@epilot/file-client 1.17.0 → 1.19.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.1.1",
5
+ "version": "1.4.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
  ],
@@ -1336,7 +1346,8 @@
1336
1346
  "get": {
1337
1347
  "operationId": "getGlobalFileFolders",
1338
1348
  "summary": "getGlobalFileFolders",
1339
- "description": "Gets all global file folders for a specific schema",
1349
+ "deprecated": true,
1350
+ "description": "Gets all global file folders for a specific schema. Deprecated - use getGlobalFileCollections instead.",
1340
1351
  "tags": [
1341
1352
  "File Folders"
1342
1353
  ],
@@ -1368,6 +1379,459 @@
1368
1379
  }
1369
1380
  }
1370
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
+ "deprecated": true,
1389
+ "tags": [
1390
+ "File Collections"
1391
+ ],
1392
+ "parameters": [
1393
+ {
1394
+ "$ref": "#/components/parameters/EntityIdPathParam"
1395
+ },
1396
+ {
1397
+ "name": "parents",
1398
+ "in": "query",
1399
+ "description": "Optional array of parent collection slugs to filter by",
1400
+ "required": false,
1401
+ "schema": {
1402
+ "type": "array",
1403
+ "items": {
1404
+ "type": "string"
1405
+ }
1406
+ },
1407
+ "style": "form",
1408
+ "explode": true
1409
+ }
1410
+ ],
1411
+ "responses": {
1412
+ "200": {
1413
+ "description": "List of collections for the entity",
1414
+ "content": {
1415
+ "application/json": {
1416
+ "schema": {
1417
+ "type": "array",
1418
+ "items": {
1419
+ "$ref": "#/components/schemas/FileCollectionItem"
1420
+ }
1421
+ }
1422
+ }
1423
+ }
1424
+ },
1425
+ "404": {
1426
+ "$ref": "#/components/responses/NotFoundError"
1427
+ }
1428
+ }
1429
+ },
1430
+ "post": {
1431
+ "operationId": "createFileCollection",
1432
+ "summary": "createFileCollection",
1433
+ "description": "Creates a new file collection for the specified entity",
1434
+ "deprecated": true,
1435
+ "tags": [
1436
+ "File Collections"
1437
+ ],
1438
+ "parameters": [
1439
+ {
1440
+ "$ref": "#/components/parameters/EntityIdPathParam"
1441
+ }
1442
+ ],
1443
+ "requestBody": {
1444
+ "required": true,
1445
+ "content": {
1446
+ "application/json": {
1447
+ "schema": {
1448
+ "$ref": "#/components/schemas/FileCollectionCreateRequest"
1449
+ }
1450
+ }
1451
+ }
1452
+ },
1453
+ "responses": {
1454
+ "201": {
1455
+ "description": "File collection created successfully",
1456
+ "content": {
1457
+ "application/json": {
1458
+ "schema": {
1459
+ "$ref": "#/components/schemas/FileCollectionItem"
1460
+ }
1461
+ }
1462
+ }
1463
+ },
1464
+ "404": {
1465
+ "$ref": "#/components/responses/NotFoundError"
1466
+ }
1467
+ }
1468
+ }
1469
+ },
1470
+ "/v1/entity/{id}/collections/{collectionSlug}": {
1471
+ "put": {
1472
+ "operationId": "updateFileCollection",
1473
+ "summary": "updateFileCollection",
1474
+ "description": "Updates a file collection for the specified entity",
1475
+ "deprecated": true,
1476
+ "tags": [
1477
+ "File Collections"
1478
+ ],
1479
+ "parameters": [
1480
+ {
1481
+ "$ref": "#/components/parameters/EntityIdPathParam"
1482
+ },
1483
+ {
1484
+ "name": "collectionSlug",
1485
+ "in": "path",
1486
+ "required": true,
1487
+ "description": "The slug identifier for the collection",
1488
+ "schema": {
1489
+ "type": "string",
1490
+ "example": "documents"
1491
+ }
1492
+ }
1493
+ ],
1494
+ "requestBody": {
1495
+ "required": true,
1496
+ "content": {
1497
+ "application/json": {
1498
+ "schema": {
1499
+ "$ref": "#/components/schemas/FileCollectionAttributes"
1500
+ }
1501
+ }
1502
+ }
1503
+ },
1504
+ "responses": {
1505
+ "200": {
1506
+ "description": "File collection updated successfully",
1507
+ "content": {
1508
+ "application/json": {
1509
+ "schema": {
1510
+ "$ref": "#/components/schemas/FileCollectionItem"
1511
+ }
1512
+ }
1513
+ }
1514
+ },
1515
+ "404": {
1516
+ "$ref": "#/components/responses/NotFoundError"
1517
+ }
1518
+ }
1519
+ },
1520
+ "delete": {
1521
+ "operationId": "deleteFileCollection",
1522
+ "summary": "deleteFileCollection",
1523
+ "description": "Deletes a file collection for the specified entity",
1524
+ "deprecated": true,
1525
+ "tags": [
1526
+ "File Collections"
1527
+ ],
1528
+ "parameters": [
1529
+ {
1530
+ "$ref": "#/components/parameters/EntityIdPathParam"
1531
+ },
1532
+ {
1533
+ "name": "collectionSlug",
1534
+ "in": "path",
1535
+ "required": true,
1536
+ "description": "The slug identifier for the collection",
1537
+ "schema": {
1538
+ "type": "string",
1539
+ "example": "documents"
1540
+ }
1541
+ }
1542
+ ],
1543
+ "responses": {
1544
+ "200": {
1545
+ "description": "File collection deleted successfully"
1546
+ },
1547
+ "404": {
1548
+ "$ref": "#/components/responses/NotFoundError"
1549
+ }
1550
+ }
1551
+ }
1552
+ },
1553
+ "/v1/{slug}/collections": {
1554
+ "get": {
1555
+ "operationId": "getUserSchemaFileCollections",
1556
+ "summary": "getUserSchemaFileCollections",
1557
+ "description": "Gets a list of file collections for the current user and schema",
1558
+ "tags": [
1559
+ "File Collections"
1560
+ ],
1561
+ "parameters": [
1562
+ {
1563
+ "name": "slug",
1564
+ "in": "path",
1565
+ "required": true,
1566
+ "description": "The schema slug (e.g., order, opportunity)",
1567
+ "schema": {
1568
+ "type": "string",
1569
+ "example": "opportunity"
1570
+ }
1571
+ }
1572
+ ],
1573
+ "responses": {
1574
+ "200": {
1575
+ "description": "List of collections for the user and schema",
1576
+ "content": {
1577
+ "application/json": {
1578
+ "schema": {
1579
+ "type": "array",
1580
+ "items": {
1581
+ "$ref": "#/components/schemas/FileCollectionItem"
1582
+ }
1583
+ }
1584
+ }
1585
+ }
1586
+ }
1587
+ }
1588
+ },
1589
+ "post": {
1590
+ "operationId": "createUserSchemaFileCollection",
1591
+ "summary": "createUserSchemaFileCollection",
1592
+ "description": "Creates a new file collection for the current user and schema",
1593
+ "tags": [
1594
+ "File Collections"
1595
+ ],
1596
+ "parameters": [
1597
+ {
1598
+ "name": "slug",
1599
+ "in": "path",
1600
+ "required": true,
1601
+ "description": "The schema slug (e.g., order, opportunity)",
1602
+ "schema": {
1603
+ "type": "string",
1604
+ "example": "opportunity"
1605
+ }
1606
+ }
1607
+ ],
1608
+ "requestBody": {
1609
+ "required": true,
1610
+ "content": {
1611
+ "application/json": {
1612
+ "schema": {
1613
+ "$ref": "#/components/schemas/FileCollectionCreateRequest"
1614
+ }
1615
+ }
1616
+ }
1617
+ },
1618
+ "responses": {
1619
+ "201": {
1620
+ "description": "File collection created successfully",
1621
+ "content": {
1622
+ "application/json": {
1623
+ "schema": {
1624
+ "$ref": "#/components/schemas/FileCollectionItem"
1625
+ }
1626
+ }
1627
+ }
1628
+ }
1629
+ }
1630
+ }
1631
+ },
1632
+ "/v1/{slug}/collections/{collectionSlug}": {
1633
+ "put": {
1634
+ "operationId": "updateUserSchemaFileCollection",
1635
+ "summary": "updateUserSchemaFileCollection",
1636
+ "description": "Updates a file collection for the current user and schema",
1637
+ "tags": [
1638
+ "File Collections"
1639
+ ],
1640
+ "parameters": [
1641
+ {
1642
+ "name": "slug",
1643
+ "in": "path",
1644
+ "required": true,
1645
+ "description": "The schema slug (e.g., order, opportunity)",
1646
+ "schema": {
1647
+ "type": "string",
1648
+ "example": "opportunity"
1649
+ }
1650
+ },
1651
+ {
1652
+ "name": "collectionSlug",
1653
+ "in": "path",
1654
+ "required": true,
1655
+ "description": "The slug identifier for the collection",
1656
+ "schema": {
1657
+ "type": "string",
1658
+ "example": "documents"
1659
+ }
1660
+ }
1661
+ ],
1662
+ "requestBody": {
1663
+ "required": true,
1664
+ "content": {
1665
+ "application/json": {
1666
+ "schema": {
1667
+ "$ref": "#/components/schemas/FileCollectionAttributes"
1668
+ }
1669
+ }
1670
+ }
1671
+ },
1672
+ "responses": {
1673
+ "200": {
1674
+ "description": "File collection updated successfully",
1675
+ "content": {
1676
+ "application/json": {
1677
+ "schema": {
1678
+ "$ref": "#/components/schemas/FileCollectionItem"
1679
+ }
1680
+ }
1681
+ }
1682
+ },
1683
+ "404": {
1684
+ "$ref": "#/components/responses/NotFoundError"
1685
+ }
1686
+ }
1687
+ },
1688
+ "delete": {
1689
+ "operationId": "deleteUserSchemaFileCollection",
1690
+ "summary": "deleteUserSchemaFileCollection",
1691
+ "description": "Deletes a file collection for the current user and schema",
1692
+ "tags": [
1693
+ "File Collections"
1694
+ ],
1695
+ "parameters": [
1696
+ {
1697
+ "name": "slug",
1698
+ "in": "path",
1699
+ "required": true,
1700
+ "description": "The schema slug (e.g., order, opportunity)",
1701
+ "schema": {
1702
+ "type": "string",
1703
+ "example": "opportunity"
1704
+ }
1705
+ },
1706
+ {
1707
+ "name": "collectionSlug",
1708
+ "in": "path",
1709
+ "required": true,
1710
+ "description": "The slug identifier for the collection",
1711
+ "schema": {
1712
+ "type": "string",
1713
+ "example": "documents"
1714
+ }
1715
+ }
1716
+ ],
1717
+ "responses": {
1718
+ "200": {
1719
+ "description": "File collection deleted successfully"
1720
+ },
1721
+ "404": {
1722
+ "$ref": "#/components/responses/NotFoundError"
1723
+ }
1724
+ }
1725
+ }
1726
+ },
1727
+ "/v1/entity/{id}/collections/{collectionSlug}/files": {
1728
+ "get": {
1729
+ "operationId": "getFilesInCollection",
1730
+ "summary": "getFilesInCollection",
1731
+ "description": "Gets all files within a specific collection for an entity (uses schema-based taxonomy derived from entity)",
1732
+ "tags": [
1733
+ "File Collections"
1734
+ ],
1735
+ "parameters": [
1736
+ {
1737
+ "$ref": "#/components/parameters/EntityIdPathParam"
1738
+ },
1739
+ {
1740
+ "name": "collectionSlug",
1741
+ "in": "path",
1742
+ "required": true,
1743
+ "description": "The slug identifier for the collection",
1744
+ "schema": {
1745
+ "type": "string",
1746
+ "example": "documents"
1747
+ }
1748
+ }
1749
+ ],
1750
+ "responses": {
1751
+ "200": {
1752
+ "description": "List of files in the collection",
1753
+ "content": {
1754
+ "application/json": {
1755
+ "schema": {
1756
+ "type": "array",
1757
+ "items": {
1758
+ "$ref": "#/components/schemas/FileEntity"
1759
+ }
1760
+ }
1761
+ }
1762
+ }
1763
+ },
1764
+ "403": {
1765
+ "description": "User must have permission to view this entity to access its files",
1766
+ "content": {
1767
+ "application/json": {
1768
+ "schema": {
1769
+ "type": "object",
1770
+ "properties": {
1771
+ "error": {
1772
+ "type": "string",
1773
+ "example": "User must have permission to view this entity to access its files"
1774
+ }
1775
+ }
1776
+ }
1777
+ }
1778
+ }
1779
+ },
1780
+ "404": {
1781
+ "description": "Entity or collection not found",
1782
+ "content": {
1783
+ "application/json": {
1784
+ "schema": {
1785
+ "type": "object",
1786
+ "properties": {
1787
+ "error": {
1788
+ "type": "string",
1789
+ "example": "Entity not found"
1790
+ }
1791
+ }
1792
+ }
1793
+ }
1794
+ }
1795
+ }
1796
+ }
1797
+ }
1798
+ },
1799
+ "/v1/collections/{schemaSlug}": {
1800
+ "get": {
1801
+ "operationId": "getGlobalFileCollections",
1802
+ "summary": "getGlobalFileCollections",
1803
+ "description": "Gets all global file collections for a specific schema",
1804
+ "tags": [
1805
+ "File Collections"
1806
+ ],
1807
+ "parameters": [
1808
+ {
1809
+ "name": "schemaSlug",
1810
+ "in": "path",
1811
+ "required": true,
1812
+ "description": "The schema slug (e.g., order, opportunity)",
1813
+ "schema": {
1814
+ "type": "string",
1815
+ "example": "order"
1816
+ }
1817
+ }
1818
+ ],
1819
+ "responses": {
1820
+ "200": {
1821
+ "description": "List of global collections for the schema",
1822
+ "content": {
1823
+ "application/json": {
1824
+ "schema": {
1825
+ "type": "array",
1826
+ "items": {
1827
+ "$ref": "#/components/schemas/FileCollectionItem"
1828
+ }
1829
+ }
1830
+ }
1831
+ }
1832
+ }
1833
+ }
1834
+ }
1371
1835
  }
1372
1836
  },
1373
1837
  "components": {
@@ -1402,7 +1866,18 @@
1402
1866
  "example": "01F130Q52Q6MWSNS8N2AVXV4JN"
1403
1867
  },
1404
1868
  "FileEntityId": {
1405
- "type": "string",
1869
+ "oneOf": [
1870
+ {
1871
+ "type": "string",
1872
+ "maxLength": 0,
1873
+ "description": "Empty string (used when file ID not yet assigned)"
1874
+ },
1875
+ {
1876
+ "type": "string",
1877
+ "format": "uuid",
1878
+ "description": "Valid UUID v4"
1879
+ }
1880
+ ],
1406
1881
  "example": "ef7d985c-2385-44f4-9c71-ae06a52264f8"
1407
1882
  },
1408
1883
  "FileAttributes": {
@@ -1944,8 +2419,8 @@
1944
2419
  "properties": {
1945
2420
  "slug": {
1946
2421
  "type": "string",
1947
- "description": "Full slug for the folder",
1948
- "example": "_system_files_collection_entity-123:documents"
2422
+ "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",
2423
+ "example": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents"
1949
2424
  },
1950
2425
  "name": {
1951
2426
  "type": "string",
@@ -1957,12 +2432,12 @@
1957
2432
  },
1958
2433
  "parents": {
1959
2434
  "type": "array",
1960
- "description": "Array of parent folder slugs, empty array if top-level folder",
2435
+ "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",
1961
2436
  "items": {
1962
2437
  "type": "string"
1963
2438
  },
1964
2439
  "example": [
1965
- "_system_files_collection_entity-123"
2440
+ "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"
1966
2441
  ]
1967
2442
  },
1968
2443
  "starred": {
@@ -2042,6 +2517,100 @@
2042
2517
  ]
2043
2518
  }
2044
2519
  ]
2520
+ },
2521
+ "FileCollectionId": {
2522
+ "description": "Generated uuid for a file collection",
2523
+ "type": "string",
2524
+ "format": "uuid"
2525
+ },
2526
+ "FileCollectionItem": {
2527
+ "description": "A file collection with identifiers and timestamps",
2528
+ "type": "object",
2529
+ "properties": {
2530
+ "slug": {
2531
+ "type": "string",
2532
+ "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",
2533
+ "example": "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234:documents"
2534
+ },
2535
+ "name": {
2536
+ "type": "string",
2537
+ "description": "Display name of the collection",
2538
+ "example": "Documents"
2539
+ },
2540
+ "id": {
2541
+ "$ref": "#/components/schemas/FileCollectionId"
2542
+ },
2543
+ "parents": {
2544
+ "type": "array",
2545
+ "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",
2546
+ "items": {
2547
+ "type": "string"
2548
+ },
2549
+ "example": [
2550
+ "_system_files_collection_3fa85f64-5717-4562-b3fc-2c963f66afa6_10234"
2551
+ ]
2552
+ },
2553
+ "starred": {
2554
+ "type": "boolean",
2555
+ "description": "Whether the collection is starred / favorited",
2556
+ "example": false
2557
+ },
2558
+ "order": {
2559
+ "type": "number",
2560
+ "description": "Display order for the collection",
2561
+ "example": 0
2562
+ },
2563
+ "created_at": {
2564
+ "type": "string",
2565
+ "format": "date-time",
2566
+ "description": "Timestamp when the collection was created",
2567
+ "example": "2024-01-01T12:00:00Z"
2568
+ },
2569
+ "updated_at": {
2570
+ "type": "string",
2571
+ "format": "date-time",
2572
+ "description": "Timestamp when the collection was last updated",
2573
+ "example": "2024-01-02T12:00:00Z"
2574
+ }
2575
+ },
2576
+ "required": [
2577
+ "name"
2578
+ ]
2579
+ },
2580
+ "FileCollectionAttributes": {
2581
+ "type": "object",
2582
+ "properties": {
2583
+ "name": {
2584
+ "type": "string",
2585
+ "description": "Name of the collection"
2586
+ },
2587
+ "parents": {
2588
+ "type": "array",
2589
+ "description": "Array of parent collection slugs, empty array if top-level collection",
2590
+ "items": {
2591
+ "type": "string"
2592
+ }
2593
+ },
2594
+ "starred": {
2595
+ "type": "boolean",
2596
+ "description": "Whether the collection is starred / favorited",
2597
+ "default": false
2598
+ }
2599
+ }
2600
+ },
2601
+ "FileCollectionCreateRequest": {
2602
+ "description": "Request body for creating a file collection",
2603
+ "allOf": [
2604
+ {
2605
+ "$ref": "#/components/schemas/FileCollectionAttributes"
2606
+ },
2607
+ {
2608
+ "type": "object",
2609
+ "required": [
2610
+ "name"
2611
+ ]
2612
+ }
2613
+ ]
2045
2614
  }
2046
2615
  },
2047
2616
  "parameters": {