@dmptool/types 1.2.6 → 2.0.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 (97) hide show
  1. package/README.md +1 -1
  2. package/dist/answers/__tests__/defaults.spec.js +216 -0
  3. package/dist/answers/answer.d.ts +29 -14
  4. package/dist/answers/answer.js +11 -5
  5. package/dist/answers/dateAnswers.d.ts +20 -47
  6. package/dist/answers/dateAnswers.js +20 -10
  7. package/dist/answers/graphQLAnswers.d.ts +48 -120
  8. package/dist/answers/graphQLAnswers.js +46 -21
  9. package/dist/answers/index.d.ts +155 -1439
  10. package/dist/answers/index.js +26 -1
  11. package/dist/answers/numberAnswers.d.ts +38 -92
  12. package/dist/answers/numberAnswers.js +38 -19
  13. package/dist/answers/optionBasedAnswers.d.ts +42 -87
  14. package/dist/answers/optionBasedAnswers.js +37 -21
  15. package/dist/answers/tableAnswers.d.ts +348 -3032
  16. package/dist/answers/tableAnswers.js +25 -61
  17. package/dist/answers/textAnswers.d.ts +32 -68
  18. package/dist/answers/textAnswers.js +30 -17
  19. package/dist/questions/__tests__/dateQuestions.spec.js +3 -0
  20. package/dist/questions/__tests__/defaults.spec.d.ts +1 -0
  21. package/dist/questions/__tests__/defaults.spec.js +668 -0
  22. package/dist/questions/__tests__/optionBasedQuestions.spec.js +3 -2
  23. package/dist/questions/__tests__/tableQuestion.spec.js +22 -23
  24. package/dist/questions/__tests__/textQuestions.spec.js +32 -0
  25. package/dist/questions/dateQuestions.d.ts +45 -191
  26. package/dist/questions/dateQuestions.js +26 -23
  27. package/dist/questions/graphQLQuestions.d.ts +262 -556
  28. package/dist/questions/graphQLQuestions.js +225 -223
  29. package/dist/questions/index.d.ts +689 -7440
  30. package/dist/questions/index.js +26 -1
  31. package/dist/questions/numberQuestions.d.ts +85 -331
  32. package/dist/questions/numberQuestions.js +50 -36
  33. package/dist/questions/optionBasedQuestions.d.ts +83 -290
  34. package/dist/questions/optionBasedQuestions.js +58 -41
  35. package/dist/questions/question.d.ts +72 -35
  36. package/dist/questions/question.js +14 -5
  37. package/dist/questions/tableQuestions.d.ts +1977 -9646
  38. package/dist/questions/tableQuestions.js +184 -192
  39. package/dist/questions/textQuestions.d.ts +70 -226
  40. package/dist/questions/textQuestions.js +31 -31
  41. package/package.json +4 -5
  42. package/dist/answers/__tests__/usage.spec.js +0 -178
  43. package/dist/questions/__tests__/usage.spec.d.ts +0 -8
  44. package/dist/questions/__tests__/usage.spec.js +0 -473
  45. package/dist/schemas/affiliationSearchAnswer.schema.json +0 -45
  46. package/dist/schemas/affiliationSearchQuestion.schema.json +0 -140
  47. package/dist/schemas/anyAnswer.schema.json +0 -605
  48. package/dist/schemas/anyQuestion.schema.json +0 -2455
  49. package/dist/schemas/anyTableColumnAnswer.schema.json +0 -466
  50. package/dist/schemas/anyTableColumnQuestion.schema.json +0 -1092
  51. package/dist/schemas/booleanAnswer.schema.json +0 -34
  52. package/dist/schemas/booleanQuestion.schema.json +0 -56
  53. package/dist/schemas/checkboxesAnswer.schema.json +0 -39
  54. package/dist/schemas/checkboxesQuestion.schema.json +0 -76
  55. package/dist/schemas/currencyAnswer.schema.json +0 -34
  56. package/dist/schemas/currencyQuestion.schema.json +0 -67
  57. package/dist/schemas/dateAnswer.schema.json +0 -34
  58. package/dist/schemas/datePickerAnswer.schema.json +0 -37
  59. package/dist/schemas/datePickerQuestion.schema.json +0 -52
  60. package/dist/schemas/dateQuestion.schema.json +0 -62
  61. package/dist/schemas/dateRangeAnswer.schema.json +0 -45
  62. package/dist/schemas/dateRangeQuestion.schema.json +0 -112
  63. package/dist/schemas/emailAnswer.schema.json +0 -34
  64. package/dist/schemas/emailQuestion.schema.json +0 -66
  65. package/dist/schemas/filteredSearchAnswer.schema.json +0 -40
  66. package/dist/schemas/filteredSearchQuestion.schema.json +0 -130
  67. package/dist/schemas/licenseSearchAnswer.schema.json +0 -49
  68. package/dist/schemas/licenseSearchQuestion.schema.json +0 -164
  69. package/dist/schemas/metadataStandardSearchAnswer.schema.json +0 -49
  70. package/dist/schemas/metadataStandardSearchQuestion.schema.json +0 -174
  71. package/dist/schemas/multiselectBoxAnswer.schema.json +0 -39
  72. package/dist/schemas/multiselectBoxQuestion.schema.json +0 -85
  73. package/dist/schemas/numberAnswer.schema.json +0 -34
  74. package/dist/schemas/numberQuestion.schema.json +0 -63
  75. package/dist/schemas/numberRangeAnswer.schema.json +0 -45
  76. package/dist/schemas/numberRangeQuestion.schema.json +0 -94
  77. package/dist/schemas/numberWithContextAnswer.schema.json +0 -45
  78. package/dist/schemas/numberWithContextQuestion.schema.json +0 -84
  79. package/dist/schemas/radioButtonsAnswer.schema.json +0 -34
  80. package/dist/schemas/radioButtonsQuestion.schema.json +0 -76
  81. package/dist/schemas/repositorySearchAnswer.schema.json +0 -49
  82. package/dist/schemas/repositorySearchQuestion.schema.json +0 -180
  83. package/dist/schemas/researchOutputTableAnswer.schema.json +0 -519
  84. package/dist/schemas/researchOutputTableQuestion.schema.json +0 -1183
  85. package/dist/schemas/selectBoxAnswer.schema.json +0 -34
  86. package/dist/schemas/selectBoxQuestion.schema.json +0 -85
  87. package/dist/schemas/tableAnswer.schema.json +0 -519
  88. package/dist/schemas/tableQuestion.schema.json +0 -1183
  89. package/dist/schemas/textAnswer.schema.json +0 -34
  90. package/dist/schemas/textAreaAnswer.schema.json +0 -34
  91. package/dist/schemas/textAreaQuestion.schema.json +0 -70
  92. package/dist/schemas/textQuestion.schema.json +0 -62
  93. package/dist/schemas/typeaheadSearchAnswer.schema.json +0 -37
  94. package/dist/schemas/typeaheadSearchQuestion.schema.json +0 -120
  95. package/dist/schemas/urlAnswer.schema.json +0 -34
  96. package/dist/schemas/urlQuestion.schema.json +0 -62
  97. /package/dist/answers/__tests__/{usage.spec.d.ts → defaults.spec.d.ts} +0 -0
@@ -1,34 +0,0 @@
1
- {
2
- "$ref": "#/definitions/SelectBoxAnswer",
3
- "definitions": {
4
- "SelectBoxAnswer": {
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "selectBox"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "answer": {
23
- "type": "string",
24
- "default": ""
25
- }
26
- },
27
- "required": [
28
- "type"
29
- ],
30
- "additionalProperties": false
31
- }
32
- },
33
- "$schema": "http://json-schema.org/draft-07/schema#"
34
- }
@@ -1,85 +0,0 @@
1
- {
2
- "$ref": "#/definitions/SelectBoxQuestion",
3
- "definitions": {
4
- "SelectBoxQuestion": {
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "selectBox"
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": false
26
- }
27
- },
28
- "required": [
29
- "multiple"
30
- ],
31
- "additionalProperties": false,
32
- "default": {
33
- "multiple": false
34
- }
35
- },
36
- "meta": {
37
- "type": "object",
38
- "properties": {
39
- "schemaVersion": {
40
- "type": "string",
41
- "default": "1.0"
42
- },
43
- "title": {
44
- "type": "string"
45
- },
46
- "usageDescription": {
47
- "type": "string"
48
- }
49
- },
50
- "additionalProperties": false,
51
- "default": {}
52
- },
53
- "options": {
54
- "type": "array",
55
- "items": {
56
- "type": "object",
57
- "properties": {
58
- "label": {
59
- "type": "string",
60
- "default": "Option A"
61
- },
62
- "value": {
63
- "type": "string",
64
- "default": "a"
65
- },
66
- "selected": {
67
- "type": "boolean",
68
- "default": false
69
- }
70
- },
71
- "additionalProperties": false
72
- },
73
- "default": [
74
- {}
75
- ]
76
- }
77
- },
78
- "required": [
79
- "type"
80
- ],
81
- "additionalProperties": false
82
- }
83
- },
84
- "$schema": "http://json-schema.org/draft-07/schema#"
85
- }
@@ -1,519 +0,0 @@
1
- {
2
- "$ref": "#/definitions/TableAnswer",
3
- "definitions": {
4
- "TableAnswer": {
5
- "type": "object",
6
- "properties": {
7
- "type": {
8
- "type": "string",
9
- "const": "table"
10
- },
11
- "meta": {
12
- "type": "object",
13
- "properties": {
14
- "schemaVersion": {
15
- "type": "string",
16
- "default": "1.0"
17
- }
18
- },
19
- "additionalProperties": false,
20
- "default": {}
21
- },
22
- "columnHeadings": {
23
- "type": "array",
24
- "items": {
25
- "type": "string"
26
- },
27
- "default": [
28
- "Column A"
29
- ]
30
- },
31
- "answer": {
32
- "type": "array",
33
- "items": {
34
- "type": "object",
35
- "properties": {
36
- "columns": {
37
- "type": "array",
38
- "items": {
39
- "anyOf": [
40
- {
41
- "type": "object",
42
- "properties": {
43
- "type": {
44
- "type": "string",
45
- "const": "affiliationSearch"
46
- },
47
- "meta": {
48
- "$ref": "#/definitions/TableAnswer/properties/meta"
49
- },
50
- "answer": {
51
- "type": "object",
52
- "properties": {
53
- "affiliationId": {
54
- "type": "string",
55
- "default": ""
56
- },
57
- "affiliationName": {
58
- "type": "string",
59
- "default": ""
60
- }
61
- },
62
- "additionalProperties": false,
63
- "default": {}
64
- }
65
- },
66
- "required": [
67
- "type"
68
- ],
69
- "additionalProperties": false
70
- },
71
- {
72
- "type": "object",
73
- "properties": {
74
- "type": {
75
- "type": "string",
76
- "const": "boolean"
77
- },
78
- "meta": {
79
- "$ref": "#/definitions/TableAnswer/properties/meta"
80
- },
81
- "answer": {
82
- "type": "boolean",
83
- "default": false
84
- }
85
- },
86
- "required": [
87
- "type"
88
- ],
89
- "additionalProperties": false
90
- },
91
- {
92
- "type": "object",
93
- "properties": {
94
- "type": {
95
- "type": "string",
96
- "const": "checkBoxes"
97
- },
98
- "meta": {
99
- "$ref": "#/definitions/TableAnswer/properties/meta"
100
- },
101
- "answer": {
102
- "type": "array",
103
- "items": {
104
- "type": "string"
105
- },
106
- "default": [
107
- ""
108
- ]
109
- }
110
- },
111
- "required": [
112
- "type"
113
- ],
114
- "additionalProperties": false
115
- },
116
- {
117
- "type": "object",
118
- "properties": {
119
- "type": {
120
- "type": "string",
121
- "const": "currency"
122
- },
123
- "meta": {
124
- "$ref": "#/definitions/TableAnswer/properties/meta"
125
- },
126
- "answer": {
127
- "type": "number",
128
- "default": 0
129
- }
130
- },
131
- "required": [
132
- "type"
133
- ],
134
- "additionalProperties": false
135
- },
136
- {
137
- "type": "object",
138
- "properties": {
139
- "type": {
140
- "type": "string",
141
- "const": "date"
142
- },
143
- "meta": {
144
- "$ref": "#/definitions/TableAnswer/properties/meta"
145
- },
146
- "answer": {
147
- "type": "string",
148
- "default": ""
149
- }
150
- },
151
- "required": [
152
- "type"
153
- ],
154
- "additionalProperties": false
155
- },
156
- {
157
- "type": "object",
158
- "properties": {
159
- "type": {
160
- "type": "string",
161
- "const": "dateRange"
162
- },
163
- "meta": {
164
- "$ref": "#/definitions/TableAnswer/properties/meta"
165
- },
166
- "answer": {
167
- "type": "object",
168
- "properties": {
169
- "start": {
170
- "type": "string",
171
- "default": ""
172
- },
173
- "end": {
174
- "type": "string",
175
- "default": ""
176
- }
177
- },
178
- "additionalProperties": false,
179
- "default": {}
180
- }
181
- },
182
- "required": [
183
- "type"
184
- ],
185
- "additionalProperties": false
186
- },
187
- {
188
- "type": "object",
189
- "properties": {
190
- "type": {
191
- "type": "string",
192
- "const": "email"
193
- },
194
- "meta": {
195
- "$ref": "#/definitions/TableAnswer/properties/meta"
196
- },
197
- "answer": {
198
- "type": "string",
199
- "default": ""
200
- }
201
- },
202
- "required": [
203
- "type"
204
- ],
205
- "additionalProperties": false
206
- },
207
- {
208
- "type": "object",
209
- "properties": {
210
- "type": {
211
- "type": "string",
212
- "const": "licenseSearch"
213
- },
214
- "meta": {
215
- "$ref": "#/definitions/TableAnswer/properties/meta"
216
- },
217
- "answer": {
218
- "type": "array",
219
- "items": {
220
- "type": "object",
221
- "properties": {
222
- "licenseId": {
223
- "type": "string",
224
- "default": ""
225
- },
226
- "licenseName": {
227
- "type": "string",
228
- "default": ""
229
- }
230
- },
231
- "additionalProperties": false,
232
- "default": {}
233
- },
234
- "default": []
235
- }
236
- },
237
- "required": [
238
- "type"
239
- ],
240
- "additionalProperties": false
241
- },
242
- {
243
- "type": "object",
244
- "properties": {
245
- "type": {
246
- "type": "string",
247
- "const": "metadataStandardSearch"
248
- },
249
- "meta": {
250
- "$ref": "#/definitions/TableAnswer/properties/meta"
251
- },
252
- "answer": {
253
- "type": "array",
254
- "items": {
255
- "type": "object",
256
- "properties": {
257
- "metadataStandardId": {
258
- "type": "string",
259
- "default": ""
260
- },
261
- "metadataStandardName": {
262
- "type": "string",
263
- "default": ""
264
- }
265
- },
266
- "additionalProperties": false,
267
- "default": {}
268
- },
269
- "default": []
270
- }
271
- },
272
- "required": [
273
- "type"
274
- ],
275
- "additionalProperties": false
276
- },
277
- {
278
- "type": "object",
279
- "properties": {
280
- "type": {
281
- "type": "string",
282
- "const": "multiselectBox"
283
- },
284
- "meta": {
285
- "$ref": "#/definitions/TableAnswer/properties/meta"
286
- },
287
- "answer": {
288
- "type": "array",
289
- "items": {
290
- "type": "string"
291
- },
292
- "default": [
293
- ""
294
- ]
295
- }
296
- },
297
- "required": [
298
- "type"
299
- ],
300
- "additionalProperties": false
301
- },
302
- {
303
- "type": "object",
304
- "properties": {
305
- "type": {
306
- "type": "string",
307
- "const": "number"
308
- },
309
- "meta": {
310
- "$ref": "#/definitions/TableAnswer/properties/meta"
311
- },
312
- "answer": {
313
- "type": "number",
314
- "default": 0
315
- }
316
- },
317
- "required": [
318
- "type"
319
- ],
320
- "additionalProperties": false
321
- },
322
- {
323
- "type": "object",
324
- "properties": {
325
- "type": {
326
- "type": "string",
327
- "const": "numberWithContext"
328
- },
329
- "meta": {
330
- "$ref": "#/definitions/TableAnswer/properties/meta"
331
- },
332
- "answer": {
333
- "type": "object",
334
- "properties": {
335
- "value": {
336
- "type": "number",
337
- "default": 0
338
- },
339
- "context": {
340
- "type": "string",
341
- "default": ""
342
- }
343
- },
344
- "additionalProperties": false
345
- }
346
- },
347
- "required": [
348
- "type",
349
- "answer"
350
- ],
351
- "additionalProperties": false
352
- },
353
- {
354
- "type": "object",
355
- "properties": {
356
- "type": {
357
- "type": "string",
358
- "const": "radioButtons"
359
- },
360
- "meta": {
361
- "$ref": "#/definitions/TableAnswer/properties/meta"
362
- },
363
- "answer": {
364
- "type": "string",
365
- "default": ""
366
- }
367
- },
368
- "required": [
369
- "type"
370
- ],
371
- "additionalProperties": false
372
- },
373
- {
374
- "type": "object",
375
- "properties": {
376
- "type": {
377
- "type": "string",
378
- "const": "repositorySearch"
379
- },
380
- "meta": {
381
- "$ref": "#/definitions/TableAnswer/properties/meta"
382
- },
383
- "answer": {
384
- "type": "array",
385
- "items": {
386
- "type": "object",
387
- "properties": {
388
- "repositoryId": {
389
- "type": "string",
390
- "default": ""
391
- },
392
- "repositoryName": {
393
- "type": "string",
394
- "default": ""
395
- }
396
- },
397
- "additionalProperties": false,
398
- "default": {}
399
- },
400
- "default": []
401
- }
402
- },
403
- "required": [
404
- "type"
405
- ],
406
- "additionalProperties": false
407
- },
408
- {
409
- "type": "object",
410
- "properties": {
411
- "type": {
412
- "type": "string",
413
- "const": "selectBox"
414
- },
415
- "meta": {
416
- "$ref": "#/definitions/TableAnswer/properties/meta"
417
- },
418
- "answer": {
419
- "type": "string",
420
- "default": ""
421
- }
422
- },
423
- "required": [
424
- "type"
425
- ],
426
- "additionalProperties": false
427
- },
428
- {
429
- "type": "object",
430
- "properties": {
431
- "type": {
432
- "type": "string",
433
- "const": "text"
434
- },
435
- "meta": {
436
- "$ref": "#/definitions/TableAnswer/properties/meta"
437
- },
438
- "answer": {
439
- "type": "string",
440
- "default": ""
441
- }
442
- },
443
- "required": [
444
- "type"
445
- ],
446
- "additionalProperties": false
447
- },
448
- {
449
- "type": "object",
450
- "properties": {
451
- "type": {
452
- "type": "string",
453
- "const": "textArea"
454
- },
455
- "meta": {
456
- "$ref": "#/definitions/TableAnswer/properties/meta"
457
- },
458
- "answer": {
459
- "type": "string",
460
- "default": ""
461
- }
462
- },
463
- "required": [
464
- "type"
465
- ],
466
- "additionalProperties": false
467
- },
468
- {
469
- "type": "object",
470
- "properties": {
471
- "type": {
472
- "type": "string",
473
- "const": "url"
474
- },
475
- "meta": {
476
- "$ref": "#/definitions/TableAnswer/properties/meta"
477
- },
478
- "answer": {
479
- "type": "string",
480
- "default": ""
481
- }
482
- },
483
- "required": [
484
- "type"
485
- ],
486
- "additionalProperties": false
487
- }
488
- ]
489
- }
490
- }
491
- },
492
- "required": [
493
- "columns"
494
- ],
495
- "additionalProperties": false
496
- },
497
- "default": [
498
- {
499
- "columns": [
500
- {
501
- "type": "textArea",
502
- "answer": "",
503
- "meta": {
504
- "schemaVersion": "1.0"
505
- }
506
- }
507
- ]
508
- }
509
- ]
510
- }
511
- },
512
- "required": [
513
- "type"
514
- ],
515
- "additionalProperties": false
516
- }
517
- },
518
- "$schema": "http://json-schema.org/draft-07/schema#"
519
- }