@dmptool/types 1.1.0 → 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 (58) hide show
  1. package/README.md +2 -0
  2. package/dist/answers/__tests__/answers.spec.js +13 -7
  3. package/dist/answers/answer.d.ts +3 -3
  4. package/dist/answers/graphQLAnswers.d.ts +2 -2
  5. package/dist/answers/graphQLAnswers.js +2 -2
  6. package/dist/answers/index.d.ts +111 -74
  7. package/dist/answers/index.js +4 -4
  8. package/dist/answers/numberAnswers.d.ts +0 -25
  9. package/dist/answers/numberAnswers.js +1 -5
  10. package/dist/answers/optionBasedAnswers.d.ts +52 -2
  11. package/dist/answers/optionBasedAnswers.js +9 -1
  12. package/dist/answers/tableAnswers.d.ts +304 -140
  13. package/dist/answers/tableAnswers.js +3 -2
  14. package/dist/questions/__tests__/graphQLQuestions.spec.js +7 -7
  15. package/dist/questions/__tests__/numberQuestions.spec.js +0 -48
  16. package/dist/questions/__tests__/optionBasedQuestions.spec.js +98 -1
  17. package/dist/questions/dateQuestions.d.ts +47 -16
  18. package/dist/questions/dateQuestions.js +25 -1
  19. package/dist/questions/graphQLQuestions.d.ts +59 -28
  20. package/dist/questions/graphQLQuestions.js +40 -3
  21. package/dist/questions/index.d.ts +1567 -689
  22. package/dist/questions/index.js +7 -4
  23. package/dist/questions/numberQuestions.d.ts +71 -76
  24. package/dist/questions/numberQuestions.js +37 -8
  25. package/dist/questions/optionBasedQuestions.d.ts +227 -23
  26. package/dist/questions/optionBasedQuestions.js +89 -5
  27. package/dist/questions/question.d.ts +51 -4
  28. package/dist/questions/question.js +14 -2
  29. package/dist/questions/tableQuestions.d.ts +1965 -1056
  30. package/dist/questions/tableQuestions.js +14 -2
  31. package/dist/questions/textQuestions.d.ts +100 -40
  32. package/dist/questions/textQuestions.js +45 -7
  33. package/dist/schemas/affiliationSearchAnswer.schema.json +37 -0
  34. package/dist/schemas/affiliationSearchQuestion.schema.json +133 -0
  35. package/dist/schemas/anyAnswer.schema.json +41 -23
  36. package/dist/schemas/anyQuestion.schema.json +563 -146
  37. package/dist/schemas/anyTableColumnAnswer.schema.json +35 -14
  38. package/dist/schemas/anyTableColumnQuestion.schema.json +398 -119
  39. package/dist/schemas/booleanQuestion.schema.json +12 -0
  40. package/dist/schemas/checkboxesQuestion.schema.json +12 -0
  41. package/dist/schemas/currencyQuestion.schema.json +12 -0
  42. package/dist/schemas/dateQuestion.schema.json +12 -0
  43. package/dist/schemas/dateRangeQuestion.schema.json +12 -0
  44. package/dist/schemas/emailQuestion.schema.json +12 -0
  45. package/dist/schemas/filteredSearchQuestion.schema.json +10 -0
  46. package/dist/schemas/multiselectBoxAnswer.schema.json +40 -0
  47. package/dist/schemas/multiselectBoxQuestion.schema.json +90 -0
  48. package/dist/schemas/numberQuestion.schema.json +12 -0
  49. package/dist/schemas/numberRangeQuestion.schema.json +12 -0
  50. package/dist/schemas/radioButtonsQuestion.schema.json +12 -0
  51. package/dist/schemas/selectBoxAnswer.schema.json +1 -4
  52. package/dist/schemas/selectBoxQuestion.schema.json +18 -1
  53. package/dist/schemas/tableAnswer.schema.json +35 -14
  54. package/dist/schemas/tableQuestion.schema.json +420 -120
  55. package/dist/schemas/textAreaQuestion.schema.json +15 -4
  56. package/dist/schemas/textQuestion.schema.json +12 -0
  57. package/dist/schemas/urlQuestion.schema.json +12 -0
  58. package/package.json +1 -1
@@ -8,7 +8,7 @@
8
8
  "properties": {
9
9
  "type": {
10
10
  "type": "string",
11
- "const": "boolean"
11
+ "const": "affiliationSearch"
12
12
  },
13
13
  "attributes": {
14
14
  "type": "object",
@@ -21,9 +21,6 @@
21
21
  },
22
22
  "labelTranslationKey": {
23
23
  "type": "string"
24
- },
25
- "checked": {
26
- "type": "boolean"
27
24
  }
28
25
  },
29
26
  "additionalProperties": false
@@ -34,16 +31,102 @@
34
31
  "schemaVersion": {
35
32
  "type": "string",
36
33
  "const": "1.0"
34
+ },
35
+ "title": {
36
+ "type": "string",
37
+ "const": "Affiliation Search"
38
+ },
39
+ "usageDescription": {
40
+ "type": "string",
41
+ "const": "For questions that require the user to select from a controlled list of institutions."
42
+ },
43
+ "defaultJSON": {
44
+ "type": "string",
45
+ "const": "{\"type\":\"affiliationSearch\",\"attributes\":{},\"meta\":{\"schemaVersion\":\"1.0\"},\"graphQL\":{\"query\":\"query Affiliations($name: String!){affiliations(name: $name) { totalCount nextCursor items {id displayName uri}}}\",\"queryId\":\"useAffiliationsQuery\",\"variables\":[{\"name\":\"term\",\"type\":\"string\",\"label\":\"Search for your institution\",\"minLength\":3,\"labelTranslationKey\":\"SignupPage.institutionHelp\"}],\"answerField\":\"uri\",\"displayFields\":[{\"label\":\"Institution\",\"propertyName\":\"displayName\",\"labelTranslationKey\":\"SignupPage.institution\"}],\"responseField\":\"affiliations.items\"}}"
37
46
  }
38
47
  },
39
48
  "required": [
40
49
  "schemaVersion"
41
50
  ],
42
51
  "additionalProperties": false
52
+ },
53
+ "graphQL": {
54
+ "type": "object",
55
+ "properties": {
56
+ "displayFields": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "propertyName": {
62
+ "type": "string"
63
+ },
64
+ "label": {
65
+ "type": "string"
66
+ },
67
+ "labelTranslationKey": {
68
+ "type": "string"
69
+ }
70
+ },
71
+ "required": [
72
+ "propertyName",
73
+ "label"
74
+ ],
75
+ "additionalProperties": false
76
+ }
77
+ },
78
+ "localQueryId": {
79
+ "type": "string"
80
+ },
81
+ "query": {
82
+ "type": "string"
83
+ },
84
+ "responseField": {
85
+ "type": "string"
86
+ },
87
+ "variables": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "object",
91
+ "properties": {
92
+ "minLength": {
93
+ "type": "number"
94
+ },
95
+ "label": {
96
+ "type": "string"
97
+ },
98
+ "labelTranslationKey": {
99
+ "type": "string"
100
+ },
101
+ "name": {
102
+ "type": "string"
103
+ },
104
+ "type": {
105
+ "type": "string"
106
+ },
107
+ "defaultValue": {
108
+ "type": "string"
109
+ }
110
+ },
111
+ "required": [
112
+ "name",
113
+ "type"
114
+ ],
115
+ "additionalProperties": false
116
+ }
117
+ }
118
+ },
119
+ "required": [
120
+ "displayFields",
121
+ "responseField"
122
+ ],
123
+ "additionalProperties": false
43
124
  }
44
125
  },
45
126
  "required": [
46
- "type"
127
+ "type",
128
+ "meta",
129
+ "graphQL"
47
130
  ],
48
131
  "additionalProperties": false
49
132
  },
@@ -52,7 +135,7 @@
52
135
  "properties": {
53
136
  "type": {
54
137
  "type": "string",
55
- "const": "checkBoxes"
138
+ "const": "boolean"
56
139
  },
57
140
  "attributes": {
58
141
  "type": "object",
@@ -65,12 +148,76 @@
65
148
  },
66
149
  "labelTranslationKey": {
67
150
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/labelTranslationKey"
151
+ },
152
+ "checked": {
153
+ "type": "boolean"
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ },
158
+ "meta": {
159
+ "type": "object",
160
+ "properties": {
161
+ "schemaVersion": {
162
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
163
+ },
164
+ "title": {
165
+ "type": "string",
166
+ "const": "Yes/No Field"
167
+ },
168
+ "usageDescription": {
169
+ "type": "string",
170
+ "const": "For questions that require a simple Yes/No response."
171
+ },
172
+ "defaultJSON": {
173
+ "type": "string",
174
+ "const": "{\n \"attributes\": {\n \"checked\": false\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
68
175
  }
69
176
  },
177
+ "required": [
178
+ "schemaVersion"
179
+ ],
70
180
  "additionalProperties": false
181
+ }
182
+ },
183
+ "required": [
184
+ "type"
185
+ ],
186
+ "additionalProperties": false
187
+ },
188
+ {
189
+ "type": "object",
190
+ "properties": {
191
+ "type": {
192
+ "type": "string",
193
+ "const": "checkBoxes"
194
+ },
195
+ "attributes": {
196
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes"
71
197
  },
72
198
  "meta": {
73
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
199
+ "type": "object",
200
+ "properties": {
201
+ "schemaVersion": {
202
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
203
+ },
204
+ "title": {
205
+ "type": "string",
206
+ "const": "Check Boxes"
207
+ },
208
+ "usageDescription": {
209
+ "type": "string",
210
+ "const": "For multiple choice questions where users can select multiple options."
211
+ },
212
+ "defaultJSON": {
213
+ "type": "string",
214
+ "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}"
215
+ }
216
+ },
217
+ "required": [
218
+ "schemaVersion"
219
+ ],
220
+ "additionalProperties": false
74
221
  },
75
222
  "options": {
76
223
  "type": "array",
@@ -136,7 +283,28 @@
136
283
  "additionalProperties": false
137
284
  },
138
285
  "meta": {
139
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
286
+ "type": "object",
287
+ "properties": {
288
+ "schemaVersion": {
289
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
290
+ },
291
+ "title": {
292
+ "type": "string",
293
+ "const": "Currency Field"
294
+ },
295
+ "usageDescription": {
296
+ "type": "string",
297
+ "const": "For questions that require a monetary amount (e.g. Cost or Budget)."
298
+ },
299
+ "defaultJSON": {
300
+ "type": "string",
301
+ "const": "{\n \"type\": \"currency\",\n \"attributes\": {\n \"denomination\": \"USD\",\n \"min\": 0,\n \"step\": 1\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
302
+ }
303
+ },
304
+ "required": [
305
+ "schemaVersion"
306
+ ],
307
+ "additionalProperties": false
140
308
  }
141
309
  },
142
310
  "required": [
@@ -176,7 +344,28 @@
176
344
  "additionalProperties": false
177
345
  },
178
346
  "meta": {
179
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
347
+ "type": "object",
348
+ "properties": {
349
+ "schemaVersion": {
350
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
351
+ },
352
+ "title": {
353
+ "type": "string",
354
+ "const": "Date Field"
355
+ },
356
+ "usageDescription": {
357
+ "type": "string",
358
+ "const": "For questions that require a date."
359
+ },
360
+ "defaultJSON": {
361
+ "type": "string",
362
+ "const": "{\"type\":\"date\",\"attributes\":{\"step\":1},\"meta\":{\"schemaVersion\":\"1.0\"}}"
363
+ }
364
+ },
365
+ "required": [
366
+ "schemaVersion"
367
+ ],
368
+ "additionalProperties": false
180
369
  }
181
370
  },
182
371
  "required": [
@@ -192,19 +381,40 @@
192
381
  "const": "dateRange"
193
382
  },
194
383
  "attributes": {
195
- "$ref": "#/definitions/AnyQuestion/anyOf/1/properties/attributes"
384
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes"
196
385
  },
197
386
  "meta": {
198
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
387
+ "type": "object",
388
+ "properties": {
389
+ "schemaVersion": {
390
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
391
+ },
392
+ "title": {
393
+ "type": "string",
394
+ "const": "Date Range"
395
+ },
396
+ "usageDescription": {
397
+ "type": "string",
398
+ "const": "For questions that require a date range (e.g. From/To, Start/End)"
399
+ },
400
+ "defaultJSON": {
401
+ "type": "string",
402
+ "const": "{\"type\":\"dateRange\",\"attributes\":{},\"columns\":{\"start\":{\"label\":\"Start\",\"step\":1},\"end\":{\"label\":\"End\",\"step\":1}}}"
403
+ }
404
+ },
405
+ "required": [
406
+ "schemaVersion"
407
+ ],
408
+ "additionalProperties": false
199
409
  },
200
410
  "columns": {
201
411
  "type": "object",
202
412
  "properties": {
203
413
  "start": {
204
- "$ref": "#/definitions/AnyQuestion/anyOf/3/properties/attributes"
414
+ "$ref": "#/definitions/AnyQuestion/anyOf/4/properties/attributes"
205
415
  },
206
416
  "end": {
207
- "$ref": "#/definitions/AnyQuestion/anyOf/3/properties/attributes"
417
+ "$ref": "#/definitions/AnyQuestion/anyOf/4/properties/attributes"
208
418
  }
209
419
  },
210
420
  "additionalProperties": false
@@ -251,7 +461,28 @@
251
461
  "additionalProperties": false
252
462
  },
253
463
  "meta": {
254
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
464
+ "type": "object",
465
+ "properties": {
466
+ "schemaVersion": {
467
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
468
+ },
469
+ "title": {
470
+ "type": "string",
471
+ "const": "Email Field"
472
+ },
473
+ "usageDescription": {
474
+ "type": "string",
475
+ "const": "For questions that require require email address(es)."
476
+ },
477
+ "defaultJSON": {
478
+ "type": "string",
479
+ "const": "{\"type\":\"email\",\"attributes\":{\"maxLength\":255,\"minLength\":1,\"multiple\":false},\"meta\":{\"schemaVersion\":\"1.0\"}}"
480
+ }
481
+ },
482
+ "required": [
483
+ "schemaVersion"
484
+ ],
485
+ "additionalProperties": false
255
486
  }
256
487
  },
257
488
  "required": [
@@ -285,79 +516,29 @@
285
516
  "additionalProperties": false
286
517
  },
287
518
  "meta": {
288
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
289
- },
290
- "graphQL": {
291
519
  "type": "object",
292
520
  "properties": {
293
- "displayFields": {
294
- "type": "array",
295
- "items": {
296
- "type": "object",
297
- "properties": {
298
- "propertyName": {
299
- "type": "string"
300
- },
301
- "label": {
302
- "type": "string"
303
- },
304
- "labelTranslationKey": {
305
- "type": "string"
306
- }
307
- },
308
- "required": [
309
- "propertyName",
310
- "label"
311
- ],
312
- "additionalProperties": false
313
- }
521
+ "schemaVersion": {
522
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
314
523
  },
315
- "localQueryId": {
316
- "type": "string"
524
+ "title": {
525
+ "type": "string",
526
+ "const": "Not yet implemented"
317
527
  },
318
- "query": {
528
+ "usageDescription": {
319
529
  "type": "string"
320
530
  },
321
- "responseField": {
531
+ "defaultJSON": {
322
532
  "type": "string"
323
- },
324
- "variables": {
325
- "type": "array",
326
- "items": {
327
- "type": "object",
328
- "properties": {
329
- "minLength": {
330
- "type": "number"
331
- },
332
- "label": {
333
- "type": "string"
334
- },
335
- "labelTranslationKey": {
336
- "type": "string"
337
- },
338
- "name": {
339
- "type": "string"
340
- },
341
- "type": {
342
- "type": "string"
343
- },
344
- "defaultValue": {
345
- "type": "string"
346
- }
347
- },
348
- "required": [
349
- "name",
350
- "type"
351
- ],
352
- "additionalProperties": false
353
- }
354
533
  }
355
534
  },
356
535
  "required": [
357
- "displayFields",
358
- "responseField"
536
+ "schemaVersion"
359
537
  ],
360
538
  "additionalProperties": false
539
+ },
540
+ "graphQL": {
541
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/graphQL"
361
542
  }
362
543
  },
363
544
  "required": [
@@ -366,6 +547,89 @@
366
547
  ],
367
548
  "additionalProperties": false
368
549
  },
550
+ {
551
+ "type": "object",
552
+ "properties": {
553
+ "type": {
554
+ "type": "string",
555
+ "const": "multiselectBox"
556
+ },
557
+ "attributes": {
558
+ "type": "object",
559
+ "properties": {
560
+ "label": {
561
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/label"
562
+ },
563
+ "help": {
564
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/help"
565
+ },
566
+ "labelTranslationKey": {
567
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/labelTranslationKey"
568
+ },
569
+ "multiple": {
570
+ "type": "boolean",
571
+ "const": true
572
+ }
573
+ },
574
+ "required": [
575
+ "multiple"
576
+ ],
577
+ "additionalProperties": false
578
+ },
579
+ "meta": {
580
+ "type": "object",
581
+ "properties": {
582
+ "schemaVersion": {
583
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
584
+ },
585
+ "title": {
586
+ "type": "string",
587
+ "const": "Multi-select Box"
588
+ },
589
+ "usageDescription": {
590
+ "type": "string",
591
+ "const": "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses."
592
+ },
593
+ "defaultJSON": {
594
+ "type": "string",
595
+ "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}"
596
+ }
597
+ },
598
+ "required": [
599
+ "schemaVersion"
600
+ ],
601
+ "additionalProperties": false
602
+ },
603
+ "options": {
604
+ "type": "array",
605
+ "items": {
606
+ "type": "object",
607
+ "properties": {
608
+ "label": {
609
+ "$ref": "#/definitions/AnyQuestion/anyOf/2/properties/options/items/properties/label"
610
+ },
611
+ "value": {
612
+ "$ref": "#/definitions/AnyQuestion/anyOf/2/properties/options/items/properties/value"
613
+ },
614
+ "selected": {
615
+ "type": "boolean"
616
+ }
617
+ },
618
+ "required": [
619
+ "label",
620
+ "value"
621
+ ],
622
+ "additionalProperties": false
623
+ }
624
+ }
625
+ },
626
+ "required": [
627
+ "type",
628
+ "attributes",
629
+ "options"
630
+ ],
631
+ "additionalProperties": false
632
+ },
369
633
  {
370
634
  "type": "object",
371
635
  "properties": {
@@ -386,19 +650,40 @@
386
650
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/labelTranslationKey"
387
651
  },
388
652
  "max": {
389
- "$ref": "#/definitions/AnyQuestion/anyOf/2/properties/attributes/properties/max"
653
+ "$ref": "#/definitions/AnyQuestion/anyOf/3/properties/attributes/properties/max"
390
654
  },
391
655
  "min": {
392
- "$ref": "#/definitions/AnyQuestion/anyOf/2/properties/attributes/properties/min"
656
+ "$ref": "#/definitions/AnyQuestion/anyOf/3/properties/attributes/properties/min"
393
657
  },
394
658
  "step": {
395
- "$ref": "#/definitions/AnyQuestion/anyOf/2/properties/attributes/properties/step"
659
+ "$ref": "#/definitions/AnyQuestion/anyOf/3/properties/attributes/properties/step"
396
660
  }
397
661
  },
398
662
  "additionalProperties": false
399
663
  },
400
664
  "meta": {
401
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
665
+ "type": "object",
666
+ "properties": {
667
+ "schemaVersion": {
668
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
669
+ },
670
+ "title": {
671
+ "type": "string",
672
+ "const": "Number Field"
673
+ },
674
+ "usageDescription": {
675
+ "type": "string",
676
+ "const": "For questions that require a single numeric value."
677
+ },
678
+ "defaultJSON": {
679
+ "type": "string",
680
+ "const": "{\n \"type\": \"number\",\n \"attributes\": {\n \"min\": 0,\n \"step\": 1\n },\n \"meta\": {\n \"schemaVersion\": \"1.0\"\n }\n}"
681
+ }
682
+ },
683
+ "required": [
684
+ "schemaVersion"
685
+ ],
686
+ "additionalProperties": false
402
687
  }
403
688
  },
404
689
  "required": [
@@ -406,6 +691,59 @@
406
691
  ],
407
692
  "additionalProperties": false
408
693
  },
694
+ {
695
+ "type": "object",
696
+ "properties": {
697
+ "type": {
698
+ "type": "string",
699
+ "const": "numberRange"
700
+ },
701
+ "attributes": {
702
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes"
703
+ },
704
+ "meta": {
705
+ "type": "object",
706
+ "properties": {
707
+ "schemaVersion": {
708
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
709
+ },
710
+ "title": {
711
+ "type": "string",
712
+ "const": "Number Range"
713
+ },
714
+ "usageDescription": {
715
+ "type": "string",
716
+ "const": "For questions that require a numerical range (e.g. From/To, Min/Max)."
717
+ },
718
+ "defaultJSON": {
719
+ "type": "string",
720
+ "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}"
721
+ }
722
+ },
723
+ "required": [
724
+ "schemaVersion"
725
+ ],
726
+ "additionalProperties": false
727
+ },
728
+ "columns": {
729
+ "type": "object",
730
+ "properties": {
731
+ "start": {
732
+ "$ref": "#/definitions/AnyQuestion/anyOf/9/properties/attributes"
733
+ },
734
+ "end": {
735
+ "$ref": "#/definitions/AnyQuestion/anyOf/9/properties/attributes"
736
+ }
737
+ },
738
+ "additionalProperties": false
739
+ }
740
+ },
741
+ "required": [
742
+ "type",
743
+ "columns"
744
+ ],
745
+ "additionalProperties": false
746
+ },
409
747
  {
410
748
  "type": "object",
411
749
  "properties": {
@@ -414,31 +752,36 @@
414
752
  "const": "radioButtons"
415
753
  },
416
754
  "attributes": {
417
- "$ref": "#/definitions/AnyQuestion/anyOf/1/properties/attributes"
755
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes"
418
756
  },
419
757
  "meta": {
420
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
758
+ "type": "object",
759
+ "properties": {
760
+ "schemaVersion": {
761
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
762
+ },
763
+ "title": {
764
+ "type": "string",
765
+ "const": "Radio Buttons"
766
+ },
767
+ "usageDescription": {
768
+ "type": "string",
769
+ "const": "For multiple choice questions where users select just one option."
770
+ },
771
+ "defaultJSON": {
772
+ "type": "string",
773
+ "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}"
774
+ }
775
+ },
776
+ "required": [
777
+ "schemaVersion"
778
+ ],
779
+ "additionalProperties": false
421
780
  },
422
781
  "options": {
423
782
  "type": "array",
424
783
  "items": {
425
- "type": "object",
426
- "properties": {
427
- "label": {
428
- "$ref": "#/definitions/AnyQuestion/anyOf/1/properties/options/items/properties/label"
429
- },
430
- "value": {
431
- "$ref": "#/definitions/AnyQuestion/anyOf/1/properties/options/items/properties/value"
432
- },
433
- "selected": {
434
- "type": "boolean"
435
- }
436
- },
437
- "required": [
438
- "label",
439
- "value"
440
- ],
441
- "additionalProperties": false
784
+ "$ref": "#/definitions/AnyQuestion/anyOf/8/properties/options/items"
442
785
  }
443
786
  }
444
787
  },
@@ -468,23 +811,46 @@
468
811
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/labelTranslationKey"
469
812
  },
470
813
  "multiple": {
471
- "type": "boolean"
814
+ "type": "boolean",
815
+ "const": false
472
816
  }
473
817
  },
818
+ "required": [
819
+ "multiple"
820
+ ],
474
821
  "additionalProperties": false
475
822
  },
476
823
  "meta": {
477
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
824
+ "type": "object",
825
+ "properties": {
826
+ "schemaVersion": {
827
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
828
+ },
829
+ "title": {
830
+ "type": "string",
831
+ "const": "Select Box"
832
+ },
833
+ "usageDescription": {
834
+ "type": "string",
835
+ "const": "For questions where users select one option from a list."
836
+ },
837
+ "defaultJSON": {
838
+ "type": "string",
839
+ "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}"
840
+ }
841
+ },
842
+ "required": [
843
+ "schemaVersion"
844
+ ],
845
+ "additionalProperties": false
478
846
  },
479
847
  "options": {
480
- "type": "array",
481
- "items": {
482
- "$ref": "#/definitions/AnyQuestion/anyOf/8/properties/options/items"
483
- }
848
+ "$ref": "#/definitions/AnyQuestion/anyOf/8/properties/options"
484
849
  }
485
850
  },
486
851
  "required": [
487
852
  "type",
853
+ "attributes",
488
854
  "options"
489
855
  ],
490
856
  "additionalProperties": false
@@ -527,7 +893,28 @@
527
893
  "additionalProperties": false
528
894
  },
529
895
  "meta": {
530
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
896
+ "type": "object",
897
+ "properties": {
898
+ "schemaVersion": {
899
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
900
+ },
901
+ "title": {
902
+ "type": "string",
903
+ "const": "Table"
904
+ },
905
+ "usageDescription": {
906
+ "type": "string",
907
+ "const": "For questions that require a tabular format."
908
+ },
909
+ "defaultJSON": {
910
+ "type": "string",
911
+ "const": "{\"type\":\"table\",\"columns\":[],\"attributes\":{\"canAddRows\":true,\"canRemoveRows\":true,\"initialRows\":1},\"meta\":{\"schemaVersion\":\"1.0\"}}"
912
+ }
913
+ },
914
+ "required": [
915
+ "schemaVersion"
916
+ ],
917
+ "additionalProperties": false
531
918
  },
532
919
  "columns": {
533
920
  "type": "array",
@@ -564,10 +951,13 @@
564
951
  "$ref": "#/definitions/AnyQuestion/anyOf/7"
565
952
  },
566
953
  {
567
- "$ref": "#/definitions/AnyQuestion/anyOf/8"
954
+ "$ref": "#/definitions/AnyQuestion/anyOf/9"
568
955
  },
569
956
  {
570
- "$ref": "#/definitions/AnyQuestion/anyOf/9"
957
+ "$ref": "#/definitions/AnyQuestion/anyOf/11"
958
+ },
959
+ {
960
+ "$ref": "#/definitions/AnyQuestion/anyOf/12"
571
961
  },
572
962
  {
573
963
  "type": "object",
@@ -599,6 +989,9 @@
599
989
  },
600
990
  "rows": {
601
991
  "type": "number"
992
+ },
993
+ "asRichText": {
994
+ "type": "boolean"
602
995
  }
603
996
  },
604
997
  "additionalProperties": false
@@ -609,8 +1002,17 @@
609
1002
  "schemaVersion": {
610
1003
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
611
1004
  },
612
- "asRichText": {
613
- "type": "boolean"
1005
+ "title": {
1006
+ "type": "string",
1007
+ "const": "Text Area"
1008
+ },
1009
+ "usageDescription": {
1010
+ "type": "string",
1011
+ "const": "For questions that require longer answers, you can select formatting options too."
1012
+ },
1013
+ "defaultJSON": {
1014
+ "type": "string",
1015
+ "const": "{\"type\":\"textArea\",\"attributes\":{\"cols\":20,\"rows\":2,\"asRichText\":true},\"meta\":{\"schemaVersion\":\"1.0\"}}"
614
1016
  }
615
1017
  },
616
1018
  "required": [
@@ -620,8 +1022,7 @@
620
1022
  }
621
1023
  },
622
1024
  "required": [
623
- "type",
624
- "meta"
1025
+ "type"
625
1026
  ],
626
1027
  "additionalProperties": false
627
1028
  },
@@ -645,19 +1046,40 @@
645
1046
  "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/attributes/properties/labelTranslationKey"
646
1047
  },
647
1048
  "maxLength": {
648
- "$ref": "#/definitions/AnyQuestion/anyOf/5/properties/attributes/properties/maxLength"
1049
+ "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/attributes/properties/maxLength"
649
1050
  },
650
1051
  "minLength": {
651
- "$ref": "#/definitions/AnyQuestion/anyOf/5/properties/attributes/properties/minLength"
1052
+ "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/attributes/properties/minLength"
652
1053
  },
653
1054
  "pattern": {
654
- "$ref": "#/definitions/AnyQuestion/anyOf/5/properties/attributes/properties/pattern"
1055
+ "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/attributes/properties/pattern"
655
1056
  }
656
1057
  },
657
1058
  "additionalProperties": false
658
1059
  },
659
1060
  "meta": {
660
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
1061
+ "type": "object",
1062
+ "properties": {
1063
+ "schemaVersion": {
1064
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
1065
+ },
1066
+ "title": {
1067
+ "type": "string",
1068
+ "const": "Text Field"
1069
+ },
1070
+ "usageDescription": {
1071
+ "type": "string",
1072
+ "const": "For questions that require short, simple answers."
1073
+ },
1074
+ "defaultJSON": {
1075
+ "type": "string",
1076
+ "const": "{\"type\":\"text\",\"attributes\":{\"maxLength\":255},\"meta\":{\"schemaVersion\":\"1.0\"}}"
1077
+ }
1078
+ },
1079
+ "required": [
1080
+ "schemaVersion"
1081
+ ],
1082
+ "additionalProperties": false
661
1083
  }
662
1084
  },
663
1085
  "required": [
@@ -665,29 +1087,6 @@
665
1087
  ],
666
1088
  "additionalProperties": false
667
1089
  },
668
- {
669
- "type": "object",
670
- "properties": {
671
- "type": {
672
- "type": "string",
673
- "const": "typeaheadSearch"
674
- },
675
- "attributes": {
676
- "$ref": "#/definitions/AnyQuestion/anyOf/1/properties/attributes"
677
- },
678
- "meta": {
679
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
680
- },
681
- "graphQL": {
682
- "$ref": "#/definitions/AnyQuestion/anyOf/6/properties/graphQL"
683
- }
684
- },
685
- "required": [
686
- "type",
687
- "graphQL"
688
- ],
689
- "additionalProperties": false
690
- },
691
1090
  {
692
1091
  "type": "object",
693
1092
  "properties": {
@@ -696,10 +1095,31 @@
696
1095
  "const": "url"
697
1096
  },
698
1097
  "attributes": {
699
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/11/properties/attributes"
1098
+ "$ref": "#/definitions/AnyQuestion/anyOf/13/properties/columns/items/properties/content/anyOf/12/properties/attributes"
700
1099
  },
701
1100
  "meta": {
702
- "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta"
1101
+ "type": "object",
1102
+ "properties": {
1103
+ "schemaVersion": {
1104
+ "$ref": "#/definitions/AnyQuestion/anyOf/0/properties/meta/properties/schemaVersion"
1105
+ },
1106
+ "title": {
1107
+ "type": "string",
1108
+ "const": "URL Field"
1109
+ },
1110
+ "usageDescription": {
1111
+ "type": "string",
1112
+ "const": "For questions that require a website, DOI or other URL."
1113
+ },
1114
+ "defaultJSON": {
1115
+ "type": "string",
1116
+ "const": "{\"type\":\"url\",\"attributes\":{\"maxLength\":255},\"meta\":{\"schemaVersion\":\"1.0\"}}"
1117
+ }
1118
+ },
1119
+ "required": [
1120
+ "schemaVersion"
1121
+ ],
1122
+ "additionalProperties": false
703
1123
  }
704
1124
  },
705
1125
  "required": [
@@ -724,16 +1144,13 @@
724
1144
  "additionalProperties": false
725
1145
  },
726
1146
  {
727
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/10"
728
- },
729
- {
730
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/11"
1147
+ "$ref": "#/definitions/AnyQuestion/anyOf/13/properties/columns/items/properties/content/anyOf/11"
731
1148
  },
732
1149
  {
733
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/12"
1150
+ "$ref": "#/definitions/AnyQuestion/anyOf/13/properties/columns/items/properties/content/anyOf/12"
734
1151
  },
735
1152
  {
736
- "$ref": "#/definitions/AnyQuestion/anyOf/10/properties/columns/items/properties/content/anyOf/13"
1153
+ "$ref": "#/definitions/AnyQuestion/anyOf/13/properties/columns/items/properties/content/anyOf/13"
737
1154
  }
738
1155
  ]
739
1156
  }