Skip to content

feat(snippets): implement bulk export, move, and delete snippet operations API (#215) - #228

Closed
jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/bulk-snippet-operations-api-215
Closed

jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/bulk-snippet-operations-api-215

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Summary

Implements backend bulk snippet operation services and API routes (export, move, and delete) with granular per-item authorization, deduplication, partial failure resilience, and audit logging.

Key Changes

  • Bulk Snippet Operations Service (lib/bulk-snippet-service.ts):
    • Supports bulkExport (JSON and Markdown formats), bulkMove (destination folder validation and access checks), and bulkDelete (ownership/delete-permission enforcement and idempotent soft deletion).
    • Deduplicates repeated snippet IDs within a request safely.
    • Processes items independently so a single failed item (VALIDATION_ERROR, FORBIDDEN, NOT_FOUND, PROCESSING_FAILURE) never aborts valid items.
    • Prevents unauthorized metadata or snippet content disclosure on forbidden/missing items.
    • Records structured audit log entries for all bulk operations.
  • API Endpoints:
    • POST /api/snippets/bulk/export
    • POST /api/snippets/bulk/move
    • POST /api/snippets/bulk/delete
  • Automated Tests (lib/bulk-snippet-service.test.ts):
    • Covers bulk export, bulk move, bulk delete, partial success scenarios, unauthorized access protection, deduplication, folder permissions, and audit logs.

Closes #215

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@jeffrey-graham is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Bulk Snippet Operations API

1 participant