@epilot/file-client 1.15.2 → 1.16.0-alpha.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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={330:function(e,r,i){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var t=a(i(466));r.default=t.default},466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v2/files/upload":{"post":{"operationId":"uploadFileV2","parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/files":{"post":{"operationId":"saveFileV2","parameters":[{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/FillActivityQueryParam"},{"$ref":"#/components/parameters/StrictQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"},{"$ref":"#/components/parameters/DeleteTempFileQueryParam"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files/upload":{"post":{"operationId":"uploadFile","deprecated":true,"parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files":{"post":{"operationId":"saveFile","deprecated":true,"parameters":[{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/files/{id}":{"get":{"operationId":"getFile","parameters":[{"name":"id","in":"path","required":true},{"name":"source_url","in":"query"},{"$ref":"#/components/parameters/StrictQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"}],"responses":{}},"delete":{"operationId":"deleteFile","parameters":[{"name":"id","in":"path","required":true},{"name":"purge","in":"query"},{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/StrictQueryParam"}],"responses":{}}},"/v1/files/{id}/download":{"get":{"operationId":"downloadFile","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query"},{"name":"attachment","in":"query"}],"responses":{}}},"/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"}],"responses":{}}},"/v1/files:downloadFiles":{"post":{"operationId":"downloadFiles","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/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"}],"responses":{}}},"/v1/files:previewS3":{"post":{"operationId":"previewS3File","parameters":[{"name":"w","in":"query"},{"name":"h","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"get":{"operationId":"previewS3FileGet","parameters":[{"name":"key","in":"query","required":true},{"name":"bucket","in":"query","required":true},{"name":"w","in":"query"},{"name":"h","in":"query"}],"responses":{}}},"/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"}],"responses":{}}},"/v1/files/session":{"get":{"operationId":"getSession","responses":{}},"delete":{"operationId":"deleteSession","responses":{}}},"/v1/files/{id}/public/links":{"post":{"operationId":"generatePublicLink","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"get":{"operationId":"listPublicLinksForFile","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/files/public/links/{id}/{filename}":{"get":{"operationId":"accessPublicLink","parameters":[{"name":"id","in":"path","required":true},{"name":"filename","in":"path","required":true},{"name":"hash","in":"query","required":false}],"responses":{}}},"/v1/files/public/links/{id}":{"delete":{"operationId":"revokePublicLink","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/files/download:verify":{"post":{"operationId":"verifyCustomDownloadUrl","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files/public/upload":{"post":{"operationId":"uploadFilePublic","requestBody":{"content":{"application/json":{}}},"responses":{}}}},"components":{"parameters":{"StrictQueryParam":{"name":"strict","in":"query","required":false},"ActivityIdQueryParam":{"name":"activity_id","in":"query","required":false},"FillActivityQueryParam":{"name":"fill_activity","in":"query","required":false},"AsyncOperationQueryParam":{"name":"async","in":"query","required":false},"DeleteTempFileQueryParam":{"name":"delete_temp_file","in":"query","required":false}}},"servers":[{"url":"https://file.sls.epilot.io"}]}')}},r={},i=function i(a){var t=r[a];if(void 0!==t)return t.exports;var n=r[a]={exports:{}};return e[a].call(n.exports,n,n.exports,i),n.exports}(330),a=exports;for(var t in i)a[t]=i[t];i.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={466:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"paths":{"/v2/files/upload":{"post":{"operationId":"uploadFileV2","parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/files":{"post":{"operationId":"saveFileV2","parameters":[{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/FillActivityQueryParam"},{"$ref":"#/components/parameters/StrictQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"},{"$ref":"#/components/parameters/DeleteTempFileQueryParam"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files/upload":{"post":{"operationId":"uploadFile","deprecated":true,"parameters":[{"name":"file_entity_id","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files":{"post":{"operationId":"saveFile","deprecated":true,"parameters":[{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v2/files/{id}":{"get":{"operationId":"getFile","parameters":[{"name":"id","in":"path","required":true},{"name":"source_url","in":"query"},{"$ref":"#/components/parameters/StrictQueryParam"},{"$ref":"#/components/parameters/AsyncOperationQueryParam"}],"responses":{}},"delete":{"operationId":"deleteFile","parameters":[{"name":"id","in":"path","required":true},{"name":"purge","in":"query"},{"$ref":"#/components/parameters/ActivityIdQueryParam"},{"$ref":"#/components/parameters/StrictQueryParam"}],"responses":{}}},"/v1/files/{id}/download":{"get":{"operationId":"downloadFile","parameters":[{"name":"id","in":"path","required":true},{"name":"version","in":"query"},{"name":"attachment","in":"query"}],"responses":{}}},"/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"}],"responses":{}}},"/v1/files:downloadFiles":{"post":{"operationId":"downloadFiles","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/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"}],"responses":{}}},"/v1/files:previewS3":{"post":{"operationId":"previewS3File","parameters":[{"name":"w","in":"query"},{"name":"h","in":"query"}],"requestBody":{"content":{"application/json":{}}},"responses":{}},"get":{"operationId":"previewS3FileGet","parameters":[{"name":"key","in":"query","required":true},{"name":"bucket","in":"query","required":true},{"name":"w","in":"query"},{"name":"h","in":"query"}],"responses":{}}},"/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"}],"responses":{}}},"/v1/files/session":{"get":{"operationId":"getSession","responses":{}},"delete":{"operationId":"deleteSession","responses":{}}},"/v1/files/{id}/public/links":{"post":{"operationId":"generatePublicLink","parameters":[{"name":"id","in":"path","required":true}],"responses":{}},"get":{"operationId":"listPublicLinksForFile","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/files/public/links/{id}/{filename}":{"get":{"operationId":"accessPublicLink","parameters":[{"name":"id","in":"path","required":true},{"name":"filename","in":"path","required":true},{"name":"hash","in":"query","required":false}],"responses":{}}},"/v1/files/public/links/{id}":{"delete":{"operationId":"revokePublicLink","parameters":[{"name":"id","in":"path","required":true}],"responses":{}}},"/v1/files/download:verify":{"post":{"operationId":"verifyCustomDownloadUrl","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/files/public/upload":{"post":{"operationId":"uploadFilePublic","requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/entity/{id}/folders":{"get":{"operationId":"getFileFolders","parameters":[{"$ref":"#/components/parameters/EntityIdPathParam"},{"name":"parents","in":"query","required":false,"style":"form","explode":true}],"responses":{}},"post":{"operationId":"createFileFolder","parameters":[{"$ref":"#/components/parameters/EntityIdPathParam"}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/entity/{id}/folders/{folderSlug}":{"put":{"operationId":"updateFileFolder","parameters":[{"$ref":"#/components/parameters/EntityIdPathParam"},{"name":"folderSlug","in":"path","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}},"delete":{"operationId":"deleteFileFolder","parameters":[{"$ref":"#/components/parameters/EntityIdPathParam"},{"name":"folderSlug","in":"path","required":true}],"responses":{}}},"/v1/entity/{id}/folders/{folderSlug}/files":{"get":{"operationId":"getFilesInFolder","parameters":[{"$ref":"#/components/parameters/EntityIdPathParam"},{"name":"folderSlug","in":"path","required":true}],"responses":{}}}},"components":{"parameters":{"EntityIdPathParam":{"name":"id","in":"path","required":true},"StrictQueryParam":{"name":"strict","in":"query","required":false},"ActivityIdQueryParam":{"name":"activity_id","in":"query","required":false},"FillActivityQueryParam":{"name":"fill_activity","in":"query","required":false},"AsyncOperationQueryParam":{"name":"async","in":"query","required":false},"DeleteTempFileQueryParam":{"name":"delete_temp_file","in":"query","required":false}},"responses":{"NotFoundError":{"content":{"application/json":{}}}}},"servers":[{"url":"https://file.sls.epilot.io"}]}')},757:function(e,r,t){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var n=a(t(466));r.default=n.default}},r={},t=function t(a){var n=r[a];if(void 0!==n)return n.exports;var i=r[a]={exports:{}};return e[a].call(i.exports,i,i.exports,t),i.exports}(757),a=exports;for(var n in t)a[n]=t[n];t.__esModule&&Object.defineProperty(a,"__esModule",{value:!0})})();
@@ -376,10 +376,100 @@
376
376
  },
377
377
  "responses": {}
378
378
  }
379
+ },
380
+ "/v1/entity/{id}/folders": {
381
+ "get": {
382
+ "operationId": "getFileFolders",
383
+ "parameters": [
384
+ {
385
+ "$ref": "#/components/parameters/EntityIdPathParam"
386
+ },
387
+ {
388
+ "name": "parents",
389
+ "in": "query",
390
+ "required": false,
391
+ "style": "form",
392
+ "explode": true
393
+ }
394
+ ],
395
+ "responses": {}
396
+ },
397
+ "post": {
398
+ "operationId": "createFileFolder",
399
+ "parameters": [
400
+ {
401
+ "$ref": "#/components/parameters/EntityIdPathParam"
402
+ }
403
+ ],
404
+ "requestBody": {
405
+ "required": true,
406
+ "content": {
407
+ "application/json": {}
408
+ }
409
+ },
410
+ "responses": {}
411
+ }
412
+ },
413
+ "/v1/entity/{id}/folders/{folderSlug}": {
414
+ "put": {
415
+ "operationId": "updateFileFolder",
416
+ "parameters": [
417
+ {
418
+ "$ref": "#/components/parameters/EntityIdPathParam"
419
+ },
420
+ {
421
+ "name": "folderSlug",
422
+ "in": "path",
423
+ "required": true
424
+ }
425
+ ],
426
+ "requestBody": {
427
+ "required": true,
428
+ "content": {
429
+ "application/json": {}
430
+ }
431
+ },
432
+ "responses": {}
433
+ },
434
+ "delete": {
435
+ "operationId": "deleteFileFolder",
436
+ "parameters": [
437
+ {
438
+ "$ref": "#/components/parameters/EntityIdPathParam"
439
+ },
440
+ {
441
+ "name": "folderSlug",
442
+ "in": "path",
443
+ "required": true
444
+ }
445
+ ],
446
+ "responses": {}
447
+ }
448
+ },
449
+ "/v1/entity/{id}/folders/{folderSlug}/files": {
450
+ "get": {
451
+ "operationId": "getFilesInFolder",
452
+ "parameters": [
453
+ {
454
+ "$ref": "#/components/parameters/EntityIdPathParam"
455
+ },
456
+ {
457
+ "name": "folderSlug",
458
+ "in": "path",
459
+ "required": true
460
+ }
461
+ ],
462
+ "responses": {}
463
+ }
379
464
  }
380
465
  },
381
466
  "components": {
382
467
  "parameters": {
468
+ "EntityIdPathParam": {
469
+ "name": "id",
470
+ "in": "path",
471
+ "required": true
472
+ },
383
473
  "StrictQueryParam": {
384
474
  "name": "strict",
385
475
  "in": "query",
@@ -405,6 +495,13 @@
405
495
  "in": "query",
406
496
  "required": false
407
497
  }
498
+ },
499
+ "responses": {
500
+ "NotFoundError": {
501
+ "content": {
502
+ "application/json": {}
503
+ }
504
+ }
408
505
  }
409
506
  },
410
507
  "servers": [
package/dist/openapi.d.ts CHANGED
@@ -18,9 +18,17 @@ declare namespace Components {
18
18
  Schemas.ActivityId /* ulid */;
19
19
  export type AsyncOperationQueryParam = boolean;
20
20
  export type DeleteTempFileQueryParam = boolean;
21
+ export type EntityIdPathParam = /**
22
+ * example:
23
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
24
+ */
25
+ Schemas.EntityId;
21
26
  export type FillActivityQueryParam = boolean;
22
27
  export type StrictQueryParam = boolean;
23
28
  }
29
+ export interface PathParameters {
30
+ EntityIdPathParam?: Parameters.EntityIdPathParam;
31
+ }
24
32
  export interface QueryParameters {
25
33
  StrictQueryParam?: Parameters.StrictQueryParam;
26
34
  ActivityIdQueryParam?: Parameters.ActivityIdQueryParam;
@@ -28,6 +36,30 @@ declare namespace Components {
28
36
  AsyncOperationQueryParam?: Parameters.AsyncOperationQueryParam;
29
37
  DeleteTempFileQueryParam?: Parameters.DeleteTempFileQueryParam;
30
38
  }
39
+ namespace Responses {
40
+ /**
41
+ * A generic error returned by the API
42
+ * example:
43
+ * {
44
+ * "status": 404,
45
+ * "error": "Not Found"
46
+ * }
47
+ */
48
+ export interface NotFoundError {
49
+ /**
50
+ * The HTTP status code of the error
51
+ * example:
52
+ * 400
53
+ */
54
+ status?: number;
55
+ /**
56
+ * The error message
57
+ * example:
58
+ * Bad Request
59
+ */
60
+ error?: string;
61
+ }
62
+ }
31
63
  namespace Schemas {
32
64
  /**
33
65
  * See https://github.com/ulid/spec
@@ -108,6 +140,23 @@ declare namespace Components {
108
140
  * contact
109
141
  */
110
142
  export type EntitySlug = string;
143
+ /**
144
+ * A generic error returned by the API
145
+ */
146
+ export interface ErrorObject {
147
+ /**
148
+ * The HTTP status code of the error
149
+ * example:
150
+ * 400
151
+ */
152
+ status?: number;
153
+ /**
154
+ * The error message
155
+ * example:
156
+ * Bad Request
157
+ */
158
+ error?: string;
159
+ }
111
160
  export interface FileAttributes {
112
161
  /**
113
162
  * example:
@@ -271,6 +320,104 @@ declare namespace Components {
271
320
  * ef7d985c-2385-44f4-9c71-ae06a52264f8
272
321
  */
273
322
  export type FileEntityId = string;
323
+ export interface FileFolderAttributes {
324
+ /**
325
+ * Name of the file folder
326
+ */
327
+ name?: string;
328
+ /**
329
+ * Optional parent folder slug. If not provided, the folder will be created at the top level
330
+ */
331
+ parent?: string;
332
+ /**
333
+ * Array of file IDs in this folder
334
+ */
335
+ files?: string /* uuid */[];
336
+ }
337
+ /**
338
+ * Request body for creating a file folder
339
+ */
340
+ export interface FileFolderCreateRequest {
341
+ /**
342
+ * Name of the file folder
343
+ */
344
+ name: string;
345
+ /**
346
+ * Optional parent folder slug. If not provided, the folder will be created at the top level
347
+ */
348
+ parent?: string;
349
+ /**
350
+ * Array of file IDs in this folder
351
+ */
352
+ files?: string /* uuid */[];
353
+ }
354
+ /**
355
+ * Generated uuid for a file folder
356
+ */
357
+ export type FileFolderId = string; // uuid
358
+ /**
359
+ * A file folder with identifiers and timestamps
360
+ */
361
+ export interface FileFolderItem {
362
+ id: /* Generated uuid for a file folder */ FileFolderId /* uuid */;
363
+ /**
364
+ * Organization ID
365
+ * example:
366
+ * 123
367
+ */
368
+ orgId: string;
369
+ entityId: /**
370
+ * example:
371
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
372
+ */
373
+ EntityId;
374
+ /**
375
+ * Logical type for this item (e.g. "folder")
376
+ * example:
377
+ * folder
378
+ */
379
+ type: string;
380
+ /**
381
+ * example:
382
+ * MyFolderOfImportantFiles
383
+ */
384
+ name: string;
385
+ entity_id: /**
386
+ * example:
387
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
388
+ */
389
+ EntityId;
390
+ /**
391
+ * URL-friendly identifier for the folder
392
+ * example:
393
+ * documents
394
+ */
395
+ slug: string;
396
+ /**
397
+ * Array of file IDs in this folder
398
+ * example:
399
+ * [
400
+ * "123e4567-e89b-12d3-a456-426614174000"
401
+ * ]
402
+ */
403
+ files: string /* uuid */[];
404
+ /**
405
+ * User ID who created the folder
406
+ * example:
407
+ * 17622
408
+ */
409
+ created_by: string;
410
+ /**
411
+ * example:
412
+ * 2025-08-20T12:01:00Z
413
+ */
414
+ created_at: string; // date-time
415
+ /**
416
+ * example:
417
+ * 2025-08-20T12:01:00Z
418
+ */
419
+ updated_at: string; // date-time
420
+ }
274
421
  export interface FileItem {
275
422
  s3ref?: S3Ref;
276
423
  /**
@@ -666,6 +813,31 @@ declare namespace Paths {
666
813
  }
667
814
  }
668
815
  }
816
+ namespace CreateFileFolder {
817
+ namespace Parameters {
818
+ export type Id = /**
819
+ * example:
820
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
821
+ */
822
+ Components.Schemas.EntityId;
823
+ }
824
+ export interface PathParameters {
825
+ id: Parameters.Id;
826
+ }
827
+ export type RequestBody = /* Request body for creating a file folder */ Components.Schemas.FileFolderCreateRequest;
828
+ namespace Responses {
829
+ export type $201 = /* A file folder with identifiers and timestamps */ Components.Schemas.FileFolderItem;
830
+ export type $404 = /**
831
+ * A generic error returned by the API
832
+ * example:
833
+ * {
834
+ * "status": 404,
835
+ * "error": "Not Found"
836
+ * }
837
+ */
838
+ Components.Responses.NotFoundError;
839
+ }
840
+ }
669
841
  namespace DeleteFile {
670
842
  namespace Parameters {
671
843
  export type ActivityId = /**
@@ -697,6 +869,41 @@ declare namespace Paths {
697
869
  export type $200 = Components.Schemas.FileEntity;
698
870
  }
699
871
  }
872
+ namespace DeleteFileFolder {
873
+ namespace Parameters {
874
+ /**
875
+ * example:
876
+ * documents
877
+ */
878
+ export type FolderSlug = string;
879
+ export type Id = /**
880
+ * example:
881
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
882
+ */
883
+ Components.Schemas.EntityId;
884
+ }
885
+ export interface PathParameters {
886
+ id: Parameters.Id;
887
+ folderSlug: /**
888
+ * example:
889
+ * documents
890
+ */
891
+ Parameters.FolderSlug;
892
+ }
893
+ namespace Responses {
894
+ export interface $200 {
895
+ }
896
+ export type $404 = /**
897
+ * A generic error returned by the API
898
+ * example:
899
+ * {
900
+ * "status": 404,
901
+ * "error": "Not Found"
902
+ * }
903
+ */
904
+ Components.Responses.NotFoundError;
905
+ }
906
+ }
700
907
  namespace DeleteSession {
701
908
  namespace Responses {
702
909
  export interface $200 {
@@ -809,6 +1016,75 @@ declare namespace Paths {
809
1016
  export type $200 = Components.Schemas.FileEntity;
810
1017
  }
811
1018
  }
1019
+ namespace GetFileFolders {
1020
+ namespace Parameters {
1021
+ export type Id = /**
1022
+ * example:
1023
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
1024
+ */
1025
+ Components.Schemas.EntityId;
1026
+ export type Parents = string[];
1027
+ }
1028
+ export interface PathParameters {
1029
+ id: Parameters.Id;
1030
+ }
1031
+ export interface QueryParameters {
1032
+ parents?: Parameters.Parents;
1033
+ }
1034
+ namespace Responses {
1035
+ export interface $200 {
1036
+ results?: /* A file folder with identifiers and timestamps */ Components.Schemas.FileFolderItem[];
1037
+ }
1038
+ export type $404 = /**
1039
+ * A generic error returned by the API
1040
+ * example:
1041
+ * {
1042
+ * "status": 404,
1043
+ * "error": "Not Found"
1044
+ * }
1045
+ */
1046
+ Components.Responses.NotFoundError;
1047
+ }
1048
+ }
1049
+ namespace GetFilesInFolder {
1050
+ namespace Parameters {
1051
+ /**
1052
+ * example:
1053
+ * documents
1054
+ */
1055
+ export type FolderSlug = string;
1056
+ export type Id = /**
1057
+ * example:
1058
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
1059
+ */
1060
+ Components.Schemas.EntityId;
1061
+ }
1062
+ export interface PathParameters {
1063
+ id: Parameters.Id;
1064
+ folderSlug: /**
1065
+ * example:
1066
+ * documents
1067
+ */
1068
+ Parameters.FolderSlug;
1069
+ }
1070
+ namespace Responses {
1071
+ export type $200 = Components.Schemas.FileEntity[];
1072
+ export interface $403 {
1073
+ /**
1074
+ * example:
1075
+ * User must have permission to view this entity to access its files
1076
+ */
1077
+ error?: string;
1078
+ }
1079
+ export interface $404 {
1080
+ /**
1081
+ * example:
1082
+ * Entity not found
1083
+ */
1084
+ error?: string;
1085
+ }
1086
+ }
1087
+ }
812
1088
  namespace GetSession {
813
1089
  namespace Responses {
814
1090
  export interface $200 {
@@ -974,6 +1250,41 @@ declare namespace Paths {
974
1250
  export type $200 = Components.Schemas.FileEntity;
975
1251
  }
976
1252
  }
1253
+ namespace UpdateFileFolder {
1254
+ namespace Parameters {
1255
+ /**
1256
+ * example:
1257
+ * documents
1258
+ */
1259
+ export type FolderSlug = string;
1260
+ export type Id = /**
1261
+ * example:
1262
+ * ef7d985c-2385-44f4-9c71-ae06a52264f8
1263
+ */
1264
+ Components.Schemas.EntityId;
1265
+ }
1266
+ export interface PathParameters {
1267
+ id: Parameters.Id;
1268
+ folderSlug: /**
1269
+ * example:
1270
+ * documents
1271
+ */
1272
+ Parameters.FolderSlug;
1273
+ }
1274
+ export type RequestBody = /* Request body for creating a file folder */ Components.Schemas.FileFolderCreateRequest;
1275
+ namespace Responses {
1276
+ export type $200 = /* A file folder with identifiers and timestamps */ Components.Schemas.FileFolderItem;
1277
+ export type $404 = /**
1278
+ * A generic error returned by the API
1279
+ * example:
1280
+ * {
1281
+ * "status": 404,
1282
+ * "error": "Not Found"
1283
+ * }
1284
+ */
1285
+ Components.Responses.NotFoundError;
1286
+ }
1287
+ }
977
1288
  namespace UploadFile {
978
1289
  namespace Parameters {
979
1290
  export type FileEntityId = /**
@@ -1013,6 +1324,11 @@ declare namespace Paths {
1013
1324
  * https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123
1014
1325
  */
1015
1326
  upload_url?: string; // url
1327
+ /**
1328
+ * example:
1329
+ * File entity not found
1330
+ */
1331
+ error?: string;
1016
1332
  }
1017
1333
  }
1018
1334
  }
@@ -1275,6 +1591,56 @@ export interface OperationMethods {
1275
1591
  data?: Paths.UploadFilePublic.RequestBody,
1276
1592
  config?: AxiosRequestConfig
1277
1593
  ): OperationResponse<Paths.UploadFilePublic.Responses.$201>
1594
+ /**
1595
+ * getFileFolders - getFileFolders
1596
+ *
1597
+ * Gets a list of folders that exist for an entity
1598
+ */
1599
+ 'getFileFolders'(
1600
+ parameters?: Parameters<Paths.GetFileFolders.QueryParameters & Paths.GetFileFolders.PathParameters> | null,
1601
+ data?: any,
1602
+ config?: AxiosRequestConfig
1603
+ ): OperationResponse<Paths.GetFileFolders.Responses.$200>
1604
+ /**
1605
+ * createFileFolder - createFileFolder
1606
+ *
1607
+ * Creates a new file folder for the specified entity
1608
+ */
1609
+ 'createFileFolder'(
1610
+ parameters?: Parameters<Paths.CreateFileFolder.PathParameters> | null,
1611
+ data?: Paths.CreateFileFolder.RequestBody,
1612
+ config?: AxiosRequestConfig
1613
+ ): OperationResponse<Paths.CreateFileFolder.Responses.$201>
1614
+ /**
1615
+ * updateFileFolder - updateFileFolder
1616
+ *
1617
+ * Updates a specific file folder by slug
1618
+ */
1619
+ 'updateFileFolder'(
1620
+ parameters?: Parameters<Paths.UpdateFileFolder.PathParameters> | null,
1621
+ data?: Paths.UpdateFileFolder.RequestBody,
1622
+ config?: AxiosRequestConfig
1623
+ ): OperationResponse<Paths.UpdateFileFolder.Responses.$200>
1624
+ /**
1625
+ * deleteFileFolder - deleteFileFolder
1626
+ *
1627
+ * Deletes a specific file folder by slug
1628
+ */
1629
+ 'deleteFileFolder'(
1630
+ parameters?: Parameters<Paths.DeleteFileFolder.PathParameters> | null,
1631
+ data?: any,
1632
+ config?: AxiosRequestConfig
1633
+ ): OperationResponse<Paths.DeleteFileFolder.Responses.$200>
1634
+ /**
1635
+ * getFilesInFolder - getFilesInFolder
1636
+ *
1637
+ * Gets all files within a specific folder for an entity
1638
+ */
1639
+ 'getFilesInFolder'(
1640
+ parameters?: Parameters<Paths.GetFilesInFolder.PathParameters> | null,
1641
+ data?: any,
1642
+ config?: AxiosRequestConfig
1643
+ ): OperationResponse<Paths.GetFilesInFolder.Responses.$200>
1278
1644
  }
1279
1645
 
1280
1646
  export interface PathsDictionary {
@@ -1543,6 +1909,62 @@ export interface PathsDictionary {
1543
1909
  config?: AxiosRequestConfig
1544
1910
  ): OperationResponse<Paths.UploadFilePublic.Responses.$201>
1545
1911
  }
1912
+ ['/v1/entity/{id}/folders']: {
1913
+ /**
1914
+ * getFileFolders - getFileFolders
1915
+ *
1916
+ * Gets a list of folders that exist for an entity
1917
+ */
1918
+ 'get'(
1919
+ parameters?: Parameters<Paths.GetFileFolders.QueryParameters & Paths.GetFileFolders.PathParameters> | null,
1920
+ data?: any,
1921
+ config?: AxiosRequestConfig
1922
+ ): OperationResponse<Paths.GetFileFolders.Responses.$200>
1923
+ /**
1924
+ * createFileFolder - createFileFolder
1925
+ *
1926
+ * Creates a new file folder for the specified entity
1927
+ */
1928
+ 'post'(
1929
+ parameters?: Parameters<Paths.CreateFileFolder.PathParameters> | null,
1930
+ data?: Paths.CreateFileFolder.RequestBody,
1931
+ config?: AxiosRequestConfig
1932
+ ): OperationResponse<Paths.CreateFileFolder.Responses.$201>
1933
+ }
1934
+ ['/v1/entity/{id}/folders/{folderSlug}']: {
1935
+ /**
1936
+ * updateFileFolder - updateFileFolder
1937
+ *
1938
+ * Updates a specific file folder by slug
1939
+ */
1940
+ 'put'(
1941
+ parameters?: Parameters<Paths.UpdateFileFolder.PathParameters> | null,
1942
+ data?: Paths.UpdateFileFolder.RequestBody,
1943
+ config?: AxiosRequestConfig
1944
+ ): OperationResponse<Paths.UpdateFileFolder.Responses.$200>
1945
+ /**
1946
+ * deleteFileFolder - deleteFileFolder
1947
+ *
1948
+ * Deletes a specific file folder by slug
1949
+ */
1950
+ 'delete'(
1951
+ parameters?: Parameters<Paths.DeleteFileFolder.PathParameters> | null,
1952
+ data?: any,
1953
+ config?: AxiosRequestConfig
1954
+ ): OperationResponse<Paths.DeleteFileFolder.Responses.$200>
1955
+ }
1956
+ ['/v1/entity/{id}/folders/{folderSlug}/files']: {
1957
+ /**
1958
+ * getFilesInFolder - getFilesInFolder
1959
+ *
1960
+ * Gets all files within a specific folder for an entity
1961
+ */
1962
+ 'get'(
1963
+ parameters?: Parameters<Paths.GetFilesInFolder.PathParameters> | null,
1964
+ data?: any,
1965
+ config?: AxiosRequestConfig
1966
+ ): OperationResponse<Paths.GetFilesInFolder.Responses.$200>
1967
+ }
1546
1968
  }
1547
1969
 
1548
1970
  export type Client = OpenAPIClient<OperationMethods, PathsDictionary>
@@ -1556,9 +1978,14 @@ export type CustomDownloadUrl = Components.Schemas.CustomDownloadUrl;
1556
1978
  export type DownloadFilesPayload = Components.Schemas.DownloadFilesPayload;
1557
1979
  export type EntityId = Components.Schemas.EntityId;
1558
1980
  export type EntitySlug = Components.Schemas.EntitySlug;
1981
+ export type ErrorObject = Components.Schemas.ErrorObject;
1559
1982
  export type FileAttributes = Components.Schemas.FileAttributes;
1560
1983
  export type FileEntity = Components.Schemas.FileEntity;
1561
1984
  export type FileEntityId = Components.Schemas.FileEntityId;
1985
+ export type FileFolderAttributes = Components.Schemas.FileFolderAttributes;
1986
+ export type FileFolderCreateRequest = Components.Schemas.FileFolderCreateRequest;
1987
+ export type FileFolderId = Components.Schemas.FileFolderId;
1988
+ export type FileFolderItem = Components.Schemas.FileFolderItem;
1562
1989
  export type FileItem = Components.Schemas.FileItem;
1563
1990
  export type FileRelationItem = Components.Schemas.FileRelationItem;
1564
1991
  export type FileType = Components.Schemas.FileType;
package/dist/openapi.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "File API",
5
- "version": "0.2.1",
6
- "description": "Upload and manage epilot Files"
5
+ "version": "1.0.0",
6
+ "description": "Upload and manage epilot Files\n\n## Changelog\n<a href=\"changelog\">View API Changelog</a>\n"
7
7
  },
8
8
  "tags": [
9
9
  {
@@ -30,6 +30,10 @@
30
30
  "name": "file_schema",
31
31
  "x-displayName": "File",
32
32
  "description": "<SchemaDefinition schemaRef=\"#/components/schemas/FileEntity\" />\n"
33
+ },
34
+ {
35
+ "name": "File Folders",
36
+ "description": "Folder management for organizing files within entities"
33
37
  }
34
38
  ],
35
39
  "x-tagGroups": [
@@ -40,6 +44,7 @@
40
44
  "Preview",
41
45
  "Public Links",
42
46
  "Session",
47
+ "File Folders",
43
48
  "Deprecated"
44
49
  ]
45
50
  },
@@ -1076,6 +1081,253 @@
1076
1081
  "type": "string",
1077
1082
  "format": "url",
1078
1083
  "example": "https://epilot-prod-user-content.s3.eu-central-1.amazonaws.com/123/temp/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf?AWSParams=123"
1084
+ },
1085
+ "error": {
1086
+ "type": "string",
1087
+ "example": "File entity not found"
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ }
1093
+ }
1094
+ }
1095
+ }
1096
+ },
1097
+ "/v1/entity/{id}/folders": {
1098
+ "get": {
1099
+ "operationId": "getFileFolders",
1100
+ "summary": "getFileFolders",
1101
+ "description": "Gets a list of folders that exist for an entity",
1102
+ "tags": [
1103
+ "File Folders"
1104
+ ],
1105
+ "parameters": [
1106
+ {
1107
+ "$ref": "#/components/parameters/EntityIdPathParam"
1108
+ },
1109
+ {
1110
+ "name": "parents",
1111
+ "in": "query",
1112
+ "description": "Optional array of parent folder slugs to filter by",
1113
+ "required": false,
1114
+ "schema": {
1115
+ "type": "array",
1116
+ "items": {
1117
+ "type": "string"
1118
+ }
1119
+ },
1120
+ "style": "form",
1121
+ "explode": true
1122
+ }
1123
+ ],
1124
+ "responses": {
1125
+ "200": {
1126
+ "description": "List of folders for the entity",
1127
+ "content": {
1128
+ "application/json": {
1129
+ "schema": {
1130
+ "type": "object",
1131
+ "properties": {
1132
+ "results": {
1133
+ "type": "array",
1134
+ "items": {
1135
+ "$ref": "#/components/schemas/FileFolderItem"
1136
+ }
1137
+ }
1138
+ }
1139
+ }
1140
+ }
1141
+ }
1142
+ },
1143
+ "404": {
1144
+ "$ref": "#/components/responses/NotFoundError"
1145
+ }
1146
+ }
1147
+ },
1148
+ "post": {
1149
+ "operationId": "createFileFolder",
1150
+ "summary": "createFileFolder",
1151
+ "description": "Creates a new file folder for the specified entity",
1152
+ "tags": [
1153
+ "File Folders"
1154
+ ],
1155
+ "parameters": [
1156
+ {
1157
+ "$ref": "#/components/parameters/EntityIdPathParam"
1158
+ }
1159
+ ],
1160
+ "requestBody": {
1161
+ "required": true,
1162
+ "content": {
1163
+ "application/json": {
1164
+ "schema": {
1165
+ "$ref": "#/components/schemas/FileFolderCreateRequest"
1166
+ }
1167
+ }
1168
+ }
1169
+ },
1170
+ "responses": {
1171
+ "201": {
1172
+ "description": "File folder created successfully",
1173
+ "content": {
1174
+ "application/json": {
1175
+ "schema": {
1176
+ "$ref": "#/components/schemas/FileFolderItem"
1177
+ }
1178
+ }
1179
+ }
1180
+ },
1181
+ "404": {
1182
+ "$ref": "#/components/responses/NotFoundError"
1183
+ }
1184
+ }
1185
+ }
1186
+ },
1187
+ "/v1/entity/{id}/folders/{folderSlug}": {
1188
+ "put": {
1189
+ "operationId": "updateFileFolder",
1190
+ "summary": "updateFileFolder",
1191
+ "description": "Updates a specific file folder by slug",
1192
+ "tags": [
1193
+ "File Folders"
1194
+ ],
1195
+ "parameters": [
1196
+ {
1197
+ "$ref": "#/components/parameters/EntityIdPathParam"
1198
+ },
1199
+ {
1200
+ "name": "folderSlug",
1201
+ "in": "path",
1202
+ "required": true,
1203
+ "description": "The slug identifier for the folder",
1204
+ "schema": {
1205
+ "type": "string",
1206
+ "example": "documents"
1207
+ }
1208
+ }
1209
+ ],
1210
+ "requestBody": {
1211
+ "required": true,
1212
+ "content": {
1213
+ "application/json": {
1214
+ "schema": {
1215
+ "$ref": "#/components/schemas/FileFolderCreateRequest"
1216
+ }
1217
+ }
1218
+ }
1219
+ },
1220
+ "responses": {
1221
+ "200": {
1222
+ "description": "File folder updated successfully",
1223
+ "content": {
1224
+ "application/json": {
1225
+ "schema": {
1226
+ "$ref": "#/components/schemas/FileFolderItem"
1227
+ }
1228
+ }
1229
+ }
1230
+ },
1231
+ "404": {
1232
+ "$ref": "#/components/responses/NotFoundError"
1233
+ }
1234
+ }
1235
+ },
1236
+ "delete": {
1237
+ "operationId": "deleteFileFolder",
1238
+ "summary": "deleteFileFolder",
1239
+ "description": "Deletes a specific file folder by slug",
1240
+ "tags": [
1241
+ "File Folders"
1242
+ ],
1243
+ "parameters": [
1244
+ {
1245
+ "$ref": "#/components/parameters/EntityIdPathParam"
1246
+ },
1247
+ {
1248
+ "name": "folderSlug",
1249
+ "in": "path",
1250
+ "required": true,
1251
+ "description": "The slug identifier for the folder",
1252
+ "schema": {
1253
+ "type": "string",
1254
+ "example": "documents"
1255
+ }
1256
+ }
1257
+ ],
1258
+ "responses": {
1259
+ "200": {
1260
+ "description": "File folder deleted successfully"
1261
+ },
1262
+ "404": {
1263
+ "$ref": "#/components/responses/NotFoundError"
1264
+ }
1265
+ }
1266
+ }
1267
+ },
1268
+ "/v1/entity/{id}/folders/{folderSlug}/files": {
1269
+ "get": {
1270
+ "operationId": "getFilesInFolder",
1271
+ "summary": "getFilesInFolder",
1272
+ "description": "Gets all files within a specific folder for an entity",
1273
+ "tags": [
1274
+ "File Folders"
1275
+ ],
1276
+ "parameters": [
1277
+ {
1278
+ "$ref": "#/components/parameters/EntityIdPathParam"
1279
+ },
1280
+ {
1281
+ "name": "folderSlug",
1282
+ "in": "path",
1283
+ "required": true,
1284
+ "description": "The slug identifier for the folder",
1285
+ "schema": {
1286
+ "type": "string",
1287
+ "example": "documents"
1288
+ }
1289
+ }
1290
+ ],
1291
+ "responses": {
1292
+ "200": {
1293
+ "description": "List of files in the folder",
1294
+ "content": {
1295
+ "application/json": {
1296
+ "schema": {
1297
+ "type": "array",
1298
+ "items": {
1299
+ "$ref": "#/components/schemas/FileEntity"
1300
+ }
1301
+ }
1302
+ }
1303
+ }
1304
+ },
1305
+ "403": {
1306
+ "description": "User must have permission to view this entity to access its files",
1307
+ "content": {
1308
+ "application/json": {
1309
+ "schema": {
1310
+ "type": "object",
1311
+ "properties": {
1312
+ "error": {
1313
+ "type": "string",
1314
+ "example": "User must have permission to view this entity to access its files"
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ }
1320
+ },
1321
+ "404": {
1322
+ "description": "Entity or folder not found",
1323
+ "content": {
1324
+ "application/json": {
1325
+ "schema": {
1326
+ "type": "object",
1327
+ "properties": {
1328
+ "error": {
1329
+ "type": "string",
1330
+ "example": "Entity not found"
1079
1331
  }
1080
1332
  }
1081
1333
  }
@@ -1648,9 +1900,148 @@
1648
1900
  }
1649
1901
  }
1650
1902
  }
1903
+ },
1904
+ "FileFolderId": {
1905
+ "description": "Generated uuid for a file folder",
1906
+ "type": "string",
1907
+ "format": "uuid"
1908
+ },
1909
+ "FileFolderItem": {
1910
+ "description": "A file folder with identifiers and timestamps",
1911
+ "type": "object",
1912
+ "properties": {
1913
+ "id": {
1914
+ "$ref": "#/components/schemas/FileFolderId"
1915
+ },
1916
+ "orgId": {
1917
+ "type": "string",
1918
+ "description": "Organization ID",
1919
+ "example": "123"
1920
+ },
1921
+ "entityId": {
1922
+ "$ref": "#/components/schemas/EntityId"
1923
+ },
1924
+ "type": {
1925
+ "type": "string",
1926
+ "description": "Logical type for this item (e.g. \"folder\")",
1927
+ "example": "folder"
1928
+ },
1929
+ "name": {
1930
+ "type": "string",
1931
+ "example": "MyFolderOfImportantFiles"
1932
+ },
1933
+ "entity_id": {
1934
+ "$ref": "#/components/schemas/EntityId"
1935
+ },
1936
+ "slug": {
1937
+ "type": "string",
1938
+ "description": "URL-friendly identifier for the folder",
1939
+ "example": "documents"
1940
+ },
1941
+ "files": {
1942
+ "type": "array",
1943
+ "description": "Array of file IDs in this folder",
1944
+ "items": {
1945
+ "type": "string",
1946
+ "format": "uuid"
1947
+ },
1948
+ "example": [
1949
+ "123e4567-e89b-12d3-a456-426614174000"
1950
+ ]
1951
+ },
1952
+ "created_by": {
1953
+ "type": "string",
1954
+ "description": "User ID who created the folder",
1955
+ "example": "17622"
1956
+ },
1957
+ "created_at": {
1958
+ "type": "string",
1959
+ "format": "date-time",
1960
+ "example": "2025-08-20T12:01:00Z"
1961
+ },
1962
+ "updated_at": {
1963
+ "type": "string",
1964
+ "format": "date-time",
1965
+ "example": "2025-08-20T12:01:00Z"
1966
+ }
1967
+ },
1968
+ "required": [
1969
+ "id",
1970
+ "orgId",
1971
+ "entityId",
1972
+ "type",
1973
+ "name",
1974
+ "entity_id",
1975
+ "slug",
1976
+ "files",
1977
+ "created_by",
1978
+ "created_at",
1979
+ "updated_at"
1980
+ ]
1981
+ },
1982
+ "ErrorObject": {
1983
+ "description": "A generic error returned by the API",
1984
+ "type": "object",
1985
+ "properties": {
1986
+ "status": {
1987
+ "type": "integer",
1988
+ "description": "The HTTP status code of the error",
1989
+ "example": 400
1990
+ },
1991
+ "error": {
1992
+ "type": "string",
1993
+ "description": "The error message",
1994
+ "example": "Bad Request"
1995
+ }
1996
+ }
1997
+ },
1998
+ "FileFolderAttributes": {
1999
+ "type": "object",
2000
+ "properties": {
2001
+ "name": {
2002
+ "type": "string",
2003
+ "description": "Name of the file folder"
2004
+ },
2005
+ "parent": {
2006
+ "type": "string",
2007
+ "description": "Optional parent folder slug. If not provided, the folder will be created at the top level"
2008
+ },
2009
+ "files": {
2010
+ "type": "array",
2011
+ "description": "Array of file IDs in this folder",
2012
+ "items": {
2013
+ "type": "string",
2014
+ "format": "uuid"
2015
+ }
2016
+ }
2017
+ },
2018
+ "additionalProperties": false
2019
+ },
2020
+ "FileFolderCreateRequest": {
2021
+ "description": "Request body for creating a file folder",
2022
+ "allOf": [
2023
+ {
2024
+ "$ref": "#/components/schemas/FileFolderAttributes"
2025
+ },
2026
+ {
2027
+ "type": "object",
2028
+ "required": [
2029
+ "name"
2030
+ ]
2031
+ }
2032
+ ]
1651
2033
  }
1652
2034
  },
1653
2035
  "parameters": {
2036
+ "EntityIdPathParam": {
2037
+ "name": "id",
2038
+ "description": "Entity id",
2039
+ "in": "path",
2040
+ "required": true,
2041
+ "schema": {
2042
+ "$ref": "#/components/schemas/EntityId"
2043
+ }
2044
+ },
1654
2045
  "StrictQueryParam": {
1655
2046
  "name": "strict",
1656
2047
  "in": "query",
@@ -1700,6 +2091,28 @@
1700
2091
  "default": true
1701
2092
  }
1702
2093
  }
2094
+ },
2095
+ "responses": {
2096
+ "NotFoundError": {
2097
+ "description": "The requested resource was not found",
2098
+ "content": {
2099
+ "application/json": {
2100
+ "schema": {
2101
+ "allOf": [
2102
+ {
2103
+ "$ref": "#/components/schemas/ErrorObject"
2104
+ },
2105
+ {
2106
+ "example": {
2107
+ "status": 404,
2108
+ "error": "Not Found"
2109
+ }
2110
+ }
2111
+ ]
2112
+ }
2113
+ }
2114
+ }
2115
+ }
1703
2116
  }
1704
2117
  },
1705
2118
  "servers": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/file-client",
3
- "version": "1.15.2",
3
+ "version": "1.16.0-alpha.0",
4
4
  "description": "Client library for the epilot File API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",