@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.
- package/README.md +1 -0
- package/definitions/external-values-runtime.json +1 -0
- package/definitions/external-values.json +450 -0
- package/dist/README-B6X6BXAW.cjs +7 -0
- package/dist/README-LE2VBY2Y.js +7 -0
- package/dist/{_index-UWRY3DNX.cjs → _index-DEYTKG4Z.cjs} +4 -1
- package/dist/{_index-UBUNWMRP.js → _index-HL3HOTXB.js} +3 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/chat.cjs +6 -6
- package/dist/apis/chat.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/external-values.cjs +38 -0
- package/dist/apis/external-values.d.cts +18 -0
- package/dist/apis/external-values.d.ts +18 -0
- package/dist/apis/external-values.js +38 -0
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/identity.cjs +6 -6
- package/dist/apis/identity.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chunk-VMA2UKDS.js → chunk-3FRPGY3C.js} +4 -2
- package/dist/chunk-CMEMMJ3T.js +14 -0
- package/dist/chunk-NC33X2WL.cjs +14 -0
- package/dist/{chunk-TF4SGSFP.cjs → chunk-UVYQFUAO.cjs} +4 -2
- package/dist/external-values-DALDMPMB.js +7 -0
- package/dist/external-values-XG5LFKZQ.cjs +7 -0
- package/dist/external-values-runtime-BPR3H6RL.cjs +5 -0
- package/dist/external-values-runtime-VXZRGQCT.js +5 -0
- package/dist/external-values.d-DjP9C_-r.d.cts +391 -0
- package/dist/external-values.d-DjP9C_-r.d.ts +391 -0
- package/dist/index.cjs +22 -14
- package/dist/index.d.cts +58 -56
- package/dist/index.d.ts +58 -56
- package/dist/index.js +15 -7
- package/docs/external-values.md +330 -0
- package/package.json +10 -1
- package/dist/README-OSHX3IVR.cjs +0 -7
- package/dist/README-ZSJDIPZZ.js +0 -7
package/README.md
CHANGED
|
@@ -65,6 +65,7 @@ Full API documentation: [https://docs.epilot.io/api](https://docs.epilot.io/api)
|
|
|
65
65
|
| `epilot.entityMapping` | `@epilot/sdk/entity-mapping` | [docs](./docs/entity-mapping.md) |
|
|
66
66
|
| `epilot.environments` | `@epilot/sdk/environments` | [docs](./docs/environments.md) |
|
|
67
67
|
| `epilot.eventCatalog` | `@epilot/sdk/event-catalog` | [docs](./docs/event-catalog.md) |
|
|
68
|
+
| `epilot.externalValues` | `@epilot/sdk/external-values` | [docs](./docs/external-values.md) |
|
|
68
69
|
| `epilot.file` | `@epilot/sdk/file` | [docs](./docs/file.md) |
|
|
69
70
|
| `epilot.iban` | `@epilot/sdk/iban` | [docs](./docs/iban.md) |
|
|
70
71
|
| `epilot.identity` | `@epilot/sdk/identity` | [docs](./docs/identity.md) |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"s":"https://external-values.sls.epilot.io","o":[["listExternalValues","get","/v1/external-values"],["resolveExternalValue","post","/v1/external-values/{app_id}/hooks/{hook_id}:resolve",null,1],["resolvePortalExternalValue","post","/v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve",null,1]],"v":"3.0.3","cp":{"AppId":["app_id","p",true],"HookId":["hook_id","p",true]},"pp":{"/v1/external-values/{app_id}/hooks/{hook_id}:resolve":[["AppId"],["HookId"]],"/v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve":[["AppId"],["HookId"]]}}
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "External Values API",
|
|
5
|
+
"description": "Resolves **External Values** — typed values fetched from third-party systems through\nhooks declared in an installed App's `EXTERNAL_VALUES` component.\n\nConsumers (validation rules, journeys, portals) reference a value as\n`{ app_id, hook_id, result_id }`; this API executes the hook against the third-party\nendpoint with the installation's options and secrets, extracts the configured results,\ncoerces them to their declared type and returns them together with the hook's\nfail policy.\n\nCallers must be authenticated: epilot 360 user tokens (`/v1/external-values*`) or\nportal end-customer tokens (`/v1/portal/external-values*`). Public journey tokens are\nnot accepted.\n",
|
|
6
|
+
"version": "1.0.0"
|
|
7
|
+
},
|
|
8
|
+
"tags": [
|
|
9
|
+
{
|
|
10
|
+
"name": "external-values",
|
|
11
|
+
"description": "Discover and resolve External Values of installed apps"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"security": [
|
|
15
|
+
{
|
|
16
|
+
"EpilotAuth": []
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/v1/external-values": {
|
|
21
|
+
"get": {
|
|
22
|
+
"operationId": "listExternalValues",
|
|
23
|
+
"summary": "listExternalValues",
|
|
24
|
+
"description": "List hooks and their results of all enabled installed apps that declare an\n`EXTERNAL_VALUES` component. Intended for pickers (e.g. the validation-rules builder).\n",
|
|
25
|
+
"tags": [
|
|
26
|
+
"external-values"
|
|
27
|
+
],
|
|
28
|
+
"responses": {
|
|
29
|
+
"200": {
|
|
30
|
+
"description": "Available external value hooks",
|
|
31
|
+
"content": {
|
|
32
|
+
"application/json": {
|
|
33
|
+
"schema": {
|
|
34
|
+
"$ref": "#/components/schemas/ExternalValueHookList"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"401": {
|
|
40
|
+
"description": "Unauthorized"
|
|
41
|
+
},
|
|
42
|
+
"403": {
|
|
43
|
+
"description": "Forbidden"
|
|
44
|
+
},
|
|
45
|
+
"500": {
|
|
46
|
+
"description": "Internal server error"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"/v1/external-values/{app_id}/hooks/{hook_id}:resolve": {
|
|
52
|
+
"parameters": [
|
|
53
|
+
{
|
|
54
|
+
"$ref": "#/components/parameters/AppId"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"$ref": "#/components/parameters/HookId"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"post": {
|
|
61
|
+
"operationId": "resolveExternalValue",
|
|
62
|
+
"summary": "resolveExternalValue",
|
|
63
|
+
"description": "Resolve an external value hook for an epilot 360 user (builder preview, entity-attribute\nrules). The organization is taken from the caller's token.\n\nReturns HTTP 200 whenever the hook configuration was found and executed — including\nupstream failures, which are reported in `errors` so clients can apply `policy`.\n",
|
|
64
|
+
"tags": [
|
|
65
|
+
"external-values"
|
|
66
|
+
],
|
|
67
|
+
"requestBody": {
|
|
68
|
+
"required": true,
|
|
69
|
+
"content": {
|
|
70
|
+
"application/json": {
|
|
71
|
+
"schema": {
|
|
72
|
+
"$ref": "#/components/schemas/ResolveExternalValueRequest"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"responses": {
|
|
78
|
+
"200": {
|
|
79
|
+
"description": "Resolution result",
|
|
80
|
+
"content": {
|
|
81
|
+
"application/json": {
|
|
82
|
+
"schema": {
|
|
83
|
+
"$ref": "#/components/schemas/ResolveExternalValueResponse"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"400": {
|
|
89
|
+
"description": "Invalid request body"
|
|
90
|
+
},
|
|
91
|
+
"401": {
|
|
92
|
+
"description": "Unauthorized"
|
|
93
|
+
},
|
|
94
|
+
"403": {
|
|
95
|
+
"description": "Forbidden"
|
|
96
|
+
},
|
|
97
|
+
"404": {
|
|
98
|
+
"description": "Unknown app, component or hook"
|
|
99
|
+
},
|
|
100
|
+
"422": {
|
|
101
|
+
"description": "The app's EXTERNAL_VALUES configuration is invalid"
|
|
102
|
+
},
|
|
103
|
+
"500": {
|
|
104
|
+
"description": "Internal server error"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"/v1/portal/external-values/{app_id}/hooks/{hook_id}:resolve": {
|
|
110
|
+
"parameters": [
|
|
111
|
+
{
|
|
112
|
+
"$ref": "#/components/parameters/AppId"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"$ref": "#/components/parameters/HookId"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"post": {
|
|
119
|
+
"operationId": "resolvePortalExternalValue",
|
|
120
|
+
"summary": "resolvePortalExternalValue",
|
|
121
|
+
"description": "Resolve an external value hook for a portal end customer (private journeys, portal).\nThe organization is taken from the portal token claims.\n\nReturns HTTP 200 whenever the hook configuration was found and executed — including\nupstream failures, which are reported in `errors` so clients can apply `policy`.\n",
|
|
122
|
+
"tags": [
|
|
123
|
+
"external-values"
|
|
124
|
+
],
|
|
125
|
+
"security": [
|
|
126
|
+
{
|
|
127
|
+
"PortalAuth": []
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"requestBody": {
|
|
131
|
+
"required": true,
|
|
132
|
+
"content": {
|
|
133
|
+
"application/json": {
|
|
134
|
+
"schema": {
|
|
135
|
+
"$ref": "#/components/schemas/ResolveExternalValueRequest"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"responses": {
|
|
141
|
+
"200": {
|
|
142
|
+
"description": "Resolution result",
|
|
143
|
+
"content": {
|
|
144
|
+
"application/json": {
|
|
145
|
+
"schema": {
|
|
146
|
+
"$ref": "#/components/schemas/ResolveExternalValueResponse"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"400": {
|
|
152
|
+
"description": "Invalid request body"
|
|
153
|
+
},
|
|
154
|
+
"401": {
|
|
155
|
+
"description": "Unauthorized"
|
|
156
|
+
},
|
|
157
|
+
"403": {
|
|
158
|
+
"description": "Forbidden"
|
|
159
|
+
},
|
|
160
|
+
"404": {
|
|
161
|
+
"description": "Unknown app, component or hook"
|
|
162
|
+
},
|
|
163
|
+
"422": {
|
|
164
|
+
"description": "The app's EXTERNAL_VALUES configuration is invalid"
|
|
165
|
+
},
|
|
166
|
+
"500": {
|
|
167
|
+
"description": "Internal server error"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"components": {
|
|
174
|
+
"securitySchemes": {
|
|
175
|
+
"EpilotAuth": {
|
|
176
|
+
"type": "http",
|
|
177
|
+
"scheme": "bearer",
|
|
178
|
+
"bearerFormat": "JWT",
|
|
179
|
+
"description": "Authorization header with epilot OAuth2 bearer token (epilot 360 users)"
|
|
180
|
+
},
|
|
181
|
+
"PortalAuth": {
|
|
182
|
+
"type": "http",
|
|
183
|
+
"scheme": "bearer",
|
|
184
|
+
"bearerFormat": "JWT",
|
|
185
|
+
"description": "Authorization header with a portal end-customer bearer token"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"parameters": {
|
|
189
|
+
"AppId": {
|
|
190
|
+
"name": "app_id",
|
|
191
|
+
"in": "path",
|
|
192
|
+
"required": true,
|
|
193
|
+
"description": "ID of the installed app declaring the EXTERNAL_VALUES component",
|
|
194
|
+
"schema": {
|
|
195
|
+
"type": "string"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"HookId": {
|
|
199
|
+
"name": "hook_id",
|
|
200
|
+
"in": "path",
|
|
201
|
+
"required": true,
|
|
202
|
+
"description": "Stable hook identifier within the component configuration",
|
|
203
|
+
"schema": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"pattern": "^[a-zA-Z0-9_-]{1,100}$"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"schemas": {
|
|
210
|
+
"TranslatedString": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"required": [
|
|
213
|
+
"de"
|
|
214
|
+
],
|
|
215
|
+
"properties": {
|
|
216
|
+
"de": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"description": "German translation"
|
|
219
|
+
},
|
|
220
|
+
"en": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"nullable": true,
|
|
223
|
+
"description": "English translation"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"ExternalValueType": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"enum": [
|
|
230
|
+
"number",
|
|
231
|
+
"text",
|
|
232
|
+
"date",
|
|
233
|
+
"boolean"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"ResolveExternalValueRequest": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"required": [
|
|
239
|
+
"context"
|
|
240
|
+
],
|
|
241
|
+
"properties": {
|
|
242
|
+
"context": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"description": "Everything the consumer supplies for interpolation, as one name → value map.\nExposed to the hook's Liquid templates as `Context` / `context`, e.g.\n`{{ context.input }}`, `{{ context.contract.installment_amount }}`.\n\nThe names are up to the consumer; this API does not interpret them. By\nconvention the journey runtime passes the validated value of a validation\nrule as `input` and every configured context binding under its own name.\n",
|
|
245
|
+
"additionalProperties": true
|
|
246
|
+
},
|
|
247
|
+
"consumer": {
|
|
248
|
+
"type": "object",
|
|
249
|
+
"description": "Who is resolving the value. Forwarded to the hook as `Consumer`.",
|
|
250
|
+
"additionalProperties": true,
|
|
251
|
+
"properties": {
|
|
252
|
+
"type": {
|
|
253
|
+
"type": "string",
|
|
254
|
+
"example": "validation_rule"
|
|
255
|
+
},
|
|
256
|
+
"rule_id": {
|
|
257
|
+
"type": "string"
|
|
258
|
+
},
|
|
259
|
+
"journey_id": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"example": {
|
|
266
|
+
"context": {
|
|
267
|
+
"input": "123,45",
|
|
268
|
+
"contract": {
|
|
269
|
+
"_id": "8a7e3f5e-9c0c-4c74-8d4a-1a1a1a1a1a1a",
|
|
270
|
+
"installment_amount": 110
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"consumer": {
|
|
274
|
+
"type": "validation_rule",
|
|
275
|
+
"rule_id": "6c0a9e1e-2f4b-4e6a-8f8e-2b2b2b2b2b2b"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"ExternalValueErrorCode": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"description": "- `timeout`: the third-party call exceeded `timeout_ms`\n- `upstream_error`: the third-party call failed or returned a non-2xx status\n- `auth_failed`: the `auth` pre-call failed\n- `extraction_failed`: template/path/jsonata threw or yielded null / empty\n- `coercion_failed`: the extracted value could not be coerced to the result type\n",
|
|
282
|
+
"enum": [
|
|
283
|
+
"timeout",
|
|
284
|
+
"upstream_error",
|
|
285
|
+
"auth_failed",
|
|
286
|
+
"extraction_failed",
|
|
287
|
+
"coercion_failed"
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
"ExternalValueError": {
|
|
291
|
+
"type": "object",
|
|
292
|
+
"required": [
|
|
293
|
+
"code",
|
|
294
|
+
"message"
|
|
295
|
+
],
|
|
296
|
+
"properties": {
|
|
297
|
+
"result_id": {
|
|
298
|
+
"type": "string",
|
|
299
|
+
"description": "Set for per-result errors; absent for hook-level failures"
|
|
300
|
+
},
|
|
301
|
+
"code": {
|
|
302
|
+
"$ref": "#/components/schemas/ExternalValueErrorCode"
|
|
303
|
+
},
|
|
304
|
+
"message": {
|
|
305
|
+
"type": "string"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"ResolveExternalValueResponse": {
|
|
310
|
+
"type": "object",
|
|
311
|
+
"required": [
|
|
312
|
+
"values",
|
|
313
|
+
"errors",
|
|
314
|
+
"policy"
|
|
315
|
+
],
|
|
316
|
+
"properties": {
|
|
317
|
+
"values": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"description": "Successfully extracted and coerced results, keyed by result id",
|
|
320
|
+
"additionalProperties": {
|
|
321
|
+
"oneOf": [
|
|
322
|
+
{
|
|
323
|
+
"type": "number"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"type": "boolean"
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
"errors": {
|
|
335
|
+
"type": "array",
|
|
336
|
+
"items": {
|
|
337
|
+
"$ref": "#/components/schemas/ExternalValueError"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"policy": {
|
|
341
|
+
"type": "object",
|
|
342
|
+
"required": [
|
|
343
|
+
"on_unavailable"
|
|
344
|
+
],
|
|
345
|
+
"properties": {
|
|
346
|
+
"on_unavailable": {
|
|
347
|
+
"type": "string",
|
|
348
|
+
"enum": [
|
|
349
|
+
"skip",
|
|
350
|
+
"block"
|
|
351
|
+
],
|
|
352
|
+
"description": "What the consumer should do when the values are unavailable"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"cached": {
|
|
357
|
+
"type": "boolean",
|
|
358
|
+
"description": "True when `values` were served from the hook's result cache"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"example": {
|
|
362
|
+
"values": {
|
|
363
|
+
"predicted": 132
|
|
364
|
+
},
|
|
365
|
+
"errors": [
|
|
366
|
+
{
|
|
367
|
+
"result_id": "limit",
|
|
368
|
+
"code": "coercion_failed",
|
|
369
|
+
"message": "Cannot coerce \"n/a\" to number"
|
|
370
|
+
}
|
|
371
|
+
],
|
|
372
|
+
"policy": {
|
|
373
|
+
"on_unavailable": "skip"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"ExternalValueResultSummary": {
|
|
378
|
+
"type": "object",
|
|
379
|
+
"required": [
|
|
380
|
+
"id",
|
|
381
|
+
"type",
|
|
382
|
+
"name"
|
|
383
|
+
],
|
|
384
|
+
"properties": {
|
|
385
|
+
"id": {
|
|
386
|
+
"type": "string"
|
|
387
|
+
},
|
|
388
|
+
"type": {
|
|
389
|
+
"$ref": "#/components/schemas/ExternalValueType"
|
|
390
|
+
},
|
|
391
|
+
"name": {
|
|
392
|
+
"$ref": "#/components/schemas/TranslatedString"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
"ExternalValueHookSummary": {
|
|
397
|
+
"type": "object",
|
|
398
|
+
"required": [
|
|
399
|
+
"app_id",
|
|
400
|
+
"app_name",
|
|
401
|
+
"hook_id",
|
|
402
|
+
"name",
|
|
403
|
+
"results"
|
|
404
|
+
],
|
|
405
|
+
"properties": {
|
|
406
|
+
"app_id": {
|
|
407
|
+
"type": "string"
|
|
408
|
+
},
|
|
409
|
+
"app_name": {
|
|
410
|
+
"type": "string"
|
|
411
|
+
},
|
|
412
|
+
"hook_id": {
|
|
413
|
+
"type": "string"
|
|
414
|
+
},
|
|
415
|
+
"name": {
|
|
416
|
+
"$ref": "#/components/schemas/TranslatedString"
|
|
417
|
+
},
|
|
418
|
+
"description": {
|
|
419
|
+
"$ref": "#/components/schemas/TranslatedString"
|
|
420
|
+
},
|
|
421
|
+
"results": {
|
|
422
|
+
"type": "array",
|
|
423
|
+
"items": {
|
|
424
|
+
"$ref": "#/components/schemas/ExternalValueResultSummary"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"ExternalValueHookList": {
|
|
430
|
+
"type": "object",
|
|
431
|
+
"required": [
|
|
432
|
+
"hooks"
|
|
433
|
+
],
|
|
434
|
+
"properties": {
|
|
435
|
+
"hooks": {
|
|
436
|
+
"type": "array",
|
|
437
|
+
"items": {
|
|
438
|
+
"$ref": "#/components/schemas/ExternalValueHookSummary"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"servers": [
|
|
446
|
+
{
|
|
447
|
+
"url": "https://external-values.sls.epilot.io"
|
|
448
|
+
}
|
|
449
|
+
]
|
|
450
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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.externalValues` | `@epilot/sdk/external-values` | [docs](./docs/external-values.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;
|
|
@@ -0,0 +1,7 @@
|
|
|
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.externalValues` | `@epilot/sdk/external-values` | [docs](./docs/external-values.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
|
+
};
|
|
@@ -26,6 +26,7 @@ var entity = "entity";
|
|
|
26
26
|
var entityMapping = "entity-mapping";
|
|
27
27
|
var environments = "environments";
|
|
28
28
|
var eventCatalog = "event-catalog";
|
|
29
|
+
var externalValues = "external-values";
|
|
29
30
|
var file = "file";
|
|
30
31
|
var iban = "iban";
|
|
31
32
|
var identity = "identity";
|
|
@@ -80,6 +81,7 @@ var index_default = {
|
|
|
80
81
|
entityMapping,
|
|
81
82
|
environments,
|
|
82
83
|
eventCatalog,
|
|
84
|
+
externalValues,
|
|
83
85
|
file,
|
|
84
86
|
iban,
|
|
85
87
|
identity,
|
|
@@ -164,4 +166,5 @@ var index_default = {
|
|
|
164
166
|
|
|
165
167
|
|
|
166
168
|
|
|
167
|
-
|
|
169
|
+
|
|
170
|
+
exports.accessToken = accessToken; exports.address = address; exports.addressSuggestions = addressSuggestions; exports.aiAgents = aiAgents; exports.app = app; exports.auditLogs = auditLogs; exports.automation = automation; exports.billing = billing; exports.blueprintManifest = blueprintManifest; exports.calendar = calendar; exports.chat = chat; exports.configurationHub = configurationHub; exports.consent = consent; exports.customerPortal = customerPortal; exports.dashboard = dashboard; exports.dataGovernance = dataGovernance; exports.deduplication = deduplication; exports.default = index_default; exports.design = design; exports.document = document; exports.emailSettings = emailSettings; exports.emailTemplate = emailTemplate; exports.entity = entity; exports.entityMapping = entityMapping; exports.environments = environments; exports.eventCatalog = eventCatalog; exports.externalValues = externalValues; exports.file = file; exports.iban = iban; exports.identity = identity; exports.integrationToolkit = integrationToolkit; exports.journey = journey; exports.kanban = kanban; exports.message = message; exports.metering = metering; exports.notes = notes; exports.notification = notification; exports.organization = organization; exports.partnerDirectory = partnerDirectory; exports.permissions = permissions; exports.pricing = pricing; exports.pricingTier = pricingTier; exports.purpose = purpose; exports.query = query; exports.sandbox = sandbox; exports.sharing = sharing; exports.snapshot = snapshot; exports.submission = submission; exports.targeting = targeting; exports.templateVariables = templateVariables; exports.user = user; exports.validationRules = validationRules; exports.webhooks = webhooks; exports.workflow = workflow; exports.workflowDefinition = workflowDefinition;
|
|
@@ -26,6 +26,7 @@ var entity = "entity";
|
|
|
26
26
|
var entityMapping = "entity-mapping";
|
|
27
27
|
var environments = "environments";
|
|
28
28
|
var eventCatalog = "event-catalog";
|
|
29
|
+
var externalValues = "external-values";
|
|
29
30
|
var file = "file";
|
|
30
31
|
var iban = "iban";
|
|
31
32
|
var identity = "identity";
|
|
@@ -80,6 +81,7 @@ var index_default = {
|
|
|
80
81
|
entityMapping,
|
|
81
82
|
environments,
|
|
82
83
|
eventCatalog,
|
|
84
|
+
externalValues,
|
|
83
85
|
file,
|
|
84
86
|
iban,
|
|
85
87
|
identity,
|
|
@@ -136,6 +138,7 @@ export {
|
|
|
136
138
|
entityMapping,
|
|
137
139
|
environments,
|
|
138
140
|
eventCatalog,
|
|
141
|
+
externalValues,
|
|
139
142
|
file,
|
|
140
143
|
iban,
|
|
141
144
|
identity,
|
|
@@ -6,25 +6,25 @@ var _chunkZMBA3WV4cjs = require('../chunk-ZMBA3WV4.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUVYQFUAOcjs = require('../chunk-UVYQFUAO.cjs');
|
|
10
10
|
require('../chunk-NJK5F5TF.cjs');
|
|
11
11
|
|
|
12
12
|
// src/apis/access-token.ts
|
|
13
13
|
var loadDefinition = () => {
|
|
14
14
|
const mod = _chunkZMBA3WV4cjs.require_access_token_runtime.call(void 0, );
|
|
15
|
-
return
|
|
15
|
+
return _chunkUVYQFUAOcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
16
16
|
};
|
|
17
17
|
var _instance = null;
|
|
18
18
|
var resolve = () => {
|
|
19
19
|
if (!_instance) {
|
|
20
20
|
const def = loadDefinition();
|
|
21
|
-
_instance =
|
|
21
|
+
_instance = _chunkUVYQFUAOcjs.createApiClient.call(void 0, { definition: def, apiName: "accessToken" });
|
|
22
22
|
}
|
|
23
23
|
return _instance;
|
|
24
24
|
};
|
|
25
|
-
var _handle =
|
|
25
|
+
var _handle = _chunkUVYQFUAOcjs.createApiHandle.call(void 0, {
|
|
26
26
|
resolveClient: resolve,
|
|
27
|
-
createClient: () =>
|
|
27
|
+
createClient: () => _chunkUVYQFUAOcjs.createApiClient.call(void 0, { definition: loadDefinition(), apiName: "accessToken" }),
|
|
28
28
|
apiName: "accessToken"
|
|
29
29
|
});
|
|
30
30
|
var getClient = _handle.getClient;
|
|
@@ -35,4 +35,4 @@ var accessToken = _handle;
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.accessToken = accessToken; exports.authorize =
|
|
38
|
+
exports.accessToken = accessToken; exports.authorize = _chunkUVYQFUAOcjs.authorize; exports.createClient = createClient; exports.getClient = getClient;
|