improvement(api): scope folders to resource paths - #6284
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryCursor Bugbot is generating a summary for commit 3df2837. Configure here. |
Greptile SummaryThis PR replaces the standalone v2 folder API with resource-scoped, canonical-path folder operations and serializes folder resolution with related resource mutations.
Confidence Score: 5/5The PR appears safe to merge based on the eligible follow-up-review scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/folders/paths.ts | Defines canonical folder-path parsing, encoding, validation, indexing, and public path projections. |
| apps/sim/lib/folders/orchestration.ts | Adds path-addressed folder creation, relocation, and deletion while integrating tree-level mutation serialization. |
| apps/sim/lib/folders/locks.ts | Introduces transaction-scoped advisory locking keyed by workspace and folder resource type. |
| apps/sim/app/api/v2/lib/folders.ts | Centralizes path resolution, folder response projection, and mutation-error mapping for resource-scoped routes. |
| apps/sim/lib/workspace-files/orchestration/file-folder-lifecycle.ts | Coordinates file mutations with canonical folder resolution under the shared folder-tree lock. |
| apps/sim/app/api/v2/files/folders/route.ts | Exposes resource-scoped file-folder listing and path-based create, relocate, and delete operations. |
| apps/sim/app/api/v2/workflows/folders/route.ts | Adds path-based workflow-folder CRUD beneath the workflows API. |
| apps/sim/app/api/v2/knowledge/folders/route.ts | Adds path-based knowledge-folder CRUD beneath the knowledge API. |
| apps/sim/app/api/v2/tables/folders/route.ts | Adds path-based table-folder CRUD beneath the tables API. |
| apps/sim/lib/api/contracts/v2/shared.ts | Defines shared canonical-path folder request schemas and public response contracts. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Client[API client] --> ResourceAPI[Resource-scoped v2 endpoint]
ResourceAPI --> Auth[Workspace access check]
Auth --> Lock[Acquire workspace and resource-type folder lock]
Lock --> Resolve[Resolve canonical folder path]
Resolve --> Mutation[Apply folder or resource mutation]
Mutation --> DB[(Postgres)]
Mutation --> Audit[Record path-based audit event]
Mutation --> Notify[Invalidate resource views]
Reviews (3): Last reviewed commit: "fix(files): release folder lock before u..." | Re-trigger Greptile
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 6d30efa. Configure here.
Summary
folderPathfiltering and serialize path resolution with resource mutationsType of Change
Testing
Checklist