@epilot/file-client 1.1.8 → 1.3.1
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/README.md +19 -28
- package/dist/client.d.ts +2 -1
- package/dist/definition.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -1
- package/dist/openapi.d.ts +256 -240
- package/dist/openapi.json +562 -0
- package/package.json +29 -19
- package/src/openapi.d.ts +0 -443
package/src/openapi.d.ts
DELETED
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import {
|
|
3
|
-
OpenAPIClient,
|
|
4
|
-
Parameters,
|
|
5
|
-
UnknownParamsObject,
|
|
6
|
-
OperationResponse,
|
|
7
|
-
AxiosRequestConfig,
|
|
8
|
-
} from 'openapi-client-axios';
|
|
9
|
-
|
|
10
|
-
declare namespace Components {
|
|
11
|
-
namespace Schemas {
|
|
12
|
-
export interface DeleteFilePayload {
|
|
13
|
-
s3ref: S3Reference;
|
|
14
|
-
}
|
|
15
|
-
export interface FileEntity {
|
|
16
|
-
_id?: FileEntityId;
|
|
17
|
-
/**
|
|
18
|
-
* example:
|
|
19
|
-
* document.pdf
|
|
20
|
-
*/
|
|
21
|
-
filename?: string;
|
|
22
|
-
access_control?: "private" | "public-read";
|
|
23
|
-
/**
|
|
24
|
-
* Direct URL for file (public only if file access control is public-read)
|
|
25
|
-
* example:
|
|
26
|
-
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
27
|
-
*/
|
|
28
|
-
public_url?: string; // url
|
|
29
|
-
/**
|
|
30
|
-
* Human readable type for file
|
|
31
|
-
*/
|
|
32
|
-
type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
33
|
-
/**
|
|
34
|
-
* MIME type of the file
|
|
35
|
-
* example:
|
|
36
|
-
* application/pdf
|
|
37
|
-
*/
|
|
38
|
-
mime_type?: string;
|
|
39
|
-
/**
|
|
40
|
-
* File size in bytes
|
|
41
|
-
*/
|
|
42
|
-
size_bytes?: number;
|
|
43
|
-
versions?: {
|
|
44
|
-
s3ref?: S3Reference;
|
|
45
|
-
}[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* example:
|
|
49
|
-
* ef7d985c-2385-44f4-9c71-ae06a52264f8
|
|
50
|
-
*/
|
|
51
|
-
export type FileEntityId = string;
|
|
52
|
-
export interface FileItem {
|
|
53
|
-
/**
|
|
54
|
-
* example:
|
|
55
|
-
* epilot-files-prod
|
|
56
|
-
*/
|
|
57
|
-
bucket: string;
|
|
58
|
-
/**
|
|
59
|
-
* example:
|
|
60
|
-
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
61
|
-
*/
|
|
62
|
-
key: string;
|
|
63
|
-
/**
|
|
64
|
-
* example:
|
|
65
|
-
* document.pdf
|
|
66
|
-
*/
|
|
67
|
-
filename?: string;
|
|
68
|
-
/**
|
|
69
|
-
* example:
|
|
70
|
-
* 1234
|
|
71
|
-
*/
|
|
72
|
-
size_bytes?: number;
|
|
73
|
-
/**
|
|
74
|
-
* example:
|
|
75
|
-
* image/jpeg
|
|
76
|
-
*/
|
|
77
|
-
mime_type?: string;
|
|
78
|
-
}
|
|
79
|
-
export interface S3Reference {
|
|
80
|
-
/**
|
|
81
|
-
* example:
|
|
82
|
-
* epilot-files-prod
|
|
83
|
-
*/
|
|
84
|
-
bucket: string;
|
|
85
|
-
/**
|
|
86
|
-
* example:
|
|
87
|
-
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
88
|
-
*/
|
|
89
|
-
key: string;
|
|
90
|
-
}
|
|
91
|
-
export interface SaveFilePayload {
|
|
92
|
-
s3ref: S3Reference;
|
|
93
|
-
/**
|
|
94
|
-
* if passed, adds a new version to existing file entity
|
|
95
|
-
*/
|
|
96
|
-
file_entity_id?: string;
|
|
97
|
-
document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
98
|
-
/**
|
|
99
|
-
* example:
|
|
100
|
-
* document.pdf
|
|
101
|
-
*/
|
|
102
|
-
filename?: string;
|
|
103
|
-
_tags?: string[];
|
|
104
|
-
access_control?: "private" | "public-read";
|
|
105
|
-
}
|
|
106
|
-
export interface UploadFilePayload {
|
|
107
|
-
/**
|
|
108
|
-
* example:
|
|
109
|
-
* document.pdf
|
|
110
|
-
*/
|
|
111
|
-
filename: string;
|
|
112
|
-
/**
|
|
113
|
-
* MIME type of file
|
|
114
|
-
* example:
|
|
115
|
-
* application/pdf
|
|
116
|
-
*/
|
|
117
|
-
mime_type?: string;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
declare namespace Paths {
|
|
122
|
-
namespace DeleteFile {
|
|
123
|
-
export type RequestBody = Components.Schemas.DeleteFilePayload;
|
|
124
|
-
}
|
|
125
|
-
namespace DownloadFile {
|
|
126
|
-
namespace Parameters {
|
|
127
|
-
export type Attachment = boolean;
|
|
128
|
-
export type Id = Components.Schemas.FileEntityId;
|
|
129
|
-
export type S3Bucket = string;
|
|
130
|
-
export type S3Key = string;
|
|
131
|
-
export type Version = number;
|
|
132
|
-
}
|
|
133
|
-
export interface PathParameters {
|
|
134
|
-
id?: Parameters.Id;
|
|
135
|
-
}
|
|
136
|
-
export interface QueryParameters {
|
|
137
|
-
version?: Parameters.Version;
|
|
138
|
-
attachment?: Parameters.Attachment;
|
|
139
|
-
s3_key?: Parameters.S3Key;
|
|
140
|
-
s3_bucket?: Parameters.S3Bucket;
|
|
141
|
-
}
|
|
142
|
-
namespace Responses {
|
|
143
|
-
export interface $200 {
|
|
144
|
-
/**
|
|
145
|
-
* example:
|
|
146
|
-
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
|
|
147
|
-
*/
|
|
148
|
-
download_url?: string; // uri
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
namespace PreviewFile {
|
|
153
|
-
namespace Parameters {
|
|
154
|
-
export type H = number;
|
|
155
|
-
export type Id = Components.Schemas.FileEntityId;
|
|
156
|
-
export type Version = number;
|
|
157
|
-
export type W = number;
|
|
158
|
-
}
|
|
159
|
-
export interface PathParameters {
|
|
160
|
-
id: Parameters.Id;
|
|
161
|
-
}
|
|
162
|
-
export interface QueryParameters {
|
|
163
|
-
version?: Parameters.Version;
|
|
164
|
-
w?: Parameters.W;
|
|
165
|
-
h?: Parameters.H;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
namespace PreviewS3File {
|
|
169
|
-
namespace Parameters {
|
|
170
|
-
export type H = number;
|
|
171
|
-
export type W = number;
|
|
172
|
-
}
|
|
173
|
-
export interface QueryParameters {
|
|
174
|
-
w?: Parameters.W;
|
|
175
|
-
h?: Parameters.H;
|
|
176
|
-
}
|
|
177
|
-
export type RequestBody = Components.Schemas.S3Reference;
|
|
178
|
-
}
|
|
179
|
-
namespace SaveFile {
|
|
180
|
-
export type RequestBody = Components.Schemas.SaveFilePayload;
|
|
181
|
-
namespace Responses {
|
|
182
|
-
export type $201 = Components.Schemas.FileEntity;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
namespace UploadFile {
|
|
186
|
-
namespace Parameters {
|
|
187
|
-
export type FileEntityId = Components.Schemas.FileEntityId;
|
|
188
|
-
}
|
|
189
|
-
export interface QueryParameters {
|
|
190
|
-
file_entity_id?: Parameters.FileEntityId;
|
|
191
|
-
}
|
|
192
|
-
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
193
|
-
namespace Responses {
|
|
194
|
-
export interface $201 {
|
|
195
|
-
/**
|
|
196
|
-
* example:
|
|
197
|
-
* {
|
|
198
|
-
* "bucket": "epilot-files-prod",
|
|
199
|
-
* "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
200
|
-
* }
|
|
201
|
-
*/
|
|
202
|
-
s3ref?: {
|
|
203
|
-
/**
|
|
204
|
-
* example:
|
|
205
|
-
* epilot-files-prod
|
|
206
|
-
*/
|
|
207
|
-
bucket: string;
|
|
208
|
-
/**
|
|
209
|
-
* example:
|
|
210
|
-
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
211
|
-
*/
|
|
212
|
-
key: string;
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* example:
|
|
216
|
-
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
|
|
217
|
-
*/
|
|
218
|
-
upload_url?: string; // url
|
|
219
|
-
/**
|
|
220
|
-
* Returned only if file is permanent i.e. file_entity_id is passed
|
|
221
|
-
* example:
|
|
222
|
-
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
223
|
-
*/
|
|
224
|
-
public_url?: string; // url
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
namespace UploadFilePublic {
|
|
229
|
-
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
230
|
-
namespace Responses {
|
|
231
|
-
export interface $201 {
|
|
232
|
-
/**
|
|
233
|
-
* example:
|
|
234
|
-
* {
|
|
235
|
-
* "bucket": "epilot-files-prod",
|
|
236
|
-
* "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
237
|
-
* }
|
|
238
|
-
*/
|
|
239
|
-
s3ref?: {
|
|
240
|
-
/**
|
|
241
|
-
* example:
|
|
242
|
-
* epilot-files-prod
|
|
243
|
-
*/
|
|
244
|
-
bucket: string;
|
|
245
|
-
/**
|
|
246
|
-
* example:
|
|
247
|
-
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
248
|
-
*/
|
|
249
|
-
key: string;
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* example:
|
|
253
|
-
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
|
|
254
|
-
*/
|
|
255
|
-
upload_url?: string; // url
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export interface OperationMethods {
|
|
262
|
-
/**
|
|
263
|
-
* uploadFilePublic - uploadFilePublic
|
|
264
|
-
*
|
|
265
|
-
* Create pre-signed S3 URL to upload a file to keep temporarily (one week).
|
|
266
|
-
*
|
|
267
|
-
* Use the createFile operation to store file file permanently.
|
|
268
|
-
*
|
|
269
|
-
*/
|
|
270
|
-
'uploadFilePublic'(
|
|
271
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
272
|
-
data?: Paths.UploadFilePublic.RequestBody,
|
|
273
|
-
config?: AxiosRequestConfig
|
|
274
|
-
): OperationResponse<Paths.UploadFilePublic.Responses.$201>
|
|
275
|
-
/**
|
|
276
|
-
* uploadFile - uploadFile
|
|
277
|
-
*
|
|
278
|
-
* Create pre-signed S3 URL to upload a file to keep temporarily (one week).
|
|
279
|
-
*
|
|
280
|
-
* Use the createFile operation to store file file permanently.
|
|
281
|
-
*
|
|
282
|
-
*/
|
|
283
|
-
'uploadFile'(
|
|
284
|
-
parameters?: Parameters<Paths.UploadFile.QueryParameters> | null,
|
|
285
|
-
data?: Paths.UploadFile.RequestBody,
|
|
286
|
-
config?: AxiosRequestConfig
|
|
287
|
-
): OperationResponse<Paths.UploadFile.Responses.$201>
|
|
288
|
-
/**
|
|
289
|
-
* saveFile - saveFile
|
|
290
|
-
*
|
|
291
|
-
* Create / Update a permanent File entity
|
|
292
|
-
*
|
|
293
|
-
* Makes file object permanent
|
|
294
|
-
*
|
|
295
|
-
* Saves metadata to file entity
|
|
296
|
-
*
|
|
297
|
-
*/
|
|
298
|
-
'saveFile'(
|
|
299
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
300
|
-
data?: Paths.SaveFile.RequestBody,
|
|
301
|
-
config?: AxiosRequestConfig
|
|
302
|
-
): OperationResponse<Paths.SaveFile.Responses.$201>
|
|
303
|
-
/**
|
|
304
|
-
* downloadFile - downloadFile
|
|
305
|
-
*
|
|
306
|
-
* Generate pre-signed download S3 url for a file
|
|
307
|
-
*/
|
|
308
|
-
'downloadFile'(
|
|
309
|
-
parameters?: Parameters<Paths.DownloadFile.PathParameters & Paths.DownloadFile.QueryParameters> | null,
|
|
310
|
-
data?: any,
|
|
311
|
-
config?: AxiosRequestConfig
|
|
312
|
-
): OperationResponse<Paths.DownloadFile.Responses.$200>
|
|
313
|
-
/**
|
|
314
|
-
* previewFile - previewFile
|
|
315
|
-
*
|
|
316
|
-
* Generate thumbnail preview for a file entity
|
|
317
|
-
*/
|
|
318
|
-
'previewFile'(
|
|
319
|
-
parameters?: Parameters<Paths.PreviewFile.PathParameters & Paths.PreviewFile.QueryParameters> | null,
|
|
320
|
-
data?: any,
|
|
321
|
-
config?: AxiosRequestConfig
|
|
322
|
-
): OperationResponse<any>
|
|
323
|
-
/**
|
|
324
|
-
* previewS3File - previewS3File
|
|
325
|
-
*
|
|
326
|
-
* Generate thumbnail preview from an s3 reference for a file entity
|
|
327
|
-
*/
|
|
328
|
-
'previewS3File'(
|
|
329
|
-
parameters?: Parameters<Paths.PreviewS3File.QueryParameters> | null,
|
|
330
|
-
data?: Paths.PreviewS3File.RequestBody,
|
|
331
|
-
config?: AxiosRequestConfig
|
|
332
|
-
): OperationResponse<any>
|
|
333
|
-
/**
|
|
334
|
-
* deleteFile - deleteFile
|
|
335
|
-
*
|
|
336
|
-
* Delete file entity
|
|
337
|
-
*/
|
|
338
|
-
'deleteFile'(
|
|
339
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
340
|
-
data?: Paths.DeleteFile.RequestBody,
|
|
341
|
-
config?: AxiosRequestConfig
|
|
342
|
-
): OperationResponse<any>
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export interface PathsDictionary {
|
|
346
|
-
['/v1/files/public/upload']: {
|
|
347
|
-
/**
|
|
348
|
-
* uploadFilePublic - uploadFilePublic
|
|
349
|
-
*
|
|
350
|
-
* Create pre-signed S3 URL to upload a file to keep temporarily (one week).
|
|
351
|
-
*
|
|
352
|
-
* Use the createFile operation to store file file permanently.
|
|
353
|
-
*
|
|
354
|
-
*/
|
|
355
|
-
'post'(
|
|
356
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
357
|
-
data?: Paths.UploadFilePublic.RequestBody,
|
|
358
|
-
config?: AxiosRequestConfig
|
|
359
|
-
): OperationResponse<Paths.UploadFilePublic.Responses.$201>
|
|
360
|
-
}
|
|
361
|
-
['/v1/files/upload']: {
|
|
362
|
-
/**
|
|
363
|
-
* uploadFile - uploadFile
|
|
364
|
-
*
|
|
365
|
-
* Create pre-signed S3 URL to upload a file to keep temporarily (one week).
|
|
366
|
-
*
|
|
367
|
-
* Use the createFile operation to store file file permanently.
|
|
368
|
-
*
|
|
369
|
-
*/
|
|
370
|
-
'post'(
|
|
371
|
-
parameters?: Parameters<Paths.UploadFile.QueryParameters> | null,
|
|
372
|
-
data?: Paths.UploadFile.RequestBody,
|
|
373
|
-
config?: AxiosRequestConfig
|
|
374
|
-
): OperationResponse<Paths.UploadFile.Responses.$201>
|
|
375
|
-
}
|
|
376
|
-
['/v1/files']: {
|
|
377
|
-
/**
|
|
378
|
-
* saveFile - saveFile
|
|
379
|
-
*
|
|
380
|
-
* Create / Update a permanent File entity
|
|
381
|
-
*
|
|
382
|
-
* Makes file object permanent
|
|
383
|
-
*
|
|
384
|
-
* Saves metadata to file entity
|
|
385
|
-
*
|
|
386
|
-
*/
|
|
387
|
-
'post'(
|
|
388
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
389
|
-
data?: Paths.SaveFile.RequestBody,
|
|
390
|
-
config?: AxiosRequestConfig
|
|
391
|
-
): OperationResponse<Paths.SaveFile.Responses.$201>
|
|
392
|
-
}
|
|
393
|
-
['/v1/files/{id}/download']: {
|
|
394
|
-
/**
|
|
395
|
-
* downloadFile - downloadFile
|
|
396
|
-
*
|
|
397
|
-
* Generate pre-signed download S3 url for a file
|
|
398
|
-
*/
|
|
399
|
-
'get'(
|
|
400
|
-
parameters?: Parameters<Paths.DownloadFile.PathParameters & Paths.DownloadFile.QueryParameters> | null,
|
|
401
|
-
data?: any,
|
|
402
|
-
config?: AxiosRequestConfig
|
|
403
|
-
): OperationResponse<Paths.DownloadFile.Responses.$200>
|
|
404
|
-
}
|
|
405
|
-
['/v1/files/{id}/preview']: {
|
|
406
|
-
/**
|
|
407
|
-
* previewFile - previewFile
|
|
408
|
-
*
|
|
409
|
-
* Generate thumbnail preview for a file entity
|
|
410
|
-
*/
|
|
411
|
-
'get'(
|
|
412
|
-
parameters?: Parameters<Paths.PreviewFile.PathParameters & Paths.PreviewFile.QueryParameters> | null,
|
|
413
|
-
data?: any,
|
|
414
|
-
config?: AxiosRequestConfig
|
|
415
|
-
): OperationResponse<any>
|
|
416
|
-
}
|
|
417
|
-
['/v1/files:previewS3']: {
|
|
418
|
-
/**
|
|
419
|
-
* previewS3File - previewS3File
|
|
420
|
-
*
|
|
421
|
-
* Generate thumbnail preview from an s3 reference for a file entity
|
|
422
|
-
*/
|
|
423
|
-
'post'(
|
|
424
|
-
parameters?: Parameters<Paths.PreviewS3File.QueryParameters> | null,
|
|
425
|
-
data?: Paths.PreviewS3File.RequestBody,
|
|
426
|
-
config?: AxiosRequestConfig
|
|
427
|
-
): OperationResponse<any>
|
|
428
|
-
}
|
|
429
|
-
['/v1/files/delete']: {
|
|
430
|
-
/**
|
|
431
|
-
* deleteFile - deleteFile
|
|
432
|
-
*
|
|
433
|
-
* Delete file entity
|
|
434
|
-
*/
|
|
435
|
-
'delete'(
|
|
436
|
-
parameters?: Parameters<UnknownParamsObject> | null,
|
|
437
|
-
data?: Paths.DeleteFile.RequestBody,
|
|
438
|
-
config?: AxiosRequestConfig
|
|
439
|
-
): OperationResponse<any>
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|