@epilot/file-client 0.1.2 → 0.1.3
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.d.ts +15 -20
- package/package.json +1 -1
- package/src/openapi.d.ts +15 -20
package/dist/definition.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){for(var i in t)e[i]=t[i];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var
|
|
1
|
+
!function(e,t){for(var i in t)e[i]=t[i];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{"use strict";var e={914:function(e,t,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=a(i(279));t.default=o.default},279:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"File API","version":"0.1.0","description":"File Upload and Management for epilot SaaS"},"tags":[{"name":"files","description":"Files"}],"security":[{"EpilotAuth":[]},{"AsOrganization":[]}],"paths":{"/v1/files/public/upload":{"post":{"operationId":"uploadFilePublic","summary":"uploadFilePublic","security":[],"description":"Create pre-signed S3 URL to upload a file to keep temporarily (one week).\\n\\nUse the createFile operation to store file file permanently.\\n","tags":["files"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFilePayload"}}}},"responses":{"201":{"description":"Pre-signed URL for POST / PUT upload","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"url","example":"https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"},"s3ref":{"allOf":[{"$ref":"#/components/schemas/S3Reference"},{"example":{"bucket":"epilot-files-prod","key":"123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"}}]}}}}}}}}},"/v1/files/upload":{"post":{"operationId":"uploadFile","summary":"uploadFile","description":"Create pre-signed S3 URL to upload a file to keep temporarily (one week).\\n\\nUse the createFile operation to store file file permanently.\\n","tags":["files"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFilePayload","type":"object"}}}},"responses":{"201":{"description":"Pre-signed URL for POST / PUT upload","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"url","example":"https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"},"s3ref":{"allOf":[{"$ref":"#/components/schemas/S3Reference"},{"example":{"bucket":"epilot-files-prod","key":"123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"}}]}}}}}}}}},"/v1/files":{"post":{"operationId":"createFile","summary":"createFile","description":"Create a permanent File entity","tags":["files"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileEntityPayload"}}}},"responses":{"201":{"description":"Created File Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileEntity"}}}}}}},"/v1/files/{id}/download":{"get":{"operationId":"downloadFile","summary":"downloadFile","description":"Generate pre-signed download S3 url for a file","tags":["files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FileEntityId"}},{"name":"version","in":"query","description":"index of file version","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Generated thumbnail image","content":{"application/json":{"schema":{"type":"object","properties":{"download_url":{"type":"string","format":"uri","example":"https://epilot-files-prod.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"}}}}}}}}},"/v1/files/{id}/preview":{"get":{"operationId":"previewFile","summary":"previewFile","description":"Generate thumbnail preview for a file entity","tags":["files"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/FileEntityId"}},{"name":"version","in":"query","description":"index of file version","schema":{"type":"integer","default":0}},{"name":"w","in":"query","description":"width","schema":{"type":"integer"}},{"name":"h","in":"query","description":"height","schema":{"type":"integer"}}],"responses":{"200":{"description":"Generated thumbnail image","content":{"image/png":{},"image/jpeg":{}}}}}}},"components":{"securitySchemes":{"EpilotAuth":{"type":"http","scheme":"bearer","description":"Epilot Bearer Token"},"AsOrganization":{"type":"apiKey","in":"header","name":"x-ivy-org-id","description":"Set organization id when using internal auth"}},"schemas":{"FileEntityId":{"type":"string","example":"ef7d985c-2385-44f4-9c71-ae06a52264f8"},"FileEntity":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/FileEntityId"},"filename":{"type":"string","example":"document.pdf"},"access_control":{"type":"string","default":"private","enum":["private","public"]},"versions":{"type":"array","items":{"type":"object","properties":{"s3ref":{"$ref":"#/components/schemas/S3Reference"}}}}}},"UploadFilePayload":{"type":"object","properties":{"filename":{"type":"string","example":"document.pdf"},"content_type":{"description":"MIME type of file","type":"string","example":"image/png","default":"application/octet-stream"}},"required":["filename"]},"FileEntityPayload":{"type":"object","properties":{"filename":{"type":"string","example":"document.pdf"},"access_control":{"type":"string","default":"private","enum":["private","public"]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/FileItem"}}}},"S3Reference":{"type":"object","properties":{"bucket":{"type":"string","example":"epilot-files-prod"},"key":{"type":"string","example":"123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"}},"required":["bucket","key"]},"FileItem":{"allOf":[{"$ref":"#/components/schemas/S3Reference"},{"type":"object","properties":{"filename":{"type":"string","example":"document.pdf"},"size_bytes":{"type":"integer","example":1234}}}]}}}}')}},t={};return function i(a){if(t[a])return t[a].exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,i),o.exports}(914)})());
|
package/dist/openapi.d.ts
CHANGED
|
@@ -69,6 +69,19 @@ declare namespace Components {
|
|
|
69
69
|
*/
|
|
70
70
|
key: string;
|
|
71
71
|
}
|
|
72
|
+
export interface UploadFilePayload {
|
|
73
|
+
/**
|
|
74
|
+
* example:
|
|
75
|
+
* document.pdf
|
|
76
|
+
*/
|
|
77
|
+
filename: string;
|
|
78
|
+
/**
|
|
79
|
+
* MIME type of file
|
|
80
|
+
* example:
|
|
81
|
+
* image/png
|
|
82
|
+
*/
|
|
83
|
+
content_type?: string;
|
|
84
|
+
}
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
declare namespace Paths {
|
|
@@ -116,13 +129,7 @@ declare namespace Paths {
|
|
|
116
129
|
}
|
|
117
130
|
}
|
|
118
131
|
namespace UploadFile {
|
|
119
|
-
export
|
|
120
|
-
/**
|
|
121
|
-
* example:
|
|
122
|
-
* document.pdf
|
|
123
|
-
*/
|
|
124
|
-
filename: string;
|
|
125
|
-
}
|
|
132
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
126
133
|
namespace Responses {
|
|
127
134
|
export interface $201 {
|
|
128
135
|
/**
|
|
@@ -153,19 +160,7 @@ declare namespace Paths {
|
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
namespace UploadFilePublic {
|
|
156
|
-
export
|
|
157
|
-
/**
|
|
158
|
-
* example:
|
|
159
|
-
* document.pdf
|
|
160
|
-
*/
|
|
161
|
-
filename: string;
|
|
162
|
-
/**
|
|
163
|
-
* MIME type of file
|
|
164
|
-
* example:
|
|
165
|
-
* image/png
|
|
166
|
-
*/
|
|
167
|
-
content_type?: string;
|
|
168
|
-
}
|
|
163
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
169
164
|
namespace Responses {
|
|
170
165
|
export interface $201 {
|
|
171
166
|
/**
|
package/package.json
CHANGED
package/src/openapi.d.ts
CHANGED
|
@@ -69,6 +69,19 @@ declare namespace Components {
|
|
|
69
69
|
*/
|
|
70
70
|
key: string;
|
|
71
71
|
}
|
|
72
|
+
export interface UploadFilePayload {
|
|
73
|
+
/**
|
|
74
|
+
* example:
|
|
75
|
+
* document.pdf
|
|
76
|
+
*/
|
|
77
|
+
filename: string;
|
|
78
|
+
/**
|
|
79
|
+
* MIME type of file
|
|
80
|
+
* example:
|
|
81
|
+
* image/png
|
|
82
|
+
*/
|
|
83
|
+
content_type?: string;
|
|
84
|
+
}
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
declare namespace Paths {
|
|
@@ -116,13 +129,7 @@ declare namespace Paths {
|
|
|
116
129
|
}
|
|
117
130
|
}
|
|
118
131
|
namespace UploadFile {
|
|
119
|
-
export
|
|
120
|
-
/**
|
|
121
|
-
* example:
|
|
122
|
-
* document.pdf
|
|
123
|
-
*/
|
|
124
|
-
filename: string;
|
|
125
|
-
}
|
|
132
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
126
133
|
namespace Responses {
|
|
127
134
|
export interface $201 {
|
|
128
135
|
/**
|
|
@@ -153,19 +160,7 @@ declare namespace Paths {
|
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
namespace UploadFilePublic {
|
|
156
|
-
export
|
|
157
|
-
/**
|
|
158
|
-
* example:
|
|
159
|
-
* document.pdf
|
|
160
|
-
*/
|
|
161
|
-
filename: string;
|
|
162
|
-
/**
|
|
163
|
-
* MIME type of file
|
|
164
|
-
* example:
|
|
165
|
-
* image/png
|
|
166
|
-
*/
|
|
167
|
-
content_type?: string;
|
|
168
|
-
}
|
|
163
|
+
export type RequestBody = Components.Schemas.UploadFilePayload;
|
|
169
164
|
namespace Responses {
|
|
170
165
|
export interface $201 {
|
|
171
166
|
/**
|