@meistrari/vault-http-client 2.3.9 → 2.4.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 +311 -93
- package/dist/index.d.cts +2 -3910
- package/dist/index.d.mts +2 -3910
- package/dist/index.d.ts +2 -3910
- package/dist/index.mjs +311 -93
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,40 +1,34 @@
|
|
|
1
1
|
import { makeApi, Zodios } from '@zodios/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
const put_WorkspacesByWorkspaceIdSettings_Body = z.object({
|
|
5
|
-
bucketName: z.string().min(1),
|
|
6
|
-
keyArns: z.array(z.string()).min(1),
|
|
7
|
-
defaultS3LinkTtl: z.number().gte(1)
|
|
8
|
-
});
|
|
9
|
-
const post_Files_Body = z.object({
|
|
10
|
-
fileName: z.string(),
|
|
11
|
-
sha256sum: z.string().optional(),
|
|
12
|
-
size: z.number().optional(),
|
|
13
|
-
mimeType: z.string().optional(),
|
|
14
|
-
createdBy: z.string().optional(),
|
|
15
|
-
path: z.string().optional()
|
|
16
|
-
});
|
|
17
4
|
const postFilesBulk_Body = z.union([
|
|
18
5
|
z.array(
|
|
19
6
|
z.object({
|
|
20
7
|
fileName: z.string(),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
parentId: z.string(),
|
|
9
|
+
sha256sum: z.string(),
|
|
10
|
+
size: z.number(),
|
|
11
|
+
mimeType: z.string(),
|
|
12
|
+
createdBy: z.string(),
|
|
13
|
+
path: z.string()
|
|
14
|
+
}).partial()
|
|
27
15
|
),
|
|
28
16
|
z.object({ files: z.array(z.string()) })
|
|
29
17
|
]);
|
|
30
18
|
const postFiles_Body = z.object({
|
|
31
|
-
fileName: z.string()
|
|
19
|
+
fileName: z.string(),
|
|
20
|
+
parentId: z.string(),
|
|
32
21
|
sha256sum: z.string(),
|
|
33
22
|
size: z.number(),
|
|
34
23
|
mimeType: z.string(),
|
|
35
24
|
createdBy: z.string(),
|
|
36
25
|
path: z.string()
|
|
37
26
|
}).partial();
|
|
27
|
+
const put_WorkspacesByWorkspaceIdSettings_Body = z.object({
|
|
28
|
+
bucketName: z.string().min(1),
|
|
29
|
+
keyArns: z.array(z.string()).min(1),
|
|
30
|
+
defaultS3LinkTtl: z.number().gte(1)
|
|
31
|
+
});
|
|
38
32
|
const endpoints = makeApi([
|
|
39
33
|
{
|
|
40
34
|
method: "get",
|
|
@@ -109,7 +103,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
109
103
|
{
|
|
110
104
|
name: "body",
|
|
111
105
|
type: "Body",
|
|
112
|
-
schema:
|
|
106
|
+
schema: postFiles_Body
|
|
113
107
|
},
|
|
114
108
|
{
|
|
115
109
|
name: "expiresIn",
|
|
@@ -122,31 +116,27 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
122
116
|
schema: z.string()
|
|
123
117
|
}
|
|
124
118
|
],
|
|
125
|
-
response: z.
|
|
126
|
-
z.
|
|
119
|
+
response: z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
uploadUrl: z.string().url(),
|
|
122
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
123
|
+
metadata: z.object({
|
|
127
124
|
id: z.string(),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
createdAt: z.string(),
|
|
142
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
143
|
-
})
|
|
144
|
-
}),
|
|
145
|
-
z.object({
|
|
146
|
-
url: z.string(),
|
|
147
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
125
|
+
path: z.string(),
|
|
126
|
+
workspaceId: z.string(),
|
|
127
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
128
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
129
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
130
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
131
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
132
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
133
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
134
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
135
|
+
createdAt: z.string(),
|
|
136
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
137
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
148
138
|
})
|
|
149
|
-
|
|
139
|
+
})
|
|
150
140
|
},
|
|
151
141
|
{
|
|
152
142
|
method: "get",
|
|
@@ -178,6 +168,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
178
168
|
id: z.string(),
|
|
179
169
|
path: z.string(),
|
|
180
170
|
workspaceId: z.string(),
|
|
171
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
181
172
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
182
173
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
183
174
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -186,7 +177,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
186
177
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
187
178
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
188
179
|
createdAt: z.string(),
|
|
189
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
180
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
181
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
190
182
|
}),
|
|
191
183
|
z.null()
|
|
192
184
|
])
|
|
@@ -225,6 +217,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
225
217
|
id: z.string(),
|
|
226
218
|
path: z.string(),
|
|
227
219
|
workspaceId: z.string(),
|
|
220
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
228
221
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
229
222
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
230
223
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -233,7 +226,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
233
226
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
234
227
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
235
228
|
createdAt: z.string(),
|
|
236
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
229
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
230
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
237
231
|
}),
|
|
238
232
|
errors: [
|
|
239
233
|
{
|
|
@@ -270,31 +264,27 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
270
264
|
schema: z.string()
|
|
271
265
|
}
|
|
272
266
|
],
|
|
273
|
-
response: z.
|
|
274
|
-
z.
|
|
267
|
+
response: z.object({
|
|
268
|
+
id: z.string(),
|
|
269
|
+
uploadUrl: z.string().url(),
|
|
270
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
271
|
+
metadata: z.object({
|
|
275
272
|
id: z.string(),
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
createdAt: z.string(),
|
|
290
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
291
|
-
})
|
|
292
|
-
}),
|
|
293
|
-
z.object({
|
|
294
|
-
url: z.string().url(),
|
|
295
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
273
|
+
path: z.string(),
|
|
274
|
+
workspaceId: z.string(),
|
|
275
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
276
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
277
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
278
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
279
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
280
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
281
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
282
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
283
|
+
createdAt: z.string(),
|
|
284
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
285
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
296
286
|
})
|
|
297
|
-
|
|
287
|
+
})
|
|
298
288
|
},
|
|
299
289
|
{
|
|
300
290
|
method: "delete",
|
|
@@ -336,6 +326,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
336
326
|
id: z.string(),
|
|
337
327
|
path: z.string(),
|
|
338
328
|
workspaceId: z.string(),
|
|
329
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
339
330
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
340
331
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
341
332
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -344,7 +335,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
344
335
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
345
336
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
346
337
|
createdAt: z.string(),
|
|
347
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
338
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
339
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
348
340
|
}),
|
|
349
341
|
errors: [
|
|
350
342
|
{
|
|
@@ -408,6 +400,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
408
400
|
id: z.string(),
|
|
409
401
|
path: z.string(),
|
|
410
402
|
workspaceId: z.string(),
|
|
403
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
411
404
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
412
405
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
413
406
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -416,7 +409,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
416
409
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
417
410
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
418
411
|
createdAt: z.string(),
|
|
419
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
412
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
413
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
420
414
|
})
|
|
421
415
|
),
|
|
422
416
|
count: z.number(),
|
|
@@ -467,6 +461,20 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
467
461
|
defaultS3LinkTtl: z.number().gte(1)
|
|
468
462
|
})
|
|
469
463
|
},
|
|
464
|
+
{
|
|
465
|
+
method: "patch",
|
|
466
|
+
path: "/:id/uploaded-at",
|
|
467
|
+
description: `Set the uploaded at timestamp for a file.`,
|
|
468
|
+
requestFormat: "json",
|
|
469
|
+
parameters: [
|
|
470
|
+
{
|
|
471
|
+
name: "id",
|
|
472
|
+
type: "Path",
|
|
473
|
+
schema: z.string()
|
|
474
|
+
}
|
|
475
|
+
],
|
|
476
|
+
response: z.void()
|
|
477
|
+
},
|
|
470
478
|
{
|
|
471
479
|
method: "post",
|
|
472
480
|
path: "/files",
|
|
@@ -474,8 +482,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
474
482
|
|
|
475
483
|
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
476
484
|
|
|
477
|
-
The `filename` parameter is deprecated. Use the `originalFileName` parameter in the request body instead. Either way, the information about the file name is stored in the `metadata.originalFileName` field.
|
|
478
|
-
|
|
479
485
|
The returned `uploadUrl` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
480
486
|
`,
|
|
481
487
|
requestFormat: "json",
|
|
@@ -499,6 +505,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
499
505
|
id: z.string(),
|
|
500
506
|
path: z.string(),
|
|
501
507
|
workspaceId: z.string(),
|
|
508
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
502
509
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
503
510
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
504
511
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -507,8 +514,10 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
507
514
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
508
515
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
509
516
|
createdAt: z.string(),
|
|
510
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
511
|
-
|
|
517
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
518
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
519
|
+
}),
|
|
520
|
+
path: z.string()
|
|
512
521
|
})
|
|
513
522
|
},
|
|
514
523
|
{
|
|
@@ -531,6 +540,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
531
540
|
id: z.string(),
|
|
532
541
|
path: z.string(),
|
|
533
542
|
workspaceId: z.string(),
|
|
543
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
534
544
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
535
545
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
536
546
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -539,7 +549,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
539
549
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
540
550
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
541
551
|
createdAt: z.string(),
|
|
542
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
552
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
553
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
543
554
|
}),
|
|
544
555
|
z.null()
|
|
545
556
|
])
|
|
@@ -604,6 +615,40 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
604
615
|
})
|
|
605
616
|
)
|
|
606
617
|
},
|
|
618
|
+
{
|
|
619
|
+
method: "post",
|
|
620
|
+
path: "/files/:filename",
|
|
621
|
+
description: `Create a file and get a pre-signed upload URL (legacy endpoint).
|
|
622
|
+
|
|
623
|
+
This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
|
|
624
|
+
|
|
625
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
626
|
+
|
|
627
|
+
The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
628
|
+
`,
|
|
629
|
+
requestFormat: "json",
|
|
630
|
+
parameters: [
|
|
631
|
+
{
|
|
632
|
+
name: "body",
|
|
633
|
+
type: "Body",
|
|
634
|
+
schema: postFiles_Body
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: "expiresIn",
|
|
638
|
+
type: "Query",
|
|
639
|
+
schema: z.number().optional().default(3600)
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: "filename",
|
|
643
|
+
type: "Path",
|
|
644
|
+
schema: z.string()
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
response: z.object({
|
|
648
|
+
url: z.string(),
|
|
649
|
+
expiresAt: z.string().datetime({ offset: true })
|
|
650
|
+
})
|
|
651
|
+
},
|
|
607
652
|
{
|
|
608
653
|
method: "put",
|
|
609
654
|
path: "/files/:id",
|
|
@@ -630,6 +675,7 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
630
675
|
id: z.string(),
|
|
631
676
|
path: z.string(),
|
|
632
677
|
workspaceId: z.string(),
|
|
678
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
633
679
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
634
680
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
635
681
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -638,7 +684,8 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
638
684
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
639
685
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
640
686
|
createdAt: z.string(),
|
|
641
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
687
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
688
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
642
689
|
})
|
|
643
690
|
}),
|
|
644
691
|
z.object({
|
|
@@ -677,6 +724,7 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
677
724
|
id: z.string(),
|
|
678
725
|
path: z.string(),
|
|
679
726
|
workspaceId: z.string(),
|
|
727
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
680
728
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
681
729
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
682
730
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -685,7 +733,8 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
685
733
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
686
734
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
687
735
|
createdAt: z.string(),
|
|
688
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
736
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
737
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
689
738
|
}),
|
|
690
739
|
errors: [
|
|
691
740
|
{
|
|
@@ -695,6 +744,60 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
695
744
|
}
|
|
696
745
|
]
|
|
697
746
|
},
|
|
747
|
+
{
|
|
748
|
+
method: "get",
|
|
749
|
+
path: "/files/:parentId/children",
|
|
750
|
+
description: `Get the children of a file.`,
|
|
751
|
+
requestFormat: "json",
|
|
752
|
+
parameters: [
|
|
753
|
+
{
|
|
754
|
+
name: "mimeType",
|
|
755
|
+
type: "Query",
|
|
756
|
+
schema: z.string().optional()
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: "includeDeleted",
|
|
760
|
+
type: "Query",
|
|
761
|
+
schema: z.enum(["true", "false"]).optional().default("false")
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
name: "limit",
|
|
765
|
+
type: "Query",
|
|
766
|
+
schema: z.number().optional().default(100)
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
name: "offset",
|
|
770
|
+
type: "Query",
|
|
771
|
+
schema: z.number().optional().default(0)
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
name: "parentId",
|
|
775
|
+
type: "Path",
|
|
776
|
+
schema: z.string()
|
|
777
|
+
}
|
|
778
|
+
],
|
|
779
|
+
response: z.object({
|
|
780
|
+
files: z.array(
|
|
781
|
+
z.object({
|
|
782
|
+
id: z.string(),
|
|
783
|
+
path: z.string(),
|
|
784
|
+
workspaceId: z.string(),
|
|
785
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
786
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
787
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
788
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
789
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
790
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
791
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
792
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
793
|
+
createdAt: z.string(),
|
|
794
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
795
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
796
|
+
})
|
|
797
|
+
),
|
|
798
|
+
count: z.number()
|
|
799
|
+
})
|
|
800
|
+
},
|
|
698
801
|
{
|
|
699
802
|
method: "post",
|
|
700
803
|
path: "/files/bulk",
|
|
@@ -713,6 +816,7 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
713
816
|
id: z.string(),
|
|
714
817
|
path: z.string(),
|
|
715
818
|
workspaceId: z.string(),
|
|
819
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
716
820
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
717
821
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
718
822
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -721,7 +825,8 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
721
825
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
722
826
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
723
827
|
createdAt: z.string(),
|
|
724
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
828
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
829
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
725
830
|
})
|
|
726
831
|
),
|
|
727
832
|
z.object({
|
|
@@ -730,6 +835,7 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
730
835
|
id: z.string(),
|
|
731
836
|
path: z.string(),
|
|
732
837
|
workspaceId: z.string(),
|
|
838
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
733
839
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
734
840
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
735
841
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -738,7 +844,8 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
738
844
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
739
845
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
740
846
|
createdAt: z.string(),
|
|
741
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
847
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
848
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
742
849
|
})
|
|
743
850
|
)
|
|
744
851
|
})
|
|
@@ -815,6 +922,20 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
815
922
|
}
|
|
816
923
|
]
|
|
817
924
|
},
|
|
925
|
+
{
|
|
926
|
+
method: "patch",
|
|
927
|
+
path: "/v2/:id/uploaded-at",
|
|
928
|
+
description: `Set the uploaded at timestamp for a file.`,
|
|
929
|
+
requestFormat: "json",
|
|
930
|
+
parameters: [
|
|
931
|
+
{
|
|
932
|
+
name: "id",
|
|
933
|
+
type: "Path",
|
|
934
|
+
schema: z.string()
|
|
935
|
+
}
|
|
936
|
+
],
|
|
937
|
+
response: z.void()
|
|
938
|
+
},
|
|
818
939
|
{
|
|
819
940
|
method: "post",
|
|
820
941
|
path: "/v2/files",
|
|
@@ -822,8 +943,6 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
822
943
|
|
|
823
944
|
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
824
945
|
|
|
825
|
-
The `filename` parameter is deprecated. Use the `originalFileName` parameter in the request body instead. Either way, the information about the file name is stored in the `metadata.originalFileName` field.
|
|
826
|
-
|
|
827
946
|
The returned `uploadUrl` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
828
947
|
`,
|
|
829
948
|
requestFormat: "json",
|
|
@@ -847,6 +966,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
847
966
|
id: z.string(),
|
|
848
967
|
path: z.string(),
|
|
849
968
|
workspaceId: z.string(),
|
|
969
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
850
970
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
851
971
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
852
972
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -855,8 +975,10 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
855
975
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
856
976
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
857
977
|
createdAt: z.string(),
|
|
858
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
859
|
-
|
|
978
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
979
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
980
|
+
}),
|
|
981
|
+
path: z.string()
|
|
860
982
|
})
|
|
861
983
|
},
|
|
862
984
|
{
|
|
@@ -879,6 +1001,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
879
1001
|
id: z.string(),
|
|
880
1002
|
path: z.string(),
|
|
881
1003
|
workspaceId: z.string(),
|
|
1004
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
882
1005
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
883
1006
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
884
1007
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -887,7 +1010,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
887
1010
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
888
1011
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
889
1012
|
createdAt: z.string(),
|
|
890
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1013
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1014
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
891
1015
|
}),
|
|
892
1016
|
z.null()
|
|
893
1017
|
])
|
|
@@ -900,6 +1024,40 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
900
1024
|
}
|
|
901
1025
|
]
|
|
902
1026
|
},
|
|
1027
|
+
{
|
|
1028
|
+
method: "post",
|
|
1029
|
+
path: "/v2/files/:filename",
|
|
1030
|
+
description: `Create a file and get a pre-signed upload URL (legacy endpoint).
|
|
1031
|
+
|
|
1032
|
+
This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
|
|
1033
|
+
|
|
1034
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
1035
|
+
|
|
1036
|
+
The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
1037
|
+
`,
|
|
1038
|
+
requestFormat: "json",
|
|
1039
|
+
parameters: [
|
|
1040
|
+
{
|
|
1041
|
+
name: "body",
|
|
1042
|
+
type: "Body",
|
|
1043
|
+
schema: postFiles_Body
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "expiresIn",
|
|
1047
|
+
type: "Query",
|
|
1048
|
+
schema: z.number().optional().default(3600)
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
name: "filename",
|
|
1052
|
+
type: "Path",
|
|
1053
|
+
schema: z.string()
|
|
1054
|
+
}
|
|
1055
|
+
],
|
|
1056
|
+
response: z.object({
|
|
1057
|
+
url: z.string(),
|
|
1058
|
+
expiresAt: z.string().datetime({ offset: true })
|
|
1059
|
+
})
|
|
1060
|
+
},
|
|
903
1061
|
{
|
|
904
1062
|
method: "put",
|
|
905
1063
|
path: "/v2/files/:id",
|
|
@@ -926,6 +1084,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
926
1084
|
id: z.string(),
|
|
927
1085
|
path: z.string(),
|
|
928
1086
|
workspaceId: z.string(),
|
|
1087
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
929
1088
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
930
1089
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
931
1090
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -934,7 +1093,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
934
1093
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
935
1094
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
936
1095
|
createdAt: z.string(),
|
|
937
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1096
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1097
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
938
1098
|
})
|
|
939
1099
|
}),
|
|
940
1100
|
z.object({
|
|
@@ -973,6 +1133,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
973
1133
|
id: z.string(),
|
|
974
1134
|
path: z.string(),
|
|
975
1135
|
workspaceId: z.string(),
|
|
1136
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
976
1137
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
977
1138
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
978
1139
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -981,7 +1142,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
981
1142
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
982
1143
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
983
1144
|
createdAt: z.string(),
|
|
984
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1145
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1146
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
985
1147
|
}),
|
|
986
1148
|
errors: [
|
|
987
1149
|
{
|
|
@@ -991,6 +1153,60 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
991
1153
|
}
|
|
992
1154
|
]
|
|
993
1155
|
},
|
|
1156
|
+
{
|
|
1157
|
+
method: "get",
|
|
1158
|
+
path: "/v2/files/:parentId/children",
|
|
1159
|
+
description: `Get the children of a file.`,
|
|
1160
|
+
requestFormat: "json",
|
|
1161
|
+
parameters: [
|
|
1162
|
+
{
|
|
1163
|
+
name: "mimeType",
|
|
1164
|
+
type: "Query",
|
|
1165
|
+
schema: z.string().optional()
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "includeDeleted",
|
|
1169
|
+
type: "Query",
|
|
1170
|
+
schema: z.enum(["true", "false"]).optional().default("false")
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: "limit",
|
|
1174
|
+
type: "Query",
|
|
1175
|
+
schema: z.number().optional().default(100)
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: "offset",
|
|
1179
|
+
type: "Query",
|
|
1180
|
+
schema: z.number().optional().default(0)
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
name: "parentId",
|
|
1184
|
+
type: "Path",
|
|
1185
|
+
schema: z.string()
|
|
1186
|
+
}
|
|
1187
|
+
],
|
|
1188
|
+
response: z.object({
|
|
1189
|
+
files: z.array(
|
|
1190
|
+
z.object({
|
|
1191
|
+
id: z.string(),
|
|
1192
|
+
path: z.string(),
|
|
1193
|
+
workspaceId: z.string(),
|
|
1194
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
1195
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
1196
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
1197
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
1198
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
1199
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
1200
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1201
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1202
|
+
createdAt: z.string(),
|
|
1203
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1204
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1205
|
+
})
|
|
1206
|
+
),
|
|
1207
|
+
count: z.number()
|
|
1208
|
+
})
|
|
1209
|
+
},
|
|
994
1210
|
{
|
|
995
1211
|
method: "post",
|
|
996
1212
|
path: "/v2/files/bulk",
|
|
@@ -1009,6 +1225,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1009
1225
|
id: z.string(),
|
|
1010
1226
|
path: z.string(),
|
|
1011
1227
|
workspaceId: z.string(),
|
|
1228
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
1012
1229
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
1013
1230
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
1014
1231
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -1017,7 +1234,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1017
1234
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1018
1235
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1019
1236
|
createdAt: z.string(),
|
|
1020
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1237
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1238
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1021
1239
|
})
|
|
1022
1240
|
),
|
|
1023
1241
|
z.object({
|
|
@@ -1026,6 +1244,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1026
1244
|
id: z.string(),
|
|
1027
1245
|
path: z.string(),
|
|
1028
1246
|
workspaceId: z.string(),
|
|
1247
|
+
parentId: z.union([z.string(), z.null()]).optional(),
|
|
1029
1248
|
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
1030
1249
|
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
1031
1250
|
size: z.union([z.number(), z.null()]).optional(),
|
|
@@ -1034,7 +1253,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1034
1253
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1035
1254
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1036
1255
|
createdAt: z.string(),
|
|
1037
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1256
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1257
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1038
1258
|
})
|
|
1039
1259
|
)
|
|
1040
1260
|
})
|
|
@@ -1046,14 +1266,12 @@ function createApiClient(baseUrl, options) {
|
|
|
1046
1266
|
return new Zodios(baseUrl, endpoints, options);
|
|
1047
1267
|
}
|
|
1048
1268
|
|
|
1049
|
-
function useVaultClient(vaultUrl, token
|
|
1269
|
+
function useVaultClient(vaultUrl, token) {
|
|
1050
1270
|
const api = createApiClient(vaultUrl, {
|
|
1051
1271
|
axiosConfig: {
|
|
1052
1272
|
headers: {
|
|
1053
1273
|
Authorization: token,
|
|
1054
|
-
"User-Agent": "vault-http-client:2.
|
|
1055
|
-
"X-Compatibility-Date": "2025-09-17T10:33:21.181Z",
|
|
1056
|
-
...headerOverrides
|
|
1274
|
+
"User-Agent": "vault-http-client:2.4.0"
|
|
1057
1275
|
}
|
|
1058
1276
|
}
|
|
1059
1277
|
});
|