sim 2.2.13-preview.230.1 → 2.2.13-preview.232.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,10 @@ export declare function saveToFile(body: ReadableStream<Uint8Array>, target: str
22
22
  export declare function streamToStdout(body: ReadableStream<Uint8Array>, output?: NodeJS.WriteStream): Promise<void>;
23
23
  /** Returns whether content can be written directly to an interactive terminal. */
24
24
  export declare function isTerminalSafeContentType(contentType: string | null): boolean;
25
+ /** Owner-specific selection uses the same bounded transfer and atomic output path as file reads. */
26
+ export declare function attachProjectFileDownload(files: Command): void;
27
+ /** Snapshot text comes from the caller's file reader, including the embedded workbench boundary. */
28
+ export declare function attachProjectFileSnapshotExport(files: Command): void;
25
29
  export declare function attachFileGet(files: Command): void;
26
30
  export declare function attachFileVersionDownload(versions: Command): void;
27
31
  /** Project source downloads share transfer protections without selecting a workspace. */
@@ -1345,6 +1345,64 @@ type CompleteTableImportResponseRef4 = {
1345
1345
  export type CompleteTableImportResponse = {
1346
1346
  data: CompleteTableImportResponseRef4;
1347
1347
  };
1348
+ /** `POST /api/v2/files/copy` */
1349
+ export type CopyFileItemsQuery = Record<string, unknown>;
1350
+ export type CopyFileItemsBody = {
1351
+ source: {
1352
+ owner: {
1353
+ entityType: 'workspace' | 'project';
1354
+ entityId: string;
1355
+ };
1356
+ fileIds?: Array<string>;
1357
+ folderIds?: Array<string>;
1358
+ };
1359
+ destination: {
1360
+ owner: {
1361
+ entityType: 'workspace' | 'project';
1362
+ entityId: string;
1363
+ };
1364
+ folderId?: string | null;
1365
+ };
1366
+ };
1367
+ export type CopyFileItemsResponse = {
1368
+ data: {
1369
+ files: Array<{
1370
+ id: string;
1371
+ name: string;
1372
+ size: number;
1373
+ type: string;
1374
+ width?: number | null;
1375
+ height?: number | null;
1376
+ uploadedBy: string;
1377
+ folderId: string | null;
1378
+ folderPath?: string | null;
1379
+ deletedAt: string | null;
1380
+ uploadedAt: string;
1381
+ updatedAt: string;
1382
+ contentUpdatedAt: string | null;
1383
+ revision: string;
1384
+ owner: {
1385
+ entityType: 'workspace' | 'project';
1386
+ entityId: string;
1387
+ };
1388
+ }>;
1389
+ folders: Array<{
1390
+ id: string;
1391
+ userId: string;
1392
+ name: string;
1393
+ parentId: string | null;
1394
+ path: string;
1395
+ sortOrder: number;
1396
+ deletedAt: string | null;
1397
+ createdAt: string;
1398
+ updatedAt: string;
1399
+ owner: {
1400
+ entityType: 'workspace' | 'project';
1401
+ entityId: string;
1402
+ };
1403
+ }>;
1404
+ };
1405
+ };
1348
1406
  /** `POST /api/v2/credentials/connections` */
1349
1407
  export type CreateCredentialConnectionQuery = Record<string, unknown>;
1350
1408
  export type CreateCredentialConnectionBody = {
@@ -3593,6 +3651,16 @@ export type DownloadFileVersionQuery = {
3593
3651
  };
3594
3652
  /** Non-JSON response (`binary`). */
3595
3653
  export type DownloadFileVersionResponse = never;
3654
+ /** `GET /api/v2/projects/[projectId]/files/bulk-download` */
3655
+ export type DownloadProjectFileItemsParams = {
3656
+ projectId: string;
3657
+ };
3658
+ export type DownloadProjectFileItemsQuery = {
3659
+ fileIds?: string;
3660
+ folderIds?: string;
3661
+ };
3662
+ /** Non-JSON response (`binary`). */
3663
+ export type DownloadProjectFileItemsResponse = never;
3596
3664
  /** `GET /api/v2/workflows/[workflowId]/runs/[runId]/files/[fileId]` */
3597
3665
  export type DownloadRunFileParams = {
3598
3666
  workflowId: string;
@@ -3775,6 +3843,17 @@ export type ExportKnowledgeBaseQuery = {
3775
3843
  };
3776
3844
  /** Non-JSON response (`binary`). */
3777
3845
  export type ExportKnowledgeBaseResponse = never;
3846
+ /** `POST /api/v2/projects/[projectId]/files/[fileId]/export` */
3847
+ export type ExportProjectFileSnapshotParams = {
3848
+ projectId: string;
3849
+ fileId: string;
3850
+ };
3851
+ export type ExportProjectFileSnapshotQuery = Record<string, unknown>;
3852
+ export type ExportProjectFileSnapshotBody = {
3853
+ content: string;
3854
+ };
3855
+ /** Non-JSON response (`binary`). */
3856
+ export type ExportProjectFileSnapshotResponse = never;
3778
3857
  /** `GET /api/v2/workflows/[workflowId]/export` */
3779
3858
  export type ExportWorkflowParams = {
3780
3859
  workflowId: string;
@@ -4824,6 +4903,26 @@ type GetProjectFileMetadataResponseRef0 = {
4824
4903
  export type GetProjectFileMetadataResponse = {
4825
4904
  data: GetProjectFileMetadataResponseRef0;
4826
4905
  };
4906
+ /** `GET /api/v2/projects/[projectId]/files/[fileId]/share` */
4907
+ export type GetProjectFileShareParams = {
4908
+ projectId: string;
4909
+ fileId: string;
4910
+ };
4911
+ export type GetProjectFileShareQuery = Record<string, unknown>;
4912
+ type GetProjectFileShareResponseRef0 = {
4913
+ id: string;
4914
+ token: string;
4915
+ url: string;
4916
+ isActive: boolean;
4917
+ resourceType: 'file' | 'folder';
4918
+ resourceId: string;
4919
+ authType: 'public' | 'password' | 'email' | 'sso';
4920
+ hasPassword: boolean;
4921
+ allowedEmails: Array<string>;
4922
+ };
4923
+ export type GetProjectFileShareResponse = {
4924
+ data: GetProjectFileShareResponseRef0 | null;
4925
+ };
4827
4926
  /** `GET /api/v2/projects/[projectId]/files/uploads/[uploadId]` */
4828
4927
  export type GetProjectFileUploadParams = {
4829
4928
  projectId: string;
@@ -10147,6 +10246,21 @@ type UnzipFileResponseRef0 = {
10147
10246
  export type UnzipFileResponse = {
10148
10247
  data: UnzipFileResponseRef0;
10149
10248
  };
10249
+ /** `POST /api/v2/projects/[projectId]/files/[fileId]/unzip` */
10250
+ export type UnzipProjectFileParams = {
10251
+ projectId: string;
10252
+ fileId: string;
10253
+ };
10254
+ export type UnzipProjectFileQuery = Record<string, unknown>;
10255
+ type UnzipProjectFileResponseRef0 = UnzipProjectFileResponseRef1;
10256
+ type UnzipProjectFileResponseRef1 = {
10257
+ folderPath: string;
10258
+ extractedFileCount: number;
10259
+ skippedFileCount: number;
10260
+ };
10261
+ export type UnzipProjectFileResponse = {
10262
+ data: UnzipProjectFileResponseRef0;
10263
+ };
10150
10264
  /** `PATCH /api/v2/credentials/[credentialId]` */
10151
10265
  export type UpdateCredentialParams = {
10152
10266
  credentialId: string;
@@ -10749,6 +10863,32 @@ export type UpdateProjectFileFolderResponse = {
10749
10863
  };
10750
10864
  };
10751
10865
  };
10866
+ /** `PATCH /api/v2/projects/[projectId]/files/[fileId]/share` */
10867
+ export type UpdateProjectFileShareParams = {
10868
+ projectId: string;
10869
+ fileId: string;
10870
+ };
10871
+ export type UpdateProjectFileShareQuery = Record<string, unknown>;
10872
+ export type UpdateProjectFileShareBody = {
10873
+ isActive: boolean;
10874
+ authType?: 'public' | 'password' | 'email' | 'sso';
10875
+ password?: string;
10876
+ allowedEmails?: Array<string>;
10877
+ };
10878
+ type UpdateProjectFileShareResponseRef0 = {
10879
+ id: string;
10880
+ token: string;
10881
+ url: string;
10882
+ isActive: boolean;
10883
+ resourceType: 'file' | 'folder';
10884
+ resourceId: string;
10885
+ authType: 'public' | 'password' | 'email' | 'sso';
10886
+ hasPassword: boolean;
10887
+ allowedEmails: Array<string>;
10888
+ };
10889
+ export type UpdateProjectFileShareResponse = {
10890
+ data: UpdateProjectFileShareResponseRef0;
10891
+ };
10752
10892
  /** `PATCH /api/v2/tables/[tableId]/rows` */
10753
10893
  export type UpdateRowsByFilterParams = {
10754
10894
  tableId: string;
@@ -12139,6 +12279,26 @@ export declare const V2_OPERATIONS: {
12139
12279
  };
12140
12280
  };
12141
12281
  };
12282
+ readonly copyFileItems: {
12283
+ readonly method: 'POST';
12284
+ readonly path: '/api/v2/files/copy';
12285
+ readonly pathParams: readonly [];
12286
+ readonly responseMode: 'json';
12287
+ readonly summary: 'Copy File Items';
12288
+ readonly workspaceKeyUnsupported: true;
12289
+ readonly body: {
12290
+ readonly source: {
12291
+ readonly kind: 'object';
12292
+ readonly required: true;
12293
+ readonly describe: 'Selection to read under the source owner.';
12294
+ };
12295
+ readonly destination: {
12296
+ readonly kind: 'object';
12297
+ readonly required: true;
12298
+ readonly describe: 'Destination requiring file write access.';
12299
+ };
12300
+ };
12301
+ };
12142
12302
  readonly createCredentialConnection: {
12143
12303
  readonly method: 'POST';
12144
12304
  readonly path: '/api/v2/credentials/connections';
@@ -14008,6 +14168,27 @@ export declare const V2_OPERATIONS: {
14008
14168
  };
14009
14169
  };
14010
14170
  };
14171
+ readonly downloadProjectFileItems: {
14172
+ readonly method: 'GET';
14173
+ readonly path: '/api/v2/projects/[projectId]/files/bulk-download';
14174
+ readonly pathParams: readonly ['projectId'];
14175
+ readonly pathParamDocs: {
14176
+ readonly projectId: 'Project identifier.';
14177
+ };
14178
+ readonly responseMode: 'binary';
14179
+ readonly summary: 'Download Project File Items';
14180
+ readonly workspaceKeyUnsupported: true;
14181
+ readonly query: {
14182
+ readonly fileIds: {
14183
+ readonly kind: 'string';
14184
+ readonly describe: 'File identifiers to include, comma-separated. At most 100 entries.';
14185
+ };
14186
+ readonly folderIds: {
14187
+ readonly kind: 'string';
14188
+ readonly describe: 'Folder identifiers to include recursively, comma-separated. The resolved selection allows at most 100 files.';
14189
+ };
14190
+ };
14191
+ };
14011
14192
  readonly downloadRunFile: {
14012
14193
  readonly method: 'GET';
14013
14194
  readonly path: '/api/v2/workflows/[workflowId]/runs/[runId]/files/[fileId]';
@@ -14184,6 +14365,25 @@ export declare const V2_OPERATIONS: {
14184
14365
  };
14185
14366
  };
14186
14367
  };
14368
+ readonly exportProjectFileSnapshot: {
14369
+ readonly method: 'POST';
14370
+ readonly path: '/api/v2/projects/[projectId]/files/[fileId]/export';
14371
+ readonly pathParams: readonly ['projectId', 'fileId'];
14372
+ readonly pathParamDocs: {
14373
+ readonly projectId: 'Project identifier.';
14374
+ readonly fileId: 'File identifier within the Project.';
14375
+ };
14376
+ readonly responseMode: 'binary';
14377
+ readonly summary: 'Export Project File Snapshot';
14378
+ readonly workspaceKeyUnsupported: true;
14379
+ readonly body: {
14380
+ readonly content: {
14381
+ readonly kind: 'string';
14382
+ readonly required: true;
14383
+ readonly describe: 'Visible Markdown snapshot to export. This does not replace the stored file or create a version.';
14384
+ };
14385
+ };
14386
+ };
14187
14387
  readonly exportWorkflow: {
14188
14388
  readonly method: 'GET';
14189
14389
  readonly path: '/api/v2/workflows/[workflowId]/export';
@@ -14726,6 +14926,18 @@ export declare const V2_OPERATIONS: {
14726
14926
  readonly summary: 'Get Project File Metadata';
14727
14927
  readonly workspaceKeyUnsupported: true;
14728
14928
  };
14929
+ readonly getProjectFileShare: {
14930
+ readonly method: 'GET';
14931
+ readonly path: '/api/v2/projects/[projectId]/files/[fileId]/share';
14932
+ readonly pathParams: readonly ['projectId', 'fileId'];
14933
+ readonly pathParamDocs: {
14934
+ readonly projectId: 'Project identifier.';
14935
+ readonly fileId: 'File identifier within the Project.';
14936
+ };
14937
+ readonly responseMode: 'json';
14938
+ readonly summary: 'Get Project File Share';
14939
+ readonly workspaceKeyUnsupported: true;
14940
+ };
14729
14941
  readonly getProjectFileUpload: {
14730
14942
  readonly method: 'GET';
14731
14943
  readonly path: '/api/v2/projects/[projectId]/files/uploads/[uploadId]';
@@ -19407,6 +19619,18 @@ export declare const V2_OPERATIONS: {
19407
19619
  };
19408
19620
  };
19409
19621
  };
19622
+ readonly unzipProjectFile: {
19623
+ readonly method: 'POST';
19624
+ readonly path: '/api/v2/projects/[projectId]/files/[fileId]/unzip';
19625
+ readonly pathParams: readonly ['projectId', 'fileId'];
19626
+ readonly pathParamDocs: {
19627
+ readonly projectId: 'Project identifier.';
19628
+ readonly fileId: 'File identifier within the Project.';
19629
+ };
19630
+ readonly responseMode: 'json';
19631
+ readonly summary: 'Unzip Project File';
19632
+ readonly workspaceKeyUnsupported: true;
19633
+ };
19410
19634
  readonly updateCredential: {
19411
19635
  readonly method: 'PATCH';
19412
19636
  readonly path: '/api/v2/credentials/[credentialId]';
@@ -20041,6 +20265,38 @@ export declare const V2_OPERATIONS: {
20041
20265
  };
20042
20266
  };
20043
20267
  };
20268
+ readonly updateProjectFileShare: {
20269
+ readonly method: 'PATCH';
20270
+ readonly path: '/api/v2/projects/[projectId]/files/[fileId]/share';
20271
+ readonly pathParams: readonly ['projectId', 'fileId'];
20272
+ readonly pathParamDocs: {
20273
+ readonly projectId: 'Project identifier.';
20274
+ readonly fileId: 'File identifier within the Project.';
20275
+ };
20276
+ readonly responseMode: 'json';
20277
+ readonly summary: 'Update Project File Share';
20278
+ readonly workspaceKeyUnsupported: true;
20279
+ readonly body: {
20280
+ readonly isActive: {
20281
+ readonly kind: 'boolean';
20282
+ readonly required: true;
20283
+ readonly describe: 'Whether the share should resolve. Disabling preserves the token and the whole access configuration, so re-enabling restores the share as it was; enabling rewrites the credentials the resulting mode does not use.';
20284
+ };
20285
+ readonly authType: {
20286
+ readonly kind: 'enum';
20287
+ readonly values: readonly ['public', 'password', 'email', 'sso'];
20288
+ readonly describe: 'How access to the share is gated. The stored mode is kept when omitted. Enabling `public` clears the stored password and empties `allowedEmails`; `password` empties `allowedEmails`; `email` and `sso` clear the stored password.';
20289
+ };
20290
+ readonly password: {
20291
+ readonly kind: 'string';
20292
+ readonly describe: 'Literal password of 15 to 1024 characters. Kept when omitted; enabling password access without a supplied or stored password is rejected.';
20293
+ };
20294
+ readonly allowedEmails: {
20295
+ readonly kind: 'array';
20296
+ readonly describe: 'Allowed addresses or `@domain` patterns for email and SSO shares. Kept when omitted; enabling `email` or `sso` with an empty resulting list is a 400.';
20297
+ };
20298
+ };
20299
+ };
20044
20300
  readonly updateRowsByFilter: {
20045
20301
  readonly method: 'PATCH';
20046
20302
  readonly path: '/api/v2/tables/[tableId]/rows';
package/dist/index.js CHANGED
@@ -10143,6 +10143,26 @@ var V2_OPERATIONS = {
10143
10143
  }
10144
10144
  }
10145
10145
  },
10146
+ copyFileItems: {
10147
+ method: "POST",
10148
+ path: "/api/v2/files/copy",
10149
+ pathParams: [],
10150
+ responseMode: "json",
10151
+ summary: "Copy File Items",
10152
+ workspaceKeyUnsupported: true,
10153
+ body: {
10154
+ source: {
10155
+ kind: "object",
10156
+ required: true,
10157
+ describe: "Selection to read under the source owner."
10158
+ },
10159
+ destination: {
10160
+ kind: "object",
10161
+ required: true,
10162
+ describe: "Destination requiring file write access."
10163
+ }
10164
+ }
10165
+ },
10146
10166
  createCredentialConnection: {
10147
10167
  method: "POST",
10148
10168
  path: "/api/v2/credentials/connections",
@@ -11736,6 +11756,25 @@ var V2_OPERATIONS = {
11736
11756
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
11737
11757
  }
11738
11758
  },
11759
+ downloadProjectFileItems: {
11760
+ method: "GET",
11761
+ path: "/api/v2/projects/[projectId]/files/bulk-download",
11762
+ pathParams: ["projectId"],
11763
+ pathParamDocs: { projectId: "Project identifier." },
11764
+ responseMode: "binary",
11765
+ summary: "Download Project File Items",
11766
+ workspaceKeyUnsupported: true,
11767
+ query: {
11768
+ fileIds: {
11769
+ kind: "string",
11770
+ describe: "File identifiers to include, comma-separated. At most 100 entries."
11771
+ },
11772
+ folderIds: {
11773
+ kind: "string",
11774
+ describe: "Folder identifiers to include recursively, comma-separated. The resolved selection allows at most 100 files."
11775
+ }
11776
+ }
11777
+ },
11739
11778
  downloadRunFile: {
11740
11779
  method: "GET",
11741
11780
  path: "/api/v2/workflows/[workflowId]/runs/[runId]/files/[fileId]",
@@ -11900,6 +11939,25 @@ var V2_OPERATIONS = {
11900
11939
  }
11901
11940
  }
11902
11941
  },
11942
+ exportProjectFileSnapshot: {
11943
+ method: "POST",
11944
+ path: "/api/v2/projects/[projectId]/files/[fileId]/export",
11945
+ pathParams: ["projectId", "fileId"],
11946
+ pathParamDocs: {
11947
+ projectId: "Project identifier.",
11948
+ fileId: "File identifier within the Project."
11949
+ },
11950
+ responseMode: "binary",
11951
+ summary: "Export Project File Snapshot",
11952
+ workspaceKeyUnsupported: true,
11953
+ body: {
11954
+ content: {
11955
+ kind: "string",
11956
+ required: true,
11957
+ describe: "Visible Markdown snapshot to export. This does not replace the stored file or create a version."
11958
+ }
11959
+ }
11960
+ },
11903
11961
  exportWorkflow: {
11904
11962
  method: "GET",
11905
11963
  path: "/api/v2/workflows/[workflowId]/export",
@@ -12407,6 +12465,18 @@ var V2_OPERATIONS = {
12407
12465
  summary: "Get Project File Metadata",
12408
12466
  workspaceKeyUnsupported: true
12409
12467
  },
12468
+ getProjectFileShare: {
12469
+ method: "GET",
12470
+ path: "/api/v2/projects/[projectId]/files/[fileId]/share",
12471
+ pathParams: ["projectId", "fileId"],
12472
+ pathParamDocs: {
12473
+ projectId: "Project identifier.",
12474
+ fileId: "File identifier within the Project."
12475
+ },
12476
+ responseMode: "json",
12477
+ summary: "Get Project File Share",
12478
+ workspaceKeyUnsupported: true
12479
+ },
12410
12480
  getProjectFileUpload: {
12411
12481
  method: "GET",
12412
12482
  path: "/api/v2/projects/[projectId]/files/uploads/[uploadId]",
@@ -16995,6 +17065,18 @@ var V2_OPERATIONS = {
16995
17065
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the archive." }
16996
17066
  }
16997
17067
  },
17068
+ unzipProjectFile: {
17069
+ method: "POST",
17070
+ path: "/api/v2/projects/[projectId]/files/[fileId]/unzip",
17071
+ pathParams: ["projectId", "fileId"],
17072
+ pathParamDocs: {
17073
+ projectId: "Project identifier.",
17074
+ fileId: "File identifier within the Project."
17075
+ },
17076
+ responseMode: "json",
17077
+ summary: "Unzip Project File",
17078
+ workspaceKeyUnsupported: true
17079
+ },
16998
17080
  updateCredential: {
16999
17081
  method: "PATCH",
17000
17082
  path: "/api/v2/credentials/[credentialId]",
@@ -17466,6 +17548,38 @@ var V2_OPERATIONS = {
17466
17548
  sortOrder: { kind: "integer", describe: "New manual position; omit to leave unchanged." }
17467
17549
  }
17468
17550
  },
17551
+ updateProjectFileShare: {
17552
+ method: "PATCH",
17553
+ path: "/api/v2/projects/[projectId]/files/[fileId]/share",
17554
+ pathParams: ["projectId", "fileId"],
17555
+ pathParamDocs: {
17556
+ projectId: "Project identifier.",
17557
+ fileId: "File identifier within the Project."
17558
+ },
17559
+ responseMode: "json",
17560
+ summary: "Update Project File Share",
17561
+ workspaceKeyUnsupported: true,
17562
+ body: {
17563
+ isActive: {
17564
+ kind: "boolean",
17565
+ required: true,
17566
+ describe: "Whether the share should resolve. Disabling preserves the token and the whole access configuration, so re-enabling restores the share as it was; enabling rewrites the credentials the resulting mode does not use."
17567
+ },
17568
+ authType: {
17569
+ kind: "enum",
17570
+ values: ["public", "password", "email", "sso"],
17571
+ describe: "How access to the share is gated. The stored mode is kept when omitted. Enabling `public` clears the stored password and empties `allowedEmails`; `password` empties `allowedEmails`; `email` and `sso` clear the stored password."
17572
+ },
17573
+ password: {
17574
+ kind: "string",
17575
+ describe: "Literal password of 15 to 1024 characters. Kept when omitted; enabling password access without a supplied or stored password is rejected."
17576
+ },
17577
+ allowedEmails: {
17578
+ kind: "array",
17579
+ describe: "Allowed addresses or `@domain` patterns for email and SSO shares. Kept when omitted; enabling `email` or `sso` with an empty resulting list is a 400."
17580
+ }
17581
+ }
17582
+ },
17469
17583
  updateRowsByFilter: {
17470
17584
  method: "PATCH",
17471
17585
  path: "/api/v2/tables/[tableId]/rows",
@@ -19301,6 +19415,13 @@ var CLI_CONTRACT = {
19301
19415
  }
19302
19416
  }
19303
19417
  },
19418
+ copyFileItems: {
19419
+ command: "files copy",
19420
+ flags: {
19421
+ source: { json: true, describe: "Source owner and selected fileIds or folderIds" },
19422
+ destination: { json: true, describe: "Destination owner and optional folderId" }
19423
+ }
19424
+ },
19304
19425
  renameProjectFile: { command: "projects files rename" },
19305
19426
  listProjectFileFolders: {
19306
19427
  command: "projects files folders list",
@@ -20136,6 +20257,11 @@ var CLI_CONTRACT = {
20136
20257
  describe: "Unzip an archive into a new folder beside it",
20137
20258
  confirm: "This writes every file in the archive into the workspace."
20138
20259
  },
20260
+ unzipProjectFile: {
20261
+ command: "projects files unzip",
20262
+ describe: "Unzip an archive into a new folder beside it in the Project",
20263
+ confirm: "This writes every file in the archive into the Project."
20264
+ },
20139
20265
  bulkDownloadFiles: {
20140
20266
  command: "files bulk-download",
20141
20267
  describe: "Download files and folders as a zip archive",
@@ -20144,6 +20270,18 @@ var CLI_CONTRACT = {
20144
20270
  folderPaths: FOLDER_PATHS_FLAG
20145
20271
  }
20146
20272
  },
20273
+ downloadProjectFileItems: {
20274
+ command: "projects files bulk-download",
20275
+ describe: "Download Project files and folders as a zip archive",
20276
+ flags: {
20277
+ fileIds: { list: true },
20278
+ folderIds: { list: true }
20279
+ }
20280
+ },
20281
+ exportProjectFileSnapshot: {
20282
+ command: "projects files export",
20283
+ describe: "Export a visible Project Markdown snapshot with its embedded assets"
20284
+ },
20147
20285
  editFileContent: {
20148
20286
  command: "files edit",
20149
20287
  describe: "Apply one exact or anchor-based edit to a text file",
@@ -20163,6 +20301,11 @@ var CLI_CONTRACT = {
20163
20301
  describe: "Show a file’s share settings",
20164
20302
  fields: FILE_SHARE_FIELDS
20165
20303
  },
20304
+ getProjectFileShare: {
20305
+ command: "projects files share get",
20306
+ describe: "Show a Project file’s share settings",
20307
+ fields: FILE_SHARE_FIELDS
20308
+ },
20166
20309
  upsertFileShare: {
20167
20310
  command: "files share set",
20168
20311
  describe: "Enable or disable sharing for a file",
@@ -20171,6 +20314,14 @@ var CLI_CONTRACT = {
20171
20314
  },
20172
20315
  fields: FILE_SHARE_FIELDS
20173
20316
  },
20317
+ updateProjectFileShare: {
20318
+ command: "projects files share set",
20319
+ describe: "Enable or disable sharing for a Project file",
20320
+ flags: {
20321
+ allowedEmails: { list: true }
20322
+ },
20323
+ fields: FILE_SHARE_FIELDS
20324
+ },
20174
20325
  listFileFolders: {
20175
20326
  describe: "List folders",
20176
20327
  aliases: ["ls"],
@@ -22777,6 +22928,22 @@ async function downloadToOutput(connect, operation, pathParams, options, scope,
22777
22928
  status: "saved"
22778
22929
  });
22779
22930
  }
22931
+ function attachProjectFileDownload(files) {
22932
+ const [command, connect] = apiCommand(files, "bulk-download", ["downloadProjectFileItems"]);
22933
+ command.argument("<projectId>", "Project that owns the files").allowExcessArguments(false).description(describeOperation(V2_OPERATIONS.downloadProjectFileItems, "Download Project files and recursive folder contents as a zip archive")).option("--file-ids <id...>", "File identifiers to include").option("--folder-ids <id...>", "Folder identifiers to include recursively").option("-o, --output-file <path>", "Write the archive to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (projectId, options) => {
22934
+ const input = await buildRequest("downloadProjectFileItems", [projectId], { ...options }, null);
22935
+ await downloadToOutput(connect, "downloadProjectFileItems", { projectId }, options, "owner", {
22936
+ query: input.query
22937
+ });
22938
+ });
22939
+ }
22940
+ function attachProjectFileSnapshotExport(files) {
22941
+ const [command, connect] = apiCommand(files, "export", ["exportProjectFileSnapshot"]);
22942
+ command.argument("<projectId>", "Project that owns the file").argument("<fileId>", "Markdown file whose visible snapshot to export").allowExcessArguments(false).description(describeOperation(V2_OPERATIONS.exportProjectFileSnapshot, "Export a visible Project Markdown snapshot with its embedded assets")).requiredOption("--content <text|@file|@->", "Visible Markdown content or a file to read").option("-o, --output-file <path>", "Write the export to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (projectId, fileId, options) => {
22943
+ const source = await readArgumentSource(options.content, "content");
22944
+ await downloadToOutput(connect, "exportProjectFileSnapshot", { projectId, fileId }, options, "owner", { body: { content: source.text } });
22945
+ });
22946
+ }
22780
22947
  function attachFileGet(files) {
22781
22948
  const [command, connect] = apiCommand(files, "get", ["downloadFile"]);
22782
22949
  command.argument("<fileId>", "File whose content to read").allowExcessArguments(false).description("Download a file’s content to stdout or a local file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, options) => downloadToOutput(connect, "downloadFile", { fileId }, options, "workspace"));
@@ -24228,6 +24395,8 @@ function attachProtocolCommands(program) {
24228
24395
  const projectFiles = group(group(program, "projects"), "files");
24229
24396
  attachProjectFileUpload(projectFiles);
24230
24397
  attachProjectFileSource(projectFiles);
24398
+ attachProjectFileDownload(projectFiles);
24399
+ attachProjectFileSnapshotExport(projectFiles);
24231
24400
  attachProjectFileVersionSource(group(projectFiles, "versions"));
24232
24401
  const files = group(program, "files");
24233
24402
  attachFileUpload(files);
package/dist/runtime.js CHANGED
@@ -10192,6 +10192,26 @@ var V2_OPERATIONS = {
10192
10192
  }
10193
10193
  }
10194
10194
  },
10195
+ copyFileItems: {
10196
+ method: "POST",
10197
+ path: "/api/v2/files/copy",
10198
+ pathParams: [],
10199
+ responseMode: "json",
10200
+ summary: "Copy File Items",
10201
+ workspaceKeyUnsupported: true,
10202
+ body: {
10203
+ source: {
10204
+ kind: "object",
10205
+ required: true,
10206
+ describe: "Selection to read under the source owner."
10207
+ },
10208
+ destination: {
10209
+ kind: "object",
10210
+ required: true,
10211
+ describe: "Destination requiring file write access."
10212
+ }
10213
+ }
10214
+ },
10195
10215
  createCredentialConnection: {
10196
10216
  method: "POST",
10197
10217
  path: "/api/v2/credentials/connections",
@@ -11785,6 +11805,25 @@ var V2_OPERATIONS = {
11785
11805
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the file." }
11786
11806
  }
11787
11807
  },
11808
+ downloadProjectFileItems: {
11809
+ method: "GET",
11810
+ path: "/api/v2/projects/[projectId]/files/bulk-download",
11811
+ pathParams: ["projectId"],
11812
+ pathParamDocs: { projectId: "Project identifier." },
11813
+ responseMode: "binary",
11814
+ summary: "Download Project File Items",
11815
+ workspaceKeyUnsupported: true,
11816
+ query: {
11817
+ fileIds: {
11818
+ kind: "string",
11819
+ describe: "File identifiers to include, comma-separated. At most 100 entries."
11820
+ },
11821
+ folderIds: {
11822
+ kind: "string",
11823
+ describe: "Folder identifiers to include recursively, comma-separated. The resolved selection allows at most 100 files."
11824
+ }
11825
+ }
11826
+ },
11788
11827
  downloadRunFile: {
11789
11828
  method: "GET",
11790
11829
  path: "/api/v2/workflows/[workflowId]/runs/[runId]/files/[fileId]",
@@ -11949,6 +11988,25 @@ var V2_OPERATIONS = {
11949
11988
  }
11950
11989
  }
11951
11990
  },
11991
+ exportProjectFileSnapshot: {
11992
+ method: "POST",
11993
+ path: "/api/v2/projects/[projectId]/files/[fileId]/export",
11994
+ pathParams: ["projectId", "fileId"],
11995
+ pathParamDocs: {
11996
+ projectId: "Project identifier.",
11997
+ fileId: "File identifier within the Project."
11998
+ },
11999
+ responseMode: "binary",
12000
+ summary: "Export Project File Snapshot",
12001
+ workspaceKeyUnsupported: true,
12002
+ body: {
12003
+ content: {
12004
+ kind: "string",
12005
+ required: true,
12006
+ describe: "Visible Markdown snapshot to export. This does not replace the stored file or create a version."
12007
+ }
12008
+ }
12009
+ },
11952
12010
  exportWorkflow: {
11953
12011
  method: "GET",
11954
12012
  path: "/api/v2/workflows/[workflowId]/export",
@@ -12456,6 +12514,18 @@ var V2_OPERATIONS = {
12456
12514
  summary: "Get Project File Metadata",
12457
12515
  workspaceKeyUnsupported: true
12458
12516
  },
12517
+ getProjectFileShare: {
12518
+ method: "GET",
12519
+ path: "/api/v2/projects/[projectId]/files/[fileId]/share",
12520
+ pathParams: ["projectId", "fileId"],
12521
+ pathParamDocs: {
12522
+ projectId: "Project identifier.",
12523
+ fileId: "File identifier within the Project."
12524
+ },
12525
+ responseMode: "json",
12526
+ summary: "Get Project File Share",
12527
+ workspaceKeyUnsupported: true
12528
+ },
12459
12529
  getProjectFileUpload: {
12460
12530
  method: "GET",
12461
12531
  path: "/api/v2/projects/[projectId]/files/uploads/[uploadId]",
@@ -17044,6 +17114,18 @@ var V2_OPERATIONS = {
17044
17114
  workspaceId: { kind: "string", required: true, describe: "Workspace that owns the archive." }
17045
17115
  }
17046
17116
  },
17117
+ unzipProjectFile: {
17118
+ method: "POST",
17119
+ path: "/api/v2/projects/[projectId]/files/[fileId]/unzip",
17120
+ pathParams: ["projectId", "fileId"],
17121
+ pathParamDocs: {
17122
+ projectId: "Project identifier.",
17123
+ fileId: "File identifier within the Project."
17124
+ },
17125
+ responseMode: "json",
17126
+ summary: "Unzip Project File",
17127
+ workspaceKeyUnsupported: true
17128
+ },
17047
17129
  updateCredential: {
17048
17130
  method: "PATCH",
17049
17131
  path: "/api/v2/credentials/[credentialId]",
@@ -17515,6 +17597,38 @@ var V2_OPERATIONS = {
17515
17597
  sortOrder: { kind: "integer", describe: "New manual position; omit to leave unchanged." }
17516
17598
  }
17517
17599
  },
17600
+ updateProjectFileShare: {
17601
+ method: "PATCH",
17602
+ path: "/api/v2/projects/[projectId]/files/[fileId]/share",
17603
+ pathParams: ["projectId", "fileId"],
17604
+ pathParamDocs: {
17605
+ projectId: "Project identifier.",
17606
+ fileId: "File identifier within the Project."
17607
+ },
17608
+ responseMode: "json",
17609
+ summary: "Update Project File Share",
17610
+ workspaceKeyUnsupported: true,
17611
+ body: {
17612
+ isActive: {
17613
+ kind: "boolean",
17614
+ required: true,
17615
+ describe: "Whether the share should resolve. Disabling preserves the token and the whole access configuration, so re-enabling restores the share as it was; enabling rewrites the credentials the resulting mode does not use."
17616
+ },
17617
+ authType: {
17618
+ kind: "enum",
17619
+ values: ["public", "password", "email", "sso"],
17620
+ describe: "How access to the share is gated. The stored mode is kept when omitted. Enabling `public` clears the stored password and empties `allowedEmails`; `password` empties `allowedEmails`; `email` and `sso` clear the stored password."
17621
+ },
17622
+ password: {
17623
+ kind: "string",
17624
+ describe: "Literal password of 15 to 1024 characters. Kept when omitted; enabling password access without a supplied or stored password is rejected."
17625
+ },
17626
+ allowedEmails: {
17627
+ kind: "array",
17628
+ describe: "Allowed addresses or `@domain` patterns for email and SSO shares. Kept when omitted; enabling `email` or `sso` with an empty resulting list is a 400."
17629
+ }
17630
+ }
17631
+ },
17518
17632
  updateRowsByFilter: {
17519
17633
  method: "PATCH",
17520
17634
  path: "/api/v2/tables/[tableId]/rows",
@@ -19350,6 +19464,13 @@ var CLI_CONTRACT = {
19350
19464
  }
19351
19465
  }
19352
19466
  },
19467
+ copyFileItems: {
19468
+ command: "files copy",
19469
+ flags: {
19470
+ source: { json: true, describe: "Source owner and selected fileIds or folderIds" },
19471
+ destination: { json: true, describe: "Destination owner and optional folderId" }
19472
+ }
19473
+ },
19353
19474
  renameProjectFile: { command: "projects files rename" },
19354
19475
  listProjectFileFolders: {
19355
19476
  command: "projects files folders list",
@@ -20185,6 +20306,11 @@ var CLI_CONTRACT = {
20185
20306
  describe: "Unzip an archive into a new folder beside it",
20186
20307
  confirm: "This writes every file in the archive into the workspace."
20187
20308
  },
20309
+ unzipProjectFile: {
20310
+ command: "projects files unzip",
20311
+ describe: "Unzip an archive into a new folder beside it in the Project",
20312
+ confirm: "This writes every file in the archive into the Project."
20313
+ },
20188
20314
  bulkDownloadFiles: {
20189
20315
  command: "files bulk-download",
20190
20316
  describe: "Download files and folders as a zip archive",
@@ -20193,6 +20319,18 @@ var CLI_CONTRACT = {
20193
20319
  folderPaths: FOLDER_PATHS_FLAG
20194
20320
  }
20195
20321
  },
20322
+ downloadProjectFileItems: {
20323
+ command: "projects files bulk-download",
20324
+ describe: "Download Project files and folders as a zip archive",
20325
+ flags: {
20326
+ fileIds: { list: true },
20327
+ folderIds: { list: true }
20328
+ }
20329
+ },
20330
+ exportProjectFileSnapshot: {
20331
+ command: "projects files export",
20332
+ describe: "Export a visible Project Markdown snapshot with its embedded assets"
20333
+ },
20196
20334
  editFileContent: {
20197
20335
  command: "files edit",
20198
20336
  describe: "Apply one exact or anchor-based edit to a text file",
@@ -20212,6 +20350,11 @@ var CLI_CONTRACT = {
20212
20350
  describe: "Show a file’s share settings",
20213
20351
  fields: FILE_SHARE_FIELDS
20214
20352
  },
20353
+ getProjectFileShare: {
20354
+ command: "projects files share get",
20355
+ describe: "Show a Project file’s share settings",
20356
+ fields: FILE_SHARE_FIELDS
20357
+ },
20215
20358
  upsertFileShare: {
20216
20359
  command: "files share set",
20217
20360
  describe: "Enable or disable sharing for a file",
@@ -20220,6 +20363,14 @@ var CLI_CONTRACT = {
20220
20363
  },
20221
20364
  fields: FILE_SHARE_FIELDS
20222
20365
  },
20366
+ updateProjectFileShare: {
20367
+ command: "projects files share set",
20368
+ describe: "Enable or disable sharing for a Project file",
20369
+ flags: {
20370
+ allowedEmails: { list: true }
20371
+ },
20372
+ fields: FILE_SHARE_FIELDS
20373
+ },
20223
20374
  listFileFolders: {
20224
20375
  describe: "List folders",
20225
20376
  aliases: ["ls"],
@@ -22826,6 +22977,22 @@ async function downloadToOutput(connect, operation, pathParams, options, scope,
22826
22977
  status: "saved"
22827
22978
  });
22828
22979
  }
22980
+ function attachProjectFileDownload(files) {
22981
+ const [command, connect] = apiCommand(files, "bulk-download", ["downloadProjectFileItems"]);
22982
+ command.argument("<projectId>", "Project that owns the files").allowExcessArguments(false).description(describeOperation(V2_OPERATIONS.downloadProjectFileItems, "Download Project files and recursive folder contents as a zip archive")).option("--file-ids <id...>", "File identifiers to include").option("--folder-ids <id...>", "Folder identifiers to include recursively").option("-o, --output-file <path>", "Write the archive to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (projectId, options) => {
22983
+ const input = await buildRequest("downloadProjectFileItems", [projectId], { ...options }, null);
22984
+ await downloadToOutput(connect, "downloadProjectFileItems", { projectId }, options, "owner", {
22985
+ query: input.query
22986
+ });
22987
+ });
22988
+ }
22989
+ function attachProjectFileSnapshotExport(files) {
22990
+ const [command, connect] = apiCommand(files, "export", ["exportProjectFileSnapshot"]);
22991
+ command.argument("<projectId>", "Project that owns the file").argument("<fileId>", "Markdown file whose visible snapshot to export").allowExcessArguments(false).description(describeOperation(V2_OPERATIONS.exportProjectFileSnapshot, "Export a visible Project Markdown snapshot with its embedded assets")).requiredOption("--content <text|@file|@->", "Visible Markdown content or a file to read").option("-o, --output-file <path>", "Write the export to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action(async (projectId, fileId, options) => {
22992
+ const source = await readArgumentSource(options.content, "content");
22993
+ await downloadToOutput(connect, "exportProjectFileSnapshot", { projectId, fileId }, options, "owner", { body: { content: source.text } });
22994
+ });
22995
+ }
22829
22996
  function attachFileGet(files) {
22830
22997
  const [command, connect] = apiCommand(files, "get", ["downloadFile"]);
22831
22998
  command.argument("<fileId>", "File whose content to read").allowExcessArguments(false).description("Download a file’s content to stdout or a local file").option("-o, --output-file <path>", "Write content to a file instead of stdout").option("--force", "Overwrite --output-file if it already exists").action((fileId, options) => downloadToOutput(connect, "downloadFile", { fileId }, options, "workspace"));
@@ -24277,6 +24444,8 @@ function attachProtocolCommands(program) {
24277
24444
  const projectFiles = group(group(program, "projects"), "files");
24278
24445
  attachProjectFileUpload(projectFiles);
24279
24446
  attachProjectFileSource(projectFiles);
24447
+ attachProjectFileDownload(projectFiles);
24448
+ attachProjectFileSnapshotExport(projectFiles);
24280
24449
  attachProjectFileVersionSource(group(projectFiles, "versions"));
24281
24450
  const files = group(program, "files");
24282
24451
  attachFileUpload(files);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.2.13-preview.230.1",
3
+ "version": "2.2.13-preview.232.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "imports": {