Skip to content

Commit eb9c1bb

Browse files
feat(cli): wire the expanded v2 files surface
Regeneration picked up seven new operations (72 → 79), every one of which derived badly. `/files/move` and `/files/bulk-archive` put a verb where the deriver expects a sub-resource, so each became a group holding a lone `create`; `GET /files/[id]/share` fetches one share and was read as a collection and named `list`; and `PATCH /files/[id]` derived to `files update` while its own summary said "Rename File". Named them: batch-archive (matching tables rows batch-delete), move, rename, restore, set-content, share get, share set. Bulk archive is gated behind --yes like the other batch destructives. `files list` gained --scope active|archived, and its rows now carry folderPath — added as a column, since which folder a file sits in is what distinguishes two rows sharing a name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148a65fkPhP4N8tgGPYtRTU
1 parent d1f386b commit eb9c1bb

2 files changed

Lines changed: 286 additions & 0 deletions

File tree

packages/sim-cli/src/contract/commands.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ export const CLI_CONTRACT: CliContract = {
122122
columns: [
123123
{ header: 'id' },
124124
{ header: 'name' },
125+
// Now that files live in folders, which one is the difference between two
126+
// identically-named rows.
127+
{ header: 'folder', path: 'folderPath' },
125128
{ header: 'size', format: 'bytes' },
126129
{ header: 'type' },
127130
{ header: 'uploaded', path: 'uploadedAt', format: 'timestamp' },
@@ -200,6 +203,43 @@ export const CLI_CONTRACT: CliContract = {
200203
],
201204
},
202205

206+
// ─── The expanded files surface ───────────────────────────────────────────
207+
// Every one of these derives badly. `/files/move` and `/files/bulk-archive`
208+
// are verbs sitting where the deriver expects a sub-resource, so it made them
209+
// groups holding a lone `create`; and `GET /files/[id]/share` fetches one
210+
// share, which the deriver read as a collection and named `list`.
211+
bulkArchiveFileItems: {
212+
// `batch-` for the bulk form, matching `tables rows batch-delete`.
213+
command: 'files batch-archive',
214+
describe: 'Archive several files and folders at once',
215+
confirm: 'This archives every listed file and folder, and everything inside those folders.',
216+
},
217+
moveFileItems: {
218+
command: 'files move',
219+
describe: 'Move files and folders into another folder',
220+
},
221+
renameFile: {
222+
// Derived to `files update`, which contradicted its own summary.
223+
command: 'files rename',
224+
describe: 'Rename a file',
225+
},
226+
restoreFile: {
227+
command: 'files restore',
228+
describe: 'Restore an archived file',
229+
},
230+
updateFileContent: {
231+
command: 'files set-content',
232+
describe: 'Replace a file’s contents',
233+
},
234+
getFileShare: {
235+
command: 'files share get',
236+
describe: 'Show a file’s share settings',
237+
},
238+
upsertFileShare: {
239+
command: 'files share set',
240+
describe: 'Enable or disable sharing for a file',
241+
},
242+
203243
// ─── Documents, not records ───────────────────────────────────────────────
204244
// The payload is the artifact: `sim workflows export <id> > wf.json` has to
205245
// produce something `sim workflows import` accepts back.

0 commit comments

Comments
 (0)