@epilot/sdk 2.20.76 → 2.20.78

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 (147) hide show
  1. package/definitions/app.json +82 -1
  2. package/definitions/external-values.json +34 -4
  3. package/definitions/validation-rules.json +12 -4
  4. package/dist/apis/access-token.cjs +6 -6
  5. package/dist/apis/access-token.js +1 -1
  6. package/dist/apis/address-suggestions.cjs +6 -6
  7. package/dist/apis/address-suggestions.js +1 -1
  8. package/dist/apis/address.cjs +6 -6
  9. package/dist/apis/address.js +1 -1
  10. package/dist/apis/ai-agents.cjs +6 -6
  11. package/dist/apis/ai-agents.js +1 -1
  12. package/dist/apis/app.cjs +6 -6
  13. package/dist/apis/app.d.cts +2 -2
  14. package/dist/apis/app.d.ts +2 -2
  15. package/dist/apis/app.js +1 -1
  16. package/dist/apis/audit-logs.cjs +6 -6
  17. package/dist/apis/audit-logs.js +1 -1
  18. package/dist/apis/automation.cjs +6 -6
  19. package/dist/apis/automation.js +1 -1
  20. package/dist/apis/billing.cjs +6 -6
  21. package/dist/apis/billing.js +1 -1
  22. package/dist/apis/blueprint-manifest.cjs +6 -6
  23. package/dist/apis/blueprint-manifest.js +1 -1
  24. package/dist/apis/calendar.cjs +6 -6
  25. package/dist/apis/calendar.js +1 -1
  26. package/dist/apis/chat.cjs +6 -6
  27. package/dist/apis/chat.js +1 -1
  28. package/dist/apis/configuration-hub.cjs +6 -6
  29. package/dist/apis/configuration-hub.js +1 -1
  30. package/dist/apis/consent.cjs +6 -6
  31. package/dist/apis/consent.js +1 -1
  32. package/dist/apis/customer-portal.cjs +6 -6
  33. package/dist/apis/customer-portal.js +1 -1
  34. package/dist/apis/dashboard.cjs +6 -6
  35. package/dist/apis/dashboard.js +1 -1
  36. package/dist/apis/data-governance.cjs +6 -6
  37. package/dist/apis/data-governance.js +1 -1
  38. package/dist/apis/deduplication.cjs +6 -6
  39. package/dist/apis/deduplication.js +1 -1
  40. package/dist/apis/design.cjs +6 -6
  41. package/dist/apis/design.js +1 -1
  42. package/dist/apis/document.cjs +6 -6
  43. package/dist/apis/document.js +1 -1
  44. package/dist/apis/email-settings.cjs +6 -6
  45. package/dist/apis/email-settings.js +1 -1
  46. package/dist/apis/email-template.cjs +6 -6
  47. package/dist/apis/email-template.js +1 -1
  48. package/dist/apis/entity-mapping.cjs +6 -6
  49. package/dist/apis/entity-mapping.js +1 -1
  50. package/dist/apis/entity.cjs +6 -6
  51. package/dist/apis/entity.js +1 -1
  52. package/dist/apis/environments.cjs +6 -6
  53. package/dist/apis/environments.js +1 -1
  54. package/dist/apis/event-catalog.cjs +6 -6
  55. package/dist/apis/event-catalog.js +1 -1
  56. package/dist/apis/external-values.cjs +6 -6
  57. package/dist/apis/external-values.d.cts +2 -2
  58. package/dist/apis/external-values.d.ts +2 -2
  59. package/dist/apis/external-values.js +1 -1
  60. package/dist/apis/file.cjs +6 -6
  61. package/dist/apis/file.js +1 -1
  62. package/dist/apis/iban.cjs +6 -6
  63. package/dist/apis/iban.js +1 -1
  64. package/dist/apis/identity.cjs +6 -6
  65. package/dist/apis/identity.js +1 -1
  66. package/dist/apis/integration-toolkit.cjs +6 -6
  67. package/dist/apis/integration-toolkit.js +1 -1
  68. package/dist/apis/journey.cjs +6 -6
  69. package/dist/apis/journey.js +1 -1
  70. package/dist/apis/kanban.cjs +6 -6
  71. package/dist/apis/kanban.js +1 -1
  72. package/dist/apis/message.cjs +6 -6
  73. package/dist/apis/message.js +1 -1
  74. package/dist/apis/metering.cjs +6 -6
  75. package/dist/apis/metering.js +1 -1
  76. package/dist/apis/notes.cjs +6 -6
  77. package/dist/apis/notes.js +1 -1
  78. package/dist/apis/notification.cjs +6 -6
  79. package/dist/apis/notification.js +1 -1
  80. package/dist/apis/organization.cjs +6 -6
  81. package/dist/apis/organization.js +1 -1
  82. package/dist/apis/partner-directory.cjs +6 -6
  83. package/dist/apis/partner-directory.js +1 -1
  84. package/dist/apis/permissions.cjs +6 -6
  85. package/dist/apis/permissions.js +1 -1
  86. package/dist/apis/phone-integration.cjs +6 -6
  87. package/dist/apis/phone-integration.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.d.cts +2 -2
  114. package/dist/apis/validation-rules.d.ts +2 -2
  115. package/dist/apis/validation-rules.js +1 -1
  116. package/dist/apis/webhooks.cjs +6 -6
  117. package/dist/apis/webhooks.js +1 -1
  118. package/dist/apis/workflow-definition.cjs +6 -6
  119. package/dist/apis/workflow-definition.js +1 -1
  120. package/dist/apis/workflow.cjs +6 -6
  121. package/dist/apis/workflow.js +1 -1
  122. package/dist/app-3WUZHA43.js +7 -0
  123. package/dist/app-7VPZV72D.cjs +7 -0
  124. package/dist/{app.d-CZELwNO3.d.cts → app.d-cnyQ-loP.d.cts} +46 -5
  125. package/dist/{app.d-CZELwNO3.d.ts → app.d-cnyQ-loP.d.ts} +46 -5
  126. package/dist/{chunk-H65UWQLJ.cjs → chunk-M5Z7JYJ3.cjs} +3 -3
  127. package/dist/{chunk-OETNMHSD.js → chunk-ZREXF3XS.js} +3 -3
  128. package/dist/external-values-66ANK66M.js +7 -0
  129. package/dist/external-values-WET4FHGU.cjs +7 -0
  130. package/dist/{external-values.d-23q55J5P.d.cts → external-values.d-DeDtCu_V.d.cts} +46 -12
  131. package/dist/{external-values.d-23q55J5P.d.ts → external-values.d-DeDtCu_V.d.ts} +46 -12
  132. package/dist/index.cjs +8 -8
  133. package/dist/index.d.cts +3 -3
  134. package/dist/index.d.ts +3 -3
  135. package/dist/index.js +1 -1
  136. package/dist/{validation-rules-QYVRILMT.cjs → validation-rules-2XORVEWP.cjs} +1 -1
  137. package/dist/{validation-rules-D4OW6VYI.js → validation-rules-Y5BLH5AA.js} +1 -1
  138. package/dist/{validation-rules.d-C1OtLama.d.cts → validation-rules.d-Dw7Qn8_e.d.cts} +88 -40
  139. package/dist/{validation-rules.d-C1OtLama.d.ts → validation-rules.d-Dw7Qn8_e.d.ts} +88 -40
  140. package/docs/app.md +60 -2
  141. package/docs/external-values.md +31 -2
  142. package/docs/validation-rules.md +87 -50
  143. package/package.json +1 -1
  144. package/dist/app-CKQAJ7EE.js +0 -7
  145. package/dist/app-ERJHXY64.cjs +0 -7
  146. package/dist/external-values-7BS76RVR.js +0 -7
  147. package/dist/external-values-R2XB2ALG.cjs +0 -7
@@ -152,19 +152,24 @@ declare namespace Components {
152
152
  * are resolved only for authenticated consumers (epilot 360 users and portal end customers);
153
153
  * in public journeys the dependent conditions are skipped.
154
154
  *
155
+ * A hook may declare value inputs (`contexts` entries `{ "type": "value", "name", "value_type" }`)
156
+ * besides the entities it receives. `inputs` supplies them from rule parameters, which the
157
+ * consumer binds like any other parameter and sends to the hook as `Context.<name>`.
158
+ *
155
159
  */
156
160
  ExternalValue | /**
157
- * A comparison value supplied by the surface that evaluates the rule, identified by a name
158
- * the rule chooses (e.g. `start_date`). The rule stores the name only. The consuming surface
159
- * binds the name to a source of its own - a journey binds it to the value of another block -
160
- * and resolves it at evaluation time, so the rule never references the surface's objects
161
- * and stays reusable across journeys and forms.
161
+ * A comparison value supplied by the consumer that evaluates the rule, identified by a name
162
+ * the rule chooses (e.g. `start_date`). The rule stores the name only. The consumer binds the
163
+ * name to a source of its own - a journey binds it to the value of another block - and
164
+ * resolves it at evaluation time, so the rule never references the consumer's objects and
165
+ * stays reusable across journeys and forms.
162
166
  *
163
- * The kind a parameter is compared as follows from the field it sits in: `number`, `text`
164
- * or `date` for comparison values, range bounds, adjustment amounts and relative date
165
- * offsets, or a number, string or boolean as an `applies_when` value. One name is compared
166
- * as one kind throughout a rule; a rule using a name as two kinds is rejected at write time.
167
- * A parameter the surface leaves unbound or empty leaves the comparison unresolved.
167
+ * A parameter's kind is determined by the field it is used in: `number`, `text` or `date`
168
+ * for comparison values, range bounds, adjustment amounts and relative date offsets, or a
169
+ * number, string or boolean as an `applies_when` value, or the `value_type` of the External
170
+ * Values hook input it supplies (`ExternalValue.inputs`). One name is compared as one kind
171
+ * throughout a rule; a rule using a name as two kinds is rejected at write time. A parameter
172
+ * the consumer leaves unbound or empty leaves the comparison unresolved.
168
173
  *
169
174
  */
170
175
  ParameterValue | /* A lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive. */ RangeValue | /* No comparison value - used by unary operators such as notInFuture / notInPast. */ NoValue;
@@ -401,6 +406,10 @@ declare namespace Components {
401
406
  * are resolved only for authenticated consumers (epilot 360 users and portal end customers);
402
407
  * in public journeys the dependent conditions are skipped.
403
408
  *
409
+ * A hook may declare value inputs (`contexts` entries `{ "type": "value", "name", "value_type" }`)
410
+ * besides the entities it receives. `inputs` supplies them from rule parameters, which the
411
+ * consumer binds like any other parameter and sends to the hook as `Context.<name>`.
412
+ *
404
413
  */
405
414
  export interface ExternalValue {
406
415
  source: "external";
@@ -416,6 +425,34 @@ declare namespace Components {
416
425
  * ID of the result entry within the hook whose value is compared.
417
426
  */
418
427
  result_id: string; // ^[a-zA-Z0-9_-]+$
428
+ /**
429
+ * Values for the hook's value inputs, keyed by the input name the hook declares
430
+ * (`contexts` entry of type `value`), e.g. `{ "reading_date": { "source": "parameter", "name": "reading_date" } }`.
431
+ * Only parameters are supported. Write-time validation checks that every key is a value input the
432
+ * hook declares and uses the input's `value_type` (`number`, `text`, `date` or `boolean`) as the
433
+ * parameter's kind, so the parameter must not be compared as another kind elsewhere in the rule.
434
+ * An input parameter must not carry an adjustment. Declared inputs without an entry are allowed;
435
+ * the consumer omits an input that has no value.
436
+ *
437
+ */
438
+ inputs?: {
439
+ [name: string]: /**
440
+ * A comparison value supplied by the consumer that evaluates the rule, identified by a name
441
+ * the rule chooses (e.g. `start_date`). The rule stores the name only. The consumer binds the
442
+ * name to a source of its own - a journey binds it to the value of another block - and
443
+ * resolves it at evaluation time, so the rule never references the consumer's objects and
444
+ * stays reusable across journeys and forms.
445
+ *
446
+ * A parameter's kind is determined by the field it is used in: `number`, `text` or `date`
447
+ * for comparison values, range bounds, adjustment amounts and relative date offsets, or a
448
+ * number, string or boolean as an `applies_when` value, or the `value_type` of the External
449
+ * Values hook input it supplies (`ExternalValue.inputs`). One name is compared as one kind
450
+ * throughout a rule; a rule using a name as two kinds is rejected at write time. A parameter
451
+ * the consumer leaves unbound or empty leaves the comparison unresolved.
452
+ *
453
+ */
454
+ ParameterValue;
455
+ };
419
456
  adjust?: /**
420
457
  * Adjusts a context-resolved numeric value before comparison, e.g. "context value plus 10 percent".
421
458
  * Used to express tolerance bands such as "at most 10% above the current instalment amount".
@@ -597,17 +634,18 @@ declare namespace Components {
597
634
  */
598
635
  export type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals";
599
636
  /**
600
- * A comparison value supplied by the surface that evaluates the rule, identified by a name
601
- * the rule chooses (e.g. `start_date`). The rule stores the name only. The consuming surface
602
- * binds the name to a source of its own - a journey binds it to the value of another block -
603
- * and resolves it at evaluation time, so the rule never references the surface's objects
604
- * and stays reusable across journeys and forms.
637
+ * A comparison value supplied by the consumer that evaluates the rule, identified by a name
638
+ * the rule chooses (e.g. `start_date`). The rule stores the name only. The consumer binds the
639
+ * name to a source of its own - a journey binds it to the value of another block - and
640
+ * resolves it at evaluation time, so the rule never references the consumer's objects and
641
+ * stays reusable across journeys and forms.
605
642
  *
606
- * The kind a parameter is compared as follows from the field it sits in: `number`, `text`
607
- * or `date` for comparison values, range bounds, adjustment amounts and relative date
608
- * offsets, or a number, string or boolean as an `applies_when` value. One name is compared
609
- * as one kind throughout a rule; a rule using a name as two kinds is rejected at write time.
610
- * A parameter the surface leaves unbound or empty leaves the comparison unresolved.
643
+ * A parameter's kind is determined by the field it is used in: `number`, `text` or `date`
644
+ * for comparison values, range bounds, adjustment amounts and relative date offsets, or a
645
+ * number, string or boolean as an `applies_when` value, or the `value_type` of the External
646
+ * Values hook input it supplies (`ExternalValue.inputs`). One name is compared as one kind
647
+ * throughout a rule; a rule using a name as two kinds is rejected at write time. A parameter
648
+ * the consumer leaves unbound or empty leaves the comparison unresolved.
611
649
  *
612
650
  */
613
651
  export interface ParameterValue {
@@ -941,19 +979,24 @@ declare namespace Components {
941
979
  * are resolved only for authenticated consumers (epilot 360 users and portal end customers);
942
980
  * in public journeys the dependent conditions are skipped.
943
981
  *
982
+ * A hook may declare value inputs (`contexts` entries `{ "type": "value", "name", "value_type" }`)
983
+ * besides the entities it receives. `inputs` supplies them from rule parameters, which the
984
+ * consumer binds like any other parameter and sends to the hook as `Context.<name>`.
985
+ *
944
986
  */
945
987
  ExternalValue | /**
946
- * A comparison value supplied by the surface that evaluates the rule, identified by a name
947
- * the rule chooses (e.g. `start_date`). The rule stores the name only. The consuming surface
948
- * binds the name to a source of its own - a journey binds it to the value of another block -
949
- * and resolves it at evaluation time, so the rule never references the surface's objects
950
- * and stays reusable across journeys and forms.
988
+ * A comparison value supplied by the consumer that evaluates the rule, identified by a name
989
+ * the rule chooses (e.g. `start_date`). The rule stores the name only. The consumer binds the
990
+ * name to a source of its own - a journey binds it to the value of another block - and
991
+ * resolves it at evaluation time, so the rule never references the consumer's objects and
992
+ * stays reusable across journeys and forms.
951
993
  *
952
- * The kind a parameter is compared as follows from the field it sits in: `number`, `text`
953
- * or `date` for comparison values, range bounds, adjustment amounts and relative date
954
- * offsets, or a number, string or boolean as an `applies_when` value. One name is compared
955
- * as one kind throughout a rule; a rule using a name as two kinds is rejected at write time.
956
- * A parameter the surface leaves unbound or empty leaves the comparison unresolved.
994
+ * A parameter's kind is determined by the field it is used in: `number`, `text` or `date`
995
+ * for comparison values, range bounds, adjustment amounts and relative date offsets, or a
996
+ * number, string or boolean as an `applies_when` value, or the `value_type` of the External
997
+ * Values hook input it supplies (`ExternalValue.inputs`). One name is compared as one kind
998
+ * throughout a rule; a rule using a name as two kinds is rejected at write time. A parameter
999
+ * the consumer leaves unbound or empty leaves the comparison unresolved.
957
1000
  *
958
1001
  */
959
1002
  ParameterValue;
@@ -1279,19 +1322,24 @@ declare namespace Components {
1279
1322
  * are resolved only for authenticated consumers (epilot 360 users and portal end customers);
1280
1323
  * in public journeys the dependent conditions are skipped.
1281
1324
  *
1325
+ * A hook may declare value inputs (`contexts` entries `{ "type": "value", "name", "value_type" }`)
1326
+ * besides the entities it receives. `inputs` supplies them from rule parameters, which the
1327
+ * consumer binds like any other parameter and sends to the hook as `Context.<name>`.
1328
+ *
1282
1329
  */
1283
1330
  ExternalValue | /**
1284
- * A comparison value supplied by the surface that evaluates the rule, identified by a name
1285
- * the rule chooses (e.g. `start_date`). The rule stores the name only. The consuming surface
1286
- * binds the name to a source of its own - a journey binds it to the value of another block -
1287
- * and resolves it at evaluation time, so the rule never references the surface's objects
1288
- * and stays reusable across journeys and forms.
1331
+ * A comparison value supplied by the consumer that evaluates the rule, identified by a name
1332
+ * the rule chooses (e.g. `start_date`). The rule stores the name only. The consumer binds the
1333
+ * name to a source of its own - a journey binds it to the value of another block - and
1334
+ * resolves it at evaluation time, so the rule never references the consumer's objects and
1335
+ * stays reusable across journeys and forms.
1289
1336
  *
1290
- * The kind a parameter is compared as follows from the field it sits in: `number`, `text`
1291
- * or `date` for comparison values, range bounds, adjustment amounts and relative date
1292
- * offsets, or a number, string or boolean as an `applies_when` value. One name is compared
1293
- * as one kind throughout a rule; a rule using a name as two kinds is rejected at write time.
1294
- * A parameter the surface leaves unbound or empty leaves the comparison unresolved.
1337
+ * A parameter's kind is determined by the field it is used in: `number`, `text` or `date`
1338
+ * for comparison values, range bounds, adjustment amounts and relative date offsets, or a
1339
+ * number, string or boolean as an `applies_when` value, or the `value_type` of the External
1340
+ * Values hook input it supplies (`ExternalValue.inputs`). One name is compared as one kind
1341
+ * throughout a rule; a rule using a name as two kinds is rejected at write time. A parameter
1342
+ * the consumer leaves unbound or empty leaves the comparison unresolved.
1295
1343
  *
1296
1344
  */
1297
1345
  ParameterValue;
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.input }}`).
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 single name
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.
@@ -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
- Today only `entity`; more types will follow. Consumers ignore types they do not know.
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
  }