@epilot/file-client 1.3.0 → 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/src/openapi.d.ts DELETED
@@ -1,482 +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 Version = number;
130
- }
131
- export interface PathParameters {
132
- id: Parameters.Id;
133
- }
134
- export interface QueryParameters {
135
- version?: Parameters.Version;
136
- attachment?: Parameters.Attachment;
137
- }
138
- namespace Responses {
139
- export interface $200 {
140
- /**
141
- * example:
142
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
143
- */
144
- download_url?: string; // uri
145
- }
146
- }
147
- }
148
- namespace DownloadS3File {
149
- namespace Parameters {
150
- export type Attachment = boolean;
151
- export type S3Bucket = string;
152
- export type S3Key = string;
153
- }
154
- export interface QueryParameters {
155
- s3_key: Parameters.S3Key;
156
- s3_bucket: Parameters.S3Bucket;
157
- attachment?: Parameters.Attachment;
158
- }
159
- namespace Responses {
160
- export interface $200 {
161
- /**
162
- * example:
163
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
164
- */
165
- download_url?: string; // uri
166
- }
167
- }
168
- }
169
- namespace PreviewFile {
170
- namespace Parameters {
171
- export type H = number;
172
- export type Id = Components.Schemas.FileEntityId;
173
- export type Version = number;
174
- export type W = number;
175
- }
176
- export interface PathParameters {
177
- id: Parameters.Id;
178
- }
179
- export interface QueryParameters {
180
- version?: Parameters.Version;
181
- w?: Parameters.W;
182
- h?: Parameters.H;
183
- }
184
- }
185
- namespace PreviewS3File {
186
- namespace Parameters {
187
- export type H = number;
188
- export type W = number;
189
- }
190
- export interface QueryParameters {
191
- w?: Parameters.W;
192
- h?: Parameters.H;
193
- }
194
- export type RequestBody = Components.Schemas.S3Reference;
195
- }
196
- namespace SaveFile {
197
- export type RequestBody = Components.Schemas.SaveFilePayload;
198
- namespace Responses {
199
- export type $201 = Components.Schemas.FileEntity;
200
- }
201
- }
202
- namespace UploadFile {
203
- namespace Parameters {
204
- export type FileEntityId = Components.Schemas.FileEntityId;
205
- }
206
- export interface QueryParameters {
207
- file_entity_id?: Parameters.FileEntityId;
208
- }
209
- export type RequestBody = Components.Schemas.UploadFilePayload;
210
- namespace Responses {
211
- export interface $201 {
212
- /**
213
- * example:
214
- * {
215
- * "bucket": "epilot-files-prod",
216
- * "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
217
- * }
218
- */
219
- s3ref?: {
220
- /**
221
- * example:
222
- * epilot-files-prod
223
- */
224
- bucket: string;
225
- /**
226
- * example:
227
- * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
228
- */
229
- key: string;
230
- };
231
- /**
232
- * example:
233
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
234
- */
235
- upload_url?: string; // url
236
- /**
237
- * Returned only if file is permanent i.e. file_entity_id is passed
238
- * example:
239
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
240
- */
241
- public_url?: string; // url
242
- }
243
- }
244
- }
245
- namespace UploadFilePublic {
246
- export type RequestBody = Components.Schemas.UploadFilePayload;
247
- namespace Responses {
248
- export interface $201 {
249
- /**
250
- * example:
251
- * {
252
- * "bucket": "epilot-files-prod",
253
- * "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
254
- * }
255
- */
256
- s3ref?: {
257
- /**
258
- * example:
259
- * epilot-files-prod
260
- */
261
- bucket: string;
262
- /**
263
- * example:
264
- * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
265
- */
266
- key: string;
267
- };
268
- /**
269
- * example:
270
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
271
- */
272
- upload_url?: string; // url
273
- }
274
- }
275
- }
276
- }
277
-
278
- export interface OperationMethods {
279
- /**
280
- * uploadFilePublic - uploadFilePublic
281
- *
282
- * Create pre-signed S3 URL to upload a file to keep temporarily (one week).
283
- *
284
- * Use the createFile operation to store file file permanently.
285
- *
286
- */
287
- 'uploadFilePublic'(
288
- parameters?: Parameters<UnknownParamsObject> | null,
289
- data?: Paths.UploadFilePublic.RequestBody,
290
- config?: AxiosRequestConfig
291
- ): OperationResponse<Paths.UploadFilePublic.Responses.$201>
292
- /**
293
- * uploadFile - uploadFile
294
- *
295
- * Create pre-signed S3 URL to upload a file to keep temporarily (one week).
296
- *
297
- * Use the createFile operation to store file file permanently.
298
- *
299
- */
300
- 'uploadFile'(
301
- parameters?: Parameters<Paths.UploadFile.QueryParameters> | null,
302
- data?: Paths.UploadFile.RequestBody,
303
- config?: AxiosRequestConfig
304
- ): OperationResponse<Paths.UploadFile.Responses.$201>
305
- /**
306
- * saveFile - saveFile
307
- *
308
- * Create / Update a permanent File entity
309
- *
310
- * Makes file object permanent
311
- *
312
- * Saves metadata to file entity
313
- *
314
- */
315
- 'saveFile'(
316
- parameters?: Parameters<UnknownParamsObject> | null,
317
- data?: Paths.SaveFile.RequestBody,
318
- config?: AxiosRequestConfig
319
- ): OperationResponse<Paths.SaveFile.Responses.$201>
320
- /**
321
- * downloadFile - downloadFile
322
- *
323
- * Generate pre-signed download S3 url for a file
324
- */
325
- 'downloadFile'(
326
- parameters?: Parameters<Paths.DownloadFile.PathParameters & Paths.DownloadFile.QueryParameters> | null,
327
- data?: any,
328
- config?: AxiosRequestConfig
329
- ): OperationResponse<Paths.DownloadFile.Responses.$200>
330
- /**
331
- * downloadS3File - downloadS3File
332
- *
333
- * Generate pre-signed download S3 url for a file
334
- */
335
- 'downloadS3File'(
336
- parameters?: Parameters<Paths.DownloadS3File.QueryParameters> | null,
337
- data?: any,
338
- config?: AxiosRequestConfig
339
- ): OperationResponse<Paths.DownloadS3File.Responses.$200>
340
- /**
341
- * previewFile - previewFile
342
- *
343
- * Generate thumbnail preview for a file entity
344
- */
345
- 'previewFile'(
346
- parameters?: Parameters<Paths.PreviewFile.PathParameters & Paths.PreviewFile.QueryParameters> | null,
347
- data?: any,
348
- config?: AxiosRequestConfig
349
- ): OperationResponse<any>
350
- /**
351
- * previewS3File - previewS3File
352
- *
353
- * Generate thumbnail preview from an s3 reference for a file entity
354
- */
355
- 'previewS3File'(
356
- parameters?: Parameters<Paths.PreviewS3File.QueryParameters> | null,
357
- data?: Paths.PreviewS3File.RequestBody,
358
- config?: AxiosRequestConfig
359
- ): OperationResponse<any>
360
- /**
361
- * deleteFile - deleteFile
362
- *
363
- * Delete file entity
364
- */
365
- 'deleteFile'(
366
- parameters?: Parameters<UnknownParamsObject> | null,
367
- data?: Paths.DeleteFile.RequestBody,
368
- config?: AxiosRequestConfig
369
- ): OperationResponse<any>
370
- }
371
-
372
- export interface PathsDictionary {
373
- ['/v1/files/public/upload']: {
374
- /**
375
- * uploadFilePublic - uploadFilePublic
376
- *
377
- * Create pre-signed S3 URL to upload a file to keep temporarily (one week).
378
- *
379
- * Use the createFile operation to store file file permanently.
380
- *
381
- */
382
- 'post'(
383
- parameters?: Parameters<UnknownParamsObject> | null,
384
- data?: Paths.UploadFilePublic.RequestBody,
385
- config?: AxiosRequestConfig
386
- ): OperationResponse<Paths.UploadFilePublic.Responses.$201>
387
- }
388
- ['/v1/files/upload']: {
389
- /**
390
- * uploadFile - uploadFile
391
- *
392
- * Create pre-signed S3 URL to upload a file to keep temporarily (one week).
393
- *
394
- * Use the createFile operation to store file file permanently.
395
- *
396
- */
397
- 'post'(
398
- parameters?: Parameters<Paths.UploadFile.QueryParameters> | null,
399
- data?: Paths.UploadFile.RequestBody,
400
- config?: AxiosRequestConfig
401
- ): OperationResponse<Paths.UploadFile.Responses.$201>
402
- }
403
- ['/v1/files']: {
404
- /**
405
- * saveFile - saveFile
406
- *
407
- * Create / Update a permanent File entity
408
- *
409
- * Makes file object permanent
410
- *
411
- * Saves metadata to file entity
412
- *
413
- */
414
- 'post'(
415
- parameters?: Parameters<UnknownParamsObject> | null,
416
- data?: Paths.SaveFile.RequestBody,
417
- config?: AxiosRequestConfig
418
- ): OperationResponse<Paths.SaveFile.Responses.$201>
419
- }
420
- ['/v1/files/{id}/download']: {
421
- /**
422
- * downloadFile - downloadFile
423
- *
424
- * Generate pre-signed download S3 url for a file
425
- */
426
- 'get'(
427
- parameters?: Parameters<Paths.DownloadFile.PathParameters & Paths.DownloadFile.QueryParameters> | null,
428
- data?: any,
429
- config?: AxiosRequestConfig
430
- ): OperationResponse<Paths.DownloadFile.Responses.$200>
431
- }
432
- ['/v1/files:downloadS3']: {
433
- /**
434
- * downloadS3File - downloadS3File
435
- *
436
- * Generate pre-signed download S3 url for a file
437
- */
438
- 'post'(
439
- parameters?: Parameters<Paths.DownloadS3File.QueryParameters> | null,
440
- data?: any,
441
- config?: AxiosRequestConfig
442
- ): OperationResponse<Paths.DownloadS3File.Responses.$200>
443
- }
444
- ['/v1/files/{id}/preview']: {
445
- /**
446
- * previewFile - previewFile
447
- *
448
- * Generate thumbnail preview for a file entity
449
- */
450
- 'get'(
451
- parameters?: Parameters<Paths.PreviewFile.PathParameters & Paths.PreviewFile.QueryParameters> | null,
452
- data?: any,
453
- config?: AxiosRequestConfig
454
- ): OperationResponse<any>
455
- }
456
- ['/v1/files:previewS3']: {
457
- /**
458
- * previewS3File - previewS3File
459
- *
460
- * Generate thumbnail preview from an s3 reference for a file entity
461
- */
462
- 'post'(
463
- parameters?: Parameters<Paths.PreviewS3File.QueryParameters> | null,
464
- data?: Paths.PreviewS3File.RequestBody,
465
- config?: AxiosRequestConfig
466
- ): OperationResponse<any>
467
- }
468
- ['/v1/files/delete']: {
469
- /**
470
- * deleteFile - deleteFile
471
- *
472
- * Delete file entity
473
- */
474
- 'delete'(
475
- parameters?: Parameters<UnknownParamsObject> | null,
476
- data?: Paths.DeleteFile.RequestBody,
477
- config?: AxiosRequestConfig
478
- ): OperationResponse<any>
479
- }
480
- }
481
-
482
- export type Client = OpenAPIClient<OperationMethods, PathsDictionary>