@meistrari/vault-http-client 2.3.6 → 2.3.10
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 +214 -141
- package/dist/index.d.cts +2 -3917
- package/dist/index.d.mts +2 -3917
- package/dist/index.d.ts +2 -3917
- package/dist/index.mjs +214 -141
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,37 +1,32 @@
|
|
|
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
|
-
});
|
|
16
4
|
const postFilesBulk_Body = z.union([
|
|
17
5
|
z.array(
|
|
18
6
|
z.object({
|
|
19
7
|
fileName: z.string(),
|
|
20
|
-
sha256sum: z.string()
|
|
21
|
-
size: z.number()
|
|
22
|
-
mimeType: z.string()
|
|
23
|
-
createdBy: z.string()
|
|
24
|
-
|
|
8
|
+
sha256sum: z.string(),
|
|
9
|
+
size: z.number(),
|
|
10
|
+
mimeType: z.string(),
|
|
11
|
+
createdBy: z.string(),
|
|
12
|
+
path: z.string()
|
|
13
|
+
}).partial()
|
|
25
14
|
),
|
|
26
15
|
z.object({ files: z.array(z.string()) })
|
|
27
16
|
]);
|
|
28
|
-
const
|
|
17
|
+
const postFiles_Body = z.object({
|
|
29
18
|
fileName: z.string(),
|
|
30
19
|
sha256sum: z.string(),
|
|
31
20
|
size: z.number(),
|
|
32
21
|
mimeType: z.string(),
|
|
33
|
-
createdBy: z.string()
|
|
22
|
+
createdBy: z.string(),
|
|
23
|
+
path: z.string()
|
|
34
24
|
}).partial();
|
|
25
|
+
const put_WorkspacesByWorkspaceIdSettings_Body = z.object({
|
|
26
|
+
bucketName: z.string().min(1),
|
|
27
|
+
keyArns: z.array(z.string()).min(1),
|
|
28
|
+
defaultS3LinkTtl: z.number().gte(1)
|
|
29
|
+
});
|
|
35
30
|
const endpoints = makeApi([
|
|
36
31
|
{
|
|
37
32
|
method: "get",
|
|
@@ -106,7 +101,7 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
106
101
|
{
|
|
107
102
|
name: "body",
|
|
108
103
|
type: "Body",
|
|
109
|
-
schema:
|
|
104
|
+
schema: postFiles_Body
|
|
110
105
|
},
|
|
111
106
|
{
|
|
112
107
|
name: "expiresIn",
|
|
@@ -119,31 +114,26 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
119
114
|
schema: z.string()
|
|
120
115
|
}
|
|
121
116
|
],
|
|
122
|
-
response: z.
|
|
123
|
-
z.
|
|
117
|
+
response: z.object({
|
|
118
|
+
id: z.string(),
|
|
119
|
+
uploadUrl: z.string().url(),
|
|
120
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
121
|
+
metadata: z.object({
|
|
124
122
|
id: z.string(),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
138
|
-
createdAt: z.string(),
|
|
139
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
140
|
-
})
|
|
141
|
-
}),
|
|
142
|
-
z.object({
|
|
143
|
-
url: z.string(),
|
|
144
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
123
|
+
path: z.string(),
|
|
124
|
+
workspaceId: z.string(),
|
|
125
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
126
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
127
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
128
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
129
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
130
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
131
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
132
|
+
createdAt: z.string(),
|
|
133
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
134
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
145
135
|
})
|
|
146
|
-
|
|
136
|
+
})
|
|
147
137
|
},
|
|
148
138
|
{
|
|
149
139
|
method: "get",
|
|
@@ -183,7 +173,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
183
173
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
184
174
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
185
175
|
createdAt: z.string(),
|
|
186
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
176
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
177
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
187
178
|
}),
|
|
188
179
|
z.null()
|
|
189
180
|
])
|
|
@@ -230,7 +221,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
230
221
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
231
222
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
232
223
|
createdAt: z.string(),
|
|
233
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
224
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
225
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
234
226
|
}),
|
|
235
227
|
errors: [
|
|
236
228
|
{
|
|
@@ -267,31 +259,26 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
267
259
|
schema: z.string()
|
|
268
260
|
}
|
|
269
261
|
],
|
|
270
|
-
response: z.
|
|
271
|
-
z.
|
|
262
|
+
response: z.object({
|
|
263
|
+
id: z.string(),
|
|
264
|
+
uploadUrl: z.string().url(),
|
|
265
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
266
|
+
metadata: z.object({
|
|
272
267
|
id: z.string(),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
286
|
-
createdAt: z.string(),
|
|
287
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
288
|
-
})
|
|
289
|
-
}),
|
|
290
|
-
z.object({
|
|
291
|
-
url: z.string().url(),
|
|
292
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
268
|
+
path: z.string(),
|
|
269
|
+
workspaceId: z.string(),
|
|
270
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
271
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
272
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
273
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
274
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
275
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
276
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
277
|
+
createdAt: z.string(),
|
|
278
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
279
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
293
280
|
})
|
|
294
|
-
|
|
281
|
+
})
|
|
295
282
|
},
|
|
296
283
|
{
|
|
297
284
|
method: "delete",
|
|
@@ -341,7 +328,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
341
328
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
342
329
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
343
330
|
createdAt: z.string(),
|
|
344
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
331
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
332
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
345
333
|
}),
|
|
346
334
|
errors: [
|
|
347
335
|
{
|
|
@@ -413,7 +401,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
413
401
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
414
402
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
415
403
|
createdAt: z.string(),
|
|
416
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
404
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
405
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
417
406
|
})
|
|
418
407
|
),
|
|
419
408
|
count: z.number(),
|
|
@@ -464,6 +453,64 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
464
453
|
defaultS3LinkTtl: z.number().gte(1)
|
|
465
454
|
})
|
|
466
455
|
},
|
|
456
|
+
{
|
|
457
|
+
method: "patch",
|
|
458
|
+
path: "/:id/uploaded-at",
|
|
459
|
+
description: `Set the uploaded at timestamp for a file.`,
|
|
460
|
+
requestFormat: "json",
|
|
461
|
+
parameters: [
|
|
462
|
+
{
|
|
463
|
+
name: "id",
|
|
464
|
+
type: "Path",
|
|
465
|
+
schema: z.string()
|
|
466
|
+
}
|
|
467
|
+
],
|
|
468
|
+
response: z.void()
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
method: "post",
|
|
472
|
+
path: "/files",
|
|
473
|
+
description: `Create a file and get a pre-signed upload URL.
|
|
474
|
+
|
|
475
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
476
|
+
|
|
477
|
+
The returned `uploadUrl` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
478
|
+
`,
|
|
479
|
+
requestFormat: "json",
|
|
480
|
+
parameters: [
|
|
481
|
+
{
|
|
482
|
+
name: "body",
|
|
483
|
+
type: "Body",
|
|
484
|
+
schema: postFiles_Body
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
name: "expiresIn",
|
|
488
|
+
type: "Query",
|
|
489
|
+
schema: z.number().optional().default(3600)
|
|
490
|
+
}
|
|
491
|
+
],
|
|
492
|
+
response: z.object({
|
|
493
|
+
id: z.string(),
|
|
494
|
+
uploadUrl: z.string(),
|
|
495
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
496
|
+
metadata: z.object({
|
|
497
|
+
id: z.string(),
|
|
498
|
+
path: z.string(),
|
|
499
|
+
workspaceId: z.string(),
|
|
500
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
501
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
502
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
503
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
504
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
505
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
506
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
507
|
+
createdAt: z.string(),
|
|
508
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
509
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
510
|
+
}),
|
|
511
|
+
path: z.string()
|
|
512
|
+
})
|
|
513
|
+
},
|
|
467
514
|
{
|
|
468
515
|
method: "get",
|
|
469
516
|
path: "/files/:fileId",
|
|
@@ -492,7 +539,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
492
539
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
493
540
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
494
541
|
createdAt: z.string(),
|
|
495
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
542
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
543
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
496
544
|
}),
|
|
497
545
|
z.null()
|
|
498
546
|
])
|
|
@@ -560,20 +608,20 @@ The returned permalink ID should be used with the `/permalinks/:permalinkId
|
|
|
560
608
|
{
|
|
561
609
|
method: "post",
|
|
562
610
|
path: "/files/:filename",
|
|
563
|
-
description: `Create a file and get a pre-signed upload URL.
|
|
611
|
+
description: `Create a file and get a pre-signed upload URL (legacy endpoint).
|
|
564
612
|
|
|
565
|
-
|
|
613
|
+
This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
|
|
566
614
|
|
|
567
|
-
The `
|
|
615
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
568
616
|
|
|
569
|
-
The returned `
|
|
617
|
+
The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
570
618
|
`,
|
|
571
619
|
requestFormat: "json",
|
|
572
620
|
parameters: [
|
|
573
621
|
{
|
|
574
622
|
name: "body",
|
|
575
623
|
type: "Body",
|
|
576
|
-
schema:
|
|
624
|
+
schema: postFiles_Body
|
|
577
625
|
},
|
|
578
626
|
{
|
|
579
627
|
name: "expiresIn",
|
|
@@ -586,31 +634,10 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
586
634
|
schema: z.string()
|
|
587
635
|
}
|
|
588
636
|
],
|
|
589
|
-
response: z.
|
|
590
|
-
z.
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
expiresAt: z.string().datetime({ offset: true }),
|
|
594
|
-
metadata: z.object({
|
|
595
|
-
id: z.string(),
|
|
596
|
-
path: z.string(),
|
|
597
|
-
workspaceId: z.string(),
|
|
598
|
-
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
599
|
-
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
600
|
-
size: z.union([z.number(), z.null()]).optional(),
|
|
601
|
-
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
602
|
-
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
603
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
604
|
-
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
605
|
-
createdAt: z.string(),
|
|
606
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
607
|
-
})
|
|
608
|
-
}),
|
|
609
|
-
z.object({
|
|
610
|
-
url: z.string(),
|
|
611
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
612
|
-
})
|
|
613
|
-
])
|
|
637
|
+
response: z.object({
|
|
638
|
+
url: z.string(),
|
|
639
|
+
expiresAt: z.string().datetime({ offset: true })
|
|
640
|
+
})
|
|
614
641
|
},
|
|
615
642
|
{
|
|
616
643
|
method: "put",
|
|
@@ -646,7 +673,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
646
673
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
647
674
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
648
675
|
createdAt: z.string(),
|
|
649
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
676
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
677
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
650
678
|
})
|
|
651
679
|
}),
|
|
652
680
|
z.object({
|
|
@@ -693,7 +721,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
693
721
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
694
722
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
695
723
|
createdAt: z.string(),
|
|
696
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
724
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
725
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
697
726
|
}),
|
|
698
727
|
errors: [
|
|
699
728
|
{
|
|
@@ -729,7 +758,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
729
758
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
730
759
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
731
760
|
createdAt: z.string(),
|
|
732
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
761
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
762
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
733
763
|
})
|
|
734
764
|
),
|
|
735
765
|
z.object({
|
|
@@ -746,7 +776,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
746
776
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
747
777
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
748
778
|
createdAt: z.string(),
|
|
749
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
779
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
780
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
750
781
|
})
|
|
751
782
|
)
|
|
752
783
|
})
|
|
@@ -823,6 +854,64 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
823
854
|
}
|
|
824
855
|
]
|
|
825
856
|
},
|
|
857
|
+
{
|
|
858
|
+
method: "patch",
|
|
859
|
+
path: "/v2/:id/uploaded-at",
|
|
860
|
+
description: `Set the uploaded at timestamp for a file.`,
|
|
861
|
+
requestFormat: "json",
|
|
862
|
+
parameters: [
|
|
863
|
+
{
|
|
864
|
+
name: "id",
|
|
865
|
+
type: "Path",
|
|
866
|
+
schema: z.string()
|
|
867
|
+
}
|
|
868
|
+
],
|
|
869
|
+
response: z.void()
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
method: "post",
|
|
873
|
+
path: "/v2/files",
|
|
874
|
+
description: `Create a file and get a pre-signed upload URL.
|
|
875
|
+
|
|
876
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
877
|
+
|
|
878
|
+
The returned `uploadUrl` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
879
|
+
`,
|
|
880
|
+
requestFormat: "json",
|
|
881
|
+
parameters: [
|
|
882
|
+
{
|
|
883
|
+
name: "body",
|
|
884
|
+
type: "Body",
|
|
885
|
+
schema: postFiles_Body
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
name: "expiresIn",
|
|
889
|
+
type: "Query",
|
|
890
|
+
schema: z.number().optional().default(3600)
|
|
891
|
+
}
|
|
892
|
+
],
|
|
893
|
+
response: z.object({
|
|
894
|
+
id: z.string(),
|
|
895
|
+
uploadUrl: z.string(),
|
|
896
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
897
|
+
metadata: z.object({
|
|
898
|
+
id: z.string(),
|
|
899
|
+
path: z.string(),
|
|
900
|
+
workspaceId: z.string(),
|
|
901
|
+
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
902
|
+
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
903
|
+
size: z.union([z.number(), z.null()]).optional(),
|
|
904
|
+
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
905
|
+
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
906
|
+
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
907
|
+
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
908
|
+
createdAt: z.string(),
|
|
909
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
910
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
911
|
+
}),
|
|
912
|
+
path: z.string()
|
|
913
|
+
})
|
|
914
|
+
},
|
|
826
915
|
{
|
|
827
916
|
method: "get",
|
|
828
917
|
path: "/v2/files/:fileId",
|
|
@@ -851,7 +940,8 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
851
940
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
852
941
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
853
942
|
createdAt: z.string(),
|
|
854
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
943
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
944
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
855
945
|
}),
|
|
856
946
|
z.null()
|
|
857
947
|
])
|
|
@@ -867,20 +957,20 @@ Make sure to follow redirects to the actual file download URL.
|
|
|
867
957
|
{
|
|
868
958
|
method: "post",
|
|
869
959
|
path: "/v2/files/:filename",
|
|
870
|
-
description: `Create a file and get a pre-signed upload URL.
|
|
960
|
+
description: `Create a file and get a pre-signed upload URL (legacy endpoint).
|
|
871
961
|
|
|
872
|
-
|
|
962
|
+
This endpoint is deprecated. Use POST /files instead with `originalFileName` in the request body.
|
|
873
963
|
|
|
874
|
-
The `
|
|
964
|
+
The `sha256` body param is used as the file's primary key. If not provided, a random UUID will be generated.
|
|
875
965
|
|
|
876
|
-
The returned `
|
|
966
|
+
The returned `url` is valid for 1 hour by default. You can change the expiration time by passing the `expiresIn` query parameter.
|
|
877
967
|
`,
|
|
878
968
|
requestFormat: "json",
|
|
879
969
|
parameters: [
|
|
880
970
|
{
|
|
881
971
|
name: "body",
|
|
882
972
|
type: "Body",
|
|
883
|
-
schema:
|
|
973
|
+
schema: postFiles_Body
|
|
884
974
|
},
|
|
885
975
|
{
|
|
886
976
|
name: "expiresIn",
|
|
@@ -893,31 +983,10 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
893
983
|
schema: z.string()
|
|
894
984
|
}
|
|
895
985
|
],
|
|
896
|
-
response: z.
|
|
897
|
-
z.
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
expiresAt: z.string().datetime({ offset: true }),
|
|
901
|
-
metadata: z.object({
|
|
902
|
-
id: z.string(),
|
|
903
|
-
path: z.string(),
|
|
904
|
-
workspaceId: z.string(),
|
|
905
|
-
originalFileName: z.union([z.string(), z.null()]).optional(),
|
|
906
|
-
mimeType: z.union([z.string(), z.null()]).optional(),
|
|
907
|
-
size: z.union([z.number(), z.null()]).optional(),
|
|
908
|
-
legacyKey: z.union([z.string(), z.null()]).optional(),
|
|
909
|
-
bucketName: z.union([z.string(), z.null()]).optional(),
|
|
910
|
-
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
911
|
-
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
912
|
-
createdAt: z.string(),
|
|
913
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
914
|
-
})
|
|
915
|
-
}),
|
|
916
|
-
z.object({
|
|
917
|
-
url: z.string(),
|
|
918
|
-
expiresAt: z.string().datetime({ offset: true })
|
|
919
|
-
})
|
|
920
|
-
])
|
|
986
|
+
response: z.object({
|
|
987
|
+
url: z.string(),
|
|
988
|
+
expiresAt: z.string().datetime({ offset: true })
|
|
989
|
+
})
|
|
921
990
|
},
|
|
922
991
|
{
|
|
923
992
|
method: "put",
|
|
@@ -953,7 +1022,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
953
1022
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
954
1023
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
955
1024
|
createdAt: z.string(),
|
|
956
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1025
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1026
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
957
1027
|
})
|
|
958
1028
|
}),
|
|
959
1029
|
z.object({
|
|
@@ -1000,7 +1070,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1000
1070
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1001
1071
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1002
1072
|
createdAt: z.string(),
|
|
1003
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1073
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1074
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1004
1075
|
}),
|
|
1005
1076
|
errors: [
|
|
1006
1077
|
{
|
|
@@ -1036,7 +1107,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1036
1107
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1037
1108
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1038
1109
|
createdAt: z.string(),
|
|
1039
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1110
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1111
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1040
1112
|
})
|
|
1041
1113
|
),
|
|
1042
1114
|
z.object({
|
|
@@ -1053,7 +1125,8 @@ The returned `uploadUrl` is valid for 1 hour by default. You can chang
|
|
|
1053
1125
|
encryptionKey: z.union([z.string(), z.null()]).optional(),
|
|
1054
1126
|
createdBy: z.union([z.string(), z.null()]).optional(),
|
|
1055
1127
|
createdAt: z.string(),
|
|
1056
|
-
deletedAt: z.union([z.string(), z.null()]).optional()
|
|
1128
|
+
deletedAt: z.union([z.string(), z.null()]).optional(),
|
|
1129
|
+
uploadedAt: z.union([z.string(), z.null()]).optional()
|
|
1057
1130
|
})
|
|
1058
1131
|
)
|
|
1059
1132
|
})
|
|
@@ -1070,7 +1143,7 @@ function useVaultClient(vaultUrl, token) {
|
|
|
1070
1143
|
axiosConfig: {
|
|
1071
1144
|
headers: {
|
|
1072
1145
|
Authorization: token,
|
|
1073
|
-
"User-Agent": "vault-http-client:2.3.
|
|
1146
|
+
"User-Agent": "vault-http-client:2.3.10"
|
|
1074
1147
|
}
|
|
1075
1148
|
}
|
|
1076
1149
|
});
|