@epilot/file-client 1.7.0 → 1.8.0-rc1

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/client.d.ts CHANGED
File without changes
package/dist/client.js CHANGED
File without changes
File without changes
@@ -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/download":{"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":{"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":{}}}}}},"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)})());
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":{"post":{"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/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
@@ -61,7 +61,7 @@
61
61
  ]
62
62
  }
63
63
  },
64
- "/v1/files/download": {
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
+ "post": {
202
+ "operationId": "getSession"
203
+ },
204
+ "delete": {
205
+ "operationId": "deleteSession"
206
+ }
176
207
  }
177
208
  },
178
209
  "components": {},
package/dist/openapi.d.ts CHANGED
@@ -144,6 +144,12 @@ declare namespace Paths {
144
144
  }
145
145
  }
146
146
  }
147
+ namespace DeleteSession {
148
+ namespace Responses {
149
+ export interface $200 {
150
+ }
151
+ }
152
+ }
147
153
  namespace DownloadFile {
148
154
  namespace Parameters {
149
155
  export type Attachment = boolean;
@@ -205,6 +211,12 @@ declare namespace Paths {
205
211
  }
206
212
  }
207
213
  }
214
+ namespace GetSession {
215
+ namespace Responses {
216
+ export interface $200 {
217
+ }
218
+ }
219
+ }
208
220
  namespace PreviewFile {
209
221
  namespace Parameters {
210
222
  export type H = number;
@@ -258,6 +270,20 @@ declare namespace Paths {
258
270
  }
259
271
  export type RequestBody = Components.Schemas.S3Reference;
260
272
  }
273
+ namespace PreviewS3FileGet {
274
+ namespace Parameters {
275
+ export type Bucket = string;
276
+ export type H = number;
277
+ export type Key = string;
278
+ export type W = number;
279
+ }
280
+ export interface QueryParameters {
281
+ key: Parameters.Key;
282
+ bucket: Parameters.Bucket;
283
+ w?: Parameters.W;
284
+ h?: Parameters.H;
285
+ }
286
+ }
261
287
  namespace SaveFile {
262
288
  export type RequestBody = Components.Schemas.SaveFilePayload;
263
289
  namespace Responses {
@@ -436,6 +462,16 @@ export interface OperationMethods {
436
462
  data?: any,
437
463
  config?: AxiosRequestConfig
438
464
  ): OperationResponse<any>
465
+ /**
466
+ * previewS3FileGet - previewS3FileGet
467
+ *
468
+ * Get thumbnail preview from an s3 reference for a file entity
469
+ */
470
+ 'previewS3FileGet'(
471
+ parameters?: Parameters<Paths.PreviewS3FileGet.QueryParameters> | null,
472
+ data?: any,
473
+ config?: AxiosRequestConfig
474
+ ): OperationResponse<any>
439
475
  /**
440
476
  * previewS3File - previewS3File
441
477
  *
@@ -456,6 +492,29 @@ export interface OperationMethods {
456
492
  data?: Paths.DeleteFile.RequestBody,
457
493
  config?: AxiosRequestConfig
458
494
  ): OperationResponse<Paths.DeleteFile.Responses.$200>
495
+ /**
496
+ * getSession - getSession
497
+ *
498
+ * Start a browser session by setting passed Authorization token in a server side cookie.
499
+ *
500
+ * Allows using preview urls directly in img src for private files using cookie authentication.
501
+ *
502
+ */
503
+ 'getSession'(
504
+ parameters?: Parameters<UnknownParamsObject> | null,
505
+ data?: any,
506
+ config?: AxiosRequestConfig
507
+ ): OperationResponse<Paths.GetSession.Responses.$200>
508
+ /**
509
+ * deleteSession - deleteSession
510
+ *
511
+ * End browser session by deleting token cookie
512
+ */
513
+ 'deleteSession'(
514
+ parameters?: Parameters<UnknownParamsObject> | null,
515
+ data?: any,
516
+ config?: AxiosRequestConfig
517
+ ): OperationResponse<Paths.DeleteSession.Responses.$200>
459
518
  }
460
519
 
461
520
  export interface PathsDictionary {
@@ -518,7 +577,7 @@ export interface PathsDictionary {
518
577
  config?: AxiosRequestConfig
519
578
  ): OperationResponse<Paths.DownloadFile.Responses.$200>
520
579
  }
521
- ['/v1/files/download']: {
580
+ ['/v1/files:downloadFiles']: {
522
581
  /**
523
582
  * downloadFiles - downloadFiles
524
583
  *
@@ -567,6 +626,16 @@ export interface PathsDictionary {
567
626
  ): OperationResponse<any>
568
627
  }
569
628
  ['/v1/files:previewS3']: {
629
+ /**
630
+ * previewS3FileGet - previewS3FileGet
631
+ *
632
+ * Get thumbnail preview from an s3 reference for a file entity
633
+ */
634
+ 'get'(
635
+ parameters?: Parameters<Paths.PreviewS3FileGet.QueryParameters> | null,
636
+ data?: any,
637
+ config?: AxiosRequestConfig
638
+ ): OperationResponse<any>
570
639
  /**
571
640
  * previewS3File - previewS3File
572
641
  *
@@ -590,6 +659,31 @@ export interface PathsDictionary {
590
659
  config?: AxiosRequestConfig
591
660
  ): OperationResponse<Paths.DeleteFile.Responses.$200>
592
661
  }
662
+ ['/v1/files/session']: {
663
+ /**
664
+ * getSession - getSession
665
+ *
666
+ * Start a browser session by setting passed Authorization token in a server side cookie.
667
+ *
668
+ * Allows using preview urls directly in img src for private files using cookie authentication.
669
+ *
670
+ */
671
+ 'post'(
672
+ parameters?: Parameters<UnknownParamsObject> | null,
673
+ data?: any,
674
+ config?: AxiosRequestConfig
675
+ ): OperationResponse<Paths.GetSession.Responses.$200>
676
+ /**
677
+ * deleteSession - deleteSession
678
+ *
679
+ * End browser session by deleting token cookie
680
+ */
681
+ 'delete'(
682
+ parameters?: Parameters<UnknownParamsObject> | null,
683
+ data?: any,
684
+ config?: AxiosRequestConfig
685
+ ): OperationResponse<Paths.DeleteSession.Responses.$200>
686
+ }
593
687
  }
594
688
 
595
689
  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": {
@@ -225,7 +232,7 @@
225
232
  }
226
233
  }
227
234
  },
228
- "/v1/files/download": {
235
+ "/v1/files:downloadFiles": {
229
236
  "post": {
230
237
  "operationId": "downloadFiles",
231
238
  "summary": "downloadFiles",
@@ -444,6 +451,59 @@
444
451
  }
445
452
  },
446
453
  "/v1/files:previewS3": {
454
+ "get": {
455
+ "operationId": "previewS3FileGet",
456
+ "summary": "previewS3FileGet",
457
+ "description": "Get thumbnail preview from an s3 reference for a file entity",
458
+ "tags": [
459
+ "files"
460
+ ],
461
+ "parameters": [
462
+ {
463
+ "name": "key",
464
+ "in": "query",
465
+ "description": "s3 key",
466
+ "required": true,
467
+ "schema": {
468
+ "type": "string"
469
+ }
470
+ },
471
+ {
472
+ "name": "bucket",
473
+ "in": "query",
474
+ "description": "s3 bucket",
475
+ "required": true,
476
+ "schema": {
477
+ "type": "string"
478
+ }
479
+ },
480
+ {
481
+ "name": "w",
482
+ "in": "query",
483
+ "description": "width",
484
+ "schema": {
485
+ "type": "integer"
486
+ }
487
+ },
488
+ {
489
+ "name": "h",
490
+ "in": "query",
491
+ "description": "height",
492
+ "schema": {
493
+ "type": "integer"
494
+ }
495
+ }
496
+ ],
497
+ "responses": {
498
+ "200": {
499
+ "description": "Generated thumbnail image",
500
+ "content": {
501
+ "image/png": {},
502
+ "image/jpeg": {}
503
+ }
504
+ }
505
+ }
506
+ },
447
507
  "post": {
448
508
  "operationId": "previewS3File",
449
509
  "summary": "previewS3File",
@@ -512,6 +572,34 @@
512
572
  }
513
573
  }
514
574
  }
575
+ },
576
+ "/v1/files/session": {
577
+ "post": {
578
+ "operationId": "getSession",
579
+ "summary": "getSession",
580
+ "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",
581
+ "tags": [
582
+ "session"
583
+ ],
584
+ "responses": {
585
+ "200": {
586
+ "description": "Session started successfully"
587
+ }
588
+ }
589
+ },
590
+ "delete": {
591
+ "operationId": "deleteSession",
592
+ "summary": "deleteSession",
593
+ "description": "End browser session by deleting token cookie",
594
+ "tags": [
595
+ "session"
596
+ ],
597
+ "responses": {
598
+ "200": {
599
+ "description": "Session deleted successfully"
600
+ }
601
+ }
602
+ }
515
603
  }
516
604
  },
517
605
  "components": {
@@ -521,6 +609,12 @@
521
609
  "scheme": "bearer",
522
610
  "description": "Authorization header with epilot OAuth2 bearer token",
523
611
  "bearerFormat": "JWT"
612
+ },
613
+ "CookieAuth": {
614
+ "type": "apiKey",
615
+ "in": "cookie",
616
+ "name": "token",
617
+ "description": "Cookie with epilot OAuth2 token"
524
618
  }
525
619
  },
526
620
  "schemas": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/file-client",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-rc1",
4
4
  "description": "Client library for the epilot File API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",