@epilot/sdk 2.19.3 → 2.19.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/access-token-runtime.json +1 -0
- package/definitions/access-token.json +835 -0
- package/definitions/address-runtime.json +1 -0
- package/definitions/address-suggestions-runtime.json +1 -0
- package/definitions/address-suggestions.json +582 -0
- package/definitions/address.json +578 -0
- package/definitions/ai-agents-runtime.json +1 -0
- package/definitions/ai-agents.json +2863 -0
- package/definitions/app-runtime.json +1 -0
- package/definitions/app.json +5743 -0
- package/definitions/audit-logs-runtime.json +1 -0
- package/definitions/audit-logs.json +305 -0
- package/definitions/automation-runtime.json +1 -0
- package/definitions/automation.json +5557 -0
- package/definitions/billing-runtime.json +1 -0
- package/definitions/billing.json +2386 -0
- package/definitions/blueprint-manifest-runtime.json +1 -0
- package/definitions/blueprint-manifest.json +7718 -0
- package/definitions/calendar-runtime.json +1 -0
- package/definitions/calendar.json +2904 -0
- package/definitions/configuration-hub-runtime.json +1 -0
- package/definitions/configuration-hub.json +2250 -0
- package/definitions/consent-runtime.json +1 -0
- package/definitions/consent.json +344 -0
- package/definitions/customer-portal-runtime.json +1 -0
- package/definitions/customer-portal.json +19945 -0
- package/definitions/dashboard-runtime.json +1 -0
- package/definitions/dashboard.json +1355 -0
- package/definitions/data-governance-runtime.json +1 -0
- package/definitions/data-governance.json +1126 -0
- package/definitions/deduplication-runtime.json +1 -0
- package/definitions/deduplication.json +782 -0
- package/definitions/design-runtime.json +1 -0
- package/definitions/design.json +1827 -0
- package/definitions/document-runtime.json +1 -0
- package/definitions/document.json +758 -0
- package/definitions/email-settings-runtime.json +1 -0
- package/definitions/email-settings.json +3736 -0
- package/definitions/email-template-runtime.json +1 -0
- package/definitions/email-template.json +1441 -0
- package/definitions/entity-mapping-runtime.json +1 -0
- package/definitions/entity-mapping.json +1642 -0
- package/definitions/entity-runtime.json +1 -0
- package/definitions/entity.json +11517 -0
- package/definitions/environments-runtime.json +1 -0
- package/definitions/environments.json +539 -0
- package/definitions/event-catalog-runtime.json +1 -0
- package/definitions/event-catalog.json +1524 -0
- package/definitions/file-runtime.json +1 -0
- package/definitions/file.json +3905 -0
- package/definitions/iban-runtime.json +1 -0
- package/definitions/iban.json +132 -0
- package/definitions/integration-toolkit-runtime.json +1 -0
- package/definitions/integration-toolkit.json +12769 -0
- package/definitions/journey-runtime.json +1 -0
- package/definitions/journey.json +2640 -0
- package/definitions/kanban-runtime.json +1 -0
- package/definitions/kanban.json +1506 -0
- package/definitions/message-runtime.json +1 -0
- package/definitions/message.json +3667 -0
- package/definitions/metering-runtime.json +1 -0
- package/definitions/metering.json +3132 -0
- package/definitions/notes-runtime.json +1 -0
- package/definitions/notes.json +1698 -0
- package/definitions/notification-runtime.json +1 -0
- package/definitions/notification.json +1439 -0
- package/definitions/organization-runtime.json +1 -0
- package/definitions/organization.json +1192 -0
- package/definitions/partner-directory-runtime.json +1 -0
- package/definitions/partner-directory.json +2284 -0
- package/definitions/permissions-runtime.json +1 -0
- package/definitions/permissions.json +1598 -0
- package/definitions/pricing-runtime.json +1 -0
- package/definitions/pricing-tier-runtime.json +1 -0
- package/definitions/pricing-tier.json +105 -0
- package/definitions/pricing.json +11569 -0
- package/definitions/purpose-runtime.json +1 -0
- package/definitions/purpose.json +524 -0
- package/definitions/query-runtime.json +1 -0
- package/definitions/query.json +3178 -0
- package/definitions/sandbox-runtime.json +1 -0
- package/definitions/sandbox.json +453 -0
- package/definitions/sharing-runtime.json +1 -0
- package/definitions/sharing.json +956 -0
- package/definitions/snapshot-runtime.json +1 -0
- package/definitions/snapshot.json +1103 -0
- package/definitions/submission-runtime.json +1 -0
- package/definitions/submission.json +313 -0
- package/definitions/targeting-runtime.json +1 -0
- package/definitions/targeting.json +2222 -0
- package/definitions/template-variables-runtime.json +1 -0
- package/definitions/template-variables.json +1416 -0
- package/definitions/user-runtime.json +1 -0
- package/definitions/user.json +3051 -0
- package/definitions/validation-rules-runtime.json +1 -0
- package/definitions/validation-rules.json +2365 -0
- package/definitions/webhooks-runtime.json +1 -0
- package/definitions/webhooks.json +1875 -0
- package/definitions/workflow-definition-runtime.json +1 -0
- package/definitions/workflow-definition.json +3592 -0
- package/definitions/workflow-runtime.json +1 -0
- package/definitions/workflow.json +4669 -0
- package/dist/apis/access-token.cjs +6 -6
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +6 -6
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +6 -6
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +6 -6
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +6 -6
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +6 -6
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +6 -6
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +6 -6
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +6 -6
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/calendar.cjs +6 -6
- package/dist/apis/calendar.js +1 -1
- package/dist/apis/configuration-hub.cjs +6 -6
- package/dist/apis/configuration-hub.js +1 -1
- package/dist/apis/consent.cjs +6 -6
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +6 -6
- package/dist/apis/customer-portal.d.cts +2 -2
- package/dist/apis/customer-portal.d.ts +2 -2
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/dashboard.cjs +6 -6
- package/dist/apis/dashboard.js +1 -1
- package/dist/apis/data-governance.cjs +6 -6
- package/dist/apis/data-governance.js +1 -1
- package/dist/apis/deduplication.cjs +6 -6
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +6 -6
- package/dist/apis/design.js +1 -1
- package/dist/apis/document.cjs +6 -6
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +6 -6
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +6 -6
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +6 -6
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +6 -6
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +6 -6
- package/dist/apis/environments.js +1 -1
- package/dist/apis/event-catalog.cjs +6 -6
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +6 -6
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +6 -6
- package/dist/apis/iban.js +1 -1
- package/dist/apis/integration-toolkit.cjs +6 -6
- package/dist/apis/integration-toolkit.js +1 -1
- package/dist/apis/journey.cjs +6 -6
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +6 -6
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +6 -6
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +6 -6
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +6 -6
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +6 -6
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +6 -6
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +6 -6
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +6 -6
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +6 -6
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +6 -6
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +6 -6
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/query.cjs +6 -6
- package/dist/apis/query.js +1 -1
- package/dist/apis/sandbox.cjs +6 -6
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/sharing.cjs +6 -6
- package/dist/apis/sharing.js +1 -1
- package/dist/apis/snapshot.cjs +6 -6
- package/dist/apis/snapshot.js +1 -1
- package/dist/apis/submission.cjs +6 -6
- package/dist/apis/submission.js +1 -1
- package/dist/apis/target.cjs +6 -6
- package/dist/apis/target.js +1 -1
- package/dist/apis/targeting.cjs +6 -6
- package/dist/apis/targeting.d.cts +2 -2
- package/dist/apis/targeting.d.ts +2 -2
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +6 -6
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +6 -6
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +6 -6
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +6 -6
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +6 -6
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +6 -6
- package/dist/apis/workflow.js +1 -1
- package/dist/{chunk-UC3IKFHD.js → chunk-HWPPR3IM.js} +2 -2
- package/dist/{chunk-QWWGJOYR.cjs → chunk-VB6VABGZ.cjs} +2 -2
- package/dist/customer-portal-CDFQM72A.js +7 -0
- package/dist/customer-portal-MS6WNXAO.cjs +7 -0
- package/dist/{customer-portal.d-DTnk0yQf.d.cts → customer-portal.d-DJHJY-vb.d.cts} +51 -8
- package/dist/{customer-portal.d-DTnk0yQf.d.ts → customer-portal.d-DJHJY-vb.d.ts} +51 -8
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/targeting-5U4XGOXY.cjs +7 -0
- package/dist/targeting-R3G32HI4.js +7 -0
- package/dist/{targeting.d-16SvPyj4.d.cts → targeting.d-KcawmWBB.d.cts} +8 -0
- package/dist/{targeting.d-16SvPyj4.d.ts → targeting.d-KcawmWBB.d.ts} +8 -0
- package/docs/customer-portal.md +13 -4
- package/docs/targeting.md +9 -1
- package/package.json +1 -1
- package/dist/customer-portal-FCUPDA7V.cjs +0 -7
- package/dist/customer-portal-GRWXQYKT.js +0 -7
- package/dist/targeting-BTVCLYFW.cjs +0 -7
- package/dist/targeting-NWYDE3E7.js +0 -7
|
@@ -0,0 +1,2365 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Validation Rules API",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "The Validation Rules API manages reusable input validation rules for epilot journeys and entity attributes.\n\nValidation rules define constraints for user input (e.g. regex patterns, numeric ranges, character counts) that can be applied to journey blocks or entity schema attributes.\n\nKey capabilities:\n- Define validation rules using regex patterns, character patterns, or numeric constraints\n- Apply rules to journey blocks or entity schema attributes via the `used_by` association\n- Manage the lifecycle of rules (create, read, update, delete)\n- Compose complex validation logic using AND/OR/NOT condition combinators\n\n## Rule schema versions\n\nThe `rule` property holds one of two shapes, identified by the document's `_schema_version`:\n- `v1`: a json-rules-engine condition tree (regex/pattern/numeric) with static comparison values only.\n- `v2`: a declarative rule with predefined comparison operators whose comparison values may be static,\n dynamic (a path into runtime context declared via `contexts`,\n e.g. `contract.installment_amount`) or relative dates. v2 shapes carry an `input_type` property.\nConverting a rule between schema versions is not supported.\n"
|
|
7
|
+
},
|
|
8
|
+
"tags": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Validation Rules",
|
|
11
|
+
"description": "CRUD endpoints for managing validation rules within an organization.\nAll endpoints require an epilot bearer token and operate within the authenticated organization's scope.\nRules are identified by a unique `ruleId` and can be referenced by journey blocks or entity attributes via the `used_by` field.\n"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"security": [
|
|
15
|
+
{
|
|
16
|
+
"EpilotAuth": []
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"/v1/validation-rules": {
|
|
21
|
+
"get": {
|
|
22
|
+
"operationId": "getValidationRules",
|
|
23
|
+
"summary": "getValidationRules",
|
|
24
|
+
"description": "Returns all validation rules belonging to the authenticated user's organization.\n\nResults are returned as a flat list. Use this endpoint to list available rules when configuring journeys or entity schemas.\n",
|
|
25
|
+
"tags": [
|
|
26
|
+
"Validation Rules"
|
|
27
|
+
],
|
|
28
|
+
"security": [
|
|
29
|
+
{
|
|
30
|
+
"EpilotAuth": []
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"responses": {
|
|
34
|
+
"200": {
|
|
35
|
+
"description": "Success",
|
|
36
|
+
"content": {
|
|
37
|
+
"application/json": {
|
|
38
|
+
"schema": {
|
|
39
|
+
"$ref": "#/components/schemas/GetValidationRulesResponse"
|
|
40
|
+
},
|
|
41
|
+
"example": {
|
|
42
|
+
"results": [
|
|
43
|
+
{
|
|
44
|
+
"_id": "rule-abc123",
|
|
45
|
+
"_organization_id": "728224",
|
|
46
|
+
"_schema_version": "1.0",
|
|
47
|
+
"title": "German postal code",
|
|
48
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
49
|
+
"updated_at": "2024-01-10T08:00:00.000Z",
|
|
50
|
+
"created_by": "user-1",
|
|
51
|
+
"updated_by": "user-1",
|
|
52
|
+
"rule": {
|
|
53
|
+
"type": "regex",
|
|
54
|
+
"conditions": {
|
|
55
|
+
"all": [
|
|
56
|
+
{
|
|
57
|
+
"fact": "inputValue",
|
|
58
|
+
"operator": "regexMatch",
|
|
59
|
+
"value": "^[0-9]{5}$"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"400": {
|
|
71
|
+
"description": "Bad Request - Invalid request body",
|
|
72
|
+
"content": {
|
|
73
|
+
"application/json": {
|
|
74
|
+
"schema": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"properties": {
|
|
77
|
+
"message": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"example": "Invalid request body"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"401": {
|
|
87
|
+
"description": "Unauthorized - Authentication required",
|
|
88
|
+
"content": {
|
|
89
|
+
"application/json": {
|
|
90
|
+
"schema": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"message": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"example": "Unauthorized"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"403": {
|
|
103
|
+
"description": "Forbidden - Insufficient permissions",
|
|
104
|
+
"content": {
|
|
105
|
+
"application/json": {
|
|
106
|
+
"schema": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {
|
|
109
|
+
"message": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"example": "Forbidden"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"500": {
|
|
119
|
+
"description": "Internal Server Error",
|
|
120
|
+
"content": {
|
|
121
|
+
"application/json": {
|
|
122
|
+
"schema": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"message": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"example": "Unknown API Error"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"post": {
|
|
137
|
+
"operationId": "createValidationRule",
|
|
138
|
+
"summary": "createValidationRule",
|
|
139
|
+
"description": "Creates a new validation rule for the authenticated organization.",
|
|
140
|
+
"tags": [
|
|
141
|
+
"Validation Rules"
|
|
142
|
+
],
|
|
143
|
+
"security": [
|
|
144
|
+
{
|
|
145
|
+
"EpilotAuth": []
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"requestBody": {
|
|
149
|
+
"description": "Validation rule to create",
|
|
150
|
+
"required": true,
|
|
151
|
+
"content": {
|
|
152
|
+
"application/json": {
|
|
153
|
+
"schema": {
|
|
154
|
+
"$ref": "#/components/schemas/CreateValidationRuleRequest"
|
|
155
|
+
},
|
|
156
|
+
"example": {
|
|
157
|
+
"title": "German postal code",
|
|
158
|
+
"rule": {
|
|
159
|
+
"type": "regex",
|
|
160
|
+
"conditions": {
|
|
161
|
+
"all": [
|
|
162
|
+
{
|
|
163
|
+
"fact": "inputValue",
|
|
164
|
+
"operator": "regexMatch",
|
|
165
|
+
"value": "^[0-9]{5}$",
|
|
166
|
+
"params": {
|
|
167
|
+
"errorMessage": "Must be a 5-digit German postal code"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"responses": {
|
|
178
|
+
"201": {
|
|
179
|
+
"description": "Validation rule created successfully",
|
|
180
|
+
"content": {
|
|
181
|
+
"application/json": {
|
|
182
|
+
"schema": {
|
|
183
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
184
|
+
},
|
|
185
|
+
"example": {
|
|
186
|
+
"_id": "rule-abc123",
|
|
187
|
+
"_organization_id": "728224",
|
|
188
|
+
"_schema_version": "1.0",
|
|
189
|
+
"title": "German postal code",
|
|
190
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
191
|
+
"updated_at": "2024-01-10T08:00:00.000Z",
|
|
192
|
+
"created_by": "user-1",
|
|
193
|
+
"updated_by": "user-1",
|
|
194
|
+
"rule": {
|
|
195
|
+
"type": "regex",
|
|
196
|
+
"conditions": {
|
|
197
|
+
"all": [
|
|
198
|
+
{
|
|
199
|
+
"fact": "inputValue",
|
|
200
|
+
"operator": "regexMatch",
|
|
201
|
+
"value": "^[0-9]{5}$"
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"400": {
|
|
211
|
+
"description": "Bad Request - Invalid request body",
|
|
212
|
+
"content": {
|
|
213
|
+
"application/json": {
|
|
214
|
+
"schema": {
|
|
215
|
+
"type": "object",
|
|
216
|
+
"properties": {
|
|
217
|
+
"message": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"example": "Invalid request body"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"401": {
|
|
227
|
+
"description": "Unauthorized - Authentication required",
|
|
228
|
+
"content": {
|
|
229
|
+
"application/json": {
|
|
230
|
+
"schema": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"message": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"example": "Unauthorized"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"403": {
|
|
243
|
+
"description": "Forbidden - Insufficient permissions",
|
|
244
|
+
"content": {
|
|
245
|
+
"application/json": {
|
|
246
|
+
"schema": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"message": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"example": "Forbidden"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"500": {
|
|
259
|
+
"description": "Internal Server Error",
|
|
260
|
+
"content": {
|
|
261
|
+
"application/json": {
|
|
262
|
+
"schema": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"properties": {
|
|
265
|
+
"message": {
|
|
266
|
+
"type": "string",
|
|
267
|
+
"example": "Unknown API Error"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"/v1/validation-rules/{ruleId}": {
|
|
278
|
+
"get": {
|
|
279
|
+
"operationId": "getValidationRuleById",
|
|
280
|
+
"summary": "getValidationRuleById",
|
|
281
|
+
"description": "Retrieves a specific validation rule by its unique ID.",
|
|
282
|
+
"tags": [
|
|
283
|
+
"Validation Rules"
|
|
284
|
+
],
|
|
285
|
+
"security": [
|
|
286
|
+
{
|
|
287
|
+
"EpilotAuth": []
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"parameters": [
|
|
291
|
+
{
|
|
292
|
+
"name": "ruleId",
|
|
293
|
+
"in": "path",
|
|
294
|
+
"required": true,
|
|
295
|
+
"schema": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
},
|
|
298
|
+
"description": "The unique identifier of the validation rule to retrieve.",
|
|
299
|
+
"example": "rule-abc123"
|
|
300
|
+
}
|
|
301
|
+
],
|
|
302
|
+
"responses": {
|
|
303
|
+
"200": {
|
|
304
|
+
"description": "Validation rule retrieved successfully",
|
|
305
|
+
"content": {
|
|
306
|
+
"application/json": {
|
|
307
|
+
"schema": {
|
|
308
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
309
|
+
},
|
|
310
|
+
"example": {
|
|
311
|
+
"_id": "rule-abc123",
|
|
312
|
+
"_organization_id": "728224",
|
|
313
|
+
"_schema_version": "1.0",
|
|
314
|
+
"title": "German postal code",
|
|
315
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
316
|
+
"updated_at": "2024-01-10T08:00:00.000Z",
|
|
317
|
+
"created_by": "user-1",
|
|
318
|
+
"updated_by": "user-1",
|
|
319
|
+
"rule": {
|
|
320
|
+
"type": "regex",
|
|
321
|
+
"conditions": {
|
|
322
|
+
"all": [
|
|
323
|
+
{
|
|
324
|
+
"fact": "inputValue",
|
|
325
|
+
"operator": "regexMatch",
|
|
326
|
+
"value": "^[0-9]{5}$"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"401": {
|
|
336
|
+
"description": "Unauthorized - Authentication required",
|
|
337
|
+
"content": {
|
|
338
|
+
"application/json": {
|
|
339
|
+
"schema": {
|
|
340
|
+
"type": "object",
|
|
341
|
+
"properties": {
|
|
342
|
+
"message": {
|
|
343
|
+
"type": "string",
|
|
344
|
+
"example": "Unauthorized"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"403": {
|
|
352
|
+
"description": "Forbidden - Insufficient permissions",
|
|
353
|
+
"content": {
|
|
354
|
+
"application/json": {
|
|
355
|
+
"schema": {
|
|
356
|
+
"type": "object",
|
|
357
|
+
"properties": {
|
|
358
|
+
"message": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"example": "Forbidden"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"404": {
|
|
368
|
+
"description": "Validation rule not found",
|
|
369
|
+
"content": {
|
|
370
|
+
"application/json": {
|
|
371
|
+
"schema": {
|
|
372
|
+
"type": "object",
|
|
373
|
+
"properties": {
|
|
374
|
+
"message": {
|
|
375
|
+
"type": "string",
|
|
376
|
+
"example": "Validation rule not found"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"500": {
|
|
384
|
+
"description": "Internal Server Error",
|
|
385
|
+
"content": {
|
|
386
|
+
"application/json": {
|
|
387
|
+
"schema": {
|
|
388
|
+
"type": "object",
|
|
389
|
+
"properties": {
|
|
390
|
+
"message": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"example": "Unknown API Error"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"patch": {
|
|
402
|
+
"operationId": "updateValidationRule",
|
|
403
|
+
"summary": "updateValidationRule",
|
|
404
|
+
"description": "Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.",
|
|
405
|
+
"tags": [
|
|
406
|
+
"Validation Rules"
|
|
407
|
+
],
|
|
408
|
+
"security": [
|
|
409
|
+
{
|
|
410
|
+
"EpilotAuth": []
|
|
411
|
+
}
|
|
412
|
+
],
|
|
413
|
+
"parameters": [
|
|
414
|
+
{
|
|
415
|
+
"name": "ruleId",
|
|
416
|
+
"in": "path",
|
|
417
|
+
"required": true,
|
|
418
|
+
"schema": {
|
|
419
|
+
"type": "string"
|
|
420
|
+
},
|
|
421
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
422
|
+
"example": "rule-abc123"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"requestBody": {
|
|
426
|
+
"content": {
|
|
427
|
+
"application/json": {
|
|
428
|
+
"schema": {
|
|
429
|
+
"$ref": "#/components/schemas/UpdateValidationRuleRequest"
|
|
430
|
+
},
|
|
431
|
+
"example": {
|
|
432
|
+
"title": "Updated German postal code",
|
|
433
|
+
"rule": {
|
|
434
|
+
"type": "regex",
|
|
435
|
+
"conditions": {
|
|
436
|
+
"all": [
|
|
437
|
+
{
|
|
438
|
+
"fact": "inputValue",
|
|
439
|
+
"operator": "regexMatch",
|
|
440
|
+
"value": "^[0-9]{5}$",
|
|
441
|
+
"params": {
|
|
442
|
+
"errorMessage": "Must be a valid 5-digit German postal code"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"description": "Fields to update in the validation rule"
|
|
452
|
+
},
|
|
453
|
+
"responses": {
|
|
454
|
+
"200": {
|
|
455
|
+
"description": "Validation rule updated successfully",
|
|
456
|
+
"content": {
|
|
457
|
+
"application/json": {
|
|
458
|
+
"schema": {
|
|
459
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
460
|
+
},
|
|
461
|
+
"example": {
|
|
462
|
+
"_id": "rule-abc123",
|
|
463
|
+
"_organization_id": "728224",
|
|
464
|
+
"_schema_version": "1.0",
|
|
465
|
+
"title": "Updated German postal code",
|
|
466
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
467
|
+
"updated_at": "2024-01-20T11:00:00.000Z",
|
|
468
|
+
"created_by": "user-1",
|
|
469
|
+
"updated_by": "user-2",
|
|
470
|
+
"rule": {
|
|
471
|
+
"type": "regex",
|
|
472
|
+
"conditions": {
|
|
473
|
+
"all": [
|
|
474
|
+
{
|
|
475
|
+
"fact": "inputValue",
|
|
476
|
+
"operator": "regexMatch",
|
|
477
|
+
"value": "^[0-9]{5}$"
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
"400": {
|
|
487
|
+
"description": "Bad Request - Invalid request body",
|
|
488
|
+
"content": {
|
|
489
|
+
"application/json": {
|
|
490
|
+
"schema": {
|
|
491
|
+
"type": "object",
|
|
492
|
+
"properties": {
|
|
493
|
+
"message": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"example": "Invalid request body"
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
"401": {
|
|
503
|
+
"description": "Unauthorized - Authentication required",
|
|
504
|
+
"content": {
|
|
505
|
+
"application/json": {
|
|
506
|
+
"schema": {
|
|
507
|
+
"type": "object",
|
|
508
|
+
"properties": {
|
|
509
|
+
"message": {
|
|
510
|
+
"type": "string",
|
|
511
|
+
"example": "Unauthorized"
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
"403": {
|
|
519
|
+
"description": "Forbidden - Insufficient permissions",
|
|
520
|
+
"content": {
|
|
521
|
+
"application/json": {
|
|
522
|
+
"schema": {
|
|
523
|
+
"type": "object",
|
|
524
|
+
"properties": {
|
|
525
|
+
"message": {
|
|
526
|
+
"type": "string",
|
|
527
|
+
"example": "Forbidden"
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
"404": {
|
|
535
|
+
"description": "Validation rule not found",
|
|
536
|
+
"content": {
|
|
537
|
+
"application/json": {
|
|
538
|
+
"schema": {
|
|
539
|
+
"type": "object",
|
|
540
|
+
"properties": {
|
|
541
|
+
"message": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"example": "Validation rule not found"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
"500": {
|
|
551
|
+
"description": "Internal Server Error",
|
|
552
|
+
"content": {
|
|
553
|
+
"application/json": {
|
|
554
|
+
"schema": {
|
|
555
|
+
"type": "object",
|
|
556
|
+
"properties": {
|
|
557
|
+
"message": {
|
|
558
|
+
"type": "string",
|
|
559
|
+
"example": "Unknown API Error"
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
"delete": {
|
|
569
|
+
"operationId": "deleteValidationRule",
|
|
570
|
+
"summary": "deleteValidationRule",
|
|
571
|
+
"description": "Permanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated before deletion.",
|
|
572
|
+
"tags": [
|
|
573
|
+
"Validation Rules"
|
|
574
|
+
],
|
|
575
|
+
"security": [
|
|
576
|
+
{
|
|
577
|
+
"EpilotAuth": []
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"parameters": [
|
|
581
|
+
{
|
|
582
|
+
"name": "ruleId",
|
|
583
|
+
"in": "path",
|
|
584
|
+
"required": true,
|
|
585
|
+
"schema": {
|
|
586
|
+
"type": "string"
|
|
587
|
+
},
|
|
588
|
+
"description": "The unique identifier of the validation rule to delete.",
|
|
589
|
+
"example": "rule-abc123"
|
|
590
|
+
}
|
|
591
|
+
],
|
|
592
|
+
"responses": {
|
|
593
|
+
"204": {
|
|
594
|
+
"description": "Validation rule deleted successfully"
|
|
595
|
+
},
|
|
596
|
+
"401": {
|
|
597
|
+
"description": "Unauthorized - Authentication required",
|
|
598
|
+
"content": {
|
|
599
|
+
"application/json": {
|
|
600
|
+
"schema": {
|
|
601
|
+
"type": "object",
|
|
602
|
+
"properties": {
|
|
603
|
+
"message": {
|
|
604
|
+
"type": "string",
|
|
605
|
+
"example": "Unauthorized"
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
"403": {
|
|
613
|
+
"description": "Forbidden - Insufficient permissions",
|
|
614
|
+
"content": {
|
|
615
|
+
"application/json": {
|
|
616
|
+
"schema": {
|
|
617
|
+
"type": "object",
|
|
618
|
+
"properties": {
|
|
619
|
+
"message": {
|
|
620
|
+
"type": "string",
|
|
621
|
+
"example": "Forbidden"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
"404": {
|
|
629
|
+
"description": "Validation rule not found",
|
|
630
|
+
"content": {
|
|
631
|
+
"application/json": {
|
|
632
|
+
"schema": {
|
|
633
|
+
"type": "object",
|
|
634
|
+
"properties": {
|
|
635
|
+
"message": {
|
|
636
|
+
"type": "string",
|
|
637
|
+
"example": "Validation rule not found"
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
"500": {
|
|
645
|
+
"description": "Internal Server Error",
|
|
646
|
+
"content": {
|
|
647
|
+
"application/json": {
|
|
648
|
+
"schema": {
|
|
649
|
+
"type": "object",
|
|
650
|
+
"properties": {
|
|
651
|
+
"message": {
|
|
652
|
+
"type": "string",
|
|
653
|
+
"example": "Unknown API Error"
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"/v1/validation-rules/{ruleId}/used-by": {
|
|
664
|
+
"post": {
|
|
665
|
+
"operationId": "addUsedByReference",
|
|
666
|
+
"summary": "addUsedByReference",
|
|
667
|
+
"description": "Adds a single `used_by` reference to an existing validation rule.\n\nUse this endpoint when attaching a validation rule to a journey block or entity attribute to track where the rule is applied.\n",
|
|
668
|
+
"tags": [
|
|
669
|
+
"Validation Rules"
|
|
670
|
+
],
|
|
671
|
+
"security": [
|
|
672
|
+
{
|
|
673
|
+
"EpilotAuth": []
|
|
674
|
+
}
|
|
675
|
+
],
|
|
676
|
+
"parameters": [
|
|
677
|
+
{
|
|
678
|
+
"name": "ruleId",
|
|
679
|
+
"in": "path",
|
|
680
|
+
"required": true,
|
|
681
|
+
"schema": {
|
|
682
|
+
"type": "string"
|
|
683
|
+
},
|
|
684
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
685
|
+
"example": "rule-abc123"
|
|
686
|
+
}
|
|
687
|
+
],
|
|
688
|
+
"requestBody": {
|
|
689
|
+
"content": {
|
|
690
|
+
"application/json": {
|
|
691
|
+
"schema": {
|
|
692
|
+
"$ref": "#/components/schemas/UsedBy"
|
|
693
|
+
},
|
|
694
|
+
"example": {
|
|
695
|
+
"type": "journey",
|
|
696
|
+
"source_id": "journey-xyz789"
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
"description": "The used_by reference to add"
|
|
701
|
+
},
|
|
702
|
+
"responses": {
|
|
703
|
+
"200": {
|
|
704
|
+
"description": "Success",
|
|
705
|
+
"content": {
|
|
706
|
+
"application/json": {
|
|
707
|
+
"schema": {
|
|
708
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
709
|
+
},
|
|
710
|
+
"example": {
|
|
711
|
+
"_id": "rule-abc123",
|
|
712
|
+
"_organization_id": "728224",
|
|
713
|
+
"_schema_version": "1.0",
|
|
714
|
+
"title": "German postal code",
|
|
715
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
716
|
+
"updated_at": "2024-01-20T11:00:00.000Z",
|
|
717
|
+
"created_by": "user-1",
|
|
718
|
+
"updated_by": "user-1",
|
|
719
|
+
"rule": {
|
|
720
|
+
"type": "regex",
|
|
721
|
+
"conditions": {
|
|
722
|
+
"all": [
|
|
723
|
+
{
|
|
724
|
+
"fact": "inputValue",
|
|
725
|
+
"operator": "regexMatch",
|
|
726
|
+
"value": "^[0-9]{5}$"
|
|
727
|
+
}
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
"used_by": [
|
|
732
|
+
{
|
|
733
|
+
"type": "journey",
|
|
734
|
+
"source_id": "journey-xyz789"
|
|
735
|
+
}
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
"400": {
|
|
742
|
+
"description": "Bad Request - Invalid request body",
|
|
743
|
+
"content": {
|
|
744
|
+
"application/json": {
|
|
745
|
+
"schema": {
|
|
746
|
+
"type": "object",
|
|
747
|
+
"properties": {
|
|
748
|
+
"message": {
|
|
749
|
+
"type": "string",
|
|
750
|
+
"example": "Invalid request body"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
"401": {
|
|
758
|
+
"description": "Unauthorized - Authentication required",
|
|
759
|
+
"content": {
|
|
760
|
+
"application/json": {
|
|
761
|
+
"schema": {
|
|
762
|
+
"type": "object",
|
|
763
|
+
"properties": {
|
|
764
|
+
"message": {
|
|
765
|
+
"type": "string",
|
|
766
|
+
"example": "Unauthorized"
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
"403": {
|
|
774
|
+
"description": "Forbidden - Insufficient permissions",
|
|
775
|
+
"content": {
|
|
776
|
+
"application/json": {
|
|
777
|
+
"schema": {
|
|
778
|
+
"type": "object",
|
|
779
|
+
"properties": {
|
|
780
|
+
"message": {
|
|
781
|
+
"type": "string",
|
|
782
|
+
"example": "Forbidden"
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
"404": {
|
|
790
|
+
"description": "Validation rule not found",
|
|
791
|
+
"content": {
|
|
792
|
+
"application/json": {
|
|
793
|
+
"schema": {
|
|
794
|
+
"type": "object",
|
|
795
|
+
"properties": {
|
|
796
|
+
"message": {
|
|
797
|
+
"type": "string",
|
|
798
|
+
"example": "Validation rule not found"
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
"500": {
|
|
806
|
+
"description": "Internal Server Error",
|
|
807
|
+
"content": {
|
|
808
|
+
"application/json": {
|
|
809
|
+
"schema": {
|
|
810
|
+
"type": "object",
|
|
811
|
+
"properties": {
|
|
812
|
+
"message": {
|
|
813
|
+
"type": "string",
|
|
814
|
+
"example": "Unknown API Error"
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
},
|
|
823
|
+
"delete": {
|
|
824
|
+
"operationId": "removeUsedByReference",
|
|
825
|
+
"summary": "removeUsedByReference",
|
|
826
|
+
"description": "Removes a specific `used_by` reference from an existing validation rule.\n\nUse this endpoint when detaching a validation rule from a journey block or entity attribute.\n",
|
|
827
|
+
"tags": [
|
|
828
|
+
"Validation Rules"
|
|
829
|
+
],
|
|
830
|
+
"security": [
|
|
831
|
+
{
|
|
832
|
+
"EpilotAuth": []
|
|
833
|
+
}
|
|
834
|
+
],
|
|
835
|
+
"parameters": [
|
|
836
|
+
{
|
|
837
|
+
"name": "ruleId",
|
|
838
|
+
"in": "path",
|
|
839
|
+
"required": true,
|
|
840
|
+
"schema": {
|
|
841
|
+
"type": "string"
|
|
842
|
+
},
|
|
843
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
844
|
+
"example": "rule-abc123"
|
|
845
|
+
}
|
|
846
|
+
],
|
|
847
|
+
"requestBody": {
|
|
848
|
+
"content": {
|
|
849
|
+
"application/json": {
|
|
850
|
+
"schema": {
|
|
851
|
+
"$ref": "#/components/schemas/UsedBy"
|
|
852
|
+
},
|
|
853
|
+
"example": {
|
|
854
|
+
"type": "journey",
|
|
855
|
+
"source_id": "journey-xyz789"
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
"description": "The used_by reference to remove"
|
|
860
|
+
},
|
|
861
|
+
"responses": {
|
|
862
|
+
"200": {
|
|
863
|
+
"description": "Success",
|
|
864
|
+
"content": {
|
|
865
|
+
"application/json": {
|
|
866
|
+
"schema": {
|
|
867
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
868
|
+
},
|
|
869
|
+
"example": {
|
|
870
|
+
"_id": "rule-abc123",
|
|
871
|
+
"_organization_id": "728224",
|
|
872
|
+
"_schema_version": "1.0",
|
|
873
|
+
"title": "German postal code",
|
|
874
|
+
"created_at": "2024-01-10T08:00:00.000Z",
|
|
875
|
+
"updated_at": "2024-01-20T11:00:00.000Z",
|
|
876
|
+
"created_by": "user-1",
|
|
877
|
+
"updated_by": "user-1",
|
|
878
|
+
"rule": {
|
|
879
|
+
"type": "regex",
|
|
880
|
+
"conditions": {
|
|
881
|
+
"all": [
|
|
882
|
+
{
|
|
883
|
+
"fact": "inputValue",
|
|
884
|
+
"operator": "regexMatch",
|
|
885
|
+
"value": "^[0-9]{5}$"
|
|
886
|
+
}
|
|
887
|
+
]
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
"used_by": []
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
"400": {
|
|
896
|
+
"description": "Bad Request - Invalid request body",
|
|
897
|
+
"content": {
|
|
898
|
+
"application/json": {
|
|
899
|
+
"schema": {
|
|
900
|
+
"type": "object",
|
|
901
|
+
"properties": {
|
|
902
|
+
"message": {
|
|
903
|
+
"type": "string",
|
|
904
|
+
"example": "Invalid request body"
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
"401": {
|
|
912
|
+
"description": "Unauthorized - Authentication required",
|
|
913
|
+
"content": {
|
|
914
|
+
"application/json": {
|
|
915
|
+
"schema": {
|
|
916
|
+
"type": "object",
|
|
917
|
+
"properties": {
|
|
918
|
+
"message": {
|
|
919
|
+
"type": "string",
|
|
920
|
+
"example": "Unauthorized"
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
"403": {
|
|
928
|
+
"description": "Forbidden - Insufficient permissions",
|
|
929
|
+
"content": {
|
|
930
|
+
"application/json": {
|
|
931
|
+
"schema": {
|
|
932
|
+
"type": "object",
|
|
933
|
+
"properties": {
|
|
934
|
+
"message": {
|
|
935
|
+
"type": "string",
|
|
936
|
+
"example": "Forbidden"
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
"404": {
|
|
944
|
+
"description": "Validation rule not found",
|
|
945
|
+
"content": {
|
|
946
|
+
"application/json": {
|
|
947
|
+
"schema": {
|
|
948
|
+
"type": "object",
|
|
949
|
+
"properties": {
|
|
950
|
+
"message": {
|
|
951
|
+
"type": "string",
|
|
952
|
+
"example": "Validation rule not found"
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
"500": {
|
|
960
|
+
"description": "Internal Server Error",
|
|
961
|
+
"content": {
|
|
962
|
+
"application/json": {
|
|
963
|
+
"schema": {
|
|
964
|
+
"type": "object",
|
|
965
|
+
"properties": {
|
|
966
|
+
"message": {
|
|
967
|
+
"type": "string",
|
|
968
|
+
"example": "Unknown API Error"
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
"components": {
|
|
980
|
+
"securitySchemes": {
|
|
981
|
+
"EpilotAuth": {
|
|
982
|
+
"type": "http",
|
|
983
|
+
"scheme": "bearer",
|
|
984
|
+
"description": "Authorization header with epilot OAuth2 bearer token",
|
|
985
|
+
"bearerFormat": "JWT"
|
|
986
|
+
},
|
|
987
|
+
"EpilotPublicAuth": {
|
|
988
|
+
"type": "http",
|
|
989
|
+
"scheme": "bearer",
|
|
990
|
+
"description": "Authorization header with epilot public access token",
|
|
991
|
+
"bearerFormat": "JWT"
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
"schemas": {
|
|
995
|
+
"GetValidationRulesResponse": {
|
|
996
|
+
"type": "object",
|
|
997
|
+
"description": "Response envelope for listing all validation rules within an organization.",
|
|
998
|
+
"properties": {
|
|
999
|
+
"results": {
|
|
1000
|
+
"type": "array",
|
|
1001
|
+
"description": "Flat list of all validation rules belonging to the authenticated organization.",
|
|
1002
|
+
"items": {
|
|
1003
|
+
"$ref": "#/components/schemas/ValidationRule"
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
"CreateValidationRuleRequest": {
|
|
1009
|
+
"allOf": [
|
|
1010
|
+
{
|
|
1011
|
+
"$ref": "#/components/schemas/ValidationRuleBase"
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"type": "object",
|
|
1015
|
+
"required": [
|
|
1016
|
+
"title",
|
|
1017
|
+
"rule"
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
]
|
|
1021
|
+
},
|
|
1022
|
+
"UpdateValidationRuleRequest": {
|
|
1023
|
+
"allOf": [
|
|
1024
|
+
{
|
|
1025
|
+
"$ref": "#/components/schemas/ValidationRuleBase"
|
|
1026
|
+
}
|
|
1027
|
+
]
|
|
1028
|
+
},
|
|
1029
|
+
"ValidationRuleBase": {
|
|
1030
|
+
"allOf": [
|
|
1031
|
+
{
|
|
1032
|
+
"type": "object",
|
|
1033
|
+
"properties": {
|
|
1034
|
+
"title": {
|
|
1035
|
+
"type": "string",
|
|
1036
|
+
"description": "Title of the validation rule."
|
|
1037
|
+
},
|
|
1038
|
+
"placeholder": {
|
|
1039
|
+
"type": "string",
|
|
1040
|
+
"description": "Placeholder for the validation rule."
|
|
1041
|
+
},
|
|
1042
|
+
"used_by": {
|
|
1043
|
+
"type": "array",
|
|
1044
|
+
"items": {
|
|
1045
|
+
"$ref": "#/components/schemas/UsedBy"
|
|
1046
|
+
},
|
|
1047
|
+
"description": "Describes where and how a validation rule is applied."
|
|
1048
|
+
},
|
|
1049
|
+
"rule": {
|
|
1050
|
+
"oneOf": [
|
|
1051
|
+
{
|
|
1052
|
+
"$ref": "#/components/schemas/RegexRuleType"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"$ref": "#/components/schemas/PatternRuleType"
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"$ref": "#/components/schemas/NumericRuleType"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
"$ref": "#/components/schemas/ComparisonRuleType"
|
|
1062
|
+
}
|
|
1063
|
+
]
|
|
1064
|
+
},
|
|
1065
|
+
"contexts": {
|
|
1066
|
+
"type": "array",
|
|
1067
|
+
"items": {
|
|
1068
|
+
"$ref": "#/components/schemas/ContextRequirement"
|
|
1069
|
+
},
|
|
1070
|
+
"description": "Declares the dynamic context a v2 rule needs at evaluation time.\n`context` condition values reference these sources by using the schema slug\nas the first segment of their `path`. Only applicable to v2 rules.\n"
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
]
|
|
1075
|
+
},
|
|
1076
|
+
"ValidationRule": {
|
|
1077
|
+
"allOf": [
|
|
1078
|
+
{
|
|
1079
|
+
"$ref": "#/components/schemas/ValidationRuleBase"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
"type": "object",
|
|
1083
|
+
"required": [
|
|
1084
|
+
"_schema_version",
|
|
1085
|
+
"_id",
|
|
1086
|
+
"_organization_id",
|
|
1087
|
+
"title",
|
|
1088
|
+
"type",
|
|
1089
|
+
"created_at",
|
|
1090
|
+
"updated_at",
|
|
1091
|
+
"created_by",
|
|
1092
|
+
"updated_by"
|
|
1093
|
+
],
|
|
1094
|
+
"properties": {
|
|
1095
|
+
"_schema_version": {
|
|
1096
|
+
"type": "string",
|
|
1097
|
+
"description": "Schema version of the validation rule."
|
|
1098
|
+
},
|
|
1099
|
+
"_id": {
|
|
1100
|
+
"type": "string",
|
|
1101
|
+
"description": "Unique identifier for the validation rule."
|
|
1102
|
+
},
|
|
1103
|
+
"_organization_id": {
|
|
1104
|
+
"type": "string",
|
|
1105
|
+
"description": "Organization ID that owns this rule."
|
|
1106
|
+
},
|
|
1107
|
+
"created_at": {
|
|
1108
|
+
"type": "string",
|
|
1109
|
+
"description": "ISO timestamp when the rule was created."
|
|
1110
|
+
},
|
|
1111
|
+
"updated_at": {
|
|
1112
|
+
"type": "string",
|
|
1113
|
+
"description": "ISO timestamp when the rule was last updated."
|
|
1114
|
+
},
|
|
1115
|
+
"created_by": {
|
|
1116
|
+
"type": "string",
|
|
1117
|
+
"description": "User ID of the creator."
|
|
1118
|
+
},
|
|
1119
|
+
"updated_by": {
|
|
1120
|
+
"type": "string",
|
|
1121
|
+
"description": "User ID of the last updater."
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
],
|
|
1126
|
+
"description": "The Validation rule definition."
|
|
1127
|
+
},
|
|
1128
|
+
"UsedBy": {
|
|
1129
|
+
"type": "object",
|
|
1130
|
+
"description": "Describes where and how a validation rule is applied. Used to track associations between rules and the journeys or entity schemas that reference them.",
|
|
1131
|
+
"required": [
|
|
1132
|
+
"type"
|
|
1133
|
+
],
|
|
1134
|
+
"properties": {
|
|
1135
|
+
"type": {
|
|
1136
|
+
"type": "string",
|
|
1137
|
+
"enum": [
|
|
1138
|
+
"journey",
|
|
1139
|
+
"entity"
|
|
1140
|
+
],
|
|
1141
|
+
"description": "The context in which the rule is used - either a journey block or an entity schema attribute.",
|
|
1142
|
+
"example": "journey"
|
|
1143
|
+
},
|
|
1144
|
+
"schema_slug": {
|
|
1145
|
+
"type": "string",
|
|
1146
|
+
"description": "Slug of the entity schema using this rule. Only applicable when `type` is `entity`.",
|
|
1147
|
+
"example": "contact"
|
|
1148
|
+
},
|
|
1149
|
+
"source_id": {
|
|
1150
|
+
"type": "string",
|
|
1151
|
+
"description": "Unique identifier of the source (e.g. journey ID or entity attribute key) that references this rule.",
|
|
1152
|
+
"example": "journey-xyz789"
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
"example": {
|
|
1156
|
+
"type": "journey",
|
|
1157
|
+
"source_id": "journey-xyz789"
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
"RegexRuleType": {
|
|
1161
|
+
"description": "Validation rule that uses a regular expression to validate input.",
|
|
1162
|
+
"type": "object",
|
|
1163
|
+
"required": [
|
|
1164
|
+
"type",
|
|
1165
|
+
"conditions"
|
|
1166
|
+
],
|
|
1167
|
+
"properties": {
|
|
1168
|
+
"type": {
|
|
1169
|
+
"type": "string",
|
|
1170
|
+
"enum": [
|
|
1171
|
+
"regex"
|
|
1172
|
+
],
|
|
1173
|
+
"description": "Indicates this is a regex-based validation rule."
|
|
1174
|
+
},
|
|
1175
|
+
"conditions": {
|
|
1176
|
+
"$ref": "#/components/schemas/RegexCondition",
|
|
1177
|
+
"description": "The conditions that must be met for the rule to trigger"
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
"PatternRuleType": {
|
|
1182
|
+
"description": "Validation rule that uses a sequence of patterns to validate input.",
|
|
1183
|
+
"type": "object",
|
|
1184
|
+
"required": [
|
|
1185
|
+
"type",
|
|
1186
|
+
"conditions"
|
|
1187
|
+
],
|
|
1188
|
+
"properties": {
|
|
1189
|
+
"type": {
|
|
1190
|
+
"type": "string",
|
|
1191
|
+
"enum": [
|
|
1192
|
+
"pattern"
|
|
1193
|
+
],
|
|
1194
|
+
"description": "Indicates this is a pattern-based validation rule."
|
|
1195
|
+
},
|
|
1196
|
+
"conditions": {
|
|
1197
|
+
"$ref": "#/components/schemas/PatternCondition",
|
|
1198
|
+
"description": "The conditions that must be met for the rule to trigger"
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
"NumericRuleType": {
|
|
1203
|
+
"description": "Validation rule for numeric values, supporting range and digit count constraints.",
|
|
1204
|
+
"type": "object",
|
|
1205
|
+
"required": [
|
|
1206
|
+
"type",
|
|
1207
|
+
"conditions"
|
|
1208
|
+
],
|
|
1209
|
+
"properties": {
|
|
1210
|
+
"type": {
|
|
1211
|
+
"type": "string",
|
|
1212
|
+
"enum": [
|
|
1213
|
+
"numeric"
|
|
1214
|
+
],
|
|
1215
|
+
"description": "Indicates this is a numeric-based validation rule."
|
|
1216
|
+
},
|
|
1217
|
+
"conditions": {
|
|
1218
|
+
"$ref": "#/components/schemas/NumericCondition",
|
|
1219
|
+
"description": "The conditions that must be met for the rule to trigger"
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
"RegexCondition": {
|
|
1224
|
+
"description": "Condition definition for a regex-based validation rule (2 levels deep)",
|
|
1225
|
+
"anyOf": [
|
|
1226
|
+
{
|
|
1227
|
+
"type": "object",
|
|
1228
|
+
"description": "All conditions must be true (AND logic)",
|
|
1229
|
+
"properties": {
|
|
1230
|
+
"all": {
|
|
1231
|
+
"type": "array",
|
|
1232
|
+
"items": {
|
|
1233
|
+
"anyOf": [
|
|
1234
|
+
{
|
|
1235
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
"$ref": "#/components/schemas/RegexNestedCondition"
|
|
1239
|
+
}
|
|
1240
|
+
]
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
},
|
|
1244
|
+
"required": [
|
|
1245
|
+
"all"
|
|
1246
|
+
],
|
|
1247
|
+
"additionalProperties": false
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
"type": "object",
|
|
1251
|
+
"description": "Any conditions must be true (OR logic)",
|
|
1252
|
+
"properties": {
|
|
1253
|
+
"any": {
|
|
1254
|
+
"type": "array",
|
|
1255
|
+
"items": {
|
|
1256
|
+
"anyOf": [
|
|
1257
|
+
{
|
|
1258
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
"$ref": "#/components/schemas/RegexNestedCondition"
|
|
1262
|
+
}
|
|
1263
|
+
]
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
"required": [
|
|
1268
|
+
"any"
|
|
1269
|
+
],
|
|
1270
|
+
"additionalProperties": false
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
"type": "object",
|
|
1274
|
+
"description": "NOT condition (negation)",
|
|
1275
|
+
"properties": {
|
|
1276
|
+
"not": {
|
|
1277
|
+
"anyOf": [
|
|
1278
|
+
{
|
|
1279
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
"$ref": "#/components/schemas/RegexNestedCondition"
|
|
1283
|
+
}
|
|
1284
|
+
]
|
|
1285
|
+
}
|
|
1286
|
+
},
|
|
1287
|
+
"required": [
|
|
1288
|
+
"not"
|
|
1289
|
+
],
|
|
1290
|
+
"additionalProperties": false
|
|
1291
|
+
}
|
|
1292
|
+
]
|
|
1293
|
+
},
|
|
1294
|
+
"RegexNestedCondition": {
|
|
1295
|
+
"description": "Nested condition with logical operators (level 2 only)",
|
|
1296
|
+
"anyOf": [
|
|
1297
|
+
{
|
|
1298
|
+
"type": "object",
|
|
1299
|
+
"properties": {
|
|
1300
|
+
"all": {
|
|
1301
|
+
"type": "array",
|
|
1302
|
+
"items": {
|
|
1303
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
"required": [
|
|
1308
|
+
"all"
|
|
1309
|
+
]
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"type": "object",
|
|
1313
|
+
"properties": {
|
|
1314
|
+
"any": {
|
|
1315
|
+
"type": "array",
|
|
1316
|
+
"items": {
|
|
1317
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
"required": [
|
|
1322
|
+
"any"
|
|
1323
|
+
]
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"type": "object",
|
|
1327
|
+
"properties": {
|
|
1328
|
+
"not": {
|
|
1329
|
+
"$ref": "#/components/schemas/RegexFactCondition"
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
"required": [
|
|
1333
|
+
"not"
|
|
1334
|
+
]
|
|
1335
|
+
}
|
|
1336
|
+
]
|
|
1337
|
+
},
|
|
1338
|
+
"RegexFactCondition": {
|
|
1339
|
+
"description": "Fact-based condition for regex validation",
|
|
1340
|
+
"type": "object",
|
|
1341
|
+
"required": [
|
|
1342
|
+
"fact",
|
|
1343
|
+
"operator",
|
|
1344
|
+
"value"
|
|
1345
|
+
],
|
|
1346
|
+
"properties": {
|
|
1347
|
+
"fact": {
|
|
1348
|
+
"type": "string",
|
|
1349
|
+
"enum": [
|
|
1350
|
+
"inputValue"
|
|
1351
|
+
],
|
|
1352
|
+
"description": "The name of the value to validate. Should always be 'inputValue' because this property name is passed to the engine"
|
|
1353
|
+
},
|
|
1354
|
+
"operator": {
|
|
1355
|
+
"type": "string",
|
|
1356
|
+
"enum": [
|
|
1357
|
+
"regexMatch"
|
|
1358
|
+
],
|
|
1359
|
+
"description": "The operator to use for comparison"
|
|
1360
|
+
},
|
|
1361
|
+
"value": {
|
|
1362
|
+
"type": "string",
|
|
1363
|
+
"description": "The actual regex"
|
|
1364
|
+
},
|
|
1365
|
+
"params": {
|
|
1366
|
+
"description": "Additional parameters for the condition",
|
|
1367
|
+
"type": "object",
|
|
1368
|
+
"properties": {
|
|
1369
|
+
"errorMessage": {
|
|
1370
|
+
"type": "string",
|
|
1371
|
+
"description": "Custom error message"
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
"PatternCondition": {
|
|
1378
|
+
"description": "Condition definition for a pattern-based validation rule (2 levels deep)",
|
|
1379
|
+
"anyOf": [
|
|
1380
|
+
{
|
|
1381
|
+
"type": "object",
|
|
1382
|
+
"description": "All conditions must be true (AND logic)",
|
|
1383
|
+
"properties": {
|
|
1384
|
+
"all": {
|
|
1385
|
+
"type": "array",
|
|
1386
|
+
"items": {
|
|
1387
|
+
"anyOf": [
|
|
1388
|
+
{
|
|
1389
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
"$ref": "#/components/schemas/PatternNestedCondition"
|
|
1393
|
+
}
|
|
1394
|
+
]
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
},
|
|
1398
|
+
"required": [
|
|
1399
|
+
"all"
|
|
1400
|
+
],
|
|
1401
|
+
"additionalProperties": false
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"type": "object",
|
|
1405
|
+
"description": "Any conditions must be true (OR logic)",
|
|
1406
|
+
"properties": {
|
|
1407
|
+
"any": {
|
|
1408
|
+
"type": "array",
|
|
1409
|
+
"items": {
|
|
1410
|
+
"anyOf": [
|
|
1411
|
+
{
|
|
1412
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
"$ref": "#/components/schemas/PatternNestedCondition"
|
|
1416
|
+
}
|
|
1417
|
+
]
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
},
|
|
1421
|
+
"required": [
|
|
1422
|
+
"any"
|
|
1423
|
+
],
|
|
1424
|
+
"additionalProperties": false
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
"type": "object",
|
|
1428
|
+
"description": "NOT condition (negation)",
|
|
1429
|
+
"properties": {
|
|
1430
|
+
"not": {
|
|
1431
|
+
"anyOf": [
|
|
1432
|
+
{
|
|
1433
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1434
|
+
},
|
|
1435
|
+
{
|
|
1436
|
+
"$ref": "#/components/schemas/PatternNestedCondition"
|
|
1437
|
+
}
|
|
1438
|
+
]
|
|
1439
|
+
}
|
|
1440
|
+
},
|
|
1441
|
+
"required": [
|
|
1442
|
+
"not"
|
|
1443
|
+
],
|
|
1444
|
+
"additionalProperties": false
|
|
1445
|
+
}
|
|
1446
|
+
]
|
|
1447
|
+
},
|
|
1448
|
+
"PatternNestedCondition": {
|
|
1449
|
+
"description": "Nested condition with logical operators (level 2 only)",
|
|
1450
|
+
"anyOf": [
|
|
1451
|
+
{
|
|
1452
|
+
"type": "object",
|
|
1453
|
+
"properties": {
|
|
1454
|
+
"all": {
|
|
1455
|
+
"type": "array",
|
|
1456
|
+
"items": {
|
|
1457
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
"required": [
|
|
1462
|
+
"all"
|
|
1463
|
+
]
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"type": "object",
|
|
1467
|
+
"properties": {
|
|
1468
|
+
"any": {
|
|
1469
|
+
"type": "array",
|
|
1470
|
+
"items": {
|
|
1471
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
},
|
|
1475
|
+
"required": [
|
|
1476
|
+
"any"
|
|
1477
|
+
]
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
"type": "object",
|
|
1481
|
+
"properties": {
|
|
1482
|
+
"not": {
|
|
1483
|
+
"$ref": "#/components/schemas/PatternFactCondition"
|
|
1484
|
+
}
|
|
1485
|
+
},
|
|
1486
|
+
"required": [
|
|
1487
|
+
"not"
|
|
1488
|
+
]
|
|
1489
|
+
}
|
|
1490
|
+
]
|
|
1491
|
+
},
|
|
1492
|
+
"PatternFactCondition": {
|
|
1493
|
+
"description": "Fact-based condition for pattern validation",
|
|
1494
|
+
"type": "object",
|
|
1495
|
+
"oneOf": [
|
|
1496
|
+
{
|
|
1497
|
+
"description": "Numeric condition (total-length fact)",
|
|
1498
|
+
"required": [
|
|
1499
|
+
"fact",
|
|
1500
|
+
"operator",
|
|
1501
|
+
"value"
|
|
1502
|
+
],
|
|
1503
|
+
"properties": {
|
|
1504
|
+
"fact": {
|
|
1505
|
+
"type": "string",
|
|
1506
|
+
"enum": [
|
|
1507
|
+
"total-length"
|
|
1508
|
+
],
|
|
1509
|
+
"description": "The name of the value to validate."
|
|
1510
|
+
},
|
|
1511
|
+
"operator": {
|
|
1512
|
+
"type": "string",
|
|
1513
|
+
"enum": [
|
|
1514
|
+
"equal",
|
|
1515
|
+
"notEqual",
|
|
1516
|
+
"lessThan",
|
|
1517
|
+
"lessThanInclusive",
|
|
1518
|
+
"greaterThan",
|
|
1519
|
+
"greaterThanInclusive"
|
|
1520
|
+
],
|
|
1521
|
+
"description": "Numeric comparison operator"
|
|
1522
|
+
},
|
|
1523
|
+
"value": {
|
|
1524
|
+
"type": "number",
|
|
1525
|
+
"description": "Numeric value to compare against"
|
|
1526
|
+
},
|
|
1527
|
+
"params": {
|
|
1528
|
+
"description": "Additional parameters for the condition",
|
|
1529
|
+
"type": "object",
|
|
1530
|
+
"properties": {
|
|
1531
|
+
"errorMessage": {
|
|
1532
|
+
"type": "string",
|
|
1533
|
+
"description": "Custom error message"
|
|
1534
|
+
},
|
|
1535
|
+
"start": {
|
|
1536
|
+
"type": "number",
|
|
1537
|
+
"description": "From where to check"
|
|
1538
|
+
},
|
|
1539
|
+
"end": {
|
|
1540
|
+
"type": "number",
|
|
1541
|
+
"description": "To where to check"
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
"description": "Exact digits condition",
|
|
1549
|
+
"required": [
|
|
1550
|
+
"fact",
|
|
1551
|
+
"operator",
|
|
1552
|
+
"value"
|
|
1553
|
+
],
|
|
1554
|
+
"properties": {
|
|
1555
|
+
"fact": {
|
|
1556
|
+
"type": "string",
|
|
1557
|
+
"enum": [
|
|
1558
|
+
"static-check",
|
|
1559
|
+
"total-length"
|
|
1560
|
+
],
|
|
1561
|
+
"description": "The name of the value to validate."
|
|
1562
|
+
},
|
|
1563
|
+
"operator": {
|
|
1564
|
+
"type": "string",
|
|
1565
|
+
"enum": [
|
|
1566
|
+
"exactlyNDigits"
|
|
1567
|
+
],
|
|
1568
|
+
"description": "Exact digit count operator"
|
|
1569
|
+
},
|
|
1570
|
+
"value": {
|
|
1571
|
+
"type": "number",
|
|
1572
|
+
"description": "Number of digits required"
|
|
1573
|
+
},
|
|
1574
|
+
"params": {
|
|
1575
|
+
"description": "Additional parameters for the condition",
|
|
1576
|
+
"type": "object",
|
|
1577
|
+
"properties": {
|
|
1578
|
+
"errorMessage": {
|
|
1579
|
+
"type": "string",
|
|
1580
|
+
"description": "Custom error message"
|
|
1581
|
+
},
|
|
1582
|
+
"start": {
|
|
1583
|
+
"type": "number",
|
|
1584
|
+
"description": "From where to check"
|
|
1585
|
+
},
|
|
1586
|
+
"end": {
|
|
1587
|
+
"type": "number",
|
|
1588
|
+
"description": "To where to check"
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
},
|
|
1594
|
+
{
|
|
1595
|
+
"description": "Array-based condition (in, notIn, contains, doesNotContain)",
|
|
1596
|
+
"required": [
|
|
1597
|
+
"fact",
|
|
1598
|
+
"operator",
|
|
1599
|
+
"value"
|
|
1600
|
+
],
|
|
1601
|
+
"properties": {
|
|
1602
|
+
"fact": {
|
|
1603
|
+
"type": "string",
|
|
1604
|
+
"enum": [
|
|
1605
|
+
"static-check"
|
|
1606
|
+
],
|
|
1607
|
+
"description": "The name of the value to validate."
|
|
1608
|
+
},
|
|
1609
|
+
"operator": {
|
|
1610
|
+
"type": "string",
|
|
1611
|
+
"enum": [
|
|
1612
|
+
"in",
|
|
1613
|
+
"notIn",
|
|
1614
|
+
"contains",
|
|
1615
|
+
"doesNotContain"
|
|
1616
|
+
],
|
|
1617
|
+
"description": "Array-based comparison operator"
|
|
1618
|
+
},
|
|
1619
|
+
"value": {
|
|
1620
|
+
"type": "array",
|
|
1621
|
+
"items": {
|
|
1622
|
+
"type": "string"
|
|
1623
|
+
},
|
|
1624
|
+
"description": "Array of string values for array-based operators"
|
|
1625
|
+
},
|
|
1626
|
+
"params": {
|
|
1627
|
+
"description": "Additional parameters for the condition",
|
|
1628
|
+
"type": "object",
|
|
1629
|
+
"properties": {
|
|
1630
|
+
"errorMessage": {
|
|
1631
|
+
"type": "string",
|
|
1632
|
+
"description": "Custom error message"
|
|
1633
|
+
},
|
|
1634
|
+
"start": {
|
|
1635
|
+
"type": "number",
|
|
1636
|
+
"description": "From where to check"
|
|
1637
|
+
},
|
|
1638
|
+
"end": {
|
|
1639
|
+
"type": "number",
|
|
1640
|
+
"description": "To where to check"
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
},
|
|
1646
|
+
{
|
|
1647
|
+
"description": "String-based condition",
|
|
1648
|
+
"required": [
|
|
1649
|
+
"fact",
|
|
1650
|
+
"operator",
|
|
1651
|
+
"value"
|
|
1652
|
+
],
|
|
1653
|
+
"properties": {
|
|
1654
|
+
"fact": {
|
|
1655
|
+
"type": "string",
|
|
1656
|
+
"enum": [
|
|
1657
|
+
"static-check"
|
|
1658
|
+
],
|
|
1659
|
+
"description": "The name of the value to validate."
|
|
1660
|
+
},
|
|
1661
|
+
"operator": {
|
|
1662
|
+
"type": "string",
|
|
1663
|
+
"enum": [
|
|
1664
|
+
"equal",
|
|
1665
|
+
"notEqual"
|
|
1666
|
+
],
|
|
1667
|
+
"description": "String comparison operator"
|
|
1668
|
+
},
|
|
1669
|
+
"value": {
|
|
1670
|
+
"type": "string",
|
|
1671
|
+
"description": "String value to compare against"
|
|
1672
|
+
},
|
|
1673
|
+
"params": {
|
|
1674
|
+
"description": "Additional parameters for the condition",
|
|
1675
|
+
"type": "object",
|
|
1676
|
+
"properties": {
|
|
1677
|
+
"errorMessage": {
|
|
1678
|
+
"type": "string",
|
|
1679
|
+
"description": "Custom error message"
|
|
1680
|
+
},
|
|
1681
|
+
"start": {
|
|
1682
|
+
"type": "number",
|
|
1683
|
+
"description": "From where to check"
|
|
1684
|
+
},
|
|
1685
|
+
"end": {
|
|
1686
|
+
"type": "number",
|
|
1687
|
+
"description": "To where to check"
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
]
|
|
1694
|
+
},
|
|
1695
|
+
"NumericCondition": {
|
|
1696
|
+
"description": "Condition definition for a numeric-based validation rule (2 levels deep)",
|
|
1697
|
+
"anyOf": [
|
|
1698
|
+
{
|
|
1699
|
+
"type": "object",
|
|
1700
|
+
"description": "All conditions must be true (AND logic)",
|
|
1701
|
+
"properties": {
|
|
1702
|
+
"all": {
|
|
1703
|
+
"type": "array",
|
|
1704
|
+
"items": {
|
|
1705
|
+
"anyOf": [
|
|
1706
|
+
{
|
|
1707
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
"$ref": "#/components/schemas/NumericNestedCondition"
|
|
1711
|
+
}
|
|
1712
|
+
]
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
},
|
|
1716
|
+
"required": [
|
|
1717
|
+
"all"
|
|
1718
|
+
],
|
|
1719
|
+
"additionalProperties": false
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
"type": "object",
|
|
1723
|
+
"description": "Any conditions must be true (OR logic)",
|
|
1724
|
+
"properties": {
|
|
1725
|
+
"any": {
|
|
1726
|
+
"type": "array",
|
|
1727
|
+
"items": {
|
|
1728
|
+
"anyOf": [
|
|
1729
|
+
{
|
|
1730
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
"$ref": "#/components/schemas/NumericNestedCondition"
|
|
1734
|
+
}
|
|
1735
|
+
]
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
"required": [
|
|
1740
|
+
"any"
|
|
1741
|
+
],
|
|
1742
|
+
"additionalProperties": false
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
"type": "object",
|
|
1746
|
+
"description": "NOT condition (negation)",
|
|
1747
|
+
"properties": {
|
|
1748
|
+
"not": {
|
|
1749
|
+
"anyOf": [
|
|
1750
|
+
{
|
|
1751
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"$ref": "#/components/schemas/NumericNestedCondition"
|
|
1755
|
+
}
|
|
1756
|
+
]
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
"required": [
|
|
1760
|
+
"not"
|
|
1761
|
+
],
|
|
1762
|
+
"additionalProperties": false
|
|
1763
|
+
}
|
|
1764
|
+
]
|
|
1765
|
+
},
|
|
1766
|
+
"NumericNestedCondition": {
|
|
1767
|
+
"description": "Nested condition with logical operators (level 2 only)",
|
|
1768
|
+
"anyOf": [
|
|
1769
|
+
{
|
|
1770
|
+
"type": "object",
|
|
1771
|
+
"properties": {
|
|
1772
|
+
"all": {
|
|
1773
|
+
"type": "array",
|
|
1774
|
+
"items": {
|
|
1775
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1776
|
+
}
|
|
1777
|
+
}
|
|
1778
|
+
},
|
|
1779
|
+
"required": [
|
|
1780
|
+
"all"
|
|
1781
|
+
]
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
"type": "object",
|
|
1785
|
+
"properties": {
|
|
1786
|
+
"any": {
|
|
1787
|
+
"type": "array",
|
|
1788
|
+
"items": {
|
|
1789
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
"required": [
|
|
1794
|
+
"any"
|
|
1795
|
+
]
|
|
1796
|
+
},
|
|
1797
|
+
{
|
|
1798
|
+
"type": "object",
|
|
1799
|
+
"properties": {
|
|
1800
|
+
"not": {
|
|
1801
|
+
"$ref": "#/components/schemas/NumericFactCondition"
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1804
|
+
"required": [
|
|
1805
|
+
"not"
|
|
1806
|
+
]
|
|
1807
|
+
}
|
|
1808
|
+
]
|
|
1809
|
+
},
|
|
1810
|
+
"NumericFactCondition": {
|
|
1811
|
+
"description": "Fact-based condition for numeric validation",
|
|
1812
|
+
"type": "object",
|
|
1813
|
+
"oneOf": [
|
|
1814
|
+
{
|
|
1815
|
+
"description": "Numeric value comparison",
|
|
1816
|
+
"required": [
|
|
1817
|
+
"fact",
|
|
1818
|
+
"operator",
|
|
1819
|
+
"value"
|
|
1820
|
+
],
|
|
1821
|
+
"properties": {
|
|
1822
|
+
"fact": {
|
|
1823
|
+
"type": "string",
|
|
1824
|
+
"enum": [
|
|
1825
|
+
"numeric-value",
|
|
1826
|
+
"total-length"
|
|
1827
|
+
],
|
|
1828
|
+
"description": "The numeric value extracted from input; The amount of digits"
|
|
1829
|
+
},
|
|
1830
|
+
"operator": {
|
|
1831
|
+
"type": "string",
|
|
1832
|
+
"enum": [
|
|
1833
|
+
"equal",
|
|
1834
|
+
"notEqual",
|
|
1835
|
+
"lessThan",
|
|
1836
|
+
"lessThanInclusive",
|
|
1837
|
+
"greaterThan",
|
|
1838
|
+
"greaterThanInclusive"
|
|
1839
|
+
],
|
|
1840
|
+
"description": "Numeric comparison operator"
|
|
1841
|
+
},
|
|
1842
|
+
"value": {
|
|
1843
|
+
"type": "number",
|
|
1844
|
+
"description": "Numeric value to compare against"
|
|
1845
|
+
},
|
|
1846
|
+
"params": {
|
|
1847
|
+
"description": "Additional parameters for the condition",
|
|
1848
|
+
"type": "object",
|
|
1849
|
+
"properties": {
|
|
1850
|
+
"errorMessage": {
|
|
1851
|
+
"type": "string",
|
|
1852
|
+
"description": "Custom error message"
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
"description": "Integer digits count validation",
|
|
1860
|
+
"required": [
|
|
1861
|
+
"fact",
|
|
1862
|
+
"operator",
|
|
1863
|
+
"value"
|
|
1864
|
+
],
|
|
1865
|
+
"properties": {
|
|
1866
|
+
"fact": {
|
|
1867
|
+
"type": "string",
|
|
1868
|
+
"enum": [
|
|
1869
|
+
"integer-digits-count"
|
|
1870
|
+
],
|
|
1871
|
+
"description": "Count of integer digits (excludes leading zeros unless allowed)"
|
|
1872
|
+
},
|
|
1873
|
+
"operator": {
|
|
1874
|
+
"type": "string",
|
|
1875
|
+
"enum": [
|
|
1876
|
+
"equal",
|
|
1877
|
+
"exactlyNDigits",
|
|
1878
|
+
"minIntegerDigits",
|
|
1879
|
+
"maxIntegerDigits"
|
|
1880
|
+
],
|
|
1881
|
+
"description": "Digit count comparison operator"
|
|
1882
|
+
},
|
|
1883
|
+
"value": {
|
|
1884
|
+
"type": "number",
|
|
1885
|
+
"description": "Expected number of integer digits"
|
|
1886
|
+
},
|
|
1887
|
+
"params": {
|
|
1888
|
+
"description": "Additional parameters for the condition",
|
|
1889
|
+
"type": "object",
|
|
1890
|
+
"properties": {
|
|
1891
|
+
"errorMessage": {
|
|
1892
|
+
"type": "string",
|
|
1893
|
+
"description": "Custom error message"
|
|
1894
|
+
},
|
|
1895
|
+
"allowLeadingZeroes": {
|
|
1896
|
+
"type": "boolean",
|
|
1897
|
+
"description": "Whether to count leading zeroes in digit count",
|
|
1898
|
+
"default": false
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
"description": "Decimal digits count validation",
|
|
1906
|
+
"required": [
|
|
1907
|
+
"fact",
|
|
1908
|
+
"operator",
|
|
1909
|
+
"value"
|
|
1910
|
+
],
|
|
1911
|
+
"properties": {
|
|
1912
|
+
"fact": {
|
|
1913
|
+
"type": "string",
|
|
1914
|
+
"enum": [
|
|
1915
|
+
"decimal-digits-count"
|
|
1916
|
+
],
|
|
1917
|
+
"description": "Count of decimal digits"
|
|
1918
|
+
},
|
|
1919
|
+
"operator": {
|
|
1920
|
+
"type": "string",
|
|
1921
|
+
"enum": [
|
|
1922
|
+
"equal",
|
|
1923
|
+
"minDecimalDigits",
|
|
1924
|
+
"maxDecimalDigits"
|
|
1925
|
+
],
|
|
1926
|
+
"description": "Decimal digit count comparison operator"
|
|
1927
|
+
},
|
|
1928
|
+
"value": {
|
|
1929
|
+
"type": "number",
|
|
1930
|
+
"description": "Expected number of decimal digits"
|
|
1931
|
+
},
|
|
1932
|
+
"params": {
|
|
1933
|
+
"description": "Additional parameters for the condition",
|
|
1934
|
+
"type": "object",
|
|
1935
|
+
"properties": {
|
|
1936
|
+
"errorMessage": {
|
|
1937
|
+
"type": "string",
|
|
1938
|
+
"description": "Custom error message"
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
"description": "Leading zeros validation",
|
|
1946
|
+
"required": [
|
|
1947
|
+
"fact",
|
|
1948
|
+
"operator",
|
|
1949
|
+
"value"
|
|
1950
|
+
],
|
|
1951
|
+
"properties": {
|
|
1952
|
+
"fact": {
|
|
1953
|
+
"type": "string",
|
|
1954
|
+
"enum": [
|
|
1955
|
+
"has-leading-zeroes"
|
|
1956
|
+
],
|
|
1957
|
+
"description": "Whether the input has leading zeros"
|
|
1958
|
+
},
|
|
1959
|
+
"operator": {
|
|
1960
|
+
"type": "string",
|
|
1961
|
+
"enum": [
|
|
1962
|
+
"equal",
|
|
1963
|
+
"notAllowed"
|
|
1964
|
+
],
|
|
1965
|
+
"description": "Leading zeros check operator"
|
|
1966
|
+
},
|
|
1967
|
+
"value": {
|
|
1968
|
+
"type": "boolean",
|
|
1969
|
+
"description": "Whether leading zeros should be present or not"
|
|
1970
|
+
},
|
|
1971
|
+
"params": {
|
|
1972
|
+
"description": "Additional parameters for the condition",
|
|
1973
|
+
"type": "object",
|
|
1974
|
+
"properties": {
|
|
1975
|
+
"errorMessage": {
|
|
1976
|
+
"type": "string",
|
|
1977
|
+
"description": "Custom error message"
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
]
|
|
1984
|
+
},
|
|
1985
|
+
"ComparisonRuleType": {
|
|
1986
|
+
"type": "object",
|
|
1987
|
+
"description": "Declarative 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",
|
|
1988
|
+
"required": [
|
|
1989
|
+
"input_type",
|
|
1990
|
+
"conditions"
|
|
1991
|
+
],
|
|
1992
|
+
"additionalProperties": false,
|
|
1993
|
+
"properties": {
|
|
1994
|
+
"input_type": {
|
|
1995
|
+
"type": "string",
|
|
1996
|
+
"enum": [
|
|
1997
|
+
"number",
|
|
1998
|
+
"date",
|
|
1999
|
+
"text"
|
|
2000
|
+
],
|
|
2001
|
+
"description": "The kind of input value the rule validates. Determines which operators are allowed."
|
|
2002
|
+
},
|
|
2003
|
+
"conditions": {
|
|
2004
|
+
"type": "array",
|
|
2005
|
+
"description": "The comparisons the input value must satisfy. All blocking conditions must pass\nfor the input to be valid; `allow_failure` conditions are advisory and excluded\nfrom the verdict. Must contain at least one condition (enforced at write time).\n",
|
|
2006
|
+
"items": {
|
|
2007
|
+
"$ref": "#/components/schemas/Condition"
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
2012
|
+
"Condition": {
|
|
2013
|
+
"type": "object",
|
|
2014
|
+
"description": "A single comparison the input value must satisfy.",
|
|
2015
|
+
"required": [
|
|
2016
|
+
"id",
|
|
2017
|
+
"operator",
|
|
2018
|
+
"value",
|
|
2019
|
+
"error_message"
|
|
2020
|
+
],
|
|
2021
|
+
"additionalProperties": false,
|
|
2022
|
+
"properties": {
|
|
2023
|
+
"id": {
|
|
2024
|
+
"type": "string",
|
|
2025
|
+
"minLength": 1,
|
|
2026
|
+
"maxLength": 50,
|
|
2027
|
+
"description": "Stable identifier of the condition within the rule, used for editing and error reporting."
|
|
2028
|
+
},
|
|
2029
|
+
"operator": {
|
|
2030
|
+
"$ref": "#/components/schemas/Operator"
|
|
2031
|
+
},
|
|
2032
|
+
"value": {
|
|
2033
|
+
"$ref": "#/components/schemas/ConditionValue"
|
|
2034
|
+
},
|
|
2035
|
+
"error_message": {
|
|
2036
|
+
"type": "string",
|
|
2037
|
+
"minLength": 1,
|
|
2038
|
+
"maxLength": 200,
|
|
2039
|
+
"description": "Message shown to the end user when this condition fails."
|
|
2040
|
+
},
|
|
2041
|
+
"applies_when": {
|
|
2042
|
+
"$ref": "#/components/schemas/AppliesWhen"
|
|
2043
|
+
},
|
|
2044
|
+
"allow_failure": {
|
|
2045
|
+
"type": "boolean",
|
|
2046
|
+
"default": false,
|
|
2047
|
+
"description": "When true, the condition is advisory: it is always evaluated and reported\nwhen it fails, but it never takes part in the validity verdict.\nThe input is valid when every blocking (non-advisory) condition passes.\nA rule whose conditions are all advisory is always valid (warnings only).\n"
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
},
|
|
2051
|
+
"Operator": {
|
|
2052
|
+
"type": "string",
|
|
2053
|
+
"description": "Predefined 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, notInPast, regexMatch\n- text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,\n greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, maxDigits, maxDecimals\nRange operators (between, dateBetween, lengthBetween) require a `range` value;\nunary operators (notInFuture, notInPast) require a `none` value; all others require a scalar value.\nregexMatch validates the raw input string's format and always takes a static string pattern.\nNumeric comparison operators on text rules parse the input as a number at evaluation time\n(free-text fields often hold numbers); unparsable input fails the condition.\nmaxDigits limits how many digits the written input may contain in total (grouping\nseparators, sign and the decimal separator are not counted); maxDecimals limits how many\ndigits may follow the decimal separator. Both take a non-negative integer comparison value\nand, like the other numeric operators, are also allowed on text rules.\n",
|
|
2054
|
+
"enum": [
|
|
2055
|
+
"equal",
|
|
2056
|
+
"notEqual",
|
|
2057
|
+
"greaterThan",
|
|
2058
|
+
"greaterThanInclusive",
|
|
2059
|
+
"lessThan",
|
|
2060
|
+
"lessThanInclusive",
|
|
2061
|
+
"between",
|
|
2062
|
+
"dateBefore",
|
|
2063
|
+
"dateOnOrBefore",
|
|
2064
|
+
"dateAfter",
|
|
2065
|
+
"dateOnOrAfter",
|
|
2066
|
+
"dateBetween",
|
|
2067
|
+
"notInFuture",
|
|
2068
|
+
"notInPast",
|
|
2069
|
+
"contains",
|
|
2070
|
+
"doesNotContain",
|
|
2071
|
+
"startsWith",
|
|
2072
|
+
"endsWith",
|
|
2073
|
+
"regexMatch",
|
|
2074
|
+
"lengthBetween",
|
|
2075
|
+
"maxDigits",
|
|
2076
|
+
"maxDecimals"
|
|
2077
|
+
]
|
|
2078
|
+
},
|
|
2079
|
+
"ConditionValue": {
|
|
2080
|
+
"description": "The comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).",
|
|
2081
|
+
"oneOf": [
|
|
2082
|
+
{
|
|
2083
|
+
"$ref": "#/components/schemas/StaticValue"
|
|
2084
|
+
},
|
|
2085
|
+
{
|
|
2086
|
+
"$ref": "#/components/schemas/ContextValue"
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
"$ref": "#/components/schemas/RelativeDateValue"
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
"$ref": "#/components/schemas/RangeValue"
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
"$ref": "#/components/schemas/NoValue"
|
|
2096
|
+
}
|
|
2097
|
+
]
|
|
2098
|
+
},
|
|
2099
|
+
"ScalarValue": {
|
|
2100
|
+
"description": "A single comparison value - static, resolved from context, or a relative date.",
|
|
2101
|
+
"oneOf": [
|
|
2102
|
+
{
|
|
2103
|
+
"$ref": "#/components/schemas/StaticValue"
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
"$ref": "#/components/schemas/ContextValue"
|
|
2107
|
+
},
|
|
2108
|
+
{
|
|
2109
|
+
"$ref": "#/components/schemas/RelativeDateValue"
|
|
2110
|
+
}
|
|
2111
|
+
]
|
|
2112
|
+
},
|
|
2113
|
+
"StaticValue": {
|
|
2114
|
+
"type": "object",
|
|
2115
|
+
"description": "A fixed comparison value.",
|
|
2116
|
+
"required": [
|
|
2117
|
+
"source",
|
|
2118
|
+
"data"
|
|
2119
|
+
],
|
|
2120
|
+
"additionalProperties": false,
|
|
2121
|
+
"properties": {
|
|
2122
|
+
"source": {
|
|
2123
|
+
"type": "string",
|
|
2124
|
+
"enum": [
|
|
2125
|
+
"static"
|
|
2126
|
+
]
|
|
2127
|
+
},
|
|
2128
|
+
"data": {
|
|
2129
|
+
"description": "The literal value. Numbers for numeric comparisons, ISO 8601 date strings for date comparisons, strings for text comparisons.",
|
|
2130
|
+
"oneOf": [
|
|
2131
|
+
{
|
|
2132
|
+
"type": "number"
|
|
2133
|
+
},
|
|
2134
|
+
{
|
|
2135
|
+
"type": "string"
|
|
2136
|
+
},
|
|
2137
|
+
{
|
|
2138
|
+
"type": "boolean"
|
|
2139
|
+
}
|
|
2140
|
+
]
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
},
|
|
2144
|
+
"ContextValue": {
|
|
2145
|
+
"type": "object",
|
|
2146
|
+
"description": "A 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",
|
|
2147
|
+
"required": [
|
|
2148
|
+
"source",
|
|
2149
|
+
"path"
|
|
2150
|
+
],
|
|
2151
|
+
"additionalProperties": false,
|
|
2152
|
+
"properties": {
|
|
2153
|
+
"source": {
|
|
2154
|
+
"type": "string",
|
|
2155
|
+
"enum": [
|
|
2156
|
+
"context"
|
|
2157
|
+
]
|
|
2158
|
+
},
|
|
2159
|
+
"path": {
|
|
2160
|
+
"type": "string",
|
|
2161
|
+
"minLength": 1,
|
|
2162
|
+
"maxLength": 200,
|
|
2163
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z0-9_]+)*$",
|
|
2164
|
+
"description": "Dot-separated path into the resolved context."
|
|
2165
|
+
},
|
|
2166
|
+
"adjust": {
|
|
2167
|
+
"$ref": "#/components/schemas/ValueAdjustment"
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
},
|
|
2171
|
+
"ValueAdjustment": {
|
|
2172
|
+
"type": "object",
|
|
2173
|
+
"description": "Adjusts 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",
|
|
2174
|
+
"required": [
|
|
2175
|
+
"type",
|
|
2176
|
+
"value",
|
|
2177
|
+
"direction"
|
|
2178
|
+
],
|
|
2179
|
+
"additionalProperties": false,
|
|
2180
|
+
"properties": {
|
|
2181
|
+
"type": {
|
|
2182
|
+
"type": "string",
|
|
2183
|
+
"enum": [
|
|
2184
|
+
"percent",
|
|
2185
|
+
"absolute"
|
|
2186
|
+
]
|
|
2187
|
+
},
|
|
2188
|
+
"value": {
|
|
2189
|
+
"description": "The adjustment amount - a fixed number, or a context path resolving to a number\n(e.g. a per-contract percentage limit). Contextual adjustment values must not\ncarry a nested adjustment.\n",
|
|
2190
|
+
"oneOf": [
|
|
2191
|
+
{
|
|
2192
|
+
"type": "number",
|
|
2193
|
+
"minimum": 0
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
"$ref": "#/components/schemas/ContextValue"
|
|
2197
|
+
}
|
|
2198
|
+
]
|
|
2199
|
+
},
|
|
2200
|
+
"direction": {
|
|
2201
|
+
"type": "string",
|
|
2202
|
+
"enum": [
|
|
2203
|
+
"increase",
|
|
2204
|
+
"decrease"
|
|
2205
|
+
]
|
|
2206
|
+
},
|
|
2207
|
+
"rounding": {
|
|
2208
|
+
"type": "string",
|
|
2209
|
+
"enum": [
|
|
2210
|
+
"up",
|
|
2211
|
+
"down"
|
|
2212
|
+
],
|
|
2213
|
+
"description": "Rounds the adjusted result to a whole number - `up` (ceiling) or `down` (floor).\nOmitted means no rounding. Used for bounds like \"round up(current × 0.9) to whole euros\".\n"
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
},
|
|
2217
|
+
"RelativeDateValue": {
|
|
2218
|
+
"type": "object",
|
|
2219
|
+
"description": "A date relative to the evaluation moment, e.g. \"today minus 30 days\". Only valid for date rules.",
|
|
2220
|
+
"required": [
|
|
2221
|
+
"source",
|
|
2222
|
+
"offset",
|
|
2223
|
+
"unit"
|
|
2224
|
+
],
|
|
2225
|
+
"additionalProperties": false,
|
|
2226
|
+
"properties": {
|
|
2227
|
+
"source": {
|
|
2228
|
+
"type": "string",
|
|
2229
|
+
"enum": [
|
|
2230
|
+
"relative_date"
|
|
2231
|
+
]
|
|
2232
|
+
},
|
|
2233
|
+
"offset": {
|
|
2234
|
+
"type": "integer",
|
|
2235
|
+
"minimum": -36500,
|
|
2236
|
+
"maximum": 36500,
|
|
2237
|
+
"description": "Offset from the anchor. Negative values are in the past, positive in the future, 0 is the anchor itself."
|
|
2238
|
+
},
|
|
2239
|
+
"unit": {
|
|
2240
|
+
"type": "string",
|
|
2241
|
+
"enum": [
|
|
2242
|
+
"days",
|
|
2243
|
+
"months",
|
|
2244
|
+
"years"
|
|
2245
|
+
]
|
|
2246
|
+
},
|
|
2247
|
+
"anchor": {
|
|
2248
|
+
"type": "string",
|
|
2249
|
+
"enum": [
|
|
2250
|
+
"today"
|
|
2251
|
+
],
|
|
2252
|
+
"default": "today"
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
},
|
|
2256
|
+
"RangeValue": {
|
|
2257
|
+
"type": "object",
|
|
2258
|
+
"description": "A lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.",
|
|
2259
|
+
"required": [
|
|
2260
|
+
"source",
|
|
2261
|
+
"min",
|
|
2262
|
+
"max"
|
|
2263
|
+
],
|
|
2264
|
+
"additionalProperties": false,
|
|
2265
|
+
"properties": {
|
|
2266
|
+
"source": {
|
|
2267
|
+
"type": "string",
|
|
2268
|
+
"enum": [
|
|
2269
|
+
"range"
|
|
2270
|
+
]
|
|
2271
|
+
},
|
|
2272
|
+
"min": {
|
|
2273
|
+
"$ref": "#/components/schemas/ScalarValue"
|
|
2274
|
+
},
|
|
2275
|
+
"max": {
|
|
2276
|
+
"$ref": "#/components/schemas/ScalarValue"
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
},
|
|
2280
|
+
"NoValue": {
|
|
2281
|
+
"type": "object",
|
|
2282
|
+
"description": "No comparison value - used by unary operators such as notInFuture / notInPast.",
|
|
2283
|
+
"required": [
|
|
2284
|
+
"source"
|
|
2285
|
+
],
|
|
2286
|
+
"additionalProperties": false,
|
|
2287
|
+
"properties": {
|
|
2288
|
+
"source": {
|
|
2289
|
+
"type": "string",
|
|
2290
|
+
"enum": [
|
|
2291
|
+
"none"
|
|
2292
|
+
]
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
},
|
|
2296
|
+
"AppliesWhen": {
|
|
2297
|
+
"type": "object",
|
|
2298
|
+
"description": "Optional 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",
|
|
2299
|
+
"required": [
|
|
2300
|
+
"path",
|
|
2301
|
+
"operator"
|
|
2302
|
+
],
|
|
2303
|
+
"additionalProperties": false,
|
|
2304
|
+
"properties": {
|
|
2305
|
+
"path": {
|
|
2306
|
+
"type": "string",
|
|
2307
|
+
"minLength": 1,
|
|
2308
|
+
"maxLength": 200,
|
|
2309
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z0-9_]+)*$",
|
|
2310
|
+
"description": "Dot-separated context path whose first segment must match a declared context schema."
|
|
2311
|
+
},
|
|
2312
|
+
"operator": {
|
|
2313
|
+
"type": "string",
|
|
2314
|
+
"enum": [
|
|
2315
|
+
"equal",
|
|
2316
|
+
"notEqual",
|
|
2317
|
+
"greaterThan",
|
|
2318
|
+
"greaterThanInclusive",
|
|
2319
|
+
"lessThan",
|
|
2320
|
+
"lessThanInclusive",
|
|
2321
|
+
"isEmpty",
|
|
2322
|
+
"isNotEmpty"
|
|
2323
|
+
],
|
|
2324
|
+
"description": "Comparison applied to the resolved context value. `isEmpty` / `isNotEmpty`\ntake no `value`; all other operators require one.\n"
|
|
2325
|
+
},
|
|
2326
|
+
"value": {
|
|
2327
|
+
"description": "Static comparison value for binary operators.",
|
|
2328
|
+
"oneOf": [
|
|
2329
|
+
{
|
|
2330
|
+
"type": "number"
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
"type": "string"
|
|
2334
|
+
},
|
|
2335
|
+
{
|
|
2336
|
+
"type": "boolean"
|
|
2337
|
+
}
|
|
2338
|
+
]
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
},
|
|
2342
|
+
"ContextRequirement": {
|
|
2343
|
+
"type": "object",
|
|
2344
|
+
"description": "An 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 comparisons use the meter/meter_counter entity schemas\n(e.g. `meter_counter.current_consumption` for the previous reading value).\n",
|
|
2345
|
+
"required": [
|
|
2346
|
+
"schema"
|
|
2347
|
+
],
|
|
2348
|
+
"additionalProperties": false,
|
|
2349
|
+
"properties": {
|
|
2350
|
+
"schema": {
|
|
2351
|
+
"type": "string",
|
|
2352
|
+
"minLength": 1,
|
|
2353
|
+
"description": "Entity schema slug.",
|
|
2354
|
+
"example": "contract"
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
},
|
|
2360
|
+
"servers": [
|
|
2361
|
+
{
|
|
2362
|
+
"url": "https://validation-rules.sls.epilot.io"
|
|
2363
|
+
}
|
|
2364
|
+
]
|
|
2365
|
+
}
|