@dmptool/types 1.1.1 → 1.1.2

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 (54) hide show
  1. package/dist/answers/__tests__/answers.spec.js +11 -5
  2. package/dist/answers/answer.d.ts +3 -3
  3. package/dist/answers/graphQLAnswers.d.ts +2 -2
  4. package/dist/answers/graphQLAnswers.js +2 -2
  5. package/dist/answers/index.d.ts +92 -55
  6. package/dist/answers/index.js +2 -2
  7. package/dist/answers/optionBasedAnswers.d.ts +27 -2
  8. package/dist/answers/optionBasedAnswers.js +5 -1
  9. package/dist/answers/tableAnswers.d.ts +268 -104
  10. package/dist/answers/tableAnswers.js +2 -1
  11. package/dist/questions/__tests__/graphQLQuestions.spec.js +7 -7
  12. package/dist/questions/__tests__/optionBasedQuestions.spec.js +48 -1
  13. package/dist/questions/dateQuestions.d.ts +47 -16
  14. package/dist/questions/dateQuestions.js +25 -1
  15. package/dist/questions/graphQLQuestions.d.ts +59 -28
  16. package/dist/questions/graphQLQuestions.js +40 -3
  17. package/dist/questions/index.d.ts +1363 -646
  18. package/dist/questions/index.js +4 -2
  19. package/dist/questions/numberQuestions.d.ts +71 -25
  20. package/dist/questions/numberQuestions.js +36 -1
  21. package/dist/questions/optionBasedQuestions.d.ts +197 -44
  22. package/dist/questions/optionBasedQuestions.js +84 -6
  23. package/dist/questions/question.d.ts +51 -4
  24. package/dist/questions/question.js +14 -2
  25. package/dist/questions/tableQuestions.d.ts +1841 -932
  26. package/dist/questions/tableQuestions.js +13 -1
  27. package/dist/questions/textQuestions.d.ts +100 -40
  28. package/dist/questions/textQuestions.js +45 -7
  29. package/dist/schemas/affiliationSearchAnswer.schema.json +37 -0
  30. package/dist/schemas/affiliationSearchQuestion.schema.json +133 -0
  31. package/dist/schemas/anyAnswer.schema.json +41 -23
  32. package/dist/schemas/anyQuestion.schema.json +533 -149
  33. package/dist/schemas/anyTableColumnAnswer.schema.json +35 -14
  34. package/dist/schemas/anyTableColumnQuestion.schema.json +397 -119
  35. package/dist/schemas/booleanQuestion.schema.json +13 -2
  36. package/dist/schemas/checkboxesQuestion.schema.json +12 -0
  37. package/dist/schemas/currencyQuestion.schema.json +12 -0
  38. package/dist/schemas/dateQuestion.schema.json +12 -0
  39. package/dist/schemas/dateRangeQuestion.schema.json +12 -0
  40. package/dist/schemas/emailQuestion.schema.json +12 -0
  41. package/dist/schemas/filteredSearchQuestion.schema.json +10 -0
  42. package/dist/schemas/multiselectBoxAnswer.schema.json +40 -0
  43. package/dist/schemas/multiselectBoxQuestion.schema.json +90 -0
  44. package/dist/schemas/numberQuestion.schema.json +12 -0
  45. package/dist/schemas/numberRangeQuestion.schema.json +12 -0
  46. package/dist/schemas/radioButtonsQuestion.schema.json +12 -0
  47. package/dist/schemas/selectBoxAnswer.schema.json +1 -4
  48. package/dist/schemas/selectBoxQuestion.schema.json +18 -1
  49. package/dist/schemas/tableAnswer.schema.json +35 -14
  50. package/dist/schemas/tableQuestion.schema.json +419 -120
  51. package/dist/schemas/textAreaQuestion.schema.json +15 -4
  52. package/dist/schemas/textQuestion.schema.json +12 -0
  53. package/dist/schemas/urlQuestion.schema.json +12 -0
  54. package/package.json +1 -1
@@ -32,6 +32,18 @@
32
32
  "schemaVersion": {
33
33
  "type": "string",
34
34
  "const": "1.0"
35
+ },
36
+ "title": {
37
+ "type": "string",
38
+ "const": "Yes/No Field"
39
+ },
40
+ "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}"
35
47
  }
36
48
  },
37
49
  "required": [
@@ -41,8 +53,7 @@
41
53
  }
42
54
  },
43
55
  "required": [
44
- "type",
45
- "attributes"
56
+ "type"
46
57
  ],
47
58
  "additionalProperties": false
48
59
  }
@@ -29,6 +29,18 @@
29
29
  "schemaVersion": {
30
30
  "type": "string",
31
31
  "const": "1.0"
32
+ },
33
+ "title": {
34
+ "type": "string",
35
+ "const": "Check Boxes"
36
+ },
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}"
32
44
  }
33
45
  },
34
46
  "required": [
@@ -41,6 +41,18 @@
41
41
  "schemaVersion": {
42
42
  "type": "string",
43
43
  "const": "1.0"
44
+ },
45
+ "title": {
46
+ "type": "string",
47
+ "const": "Currency Field"
48
+ },
49
+ "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}"
44
56
  }
45
57
  },
46
58
  "required": [
@@ -38,6 +38,18 @@
38
38
  "schemaVersion": {
39
39
  "type": "string",
40
40
  "const": "1.0"
41
+ },
42
+ "title": {
43
+ "type": "string",
44
+ "const": "Date Field"
45
+ },
46
+ "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\"}}"
41
53
  }
42
54
  },
43
55
  "required": [
@@ -29,6 +29,18 @@
29
29
  "schemaVersion": {
30
30
  "type": "string",
31
31
  "const": "1.0"
32
+ },
33
+ "title": {
34
+ "type": "string",
35
+ "const": "Date Range"
36
+ },
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}}}"
32
44
  }
33
45
  },
34
46
  "required": [
@@ -41,6 +41,18 @@
41
41
  "schemaVersion": {
42
42
  "type": "string",
43
43
  "const": "1.0"
44
+ },
45
+ "title": {
46
+ "type": "string",
47
+ "const": "Email Field"
48
+ },
49
+ "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\"}}"
44
56
  }
45
57
  },
46
58
  "required": [
@@ -32,6 +32,16 @@
32
32
  "schemaVersion": {
33
33
  "type": "string",
34
34
  "const": "1.0"
35
+ },
36
+ "title": {
37
+ "type": "string",
38
+ "const": "Not yet implemented"
39
+ },
40
+ "usageDescription": {
41
+ "type": "string"
42
+ },
43
+ "defaultJSON": {
44
+ "type": "string"
35
45
  }
36
46
  },
37
47
  "required": [
@@ -0,0 +1,40 @@
1
+ {
2
+ "$ref": "#/definitions/MultiselectBoxAnswer",
3
+ "definitions": {
4
+ "MultiselectBoxAnswer": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "multiselectBox"
10
+ },
11
+ "answer": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "meta": {
18
+ "type": "object",
19
+ "properties": {
20
+ "schemaVersion": {
21
+ "type": "string",
22
+ "const": "1.0"
23
+ }
24
+ },
25
+ "required": [
26
+ "schemaVersion"
27
+ ],
28
+ "additionalProperties": false
29
+ }
30
+ },
31
+ "required": [
32
+ "type",
33
+ "answer",
34
+ "meta"
35
+ ],
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "$schema": "http://json-schema.org/draft-07/schema#"
40
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$ref": "#/definitions/MultiselectBoxQuestion",
3
+ "definitions": {
4
+ "MultiselectBoxQuestion": {
5
+ "type": "object",
6
+ "properties": {
7
+ "type": {
8
+ "type": "string",
9
+ "const": "multiselectBox"
10
+ },
11
+ "attributes": {
12
+ "type": "object",
13
+ "properties": {
14
+ "label": {
15
+ "type": "string"
16
+ },
17
+ "help": {
18
+ "type": "string"
19
+ },
20
+ "labelTranslationKey": {
21
+ "type": "string"
22
+ },
23
+ "multiple": {
24
+ "type": "boolean",
25
+ "const": true
26
+ }
27
+ },
28
+ "required": [
29
+ "multiple"
30
+ ],
31
+ "additionalProperties": false
32
+ },
33
+ "meta": {
34
+ "type": "object",
35
+ "properties": {
36
+ "schemaVersion": {
37
+ "type": "string",
38
+ "const": "1.0"
39
+ },
40
+ "title": {
41
+ "type": "string",
42
+ "const": "Multi-select Box"
43
+ },
44
+ "usageDescription": {
45
+ "type": "string",
46
+ "const": "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses."
47
+ },
48
+ "defaultJSON": {
49
+ "type": "string",
50
+ "const": "{\n \"type\": \"selectBox\",\n \"attributes\": {\n \"multiple\": true\n },\n \"options\": [\n {\n \"label\": \"Option 1\",\n \"value\": \"option1\"\n }\n ],\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
51
+ }
52
+ },
53
+ "required": [
54
+ "schemaVersion"
55
+ ],
56
+ "additionalProperties": false
57
+ },
58
+ "options": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "object",
62
+ "properties": {
63
+ "label": {
64
+ "type": "string"
65
+ },
66
+ "value": {
67
+ "type": "string"
68
+ },
69
+ "selected": {
70
+ "type": "boolean"
71
+ }
72
+ },
73
+ "required": [
74
+ "label",
75
+ "value"
76
+ ],
77
+ "additionalProperties": false
78
+ }
79
+ }
80
+ },
81
+ "required": [
82
+ "type",
83
+ "attributes",
84
+ "options"
85
+ ],
86
+ "additionalProperties": false
87
+ }
88
+ },
89
+ "$schema": "http://json-schema.org/draft-07/schema#"
90
+ }
@@ -38,6 +38,18 @@
38
38
  "schemaVersion": {
39
39
  "type": "string",
40
40
  "const": "1.0"
41
+ },
42
+ "title": {
43
+ "type": "string",
44
+ "const": "Number Field"
45
+ },
46
+ "usageDescription": {
47
+ "type": "string",
48
+ "const": "For questions that require a single numeric value."
49
+ },
50
+ "defaultJSON": {
51
+ "type": "string",
52
+ "const": "{\n \"type\": \"number\",\n \"attributes\": {\n \"min\": 0,\n \"step\": 1\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
41
53
  }
42
54
  },
43
55
  "required": [
@@ -29,6 +29,18 @@
29
29
  "schemaVersion": {
30
30
  "type": "string",
31
31
  "const": "1.0"
32
+ },
33
+ "title": {
34
+ "type": "string",
35
+ "const": "Number Range"
36
+ },
37
+ "usageDescription": {
38
+ "type": "string",
39
+ "const": "For questions that require a numerical range (e.g. From/To, Min/Max)."
40
+ },
41
+ "defaultJSON": {
42
+ "type": "string",
43
+ "const": "{\n \"type\": \"numberRange\",\n \"attributes\": {},\n \"columns\": {\n \"start\": {\n \"label\": \"From\",\n \"min\": 0,\n \"step\": 1\n },\n \"end\": {\n \"label\": \"To\",\n \"min\": 0,\n \"step\": 1\n }\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
32
44
  }
33
45
  },
34
46
  "required": [
@@ -29,6 +29,18 @@
29
29
  "schemaVersion": {
30
30
  "type": "string",
31
31
  "const": "1.0"
32
+ },
33
+ "title": {
34
+ "type": "string",
35
+ "const": "Radio Buttons"
36
+ },
37
+ "usageDescription": {
38
+ "type": "string",
39
+ "const": "For multiple choice questions where users select just one option."
40
+ },
41
+ "defaultJSON": {
42
+ "type": "string",
43
+ "const": "{\n \"type\": \"radioButtons\",\n \"attributes\": {},\n \"options\": [\n {\n \"label\": \"Option 1\",\n \"value\": \"option1\",\n \"selected\": false\n }\n ],\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
32
44
  }
33
45
  },
34
46
  "required": [
@@ -9,10 +9,7 @@
9
9
  "const": "selectBox"
10
10
  },
11
11
  "answer": {
12
- "type": "array",
13
- "items": {
14
- "type": "string"
15
- }
12
+ "type": "string"
16
13
  },
17
14
  "meta": {
18
15
  "type": "object",
@@ -21,9 +21,13 @@
21
21
  "type": "string"
22
22
  },
23
23
  "multiple": {
24
- "type": "boolean"
24
+ "type": "boolean",
25
+ "const": false
25
26
  }
26
27
  },
28
+ "required": [
29
+ "multiple"
30
+ ],
27
31
  "additionalProperties": false
28
32
  },
29
33
  "meta": {
@@ -32,6 +36,18 @@
32
36
  "schemaVersion": {
33
37
  "type": "string",
34
38
  "const": "1.0"
39
+ },
40
+ "title": {
41
+ "type": "string",
42
+ "const": "Select Box"
43
+ },
44
+ "usageDescription": {
45
+ "type": "string",
46
+ "const": "For questions where users select one option from a list."
47
+ },
48
+ "defaultJSON": {
49
+ "type": "string",
50
+ "const": "{\n \"type\": \"selectBox\",\n \"attributes\": {\n \"multiple\": false\n },\n \"options\": [\n {\n \"label\": \"Option 1\",\n \"value\": \"option1\"\n }\n ],\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
35
51
  }
36
52
  },
37
53
  "required": [
@@ -64,6 +80,7 @@
64
80
  },
65
81
  "required": [
66
82
  "type",
83
+ "attributes",
67
84
  "options"
68
85
  ],
69
86
  "additionalProperties": false
@@ -28,10 +28,10 @@
28
28
  "properties": {
29
29
  "type": {
30
30
  "type": "string",
31
- "const": "boolean"
31
+ "const": "typeaheadSearch"
32
32
  },
33
33
  "answer": {
34
- "type": "boolean"
34
+ "type": "string"
35
35
  },
36
36
  "meta": {
37
37
  "type": "object",
@@ -54,6 +54,27 @@
54
54
  ],
55
55
  "additionalProperties": false
56
56
  },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "type": {
61
+ "type": "string",
62
+ "const": "boolean"
63
+ },
64
+ "answer": {
65
+ "type": "boolean"
66
+ },
67
+ "meta": {
68
+ "$ref": "#/definitions/TableAnswer/properties/answer/items/properties/columns/items/properties/content/anyOf/0/properties/meta"
69
+ }
70
+ },
71
+ "required": [
72
+ "type",
73
+ "answer",
74
+ "meta"
75
+ ],
76
+ "additionalProperties": false
77
+ },
57
78
  {
58
79
  "type": "object",
59
80
  "properties": {
@@ -204,10 +225,13 @@
204
225
  "properties": {
205
226
  "type": {
206
227
  "type": "string",
207
- "const": "number"
228
+ "const": "multiselectBox"
208
229
  },
209
230
  "answer": {
210
- "type": "number"
231
+ "type": "array",
232
+ "items": {
233
+ "type": "string"
234
+ }
211
235
  },
212
236
  "meta": {
213
237
  "$ref": "#/definitions/TableAnswer/properties/answer/items/properties/columns/items/properties/content/anyOf/0/properties/meta"
@@ -225,10 +249,10 @@
225
249
  "properties": {
226
250
  "type": {
227
251
  "type": "string",
228
- "const": "radioButtons"
252
+ "const": "number"
229
253
  },
230
254
  "answer": {
231
- "type": "string"
255
+ "type": "number"
232
256
  },
233
257
  "meta": {
234
258
  "$ref": "#/definitions/TableAnswer/properties/answer/items/properties/columns/items/properties/content/anyOf/0/properties/meta"
@@ -246,13 +270,10 @@
246
270
  "properties": {
247
271
  "type": {
248
272
  "type": "string",
249
- "const": "selectBox"
273
+ "const": "radioButtons"
250
274
  },
251
275
  "answer": {
252
- "type": "array",
253
- "items": {
254
- "type": "string"
255
- }
276
+ "type": "string"
256
277
  },
257
278
  "meta": {
258
279
  "$ref": "#/definitions/TableAnswer/properties/answer/items/properties/columns/items/properties/content/anyOf/0/properties/meta"
@@ -270,7 +291,7 @@
270
291
  "properties": {
271
292
  "type": {
272
293
  "type": "string",
273
- "const": "text"
294
+ "const": "selectBox"
274
295
  },
275
296
  "answer": {
276
297
  "type": "string"
@@ -291,7 +312,7 @@
291
312
  "properties": {
292
313
  "type": {
293
314
  "type": "string",
294
- "const": "textArea"
315
+ "const": "text"
295
316
  },
296
317
  "answer": {
297
318
  "type": "string"
@@ -312,7 +333,7 @@
312
333
  "properties": {
313
334
  "type": {
314
335
  "type": "string",
315
- "const": "typeaheadSearch"
336
+ "const": "textArea"
316
337
  },
317
338
  "answer": {
318
339
  "type": "string"