@meistrari/vault-http-client 2.14.1 → 2.20.0
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/dist/index.cjs +295 -95
- package/dist/index.d.cts +485 -211
- package/dist/index.d.mts +485 -211
- package/dist/index.d.ts +485 -211
- package/dist/index.mjs +295 -95
- package/package.json +24 -23
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { makeApi, Zodios } from '@zodios/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
const postAssets_Body = z.object({
|
|
5
|
+
assetClass: z.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._:-]*$/),
|
|
6
|
+
subject: z.string().min(1).max(255),
|
|
7
|
+
mimeType: z.enum([
|
|
8
|
+
"image/png",
|
|
9
|
+
"image/jpeg",
|
|
10
|
+
"image/gif",
|
|
11
|
+
"image/webp",
|
|
12
|
+
"image/avif"
|
|
13
|
+
]),
|
|
14
|
+
size: z.number().int().gte(0).lte(9007199254740991).optional()
|
|
15
|
+
});
|
|
4
16
|
const postFiles_Body = z.object({
|
|
5
17
|
fileName: z.string(),
|
|
6
18
|
parentId: z.string(),
|
|
@@ -9,8 +21,7 @@ const postFiles_Body = z.object({
|
|
|
9
21
|
sha256sum: z.string(),
|
|
10
22
|
size: z.number(),
|
|
11
23
|
mimeType: z.string(),
|
|
12
|
-
createdBy: z.string()
|
|
13
|
-
path: z.string()
|
|
24
|
+
createdBy: z.string()
|
|
14
25
|
}).partial();
|
|
15
26
|
const postFilesBulk_Body = z.array(
|
|
16
27
|
z.object({
|
|
@@ -21,13 +32,29 @@ const postFilesBulk_Body = z.array(
|
|
|
21
32
|
sha256sum: z.string(),
|
|
22
33
|
size: z.number(),
|
|
23
34
|
mimeType: z.string(),
|
|
24
|
-
createdBy: z.string()
|
|
25
|
-
path: z.string()
|
|
35
|
+
createdBy: z.string()
|
|
26
36
|
}).partial()
|
|
27
37
|
);
|
|
28
|
-
const
|
|
38
|
+
const postFilesDownloadUrlsBulk_Body = z.object({
|
|
39
|
+
fileIds: z.array(z.string().min(1).max(1024)).min(1).max(100),
|
|
40
|
+
expiresIn: z.number().int().gte(1).lte(604800).optional(),
|
|
41
|
+
preserveFileName: z.boolean().optional().default(true)
|
|
42
|
+
});
|
|
43
|
+
const postFilesByFileIdMultipartPart_Body = z.object({
|
|
44
|
+
uploadId: z.string().min(1).max(4096),
|
|
45
|
+
partNumber: z.number().int().gte(1).lte(1e4)
|
|
46
|
+
});
|
|
47
|
+
const postFilesByFileIdMultipartComplete_Body = z.object({
|
|
48
|
+
uploadId: z.string().min(1).max(4096),
|
|
49
|
+
parts: z.array(
|
|
50
|
+
z.object({
|
|
51
|
+
partNumber: z.number().int().gte(1).lte(1e4),
|
|
52
|
+
etag: z.string().min(1).max(256)
|
|
53
|
+
})
|
|
54
|
+
).min(1).max(1e4)
|
|
55
|
+
});
|
|
56
|
+
const putWorkspacesByWorkspaceIdSettings_Body = z.object({
|
|
29
57
|
bucketName: z.string().min(1),
|
|
30
|
-
keyArns: z.array(z.string()).min(1),
|
|
31
58
|
defaultS3LinkTtl: z.number().gte(1)
|
|
32
59
|
});
|
|
33
60
|
const endpoints = makeApi([
|
|
@@ -126,7 +153,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
126
153
|
response: z.object({
|
|
127
154
|
id: z.string(),
|
|
128
155
|
uploadUrl: z.string().url(),
|
|
129
|
-
expiresAt: z.string().
|
|
156
|
+
expiresAt: z.string().regex(
|
|
157
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
158
|
+
).datetime({ offset: true }),
|
|
130
159
|
metadata: z.object({
|
|
131
160
|
id: z.string(),
|
|
132
161
|
path: z.string(),
|
|
@@ -137,7 +166,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
137
166
|
size: z.union([z.number(), z.null()]).optional(),
|
|
138
167
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
139
168
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
140
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
141
169
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
142
170
|
createdAt: z.string(),
|
|
143
171
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -166,6 +194,16 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
166
194
|
type: "Query",
|
|
167
195
|
schema: z.enum(["true", "false"]).optional().default("false")
|
|
168
196
|
},
|
|
197
|
+
{
|
|
198
|
+
name: "includeChildren",
|
|
199
|
+
type: "Query",
|
|
200
|
+
schema: z.enum(["true", "false"]).optional().default("false")
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "includeParent",
|
|
204
|
+
type: "Query",
|
|
205
|
+
schema: z.enum(["true", "false"]).optional().default("false")
|
|
206
|
+
},
|
|
169
207
|
{
|
|
170
208
|
name: "fileId",
|
|
171
209
|
type: "Path",
|
|
@@ -174,7 +212,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
174
212
|
],
|
|
175
213
|
response: z.object({
|
|
176
214
|
url: z.string(),
|
|
177
|
-
expiresAt: z.string().
|
|
215
|
+
expiresAt: z.string().regex(
|
|
216
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
217
|
+
).datetime({ offset: true }),
|
|
178
218
|
metadata: z.union([
|
|
179
219
|
z.object({
|
|
180
220
|
id: z.string(),
|
|
@@ -186,7 +226,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
186
226
|
size: z.union([z.number(), z.null()]).optional(),
|
|
187
227
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
188
228
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
189
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
190
229
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
191
230
|
createdAt: z.string(),
|
|
192
231
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -202,13 +241,12 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
202
241
|
size: z.union([z.number(), z.null()]).optional(),
|
|
203
242
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
204
243
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
205
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
206
244
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
207
245
|
createdAt: z.string(),
|
|
208
246
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
209
247
|
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
210
248
|
})
|
|
211
|
-
),
|
|
249
|
+
).optional(),
|
|
212
250
|
parent: z.union([
|
|
213
251
|
z.object({
|
|
214
252
|
id: z.string(),
|
|
@@ -220,14 +258,13 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
220
258
|
size: z.union([z.number(), z.null()]).optional(),
|
|
221
259
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
222
260
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
223
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
224
261
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
225
262
|
createdAt: z.string(),
|
|
226
263
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
227
264
|
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
228
265
|
}),
|
|
229
266
|
z.null()
|
|
230
|
-
])
|
|
267
|
+
]).optional()
|
|
231
268
|
}),
|
|
232
269
|
z.null()
|
|
233
270
|
])
|
|
@@ -272,7 +309,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
272
309
|
size: z.union([z.number(), z.null()]).optional(),
|
|
273
310
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
274
311
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
275
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
276
312
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
277
313
|
createdAt: z.string(),
|
|
278
314
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -316,7 +352,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
316
352
|
response: z.object({
|
|
317
353
|
id: z.string(),
|
|
318
354
|
uploadUrl: z.string().url(),
|
|
319
|
-
expiresAt: z.string().
|
|
355
|
+
expiresAt: z.string().regex(
|
|
356
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
357
|
+
).datetime({ offset: true }),
|
|
320
358
|
metadata: z.object({
|
|
321
359
|
id: z.string(),
|
|
322
360
|
path: z.string(),
|
|
@@ -327,7 +365,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
327
365
|
size: z.union([z.number(), z.null()]).optional(),
|
|
328
366
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
329
367
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
330
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
331
368
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
332
369
|
createdAt: z.string(),
|
|
333
370
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -381,7 +418,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
381
418
|
size: z.union([z.number(), z.null()]).optional(),
|
|
382
419
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
383
420
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
384
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
385
421
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
386
422
|
createdAt: z.string(),
|
|
387
423
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -454,7 +490,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
454
490
|
size: z.union([z.number(), z.null()]).optional(),
|
|
455
491
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
456
492
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
457
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
458
493
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
459
494
|
createdAt: z.string(),
|
|
460
495
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -474,7 +509,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
474
509
|
{
|
|
475
510
|
name: "body",
|
|
476
511
|
type: "Body",
|
|
477
|
-
schema:
|
|
512
|
+
schema: putWorkspacesByWorkspaceIdSettings_Body
|
|
478
513
|
},
|
|
479
514
|
{
|
|
480
515
|
name: "workspaceId",
|
|
@@ -505,7 +540,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
505
540
|
],
|
|
506
541
|
response: z.object({
|
|
507
542
|
bucketName: z.string().min(1),
|
|
508
|
-
keyArns: z.array(z.string()).min(1),
|
|
509
543
|
defaultS3LinkTtl: z.number().gte(1)
|
|
510
544
|
})
|
|
511
545
|
},
|
|
@@ -523,6 +557,86 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
523
557
|
],
|
|
524
558
|
response: z.void()
|
|
525
559
|
},
|
|
560
|
+
{
|
|
561
|
+
method: "post",
|
|
562
|
+
path: "/assets",
|
|
563
|
+
description: `Create an asset and get a pre-signed upload URL for the dedicated assets bucket.`,
|
|
564
|
+
requestFormat: "json",
|
|
565
|
+
parameters: [
|
|
566
|
+
{
|
|
567
|
+
name: "body",
|
|
568
|
+
type: "Body",
|
|
569
|
+
schema: postAssets_Body
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "expiresIn",
|
|
573
|
+
type: "Query",
|
|
574
|
+
schema: z.number().optional().default(3600)
|
|
575
|
+
}
|
|
576
|
+
],
|
|
577
|
+
response: z.object({
|
|
578
|
+
assetId: z.string(),
|
|
579
|
+
assetUrl: z.string().url(),
|
|
580
|
+
uploadUrl: z.string().url(),
|
|
581
|
+
expiresAt: z.string().regex(
|
|
582
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
583
|
+
).datetime({ offset: true }),
|
|
584
|
+
uploadHeaders: z.object({
|
|
585
|
+
"cache-control": z.string(),
|
|
586
|
+
"content-disposition": z.string(),
|
|
587
|
+
"content-type": z.string(),
|
|
588
|
+
"if-none-match": z.string()
|
|
589
|
+
}),
|
|
590
|
+
asset: z.object({
|
|
591
|
+
id: z.string(),
|
|
592
|
+
path: z.string(),
|
|
593
|
+
assetUrl: z.string().url(),
|
|
594
|
+
assetClass: z.string(),
|
|
595
|
+
subject: z.string(),
|
|
596
|
+
mimeType: z.string(),
|
|
597
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
598
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
599
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
600
|
+
createdAt: z.string(),
|
|
601
|
+
uploadedAt: z.union([z.string(), z.null()]).optional(),
|
|
602
|
+
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
603
|
+
})
|
|
604
|
+
})
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
method: "get",
|
|
608
|
+
path: "/assets/:assetId",
|
|
609
|
+
description: `Get a stored asset by ID, including its stable CloudFront URL.`,
|
|
610
|
+
requestFormat: "json",
|
|
611
|
+
parameters: [
|
|
612
|
+
{
|
|
613
|
+
name: "assetId",
|
|
614
|
+
type: "Path",
|
|
615
|
+
schema: z.string()
|
|
616
|
+
}
|
|
617
|
+
],
|
|
618
|
+
response: z.object({
|
|
619
|
+
id: z.string(),
|
|
620
|
+
path: z.string(),
|
|
621
|
+
assetUrl: z.string().url(),
|
|
622
|
+
assetClass: z.string(),
|
|
623
|
+
subject: z.string(),
|
|
624
|
+
mimeType: z.string(),
|
|
625
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
626
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
627
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
628
|
+
createdAt: z.string(),
|
|
629
|
+
uploadedAt: z.union([z.string(), z.null()]).optional(),
|
|
630
|
+
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
631
|
+
}),
|
|
632
|
+
errors: [
|
|
633
|
+
{
|
|
634
|
+
status: 404,
|
|
635
|
+
description: `Asset not found`,
|
|
636
|
+
schema: z.void()
|
|
637
|
+
}
|
|
638
|
+
]
|
|
639
|
+
},
|
|
526
640
|
{
|
|
527
641
|
method: "post",
|
|
528
642
|
path: "/files",
|
|
@@ -548,7 +662,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
548
662
|
response: z.object({
|
|
549
663
|
id: z.string(),
|
|
550
664
|
uploadUrl: z.string(),
|
|
551
|
-
expiresAt: z.string().
|
|
665
|
+
expiresAt: z.string().regex(
|
|
666
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
667
|
+
).datetime({ offset: true }),
|
|
552
668
|
metadata: z.object({
|
|
553
669
|
id: z.string(),
|
|
554
670
|
path: z.string(),
|
|
@@ -559,7 +675,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
559
675
|
size: z.union([z.number(), z.null()]).optional(),
|
|
560
676
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
561
677
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
562
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
563
678
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
564
679
|
createdAt: z.string(),
|
|
565
680
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -622,7 +737,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
622
737
|
size: z.union([z.number(), z.null()]).optional(),
|
|
623
738
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
624
739
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
625
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
626
740
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
627
741
|
createdAt: z.string(),
|
|
628
742
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -652,7 +766,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
652
766
|
],
|
|
653
767
|
response: z.object({
|
|
654
768
|
url: z.string(),
|
|
655
|
-
expiresAt: z.string().
|
|
769
|
+
expiresAt: z.string().regex(
|
|
770
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
771
|
+
).datetime({ offset: true }),
|
|
656
772
|
metadata: z.union([
|
|
657
773
|
z.object({
|
|
658
774
|
id: z.string(),
|
|
@@ -664,7 +780,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
664
780
|
size: z.union([z.number(), z.null()]).optional(),
|
|
665
781
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
666
782
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
667
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
668
783
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
669
784
|
createdAt: z.string(),
|
|
670
785
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -708,13 +823,93 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
708
823
|
size: z.union([z.number(), z.null()]).optional(),
|
|
709
824
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
710
825
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
711
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
712
826
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
713
827
|
createdAt: z.string(),
|
|
714
828
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
715
829
|
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
716
830
|
})
|
|
717
831
|
},
|
|
832
|
+
{
|
|
833
|
+
method: "post",
|
|
834
|
+
path: "/files/:fileId/multipart",
|
|
835
|
+
description: `Initiate a multipart upload for a file.`,
|
|
836
|
+
requestFormat: "json",
|
|
837
|
+
parameters: [
|
|
838
|
+
{
|
|
839
|
+
name: "fileId",
|
|
840
|
+
type: "Path",
|
|
841
|
+
schema: z.string()
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
response: z.object({ uploadId: z.string().min(1) })
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
method: "delete",
|
|
848
|
+
path: "/files/:fileId/multipart",
|
|
849
|
+
description: `Abort a multipart upload and discard its uploaded parts.`,
|
|
850
|
+
requestFormat: "json",
|
|
851
|
+
parameters: [
|
|
852
|
+
{
|
|
853
|
+
name: "uploadId",
|
|
854
|
+
type: "Query",
|
|
855
|
+
schema: z.string().min(1).max(4096)
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
name: "fileId",
|
|
859
|
+
type: "Path",
|
|
860
|
+
schema: z.string()
|
|
861
|
+
}
|
|
862
|
+
],
|
|
863
|
+
response: z.void()
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
method: "post",
|
|
867
|
+
path: "/files/:fileId/multipart/complete",
|
|
868
|
+
description: `Complete a multipart upload and assemble the file in S3.`,
|
|
869
|
+
requestFormat: "json",
|
|
870
|
+
parameters: [
|
|
871
|
+
{
|
|
872
|
+
name: "body",
|
|
873
|
+
type: "Body",
|
|
874
|
+
schema: postFilesByFileIdMultipartComplete_Body
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
name: "fileId",
|
|
878
|
+
type: "Path",
|
|
879
|
+
schema: z.string()
|
|
880
|
+
}
|
|
881
|
+
],
|
|
882
|
+
response: z.void()
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
method: "post",
|
|
886
|
+
path: "/files/:fileId/multipart/part",
|
|
887
|
+
description: `Get a pre-signed URL for one multipart upload part.`,
|
|
888
|
+
requestFormat: "json",
|
|
889
|
+
parameters: [
|
|
890
|
+
{
|
|
891
|
+
name: "body",
|
|
892
|
+
type: "Body",
|
|
893
|
+
schema: postFilesByFileIdMultipartPart_Body
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "expiresIn",
|
|
897
|
+
type: "Query",
|
|
898
|
+
schema: z.number().optional().default(3600)
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: "fileId",
|
|
902
|
+
type: "Path",
|
|
903
|
+
schema: z.string()
|
|
904
|
+
}
|
|
905
|
+
],
|
|
906
|
+
response: z.object({
|
|
907
|
+
uploadUrl: z.string().url(),
|
|
908
|
+
expiresAt: z.string().regex(
|
|
909
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
910
|
+
).datetime({ offset: true })
|
|
911
|
+
})
|
|
912
|
+
},
|
|
718
913
|
{
|
|
719
914
|
method: "post",
|
|
720
915
|
path: "/files/:fileId/permalinks",
|
|
@@ -727,7 +922,11 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
727
922
|
{
|
|
728
923
|
name: "body",
|
|
729
924
|
type: "Body",
|
|
730
|
-
schema: z.object({
|
|
925
|
+
schema: z.object({
|
|
926
|
+
expiresAt: z.string().regex(
|
|
927
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
928
|
+
).datetime({ offset: true })
|
|
929
|
+
}).partial()
|
|
731
930
|
},
|
|
732
931
|
{
|
|
733
932
|
name: "fileId",
|
|
@@ -739,7 +938,7 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
739
938
|
id: z.string(),
|
|
740
939
|
fileId: z.string(),
|
|
741
940
|
workspaceId: z.string(),
|
|
742
|
-
createdAt: z.string(),
|
|
941
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
743
942
|
expiresAt: z.union([z.string(), z.null()]),
|
|
744
943
|
createdBy: z.union([z.string(), z.null()])
|
|
745
944
|
})
|
|
@@ -761,46 +960,12 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
761
960
|
id: z.string(),
|
|
762
961
|
fileId: z.string(),
|
|
763
962
|
workspaceId: z.string(),
|
|
764
|
-
createdAt: z.string(),
|
|
963
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
765
964
|
expiresAt: z.union([z.string(), z.null()]),
|
|
766
965
|
createdBy: z.union([z.string(), z.null()])
|
|
767
966
|
})
|
|
768
967
|
)
|
|
769
968
|
},
|
|
770
|
-
{
|
|
771
|
-
method: "post",
|
|
772
|
-
path: "/files/:filename",
|
|
773
|
-
description: `Create a file and get a pre-signed upload URL (legacy endpoint).
|
|
774
|
-
|
|
775
|
-
This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
|
|
776
|
-
|
|
777
|
-
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
778
|
-
|
|
779
|
-
The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
780
|
-
`,
|
|
781
|
-
requestFormat: "json",
|
|
782
|
-
parameters: [
|
|
783
|
-
{
|
|
784
|
-
name: "body",
|
|
785
|
-
type: "Body",
|
|
786
|
-
schema: postFiles_Body
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
name: "expiresIn",
|
|
790
|
-
type: "Query",
|
|
791
|
-
schema: z.number().optional().default(3600)
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
name: "filename",
|
|
795
|
-
type: "Path",
|
|
796
|
-
schema: z.string()
|
|
797
|
-
}
|
|
798
|
-
],
|
|
799
|
-
response: z.object({
|
|
800
|
-
url: z.string(),
|
|
801
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
802
|
-
})
|
|
803
|
-
},
|
|
804
969
|
{
|
|
805
970
|
method: "put",
|
|
806
971
|
path: "/files/:id",
|
|
@@ -818,33 +983,28 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
818
983
|
schema: z.string()
|
|
819
984
|
}
|
|
820
985
|
],
|
|
821
|
-
response: z.
|
|
822
|
-
z.
|
|
986
|
+
response: z.object({
|
|
987
|
+
id: z.string(),
|
|
988
|
+
uploadUrl: z.string().url(),
|
|
989
|
+
expiresAt: z.string().regex(
|
|
990
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
991
|
+
).datetime({ offset: true }),
|
|
992
|
+
metadata: z.object({
|
|
823
993
|
id: z.string(),
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
837
|
-
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
838
|
-
createdAt: z.string(),
|
|
839
|
-
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
840
|
-
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
841
|
-
})
|
|
842
|
-
}),
|
|
843
|
-
z.object({
|
|
844
|
-
url: z.string().url(),
|
|
845
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
994
|
+
path: z.string(),
|
|
995
|
+
workspaceId: z.string(),
|
|
996
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
997
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
998
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
999
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
1000
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
1001
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
1002
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1003
|
+
createdAt: z.string(),
|
|
1004
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1005
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
846
1006
|
})
|
|
847
|
-
|
|
1007
|
+
})
|
|
848
1008
|
},
|
|
849
1009
|
{
|
|
850
1010
|
method: "delete",
|
|
@@ -882,7 +1042,6 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
882
1042
|
size: z.union([z.number(), z.null()]).optional(),
|
|
883
1043
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
884
1044
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
885
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
886
1045
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
887
1046
|
createdAt: z.string(),
|
|
888
1047
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -940,7 +1099,6 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
940
1099
|
size: z.union([z.number(), z.null()]).optional(),
|
|
941
1100
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
942
1101
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
943
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
944
1102
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
945
1103
|
createdAt: z.string(),
|
|
946
1104
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -966,7 +1124,9 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
966
1124
|
z.object({
|
|
967
1125
|
id: z.string(),
|
|
968
1126
|
uploadUrl: z.string(),
|
|
969
|
-
expiresAt: z.string().
|
|
1127
|
+
expiresAt: z.string().regex(
|
|
1128
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
1129
|
+
).datetime({ offset: true }),
|
|
970
1130
|
metadata: z.object({
|
|
971
1131
|
id: z.string(),
|
|
972
1132
|
path: z.string(),
|
|
@@ -977,7 +1137,6 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
977
1137
|
size: z.union([z.number(), z.null()]).optional(),
|
|
978
1138
|
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
979
1139
|
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
980
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
981
1140
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
982
1141
|
createdAt: z.string(),
|
|
983
1142
|
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
@@ -987,6 +1146,47 @@ The returned `url` is valid for 1 hour by default. You can change the
|
|
|
987
1146
|
})
|
|
988
1147
|
)
|
|
989
1148
|
},
|
|
1149
|
+
{
|
|
1150
|
+
method: "post",
|
|
1151
|
+
path: "/files/download-urls/bulk",
|
|
1152
|
+
description: `Read up to 100 files and sign their download URLs. Results preserve input order and duplicates. Missing, deleted and inaccessible files all return not_found.`,
|
|
1153
|
+
requestFormat: "json",
|
|
1154
|
+
parameters: [
|
|
1155
|
+
{
|
|
1156
|
+
name: "body",
|
|
1157
|
+
type: "Body",
|
|
1158
|
+
schema: postFilesDownloadUrlsBulk_Body
|
|
1159
|
+
}
|
|
1160
|
+
],
|
|
1161
|
+
response: z.array(
|
|
1162
|
+
z.union([
|
|
1163
|
+
z.object({
|
|
1164
|
+
id: z.string(),
|
|
1165
|
+
status: z.string(),
|
|
1166
|
+
url: z.string().url(),
|
|
1167
|
+
expiresAt: z.string().regex(
|
|
1168
|
+
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
|
|
1169
|
+
).datetime({ offset: true }),
|
|
1170
|
+
metadata: z.object({
|
|
1171
|
+
id: z.string(),
|
|
1172
|
+
path: z.string(),
|
|
1173
|
+
workspaceId: z.string(),
|
|
1174
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
1175
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
1176
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
1177
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
1178
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
1179
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
1180
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1181
|
+
createdAt: z.string(),
|
|
1182
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1183
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1184
|
+
})
|
|
1185
|
+
}),
|
|
1186
|
+
z.object({ id: z.string(), status: z.enum(["not_found", "error"]) })
|
|
1187
|
+
])
|
|
1188
|
+
)
|
|
1189
|
+
},
|
|
990
1190
|
{
|
|
991
1191
|
method: "get",
|
|
992
1192
|
path: "/permalinks/:permalinkId",
|
|
@@ -1046,7 +1246,7 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
1046
1246
|
id: z.string(),
|
|
1047
1247
|
fileId: z.string(),
|
|
1048
1248
|
workspaceId: z.string(),
|
|
1049
|
-
createdAt: z.string(),
|
|
1249
|
+
createdAt: z.string().datetime({ offset: true }),
|
|
1050
1250
|
expiresAt: z.union([z.string(), z.null()]),
|
|
1051
1251
|
createdBy: z.union([z.string(), z.null()])
|
|
1052
1252
|
}),
|
|
@@ -1064,7 +1264,7 @@ function createApiClient(baseUrl, options) {
|
|
|
1064
1264
|
return new Zodios(baseUrl, endpoints, options);
|
|
1065
1265
|
}
|
|
1066
1266
|
|
|
1067
|
-
const version = "
|
|
1267
|
+
const version = "v2.20.0";
|
|
1068
1268
|
const packageInfo = {
|
|
1069
1269
|
version: version};
|
|
1070
1270
|
|