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