@dmptool/types 1.1.2 → 1.2.0

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 (78) hide show
  1. package/README.md +119 -47
  2. package/dist/answers/__tests__/answers.spec.js +20 -28
  3. package/dist/answers/__tests__/usage.spec.d.ts +1 -0
  4. package/dist/answers/__tests__/usage.spec.js +175 -0
  5. package/dist/answers/answer.d.ts +12 -15
  6. package/dist/answers/answer.js +3 -4
  7. package/dist/answers/dateAnswers.d.ts +30 -30
  8. package/dist/answers/dateAnswers.js +6 -5
  9. package/dist/answers/graphQLAnswers.d.ts +25 -25
  10. package/dist/answers/graphQLAnswers.js +4 -4
  11. package/dist/answers/index.d.ts +860 -1088
  12. package/dist/answers/index.js +2 -2
  13. package/dist/answers/numberAnswers.d.ts +41 -41
  14. package/dist/answers/numberAnswers.js +8 -8
  15. package/dist/answers/optionBasedAnswers.d.ts +55 -55
  16. package/dist/answers/optionBasedAnswers.js +10 -10
  17. package/dist/answers/tableAnswers.d.ts +811 -1772
  18. package/dist/answers/tableAnswers.js +12 -8
  19. package/dist/answers/textAnswers.d.ts +44 -44
  20. package/dist/answers/textAnswers.js +8 -8
  21. package/dist/questions/__tests__/graphQLQuestions.spec.js +6 -4
  22. package/dist/questions/__tests__/optionBasedQuestions.spec.js +4 -12
  23. package/dist/questions/__tests__/usage.spec.d.ts +8 -0
  24. package/dist/questions/__tests__/usage.spec.js +312 -0
  25. package/dist/questions/dateQuestions.d.ts +90 -101
  26. package/dist/questions/dateQuestions.js +15 -34
  27. package/dist/questions/graphQLQuestions.d.ts +176 -182
  28. package/dist/questions/graphQLQuestions.js +44 -45
  29. package/dist/questions/index.d.ts +1791 -2170
  30. package/dist/questions/index.js +2 -2
  31. package/dist/questions/numberQuestions.d.ts +126 -142
  32. package/dist/questions/numberQuestions.js +11 -45
  33. package/dist/questions/optionBasedQuestions.d.ts +197 -225
  34. package/dist/questions/optionBasedQuestions.js +24 -88
  35. package/dist/questions/question.d.ts +24 -56
  36. package/dist/questions/question.js +78 -18
  37. package/dist/questions/tableQuestions.d.ts +2637 -2930
  38. package/dist/questions/tableQuestions.js +9 -21
  39. package/dist/questions/textQuestions.d.ts +125 -145
  40. package/dist/questions/textQuestions.js +16 -57
  41. package/dist/schemas/affiliationSearchAnswer.schema.json +9 -12
  42. package/dist/schemas/affiliationSearchQuestion.schema.json +57 -50
  43. package/dist/schemas/anyAnswer.schema.json +228 -237
  44. package/dist/schemas/anyQuestion.schema.json +349 -517
  45. package/dist/schemas/anyTableColumnAnswer.schema.json +93 -106
  46. package/dist/schemas/anyTableColumnQuestion.schema.json +259 -382
  47. package/dist/schemas/booleanAnswer.schema.json +8 -11
  48. package/dist/schemas/booleanQuestion.schema.json +9 -15
  49. package/dist/schemas/checkboxesAnswer.schema.json +13 -14
  50. package/dist/schemas/checkboxesQuestion.schema.json +18 -24
  51. package/dist/schemas/currencyAnswer.schema.json +8 -11
  52. package/dist/schemas/currencyQuestion.schema.json +13 -17
  53. package/dist/schemas/dateAnswer.schema.json +8 -11
  54. package/dist/schemas/dateQuestion.schema.json +9 -15
  55. package/dist/schemas/dateRangeAnswer.schema.json +16 -21
  56. package/dist/schemas/dateRangeQuestion.schema.json +40 -21
  57. package/dist/schemas/emailAnswer.schema.json +8 -11
  58. package/dist/schemas/emailQuestion.schema.json +11 -16
  59. package/dist/schemas/filteredSearchQuestion.schema.json +0 -3
  60. package/dist/schemas/multiselectBoxAnswer.schema.json +13 -14
  61. package/dist/schemas/multiselectBoxQuestion.schema.json +20 -25
  62. package/dist/schemas/numberAnswer.schema.json +8 -11
  63. package/dist/schemas/numberQuestion.schema.json +11 -16
  64. package/dist/schemas/numberRangeAnswer.schema.json +17 -22
  65. package/dist/schemas/numberRangeQuestion.schema.json +22 -21
  66. package/dist/schemas/radioButtonsAnswer.schema.json +8 -11
  67. package/dist/schemas/radioButtonsQuestion.schema.json +18 -24
  68. package/dist/schemas/selectBoxAnswer.schema.json +8 -11
  69. package/dist/schemas/selectBoxQuestion.schema.json +20 -25
  70. package/dist/schemas/tableAnswer.schema.json +337 -343
  71. package/dist/schemas/tableQuestion.schema.json +279 -416
  72. package/dist/schemas/textAnswer.schema.json +8 -11
  73. package/dist/schemas/textAreaAnswer.schema.json +8 -11
  74. package/dist/schemas/textAreaQuestion.schema.json +13 -17
  75. package/dist/schemas/textQuestion.schema.json +9 -15
  76. package/dist/schemas/urlAnswer.schema.json +8 -11
  77. package/dist/schemas/urlQuestion.schema.json +9 -15
  78. package/package.json +1 -1
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "boolean"
10
10
  },
11
- "answer": {
12
- "type": "boolean"
13
- },
14
11
  "meta": {
15
12
  "type": "object",
16
13
  "properties": {
17
14
  "schemaVersion": {
18
15
  "type": "string",
19
- "const": "1.0"
16
+ "default": "1.0"
20
17
  }
21
18
  },
22
- "required": [
23
- "schemaVersion"
24
- ],
25
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
21
+ },
22
+ "answer": {
23
+ "type": "boolean",
24
+ "default": false
26
25
  }
27
26
  },
28
27
  "required": [
29
- "type",
30
- "answer",
31
- "meta"
28
+ "type"
32
29
  ],
33
30
  "additionalProperties": false
34
31
  }
@@ -21,35 +21,29 @@
21
21
  "type": "string"
22
22
  },
23
23
  "checked": {
24
- "type": "boolean"
24
+ "type": "boolean",
25
+ "default": false
25
26
  }
26
27
  },
27
- "additionalProperties": false
28
+ "additionalProperties": false,
29
+ "default": {}
28
30
  },
29
31
  "meta": {
30
32
  "type": "object",
31
33
  "properties": {
32
34
  "schemaVersion": {
33
35
  "type": "string",
34
- "const": "1.0"
36
+ "default": "1.0"
35
37
  },
36
38
  "title": {
37
- "type": "string",
38
- "const": "Yes/No Field"
39
+ "type": "string"
39
40
  },
40
41
  "usageDescription": {
41
- "type": "string",
42
- "const": "For questions that require a simple Yes/No response."
43
- },
44
- "defaultJSON": {
45
- "type": "string",
46
- "const": "{\n \"attributes\": {\n \"checked\": false\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
42
+ "type": "string"
47
43
  }
48
44
  },
49
- "required": [
50
- "schemaVersion"
51
- ],
52
- "additionalProperties": false
45
+ "additionalProperties": false,
46
+ "default": {}
53
47
  }
54
48
  },
55
49
  "required": [
@@ -8,30 +8,29 @@
8
8
  "type": "string",
9
9
  "const": "checkBoxes"
10
10
  },
11
- "answer": {
12
- "type": "array",
13
- "items": {
14
- "type": "string"
15
- }
16
- },
17
11
  "meta": {
18
12
  "type": "object",
19
13
  "properties": {
20
14
  "schemaVersion": {
21
15
  "type": "string",
22
- "const": "1.0"
16
+ "default": "1.0"
23
17
  }
24
18
  },
25
- "required": [
26
- "schemaVersion"
27
- ],
28
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
21
+ },
22
+ "answer": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string"
26
+ },
27
+ "default": [
28
+ ""
29
+ ]
29
30
  }
30
31
  },
31
32
  "required": [
32
- "type",
33
- "answer",
34
- "meta"
33
+ "type"
35
34
  ],
36
35
  "additionalProperties": false
37
36
  }
@@ -21,32 +21,25 @@
21
21
  "type": "string"
22
22
  }
23
23
  },
24
- "additionalProperties": false
24
+ "additionalProperties": false,
25
+ "default": {}
25
26
  },
26
27
  "meta": {
27
28
  "type": "object",
28
29
  "properties": {
29
30
  "schemaVersion": {
30
31
  "type": "string",
31
- "const": "1.0"
32
+ "default": "1.0"
32
33
  },
33
34
  "title": {
34
- "type": "string",
35
- "const": "Check Boxes"
35
+ "type": "string"
36
36
  },
37
37
  "usageDescription": {
38
- "type": "string",
39
- "const": "For multiple choice questions where users can select multiple options."
40
- },
41
- "defaultJSON": {
42
- "type": "string",
43
- "const": "{\n \"type\": \"checkBoxes\",\n \"attributes\": {},\n \"options\": [\n {\n \"label\": \"Option 1\",\n \"value\": \"1\",\n \"checked\": false\n }\n ],\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
38
+ "type": "string"
44
39
  }
45
40
  },
46
- "required": [
47
- "schemaVersion"
48
- ],
49
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "default": {}
50
43
  },
51
44
  "options": {
52
45
  "type": "array",
@@ -54,26 +47,27 @@
54
47
  "type": "object",
55
48
  "properties": {
56
49
  "label": {
57
- "type": "string"
50
+ "type": "string",
51
+ "default": "Option A"
58
52
  },
59
53
  "value": {
60
- "type": "string"
54
+ "type": "string",
55
+ "default": "a"
61
56
  },
62
57
  "checked": {
63
- "type": "boolean"
58
+ "type": "boolean",
59
+ "default": false
64
60
  }
65
61
  },
66
- "required": [
67
- "label",
68
- "value"
69
- ],
70
62
  "additionalProperties": false
71
- }
63
+ },
64
+ "default": [
65
+ {}
66
+ ]
72
67
  }
73
68
  },
74
69
  "required": [
75
- "type",
76
- "options"
70
+ "type"
77
71
  ],
78
72
  "additionalProperties": false
79
73
  }
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "currency"
10
10
  },
11
- "answer": {
12
- "type": "number"
13
- },
14
11
  "meta": {
15
12
  "type": "object",
16
13
  "properties": {
17
14
  "schemaVersion": {
18
15
  "type": "string",
19
- "const": "1.0"
16
+ "default": "1.0"
20
17
  }
21
18
  },
22
- "required": [
23
- "schemaVersion"
24
- ],
25
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
21
+ },
22
+ "answer": {
23
+ "type": "number",
24
+ "default": 0
26
25
  }
27
26
  },
28
27
  "required": [
29
- "type",
30
- "answer",
31
- "meta"
28
+ "type"
32
29
  ],
33
30
  "additionalProperties": false
34
31
  }
@@ -24,41 +24,37 @@
24
24
  "type": "number"
25
25
  },
26
26
  "min": {
27
- "type": "number"
27
+ "type": "number",
28
+ "default": 0
28
29
  },
29
30
  "step": {
30
- "type": "number"
31
+ "type": "number",
32
+ "default": 1
31
33
  },
32
34
  "denomination": {
33
- "type": "string"
35
+ "type": "string",
36
+ "default": "USD"
34
37
  }
35
38
  },
36
- "additionalProperties": false
39
+ "additionalProperties": false,
40
+ "default": {}
37
41
  },
38
42
  "meta": {
39
43
  "type": "object",
40
44
  "properties": {
41
45
  "schemaVersion": {
42
46
  "type": "string",
43
- "const": "1.0"
47
+ "default": "1.0"
44
48
  },
45
49
  "title": {
46
- "type": "string",
47
- "const": "Currency Field"
50
+ "type": "string"
48
51
  },
49
52
  "usageDescription": {
50
- "type": "string",
51
- "const": "For questions that require a monetary amount (e.g. Cost or Budget)."
52
- },
53
- "defaultJSON": {
54
- "type": "string",
55
- "const": "{\n \"type\": \"currency\",\n \"attributes\": {\n \"denomination\": \"USD\",\n \"min\": 0,\n \"step\": 1\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
53
+ "type": "string"
56
54
  }
57
55
  },
58
- "required": [
59
- "schemaVersion"
60
- ],
61
- "additionalProperties": false
56
+ "additionalProperties": false,
57
+ "default": {}
62
58
  }
63
59
  },
64
60
  "required": [
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "date"
10
10
  },
11
- "answer": {
12
- "type": "string"
13
- },
14
11
  "meta": {
15
12
  "type": "object",
16
13
  "properties": {
17
14
  "schemaVersion": {
18
15
  "type": "string",
19
- "const": "1.0"
16
+ "default": "1.0"
20
17
  }
21
18
  },
22
- "required": [
23
- "schemaVersion"
24
- ],
25
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
21
+ },
22
+ "answer": {
23
+ "type": "string",
24
+ "default": ""
26
25
  }
27
26
  },
28
27
  "required": [
29
- "type",
30
- "answer",
31
- "meta"
28
+ "type"
32
29
  ],
33
30
  "additionalProperties": false
34
31
  }
@@ -27,35 +27,29 @@
27
27
  "type": "string"
28
28
  },
29
29
  "step": {
30
- "type": "number"
30
+ "type": "number",
31
+ "default": 1
31
32
  }
32
33
  },
33
- "additionalProperties": false
34
+ "additionalProperties": false,
35
+ "default": {}
34
36
  },
35
37
  "meta": {
36
38
  "type": "object",
37
39
  "properties": {
38
40
  "schemaVersion": {
39
41
  "type": "string",
40
- "const": "1.0"
42
+ "default": "1.0"
41
43
  },
42
44
  "title": {
43
- "type": "string",
44
- "const": "Date Field"
45
+ "type": "string"
45
46
  },
46
47
  "usageDescription": {
47
- "type": "string",
48
- "const": "For questions that require a date."
49
- },
50
- "defaultJSON": {
51
- "type": "string",
52
- "const": "{\"type\":\"date\",\"attributes\":{\"step\":1},\"meta\":{\"schemaVersion\":\"1.0\"}}"
48
+ "type": "string"
53
49
  }
54
50
  },
55
- "required": [
56
- "schemaVersion"
57
- ],
58
- "additionalProperties": false
51
+ "additionalProperties": false,
52
+ "default": {}
59
53
  }
60
54
  },
61
55
  "required": [
@@ -8,40 +8,35 @@
8
8
  "type": "string",
9
9
  "const": "dateRange"
10
10
  },
11
- "answer": {
11
+ "meta": {
12
12
  "type": "object",
13
13
  "properties": {
14
- "start": {
15
- "type": "string"
16
- },
17
- "end": {
18
- "type": "string"
14
+ "schemaVersion": {
15
+ "type": "string",
16
+ "default": "1.0"
19
17
  }
20
18
  },
21
- "required": [
22
- "start",
23
- "end"
24
- ],
25
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
26
21
  },
27
- "meta": {
22
+ "answer": {
28
23
  "type": "object",
29
24
  "properties": {
30
- "schemaVersion": {
25
+ "start": {
26
+ "type": "string",
27
+ "default": ""
28
+ },
29
+ "end": {
31
30
  "type": "string",
32
- "const": "1.0"
31
+ "default": ""
33
32
  }
34
33
  },
35
- "required": [
36
- "schemaVersion"
37
- ],
38
- "additionalProperties": false
34
+ "additionalProperties": false,
35
+ "default": {}
39
36
  }
40
37
  },
41
38
  "required": [
42
- "type",
43
- "answer",
44
- "meta"
39
+ "type"
45
40
  ],
46
41
  "additionalProperties": false
47
42
  }
@@ -21,32 +21,25 @@
21
21
  "type": "string"
22
22
  }
23
23
  },
24
- "additionalProperties": false
24
+ "additionalProperties": false,
25
+ "default": {}
25
26
  },
26
27
  "meta": {
27
28
  "type": "object",
28
29
  "properties": {
29
30
  "schemaVersion": {
30
31
  "type": "string",
31
- "const": "1.0"
32
+ "default": "1.0"
32
33
  },
33
34
  "title": {
34
- "type": "string",
35
- "const": "Date Range"
35
+ "type": "string"
36
36
  },
37
37
  "usageDescription": {
38
- "type": "string",
39
- "const": "For questions that require a date range (e.g. From/To, Start/End)"
40
- },
41
- "defaultJSON": {
42
- "type": "string",
43
- "const": "{\"type\":\"dateRange\",\"attributes\":{},\"columns\":{\"start\":{\"label\":\"Start\",\"step\":1},\"end\":{\"label\":\"End\",\"step\":1}}}"
38
+ "type": "string"
44
39
  }
45
40
  },
46
- "required": [
47
- "schemaVersion"
48
- ],
49
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "default": {}
50
43
  },
51
44
  "columns": {
52
45
  "type": "object",
@@ -55,7 +48,8 @@
55
48
  "type": "object",
56
49
  "properties": {
57
50
  "label": {
58
- "$ref": "#/definitions/DateRangeQuestion/properties/attributes/properties/label"
51
+ "type": "string",
52
+ "default": "From"
59
53
  },
60
54
  "help": {
61
55
  "$ref": "#/definitions/DateRangeQuestion/properties/attributes/properties/help"
@@ -70,21 +64,46 @@
70
64
  "type": "string"
71
65
  },
72
66
  "step": {
73
- "type": "number"
67
+ "type": "number",
68
+ "default": 1
74
69
  }
75
70
  },
76
- "additionalProperties": false
71
+ "additionalProperties": false,
72
+ "default": {}
77
73
  },
78
74
  "end": {
79
- "$ref": "#/definitions/DateRangeQuestion/properties/columns/properties/start"
75
+ "type": "object",
76
+ "properties": {
77
+ "label": {
78
+ "type": "string",
79
+ "default": "To"
80
+ },
81
+ "help": {
82
+ "$ref": "#/definitions/DateRangeQuestion/properties/attributes/properties/help"
83
+ },
84
+ "labelTranslationKey": {
85
+ "$ref": "#/definitions/DateRangeQuestion/properties/attributes/properties/labelTranslationKey"
86
+ },
87
+ "max": {
88
+ "$ref": "#/definitions/DateRangeQuestion/properties/columns/properties/start/properties/max"
89
+ },
90
+ "min": {
91
+ "$ref": "#/definitions/DateRangeQuestion/properties/columns/properties/start/properties/min"
92
+ },
93
+ "step": {
94
+ "$ref": "#/definitions/DateRangeQuestion/properties/columns/properties/start/properties/step"
95
+ }
96
+ },
97
+ "additionalProperties": false,
98
+ "default": {}
80
99
  }
81
100
  },
82
- "additionalProperties": false
101
+ "additionalProperties": false,
102
+ "default": {}
83
103
  }
84
104
  },
85
105
  "required": [
86
- "type",
87
- "columns"
106
+ "type"
88
107
  ],
89
108
  "additionalProperties": false
90
109
  }
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "email"
10
10
  },
11
- "answer": {
12
- "type": "string"
13
- },
14
11
  "meta": {
15
12
  "type": "object",
16
13
  "properties": {
17
14
  "schemaVersion": {
18
15
  "type": "string",
19
- "const": "1.0"
16
+ "default": "1.0"
20
17
  }
21
18
  },
22
- "required": [
23
- "schemaVersion"
24
- ],
25
- "additionalProperties": false
19
+ "additionalProperties": false,
20
+ "default": {}
21
+ },
22
+ "answer": {
23
+ "type": "string",
24
+ "default": ""
26
25
  }
27
26
  },
28
27
  "required": [
29
- "type",
30
- "answer",
31
- "meta"
28
+ "type"
32
29
  ],
33
30
  "additionalProperties": false
34
31
  }
@@ -21,7 +21,8 @@
21
21
  "type": "string"
22
22
  },
23
23
  "maxLength": {
24
- "type": "number"
24
+ "type": "number",
25
+ "default": 255
25
26
  },
26
27
  "minLength": {
27
28
  "type": "number"
@@ -30,35 +31,29 @@
30
31
  "type": "string"
31
32
  },
32
33
  "multiple": {
33
- "type": "boolean"
34
+ "type": "boolean",
35
+ "default": false
34
36
  }
35
37
  },
36
- "additionalProperties": false
38
+ "additionalProperties": false,
39
+ "default": {}
37
40
  },
38
41
  "meta": {
39
42
  "type": "object",
40
43
  "properties": {
41
44
  "schemaVersion": {
42
45
  "type": "string",
43
- "const": "1.0"
46
+ "default": "1.0"
44
47
  },
45
48
  "title": {
46
- "type": "string",
47
- "const": "Email Field"
49
+ "type": "string"
48
50
  },
49
51
  "usageDescription": {
50
- "type": "string",
51
- "const": "For questions that require require email address(es)."
52
- },
53
- "defaultJSON": {
54
- "type": "string",
55
- "const": "{\"type\":\"email\",\"attributes\":{\"maxLength\":255,\"minLength\":1,\"multiple\":false},\"meta\":{\"schemaVersion\":\"1.0\"}}"
52
+ "type": "string"
56
53
  }
57
54
  },
58
- "required": [
59
- "schemaVersion"
60
- ],
61
- "additionalProperties": false
55
+ "additionalProperties": false,
56
+ "default": {}
62
57
  }
63
58
  },
64
59
  "required": [
@@ -39,9 +39,6 @@
39
39
  },
40
40
  "usageDescription": {
41
41
  "type": "string"
42
- },
43
- "defaultJSON": {
44
- "type": "string"
45
42
  }
46
43
  },
47
44
  "required": [