@meistrari/vault-http-client 2.10.0 → 2.17.6

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,22 +3,18 @@
3
3
  const core = require('@zodios/core');
4
4
  const zod = require('zod');
5
5
 
6
- const postFilesBulk_Body = zod.z.union([
7
- zod.z.array(
8
- zod.z.object({
9
- fileName: zod.z.string(),
10
- parentId: zod.z.string(),
11
- onMissingParent: zod.z.enum(["error", "create-as-root"]).default("error"),
12
- onParentConflict: zod.z.enum(["error", "update-parent-id", "ignore"]).default("error"),
13
- sha256sum: zod.z.string(),
14
- size: zod.z.number(),
15
- mimeType: zod.z.string(),
16
- createdBy: zod.z.string(),
17
- path: zod.z.string()
18
- }).partial()
19
- ),
20
- zod.z.object({ files: zod.z.array(zod.z.string()) })
21
- ]);
6
+ const postAssets_Body = zod.z.object({
7
+ assetClass: zod.z.string().min(1).max(128).regex(/^[a-z0-9][a-z0-9._:-]*$/),
8
+ subject: zod.z.string().min(1).max(255),
9
+ mimeType: zod.z.enum([
10
+ "image/png",
11
+ "image/jpeg",
12
+ "image/gif",
13
+ "image/webp",
14
+ "image/avif"
15
+ ]),
16
+ size: zod.z.number().int().gte(0).lte(9007199254740991).optional()
17
+ });
22
18
  const postFiles_Body = zod.z.object({
23
19
  fileName: zod.z.string(),
24
20
  parentId: zod.z.string(),
@@ -27,10 +23,34 @@ const postFiles_Body = zod.z.object({
27
23
  sha256sum: zod.z.string(),
28
24
  size: zod.z.number(),
29
25
  mimeType: zod.z.string(),
30
- createdBy: zod.z.string(),
31
- path: zod.z.string()
26
+ createdBy: zod.z.string()
32
27
  }).partial();
33
- const put_WorkspacesByWorkspaceIdSettings_Body = zod.z.object({
28
+ const postFilesBulk_Body = zod.z.array(
29
+ zod.z.object({
30
+ fileName: zod.z.string(),
31
+ parentId: zod.z.string(),
32
+ onMissingParent: zod.z.enum(["error", "create-as-root"]).default("error"),
33
+ onParentConflict: zod.z.enum(["error", "update-parent-id", "ignore"]).default("error"),
34
+ sha256sum: zod.z.string(),
35
+ size: zod.z.number(),
36
+ mimeType: zod.z.string(),
37
+ createdBy: zod.z.string()
38
+ }).partial()
39
+ );
40
+ const postFilesByFileIdMultipartPart_Body = zod.z.object({
41
+ uploadId: zod.z.string().min(1).max(4096),
42
+ partNumber: zod.z.number().int().gte(1).lte(1e4)
43
+ });
44
+ const postFilesByFileIdMultipartComplete_Body = zod.z.object({
45
+ uploadId: zod.z.string().min(1).max(4096),
46
+ parts: zod.z.array(
47
+ zod.z.object({
48
+ partNumber: zod.z.number().int().gte(1).lte(1e4),
49
+ etag: zod.z.string().min(1).max(256)
50
+ })
51
+ ).min(1).max(1e4)
52
+ });
53
+ const putWorkspacesByWorkspaceIdSettings_Body = zod.z.object({
34
54
  bucketName: zod.z.string().min(1),
35
55
  keyArns: zod.z.array(zod.z.string()).min(1),
36
56
  defaultS3LinkTtl: zod.z.number().gte(1)
@@ -131,7 +151,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
131
151
  response: zod.z.object({
132
152
  id: zod.z.string(),
133
153
  uploadUrl: zod.z.string().url(),
134
- expiresAt: zod.z.string().datetime({ offset: true }),
154
+ expiresAt: zod.z.string().regex(
155
+ /^(?:(?:\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))$/
156
+ ).datetime({ offset: true }),
135
157
  metadata: zod.z.object({
136
158
  id: zod.z.string(),
137
159
  path: zod.z.string(),
@@ -171,6 +193,16 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
171
193
  type: "Query",
172
194
  schema: zod.z.enum(["true", "false"]).optional().default("false")
173
195
  },
196
+ {
197
+ name: "includeChildren",
198
+ type: "Query",
199
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
200
+ },
201
+ {
202
+ name: "includeParent",
203
+ type: "Query",
204
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
205
+ },
174
206
  {
175
207
  name: "fileId",
176
208
  type: "Path",
@@ -179,7 +211,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
179
211
  ],
180
212
  response: zod.z.object({
181
213
  url: zod.z.string(),
182
- expiresAt: zod.z.string().datetime({ offset: true }),
214
+ expiresAt: zod.z.string().regex(
215
+ /^(?:(?:\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))$/
216
+ ).datetime({ offset: true }),
183
217
  metadata: zod.z.union([
184
218
  zod.z.object({
185
219
  id: zod.z.string(),
@@ -213,7 +247,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
213
247
  deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
214
248
  uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
215
249
  })
216
- ),
250
+ ).optional(),
217
251
  parent: zod.z.union([
218
252
  zod.z.object({
219
253
  id: zod.z.string(),
@@ -232,7 +266,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
232
266
  uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
233
267
  }),
234
268
  zod.z.null()
235
- ])
269
+ ]).optional()
236
270
  }),
237
271
  zod.z.null()
238
272
  ])
@@ -321,7 +355,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
321
355
  response: zod.z.object({
322
356
  id: zod.z.string(),
323
357
  uploadUrl: zod.z.string().url(),
324
- expiresAt: zod.z.string().datetime({ offset: true }),
358
+ expiresAt: zod.z.string().regex(
359
+ /^(?:(?:\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))$/
360
+ ).datetime({ offset: true }),
325
361
  metadata: zod.z.object({
326
362
  id: zod.z.string(),
327
363
  path: zod.z.string(),
@@ -408,7 +444,6 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
408
444
  response: zod.z.array(
409
445
  zod.z.object({
410
446
  workspaceId: zod.z.string(),
411
- files: zod.z.number(),
412
447
  permalinks: zod.z.number(),
413
448
  hasCustomSettings: zod.z.boolean()
414
449
  })
@@ -480,7 +515,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
480
515
  {
481
516
  name: "body",
482
517
  type: "Body",
483
- schema: put_WorkspacesByWorkspaceIdSettings_Body
518
+ schema: putWorkspacesByWorkspaceIdSettings_Body
484
519
  },
485
520
  {
486
521
  name: "workspaceId",
@@ -529,6 +564,86 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
529
564
  ],
530
565
  response: zod.z.void()
531
566
  },
567
+ {
568
+ method: "post",
569
+ path: "/assets",
570
+ description: `Create an asset and get a pre-signed upload URL for the dedicated assets bucket.`,
571
+ requestFormat: "json",
572
+ parameters: [
573
+ {
574
+ name: "body",
575
+ type: "Body",
576
+ schema: postAssets_Body
577
+ },
578
+ {
579
+ name: "expiresIn",
580
+ type: "Query",
581
+ schema: zod.z.number().optional().default(3600)
582
+ }
583
+ ],
584
+ response: zod.z.object({
585
+ assetId: zod.z.string(),
586
+ assetUrl: zod.z.string().url(),
587
+ uploadUrl: zod.z.string().url(),
588
+ expiresAt: zod.z.string().regex(
589
+ /^(?:(?:\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))$/
590
+ ).datetime({ offset: true }),
591
+ uploadHeaders: zod.z.object({
592
+ "cache-control": zod.z.string(),
593
+ "content-disposition": zod.z.string(),
594
+ "content-type": zod.z.string(),
595
+ "if-none-match": zod.z.string()
596
+ }),
597
+ asset: zod.z.object({
598
+ id: zod.z.string(),
599
+ path: zod.z.string(),
600
+ assetUrl: zod.z.string().url(),
601
+ assetClass: zod.z.string(),
602
+ subject: zod.z.string(),
603
+ mimeType: zod.z.string(),
604
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
605
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
606
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
607
+ createdAt: zod.z.string(),
608
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
609
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
610
+ })
611
+ })
612
+ },
613
+ {
614
+ method: "get",
615
+ path: "/assets/:assetId",
616
+ description: `Get a stored asset by ID, including its stable CloudFront URL.`,
617
+ requestFormat: "json",
618
+ parameters: [
619
+ {
620
+ name: "assetId",
621
+ type: "Path",
622
+ schema: zod.z.string()
623
+ }
624
+ ],
625
+ response: zod.z.object({
626
+ id: zod.z.string(),
627
+ path: zod.z.string(),
628
+ assetUrl: zod.z.string().url(),
629
+ assetClass: zod.z.string(),
630
+ subject: zod.z.string(),
631
+ mimeType: zod.z.string(),
632
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
633
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
634
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
635
+ createdAt: zod.z.string(),
636
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
637
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
638
+ }),
639
+ errors: [
640
+ {
641
+ status: 404,
642
+ description: `Asset not found`,
643
+ schema: zod.z.void()
644
+ }
645
+ ]
646
+ },
532
647
  {
533
648
  method: "post",
534
649
  path: "/files",
@@ -554,7 +669,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
554
669
  response: zod.z.object({
555
670
  id: zod.z.string(),
556
671
  uploadUrl: zod.z.string(),
557
- expiresAt: zod.z.string().datetime({ offset: true }),
672
+ expiresAt: zod.z.string().regex(
673
+ /^(?:(?:\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))$/
674
+ ).datetime({ offset: true }),
558
675
  metadata: zod.z.object({
559
676
  id: zod.z.string(),
560
677
  path: zod.z.string(),
@@ -574,6 +691,71 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
574
691
  path: zod.z.string()
575
692
  })
576
693
  },
694
+ {
695
+ method: "get",
696
+ path: "/files",
697
+ description: `Get a list of files.`,
698
+ requestFormat: "json",
699
+ parameters: [
700
+ {
701
+ name: "limit",
702
+ type: "Query",
703
+ schema: zod.z.number().gte(1).lte(500).optional().default(10)
704
+ },
705
+ {
706
+ name: "offset",
707
+ type: "Query",
708
+ schema: zod.z.number().gte(0).optional().default(0)
709
+ },
710
+ {
711
+ name: "orderByField",
712
+ type: "Query",
713
+ schema: zod.z.enum(["id", "createdAt", "deletedAt"]).optional()
714
+ },
715
+ {
716
+ name: "orderByDirection",
717
+ type: "Query",
718
+ schema: zod.z.enum(["asc", "desc"]).optional().default("asc")
719
+ },
720
+ {
721
+ name: "search",
722
+ type: "Query",
723
+ schema: zod.z.string().optional()
724
+ },
725
+ {
726
+ name: "includeDeleted",
727
+ type: "Query",
728
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
729
+ },
730
+ {
731
+ name: "includeChildren",
732
+ type: "Query",
733
+ schema: zod.z.enum(["true", "false"]).optional().default("false")
734
+ }
735
+ ],
736
+ response: zod.z.object({
737
+ files: zod.z.array(
738
+ zod.z.object({
739
+ id: zod.z.string(),
740
+ path: zod.z.string(),
741
+ workspaceId: zod.z.string(),
742
+ parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
743
+ originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
744
+ mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
745
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
746
+ legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
747
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
748
+ encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
749
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
750
+ createdAt: zod.z.string(),
751
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
752
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
753
+ })
754
+ ),
755
+ count: zod.z.number(),
756
+ pages: zod.z.number()
757
+ })
758
+ },
577
759
  {
578
760
  method: "get",
579
761
  path: "/files/:fileId",
@@ -593,7 +775,9 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
593
775
  ],
594
776
  response: zod.z.object({
595
777
  url: zod.z.string(),
596
- expiresAt: zod.z.string().datetime({ offset: true }),
778
+ expiresAt: zod.z.string().regex(
779
+ /^(?:(?:\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))$/
780
+ ).datetime({ offset: true }),
597
781
  metadata: zod.z.union([
598
782
  zod.z.object({
599
783
  id: zod.z.string(),
@@ -623,18 +807,15 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
623
807
  ]
624
808
  },
625
809
  {
626
- method: "post",
627
- path: "/files/:fileId/permalinks",
628
- description: `Create a public, direct, and optionally expiring download link for a file.
629
-
630
- The returned permalink ID should be used with the `/permalinks/:permalinkId` endpoint to download the file via a 302 redirect.
631
- `,
810
+ method: "patch",
811
+ path: "/files/:fileId",
812
+ description: `Update file metadata. This only affects file metadata and has no effect on file conflicts or storage location.`,
632
813
  requestFormat: "json",
633
814
  parameters: [
634
815
  {
635
816
  name: "body",
636
817
  type: "Body",
637
- schema: zod.z.object({ expiresAt: zod.z.string().datetime({ offset: true }) }).partial()
818
+ schema: zod.z.object({ name: zod.z.string().min(1) })
638
819
  },
639
820
  {
640
821
  name: "fileId",
@@ -644,17 +825,25 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
644
825
  ],
645
826
  response: zod.z.object({
646
827
  id: zod.z.string(),
647
- fileId: zod.z.string(),
828
+ path: zod.z.string(),
648
829
  workspaceId: zod.z.string(),
830
+ parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
831
+ originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
832
+ mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
833
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
834
+ legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
835
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
836
+ encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
837
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
649
838
  createdAt: zod.z.string(),
650
- expiresAt: zod.z.union([zod.z.string(), zod.z.null()]),
651
- createdBy: zod.z.union([zod.z.string(), zod.z.null()])
839
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
840
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
652
841
  })
653
842
  },
654
843
  {
655
- method: "get",
656
- path: "/files/:fileId/permalinks",
657
- description: `Get all permalinks for a file.`,
844
+ method: "post",
845
+ path: "/files/:fileId/multipart",
846
+ description: `Initiate a multipart upload for a file.`,
658
847
  requestFormat: "json",
659
848
  parameters: [
660
849
  {
@@ -663,34 +852,56 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
663
852
  schema: zod.z.string()
664
853
  }
665
854
  ],
666
- response: zod.z.array(
667
- zod.z.object({
668
- id: zod.z.string(),
669
- fileId: zod.z.string(),
670
- workspaceId: zod.z.string(),
671
- createdAt: zod.z.string(),
672
- expiresAt: zod.z.union([zod.z.string(), zod.z.null()]),
673
- createdBy: zod.z.union([zod.z.string(), zod.z.null()])
674
- })
675
- )
855
+ response: zod.z.object({ uploadId: zod.z.string().min(1) })
856
+ },
857
+ {
858
+ method: "delete",
859
+ path: "/files/:fileId/multipart",
860
+ description: `Abort a multipart upload and discard its uploaded parts.`,
861
+ requestFormat: "json",
862
+ parameters: [
863
+ {
864
+ name: "uploadId",
865
+ type: "Query",
866
+ schema: zod.z.string().min(1).max(4096)
867
+ },
868
+ {
869
+ name: "fileId",
870
+ type: "Path",
871
+ schema: zod.z.string()
872
+ }
873
+ ],
874
+ response: zod.z.void()
676
875
  },
677
876
  {
678
877
  method: "post",
679
- path: "/files/:filename",
680
- description: `Create a file and get a pre-signed upload URL (legacy endpoint).
681
-
682
- This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
683
-
684
- The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
685
-
686
- The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
687
- `,
878
+ path: "/files/:fileId/multipart/complete",
879
+ description: `Complete a multipart upload and assemble the file in S3.`,
688
880
  requestFormat: "json",
689
881
  parameters: [
690
882
  {
691
883
  name: "body",
692
884
  type: "Body",
693
- schema: postFiles_Body
885
+ schema: postFilesByFileIdMultipartComplete_Body
886
+ },
887
+ {
888
+ name: "fileId",
889
+ type: "Path",
890
+ schema: zod.z.string()
891
+ }
892
+ ],
893
+ response: zod.z.void()
894
+ },
895
+ {
896
+ method: "post",
897
+ path: "/files/:fileId/multipart/part",
898
+ description: `Get a pre-signed URL for one multipart upload part.`,
899
+ requestFormat: "json",
900
+ parameters: [
901
+ {
902
+ name: "body",
903
+ type: "Body",
904
+ schema: postFilesByFileIdMultipartPart_Body
694
905
  },
695
906
  {
696
907
  name: "expiresIn",
@@ -698,16 +909,74 @@ The returned `url` is valid for 1 hour by default. You can change the
698
909
  schema: zod.z.number().optional().default(3600)
699
910
  },
700
911
  {
701
- name: "filename",
912
+ name: "fileId",
702
913
  type: "Path",
703
914
  schema: zod.z.string()
704
915
  }
705
916
  ],
706
917
  response: zod.z.object({
707
- url: zod.z.string(),
708
- expiresAt: zod.z.string().datetime({ offset: true })
918
+ uploadUrl: zod.z.string().url(),
919
+ expiresAt: zod.z.string().regex(
920
+ /^(?:(?:\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))$/
921
+ ).datetime({ offset: true })
922
+ })
923
+ },
924
+ {
925
+ method: "post",
926
+ path: "/files/:fileId/permalinks",
927
+ description: `Create a public, direct, and optionally expiring download link for a file.
928
+
929
+ The returned permalink ID should be used with the `/permalinks/:permalinkId` endpoint to download the file via a 302 redirect.
930
+ `,
931
+ requestFormat: "json",
932
+ parameters: [
933
+ {
934
+ name: "body",
935
+ type: "Body",
936
+ schema: zod.z.object({
937
+ expiresAt: zod.z.string().regex(
938
+ /^(?:(?:\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))$/
939
+ ).datetime({ offset: true })
940
+ }).partial()
941
+ },
942
+ {
943
+ name: "fileId",
944
+ type: "Path",
945
+ schema: zod.z.string()
946
+ }
947
+ ],
948
+ response: zod.z.object({
949
+ id: zod.z.string(),
950
+ fileId: zod.z.string(),
951
+ workspaceId: zod.z.string(),
952
+ createdAt: zod.z.string().datetime({ offset: true }),
953
+ expiresAt: zod.z.union([zod.z.string(), zod.z.null()]),
954
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()])
709
955
  })
710
956
  },
957
+ {
958
+ method: "get",
959
+ path: "/files/:fileId/permalinks",
960
+ description: `Get all permalinks for a file.`,
961
+ requestFormat: "json",
962
+ parameters: [
963
+ {
964
+ name: "fileId",
965
+ type: "Path",
966
+ schema: zod.z.string()
967
+ }
968
+ ],
969
+ response: zod.z.array(
970
+ zod.z.object({
971
+ id: zod.z.string(),
972
+ fileId: zod.z.string(),
973
+ workspaceId: zod.z.string(),
974
+ createdAt: zod.z.string().datetime({ offset: true }),
975
+ expiresAt: zod.z.union([zod.z.string(), zod.z.null()]),
976
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()])
977
+ })
978
+ )
979
+ },
711
980
  {
712
981
  method: "put",
713
982
  path: "/files/:id",
@@ -725,33 +994,29 @@ The returned `url` is valid for 1 hour by default. You can change the
725
994
  schema: zod.z.string()
726
995
  }
727
996
  ],
728
- response: zod.z.union([
729
- zod.z.object({
997
+ response: zod.z.object({
998
+ id: zod.z.string(),
999
+ uploadUrl: zod.z.string().url(),
1000
+ expiresAt: zod.z.string().regex(
1001
+ /^(?:(?:\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))$/
1002
+ ).datetime({ offset: true }),
1003
+ metadata: zod.z.object({
730
1004
  id: zod.z.string(),
731
- uploadUrl: zod.z.string().url(),
732
- expiresAt: zod.z.string().datetime({ offset: true }),
733
- metadata: zod.z.object({
734
- id: zod.z.string(),
735
- path: zod.z.string(),
736
- workspaceId: zod.z.string(),
737
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
738
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
739
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
740
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
741
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
742
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
743
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
744
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
745
- createdAt: zod.z.string(),
746
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
747
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
748
- })
749
- }),
750
- zod.z.object({
751
- url: zod.z.string().url(),
752
- expiresAt: zod.z.string().datetime({ offset: true })
1005
+ path: zod.z.string(),
1006
+ workspaceId: zod.z.string(),
1007
+ parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1008
+ originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1009
+ mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1010
+ size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
1011
+ legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1012
+ bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1013
+ encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1014
+ createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1015
+ createdAt: zod.z.string(),
1016
+ deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
1017
+ uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
753
1018
  })
754
- ])
1019
+ })
755
1020
  },
756
1021
  {
757
1022
  method: "delete",
@@ -869,9 +1134,14 @@ The returned `url` is valid for 1 hour by default. You can change the
869
1134
  schema: postFilesBulk_Body
870
1135
  }
871
1136
  ],
872
- response: zod.z.union([
873
- zod.z.array(
874
- zod.z.object({
1137
+ response: zod.z.array(
1138
+ zod.z.object({
1139
+ id: zod.z.string(),
1140
+ uploadUrl: zod.z.string(),
1141
+ expiresAt: zod.z.string().regex(
1142
+ /^(?:(?:\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))$/
1143
+ ).datetime({ offset: true }),
1144
+ metadata: zod.z.object({
875
1145
  id: zod.z.string(),
876
1146
  path: zod.z.string(),
877
1147
  workspaceId: zod.z.string(),
@@ -886,29 +1156,10 @@ The returned `url` is valid for 1 hour by default. You can change the
886
1156
  createdAt: zod.z.string(),
887
1157
  deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
888
1158
  uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
889
- })
890
- ),
891
- zod.z.object({
892
- files: zod.z.array(
893
- zod.z.object({
894
- id: zod.z.string(),
895
- path: zod.z.string(),
896
- workspaceId: zod.z.string(),
897
- parentId: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
898
- originalFileName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
899
- mimeType: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
900
- size: zod.z.union([zod.z.number(), zod.z.null()]).optional(),
901
- legacyKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
902
- bucketName: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
903
- encryptionKey: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
904
- createdBy: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
905
- createdAt: zod.z.string(),
906
- deletedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional(),
907
- uploadedAt: zod.z.union([zod.z.string(), zod.z.null()]).optional()
908
- })
909
- )
1159
+ }),
1160
+ path: zod.z.string()
910
1161
  })
911
- ])
1162
+ )
912
1163
  },
913
1164
  {
914
1165
  method: "get",
@@ -969,7 +1220,7 @@ Make sure to follow redirects to the actual file download URL.
969
1220
  id: zod.z.string(),
970
1221
  fileId: zod.z.string(),
971
1222
  workspaceId: zod.z.string(),
972
- createdAt: zod.z.string(),
1223
+ createdAt: zod.z.string().datetime({ offset: true }),
973
1224
  expiresAt: zod.z.union([zod.z.string(), zod.z.null()]),
974
1225
  createdBy: zod.z.union([zod.z.string(), zod.z.null()])
975
1226
  }),
@@ -987,8 +1238,12 @@ function createApiClient(baseUrl, options) {
987
1238
  return new core.Zodios(baseUrl, endpoints, options);
988
1239
  }
989
1240
 
1241
+ const version = "2.17.6";
1242
+ const packageInfo = {
1243
+ version: version};
1244
+
990
1245
  const serviceName = process.env.SERVICE_NAME;
991
- const userAgent = `vault-http-client:2.10.0${serviceName ? `@${serviceName}` : ""}`.trim();
1246
+ const userAgent = `vault-http-client:${packageInfo.version}${serviceName ? `@${serviceName}` : ""}`.trim();
992
1247
  function useVaultClient(vaultUrl, token) {
993
1248
  const api = createApiClient(vaultUrl, {
994
1249
  axiosConfig: {