@epilot/file-client 1.8.0-rc1 → 1.8.0-rc2
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/definition.js +1 -1
- package/dist/openapi-runtime.json +1 -1
- package/dist/openapi.d.ts +38 -3
- package/dist/openapi.json +82 -8
- package/package.json +1 -1
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,i){for(var t in i)e[t]=i[t];i.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"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(946));i.default=r.default},946: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: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":{"
|
|
1
|
+
!function(e,i){for(var t in i)e[t]=i[t];i.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"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(946));i.default=r.default},946: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: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"}}},"components":{},"servers":[{"url":"https://file.sls.epilot.io"}]}')}},i={};return function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{}};return e[n].call(r.exports,r,r.exports,t),r.exports}(914)})());
|
package/dist/openapi.d.ts
CHANGED
|
@@ -9,6 +9,21 @@ import type {
|
|
|
9
9
|
|
|
10
10
|
declare namespace Components {
|
|
11
11
|
namespace Schemas {
|
|
12
|
+
export interface CommonSaveFilePayload {
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
/**
|
|
15
|
+
* if passed, adds a new version to existing file entity
|
|
16
|
+
*/
|
|
17
|
+
file_entity_id?: string;
|
|
18
|
+
document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
19
|
+
/**
|
|
20
|
+
* example:
|
|
21
|
+
* document.pdf
|
|
22
|
+
*/
|
|
23
|
+
filename?: string;
|
|
24
|
+
_tags?: string[];
|
|
25
|
+
access_control?: "private" | "public-read";
|
|
26
|
+
}
|
|
12
27
|
export interface DeleteFilePayload {
|
|
13
28
|
s3ref: S3Reference;
|
|
14
29
|
}
|
|
@@ -105,9 +120,8 @@ declare namespace Components {
|
|
|
105
120
|
*/
|
|
106
121
|
key: string;
|
|
107
122
|
}
|
|
108
|
-
export interface
|
|
123
|
+
export interface SaveCustomFilePayload {
|
|
109
124
|
[name: string]: any;
|
|
110
|
-
s3ref: S3Reference;
|
|
111
125
|
/**
|
|
112
126
|
* if passed, adds a new version to existing file entity
|
|
113
127
|
*/
|
|
@@ -120,6 +134,27 @@ declare namespace Components {
|
|
|
120
134
|
filename?: string;
|
|
121
135
|
_tags?: string[];
|
|
122
136
|
access_control?: "private" | "public-read";
|
|
137
|
+
/**
|
|
138
|
+
* Custom external download url used for the file
|
|
139
|
+
*/
|
|
140
|
+
custom_download_url: string; // url
|
|
141
|
+
}
|
|
142
|
+
export type SaveFilePayload = SaveS3FilePayload | SaveCustomFilePayload;
|
|
143
|
+
export interface SaveS3FilePayload {
|
|
144
|
+
[name: string]: any;
|
|
145
|
+
/**
|
|
146
|
+
* if passed, adds a new version to existing file entity
|
|
147
|
+
*/
|
|
148
|
+
file_entity_id?: string;
|
|
149
|
+
document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
150
|
+
/**
|
|
151
|
+
* example:
|
|
152
|
+
* document.pdf
|
|
153
|
+
*/
|
|
154
|
+
filename?: string;
|
|
155
|
+
_tags?: string[];
|
|
156
|
+
access_control?: "private" | "public-read";
|
|
157
|
+
s3ref: S3Reference;
|
|
123
158
|
}
|
|
124
159
|
export interface UploadFilePayload {
|
|
125
160
|
/**
|
|
@@ -668,7 +703,7 @@ export interface PathsDictionary {
|
|
|
668
703
|
* Allows using preview urls directly in img src for private files using cookie authentication.
|
|
669
704
|
*
|
|
670
705
|
*/
|
|
671
|
-
'
|
|
706
|
+
'get'(
|
|
672
707
|
parameters?: Parameters<UnknownParamsObject> | null,
|
|
673
708
|
data?: any,
|
|
674
709
|
config?: AxiosRequestConfig
|
package/dist/openapi.json
CHANGED
|
@@ -157,6 +157,38 @@
|
|
|
157
157
|
"application/json": {
|
|
158
158
|
"schema": {
|
|
159
159
|
"$ref": "#/components/schemas/SaveFilePayload"
|
|
160
|
+
},
|
|
161
|
+
"examples": {
|
|
162
|
+
"S3File": {
|
|
163
|
+
"description": "Standard epilot file entity with S3 Ref",
|
|
164
|
+
"value": {
|
|
165
|
+
"file_entity_id": "string",
|
|
166
|
+
"document_type": "document",
|
|
167
|
+
"filename": "document.pdf",
|
|
168
|
+
"_tags": [
|
|
169
|
+
"string"
|
|
170
|
+
],
|
|
171
|
+
"access_control": "private",
|
|
172
|
+
"s3ref": {
|
|
173
|
+
"bucket": "epilot-files-prod",
|
|
174
|
+
"key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"CustomFile": {
|
|
179
|
+
"description": "Custom file entity with custom download url",
|
|
180
|
+
"value": {
|
|
181
|
+
"file_entity_id": "string",
|
|
182
|
+
"document_type": "document",
|
|
183
|
+
"filename": "document.pdf",
|
|
184
|
+
"_tags": [
|
|
185
|
+
"string"
|
|
186
|
+
],
|
|
187
|
+
"access_control": "private",
|
|
188
|
+
"custom_download_url": "https://some-api-url.com/download?file_id=123",
|
|
189
|
+
"shared_with_end_customer": true
|
|
190
|
+
}
|
|
191
|
+
}
|
|
160
192
|
}
|
|
161
193
|
}
|
|
162
194
|
}
|
|
@@ -574,7 +606,7 @@
|
|
|
574
606
|
}
|
|
575
607
|
},
|
|
576
608
|
"/v1/files/session": {
|
|
577
|
-
"
|
|
609
|
+
"get": {
|
|
578
610
|
"operationId": "getSession",
|
|
579
611
|
"summary": "getSession",
|
|
580
612
|
"description": "Start a browser session by setting passed Authorization token in a server side cookie.\n\nAllows using preview urls directly in img src for private files using cookie authentication.\n",
|
|
@@ -724,12 +756,9 @@
|
|
|
724
756
|
]
|
|
725
757
|
}
|
|
726
758
|
},
|
|
727
|
-
"
|
|
759
|
+
"CommonSaveFilePayload": {
|
|
728
760
|
"type": "object",
|
|
729
761
|
"properties": {
|
|
730
|
-
"s3ref": {
|
|
731
|
-
"$ref": "#/components/schemas/S3Reference"
|
|
732
|
-
},
|
|
733
762
|
"file_entity_id": {
|
|
734
763
|
"type": "string",
|
|
735
764
|
"description": "if passed, adds a new version to existing file entity"
|
|
@@ -770,9 +799,54 @@
|
|
|
770
799
|
]
|
|
771
800
|
}
|
|
772
801
|
},
|
|
773
|
-
"additionalProperties": true
|
|
774
|
-
|
|
775
|
-
|
|
802
|
+
"additionalProperties": true
|
|
803
|
+
},
|
|
804
|
+
"SaveS3FilePayload": {
|
|
805
|
+
"allOf": [
|
|
806
|
+
{
|
|
807
|
+
"$ref": "#/components/schemas/CommonSaveFilePayload"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"type": "object",
|
|
811
|
+
"properties": {
|
|
812
|
+
"s3ref": {
|
|
813
|
+
"$ref": "#/components/schemas/S3Reference"
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
"required": [
|
|
817
|
+
"s3ref"
|
|
818
|
+
]
|
|
819
|
+
}
|
|
820
|
+
]
|
|
821
|
+
},
|
|
822
|
+
"SaveCustomFilePayload": {
|
|
823
|
+
"allOf": [
|
|
824
|
+
{
|
|
825
|
+
"$ref": "#/components/schemas/CommonSaveFilePayload"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"type": "object",
|
|
829
|
+
"properties": {
|
|
830
|
+
"custom_download_url": {
|
|
831
|
+
"description": "Custom external download url used for the file",
|
|
832
|
+
"type": "string",
|
|
833
|
+
"format": "url"
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
"required": [
|
|
837
|
+
"custom_download_url"
|
|
838
|
+
]
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
},
|
|
842
|
+
"SaveFilePayload": {
|
|
843
|
+
"anyOf": [
|
|
844
|
+
{
|
|
845
|
+
"$ref": "#/components/schemas/SaveS3FilePayload"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"$ref": "#/components/schemas/SaveCustomFilePayload"
|
|
849
|
+
}
|
|
776
850
|
]
|
|
777
851
|
},
|
|
778
852
|
"DeleteFilePayload": {
|