@epilot/file-client 1.7.0 → 1.7.2
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 +32 -1
- package/dist/openapi.d.ts +169 -3
- package/dist/openapi.json +236 -9
- 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
|
|
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)})());
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
"/v1/files
|
|
64
|
+
"/v1/files:downloadFiles": {
|
|
65
65
|
"post": {
|
|
66
66
|
"operationId": "downloadFiles",
|
|
67
67
|
"requestBody": {
|
|
@@ -145,6 +145,29 @@
|
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
"/v1/files:previewS3": {
|
|
148
|
+
"get": {
|
|
149
|
+
"operationId": "previewS3FileGet",
|
|
150
|
+
"parameters": [
|
|
151
|
+
{
|
|
152
|
+
"name": "key",
|
|
153
|
+
"in": "query",
|
|
154
|
+
"required": true
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "bucket",
|
|
158
|
+
"in": "query",
|
|
159
|
+
"required": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "w",
|
|
163
|
+
"in": "query"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "h",
|
|
167
|
+
"in": "query"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
148
171
|
"post": {
|
|
149
172
|
"operationId": "previewS3File",
|
|
150
173
|
"parameters": [
|
|
@@ -173,6 +196,14 @@
|
|
|
173
196
|
}
|
|
174
197
|
}
|
|
175
198
|
}
|
|
199
|
+
},
|
|
200
|
+
"/v1/files/session": {
|
|
201
|
+
"get": {
|
|
202
|
+
"operationId": "getSession"
|
|
203
|
+
},
|
|
204
|
+
"delete": {
|
|
205
|
+
"operationId": "deleteSession"
|
|
206
|
+
}
|
|
176
207
|
}
|
|
177
208
|
},
|
|
178
209
|
"components": {},
|
package/dist/openapi.d.ts
CHANGED
|
@@ -9,6 +9,25 @@ 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
|
+
/**
|
|
27
|
+
* List of entities to relate the file to
|
|
28
|
+
*/
|
|
29
|
+
relations?: FileRelationItem[];
|
|
30
|
+
}
|
|
12
31
|
export interface DeleteFilePayload {
|
|
13
32
|
s3ref: S3Reference;
|
|
14
33
|
}
|
|
@@ -25,6 +44,17 @@ declare namespace Components {
|
|
|
25
44
|
*/
|
|
26
45
|
version?: number;
|
|
27
46
|
}[];
|
|
47
|
+
/**
|
|
48
|
+
* example:
|
|
49
|
+
* ef7d985c-2385-44f4-9c71-ae06a52264f8
|
|
50
|
+
*/
|
|
51
|
+
export type EntityId = string;
|
|
52
|
+
/**
|
|
53
|
+
* URL-friendly identifier for the entity schema
|
|
54
|
+
* example:
|
|
55
|
+
* contact
|
|
56
|
+
*/
|
|
57
|
+
export type EntitySlug = string;
|
|
28
58
|
export interface FileEntity {
|
|
29
59
|
_id?: /**
|
|
30
60
|
* example:
|
|
@@ -93,6 +123,20 @@ declare namespace Components {
|
|
|
93
123
|
*/
|
|
94
124
|
mime_type?: string;
|
|
95
125
|
}
|
|
126
|
+
export interface FileRelationItem {
|
|
127
|
+
entity_id: /**
|
|
128
|
+
* example:
|
|
129
|
+
* ef7d985c-2385-44f4-9c71-ae06a52264f8
|
|
130
|
+
*/
|
|
131
|
+
EntityId;
|
|
132
|
+
_schema?: /**
|
|
133
|
+
* URL-friendly identifier for the entity schema
|
|
134
|
+
* example:
|
|
135
|
+
* contact
|
|
136
|
+
*/
|
|
137
|
+
EntitySlug;
|
|
138
|
+
_tags?: string[];
|
|
139
|
+
}
|
|
96
140
|
export interface S3Reference {
|
|
97
141
|
/**
|
|
98
142
|
* example:
|
|
@@ -105,9 +149,8 @@ declare namespace Components {
|
|
|
105
149
|
*/
|
|
106
150
|
key: string;
|
|
107
151
|
}
|
|
108
|
-
export interface
|
|
152
|
+
export interface SaveCustomFilePayload {
|
|
109
153
|
[name: string]: any;
|
|
110
|
-
s3ref: S3Reference;
|
|
111
154
|
/**
|
|
112
155
|
* if passed, adds a new version to existing file entity
|
|
113
156
|
*/
|
|
@@ -120,6 +163,35 @@ declare namespace Components {
|
|
|
120
163
|
filename?: string;
|
|
121
164
|
_tags?: string[];
|
|
122
165
|
access_control?: "private" | "public-read";
|
|
166
|
+
/**
|
|
167
|
+
* List of entities to relate the file to
|
|
168
|
+
*/
|
|
169
|
+
relations?: FileRelationItem[];
|
|
170
|
+
/**
|
|
171
|
+
* Custom external download url used for the file
|
|
172
|
+
*/
|
|
173
|
+
custom_download_url: string; // url
|
|
174
|
+
}
|
|
175
|
+
export type SaveFilePayload = SaveS3FilePayload | SaveCustomFilePayload;
|
|
176
|
+
export interface SaveS3FilePayload {
|
|
177
|
+
[name: string]: any;
|
|
178
|
+
/**
|
|
179
|
+
* if passed, adds a new version to existing file entity
|
|
180
|
+
*/
|
|
181
|
+
file_entity_id?: string;
|
|
182
|
+
document_type?: "document" | "document_template" | "text" | "image" | "video" | "audio" | "spreadsheet" | "presentation" | "font" | "archive" | "application" | "unknown";
|
|
183
|
+
/**
|
|
184
|
+
* example:
|
|
185
|
+
* document.pdf
|
|
186
|
+
*/
|
|
187
|
+
filename?: string;
|
|
188
|
+
_tags?: string[];
|
|
189
|
+
access_control?: "private" | "public-read";
|
|
190
|
+
/**
|
|
191
|
+
* List of entities to relate the file to
|
|
192
|
+
*/
|
|
193
|
+
relations?: FileRelationItem[];
|
|
194
|
+
s3ref: S3Reference;
|
|
123
195
|
}
|
|
124
196
|
export interface UploadFilePayload {
|
|
125
197
|
/**
|
|
@@ -144,6 +216,12 @@ declare namespace Paths {
|
|
|
144
216
|
}
|
|
145
217
|
}
|
|
146
218
|
}
|
|
219
|
+
namespace DeleteSession {
|
|
220
|
+
namespace Responses {
|
|
221
|
+
export interface $200 {
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
147
225
|
namespace DownloadFile {
|
|
148
226
|
namespace Parameters {
|
|
149
227
|
export type Attachment = boolean;
|
|
@@ -205,6 +283,12 @@ declare namespace Paths {
|
|
|
205
283
|
}
|
|
206
284
|
}
|
|
207
285
|
}
|
|
286
|
+
namespace GetSession {
|
|
287
|
+
namespace Responses {
|
|
288
|
+
export interface $200 {
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
208
292
|
namespace PreviewFile {
|
|
209
293
|
namespace Parameters {
|
|
210
294
|
export type H = number;
|
|
@@ -258,6 +342,20 @@ declare namespace Paths {
|
|
|
258
342
|
}
|
|
259
343
|
export type RequestBody = Components.Schemas.S3Reference;
|
|
260
344
|
}
|
|
345
|
+
namespace PreviewS3FileGet {
|
|
346
|
+
namespace Parameters {
|
|
347
|
+
export type Bucket = string;
|
|
348
|
+
export type H = number;
|
|
349
|
+
export type Key = string;
|
|
350
|
+
export type W = number;
|
|
351
|
+
}
|
|
352
|
+
export interface QueryParameters {
|
|
353
|
+
key: Parameters.Key;
|
|
354
|
+
bucket: Parameters.Bucket;
|
|
355
|
+
w?: Parameters.W;
|
|
356
|
+
h?: Parameters.H;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
261
359
|
namespace SaveFile {
|
|
262
360
|
export type RequestBody = Components.Schemas.SaveFilePayload;
|
|
263
361
|
namespace Responses {
|
|
@@ -436,6 +534,16 @@ export interface OperationMethods {
|
|
|
436
534
|
data?: any,
|
|
437
535
|
config?: AxiosRequestConfig
|
|
438
536
|
): OperationResponse<any>
|
|
537
|
+
/**
|
|
538
|
+
* previewS3FileGet - previewS3FileGet
|
|
539
|
+
*
|
|
540
|
+
* Get thumbnail preview from an s3 reference for a file entity
|
|
541
|
+
*/
|
|
542
|
+
'previewS3FileGet'(
|
|
543
|
+
parameters?: Parameters<Paths.PreviewS3FileGet.QueryParameters> | null,
|
|
544
|
+
data?: any,
|
|
545
|
+
config?: AxiosRequestConfig
|
|
546
|
+
): OperationResponse<any>
|
|
439
547
|
/**
|
|
440
548
|
* previewS3File - previewS3File
|
|
441
549
|
*
|
|
@@ -456,6 +564,29 @@ export interface OperationMethods {
|
|
|
456
564
|
data?: Paths.DeleteFile.RequestBody,
|
|
457
565
|
config?: AxiosRequestConfig
|
|
458
566
|
): OperationResponse<Paths.DeleteFile.Responses.$200>
|
|
567
|
+
/**
|
|
568
|
+
* getSession - getSession
|
|
569
|
+
*
|
|
570
|
+
* Start a browser session by setting passed Authorization token in a server side cookie.
|
|
571
|
+
*
|
|
572
|
+
* Allows using preview urls directly in img src for private files using cookie authentication.
|
|
573
|
+
*
|
|
574
|
+
*/
|
|
575
|
+
'getSession'(
|
|
576
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
577
|
+
data?: any,
|
|
578
|
+
config?: AxiosRequestConfig
|
|
579
|
+
): OperationResponse<Paths.GetSession.Responses.$200>
|
|
580
|
+
/**
|
|
581
|
+
* deleteSession - deleteSession
|
|
582
|
+
*
|
|
583
|
+
* End browser session by deleting token cookie
|
|
584
|
+
*/
|
|
585
|
+
'deleteSession'(
|
|
586
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
587
|
+
data?: any,
|
|
588
|
+
config?: AxiosRequestConfig
|
|
589
|
+
): OperationResponse<Paths.DeleteSession.Responses.$200>
|
|
459
590
|
}
|
|
460
591
|
|
|
461
592
|
export interface PathsDictionary {
|
|
@@ -518,7 +649,7 @@ export interface PathsDictionary {
|
|
|
518
649
|
config?: AxiosRequestConfig
|
|
519
650
|
): OperationResponse<Paths.DownloadFile.Responses.$200>
|
|
520
651
|
}
|
|
521
|
-
['/v1/files
|
|
652
|
+
['/v1/files:downloadFiles']: {
|
|
522
653
|
/**
|
|
523
654
|
* downloadFiles - downloadFiles
|
|
524
655
|
*
|
|
@@ -567,6 +698,16 @@ export interface PathsDictionary {
|
|
|
567
698
|
): OperationResponse<any>
|
|
568
699
|
}
|
|
569
700
|
['/v1/files:previewS3']: {
|
|
701
|
+
/**
|
|
702
|
+
* previewS3FileGet - previewS3FileGet
|
|
703
|
+
*
|
|
704
|
+
* Get thumbnail preview from an s3 reference for a file entity
|
|
705
|
+
*/
|
|
706
|
+
'get'(
|
|
707
|
+
parameters?: Parameters<Paths.PreviewS3FileGet.QueryParameters> | null,
|
|
708
|
+
data?: any,
|
|
709
|
+
config?: AxiosRequestConfig
|
|
710
|
+
): OperationResponse<any>
|
|
570
711
|
/**
|
|
571
712
|
* previewS3File - previewS3File
|
|
572
713
|
*
|
|
@@ -590,6 +731,31 @@ export interface PathsDictionary {
|
|
|
590
731
|
config?: AxiosRequestConfig
|
|
591
732
|
): OperationResponse<Paths.DeleteFile.Responses.$200>
|
|
592
733
|
}
|
|
734
|
+
['/v1/files/session']: {
|
|
735
|
+
/**
|
|
736
|
+
* getSession - getSession
|
|
737
|
+
*
|
|
738
|
+
* Start a browser session by setting passed Authorization token in a server side cookie.
|
|
739
|
+
*
|
|
740
|
+
* Allows using preview urls directly in img src for private files using cookie authentication.
|
|
741
|
+
*
|
|
742
|
+
*/
|
|
743
|
+
'get'(
|
|
744
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
745
|
+
data?: any,
|
|
746
|
+
config?: AxiosRequestConfig
|
|
747
|
+
): OperationResponse<Paths.GetSession.Responses.$200>
|
|
748
|
+
/**
|
|
749
|
+
* deleteSession - deleteSession
|
|
750
|
+
*
|
|
751
|
+
* End browser session by deleting token cookie
|
|
752
|
+
*/
|
|
753
|
+
'delete'(
|
|
754
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
755
|
+
data?: any,
|
|
756
|
+
config?: AxiosRequestConfig
|
|
757
|
+
): OperationResponse<Paths.DeleteSession.Responses.$200>
|
|
758
|
+
}
|
|
593
759
|
}
|
|
594
760
|
|
|
595
761
|
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
|
package/dist/openapi.json
CHANGED
|
@@ -8,12 +8,19 @@
|
|
|
8
8
|
"tags": [
|
|
9
9
|
{
|
|
10
10
|
"name": "files",
|
|
11
|
-
"description": "Files"
|
|
11
|
+
"description": "Files API"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "session",
|
|
15
|
+
"description": "Session API for cookie authentication"
|
|
12
16
|
}
|
|
13
17
|
],
|
|
14
18
|
"security": [
|
|
15
19
|
{
|
|
16
20
|
"EpilotAuth": []
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"CookieAuth": []
|
|
17
24
|
}
|
|
18
25
|
],
|
|
19
26
|
"paths": {
|
|
@@ -150,6 +157,58 @@
|
|
|
150
157
|
"application/json": {
|
|
151
158
|
"schema": {
|
|
152
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
|
+
},
|
|
192
|
+
"CustomFileWithRelations": {
|
|
193
|
+
"description": "Custom file entity with custom download url",
|
|
194
|
+
"value": {
|
|
195
|
+
"file_entity_id": "string",
|
|
196
|
+
"document_type": "document",
|
|
197
|
+
"filename": "document.pdf",
|
|
198
|
+
"_tags": [
|
|
199
|
+
"string"
|
|
200
|
+
],
|
|
201
|
+
"access_control": "private",
|
|
202
|
+
"custom_download_url": "https://some-api-url.com/download?file_id=123",
|
|
203
|
+
"shared_with_end_customer": true,
|
|
204
|
+
"relations": [
|
|
205
|
+
{
|
|
206
|
+
"entity_id": "77a1e0cc-7b92-4d41-8cce-eefd317ec004",
|
|
207
|
+
"_schema": "contact"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
153
212
|
}
|
|
154
213
|
}
|
|
155
214
|
}
|
|
@@ -225,7 +284,7 @@
|
|
|
225
284
|
}
|
|
226
285
|
}
|
|
227
286
|
},
|
|
228
|
-
"/v1/files
|
|
287
|
+
"/v1/files:downloadFiles": {
|
|
229
288
|
"post": {
|
|
230
289
|
"operationId": "downloadFiles",
|
|
231
290
|
"summary": "downloadFiles",
|
|
@@ -444,6 +503,59 @@
|
|
|
444
503
|
}
|
|
445
504
|
},
|
|
446
505
|
"/v1/files:previewS3": {
|
|
506
|
+
"get": {
|
|
507
|
+
"operationId": "previewS3FileGet",
|
|
508
|
+
"summary": "previewS3FileGet",
|
|
509
|
+
"description": "Get thumbnail preview from an s3 reference for a file entity",
|
|
510
|
+
"tags": [
|
|
511
|
+
"files"
|
|
512
|
+
],
|
|
513
|
+
"parameters": [
|
|
514
|
+
{
|
|
515
|
+
"name": "key",
|
|
516
|
+
"in": "query",
|
|
517
|
+
"description": "s3 key",
|
|
518
|
+
"required": true,
|
|
519
|
+
"schema": {
|
|
520
|
+
"type": "string"
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"name": "bucket",
|
|
525
|
+
"in": "query",
|
|
526
|
+
"description": "s3 bucket",
|
|
527
|
+
"required": true,
|
|
528
|
+
"schema": {
|
|
529
|
+
"type": "string"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"name": "w",
|
|
534
|
+
"in": "query",
|
|
535
|
+
"description": "width",
|
|
536
|
+
"schema": {
|
|
537
|
+
"type": "integer"
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "h",
|
|
542
|
+
"in": "query",
|
|
543
|
+
"description": "height",
|
|
544
|
+
"schema": {
|
|
545
|
+
"type": "integer"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
"responses": {
|
|
550
|
+
"200": {
|
|
551
|
+
"description": "Generated thumbnail image",
|
|
552
|
+
"content": {
|
|
553
|
+
"image/png": {},
|
|
554
|
+
"image/jpeg": {}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
},
|
|
447
559
|
"post": {
|
|
448
560
|
"operationId": "previewS3File",
|
|
449
561
|
"summary": "previewS3File",
|
|
@@ -512,6 +624,34 @@
|
|
|
512
624
|
}
|
|
513
625
|
}
|
|
514
626
|
}
|
|
627
|
+
},
|
|
628
|
+
"/v1/files/session": {
|
|
629
|
+
"get": {
|
|
630
|
+
"operationId": "getSession",
|
|
631
|
+
"summary": "getSession",
|
|
632
|
+
"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",
|
|
633
|
+
"tags": [
|
|
634
|
+
"session"
|
|
635
|
+
],
|
|
636
|
+
"responses": {
|
|
637
|
+
"200": {
|
|
638
|
+
"description": "Session started successfully"
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
"delete": {
|
|
643
|
+
"operationId": "deleteSession",
|
|
644
|
+
"summary": "deleteSession",
|
|
645
|
+
"description": "End browser session by deleting token cookie",
|
|
646
|
+
"tags": [
|
|
647
|
+
"session"
|
|
648
|
+
],
|
|
649
|
+
"responses": {
|
|
650
|
+
"200": {
|
|
651
|
+
"description": "Session deleted successfully"
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
515
655
|
}
|
|
516
656
|
},
|
|
517
657
|
"components": {
|
|
@@ -521,9 +661,24 @@
|
|
|
521
661
|
"scheme": "bearer",
|
|
522
662
|
"description": "Authorization header with epilot OAuth2 bearer token",
|
|
523
663
|
"bearerFormat": "JWT"
|
|
664
|
+
},
|
|
665
|
+
"CookieAuth": {
|
|
666
|
+
"type": "apiKey",
|
|
667
|
+
"in": "cookie",
|
|
668
|
+
"name": "token",
|
|
669
|
+
"description": "Cookie with epilot OAuth2 token"
|
|
524
670
|
}
|
|
525
671
|
},
|
|
526
672
|
"schemas": {
|
|
673
|
+
"EntityId": {
|
|
674
|
+
"type": "string",
|
|
675
|
+
"example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
|
|
676
|
+
},
|
|
677
|
+
"EntitySlug": {
|
|
678
|
+
"description": "URL-friendly identifier for the entity schema",
|
|
679
|
+
"type": "string",
|
|
680
|
+
"example": "contact"
|
|
681
|
+
},
|
|
527
682
|
"FileEntityId": {
|
|
528
683
|
"type": "string",
|
|
529
684
|
"example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
|
|
@@ -630,12 +785,9 @@
|
|
|
630
785
|
]
|
|
631
786
|
}
|
|
632
787
|
},
|
|
633
|
-
"
|
|
788
|
+
"CommonSaveFilePayload": {
|
|
634
789
|
"type": "object",
|
|
635
790
|
"properties": {
|
|
636
|
-
"s3ref": {
|
|
637
|
-
"$ref": "#/components/schemas/S3Reference"
|
|
638
|
-
},
|
|
639
791
|
"file_entity_id": {
|
|
640
792
|
"type": "string",
|
|
641
793
|
"description": "if passed, adds a new version to existing file entity"
|
|
@@ -674,11 +826,63 @@
|
|
|
674
826
|
"private",
|
|
675
827
|
"public-read"
|
|
676
828
|
]
|
|
829
|
+
},
|
|
830
|
+
"relations": {
|
|
831
|
+
"type": "array",
|
|
832
|
+
"description": "List of entities to relate the file to",
|
|
833
|
+
"items": {
|
|
834
|
+
"$ref": "#/components/schemas/FileRelationItem"
|
|
835
|
+
}
|
|
677
836
|
}
|
|
678
837
|
},
|
|
679
|
-
"additionalProperties": true
|
|
680
|
-
|
|
681
|
-
|
|
838
|
+
"additionalProperties": true
|
|
839
|
+
},
|
|
840
|
+
"SaveS3FilePayload": {
|
|
841
|
+
"allOf": [
|
|
842
|
+
{
|
|
843
|
+
"$ref": "#/components/schemas/CommonSaveFilePayload"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"type": "object",
|
|
847
|
+
"properties": {
|
|
848
|
+
"s3ref": {
|
|
849
|
+
"$ref": "#/components/schemas/S3Reference"
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
"required": [
|
|
853
|
+
"s3ref"
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
]
|
|
857
|
+
},
|
|
858
|
+
"SaveCustomFilePayload": {
|
|
859
|
+
"allOf": [
|
|
860
|
+
{
|
|
861
|
+
"$ref": "#/components/schemas/CommonSaveFilePayload"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"type": "object",
|
|
865
|
+
"properties": {
|
|
866
|
+
"custom_download_url": {
|
|
867
|
+
"description": "Custom external download url used for the file",
|
|
868
|
+
"type": "string",
|
|
869
|
+
"format": "url"
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
"required": [
|
|
873
|
+
"custom_download_url"
|
|
874
|
+
]
|
|
875
|
+
}
|
|
876
|
+
]
|
|
877
|
+
},
|
|
878
|
+
"SaveFilePayload": {
|
|
879
|
+
"anyOf": [
|
|
880
|
+
{
|
|
881
|
+
"$ref": "#/components/schemas/SaveS3FilePayload"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"$ref": "#/components/schemas/SaveCustomFilePayload"
|
|
885
|
+
}
|
|
682
886
|
]
|
|
683
887
|
},
|
|
684
888
|
"DeleteFilePayload": {
|
|
@@ -732,10 +936,33 @@
|
|
|
732
936
|
}
|
|
733
937
|
}
|
|
734
938
|
]
|
|
939
|
+
},
|
|
940
|
+
"FileRelationItem": {
|
|
941
|
+
"type": "object",
|
|
942
|
+
"properties": {
|
|
943
|
+
"entity_id": {
|
|
944
|
+
"$ref": "#/components/schemas/EntityId"
|
|
945
|
+
},
|
|
946
|
+
"_schema": {
|
|
947
|
+
"$ref": "#/components/schemas/EntitySlug"
|
|
948
|
+
},
|
|
949
|
+
"_tags": {
|
|
950
|
+
"type": "array",
|
|
951
|
+
"items": {
|
|
952
|
+
"type": "string"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
"required": [
|
|
957
|
+
"entity_id"
|
|
958
|
+
]
|
|
735
959
|
}
|
|
736
960
|
}
|
|
737
961
|
},
|
|
738
962
|
"servers": [
|
|
963
|
+
{
|
|
964
|
+
"url": "https://file.sls.epilot.io"
|
|
965
|
+
},
|
|
739
966
|
{
|
|
740
967
|
"url": "https://file.sls.epilot.io"
|
|
741
968
|
}
|