@epilot/file-client 1.22.0 → 1.23.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/dist/openapi.d.ts CHANGED
@@ -183,6 +183,38 @@ declare namespace Components {
183
183
  */
184
184
  user_id?: string;
185
185
  }
186
+ /**
187
+ * Payload for batch version save. Only s3ref payloads are supported.
188
+ */
189
+ export interface BatchSaveFileVersionPayload {
190
+ /**
191
+ * Target file entity to add version to
192
+ * example:
193
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
194
+ */
195
+ _id?: /**
196
+ * Target file entity to add version to
197
+ * example:
198
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
199
+ */
200
+ string | string /* uuid */;
201
+ /**
202
+ * Deprecated, use _id instead
203
+ */
204
+ file_entity_id?: string;
205
+ /**
206
+ * example:
207
+ * document.pdf
208
+ */
209
+ filename?: string;
210
+ /**
211
+ * example:
212
+ * application/pdf
213
+ */
214
+ mime_type?: string;
215
+ access_control?: "private" | "public-read";
216
+ s3ref: S3Ref;
217
+ }
186
218
  export interface CommonSaveFilePayload {
187
219
  [name: string]: any;
188
220
  /**
@@ -1779,7 +1811,28 @@ declare namespace Paths {
1779
1811
  delete_temp_file?: Parameters.DeleteTempFile;
1780
1812
  version_only?: Parameters.VersionOnly;
1781
1813
  }
1782
- export type RequestBody = Components.Schemas.SaveFilePayloadV2;
1814
+ export type RequestBody = Components.Schemas.SaveFilePayloadV2 | [
1815
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload,
1816
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1817
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1818
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1819
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1820
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1821
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1822
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1823
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1824
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1825
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1826
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1827
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1828
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1829
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1830
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1831
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1832
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1833
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?,
1834
+ /* Payload for batch version save. Only s3ref payloads are supported. */ Components.Schemas.BatchSaveFileVersionPayload?
1835
+ ];
1783
1836
  namespace Responses {
1784
1837
  export type $200 = Components.Schemas.FileEntity;
1785
1838
  export type $400 = /**
@@ -2910,6 +2963,7 @@ export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
2910
2963
  export type ActivityId = Components.Schemas.ActivityId;
2911
2964
  export type BaseEntityAcl = Components.Schemas.BaseEntityAcl;
2912
2965
  export type BaseEntityOwner = Components.Schemas.BaseEntityOwner;
2966
+ export type BatchSaveFileVersionPayload = Components.Schemas.BatchSaveFileVersionPayload;
2913
2967
  export type CommonSaveFilePayload = Components.Schemas.CommonSaveFilePayload;
2914
2968
  export type CustomDownloadUrl = Components.Schemas.CustomDownloadUrl;
2915
2969
  export type DownloadFilesPayload = Components.Schemas.DownloadFilesPayload;
package/dist/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "File API",
5
- "version": "1.9.0",
5
+ "version": "1.10.0",
6
6
  "description": "The File API enables you to upload, store, manage, and share files within the epilot platform.\n\n## Key Features\n- **Upload files** to temporary storage and save them permanently as File entities\n- **Generate previews** (thumbnails) for images and documents\n- **Create public links** to share private files externally\n- **Organize files** into collections for better management\n- **Version control** with automatic file versioning on updates\n\n## File Upload Workflow\n1. Call `uploadFileV2` to get a pre-signed S3 URL\n2. Upload your file directly to S3 using the pre-signed URL (PUT request)\n3. Call `saveFileV2` with the S3 reference to create a permanent File entity\n\n## Changelog\n<a href=\"changelog\">View API Changelog</a>\n"
7
7
  },
8
8
  "tags": [
@@ -162,7 +162,20 @@
162
162
  "content": {
163
163
  "application/json": {
164
164
  "schema": {
165
- "$ref": "#/components/schemas/SaveFilePayloadV2"
165
+ "oneOf": [
166
+ {
167
+ "$ref": "#/components/schemas/SaveFilePayloadV2"
168
+ },
169
+ {
170
+ "type": "array",
171
+ "description": "Batch version mode: array of s3ref payloads to add multiple versions to a single file entity.\nAll payloads must target the same file entity (_id or file_entity_id).\nRequires version_only=true query parameter.\nS3 operations run in parallel, with a single entity update at the end.\n",
172
+ "items": {
173
+ "$ref": "#/components/schemas/BatchSaveFileVersionPayload"
174
+ },
175
+ "minItems": 1,
176
+ "maxItems": 20
177
+ }
178
+ ]
166
179
  },
167
180
  "examples": {
168
181
  "New file from s3ref": {
@@ -220,6 +233,29 @@
220
233
  "custom_download_url": "https://some-api-url.com/download?file_id=123",
221
234
  "shared_with_end_customer": true
222
235
  }
236
+ },
237
+ "Batch save multiple versions": {
238
+ "description": "Save multiple file versions in a single request (parallel S3 processing)",
239
+ "value": [
240
+ {
241
+ "_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
242
+ "filename": "photo1.jpg",
243
+ "access_control": "private",
244
+ "s3ref": {
245
+ "bucket": "epilot-prod-user-content",
246
+ "key": "123/temp/abc/photo1.jpg"
247
+ }
248
+ },
249
+ {
250
+ "_id": "ef7d985c-2385-44f4-9c71-ae06a52264f8",
251
+ "filename": "photo2.jpg",
252
+ "access_control": "private",
253
+ "s3ref": {
254
+ "bucket": "epilot-prod-user-content",
255
+ "key": "123/temp/def/photo2.jpg"
256
+ }
257
+ }
258
+ ]
223
259
  }
224
260
  }
225
261
  }
@@ -227,7 +263,7 @@
227
263
  },
228
264
  "responses": {
229
265
  "200": {
230
- "description": "Created File Entity",
266
+ "description": "Created or updated File Entity",
231
267
  "content": {
232
268
  "application/json": {
233
269
  "schema": {
@@ -2212,6 +2248,50 @@
2212
2248
  }
2213
2249
  ]
2214
2250
  },
2251
+ "BatchSaveFileVersionPayload": {
2252
+ "type": "object",
2253
+ "description": "Payload for batch version save. Only s3ref payloads are supported.",
2254
+ "properties": {
2255
+ "_id": {
2256
+ "allOf": [
2257
+ {
2258
+ "$ref": "#/components/schemas/FileEntityId"
2259
+ },
2260
+ {
2261
+ "description": "Target file entity to add version to"
2262
+ }
2263
+ ]
2264
+ },
2265
+ "file_entity_id": {
2266
+ "type": "string",
2267
+ "description": "Deprecated, use _id instead",
2268
+ "deprecated": true
2269
+ },
2270
+ "filename": {
2271
+ "type": "string",
2272
+ "example": "document.pdf"
2273
+ },
2274
+ "mime_type": {
2275
+ "type": "string",
2276
+ "example": "application/pdf"
2277
+ },
2278
+ "access_control": {
2279
+ "type": "string",
2280
+ "default": "private",
2281
+ "enum": [
2282
+ "private",
2283
+ "public-read"
2284
+ ]
2285
+ },
2286
+ "s3ref": {
2287
+ "$ref": "#/components/schemas/S3Ref"
2288
+ }
2289
+ },
2290
+ "required": [
2291
+ "s3ref"
2292
+ ],
2293
+ "additionalProperties": false
2294
+ },
2215
2295
  "UploadFilePayload": {
2216
2296
  "type": "object",
2217
2297
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/file-client",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Client library for the epilot File API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",