@epilot/cli 0.1.108 → 0.1.110
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/README.md +1 -1
- package/definitions/app.json +170 -38
- package/definitions/validation-rules.json +840 -37
- package/dist/{add-component-UPHG3VNG.js → add-component-TCF7V3KU.js} +1 -11
- package/dist/add-function-VRVBRNY3.js +184 -0
- package/dist/app-NATUF3YX.js +26 -0
- package/dist/bin/epilot.js +7 -7
- package/dist/{chunk-CZHW3BIT.js → chunk-QGAMGDQ5.js} +1 -1
- package/dist/{chunk-QOD77YLW.js → chunk-UDGF4AVJ.js} +263 -3
- package/dist/{completion-TFHA4W2J.js → completion-OMS4BH5U.js} +1 -1
- package/dist/{deploy-NRQHZ635.js → deploy-2U5FVEE7.js} +90 -9
- package/dist/dev-JEAHUYQU.js +105 -0
- package/dist/{export-ZRDJCALM.js → export-VLAY2KZP.js} +1 -1
- package/dist/{init-BXAGJAPS.js → init-C66L5GFR.js} +164 -4
- package/dist/{remove-component-LPTHVN4P.js → remove-component-7C7MPSBF.js} +1 -1
- package/dist/{review-OZTM3XBD.js → review-JZTMQNU3.js} +1 -1
- package/dist/{upgrade-HU256V6J.js → upgrade-KY6R7SUW.js} +1 -1
- package/dist/{validate-TLSOTJAY.js → validate-J35DJW3H.js} +9 -1
- package/dist/{versions-VA4H3EPK.js → versions-2TMTHO7W.js} +1 -1
- package/package.json +1 -1
- package/dist/app-RULTIGMJ.js +0 -24
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
"openapi": "3.0.3",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Validation Rules API",
|
|
5
|
-
"version": "1.0.0"
|
|
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"
|
|
6
7
|
},
|
|
7
8
|
"tags": [
|
|
8
9
|
{
|
|
9
10
|
"name": "Validation Rules",
|
|
10
|
-
"description": "
|
|
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"
|
|
11
12
|
}
|
|
12
13
|
],
|
|
13
14
|
"security": [
|
|
@@ -19,8 +20,8 @@
|
|
|
19
20
|
"/v1/validation-rules": {
|
|
20
21
|
"get": {
|
|
21
22
|
"operationId": "getValidationRules",
|
|
22
|
-
"summary": "
|
|
23
|
-
"description": "
|
|
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",
|
|
24
25
|
"tags": [
|
|
25
26
|
"Validation Rules"
|
|
26
27
|
],
|
|
@@ -36,6 +37,32 @@
|
|
|
36
37
|
"application/json": {
|
|
37
38
|
"schema": {
|
|
38
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
|
+
]
|
|
39
66
|
}
|
|
40
67
|
}
|
|
41
68
|
}
|
|
@@ -56,6 +83,38 @@
|
|
|
56
83
|
}
|
|
57
84
|
}
|
|
58
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
|
+
},
|
|
59
118
|
"500": {
|
|
60
119
|
"description": "Internal Server Error",
|
|
61
120
|
"content": {
|
|
@@ -76,8 +135,8 @@
|
|
|
76
135
|
},
|
|
77
136
|
"post": {
|
|
78
137
|
"operationId": "createValidationRule",
|
|
79
|
-
"summary": "
|
|
80
|
-
"description": "Creates a new validation rule",
|
|
138
|
+
"summary": "createValidationRule",
|
|
139
|
+
"description": "Creates a new validation rule for the authenticated organization.",
|
|
81
140
|
"tags": [
|
|
82
141
|
"Validation Rules"
|
|
83
142
|
],
|
|
@@ -87,22 +146,127 @@
|
|
|
87
146
|
}
|
|
88
147
|
],
|
|
89
148
|
"requestBody": {
|
|
149
|
+
"description": "Validation rule to create",
|
|
150
|
+
"required": true,
|
|
90
151
|
"content": {
|
|
91
152
|
"application/json": {
|
|
92
153
|
"schema": {
|
|
93
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
|
+
}
|
|
94
173
|
}
|
|
95
174
|
}
|
|
96
|
-
}
|
|
97
|
-
"description": "Payload"
|
|
175
|
+
}
|
|
98
176
|
},
|
|
99
177
|
"responses": {
|
|
100
178
|
"201": {
|
|
101
|
-
"description": "
|
|
179
|
+
"description": "Validation rule created successfully",
|
|
102
180
|
"content": {
|
|
103
181
|
"application/json": {
|
|
104
182
|
"schema": {
|
|
105
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
|
+
}
|
|
106
270
|
}
|
|
107
271
|
}
|
|
108
272
|
}
|
|
@@ -113,8 +277,8 @@
|
|
|
113
277
|
"/v1/validation-rules/{ruleId}": {
|
|
114
278
|
"get": {
|
|
115
279
|
"operationId": "getValidationRuleById",
|
|
116
|
-
"summary": "
|
|
117
|
-
"description": "Retrieves a specific validation rule by its ID",
|
|
280
|
+
"summary": "getValidationRuleById",
|
|
281
|
+
"description": "Retrieves a specific validation rule by its unique ID.",
|
|
118
282
|
"tags": [
|
|
119
283
|
"Validation Rules"
|
|
120
284
|
],
|
|
@@ -131,16 +295,71 @@
|
|
|
131
295
|
"schema": {
|
|
132
296
|
"type": "string"
|
|
133
297
|
},
|
|
134
|
-
"description": "The unique identifier of the validation rule to retrieve."
|
|
298
|
+
"description": "The unique identifier of the validation rule to retrieve.",
|
|
299
|
+
"example": "rule-abc123"
|
|
135
300
|
}
|
|
136
301
|
],
|
|
137
302
|
"responses": {
|
|
138
303
|
"200": {
|
|
139
|
-
"description": "
|
|
304
|
+
"description": "Validation rule retrieved successfully",
|
|
140
305
|
"content": {
|
|
141
306
|
"application/json": {
|
|
142
307
|
"schema": {
|
|
143
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
|
+
}
|
|
144
363
|
}
|
|
145
364
|
}
|
|
146
365
|
}
|
|
@@ -181,8 +400,8 @@
|
|
|
181
400
|
},
|
|
182
401
|
"patch": {
|
|
183
402
|
"operationId": "updateValidationRule",
|
|
184
|
-
"summary": "
|
|
185
|
-
"description": "
|
|
403
|
+
"summary": "updateValidationRule",
|
|
404
|
+
"description": "Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.",
|
|
186
405
|
"tags": [
|
|
187
406
|
"Validation Rules"
|
|
188
407
|
],
|
|
@@ -199,7 +418,8 @@
|
|
|
199
418
|
"schema": {
|
|
200
419
|
"type": "string"
|
|
201
420
|
},
|
|
202
|
-
"description": "The unique identifier of the validation rule to update."
|
|
421
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
422
|
+
"example": "rule-abc123"
|
|
203
423
|
}
|
|
204
424
|
],
|
|
205
425
|
"requestBody": {
|
|
@@ -207,6 +427,24 @@
|
|
|
207
427
|
"application/json": {
|
|
208
428
|
"schema": {
|
|
209
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
|
+
}
|
|
210
448
|
}
|
|
211
449
|
}
|
|
212
450
|
},
|
|
@@ -214,11 +452,33 @@
|
|
|
214
452
|
},
|
|
215
453
|
"responses": {
|
|
216
454
|
"200": {
|
|
217
|
-
"description": "
|
|
455
|
+
"description": "Validation rule updated successfully",
|
|
218
456
|
"content": {
|
|
219
457
|
"application/json": {
|
|
220
458
|
"schema": {
|
|
221
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
|
+
}
|
|
222
482
|
}
|
|
223
483
|
}
|
|
224
484
|
}
|
|
@@ -239,6 +499,54 @@
|
|
|
239
499
|
}
|
|
240
500
|
}
|
|
241
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
|
+
},
|
|
242
550
|
"500": {
|
|
243
551
|
"description": "Internal Server Error",
|
|
244
552
|
"content": {
|
|
@@ -259,8 +567,8 @@
|
|
|
259
567
|
},
|
|
260
568
|
"delete": {
|
|
261
569
|
"operationId": "deleteValidationRule",
|
|
262
|
-
"summary": "
|
|
263
|
-
"description": "
|
|
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.",
|
|
264
572
|
"tags": [
|
|
265
573
|
"Validation Rules"
|
|
266
574
|
],
|
|
@@ -277,13 +585,62 @@
|
|
|
277
585
|
"schema": {
|
|
278
586
|
"type": "string"
|
|
279
587
|
},
|
|
280
|
-
"description": "The unique identifier of the validation rule to delete."
|
|
588
|
+
"description": "The unique identifier of the validation rule to delete.",
|
|
589
|
+
"example": "rule-abc123"
|
|
281
590
|
}
|
|
282
591
|
],
|
|
283
592
|
"responses": {
|
|
284
593
|
"204": {
|
|
285
594
|
"description": "Validation rule deleted successfully"
|
|
286
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
|
+
},
|
|
287
644
|
"500": {
|
|
288
645
|
"description": "Internal Server Error",
|
|
289
646
|
"content": {
|
|
@@ -306,8 +663,8 @@
|
|
|
306
663
|
"/v1/validation-rules/{ruleId}/used-by": {
|
|
307
664
|
"post": {
|
|
308
665
|
"operationId": "addUsedByReference",
|
|
309
|
-
"summary": "
|
|
310
|
-
"description": "Adds a single reference to
|
|
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",
|
|
311
668
|
"tags": [
|
|
312
669
|
"Validation Rules"
|
|
313
670
|
],
|
|
@@ -324,7 +681,8 @@
|
|
|
324
681
|
"schema": {
|
|
325
682
|
"type": "string"
|
|
326
683
|
},
|
|
327
|
-
"description": "The unique identifier of the validation rule to update."
|
|
684
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
685
|
+
"example": "rule-abc123"
|
|
328
686
|
}
|
|
329
687
|
],
|
|
330
688
|
"requestBody": {
|
|
@@ -332,10 +690,14 @@
|
|
|
332
690
|
"application/json": {
|
|
333
691
|
"schema": {
|
|
334
692
|
"$ref": "#/components/schemas/UsedBy"
|
|
693
|
+
},
|
|
694
|
+
"example": {
|
|
695
|
+
"type": "journey",
|
|
696
|
+
"source_id": "journey-xyz789"
|
|
335
697
|
}
|
|
336
698
|
}
|
|
337
699
|
},
|
|
338
|
-
"description": "The
|
|
700
|
+
"description": "The used_by reference to add"
|
|
339
701
|
},
|
|
340
702
|
"responses": {
|
|
341
703
|
"200": {
|
|
@@ -344,6 +706,34 @@
|
|
|
344
706
|
"application/json": {
|
|
345
707
|
"schema": {
|
|
346
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
|
+
]
|
|
347
737
|
}
|
|
348
738
|
}
|
|
349
739
|
}
|
|
@@ -364,6 +754,38 @@
|
|
|
364
754
|
}
|
|
365
755
|
}
|
|
366
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
|
+
},
|
|
367
789
|
"404": {
|
|
368
790
|
"description": "Validation rule not found",
|
|
369
791
|
"content": {
|
|
@@ -400,8 +822,8 @@
|
|
|
400
822
|
},
|
|
401
823
|
"delete": {
|
|
402
824
|
"operationId": "removeUsedByReference",
|
|
403
|
-
"summary": "
|
|
404
|
-
"description": "Removes a specific reference from
|
|
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",
|
|
405
827
|
"tags": [
|
|
406
828
|
"Validation Rules"
|
|
407
829
|
],
|
|
@@ -418,7 +840,8 @@
|
|
|
418
840
|
"schema": {
|
|
419
841
|
"type": "string"
|
|
420
842
|
},
|
|
421
|
-
"description": "The unique identifier of the validation rule to update."
|
|
843
|
+
"description": "The unique identifier of the validation rule to update.",
|
|
844
|
+
"example": "rule-abc123"
|
|
422
845
|
}
|
|
423
846
|
],
|
|
424
847
|
"requestBody": {
|
|
@@ -426,10 +849,14 @@
|
|
|
426
849
|
"application/json": {
|
|
427
850
|
"schema": {
|
|
428
851
|
"$ref": "#/components/schemas/UsedBy"
|
|
852
|
+
},
|
|
853
|
+
"example": {
|
|
854
|
+
"type": "journey",
|
|
855
|
+
"source_id": "journey-xyz789"
|
|
429
856
|
}
|
|
430
857
|
}
|
|
431
858
|
},
|
|
432
|
-
"description": "The
|
|
859
|
+
"description": "The used_by reference to remove"
|
|
433
860
|
},
|
|
434
861
|
"responses": {
|
|
435
862
|
"200": {
|
|
@@ -438,6 +865,29 @@
|
|
|
438
865
|
"application/json": {
|
|
439
866
|
"schema": {
|
|
440
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": []
|
|
441
891
|
}
|
|
442
892
|
}
|
|
443
893
|
}
|
|
@@ -458,6 +908,38 @@
|
|
|
458
908
|
}
|
|
459
909
|
}
|
|
460
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
|
+
},
|
|
461
943
|
"404": {
|
|
462
944
|
"description": "Validation rule not found",
|
|
463
945
|
"content": {
|
|
@@ -512,9 +994,11 @@
|
|
|
512
994
|
"schemas": {
|
|
513
995
|
"GetValidationRulesResponse": {
|
|
514
996
|
"type": "object",
|
|
997
|
+
"description": "Response envelope for listing all validation rules within an organization.",
|
|
515
998
|
"properties": {
|
|
516
999
|
"results": {
|
|
517
1000
|
"type": "array",
|
|
1001
|
+
"description": "Flat list of all validation rules belonging to the authenticated organization.",
|
|
518
1002
|
"items": {
|
|
519
1003
|
"$ref": "#/components/schemas/ValidationRule"
|
|
520
1004
|
}
|
|
@@ -572,8 +1056,18 @@
|
|
|
572
1056
|
},
|
|
573
1057
|
{
|
|
574
1058
|
"$ref": "#/components/schemas/NumericRuleType"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
"$ref": "#/components/schemas/ComparisonRuleType"
|
|
575
1062
|
}
|
|
576
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"
|
|
577
1071
|
}
|
|
578
1072
|
}
|
|
579
1073
|
}
|
|
@@ -633,6 +1127,7 @@
|
|
|
633
1127
|
},
|
|
634
1128
|
"UsedBy": {
|
|
635
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.",
|
|
636
1131
|
"required": [
|
|
637
1132
|
"type"
|
|
638
1133
|
],
|
|
@@ -643,18 +1138,24 @@
|
|
|
643
1138
|
"journey",
|
|
644
1139
|
"entity"
|
|
645
1140
|
],
|
|
646
|
-
"description": "The context in which the rule is used
|
|
1141
|
+
"description": "The context in which the rule is used - either a journey block or an entity schema attribute.",
|
|
1142
|
+
"example": "journey"
|
|
647
1143
|
},
|
|
648
1144
|
"schema_slug": {
|
|
649
1145
|
"type": "string",
|
|
650
|
-
"description": "Slug of the schema using this rule
|
|
1146
|
+
"description": "Slug of the entity schema using this rule. Only applicable when `type` is `entity`.",
|
|
1147
|
+
"example": "contact"
|
|
651
1148
|
},
|
|
652
1149
|
"source_id": {
|
|
653
1150
|
"type": "string",
|
|
654
|
-
"description": "
|
|
1151
|
+
"description": "Unique identifier of the source (e.g. journey ID or entity attribute key) that references this rule.",
|
|
1152
|
+
"example": "journey-xyz789"
|
|
655
1153
|
}
|
|
656
1154
|
},
|
|
657
|
-
"
|
|
1155
|
+
"example": {
|
|
1156
|
+
"type": "journey",
|
|
1157
|
+
"source_id": "journey-xyz789"
|
|
1158
|
+
}
|
|
658
1159
|
},
|
|
659
1160
|
"RegexRuleType": {
|
|
660
1161
|
"description": "Validation rule that uses a regular expression to validate input.",
|
|
@@ -1480,12 +1981,314 @@
|
|
|
1480
1981
|
}
|
|
1481
1982
|
}
|
|
1482
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
|
+
"allow_failure": {
|
|
2042
|
+
"type": "boolean",
|
|
2043
|
+
"default": false,
|
|
2044
|
+
"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"
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
"Operator": {
|
|
2049
|
+
"type": "string",
|
|
2050
|
+
"description": "Predefined comparison operator. Compatibility (enforced at write time):\n- number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch\n- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch\n- text: equal, notEqual, contains, doesNotContain, startsWith, endsWith, regexMatch, lengthBetween,\n greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between\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.\n",
|
|
2051
|
+
"enum": [
|
|
2052
|
+
"equal",
|
|
2053
|
+
"notEqual",
|
|
2054
|
+
"greaterThan",
|
|
2055
|
+
"greaterThanInclusive",
|
|
2056
|
+
"lessThan",
|
|
2057
|
+
"lessThanInclusive",
|
|
2058
|
+
"between",
|
|
2059
|
+
"dateBefore",
|
|
2060
|
+
"dateOnOrBefore",
|
|
2061
|
+
"dateAfter",
|
|
2062
|
+
"dateOnOrAfter",
|
|
2063
|
+
"dateBetween",
|
|
2064
|
+
"notInFuture",
|
|
2065
|
+
"notInPast",
|
|
2066
|
+
"contains",
|
|
2067
|
+
"doesNotContain",
|
|
2068
|
+
"startsWith",
|
|
2069
|
+
"endsWith",
|
|
2070
|
+
"regexMatch",
|
|
2071
|
+
"lengthBetween"
|
|
2072
|
+
]
|
|
2073
|
+
},
|
|
2074
|
+
"ConditionValue": {
|
|
2075
|
+
"description": "The comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).",
|
|
2076
|
+
"oneOf": [
|
|
2077
|
+
{
|
|
2078
|
+
"$ref": "#/components/schemas/StaticValue"
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
"$ref": "#/components/schemas/ContextValue"
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
"$ref": "#/components/schemas/RelativeDateValue"
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
"$ref": "#/components/schemas/RangeValue"
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"$ref": "#/components/schemas/NoValue"
|
|
2091
|
+
}
|
|
2092
|
+
]
|
|
2093
|
+
},
|
|
2094
|
+
"ScalarValue": {
|
|
2095
|
+
"description": "A single comparison value - static, resolved from context, or a relative date.",
|
|
2096
|
+
"oneOf": [
|
|
2097
|
+
{
|
|
2098
|
+
"$ref": "#/components/schemas/StaticValue"
|
|
2099
|
+
},
|
|
2100
|
+
{
|
|
2101
|
+
"$ref": "#/components/schemas/ContextValue"
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
"$ref": "#/components/schemas/RelativeDateValue"
|
|
2105
|
+
}
|
|
2106
|
+
]
|
|
2107
|
+
},
|
|
2108
|
+
"StaticValue": {
|
|
2109
|
+
"type": "object",
|
|
2110
|
+
"description": "A fixed comparison value.",
|
|
2111
|
+
"required": [
|
|
2112
|
+
"source",
|
|
2113
|
+
"data"
|
|
2114
|
+
],
|
|
2115
|
+
"additionalProperties": false,
|
|
2116
|
+
"properties": {
|
|
2117
|
+
"source": {
|
|
2118
|
+
"type": "string",
|
|
2119
|
+
"enum": [
|
|
2120
|
+
"static"
|
|
2121
|
+
]
|
|
2122
|
+
},
|
|
2123
|
+
"data": {
|
|
2124
|
+
"description": "The literal value. Numbers for numeric comparisons, ISO 8601 date strings for date comparisons, strings for text comparisons.",
|
|
2125
|
+
"oneOf": [
|
|
2126
|
+
{
|
|
2127
|
+
"type": "number"
|
|
2128
|
+
},
|
|
2129
|
+
{
|
|
2130
|
+
"type": "string"
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
"type": "boolean"
|
|
2134
|
+
}
|
|
2135
|
+
]
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
"ContextValue": {
|
|
2140
|
+
"type": "object",
|
|
2141
|
+
"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",
|
|
2142
|
+
"required": [
|
|
2143
|
+
"source",
|
|
2144
|
+
"path"
|
|
2145
|
+
],
|
|
2146
|
+
"additionalProperties": false,
|
|
2147
|
+
"properties": {
|
|
2148
|
+
"source": {
|
|
2149
|
+
"type": "string",
|
|
2150
|
+
"enum": [
|
|
2151
|
+
"context"
|
|
2152
|
+
]
|
|
2153
|
+
},
|
|
2154
|
+
"path": {
|
|
2155
|
+
"type": "string",
|
|
2156
|
+
"minLength": 1,
|
|
2157
|
+
"maxLength": 200,
|
|
2158
|
+
"pattern": "^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z0-9_]+)*$",
|
|
2159
|
+
"description": "Dot-separated path into the resolved context."
|
|
2160
|
+
},
|
|
2161
|
+
"adjust": {
|
|
2162
|
+
"$ref": "#/components/schemas/ValueAdjustment"
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
},
|
|
2166
|
+
"ValueAdjustment": {
|
|
2167
|
+
"type": "object",
|
|
2168
|
+
"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",
|
|
2169
|
+
"required": [
|
|
2170
|
+
"type",
|
|
2171
|
+
"value",
|
|
2172
|
+
"direction"
|
|
2173
|
+
],
|
|
2174
|
+
"additionalProperties": false,
|
|
2175
|
+
"properties": {
|
|
2176
|
+
"type": {
|
|
2177
|
+
"type": "string",
|
|
2178
|
+
"enum": [
|
|
2179
|
+
"percent",
|
|
2180
|
+
"absolute"
|
|
2181
|
+
]
|
|
2182
|
+
},
|
|
2183
|
+
"value": {
|
|
2184
|
+
"type": "number",
|
|
2185
|
+
"minimum": 0
|
|
2186
|
+
},
|
|
2187
|
+
"direction": {
|
|
2188
|
+
"type": "string",
|
|
2189
|
+
"enum": [
|
|
2190
|
+
"increase",
|
|
2191
|
+
"decrease"
|
|
2192
|
+
]
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
"RelativeDateValue": {
|
|
2197
|
+
"type": "object",
|
|
2198
|
+
"description": "A date relative to the evaluation moment, e.g. \"today minus 30 days\". Only valid for date rules.",
|
|
2199
|
+
"required": [
|
|
2200
|
+
"source",
|
|
2201
|
+
"offset",
|
|
2202
|
+
"unit"
|
|
2203
|
+
],
|
|
2204
|
+
"additionalProperties": false,
|
|
2205
|
+
"properties": {
|
|
2206
|
+
"source": {
|
|
2207
|
+
"type": "string",
|
|
2208
|
+
"enum": [
|
|
2209
|
+
"relative_date"
|
|
2210
|
+
]
|
|
2211
|
+
},
|
|
2212
|
+
"offset": {
|
|
2213
|
+
"type": "integer",
|
|
2214
|
+
"minimum": -36500,
|
|
2215
|
+
"maximum": 36500,
|
|
2216
|
+
"description": "Offset from the anchor. Negative values are in the past, positive in the future, 0 is the anchor itself."
|
|
2217
|
+
},
|
|
2218
|
+
"unit": {
|
|
2219
|
+
"type": "string",
|
|
2220
|
+
"enum": [
|
|
2221
|
+
"days",
|
|
2222
|
+
"months",
|
|
2223
|
+
"years"
|
|
2224
|
+
]
|
|
2225
|
+
},
|
|
2226
|
+
"anchor": {
|
|
2227
|
+
"type": "string",
|
|
2228
|
+
"enum": [
|
|
2229
|
+
"today"
|
|
2230
|
+
],
|
|
2231
|
+
"default": "today"
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
},
|
|
2235
|
+
"RangeValue": {
|
|
2236
|
+
"type": "object",
|
|
2237
|
+
"description": "A lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.",
|
|
2238
|
+
"required": [
|
|
2239
|
+
"source",
|
|
2240
|
+
"min",
|
|
2241
|
+
"max"
|
|
2242
|
+
],
|
|
2243
|
+
"additionalProperties": false,
|
|
2244
|
+
"properties": {
|
|
2245
|
+
"source": {
|
|
2246
|
+
"type": "string",
|
|
2247
|
+
"enum": [
|
|
2248
|
+
"range"
|
|
2249
|
+
]
|
|
2250
|
+
},
|
|
2251
|
+
"min": {
|
|
2252
|
+
"$ref": "#/components/schemas/ScalarValue"
|
|
2253
|
+
},
|
|
2254
|
+
"max": {
|
|
2255
|
+
"$ref": "#/components/schemas/ScalarValue"
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
},
|
|
2259
|
+
"NoValue": {
|
|
2260
|
+
"type": "object",
|
|
2261
|
+
"description": "No comparison value - used by unary operators such as notInFuture / notInPast.",
|
|
2262
|
+
"required": [
|
|
2263
|
+
"source"
|
|
2264
|
+
],
|
|
2265
|
+
"additionalProperties": false,
|
|
2266
|
+
"properties": {
|
|
2267
|
+
"source": {
|
|
2268
|
+
"type": "string",
|
|
2269
|
+
"enum": [
|
|
2270
|
+
"none"
|
|
2271
|
+
]
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
},
|
|
2275
|
+
"ContextRequirement": {
|
|
2276
|
+
"type": "object",
|
|
2277
|
+
"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",
|
|
2278
|
+
"required": [
|
|
2279
|
+
"schema"
|
|
2280
|
+
],
|
|
2281
|
+
"additionalProperties": false,
|
|
2282
|
+
"properties": {
|
|
2283
|
+
"schema": {
|
|
2284
|
+
"type": "string",
|
|
2285
|
+
"minLength": 1,
|
|
2286
|
+
"description": "Entity schema slug.",
|
|
2287
|
+
"example": "contract"
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
1483
2290
|
}
|
|
1484
2291
|
}
|
|
1485
2292
|
},
|
|
1486
|
-
"servers": [
|
|
1487
|
-
{
|
|
1488
|
-
"url": "https://validation-rules.sls.epilot.io"
|
|
1489
|
-
}
|
|
1490
|
-
]
|
|
2293
|
+
"servers": []
|
|
1491
2294
|
}
|