aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/assetdb.ts (follow)
Commit message (Collapse)AuthorAgeFilesLines
* feat: Add automated bookmark backup feature (#2182)Mohamed Bassem2025-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: Add automated bookmark backup system Implements a comprehensive automated backup feature for user bookmarks with the following capabilities: Database Schema: - Add backupSettings table to store user backup preferences (enabled, frequency, retention) - Add backups table to track backup records with status and metadata - Add BACKUP asset type for storing compressed backup files - Add migration 0066_add_backup_tables.sql Background Workers: - Implement BackupSchedulingWorker cron job (runs daily at midnight UTC) - Create BackupWorker to process individual backup jobs - Deterministic scheduling spreads backup jobs across 24 hours based on user ID hash - Support for daily and weekly backup frequencies - Automated retention cleanup to delete old backups based on user settings Export & Compression: - Reuse existing export functionality for bookmark data - Compress exports using Node.js built-in zlib (gzip level 9) - Store compressed backups as assets with proper metadata - Track backup size and bookmark count for statistics tRPC API: - backups.getSettings - Retrieve user backup configuration - backups.updateSettings - Update backup preferences - backups.list - List all user backups with metadata - backups.get - Get specific backup details - backups.delete - Delete a backup - backups.download - Download backup file (base64 encoded) - backups.triggerBackup - Manually trigger backup creation UI Components: - BackupSettings component with configuration form - Enable/disable automatic backups toggle - Frequency selection (daily/weekly) - Retention period configuration (1-365 days) - Backup list table with download and delete actions - Manual backup trigger button - Display backup stats (size, bookmark count, status) - Added backups page to settings navigation Technical Details: - Uses Restate queue system for distributed job processing - Implements idempotency keys to prevent duplicate backups - Background worker concurrency: 2 jobs at a time - 10-minute timeout for large backup exports - Proper error handling and logging throughout - Type-safe implementation with Zod schemas * refactor: simplify backup settings and asset handling - Move backup settings from separate table to user table columns - Update BackupSettings model to use static methods with users table - Remove download mutation in favor of direct asset links - Implement proper quota checks using QuotaService.checkStorageQuota - Update UI to use new property names and direct asset downloads - Update shared types to match new schema Key changes: - backupSettingsTable removed, settings now in users table - Backup downloads use direct /api/assets/{id} links - Quota properly validated before creating backup assets - Cleaner separation of concerns in tRPC models * migration * use zip instead of gzip * fix drizzle * fix settings * streaming json * remove more dead code * add e2e tests * return backup * poll for backups * more fixes * more fixes * fix test * fix UI * fix delete asset * fix ui * redirect for backup download * cleanups * fix idempotency * fix tests * add ratelimit * add error handling for background backups * i18n * model changes --------- Co-authored-by: Claude <noreply@anthropic.com>
* feat: add gif asset type support (#1876)Drashi2025-09-071-0/+2
| | | | | | | | | * feat: add gif asset type support * skip inference for gis --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
* feat: Support video uploads and attachments (#1847)Evan Sharp2025-08-221-0/+10
| | | | | | | | This commit allows the following mime types to be uploaded and attached as video assets on bookmarks. - video/mp4 - video/webm - video/x-matroska
* feat: Add per user storage quotaMohamed Bassem2025-07-061-32/+21
|
* feat: Add support for S3 as an asset storage layer (#1703)Mohamed Bassem2025-07-041-94/+576
| | | | | | | | | * feat: Add support for S3 as an asset storage layer. Fixes #305 * some minor fixes * use bulk deletion api * stream the file to s3
* feat: Allow storing assets in a separate directory. Fixes #1091Mohamed Bassem2025-03-291-1/+1
|
* feat: Add PDF screenshot generation and display (#995)Ahmad Mujahid2025-02-171-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updated pdf2json to 3.1.5 * Extract and store a screenshot from PDF files using pdf2pic * Installing graphicsmagick and ghostscript * Generate Missing PDF screenshot with tidyAssets worker for backward support * Display PDF screenshot instead of the PDF in web if it exists. * Display PDF screenshot in mobile app if exists. * Updated pnpm-lock.yaml * Removed console.log * Revert the unnecessary changes in package.json * Revert pnpm-lock changes * Prevent rendering PDF files if the screenshot is not generated * refactor: replace useEffect with useMemo for section initialization * feat: show PDF file download button and handle large PDFs by defaulting to screenshot view * feat: add file size to openapi spec * feature: Add Assets preprocessing in fix mode to admin actions * i18n: add reprocess_assets_fix_mode translation * i18n: Add missing ar translations * A bunch of fixes * Fix openspec schema --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
* deps: Upgrade typescript to 5.7Mohamed Bassem2025-02-011-1/+4
|
* feat: Add support for singlefile extension uploads. #172Mohamed Bassem2025-01-111-0/+7
|
* refactor: Implement file streaming for asset route. Fixes #818Mohamed Bassem (aider)2025-01-051-0/+19
|
* feature: Archive videos using yt-dlp. Fixes #215 (#525)kamtschatka2024-10-281-0/+16
| | | | | | | | | | | | | | | | | | | | | * Allow downloading more content from a webpage and index it #215 Added a worker that allows downloading videos depending on the environment variables refactored the code a bit added new video asset updated documentation * Some tweaks * Drop the dependency on the yt-dlp wrapper * Update openapi specs * Dont log an error when the url is not supported * Better handle supported websites that dont download anything --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
* feature: Introduce a mechanism to cleanup dangling assetsMohamedBassem2024-10-121-0/+42
|
* refactor: Start tracking bookmark assets in the assets tableMohamedBassem2024-10-061-0/+12
|
* fix: Renaming full page archive asset file doesn't work inside docker. Fixes ↵MohamedBassem2024-07-051-1/+4
| | | | #273
* feature: Automatically transfer image urls into bookmared assets. Fixes #246MohamedBassem2024-06-231-3/+7
|
* feature: add support for PDF links. Fixes #28 (#216)kamtschatka2024-06-221-6/+14
| | | | | | | | | | | | | | | | | * feature request: pdf support #28 Added a new sourceUrl column to the asset bookmarks Added transforming a link bookmark pointing at a pdf to an asset bookmark made sure the "View Original" link is also shown for asset bookmarks that have a sourceURL updated gitignore for IDEA * remove pdf parsing from the crawler * extract the http logic into its own function to avoid duplicating the post-processing actions (openai/index) * Add 5s timeout to the content type fetch --------- Co-authored-by: MohamedBassem <me@mbassem.com>
* feature: Full page archival with monolith. Fixes #132MohamedBassem2024-05-261-1/+34
|
* fix: Ensure that downloaded asset images are from the allowed content typesMohamedBassem2024-04-201-0/+10
|
* feature: Download images and screenshotsMohamedBassem2024-04-201-0/+4
|
* feature: Add PDF support (#88)Ahmad Mujahid2024-04-111-0/+1
| | | | | | | | | | | | | | | | | | | * feature: Add PDF support * fix: PDF feature enhancements * fix: Freeze expo-share-intent version to prevent breaking changes * fix: set endOfLine to auto for cross-platform development * fix: Upgrading eslint/parser and eslint-plugin to 7.6.0 to solve the linting issues * fix: enhancing PDF feature * fix: Allowing null in fiename for backward compatibility * fix: update pnpm file with pnpm 9.0.0-alpha-8 * fix:(web): PDF Preview for web
* fix: Delete user's assets when the user is deletedMohamedBassem2024-04-051-0/+12
|
* format: Add missing lint and format, and format the entire repoMohamedBassem2024-03-301-7/+12
|
* refactor: Change asset storage to be the filesystem instead of sqliteMohamedBassem2024-03-191-0/+64