@epilot/file-client 1.10.0 → 1.11.0
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/LICENSE +21 -0
- package/dist/definition.js +1 -1
- package/dist/openapi-runtime.json +29 -1
- package/dist/openapi.d.ts +157 -0
- package/dist/openapi.json +243 -2
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 epilot GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={914:function(e,i,
|
|
1
|
+
(()=>{"use strict";var e={914:function(e,i,t){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(i,"__esModule",{value:!0});var r=n(t(240));i.default=r.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v1/files/public/upload":{"post":{"operationId":"uploadFilePublic","requestBody":{"content":{"application/json":{}}}}},"/v1/files/upload":{"post":{"operationId":"uploadFile","parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}}}},"/v1/files":{"post":{"operationId":"saveFile","requestBody":{"content":{"application/json":{}}}}},"/v1/files/{id}/download":{"get":{"operationId":"downloadFile","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query"},{"name":"attachment","in":"query"}]}},"/v1/files/download:verify":{"post":{"operationId":"verifyCustomDownloadUrl","requestBody":{"content":{"application/json":{}}}}},"/v1/files:downloadFiles":{"post":{"operationId":"downloadFiles","requestBody":{"content":{"application/json":{}}}}},"/v1/files:downloadS3":{"post":{"operationId":"downloadS3File","parameters":[{"name":"s3_key","in":"query","required":true},{"name":"s3_bucket","in":"query","required":true},{"name":"attachment","in":"query"}]}},"/v1/files/{id}/preview":{"get":{"operationId":"previewFile","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query"},{"name":"w","in":"query"},{"name":"h","in":"query"}]}},"/v1/files/public/{id}/preview":{"get":{"operationId":"previewPublicFile","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query"},{"name":"w","in":"query"},{"name":"h","in":"query"},{"name":"org_id","in":"query"}]}},"/v1/files:previewS3":{"get":{"operationId":"previewS3FileGet","parameters":[{"name":"key","in":"query","required":true},{"name":"bucket","in":"query","required":true},{"name":"w","in":"query"},{"name":"h","in":"query"}]},"post":{"operationId":"previewS3File","parameters":[{"name":"w","in":"query"},{"name":"h","in":"query"}],"requestBody":{"content":{"application/json":{}}}}},"/v1/files/delete":{"delete":{"operationId":"deleteFile","requestBody":{"content":{"application/json":{}}}}},"/v1/files/session":{"get":{"operationId":"getSession"},"delete":{"operationId":"deleteSession"}},"/v1/files/{id}/public/links":{"post":{"operationId":"generatePublicLink","parameters":[{"name":"id","in":"path","required":true}]},"get":{"operationId":"getAllPublicLinksForFile","parameters":[{"name":"id","in":"path","required":true}]}},"/v1/files/public/links/{id}/{filename}":{"get":{"operationId":"accessPublicLink","parameters":[{"name":"id","in":"path","required":true},{"name":"filename","in":"path","required":true}]}},"/v1/files/public/links/{id}":{"delete":{"operationId":"revokePublicLink","parameters":[{"name":"id","in":"path","required":true}]}},"/v2/files/upload":{"post":{"operationId":"uploadFileV2","parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}}}},"/v2/files":{"post":{"operationId":"saveFileV2","requestBody":{"content":{"application/json":{}}}}}},"components":{},"servers":[{"url":"https://file.sls.epilot.io"}]}')}},i={},t=function t(n){var r=i[n];if(void 0!==r)return r.exports;var o=i[n]={exports:{}};return e[n].call(o.exports,o,o.exports,t),o.exports}(914),n=exports;for(var r in t)n[r]=t[r];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
|
|
@@ -252,7 +252,9 @@
|
|
|
252
252
|
"required": true
|
|
253
253
|
}
|
|
254
254
|
]
|
|
255
|
-
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"/v1/files/public/links/{id}": {
|
|
256
258
|
"delete": {
|
|
257
259
|
"operationId": "revokePublicLink",
|
|
258
260
|
"parameters": [
|
|
@@ -263,6 +265,32 @@
|
|
|
263
265
|
}
|
|
264
266
|
]
|
|
265
267
|
}
|
|
268
|
+
},
|
|
269
|
+
"/v2/files/upload": {
|
|
270
|
+
"post": {
|
|
271
|
+
"operationId": "uploadFileV2",
|
|
272
|
+
"parameters": [
|
|
273
|
+
{
|
|
274
|
+
"name": "file_entity_id",
|
|
275
|
+
"in": "query"
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"requestBody": {
|
|
279
|
+
"content": {
|
|
280
|
+
"application/json": {}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"/v2/files": {
|
|
286
|
+
"post": {
|
|
287
|
+
"operationId": "saveFileV2",
|
|
288
|
+
"requestBody": {
|
|
289
|
+
"content": {
|
|
290
|
+
"application/json": {}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
266
294
|
}
|
|
267
295
|
},
|
|
268
296
|
"components": {},
|
package/dist/openapi.d.ts
CHANGED
|
@@ -137,6 +137,38 @@ declare namespace Components {
|
|
|
137
137
|
EntitySlug;
|
|
138
138
|
_tags?: string[];
|
|
139
139
|
}
|
|
140
|
+
export interface FileUpload {
|
|
141
|
+
/**
|
|
142
|
+
* example:
|
|
143
|
+
* {
|
|
144
|
+
* "bucket": "epilot-files-prod",
|
|
145
|
+
* "key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
146
|
+
* }
|
|
147
|
+
*/
|
|
148
|
+
s3ref?: {
|
|
149
|
+
/**
|
|
150
|
+
* example:
|
|
151
|
+
* epilot-files-prod
|
|
152
|
+
*/
|
|
153
|
+
bucket: string;
|
|
154
|
+
/**
|
|
155
|
+
* example:
|
|
156
|
+
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
157
|
+
*/
|
|
158
|
+
key: string;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* example:
|
|
162
|
+
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
|
|
163
|
+
*/
|
|
164
|
+
upload_url?: string; // url
|
|
165
|
+
/**
|
|
166
|
+
* Returned only if file is permanent i.e. file_entity_id is passed
|
|
167
|
+
* example:
|
|
168
|
+
* https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
169
|
+
*/
|
|
170
|
+
public_url?: string; // url
|
|
171
|
+
}
|
|
140
172
|
export interface PublicLink {
|
|
141
173
|
/**
|
|
142
174
|
* ID of the public link
|
|
@@ -191,6 +223,37 @@ declare namespace Components {
|
|
|
191
223
|
custom_download_url: string; // uri
|
|
192
224
|
}
|
|
193
225
|
export type SaveFilePayload = SaveS3FilePayload | SaveCustomFilePayload;
|
|
226
|
+
export interface SaveFilePayloadV2 {
|
|
227
|
+
[name: string]: any;
|
|
228
|
+
s3ref: {
|
|
229
|
+
/**
|
|
230
|
+
* example:
|
|
231
|
+
* epilot-files-prod
|
|
232
|
+
*/
|
|
233
|
+
bucket: string;
|
|
234
|
+
/**
|
|
235
|
+
* example:
|
|
236
|
+
* 123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf
|
|
237
|
+
*/
|
|
238
|
+
key: string;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* example:
|
|
242
|
+
* document.pdf
|
|
243
|
+
*/
|
|
244
|
+
filename: string;
|
|
245
|
+
/**
|
|
246
|
+
* if passed, adds a new version to existing file entity
|
|
247
|
+
*/
|
|
248
|
+
file_entity_id?: string;
|
|
249
|
+
document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
250
|
+
_tags?: string[];
|
|
251
|
+
access_control?: "private" | "public-read";
|
|
252
|
+
/**
|
|
253
|
+
* Custom external download url used for the file
|
|
254
|
+
*/
|
|
255
|
+
custom_download_url?: string; // uri
|
|
256
|
+
}
|
|
194
257
|
export interface SaveS3FilePayload {
|
|
195
258
|
[name: string]: any;
|
|
196
259
|
/**
|
|
@@ -223,6 +286,16 @@ declare namespace Components {
|
|
|
223
286
|
* application/pdf
|
|
224
287
|
*/
|
|
225
288
|
mime_type?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Allows passing in custom metadata for the file, expects key-value pairs of string type
|
|
291
|
+
* example:
|
|
292
|
+
* {
|
|
293
|
+
* "color": "blue"
|
|
294
|
+
* }
|
|
295
|
+
*/
|
|
296
|
+
metadata?: {
|
|
297
|
+
[name: string]: string;
|
|
298
|
+
};
|
|
226
299
|
}
|
|
227
300
|
export interface VerifyCustomDownloadUrlPayload {
|
|
228
301
|
/**
|
|
@@ -489,6 +562,12 @@ declare namespace Paths {
|
|
|
489
562
|
export type $201 = Components.Schemas.FileEntity;
|
|
490
563
|
}
|
|
491
564
|
}
|
|
565
|
+
namespace SaveFileV2 {
|
|
566
|
+
export type RequestBody = Components.Schemas.SaveFilePayloadV2;
|
|
567
|
+
namespace Responses {
|
|
568
|
+
export type $201 = Components.Schemas.FileEntity;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
492
571
|
namespace UploadFile {
|
|
493
572
|
namespace Parameters {
|
|
494
573
|
export type FileEntityId = /**
|
|
@@ -567,6 +646,22 @@ declare namespace Paths {
|
|
|
567
646
|
}
|
|
568
647
|
}
|
|
569
648
|
}
|
|
649
|
+
namespace UploadFileV2 {
|
|
650
|
+
namespace Parameters {
|
|
651
|
+
export type FileEntityId = /**
|
|
652
|
+
* example:
|
|
653
|
+
* ef7d985c-2385-44f4-9c71-ae06a52264f8
|
|
654
|
+
*/
|
|
655
|
+
Components.Schemas.FileEntityId;
|
|
656
|
+
}
|
|
657
|
+
export interface QueryParameters {
|
|
658
|
+
file_entity_id?: Parameters.FileEntityId;
|
|
659
|
+
}
|
|
660
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
661
|
+
namespace Responses {
|
|
662
|
+
export type $201 = Components.Schemas.FileUpload;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
570
665
|
namespace VerifyCustomDownloadUrl {
|
|
571
666
|
export type RequestBody = Components.Schemas.VerifyCustomDownloadUrlPayload;
|
|
572
667
|
namespace Responses {
|
|
@@ -773,6 +868,34 @@ export interface OperationMethods {
|
|
|
773
868
|
data?: any,
|
|
774
869
|
config?: AxiosRequestConfig
|
|
775
870
|
): OperationResponse<Paths.RevokePublicLink.Responses.$204>
|
|
871
|
+
/**
|
|
872
|
+
* uploadFileV2 - uploadFileV2
|
|
873
|
+
*
|
|
874
|
+
* Create pre-signed S3 URL to upload a file to keep temporarily (one week). - v2
|
|
875
|
+
*
|
|
876
|
+
* Use the createFile operation to store file file permanently.
|
|
877
|
+
*
|
|
878
|
+
*/
|
|
879
|
+
'uploadFileV2'(
|
|
880
|
+
parameters?: Parameters<Paths.UploadFileV2.QueryParameters> | null,
|
|
881
|
+
data?: Paths.UploadFileV2.RequestBody,
|
|
882
|
+
config?: AxiosRequestConfig
|
|
883
|
+
): OperationResponse<Paths.UploadFileV2.Responses.$201>
|
|
884
|
+
/**
|
|
885
|
+
* saveFileV2 - saveFileV2
|
|
886
|
+
*
|
|
887
|
+
* Create / Update a permanent File entity
|
|
888
|
+
*
|
|
889
|
+
* Makes file object permanent
|
|
890
|
+
*
|
|
891
|
+
* Saves metadata to file entity
|
|
892
|
+
*
|
|
893
|
+
*/
|
|
894
|
+
'saveFileV2'(
|
|
895
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
896
|
+
data?: Paths.SaveFileV2.RequestBody,
|
|
897
|
+
config?: AxiosRequestConfig
|
|
898
|
+
): OperationResponse<Paths.SaveFileV2.Responses.$201>
|
|
776
899
|
}
|
|
777
900
|
|
|
778
901
|
export interface PathsDictionary {
|
|
@@ -988,6 +1111,8 @@ export interface PathsDictionary {
|
|
|
988
1111
|
data?: any,
|
|
989
1112
|
config?: AxiosRequestConfig
|
|
990
1113
|
): OperationResponse<any>
|
|
1114
|
+
}
|
|
1115
|
+
['/v1/files/public/links/{id}']: {
|
|
991
1116
|
/**
|
|
992
1117
|
* revokePublicLink - revokePublicLink
|
|
993
1118
|
*
|
|
@@ -999,6 +1124,38 @@ export interface PathsDictionary {
|
|
|
999
1124
|
config?: AxiosRequestConfig
|
|
1000
1125
|
): OperationResponse<Paths.RevokePublicLink.Responses.$204>
|
|
1001
1126
|
}
|
|
1127
|
+
['/v2/files/upload']: {
|
|
1128
|
+
/**
|
|
1129
|
+
* uploadFileV2 - uploadFileV2
|
|
1130
|
+
*
|
|
1131
|
+
* Create pre-signed S3 URL to upload a file to keep temporarily (one week). - v2
|
|
1132
|
+
*
|
|
1133
|
+
* Use the createFile operation to store file file permanently.
|
|
1134
|
+
*
|
|
1135
|
+
*/
|
|
1136
|
+
'post'(
|
|
1137
|
+
parameters?: Parameters<Paths.UploadFileV2.QueryParameters> | null,
|
|
1138
|
+
data?: Paths.UploadFileV2.RequestBody,
|
|
1139
|
+
config?: AxiosRequestConfig
|
|
1140
|
+
): OperationResponse<Paths.UploadFileV2.Responses.$201>
|
|
1141
|
+
}
|
|
1142
|
+
['/v2/files']: {
|
|
1143
|
+
/**
|
|
1144
|
+
* saveFileV2 - saveFileV2
|
|
1145
|
+
*
|
|
1146
|
+
* Create / Update a permanent File entity
|
|
1147
|
+
*
|
|
1148
|
+
* Makes file object permanent
|
|
1149
|
+
*
|
|
1150
|
+
* Saves metadata to file entity
|
|
1151
|
+
*
|
|
1152
|
+
*/
|
|
1153
|
+
'post'(
|
|
1154
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
1155
|
+
data?: Paths.SaveFileV2.RequestBody,
|
|
1156
|
+
config?: AxiosRequestConfig
|
|
1157
|
+
): OperationResponse<Paths.SaveFileV2.Responses.$201>
|
|
1158
|
+
}
|
|
1002
1159
|
}
|
|
1003
1160
|
|
|
1004
1161
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
package/dist/openapi.json
CHANGED
|
@@ -799,7 +799,9 @@
|
|
|
799
799
|
"description": "Redirect to signed URL where the caller can access the file"
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
}
|
|
802
|
+
}
|
|
803
|
+
},
|
|
804
|
+
"/v1/files/public/links/{id}": {
|
|
803
805
|
"delete": {
|
|
804
806
|
"operationId": "revokePublicLink",
|
|
805
807
|
"summary": "revokePublicLink",
|
|
@@ -835,6 +837,131 @@
|
|
|
835
837
|
}
|
|
836
838
|
}
|
|
837
839
|
}
|
|
840
|
+
},
|
|
841
|
+
"/v2/files/upload": {
|
|
842
|
+
"post": {
|
|
843
|
+
"operationId": "uploadFileV2",
|
|
844
|
+
"summary": "uploadFileV2",
|
|
845
|
+
"description": "Create pre-signed S3 URL to upload a file to keep temporarily (one week). - v2\n\nUse the createFile operation to store file file permanently.\n",
|
|
846
|
+
"tags": [
|
|
847
|
+
"files"
|
|
848
|
+
],
|
|
849
|
+
"parameters": [
|
|
850
|
+
{
|
|
851
|
+
"name": "file_entity_id",
|
|
852
|
+
"in": "query",
|
|
853
|
+
"description": "file entity id",
|
|
854
|
+
"schema": {
|
|
855
|
+
"$ref": "#/components/schemas/FileEntityId"
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
"requestBody": {
|
|
860
|
+
"content": {
|
|
861
|
+
"application/json": {
|
|
862
|
+
"schema": {
|
|
863
|
+
"$ref": "#/components/schemas/UploadFilePayload",
|
|
864
|
+
"type": "object"
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
},
|
|
869
|
+
"responses": {
|
|
870
|
+
"201": {
|
|
871
|
+
"description": "Pre-signed URL for POST / PUT upload",
|
|
872
|
+
"content": {
|
|
873
|
+
"application/json": {
|
|
874
|
+
"schema": {
|
|
875
|
+
"$ref": "#/components/schemas/FileUpload"
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
"/v2/files": {
|
|
884
|
+
"post": {
|
|
885
|
+
"operationId": "saveFileV2",
|
|
886
|
+
"summary": "saveFileV2",
|
|
887
|
+
"description": "Create / Update a permanent File entity\n\nMakes file object permanent\n\nSaves metadata to file entity\n",
|
|
888
|
+
"tags": [
|
|
889
|
+
"files"
|
|
890
|
+
],
|
|
891
|
+
"requestBody": {
|
|
892
|
+
"content": {
|
|
893
|
+
"application/json": {
|
|
894
|
+
"schema": {
|
|
895
|
+
"$ref": "#/components/schemas/SaveFilePayloadV2"
|
|
896
|
+
},
|
|
897
|
+
"examples": {
|
|
898
|
+
"S3File": {
|
|
899
|
+
"description": "Standard epilot file entity with S3 Ref",
|
|
900
|
+
"value": {
|
|
901
|
+
"file_entity_id": "string",
|
|
902
|
+
"document_type": "document",
|
|
903
|
+
"filename": "document.pdf",
|
|
904
|
+
"_tags": [
|
|
905
|
+
"string"
|
|
906
|
+
],
|
|
907
|
+
"access_control": "private",
|
|
908
|
+
"s3ref": {
|
|
909
|
+
"bucket": "epilot-files-prod",
|
|
910
|
+
"key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
"CustomFile": {
|
|
915
|
+
"description": "Custom file entity with custom download url",
|
|
916
|
+
"value": {
|
|
917
|
+
"file_entity_id": "string",
|
|
918
|
+
"document_type": "document",
|
|
919
|
+
"filename": "document.pdf",
|
|
920
|
+
"_tags": [
|
|
921
|
+
"string"
|
|
922
|
+
],
|
|
923
|
+
"access_control": "private",
|
|
924
|
+
"custom_download_url": "https://some-api-url.com/download?file_id=123",
|
|
925
|
+
"shared_with_end_customer": true
|
|
926
|
+
}
|
|
927
|
+
},
|
|
928
|
+
"CustomFileWithRelations": {
|
|
929
|
+
"description": "Custom file entity with custom download url",
|
|
930
|
+
"value": {
|
|
931
|
+
"file_entity_id": "string",
|
|
932
|
+
"document_type": "document",
|
|
933
|
+
"filename": "document.pdf",
|
|
934
|
+
"_tags": [
|
|
935
|
+
"string"
|
|
936
|
+
],
|
|
937
|
+
"access_control": "private",
|
|
938
|
+
"custom_download_url": "https://some-api-url.com/download?file_id=123",
|
|
939
|
+
"shared_with_end_customer": true,
|
|
940
|
+
"relations": [
|
|
941
|
+
{
|
|
942
|
+
"entity_id": "77a1e0cc-7b92-4d41-8cce-eefd317ec004",
|
|
943
|
+
"_schema": "contact"
|
|
944
|
+
}
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
"responses": {
|
|
953
|
+
"201": {
|
|
954
|
+
"description": "Created File Entity",
|
|
955
|
+
"content": {
|
|
956
|
+
"application/json": {
|
|
957
|
+
"schema": {
|
|
958
|
+
"$ref": "#/components/schemas/FileEntity"
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
838
965
|
}
|
|
839
966
|
},
|
|
840
967
|
"components": {
|
|
@@ -943,12 +1070,55 @@
|
|
|
943
1070
|
"type": "string",
|
|
944
1071
|
"example": "application/pdf",
|
|
945
1072
|
"default": "application/octet-stream"
|
|
1073
|
+
},
|
|
1074
|
+
"metadata": {
|
|
1075
|
+
"type": "object",
|
|
1076
|
+
"additionalProperties": {
|
|
1077
|
+
"anyOf": [
|
|
1078
|
+
{
|
|
1079
|
+
"type": "string"
|
|
1080
|
+
}
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
"example": {
|
|
1084
|
+
"color": "blue"
|
|
1085
|
+
},
|
|
1086
|
+
"description": "Allows passing in custom metadata for the file, expects key-value pairs of string type"
|
|
946
1087
|
}
|
|
947
1088
|
},
|
|
948
1089
|
"required": [
|
|
949
1090
|
"filename"
|
|
950
1091
|
]
|
|
951
1092
|
},
|
|
1093
|
+
"FileUpload": {
|
|
1094
|
+
"type": "object",
|
|
1095
|
+
"properties": {
|
|
1096
|
+
"s3ref": {
|
|
1097
|
+
"allOf": [
|
|
1098
|
+
{
|
|
1099
|
+
"$ref": "#/components/schemas/S3Reference"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"example": {
|
|
1103
|
+
"bucket": "epilot-files-prod",
|
|
1104
|
+
"key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
]
|
|
1108
|
+
},
|
|
1109
|
+
"upload_url": {
|
|
1110
|
+
"type": "string",
|
|
1111
|
+
"format": "url",
|
|
1112
|
+
"example": "https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"
|
|
1113
|
+
},
|
|
1114
|
+
"public_url": {
|
|
1115
|
+
"description": "Returned only if file is permanent i.e. file_entity_id is passed",
|
|
1116
|
+
"type": "string",
|
|
1117
|
+
"format": "url",
|
|
1118
|
+
"example": "https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
952
1122
|
"DownloadFilesPayload": {
|
|
953
1123
|
"type": "array",
|
|
954
1124
|
"items": {
|
|
@@ -1068,6 +1238,77 @@
|
|
|
1068
1238
|
}
|
|
1069
1239
|
]
|
|
1070
1240
|
},
|
|
1241
|
+
"SaveFilePayloadV2": {
|
|
1242
|
+
"type": "object",
|
|
1243
|
+
"properties": {
|
|
1244
|
+
"s3ref": {
|
|
1245
|
+
"type": "object",
|
|
1246
|
+
"properties": {
|
|
1247
|
+
"bucket": {
|
|
1248
|
+
"type": "string",
|
|
1249
|
+
"example": "epilot-files-prod"
|
|
1250
|
+
},
|
|
1251
|
+
"key": {
|
|
1252
|
+
"type": "string",
|
|
1253
|
+
"example": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
"required": [
|
|
1257
|
+
"bucket",
|
|
1258
|
+
"key"
|
|
1259
|
+
]
|
|
1260
|
+
},
|
|
1261
|
+
"filename": {
|
|
1262
|
+
"type": "string",
|
|
1263
|
+
"example": "document.pdf"
|
|
1264
|
+
},
|
|
1265
|
+
"file_entity_id": {
|
|
1266
|
+
"type": "string",
|
|
1267
|
+
"description": "if passed, adds a new version to existing file entity"
|
|
1268
|
+
},
|
|
1269
|
+
"document_type": {
|
|
1270
|
+
"type": "string",
|
|
1271
|
+
"enum": [
|
|
1272
|
+
"document",
|
|
1273
|
+
"document_template",
|
|
1274
|
+
"text",
|
|
1275
|
+
"image",
|
|
1276
|
+
"video",
|
|
1277
|
+
"audio",
|
|
1278
|
+
"spreadsheet",
|
|
1279
|
+
"presentation",
|
|
1280
|
+
"font",
|
|
1281
|
+
"archive",
|
|
1282
|
+
"application",
|
|
1283
|
+
"unknown"
|
|
1284
|
+
]
|
|
1285
|
+
},
|
|
1286
|
+
"_tags": {
|
|
1287
|
+
"type": "array",
|
|
1288
|
+
"items": {
|
|
1289
|
+
"type": "string"
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
"access_control": {
|
|
1293
|
+
"type": "string",
|
|
1294
|
+
"default": "private",
|
|
1295
|
+
"enum": [
|
|
1296
|
+
"private",
|
|
1297
|
+
"public-read"
|
|
1298
|
+
]
|
|
1299
|
+
},
|
|
1300
|
+
"custom_download_url": {
|
|
1301
|
+
"description": "Custom external download url used for the file",
|
|
1302
|
+
"type": "string",
|
|
1303
|
+
"format": "uri"
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
"additionalProperties": true,
|
|
1307
|
+
"required": [
|
|
1308
|
+
"s3ref",
|
|
1309
|
+
"filename"
|
|
1310
|
+
]
|
|
1311
|
+
},
|
|
1071
1312
|
"DeleteFilePayload": {
|
|
1072
1313
|
"type": "object",
|
|
1073
1314
|
"properties": {
|
|
@@ -1180,4 +1421,4 @@
|
|
|
1180
1421
|
"url": "https://file.sls.epilot.io"
|
|
1181
1422
|
}
|
|
1182
1423
|
]
|
|
1183
|
-
}
|
|
1424
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/file-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Client library for the epilot File API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"webpack": "^5.18.0",
|
|
71
71
|
"webpack-cli": "^4.4.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
-
}
|
|
73
|
+
"gitHead": "25f84cc5cd8614b24fd23343697d70946768682f"
|
|
74
|
+
}
|