@epilot/sdk 2.18.12 → 2.18.14

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 (144) hide show
  1. package/definitions/app-runtime.json +1 -1
  2. package/definitions/app.json +170 -38
  3. package/definitions/validation-rules-runtime.json +1 -1
  4. package/definitions/validation-rules.json +840 -37
  5. package/dist/apis/access-token.cjs +6 -6
  6. package/dist/apis/access-token.js +1 -1
  7. package/dist/apis/address-suggestions.cjs +6 -6
  8. package/dist/apis/address-suggestions.js +1 -1
  9. package/dist/apis/address.cjs +6 -6
  10. package/dist/apis/address.js +1 -1
  11. package/dist/apis/ai-agents.cjs +6 -6
  12. package/dist/apis/ai-agents.js +1 -1
  13. package/dist/apis/app.cjs +8 -8
  14. package/dist/apis/app.d.cts +2 -2
  15. package/dist/apis/app.d.ts +2 -2
  16. package/dist/apis/app.js +2 -2
  17. package/dist/apis/audit-logs.cjs +6 -6
  18. package/dist/apis/audit-logs.js +1 -1
  19. package/dist/apis/automation.cjs +6 -6
  20. package/dist/apis/automation.js +1 -1
  21. package/dist/apis/billing.cjs +6 -6
  22. package/dist/apis/billing.js +1 -1
  23. package/dist/apis/blueprint-manifest.cjs +6 -6
  24. package/dist/apis/blueprint-manifest.js +1 -1
  25. package/dist/apis/calendar.cjs +6 -6
  26. package/dist/apis/calendar.js +1 -1
  27. package/dist/apis/configuration-hub.cjs +6 -6
  28. package/dist/apis/configuration-hub.js +1 -1
  29. package/dist/apis/consent.cjs +6 -6
  30. package/dist/apis/consent.js +1 -1
  31. package/dist/apis/customer-portal.cjs +6 -6
  32. package/dist/apis/customer-portal.js +1 -1
  33. package/dist/apis/dashboard.cjs +6 -6
  34. package/dist/apis/dashboard.js +1 -1
  35. package/dist/apis/data-governance.cjs +6 -6
  36. package/dist/apis/data-governance.js +1 -1
  37. package/dist/apis/deduplication.cjs +6 -6
  38. package/dist/apis/deduplication.js +1 -1
  39. package/dist/apis/design.cjs +6 -6
  40. package/dist/apis/design.js +1 -1
  41. package/dist/apis/document.cjs +6 -6
  42. package/dist/apis/document.js +1 -1
  43. package/dist/apis/email-settings.cjs +6 -6
  44. package/dist/apis/email-settings.js +1 -1
  45. package/dist/apis/email-template.cjs +6 -6
  46. package/dist/apis/email-template.js +1 -1
  47. package/dist/apis/entity-mapping.cjs +6 -6
  48. package/dist/apis/entity-mapping.js +1 -1
  49. package/dist/apis/entity.cjs +6 -6
  50. package/dist/apis/entity.js +1 -1
  51. package/dist/apis/environments.cjs +6 -6
  52. package/dist/apis/environments.js +1 -1
  53. package/dist/apis/event-catalog.cjs +6 -6
  54. package/dist/apis/event-catalog.js +1 -1
  55. package/dist/apis/file.cjs +6 -6
  56. package/dist/apis/file.js +1 -1
  57. package/dist/apis/iban.cjs +6 -6
  58. package/dist/apis/iban.js +1 -1
  59. package/dist/apis/integration-toolkit.cjs +6 -6
  60. package/dist/apis/integration-toolkit.js +1 -1
  61. package/dist/apis/journey.cjs +6 -6
  62. package/dist/apis/journey.js +1 -1
  63. package/dist/apis/kanban.cjs +6 -6
  64. package/dist/apis/kanban.js +1 -1
  65. package/dist/apis/message.cjs +6 -6
  66. package/dist/apis/message.js +1 -1
  67. package/dist/apis/metering.cjs +6 -6
  68. package/dist/apis/metering.js +1 -1
  69. package/dist/apis/notes.cjs +6 -6
  70. package/dist/apis/notes.js +1 -1
  71. package/dist/apis/notification.cjs +6 -6
  72. package/dist/apis/notification.js +1 -1
  73. package/dist/apis/organization.cjs +6 -6
  74. package/dist/apis/organization.js +1 -1
  75. package/dist/apis/partner-directory.cjs +6 -6
  76. package/dist/apis/partner-directory.js +1 -1
  77. package/dist/apis/permissions.cjs +6 -6
  78. package/dist/apis/permissions.js +1 -1
  79. package/dist/apis/pricing-tier.cjs +6 -6
  80. package/dist/apis/pricing-tier.js +1 -1
  81. package/dist/apis/pricing.cjs +6 -6
  82. package/dist/apis/pricing.js +1 -1
  83. package/dist/apis/purpose.cjs +6 -6
  84. package/dist/apis/purpose.js +1 -1
  85. package/dist/apis/query.cjs +6 -6
  86. package/dist/apis/query.js +1 -1
  87. package/dist/apis/sandbox.cjs +6 -6
  88. package/dist/apis/sandbox.js +1 -1
  89. package/dist/apis/sharing.cjs +6 -6
  90. package/dist/apis/sharing.js +1 -1
  91. package/dist/apis/snapshot.cjs +6 -6
  92. package/dist/apis/snapshot.js +1 -1
  93. package/dist/apis/submission.cjs +6 -6
  94. package/dist/apis/submission.js +1 -1
  95. package/dist/apis/target.cjs +6 -6
  96. package/dist/apis/target.js +1 -1
  97. package/dist/apis/targeting.cjs +6 -6
  98. package/dist/apis/targeting.js +1 -1
  99. package/dist/apis/template-variables.cjs +6 -6
  100. package/dist/apis/template-variables.js +1 -1
  101. package/dist/apis/user.cjs +6 -6
  102. package/dist/apis/user.js +1 -1
  103. package/dist/apis/validation-rules.cjs +8 -8
  104. package/dist/apis/validation-rules.d.cts +2 -2
  105. package/dist/apis/validation-rules.d.ts +2 -2
  106. package/dist/apis/validation-rules.js +2 -2
  107. package/dist/apis/webhooks.cjs +6 -6
  108. package/dist/apis/webhooks.js +1 -1
  109. package/dist/apis/workflow-definition.cjs +6 -6
  110. package/dist/apis/workflow-definition.js +1 -1
  111. package/dist/apis/workflow.cjs +6 -6
  112. package/dist/apis/workflow.js +1 -1
  113. package/dist/app-A7P5LKNL.cjs +7 -0
  114. package/dist/app-EEEBOCVZ.js +7 -0
  115. package/dist/app-runtime-AAQHTC7F.cjs +5 -0
  116. package/dist/{app-runtime-6T473MHJ.js → app-runtime-NBGFHFT2.js} +1 -1
  117. package/dist/{app.d-B5s8GfqF.d.cts → app.d-vPrbhe5h.d.cts} +202 -39
  118. package/dist/{app.d-B5s8GfqF.d.ts → app.d-vPrbhe5h.d.ts} +202 -39
  119. package/dist/{chunk-4LZNHNK7.js → chunk-6X7EGWOK.js} +4 -4
  120. package/dist/chunk-HRSCAD3W.cjs +14 -0
  121. package/dist/chunk-PPX45U34.js +14 -0
  122. package/dist/{chunk-R6N6H5M2.cjs → chunk-S7UE54HY.cjs} +4 -4
  123. package/dist/{chunk-ZEOU24C3.js → chunk-TNRT33VQ.js} +1 -1
  124. package/dist/{chunk-W6BCTQLU.cjs → chunk-XHVIF7AC.cjs} +1 -1
  125. package/dist/index.cjs +12 -12
  126. package/dist/index.d.cts +2 -2
  127. package/dist/index.d.ts +2 -2
  128. package/dist/index.js +3 -3
  129. package/dist/validation-rules-CU5JJKDV.cjs +7 -0
  130. package/dist/validation-rules-M2JVIR7U.js +7 -0
  131. package/dist/{validation-rules-runtime-X7M3QE5I.cjs → validation-rules-runtime-DENVKYLF.cjs} +2 -2
  132. package/dist/{validation-rules-runtime-6MRCS5X2.js → validation-rules-runtime-VGLVHV36.js} +1 -1
  133. package/dist/{validation-rules.d-Db5c5zTf.d.ts → validation-rules.d-BBy6Cw2O.d.cts} +519 -46
  134. package/dist/{validation-rules.d-Db5c5zTf.d.cts → validation-rules.d-BBy6Cw2O.d.ts} +519 -46
  135. package/docs/app.md +375 -106
  136. package/docs/validation-rules.md +417 -31
  137. package/package.json +1 -1
  138. package/dist/app-5GFMQJQP.cjs +0 -7
  139. package/dist/app-YY2NCNQ2.js +0 -7
  140. package/dist/app-runtime-2QBLB4AK.cjs +0 -5
  141. package/dist/chunk-7IKQIVUS.js +0 -14
  142. package/dist/chunk-JIUTCNTB.cjs +0 -14
  143. package/dist/validation-rules-P6F5P73P.js +0 -7
  144. package/dist/validation-rules-VDU3CIZV.cjs +0 -7
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  var _chunkX2LMHC5Rcjs = require('./chunk-X2LMHC5R.cjs');
4
4
 
5
5
 
6
- var _chunkJIUTCNTBcjs = require('./chunk-JIUTCNTB.cjs');
6
+ var _chunkHRSCAD3Wcjs = require('./chunk-HRSCAD3W.cjs');
7
7
 
8
8
 
9
9
  var _chunkNGGI52NVcjs = require('./chunk-NGGI52NV.cjs');
@@ -144,7 +144,7 @@ var _chunkT67ZXTVGcjs = require('./chunk-T67ZXTVG.cjs');
144
144
  var _chunkGD6KHA54cjs = require('./chunk-GD6KHA54.cjs');
145
145
 
146
146
 
147
- var _chunkW6BCTQLUcjs = require('./chunk-W6BCTQLU.cjs');
147
+ var _chunkXHVIF7ACcjs = require('./chunk-XHVIF7AC.cjs');
148
148
 
149
149
 
150
150
  var _chunkRUZRPIHWcjs = require('./chunk-RUZRPIHW.cjs');
@@ -158,7 +158,7 @@ var _chunkADSWGLIVcjs = require('./chunk-ADSWGLIV.cjs');
158
158
 
159
159
 
160
160
 
161
- var _chunkR6N6H5M2cjs = require('./chunk-R6N6H5M2.cjs');
161
+ var _chunkS7UE54HYcjs = require('./chunk-S7UE54HY.cjs');
162
162
 
163
163
 
164
164
  var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
@@ -225,7 +225,7 @@ var resolveClient = (params) => {
225
225
  }
226
226
  if (!entry.instance) {
227
227
  const definition = entry.loader();
228
- entry.instance = _chunkR6N6H5M2cjs.createApiClient.call(void 0, {
228
+ entry.instance = _chunkS7UE54HYcjs.createApiClient.call(void 0, {
229
229
  definition,
230
230
  token: state.token,
231
231
  headers: state.globalHeaders,
@@ -258,7 +258,7 @@ var resetAllClients = (registry) => {
258
258
  };
259
259
 
260
260
  // src/apis/_registry.ts
261
- var expandDef = (mod) => _chunkR6N6H5M2cjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
261
+ var expandDef = (mod) => _chunkS7UE54HYcjs.expand.call(void 0, _nullishCoalesce(mod.default, () => ( mod)));
262
262
  var registerBuiltinApis = (registry) => {
263
263
  registerApi({
264
264
  registry,
@@ -283,7 +283,7 @@ var registerBuiltinApis = (registry) => {
283
283
  registerApi({
284
284
  registry,
285
285
  name: "app",
286
- loader: () => expandDef(_chunkW6BCTQLUcjs.require_app_runtime.call(void 0, ))
286
+ loader: () => expandDef(_chunkXHVIF7ACcjs.require_app_runtime.call(void 0, ))
287
287
  });
288
288
  registerApi({
289
289
  registry,
@@ -498,7 +498,7 @@ var registerBuiltinApis = (registry) => {
498
498
  registerApi({
499
499
  registry,
500
500
  name: "validationRules",
501
- loader: () => expandDef(_chunkJIUTCNTBcjs.require_validation_rules_runtime.call(void 0, ))
501
+ loader: () => expandDef(_chunkHRSCAD3Wcjs.require_validation_rules_runtime.call(void 0, ))
502
502
  });
503
503
  registerApi({
504
504
  registry,
@@ -601,9 +601,9 @@ var createSDK = () => {
601
601
  const available = [...registry.keys()].join(", ");
602
602
  throw new Error(`Unknown API: "${name}". Available: ${available}`);
603
603
  }
604
- return _chunkR6N6H5M2cjs.createApiHandle.call(void 0, {
604
+ return _chunkS7UE54HYcjs.createApiHandle.call(void 0, {
605
605
  resolveClient: () => resolveClient({ registry, name, state }),
606
- createClient: () => _chunkR6N6H5M2cjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
606
+ createClient: () => _chunkS7UE54HYcjs.createApiClient.call(void 0, { definition: entry.loader(), apiName: name }),
607
607
  apiName: name
608
608
  });
609
609
  };
@@ -651,9 +651,9 @@ var createSDK = () => {
651
651
  return interceptorUse;
652
652
  }
653
653
  case "help":
654
- return (apiName) => _chunkR6N6H5M2cjs.help.call(void 0, apiName);
654
+ return (apiName) => _chunkS7UE54HYcjs.help.call(void 0, apiName);
655
655
  case "openapi":
656
- return (apiName) => _chunkR6N6H5M2cjs.openapi.call(void 0, apiName);
656
+ return (apiName) => _chunkS7UE54HYcjs.openapi.call(void 0, apiName);
657
657
  case "then":
658
658
  case "catch":
659
659
  case "finally":
@@ -683,4 +683,4 @@ var epilot = createSDK();
683
683
 
684
684
 
685
685
 
686
- exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkR6N6H5M2cjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkR6N6H5M2cjs.help; exports.openapi = _chunkR6N6H5M2cjs.openapi;
686
+ exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkS7UE54HYcjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot; exports.help = _chunkS7UE54HYcjs.help; exports.openapi = _chunkS7UE54HYcjs.openapi;
package/dist/index.d.cts CHANGED
@@ -7,7 +7,7 @@ import { C as Client } from './access-token.d-BhRUc8I-.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-BnR7CAeJ.cjs';
10
- import { C as Client$4 } from './app.d-B5s8GfqF.cjs';
10
+ import { C as Client$4 } from './app.d-vPrbhe5h.cjs';
11
11
  import { C as Client$5 } from './audit-logs.d-BRToFqeX.cjs';
12
12
  import { C as Client$6 } from './automation.d-DiWfPkLs.cjs';
13
13
  import { C as Client$7 } from './billing.d-N_1F759g.cjs';
@@ -50,7 +50,7 @@ import { C as Client$H } from './submission.d-BamwfhXw.cjs';
50
50
  import { C as Client$I } from './targeting.d-DaK3kwZg.cjs';
51
51
  import { C as Client$J } from './template-variables.d-Ble9TSBa.cjs';
52
52
  import { C as Client$K } from './user.d-rqYtwsCz.cjs';
53
- import { C as Client$L } from './validation-rules.d-Db5c5zTf.cjs';
53
+ import { C as Client$L } from './validation-rules.d-BBy6Cw2O.cjs';
54
54
  import { C as Client$M } from './webhooks.d-DqOEzFsp.cjs';
55
55
  import { C as Client$N } from './workflow.d-5cyNJgVQ.cjs';
56
56
  import { C as Client$O } from './workflow-definition.d-CweGhhBU.cjs';
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { C as Client } from './access-token.d-BhRUc8I-.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-BnR7CAeJ.js';
10
- import { C as Client$4 } from './app.d-B5s8GfqF.js';
10
+ import { C as Client$4 } from './app.d-vPrbhe5h.js';
11
11
  import { C as Client$5 } from './audit-logs.d-BRToFqeX.js';
12
12
  import { C as Client$6 } from './automation.d-DiWfPkLs.js';
13
13
  import { C as Client$7 } from './billing.d-N_1F759g.js';
@@ -50,7 +50,7 @@ import { C as Client$H } from './submission.d-BamwfhXw.js';
50
50
  import { C as Client$I } from './targeting.d-DaK3kwZg.js';
51
51
  import { C as Client$J } from './template-variables.d-Ble9TSBa.js';
52
52
  import { C as Client$K } from './user.d-rqYtwsCz.js';
53
- import { C as Client$L } from './validation-rules.d-Db5c5zTf.js';
53
+ import { C as Client$L } from './validation-rules.d-BBy6Cw2O.js';
54
54
  import { C as Client$M } from './webhooks.d-DqOEzFsp.js';
55
55
  import { C as Client$N } from './workflow.d-5cyNJgVQ.js';
56
56
  import { C as Client$O } from './workflow-definition.d-CweGhhBU.js';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-N254AABZ.js";
4
4
  import {
5
5
  require_validation_rules_runtime
6
- } from "./chunk-7IKQIVUS.js";
6
+ } from "./chunk-PPX45U34.js";
7
7
  import {
8
8
  require_webhooks_runtime
9
9
  } from "./chunk-OV4MYZR5.js";
@@ -144,7 +144,7 @@ import {
144
144
  } from "./chunk-IZ6OQZZ2.js";
145
145
  import {
146
146
  require_app_runtime
147
- } from "./chunk-ZEOU24C3.js";
147
+ } from "./chunk-TNRT33VQ.js";
148
148
  import {
149
149
  require_audit_logs_runtime
150
150
  } from "./chunk-RELUU5QZ.js";
@@ -158,7 +158,7 @@ import {
158
158
  expand,
159
159
  help,
160
160
  openapi
161
- } from "./chunk-4LZNHNK7.js";
161
+ } from "./chunk-6X7EGWOK.js";
162
162
  import {
163
163
  __require
164
164
  } from "./chunk-YPSWSI3M.js";
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-NJK5F5TF.cjs');
2
+
3
+ // src/docs/validation-rules.json
4
+ var validation_rules_default = '# Validation Rules API\n\n- **Full API Docs:** [https://docs.epilot.io/api/validation-rules](https://docs.epilot.io/api/validation-rules)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.validationRules.getValidationRules(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/validation-rules\'\n\nconst validationRulesClient = getClient()\nauthorize(validationRulesClient, () => \'<token>\')\nconst { data } = await validationRulesClient.getValidationRules(...)\n```\n\n## Operations\n\n**Validation Rules**\n- [`getValidationRules`](#getvalidationrules)\n- [`createValidationRule`](#createvalidationrule)\n- [`getValidationRuleById`](#getvalidationrulebyid)\n- [`updateValidationRule`](#updatevalidationrule)\n- [`deleteValidationRule`](#deletevalidationrule)\n- [`addUsedByReference`](#addusedbyreference)\n- [`removeUsedByReference`](#removeusedbyreference)\n\n**Schemas**\n- [`GetValidationRulesResponse`](#getvalidationrulesresponse)\n- [`CreateValidationRuleRequest`](#createvalidationrulerequest)\n- [`UpdateValidationRuleRequest`](#updatevalidationrulerequest)\n- [`ValidationRuleBase`](#validationrulebase)\n- [`ValidationRule`](#validationrule)\n- [`UsedBy`](#usedby)\n- [`RegexRuleType`](#regexruletype)\n- [`PatternRuleType`](#patternruletype)\n- [`NumericRuleType`](#numericruletype)\n- [`RegexCondition`](#regexcondition)\n- [`RegexNestedCondition`](#regexnestedcondition)\n- [`RegexFactCondition`](#regexfactcondition)\n- [`PatternCondition`](#patterncondition)\n- [`PatternNestedCondition`](#patternnestedcondition)\n- [`PatternFactCondition`](#patternfactcondition)\n- [`NumericCondition`](#numericcondition)\n- [`NumericNestedCondition`](#numericnestedcondition)\n- [`NumericFactCondition`](#numericfactcondition)\n- [`ComparisonRuleType`](#comparisonruletype)\n- [`Condition`](#condition)\n- [`Operator`](#operator)\n- [`ConditionValue`](#conditionvalue)\n- [`ScalarValue`](#scalarvalue)\n- [`StaticValue`](#staticvalue)\n- [`ContextValue`](#contextvalue)\n- [`ValueAdjustment`](#valueadjustment)\n- [`RelativeDateValue`](#relativedatevalue)\n- [`RangeValue`](#rangevalue)\n- [`NoValue`](#novalue)\n- [`ContextRequirement`](#contextrequirement)\n\n### `getValidationRules`\n\nReturns all validation rules belonging to the authenticated user\'s organization.\n\n`GET /v1/validation-rules`\n\n```ts\nconst { data } = await client.getValidationRules()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createValidationRule`\n\nCreates a new validation rule for the authenticated organization.\n\n`POST /v1/validation-rules`\n\n```ts\nconst { data } = await client.createValidationRule(\n null,\n {\n title: \'string\',\n placeholder: \'string\',\n used_by: [\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n }\n ],\n rule: {\n type: \'regex\',\n conditions: {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n },\n {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n }\n ]\n }\n ]\n }\n },\n contexts: [\n {\n schema: \'contract\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getValidationRuleById`\n\nRetrieves a specific validation rule by its unique ID.\n\n`GET /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.getValidationRuleById({\n ruleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateValidationRule`\n\nPartially updates an existing validation rule by ID. Only the fields provided in the request body are updated.\n\n`PATCH /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.updateValidationRule(\n {\n ruleId: \'example\',\n },\n {\n title: \'string\',\n placeholder: \'string\',\n used_by: [\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n }\n ],\n rule: {\n type: \'regex\',\n conditions: {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n },\n {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n }\n ]\n }\n ]\n }\n },\n contexts: [\n {\n schema: \'contract\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteValidationRule`\n\nPermanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated before deletion.\n\n`DELETE /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.deleteValidationRule({\n ruleId: \'example\',\n})\n```\n\n---\n\n### `addUsedByReference`\n\nAdds a single `used_by` reference to an existing validation rule.\n\n`POST /v1/validation-rules/{ruleId}/used-by`\n\n```ts\nconst { data } = await client.addUsedByReference(\n {\n ruleId: \'example\',\n },\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `removeUsedByReference`\n\nRemoves a specific `used_by` reference from an existing validation rule.\n\n`DELETE /v1/validation-rules/{ruleId}/used-by`\n\n```ts\nconst { data } = await client.removeUsedByReference(\n {\n ruleId: \'example\',\n },\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `GetValidationRulesResponse`\n\nResponse envelope for listing all validation rules within an organization.\n\n```ts\ntype GetValidationRulesResponse = {\n results?: Array<{\n _schema_version: string\n _id: string\n _organization_id: string\n created_at: string\n updated_at: string\n created_by: string\n updated_by: string\n }>\n}\n```\n\n### `CreateValidationRuleRequest`\n\n```ts\ntype CreateValidationRuleRequest = object\n```\n\n### `UpdateValidationRuleRequest`\n\n```ts\ntype UpdateValidationRuleRequest = {\n title?: string\n placeholder?: string\n used_by?: Array<{\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n }>\n rule?: {\n type: "regex"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "pattern"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "numeric"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: { ... }\n operator: { ... }\n value: { ... }\n error_message: { ... }\n allow_failure?: { ... }\n }>\n }\n contexts?: Array<{\n schema: string\n }>\n}\n```\n\n### `ValidationRuleBase`\n\n```ts\ntype ValidationRuleBase = {\n title?: string\n placeholder?: string\n used_by?: Array<{\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n }>\n rule?: {\n type: "regex"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "pattern"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "numeric"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: { ... }\n operator: { ... }\n value: { ... }\n error_message: { ... }\n allow_failure?: { ... }\n }>\n }\n contexts?: Array<{\n schema: string\n }>\n}\n```\n\n### `ValidationRule`\n\nThe Validation rule definition.\n\n```ts\ntype ValidationRule = {\n _schema_version: string\n _id: string\n _organization_id: string\n created_at: string\n updated_at: string\n created_by: string\n updated_by: string\n}\n```\n\n### `UsedBy`\n\nDescribes where and how a validation rule is applied. Used to track associations between rules and the journeys or entity schemas that reference them.\n\n```ts\ntype UsedBy = {\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n}\n```\n\n### `RegexRuleType`\n\nValidation rule that uses a regular expression to validate input.\n\n```ts\ntype RegexRuleType = {\n type: "regex"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `PatternRuleType`\n\nValidation rule that uses a sequence of patterns to validate input.\n\n```ts\ntype PatternRuleType = {\n type: "pattern"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `NumericRuleType`\n\nValidation rule for numeric values, supporting range and digit count constraints.\n\n```ts\ntype NumericRuleType = {\n type: "numeric"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `RegexCondition`\n\nCondition definition for a regex-based validation rule (2 levels deep)\n\n```ts\ntype RegexCondition = {\n all: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n not: {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }\n}\n```\n\n### `RegexNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype RegexNestedCondition = {\n all: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n not: {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }\n}\n```\n\n### `RegexFactCondition`\n\nFact-based condition for regex validation\n\n```ts\ntype RegexFactCondition = {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: string\n }\n}\n```\n\n### `PatternCondition`\n\nCondition definition for a pattern-based validation rule (2 levels deep)\n\n```ts\ntype PatternCondition = {\n all: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n // ...\n}\n```\n\n### `PatternNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype PatternNestedCondition = {\n all: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n }>\n} | {\n not: {\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n // ...\n}\n```\n\n### `PatternFactCondition`\n\nFact-based condition for pattern validation\n\n```ts\ntype PatternFactCondition = {\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n}\n```\n\n### `NumericCondition`\n\nCondition definition for a numeric-based validation rule (2 levels deep)\n\n```ts\ntype NumericCondition = {\n all: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "numeric-value" | "total-length"\n // ...\n}\n```\n\n### `NumericNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype NumericNestedCondition = {\n all: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n not: {\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }\n}\n```\n\n### `NumericFactCondition`\n\nFact-based condition for numeric validation\n\n```ts\ntype NumericFactCondition = {\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: string\n }\n} | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: string\n allowLeadingZeroes?: boolean\n }\n} | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: string\n }\n} | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: string\n }\n}\n```\n\n### `ComparisonRuleType`\n\nDeclarative validation rule (schema version v2). Supports predefined comparison operators\nover number, date and text inputs, with static, dynamic (context path) and relative-date\ncomparison values.\n\n\n```ts\ntype ComparisonRuleType = {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n value: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n } | {\n source: { ... }\n min: { ... }\n max: { ... }\n } | {\n source: { ... }\n }\n error_message: string\n allow_failure?: boolean\n }>\n}\n```\n\n### `Condition`\n\nA single comparison the input value must satisfy.\n\n```ts\ntype Condition = {\n id: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n value: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n } | {\n source: "range"\n min: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n }\n max: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n }\n } | {\n source: "none"\n }\n error_message: string\n allow_failure?: boolean\n}\n```\n\n### `Operator`\n\nPredefined comparison operator. Compatibility (enforced at write time):\n- number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch\n- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch\n- text:\n\n```ts\ntype Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n```\n\n### `ConditionValue`\n\nThe comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).\n\n```ts\ntype ConditionValue = {\n source: "static"\n data: number | string | boolean\n} | {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n} | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n} | {\n source: "range"\n min: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n max: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n} | {\n source: "none"\n}\n```\n\n### `ScalarValue`\n\nA single comparison value - static, resolved from context, or a relative date.\n\n```ts\ntype ScalarValue = {\n source: "static"\n data: number | string | boolean\n} | {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n} | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n}\n```\n\n### `StaticValue`\n\nA fixed comparison value.\n\n```ts\ntype StaticValue = {\n source: "static"\n data: number | string | boolean\n}\n```\n\n### `ContextValue`\n\nA dynamic comparison value resolved from runtime context, e.g. `contract.installment_amount`\nor `previous_reading.value`. The first path segment must match the `name` of a declared\ncontext requirement.\n\n\n```ts\ntype ContextValue = {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n}\n```\n\n### `ValueAdjustment`\n\nAdjusts a context-resolved numeric value before comparison, e.g. "context value plus 10 percent".\nUsed to express tolerance bands such as "at most 10% above the current instalment amount".\n\n\n```ts\ntype ValueAdjustment = {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n}\n```\n\n### `RelativeDateValue`\n\nA date relative to the evaluation moment, e.g. "today minus 30 days". Only valid for date rules.\n\n```ts\ntype RelativeDateValue = {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n}\n```\n\n### `RangeValue`\n\nA lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.\n\n```ts\ntype RangeValue = {\n source: "range"\n min: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n max: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n}\n```\n\n### `NoValue`\n\nNo comparison value - used by unary operators such as notInFuture / notInPast.\n\n```ts\ntype NoValue = {\n source: "none"\n}\n```\n\n### `ContextRequirement`\n\nAn entity context source the rule needs at evaluation time, referenced by `context`\nvalue paths via the schema slug as their first segment (e.g. `contract.installment_amount`).\nHow the source is resolved (which entity instance) is decided by the consuming surface,\nnot by the rule. Meter reading comp\n\n```ts\ntype ContextRequirement = {\n schema: string\n}\n```\n';
5
+
6
+
7
+ exports.default = validation_rules_default;
@@ -0,0 +1,7 @@
1
+ import "./chunk-YPSWSI3M.js";
2
+
3
+ // src/docs/validation-rules.json
4
+ var validation_rules_default = '# Validation Rules API\n\n- **Full API Docs:** [https://docs.epilot.io/api/validation-rules](https://docs.epilot.io/api/validation-rules)\n\n## Usage\n\n```ts\nimport { epilot } from \'@epilot/sdk\'\n\nepilot.authorize(() => \'<token>\')\nconst { data } = await epilot.validationRules.getValidationRules(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from \'@epilot/sdk/validation-rules\'\n\nconst validationRulesClient = getClient()\nauthorize(validationRulesClient, () => \'<token>\')\nconst { data } = await validationRulesClient.getValidationRules(...)\n```\n\n## Operations\n\n**Validation Rules**\n- [`getValidationRules`](#getvalidationrules)\n- [`createValidationRule`](#createvalidationrule)\n- [`getValidationRuleById`](#getvalidationrulebyid)\n- [`updateValidationRule`](#updatevalidationrule)\n- [`deleteValidationRule`](#deletevalidationrule)\n- [`addUsedByReference`](#addusedbyreference)\n- [`removeUsedByReference`](#removeusedbyreference)\n\n**Schemas**\n- [`GetValidationRulesResponse`](#getvalidationrulesresponse)\n- [`CreateValidationRuleRequest`](#createvalidationrulerequest)\n- [`UpdateValidationRuleRequest`](#updatevalidationrulerequest)\n- [`ValidationRuleBase`](#validationrulebase)\n- [`ValidationRule`](#validationrule)\n- [`UsedBy`](#usedby)\n- [`RegexRuleType`](#regexruletype)\n- [`PatternRuleType`](#patternruletype)\n- [`NumericRuleType`](#numericruletype)\n- [`RegexCondition`](#regexcondition)\n- [`RegexNestedCondition`](#regexnestedcondition)\n- [`RegexFactCondition`](#regexfactcondition)\n- [`PatternCondition`](#patterncondition)\n- [`PatternNestedCondition`](#patternnestedcondition)\n- [`PatternFactCondition`](#patternfactcondition)\n- [`NumericCondition`](#numericcondition)\n- [`NumericNestedCondition`](#numericnestedcondition)\n- [`NumericFactCondition`](#numericfactcondition)\n- [`ComparisonRuleType`](#comparisonruletype)\n- [`Condition`](#condition)\n- [`Operator`](#operator)\n- [`ConditionValue`](#conditionvalue)\n- [`ScalarValue`](#scalarvalue)\n- [`StaticValue`](#staticvalue)\n- [`ContextValue`](#contextvalue)\n- [`ValueAdjustment`](#valueadjustment)\n- [`RelativeDateValue`](#relativedatevalue)\n- [`RangeValue`](#rangevalue)\n- [`NoValue`](#novalue)\n- [`ContextRequirement`](#contextrequirement)\n\n### `getValidationRules`\n\nReturns all validation rules belonging to the authenticated user\'s organization.\n\n`GET /v1/validation-rules`\n\n```ts\nconst { data } = await client.getValidationRules()\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "results": [\n {\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n }\n ]\n}\n```\n\n</details>\n\n---\n\n### `createValidationRule`\n\nCreates a new validation rule for the authenticated organization.\n\n`POST /v1/validation-rules`\n\n```ts\nconst { data } = await client.createValidationRule(\n null,\n {\n title: \'string\',\n placeholder: \'string\',\n used_by: [\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n }\n ],\n rule: {\n type: \'regex\',\n conditions: {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n },\n {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n }\n ]\n }\n ]\n }\n },\n contexts: [\n {\n schema: \'contract\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `getValidationRuleById`\n\nRetrieves a specific validation rule by its unique ID.\n\n`GET /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.getValidationRuleById({\n ruleId: \'example\',\n})\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `updateValidationRule`\n\nPartially updates an existing validation rule by ID. Only the fields provided in the request body are updated.\n\n`PATCH /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.updateValidationRule(\n {\n ruleId: \'example\',\n },\n {\n title: \'string\',\n placeholder: \'string\',\n used_by: [\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n }\n ],\n rule: {\n type: \'regex\',\n conditions: {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n },\n {\n all: [\n {\n fact: \'inputValue\',\n operator: \'regexMatch\',\n value: \'string\',\n params: {\n errorMessage: \'string\'\n }\n }\n ]\n }\n ]\n }\n },\n contexts: [\n {\n schema: \'contract\'\n }\n ]\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `deleteValidationRule`\n\nPermanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated before deletion.\n\n`DELETE /v1/validation-rules/{ruleId}`\n\n```ts\nconst { data } = await client.deleteValidationRule({\n ruleId: \'example\',\n})\n```\n\n---\n\n### `addUsedByReference`\n\nAdds a single `used_by` reference to an existing validation rule.\n\n`POST /v1/validation-rules/{ruleId}/used-by`\n\n```ts\nconst { data } = await client.addUsedByReference(\n {\n ruleId: \'example\',\n },\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n### `removeUsedByReference`\n\nRemoves a specific `used_by` reference from an existing validation rule.\n\n`DELETE /v1/validation-rules/{ruleId}/used-by`\n\n```ts\nconst { data } = await client.removeUsedByReference(\n {\n ruleId: \'example\',\n },\n {\n type: \'journey\',\n source_id: \'journey-xyz789\'\n },\n)\n```\n\n<details>\n<summary>Response</summary>\n\n```json\n{\n "title": "string",\n "placeholder": "string",\n "used_by": [\n {\n "type": "journey",\n "source_id": "journey-xyz789"\n }\n ],\n "rule": {\n "type": "regex",\n "conditions": {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n },\n {\n "all": [\n {\n "fact": "inputValue",\n "operator": "regexMatch",\n "value": "string",\n "params": {\n "errorMessage": "string"\n }\n }\n ]\n }\n ]\n }\n },\n "contexts": [\n {\n "schema": "contract"\n }\n ],\n "_schema_version": "string",\n "_id": "string",\n "_organization_id": "string",\n "created_at": "string",\n "updated_at": "string",\n "created_by": "string",\n "updated_by": "string"\n}\n```\n\n</details>\n\n---\n\n## Schemas\n\n### `GetValidationRulesResponse`\n\nResponse envelope for listing all validation rules within an organization.\n\n```ts\ntype GetValidationRulesResponse = {\n results?: Array<{\n _schema_version: string\n _id: string\n _organization_id: string\n created_at: string\n updated_at: string\n created_by: string\n updated_by: string\n }>\n}\n```\n\n### `CreateValidationRuleRequest`\n\n```ts\ntype CreateValidationRuleRequest = object\n```\n\n### `UpdateValidationRuleRequest`\n\n```ts\ntype UpdateValidationRuleRequest = {\n title?: string\n placeholder?: string\n used_by?: Array<{\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n }>\n rule?: {\n type: "regex"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "pattern"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "numeric"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: { ... }\n operator: { ... }\n value: { ... }\n error_message: { ... }\n allow_failure?: { ... }\n }>\n }\n contexts?: Array<{\n schema: string\n }>\n}\n```\n\n### `ValidationRuleBase`\n\n```ts\ntype ValidationRuleBase = {\n title?: string\n placeholder?: string\n used_by?: Array<{\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n }>\n rule?: {\n type: "regex"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "pattern"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n type: "numeric"\n conditions: {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n } | {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: { ... }\n operator: { ... }\n value: { ... }\n error_message: { ... }\n allow_failure?: { ... }\n }>\n }\n contexts?: Array<{\n schema: string\n }>\n}\n```\n\n### `ValidationRule`\n\nThe Validation rule definition.\n\n```ts\ntype ValidationRule = {\n _schema_version: string\n _id: string\n _organization_id: string\n created_at: string\n updated_at: string\n created_by: string\n updated_by: string\n}\n```\n\n### `UsedBy`\n\nDescribes where and how a validation rule is applied. Used to track associations between rules and the journeys or entity schemas that reference them.\n\n```ts\ntype UsedBy = {\n type: "journey" | "entity"\n schema_slug?: string\n source_id?: string\n}\n```\n\n### `RegexRuleType`\n\nValidation rule that uses a regular expression to validate input.\n\n```ts\ntype RegexRuleType = {\n type: "regex"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `PatternRuleType`\n\nValidation rule that uses a sequence of patterns to validate input.\n\n```ts\ntype PatternRuleType = {\n type: "pattern"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `NumericRuleType`\n\nValidation rule for numeric values, supporting range and digit count constraints.\n\n```ts\ntype NumericRuleType = {\n type: "numeric"\n conditions: {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n all: { ... }\n } | {\n any: { ... }\n } | {\n not: { ... }\n }\n }\n}\n```\n\n### `RegexCondition`\n\nCondition definition for a regex-based validation rule (2 levels deep)\n\n```ts\ntype RegexCondition = {\n all: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n not: {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }\n}\n```\n\n### `RegexNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype RegexNestedCondition = {\n all: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n not: {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: { ... }\n }\n }\n}\n```\n\n### `RegexFactCondition`\n\nFact-based condition for regex validation\n\n```ts\ntype RegexFactCondition = {\n fact: "inputValue"\n operator: "regexMatch"\n value: string\n params?: {\n errorMessage?: string\n }\n}\n```\n\n### `PatternCondition`\n\nCondition definition for a pattern-based validation rule (2 levels deep)\n\n```ts\ntype PatternCondition = {\n all: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n // ...\n}\n```\n\n### `PatternNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype PatternNestedCondition = {\n all: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n }>\n} | {\n not: {\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n start?: { ... }\n end?: { ... }\n }\n } | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n // ...\n}\n```\n\n### `PatternFactCondition`\n\nFact-based condition for pattern validation\n\n```ts\ntype PatternFactCondition = {\n fact: "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check" | "total-length"\n operator: "exactlyNDigits"\n value: number\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check"\n operator: "in" | "notIn" | "contains" | "doesNotContain"\n value: string[]\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n} | {\n fact: "static-check"\n operator: "equal" | "notEqual"\n value: string\n params?: {\n errorMessage?: string\n start?: number\n end?: number\n }\n}\n```\n\n### `NumericCondition`\n\nCondition definition for a numeric-based validation rule (2 levels deep)\n\n```ts\ntype NumericCondition = {\n all: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n } | {\n all: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n any: Array<{\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }>\n } | {\n not: {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n } | {\n fact: { ... }\n operator: { ... }\n value: { ... }\n params?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "numeric-value" | "total-length"\n // ...\n}\n```\n\n### `NumericNestedCondition`\n\nNested condition with logical operators (level 2 only)\n\n```ts\ntype NumericNestedCondition = {\n all: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n any: Array<{\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }>\n} | {\n not: {\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n allowLeadingZeroes?: { ... }\n }\n } | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: { ... }\n }\n } | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: { ... }\n }\n }\n}\n```\n\n### `NumericFactCondition`\n\nFact-based condition for numeric validation\n\n```ts\ntype NumericFactCondition = {\n fact: "numeric-value" | "total-length"\n operator: "equal" | "notEqual" | "lessThan" | "lessThanInclusive" | "greaterThan" | "greaterThanInclusive"\n value: number\n params?: {\n errorMessage?: string\n }\n} | {\n fact: "integer-digits-count"\n operator: "equal" | "exactlyNDigits" | "minIntegerDigits" | "maxIntegerDigits"\n value: number\n params?: {\n errorMessage?: string\n allowLeadingZeroes?: boolean\n }\n} | {\n fact: "decimal-digits-count"\n operator: "equal" | "minDecimalDigits" | "maxDecimalDigits"\n value: number\n params?: {\n errorMessage?: string\n }\n} | {\n fact: "has-leading-zeroes"\n operator: "equal" | "notAllowed"\n value: boolean\n params?: {\n errorMessage?: string\n }\n}\n```\n\n### `ComparisonRuleType`\n\nDeclarative validation rule (schema version v2). Supports predefined comparison operators\nover number, date and text inputs, with static, dynamic (context path) and relative-date\ncomparison values.\n\n\n```ts\ntype ComparisonRuleType = {\n input_type: "number" | "date" | "text"\n conditions: Array<{\n id: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n value: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n } | {\n source: { ... }\n min: { ... }\n max: { ... }\n } | {\n source: { ... }\n }\n error_message: string\n allow_failure?: boolean\n }>\n}\n```\n\n### `Condition`\n\nA single comparison the input value must satisfy.\n\n```ts\ntype Condition = {\n id: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n value: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n } | {\n source: "range"\n min: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n }\n max: {\n source: { ... }\n data: { ... }\n } | {\n source: { ... }\n path: { ... }\n adjust?: { ... }\n } | {\n source: { ... }\n offset: { ... }\n unit: { ... }\n anchor?: { ... }\n }\n } | {\n source: "none"\n }\n error_message: string\n allow_failure?: boolean\n}\n```\n\n### `Operator`\n\nPredefined comparison operator. Compatibility (enforced at write time):\n- number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch\n- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch\n- text:\n\n```ts\ntype Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"\n```\n\n### `ConditionValue`\n\nThe comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).\n\n```ts\ntype ConditionValue = {\n source: "static"\n data: number | string | boolean\n} | {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n} | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n} | {\n source: "range"\n min: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n max: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n} | {\n source: "none"\n}\n```\n\n### `ScalarValue`\n\nA single comparison value - static, resolved from context, or a relative date.\n\n```ts\ntype ScalarValue = {\n source: "static"\n data: number | string | boolean\n} | {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n} | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n}\n```\n\n### `StaticValue`\n\nA fixed comparison value.\n\n```ts\ntype StaticValue = {\n source: "static"\n data: number | string | boolean\n}\n```\n\n### `ContextValue`\n\nA dynamic comparison value resolved from runtime context, e.g. `contract.installment_amount`\nor `previous_reading.value`. The first path segment must match the `name` of a declared\ncontext requirement.\n\n\n```ts\ntype ContextValue = {\n source: "context"\n path: string\n adjust?: {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n }\n}\n```\n\n### `ValueAdjustment`\n\nAdjusts a context-resolved numeric value before comparison, e.g. "context value plus 10 percent".\nUsed to express tolerance bands such as "at most 10% above the current instalment amount".\n\n\n```ts\ntype ValueAdjustment = {\n type: "percent" | "absolute"\n value: number\n direction: "increase" | "decrease"\n}\n```\n\n### `RelativeDateValue`\n\nA date relative to the evaluation moment, e.g. "today minus 30 days". Only valid for date rules.\n\n```ts\ntype RelativeDateValue = {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n}\n```\n\n### `RangeValue`\n\nA lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.\n\n```ts\ntype RangeValue = {\n source: "range"\n min: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n max: {\n source: "static"\n data: number | string | boolean\n } | {\n source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n }\n } | {\n source: "relative_date"\n offset: number\n unit: "days" | "months" | "years"\n anchor?: "today"\n }\n}\n```\n\n### `NoValue`\n\nNo comparison value - used by unary operators such as notInFuture / notInPast.\n\n```ts\ntype NoValue = {\n source: "none"\n}\n```\n\n### `ContextRequirement`\n\nAn entity context source the rule needs at evaluation time, referenced by `context`\nvalue paths via the schema slug as their first segment (e.g. `contract.installment_amount`).\nHow the source is resolved (which entity instance) is decided by the consuming surface,\nnot by the rule. Meter reading comp\n\n```ts\ntype ContextRequirement = {\n schema: string\n}\n```\n';
5
+ export {
6
+ validation_rules_default as default
7
+ };
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJIUTCNTBcjs = require('./chunk-JIUTCNTB.cjs');
3
+ var _chunkHRSCAD3Wcjs = require('./chunk-HRSCAD3W.cjs');
4
4
  require('./chunk-NJK5F5TF.cjs');
5
- exports. default = _chunkJIUTCNTBcjs.require_validation_rules_runtime.call(void 0, );
5
+ exports. default = _chunkHRSCAD3Wcjs.require_validation_rules_runtime.call(void 0, );
@@ -1,5 +1,5 @@
1
1
  import {
2
2
  require_validation_rules_runtime
3
- } from "./chunk-7IKQIVUS.js";
3
+ } from "./chunk-PPX45U34.js";
4
4
  import "./chunk-YPSWSI3M.js";
5
5
  export default require_validation_rules_runtime();