@dmptool/types 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +5 -4
  2. package/dist/answers/__tests__/answers.spec.js +59 -7
  3. package/dist/answers/answer.d.ts +3 -3
  4. package/dist/answers/dateAnswers.d.ts +5 -5
  5. package/dist/answers/dateAnswers.js +3 -3
  6. package/dist/answers/index.d.ts +892 -513
  7. package/dist/answers/index.js +3 -2
  8. package/dist/answers/primitiveAnswers.d.ts +39 -0
  9. package/dist/answers/primitiveAnswers.js +8 -1
  10. package/dist/answers/tableAnswers.d.ts +1639 -32
  11. package/dist/answers/tableAnswers.js +10 -3
  12. package/dist/questions/__tests__/dateQuestions.spec.js +20 -20
  13. package/dist/questions/__tests__/primitiveQuestions.spec.js +92 -0
  14. package/dist/questions/__tests__/tableQuestion.spec.d.ts +1 -0
  15. package/dist/questions/__tests__/tableQuestion.spec.js +73 -0
  16. package/dist/questions/dateQuestions.d.ts +19 -19
  17. package/dist/questions/dateQuestions.js +8 -8
  18. package/dist/questions/graphQLQuestions.d.ts +20 -20
  19. package/dist/questions/graphQLQuestions.js +1 -1
  20. package/dist/questions/index.d.ts +1875 -1380
  21. package/dist/questions/index.js +3 -2
  22. package/dist/questions/optionBasedQuestions.js +1 -1
  23. package/dist/questions/primitiveQuestions.d.ts +214 -0
  24. package/dist/questions/primitiveQuestions.js +20 -3
  25. package/dist/questions/question.d.ts +4 -4
  26. package/dist/questions/question.js +2 -1
  27. package/dist/questions/tableQuestions.d.ts +2176 -145
  28. package/dist/questions/tableQuestions.js +7 -3
  29. package/dist/schemas/anyAnswer.schema.json +144 -119
  30. package/dist/schemas/anyQuestion.schema.json +161 -132
  31. package/dist/schemas/anyTableColumnAnswer.schema.json +1 -1
  32. package/dist/schemas/anyTableColumnQuestion.schema.json +20 -3
  33. package/dist/schemas/currencyQuestion.schema.json +10 -0
  34. package/dist/schemas/dateAnswer.schema.json +37 -0
  35. package/dist/schemas/datePickerAnswer.schema.json +4 -4
  36. package/dist/schemas/datePickerQuestion.schema.json +6 -5
  37. package/dist/schemas/dateQuestion.schema.json +51 -0
  38. package/dist/schemas/dateRangeQuestion.schema.json +1 -1
  39. package/dist/schemas/filteredSearchQuestion.schema.json +1 -2
  40. package/dist/schemas/numberRangeAnswer.schema.json +50 -0
  41. package/dist/schemas/numberRangeQuestion.schema.json +106 -0
  42. package/dist/schemas/tableAnswer.schema.json +349 -324
  43. package/dist/schemas/tableQuestion.schema.json +497 -468
  44. package/dist/schemas/textAreaQuestion.schema.json +10 -0
  45. package/package.json +1 -1
@@ -106,10 +106,19 @@
106
106
  "meta": {
107
107
  "type": "object",
108
108
  "properties": {
109
+ "schemaVersion": {
110
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
111
+ },
112
+ "labelTranslationKey": {
113
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/labelTranslationKey"
114
+ },
109
115
  "denomination": {
110
116
  "type": "string"
111
117
  }
112
118
  },
119
+ "required": [
120
+ "schemaVersion"
121
+ ],
113
122
  "additionalProperties": false
114
123
  },
115
124
  "attributes": {
@@ -139,7 +148,7 @@
139
148
  "properties": {
140
149
  "type": {
141
150
  "type": "string",
142
- "const": "datePicker"
151
+ "const": "date"
143
152
  },
144
153
  "meta": {
145
154
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
@@ -382,8 +391,7 @@
382
391
  "required": [
383
392
  "type",
384
393
  "meta",
385
- "graphQL",
386
- "attributes"
394
+ "graphQL"
387
395
  ],
388
396
  "additionalProperties": false
389
397
  },
@@ -507,164 +515,185 @@
507
515
  "columns": {
508
516
  "type": "array",
509
517
  "items": {
510
- "anyOf": [
511
- {
512
- "$ref": "#/definitions/AnyQuestion/anyOf/0"
513
- },
514
- {
515
- "$ref": "#/definitions/AnyQuestion/anyOf/1"
516
- },
517
- {
518
- "$ref": "#/definitions/AnyQuestion/anyOf/2"
519
- },
520
- {
521
- "$ref": "#/definitions/AnyQuestion/anyOf/3"
522
- },
523
- {
524
- "$ref": "#/definitions/AnyQuestion/anyOf/4"
525
- },
526
- {
527
- "$ref": "#/definitions/AnyQuestion/anyOf/5"
528
- },
529
- {
530
- "$ref": "#/definitions/AnyQuestion/anyOf/6"
531
- },
532
- {
533
- "$ref": "#/definitions/AnyQuestion/anyOf/7"
534
- },
535
- {
536
- "$ref": "#/definitions/AnyQuestion/anyOf/8"
537
- },
538
- {
539
- "$ref": "#/definitions/AnyQuestion/anyOf/9"
518
+ "type": "object",
519
+ "properties": {
520
+ "heading": {
521
+ "type": "string"
540
522
  },
541
- {
542
- "type": "object",
543
- "properties": {
544
- "type": {
545
- "type": "string",
546
- "const": "textArea"
523
+ "content": {
524
+ "anyOf": [
525
+ {
526
+ "$ref": "#/definitions/AnyQuestion/anyOf/0"
527
+ },
528
+ {
529
+ "$ref": "#/definitions/AnyQuestion/anyOf/1"
530
+ },
531
+ {
532
+ "$ref": "#/definitions/AnyQuestion/anyOf/2"
533
+ },
534
+ {
535
+ "$ref": "#/definitions/AnyQuestion/anyOf/3"
536
+ },
537
+ {
538
+ "$ref": "#/definitions/AnyQuestion/anyOf/4"
539
+ },
540
+ {
541
+ "$ref": "#/definitions/AnyQuestion/anyOf/5"
542
+ },
543
+ {
544
+ "$ref": "#/definitions/AnyQuestion/anyOf/6"
547
545
  },
548
- "meta": {
546
+ {
547
+ "$ref": "#/definitions/AnyQuestion/anyOf/7"
548
+ },
549
+ {
550
+ "$ref": "#/definitions/AnyQuestion/anyOf/8"
551
+ },
552
+ {
553
+ "$ref": "#/definitions/AnyQuestion/anyOf/9"
554
+ },
555
+ {
549
556
  "type": "object",
550
557
  "properties": {
551
- "asRichText": {
552
- "type": "boolean"
558
+ "type": {
559
+ "type": "string",
560
+ "const": "textArea"
561
+ },
562
+ "meta": {
563
+ "type": "object",
564
+ "properties": {
565
+ "schemaVersion": {
566
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
567
+ },
568
+ "labelTranslationKey": {
569
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/labelTranslationKey"
570
+ },
571
+ "asRichText": {
572
+ "type": "boolean"
573
+ }
574
+ },
575
+ "required": [
576
+ "schemaVersion"
577
+ ],
578
+ "additionalProperties": false
579
+ },
580
+ "attributes": {
581
+ "type": "object",
582
+ "properties": {
583
+ "cols": {
584
+ "type": "number"
585
+ },
586
+ "maxLength": {
587
+ "type": "number"
588
+ },
589
+ "minLength": {
590
+ "type": "number"
591
+ },
592
+ "rows": {
593
+ "type": "number"
594
+ }
595
+ },
596
+ "additionalProperties": false
553
597
  }
554
598
  },
599
+ "required": [
600
+ "type",
601
+ "meta"
602
+ ],
555
603
  "additionalProperties": false
556
604
  },
557
- "attributes": {
605
+ {
558
606
  "type": "object",
559
607
  "properties": {
560
- "cols": {
561
- "type": "number"
608
+ "type": {
609
+ "type": "string",
610
+ "const": "text"
562
611
  },
563
- "maxLength": {
564
- "type": "number"
612
+ "meta": {
613
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
565
614
  },
566
- "minLength": {
567
- "type": "number"
568
- },
569
- "rows": {
570
- "type": "number"
615
+ "attributes": {
616
+ "type": "object",
617
+ "properties": {
618
+ "maxLength": {
619
+ "type": "number"
620
+ },
621
+ "minLength": {
622
+ "type": "number"
623
+ },
624
+ "pattern": {
625
+ "type": "string"
626
+ }
627
+ },
628
+ "additionalProperties": false
571
629
  }
572
630
  },
631
+ "required": [
632
+ "type",
633
+ "meta"
634
+ ],
573
635
  "additionalProperties": false
574
- }
575
- },
576
- "required": [
577
- "type",
578
- "meta"
579
- ],
580
- "additionalProperties": false
581
- },
582
- {
583
- "type": "object",
584
- "properties": {
585
- "type": {
586
- "type": "string",
587
- "const": "text"
588
- },
589
- "meta": {
590
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
591
636
  },
592
- "attributes": {
637
+ {
593
638
  "type": "object",
594
639
  "properties": {
595
- "maxLength": {
596
- "type": "number"
640
+ "type": {
641
+ "type": "string",
642
+ "const": "typeaheadSearch"
597
643
  },
598
- "minLength": {
599
- "type": "number"
644
+ "meta": {
645
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
600
646
  },
601
- "pattern": {
602
- "type": "string"
647
+ "graphQL": {
648
+ "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/graphQL"
603
649
  }
604
650
  },
651
+ "required": [
652
+ "type",
653
+ "meta",
654
+ "graphQL"
655
+ ],
605
656
  "additionalProperties": false
606
- }
607
- },
608
- "required": [
609
- "type",
610
- "meta"
611
- ],
612
- "additionalProperties": false
613
- },
614
- {
615
- "type": "object",
616
- "properties": {
617
- "type": {
618
- "type": "string",
619
- "const": "typeaheadSearch"
620
- },
621
- "meta": {
622
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
623
- },
624
- "graphQL": {
625
- "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/graphQL"
626
- }
627
- },
628
- "required": [
629
- "type",
630
- "meta",
631
- "graphQL"
632
- ],
633
- "additionalProperties": false
634
- },
635
- {
636
- "type": "object",
637
- "properties": {
638
- "type": {
639
- "type": "string",
640
- "const": "url"
641
657
  },
642
- "meta": {
643
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
644
- },
645
- "attributes": {
658
+ {
646
659
  "type": "object",
647
660
  "properties": {
648
- "maxLength": {
649
- "type": "number"
661
+ "type": {
662
+ "type": "string",
663
+ "const": "url"
650
664
  },
651
- "minLength": {
652
- "type": "number"
665
+ "meta": {
666
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
653
667
  },
654
- "pattern": {
655
- "type": "string"
668
+ "attributes": {
669
+ "type": "object",
670
+ "properties": {
671
+ "maxLength": {
672
+ "type": "number"
673
+ },
674
+ "minLength": {
675
+ "type": "number"
676
+ },
677
+ "pattern": {
678
+ "type": "string"
679
+ }
680
+ },
681
+ "additionalProperties": false
656
682
  }
657
683
  },
684
+ "required": [
685
+ "type",
686
+ "meta"
687
+ ],
658
688
  "additionalProperties": false
659
689
  }
660
- },
661
- "required": [
662
- "type",
663
- "meta"
664
- ],
665
- "additionalProperties": false
690
+ ]
666
691
  }
667
- ]
692
+ },
693
+ "required": [
694
+ "content"
695
+ ],
696
+ "additionalProperties": false
668
697
  }
669
698
  },
670
699
  "attributes": {
@@ -697,16 +726,16 @@
697
726
  "additionalProperties": false
698
727
  },
699
728
  {
700
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/anyOf/10"
729
+ "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/10"
701
730
  },
702
731
  {
703
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/anyOf/11"
732
+ "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/11"
704
733
  },
705
734
  {
706
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/anyOf/12"
735
+ "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/12"
707
736
  },
708
737
  {
709
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/anyOf/13"
738
+ "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/13"
710
739
  }
711
740
  ]
712
741
  }
@@ -84,7 +84,7 @@
84
84
  "properties": {
85
85
  "type": {
86
86
  "type": "string",
87
- "const": "datePicker"
87
+ "const": "date"
88
88
  },
89
89
  "answer": {
90
90
  "type": "string"
@@ -106,10 +106,19 @@
106
106
  "meta": {
107
107
  "type": "object",
108
108
  "properties": {
109
+ "schemaVersion": {
110
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta/properties/schemaVersion"
111
+ },
112
+ "labelTranslationKey": {
113
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta/properties/labelTranslationKey"
114
+ },
109
115
  "denomination": {
110
116
  "type": "string"
111
117
  }
112
118
  },
119
+ "required": [
120
+ "schemaVersion"
121
+ ],
113
122
  "additionalProperties": false
114
123
  },
115
124
  "attributes": {
@@ -139,7 +148,7 @@
139
148
  "properties": {
140
149
  "type": {
141
150
  "type": "string",
142
- "const": "datePicker"
151
+ "const": "date"
143
152
  },
144
153
  "meta": {
145
154
  "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
@@ -382,8 +391,7 @@
382
391
  "required": [
383
392
  "type",
384
393
  "meta",
385
- "graphQL",
386
- "attributes"
394
+ "graphQL"
387
395
  ],
388
396
  "additionalProperties": false
389
397
  },
@@ -504,10 +512,19 @@
504
512
  "meta": {
505
513
  "type": "object",
506
514
  "properties": {
515
+ "schemaVersion": {
516
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta/properties/schemaVersion"
517
+ },
518
+ "labelTranslationKey": {
519
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta/properties/labelTranslationKey"
520
+ },
507
521
  "asRichText": {
508
522
  "type": "boolean"
509
523
  }
510
524
  },
525
+ "required": [
526
+ "schemaVersion"
527
+ ],
511
528
  "additionalProperties": false
512
529
  },
513
530
  "attributes": {
@@ -11,10 +11,20 @@
11
11
  "meta": {
12
12
  "type": "object",
13
13
  "properties": {
14
+ "schemaVersion": {
15
+ "type": "string",
16
+ "const": "1.0"
17
+ },
18
+ "labelTranslationKey": {
19
+ "type": "string"
20
+ },
14
21
  "denomination": {
15
22
  "type": "string"
16
23
  }
17
24
  },
25
+ "required": [
26
+ "schemaVersion"
27
+ ],
18
28
  "additionalProperties": false
19
29
  },
20
30
  "attributes": {
@@ -0,0 +1,37 @@
1
+ {
2
+ "$ref": "#/definitions/DateAnswer",
3
+ "definitions": {
4
+ "DateAnswer": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "date"
10
+ },
11
+ "answer": {
12
+ "type": "string"
13
+ },
14
+ "meta": {
15
+ "type": "object",
16
+ "properties": {
17
+ "schemaVersion": {
18
+ "type": "string",
19
+ "const": "1.0"
20
+ }
21
+ },
22
+ "required": [
23
+ "schemaVersion"
24
+ ],
25
+ "additionalProperties": false
26
+ }
27
+ },
28
+ "required": [
29
+ "type",
30
+ "answer",
31
+ "meta"
32
+ ],
33
+ "additionalProperties": false
34
+ }
35
+ },
36
+ "$schema": "http://json-schema.org/draft-07/schema#"
37
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
- "$ref": "#/definitions/DatePickerAnswer",
2
+ "$ref": "#/definitions/DateAnswer",
3
3
  "definitions": {
4
- "DatePickerAnswer": {
4
+ "DateAnswer": {
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "type": {
8
8
  "type": "string",
9
- "const": "datePicker"
9
+ "const": "date"
10
10
  },
11
11
  "answer": {
12
12
  "type": "string"
@@ -34,4 +34,4 @@
34
34
  }
35
35
  },
36
36
  "$schema": "http://json-schema.org/draft-07/schema#"
37
- }
37
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
- "$ref": "#/definitions/DatePickerQuestion",
2
+ "$ref": "#/definitions/DateQuestion",
3
3
  "definitions": {
4
- "DatePickerQuestion": {
4
+ "DateQuestion": {
5
5
  "type": "object",
6
6
  "properties": {
7
7
  "type": {
8
8
  "type": "string",
9
- "const": "datePicker"
9
+ "const": "date"
10
10
  },
11
11
  "meta": {
12
12
  "type": "object",
@@ -42,10 +42,11 @@
42
42
  },
43
43
  "required": [
44
44
  "type",
45
- "meta"
45
+ "meta",
46
+ "attributes"
46
47
  ],
47
48
  "additionalProperties": false
48
49
  }
49
50
  },
50
51
  "$schema": "http://json-schema.org/draft-07/schema#"
51
- }
52
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$ref": "#/definitions/DateQuestion",
3
+ "definitions": {
4
+ "DateQuestion": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "date"
10
+ },
11
+ "meta": {
12
+ "type": "object",
13
+ "properties": {
14
+ "schemaVersion": {
15
+ "type": "string",
16
+ "const": "1.0"
17
+ },
18
+ "labelTranslationKey": {
19
+ "type": "string"
20
+ }
21
+ },
22
+ "required": [
23
+ "schemaVersion"
24
+ ],
25
+ "additionalProperties": false
26
+ },
27
+ "attributes": {
28
+ "type": "object",
29
+ "properties": {
30
+ "max": {
31
+ "type": "string"
32
+ },
33
+ "min": {
34
+ "type": "string"
35
+ },
36
+ "step": {
37
+ "type": "number"
38
+ }
39
+ },
40
+ "additionalProperties": false
41
+ }
42
+ },
43
+ "required": [
44
+ "type",
45
+ "meta"
46
+ ],
47
+ "additionalProperties": false
48
+ }
49
+ },
50
+ "$schema": "http://json-schema.org/draft-07/schema#"
51
+ }
@@ -32,7 +32,7 @@
32
32
  "properties": {
33
33
  "type": {
34
34
  "type": "string",
35
- "const": "datePicker"
35
+ "const": "date"
36
36
  },
37
37
  "meta": {
38
38
  "$ref": "#/definitions/DateRangeQuestion/properties/meta"
@@ -109,8 +109,7 @@
109
109
  "required": [
110
110
  "type",
111
111
  "meta",
112
- "graphQL",
113
- "attributes"
112
+ "graphQL"
114
113
  ],
115
114
  "additionalProperties": false
116
115
  }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$ref": "#/definitions/NumberRangeAnswer",
3
+ "definitions": {
4
+ "NumberRangeAnswer": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "numberRange"
10
+ },
11
+ "answer": {
12
+ "type": "object",
13
+ "properties": {
14
+ "start": {
15
+ "type": "number"
16
+ },
17
+ "end": {
18
+ "type": "number"
19
+ }
20
+ },
21
+ "required": [
22
+ "start",
23
+ "end"
24
+ ],
25
+ "additionalProperties": false
26
+ },
27
+ "meta": {
28
+ "type": "object",
29
+ "properties": {
30
+ "schemaVersion": {
31
+ "type": "string",
32
+ "const": "1.0"
33
+ }
34
+ },
35
+ "required": [
36
+ "schemaVersion"
37
+ ],
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "required": [
42
+ "type",
43
+ "answer",
44
+ "meta"
45
+ ],
46
+ "additionalProperties": false
47
+ }
48
+ },
49
+ "$schema": "http://json-schema.org/draft-07/schema#"
50
+ }