@dmptool/types 1.1.3 → 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 (76) 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 +1 -1
  22. package/dist/questions/__tests__/usage.spec.d.ts +8 -0
  23. package/dist/questions/__tests__/usage.spec.js +312 -0
  24. package/dist/questions/dateQuestions.d.ts +81 -82
  25. package/dist/questions/dateQuestions.js +12 -16
  26. package/dist/questions/graphQLQuestions.d.ts +142 -142
  27. package/dist/questions/graphQLQuestions.js +35 -30
  28. package/dist/questions/index.d.ts +1494 -1674
  29. package/dist/questions/index.js +2 -2
  30. package/dist/questions/numberQuestions.d.ts +97 -98
  31. package/dist/questions/numberQuestions.js +7 -19
  32. package/dist/questions/optionBasedQuestions.d.ts +163 -166
  33. package/dist/questions/optionBasedQuestions.js +20 -36
  34. package/dist/questions/question.d.ts +24 -48
  35. package/dist/questions/question.js +78 -17
  36. package/dist/questions/tableQuestions.d.ts +2219 -2231
  37. package/dist/questions/tableQuestions.js +6 -11
  38. package/dist/questions/textQuestions.d.ts +104 -104
  39. package/dist/questions/textQuestions.js +6 -23
  40. package/dist/schemas/affiliationSearchAnswer.schema.json +9 -12
  41. package/dist/schemas/affiliationSearchQuestion.schema.json +30 -36
  42. package/dist/schemas/anyAnswer.schema.json +228 -237
  43. package/dist/schemas/anyQuestion.schema.json +292 -493
  44. package/dist/schemas/anyTableColumnAnswer.schema.json +93 -106
  45. package/dist/schemas/anyTableColumnQuestion.schema.json +164 -325
  46. package/dist/schemas/booleanAnswer.schema.json +8 -11
  47. package/dist/schemas/booleanQuestion.schema.json +7 -10
  48. package/dist/schemas/checkboxesAnswer.schema.json +13 -14
  49. package/dist/schemas/checkboxesQuestion.schema.json +12 -13
  50. package/dist/schemas/currencyAnswer.schema.json +8 -11
  51. package/dist/schemas/currencyQuestion.schema.json +7 -10
  52. package/dist/schemas/dateAnswer.schema.json +8 -11
  53. package/dist/schemas/dateQuestion.schema.json +7 -10
  54. package/dist/schemas/dateRangeAnswer.schema.json +16 -21
  55. package/dist/schemas/dateRangeQuestion.schema.json +38 -20
  56. package/dist/schemas/emailAnswer.schema.json +8 -11
  57. package/dist/schemas/emailQuestion.schema.json +7 -10
  58. package/dist/schemas/multiselectBoxAnswer.schema.json +13 -14
  59. package/dist/schemas/multiselectBoxQuestion.schema.json +14 -14
  60. package/dist/schemas/numberAnswer.schema.json +8 -11
  61. package/dist/schemas/numberQuestion.schema.json +7 -10
  62. package/dist/schemas/numberRangeAnswer.schema.json +17 -22
  63. package/dist/schemas/numberRangeQuestion.schema.json +18 -19
  64. package/dist/schemas/radioButtonsAnswer.schema.json +8 -11
  65. package/dist/schemas/radioButtonsQuestion.schema.json +12 -13
  66. package/dist/schemas/selectBoxAnswer.schema.json +8 -11
  67. package/dist/schemas/selectBoxQuestion.schema.json +18 -15
  68. package/dist/schemas/tableAnswer.schema.json +337 -343
  69. package/dist/schemas/tableQuestion.schema.json +178 -352
  70. package/dist/schemas/textAnswer.schema.json +8 -11
  71. package/dist/schemas/textAreaAnswer.schema.json +8 -11
  72. package/dist/schemas/textAreaQuestion.schema.json +7 -10
  73. package/dist/schemas/textQuestion.schema.json +7 -10
  74. package/dist/schemas/urlAnswer.schema.json +8 -11
  75. package/dist/schemas/urlQuestion.schema.json +7 -10
  76. package/package.json +1 -1
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "number"
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
  }
@@ -32,28 +32,25 @@
32
32
  "default": 1
33
33
  }
34
34
  },
35
- "additionalProperties": false
35
+ "additionalProperties": false,
36
+ "default": {}
36
37
  },
37
38
  "meta": {
38
39
  "type": "object",
39
40
  "properties": {
40
41
  "schemaVersion": {
41
42
  "type": "string",
42
- "const": "1.0"
43
+ "default": "1.0"
43
44
  },
44
45
  "title": {
45
- "type": "string",
46
- "const": "Number Field"
46
+ "type": "string"
47
47
  },
48
48
  "usageDescription": {
49
- "type": "string",
50
- "const": "For questions that require a single numeric value."
49
+ "type": "string"
51
50
  }
52
51
  },
53
- "required": [
54
- "schemaVersion"
55
- ],
56
- "additionalProperties": false
52
+ "additionalProperties": false,
53
+ "default": {}
57
54
  }
58
55
  },
59
56
  "required": [
@@ -8,40 +8,35 @@
8
8
  "type": "string",
9
9
  "const": "numberRange"
10
10
  },
11
- "answer": {
11
+ "meta": {
12
12
  "type": "object",
13
13
  "properties": {
14
- "start": {
15
- "type": "number"
16
- },
17
- "end": {
18
- "type": "number"
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": {
31
- "type": "string",
32
- "const": "1.0"
25
+ "start": {
26
+ "type": "number",
27
+ "default": 0
28
+ },
29
+ "end": {
30
+ "type": "number",
31
+ "default": 0
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,28 +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": "Number Range"
35
+ "type": "string"
36
36
  },
37
37
  "usageDescription": {
38
- "type": "string",
39
- "const": "For questions that require a numerical range (e.g. From/To, Min/Max)."
38
+ "type": "string"
40
39
  }
41
40
  },
42
- "required": [
43
- "schemaVersion"
44
- ],
45
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "default": {}
46
43
  },
47
44
  "columns": {
48
45
  "type": "object",
@@ -71,22 +68,24 @@
71
68
  "default": 1
72
69
  }
73
70
  },
74
- "additionalProperties": false
71
+ "additionalProperties": false,
72
+ "default": {
73
+ "label": "From"
74
+ }
75
75
  },
76
76
  "end": {
77
- "$ref": "#/definitions/NumberRangeQuestion/properties/columns/properties/start"
77
+ "$ref": "#/definitions/NumberRangeQuestion/properties/columns/properties/start",
78
+ "default": {
79
+ "label": "To"
80
+ }
78
81
  }
79
82
  },
80
- "required": [
81
- "start",
82
- "end"
83
- ],
84
- "additionalProperties": false
83
+ "additionalProperties": false,
84
+ "default": {}
85
85
  }
86
86
  },
87
87
  "required": [
88
- "type",
89
- "columns"
88
+ "type"
90
89
  ],
91
90
  "additionalProperties": false
92
91
  }
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "radioButtons"
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,28 +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": "Radio Buttons"
35
+ "type": "string"
36
36
  },
37
37
  "usageDescription": {
38
- "type": "string",
39
- "const": "For multiple choice questions where users select just one option."
38
+ "type": "string"
40
39
  }
41
40
  },
42
- "required": [
43
- "schemaVersion"
44
- ],
45
- "additionalProperties": false
41
+ "additionalProperties": false,
42
+ "default": {}
46
43
  },
47
44
  "options": {
48
45
  "type": "array",
@@ -63,12 +60,14 @@
63
60
  }
64
61
  },
65
62
  "additionalProperties": false
66
- }
63
+ },
64
+ "default": [
65
+ {}
66
+ ]
67
67
  }
68
68
  },
69
69
  "required": [
70
- "type",
71
- "options"
70
+ "type"
72
71
  ],
73
72
  "additionalProperties": false
74
73
  }
@@ -8,27 +8,24 @@
8
8
  "type": "string",
9
9
  "const": "selectBox"
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
  }
@@ -22,31 +22,33 @@
22
22
  },
23
23
  "multiple": {
24
24
  "type": "boolean",
25
- "default": false
25
+ "const": false
26
26
  }
27
27
  },
28
- "additionalProperties": false
28
+ "required": [
29
+ "multiple"
30
+ ],
31
+ "additionalProperties": false,
32
+ "default": {
33
+ "multiple": false
34
+ }
29
35
  },
30
36
  "meta": {
31
37
  "type": "object",
32
38
  "properties": {
33
39
  "schemaVersion": {
34
40
  "type": "string",
35
- "const": "1.0"
41
+ "default": "1.0"
36
42
  },
37
43
  "title": {
38
- "type": "string",
39
- "const": "Select Box"
44
+ "type": "string"
40
45
  },
41
46
  "usageDescription": {
42
- "type": "string",
43
- "const": "For questions where users select one option from a list."
47
+ "type": "string"
44
48
  }
45
49
  },
46
- "required": [
47
- "schemaVersion"
48
- ],
49
- "additionalProperties": false
50
+ "additionalProperties": false,
51
+ "default": {}
50
52
  },
51
53
  "options": {
52
54
  "type": "array",
@@ -67,13 +69,14 @@
67
69
  }
68
70
  },
69
71
  "additionalProperties": false
70
- }
72
+ },
73
+ "default": [
74
+ {}
75
+ ]
71
76
  }
72
77
  },
73
78
  "required": [
74
- "type",
75
- "attributes",
76
- "options"
79
+ "type"
77
80
  ],
78
81
  "additionalProperties": false
79
82
  }