aboutsummaryrefslogtreecommitdiffstats
path: root/packages/open-api/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* feat: Add automated bookmark backup feature (#2182)Mohamed Bassem2025-11-291-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>
* feat: Add support for user uploaded files (#2100)Mohamed Bassem2025-11-081-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>
* fix(api): Return 200 when bookmark already exists instead of 200Mohamed Bassem2025-10-111-1/+9
|
* fix(api): Document the API for getting lists of a bookmark. fixes #2030Mohamed Bassem2025-10-116-50/+90
|
* feat: Add tag search and pagination (#1987)Mohamed Bassem2025-09-281-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
* feat(api): Expose the update user API in the openapi specsMohamed Bassem2025-07-121-0/+100
|
* docs: Add asset APIs to the openapi specMohamed Bassem2025-06-072-11/+78
|
* feat(api): Expose the endpoint to create a new tagMohamed Bassem2025-05-181-1/+32
|
* feat(api): enable ?sortOrder= for relevant resources (#1398)xuatz2025-05-183-6/+30
| | | | | * feat(api): enable `?sortOrder=` for relevant resources * fix tests
* fix(api): make PUT bookmark to a list idempotent (#1427)xuatz2025-05-171-8/+0
| | | | | * fix(api): make duplicate PUT /lists/:id/bookmarks/:id as allowed operation * apply pr comments
* fix: Add includeContent to search endpoint and document it in the docsMohamed Bassem2025-04-164-6/+27
|
* feat: Add an MCP server for karakeepMohamed Bassem2025-04-135-0/+242
|
* chore: Rename hoarder packages to karakeepMohamedBassem2025-04-126-6/+6
|
* feat: Add endpoints for whoami and user stats. Fixes #1113Mohamed Bassem2025-03-111-0/+55
|
* feat: Expose bookmark summarization in the API (#1088)erik-nilcoast2025-03-091-0/+23
| | | Proxy to the TRPC Summarize mutation for use in the public API
* feat: Expose the search functionality in the REST APIMohamed Bassem2025-01-051-0/+26
|
* feat: Expose asset manipulation endpoints in the REST APIMohamed Bassem2025-01-041-0/+92
|
* feat: Add support for smart lists (#802)Mohamed Bassem2025-01-021-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>
* fix(api): Return 201 from highlights creation and fix docs for PATCH ↵Mohamed Bassem2024-12-301-1/+1
| | | | /lists/[listId]
* feat: Add REST APIs for manipulating highlights. Fixes #620Mohamed Bassem2024-12-272-0/+185
|
* api: Add tag ids and support variable baseURLMohamed Bassem2024-10-203-0/+20
|
* chore: Define hoarder's rest API in zod formatMohamed Bassem2024-10-205-0/+586