aboutsummaryrefslogtreecommitdiffstats
path: root/packages/open-api/lib (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-11-29feat: Add automated bookmark backup feature (#2182)Mohamed Bassem1-0/+149
* 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-11-08feat: Add support for user uploaded files (#2100)Mohamed Bassem1-1/+5
* feat: add user file upload support for bookmarks Add a new "user-uploaded" asset type that allows users to upload and attach their own files to bookmarks from the attachment box in the bookmark preview page. Changes: - Add USER_UPLOADED asset type to database schema - Add userUploaded to zAssetTypesSchema for type safety - Update attachment permissions to allow attaching/detaching user files - Add fileName field to asset schema for displaying custom filenames - Add "Upload File" button in AttachmentBox component - Display actual filename for user-uploaded files - Allow any file type for user uploads (respects existing upload limits) - Add Upload icon for user-uploaded files Fixes #1863 related asset attachment improvements * fix: ensure fileName is returned and remove edit button for user uploads - Fix attachAsset mutation to fetch and return complete asset with fileName instead of just returning the input (which lacks fileName) - Remove replace/edit button for user-uploaded files - users can only delete and re-upload instead - This ensures the filename displays correctly in the UI immediately after upload Fixes fileName propagation issue for user-uploaded assets * fix asset file name * remove filename from attach asset api --------- Co-authored-by: Claude <noreply@anthropic.com>
2025-10-11fix(api): Return 200 when bookmark already exists instead of 200Mohamed Bassem1-1/+9
2025-10-11fix(api): Document the API for getting lists of a bookmark. fixes #2030Mohamed Bassem6-50/+90
2025-09-28feat: Add tag search and pagination (#1987)Mohamed Bassem1-1/+5
* feat: Add tag search and use in the homepage * use paginated query in the all tags view * wire the load more buttons * add skeleton to all tags page * fix attachedby aggregation * fix loading states * fix hasNextPage * use action buttons for load more buttons * migrate the tags auto complete to the search api * Migrate the tags editor to the new search API * Replace tag merging dialog with tag auto completion * Merge both search and list APIs * fix tags.list * add some tests for the endpoint * add relevance based sorting * change cursor * update the REST API * fix review comments * more fixes * fix lockfile * i18n * fix visible tags
2025-07-12feat(api): Expose the update user API in the openapi specsMohamed Bassem1-0/+100
2025-06-07docs: Add asset APIs to the openapi specMohamed Bassem2-11/+78
2025-05-18feat(api): Expose the endpoint to create a new tagMohamed Bassem1-1/+32
2025-05-18feat(api): enable ?sortOrder= for relevant resources (#1398)xuatz3-6/+30
* feat(api): enable `?sortOrder=` for relevant resources * fix tests
2025-05-17fix(api): make PUT bookmark to a list idempotent (#1427)xuatz1-8/+0
* fix(api): make duplicate PUT /lists/:id/bookmarks/:id as allowed operation * apply pr comments
2025-04-16fix: Add includeContent to search endpoint and document it in the docsMohamed Bassem4-6/+27
2025-04-13feat: Add an MCP server for karakeepMohamed Bassem5-0/+242
2025-04-12chore: Rename hoarder packages to karakeepMohamedBassem6-6/+6
2025-03-11feat: Add endpoints for whoami and user stats. Fixes #1113Mohamed Bassem1-0/+55
2025-03-09feat: Expose bookmark summarization in the API (#1088)erik-nilcoast1-0/+23
Proxy to the TRPC Summarize mutation for use in the public API
2025-01-05feat: Expose the search functionality in the REST APIMohamed Bassem1-0/+26
2025-01-04feat: Expose asset manipulation endpoints in the REST APIMohamed Bassem1-0/+92
2025-01-02feat: Add support for smart lists (#802)Mohamed Bassem1-1/+2
* feat: Add support for smart lists * i18n * Fix update list endpoint * Add a test for smart lists * Add header to the query explainer * Hide remove from lists in the smart context list * Add proper validation to list form --------- Co-authored-by: Deepak Kapoor <41769111+orthdron@users.noreply.github.com>
2024-12-30fix(api): Return 201 from highlights creation and fix docs for PATCH ↵Mohamed Bassem1-1/+1
/lists/[listId]
2024-12-27feat: Add REST APIs for manipulating highlights. Fixes #620Mohamed Bassem2-0/+185
2024-10-20api: Add tag ids and support variable baseURLMohamed Bassem3-0/+20
2024-10-20chore: Define hoarder's rest API in zod formatMohamed Bassem5-0/+586