@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/dist/openapi.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- import {
2
+ import type {
3
3
  OpenAPIClient,
4
4
  Parameters,
5
5
  UnknownParamsObject,
@@ -8,271 +8,270 @@ import {
8
8
  } from 'openapi-client-axios';
9
9
 
10
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 {
11
+ namespace Schemas {
12
+ export interface DeleteFilePayload {
13
+ s3ref: S3Reference;
14
+ }
15
+ export interface FileEntity {
16
+ _id?: /**
17
+ * example:
18
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
19
+ */
20
+ FileEntityId;
21
+ /**
22
+ * example:
23
+ * document.pdf
24
+ */
25
+ filename?: string;
26
+ access_control?: "private" | "public-read";
27
+ /**
28
+ * Direct URL for file (public only if file access control is public-read)
29
+ * example:
30
+ * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
31
+ */
32
+ public_url?: string; // url
33
+ /**
34
+ * Human readable type for file
35
+ */
36
+ type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
37
+ /**
38
+ * MIME type of the file
39
+ * example:
40
+ * application/pdf
41
+ */
42
+ mime_type?: string;
43
+ /**
44
+ * File size in bytes
45
+ */
46
+ size_bytes?: number;
47
+ versions?: {
48
+ s3ref?: S3Reference;
49
+ }[];
50
+ }
161
51
  /**
162
52
  * example:
163
- * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
53
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
164
54
  */
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;
55
+ export type FileEntityId = string;
56
+ export interface FileItem {
57
+ /**
58
+ * example:
59
+ * epilot-files-prod
60
+ */
61
+ bucket: string;
62
+ /**
63
+ * example:
64
+ * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
65
+ */
66
+ key: string;
67
+ /**
68
+ * example:
69
+ * document.pdf
70
+ */
71
+ filename?: string;
72
+ /**
73
+ * example:
74
+ * 1234
75
+ */
76
+ size_bytes?: number;
77
+ /**
78
+ * example:
79
+ * image/jpeg
80
+ */
81
+ mime_type?: string;
82
+ }
83
+ export interface S3Reference {
84
+ /**
85
+ * example:
86
+ * epilot-files-prod
87
+ */
88
+ bucket: string;
89
+ /**
90
+ * example:
91
+ * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
92
+ */
93
+ key: string;
94
+ }
95
+ export interface SaveFilePayload {
96
+ s3ref: S3Reference;
97
+ /**
98
+ * if passed, adds a new version to existing file entity
99
+ */
100
+ file_entity_id?: string;
101
+ document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
102
+ /**
103
+ * example:
104
+ * document.pdf
105
+ */
106
+ filename?: string;
107
+ _tags?: string[];
108
+ access_control?: "private" | "public-read";
109
+ }
110
+ export interface UploadFilePayload {
111
+ /**
112
+ * example:
113
+ * document.pdf
114
+ */
115
+ filename: string;
116
+ /**
117
+ * MIME type of file
118
+ * example:
119
+ * application/pdf
120
+ */
121
+ mime_type?: string;
122
+ }
175
123
  }
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;
124
+ }
125
+ declare namespace Paths {
126
+ namespace DeleteFile {
127
+ export type RequestBody = Components.Schemas.DeleteFilePayload;
128
+ namespace Responses {
129
+ export interface $200 {
130
+ }
131
+ }
189
132
  }
190
- export interface QueryParameters {
191
- w?: Parameters.W;
192
- h?: Parameters.H;
133
+ namespace DownloadFile {
134
+ namespace Parameters {
135
+ export type Attachment = boolean;
136
+ export type Id = /**
137
+ * example:
138
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
139
+ */
140
+ Components.Schemas.FileEntityId;
141
+ export type Version = number;
142
+ }
143
+ export interface PathParameters {
144
+ id: Parameters.Id;
145
+ }
146
+ export interface QueryParameters {
147
+ version?: Parameters.Version;
148
+ attachment?: Parameters.Attachment;
149
+ }
150
+ namespace Responses {
151
+ export interface $200 {
152
+ /**
153
+ * example:
154
+ * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
155
+ */
156
+ download_url?: string; // uri
157
+ }
158
+ }
193
159
  }
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;
160
+ namespace PreviewFile {
161
+ namespace Parameters {
162
+ export type H = number;
163
+ export type Id = /**
164
+ * example:
165
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
166
+ */
167
+ Components.Schemas.FileEntityId;
168
+ export type Version = number;
169
+ export type W = number;
170
+ }
171
+ export interface PathParameters {
172
+ id: Parameters.Id;
173
+ }
174
+ export interface QueryParameters {
175
+ version?: Parameters.Version;
176
+ w?: Parameters.W;
177
+ h?: Parameters.H;
178
+ }
200
179
  }
201
- }
202
- namespace UploadFile {
203
- namespace Parameters {
204
- export type FileEntityId = Components.Schemas.FileEntityId;
180
+ namespace PreviewS3File {
181
+ namespace Parameters {
182
+ export type H = number;
183
+ export type W = number;
184
+ }
185
+ export interface QueryParameters {
186
+ w?: Parameters.W;
187
+ h?: Parameters.H;
188
+ }
189
+ export type RequestBody = Components.Schemas.S3Reference;
205
190
  }
206
- export interface QueryParameters {
207
- file_entity_id?: Parameters.FileEntityId;
191
+ namespace SaveFile {
192
+ export type RequestBody = Components.Schemas.SaveFilePayload;
193
+ namespace Responses {
194
+ export type $201 = Components.Schemas.FileEntity;
195
+ }
208
196
  }
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
- }
197
+ namespace UploadFile {
198
+ namespace Parameters {
199
+ export type FileEntityId = /**
200
+ * example:
201
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
202
+ */
203
+ Components.Schemas.FileEntityId;
204
+ }
205
+ export interface QueryParameters {
206
+ file_entity_id?: Parameters.FileEntityId;
207
+ }
208
+ export type RequestBody = Components.Schemas.UploadFilePayload;
209
+ namespace Responses {
210
+ export interface $201 {
211
+ /**
212
+ * example:
213
+ * {
214
+ * "bucket": "epilot-files-prod",
215
+ * "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
216
+ * }
217
+ */
218
+ s3ref?: {
219
+ /**
220
+ * example:
221
+ * epilot-files-prod
222
+ */
223
+ bucket: string;
224
+ /**
225
+ * example:
226
+ * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
227
+ */
228
+ key: string;
229
+ };
230
+ /**
231
+ * example:
232
+ * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
233
+ */
234
+ upload_url?: string; // url
235
+ /**
236
+ * Returned only if file is permanent i.e. file_entity_id is passed
237
+ * example:
238
+ * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
239
+ */
240
+ public_url?: string; // url
241
+ }
242
+ }
243
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
- }
244
+ namespace UploadFilePublic {
245
+ export type RequestBody = Components.Schemas.UploadFilePayload;
246
+ namespace Responses {
247
+ export interface $201 {
248
+ /**
249
+ * example:
250
+ * {
251
+ * "bucket": "epilot-files-prod",
252
+ * "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
253
+ * }
254
+ */
255
+ s3ref?: {
256
+ /**
257
+ * example:
258
+ * epilot-files-prod
259
+ */
260
+ bucket: string;
261
+ /**
262
+ * example:
263
+ * 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
264
+ */
265
+ key: string;
266
+ };
267
+ /**
268
+ * example:
269
+ * https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
270
+ */
271
+ upload_url?: string; // url
272
+ }
273
+ }
274
274
  }
275
- }
276
275
  }
277
276
 
278
277
  export interface OperationMethods {
@@ -327,16 +326,6 @@ export interface OperationMethods {
327
326
  data?: any,
328
327
  config?: AxiosRequestConfig
329
328
  ): 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
329
  /**
341
330
  * previewFile - previewFile
342
331
  *
@@ -366,7 +355,7 @@ export interface OperationMethods {
366
355
  parameters?: Parameters<UnknownParamsObject> | null,
367
356
  data?: Paths.DeleteFile.RequestBody,
368
357
  config?: AxiosRequestConfig
369
- ): OperationResponse<any>
358
+ ): OperationResponse<Paths.DeleteFile.Responses.$200>
370
359
  }
371
360
 
372
361
  export interface PathsDictionary {
@@ -429,18 +418,6 @@ export interface PathsDictionary {
429
418
  config?: AxiosRequestConfig
430
419
  ): OperationResponse<Paths.DownloadFile.Responses.$200>
431
420
  }
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
421
  ['/v1/files/{id}/preview']: {
445
422
  /**
446
423
  * previewFile - previewFile
@@ -475,7 +452,7 @@ export interface PathsDictionary {
475
452
  parameters?: Parameters<UnknownParamsObject> | null,
476
453
  data?: Paths.DeleteFile.RequestBody,
477
454
  config?: AxiosRequestConfig
478
- ): OperationResponse<any>
455
+ ): OperationResponse<Paths.DeleteFile.Responses.$200>
479
456
  }
480
457
  }
481
458