@epilot/sdk 2.20.22 → 2.20.24

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.
Files changed (142) hide show
  1. package/definitions/automation-runtime.json +1 -1
  2. package/definitions/automation.json +207 -2
  3. package/definitions/entity-mapping.json +23 -0
  4. package/dist/README-7F36AG5O.js +7 -0
  5. package/dist/README-I7JMAFA4.cjs +7 -0
  6. package/dist/apis/access-token.cjs +6 -6
  7. package/dist/apis/access-token.js +1 -1
  8. package/dist/apis/address-suggestions.cjs +6 -6
  9. package/dist/apis/address-suggestions.js +1 -1
  10. package/dist/apis/address.cjs +6 -6
  11. package/dist/apis/address.js +1 -1
  12. package/dist/apis/ai-agents.cjs +6 -6
  13. package/dist/apis/ai-agents.js +1 -1
  14. package/dist/apis/app.cjs +6 -6
  15. package/dist/apis/app.js +1 -1
  16. package/dist/apis/audit-logs.cjs +6 -6
  17. package/dist/apis/audit-logs.js +1 -1
  18. package/dist/apis/automation.cjs +8 -8
  19. package/dist/apis/automation.d.cts +2 -2
  20. package/dist/apis/automation.d.ts +2 -2
  21. package/dist/apis/automation.js +2 -2
  22. package/dist/apis/billing.cjs +6 -6
  23. package/dist/apis/billing.js +1 -1
  24. package/dist/apis/blueprint-manifest.cjs +6 -6
  25. package/dist/apis/blueprint-manifest.js +1 -1
  26. package/dist/apis/calendar.cjs +6 -6
  27. package/dist/apis/calendar.js +1 -1
  28. package/dist/apis/chat.cjs +6 -6
  29. package/dist/apis/chat.js +1 -1
  30. package/dist/apis/configuration-hub.cjs +6 -6
  31. package/dist/apis/configuration-hub.js +1 -1
  32. package/dist/apis/consent.cjs +6 -6
  33. package/dist/apis/consent.js +1 -1
  34. package/dist/apis/customer-portal.cjs +6 -6
  35. package/dist/apis/customer-portal.js +1 -1
  36. package/dist/apis/dashboard.cjs +6 -6
  37. package/dist/apis/dashboard.js +1 -1
  38. package/dist/apis/data-governance.cjs +6 -6
  39. package/dist/apis/data-governance.js +1 -1
  40. package/dist/apis/deduplication.cjs +6 -6
  41. package/dist/apis/deduplication.js +1 -1
  42. package/dist/apis/design.cjs +6 -6
  43. package/dist/apis/design.js +1 -1
  44. package/dist/apis/document.cjs +6 -6
  45. package/dist/apis/document.js +1 -1
  46. package/dist/apis/email-settings.cjs +6 -6
  47. package/dist/apis/email-settings.js +1 -1
  48. package/dist/apis/email-template.cjs +6 -6
  49. package/dist/apis/email-template.js +1 -1
  50. package/dist/apis/entity-mapping.cjs +6 -6
  51. package/dist/apis/entity-mapping.d.cts +2 -2
  52. package/dist/apis/entity-mapping.d.ts +2 -2
  53. package/dist/apis/entity-mapping.js +1 -1
  54. package/dist/apis/entity.cjs +6 -6
  55. package/dist/apis/entity.js +1 -1
  56. package/dist/apis/environments.cjs +6 -6
  57. package/dist/apis/environments.js +1 -1
  58. package/dist/apis/event-catalog.cjs +6 -6
  59. package/dist/apis/event-catalog.js +1 -1
  60. package/dist/apis/file.cjs +6 -6
  61. package/dist/apis/file.js +1 -1
  62. package/dist/apis/iban.cjs +6 -6
  63. package/dist/apis/iban.js +1 -1
  64. package/dist/apis/integration-toolkit.cjs +6 -6
  65. package/dist/apis/integration-toolkit.js +1 -1
  66. package/dist/apis/journey.cjs +6 -6
  67. package/dist/apis/journey.js +1 -1
  68. package/dist/apis/kanban.cjs +6 -6
  69. package/dist/apis/kanban.js +1 -1
  70. package/dist/apis/message.cjs +6 -6
  71. package/dist/apis/message.js +1 -1
  72. package/dist/apis/metering.cjs +6 -6
  73. package/dist/apis/metering.js +1 -1
  74. package/dist/apis/notes.cjs +6 -6
  75. package/dist/apis/notes.js +1 -1
  76. package/dist/apis/notification.cjs +6 -6
  77. package/dist/apis/notification.js +1 -1
  78. package/dist/apis/organization.cjs +6 -6
  79. package/dist/apis/organization.js +1 -1
  80. package/dist/apis/partner-directory.cjs +6 -6
  81. package/dist/apis/partner-directory.js +1 -1
  82. package/dist/apis/permissions.cjs +6 -6
  83. package/dist/apis/permissions.js +1 -1
  84. package/dist/apis/pricing-tier.cjs +6 -6
  85. package/dist/apis/pricing-tier.js +1 -1
  86. package/dist/apis/pricing.cjs +6 -6
  87. package/dist/apis/pricing.js +1 -1
  88. package/dist/apis/purpose.cjs +6 -6
  89. package/dist/apis/purpose.js +1 -1
  90. package/dist/apis/query.cjs +6 -6
  91. package/dist/apis/query.js +1 -1
  92. package/dist/apis/sandbox.cjs +6 -6
  93. package/dist/apis/sandbox.js +1 -1
  94. package/dist/apis/sharing.cjs +6 -6
  95. package/dist/apis/sharing.js +1 -1
  96. package/dist/apis/snapshot.cjs +6 -6
  97. package/dist/apis/snapshot.js +1 -1
  98. package/dist/apis/submission.cjs +6 -6
  99. package/dist/apis/submission.js +1 -1
  100. package/dist/apis/target.cjs +6 -6
  101. package/dist/apis/target.js +1 -1
  102. package/dist/apis/targeting.cjs +6 -6
  103. package/dist/apis/targeting.js +1 -1
  104. package/dist/apis/template-variables.cjs +6 -6
  105. package/dist/apis/template-variables.js +1 -1
  106. package/dist/apis/user.cjs +6 -6
  107. package/dist/apis/user.js +1 -1
  108. package/dist/apis/validation-rules.cjs +6 -6
  109. package/dist/apis/validation-rules.js +1 -1
  110. package/dist/apis/webhooks.cjs +6 -6
  111. package/dist/apis/webhooks.js +1 -1
  112. package/dist/apis/workflow-definition.cjs +6 -6
  113. package/dist/apis/workflow-definition.js +1 -1
  114. package/dist/apis/workflow.cjs +6 -6
  115. package/dist/apis/workflow.js +1 -1
  116. package/dist/automation-CDMOEYVP.cjs +7 -0
  117. package/dist/automation-XFMSH7Y3.js +7 -0
  118. package/dist/{automation-runtime-RM5EOZH2.cjs → automation-runtime-KLCXZKEC.cjs} +2 -2
  119. package/dist/{automation-runtime-ORW5BVCD.js → automation-runtime-Y52HM57N.js} +1 -1
  120. package/dist/{automation.d-Bp45eKlU.d.cts → automation.d-2biAmiMc.d.cts} +214 -6
  121. package/dist/{automation.d-Bp45eKlU.d.ts → automation.d-2biAmiMc.d.ts} +214 -6
  122. package/dist/{chunk-R6RAUX3Z.js → chunk-5D6VD6OZ.js} +4 -4
  123. package/dist/{chunk-4GR5MDWN.cjs → chunk-B43U4DLU.cjs} +4 -4
  124. package/dist/chunk-QW3ROE6H.js +14 -0
  125. package/dist/chunk-WOUASZJW.cjs +14 -0
  126. package/dist/{entity-mapping-D67LJE74.js → entity-mapping-CBRH3VBZ.js} +1 -1
  127. package/dist/{entity-mapping-WFPSOXRK.cjs → entity-mapping-WE3QMZWA.cjs} +1 -1
  128. package/dist/{entity-mapping.d-CQv75o8M.d.ts → entity-mapping.d-8MtWa2_L.d.cts} +22 -0
  129. package/dist/{entity-mapping.d-CQv75o8M.d.cts → entity-mapping.d-8MtWa2_L.d.ts} +22 -0
  130. package/dist/index.cjs +10 -10
  131. package/dist/index.d.cts +2 -2
  132. package/dist/index.d.ts +2 -2
  133. package/dist/index.js +2 -2
  134. package/docs/automation.md +99 -17
  135. package/docs/entity-mapping.md +19 -0
  136. package/package.json +1 -1
  137. package/dist/README-NBWAQWQS.js +0 -7
  138. package/dist/README-XCIDDEAE.cjs +0 -7
  139. package/dist/automation-FTFGFHT7.cjs +0 -7
  140. package/dist/automation-HJGT6QK5.js +0 -7
  141. package/dist/chunk-ADSWGLIV.cjs +0 -14
  142. package/dist/chunk-LCE7N4ZL.js +0 -14
@@ -146,6 +146,8 @@ const { data } = await automationClient.searchFlows(...)
146
146
  - [`TriggerEventEntityActivity`](#triggerevententityactivity)
147
147
  - [`TriggerEventMessaging`](#triggereventmessaging)
148
148
  - [`TriggerEventEntityOperation`](#triggerevententityoperation)
149
+ - [`TriggerEventEventCatalog`](#triggereventeventcatalog)
150
+ - [`TriggerEventPayloadRef`](#triggereventpayloadref)
149
151
  - [`ApiCallerContext`](#apicallercontext)
150
152
  - [`ExecutionStatus`](#executionstatus)
151
153
  - [`GetExecutionsResp`](#getexecutionsresp)
@@ -175,6 +177,7 @@ const { data } = await automationClient.searchFlows(...)
175
177
  - [`EntitySearchFilter`](#entitysearchfilter)
176
178
  - [`EntitySearchFilterValue`](#entitysearchfiltervalue)
177
179
  - [`EntityManualTrigger`](#entitymanualtrigger)
180
+ - [`EventCatalogTrigger`](#eventcatalogtrigger)
178
181
  - [`TriggerCondition`](#triggercondition)
179
182
  - [`Comparison`](#comparison)
180
183
  - [`FilterConditionOnEvent`](#filterconditiononevent)
@@ -210,6 +213,7 @@ const { data } = await client.searchFlows({
210
213
  from: 1,
211
214
  trigger_source_id: 'example',
212
215
  target_workflow: 'example',
216
+ trigger_event_name: 'example',
213
217
  include_flows: true,
214
218
  })
215
219
  ```
@@ -506,6 +510,7 @@ const { data } = await client.startExecution(
506
510
  "id": "loop_contracts",
507
511
  "source_path": "submission.steps[0]['Contracts']",
508
512
  "source_type": "journey-multi-select",
513
+ "filter_tags": ["_hidden_ 2a4b1c3d-0000-4000-8000-000000000000 - Dokumente"],
509
514
  "length": 0
510
515
  }
511
516
  ],
@@ -879,6 +884,7 @@ const { data } = await client.getExecution({
879
884
  "id": "loop_contracts",
880
885
  "source_path": "submission.steps[0]['Contracts']",
881
886
  "source_type": "journey-multi-select",
887
+ "filter_tags": ["_hidden_ 2a4b1c3d-0000-4000-8000-000000000000 - Dokumente"],
882
888
  "length": 0
883
889
  }
884
890
  ],
@@ -1030,6 +1036,7 @@ const { data } = await client.cancelExecution({
1030
1036
  "id": "loop_contracts",
1031
1037
  "source_path": "submission.steps[0]['Contracts']",
1032
1038
  "source_type": "journey-multi-select",
1039
+ "filter_tags": ["_hidden_ 2a4b1c3d-0000-4000-8000-000000000000 - Dokumente"],
1033
1040
  "length": 0
1034
1041
  }
1035
1042
  ],
@@ -1316,6 +1323,16 @@ type AutomationFlow = {
1316
1323
  configuration?: {
1317
1324
  journey_id?: { ... }
1318
1325
  }
1326
+ } | {
1327
+ id?: string // uuid
1328
+ type: "event_catalog"
1329
+ configuration: {
1330
+ event_name: { ... }
1331
+ event_version: { ... }
1332
+ entity_node_id: { ... }
1333
+ entity_schema: { ... }
1334
+ ignore_automation_triggered?: { ... }
1335
+ }
1319
1336
  }>
1320
1337
  trigger_conditions?: Array<{
1321
1338
  source: string
@@ -1336,16 +1353,6 @@ type AutomationFlow = {
1336
1353
  allow_failure?: boolean
1337
1354
  statements?: Array<{
1338
1355
  id?: { ... }
1339
- source?: { ... }
1340
- operation?: { ... }
1341
- values?: { ... }
1342
- }>
1343
- }>
1344
- schedules?: Array<{
1345
- id: string
1346
- scheduleApiId?: string
1347
- numberOfUnits?: number
1348
- timePeriod?: "minutes" | "hours" | "days" | "weeks" | "months"
1349
1356
  // ...
1350
1357
  }
1351
1358
  ```
@@ -1408,6 +1415,10 @@ type SearchAutomationsResp = {
1408
1415
  id?: { ... }
1409
1416
  type: { ... }
1410
1417
  configuration?: { ... }
1418
+ } | {
1419
+ id?: { ... }
1420
+ type: { ... }
1421
+ configuration: { ... }
1411
1422
  }>
1412
1423
  trigger_conditions?: Array<{
1413
1424
  source: { ... }
@@ -1436,6 +1447,7 @@ type SearchAutomationsResp = {
1436
1447
  id: { ... }
1437
1448
  source_path: { ... }
1438
1449
  source_type?: { ... }
1450
+ filter_tags?: { ... }
1439
1451
  length?: { ... }
1440
1452
  }>
1441
1453
  actions: Array<{
@@ -1456,11 +1468,6 @@ type SearchAutomationsResp = {
1456
1468
  } | {
1457
1469
  type?: { ... }
1458
1470
  config?: { ... }
1459
- } | {
1460
- type?: { ... }
1461
- config?: { ... }
1462
- } | {
1463
- type?: { ... }
1464
1471
  // ...
1465
1472
  }
1466
1473
  ```
@@ -1536,6 +1543,16 @@ type AnyTrigger = {
1536
1543
  configuration?: {
1537
1544
  journey_id?: string // uuid
1538
1545
  }
1546
+ } | {
1547
+ id?: string // uuid
1548
+ type: "event_catalog"
1549
+ configuration: {
1550
+ event_name: string
1551
+ event_version: string
1552
+ entity_node_id: string
1553
+ entity_schema: string
1554
+ ignore_automation_triggered?: boolean
1555
+ }
1539
1556
  }
1540
1557
  ```
1541
1558
 
@@ -1783,7 +1800,8 @@ A loop scope on an automation flow.
1783
1800
  type AutomationLoop = {
1784
1801
  id: string
1785
1802
  source_path: string
1786
- source_type?: "journey-multi-select" | "previous-action-outputs" | "entity-relation"
1803
+ source_type?: "journey-multi-select" | "journey-file-upload" | "previous-action-outputs" | "entity-relation"
1804
+ filter_tags?: string[]
1787
1805
  length?: number
1788
1806
  }
1789
1807
  ```
@@ -2598,6 +2616,9 @@ type AssignEntityConfig = {
2598
2616
  attribute?: string
2599
2617
  values?: string[]
2600
2618
  }
2619
+ match_user_skills?: boolean
2620
+ required_skill_categories?: string[]
2621
+ skill_match_mode?: "require_all" | "prefer"
2601
2622
  fallback?: "leave_unassigned" | "assign_to_fallback"
2602
2623
  fallback_assignees?: Array<{
2603
2624
  type: "user" | "partner_user" | "partner_organization" | "group"
@@ -2651,6 +2672,9 @@ type AssignEntityActionConfig = {
2651
2672
  attribute?: { ... }
2652
2673
  values?: { ... }
2653
2674
  }
2675
+ match_user_skills?: boolean
2676
+ required_skill_categories?: string[]
2677
+ skill_match_mode?: "require_all" | "prefer"
2654
2678
  fallback?: "leave_unassigned" | "assign_to_fallback"
2655
2679
  fallback_assignees?: Array<{
2656
2680
  type: { ... }
@@ -2712,6 +2736,9 @@ type AssignEntityAction = {
2712
2736
  attribute?: { ... }
2713
2737
  values?: { ... }
2714
2738
  }
2739
+ match_user_skills?: boolean
2740
+ required_skill_categories?: string[]
2741
+ skill_match_mode?: "require_all" | "prefer"
2715
2742
  fallback?: "leave_unassigned" | "assign_to_fallback"
2716
2743
  fallback_assignees?: Array<{
2717
2744
  type: { ... }
@@ -3395,7 +3422,7 @@ type ConditionStatement = {
3395
3422
  source?: {
3396
3423
  id?: string
3397
3424
  origin?: "trigger" | "action"
3398
- originType?: "entity" | "workflow" | "journey_block"
3425
+ originType?: "entity" | "workflow" | "journey_block" | "event"
3399
3426
  schema?: string
3400
3427
  attribute?: string
3401
3428
  attributeType?: "string" | "text" | "number" | "boolean" | "date" | "datetime" | "tags" | "country" | "email" | "phone" | "product" | "price" | "status" | "relation" | "multiselect" | "select" | "radio" | "relation_user" | "purpose" | "label" | "payment" | "relation_payment_method"
@@ -3717,6 +3744,42 @@ type TriggerEventEntityOperation = {
3717
3744
  }
3718
3745
  ```
3719
3746
 
3747
+ ### `TriggerEventEventCatalog`
3748
+
3749
+ Set on executions started by an Event Catalog event (see EventCatalogTrigger). The full event payload is not stored inline (it may be up to 256 KB) but by reference in `payload_ref`; automation workers hydrate it before every action.
3750
+
3751
+
3752
+ ```ts
3753
+ type TriggerEventEventCatalog = {
3754
+ type: "event_catalog"
3755
+ org_id: string
3756
+ entity_id: string
3757
+ entity_node_id: string
3758
+ event_id: string
3759
+ event_name: string
3760
+ event_version: string
3761
+ published_version?: string
3762
+ event_time?: string // date-time
3763
+ trigger_source_type?: string
3764
+ trigger_source?: string
3765
+ payload_ref?: {
3766
+ bucket: string
3767
+ key: string
3768
+ }
3769
+ }
3770
+ ```
3771
+
3772
+ ### `TriggerEventPayloadRef`
3773
+
3774
+ S3 reference to the stored trigger event payload (`_downgrades` stripped, downgraded to the pinned version)
3775
+
3776
+ ```ts
3777
+ type TriggerEventPayloadRef = {
3778
+ bucket: string
3779
+ key: string
3780
+ }
3781
+ ```
3782
+
3720
3783
  ### `ApiCallerContext`
3721
3784
 
3722
3785
  ```ts
@@ -4438,6 +4501,25 @@ type EntityManualTrigger = {
4438
4501
  }
4439
4502
  ```
4440
4503
 
4504
+ ### `EventCatalogTrigger`
4505
+
4506
+ Starts the flow when an Event Catalog event is published for the organization. The execution runs in the context of one entity from the event's entity graph (`entity_node_id`), and the event payload is available to conditions and actions as the `event` variable context.
4507
+
4508
+
4509
+ ```ts
4510
+ type EventCatalogTrigger = {
4511
+ id?: string // uuid
4512
+ type: "event_catalog"
4513
+ configuration: {
4514
+ event_name: string
4515
+ event_version: string
4516
+ entity_node_id: string
4517
+ entity_schema: string
4518
+ ignore_automation_triggered?: boolean
4519
+ }
4520
+ }
4521
+ ```
4522
+
4441
4523
  ### `TriggerCondition`
4442
4524
 
4443
4525
  ```ts
@@ -1029,6 +1029,8 @@ type MappingConfigs = Array<{
1029
1029
  use_uniqueness_criteria?: boolean
1030
1030
  loop_config?: {
1031
1031
  source_path?: { ... }
1032
+ source_type?: { ... }
1033
+ filter_tags?: { ... }
1032
1034
  length?: { ... }
1033
1035
  }
1034
1036
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1115,6 +1117,8 @@ type MappingConfig = {
1115
1117
  use_uniqueness_criteria?: boolean
1116
1118
  loop_config?: {
1117
1119
  source_path?: { ... }
1120
+ source_type?: { ... }
1121
+ filter_tags?: { ... }
1118
1122
  length?: { ... }
1119
1123
  }
1120
1124
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1201,6 +1205,8 @@ type MappingConfigV2 = {
1201
1205
  use_uniqueness_criteria?: boolean
1202
1206
  loop_config?: {
1203
1207
  source_path?: { ... }
1208
+ source_type?: { ... }
1209
+ filter_tags?: { ... }
1204
1210
  length?: { ... }
1205
1211
  }
1206
1212
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1287,6 +1293,8 @@ type MappingConfigCommonFields = {
1287
1293
  use_uniqueness_criteria?: boolean
1288
1294
  loop_config?: {
1289
1295
  source_path?: { ... }
1296
+ source_type?: { ... }
1297
+ filter_tags?: { ... }
1290
1298
  length?: { ... }
1291
1299
  }
1292
1300
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1452,6 +1460,8 @@ type ExecuteMappingReq = {
1452
1460
  use_uniqueness_criteria?: boolean
1453
1461
  loop_config?: {
1454
1462
  source_path?: { ... }
1463
+ source_type?: { ... }
1464
+ filter_tags?: { ... }
1455
1465
  length?: { ... }
1456
1466
  }
1457
1467
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1558,6 +1568,8 @@ type MappingFailure = {
1558
1568
  use_uniqueness_criteria?: boolean
1559
1569
  loop_config?: {
1560
1570
  source_path?: { ... }
1571
+ source_type?: { ... }
1572
+ filter_tags?: { ... }
1561
1573
  length?: { ... }
1562
1574
  }
1563
1575
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1687,6 +1699,8 @@ type TargetConfig = {
1687
1699
  use_uniqueness_criteria?: boolean
1688
1700
  loop_config?: {
1689
1701
  source_path?: string
1702
+ source_type?: "journey-multi-select" | "journey-file-upload"
1703
+ filter_tags?: string[]
1690
1704
  length?: number
1691
1705
  }
1692
1706
  conditionMode?: "oneOf" | "anyOf" | "allOf"
@@ -1847,6 +1861,7 @@ type GraphContextEntry = {
1847
1861
  cardinality?: { ... }
1848
1862
  fields?: { ... }
1849
1863
  filter?: { ... }
1864
+ optional?: { ... }
1850
1865
  }>
1851
1866
  edges: Array<{
1852
1867
  from: { ... }
@@ -1882,6 +1897,7 @@ type GraphDefinition = {
1882
1897
  attribute: { ... }
1883
1898
  value: { ... }
1884
1899
  }>
1900
+ optional?: boolean
1885
1901
  }>
1886
1902
  edges: Array<{
1887
1903
  from: string
@@ -1904,6 +1920,7 @@ type GraphNode = {
1904
1920
  attribute: string
1905
1921
  value: string | number | boolean
1906
1922
  }>
1923
+ optional?: boolean
1907
1924
  }
1908
1925
  ```
1909
1926
 
@@ -2249,6 +2266,8 @@ type MappingHistoryEntry = {
2249
2266
  use_uniqueness_criteria?: boolean
2250
2267
  loop_config?: {
2251
2268
  source_path?: { ... }
2269
+ source_type?: { ... }
2270
+ filter_tags?: { ... }
2252
2271
  length?: { ... }
2253
2272
  }
2254
2273
  conditionMode?: "oneOf" | "anyOf" | "allOf"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.20.22",
3
+ "version": "2.20.24",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,7 +0,0 @@
1
- import "./chunk-YPSWSI3M.js";
2
-
3
- // src/docs/README.json
4
- var README_default = "<h1 align=\"center\"><img alt=\"epilot\" src=\"https://raw.githubusercontent.com/epilot-dev/sdk-js/main/logo.png\" width=\"200\"><br>@epilot/sdk</h1>\n\n<p align=\"center\">\n <a href=\"https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI\"><img src=\"https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg\" alt=\"CI\"></a>\n <a href=\"https://www.npmjs.com/package/@epilot/sdk\"><img src=\"https://img.shields.io/npm/v/@epilot/sdk.svg\" alt=\"npm version\"></a>\n <a href=\"https://github.com/epilot-dev/sdk-js/blob/main/\"><img src=\"http://img.shields.io/:license-mit-blue.svg\" alt=\"License\"></a>\n</p>\n\n<p align=\"center\">JavaScript/TypeScript SDK for epilot APIs. Full types, tree-shakeable imports, and lazy-loaded OpenAPI specs.</p>\n\n## Install\n\n```bash\nnpm i @epilot/sdk axios openapi-client-axios\n```\n\n## Quick Start\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-bearer-token>')\n\nconst { data: entity } = await epilot.entity.createEntity(\n { slug: 'contact' },\n { first_name: 'John', last_name: 'Doe' },\n)\n\nconst { data: file } = await epilot.file.getFile({ id: 'file-123' })\n\nconst { data: executions } = await epilot.workflow.getExecutions()\n```\n\nAPI clients are built on [openapi-client-axios](https://openapistack.co/docs/openapi-client-axios/intro/), which generates fully typed operation methods on top of regular [axios](https://axios-http.com/docs/intro) instances. All standard axios features (interceptors, defaults, config) work as expected. Each operation is forwarded to a lazy singleton \u2014 the spec is loaded and the client initialized on first use, then cached.\n\nFull API documentation: [https://docs.epilot.io/api](https://docs.epilot.io/api)\n\n## API Reference\n\n<!-- api-reference-table -->\n| API | Import | Docs |\n| --- | ------ | ---- |\n| `epilot.accessToken` | `@epilot/sdk/access-token` | [docs](./docs/access-token.md) |\n| `epilot.address` | `@epilot/sdk/address` | [docs](./docs/address.md) |\n| `epilot.addressSuggestions` | `@epilot/sdk/address-suggestions` | [docs](./docs/address-suggestions.md) |\n| `epilot.aiAgents` | `@epilot/sdk/ai-agents` | [docs](./docs/ai-agents.md) |\n| `epilot.app` | `@epilot/sdk/app` | [docs](./docs/app.md) |\n| `epilot.auditLogs` | `@epilot/sdk/audit-logs` | [docs](./docs/audit-logs.md) |\n| `epilot.automation` | `@epilot/sdk/automation` | [docs](./docs/automation.md) |\n| `epilot.billing` | `@epilot/sdk/billing` | [docs](./docs/billing.md) |\n| `epilot.blueprintManifest` | `@epilot/sdk/blueprint-manifest` | [docs](./docs/blueprint-manifest.md) |\n| `epilot.calendar` | `@epilot/sdk/calendar` | [docs](./docs/calendar.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
5
- export {
6
- README_default as default
7
- };
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
2
-
3
- // src/docs/README.json
4
- var README_default = "<h1 align=\"center\"><img alt=\"epilot\" src=\"https://raw.githubusercontent.com/epilot-dev/sdk-js/main/logo.png\" width=\"200\"><br>@epilot/sdk</h1>\n\n<p align=\"center\">\n <a href=\"https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI\"><img src=\"https://github.com/epilot-dev/sdk-js/workflows/CI/badge.svg\" alt=\"CI\"></a>\n <a href=\"https://www.npmjs.com/package/@epilot/sdk\"><img src=\"https://img.shields.io/npm/v/@epilot/sdk.svg\" alt=\"npm version\"></a>\n <a href=\"https://github.com/epilot-dev/sdk-js/blob/main/\"><img src=\"http://img.shields.io/:license-mit-blue.svg\" alt=\"License\"></a>\n</p>\n\n<p align=\"center\">JavaScript/TypeScript SDK for epilot APIs. Full types, tree-shakeable imports, and lazy-loaded OpenAPI specs.</p>\n\n## Install\n\n```bash\nnpm i @epilot/sdk axios openapi-client-axios\n```\n\n## Quick Start\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-bearer-token>')\n\nconst { data: entity } = await epilot.entity.createEntity(\n { slug: 'contact' },\n { first_name: 'John', last_name: 'Doe' },\n)\n\nconst { data: file } = await epilot.file.getFile({ id: 'file-123' })\n\nconst { data: executions } = await epilot.workflow.getExecutions()\n```\n\nAPI clients are built on [openapi-client-axios](https://openapistack.co/docs/openapi-client-axios/intro/), which generates fully typed operation methods on top of regular [axios](https://axios-http.com/docs/intro) instances. All standard axios features (interceptors, defaults, config) work as expected. Each operation is forwarded to a lazy singleton \u2014 the spec is loaded and the client initialized on first use, then cached.\n\nFull API documentation: [https://docs.epilot.io/api](https://docs.epilot.io/api)\n\n## API Reference\n\n<!-- api-reference-table -->\n| API | Import | Docs |\n| --- | ------ | ---- |\n| `epilot.accessToken` | `@epilot/sdk/access-token` | [docs](./docs/access-token.md) |\n| `epilot.address` | `@epilot/sdk/address` | [docs](./docs/address.md) |\n| `epilot.addressSuggestions` | `@epilot/sdk/address-suggestions` | [docs](./docs/address-suggestions.md) |\n| `epilot.aiAgents` | `@epilot/sdk/ai-agents` | [docs](./docs/ai-agents.md) |\n| `epilot.app` | `@epilot/sdk/app` | [docs](./docs/app.md) |\n| `epilot.auditLogs` | `@epilot/sdk/audit-logs` | [docs](./docs/audit-logs.md) |\n| `epilot.automation` | `@epilot/sdk/automation` | [docs](./docs/automation.md) |\n| `epilot.billing` | `@epilot/sdk/billing` | [docs](./docs/billing.md) |\n| `epilot.blueprintManifest` | `@epilot/sdk/blueprint-manifest` | [docs](./docs/blueprint-manifest.md) |\n| `epilot.calendar` | `@epilot/sdk/calendar` | [docs](./docs/calendar.md) |\n| `epilot.configurationHub` | `@epilot/sdk/configuration-hub` | [docs](./docs/configuration-hub.md) |\n| `epilot.consent` | `@epilot/sdk/consent` | [docs](./docs/consent.md) |\n| `epilot.customerPortal` | `@epilot/sdk/customer-portal` | [docs](./docs/customer-portal.md) |\n| `epilot.dashboard` | `@epilot/sdk/dashboard` | [docs](./docs/dashboard.md) |\n| `epilot.dataGovernance` | `@epilot/sdk/data-governance` | [docs](./docs/data-governance.md) |\n| `epilot.deduplication` | `@epilot/sdk/deduplication` | [docs](./docs/deduplication.md) |\n| `epilot.design` | `@epilot/sdk/design` | [docs](./docs/design.md) |\n| `epilot.document` | `@epilot/sdk/document` | [docs](./docs/document.md) |\n| `epilot.emailSettings` | `@epilot/sdk/email-settings` | [docs](./docs/email-settings.md) |\n| `epilot.emailTemplate` | `@epilot/sdk/email-template` | [docs](./docs/email-template.md) |\n| `epilot.entity` | `@epilot/sdk/entity` | [docs](./docs/entity.md) |\n| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |\n| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |\n| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |\n| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |\n| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |\n| `epilot.integrationToolkit` | `@epilot/sdk/integration-toolkit` | [docs](./docs/integration-toolkit.md) |\n| `epilot.journey` | `@epilot/sdk/journey` | [docs](./docs/journey.md) |\n| `epilot.kanban` | `@epilot/sdk/kanban` | [docs](./docs/kanban.md) |\n| `epilot.message` | `@epilot/sdk/message` | [docs](./docs/message.md) |\n| `epilot.metering` | `@epilot/sdk/metering` | [docs](./docs/metering.md) |\n| `epilot.notes` | `@epilot/sdk/notes` | [docs](./docs/notes.md) |\n| `epilot.notification` | `@epilot/sdk/notification` | [docs](./docs/notification.md) |\n| `epilot.organization` | `@epilot/sdk/organization` | [docs](./docs/organization.md) |\n| `epilot.partnerDirectory` | `@epilot/sdk/partner-directory` | [docs](./docs/partner-directory.md) |\n| `epilot.permissions` | `@epilot/sdk/permissions` | [docs](./docs/permissions.md) |\n| `epilot.pricing` | `@epilot/sdk/pricing` | [docs](./docs/pricing.md) |\n| `epilot.pricingTier` | `@epilot/sdk/pricing-tier` | [docs](./docs/pricing-tier.md) |\n| `epilot.purpose` | `@epilot/sdk/purpose` | [docs](./docs/purpose.md) |\n| `epilot.query` | `@epilot/sdk/query` | [docs](./docs/query.md) |\n| `epilot.sandbox` | `@epilot/sdk/sandbox` | [docs](./docs/sandbox.md) |\n| `epilot.sharing` | `@epilot/sdk/sharing` | [docs](./docs/sharing.md) |\n| `epilot.snapshot` | `@epilot/sdk/snapshot` | [docs](./docs/snapshot.md) |\n| `epilot.submission` | `@epilot/sdk/submission` | [docs](./docs/submission.md) |\n| `epilot.targeting` | `@epilot/sdk/targeting` | [docs](./docs/targeting.md) |\n| `epilot.templateVariables` | `@epilot/sdk/template-variables` | [docs](./docs/template-variables.md) |\n| `epilot.user` | `@epilot/sdk/user` | [docs](./docs/user.md) |\n| `epilot.validationRules` | `@epilot/sdk/validation-rules` | [docs](./docs/validation-rules.md) |\n| `epilot.webhooks` | `@epilot/sdk/webhooks` | [docs](./docs/webhooks.md) |\n| `epilot.workflow` | `@epilot/sdk/workflow` | [docs](./docs/workflow.md) |\n| `epilot.workflowDefinition` | `@epilot/sdk/workflow-definition` | [docs](./docs/workflow-definition.md) |\n<!-- /api-reference-table -->\n\n## OpenAPI Spec\n\nRetrieve the full OpenAPI specification for any API at runtime. The spec is lazy-loaded on first call and cached.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Via API handle\nconst entitySpec = await epilot.entity.openapi()\nconsole.log(entitySpec.info.title) // \"Entity API\"\nconsole.log(entitySpec.paths) // all paths with full schemas\n\n// Via top-level method\nconst spec = await epilot.openapi('entity')\n```\n\nFor tree-shakeable imports:\n\n```ts\nimport { openapi } from '@epilot/sdk/entity'\n\nconst spec = await openapi()\n```\n\n## Explicit Client Access\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\n\n// Get the cached singleton client\nconst entityClient = epilot.entity.getClient()\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Create a fresh (non-singleton) client instance\nconst freshClient = epilot.entity.createClient()\nauthorize(freshClient, () => '<my-token>')\n```\n\n## Tree-Shakeable Imports\n\nImport only what you need. Other APIs never touch your bundle.\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\nconst { data } = await entityClient.getEntity({ slug: 'contact', id: '123' })\n\n// Or use the handle for direct operation forwarding\nimport { entity } from '@epilot/sdk/entity'\nconst { data } = await entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n## Types\n\nEach API subpath re-exports all schema types generated from the OpenAPI spec. Import them directly:\n\n```ts\nimport type { Entity, EntitySchema, RelationAttribute } from '@epilot/sdk/entity'\nimport type { FileItem } from '@epilot/sdk/file'\nimport type { AutomationFlow } from '@epilot/sdk/automation'\n```\n\nThe `Client`, `OperationMethods`, and `PathsDictionary` types are also available for typing client instances:\n\n```ts\nimport type { Client } from '@epilot/sdk/entity'\n\nconst entityClient: Client = epilot.entity.getClient()\n```\n\n## Headers\n\n### Global Headers\n\nSet default headers applied to all clients. Useful for `x-epilot-org-id`, `x-epilot-user-id`, etc.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.headers({\n 'x-epilot-org-id': 'org-123',\n 'x-epilot-user-id': 'user-456',\n})\n\nconst { data } = await epilot.entity.searchEntities(...)\n```\n\n### Standard Axios Headers\n\nUse standard axios `defaults.headers.common` on individual clients:\n\n```ts\nconst entityClient = epilot.entity.getClient()\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Auth Patterns\n\n`authorize()` accepts a string or a function. The function form is preferred \u2014 it is called on every request, so tokens stay fresh.\n\n```ts\nimport { authorize } from '@epilot/sdk'\nimport { getClient } from '@epilot/sdk/entity'\n\n// Per-client \u2014 function predicate (recommended)\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\n\n// Per-client \u2014 async function (e.g. OAuth / session)\nauthorize(entityClient, async () => {\n return await getTokenFromSession()\n})\n\n// Per-client \u2014 static string (sets default header once)\nauthorize(entityClient, 'my-static-api-token')\n```\n\n```ts\n// Global \u2014 applies to all clients resolved from the SDK\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '<my-token>')\nepilot.authorize(async () => await getTokenFromSession())\nepilot.authorize('my-static-api-token')\n```\n\n## Fresh Client Instance\n\n```ts\nimport { createClient, authorize } from '@epilot/sdk/entity'\n\nconst entityClient = createClient()\nauthorize(entityClient, () => '<my-token>')\nentityClient.defaults.headers.common['x-epilot-org-id'] = 'org-123'\n```\n\n## Multiple SDK Instances\n\n```ts\nimport { createSDK } from '@epilot/sdk'\n\nconst sdk1 = createSDK()\nsdk1.authorize(() => '<token-for-org-1>')\nsdk1.headers({ 'x-epilot-org-id': 'org-1' })\n\nconst sdk2 = createSDK()\nsdk2.authorize(() => '<token-for-org-2>')\nsdk2.headers({ 'x-epilot-org-id': 'org-2' })\n```\n\n\n## Interceptors\n\nUse axios interceptors for custom request/response processing. Since clients are axios instances, you can use `client.interceptors` directly:\n\n```ts\nentityClient.interceptors.response.use((response) => {\n console.debug(`${response.config.method?.toUpperCase()} ${response.config.url}`, {\n status: response.status,\n data: response.data,\n })\n return response\n})\n```\n\nOr register global interceptors applied to all clients:\n\n```ts\nepilot.interceptors.request((config) => {\n config.headers['x-correlation-id'] = generateTraceId()\n return config\n})\n```\n\n## Auto-Retry (429 Too Many Requests)\n\nThe SDK automatically retries requests that receive a `429 Too Many Requests` response. It respects the `Retry-After` header (in seconds) to determine how long to wait before retrying.\n\nEnabled by default with up to 3 retries.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Customize retry behavior\nepilot.retry({ maxRetries: 5, defaultDelayMs: 2000 })\n\n// Disable retries\nepilot.retry({ maxRetries: 0 })\n```\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `maxRetries` | `3` | Maximum number of retries. Set to `0` to disable. |\n| `defaultDelayMs` | `1000` | Fallback delay in ms when `Retry-After` header is missing. |\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyRetryInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyRetryInterceptor({ client: entityClient, config: { maxRetries: 3 } })\n```\n\n## Large Response Handling (413 Payload Too Large)\n\nepilot APIs use a [large response middleware](https://github.com/epilot-dev/aws-lambda-utility-middlewares) to work around the AWS Lambda 6MB response limit. When a response exceeds ~5.1MB, the API uploads the payload to S3 and returns a presigned URL instead.\n\nThe SDK handles this transparently \u2014 it sends the opt-in `Accept` header and automatically fetches the full payload from S3 when a large response URL is returned. Enabled by default.\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\n// Disable large response handling\nepilot.largeResponse({ enabled: false })\n```\n\nFor individually imported clients (tree-shakeable imports), apply the interceptor manually:\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/entity'\nimport { applyLargeResponseInterceptor } from '@epilot/sdk'\n\nconst entityClient = getClient()\nauthorize(entityClient, () => '<my-token>')\napplyLargeResponseInterceptor({ client: entityClient, config: { enabled: true } })\n```\n\n## Overrides & Custom APIs\n\nOverride built-in API specs or register custom APIs via `.epilot/sdk-overrides.json`. This is useful for testing new versions of an API spec or getting the latest types without waiting for an SDK release.\n\n```json\n{\n \"entity\": \"./specs/entity-openapi.json\",\n \"myNewApi\": \"./specs/my-new-api-openapi.json\"\n}\n```\n\n```ts\n// Built-in API with overridden spec\nconst { data } = await epilot.entity.getEntity({ slug: 'contact', id: '123' })\n```\n\n### Override Commands\n\n```bash\n# Apply all overrides from .epilot/sdk-overrides.json\nnpx epilot-sdk override\n\n# Override a single API\nnpx epilot-sdk override entity ./my-local-entity-spec.yaml\n\n# Regenerate types after spec changes\nnpx epilot-sdk typegen\n```\n\n<details>\n<summary>Migration from <code>@epilot/*-client</code></summary>\n\nDrop-in replacement \u2014 just change the import path:\n\n```ts\n// Before\nimport { getClient, createClient, authorize } from '@epilot/entity-client'\nimport type { Client, Entity } from '@epilot/entity-client'\n\n// After\nimport { getClient, createClient, authorize } from '@epilot/sdk/entity'\nimport type { Client, Entity } from '@epilot/sdk/entity'\n```\n\n</details>\n\n<details>\n<summary>Client Lifecycle</summary>\n\nWhen you call `authorize()`, `headers()`, `retry()`, `largeResponse()`, or `interceptors`, the SDK invalidates all cached client instances. The next operation call creates a fresh client with the updated configuration.\n\n**Operation methods are always up to date** \u2014 calls like `epilot.entity.getEntity(...)` re-resolve the client on every invocation, so they always use the latest config.\n\n**Direct `getClient()` references can go stale** \u2014 if you hold a reference and then change config, your reference still points to the old client:\n\n```ts\nconst entityClient = epilot.entity.getClient()\n\nepilot.authorize('new-token') // invalidates all cached clients\n\n// entityClient still has the old token\n// epilot.entity.getEntity(...) will use a new client with the new token\n```\n\nIf you need a long-lived reference that survives config changes, call `getClient()` again after changing config, or use operation methods directly.\n\n</details>\n";
5
-
6
-
7
- exports.default = README_default;