@epilot/file-client 1.10.0 → 1.12.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 +163 -0
- package/dist/openapi.json +248 -1
- 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,22 @@ declare namespace Components {
|
|
|
223
286
|
* application/pdf
|
|
224
287
|
*/
|
|
225
288
|
mime_type?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Used to index the file at the storage layer, which helps when browsing for this file
|
|
291
|
+
* example:
|
|
292
|
+
* 2f6a377c8e78
|
|
293
|
+
*/
|
|
294
|
+
index_tag?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Allows passing in custom metadata for the file, expects key-value pairs of string type
|
|
297
|
+
* example:
|
|
298
|
+
* {
|
|
299
|
+
* "color": "blue"
|
|
300
|
+
* }
|
|
301
|
+
*/
|
|
302
|
+
metadata?: {
|
|
303
|
+
[name: string]: string;
|
|
304
|
+
};
|
|
226
305
|
}
|
|
227
306
|
export interface VerifyCustomDownloadUrlPayload {
|
|
228
307
|
/**
|
|
@@ -489,6 +568,12 @@ declare namespace Paths {
|
|
|
489
568
|
export type $201 = Components.Schemas.FileEntity;
|
|
490
569
|
}
|
|
491
570
|
}
|
|
571
|
+
namespace SaveFileV2 {
|
|
572
|
+
export type RequestBody = Components.Schemas.SaveFilePayloadV2;
|
|
573
|
+
namespace Responses {
|
|
574
|
+
export type $201 = Components.Schemas.FileEntity;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
492
577
|
namespace UploadFile {
|
|
493
578
|
namespace Parameters {
|
|
494
579
|
export type FileEntityId = /**
|
|
@@ -567,6 +652,22 @@ declare namespace Paths {
|
|
|
567
652
|
}
|
|
568
653
|
}
|
|
569
654
|
}
|
|
655
|
+
namespace UploadFileV2 {
|
|
656
|
+
namespace Parameters {
|
|
657
|
+
export type FileEntityId = /**
|
|
658
|
+
* example:
|
|
659
|
+
* ef7d985c-2385-44f4-9c71-ae06a52264f8
|
|
660
|
+
*/
|
|
661
|
+
Components.Schemas.FileEntityId;
|
|
662
|
+
}
|
|
663
|
+
export interface QueryParameters {
|
|
664
|
+
file_entity_id?: Parameters.FileEntityId;
|
|
665
|
+
}
|
|
666
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
667
|
+
namespace Responses {
|
|
668
|
+
export type $201 = Components.Schemas.FileUpload;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
570
671
|
namespace VerifyCustomDownloadUrl {
|
|
571
672
|
export type RequestBody = Components.Schemas.VerifyCustomDownloadUrlPayload;
|
|
572
673
|
namespace Responses {
|
|
@@ -773,6 +874,34 @@ export interface OperationMethods {
|
|
|
773
874
|
data?: any,
|
|
774
875
|
config?: AxiosRequestConfig
|
|
775
876
|
): OperationResponse<Paths.RevokePublicLink.Responses.$204>
|
|
877
|
+
/**
|
|
878
|
+
* uploadFileV2 - uploadFileV2
|
|
879
|
+
*
|
|
880
|
+
* Create pre-signed S3 URL to upload a file to keep temporarily (one week). - v2
|
|
881
|
+
*
|
|
882
|
+
* Use the createFile operation to store file file permanently.
|
|
883
|
+
*
|
|
884
|
+
*/
|
|
885
|
+
'uploadFileV2'(
|
|
886
|
+
parameters?: Parameters<Paths.UploadFileV2.QueryParameters> | null,
|
|
887
|
+
data?: Paths.UploadFileV2.RequestBody,
|
|
888
|
+
config?: AxiosRequestConfig
|
|
889
|
+
): OperationResponse<Paths.UploadFileV2.Responses.$201>
|
|
890
|
+
/**
|
|
891
|
+
* saveFileV2 - saveFileV2
|
|
892
|
+
*
|
|
893
|
+
* Create / Update a permanent File entity
|
|
894
|
+
*
|
|
895
|
+
* Makes file object permanent
|
|
896
|
+
*
|
|
897
|
+
* Saves metadata to file entity
|
|
898
|
+
*
|
|
899
|
+
*/
|
|
900
|
+
'saveFileV2'(
|
|
901
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
902
|
+
data?: Paths.SaveFileV2.RequestBody,
|
|
903
|
+
config?: AxiosRequestConfig
|
|
904
|
+
): OperationResponse<Paths.SaveFileV2.Responses.$201>
|
|
776
905
|
}
|
|
777
906
|
|
|
778
907
|
export interface PathsDictionary {
|
|
@@ -988,6 +1117,8 @@ export interface PathsDictionary {
|
|
|
988
1117
|
data?: any,
|
|
989
1118
|
config?: AxiosRequestConfig
|
|
990
1119
|
): OperationResponse<any>
|
|
1120
|
+
}
|
|
1121
|
+
['/v1/files/public/links/{id}']: {
|
|
991
1122
|
/**
|
|
992
1123
|
* revokePublicLink - revokePublicLink
|
|
993
1124
|
*
|
|
@@ -999,6 +1130,38 @@ export interface PathsDictionary {
|
|
|
999
1130
|
config?: AxiosRequestConfig
|
|
1000
1131
|
): OperationResponse<Paths.RevokePublicLink.Responses.$204>
|
|
1001
1132
|
}
|
|
1133
|
+
['/v2/files/upload']: {
|
|
1134
|
+
/**
|
|
1135
|
+
* uploadFileV2 - uploadFileV2
|
|
1136
|
+
*
|
|
1137
|
+
* Create pre-signed S3 URL to upload a file to keep temporarily (one week). - v2
|
|
1138
|
+
*
|
|
1139
|
+
* Use the createFile operation to store file file permanently.
|
|
1140
|
+
*
|
|
1141
|
+
*/
|
|
1142
|
+
'post'(
|
|
1143
|
+
parameters?: Parameters<Paths.UploadFileV2.QueryParameters> | null,
|
|
1144
|
+
data?: Paths.UploadFileV2.RequestBody,
|
|
1145
|
+
config?: AxiosRequestConfig
|
|
1146
|
+
): OperationResponse<Paths.UploadFileV2.Responses.$201>
|
|
1147
|
+
}
|
|
1148
|
+
['/v2/files']: {
|
|
1149
|
+
/**
|
|
1150
|
+
* saveFileV2 - saveFileV2
|
|
1151
|
+
*
|
|
1152
|
+
* Create / Update a permanent File entity
|
|
1153
|
+
*
|
|
1154
|
+
* Makes file object permanent
|
|
1155
|
+
*
|
|
1156
|
+
* Saves metadata to file entity
|
|
1157
|
+
*
|
|
1158
|
+
*/
|
|
1159
|
+
'post'(
|
|
1160
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
1161
|
+
data?: Paths.SaveFileV2.RequestBody,
|
|
1162
|
+
config?: AxiosRequestConfig
|
|
1163
|
+
): OperationResponse<Paths.SaveFileV2.Responses.$201>
|
|
1164
|
+
}
|
|
1002
1165
|
}
|
|
1003
1166
|
|
|
1004
1167
|
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,61 @@
|
|
|
943
1070
|
"type": "string",
|
|
944
1071
|
"example": "application/pdf",
|
|
945
1072
|
"default": "application/octet-stream"
|
|
1073
|
+
},
|
|
1074
|
+
"index_tag": {
|
|
1075
|
+
"type": "string",
|
|
1076
|
+
"example": "2f6a377c8e78",
|
|
1077
|
+
"maxLength": 64,
|
|
1078
|
+
"description": "Used to index the file at the storage layer, which helps when browsing for this file"
|
|
1079
|
+
},
|
|
1080
|
+
"metadata": {
|
|
1081
|
+
"type": "object",
|
|
1082
|
+
"additionalProperties": {
|
|
1083
|
+
"anyOf": [
|
|
1084
|
+
{
|
|
1085
|
+
"type": "string"
|
|
1086
|
+
}
|
|
1087
|
+
]
|
|
1088
|
+
},
|
|
1089
|
+
"example": {
|
|
1090
|
+
"color": "blue"
|
|
1091
|
+
},
|
|
1092
|
+
"description": "Allows passing in custom metadata for the file, expects key-value pairs of string type"
|
|
946
1093
|
}
|
|
947
1094
|
},
|
|
948
1095
|
"required": [
|
|
949
1096
|
"filename"
|
|
950
1097
|
]
|
|
951
1098
|
},
|
|
1099
|
+
"FileUpload": {
|
|
1100
|
+
"type": "object",
|
|
1101
|
+
"properties": {
|
|
1102
|
+
"s3ref": {
|
|
1103
|
+
"allOf": [
|
|
1104
|
+
{
|
|
1105
|
+
"$ref": "#/components/schemas/S3Reference"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"example": {
|
|
1109
|
+
"bucket": "epilot-files-prod",
|
|
1110
|
+
"key": "123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
]
|
|
1114
|
+
},
|
|
1115
|
+
"upload_url": {
|
|
1116
|
+
"type": "string",
|
|
1117
|
+
"format": "url",
|
|
1118
|
+
"example": "https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"
|
|
1119
|
+
},
|
|
1120
|
+
"public_url": {
|
|
1121
|
+
"description": "Returned only if file is permanent i.e. file_entity_id is passed",
|
|
1122
|
+
"type": "string",
|
|
1123
|
+
"format": "url",
|
|
1124
|
+
"example": "https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
952
1128
|
"DownloadFilesPayload": {
|
|
953
1129
|
"type": "array",
|
|
954
1130
|
"items": {
|
|
@@ -1068,6 +1244,77 @@
|
|
|
1068
1244
|
}
|
|
1069
1245
|
]
|
|
1070
1246
|
},
|
|
1247
|
+
"SaveFilePayloadV2": {
|
|
1248
|
+
"type": "object",
|
|
1249
|
+
"properties": {
|
|
1250
|
+
"s3ref": {
|
|
1251
|
+
"type": "object",
|
|
1252
|
+
"properties": {
|
|
1253
|
+
"bucket": {
|
|
1254
|
+
"type": "string",
|
|
1255
|
+
"example": "epilot-files-prod"
|
|
1256
|
+
},
|
|
1257
|
+
"key": {
|
|
1258
|
+
"type": "string",
|
|
1259
|
+
"example": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
"required": [
|
|
1263
|
+
"bucket",
|
|
1264
|
+
"key"
|
|
1265
|
+
]
|
|
1266
|
+
},
|
|
1267
|
+
"filename": {
|
|
1268
|
+
"type": "string",
|
|
1269
|
+
"example": "document.pdf"
|
|
1270
|
+
},
|
|
1271
|
+
"file_entity_id": {
|
|
1272
|
+
"type": "string",
|
|
1273
|
+
"description": "if passed, adds a new version to existing file entity"
|
|
1274
|
+
},
|
|
1275
|
+
"document_type": {
|
|
1276
|
+
"type": "string",
|
|
1277
|
+
"enum": [
|
|
1278
|
+
"document",
|
|
1279
|
+
"document_template",
|
|
1280
|
+
"text",
|
|
1281
|
+
"image",
|
|
1282
|
+
"video",
|
|
1283
|
+
"audio",
|
|
1284
|
+
"spreadsheet",
|
|
1285
|
+
"presentation",
|
|
1286
|
+
"font",
|
|
1287
|
+
"archive",
|
|
1288
|
+
"application",
|
|
1289
|
+
"unknown"
|
|
1290
|
+
]
|
|
1291
|
+
},
|
|
1292
|
+
"_tags": {
|
|
1293
|
+
"type": "array",
|
|
1294
|
+
"items": {
|
|
1295
|
+
"type": "string"
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
"access_control": {
|
|
1299
|
+
"type": "string",
|
|
1300
|
+
"default": "private",
|
|
1301
|
+
"enum": [
|
|
1302
|
+
"private",
|
|
1303
|
+
"public-read"
|
|
1304
|
+
]
|
|
1305
|
+
},
|
|
1306
|
+
"custom_download_url": {
|
|
1307
|
+
"description": "Custom external download url used for the file",
|
|
1308
|
+
"type": "string",
|
|
1309
|
+
"format": "uri"
|
|
1310
|
+
}
|
|
1311
|
+
},
|
|
1312
|
+
"additionalProperties": true,
|
|
1313
|
+
"required": [
|
|
1314
|
+
"s3ref",
|
|
1315
|
+
"filename"
|
|
1316
|
+
]
|
|
1317
|
+
},
|
|
1071
1318
|
"DeleteFilePayload": {
|
|
1072
1319
|
"type": "object",
|
|
1073
1320
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/file-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.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": "59c5ea8db9845622bc32845f17321467d73908d9"
|
|
74
|
+
}
|