@timeax/digital-service-engine 0.0.1

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.
@@ -0,0 +1,772 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/ServiceProps",
4
+ "definitions": {
5
+ "ServiceProps": {
6
+ "type": "object",
7
+ "properties": {
8
+ "order_for_tags": {
9
+ "type": "object",
10
+ "additionalProperties": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "string"
14
+ }
15
+ }
16
+ },
17
+ "filters": {
18
+ "type": "array",
19
+ "items": {
20
+ "$ref": "#/definitions/Tag"
21
+ }
22
+ },
23
+ "fields": {
24
+ "type": "array",
25
+ "items": {
26
+ "$ref": "#/definitions/Field"
27
+ }
28
+ },
29
+ "includes_for_buttons": {
30
+ "type": "object",
31
+ "additionalProperties": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ }
37
+ },
38
+ "excludes_for_buttons": {
39
+ "type": "object",
40
+ "additionalProperties": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string"
44
+ }
45
+ }
46
+ },
47
+ "schema_version": {
48
+ "type": "string"
49
+ },
50
+ "fallbacks": {
51
+ "$ref": "#/definitions/ServiceFallback"
52
+ }
53
+ },
54
+ "required": [
55
+ "filters",
56
+ "fields"
57
+ ]
58
+ },
59
+ "Tag": {
60
+ "type": "object",
61
+ "properties": {
62
+ "id": {
63
+ "type": "string"
64
+ },
65
+ "label": {
66
+ "type": "string"
67
+ },
68
+ "bind_id": {
69
+ "type": "string"
70
+ },
71
+ "service_id": {
72
+ "type": "number"
73
+ },
74
+ "includes": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string"
78
+ }
79
+ },
80
+ "excludes": {
81
+ "type": "array",
82
+ "items": {
83
+ "type": "string"
84
+ }
85
+ },
86
+ "meta": {
87
+ "type": "object",
88
+ "properties": {
89
+ "quantityDefault": {
90
+ "type": "number"
91
+ }
92
+ }
93
+ },
94
+ "constraints": {
95
+ "type": "object",
96
+ "additionalProperties": {
97
+ "type": "boolean"
98
+ },
99
+ "description": "Which flags are set for this tag. If a flag is not set, it's inherited from the nearest ancestor with a value set."
100
+ },
101
+ "constraints_origin": {
102
+ "type": "object",
103
+ "additionalProperties": {
104
+ "type": "string"
105
+ },
106
+ "description": "Which ancestor defined the *effective* value for each flag (nearest source)."
107
+ },
108
+ "constraints_overrides": {
109
+ "type": "object",
110
+ "additionalProperties": {
111
+ "type": "object",
112
+ "properties": {
113
+ "from": {
114
+ "type": "boolean"
115
+ },
116
+ "to": {
117
+ "type": "boolean"
118
+ },
119
+ "origin": {
120
+ "type": "string"
121
+ }
122
+ },
123
+ "required": [
124
+ "from",
125
+ "to",
126
+ "origin"
127
+ ]
128
+ },
129
+ "description": "Present only when a child explicitly set a different value but was overridden by an ancestor during normalisation."
130
+ }
131
+ },
132
+ "required": [
133
+ "id",
134
+ "label"
135
+ ]
136
+ },
137
+ "Field": {
138
+ "anyOf": [
139
+ {
140
+ "type": "object",
141
+ "properties": {
142
+ "button": {
143
+ "type": "boolean",
144
+ "const": false
145
+ },
146
+ "service_id": {
147
+ "not": {}
148
+ },
149
+ "id": {
150
+ "type": "string"
151
+ },
152
+ "type": {
153
+ "$ref": "#/definitions/FieldType"
154
+ },
155
+ "bind_id": {
156
+ "anyOf": [
157
+ {
158
+ "type": "string"
159
+ },
160
+ {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "string"
164
+ }
165
+ }
166
+ ]
167
+ },
168
+ "name": {
169
+ "type": "string"
170
+ },
171
+ "options": {
172
+ "type": "array",
173
+ "items": {
174
+ "$ref": "#/definitions/FieldOption"
175
+ }
176
+ },
177
+ "description": {
178
+ "type": "string"
179
+ },
180
+ "component": {
181
+ "type": "string"
182
+ },
183
+ "pricing_role": {
184
+ "$ref": "#/definitions/PricingRole"
185
+ },
186
+ "meta": {
187
+ "type": "object",
188
+ "properties": {
189
+ "multi": {
190
+ "type": "boolean"
191
+ },
192
+ "utility": {
193
+ "type": "object",
194
+ "properties": {
195
+ "rate": {
196
+ "type": "number"
197
+ },
198
+ "mode": {
199
+ "type": "string",
200
+ "enum": [
201
+ "flat",
202
+ "per_quantity",
203
+ "per_value",
204
+ "percent"
205
+ ]
206
+ },
207
+ "valueBy": {
208
+ "type": "string",
209
+ "enum": [
210
+ "value",
211
+ "length"
212
+ ]
213
+ },
214
+ "percentBase": {
215
+ "type": "string",
216
+ "enum": [
217
+ "service_total",
218
+ "base_service",
219
+ "all"
220
+ ]
221
+ },
222
+ "label": {
223
+ "type": "string"
224
+ }
225
+ },
226
+ "required": [
227
+ "rate",
228
+ "mode"
229
+ ]
230
+ },
231
+ "quantity": {
232
+ "type": "object",
233
+ "properties": {
234
+ "valueBy": {
235
+ "type": "string",
236
+ "enum": [
237
+ "value",
238
+ "length",
239
+ "eval"
240
+ ]
241
+ },
242
+ "code": {
243
+ "type": "string"
244
+ },
245
+ "multiply": {
246
+ "type": "number"
247
+ },
248
+ "clamp": {
249
+ "type": "object",
250
+ "properties": {
251
+ "min": {
252
+ "type": "number"
253
+ },
254
+ "max": {
255
+ "type": "number"
256
+ }
257
+ }
258
+ },
259
+ "fallback": {
260
+ "type": "number"
261
+ }
262
+ },
263
+ "required": [
264
+ "valueBy"
265
+ ]
266
+ }
267
+ }
268
+ },
269
+ "label": {
270
+ "type": "string"
271
+ },
272
+ "required": {
273
+ "type": "boolean"
274
+ },
275
+ "ui": {
276
+ "type": "object",
277
+ "additionalProperties": {
278
+ "$ref": "#/definitions/Ui"
279
+ },
280
+ "description": "Host-defined prop names → typed UI nodes"
281
+ },
282
+ "defaults": {
283
+ "type": "object",
284
+ "additionalProperties": {},
285
+ "description": "Host-defined prop names → runtime default values (untyped base)"
286
+ }
287
+ },
288
+ "required": [
289
+ "id",
290
+ "label",
291
+ "type"
292
+ ]
293
+ },
294
+ {
295
+ "type": "object",
296
+ "properties": {
297
+ "quantityDefault": {
298
+ "type": "number"
299
+ },
300
+ "button": {
301
+ "type": "boolean",
302
+ "const": true
303
+ },
304
+ "service_id": {
305
+ "type": "number"
306
+ },
307
+ "id": {
308
+ "type": "string"
309
+ },
310
+ "type": {
311
+ "$ref": "#/definitions/FieldType"
312
+ },
313
+ "bind_id": {
314
+ "anyOf": [
315
+ {
316
+ "type": "string"
317
+ },
318
+ {
319
+ "type": "array",
320
+ "items": {
321
+ "type": "string"
322
+ }
323
+ }
324
+ ]
325
+ },
326
+ "name": {
327
+ "type": "string"
328
+ },
329
+ "options": {
330
+ "type": "array",
331
+ "items": {
332
+ "$ref": "#/definitions/FieldOption"
333
+ }
334
+ },
335
+ "description": {
336
+ "type": "string"
337
+ },
338
+ "component": {
339
+ "type": "string"
340
+ },
341
+ "pricing_role": {
342
+ "$ref": "#/definitions/PricingRole"
343
+ },
344
+ "meta": {
345
+ "type": "object",
346
+ "properties": {
347
+ "multi": {
348
+ "type": "boolean"
349
+ },
350
+ "utility": {
351
+ "type": "object",
352
+ "properties": {
353
+ "rate": {
354
+ "type": "number"
355
+ },
356
+ "mode": {
357
+ "type": "string",
358
+ "enum": [
359
+ "flat",
360
+ "per_quantity",
361
+ "per_value",
362
+ "percent"
363
+ ]
364
+ },
365
+ "valueBy": {
366
+ "type": "string",
367
+ "enum": [
368
+ "value",
369
+ "length"
370
+ ]
371
+ },
372
+ "percentBase": {
373
+ "type": "string",
374
+ "enum": [
375
+ "service_total",
376
+ "base_service",
377
+ "all"
378
+ ]
379
+ },
380
+ "label": {
381
+ "type": "string"
382
+ }
383
+ },
384
+ "required": [
385
+ "rate",
386
+ "mode"
387
+ ]
388
+ },
389
+ "quantity": {
390
+ "type": "object",
391
+ "properties": {
392
+ "valueBy": {
393
+ "type": "string",
394
+ "enum": [
395
+ "value",
396
+ "length",
397
+ "eval"
398
+ ]
399
+ },
400
+ "code": {
401
+ "type": "string"
402
+ },
403
+ "multiply": {
404
+ "type": "number"
405
+ },
406
+ "clamp": {
407
+ "type": "object",
408
+ "properties": {
409
+ "min": {
410
+ "type": "number"
411
+ },
412
+ "max": {
413
+ "type": "number"
414
+ }
415
+ }
416
+ },
417
+ "fallback": {
418
+ "type": "number"
419
+ }
420
+ },
421
+ "required": [
422
+ "valueBy"
423
+ ]
424
+ }
425
+ }
426
+ },
427
+ "label": {
428
+ "type": "string"
429
+ },
430
+ "required": {
431
+ "type": "boolean"
432
+ },
433
+ "ui": {
434
+ "type": "object",
435
+ "additionalProperties": {
436
+ "$ref": "#/definitions/Ui"
437
+ },
438
+ "description": "Host-defined prop names → typed UI nodes"
439
+ },
440
+ "defaults": {
441
+ "type": "object",
442
+ "additionalProperties": {},
443
+ "description": "Host-defined prop names → runtime default values (untyped base)"
444
+ }
445
+ },
446
+ "required": [
447
+ "button",
448
+ "id",
449
+ "label",
450
+ "type"
451
+ ]
452
+ }
453
+ ]
454
+ },
455
+ "FieldType": {
456
+ "type": "string"
457
+ },
458
+ "FieldOption": {
459
+ "type": "object",
460
+ "properties": {
461
+ "id": {
462
+ "type": "string"
463
+ },
464
+ "label": {
465
+ "type": "string"
466
+ },
467
+ "value": {
468
+ "type": [
469
+ "string",
470
+ "number"
471
+ ]
472
+ },
473
+ "service_id": {
474
+ "type": "number"
475
+ },
476
+ "pricing_role": {
477
+ "$ref": "#/definitions/PricingRole"
478
+ },
479
+ "meta": {
480
+ "type": "object",
481
+ "properties": {
482
+ "quantityDefault": {
483
+ "type": "number"
484
+ },
485
+ "utility": {
486
+ "type": "object",
487
+ "properties": {
488
+ "rate": {
489
+ "type": "number"
490
+ },
491
+ "mode": {
492
+ "type": "string",
493
+ "enum": [
494
+ "flat",
495
+ "per_quantity",
496
+ "per_value",
497
+ "percent"
498
+ ]
499
+ },
500
+ "valueBy": {
501
+ "type": "string",
502
+ "enum": [
503
+ "value",
504
+ "length"
505
+ ]
506
+ },
507
+ "percentBase": {
508
+ "type": "string",
509
+ "enum": [
510
+ "service_total",
511
+ "base_service",
512
+ "all"
513
+ ]
514
+ },
515
+ "label": {
516
+ "type": "string"
517
+ }
518
+ },
519
+ "required": [
520
+ "rate",
521
+ "mode"
522
+ ]
523
+ }
524
+ }
525
+ }
526
+ },
527
+ "required": [
528
+ "id",
529
+ "label"
530
+ ]
531
+ },
532
+ "PricingRole": {
533
+ "type": "string",
534
+ "enum": [
535
+ "base",
536
+ "utility"
537
+ ]
538
+ },
539
+ "Ui": {
540
+ "anyOf": [
541
+ {
542
+ "$ref": "#/definitions/UiString"
543
+ },
544
+ {
545
+ "$ref": "#/definitions/UiNumber"
546
+ },
547
+ {
548
+ "$ref": "#/definitions/UiBoolean"
549
+ },
550
+ {
551
+ "$ref": "#/definitions/UiAnyOf"
552
+ },
553
+ {
554
+ "$ref": "#/definitions/UiArray"
555
+ },
556
+ {
557
+ "$ref": "#/definitions/UiObject"
558
+ }
559
+ ]
560
+ },
561
+ "UiString": {
562
+ "type": "object",
563
+ "properties": {
564
+ "type": {
565
+ "type": "string",
566
+ "const": "string"
567
+ },
568
+ "enum": {
569
+ "type": "array",
570
+ "items": {
571
+ "type": "string"
572
+ }
573
+ },
574
+ "minLength": {
575
+ "type": "number"
576
+ },
577
+ "maxLength": {
578
+ "type": "number"
579
+ },
580
+ "pattern": {
581
+ "type": "string"
582
+ },
583
+ "format": {
584
+ "type": "string"
585
+ }
586
+ },
587
+ "required": [
588
+ "type"
589
+ ],
590
+ "description": "string"
591
+ },
592
+ "UiNumber": {
593
+ "type": "object",
594
+ "properties": {
595
+ "type": {
596
+ "type": "string",
597
+ "const": "number"
598
+ },
599
+ "minimum": {
600
+ "type": "number"
601
+ },
602
+ "maximum": {
603
+ "type": "number"
604
+ },
605
+ "multipleOf": {
606
+ "type": "number"
607
+ }
608
+ },
609
+ "required": [
610
+ "type"
611
+ ],
612
+ "description": "number"
613
+ },
614
+ "UiBoolean": {
615
+ "type": "object",
616
+ "properties": {
617
+ "type": {
618
+ "type": "string",
619
+ "const": "boolean"
620
+ }
621
+ },
622
+ "required": [
623
+ "type"
624
+ ],
625
+ "description": "boolean"
626
+ },
627
+ "UiAnyOf": {
628
+ "type": "object",
629
+ "properties": {
630
+ "type": {
631
+ "type": "string",
632
+ "const": "anyOf"
633
+ },
634
+ "multiple": {
635
+ "type": "boolean"
636
+ },
637
+ "items": {
638
+ "type": "array",
639
+ "items": {
640
+ "type": "object",
641
+ "properties": {
642
+ "type": {
643
+ "type": "string",
644
+ "enum": [
645
+ "string",
646
+ "number",
647
+ "boolean"
648
+ ]
649
+ },
650
+ "title": {
651
+ "type": "string"
652
+ },
653
+ "description": {
654
+ "type": "string"
655
+ },
656
+ "value": {
657
+ "type": [
658
+ "string",
659
+ "number",
660
+ "boolean"
661
+ ]
662
+ }
663
+ },
664
+ "required": [
665
+ "type",
666
+ "value"
667
+ ]
668
+ }
669
+ }
670
+ },
671
+ "required": [
672
+ "type",
673
+ "items"
674
+ ],
675
+ "description": "enumerated choices"
676
+ },
677
+ "UiArray": {
678
+ "type": "object",
679
+ "properties": {
680
+ "type": {
681
+ "type": "string",
682
+ "const": "array"
683
+ },
684
+ "item": {
685
+ "$ref": "#/definitions/Ui"
686
+ },
687
+ "items": {
688
+ "type": "array",
689
+ "items": {
690
+ "$ref": "#/definitions/Ui"
691
+ }
692
+ },
693
+ "minItems": {
694
+ "type": "number"
695
+ },
696
+ "maxItems": {
697
+ "type": "number"
698
+ },
699
+ "uniqueItems": {
700
+ "type": "boolean"
701
+ }
702
+ },
703
+ "required": [
704
+ "type"
705
+ ],
706
+ "description": "arrays: homogeneous (item) or tuple (items)"
707
+ },
708
+ "UiObject": {
709
+ "type": "object",
710
+ "properties": {
711
+ "type": {
712
+ "type": "string",
713
+ "const": "object"
714
+ },
715
+ "fields": {
716
+ "type": "object",
717
+ "additionalProperties": {
718
+ "$ref": "#/definitions/Ui"
719
+ }
720
+ },
721
+ "required": {
722
+ "type": "array",
723
+ "items": {
724
+ "type": "string"
725
+ }
726
+ },
727
+ "order": {
728
+ "type": "array",
729
+ "items": {
730
+ "type": "string"
731
+ }
732
+ }
733
+ },
734
+ "required": [
735
+ "type",
736
+ "fields"
737
+ ],
738
+ "description": "objects: nested props"
739
+ },
740
+ "ServiceFallback": {
741
+ "type": "object",
742
+ "properties": {
743
+ "nodes": {
744
+ "type": "object",
745
+ "additionalProperties": {
746
+ "type": "array",
747
+ "items": {
748
+ "$ref": "#/definitions/ServiceIdRef"
749
+ }
750
+ },
751
+ "description": "Node-scoped fallbacks: prefer these when that node’s primary service fails"
752
+ },
753
+ "global": {
754
+ "type": "object",
755
+ "additionalProperties": {
756
+ "type": "array",
757
+ "items": {
758
+ "$ref": "#/definitions/ServiceIdRef"
759
+ }
760
+ },
761
+ "description": "Primary→fallback list used when no node-scoped entry is present"
762
+ }
763
+ }
764
+ },
765
+ "ServiceIdRef": {
766
+ "type": [
767
+ "number",
768
+ "string"
769
+ ]
770
+ }
771
+ }
772
+ }