@epilot/sdk 2.20.50 → 2.20.51

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 (137) hide show
  1. package/README.md +1 -0
  2. package/definitions/external-values-runtime.json +1 -0
  3. package/definitions/external-values.json +450 -0
  4. package/dist/README-B6X6BXAW.cjs +7 -0
  5. package/dist/README-LE2VBY2Y.js +7 -0
  6. package/dist/{_index-UWRY3DNX.cjs → _index-DEYTKG4Z.cjs} +4 -1
  7. package/dist/{_index-UBUNWMRP.js → _index-HL3HOTXB.js} +3 -0
  8. package/dist/apis/access-token.cjs +6 -6
  9. package/dist/apis/access-token.js +1 -1
  10. package/dist/apis/address-suggestions.cjs +6 -6
  11. package/dist/apis/address-suggestions.js +1 -1
  12. package/dist/apis/address.cjs +6 -6
  13. package/dist/apis/address.js +1 -1
  14. package/dist/apis/ai-agents.cjs +6 -6
  15. package/dist/apis/ai-agents.js +1 -1
  16. package/dist/apis/app.cjs +6 -6
  17. package/dist/apis/app.js +1 -1
  18. package/dist/apis/audit-logs.cjs +6 -6
  19. package/dist/apis/audit-logs.js +1 -1
  20. package/dist/apis/automation.cjs +6 -6
  21. package/dist/apis/automation.js +1 -1
  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.js +1 -1
  52. package/dist/apis/entity.cjs +6 -6
  53. package/dist/apis/entity.js +1 -1
  54. package/dist/apis/environments.cjs +6 -6
  55. package/dist/apis/environments.js +1 -1
  56. package/dist/apis/event-catalog.cjs +6 -6
  57. package/dist/apis/event-catalog.js +1 -1
  58. package/dist/apis/external-values.cjs +38 -0
  59. package/dist/apis/external-values.d.cts +18 -0
  60. package/dist/apis/external-values.d.ts +18 -0
  61. package/dist/apis/external-values.js +38 -0
  62. package/dist/apis/file.cjs +6 -6
  63. package/dist/apis/file.js +1 -1
  64. package/dist/apis/iban.cjs +6 -6
  65. package/dist/apis/iban.js +1 -1
  66. package/dist/apis/identity.cjs +6 -6
  67. package/dist/apis/identity.js +1 -1
  68. package/dist/apis/integration-toolkit.cjs +6 -6
  69. package/dist/apis/integration-toolkit.js +1 -1
  70. package/dist/apis/journey.cjs +6 -6
  71. package/dist/apis/journey.js +1 -1
  72. package/dist/apis/kanban.cjs +6 -6
  73. package/dist/apis/kanban.js +1 -1
  74. package/dist/apis/message.cjs +6 -6
  75. package/dist/apis/message.js +1 -1
  76. package/dist/apis/metering.cjs +6 -6
  77. package/dist/apis/metering.js +1 -1
  78. package/dist/apis/notes.cjs +6 -6
  79. package/dist/apis/notes.js +1 -1
  80. package/dist/apis/notification.cjs +6 -6
  81. package/dist/apis/notification.js +1 -1
  82. package/dist/apis/organization.cjs +6 -6
  83. package/dist/apis/organization.js +1 -1
  84. package/dist/apis/partner-directory.cjs +6 -6
  85. package/dist/apis/partner-directory.js +1 -1
  86. package/dist/apis/permissions.cjs +6 -6
  87. package/dist/apis/permissions.js +1 -1
  88. package/dist/apis/pricing-tier.cjs +6 -6
  89. package/dist/apis/pricing-tier.js +1 -1
  90. package/dist/apis/pricing.cjs +6 -6
  91. package/dist/apis/pricing.js +1 -1
  92. package/dist/apis/purpose.cjs +6 -6
  93. package/dist/apis/purpose.js +1 -1
  94. package/dist/apis/query.cjs +6 -6
  95. package/dist/apis/query.js +1 -1
  96. package/dist/apis/sandbox.cjs +6 -6
  97. package/dist/apis/sandbox.js +1 -1
  98. package/dist/apis/sharing.cjs +6 -6
  99. package/dist/apis/sharing.js +1 -1
  100. package/dist/apis/snapshot.cjs +6 -6
  101. package/dist/apis/snapshot.js +1 -1
  102. package/dist/apis/submission.cjs +6 -6
  103. package/dist/apis/submission.js +1 -1
  104. package/dist/apis/target.cjs +6 -6
  105. package/dist/apis/target.js +1 -1
  106. package/dist/apis/targeting.cjs +6 -6
  107. package/dist/apis/targeting.js +1 -1
  108. package/dist/apis/template-variables.cjs +6 -6
  109. package/dist/apis/template-variables.js +1 -1
  110. package/dist/apis/user.cjs +6 -6
  111. package/dist/apis/user.js +1 -1
  112. package/dist/apis/validation-rules.cjs +6 -6
  113. package/dist/apis/validation-rules.js +1 -1
  114. package/dist/apis/webhooks.cjs +6 -6
  115. package/dist/apis/webhooks.js +1 -1
  116. package/dist/apis/workflow-definition.cjs +6 -6
  117. package/dist/apis/workflow-definition.js +1 -1
  118. package/dist/apis/workflow.cjs +6 -6
  119. package/dist/apis/workflow.js +1 -1
  120. package/dist/{chunk-VMA2UKDS.js → chunk-3FRPGY3C.js} +4 -2
  121. package/dist/chunk-CMEMMJ3T.js +14 -0
  122. package/dist/chunk-NC33X2WL.cjs +14 -0
  123. package/dist/{chunk-TF4SGSFP.cjs → chunk-UVYQFUAO.cjs} +4 -2
  124. package/dist/external-values-DALDMPMB.js +7 -0
  125. package/dist/external-values-XG5LFKZQ.cjs +7 -0
  126. package/dist/external-values-runtime-BPR3H6RL.cjs +5 -0
  127. package/dist/external-values-runtime-VXZRGQCT.js +5 -0
  128. package/dist/external-values.d-DjP9C_-r.d.cts +391 -0
  129. package/dist/external-values.d-DjP9C_-r.d.ts +391 -0
  130. package/dist/index.cjs +22 -14
  131. package/dist/index.d.cts +58 -56
  132. package/dist/index.d.ts +58 -56
  133. package/dist/index.js +15 -7
  134. package/docs/external-values.md +330 -0
  135. package/package.json +10 -1
  136. package/dist/README-OSHX3IVR.cjs +0 -7
  137. package/dist/README-ZSJDIPZZ.js +0 -7
package/dist/index.d.ts CHANGED
@@ -28,34 +28,35 @@ import { C as Client$l } from './entity.d-BwsBk0Po.js';
28
28
  import { C as Client$m } from './entity-mapping.d-8MtWa2_L.js';
29
29
  import { C as Client$n } from './environments.d-qL1urwAq.js';
30
30
  import { C as Client$o } from './event-catalog.d-BrAxYS9D.js';
31
- import { C as Client$p } from './file.d-DELNV63w.js';
32
- import { C as Client$q } from './iban.d-BwdiGbxi.js';
33
- import { C as Client$r } from './identity.d-BBL0NI_O.js';
34
- import { C as Client$s } from './integration-toolkit.d-CLlaZx6b.js';
35
- import { C as Client$t } from './journey.d-CMtM6U3Y.js';
36
- import { C as Client$u } from './kanban.d-BHnSRCYW.js';
37
- import { C as Client$v } from './message.d-DwnqO-Us.js';
38
- import { C as Client$w } from './metering.d-BP04w-gR.js';
39
- import { C as Client$x } from './notes.d-rbcyHfiB.js';
40
- import { C as Client$y } from './notification.d-r89Jec85.js';
41
- import { C as Client$z } from './organization.d-DqwnNxMg.js';
42
- import { C as Client$A } from './partner-directory.d-BCIjHoGs.js';
43
- import { C as Client$B } from './permissions.d-BKoyMhU7.js';
44
- import { C as Client$C } from './pricing.d-BMV5QoZ7.js';
45
- import { C as Client$D } from './pricing-tier.d-Cg0jl6n_.js';
46
- import { C as Client$E } from './purpose.d-CbIYfTua.js';
47
- import { C as Client$F } from './query.d-Cmp78IhZ.js';
48
- import { C as Client$G } from './sandbox.d-BdbOFzDu.js';
49
- import { C as Client$H } from './sharing.d-sOXq-gtz.js';
50
- import { C as Client$I } from './snapshot.d-DT0zg2CS.js';
51
- import { C as Client$J } from './submission.d-BamwfhXw.js';
52
- import { C as Client$K } from './targeting.d-BYVSahmV.js';
53
- import { C as Client$L } from './template-variables.d-Ble9TSBa.js';
54
- import { C as Client$M } from './user.d-rqYtwsCz.js';
55
- import { C as Client$N } from './validation-rules.d-Bbo90IYn.js';
56
- import { C as Client$O } from './webhooks.d-DqOEzFsp.js';
57
- import { C as Client$P } from './workflow.d-5cyNJgVQ.js';
58
- import { C as Client$Q } from './workflow-definition.d-CweGhhBU.js';
31
+ import { C as Client$p } from './external-values.d-DjP9C_-r.js';
32
+ import { C as Client$q } from './file.d-DELNV63w.js';
33
+ import { C as Client$r } from './iban.d-BwdiGbxi.js';
34
+ import { C as Client$s } from './identity.d-BBL0NI_O.js';
35
+ import { C as Client$t } from './integration-toolkit.d-CLlaZx6b.js';
36
+ import { C as Client$u } from './journey.d-CMtM6U3Y.js';
37
+ import { C as Client$v } from './kanban.d-BHnSRCYW.js';
38
+ import { C as Client$w } from './message.d-DwnqO-Us.js';
39
+ import { C as Client$x } from './metering.d-BP04w-gR.js';
40
+ import { C as Client$y } from './notes.d-rbcyHfiB.js';
41
+ import { C as Client$z } from './notification.d-r89Jec85.js';
42
+ import { C as Client$A } from './organization.d-DqwnNxMg.js';
43
+ import { C as Client$B } from './partner-directory.d-BCIjHoGs.js';
44
+ import { C as Client$C } from './permissions.d-BKoyMhU7.js';
45
+ import { C as Client$D } from './pricing.d-BMV5QoZ7.js';
46
+ import { C as Client$E } from './pricing-tier.d-Cg0jl6n_.js';
47
+ import { C as Client$F } from './purpose.d-CbIYfTua.js';
48
+ import { C as Client$G } from './query.d-Cmp78IhZ.js';
49
+ import { C as Client$H } from './sandbox.d-BdbOFzDu.js';
50
+ import { C as Client$I } from './sharing.d-sOXq-gtz.js';
51
+ import { C as Client$J } from './snapshot.d-DT0zg2CS.js';
52
+ import { C as Client$K } from './submission.d-BamwfhXw.js';
53
+ import { C as Client$L } from './targeting.d-BYVSahmV.js';
54
+ import { C as Client$M } from './template-variables.d-Ble9TSBa.js';
55
+ import { C as Client$N } from './user.d-rqYtwsCz.js';
56
+ import { C as Client$O } from './validation-rules.d-Bbo90IYn.js';
57
+ import { C as Client$P } from './webhooks.d-DqOEzFsp.js';
58
+ import { C as Client$Q } from './workflow.d-5cyNJgVQ.js';
59
+ import { C as Client$R } from './workflow-definition.d-CweGhhBU.js';
59
60
 
60
61
  type SDKClientMap = {
61
62
  accessToken: Client;
@@ -83,34 +84,35 @@ type SDKClientMap = {
83
84
  entityMapping: Client$m;
84
85
  environments: Client$n;
85
86
  eventCatalog: Client$o;
86
- file: Client$p;
87
- iban: Client$q;
88
- identity: Client$r;
89
- integrationToolkit: Client$s;
90
- journey: Client$t;
91
- kanban: Client$u;
92
- message: Client$v;
93
- metering: Client$w;
94
- notes: Client$x;
95
- notification: Client$y;
96
- organization: Client$z;
97
- partnerDirectory: Client$A;
98
- permissions: Client$B;
99
- pricing: Client$C;
100
- pricingTier: Client$D;
101
- purpose: Client$E;
102
- query: Client$F;
103
- sandbox: Client$G;
104
- sharing: Client$H;
105
- snapshot: Client$I;
106
- submission: Client$J;
107
- targeting: Client$K;
108
- templateVariables: Client$L;
109
- user: Client$M;
110
- validationRules: Client$N;
111
- webhooks: Client$O;
112
- workflow: Client$P;
113
- workflowDefinition: Client$Q;
87
+ externalValues: Client$p;
88
+ file: Client$q;
89
+ iban: Client$r;
90
+ identity: Client$s;
91
+ integrationToolkit: Client$t;
92
+ journey: Client$u;
93
+ kanban: Client$v;
94
+ message: Client$w;
95
+ metering: Client$x;
96
+ notes: Client$y;
97
+ notification: Client$z;
98
+ organization: Client$A;
99
+ partnerDirectory: Client$B;
100
+ permissions: Client$C;
101
+ pricing: Client$D;
102
+ pricingTier: Client$E;
103
+ purpose: Client$F;
104
+ query: Client$G;
105
+ sandbox: Client$H;
106
+ sharing: Client$I;
107
+ snapshot: Client$J;
108
+ submission: Client$K;
109
+ targeting: Client$L;
110
+ templateVariables: Client$M;
111
+ user: Client$N;
112
+ validationRules: Client$O;
113
+ webhooks: Client$P;
114
+ workflow: Client$Q;
115
+ workflowDefinition: Client$R;
114
116
  };
115
117
 
116
118
  type LargeResponseConfig = {
package/dist/index.js CHANGED
@@ -19,6 +19,9 @@ import {
19
19
  import {
20
20
  require_workflow_runtime
21
21
  } from "./chunk-522LYPPW.js";
22
+ import {
23
+ require_pricing_tier_runtime
24
+ } from "./chunk-6VWCUZ5M.js";
22
25
  import {
23
26
  require_pricing_runtime
24
27
  } from "./chunk-QZ3FPCEP.js";
@@ -40,6 +43,9 @@ import {
40
43
  import {
41
44
  require_submission_runtime
42
45
  } from "./chunk-IJR3GZKC.js";
46
+ import {
47
+ require_kanban_runtime
48
+ } from "./chunk-IQOCHPWU.js";
43
49
  import {
44
50
  require_message_runtime
45
51
  } from "./chunk-OT6AETWN.js";
@@ -61,15 +67,15 @@ import {
61
67
  import {
62
68
  require_permissions_runtime
63
69
  } from "./chunk-SITPUXIR.js";
64
- import {
65
- require_pricing_tier_runtime
66
- } from "./chunk-6VWCUZ5M.js";
67
70
  import {
68
71
  require_environments_runtime
69
72
  } from "./chunk-2LEEXRJX.js";
70
73
  import {
71
74
  require_event_catalog_runtime
72
75
  } from "./chunk-M6G3GHCU.js";
76
+ import {
77
+ require_external_values_runtime
78
+ } from "./chunk-CMEMMJ3T.js";
73
79
  import {
74
80
  require_file_runtime
75
81
  } from "./chunk-FGQBS7TA.js";
@@ -85,9 +91,6 @@ import {
85
91
  import {
86
92
  require_journey_runtime
87
93
  } from "./chunk-I3ZZES76.js";
88
- import {
89
- require_kanban_runtime
90
- } from "./chunk-IQOCHPWU.js";
91
94
  import {
92
95
  require_data_governance_runtime
93
96
  } from "./chunk-5ED7FB3Q.js";
@@ -164,7 +167,7 @@ import {
164
167
  expand,
165
168
  help,
166
169
  openapi
167
- } from "./chunk-VMA2UKDS.js";
170
+ } from "./chunk-3FRPGY3C.js";
168
171
  import {
169
172
  __require
170
173
  } from "./chunk-YPSWSI3M.js";
@@ -391,6 +394,11 @@ var registerBuiltinApis = (registry) => {
391
394
  name: "eventCatalog",
392
395
  loader: () => expandDef(require_event_catalog_runtime())
393
396
  });
397
+ registerApi({
398
+ registry,
399
+ name: "externalValues",
400
+ loader: () => expandDef(require_external_values_runtime())
401
+ });
394
402
  registerApi({
395
403
  registry,
396
404
  name: "file",
@@ -0,0 +1,330 @@
1
+ # External Values API
2
+
3
+ - **Base URL:** `https://external-values.sls.epilot.io`
4
+ - **Full API Docs:** [https://docs.epilot.io/api/external-values](https://docs.epilot.io/api/external-values)
5
+
6
+ ## Usage
7
+
8
+ ```ts
9
+ import { epilot } from '@epilot/sdk'
10
+
11
+ epilot.authorize(() => '<token>')
12
+ const { data } = await epilot.externalValues.listExternalValues(...)
13
+ ```
14
+
15
+ ### Tree-shakeable import
16
+
17
+ ```ts
18
+ import { getClient, authorize } from '@epilot/sdk/external-values'
19
+
20
+ const externalValuesClient = getClient()
21
+ authorize(externalValuesClient, () => '<token>')
22
+ const { data } = await externalValuesClient.listExternalValues(...)
23
+ ```
24
+
25
+ ## Operations
26
+
27
+ **external-values**
28
+ - [`listExternalValues`](#listexternalvalues)
29
+ - [`resolveExternalValue`](#resolveexternalvalue)
30
+ - [`resolvePortalExternalValue`](#resolveportalexternalvalue)
31
+
32
+ **Schemas**
33
+ - [`TranslatedString`](#translatedstring)
34
+ - [`ExternalValueType`](#externalvaluetype)
35
+ - [`ResolveExternalValueRequest`](#resolveexternalvaluerequest)
36
+ - [`ExternalValueErrorCode`](#externalvalueerrorcode)
37
+ - [`ExternalValueError`](#externalvalueerror)
38
+ - [`ResolveExternalValueResponse`](#resolveexternalvalueresponse)
39
+ - [`ExternalValueResultSummary`](#externalvalueresultsummary)
40
+ - [`ExternalValueHookSummary`](#externalvaluehooksummary)
41
+ - [`ExternalValueHookList`](#externalvaluehooklist)
42
+
43
+ ### `listExternalValues`
44
+
45
+ List hooks and their results of all enabled installed apps that declare an
46
+ `EXTERNAL_VALUES` component. Intended for pickers (e.g. the validation-rules builder).
47
+
48
+ `GET /v1/external-values`
49
+
50
+ ```ts
51
+ const { data } = await client.listExternalValues()
52
+ ```
53
+
54
+ <details>
55
+ <summary>Response</summary>
56
+
57
+ ```json
58
+ {
59
+ "hooks": [
60
+ {
61
+ "app_id": "string",
62
+ "app_name": "string",
63
+ "hook_id": "string",
64
+ "name": {
65
+ "de": "string",
66
+ "en": "string"
67
+ },
68
+ "description": {
69
+ "de": "string",
70
+ "en": "string"
71
+ },
72
+ "results": [
73
+ {
74
+ "id": "string",
75
+ "type": "number",
76
+ "name": {
77
+ "de": "string",
78
+ "en": "string"
79
+ }
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ }
85
+ ```
86
+
87
+ </details>
88
+
89
+ ---
90
+
91
+ ### `resolveExternalValue`
92
+
93
+ Resolve an external value hook for an epilot 360 user (builder preview, entity-attribute
94
+ rules). The organization is taken from the caller's token.
95
+
96
+ `POST /v1/external-values/{app_id}/hooks/{hook_id}:resolve`
97
+
98
+ ```ts
99
+ const { data } = await client.resolveExternalValue(
100
+ {
101
+ app_id: 'example',
102
+ hook_id: 'example',
103
+ },
104
+ {
105
+ context: {
106
+ input: '123,45',
107
+ contract: {
108
+ _id: '8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a',
109
+ installment_amount: 110
110
+ }
111
+ },
112
+ consumer: {
113
+ type: 'validation_rule',
114
+ rule_id: '6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b'
115
+ }
116
+ },
117
+ )
118
+ ```
119
+
120
+ <details>
121
+ <summary>Response</summary>
122
+
123
+ ```json
124
+ {
125
+ "values": {
126
+ "predicted": 132
127
+ },
128
+ "errors": [
129
+ {
130
+ "result_id": "limit",
131
+ "code": "coercion_failed",
132
+ "message": "Cannot coerce \"n/a\" to number"
133
+ }
134
+ ],
135
+ "policy": {
136
+ "on_unavailable": "skip"
137
+ }
138
+ }
139
+ ```
140
+
141
+ </details>
142
+
143
+ ---
144
+
145
+ ### `resolvePortalExternalValue`
146
+
147
+ Resolve an external value hook for a portal end customer (private journeys, portal).
148
+ The organization is taken from the portal token claims.
149
+
150
+ `POST /v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve`
151
+
152
+ ```ts
153
+ const { data } = await client.resolvePortalExternalValue(
154
+ {
155
+ app_id: 'example',
156
+ hook_id: 'example',
157
+ },
158
+ {
159
+ context: {
160
+ input: '123,45',
161
+ contract: {
162
+ _id: '8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a',
163
+ installment_amount: 110
164
+ }
165
+ },
166
+ consumer: {
167
+ type: 'validation_rule',
168
+ rule_id: '6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b'
169
+ }
170
+ },
171
+ )
172
+ ```
173
+
174
+ <details>
175
+ <summary>Response</summary>
176
+
177
+ ```json
178
+ {
179
+ "values": {
180
+ "predicted": 132
181
+ },
182
+ "errors": [
183
+ {
184
+ "result_id": "limit",
185
+ "code": "coercion_failed",
186
+ "message": "Cannot coerce \"n/a\" to number"
187
+ }
188
+ ],
189
+ "policy": {
190
+ "on_unavailable": "skip"
191
+ }
192
+ }
193
+ ```
194
+
195
+ </details>
196
+
197
+ ---
198
+
199
+ ## Schemas
200
+
201
+ ### `TranslatedString`
202
+
203
+ ```ts
204
+ type TranslatedString = {
205
+ de: string
206
+ en?: string
207
+ }
208
+ ```
209
+
210
+ ### `ExternalValueType`
211
+
212
+ ```ts
213
+ type ExternalValueType = "number" | "text" | "date" | "boolean"
214
+ ```
215
+
216
+ ### `ResolveExternalValueRequest`
217
+
218
+ ```ts
219
+ type ResolveExternalValueRequest = {
220
+ context: Record<string, unknown>
221
+ consumer?: {
222
+ type?: string
223
+ rule_id?: string
224
+ journey_id?: string
225
+ }
226
+ }
227
+ ```
228
+
229
+ ### `ExternalValueErrorCode`
230
+
231
+ - `timeout`: the third-party call exceeded `timeout_ms`
232
+ - `upstream_error`: the third-party call failed or returned a non-2xx status
233
+ - `auth_failed`: the `auth` pre-call failed
234
+ - `extraction_failed`: template/path/jsonata threw or yielded null / empty
235
+ - `coercion_failed`: the extracted value could n
236
+
237
+ ```ts
238
+ type ExternalValueErrorCode = "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"
239
+ ```
240
+
241
+ ### `ExternalValueError`
242
+
243
+ ```ts
244
+ type ExternalValueError = {
245
+ result_id?: string
246
+ code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"
247
+ message: string
248
+ }
249
+ ```
250
+
251
+ ### `ResolveExternalValueResponse`
252
+
253
+ ```ts
254
+ type ResolveExternalValueResponse = {
255
+ values: Record<string, number | string | boolean>
256
+ errors: Array<{
257
+ result_id?: string
258
+ code: "timeout" | "upstream_error" | "auth_failed" | "extraction_failed" | "coercion_failed"
259
+ message: string
260
+ }>
261
+ policy: {
262
+ on_unavailable: "skip" | "block"
263
+ }
264
+ cached?: boolean
265
+ }
266
+ ```
267
+
268
+ ### `ExternalValueResultSummary`
269
+
270
+ ```ts
271
+ type ExternalValueResultSummary = {
272
+ id: string
273
+ type: "number" | "text" | "date" | "boolean"
274
+ name: {
275
+ de: string
276
+ en?: string
277
+ }
278
+ }
279
+ ```
280
+
281
+ ### `ExternalValueHookSummary`
282
+
283
+ ```ts
284
+ type ExternalValueHookSummary = {
285
+ app_id: string
286
+ app_name: string
287
+ hook_id: string
288
+ name: {
289
+ de: string
290
+ en?: string
291
+ }
292
+ description?: {
293
+ de: string
294
+ en?: string
295
+ }
296
+ results: Array<{
297
+ id: string
298
+ type: "number" | "text" | "date" | "boolean"
299
+ name: {
300
+ de: { ... }
301
+ en?: { ... }
302
+ }
303
+ }>
304
+ }
305
+ ```
306
+
307
+ ### `ExternalValueHookList`
308
+
309
+ ```ts
310
+ type ExternalValueHookList = {
311
+ hooks: Array<{
312
+ app_id: string
313
+ app_name: string
314
+ hook_id: string
315
+ name: {
316
+ de: { ... }
317
+ en?: { ... }
318
+ }
319
+ description?: {
320
+ de: { ... }
321
+ en?: { ... }
322
+ }
323
+ results: Array<{
324
+ id: { ... }
325
+ type: { ... }
326
+ name: { ... }
327
+ }>
328
+ }>
329
+ }
330
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.20.50",
3
+ "version": "2.20.51",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -165,6 +165,12 @@
165
165
  "require": "./dist/apis/event-catalog.cjs"
166
166
  },
167
167
  "./event-catalog/openapi.json": "./definitions/event-catalog.json",
168
+ "./external-values": {
169
+ "types": "./dist/apis/external-values.d.ts",
170
+ "import": "./dist/apis/external-values.js",
171
+ "require": "./dist/apis/external-values.cjs"
172
+ },
173
+ "./external-values/openapi.json": "./definitions/external-values.json",
168
174
  "./file": {
169
175
  "types": "./dist/apis/file.d.ts",
170
176
  "import": "./dist/apis/file.js",
@@ -448,6 +454,9 @@
448
454
  "event-catalog": [
449
455
  "./dist/apis/event-catalog.d.ts"
450
456
  ],
457
+ "external-values": [
458
+ "./dist/apis/external-values.d.ts"
459
+ ],
451
460
  "file": [
452
461
  "./dist/apis/file.d.ts"
453
462
  ],
@@ -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.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.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.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.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;
@@ -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.chat` | `@epilot/sdk/chat` | [docs](./docs/chat.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.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.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
- };