@sequenceholdings/managed-functions 0.4.5 → 0.5.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.
Files changed (71) hide show
  1. package/README.md +147 -12
  2. package/dist/abrigo-contract.d.ts +2 -92
  3. package/dist/abrigo-contract.js +12 -53
  4. package/dist/abrigo-response.d.ts +1 -6
  5. package/dist/abrigo-response.js +3 -25
  6. package/dist/abrigo.d.ts +5 -5
  7. package/dist/abrigo.js +66 -92
  8. package/dist/agent-evidence.d.ts +5 -5
  9. package/dist/agent-evidence.js +58 -48
  10. package/dist/agent-source-evidence-contract.d.ts +2 -1197
  11. package/dist/agent-source-evidence-contract.js +24 -94
  12. package/dist/agents-contract.d.ts +2 -99
  13. package/dist/agents-contract.js +13 -67
  14. package/dist/agents.d.ts +5 -5
  15. package/dist/agents.js +79 -44
  16. package/dist/capabilities.d.ts +1 -1
  17. package/dist/capabilities.js +1 -1
  18. package/dist/config.d.ts +1 -0
  19. package/dist/config.js +4 -1
  20. package/dist/directory-config.d.ts +1 -23
  21. package/dist/directory-config.js +8 -20
  22. package/dist/directory-contract.d.ts +2 -68
  23. package/dist/directory-contract.js +13 -55
  24. package/dist/directory-roster-contract.d.ts +2 -22
  25. package/dist/directory-roster-contract.js +7 -22
  26. package/dist/directory.d.ts +4 -8
  27. package/dist/directory.js +15 -33
  28. package/dist/group-roster-access.d.ts +7 -0
  29. package/dist/group-roster-access.js +8 -0
  30. package/dist/index.d.ts +49 -46
  31. package/dist/index.js +8 -1
  32. package/dist/invocation-client.d.ts +4 -4
  33. package/dist/invocation-client.js +32 -60
  34. package/dist/invocation-contract.d.ts +2 -59
  35. package/dist/invocation-contract.js +10 -61
  36. package/dist/invocation.d.ts +4 -4
  37. package/dist/invocation.js +42 -63
  38. package/dist/lattice-provenance-contract.d.ts +2 -607
  39. package/dist/lattice-provenance-contract.js +14 -154
  40. package/dist/lattice-provenance.d.ts +3 -3
  41. package/dist/lattice-provenance.js +46 -97
  42. package/dist/monitoring-annotations.d.ts +2 -53
  43. package/dist/monitoring-annotations.js +2 -51
  44. package/dist/monitoring-contract.d.ts +5 -460
  45. package/dist/monitoring-contract.js +37 -77
  46. package/dist/monitoring-events.d.ts +2 -252
  47. package/dist/monitoring-events.js +15 -125
  48. package/dist/monitoring.d.ts +3 -3
  49. package/dist/monitoring.js +41 -41
  50. package/dist/orm.d.ts +10 -1
  51. package/dist/orm.js +27 -7
  52. package/dist/platform-client.d.ts +27 -0
  53. package/dist/platform-client.js +79 -0
  54. package/dist/platform-domains.d.ts +1671 -0
  55. package/dist/platform-domains.js +77 -0
  56. package/dist/processes-contract.d.ts +2 -149
  57. package/dist/processes-contract.js +17 -100
  58. package/dist/processes.d.ts +3 -3
  59. package/dist/processes.js +64 -49
  60. package/dist/runtime.cjs +4251 -1666
  61. package/dist/service-directory-roster.d.ts +12 -3
  62. package/dist/service-directory-roster.js +11 -17
  63. package/dist/service-directory.d.ts +4 -8
  64. package/dist/service-directory.js +16 -67
  65. package/dist/storage.d.ts +36 -35
  66. package/dist/storage.js +12 -5
  67. package/dist/workflow-source-contract.d.ts +2 -524
  68. package/dist/workflow-source-contract.js +16 -56
  69. package/dist/workflow-source.d.ts +3 -3
  70. package/dist/workflow-source.js +106 -43
  71. package/package.json +4 -3
@@ -0,0 +1,1671 @@
1
+ import type { FunctionInvocationClientOptions } from "./invocation-client";
2
+ import { createFunctionDirectoryClient } from "./directory";
3
+ import { createFunctionServiceAgentsClient } from "./agents";
4
+ import { createFunctionAgentEvidenceClient } from "./agent-evidence";
5
+ import { createFunctionServiceWorkflowsClient, createFunctionWorkflowEvidenceClient } from "./workflow-source";
6
+ import { createFunctionServiceMonitoringClient } from "./monitoring";
7
+ import { createFunctionCallerAbrigoClient } from "./abrigo";
8
+ export declare const FUNCTION_PLATFORM_DOMAIN_HEADERS: readonly ["x-sequence-directory-token", "x-sequence-storage-token", "x-sequence-storage-token-service", "x-sequence-agent-evidence-token", "x-sequence-workflow-service-token", "x-sequence-workflow-evidence-token", "x-sequence-monitoring-service-token", "x-sequence-abrigo-read-token"];
9
+ export declare function createFunctionPlatformDomains(context: FunctionInvocationClientOptions): {
10
+ callerDirectory: {
11
+ resolveMembers: (query: Parameters<ReturnType<typeof createFunctionDirectoryClient>["resolveMembers"]>[0]) => Promise<{
12
+ members: {
13
+ id: string;
14
+ sub: string;
15
+ name: string;
16
+ email: string;
17
+ deactivated: false;
18
+ }[];
19
+ }>;
20
+ };
21
+ agents: {
22
+ getCompletedRun: (query: Parameters<ReturnType<typeof createFunctionServiceAgentsClient>["getCompletedRun"]>[0]) => Promise<{
23
+ runId: string;
24
+ agent: string;
25
+ threadId: string;
26
+ status: "completed";
27
+ output: import("zod").JSONType;
28
+ messages: {
29
+ id: string;
30
+ role: "assistant";
31
+ parts: ({
32
+ type: "text";
33
+ text: string;
34
+ } | {
35
+ type: "dynamic-tool";
36
+ output: {
37
+ content: {
38
+ type: "resource";
39
+ resource: {
40
+ uri: string;
41
+ text: string;
42
+ };
43
+ }[];
44
+ };
45
+ })[];
46
+ metadata?: {
47
+ citations: import("zod").JSONType[];
48
+ } | undefined;
49
+ }[];
50
+ conversation?: {
51
+ messageCount: number;
52
+ userMessageCount: number;
53
+ assistantMessageCount: number;
54
+ messages: {
55
+ id: string;
56
+ role: "user" | "assistant";
57
+ textParts: string[];
58
+ tools: {
59
+ partType: string;
60
+ toolName: string | null;
61
+ state: string | null;
62
+ outputTruthy: boolean;
63
+ }[];
64
+ }[];
65
+ } | undefined;
66
+ }>;
67
+ captureCompletedRun: (query: Parameters<ReturnType<typeof createFunctionServiceAgentsClient>["captureCompletedRun"]>[0]) => Promise<{
68
+ response: {
69
+ runId: string;
70
+ agent: string;
71
+ threadId: string;
72
+ status: "completed";
73
+ output: import("zod").JSONType;
74
+ messages: {
75
+ id: string;
76
+ role: "assistant";
77
+ parts: ({
78
+ type: "text";
79
+ text: string;
80
+ } | {
81
+ type: "dynamic-tool";
82
+ output: {
83
+ content: {
84
+ type: "resource";
85
+ resource: {
86
+ uri: string;
87
+ text: string;
88
+ };
89
+ }[];
90
+ };
91
+ })[];
92
+ metadata?: {
93
+ citations: import("zod").JSONType[];
94
+ } | undefined;
95
+ }[];
96
+ conversation?: {
97
+ messageCount: number;
98
+ userMessageCount: number;
99
+ assistantMessageCount: number;
100
+ messages: {
101
+ id: string;
102
+ role: "user" | "assistant";
103
+ textParts: string[];
104
+ tools: {
105
+ partType: string;
106
+ toolName: string | null;
107
+ state: string | null;
108
+ outputTruthy: boolean;
109
+ }[];
110
+ }[];
111
+ } | undefined;
112
+ } | {
113
+ runId: string;
114
+ agent: string;
115
+ threadId: string;
116
+ status: "completed";
117
+ output: import("zod").JSONType;
118
+ messages: {
119
+ id: string;
120
+ role: "assistant";
121
+ parts: ({
122
+ type: "text";
123
+ text: string;
124
+ } | {
125
+ type: "dynamic-tool";
126
+ output: {
127
+ content: {
128
+ type: "resource";
129
+ resource: {
130
+ uri: string;
131
+ text: string;
132
+ };
133
+ }[];
134
+ };
135
+ })[];
136
+ metadata?: {
137
+ citations: import("zod").JSONType[];
138
+ } | undefined;
139
+ }[];
140
+ context: {
141
+ messages: {
142
+ id: string;
143
+ role: "user" | "assistant";
144
+ parts: ({
145
+ type: "text";
146
+ text: string;
147
+ } | {
148
+ type: string;
149
+ toolName?: string | undefined;
150
+ name?: string | undefined;
151
+ toolCallId?: string | undefined;
152
+ state?: string | undefined;
153
+ input?: import("zod").JSONType | undefined;
154
+ output?: import("zod").JSONType | undefined;
155
+ })[];
156
+ metadata?: {
157
+ citations: import("zod").JSONType[];
158
+ } | undefined;
159
+ }[];
160
+ compactionSummary: string | null;
161
+ };
162
+ conversation?: {
163
+ messageCount: number;
164
+ userMessageCount: number;
165
+ assistantMessageCount: number;
166
+ messages: {
167
+ id: string;
168
+ role: "user" | "assistant";
169
+ textParts: string[];
170
+ tools: {
171
+ partType: string;
172
+ toolName: string | null;
173
+ state: string | null;
174
+ outputTruthy: boolean;
175
+ }[];
176
+ }[];
177
+ } | undefined;
178
+ };
179
+ responseHash: string;
180
+ sourceReceipt: string;
181
+ }>;
182
+ evidence: {
183
+ verifySourceEvidence: (input: Parameters<ReturnType<typeof createFunctionAgentEvidenceClient>["verifySourceEvidence"]>[0]) => Promise<{
184
+ source: {
185
+ sourceKind: "human";
186
+ audience: "atlas-agent-source-evidence";
187
+ actualUserSub: string;
188
+ projection: "completed-v1" | "conversation-v1";
189
+ environment: string;
190
+ org: string;
191
+ agentId: string;
192
+ runId: string;
193
+ threadId: string;
194
+ familyRunIds: string[];
195
+ cutoffAt: string;
196
+ responseHash: string;
197
+ sourceExecution: {
198
+ run: {
199
+ id: string;
200
+ processId: string;
201
+ processVersion: string;
202
+ bundleHash: string;
203
+ entity: {
204
+ type: string;
205
+ id: string;
206
+ } | null;
207
+ };
208
+ step: {
209
+ id: string;
210
+ nodeId: string;
211
+ attempt: number;
212
+ };
213
+ agent: {
214
+ id: string;
215
+ runId: string;
216
+ threadId: string;
217
+ identity: {
218
+ id: string;
219
+ version: string;
220
+ definitionSha256: string;
221
+ };
222
+ };
223
+ } | null;
224
+ jobAdmission: {
225
+ idempotencyKey: string;
226
+ requestHash: string;
227
+ kind: "workflow" | "agent";
228
+ resourceId: string;
229
+ actorSub: string;
230
+ runId: string;
231
+ executionSnapshotId: string;
232
+ } | null;
233
+ } | {
234
+ sourceKind: "managed_function";
235
+ audience: "atlas-managed-function-source-evidence";
236
+ actualServiceAccountSub: string;
237
+ projection: "completed-v1";
238
+ sourceReceiver: {
239
+ functionId: string;
240
+ versionId: string;
241
+ invocationId: string;
242
+ serviceAccountId: string;
243
+ org: string;
244
+ };
245
+ environment: string;
246
+ org: string;
247
+ agentId: string;
248
+ runId: string;
249
+ threadId: string;
250
+ familyRunIds: string[];
251
+ cutoffAt: string;
252
+ responseHash: string;
253
+ sourceExecution: {
254
+ run: {
255
+ id: string;
256
+ processId: string;
257
+ processVersion: string;
258
+ bundleHash: string;
259
+ entity: {
260
+ type: string;
261
+ id: string;
262
+ } | null;
263
+ };
264
+ step: {
265
+ id: string;
266
+ nodeId: string;
267
+ attempt: number;
268
+ };
269
+ agent: {
270
+ id: string;
271
+ runId: string;
272
+ threadId: string;
273
+ identity: {
274
+ id: string;
275
+ version: string;
276
+ definitionSha256: string;
277
+ };
278
+ };
279
+ } | null;
280
+ jobAdmission: {
281
+ idempotencyKey: string;
282
+ requestHash: string;
283
+ kind: "workflow" | "agent";
284
+ resourceId: string;
285
+ actorSub: string;
286
+ runId: string;
287
+ executionSnapshotId: string;
288
+ } | null;
289
+ } | {
290
+ sourceKind: "human";
291
+ projection: "thread-conversation-v1";
292
+ audience: "atlas-agent-source-evidence";
293
+ actualUserSub: string;
294
+ environment: string;
295
+ org: string;
296
+ agentId: string;
297
+ threadId: string;
298
+ revision: number;
299
+ cutoffAt: string;
300
+ responseHash: string;
301
+ };
302
+ receiver: {
303
+ functionId: string;
304
+ versionId: string;
305
+ invocationId: string;
306
+ serviceAccountId: string;
307
+ org: string;
308
+ };
309
+ lattice: {
310
+ receiverFunctionOrgId: string;
311
+ run: {
312
+ id: string;
313
+ processId: string;
314
+ processVersion: string;
315
+ bundleHash: string;
316
+ entity: {
317
+ type: string;
318
+ id: string;
319
+ } | null;
320
+ };
321
+ step: {
322
+ id: string;
323
+ nodeId: string;
324
+ attempt: number;
325
+ runAsServiceAccount: string | null;
326
+ };
327
+ receiver: {
328
+ functionId: string;
329
+ versionId: string;
330
+ invocationId: string;
331
+ };
332
+ } | null;
333
+ }>;
334
+ verifyConversationEvidence: (input: Parameters<ReturnType<typeof createFunctionAgentEvidenceClient>["verifyConversationEvidence"]>[0]) => Promise<{
335
+ source: {
336
+ sourceKind: "human";
337
+ audience: "atlas-agent-source-evidence";
338
+ actualUserSub: string;
339
+ projection: "completed-v1" | "conversation-v1";
340
+ environment: string;
341
+ org: string;
342
+ agentId: string;
343
+ runId: string;
344
+ threadId: string;
345
+ familyRunIds: string[];
346
+ cutoffAt: string;
347
+ responseHash: string;
348
+ sourceExecution: {
349
+ run: {
350
+ id: string;
351
+ processId: string;
352
+ processVersion: string;
353
+ bundleHash: string;
354
+ entity: {
355
+ type: string;
356
+ id: string;
357
+ } | null;
358
+ };
359
+ step: {
360
+ id: string;
361
+ nodeId: string;
362
+ attempt: number;
363
+ };
364
+ agent: {
365
+ id: string;
366
+ runId: string;
367
+ threadId: string;
368
+ identity: {
369
+ id: string;
370
+ version: string;
371
+ definitionSha256: string;
372
+ };
373
+ };
374
+ } | null;
375
+ jobAdmission: {
376
+ idempotencyKey: string;
377
+ requestHash: string;
378
+ kind: "workflow" | "agent";
379
+ resourceId: string;
380
+ actorSub: string;
381
+ runId: string;
382
+ executionSnapshotId: string;
383
+ } | null;
384
+ } | {
385
+ sourceKind: "managed_function";
386
+ audience: "atlas-managed-function-source-evidence";
387
+ actualServiceAccountSub: string;
388
+ projection: "completed-v1";
389
+ sourceReceiver: {
390
+ functionId: string;
391
+ versionId: string;
392
+ invocationId: string;
393
+ serviceAccountId: string;
394
+ org: string;
395
+ };
396
+ environment: string;
397
+ org: string;
398
+ agentId: string;
399
+ runId: string;
400
+ threadId: string;
401
+ familyRunIds: string[];
402
+ cutoffAt: string;
403
+ responseHash: string;
404
+ sourceExecution: {
405
+ run: {
406
+ id: string;
407
+ processId: string;
408
+ processVersion: string;
409
+ bundleHash: string;
410
+ entity: {
411
+ type: string;
412
+ id: string;
413
+ } | null;
414
+ };
415
+ step: {
416
+ id: string;
417
+ nodeId: string;
418
+ attempt: number;
419
+ };
420
+ agent: {
421
+ id: string;
422
+ runId: string;
423
+ threadId: string;
424
+ identity: {
425
+ id: string;
426
+ version: string;
427
+ definitionSha256: string;
428
+ };
429
+ };
430
+ } | null;
431
+ jobAdmission: {
432
+ idempotencyKey: string;
433
+ requestHash: string;
434
+ kind: "workflow" | "agent";
435
+ resourceId: string;
436
+ actorSub: string;
437
+ runId: string;
438
+ executionSnapshotId: string;
439
+ } | null;
440
+ } | {
441
+ sourceKind: "human";
442
+ projection: "thread-conversation-v1";
443
+ audience: "atlas-agent-source-evidence";
444
+ actualUserSub: string;
445
+ environment: string;
446
+ org: string;
447
+ agentId: string;
448
+ threadId: string;
449
+ revision: number;
450
+ cutoffAt: string;
451
+ responseHash: string;
452
+ };
453
+ receiver: {
454
+ functionId: string;
455
+ versionId: string;
456
+ invocationId: string;
457
+ serviceAccountId: string;
458
+ org: string;
459
+ };
460
+ lattice: {
461
+ receiverFunctionOrgId: string;
462
+ run: {
463
+ id: string;
464
+ processId: string;
465
+ processVersion: string;
466
+ bundleHash: string;
467
+ entity: {
468
+ type: string;
469
+ id: string;
470
+ } | null;
471
+ };
472
+ step: {
473
+ id: string;
474
+ nodeId: string;
475
+ attempt: number;
476
+ runAsServiceAccount: string | null;
477
+ };
478
+ receiver: {
479
+ functionId: string;
480
+ versionId: string;
481
+ invocationId: string;
482
+ };
483
+ } | null;
484
+ }>;
485
+ };
486
+ };
487
+ workflows: {
488
+ captureCompletedRun: (query: Parameters<ReturnType<typeof createFunctionServiceWorkflowsClient>["captureCompletedRun"]>[0]) => Promise<{
489
+ response: {
490
+ workflow: string;
491
+ runId: string;
492
+ status: "completed";
493
+ output: import("zod").JSONType;
494
+ };
495
+ responseHash: string;
496
+ sourceReceipt: string;
497
+ }>;
498
+ evidence: {
499
+ verifySourceEvidence: (input: Parameters<ReturnType<typeof createFunctionWorkflowEvidenceClient>["verifySourceEvidence"]>[0]) => Promise<{
500
+ source: {
501
+ actualServiceAccountSub: string;
502
+ sourceReceiver: {
503
+ functionId: string;
504
+ versionId: string;
505
+ invocationId: string;
506
+ serviceAccountId: string;
507
+ org: string;
508
+ };
509
+ sourceExecution: {
510
+ run: {
511
+ id: string;
512
+ processId: string;
513
+ processVersion: string;
514
+ bundleHash: string;
515
+ entity: {
516
+ type: string;
517
+ id: string;
518
+ } | null;
519
+ };
520
+ step: {
521
+ id: string;
522
+ nodeId: string;
523
+ attempt: number;
524
+ };
525
+ workflow: {
526
+ id: string;
527
+ runId: string;
528
+ identity: {
529
+ id: string;
530
+ version: string;
531
+ definitionSha256: string;
532
+ };
533
+ branches: {
534
+ nodeId: string;
535
+ nodeRunId: string;
536
+ attempt: number;
537
+ agentId: string;
538
+ runId: string | null;
539
+ status: "completed" | "failed" | "cancelled" | "skipped";
540
+ identity: {
541
+ id: string;
542
+ version: string;
543
+ definitionSha256: string;
544
+ };
545
+ completedAt: string | null;
546
+ }[];
547
+ };
548
+ };
549
+ environment: string;
550
+ org: string;
551
+ workflowId: string;
552
+ runId: string;
553
+ cutoffAt: string;
554
+ outputHash: string;
555
+ responseHash: string;
556
+ jobAdmission: {
557
+ idempotencyKey: string;
558
+ requestHash: string;
559
+ kind: "workflow" | "agent";
560
+ resourceId: string;
561
+ actorSub: string;
562
+ runId: string;
563
+ executionSnapshotId: string;
564
+ } | null;
565
+ sourceKind: "managed_function";
566
+ projection: "workflow-completed-v1";
567
+ audience: "atlas-managed-function-workflow-source-evidence";
568
+ } | {
569
+ sourceKind: "human";
570
+ projection: "workflow-completed-v1";
571
+ audience: "atlas-workflow-source-evidence";
572
+ actualUserSub: string;
573
+ sourceExecution: null;
574
+ workflowSource: {
575
+ id: string;
576
+ runId: string;
577
+ identity: {
578
+ id: string;
579
+ version: string;
580
+ definitionSha256: string;
581
+ };
582
+ branches: {
583
+ nodeId: string;
584
+ nodeRunId: string;
585
+ attempt: number;
586
+ agentId: string;
587
+ runId: string | null;
588
+ status: "completed" | "failed" | "cancelled" | "skipped";
589
+ identity: {
590
+ id: string;
591
+ version: string;
592
+ definitionSha256: string;
593
+ };
594
+ completedAt: string | null;
595
+ }[];
596
+ };
597
+ environment: string;
598
+ org: string;
599
+ workflowId: string;
600
+ runId: string;
601
+ cutoffAt: string;
602
+ outputHash: string;
603
+ responseHash: string;
604
+ jobAdmission: {
605
+ idempotencyKey: string;
606
+ requestHash: string;
607
+ kind: "workflow" | "agent";
608
+ resourceId: string;
609
+ actorSub: string;
610
+ runId: string;
611
+ executionSnapshotId: string;
612
+ } | null;
613
+ };
614
+ receiver: {
615
+ functionId: string;
616
+ versionId: string;
617
+ invocationId: string;
618
+ serviceAccountId: string;
619
+ org: string;
620
+ };
621
+ }>;
622
+ };
623
+ };
624
+ monitoring: {
625
+ publish: (input: Parameters<ReturnType<typeof createFunctionServiceMonitoringClient>["publish"]>[0]) => Promise<{
626
+ id: string;
627
+ producer: string;
628
+ businessKey: string;
629
+ payloadHash: string;
630
+ status: "confirmed";
631
+ eventCount: number;
632
+ confirmedAt: string;
633
+ eventIds: string[];
634
+ }>;
635
+ get: (input: Parameters<ReturnType<typeof createFunctionServiceMonitoringClient>["get"]>[0]) => Promise<{
636
+ id: string;
637
+ producer: string;
638
+ businessKey: string;
639
+ payloadHash: string;
640
+ status: "confirmed";
641
+ eventCount: number;
642
+ confirmedAt: string;
643
+ eventIds: string[];
644
+ }>;
645
+ getBucketCatalog: (input: Parameters<ReturnType<typeof createFunctionServiceMonitoringClient>["getBucketCatalog"]>[0]) => Promise<{
646
+ producer: string;
647
+ complete: true;
648
+ buckets: {
649
+ slug: string;
650
+ name: string;
651
+ description: string;
652
+ severity: "critical" | "high" | "medium" | "low";
653
+ category: string;
654
+ }[];
655
+ }>;
656
+ };
657
+ abrigo: {
658
+ read: (input: Parameters<ReturnType<typeof createFunctionCallerAbrigoClient>["read"]>[0]) => Promise<import("./cache").JsonValue>;
659
+ };
660
+ storage: {
661
+ caller: {
662
+ capabilities: () => Promise<{
663
+ canProvision: boolean;
664
+ uploadMethods: string[];
665
+ pendingUploads: {
666
+ perPrincipal: number;
667
+ perWorkspace: number;
668
+ };
669
+ uploadBatchLimit: number;
670
+ importConcurrency: {
671
+ default: number;
672
+ max: number;
673
+ };
674
+ }>;
675
+ list: (options?: import("@sequenceholdings/platform/storage").StorageListOptions) => Promise<{
676
+ items: {
677
+ id: string;
678
+ name: string;
679
+ description: string;
680
+ environment: string;
681
+ state: "active" | "trashed" | "purging";
682
+ revision: number;
683
+ createdAt: string;
684
+ role: "viewer" | "editor" | "admin" | "owner";
685
+ quotaBytes: number;
686
+ usedBytes: number;
687
+ reservedBytes: number;
688
+ }[];
689
+ nextCursor: string | null;
690
+ }>;
691
+ shared: (options?: import("@sequenceholdings/platform/storage").StorageListOptions & {
692
+ trash?: boolean;
693
+ }) => Promise<{
694
+ items: {
695
+ id: string;
696
+ workspaceId: string;
697
+ parentId: string | null;
698
+ name: string;
699
+ kind: "file" | "folder";
700
+ state: "active" | "trashed" | "purging";
701
+ restricted: boolean;
702
+ revision: number;
703
+ currentVersionId: string | null;
704
+ metadata: Record<string, string>;
705
+ createdAt: string;
706
+ updatedAt: string;
707
+ role: "viewer" | "editor" | "admin";
708
+ size: number | null;
709
+ contentType: string | null;
710
+ }[];
711
+ nextCursor: string | null;
712
+ }>;
713
+ apply: (manifest: import("@sequenceholdings/platform/storage").WorkspaceManifest) => Promise<{
714
+ id: string;
715
+ name: string;
716
+ description: string;
717
+ environment: string;
718
+ state: "active" | "trashed" | "purging";
719
+ revision: number;
720
+ createdAt: string;
721
+ role: "viewer" | "editor" | "admin" | "owner";
722
+ quotaBytes: number;
723
+ usedBytes: number;
724
+ reservedBytes: number;
725
+ }>;
726
+ workspace(id: string): {
727
+ get: () => Promise<{
728
+ id: string;
729
+ name: string;
730
+ description: string;
731
+ environment: string;
732
+ state: "active" | "trashed" | "purging";
733
+ revision: number;
734
+ createdAt: string;
735
+ role: "viewer" | "editor" | "admin" | "owner";
736
+ quotaBytes: number;
737
+ usedBytes: number;
738
+ reservedBytes: number;
739
+ }>;
740
+ delete: (expectedRevision: number) => Promise<{
741
+ id: string;
742
+ workspaceId: string;
743
+ targetId: string | null;
744
+ kind: "purge" | "delete_version";
745
+ status: "running" | "failed" | "queued" | "succeeded";
746
+ completed: number;
747
+ total: number;
748
+ error: string | null;
749
+ createdAt: string;
750
+ updatedAt: string;
751
+ canRetry: boolean;
752
+ }>;
753
+ list: (options?: import("@sequenceholdings/platform/storage").StorageListOptions & {
754
+ parentId?: string | null;
755
+ trash?: boolean;
756
+ }) => Promise<{
757
+ items: {
758
+ id: string;
759
+ workspaceId: string;
760
+ parentId: string | null;
761
+ name: string;
762
+ kind: "file" | "folder";
763
+ state: "active" | "trashed" | "purging";
764
+ restricted: boolean;
765
+ revision: number;
766
+ currentVersionId: string | null;
767
+ metadata: Record<string, string>;
768
+ createdAt: string;
769
+ updatedAt: string;
770
+ role: "viewer" | "editor" | "admin";
771
+ size: number | null;
772
+ contentType: string | null;
773
+ }[];
774
+ nextCursor: string | null;
775
+ }>;
776
+ getNode: (id: string) => Promise<{
777
+ id: string;
778
+ workspaceId: string;
779
+ parentId: string | null;
780
+ name: string;
781
+ kind: "file" | "folder";
782
+ state: "active" | "trashed" | "purging";
783
+ restricted: boolean;
784
+ revision: number;
785
+ currentVersionId: string | null;
786
+ metadata: Record<string, string>;
787
+ createdAt: string;
788
+ updatedAt: string;
789
+ role: "viewer" | "editor" | "admin";
790
+ size: number | null;
791
+ contentType: string | null;
792
+ }>;
793
+ getNodeWithAncestors: (id: string) => Promise<{
794
+ id: string;
795
+ workspaceId: string;
796
+ parentId: string | null;
797
+ name: string;
798
+ kind: "file" | "folder";
799
+ state: "active" | "trashed" | "purging";
800
+ restricted: boolean;
801
+ revision: number;
802
+ currentVersionId: string | null;
803
+ metadata: Record<string, string>;
804
+ createdAt: string;
805
+ updatedAt: string;
806
+ role: "viewer" | "editor" | "admin";
807
+ size: number | null;
808
+ contentType: string | null;
809
+ ancestors: {
810
+ id: string;
811
+ workspaceId: string;
812
+ parentId: string | null;
813
+ name: string;
814
+ kind: "file" | "folder";
815
+ state: "active" | "trashed" | "purging";
816
+ restricted: boolean;
817
+ revision: number;
818
+ currentVersionId: string | null;
819
+ metadata: Record<string, string>;
820
+ createdAt: string;
821
+ updatedAt: string;
822
+ role: "viewer" | "editor" | "admin";
823
+ size: number | null;
824
+ contentType: string | null;
825
+ }[];
826
+ }>;
827
+ createFolder: (name: string, parentId?: string | null, { idempotencyKey, }?: {
828
+ idempotencyKey?: string;
829
+ }) => Promise<{
830
+ id: string;
831
+ workspaceId: string;
832
+ parentId: string | null;
833
+ name: string;
834
+ kind: "file" | "folder";
835
+ state: "active" | "trashed" | "purging";
836
+ restricted: boolean;
837
+ revision: number;
838
+ currentVersionId: string | null;
839
+ metadata: Record<string, string>;
840
+ createdAt: string;
841
+ updatedAt: string;
842
+ role: "viewer" | "editor" | "admin";
843
+ size: number | null;
844
+ contentType: string | null;
845
+ }>;
846
+ update: (id: string, input: import("zod").input<typeof import("@sequenceholdings/platform/storage").updateNodeSchema>) => Promise<{
847
+ id: string;
848
+ workspaceId: string;
849
+ parentId: string | null;
850
+ name: string;
851
+ kind: "file" | "folder";
852
+ state: "active" | "trashed" | "purging";
853
+ restricted: boolean;
854
+ revision: number;
855
+ currentVersionId: string | null;
856
+ metadata: Record<string, string>;
857
+ createdAt: string;
858
+ updatedAt: string;
859
+ role: "viewer" | "editor" | "admin";
860
+ size: number | null;
861
+ contentType: string | null;
862
+ }>;
863
+ trash: (id: string, expectedRevision: number) => Promise<{
864
+ id: string;
865
+ workspaceId: string;
866
+ parentId: string | null;
867
+ name: string;
868
+ kind: "file" | "folder";
869
+ state: "active" | "trashed" | "purging";
870
+ restricted: boolean;
871
+ revision: number;
872
+ currentVersionId: string | null;
873
+ metadata: Record<string, string>;
874
+ createdAt: string;
875
+ updatedAt: string;
876
+ role: "viewer" | "editor" | "admin";
877
+ size: number | null;
878
+ contentType: string | null;
879
+ }>;
880
+ restore: (id: string, expectedRevision: number) => Promise<{
881
+ id: string;
882
+ workspaceId: string;
883
+ parentId: string | null;
884
+ name: string;
885
+ kind: "file" | "folder";
886
+ state: "active" | "trashed" | "purging";
887
+ restricted: boolean;
888
+ revision: number;
889
+ currentVersionId: string | null;
890
+ metadata: Record<string, string>;
891
+ createdAt: string;
892
+ updatedAt: string;
893
+ role: "viewer" | "editor" | "admin";
894
+ size: number | null;
895
+ contentType: string | null;
896
+ }>;
897
+ purge: (id: string, expectedRevision: number) => Promise<{
898
+ id: string;
899
+ workspaceId: string;
900
+ targetId: string | null;
901
+ kind: "purge" | "delete_version";
902
+ status: "running" | "failed" | "queued" | "succeeded";
903
+ completed: number;
904
+ total: number;
905
+ error: string | null;
906
+ createdAt: string;
907
+ updatedAt: string;
908
+ canRetry: boolean;
909
+ }>;
910
+ download: (id: string, options?: {
911
+ versionId?: string;
912
+ preview?: boolean;
913
+ }) => Promise<{
914
+ url: string;
915
+ expiresAt: string;
916
+ preview: boolean;
917
+ }>;
918
+ versions: (id: string, options?: {
919
+ before?: number;
920
+ limit?: number;
921
+ }) => Promise<{
922
+ items: {
923
+ id: string;
924
+ fileId: string;
925
+ revision: number;
926
+ size: number;
927
+ checksum: string;
928
+ contentType: string;
929
+ createdAt: string;
930
+ createdBy: string;
931
+ state: "active" | "purging";
932
+ }[];
933
+ nextRevision: number | null;
934
+ }>;
935
+ restoreVersion: (id: string, versionId: string, expectedRevision: number) => Promise<{
936
+ id: string;
937
+ fileId: string;
938
+ revision: number;
939
+ size: number;
940
+ checksum: string;
941
+ contentType: string;
942
+ createdAt: string;
943
+ createdBy: string;
944
+ state: "active" | "purging";
945
+ }>;
946
+ deleteVersion: (id: string, versionId: string, expectedRevision: number) => Promise<{
947
+ id: string;
948
+ workspaceId: string;
949
+ targetId: string | null;
950
+ kind: "purge" | "delete_version";
951
+ status: "running" | "failed" | "queued" | "succeeded";
952
+ completed: number;
953
+ total: number;
954
+ error: string | null;
955
+ createdAt: string;
956
+ updatedAt: string;
957
+ canRetry: boolean;
958
+ }>;
959
+ access: (id?: string) => Promise<{
960
+ revision: number;
961
+ restricted: boolean;
962
+ grants: {
963
+ type: "user" | "service_account" | "group" | "organization";
964
+ id: string;
965
+ role: "viewer" | "editor" | "admin";
966
+ }[];
967
+ owner: string | null;
968
+ inherited: boolean;
969
+ workspaceAdminOverride: true;
970
+ displayNames: Record<string, string>;
971
+ }>;
972
+ setAccess: (input: import("zod").input<typeof import("@sequenceholdings/platform/storage").updateStorageAccessSchema>, id?: string) => Promise<{
973
+ revision: number;
974
+ restricted: boolean;
975
+ grants: {
976
+ type: "user" | "service_account" | "group" | "organization";
977
+ id: string;
978
+ role: "viewer" | "editor" | "admin";
979
+ }[];
980
+ owner: string | null;
981
+ inherited: boolean;
982
+ workspaceAdminOverride: true;
983
+ displayNames: Record<string, string>;
984
+ }>;
985
+ transferOwner: (principal: {
986
+ type: "user" | "service_account";
987
+ id: string;
988
+ }, expectedRevision: number) => Promise<{
989
+ revision: number;
990
+ restricted: boolean;
991
+ grants: {
992
+ type: "user" | "service_account" | "group" | "organization";
993
+ id: string;
994
+ role: "viewer" | "editor" | "admin";
995
+ }[];
996
+ owner: string | null;
997
+ inherited: boolean;
998
+ workspaceAdminOverride: true;
999
+ displayNames: Record<string, string>;
1000
+ }>;
1001
+ operations: (options?: {
1002
+ before?: string;
1003
+ limit?: number;
1004
+ scope?: import("@sequenceholdings/platform/storage").StorageOperationScope;
1005
+ }) => Promise<{
1006
+ items: {
1007
+ id: string;
1008
+ workspaceId: string;
1009
+ targetId: string | null;
1010
+ kind: "purge" | "delete_version";
1011
+ status: "running" | "failed" | "queued" | "succeeded";
1012
+ completed: number;
1013
+ total: number;
1014
+ error: string | null;
1015
+ createdAt: string;
1016
+ updatedAt: string;
1017
+ canRetry: boolean;
1018
+ }[];
1019
+ nextCursor: string | null;
1020
+ }>;
1021
+ retryOperation: (id: string) => Promise<{
1022
+ id: string;
1023
+ workspaceId: string;
1024
+ targetId: string | null;
1025
+ kind: "purge" | "delete_version";
1026
+ status: "running" | "failed" | "queued" | "succeeded";
1027
+ completed: number;
1028
+ total: number;
1029
+ error: string | null;
1030
+ createdAt: string;
1031
+ updatedAt: string;
1032
+ canRetry: boolean;
1033
+ }>;
1034
+ uploads: {
1035
+ start: (input: import("@sequenceholdings/platform/storage").StartStorageUpload) => Promise<{
1036
+ id: string;
1037
+ fileId: string;
1038
+ uploadUrl: string | null;
1039
+ expiresAt: string;
1040
+ state: "aborted" | "pending" | "complete";
1041
+ versionId: string | null;
1042
+ maxBytes: number;
1043
+ }>;
1044
+ get: (id: string) => Promise<{
1045
+ id: string;
1046
+ fileId: string;
1047
+ uploadUrl: string | null;
1048
+ expiresAt: string;
1049
+ state: "aborted" | "pending" | "complete";
1050
+ versionId: string | null;
1051
+ maxBytes: number;
1052
+ }>;
1053
+ complete: (id: string, input?: import("@sequenceholdings/platform/storage").CompleteStorageUpload) => Promise<{
1054
+ id: string;
1055
+ fileId: string;
1056
+ uploadUrl: string | null;
1057
+ expiresAt: string;
1058
+ state: "aborted" | "pending" | "complete";
1059
+ versionId: string | null;
1060
+ maxBytes: number;
1061
+ }>;
1062
+ abort: (id: string) => Promise<{
1063
+ id: string;
1064
+ fileId: string;
1065
+ uploadUrl: string | null;
1066
+ expiresAt: string;
1067
+ state: "aborted" | "pending" | "complete";
1068
+ versionId: string | null;
1069
+ maxBytes: number;
1070
+ }>;
1071
+ startBatch: (items: import("@sequenceholdings/platform/storage").StartStorageUpload[]) => Promise<{
1072
+ items: {
1073
+ id: string;
1074
+ fileId: string;
1075
+ uploadUrl: string | null;
1076
+ expiresAt: string;
1077
+ state: "aborted" | "pending" | "complete";
1078
+ versionId: string | null;
1079
+ maxBytes: number;
1080
+ }[];
1081
+ }>;
1082
+ list: () => Promise<{
1083
+ items: {
1084
+ id: string;
1085
+ fileId: string;
1086
+ name: string;
1087
+ state: "aborted" | "pending" | "complete";
1088
+ expiresAt: string;
1089
+ maxBytes: number;
1090
+ expectedSize: number | null;
1091
+ versionId: string | null;
1092
+ }[];
1093
+ limits: {
1094
+ perPrincipal: number;
1095
+ perWorkspace: number;
1096
+ };
1097
+ }>;
1098
+ reconcile: (input?: {
1099
+ abortIncomplete?: boolean;
1100
+ }) => Promise<{
1101
+ completed: {
1102
+ id: string;
1103
+ fileId: string;
1104
+ name: string;
1105
+ state: "aborted" | "pending" | "complete";
1106
+ expiresAt: string;
1107
+ maxBytes: number;
1108
+ expectedSize: number | null;
1109
+ versionId: string | null;
1110
+ code: string;
1111
+ message: string;
1112
+ }[];
1113
+ aborted: {
1114
+ id: string;
1115
+ fileId: string;
1116
+ name: string;
1117
+ state: "aborted" | "pending" | "complete";
1118
+ expiresAt: string;
1119
+ maxBytes: number;
1120
+ expectedSize: number | null;
1121
+ versionId: string | null;
1122
+ code: string;
1123
+ message: string;
1124
+ }[];
1125
+ pending: {
1126
+ id: string;
1127
+ fileId: string;
1128
+ name: string;
1129
+ state: "aborted" | "pending" | "complete";
1130
+ expiresAt: string;
1131
+ maxBytes: number;
1132
+ expectedSize: number | null;
1133
+ versionId: string | null;
1134
+ code: string;
1135
+ message: string;
1136
+ }[];
1137
+ }>;
1138
+ resume(id: string, source: import("@sequenceholdings/platform/storage").StorageUploadSource, options?: import("@sequenceholdings/platform/storage").StorageTransferOptions & {
1139
+ size?: number;
1140
+ }): Promise<{
1141
+ id: string;
1142
+ fileId: string;
1143
+ uploadUrl: string | null;
1144
+ expiresAt: string;
1145
+ state: "aborted" | "pending" | "complete";
1146
+ versionId: string | null;
1147
+ maxBytes: number;
1148
+ }>;
1149
+ put(input: Omit<import("@sequenceholdings/platform/storage").StartStorageUpload, "idempotencyKey"> & {
1150
+ idempotencyKey?: string;
1151
+ }, source: import("@sequenceholdings/platform/storage").StorageUploadSource, { keepSessionOnFailure, ...options }?: import("@sequenceholdings/platform/storage").StorageTransferOptions & {
1152
+ keepSessionOnFailure?: boolean;
1153
+ }): Promise<{
1154
+ id: string;
1155
+ fileId: string;
1156
+ uploadUrl: string | null;
1157
+ expiresAt: string;
1158
+ state: "aborted" | "pending" | "complete";
1159
+ versionId: string | null;
1160
+ maxBytes: number;
1161
+ }>;
1162
+ };
1163
+ };
1164
+ };
1165
+ service: {
1166
+ capabilities: () => Promise<{
1167
+ canProvision: boolean;
1168
+ uploadMethods: string[];
1169
+ pendingUploads: {
1170
+ perPrincipal: number;
1171
+ perWorkspace: number;
1172
+ };
1173
+ uploadBatchLimit: number;
1174
+ importConcurrency: {
1175
+ default: number;
1176
+ max: number;
1177
+ };
1178
+ }>;
1179
+ list: (options?: import("@sequenceholdings/platform/storage").StorageListOptions) => Promise<{
1180
+ items: {
1181
+ id: string;
1182
+ name: string;
1183
+ description: string;
1184
+ environment: string;
1185
+ state: "active" | "trashed" | "purging";
1186
+ revision: number;
1187
+ createdAt: string;
1188
+ role: "viewer" | "editor" | "admin" | "owner";
1189
+ quotaBytes: number;
1190
+ usedBytes: number;
1191
+ reservedBytes: number;
1192
+ }[];
1193
+ nextCursor: string | null;
1194
+ }>;
1195
+ shared: (options?: import("@sequenceholdings/platform/storage").StorageListOptions & {
1196
+ trash?: boolean;
1197
+ }) => Promise<{
1198
+ items: {
1199
+ id: string;
1200
+ workspaceId: string;
1201
+ parentId: string | null;
1202
+ name: string;
1203
+ kind: "file" | "folder";
1204
+ state: "active" | "trashed" | "purging";
1205
+ restricted: boolean;
1206
+ revision: number;
1207
+ currentVersionId: string | null;
1208
+ metadata: Record<string, string>;
1209
+ createdAt: string;
1210
+ updatedAt: string;
1211
+ role: "viewer" | "editor" | "admin";
1212
+ size: number | null;
1213
+ contentType: string | null;
1214
+ }[];
1215
+ nextCursor: string | null;
1216
+ }>;
1217
+ apply: (manifest: import("@sequenceholdings/platform/storage").WorkspaceManifest) => Promise<{
1218
+ id: string;
1219
+ name: string;
1220
+ description: string;
1221
+ environment: string;
1222
+ state: "active" | "trashed" | "purging";
1223
+ revision: number;
1224
+ createdAt: string;
1225
+ role: "viewer" | "editor" | "admin" | "owner";
1226
+ quotaBytes: number;
1227
+ usedBytes: number;
1228
+ reservedBytes: number;
1229
+ }>;
1230
+ workspace(id: string): {
1231
+ get: () => Promise<{
1232
+ id: string;
1233
+ name: string;
1234
+ description: string;
1235
+ environment: string;
1236
+ state: "active" | "trashed" | "purging";
1237
+ revision: number;
1238
+ createdAt: string;
1239
+ role: "viewer" | "editor" | "admin" | "owner";
1240
+ quotaBytes: number;
1241
+ usedBytes: number;
1242
+ reservedBytes: number;
1243
+ }>;
1244
+ delete: (expectedRevision: number) => Promise<{
1245
+ id: string;
1246
+ workspaceId: string;
1247
+ targetId: string | null;
1248
+ kind: "purge" | "delete_version";
1249
+ status: "running" | "failed" | "queued" | "succeeded";
1250
+ completed: number;
1251
+ total: number;
1252
+ error: string | null;
1253
+ createdAt: string;
1254
+ updatedAt: string;
1255
+ canRetry: boolean;
1256
+ }>;
1257
+ list: (options?: import("@sequenceholdings/platform/storage").StorageListOptions & {
1258
+ parentId?: string | null;
1259
+ trash?: boolean;
1260
+ }) => Promise<{
1261
+ items: {
1262
+ id: string;
1263
+ workspaceId: string;
1264
+ parentId: string | null;
1265
+ name: string;
1266
+ kind: "file" | "folder";
1267
+ state: "active" | "trashed" | "purging";
1268
+ restricted: boolean;
1269
+ revision: number;
1270
+ currentVersionId: string | null;
1271
+ metadata: Record<string, string>;
1272
+ createdAt: string;
1273
+ updatedAt: string;
1274
+ role: "viewer" | "editor" | "admin";
1275
+ size: number | null;
1276
+ contentType: string | null;
1277
+ }[];
1278
+ nextCursor: string | null;
1279
+ }>;
1280
+ getNode: (id: string) => Promise<{
1281
+ id: string;
1282
+ workspaceId: string;
1283
+ parentId: string | null;
1284
+ name: string;
1285
+ kind: "file" | "folder";
1286
+ state: "active" | "trashed" | "purging";
1287
+ restricted: boolean;
1288
+ revision: number;
1289
+ currentVersionId: string | null;
1290
+ metadata: Record<string, string>;
1291
+ createdAt: string;
1292
+ updatedAt: string;
1293
+ role: "viewer" | "editor" | "admin";
1294
+ size: number | null;
1295
+ contentType: string | null;
1296
+ }>;
1297
+ getNodeWithAncestors: (id: string) => Promise<{
1298
+ id: string;
1299
+ workspaceId: string;
1300
+ parentId: string | null;
1301
+ name: string;
1302
+ kind: "file" | "folder";
1303
+ state: "active" | "trashed" | "purging";
1304
+ restricted: boolean;
1305
+ revision: number;
1306
+ currentVersionId: string | null;
1307
+ metadata: Record<string, string>;
1308
+ createdAt: string;
1309
+ updatedAt: string;
1310
+ role: "viewer" | "editor" | "admin";
1311
+ size: number | null;
1312
+ contentType: string | null;
1313
+ ancestors: {
1314
+ id: string;
1315
+ workspaceId: string;
1316
+ parentId: string | null;
1317
+ name: string;
1318
+ kind: "file" | "folder";
1319
+ state: "active" | "trashed" | "purging";
1320
+ restricted: boolean;
1321
+ revision: number;
1322
+ currentVersionId: string | null;
1323
+ metadata: Record<string, string>;
1324
+ createdAt: string;
1325
+ updatedAt: string;
1326
+ role: "viewer" | "editor" | "admin";
1327
+ size: number | null;
1328
+ contentType: string | null;
1329
+ }[];
1330
+ }>;
1331
+ createFolder: (name: string, parentId?: string | null, { idempotencyKey, }?: {
1332
+ idempotencyKey?: string;
1333
+ }) => Promise<{
1334
+ id: string;
1335
+ workspaceId: string;
1336
+ parentId: string | null;
1337
+ name: string;
1338
+ kind: "file" | "folder";
1339
+ state: "active" | "trashed" | "purging";
1340
+ restricted: boolean;
1341
+ revision: number;
1342
+ currentVersionId: string | null;
1343
+ metadata: Record<string, string>;
1344
+ createdAt: string;
1345
+ updatedAt: string;
1346
+ role: "viewer" | "editor" | "admin";
1347
+ size: number | null;
1348
+ contentType: string | null;
1349
+ }>;
1350
+ update: (id: string, input: import("zod").input<typeof import("@sequenceholdings/platform/storage").updateNodeSchema>) => Promise<{
1351
+ id: string;
1352
+ workspaceId: string;
1353
+ parentId: string | null;
1354
+ name: string;
1355
+ kind: "file" | "folder";
1356
+ state: "active" | "trashed" | "purging";
1357
+ restricted: boolean;
1358
+ revision: number;
1359
+ currentVersionId: string | null;
1360
+ metadata: Record<string, string>;
1361
+ createdAt: string;
1362
+ updatedAt: string;
1363
+ role: "viewer" | "editor" | "admin";
1364
+ size: number | null;
1365
+ contentType: string | null;
1366
+ }>;
1367
+ trash: (id: string, expectedRevision: number) => Promise<{
1368
+ id: string;
1369
+ workspaceId: string;
1370
+ parentId: string | null;
1371
+ name: string;
1372
+ kind: "file" | "folder";
1373
+ state: "active" | "trashed" | "purging";
1374
+ restricted: boolean;
1375
+ revision: number;
1376
+ currentVersionId: string | null;
1377
+ metadata: Record<string, string>;
1378
+ createdAt: string;
1379
+ updatedAt: string;
1380
+ role: "viewer" | "editor" | "admin";
1381
+ size: number | null;
1382
+ contentType: string | null;
1383
+ }>;
1384
+ restore: (id: string, expectedRevision: number) => Promise<{
1385
+ id: string;
1386
+ workspaceId: string;
1387
+ parentId: string | null;
1388
+ name: string;
1389
+ kind: "file" | "folder";
1390
+ state: "active" | "trashed" | "purging";
1391
+ restricted: boolean;
1392
+ revision: number;
1393
+ currentVersionId: string | null;
1394
+ metadata: Record<string, string>;
1395
+ createdAt: string;
1396
+ updatedAt: string;
1397
+ role: "viewer" | "editor" | "admin";
1398
+ size: number | null;
1399
+ contentType: string | null;
1400
+ }>;
1401
+ purge: (id: string, expectedRevision: number) => Promise<{
1402
+ id: string;
1403
+ workspaceId: string;
1404
+ targetId: string | null;
1405
+ kind: "purge" | "delete_version";
1406
+ status: "running" | "failed" | "queued" | "succeeded";
1407
+ completed: number;
1408
+ total: number;
1409
+ error: string | null;
1410
+ createdAt: string;
1411
+ updatedAt: string;
1412
+ canRetry: boolean;
1413
+ }>;
1414
+ download: (id: string, options?: {
1415
+ versionId?: string;
1416
+ preview?: boolean;
1417
+ }) => Promise<{
1418
+ url: string;
1419
+ expiresAt: string;
1420
+ preview: boolean;
1421
+ }>;
1422
+ versions: (id: string, options?: {
1423
+ before?: number;
1424
+ limit?: number;
1425
+ }) => Promise<{
1426
+ items: {
1427
+ id: string;
1428
+ fileId: string;
1429
+ revision: number;
1430
+ size: number;
1431
+ checksum: string;
1432
+ contentType: string;
1433
+ createdAt: string;
1434
+ createdBy: string;
1435
+ state: "active" | "purging";
1436
+ }[];
1437
+ nextRevision: number | null;
1438
+ }>;
1439
+ restoreVersion: (id: string, versionId: string, expectedRevision: number) => Promise<{
1440
+ id: string;
1441
+ fileId: string;
1442
+ revision: number;
1443
+ size: number;
1444
+ checksum: string;
1445
+ contentType: string;
1446
+ createdAt: string;
1447
+ createdBy: string;
1448
+ state: "active" | "purging";
1449
+ }>;
1450
+ deleteVersion: (id: string, versionId: string, expectedRevision: number) => Promise<{
1451
+ id: string;
1452
+ workspaceId: string;
1453
+ targetId: string | null;
1454
+ kind: "purge" | "delete_version";
1455
+ status: "running" | "failed" | "queued" | "succeeded";
1456
+ completed: number;
1457
+ total: number;
1458
+ error: string | null;
1459
+ createdAt: string;
1460
+ updatedAt: string;
1461
+ canRetry: boolean;
1462
+ }>;
1463
+ access: (id?: string) => Promise<{
1464
+ revision: number;
1465
+ restricted: boolean;
1466
+ grants: {
1467
+ type: "user" | "service_account" | "group" | "organization";
1468
+ id: string;
1469
+ role: "viewer" | "editor" | "admin";
1470
+ }[];
1471
+ owner: string | null;
1472
+ inherited: boolean;
1473
+ workspaceAdminOverride: true;
1474
+ displayNames: Record<string, string>;
1475
+ }>;
1476
+ setAccess: (input: import("zod").input<typeof import("@sequenceholdings/platform/storage").updateStorageAccessSchema>, id?: string) => Promise<{
1477
+ revision: number;
1478
+ restricted: boolean;
1479
+ grants: {
1480
+ type: "user" | "service_account" | "group" | "organization";
1481
+ id: string;
1482
+ role: "viewer" | "editor" | "admin";
1483
+ }[];
1484
+ owner: string | null;
1485
+ inherited: boolean;
1486
+ workspaceAdminOverride: true;
1487
+ displayNames: Record<string, string>;
1488
+ }>;
1489
+ transferOwner: (principal: {
1490
+ type: "user" | "service_account";
1491
+ id: string;
1492
+ }, expectedRevision: number) => Promise<{
1493
+ revision: number;
1494
+ restricted: boolean;
1495
+ grants: {
1496
+ type: "user" | "service_account" | "group" | "organization";
1497
+ id: string;
1498
+ role: "viewer" | "editor" | "admin";
1499
+ }[];
1500
+ owner: string | null;
1501
+ inherited: boolean;
1502
+ workspaceAdminOverride: true;
1503
+ displayNames: Record<string, string>;
1504
+ }>;
1505
+ operations: (options?: {
1506
+ before?: string;
1507
+ limit?: number;
1508
+ scope?: import("@sequenceholdings/platform/storage").StorageOperationScope;
1509
+ }) => Promise<{
1510
+ items: {
1511
+ id: string;
1512
+ workspaceId: string;
1513
+ targetId: string | null;
1514
+ kind: "purge" | "delete_version";
1515
+ status: "running" | "failed" | "queued" | "succeeded";
1516
+ completed: number;
1517
+ total: number;
1518
+ error: string | null;
1519
+ createdAt: string;
1520
+ updatedAt: string;
1521
+ canRetry: boolean;
1522
+ }[];
1523
+ nextCursor: string | null;
1524
+ }>;
1525
+ retryOperation: (id: string) => Promise<{
1526
+ id: string;
1527
+ workspaceId: string;
1528
+ targetId: string | null;
1529
+ kind: "purge" | "delete_version";
1530
+ status: "running" | "failed" | "queued" | "succeeded";
1531
+ completed: number;
1532
+ total: number;
1533
+ error: string | null;
1534
+ createdAt: string;
1535
+ updatedAt: string;
1536
+ canRetry: boolean;
1537
+ }>;
1538
+ uploads: {
1539
+ start: (input: import("@sequenceholdings/platform/storage").StartStorageUpload) => Promise<{
1540
+ id: string;
1541
+ fileId: string;
1542
+ uploadUrl: string | null;
1543
+ expiresAt: string;
1544
+ state: "aborted" | "pending" | "complete";
1545
+ versionId: string | null;
1546
+ maxBytes: number;
1547
+ }>;
1548
+ get: (id: string) => Promise<{
1549
+ id: string;
1550
+ fileId: string;
1551
+ uploadUrl: string | null;
1552
+ expiresAt: string;
1553
+ state: "aborted" | "pending" | "complete";
1554
+ versionId: string | null;
1555
+ maxBytes: number;
1556
+ }>;
1557
+ complete: (id: string, input?: import("@sequenceholdings/platform/storage").CompleteStorageUpload) => Promise<{
1558
+ id: string;
1559
+ fileId: string;
1560
+ uploadUrl: string | null;
1561
+ expiresAt: string;
1562
+ state: "aborted" | "pending" | "complete";
1563
+ versionId: string | null;
1564
+ maxBytes: number;
1565
+ }>;
1566
+ abort: (id: string) => Promise<{
1567
+ id: string;
1568
+ fileId: string;
1569
+ uploadUrl: string | null;
1570
+ expiresAt: string;
1571
+ state: "aborted" | "pending" | "complete";
1572
+ versionId: string | null;
1573
+ maxBytes: number;
1574
+ }>;
1575
+ startBatch: (items: import("@sequenceholdings/platform/storage").StartStorageUpload[]) => Promise<{
1576
+ items: {
1577
+ id: string;
1578
+ fileId: string;
1579
+ uploadUrl: string | null;
1580
+ expiresAt: string;
1581
+ state: "aborted" | "pending" | "complete";
1582
+ versionId: string | null;
1583
+ maxBytes: number;
1584
+ }[];
1585
+ }>;
1586
+ list: () => Promise<{
1587
+ items: {
1588
+ id: string;
1589
+ fileId: string;
1590
+ name: string;
1591
+ state: "aborted" | "pending" | "complete";
1592
+ expiresAt: string;
1593
+ maxBytes: number;
1594
+ expectedSize: number | null;
1595
+ versionId: string | null;
1596
+ }[];
1597
+ limits: {
1598
+ perPrincipal: number;
1599
+ perWorkspace: number;
1600
+ };
1601
+ }>;
1602
+ reconcile: (input?: {
1603
+ abortIncomplete?: boolean;
1604
+ }) => Promise<{
1605
+ completed: {
1606
+ id: string;
1607
+ fileId: string;
1608
+ name: string;
1609
+ state: "aborted" | "pending" | "complete";
1610
+ expiresAt: string;
1611
+ maxBytes: number;
1612
+ expectedSize: number | null;
1613
+ versionId: string | null;
1614
+ code: string;
1615
+ message: string;
1616
+ }[];
1617
+ aborted: {
1618
+ id: string;
1619
+ fileId: string;
1620
+ name: string;
1621
+ state: "aborted" | "pending" | "complete";
1622
+ expiresAt: string;
1623
+ maxBytes: number;
1624
+ expectedSize: number | null;
1625
+ versionId: string | null;
1626
+ code: string;
1627
+ message: string;
1628
+ }[];
1629
+ pending: {
1630
+ id: string;
1631
+ fileId: string;
1632
+ name: string;
1633
+ state: "aborted" | "pending" | "complete";
1634
+ expiresAt: string;
1635
+ maxBytes: number;
1636
+ expectedSize: number | null;
1637
+ versionId: string | null;
1638
+ code: string;
1639
+ message: string;
1640
+ }[];
1641
+ }>;
1642
+ resume(id: string, source: import("@sequenceholdings/platform/storage").StorageUploadSource, options?: import("@sequenceholdings/platform/storage").StorageTransferOptions & {
1643
+ size?: number;
1644
+ }): Promise<{
1645
+ id: string;
1646
+ fileId: string;
1647
+ uploadUrl: string | null;
1648
+ expiresAt: string;
1649
+ state: "aborted" | "pending" | "complete";
1650
+ versionId: string | null;
1651
+ maxBytes: number;
1652
+ }>;
1653
+ put(input: Omit<import("@sequenceholdings/platform/storage").StartStorageUpload, "idempotencyKey"> & {
1654
+ idempotencyKey?: string;
1655
+ }, source: import("@sequenceholdings/platform/storage").StorageUploadSource, { keepSessionOnFailure, ...options }?: import("@sequenceholdings/platform/storage").StorageTransferOptions & {
1656
+ keepSessionOnFailure?: boolean;
1657
+ }): Promise<{
1658
+ id: string;
1659
+ fileId: string;
1660
+ uploadUrl: string | null;
1661
+ expiresAt: string;
1662
+ state: "aborted" | "pending" | "complete";
1663
+ versionId: string | null;
1664
+ maxBytes: number;
1665
+ }>;
1666
+ };
1667
+ };
1668
+ };
1669
+ };
1670
+ };
1671
+ export type FunctionPlatformDomains = ReturnType<typeof createFunctionPlatformDomains>;