@epilot/file-client 1.16.1 → 1.18.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.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "File API",
5
- "version": "1.0.0",
5
+ "version": "1.3.0",
6
6
  "description": "Upload and manage epilot Files\n\n## Changelog\n<a href=\"changelog\">View API Changelog</a>\n"
7
7
  },
8
8
  "tags": [
@@ -33,7 +33,11 @@
33
33
  },
34
34
  {
35
35
  "name": "File Folders",
36
- "description": "Folder management for organizing files within entities"
36
+ "description": "Folder management for organizing files within entities (deprecated - use File Collections)"
37
+ },
38
+ {
39
+ "name": "File Collections",
40
+ "description": "Collection management for organizing files within entities"
37
41
  }
38
42
  ],
39
43
  "x-tagGroups": [
@@ -44,6 +48,7 @@
44
48
  "Preview",
45
49
  "Public Links",
46
50
  "Session",
51
+ "File Collections",
47
52
  "File Folders",
48
53
  "Deprecated"
49
54
  ]
@@ -1098,7 +1103,8 @@
1098
1103
  "get": {
1099
1104
  "operationId": "getFileFolders",
1100
1105
  "summary": "getFileFolders",
1101
- "description": "Gets a list of folders that exist for an entity",
1106
+ "deprecated": true,
1107
+ "description": "Gets a list of folders that exist for an entity. Deprecated - use getFileCollections instead.",
1102
1108
  "tags": [
1103
1109
  "File Folders"
1104
1110
  ],
@@ -1143,7 +1149,8 @@
1143
1149
  "post": {
1144
1150
  "operationId": "createFileFolder",
1145
1151
  "summary": "createFileFolder",
1146
- "description": "Creates a new file folder for the specified entity",
1152
+ "deprecated": true,
1153
+ "description": "Creates a new file folder for the specified entity. Deprecated - use createFileCollection instead.",
1147
1154
  "tags": [
1148
1155
  "File Folders"
1149
1156
  ],
@@ -1183,7 +1190,8 @@
1183
1190
  "put": {
1184
1191
  "operationId": "updateFileFolder",
1185
1192
  "summary": "updateFileFolder",
1186
- "description": "Updates a specific file folder by slug",
1193
+ "deprecated": true,
1194
+ "description": "Updates a specific file folder by slug. Deprecated - use updateFileCollection instead.",
1187
1195
  "tags": [
1188
1196
  "File Folders"
1189
1197
  ],
@@ -1231,7 +1239,8 @@
1231
1239
  "delete": {
1232
1240
  "operationId": "deleteFileFolder",
1233
1241
  "summary": "deleteFileFolder",
1234
- "description": "Deletes a specific file folder by slug",
1242
+ "deprecated": true,
1243
+ "description": "Deletes a specific file folder by slug. Deprecated - use deleteFileCollection instead.",
1235
1244
  "tags": [
1236
1245
  "File Folders"
1237
1246
  ],
@@ -1264,7 +1273,8 @@
1264
1273
  "get": {
1265
1274
  "operationId": "getFilesInFolder",
1266
1275
  "summary": "getFilesInFolder",
1267
- "description": "Gets all files within a specific folder for an entity",
1276
+ "deprecated": true,
1277
+ "description": "Gets all files within a specific folder for an entity. Deprecated - use getFilesInCollection instead.",
1268
1278
  "tags": [
1269
1279
  "File Folders"
1270
1280
  ],
@@ -1331,6 +1341,319 @@
1331
1341
  }
1332
1342
  }
1333
1343
  }
1344
+ },
1345
+ "/v1/folders/{schemaSlug}": {
1346
+ "get": {
1347
+ "operationId": "getGlobalFileFolders",
1348
+ "summary": "getGlobalFileFolders",
1349
+ "deprecated": true,
1350
+ "description": "Gets all global file folders for a specific schema. Deprecated - use getGlobalFileCollections instead.",
1351
+ "tags": [
1352
+ "File Folders"
1353
+ ],
1354
+ "parameters": [
1355
+ {
1356
+ "name": "schemaSlug",
1357
+ "in": "path",
1358
+ "required": true,
1359
+ "description": "The schema slug (e.g., order, opportunity)",
1360
+ "schema": {
1361
+ "type": "string",
1362
+ "example": "order"
1363
+ }
1364
+ }
1365
+ ],
1366
+ "responses": {
1367
+ "200": {
1368
+ "description": "List of global folders for the schema",
1369
+ "content": {
1370
+ "application/json": {
1371
+ "schema": {
1372
+ "type": "array",
1373
+ "items": {
1374
+ "$ref": "#/components/schemas/FileFolderItem"
1375
+ }
1376
+ }
1377
+ }
1378
+ }
1379
+ }
1380
+ }
1381
+ }
1382
+ },
1383
+ "/v1/entity/{id}/collections": {
1384
+ "get": {
1385
+ "operationId": "getFileCollections",
1386
+ "summary": "getFileCollections",
1387
+ "description": "Gets a list of collections that exist for an entity",
1388
+ "tags": [
1389
+ "File Collections"
1390
+ ],
1391
+ "parameters": [
1392
+ {
1393
+ "$ref": "#/components/parameters/EntityIdPathParam"
1394
+ },
1395
+ {
1396
+ "name": "parents",
1397
+ "in": "query",
1398
+ "description": "Optional array of parent collection slugs to filter by",
1399
+ "required": false,
1400
+ "schema": {
1401
+ "type": "array",
1402
+ "items": {
1403
+ "type": "string"
1404
+ }
1405
+ },
1406
+ "style": "form",
1407
+ "explode": true
1408
+ }
1409
+ ],
1410
+ "responses": {
1411
+ "200": {
1412
+ "description": "List of collections for the entity",
1413
+ "content": {
1414
+ "application/json": {
1415
+ "schema": {
1416
+ "type": "array",
1417
+ "items": {
1418
+ "$ref": "#/components/schemas/FileCollectionItem"
1419
+ }
1420
+ }
1421
+ }
1422
+ }
1423
+ },
1424
+ "404": {
1425
+ "$ref": "#/components/responses/NotFoundError"
1426
+ }
1427
+ }
1428
+ },
1429
+ "post": {
1430
+ "operationId": "createFileCollection",
1431
+ "summary": "createFileCollection",
1432
+ "description": "Creates a new file collection for the specified entity",
1433
+ "tags": [
1434
+ "File Collections"
1435
+ ],
1436
+ "parameters": [
1437
+ {
1438
+ "$ref": "#/components/parameters/EntityIdPathParam"
1439
+ }
1440
+ ],
1441
+ "requestBody": {
1442
+ "required": true,
1443
+ "content": {
1444
+ "application/json": {
1445
+ "schema": {
1446
+ "$ref": "#/components/schemas/FileCollectionCreateRequest"
1447
+ }
1448
+ }
1449
+ }
1450
+ },
1451
+ "responses": {
1452
+ "201": {
1453
+ "description": "File collection created successfully",
1454
+ "content": {
1455
+ "application/json": {
1456
+ "schema": {
1457
+ "$ref": "#/components/schemas/FileCollectionItem"
1458
+ }
1459
+ }
1460
+ }
1461
+ },
1462
+ "404": {
1463
+ "$ref": "#/components/responses/NotFoundError"
1464
+ }
1465
+ }
1466
+ }
1467
+ },
1468
+ "/v1/entity/{id}/collections/{collectionSlug}": {
1469
+ "put": {
1470
+ "operationId": "updateFileCollection",
1471
+ "summary": "updateFileCollection",
1472
+ "description": "Updates a specific file collection by slug",
1473
+ "tags": [
1474
+ "File Collections"
1475
+ ],
1476
+ "parameters": [
1477
+ {
1478
+ "$ref": "#/components/parameters/EntityIdPathParam"
1479
+ },
1480
+ {
1481
+ "name": "collectionSlug",
1482
+ "in": "path",
1483
+ "required": true,
1484
+ "description": "The slug identifier for the collection",
1485
+ "schema": {
1486
+ "type": "string",
1487
+ "example": "documents"
1488
+ }
1489
+ }
1490
+ ],
1491
+ "requestBody": {
1492
+ "required": true,
1493
+ "content": {
1494
+ "application/json": {
1495
+ "schema": {
1496
+ "$ref": "#/components/schemas/FileCollectionAttributes"
1497
+ }
1498
+ }
1499
+ }
1500
+ },
1501
+ "responses": {
1502
+ "200": {
1503
+ "description": "File collection updated successfully",
1504
+ "content": {
1505
+ "application/json": {
1506
+ "schema": {
1507
+ "$ref": "#/components/schemas/FileCollectionItem"
1508
+ }
1509
+ }
1510
+ }
1511
+ },
1512
+ "404": {
1513
+ "$ref": "#/components/responses/NotFoundError"
1514
+ }
1515
+ }
1516
+ },
1517
+ "delete": {
1518
+ "operationId": "deleteFileCollection",
1519
+ "summary": "deleteFileCollection",
1520
+ "description": "Deletes a specific file collection by slug",
1521
+ "tags": [
1522
+ "File Collections"
1523
+ ],
1524
+ "parameters": [
1525
+ {
1526
+ "$ref": "#/components/parameters/EntityIdPathParam"
1527
+ },
1528
+ {
1529
+ "name": "collectionSlug",
1530
+ "in": "path",
1531
+ "required": true,
1532
+ "description": "The slug identifier for the collection",
1533
+ "schema": {
1534
+ "type": "string",
1535
+ "example": "documents"
1536
+ }
1537
+ }
1538
+ ],
1539
+ "responses": {
1540
+ "200": {
1541
+ "description": "File collection deleted successfully"
1542
+ },
1543
+ "404": {
1544
+ "$ref": "#/components/responses/NotFoundError"
1545
+ }
1546
+ }
1547
+ }
1548
+ },
1549
+ "/v1/entity/{id}/collections/{collectionSlug}/files": {
1550
+ "get": {
1551
+ "operationId": "getFilesInCollection",
1552
+ "summary": "getFilesInCollection",
1553
+ "description": "Gets all files within a specific collection for an entity",
1554
+ "tags": [
1555
+ "File Collections"
1556
+ ],
1557
+ "parameters": [
1558
+ {
1559
+ "$ref": "#/components/parameters/EntityIdPathParam"
1560
+ },
1561
+ {
1562
+ "name": "collectionSlug",
1563
+ "in": "path",
1564
+ "required": true,
1565
+ "description": "The slug identifier for the collection",
1566
+ "schema": {
1567
+ "type": "string",
1568
+ "example": "documents"
1569
+ }
1570
+ }
1571
+ ],
1572
+ "responses": {
1573
+ "200": {
1574
+ "description": "List of files in the collection",
1575
+ "content": {
1576
+ "application/json": {
1577
+ "schema": {
1578
+ "type": "array",
1579
+ "items": {
1580
+ "$ref": "#/components/schemas/FileEntity"
1581
+ }
1582
+ }
1583
+ }
1584
+ }
1585
+ },
1586
+ "403": {
1587
+ "description": "User must have permission to view this entity to access its files",
1588
+ "content": {
1589
+ "application/json": {
1590
+ "schema": {
1591
+ "type": "object",
1592
+ "properties": {
1593
+ "error": {
1594
+ "type": "string",
1595
+ "example": "User must have permission to view this entity to access its files"
1596
+ }
1597
+ }
1598
+ }
1599
+ }
1600
+ }
1601
+ },
1602
+ "404": {
1603
+ "description": "Entity or collection not found",
1604
+ "content": {
1605
+ "application/json": {
1606
+ "schema": {
1607
+ "type": "object",
1608
+ "properties": {
1609
+ "error": {
1610
+ "type": "string",
1611
+ "example": "Entity not found"
1612
+ }
1613
+ }
1614
+ }
1615
+ }
1616
+ }
1617
+ }
1618
+ }
1619
+ }
1620
+ },
1621
+ "/v1/collections/{schemaSlug}": {
1622
+ "get": {
1623
+ "operationId": "getGlobalFileCollections",
1624
+ "summary": "getGlobalFileCollections",
1625
+ "description": "Gets all global file collections for a specific schema",
1626
+ "tags": [
1627
+ "File Collections"
1628
+ ],
1629
+ "parameters": [
1630
+ {
1631
+ "name": "schemaSlug",
1632
+ "in": "path",
1633
+ "required": true,
1634
+ "description": "The schema slug (e.g., order, opportunity)",
1635
+ "schema": {
1636
+ "type": "string",
1637
+ "example": "order"
1638
+ }
1639
+ }
1640
+ ],
1641
+ "responses": {
1642
+ "200": {
1643
+ "description": "List of global collections for the schema",
1644
+ "content": {
1645
+ "application/json": {
1646
+ "schema": {
1647
+ "type": "array",
1648
+ "items": {
1649
+ "$ref": "#/components/schemas/FileCollectionItem"
1650
+ }
1651
+ }
1652
+ }
1653
+ }
1654
+ }
1655
+ }
1656
+ }
1334
1657
  }
1335
1658
  },
1336
1659
  "components": {
@@ -1365,7 +1688,18 @@
1365
1688
  "example": "01F130Q52Q6MWSNS8N2AVXV4JN"
1366
1689
  },
1367
1690
  "FileEntityId": {
1368
- "type": "string",
1691
+ "oneOf": [
1692
+ {
1693
+ "type": "string",
1694
+ "maxLength": 0,
1695
+ "description": "Empty string (used when file ID not yet assigned)"
1696
+ },
1697
+ {
1698
+ "type": "string",
1699
+ "format": "uuid",
1700
+ "description": "Valid UUID v4"
1701
+ }
1702
+ ],
1369
1703
  "example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
1370
1704
  },
1371
1705
  "FileAttributes": {
@@ -1907,8 +2241,8 @@
1907
2241
  "properties": {
1908
2242
  "slug": {
1909
2243
  "type": "string",
1910
- "description": "Full slug for the folder",
1911
- "example": "_system_files_collection_entity-123:documents"
2244
+ "description": "Full slug for the folder. Format depends on collection type:\n- User collection: `_system_files_collection_{entity_uuid}_{user_id}:{collection_name}`\n Example: `_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents`\n- Global collection: `_system_files_collection_schema_{schema_slug}:{collection_name}`\n Example: `_system_files_collection_schema_opportunity:templates`\n",
2245
+ "example": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents"
1912
2246
  },
1913
2247
  "name": {
1914
2248
  "type": "string",
@@ -1920,12 +2254,12 @@
1920
2254
  },
1921
2255
  "parents": {
1922
2256
  "type": "array",
1923
- "description": "Array of parent folder slugs, empty array if top-level folder",
2257
+ "description": "Array of parent folder slugs, empty array if top-level folder. Format depends on collection type:\n- User collection: `_system_files_collection_{entity_uuid}_{user_id}`\n Example: `[\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"]`\n- Global collection: `_system_files_collection_schema_{schema_slug}`\n Example: `[\"_system_files_collection_schema_opportunity\"]`\n",
1924
2258
  "items": {
1925
2259
  "type": "string"
1926
2260
  },
1927
2261
  "example": [
1928
- "_system_files_collection_entity-123"
2262
+ "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"
1929
2263
  ]
1930
2264
  },
1931
2265
  "starred": {
@@ -1933,6 +2267,11 @@
1933
2267
  "description": "Whether the folder is starred / favorited",
1934
2268
  "example": false
1935
2269
  },
2270
+ "order": {
2271
+ "type": "number",
2272
+ "description": "Display order for the folder",
2273
+ "example": 0
2274
+ },
1936
2275
  "created_at": {
1937
2276
  "type": "string",
1938
2277
  "format": "date-time",
@@ -2000,6 +2339,100 @@
2000
2339
  ]
2001
2340
  }
2002
2341
  ]
2342
+ },
2343
+ "FileCollectionId": {
2344
+ "description": "Generated uuid for a file collection",
2345
+ "type": "string",
2346
+ "format": "uuid"
2347
+ },
2348
+ "FileCollectionItem": {
2349
+ "description": "A file collection with identifiers and timestamps",
2350
+ "type": "object",
2351
+ "properties": {
2352
+ "slug": {
2353
+ "type": "string",
2354
+ "description": "Full slug for the collection. Format depends on collection type:\n- User collection: `_system_files_collection_{entity_uuid}_{user_id}:{collection_name}`\n Example: `_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents`\n- Global collection: `_system_files_collection_schema_{schema_slug}:{collection_name}`\n Example: `_system_files_collection_schema_opportunity:templates`\n",
2355
+ "example": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents"
2356
+ },
2357
+ "name": {
2358
+ "type": "string",
2359
+ "description": "Display name of the collection",
2360
+ "example": "Documents"
2361
+ },
2362
+ "id": {
2363
+ "$ref": "#/components/schemas/FileCollectionId"
2364
+ },
2365
+ "parents": {
2366
+ "type": "array",
2367
+ "description": "Array of parent collection slugs, empty array if top-level collection. Format depends on collection type:\n- User collection: `_system_files_collection_{entity_uuid}_{user_id}`\n Example: `[\"_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234\"]`\n- Global collection: `_system_files_collection_schema_{schema_slug}`\n Example: `[\"_system_files_collection_schema_opportunity\"]`\n",
2368
+ "items": {
2369
+ "type": "string"
2370
+ },
2371
+ "example": [
2372
+ "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"
2373
+ ]
2374
+ },
2375
+ "starred": {
2376
+ "type": "boolean",
2377
+ "description": "Whether the collection is starred / favorited",
2378
+ "example": false
2379
+ },
2380
+ "order": {
2381
+ "type": "number",
2382
+ "description": "Display order for the collection",
2383
+ "example": 0
2384
+ },
2385
+ "created_at": {
2386
+ "type": "string",
2387
+ "format": "date-time",
2388
+ "description": "Timestamp when the collection was created",
2389
+ "example": "2024-01-01T12:00:00Z"
2390
+ },
2391
+ "updated_at": {
2392
+ "type": "string",
2393
+ "format": "date-time",
2394
+ "description": "Timestamp when the collection was last updated",
2395
+ "example": "2024-01-02T12:00:00Z"
2396
+ }
2397
+ },
2398
+ "required": [
2399
+ "name"
2400
+ ]
2401
+ },
2402
+ "FileCollectionAttributes": {
2403
+ "type": "object",
2404
+ "properties": {
2405
+ "name": {
2406
+ "type": "string",
2407
+ "description": "Name of the collection"
2408
+ },
2409
+ "parents": {
2410
+ "type": "array",
2411
+ "description": "Array of parent collection slugs, empty array if top-level collection",
2412
+ "items": {
2413
+ "type": "string"
2414
+ }
2415
+ },
2416
+ "starred": {
2417
+ "type": "boolean",
2418
+ "description": "Whether the collection is starred / favorited",
2419
+ "default": false
2420
+ }
2421
+ }
2422
+ },
2423
+ "FileCollectionCreateRequest": {
2424
+ "description": "Request body for creating a file collection",
2425
+ "allOf": [
2426
+ {
2427
+ "$ref": "#/components/schemas/FileCollectionAttributes"
2428
+ },
2429
+ {
2430
+ "type": "object",
2431
+ "required": [
2432
+ "name"
2433
+ ]
2434
+ }
2435
+ ]
2003
2436
  }
2004
2437
  },
2005
2438
  "parameters": {
package/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "@epilot/file-client",
3
- "version": "1.16.1",
3
+ "version": "1.18.0",
4
4
  "description": "Client library for the epilot File API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "author": "epilot GmbH",
8
8
  "license": "MIT",
9
9
  "private": false,
10
+ "scripts": {
11
+ "test": "jest",
12
+ "typescript": "tsc",
13
+ "bundle-definition": "webpack",
14
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/file.yaml",
15
+ "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
16
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
17
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
18
+ "build:watch": "npm run build && tsc -w",
19
+ "prepublishOnly": "npm run typegen && npm run build",
20
+ "lint": "pnpm exec eslint src"
21
+ },
10
22
  "repository": {
11
23
  "type": "git",
12
24
  "url": "git+https://github.com/epilot-dev/sdk-js.git",
@@ -59,16 +71,5 @@
59
71
  "webpack": "^5.18.0",
60
72
  "webpack-cli": "^4.4.0"
61
73
  },
62
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7",
63
- "scripts": {
64
- "test": "jest",
65
- "typescript": "tsc",
66
- "bundle-definition": "webpack",
67
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/file.yaml",
68
- "typegen": "openapi typegen src/openapi.json --client -b '/* eslint-disable */' > src/openapi.d.ts",
69
- "build": "tsc && npm run build:patch && npm run bundle-definition",
70
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
71
- "build:watch": "npm run build && tsc -w",
72
- "lint": "pnpm exec eslint src"
73
- }
74
- }
74
+ "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
75
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 epilot GmbH
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.