@epilot/sdk 2.20.75 → 2.20.77
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/definitions/app.json +82 -1
- package/definitions/environments.json +42 -2
- package/definitions/external-values.json +34 -4
- 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.d.cts +2 -2
- package/dist/apis/app.d.ts +2 -2
- 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.d.cts +2 -2
- package/dist/apis/environments.d.ts +2 -2
- 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 +6 -6
- package/dist/apis/external-values.d.cts +2 -2
- package/dist/apis/external-values.d.ts +2 -2
- package/dist/apis/external-values.js +1 -1
- 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/phone-integration.cjs +6 -6
- package/dist/apis/phone-integration.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/app-3WUZHA43.js +7 -0
- package/dist/app-7VPZV72D.cjs +7 -0
- package/dist/{app.d-CZELwNO3.d.cts → app.d-cnyQ-loP.d.cts} +46 -5
- package/dist/{app.d-CZELwNO3.d.ts → app.d-cnyQ-loP.d.ts} +46 -5
- package/dist/{chunk-6B5HXASK.js → chunk-C6T52ZOY.js} +3 -3
- package/dist/{chunk-JGPHZYSD.cjs → chunk-RZJMF6WE.cjs} +3 -3
- package/dist/environments-MKY6TF4Z.js +7 -0
- package/dist/environments-QII3AKWU.cjs +7 -0
- package/dist/{environments.d-qL1urwAq.d.cts → environments.d-BC2zAtBO.d.cts} +40 -28
- package/dist/{environments.d-qL1urwAq.d.ts → environments.d-BC2zAtBO.d.ts} +40 -28
- package/dist/external-values-66ANK66M.js +7 -0
- package/dist/external-values-WET4FHGU.cjs +7 -0
- package/dist/{external-values.d-23q55J5P.d.cts → external-values.d-DeDtCu_V.d.cts} +46 -12
- package/dist/{external-values.d-23q55J5P.d.ts → external-values.d-DeDtCu_V.d.ts} +46 -12
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/docs/app.md +60 -2
- package/docs/environments.md +4 -3
- package/docs/external-values.md +31 -2
- package/package.json +1 -1
- package/dist/app-CKQAJ7EE.js +0 -7
- package/dist/app-ERJHXY64.cjs +0 -7
- package/dist/environments-OYCH6VUD.js +0 -7
- package/dist/environments-S3O6ASTY.cjs +0 -7
- package/dist/external-values-7BS76RVR.js +0 -7
- package/dist/external-values-R2XB2ALG.cjs +0 -7
|
@@ -14,13 +14,15 @@ declare namespace Components {
|
|
|
14
14
|
}
|
|
15
15
|
namespace Schemas {
|
|
16
16
|
/**
|
|
17
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
18
|
-
*
|
|
17
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
18
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
19
|
+
* consumers ignore types they do not know.
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
22
|
export type ContextRequirement = /**
|
|
22
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
23
|
-
*
|
|
23
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
24
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
25
|
+
* consumers ignore types they do not know.
|
|
24
26
|
*
|
|
25
27
|
*/
|
|
26
28
|
/**
|
|
@@ -29,7 +31,16 @@ declare namespace Components {
|
|
|
29
31
|
* `{ type: entity, schema: contract }`.
|
|
30
32
|
*
|
|
31
33
|
*/
|
|
32
|
-
EntityContextRequirement
|
|
34
|
+
EntityContextRequirement | /**
|
|
35
|
+
* An optional scalar input. When the consumer has a value it supplies it under
|
|
36
|
+
* `Context.<name>` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the
|
|
37
|
+
* key is absent, so the hook template must provide a fallback, e.g.
|
|
38
|
+
* `{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` declares
|
|
39
|
+
* `{ type: value, name: reading_date, value_type: date }`. `name` is unique among the hook's
|
|
40
|
+
* `value` requirements and never equals the `schema` of one of its `entity` requirements.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
ValueContextRequirement;
|
|
33
44
|
/**
|
|
34
45
|
* The consumer supplies the bound entities of `schema` under `Context.<schema>`, e.g. a hook
|
|
35
46
|
* interpolating `{{ Context.contract[0].external_id }}` declares
|
|
@@ -83,13 +94,15 @@ declare namespace Components {
|
|
|
83
94
|
/**
|
|
84
95
|
* What the hook needs the consumer to supply in `context`, as declared in the hook
|
|
85
96
|
* config. Omitted when the hook declares none. A rule builder must require these
|
|
86
|
-
* contexts on any rule that uses the hook, so the
|
|
87
|
-
* More requirement types
|
|
97
|
+
* contexts (and offer these value inputs) on any rule that uses the hook, so the
|
|
98
|
+
* caller passes them in `context`. More requirement types may follow; consumers
|
|
99
|
+
* ignore types they do not know.
|
|
88
100
|
*
|
|
89
101
|
*/
|
|
90
102
|
contexts?: /**
|
|
91
|
-
* Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
92
|
-
*
|
|
103
|
+
* Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
104
|
+
* bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
105
|
+
* consumers ignore types they do not know.
|
|
93
106
|
*
|
|
94
107
|
*/
|
|
95
108
|
ContextRequirement[];
|
|
@@ -126,8 +139,9 @@ declare namespace Components {
|
|
|
126
139
|
*
|
|
127
140
|
* One entry per context requirement the consumer bound (see
|
|
128
141
|
* `ExternalValueHookSummary.contexts`): for an `entity` requirement, the bound
|
|
129
|
-
* entities of that schema under its schema slug
|
|
130
|
-
*
|
|
142
|
+
* entities of that schema under its schema slug; for a `value` requirement, the
|
|
143
|
+
* bound scalar under its `name` (e.g. `"reading_date": "2026-03-01"`), omitted when
|
|
144
|
+
* the consumer has no value. This API gives no name special treatment.
|
|
131
145
|
*
|
|
132
146
|
*/
|
|
133
147
|
context: {
|
|
@@ -194,6 +208,25 @@ declare namespace Components {
|
|
|
194
208
|
*/
|
|
195
209
|
en?: string | null;
|
|
196
210
|
}
|
|
211
|
+
/**
|
|
212
|
+
* An optional scalar input. When the consumer has a value it supplies it under
|
|
213
|
+
* `Context.<name>` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the
|
|
214
|
+
* key is absent, so the hook template must provide a fallback, e.g.
|
|
215
|
+
* `{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` declares
|
|
216
|
+
* `{ type: value, name: reading_date, value_type: date }`. `name` is unique among the hook's
|
|
217
|
+
* `value` requirements and never equals the `schema` of one of its `entity` requirements.
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
export interface ValueContextRequirement {
|
|
221
|
+
type: "value";
|
|
222
|
+
/**
|
|
223
|
+
* Key under `Context`, same pattern as validation rule parameter names.
|
|
224
|
+
* example:
|
|
225
|
+
* reading_date
|
|
226
|
+
*/
|
|
227
|
+
name: string; // ^[a-z][a-z0-9_]{0,63}$
|
|
228
|
+
value_type: ExternalValueType;
|
|
229
|
+
}
|
|
197
230
|
}
|
|
198
231
|
}
|
|
199
232
|
declare namespace Paths {
|
|
@@ -441,5 +474,6 @@ type ExternalValueType = Components.Schemas.ExternalValueType;
|
|
|
441
474
|
type ResolveExternalValueRequest = Components.Schemas.ResolveExternalValueRequest;
|
|
442
475
|
type ResolveExternalValueResponse = Components.Schemas.ResolveExternalValueResponse;
|
|
443
476
|
type TranslatedString = Components.Schemas.TranslatedString;
|
|
477
|
+
type ValueContextRequirement = Components.Schemas.ValueContextRequirement;
|
|
444
478
|
|
|
445
|
-
export { type Client as C, type EntityContextRequirement as E, type OperationMethods as O, Paths as P, type ResolveExternalValueRequest as R, type TranslatedString as T, Components as a, type PathsDictionary as b, type ContextRequirement as c, type ExternalValueError as d, type ExternalValueErrorCode as e, type ExternalValueHookList as f, type ExternalValueHookSummary as g, type ExternalValueResultSummary as h, type ExternalValueType as i, type ResolveExternalValueResponse as j };
|
|
479
|
+
export { type Client as C, type EntityContextRequirement as E, type OperationMethods as O, Paths as P, type ResolveExternalValueRequest as R, type TranslatedString as T, type ValueContextRequirement as V, Components as a, type PathsDictionary as b, type ContextRequirement as c, type ExternalValueError as d, type ExternalValueErrorCode as e, type ExternalValueHookList as f, type ExternalValueHookSummary as g, type ExternalValueResultSummary as h, type ExternalValueType as i, type ResolveExternalValueResponse as j };
|
package/dist/index.cjs
CHANGED
|
@@ -170,7 +170,7 @@ var _chunkWOUASZJWcjs = require('./chunk-WOUASZJW.cjs');
|
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
var
|
|
173
|
+
var _chunkRZJMF6WEcjs = require('./chunk-RZJMF6WE.cjs');
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
|
|
@@ -244,7 +244,7 @@ var resolveClient = (params) => {
|
|
|
244
244
|
}
|
|
245
245
|
if (!entry.instance) {
|
|
246
246
|
const definition = entry.loader();
|
|
247
|
-
entry.instance =
|
|
247
|
+
entry.instance = _chunkRZJMF6WEcjs.createApiClient.call(void 0, {
|
|
248
248
|
definition,
|
|
249
249
|
token: state.token,
|
|
250
250
|
headers: state.globalHeaders,
|
|
@@ -277,7 +277,7 @@ var resetAllClients = (registry) => {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
// src/apis/_registry.ts
|
|
280
|
-
var expandDef = (mod) =>
|
|
280
|
+
var expandDef = (mod) => _chunkRZJMF6WEcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
|
|
281
281
|
var registerBuiltinApis = (registry) => {
|
|
282
282
|
registerApi({
|
|
283
283
|
registry,
|
|
@@ -640,9 +640,9 @@ var createSDK = () => {
|
|
|
640
640
|
const available = [...registry.keys()].join(", ");
|
|
641
641
|
throw new Error(`Unknown API: "${name}". Available: ${available}`);
|
|
642
642
|
}
|
|
643
|
-
return
|
|
643
|
+
return _chunkRZJMF6WEcjs.createApiHandle.call(void 0, {
|
|
644
644
|
resolveClient: () => resolveClient({ registry, name, state }),
|
|
645
|
-
createClient: () =>
|
|
645
|
+
createClient: () => _chunkRZJMF6WEcjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
|
|
646
646
|
apiName: name
|
|
647
647
|
});
|
|
648
648
|
};
|
|
@@ -690,9 +690,9 @@ var createSDK = () => {
|
|
|
690
690
|
return interceptorUse;
|
|
691
691
|
}
|
|
692
692
|
case "help":
|
|
693
|
-
return (apiName) =>
|
|
693
|
+
return (apiName) => _chunkRZJMF6WEcjs.help.call(void 0, apiName);
|
|
694
694
|
case "openapi":
|
|
695
|
-
return (apiName) =>
|
|
695
|
+
return (apiName) => _chunkRZJMF6WEcjs.openapi.call(void 0, apiName);
|
|
696
696
|
case "then":
|
|
697
697
|
case "catch":
|
|
698
698
|
case "finally":
|
|
@@ -722,4 +722,4 @@ var epilot = createSDK();
|
|
|
722
722
|
|
|
723
723
|
|
|
724
724
|
|
|
725
|
-
exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize =
|
|
725
|
+
exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkRZJMF6WEcjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkRZJMF6WEcjs.help; exports.openapi = _chunkRZJMF6WEcjs.openapi;
|
package/dist/index.d.cts
CHANGED
|
@@ -7,7 +7,7 @@ import { C as Client } from './access-token.d-Yy-yrft_.cjs';
|
|
|
7
7
|
import { C as Client$1 } from './address.d-CwAPOVxa.cjs';
|
|
8
8
|
import { C as Client$2 } from './address-suggestions.d-_YwTOR-9.cjs';
|
|
9
9
|
import { C as Client$3 } from './ai-agents.d-BhnWCRxD.cjs';
|
|
10
|
-
import { C as Client$4 } from './app.d-
|
|
10
|
+
import { C as Client$4 } from './app.d-cnyQ-loP.cjs';
|
|
11
11
|
import { C as Client$5 } from './audit-logs.d-BRToFqeX.cjs';
|
|
12
12
|
import { C as Client$6 } from './automation.d-B8g3nYp-.cjs';
|
|
13
13
|
import { C as Client$7 } from './billing.d-DA3sViEF.cjs';
|
|
@@ -26,9 +26,9 @@ import { C as Client$j } from './email-settings.d-dCUXyPAZ.cjs';
|
|
|
26
26
|
import { C as Client$k } from './email-template.d-gtQkdaXM.cjs';
|
|
27
27
|
import { C as Client$l } from './entity.d-DlI8zhXF.cjs';
|
|
28
28
|
import { C as Client$m } from './entity-mapping.d-8MtWa2_L.cjs';
|
|
29
|
-
import { C as Client$n } from './environments.d-
|
|
29
|
+
import { C as Client$n } from './environments.d-BC2zAtBO.cjs';
|
|
30
30
|
import { C as Client$o } from './event-catalog.d-BrAxYS9D.cjs';
|
|
31
|
-
import { C as Client$p } from './external-values.d-
|
|
31
|
+
import { C as Client$p } from './external-values.d-DeDtCu_V.cjs';
|
|
32
32
|
import { C as Client$q } from './file.d-DELNV63w.cjs';
|
|
33
33
|
import { C as Client$r } from './iban.d-BwdiGbxi.cjs';
|
|
34
34
|
import { C as Client$s } from './identity.d-DUcoy_-W.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { C as Client } from './access-token.d-Yy-yrft_.js';
|
|
|
7
7
|
import { C as Client$1 } from './address.d-CwAPOVxa.js';
|
|
8
8
|
import { C as Client$2 } from './address-suggestions.d-_YwTOR-9.js';
|
|
9
9
|
import { C as Client$3 } from './ai-agents.d-BhnWCRxD.js';
|
|
10
|
-
import { C as Client$4 } from './app.d-
|
|
10
|
+
import { C as Client$4 } from './app.d-cnyQ-loP.js';
|
|
11
11
|
import { C as Client$5 } from './audit-logs.d-BRToFqeX.js';
|
|
12
12
|
import { C as Client$6 } from './automation.d-B8g3nYp-.js';
|
|
13
13
|
import { C as Client$7 } from './billing.d-DA3sViEF.js';
|
|
@@ -26,9 +26,9 @@ import { C as Client$j } from './email-settings.d-dCUXyPAZ.js';
|
|
|
26
26
|
import { C as Client$k } from './email-template.d-gtQkdaXM.js';
|
|
27
27
|
import { C as Client$l } from './entity.d-DlI8zhXF.js';
|
|
28
28
|
import { C as Client$m } from './entity-mapping.d-8MtWa2_L.js';
|
|
29
|
-
import { C as Client$n } from './environments.d-
|
|
29
|
+
import { C as Client$n } from './environments.d-BC2zAtBO.js';
|
|
30
30
|
import { C as Client$o } from './event-catalog.d-BrAxYS9D.js';
|
|
31
|
-
import { C as Client$p } from './external-values.d-
|
|
31
|
+
import { C as Client$p } from './external-values.d-DeDtCu_V.js';
|
|
32
32
|
import { C as Client$q } from './file.d-DELNV63w.js';
|
|
33
33
|
import { C as Client$r } from './iban.d-BwdiGbxi.js';
|
|
34
34
|
import { C as Client$s } from './identity.d-DUcoy_-W.js';
|
package/dist/index.js
CHANGED
package/docs/app.md
CHANGED
|
@@ -136,6 +136,9 @@ const { data } = await appClient.getPublicFacingComponent(...)
|
|
|
136
136
|
- [`ApiProxyConfig`](#apiproxyconfig)
|
|
137
137
|
- [`ExternalValuesConfig`](#externalvaluesconfig)
|
|
138
138
|
- [`ExternalValuesHook`](#externalvalueshook)
|
|
139
|
+
- [`ContextRequirement`](#contextrequirement)
|
|
140
|
+
- [`EntityContextRequirement`](#entitycontextrequirement)
|
|
141
|
+
- [`ValueContextRequirement`](#valuecontextrequirement)
|
|
139
142
|
- [`ExternalValuesResult`](#externalvaluesresult)
|
|
140
143
|
- [`Grants`](#grants)
|
|
141
144
|
- [`BlueprintRef`](#blueprintref)
|
|
@@ -2268,6 +2271,7 @@ type ExternalValuesComponent = {
|
|
|
2268
2271
|
result: { ... }
|
|
2269
2272
|
timeout_ms?: { ... }
|
|
2270
2273
|
on_unavailable?: { ... }
|
|
2274
|
+
contexts?: { ... }
|
|
2271
2275
|
cache?: { ... }
|
|
2272
2276
|
secure_proxy?: { ... }
|
|
2273
2277
|
}>
|
|
@@ -3797,6 +3801,14 @@ type ExternalValuesConfig = {
|
|
|
3797
3801
|
}>
|
|
3798
3802
|
timeout_ms?: number
|
|
3799
3803
|
on_unavailable?: "skip" | "block"
|
|
3804
|
+
contexts?: Array<{
|
|
3805
|
+
type: { ... }
|
|
3806
|
+
schema: { ... }
|
|
3807
|
+
} | {
|
|
3808
|
+
type: { ... }
|
|
3809
|
+
name: { ... }
|
|
3810
|
+
value_type: { ... }
|
|
3811
|
+
}>
|
|
3800
3812
|
cache?: {
|
|
3801
3813
|
ttl_seconds: { ... }
|
|
3802
3814
|
key?: { ... }
|
|
@@ -3811,9 +3823,9 @@ type ExternalValuesConfig = {
|
|
|
3811
3823
|
|
|
3812
3824
|
### `ExternalValuesHook`
|
|
3813
3825
|
|
|
3814
|
-
One external call that returns one or more typed results. Interpolated templates (Liquid) have access to `Context`, `Consumer`, `Options`, `Env` and — for `result` templates — `Response` and `AuthResponse` (each is also available snake_case, e.g. `{{ context.
|
|
3826
|
+
One external call that returns one or more typed results. Interpolated templates (Liquid) have access to `Context`, `Consumer`, `Options`, `Env` and — for `result` templates — `Response` and `AuthResponse` (each is also available snake_case, e.g. `{{ context.contract }}`).
|
|
3815
3827
|
|
|
3816
|
-
`Context` is the
|
|
3828
|
+
`Context` is the name → v
|
|
3817
3829
|
|
|
3818
3830
|
```ts
|
|
3819
3831
|
type ExternalValuesHook = {
|
|
@@ -3860,6 +3872,14 @@ type ExternalValuesHook = {
|
|
|
3860
3872
|
}>
|
|
3861
3873
|
timeout_ms?: number
|
|
3862
3874
|
on_unavailable?: "skip" | "block"
|
|
3875
|
+
contexts?: Array<{
|
|
3876
|
+
type: "entity"
|
|
3877
|
+
schema: string
|
|
3878
|
+
} | {
|
|
3879
|
+
type: "value"
|
|
3880
|
+
name: string
|
|
3881
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
3882
|
+
}>
|
|
3863
3883
|
cache?: {
|
|
3864
3884
|
ttl_seconds: number
|
|
3865
3885
|
key?: string
|
|
@@ -3871,6 +3891,44 @@ type ExternalValuesHook = {
|
|
|
3871
3891
|
}
|
|
3872
3892
|
```
|
|
3873
3893
|
|
|
3894
|
+
### `ContextRequirement`
|
|
3895
|
+
|
|
3896
|
+
A requirement a hook reads from `Context`, discriminated by `type`. More types will be added later; consumers must ignore types they do not know.
|
|
3897
|
+
|
|
3898
|
+
```ts
|
|
3899
|
+
type ContextRequirement = {
|
|
3900
|
+
type: "entity"
|
|
3901
|
+
schema: string
|
|
3902
|
+
} | {
|
|
3903
|
+
type: "value"
|
|
3904
|
+
name: string
|
|
3905
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
3906
|
+
}
|
|
3907
|
+
```
|
|
3908
|
+
|
|
3909
|
+
### `EntityContextRequirement`
|
|
3910
|
+
|
|
3911
|
+
The consumer supplies the bound entities of `schema` under `Context.`<schema>``.
|
|
3912
|
+
|
|
3913
|
+
```ts
|
|
3914
|
+
type EntityContextRequirement = {
|
|
3915
|
+
type: "entity"
|
|
3916
|
+
schema: string
|
|
3917
|
+
}
|
|
3918
|
+
```
|
|
3919
|
+
|
|
3920
|
+
### `ValueContextRequirement`
|
|
3921
|
+
|
|
3922
|
+
The consumer supplies one scalar value under `Context.`<name>``, e.g. a date the customer entered in a journey block. A value input is optional: the consumer sends it when it has a value and omits it otherwise, so the hook's templates must cope with its absence, e.g. `{{ Context.reading_date | default
|
|
3923
|
+
|
|
3924
|
+
```ts
|
|
3925
|
+
type ValueContextRequirement = {
|
|
3926
|
+
type: "value"
|
|
3927
|
+
name: string
|
|
3928
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
3929
|
+
}
|
|
3930
|
+
```
|
|
3931
|
+
|
|
3874
3932
|
### `ExternalValuesResult`
|
|
3875
3933
|
|
|
3876
3934
|
A single typed value extracted from the hook response. Exactly one of `template`, `path` or `jsonata` must be set.
|
package/docs/environments.md
CHANGED
|
@@ -308,9 +308,10 @@ const { data } = await client.deleteEnvironmentVariable({
|
|
|
308
308
|
### `EnvironmentValueType`
|
|
309
309
|
|
|
310
310
|
The structure a variable's value holds. `SecretString` is encrypted at rest and
|
|
311
|
-
its value is never returned.
|
|
312
|
-
may be served to browser-facing consumers
|
|
313
|
-
|
|
311
|
+
its value is never returned. Every other type
|
|
312
|
+
may be served to browser-facing consumers. A `List` inherits this from its element
|
|
313
|
+
type: a `List`<SecretString>`` is never served.
|
|
314
|
+
|
|
314
315
|
|
|
315
316
|
```ts
|
|
316
317
|
type EnvironmentValueType = "String" | "SecretString" | "Text" | "Number" | "Boolean" | "Map" | "JSON" | "Link" | "List"
|
package/docs/external-values.md
CHANGED
|
@@ -40,6 +40,7 @@ const { data } = await externalValuesClient.listExternalValues(...)
|
|
|
40
40
|
- [`ExternalValueHookSummary`](#externalvaluehooksummary)
|
|
41
41
|
- [`ContextRequirement`](#contextrequirement)
|
|
42
42
|
- [`EntityContextRequirement`](#entitycontextrequirement)
|
|
43
|
+
- [`ValueContextRequirement`](#valuecontextrequirement)
|
|
43
44
|
- [`ExternalValueHookList`](#externalvaluehooklist)
|
|
44
45
|
|
|
45
46
|
### `listExternalValues`
|
|
@@ -316,20 +317,29 @@ type ExternalValueHookSummary = {
|
|
|
316
317
|
contexts?: Array<{
|
|
317
318
|
type: "entity"
|
|
318
319
|
schema: string
|
|
320
|
+
} | {
|
|
321
|
+
type: "value"
|
|
322
|
+
name: string
|
|
323
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
319
324
|
}>
|
|
320
325
|
}
|
|
321
326
|
```
|
|
322
327
|
|
|
323
328
|
### `ContextRequirement`
|
|
324
329
|
|
|
325
|
-
Something a hook needs the consumer to supply in `context`, discriminated by `type
|
|
326
|
-
|
|
330
|
+
Something a hook needs the consumer to supply in `context`, discriminated by `type`:
|
|
331
|
+
bound entities (`entity`) or an optional scalar input (`value`). More types may follow;
|
|
332
|
+
consumers ignore types they do not know.
|
|
327
333
|
|
|
328
334
|
|
|
329
335
|
```ts
|
|
330
336
|
type ContextRequirement = {
|
|
331
337
|
type: "entity"
|
|
332
338
|
schema: string
|
|
339
|
+
} | {
|
|
340
|
+
type: "value"
|
|
341
|
+
name: string
|
|
342
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
333
343
|
}
|
|
334
344
|
```
|
|
335
345
|
|
|
@@ -347,6 +357,21 @@ type EntityContextRequirement = {
|
|
|
347
357
|
}
|
|
348
358
|
```
|
|
349
359
|
|
|
360
|
+
### `ValueContextRequirement`
|
|
361
|
+
|
|
362
|
+
An optional scalar input. When the consumer has a value it supplies it under
|
|
363
|
+
`Context.`<name>`` (dates as ISO 8601 strings, `YYYY-MM-DD` or a date-time); otherwise the
|
|
364
|
+
key is absent, so the hook template must provide a fallback, e.g.
|
|
365
|
+
`{{ Context.reading_date | default: "now" | date: "%Y-%m-%d" }}` dec
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
type ValueContextRequirement = {
|
|
369
|
+
type: "value"
|
|
370
|
+
name: string
|
|
371
|
+
value_type: "number" | "text" | "date" | "boolean"
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
350
375
|
### `ExternalValueHookList`
|
|
351
376
|
|
|
352
377
|
```ts
|
|
@@ -371,6 +396,10 @@ type ExternalValueHookList = {
|
|
|
371
396
|
contexts?: Array<{
|
|
372
397
|
type: { ... }
|
|
373
398
|
schema: { ... }
|
|
399
|
+
} | {
|
|
400
|
+
type: { ... }
|
|
401
|
+
name: { ... }
|
|
402
|
+
value_type: { ... }
|
|
374
403
|
}>
|
|
375
404
|
}>
|
|
376
405
|
}
|