@epilot/sdk 2.18.32 → 2.18.34

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 (138) hide show
  1. package/definitions/integration-toolkit.json +29 -11
  2. package/definitions/validation-rules-runtime.json +1 -1
  3. package/definitions/validation-rules.json +9 -3
  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.js +1 -1
  14. package/dist/apis/audit-logs.cjs +6 -6
  15. package/dist/apis/audit-logs.js +1 -1
  16. package/dist/apis/automation.cjs +6 -6
  17. package/dist/apis/automation.js +1 -1
  18. package/dist/apis/billing.cjs +6 -6
  19. package/dist/apis/billing.js +1 -1
  20. package/dist/apis/blueprint-manifest.cjs +6 -6
  21. package/dist/apis/blueprint-manifest.js +1 -1
  22. package/dist/apis/calendar.cjs +6 -6
  23. package/dist/apis/calendar.js +1 -1
  24. package/dist/apis/configuration-hub.cjs +6 -6
  25. package/dist/apis/configuration-hub.js +1 -1
  26. package/dist/apis/consent.cjs +6 -6
  27. package/dist/apis/consent.js +1 -1
  28. package/dist/apis/customer-portal.cjs +6 -6
  29. package/dist/apis/customer-portal.js +1 -1
  30. package/dist/apis/dashboard.cjs +6 -6
  31. package/dist/apis/dashboard.js +1 -1
  32. package/dist/apis/data-governance.cjs +6 -6
  33. package/dist/apis/data-governance.js +1 -1
  34. package/dist/apis/deduplication.cjs +6 -6
  35. package/dist/apis/deduplication.js +1 -1
  36. package/dist/apis/design.cjs +6 -6
  37. package/dist/apis/design.js +1 -1
  38. package/dist/apis/document.cjs +6 -6
  39. package/dist/apis/document.js +1 -1
  40. package/dist/apis/email-settings.cjs +6 -6
  41. package/dist/apis/email-settings.js +1 -1
  42. package/dist/apis/email-template.cjs +6 -6
  43. package/dist/apis/email-template.js +1 -1
  44. package/dist/apis/entity-mapping.cjs +6 -6
  45. package/dist/apis/entity-mapping.js +1 -1
  46. package/dist/apis/entity.cjs +6 -6
  47. package/dist/apis/entity.js +1 -1
  48. package/dist/apis/environments.cjs +6 -6
  49. package/dist/apis/environments.js +1 -1
  50. package/dist/apis/event-catalog.cjs +6 -6
  51. package/dist/apis/event-catalog.js +1 -1
  52. package/dist/apis/file.cjs +6 -6
  53. package/dist/apis/file.js +1 -1
  54. package/dist/apis/iban.cjs +6 -6
  55. package/dist/apis/iban.js +1 -1
  56. package/dist/apis/integration-toolkit.cjs +6 -6
  57. package/dist/apis/integration-toolkit.d.cts +2 -2
  58. package/dist/apis/integration-toolkit.d.ts +2 -2
  59. package/dist/apis/integration-toolkit.js +1 -1
  60. package/dist/apis/journey.cjs +6 -6
  61. package/dist/apis/journey.js +1 -1
  62. package/dist/apis/kanban.cjs +6 -6
  63. package/dist/apis/kanban.js +1 -1
  64. package/dist/apis/message.cjs +6 -6
  65. package/dist/apis/message.js +1 -1
  66. package/dist/apis/metering.cjs +6 -6
  67. package/dist/apis/metering.js +1 -1
  68. package/dist/apis/notes.cjs +6 -6
  69. package/dist/apis/notes.js +1 -1
  70. package/dist/apis/notification.cjs +6 -6
  71. package/dist/apis/notification.js +1 -1
  72. package/dist/apis/organization.cjs +6 -6
  73. package/dist/apis/organization.js +1 -1
  74. package/dist/apis/partner-directory.cjs +6 -6
  75. package/dist/apis/partner-directory.js +1 -1
  76. package/dist/apis/permissions.cjs +6 -6
  77. package/dist/apis/permissions.js +1 -1
  78. package/dist/apis/pricing-tier.cjs +6 -6
  79. package/dist/apis/pricing-tier.js +1 -1
  80. package/dist/apis/pricing.cjs +6 -6
  81. package/dist/apis/pricing.js +1 -1
  82. package/dist/apis/purpose.cjs +6 -6
  83. package/dist/apis/purpose.js +1 -1
  84. package/dist/apis/query.cjs +6 -6
  85. package/dist/apis/query.js +1 -1
  86. package/dist/apis/sandbox.cjs +6 -6
  87. package/dist/apis/sandbox.js +1 -1
  88. package/dist/apis/sharing.cjs +6 -6
  89. package/dist/apis/sharing.js +1 -1
  90. package/dist/apis/snapshot.cjs +6 -6
  91. package/dist/apis/snapshot.js +1 -1
  92. package/dist/apis/submission.cjs +6 -6
  93. package/dist/apis/submission.js +1 -1
  94. package/dist/apis/target.cjs +6 -6
  95. package/dist/apis/target.js +1 -1
  96. package/dist/apis/targeting.cjs +6 -6
  97. package/dist/apis/targeting.js +1 -1
  98. package/dist/apis/template-variables.cjs +6 -6
  99. package/dist/apis/template-variables.js +1 -1
  100. package/dist/apis/user.cjs +6 -6
  101. package/dist/apis/user.js +1 -1
  102. package/dist/apis/validation-rules.cjs +8 -8
  103. package/dist/apis/validation-rules.d.cts +2 -2
  104. package/dist/apis/validation-rules.d.ts +2 -2
  105. package/dist/apis/validation-rules.js +2 -2
  106. package/dist/apis/webhooks.cjs +6 -6
  107. package/dist/apis/webhooks.js +1 -1
  108. package/dist/apis/workflow-definition.cjs +6 -6
  109. package/dist/apis/workflow-definition.js +1 -1
  110. package/dist/apis/workflow.cjs +6 -6
  111. package/dist/apis/workflow.js +1 -1
  112. package/dist/chunk-7IKQIVUS.js +14 -0
  113. package/dist/{chunk-5A6KKQEZ.cjs → chunk-HA3PH5QM.cjs} +3 -3
  114. package/dist/chunk-JIUTCNTB.cjs +14 -0
  115. package/dist/{chunk-Z3EVGVBQ.js → chunk-PYZPMZ7V.js} +3 -3
  116. package/dist/index.cjs +10 -10
  117. package/dist/index.d.cts +2 -2
  118. package/dist/index.d.ts +2 -2
  119. package/dist/index.js +2 -2
  120. package/dist/integration-toolkit-6SBBMBPK.cjs +7 -0
  121. package/dist/integration-toolkit-AWMCD2KB.js +7 -0
  122. package/dist/{integration-toolkit.d-D8kNGpJq.d.cts → integration-toolkit.d-CLVwmd8s.d.cts} +858 -7
  123. package/dist/{integration-toolkit.d-D8kNGpJq.d.ts → integration-toolkit.d-CLVwmd8s.d.ts} +858 -7
  124. package/dist/validation-rules-B2KQKMLO.js +7 -0
  125. package/dist/validation-rules-GR2IVLGJ.cjs +7 -0
  126. package/dist/{validation-rules-runtime-VGLVHV36.js → validation-rules-runtime-6MRCS5X2.js} +1 -1
  127. package/dist/{validation-rules-runtime-DENVKYLF.cjs → validation-rules-runtime-X7M3QE5I.cjs} +2 -2
  128. package/dist/{validation-rules.d-MvjG-zzw.d.cts → validation-rules.d-CvGvBnMX.d.cts} +15 -5
  129. package/dist/{validation-rules.d-MvjG-zzw.d.ts → validation-rules.d-CvGvBnMX.d.ts} +15 -5
  130. package/docs/integration-toolkit.md +22 -7
  131. package/docs/validation-rules.md +7 -6
  132. package/package.json +1 -1
  133. package/dist/chunk-HRSCAD3W.cjs +0 -14
  134. package/dist/chunk-PPX45U34.js +0 -14
  135. package/dist/integration-toolkit-RVVT6BCK.cjs +0 -7
  136. package/dist/integration-toolkit-X64BK3WX.js +0 -7
  137. package/dist/validation-rules-G5BWXUWI.cjs +0 -7
  138. package/dist/validation-rules-NLHK2CD3.js +0 -7
@@ -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- **Base URL:** `https://validation-rules.sls.epilot.io`\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- [`AppliesWhen`](#applieswhen)\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 applies_when?: { ... }\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 applies_when?: { ... }\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" | "maxDigits" | "maxDecimals"\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 applies_when?: {\n path: { ... }\n operator: { ... }\n value?: { ... }\n }\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" | "maxDigits" | "maxDecimals"\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 rounding?: { ... }\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 applies_when?: {\n path: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "isEmpty" | "isNotEmpty"\n value?: number | string | boolean\n }\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 maxDigits, maxDecimals\n- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, not\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" | "maxDigits" | "maxDecimals"\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 rounding?: { ... }\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 rounding?: { ... }\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n rounding?: { ... }\n }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 rounding?: { ... }\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 rounding?: { ... }\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### `AppliesWhen`\n\nOptional precondition on a condition: the condition only takes part in the\nvalidation when this comparison over context holds. Examples: apply the\ndual-tariff reference only when `contract.htnt` is not empty, or run a\nplausibility check only when a context value reaches a threshold.\n\n\n```ts\ntype AppliesWhen = {\n path: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "isEmpty" | "isNotEmpty"\n value?: number | string | boolean\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
+ };
@@ -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- **Base URL:** `https://validation-rules.sls.epilot.io`\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- [`AppliesWhen`](#applieswhen)\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 applies_when?: { ... }\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 applies_when?: { ... }\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" | "maxDigits" | "maxDecimals"\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 applies_when?: {\n path: { ... }\n operator: { ... }\n value?: { ... }\n }\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" | "maxDigits" | "maxDecimals"\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 rounding?: { ... }\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 applies_when?: {\n path: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "isEmpty" | "isNotEmpty"\n value?: number | string | boolean\n }\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 maxDigits, maxDecimals\n- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, not\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" | "maxDigits" | "maxDecimals"\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 rounding?: { ... }\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 rounding?: { ... }\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 source: { ... }\n path: { ... }\n adjust?: { ... }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 source: "context"\n path: string\n adjust?: {\n type: { ... }\n value: { ... }\n direction: { ... }\n rounding?: { ... }\n }\n }\n direction: "increase" | "decrease"\n rounding?: "up" | "down"\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 rounding?: { ... }\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 rounding?: { ... }\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### `AppliesWhen`\n\nOptional precondition on a condition: the condition only takes part in the\nvalidation when this comparison over context holds. Examples: apply the\ndual-tariff reference only when `contract.htnt` is not empty, or run a\nplausibility check only when a context value reaches a threshold.\n\n\n```ts\ntype AppliesWhen = {\n path: string\n operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "isEmpty" | "isNotEmpty"\n value?: number | string | boolean\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;
@@ -1,5 +1,5 @@
1
1
  import {
2
2
  require_validation_rules_runtime
3
- } from "./chunk-PPX45U34.js";
3
+ } from "./chunk-7IKQIVUS.js";
4
4
  import "./chunk-YPSWSI3M.js";
5
5
  export default require_validation_rules_runtime();
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHRSCAD3Wcjs = require('./chunk-HRSCAD3W.cjs');
3
+ var _chunkJIUTCNTBcjs = require('./chunk-JIUTCNTB.cjs');
4
4
  require('./chunk-NJK5F5TF.cjs');
5
- exports. default = _chunkHRSCAD3Wcjs.require_validation_rules_runtime.call(void 0, );
5
+ exports. default = _chunkJIUTCNTBcjs.require_validation_rules_runtime.call(void 0, );
@@ -57,15 +57,20 @@ declare namespace Components {
57
57
  id: string;
58
58
  operator: /**
59
59
  * Predefined comparison operator. Compatibility (enforced at write time):
60
- * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
60
+ * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch,
61
+ * maxDigits, maxDecimals
61
62
  * - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
62
63
  * - text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,
63
- * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between
64
+ * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, maxDigits, maxDecimals
64
65
  * Range operators (between, dateBetween, lengthBetween) require a `range` value;
65
66
  * unary operators (notInFuture, notInPast) require a `none` value; all others require a scalar value.
66
67
  * regexMatch validates the raw input string's format and always takes a static string pattern.
67
68
  * Numeric comparison operators on text rules parse the input as a number at evaluation time
68
69
  * (free-text fields often hold numbers); unparsable input fails the condition.
70
+ * maxDigits limits how many digits the written input may contain in total (grouping
71
+ * separators, sign and the decimal separator are not counted); maxDecimals limits how many
72
+ * digits may follow the decimal separator. Both take a non-negative integer comparison value
73
+ * and, like the other numeric operators, are also allowed on text rules.
69
74
  *
70
75
  */
71
76
  Operator;
@@ -326,18 +331,23 @@ declare namespace Components {
326
331
  }
327
332
  /**
328
333
  * Predefined comparison operator. Compatibility (enforced at write time):
329
- * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
334
+ * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch,
335
+ * maxDigits, maxDecimals
330
336
  * - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
331
337
  * - text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,
332
- * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between
338
+ * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, maxDigits, maxDecimals
333
339
  * Range operators (between, dateBetween, lengthBetween) require a `range` value;
334
340
  * unary operators (notInFuture, notInPast) require a `none` value; all others require a scalar value.
335
341
  * regexMatch validates the raw input string's format and always takes a static string pattern.
336
342
  * Numeric comparison operators on text rules parse the input as a number at evaluation time
337
343
  * (free-text fields often hold numbers); unparsable input fails the condition.
344
+ * maxDigits limits how many digits the written input may contain in total (grouping
345
+ * separators, sign and the decimal separator are not counted); maxDecimals limits how many
346
+ * digits may follow the decimal separator. Both take a non-negative integer comparison value
347
+ * and, like the other numeric operators, are also allowed on text rules.
338
348
  *
339
349
  */
340
- export type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween";
350
+ 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";
341
351
  /**
342
352
  * Condition definition for a pattern-based validation rule (2 levels deep)
343
353
  */
@@ -57,15 +57,20 @@ declare namespace Components {
57
57
  id: string;
58
58
  operator: /**
59
59
  * Predefined comparison operator. Compatibility (enforced at write time):
60
- * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
60
+ * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch,
61
+ * maxDigits, maxDecimals
61
62
  * - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
62
63
  * - text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,
63
- * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between
64
+ * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, maxDigits, maxDecimals
64
65
  * Range operators (between, dateBetween, lengthBetween) require a `range` value;
65
66
  * unary operators (notInFuture, notInPast) require a `none` value; all others require a scalar value.
66
67
  * regexMatch validates the raw input string's format and always takes a static string pattern.
67
68
  * Numeric comparison operators on text rules parse the input as a number at evaluation time
68
69
  * (free-text fields often hold numbers); unparsable input fails the condition.
70
+ * maxDigits limits how many digits the written input may contain in total (grouping
71
+ * separators, sign and the decimal separator are not counted); maxDecimals limits how many
72
+ * digits may follow the decimal separator. Both take a non-negative integer comparison value
73
+ * and, like the other numeric operators, are also allowed on text rules.
69
74
  *
70
75
  */
71
76
  Operator;
@@ -326,18 +331,23 @@ declare namespace Components {
326
331
  }
327
332
  /**
328
333
  * Predefined comparison operator. Compatibility (enforced at write time):
329
- * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
334
+ * - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch,
335
+ * maxDigits, maxDecimals
330
336
  * - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
331
337
  * - text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,
332
- * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between
338
+ * greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, maxDigits, maxDecimals
333
339
  * Range operators (between, dateBetween, lengthBetween) require a `range` value;
334
340
  * unary operators (notInFuture, notInPast) require a `none` value; all others require a scalar value.
335
341
  * regexMatch validates the raw input string's format and always takes a static string pattern.
336
342
  * Numeric comparison operators on text rules parse the input as a number at evaluation time
337
343
  * (free-text fields often hold numbers); unparsable input fails the condition.
344
+ * maxDigits limits how many digits the written input may contain in total (grouping
345
+ * separators, sign and the decimal separator are not counted); maxDecimals limits how many
346
+ * digits may follow the decimal separator. Both take a non-negative integer comparison value
347
+ * and, like the other numeric operators, are also allowed on text rules.
338
348
  *
339
349
  */
340
- export type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween";
350
+ 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";
341
351
  /**
342
352
  * Condition definition for a pattern-based validation rule (2 levels deep)
343
353
  */
@@ -2684,7 +2684,10 @@ const { data } = await client.getEntitySyncStatus({
2684
2684
  "last_synced_at": "1970-01-01T00:00:00.000Z",
2685
2685
  "last_changed_at": "1970-01-01T00:00:00.000Z",
2686
2686
  "last_operation": "create",
2687
- "last_event_id": "string"
2687
+ "last_event_id": "string",
2688
+ "readings_last_synced_at": "1970-01-01T00:00:00.000Z",
2689
+ "readings_last_operation": "upsert",
2690
+ "readings_last_event_id": "string"
2688
2691
  }
2689
2692
  ]
2690
2693
  }
@@ -7783,7 +7786,7 @@ The sc
7783
7786
 
7784
7787
  ```ts
7785
7788
  type DirectPayload = {
7786
- version: "1"
7789
+ version: string
7787
7790
  operations: Array<{
7788
7791
  type?: "entity"
7789
7792
  entity_slug: string
@@ -8031,7 +8034,7 @@ type DirectSimulationRequest = {
8031
8034
  }>
8032
8035
  }
8033
8036
  payload: string | {
8034
- version: "1"
8037
+ version: string
8035
8038
  operations: Array<{
8036
8039
  type?: { ... }
8037
8040
  entity_slug: { ... }
@@ -8333,26 +8336,38 @@ type EntitySyncStatusResponse = {
8333
8336
  integration_id: string // uuid
8334
8337
  entity_slug: string
8335
8338
  use_case_id?: string
8336
- last_synced_at: string // date-time
8339
+ last_synced_at?: string // date-time
8337
8340
  last_changed_at?: string // date-time
8338
- last_operation: "create" | "patch" | "delete" | "no-op"
8341
+ last_operation?: "create" | "patch" | "delete" | "no-op"
8339
8342
  last_event_id?: string
8343
+ readings_last_synced_at?: string // date-time
8344
+ readings_last_operation?: "upsert" | "delete"
8345
+ readings_last_event_id?: string
8340
8346
  }>
8341
8347
  }
8342
8348
  ```
8343
8349
 
8344
8350
  ### `EntitySyncState`
8345
8351
 
8352
+ Inbound sync state of one entity for one integration. Carries two
8353
+ independent groups: the entity-level fields (`last_synced_at`, …) and,
8354
+ on meter/meter_counter entities, the readings-level fields
8355
+ (`readings_last_synced_at`, …). Either group can be present alone — a
8356
+ meter whose readings sync via the
8357
+
8346
8358
  ```ts
8347
8359
  type EntitySyncState = {
8348
8360
  entity_id: string // uuid
8349
8361
  integration_id: string // uuid
8350
8362
  entity_slug: string
8351
8363
  use_case_id?: string
8352
- last_synced_at: string // date-time
8364
+ last_synced_at?: string // date-time
8353
8365
  last_changed_at?: string // date-time
8354
- last_operation: "create" | "patch" | "delete" | "no-op"
8366
+ last_operation?: "create" | "patch" | "delete" | "no-op"
8355
8367
  last_event_id?: string
8368
+ readings_last_synced_at?: string // date-time
8369
+ readings_last_operation?: "upsert" | "delete"
8370
+ readings_last_event_id?: string
8356
8371
  }
8357
8372
  ```
8358
8373
 
@@ -1,5 +1,6 @@
1
1
  # Validation Rules API
2
2
 
3
+ - **Base URL:** `https://validation-rules.sls.epilot.io`
3
4
  - **Full API Docs:** [https://docs.epilot.io/api/validation-rules](https://docs.epilot.io/api/validation-rules)
4
5
 
5
6
  ## Usage
@@ -1678,7 +1679,7 @@ type ComparisonRuleType = {
1678
1679
  input_type: "number" | "date" | "text"
1679
1680
  conditions: Array<{
1680
1681
  id: string
1681
- operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
1682
+ operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
1682
1683
  value: {
1683
1684
  source: { ... }
1684
1685
  data: { ... }
@@ -1716,7 +1717,7 @@ A single comparison the input value must satisfy.
1716
1717
  ```ts
1717
1718
  type Condition = {
1718
1719
  id: string
1719
- operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
1720
+ operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
1720
1721
  value: {
1721
1722
  source: "static"
1722
1723
  data: number | string | boolean
@@ -1778,12 +1779,12 @@ type Condition = {
1778
1779
  ### `Operator`
1779
1780
 
1780
1781
  Predefined comparison operator. Compatibility (enforced at write time):
1781
- - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
1782
- - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
1783
- - text:
1782
+ - number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch,
1783
+ maxDigits, maxDecimals
1784
+ - date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, not
1784
1785
 
1785
1786
  ```ts
1786
- type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
1787
+ type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween" | "maxDigits" | "maxDecimals"
1787
1788
  ```
1788
1789
 
1789
1790
  ### `ConditionValue`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.18.32",
3
+ "version": "2.18.34",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,14 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
4
-
5
- // src/definitions/validation-rules-runtime.json
6
- var require_validation_rules_runtime = _chunkNJK5F5TFcjs.__commonJS.call(void 0, {
7
- "src/definitions/validation-rules-runtime.json"(exports, module) {
8
- module.exports = { s: "", o: [["getValidationRules", "get", "/v1/validation-rules"], ["createValidationRule", "post", "/v1/validation-rules", null, 1], ["getValidationRuleById", "get", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["updateValidationRule", "patch", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]], 1], ["deleteValidationRule", "delete", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["addUsedByReference", "post", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1], ["removeUsedByReference", "delete", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1]], v: "3.0.3" };
9
- }
10
- });
11
-
12
-
13
-
14
- exports.require_validation_rules_runtime = require_validation_rules_runtime;
@@ -1,14 +0,0 @@
1
- import {
2
- __commonJS
3
- } from "./chunk-YPSWSI3M.js";
4
-
5
- // src/definitions/validation-rules-runtime.json
6
- var require_validation_rules_runtime = __commonJS({
7
- "src/definitions/validation-rules-runtime.json"(exports, module) {
8
- module.exports = { s: "", o: [["getValidationRules", "get", "/v1/validation-rules"], ["createValidationRule", "post", "/v1/validation-rules", null, 1], ["getValidationRuleById", "get", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["updateValidationRule", "patch", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]], 1], ["deleteValidationRule", "delete", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["addUsedByReference", "post", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1], ["removeUsedByReference", "delete", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1]], v: "3.0.3" };
9
- }
10
- });
11
-
12
- export {
13
- require_validation_rules_runtime
14
- };