@epilot/sdk 2.18.13 → 2.18.15
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/calendar.json +25 -25
- package/definitions/validation-rules-runtime.json +1 -1
- package/definitions/validation-rules.json +840 -37
- 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.d.cts +2 -2
- package/dist/apis/calendar.d.ts +2 -2
- 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.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.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 +8 -8
- package/dist/apis/validation-rules.d.cts +2 -2
- package/dist/apis/validation-rules.d.ts +2 -2
- package/dist/apis/validation-rules.js +2 -2
- 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/{calendar-GJ7UX6PX.cjs → calendar-EMNHW6ME.cjs} +1 -1
- package/dist/{calendar-W42TSLFV.js → calendar-PZFEAXYE.js} +1 -1
- package/dist/{calendar.d-Cinz1Vzo.d.cts → calendar.d-Cz8R-GJ5.d.cts} +22 -7
- package/dist/{calendar.d-Cinz1Vzo.d.ts → calendar.d-Cz8R-GJ5.d.ts} +22 -7
- package/dist/{chunk-O2ELDNPK.cjs → chunk-22LE7Q52.cjs} +3 -3
- package/dist/{chunk-2UWWI6AM.js → chunk-GSQI3C2W.js} +3 -3
- package/dist/chunk-HRSCAD3W.cjs +14 -0
- package/dist/chunk-PPX45U34.js +14 -0
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/validation-rules-CU5JJKDV.cjs +7 -0
- package/dist/validation-rules-M2JVIR7U.js +7 -0
- package/dist/{validation-rules-runtime-X7M3QE5I.cjs → validation-rules-runtime-DENVKYLF.cjs} +2 -2
- package/dist/{validation-rules-runtime-6MRCS5X2.js → validation-rules-runtime-VGLVHV36.js} +1 -1
- package/dist/{validation-rules.d-Db5c5zTf.d.cts → validation-rules.d-BBy6Cw2O.d.cts} +519 -46
- package/dist/{validation-rules.d-Db5c5zTf.d.ts → validation-rules.d-BBy6Cw2O.d.ts} +519 -46
- package/docs/calendar.md +16 -2
- package/docs/validation-rules.md +417 -31
- package/package.json +1 -1
- package/dist/chunk-7IKQIVUS.js +0 -14
- package/dist/chunk-JIUTCNTB.cjs +0 -14
- package/dist/validation-rules-P6F5P73P.js +0 -7
- package/dist/validation-rules-VDU3CIZV.cjs +0 -7
package/docs/validation-rules.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# Validation Rules API
|
|
2
2
|
|
|
3
|
-
- **Base URL:** `https://validation-rules.sls.epilot.io`
|
|
4
3
|
- **Full API Docs:** [https://docs.epilot.io/api/validation-rules](https://docs.epilot.io/api/validation-rules)
|
|
5
4
|
|
|
6
5
|
## Usage
|
|
@@ -52,10 +51,22 @@ const { data } = await validationRulesClient.getValidationRules(...)
|
|
|
52
51
|
- [`NumericCondition`](#numericcondition)
|
|
53
52
|
- [`NumericNestedCondition`](#numericnestedcondition)
|
|
54
53
|
- [`NumericFactCondition`](#numericfactcondition)
|
|
54
|
+
- [`ComparisonRuleType`](#comparisonruletype)
|
|
55
|
+
- [`Condition`](#condition)
|
|
56
|
+
- [`Operator`](#operator)
|
|
57
|
+
- [`ConditionValue`](#conditionvalue)
|
|
58
|
+
- [`ScalarValue`](#scalarvalue)
|
|
59
|
+
- [`StaticValue`](#staticvalue)
|
|
60
|
+
- [`ContextValue`](#contextvalue)
|
|
61
|
+
- [`ValueAdjustment`](#valueadjustment)
|
|
62
|
+
- [`RelativeDateValue`](#relativedatevalue)
|
|
63
|
+
- [`RangeValue`](#rangevalue)
|
|
64
|
+
- [`NoValue`](#novalue)
|
|
65
|
+
- [`ContextRequirement`](#contextrequirement)
|
|
55
66
|
|
|
56
67
|
### `getValidationRules`
|
|
57
68
|
|
|
58
|
-
|
|
69
|
+
Returns all validation rules belonging to the authenticated user's organization.
|
|
59
70
|
|
|
60
71
|
`GET /v1/validation-rules`
|
|
61
72
|
|
|
@@ -75,8 +86,7 @@ const { data } = await client.getValidationRules()
|
|
|
75
86
|
"used_by": [
|
|
76
87
|
{
|
|
77
88
|
"type": "journey",
|
|
78
|
-
"
|
|
79
|
-
"source_id": "string"
|
|
89
|
+
"source_id": "journey-xyz789"
|
|
80
90
|
}
|
|
81
91
|
],
|
|
82
92
|
"rule": {
|
|
@@ -106,6 +116,11 @@ const { data } = await client.getValidationRules()
|
|
|
106
116
|
]
|
|
107
117
|
}
|
|
108
118
|
},
|
|
119
|
+
"contexts": [
|
|
120
|
+
{
|
|
121
|
+
"schema": "contract"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
109
124
|
"_schema_version": "string",
|
|
110
125
|
"_id": "string",
|
|
111
126
|
"_organization_id": "string",
|
|
@@ -124,7 +139,7 @@ const { data } = await client.getValidationRules()
|
|
|
124
139
|
|
|
125
140
|
### `createValidationRule`
|
|
126
141
|
|
|
127
|
-
|
|
142
|
+
Creates a new validation rule for the authenticated organization.
|
|
128
143
|
|
|
129
144
|
`POST /v1/validation-rules`
|
|
130
145
|
|
|
@@ -137,8 +152,7 @@ const { data } = await client.createValidationRule(
|
|
|
137
152
|
used_by: [
|
|
138
153
|
{
|
|
139
154
|
type: 'journey',
|
|
140
|
-
|
|
141
|
-
source_id: 'string'
|
|
155
|
+
source_id: 'journey-xyz789'
|
|
142
156
|
}
|
|
143
157
|
],
|
|
144
158
|
rule: {
|
|
@@ -167,7 +181,12 @@ const { data } = await client.createValidationRule(
|
|
|
167
181
|
}
|
|
168
182
|
]
|
|
169
183
|
}
|
|
170
|
-
}
|
|
184
|
+
},
|
|
185
|
+
contexts: [
|
|
186
|
+
{
|
|
187
|
+
schema: 'contract'
|
|
188
|
+
}
|
|
189
|
+
]
|
|
171
190
|
},
|
|
172
191
|
)
|
|
173
192
|
```
|
|
@@ -182,8 +201,7 @@ const { data } = await client.createValidationRule(
|
|
|
182
201
|
"used_by": [
|
|
183
202
|
{
|
|
184
203
|
"type": "journey",
|
|
185
|
-
"
|
|
186
|
-
"source_id": "string"
|
|
204
|
+
"source_id": "journey-xyz789"
|
|
187
205
|
}
|
|
188
206
|
],
|
|
189
207
|
"rule": {
|
|
@@ -213,6 +231,11 @@ const { data } = await client.createValidationRule(
|
|
|
213
231
|
]
|
|
214
232
|
}
|
|
215
233
|
},
|
|
234
|
+
"contexts": [
|
|
235
|
+
{
|
|
236
|
+
"schema": "contract"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
216
239
|
"_schema_version": "string",
|
|
217
240
|
"_id": "string",
|
|
218
241
|
"_organization_id": "string",
|
|
@@ -229,7 +252,7 @@ const { data } = await client.createValidationRule(
|
|
|
229
252
|
|
|
230
253
|
### `getValidationRuleById`
|
|
231
254
|
|
|
232
|
-
|
|
255
|
+
Retrieves a specific validation rule by its unique ID.
|
|
233
256
|
|
|
234
257
|
`GET /v1/validation-rules/{ruleId}`
|
|
235
258
|
|
|
@@ -249,8 +272,7 @@ const { data } = await client.getValidationRuleById({
|
|
|
249
272
|
"used_by": [
|
|
250
273
|
{
|
|
251
274
|
"type": "journey",
|
|
252
|
-
"
|
|
253
|
-
"source_id": "string"
|
|
275
|
+
"source_id": "journey-xyz789"
|
|
254
276
|
}
|
|
255
277
|
],
|
|
256
278
|
"rule": {
|
|
@@ -280,6 +302,11 @@ const { data } = await client.getValidationRuleById({
|
|
|
280
302
|
]
|
|
281
303
|
}
|
|
282
304
|
},
|
|
305
|
+
"contexts": [
|
|
306
|
+
{
|
|
307
|
+
"schema": "contract"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
283
310
|
"_schema_version": "string",
|
|
284
311
|
"_id": "string",
|
|
285
312
|
"_organization_id": "string",
|
|
@@ -296,7 +323,7 @@ const { data } = await client.getValidationRuleById({
|
|
|
296
323
|
|
|
297
324
|
### `updateValidationRule`
|
|
298
325
|
|
|
299
|
-
|
|
326
|
+
Partially updates an existing validation rule by ID. Only the fields provided in the request body are updated.
|
|
300
327
|
|
|
301
328
|
`PATCH /v1/validation-rules/{ruleId}`
|
|
302
329
|
|
|
@@ -311,8 +338,7 @@ const { data } = await client.updateValidationRule(
|
|
|
311
338
|
used_by: [
|
|
312
339
|
{
|
|
313
340
|
type: 'journey',
|
|
314
|
-
|
|
315
|
-
source_id: 'string'
|
|
341
|
+
source_id: 'journey-xyz789'
|
|
316
342
|
}
|
|
317
343
|
],
|
|
318
344
|
rule: {
|
|
@@ -341,7 +367,12 @@ const { data } = await client.updateValidationRule(
|
|
|
341
367
|
}
|
|
342
368
|
]
|
|
343
369
|
}
|
|
344
|
-
}
|
|
370
|
+
},
|
|
371
|
+
contexts: [
|
|
372
|
+
{
|
|
373
|
+
schema: 'contract'
|
|
374
|
+
}
|
|
375
|
+
]
|
|
345
376
|
},
|
|
346
377
|
)
|
|
347
378
|
```
|
|
@@ -356,8 +387,7 @@ const { data } = await client.updateValidationRule(
|
|
|
356
387
|
"used_by": [
|
|
357
388
|
{
|
|
358
389
|
"type": "journey",
|
|
359
|
-
"
|
|
360
|
-
"source_id": "string"
|
|
390
|
+
"source_id": "journey-xyz789"
|
|
361
391
|
}
|
|
362
392
|
],
|
|
363
393
|
"rule": {
|
|
@@ -387,6 +417,11 @@ const { data } = await client.updateValidationRule(
|
|
|
387
417
|
]
|
|
388
418
|
}
|
|
389
419
|
},
|
|
420
|
+
"contexts": [
|
|
421
|
+
{
|
|
422
|
+
"schema": "contract"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
390
425
|
"_schema_version": "string",
|
|
391
426
|
"_id": "string",
|
|
392
427
|
"_organization_id": "string",
|
|
@@ -403,7 +438,7 @@ const { data } = await client.updateValidationRule(
|
|
|
403
438
|
|
|
404
439
|
### `deleteValidationRule`
|
|
405
440
|
|
|
406
|
-
|
|
441
|
+
Permanently deletes a validation rule by ID. Any journeys or entity attributes referencing this rule should be updated before deletion.
|
|
407
442
|
|
|
408
443
|
`DELETE /v1/validation-rules/{ruleId}`
|
|
409
444
|
|
|
@@ -417,7 +452,7 @@ const { data } = await client.deleteValidationRule({
|
|
|
417
452
|
|
|
418
453
|
### `addUsedByReference`
|
|
419
454
|
|
|
420
|
-
|
|
455
|
+
Adds a single `used_by` reference to an existing validation rule.
|
|
421
456
|
|
|
422
457
|
`POST /v1/validation-rules/{ruleId}/used-by`
|
|
423
458
|
|
|
@@ -428,8 +463,7 @@ const { data } = await client.addUsedByReference(
|
|
|
428
463
|
},
|
|
429
464
|
{
|
|
430
465
|
type: 'journey',
|
|
431
|
-
|
|
432
|
-
source_id: 'string'
|
|
466
|
+
source_id: 'journey-xyz789'
|
|
433
467
|
},
|
|
434
468
|
)
|
|
435
469
|
```
|
|
@@ -444,8 +478,7 @@ const { data } = await client.addUsedByReference(
|
|
|
444
478
|
"used_by": [
|
|
445
479
|
{
|
|
446
480
|
"type": "journey",
|
|
447
|
-
"
|
|
448
|
-
"source_id": "string"
|
|
481
|
+
"source_id": "journey-xyz789"
|
|
449
482
|
}
|
|
450
483
|
],
|
|
451
484
|
"rule": {
|
|
@@ -475,6 +508,11 @@ const { data } = await client.addUsedByReference(
|
|
|
475
508
|
]
|
|
476
509
|
}
|
|
477
510
|
},
|
|
511
|
+
"contexts": [
|
|
512
|
+
{
|
|
513
|
+
"schema": "contract"
|
|
514
|
+
}
|
|
515
|
+
],
|
|
478
516
|
"_schema_version": "string",
|
|
479
517
|
"_id": "string",
|
|
480
518
|
"_organization_id": "string",
|
|
@@ -491,7 +529,7 @@ const { data } = await client.addUsedByReference(
|
|
|
491
529
|
|
|
492
530
|
### `removeUsedByReference`
|
|
493
531
|
|
|
494
|
-
|
|
532
|
+
Removes a specific `used_by` reference from an existing validation rule.
|
|
495
533
|
|
|
496
534
|
`DELETE /v1/validation-rules/{ruleId}/used-by`
|
|
497
535
|
|
|
@@ -502,8 +540,7 @@ const { data } = await client.removeUsedByReference(
|
|
|
502
540
|
},
|
|
503
541
|
{
|
|
504
542
|
type: 'journey',
|
|
505
|
-
|
|
506
|
-
source_id: 'string'
|
|
543
|
+
source_id: 'journey-xyz789'
|
|
507
544
|
},
|
|
508
545
|
)
|
|
509
546
|
```
|
|
@@ -518,8 +555,7 @@ const { data } = await client.removeUsedByReference(
|
|
|
518
555
|
"used_by": [
|
|
519
556
|
{
|
|
520
557
|
"type": "journey",
|
|
521
|
-
"
|
|
522
|
-
"source_id": "string"
|
|
558
|
+
"source_id": "journey-xyz789"
|
|
523
559
|
}
|
|
524
560
|
],
|
|
525
561
|
"rule": {
|
|
@@ -549,6 +585,11 @@ const { data } = await client.removeUsedByReference(
|
|
|
549
585
|
]
|
|
550
586
|
}
|
|
551
587
|
},
|
|
588
|
+
"contexts": [
|
|
589
|
+
{
|
|
590
|
+
"schema": "contract"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
552
593
|
"_schema_version": "string",
|
|
553
594
|
"_id": "string",
|
|
554
595
|
"_organization_id": "string",
|
|
@@ -567,6 +608,8 @@ const { data } = await client.removeUsedByReference(
|
|
|
567
608
|
|
|
568
609
|
### `GetValidationRulesResponse`
|
|
569
610
|
|
|
611
|
+
Response envelope for listing all validation rules within an organization.
|
|
612
|
+
|
|
570
613
|
```ts
|
|
571
614
|
type GetValidationRulesResponse = {
|
|
572
615
|
results?: Array<{
|
|
@@ -625,7 +668,19 @@ type UpdateValidationRuleRequest = {
|
|
|
625
668
|
} | {
|
|
626
669
|
not: { ... }
|
|
627
670
|
}
|
|
671
|
+
} | {
|
|
672
|
+
input_type: "number" | "date" | "text"
|
|
673
|
+
conditions: Array<{
|
|
674
|
+
id: { ... }
|
|
675
|
+
operator: { ... }
|
|
676
|
+
value: { ... }
|
|
677
|
+
error_message: { ... }
|
|
678
|
+
allow_failure?: { ... }
|
|
679
|
+
}>
|
|
628
680
|
}
|
|
681
|
+
contexts?: Array<{
|
|
682
|
+
schema: string
|
|
683
|
+
}>
|
|
629
684
|
}
|
|
630
685
|
```
|
|
631
686
|
|
|
@@ -667,7 +722,19 @@ type ValidationRuleBase = {
|
|
|
667
722
|
} | {
|
|
668
723
|
not: { ... }
|
|
669
724
|
}
|
|
725
|
+
} | {
|
|
726
|
+
input_type: "number" | "date" | "text"
|
|
727
|
+
conditions: Array<{
|
|
728
|
+
id: { ... }
|
|
729
|
+
operator: { ... }
|
|
730
|
+
value: { ... }
|
|
731
|
+
error_message: { ... }
|
|
732
|
+
allow_failure?: { ... }
|
|
733
|
+
}>
|
|
670
734
|
}
|
|
735
|
+
contexts?: Array<{
|
|
736
|
+
schema: string
|
|
737
|
+
}>
|
|
671
738
|
}
|
|
672
739
|
```
|
|
673
740
|
|
|
@@ -689,7 +756,7 @@ type ValidationRule = {
|
|
|
689
756
|
|
|
690
757
|
### `UsedBy`
|
|
691
758
|
|
|
692
|
-
Describes where and how a validation rule is applied.
|
|
759
|
+
Describes where and how a validation rule is applied. Used to track associations between rules and the journeys or entity schemas that reference them.
|
|
693
760
|
|
|
694
761
|
```ts
|
|
695
762
|
type UsedBy = {
|
|
@@ -1595,3 +1662,322 @@ type NumericFactCondition = {
|
|
|
1595
1662
|
}
|
|
1596
1663
|
}
|
|
1597
1664
|
```
|
|
1665
|
+
|
|
1666
|
+
### `ComparisonRuleType`
|
|
1667
|
+
|
|
1668
|
+
Declarative validation rule (schema version v2). Supports predefined comparison operators
|
|
1669
|
+
over number, date and text inputs, with static, dynamic (context path) and relative-date
|
|
1670
|
+
comparison values.
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
```ts
|
|
1674
|
+
type ComparisonRuleType = {
|
|
1675
|
+
input_type: "number" | "date" | "text"
|
|
1676
|
+
conditions: Array<{
|
|
1677
|
+
id: string
|
|
1678
|
+
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
|
|
1679
|
+
value: {
|
|
1680
|
+
source: { ... }
|
|
1681
|
+
data: { ... }
|
|
1682
|
+
} | {
|
|
1683
|
+
source: { ... }
|
|
1684
|
+
path: { ... }
|
|
1685
|
+
adjust?: { ... }
|
|
1686
|
+
} | {
|
|
1687
|
+
source: { ... }
|
|
1688
|
+
offset: { ... }
|
|
1689
|
+
unit: { ... }
|
|
1690
|
+
anchor?: { ... }
|
|
1691
|
+
} | {
|
|
1692
|
+
source: { ... }
|
|
1693
|
+
min: { ... }
|
|
1694
|
+
max: { ... }
|
|
1695
|
+
} | {
|
|
1696
|
+
source: { ... }
|
|
1697
|
+
}
|
|
1698
|
+
error_message: string
|
|
1699
|
+
allow_failure?: boolean
|
|
1700
|
+
}>
|
|
1701
|
+
}
|
|
1702
|
+
```
|
|
1703
|
+
|
|
1704
|
+
### `Condition`
|
|
1705
|
+
|
|
1706
|
+
A single comparison the input value must satisfy.
|
|
1707
|
+
|
|
1708
|
+
```ts
|
|
1709
|
+
type Condition = {
|
|
1710
|
+
id: string
|
|
1711
|
+
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
|
|
1712
|
+
value: {
|
|
1713
|
+
source: "static"
|
|
1714
|
+
data: number | string | boolean
|
|
1715
|
+
} | {
|
|
1716
|
+
source: "context"
|
|
1717
|
+
path: string
|
|
1718
|
+
adjust?: {
|
|
1719
|
+
type: { ... }
|
|
1720
|
+
value: { ... }
|
|
1721
|
+
direction: { ... }
|
|
1722
|
+
}
|
|
1723
|
+
} | {
|
|
1724
|
+
source: "relative_date"
|
|
1725
|
+
offset: number
|
|
1726
|
+
unit: "days" | "months" | "years"
|
|
1727
|
+
anchor?: "today"
|
|
1728
|
+
} | {
|
|
1729
|
+
source: "range"
|
|
1730
|
+
min: {
|
|
1731
|
+
source: { ... }
|
|
1732
|
+
data: { ... }
|
|
1733
|
+
} | {
|
|
1734
|
+
source: { ... }
|
|
1735
|
+
path: { ... }
|
|
1736
|
+
adjust?: { ... }
|
|
1737
|
+
} | {
|
|
1738
|
+
source: { ... }
|
|
1739
|
+
offset: { ... }
|
|
1740
|
+
unit: { ... }
|
|
1741
|
+
anchor?: { ... }
|
|
1742
|
+
}
|
|
1743
|
+
max: {
|
|
1744
|
+
source: { ... }
|
|
1745
|
+
data: { ... }
|
|
1746
|
+
} | {
|
|
1747
|
+
source: { ... }
|
|
1748
|
+
path: { ... }
|
|
1749
|
+
adjust?: { ... }
|
|
1750
|
+
} | {
|
|
1751
|
+
source: { ... }
|
|
1752
|
+
offset: { ... }
|
|
1753
|
+
unit: { ... }
|
|
1754
|
+
anchor?: { ... }
|
|
1755
|
+
}
|
|
1756
|
+
} | {
|
|
1757
|
+
source: "none"
|
|
1758
|
+
}
|
|
1759
|
+
error_message: string
|
|
1760
|
+
allow_failure?: boolean
|
|
1761
|
+
}
|
|
1762
|
+
```
|
|
1763
|
+
|
|
1764
|
+
### `Operator`
|
|
1765
|
+
|
|
1766
|
+
Predefined comparison operator. Compatibility (enforced at write time):
|
|
1767
|
+
- number: equal, notEqual, greaterThan, greaterThanInclusive, lessThan, lessThanInclusive, between, regexMatch
|
|
1768
|
+
- date: dateBefore, dateOnOrBefore, dateAfter, dateOnOrAfter, dateBetween, notInFuture, notInPast, regexMatch
|
|
1769
|
+
- text:
|
|
1770
|
+
|
|
1771
|
+
```ts
|
|
1772
|
+
type Operator = "equal" | "notEqual" | "greaterThan" | "greaterThanInclusive" | "lessThan" | "lessThanInclusive" | "between" | "dateBefore" | "dateOnOrBefore" | "dateAfter" | "dateOnOrAfter" | "dateBetween" | "notInFuture" | "notInPast" | "contains" | "doesNotContain" | "startsWith" | "endsWith" | "regexMatch" | "lengthBetween"
|
|
1773
|
+
```
|
|
1774
|
+
|
|
1775
|
+
### `ConditionValue`
|
|
1776
|
+
|
|
1777
|
+
The comparison value of a condition - a scalar, a range of scalars, or nothing (unary operators).
|
|
1778
|
+
|
|
1779
|
+
```ts
|
|
1780
|
+
type ConditionValue = {
|
|
1781
|
+
source: "static"
|
|
1782
|
+
data: number | string | boolean
|
|
1783
|
+
} | {
|
|
1784
|
+
source: "context"
|
|
1785
|
+
path: string
|
|
1786
|
+
adjust?: {
|
|
1787
|
+
type: "percent" | "absolute"
|
|
1788
|
+
value: number
|
|
1789
|
+
direction: "increase" | "decrease"
|
|
1790
|
+
}
|
|
1791
|
+
} | {
|
|
1792
|
+
source: "relative_date"
|
|
1793
|
+
offset: number
|
|
1794
|
+
unit: "days" | "months" | "years"
|
|
1795
|
+
anchor?: "today"
|
|
1796
|
+
} | {
|
|
1797
|
+
source: "range"
|
|
1798
|
+
min: {
|
|
1799
|
+
source: "static"
|
|
1800
|
+
data: number | string | boolean
|
|
1801
|
+
} | {
|
|
1802
|
+
source: "context"
|
|
1803
|
+
path: string
|
|
1804
|
+
adjust?: {
|
|
1805
|
+
type: { ... }
|
|
1806
|
+
value: { ... }
|
|
1807
|
+
direction: { ... }
|
|
1808
|
+
}
|
|
1809
|
+
} | {
|
|
1810
|
+
source: "relative_date"
|
|
1811
|
+
offset: number
|
|
1812
|
+
unit: "days" | "months" | "years"
|
|
1813
|
+
anchor?: "today"
|
|
1814
|
+
}
|
|
1815
|
+
max: {
|
|
1816
|
+
source: "static"
|
|
1817
|
+
data: number | string | boolean
|
|
1818
|
+
} | {
|
|
1819
|
+
source: "context"
|
|
1820
|
+
path: string
|
|
1821
|
+
adjust?: {
|
|
1822
|
+
type: { ... }
|
|
1823
|
+
value: { ... }
|
|
1824
|
+
direction: { ... }
|
|
1825
|
+
}
|
|
1826
|
+
} | {
|
|
1827
|
+
source: "relative_date"
|
|
1828
|
+
offset: number
|
|
1829
|
+
unit: "days" | "months" | "years"
|
|
1830
|
+
anchor?: "today"
|
|
1831
|
+
}
|
|
1832
|
+
} | {
|
|
1833
|
+
source: "none"
|
|
1834
|
+
}
|
|
1835
|
+
```
|
|
1836
|
+
|
|
1837
|
+
### `ScalarValue`
|
|
1838
|
+
|
|
1839
|
+
A single comparison value - static, resolved from context, or a relative date.
|
|
1840
|
+
|
|
1841
|
+
```ts
|
|
1842
|
+
type ScalarValue = {
|
|
1843
|
+
source: "static"
|
|
1844
|
+
data: number | string | boolean
|
|
1845
|
+
} | {
|
|
1846
|
+
source: "context"
|
|
1847
|
+
path: string
|
|
1848
|
+
adjust?: {
|
|
1849
|
+
type: "percent" | "absolute"
|
|
1850
|
+
value: number
|
|
1851
|
+
direction: "increase" | "decrease"
|
|
1852
|
+
}
|
|
1853
|
+
} | {
|
|
1854
|
+
source: "relative_date"
|
|
1855
|
+
offset: number
|
|
1856
|
+
unit: "days" | "months" | "years"
|
|
1857
|
+
anchor?: "today"
|
|
1858
|
+
}
|
|
1859
|
+
```
|
|
1860
|
+
|
|
1861
|
+
### `StaticValue`
|
|
1862
|
+
|
|
1863
|
+
A fixed comparison value.
|
|
1864
|
+
|
|
1865
|
+
```ts
|
|
1866
|
+
type StaticValue = {
|
|
1867
|
+
source: "static"
|
|
1868
|
+
data: number | string | boolean
|
|
1869
|
+
}
|
|
1870
|
+
```
|
|
1871
|
+
|
|
1872
|
+
### `ContextValue`
|
|
1873
|
+
|
|
1874
|
+
A dynamic comparison value resolved from runtime context, e.g. `contract.installment_amount`
|
|
1875
|
+
or `previous_reading.value`. The first path segment must match the `name` of a declared
|
|
1876
|
+
context requirement.
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
```ts
|
|
1880
|
+
type ContextValue = {
|
|
1881
|
+
source: "context"
|
|
1882
|
+
path: string
|
|
1883
|
+
adjust?: {
|
|
1884
|
+
type: "percent" | "absolute"
|
|
1885
|
+
value: number
|
|
1886
|
+
direction: "increase" | "decrease"
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1891
|
+
### `ValueAdjustment`
|
|
1892
|
+
|
|
1893
|
+
Adjusts a context-resolved numeric value before comparison, e.g. "context value plus 10 percent".
|
|
1894
|
+
Used to express tolerance bands such as "at most 10% above the current instalment amount".
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
```ts
|
|
1898
|
+
type ValueAdjustment = {
|
|
1899
|
+
type: "percent" | "absolute"
|
|
1900
|
+
value: number
|
|
1901
|
+
direction: "increase" | "decrease"
|
|
1902
|
+
}
|
|
1903
|
+
```
|
|
1904
|
+
|
|
1905
|
+
### `RelativeDateValue`
|
|
1906
|
+
|
|
1907
|
+
A date relative to the evaluation moment, e.g. "today minus 30 days". Only valid for date rules.
|
|
1908
|
+
|
|
1909
|
+
```ts
|
|
1910
|
+
type RelativeDateValue = {
|
|
1911
|
+
source: "relative_date"
|
|
1912
|
+
offset: number
|
|
1913
|
+
unit: "days" | "months" | "years"
|
|
1914
|
+
anchor?: "today"
|
|
1915
|
+
}
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
### `RangeValue`
|
|
1919
|
+
|
|
1920
|
+
A lower and upper bound for range operators (between, dateBetween, lengthBetween). Bounds are inclusive.
|
|
1921
|
+
|
|
1922
|
+
```ts
|
|
1923
|
+
type RangeValue = {
|
|
1924
|
+
source: "range"
|
|
1925
|
+
min: {
|
|
1926
|
+
source: "static"
|
|
1927
|
+
data: number | string | boolean
|
|
1928
|
+
} | {
|
|
1929
|
+
source: "context"
|
|
1930
|
+
path: string
|
|
1931
|
+
adjust?: {
|
|
1932
|
+
type: { ... }
|
|
1933
|
+
value: { ... }
|
|
1934
|
+
direction: { ... }
|
|
1935
|
+
}
|
|
1936
|
+
} | {
|
|
1937
|
+
source: "relative_date"
|
|
1938
|
+
offset: number
|
|
1939
|
+
unit: "days" | "months" | "years"
|
|
1940
|
+
anchor?: "today"
|
|
1941
|
+
}
|
|
1942
|
+
max: {
|
|
1943
|
+
source: "static"
|
|
1944
|
+
data: number | string | boolean
|
|
1945
|
+
} | {
|
|
1946
|
+
source: "context"
|
|
1947
|
+
path: string
|
|
1948
|
+
adjust?: {
|
|
1949
|
+
type: { ... }
|
|
1950
|
+
value: { ... }
|
|
1951
|
+
direction: { ... }
|
|
1952
|
+
}
|
|
1953
|
+
} | {
|
|
1954
|
+
source: "relative_date"
|
|
1955
|
+
offset: number
|
|
1956
|
+
unit: "days" | "months" | "years"
|
|
1957
|
+
anchor?: "today"
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
```
|
|
1961
|
+
|
|
1962
|
+
### `NoValue`
|
|
1963
|
+
|
|
1964
|
+
No comparison value - used by unary operators such as notInFuture / notInPast.
|
|
1965
|
+
|
|
1966
|
+
```ts
|
|
1967
|
+
type NoValue = {
|
|
1968
|
+
source: "none"
|
|
1969
|
+
}
|
|
1970
|
+
```
|
|
1971
|
+
|
|
1972
|
+
### `ContextRequirement`
|
|
1973
|
+
|
|
1974
|
+
An entity context source the rule needs at evaluation time, referenced by `context`
|
|
1975
|
+
value paths via the schema slug as their first segment (e.g. `contract.installment_amount`).
|
|
1976
|
+
How the source is resolved (which entity instance) is decided by the consuming surface,
|
|
1977
|
+
not by the rule. Meter reading comp
|
|
1978
|
+
|
|
1979
|
+
```ts
|
|
1980
|
+
type ContextRequirement = {
|
|
1981
|
+
schema: string
|
|
1982
|
+
}
|
|
1983
|
+
```
|
package/package.json
CHANGED
package/dist/chunk-7IKQIVUS.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__commonJS
|
|
3
|
-
} from "./chunk-YPSWSI3M.js";
|
|
4
|
-
|
|
5
|
-
// src/definitions/validation-rules-runtime.json
|
|
6
|
-
var require_validation_rules_runtime = __commonJS({
|
|
7
|
-
"src/definitions/validation-rules-runtime.json"(exports, module) {
|
|
8
|
-
module.exports = { s: "https://validation-rules.sls.epilot.io", o: [["getValidationRules", "get", "/v1/validation-rules"], ["createValidationRule", "post", "/v1/validation-rules", null, 1], ["getValidationRuleById", "get", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["updateValidationRule", "patch", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]], 1], ["deleteValidationRule", "delete", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["addUsedByReference", "post", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1], ["removeUsedByReference", "delete", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1]], v: "3.0.3" };
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
require_validation_rules_runtime
|
|
14
|
-
};
|
package/dist/chunk-JIUTCNTB.cjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkNJK5F5TFcjs = require('./chunk-NJK5F5TF.cjs');
|
|
4
|
-
|
|
5
|
-
// src/definitions/validation-rules-runtime.json
|
|
6
|
-
var require_validation_rules_runtime = _chunkNJK5F5TFcjs.__commonJS.call(void 0, {
|
|
7
|
-
"src/definitions/validation-rules-runtime.json"(exports, module) {
|
|
8
|
-
module.exports = { s: "https://validation-rules.sls.epilot.io", o: [["getValidationRules", "get", "/v1/validation-rules"], ["createValidationRule", "post", "/v1/validation-rules", null, 1], ["getValidationRuleById", "get", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["updateValidationRule", "patch", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]], 1], ["deleteValidationRule", "delete", "/v1/validation-rules/{ruleId}", [["ruleId", "p", true]]], ["addUsedByReference", "post", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1], ["removeUsedByReference", "delete", "/v1/validation-rules/{ruleId}/used-by", [["ruleId", "p", true]], 1]], v: "3.0.3" };
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.require_validation_rules_runtime = require_validation_rules_runtime;
|