@sequenceholdings/storage 0.1.2 → 0.1.3
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.
- package/README.md +8 -0
- package/dist/client.d.ts +2 -529
- package/dist/client.js +16 -320
- package/dist/contracts.d.ts +2 -362
- package/dist/contracts.js +16 -230
- package/dist/crc32c.d.ts +2 -11
- package/dist/crc32c.js +16 -74
- package/dist/index.d.ts +2 -6
- package/dist/index.js +2 -6
- package/dist/paths.d.ts +2 -4
- package/dist/paths.js +16 -26
- package/dist/scope.d.ts +2 -15
- package/dist/scope.js +16 -40
- package/dist/transfer.d.ts +2 -34
- package/dist/transfer.js +16 -263
- package/package.json +3 -2
package/dist/contracts.d.ts
CHANGED
|
@@ -1,362 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const storageRole: z.ZodEnum<{
|
|
4
|
-
viewer: "viewer";
|
|
5
|
-
editor: "editor";
|
|
6
|
-
admin: "admin";
|
|
7
|
-
owner: "owner";
|
|
8
|
-
}>;
|
|
9
|
-
export type StorageRole = z.infer<typeof storageRole>;
|
|
10
|
-
export declare const storageLifecycle: z.ZodEnum<{
|
|
11
|
-
active: "active";
|
|
12
|
-
trashed: "trashed";
|
|
13
|
-
purging: "purging";
|
|
14
|
-
}>;
|
|
15
|
-
export declare const storageName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
16
|
-
export declare const storagePath: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
17
|
-
export declare const storageMetadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
18
|
-
export declare const workspaceManifestSchema: z.ZodObject<{
|
|
19
|
-
workspace: z.ZodObject<{
|
|
20
|
-
name: z.ZodString;
|
|
21
|
-
description: z.ZodDefault<z.ZodString>;
|
|
22
|
-
}, z.core.$strict>;
|
|
23
|
-
}, z.core.$strict>;
|
|
24
|
-
export type WorkspaceManifest = z.infer<typeof workspaceManifestSchema>;
|
|
25
|
-
export declare const workspaceSchema: z.ZodObject<{
|
|
26
|
-
id: z.ZodUUID;
|
|
27
|
-
name: z.ZodString;
|
|
28
|
-
description: z.ZodString;
|
|
29
|
-
environment: z.ZodString;
|
|
30
|
-
state: z.ZodEnum<{
|
|
31
|
-
active: "active";
|
|
32
|
-
trashed: "trashed";
|
|
33
|
-
purging: "purging";
|
|
34
|
-
}>;
|
|
35
|
-
revision: z.ZodNumber;
|
|
36
|
-
createdAt: z.ZodString;
|
|
37
|
-
role: z.ZodEnum<{
|
|
38
|
-
viewer: "viewer";
|
|
39
|
-
editor: "editor";
|
|
40
|
-
admin: "admin";
|
|
41
|
-
owner: "owner";
|
|
42
|
-
}>;
|
|
43
|
-
quotaBytes: z.ZodNumber;
|
|
44
|
-
usedBytes: z.ZodNumber;
|
|
45
|
-
reservedBytes: z.ZodNumber;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
export type StorageWorkspace = z.infer<typeof workspaceSchema>;
|
|
48
|
-
export declare const nodeSchema: z.ZodObject<{
|
|
49
|
-
id: z.ZodUUID;
|
|
50
|
-
workspaceId: z.ZodUUID;
|
|
51
|
-
parentId: z.ZodNullable<z.ZodUUID>;
|
|
52
|
-
name: z.ZodString;
|
|
53
|
-
kind: z.ZodEnum<{
|
|
54
|
-
file: "file";
|
|
55
|
-
folder: "folder";
|
|
56
|
-
}>;
|
|
57
|
-
state: z.ZodEnum<{
|
|
58
|
-
active: "active";
|
|
59
|
-
trashed: "trashed";
|
|
60
|
-
purging: "purging";
|
|
61
|
-
}>;
|
|
62
|
-
restricted: z.ZodBoolean;
|
|
63
|
-
revision: z.ZodNumber;
|
|
64
|
-
currentVersionId: z.ZodNullable<z.ZodUUID>;
|
|
65
|
-
metadata: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
66
|
-
createdAt: z.ZodString;
|
|
67
|
-
updatedAt: z.ZodString;
|
|
68
|
-
role: z.ZodEnum<{
|
|
69
|
-
viewer: "viewer";
|
|
70
|
-
editor: "editor";
|
|
71
|
-
admin: "admin";
|
|
72
|
-
}>;
|
|
73
|
-
size: z.ZodNullable<z.ZodNumber>;
|
|
74
|
-
contentType: z.ZodNullable<z.ZodString>;
|
|
75
|
-
}, z.core.$strip>;
|
|
76
|
-
export type StorageNode = z.infer<typeof nodeSchema>;
|
|
77
|
-
export declare const versionSchema: z.ZodObject<{
|
|
78
|
-
id: z.ZodUUID;
|
|
79
|
-
fileId: z.ZodUUID;
|
|
80
|
-
revision: z.ZodNumber;
|
|
81
|
-
size: z.ZodNumber;
|
|
82
|
-
checksum: z.ZodString;
|
|
83
|
-
contentType: z.ZodString;
|
|
84
|
-
createdAt: z.ZodString;
|
|
85
|
-
createdBy: z.ZodString;
|
|
86
|
-
state: z.ZodEnum<{
|
|
87
|
-
active: "active";
|
|
88
|
-
purging: "purging";
|
|
89
|
-
}>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
export type StorageVersion = z.infer<typeof versionSchema>;
|
|
92
|
-
export declare const operationSchema: z.ZodObject<{
|
|
93
|
-
id: z.ZodUUID;
|
|
94
|
-
workspaceId: z.ZodUUID;
|
|
95
|
-
targetId: z.ZodNullable<z.ZodUUID>;
|
|
96
|
-
kind: z.ZodEnum<{
|
|
97
|
-
purge: "purge";
|
|
98
|
-
delete_version: "delete_version";
|
|
99
|
-
}>;
|
|
100
|
-
status: z.ZodEnum<{
|
|
101
|
-
queued: "queued";
|
|
102
|
-
running: "running";
|
|
103
|
-
succeeded: "succeeded";
|
|
104
|
-
failed: "failed";
|
|
105
|
-
}>;
|
|
106
|
-
completed: z.ZodNumber;
|
|
107
|
-
total: z.ZodNumber;
|
|
108
|
-
error: z.ZodNullable<z.ZodString>;
|
|
109
|
-
createdAt: z.ZodString;
|
|
110
|
-
updatedAt: z.ZodString;
|
|
111
|
-
canRetry: z.ZodBoolean;
|
|
112
|
-
}, z.core.$strip>;
|
|
113
|
-
export type StorageOperation = z.infer<typeof operationSchema>;
|
|
114
|
-
/** `mine` lists the caller's own jobs; `workspace` every job (Admins and Sequence operators). */
|
|
115
|
-
export declare const storageOperationScope: z.ZodEnum<{
|
|
116
|
-
workspace: "workspace";
|
|
117
|
-
mine: "mine";
|
|
118
|
-
}>;
|
|
119
|
-
export type StorageOperationScope = z.infer<typeof storageOperationScope>;
|
|
120
|
-
export declare const listStorageOperationsSchema: z.ZodObject<{
|
|
121
|
-
before: z.ZodOptional<z.ZodUUID>;
|
|
122
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
123
|
-
scope: z.ZodDefault<z.ZodEnum<{
|
|
124
|
-
workspace: "workspace";
|
|
125
|
-
mine: "mine";
|
|
126
|
-
}>>;
|
|
127
|
-
}, z.core.$strip>;
|
|
128
|
-
export declare const storagePage: <T extends z.ZodType>(item: T) => z.ZodObject<{
|
|
129
|
-
items: z.ZodArray<T>;
|
|
130
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
131
|
-
}, z.core.$strip>;
|
|
132
|
-
export declare const listStorageSchema: z.ZodObject<{
|
|
133
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
134
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
135
|
-
q: z.ZodDefault<z.ZodString>;
|
|
136
|
-
sort: z.ZodDefault<z.ZodEnum<{
|
|
137
|
-
name: "name";
|
|
138
|
-
newest: "newest";
|
|
139
|
-
}>>;
|
|
140
|
-
}, z.core.$strip>;
|
|
141
|
-
export declare const createFolderSchema: z.ZodObject<{
|
|
142
|
-
parentId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
143
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
144
|
-
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
145
|
-
}, z.core.$strict>;
|
|
146
|
-
export declare const updateNodeSchema: z.ZodObject<{
|
|
147
|
-
expectedRevision: z.ZodNumber;
|
|
148
|
-
name: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
149
|
-
parentId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
150
|
-
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
151
|
-
}, z.core.$strict>;
|
|
152
|
-
/**
|
|
153
|
-
* Live pending upload sessions. Published on the capabilities and upload-list
|
|
154
|
-
* responses so callers can size a batch instead of discovering the cap from a
|
|
155
|
-
* 429. A batch registers at most one principal's cap in a single request.
|
|
156
|
-
*/
|
|
157
|
-
export declare const STORAGE_PENDING_UPLOADS_PER_PRINCIPAL = 20;
|
|
158
|
-
export declare const STORAGE_PENDING_UPLOADS_PER_WORKSPACE = 100;
|
|
159
|
-
export declare const STORAGE_UPLOAD_BATCH_LIMIT = 20;
|
|
160
|
-
/** Parallel byte transfers `seq-studio storage import` opens. */
|
|
161
|
-
export declare const STORAGE_IMPORT_CONCURRENCY_DEFAULT = 8;
|
|
162
|
-
export declare const STORAGE_IMPORT_CONCURRENCY_MAX = 16;
|
|
163
|
-
/** CRC32C in GCS's encoding: base64 of the big-endian uint32. */
|
|
164
|
-
export declare const storageChecksum: z.ZodString;
|
|
165
|
-
export declare const startUploadSchema: z.ZodObject<{
|
|
166
|
-
parentId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
167
|
-
path: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
168
|
-
fileId: z.ZodOptional<z.ZodUUID>;
|
|
169
|
-
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
171
|
-
contentType: z.ZodDefault<z.ZodString>;
|
|
172
|
-
checksum: z.ZodOptional<z.ZodString>;
|
|
173
|
-
idempotencyKey: z.ZodString;
|
|
174
|
-
}, z.core.$strict>;
|
|
175
|
-
export type StartStorageUpload = z.infer<typeof startUploadSchema>;
|
|
176
|
-
export declare const completeUploadSchema: z.ZodObject<{
|
|
177
|
-
crc32c: z.ZodOptional<z.ZodString>;
|
|
178
|
-
}, z.core.$strict>;
|
|
179
|
-
export type CompleteStorageUpload = z.infer<typeof completeUploadSchema>;
|
|
180
|
-
export declare const startUploadBatchSchema: z.ZodObject<{
|
|
181
|
-
items: z.ZodArray<z.ZodObject<{
|
|
182
|
-
parentId: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
|
|
183
|
-
path: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
184
|
-
fileId: z.ZodOptional<z.ZodUUID>;
|
|
185
|
-
expectedRevision: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
size: z.ZodOptional<z.ZodNumber>;
|
|
187
|
-
contentType: z.ZodDefault<z.ZodString>;
|
|
188
|
-
checksum: z.ZodOptional<z.ZodString>;
|
|
189
|
-
idempotencyKey: z.ZodString;
|
|
190
|
-
}, z.core.$strict>>;
|
|
191
|
-
}, z.core.$strict>;
|
|
192
|
-
export type StartStorageUploadBatch = z.infer<typeof startUploadBatchSchema>;
|
|
193
|
-
export declare const uploadSessionSchema: z.ZodObject<{
|
|
194
|
-
id: z.ZodUUID;
|
|
195
|
-
fileId: z.ZodUUID;
|
|
196
|
-
uploadUrl: z.ZodNullable<z.ZodURL>;
|
|
197
|
-
expiresAt: z.ZodString;
|
|
198
|
-
state: z.ZodEnum<{
|
|
199
|
-
pending: "pending";
|
|
200
|
-
complete: "complete";
|
|
201
|
-
aborted: "aborted";
|
|
202
|
-
}>;
|
|
203
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
204
|
-
maxBytes: z.ZodNumber;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
export type StorageUploadSession = z.infer<typeof uploadSessionSchema>;
|
|
207
|
-
/** A pending session without its bearer upload URL. */
|
|
208
|
-
export declare const uploadListItemSchema: z.ZodObject<{
|
|
209
|
-
id: z.ZodUUID;
|
|
210
|
-
fileId: z.ZodUUID;
|
|
211
|
-
name: z.ZodString;
|
|
212
|
-
state: z.ZodEnum<{
|
|
213
|
-
pending: "pending";
|
|
214
|
-
complete: "complete";
|
|
215
|
-
aborted: "aborted";
|
|
216
|
-
}>;
|
|
217
|
-
expiresAt: z.ZodString;
|
|
218
|
-
maxBytes: z.ZodNumber;
|
|
219
|
-
expectedSize: z.ZodNullable<z.ZodNumber>;
|
|
220
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
221
|
-
}, z.core.$strip>;
|
|
222
|
-
export type StorageUploadListItem = z.infer<typeof uploadListItemSchema>;
|
|
223
|
-
export declare const uploadLimitsSchema: z.ZodObject<{
|
|
224
|
-
perPrincipal: z.ZodNumber;
|
|
225
|
-
perWorkspace: z.ZodNumber;
|
|
226
|
-
}, z.core.$strip>;
|
|
227
|
-
export declare const uploadListSchema: z.ZodObject<{
|
|
228
|
-
items: z.ZodArray<z.ZodObject<{
|
|
229
|
-
id: z.ZodUUID;
|
|
230
|
-
fileId: z.ZodUUID;
|
|
231
|
-
name: z.ZodString;
|
|
232
|
-
state: z.ZodEnum<{
|
|
233
|
-
pending: "pending";
|
|
234
|
-
complete: "complete";
|
|
235
|
-
aborted: "aborted";
|
|
236
|
-
}>;
|
|
237
|
-
expiresAt: z.ZodString;
|
|
238
|
-
maxBytes: z.ZodNumber;
|
|
239
|
-
expectedSize: z.ZodNullable<z.ZodNumber>;
|
|
240
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
241
|
-
}, z.core.$strip>>;
|
|
242
|
-
limits: z.ZodObject<{
|
|
243
|
-
perPrincipal: z.ZodNumber;
|
|
244
|
-
perWorkspace: z.ZodNumber;
|
|
245
|
-
}, z.core.$strip>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
|
-
export declare const reconcileUploadsSchema: z.ZodObject<{
|
|
248
|
-
abortIncomplete: z.ZodDefault<z.ZodBoolean>;
|
|
249
|
-
}, z.core.$strict>;
|
|
250
|
-
export declare const reconcileUploadsResultSchema: z.ZodObject<{
|
|
251
|
-
completed: z.ZodArray<z.ZodObject<{
|
|
252
|
-
id: z.ZodUUID;
|
|
253
|
-
fileId: z.ZodUUID;
|
|
254
|
-
name: z.ZodString;
|
|
255
|
-
state: z.ZodEnum<{
|
|
256
|
-
pending: "pending";
|
|
257
|
-
complete: "complete";
|
|
258
|
-
aborted: "aborted";
|
|
259
|
-
}>;
|
|
260
|
-
expiresAt: z.ZodString;
|
|
261
|
-
maxBytes: z.ZodNumber;
|
|
262
|
-
expectedSize: z.ZodNullable<z.ZodNumber>;
|
|
263
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
264
|
-
code: z.ZodString;
|
|
265
|
-
message: z.ZodString;
|
|
266
|
-
}, z.core.$strip>>;
|
|
267
|
-
aborted: z.ZodArray<z.ZodObject<{
|
|
268
|
-
id: z.ZodUUID;
|
|
269
|
-
fileId: z.ZodUUID;
|
|
270
|
-
name: z.ZodString;
|
|
271
|
-
state: z.ZodEnum<{
|
|
272
|
-
pending: "pending";
|
|
273
|
-
complete: "complete";
|
|
274
|
-
aborted: "aborted";
|
|
275
|
-
}>;
|
|
276
|
-
expiresAt: z.ZodString;
|
|
277
|
-
maxBytes: z.ZodNumber;
|
|
278
|
-
expectedSize: z.ZodNullable<z.ZodNumber>;
|
|
279
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
280
|
-
code: z.ZodString;
|
|
281
|
-
message: z.ZodString;
|
|
282
|
-
}, z.core.$strip>>;
|
|
283
|
-
pending: z.ZodArray<z.ZodObject<{
|
|
284
|
-
id: z.ZodUUID;
|
|
285
|
-
fileId: z.ZodUUID;
|
|
286
|
-
name: z.ZodString;
|
|
287
|
-
state: z.ZodEnum<{
|
|
288
|
-
pending: "pending";
|
|
289
|
-
complete: "complete";
|
|
290
|
-
aborted: "aborted";
|
|
291
|
-
}>;
|
|
292
|
-
expiresAt: z.ZodString;
|
|
293
|
-
maxBytes: z.ZodNumber;
|
|
294
|
-
expectedSize: z.ZodNullable<z.ZodNumber>;
|
|
295
|
-
versionId: z.ZodNullable<z.ZodUUID>;
|
|
296
|
-
code: z.ZodString;
|
|
297
|
-
message: z.ZodString;
|
|
298
|
-
}, z.core.$strip>>;
|
|
299
|
-
}, z.core.$strip>;
|
|
300
|
-
export type ReconcileStorageUploads = z.infer<typeof reconcileUploadsSchema>;
|
|
301
|
-
export declare const storagePrincipalSchema: z.ZodObject<{
|
|
302
|
-
type: z.ZodEnum<{
|
|
303
|
-
user: "user";
|
|
304
|
-
group: "group";
|
|
305
|
-
organization: "organization";
|
|
306
|
-
service_account: "service_account";
|
|
307
|
-
}>;
|
|
308
|
-
id: z.ZodString;
|
|
309
|
-
role: z.ZodEnum<{
|
|
310
|
-
viewer: "viewer";
|
|
311
|
-
editor: "editor";
|
|
312
|
-
admin: "admin";
|
|
313
|
-
}>;
|
|
314
|
-
}, z.core.$strict>;
|
|
315
|
-
export type StorageGrant = z.infer<typeof storagePrincipalSchema>;
|
|
316
|
-
export declare const updateStorageAccessSchema: z.ZodObject<{
|
|
317
|
-
expectedRevision: z.ZodNumber;
|
|
318
|
-
restricted: z.ZodBoolean;
|
|
319
|
-
grants: z.ZodArray<z.ZodObject<{
|
|
320
|
-
type: z.ZodEnum<{
|
|
321
|
-
user: "user";
|
|
322
|
-
group: "group";
|
|
323
|
-
organization: "organization";
|
|
324
|
-
service_account: "service_account";
|
|
325
|
-
}>;
|
|
326
|
-
id: z.ZodString;
|
|
327
|
-
role: z.ZodEnum<{
|
|
328
|
-
viewer: "viewer";
|
|
329
|
-
editor: "editor";
|
|
330
|
-
admin: "admin";
|
|
331
|
-
}>;
|
|
332
|
-
}, z.core.$strict>>;
|
|
333
|
-
}, z.core.$strict>;
|
|
334
|
-
export declare const storageAccessSchema: z.ZodObject<{
|
|
335
|
-
revision: z.ZodNumber;
|
|
336
|
-
restricted: z.ZodBoolean;
|
|
337
|
-
grants: z.ZodArray<z.ZodObject<{
|
|
338
|
-
type: z.ZodEnum<{
|
|
339
|
-
user: "user";
|
|
340
|
-
group: "group";
|
|
341
|
-
organization: "organization";
|
|
342
|
-
service_account: "service_account";
|
|
343
|
-
}>;
|
|
344
|
-
id: z.ZodString;
|
|
345
|
-
role: z.ZodEnum<{
|
|
346
|
-
viewer: "viewer";
|
|
347
|
-
editor: "editor";
|
|
348
|
-
admin: "admin";
|
|
349
|
-
}>;
|
|
350
|
-
}, z.core.$strict>>;
|
|
351
|
-
owner: z.ZodNullable<z.ZodString>;
|
|
352
|
-
inherited: z.ZodBoolean;
|
|
353
|
-
workspaceAdminOverride: z.ZodLiteral<true>;
|
|
354
|
-
displayNames: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
355
|
-
}, z.core.$strip>;
|
|
356
|
-
export type StorageAccess = z.infer<typeof storageAccessSchema>;
|
|
357
|
-
export declare const storageErrorSchema: z.ZodObject<{
|
|
358
|
-
error: z.ZodObject<{
|
|
359
|
-
code: z.ZodString;
|
|
360
|
-
message: z.ZodString;
|
|
361
|
-
}, z.core.$strip>;
|
|
362
|
-
}, z.core.$strip>;
|
|
1
|
+
/** Runtime compatibility export; implementation lives in the platform SDK. */
|
|
2
|
+
export * from "@sequenceholdings/platform/storage";
|
package/dist/contracts.js
CHANGED
|
@@ -1,232 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.storageRole = zod_1.z.enum(['viewer', 'editor', 'admin', 'owner']);
|
|
8
|
-
exports.storageLifecycle = zod_1.z.enum(['active', 'trashed', 'purging']);
|
|
9
|
-
exports.storageName = zod_1.z.string().transform((value, ctx) => {
|
|
10
|
-
try {
|
|
11
|
-
return (0, paths_js_1.normalizeStorageName)(value);
|
|
12
|
-
}
|
|
13
|
-
catch (error) {
|
|
14
|
-
ctx.addIssue({
|
|
15
|
-
code: 'custom',
|
|
16
|
-
message: error instanceof Error ? error.message : 'Invalid name',
|
|
17
|
-
});
|
|
18
|
-
return zod_1.z.NEVER;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
exports.storagePath = zod_1.z.string().transform((value, ctx) => {
|
|
22
|
-
try {
|
|
23
|
-
return (0, paths_js_1.splitStoragePath)(value).join('/');
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
24
7
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
exports
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports.workspaceManifestSchema = zod_1.z.strictObject({
|
|
37
|
-
workspace: zod_1.z.strictObject({
|
|
38
|
-
name: zod_1.z.string().regex(/^[a-z][a-z0-9-]{1,62}$/),
|
|
39
|
-
description: zod_1.z.string().max(2000).default(''),
|
|
40
|
-
}),
|
|
41
|
-
});
|
|
42
|
-
exports.workspaceSchema = zod_1.z.object({
|
|
43
|
-
id: exports.storageId,
|
|
44
|
-
name: zod_1.z.string(),
|
|
45
|
-
description: zod_1.z.string(),
|
|
46
|
-
environment: zod_1.z.string(),
|
|
47
|
-
state: exports.storageLifecycle,
|
|
48
|
-
revision: zod_1.z.number().int(),
|
|
49
|
-
createdAt: zod_1.z.string(),
|
|
50
|
-
role: exports.storageRole,
|
|
51
|
-
quotaBytes: zod_1.z.number(),
|
|
52
|
-
usedBytes: zod_1.z.number(),
|
|
53
|
-
reservedBytes: zod_1.z.number(),
|
|
54
|
-
});
|
|
55
|
-
exports.nodeSchema = zod_1.z.object({
|
|
56
|
-
id: exports.storageId,
|
|
57
|
-
workspaceId: exports.storageId,
|
|
58
|
-
parentId: exports.storageId.nullable(),
|
|
59
|
-
name: zod_1.z.string(),
|
|
60
|
-
kind: zod_1.z.enum(['folder', 'file']),
|
|
61
|
-
state: exports.storageLifecycle,
|
|
62
|
-
restricted: zod_1.z.boolean(),
|
|
63
|
-
revision: zod_1.z.number().int(),
|
|
64
|
-
currentVersionId: exports.storageId.nullable(),
|
|
65
|
-
metadata: exports.storageMetadata,
|
|
66
|
-
createdAt: zod_1.z.string(),
|
|
67
|
-
updatedAt: zod_1.z.string(),
|
|
68
|
-
role: exports.storageRole.exclude(['owner']),
|
|
69
|
-
size: zod_1.z.number().nullable(),
|
|
70
|
-
contentType: zod_1.z.string().nullable(),
|
|
71
|
-
});
|
|
72
|
-
exports.versionSchema = zod_1.z.object({
|
|
73
|
-
id: exports.storageId,
|
|
74
|
-
fileId: exports.storageId,
|
|
75
|
-
revision: zod_1.z.number().int(),
|
|
76
|
-
size: zod_1.z.number(),
|
|
77
|
-
checksum: zod_1.z.string(),
|
|
78
|
-
contentType: zod_1.z.string(),
|
|
79
|
-
createdAt: zod_1.z.string(),
|
|
80
|
-
createdBy: zod_1.z.string(),
|
|
81
|
-
state: zod_1.z.enum(['active', 'purging']),
|
|
82
|
-
});
|
|
83
|
-
exports.operationSchema = zod_1.z.object({
|
|
84
|
-
id: exports.storageId,
|
|
85
|
-
workspaceId: exports.storageId,
|
|
86
|
-
targetId: exports.storageId.nullable(),
|
|
87
|
-
kind: zod_1.z.enum(['purge', 'delete_version']),
|
|
88
|
-
status: zod_1.z.enum(['queued', 'running', 'succeeded', 'failed']),
|
|
89
|
-
completed: zod_1.z.number().int(),
|
|
90
|
-
total: zod_1.z.number().int(),
|
|
91
|
-
error: zod_1.z.string().nullable(),
|
|
92
|
-
createdAt: zod_1.z.string(),
|
|
93
|
-
updatedAt: zod_1.z.string(),
|
|
94
|
-
/** The caller may retry once failed: its initiator, the workspace Owner, or a Sequence operator. */
|
|
95
|
-
canRetry: zod_1.z.boolean(),
|
|
96
|
-
});
|
|
97
|
-
/** `mine` lists the caller's own jobs; `workspace` every job (Admins and Sequence operators). */
|
|
98
|
-
exports.storageOperationScope = zod_1.z.enum(['mine', 'workspace']);
|
|
99
|
-
exports.listStorageOperationsSchema = zod_1.z.object({
|
|
100
|
-
before: exports.storageId.optional(),
|
|
101
|
-
limit: zod_1.z.coerce.number().int().min(1).max(100).default(50),
|
|
102
|
-
scope: exports.storageOperationScope.default('mine'),
|
|
103
|
-
});
|
|
104
|
-
const storagePage = (item) => zod_1.z.object({
|
|
105
|
-
items: zod_1.z.array(item),
|
|
106
|
-
nextCursor: zod_1.z.string().nullable(),
|
|
107
|
-
});
|
|
108
|
-
exports.storagePage = storagePage;
|
|
109
|
-
exports.listStorageSchema = zod_1.z.object({
|
|
110
|
-
limit: zod_1.z.coerce.number().int().min(1).max(100).default(50),
|
|
111
|
-
cursor: zod_1.z.string().max(2048).optional(),
|
|
112
|
-
q: zod_1.z.string().max(255).default(''),
|
|
113
|
-
sort: zod_1.z.enum(['name', 'newest']).default('name'),
|
|
114
|
-
});
|
|
115
|
-
exports.createFolderSchema = zod_1.z.strictObject({
|
|
116
|
-
parentId: exports.storageId.nullable().default(null),
|
|
117
|
-
name: exports.storageName,
|
|
118
|
-
/** A replay by the same principal returns the folder this key created. */
|
|
119
|
-
idempotencyKey: zod_1.z.string().min(1).max(128).optional(),
|
|
120
|
-
});
|
|
121
|
-
exports.updateNodeSchema = zod_1.z.strictObject({
|
|
122
|
-
expectedRevision: zod_1.z.number().int().nonnegative(),
|
|
123
|
-
name: exports.storageName.optional(),
|
|
124
|
-
parentId: exports.storageId.nullable().optional(),
|
|
125
|
-
metadata: exports.storageMetadata.optional(),
|
|
126
|
-
});
|
|
127
|
-
/**
|
|
128
|
-
* Live pending upload sessions. Published on the capabilities and upload-list
|
|
129
|
-
* responses so callers can size a batch instead of discovering the cap from a
|
|
130
|
-
* 429. A batch registers at most one principal's cap in a single request.
|
|
131
|
-
*/
|
|
132
|
-
exports.STORAGE_PENDING_UPLOADS_PER_PRINCIPAL = 20;
|
|
133
|
-
exports.STORAGE_PENDING_UPLOADS_PER_WORKSPACE = 100;
|
|
134
|
-
exports.STORAGE_UPLOAD_BATCH_LIMIT = exports.STORAGE_PENDING_UPLOADS_PER_PRINCIPAL;
|
|
135
|
-
/** Parallel byte transfers `seq-studio storage import` opens. */
|
|
136
|
-
exports.STORAGE_IMPORT_CONCURRENCY_DEFAULT = 8;
|
|
137
|
-
exports.STORAGE_IMPORT_CONCURRENCY_MAX = 16;
|
|
138
|
-
/** CRC32C in GCS's encoding: base64 of the big-endian uint32. */
|
|
139
|
-
exports.storageChecksum = zod_1.z.string().regex(/^[A-Za-z0-9+/]{6}==$/);
|
|
140
|
-
exports.startUploadSchema = zod_1.z
|
|
141
|
-
.strictObject({
|
|
142
|
-
parentId: exports.storageId.nullable().default(null),
|
|
143
|
-
path: exports.storagePath,
|
|
144
|
-
fileId: exports.storageId.optional(),
|
|
145
|
-
expectedRevision: zod_1.z.number().int().nonnegative().optional(),
|
|
146
|
-
size: zod_1.z.number().int().nonnegative().safe().optional(),
|
|
147
|
-
contentType: zod_1.z
|
|
148
|
-
.string()
|
|
149
|
-
.max(255)
|
|
150
|
-
.regex(/^[\w!#$&^.+-]+\/[\w!#$&^.+-]+$/)
|
|
151
|
-
.default('application/octet-stream'),
|
|
152
|
-
/** CRC32C the producer knows in advance; completion rejects any other object. */
|
|
153
|
-
checksum: exports.storageChecksum.optional(),
|
|
154
|
-
idempotencyKey: zod_1.z.string().min(1).max(128),
|
|
155
|
-
})
|
|
156
|
-
.refine((v) => Boolean(v.fileId) === (v.expectedRevision !== undefined), {
|
|
157
|
-
message: 'Replacement requires both fileId and expectedRevision',
|
|
158
|
-
});
|
|
159
|
-
exports.completeUploadSchema = zod_1.z.strictObject({
|
|
160
|
-
/**
|
|
161
|
-
* CRC32C the SDK computed over the source it sent, from byte zero. Completion
|
|
162
|
-
* rejects and aborts the session when the stored object differs. Optional
|
|
163
|
-
* until every in-repo consumer sends it; then it becomes required.
|
|
164
|
-
*/
|
|
165
|
-
crc32c: exports.storageChecksum.optional(),
|
|
166
|
-
});
|
|
167
|
-
exports.startUploadBatchSchema = zod_1.z.strictObject({
|
|
168
|
-
items: zod_1.z.array(exports.startUploadSchema).min(1).max(exports.STORAGE_UPLOAD_BATCH_LIMIT),
|
|
169
|
-
});
|
|
170
|
-
exports.uploadSessionSchema = zod_1.z.object({
|
|
171
|
-
id: exports.storageId,
|
|
172
|
-
fileId: exports.storageId,
|
|
173
|
-
uploadUrl: zod_1.z.url().nullable(),
|
|
174
|
-
expiresAt: zod_1.z.string(),
|
|
175
|
-
state: zod_1.z.enum(['pending', 'complete', 'aborted']),
|
|
176
|
-
versionId: exports.storageId.nullable(),
|
|
177
|
-
maxBytes: zod_1.z.number().int(),
|
|
178
|
-
});
|
|
179
|
-
/** A pending session without its bearer upload URL. */
|
|
180
|
-
exports.uploadListItemSchema = zod_1.z.object({
|
|
181
|
-
id: exports.storageId,
|
|
182
|
-
fileId: exports.storageId,
|
|
183
|
-
name: zod_1.z.string(),
|
|
184
|
-
state: zod_1.z.enum(['pending', 'complete', 'aborted']),
|
|
185
|
-
expiresAt: zod_1.z.string(),
|
|
186
|
-
maxBytes: zod_1.z.number().int(),
|
|
187
|
-
expectedSize: zod_1.z.number().int().nullable(),
|
|
188
|
-
versionId: exports.storageId.nullable(),
|
|
189
|
-
});
|
|
190
|
-
exports.uploadLimitsSchema = zod_1.z.object({
|
|
191
|
-
perPrincipal: zod_1.z.number().int(),
|
|
192
|
-
perWorkspace: zod_1.z.number().int(),
|
|
193
|
-
});
|
|
194
|
-
exports.uploadListSchema = zod_1.z.object({
|
|
195
|
-
items: zod_1.z.array(exports.uploadListItemSchema),
|
|
196
|
-
limits: exports.uploadLimitsSchema,
|
|
197
|
-
});
|
|
198
|
-
exports.reconcileUploadsSchema = zod_1.z.strictObject({
|
|
199
|
-
/** Abort sessions whose bytes never arrived. Terminal mismatches are already released. */
|
|
200
|
-
abortIncomplete: zod_1.z.boolean().default(false),
|
|
201
|
-
});
|
|
202
|
-
const reconcileEntrySchema = exports.uploadListItemSchema.extend({
|
|
203
|
-
code: zod_1.z.string(),
|
|
204
|
-
message: zod_1.z.string(),
|
|
205
|
-
});
|
|
206
|
-
exports.reconcileUploadsResultSchema = zod_1.z.object({
|
|
207
|
-
completed: zod_1.z.array(reconcileEntrySchema),
|
|
208
|
-
aborted: zod_1.z.array(reconcileEntrySchema),
|
|
209
|
-
pending: zod_1.z.array(reconcileEntrySchema),
|
|
210
|
-
});
|
|
211
|
-
exports.storagePrincipalSchema = zod_1.z.strictObject({
|
|
212
|
-
type: zod_1.z.enum(['user', 'group', 'organization', 'service_account']),
|
|
213
|
-
id: zod_1.z.string().min(1).max(255),
|
|
214
|
-
role: exports.storageRole.exclude(['owner']),
|
|
215
|
-
});
|
|
216
|
-
exports.updateStorageAccessSchema = zod_1.z.strictObject({
|
|
217
|
-
expectedRevision: zod_1.z.number().int().nonnegative(),
|
|
218
|
-
restricted: zod_1.z.boolean(),
|
|
219
|
-
grants: zod_1.z.array(exports.storagePrincipalSchema).max(40),
|
|
220
|
-
});
|
|
221
|
-
exports.storageAccessSchema = zod_1.z.object({
|
|
222
|
-
revision: zod_1.z.number().int(),
|
|
223
|
-
restricted: zod_1.z.boolean(),
|
|
224
|
-
grants: zod_1.z.array(exports.storagePrincipalSchema),
|
|
225
|
-
owner: zod_1.z.string().nullable(),
|
|
226
|
-
inherited: zod_1.z.boolean(),
|
|
227
|
-
workspaceAdminOverride: zod_1.z.literal(true),
|
|
228
|
-
displayNames: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).default({}),
|
|
229
|
-
});
|
|
230
|
-
exports.storageErrorSchema = zod_1.z.object({
|
|
231
|
-
error: zod_1.z.object({ code: zod_1.z.string(), message: zod_1.z.string() }),
|
|
232
|
-
});
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/** Runtime compatibility export; implementation lives in the platform SDK. */
|
|
18
|
+
__exportStar(require("@sequenceholdings/platform/storage"), exports);
|
package/dist/crc32c.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
3
|
-
#private;
|
|
4
|
-
update(bytes: Uint8Array): this;
|
|
5
|
-
/** The checksum of everything passed to `update` so far, as a uint32. */
|
|
6
|
-
value(): number;
|
|
7
|
-
/** The checksum in GCS's encoding. Does not reset; `update` may continue. */
|
|
8
|
-
digest(): string;
|
|
9
|
-
}
|
|
10
|
-
/** One-shot CRC32C of `bytes` in GCS's base64 encoding. */
|
|
11
|
-
export declare function crc32c(bytes: Uint8Array): string;
|
|
1
|
+
/** Runtime compatibility export; implementation lives in the platform SDK. */
|
|
2
|
+
export * from "@sequenceholdings/platform/storage";
|