aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared-server/assetdb.ts (unfollow)
Commit message (Collapse)AuthorFilesLines
2026-02-09Revert "refactor: move assetdb to shared-server"Mohamed Bassem1-773/+0
This reverts commit a04d3c35fc9082e529a713605a038d236bb072c7.
2026-02-09refactor: move assetdb to shared-serverMohamed Bassem1-11/+23
2025-11-29feat: Add automated bookmark backup feature (#2182)Mohamed Bassem1-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>
2025-09-07feat: add gif asset type support (#1876)Drashi1-0/+2
* feat: add gif asset type support * skip inference for gis --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
2025-08-22feat: Support video uploads and attachments (#1847)Evan Sharp1-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
2025-07-06feat: Add per user storage quotaMohamed Bassem1-32/+21
2025-07-04feat: Add support for S3 as an asset storage layer (#1703)Mohamed Bassem1-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
2025-03-29feat: Allow storing assets in a separate directory. Fixes #1091Mohamed Bassem1-1/+1
2025-02-17feat: Add PDF screenshot generation and display (#995)Ahmad Mujahid1-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>
2025-02-01deps: Upgrade typescript to 5.7Mohamed Bassem1-1/+4
2025-01-11feat: Add support for singlefile extension uploads. #172Mohamed Bassem1-0/+7
2025-01-05refactor: Implement file streaming for asset route. Fixes #818Mohamed Bassem (aider)1-0/+19
2024-10-28feature: Archive videos using yt-dlp. Fixes #215 (#525)kamtschatka1-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>
2024-10-12feature: Introduce a mechanism to cleanup dangling assetsMohamedBassem1-0/+42
2024-10-06refactor: Start tracking bookmark assets in the assets tableMohamedBassem1-0/+12
2024-07-05fix: Renaming full page archive asset file doesn't work inside docker. Fixes ↵MohamedBassem1-1/+4
#273
2024-06-23feature: Automatically transfer image urls into bookmared assets. Fixes #246MohamedBassem1-3/+7
2024-06-22feature: add support for PDF links. Fixes #28 (#216)kamtschatka1-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>
2024-05-26feature: Full page archival with monolith. Fixes #132MohamedBassem1-1/+34
2024-04-20fix: Ensure that downloaded asset images are from the allowed content typesMohamedBassem1-0/+10
2024-04-20feature: Download images and screenshotsMohamedBassem1-0/+4
2024-04-11feature: Add PDF support (#88)Ahmad Mujahid1-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
2024-04-05fix: Delete user's assets when the user is deletedMohamedBassem1-0/+12
2024-03-30format: Add missing lint and format, and format the entire repoMohamedBassem1-7/+12
2024-03-19refactor: Change asset storage to be the filesystem instead of sqliteMohamedBassem1-0/+64