@dmptool/types 1.0.0 → 1.0.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 (62) hide show
  1. package/README.md +127 -29
  2. package/dist/answers/__tests__/answers.spec.d.ts +1 -0
  3. package/dist/answers/__tests__/answers.spec.js +127 -0
  4. package/dist/answers/answer.d.ts +25 -0
  5. package/dist/answers/answer.js +13 -0
  6. package/dist/answers/dateAnswers.d.ts +66 -0
  7. package/dist/answers/dateAnswers.js +16 -0
  8. package/dist/answers/graphQLAnswers.d.ts +51 -0
  9. package/dist/answers/graphQLAnswers.js +14 -0
  10. package/dist/answers/index.d.ts +880 -0
  11. package/dist/answers/index.js +48 -0
  12. package/dist/answers/optionBasedAnswers.d.ts +76 -0
  13. package/dist/answers/optionBasedAnswers.js +18 -0
  14. package/dist/answers/primitiveAnswers.d.ts +176 -0
  15. package/dist/answers/primitiveAnswers.js +34 -0
  16. package/dist/answers/tableAnswers.d.ts +876 -0
  17. package/dist/answers/tableAnswers.js +31 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.js +19 -0
  20. package/dist/questions/__tests__/dateQuestions.spec.d.ts +1 -0
  21. package/dist/questions/__tests__/dateQuestions.spec.js +149 -0
  22. package/dist/questions/__tests__/graphQLQuestions.spec.d.ts +1 -0
  23. package/dist/questions/__tests__/graphQLQuestions.spec.js +87 -0
  24. package/dist/questions/__tests__/optionBasedQuestions.spec.d.ts +1 -0
  25. package/dist/questions/__tests__/optionBasedQuestions.spec.js +152 -0
  26. package/dist/questions/__tests__/primitiveQuestions.spec.d.ts +1 -0
  27. package/dist/questions/__tests__/primitiveQuestions.spec.js +189 -0
  28. package/dist/{dateQuestions.js → questions/dateQuestions.js} +3 -3
  29. package/dist/{graphQLQuestions.js → questions/graphQLQuestions.js} +3 -3
  30. package/dist/{tableQuestions.d.ts → questions/index.d.ts} +97 -1650
  31. package/dist/questions/index.js +48 -0
  32. package/dist/{optionBasedQuestions.js → questions/optionBasedQuestions.js} +4 -4
  33. package/dist/{primitiveQuestions.d.ts → questions/primitiveQuestions.d.ts} +0 -27
  34. package/dist/{primitiveQuestions.js → questions/primitiveQuestions.js} +8 -35
  35. package/dist/questions/question.d.ts +29 -0
  36. package/dist/questions/question.js +32 -0
  37. package/dist/questions/tableQuestions.d.ts +2638 -0
  38. package/dist/{tableQuestions.js → questions/tableQuestions.js} +5 -22
  39. package/dist/schemas/anyAnswer.schema.json +195 -59
  40. package/dist/schemas/anyTableColumnAnswer.schema.json +336 -0
  41. package/dist/schemas/anyTableColumnQuestion.schema.json +637 -0
  42. package/dist/schemas/booleanAnswer.schema.json +15 -1
  43. package/dist/schemas/checkboxesAnswer.schema.json +15 -1
  44. package/dist/schemas/currencyAnswer.schema.json +15 -1
  45. package/dist/schemas/datePickerAnswer.schema.json +15 -1
  46. package/dist/schemas/dateRangeAnswer.schema.json +15 -1
  47. package/dist/schemas/emailAnswer.schema.json +15 -1
  48. package/dist/schemas/filteredSearchAnswer.schema.json +15 -1
  49. package/dist/schemas/numberAnswer.schema.json +15 -1
  50. package/dist/schemas/radioButtonsAnswer.schema.json +15 -1
  51. package/dist/schemas/selectBoxAnswer.schema.json +19 -2
  52. package/dist/schemas/tableAnswer.schema.json +91 -18
  53. package/dist/schemas/textAnswer.schema.json +15 -1
  54. package/dist/schemas/textAreaAnswer.schema.json +15 -1
  55. package/dist/schemas/typeaheadSearchAnswer.schema.json +15 -1
  56. package/dist/schemas/urlAnswer.schema.json +15 -1
  57. package/package.json +8 -1
  58. package/dist/answers.d.ts +0 -558
  59. package/dist/answers.js +0 -87
  60. /package/dist/{dateQuestions.d.ts → questions/dateQuestions.d.ts} +0 -0
  61. /package/dist/{graphQLQuestions.d.ts → questions/graphQLQuestions.d.ts} +0 -0
  62. /package/dist/{optionBasedQuestions.d.ts → questions/optionBasedQuestions.d.ts} +0 -0
@@ -0,0 +1,637 @@
1
+ {
2
+ "$ref": "#/definitions/AnyTableColumnQuestion",
3
+ "definitions": {
4
+ "AnyTableColumnQuestion": {
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "properties": {
9
+ "type": {
10
+ "type": "string",
11
+ "const": "boolean"
12
+ },
13
+ "meta": {
14
+ "type": "object",
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "type": "string",
18
+ "const": "1.0"
19
+ },
20
+ "labelTranslationKey": {
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": [
25
+ "schemaVersion"
26
+ ],
27
+ "additionalProperties": false
28
+ },
29
+ "attributes": {
30
+ "type": "object",
31
+ "properties": {
32
+ "checked": {
33
+ "type": "boolean"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "required": [
40
+ "type",
41
+ "meta",
42
+ "attributes"
43
+ ],
44
+ "additionalProperties": false
45
+ },
46
+ {
47
+ "type": "object",
48
+ "properties": {
49
+ "type": {
50
+ "type": "string",
51
+ "const": "checkBoxes"
52
+ },
53
+ "meta": {
54
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
55
+ },
56
+ "options": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "type": {
62
+ "type": "string",
63
+ "const": "option"
64
+ },
65
+ "attributes": {
66
+ "type": "object",
67
+ "properties": {
68
+ "label": {
69
+ "type": "string"
70
+ },
71
+ "value": {
72
+ "type": "string"
73
+ },
74
+ "checked": {
75
+ "type": "boolean"
76
+ }
77
+ },
78
+ "required": [
79
+ "label",
80
+ "value"
81
+ ],
82
+ "additionalProperties": false
83
+ }
84
+ },
85
+ "required": [
86
+ "type",
87
+ "attributes"
88
+ ],
89
+ "additionalProperties": false
90
+ }
91
+ }
92
+ },
93
+ "required": [
94
+ "type",
95
+ "meta",
96
+ "options"
97
+ ],
98
+ "additionalProperties": false
99
+ },
100
+ {
101
+ "type": "object",
102
+ "properties": {
103
+ "type": {
104
+ "type": "string",
105
+ "const": "currency"
106
+ },
107
+ "meta": {
108
+ "type": "object",
109
+ "properties": {
110
+ "denomination": {
111
+ "type": "string"
112
+ }
113
+ },
114
+ "additionalProperties": false
115
+ },
116
+ "attributes": {
117
+ "type": "object",
118
+ "properties": {
119
+ "max": {
120
+ "type": "number"
121
+ },
122
+ "min": {
123
+ "type": "number"
124
+ },
125
+ "step": {
126
+ "type": "number"
127
+ }
128
+ },
129
+ "additionalProperties": false
130
+ }
131
+ },
132
+ "required": [
133
+ "type",
134
+ "meta",
135
+ "attributes"
136
+ ],
137
+ "additionalProperties": false
138
+ },
139
+ {
140
+ "type": "object",
141
+ "properties": {
142
+ "type": {
143
+ "type": "string",
144
+ "const": "datePicker"
145
+ },
146
+ "meta": {
147
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
148
+ },
149
+ "attributes": {
150
+ "type": "object",
151
+ "properties": {
152
+ "max": {
153
+ "type": "string"
154
+ },
155
+ "min": {
156
+ "type": "string"
157
+ },
158
+ "step": {
159
+ "type": "number"
160
+ }
161
+ },
162
+ "additionalProperties": false
163
+ }
164
+ },
165
+ "required": [
166
+ "type",
167
+ "meta",
168
+ "attributes"
169
+ ],
170
+ "additionalProperties": false
171
+ },
172
+ {
173
+ "type": "object",
174
+ "properties": {
175
+ "type": {
176
+ "type": "string",
177
+ "const": "dateRange"
178
+ },
179
+ "meta": {
180
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
181
+ },
182
+ "columns": {
183
+ "type": "object",
184
+ "properties": {
185
+ "start": {
186
+ "type": "object",
187
+ "properties": {
188
+ "type": {
189
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/3/properties/type"
190
+ },
191
+ "meta": {
192
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
193
+ },
194
+ "attributes": {
195
+ "type": "object",
196
+ "properties": {
197
+ "label": {
198
+ "type": "string"
199
+ }
200
+ },
201
+ "required": [
202
+ "label"
203
+ ],
204
+ "additionalProperties": false
205
+ }
206
+ },
207
+ "required": [
208
+ "type",
209
+ "meta",
210
+ "attributes"
211
+ ],
212
+ "additionalProperties": false
213
+ },
214
+ "end": {
215
+ "type": "object",
216
+ "properties": {
217
+ "type": {
218
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/3/properties/type"
219
+ },
220
+ "meta": {
221
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
222
+ },
223
+ "attributes": {
224
+ "type": "object",
225
+ "properties": {
226
+ "label": {
227
+ "type": "string"
228
+ }
229
+ },
230
+ "required": [
231
+ "label"
232
+ ],
233
+ "additionalProperties": false
234
+ }
235
+ },
236
+ "required": [
237
+ "type",
238
+ "meta",
239
+ "attributes"
240
+ ],
241
+ "additionalProperties": false
242
+ }
243
+ },
244
+ "required": [
245
+ "start",
246
+ "end"
247
+ ],
248
+ "additionalProperties": false
249
+ }
250
+ },
251
+ "required": [
252
+ "type",
253
+ "meta",
254
+ "columns"
255
+ ],
256
+ "additionalProperties": false
257
+ },
258
+ {
259
+ "type": "object",
260
+ "properties": {
261
+ "type": {
262
+ "type": "string",
263
+ "const": "email"
264
+ },
265
+ "meta": {
266
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
267
+ },
268
+ "attributes": {
269
+ "type": "object",
270
+ "properties": {
271
+ "maxLength": {
272
+ "type": "number"
273
+ },
274
+ "minLength": {
275
+ "type": "number"
276
+ },
277
+ "multiple": {
278
+ "type": "boolean"
279
+ },
280
+ "pattern": {
281
+ "type": "string"
282
+ }
283
+ },
284
+ "additionalProperties": false
285
+ }
286
+ },
287
+ "required": [
288
+ "type",
289
+ "meta",
290
+ "attributes"
291
+ ],
292
+ "additionalProperties": false
293
+ },
294
+ {
295
+ "type": "object",
296
+ "properties": {
297
+ "type": {
298
+ "type": "string",
299
+ "const": "filteredSearch"
300
+ },
301
+ "meta": {
302
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
303
+ },
304
+ "graphQL": {
305
+ "type": "object",
306
+ "properties": {
307
+ "displayFields": {
308
+ "type": "array",
309
+ "items": {
310
+ "type": "object",
311
+ "properties": {
312
+ "propertyName": {
313
+ "type": "string"
314
+ },
315
+ "label": {
316
+ "type": "string"
317
+ },
318
+ "labelTranslationKey": {
319
+ "type": "string"
320
+ }
321
+ },
322
+ "required": [
323
+ "propertyName",
324
+ "label"
325
+ ],
326
+ "additionalProperties": false
327
+ }
328
+ },
329
+ "localQueryId": {
330
+ "type": "string"
331
+ },
332
+ "query": {
333
+ "type": "string"
334
+ },
335
+ "responseField": {
336
+ "type": "string"
337
+ },
338
+ "variables": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "object",
342
+ "properties": {
343
+ "minLength": {
344
+ "type": "number"
345
+ },
346
+ "label": {
347
+ "type": "string"
348
+ },
349
+ "labelTranslationKey": {
350
+ "type": "string"
351
+ },
352
+ "name": {
353
+ "type": "string"
354
+ },
355
+ "type": {
356
+ "type": "string"
357
+ },
358
+ "defaultValue": {
359
+ "type": "string"
360
+ }
361
+ },
362
+ "required": [
363
+ "name",
364
+ "type"
365
+ ],
366
+ "additionalProperties": false
367
+ }
368
+ }
369
+ },
370
+ "required": [
371
+ "displayFields",
372
+ "responseField",
373
+ "variables"
374
+ ],
375
+ "additionalProperties": false
376
+ },
377
+ "attributes": {
378
+ "type": "object",
379
+ "properties": {
380
+ "multiple": {
381
+ "type": "boolean"
382
+ }
383
+ },
384
+ "additionalProperties": false
385
+ }
386
+ },
387
+ "required": [
388
+ "type",
389
+ "meta",
390
+ "graphQL",
391
+ "attributes"
392
+ ],
393
+ "additionalProperties": false
394
+ },
395
+ {
396
+ "type": "object",
397
+ "properties": {
398
+ "type": {
399
+ "type": "string",
400
+ "const": "number"
401
+ },
402
+ "meta": {
403
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
404
+ },
405
+ "attributes": {
406
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/2/properties/attributes"
407
+ }
408
+ },
409
+ "required": [
410
+ "type",
411
+ "meta",
412
+ "attributes"
413
+ ],
414
+ "additionalProperties": false
415
+ },
416
+ {
417
+ "type": "object",
418
+ "properties": {
419
+ "type": {
420
+ "type": "string",
421
+ "const": "radioButtons"
422
+ },
423
+ "meta": {
424
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
425
+ },
426
+ "options": {
427
+ "type": "array",
428
+ "items": {
429
+ "type": "object",
430
+ "properties": {
431
+ "type": {
432
+ "type": "string",
433
+ "const": "option"
434
+ },
435
+ "attributes": {
436
+ "type": "object",
437
+ "properties": {
438
+ "label": {
439
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/1/properties/options/items/properties/attributes/properties/label"
440
+ },
441
+ "value": {
442
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/1/properties/options/items/properties/attributes/properties/value"
443
+ },
444
+ "selected": {
445
+ "type": "boolean"
446
+ }
447
+ },
448
+ "required": [
449
+ "label",
450
+ "value"
451
+ ],
452
+ "additionalProperties": false
453
+ }
454
+ },
455
+ "required": [
456
+ "type",
457
+ "attributes"
458
+ ],
459
+ "additionalProperties": false
460
+ }
461
+ }
462
+ },
463
+ "required": [
464
+ "type",
465
+ "meta",
466
+ "options"
467
+ ],
468
+ "additionalProperties": false
469
+ },
470
+ {
471
+ "type": "object",
472
+ "properties": {
473
+ "type": {
474
+ "type": "string",
475
+ "const": "selectBox"
476
+ },
477
+ "meta": {
478
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
479
+ },
480
+ "options": {
481
+ "type": "array",
482
+ "items": {
483
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/8/properties/options/items"
484
+ }
485
+ },
486
+ "attributes": {
487
+ "type": "object",
488
+ "properties": {
489
+ "multiple": {
490
+ "type": "boolean"
491
+ }
492
+ },
493
+ "additionalProperties": false
494
+ }
495
+ },
496
+ "required": [
497
+ "type",
498
+ "meta",
499
+ "options",
500
+ "attributes"
501
+ ],
502
+ "additionalProperties": false
503
+ },
504
+ {
505
+ "type": "object",
506
+ "properties": {
507
+ "type": {
508
+ "type": "string",
509
+ "const": "textArea"
510
+ },
511
+ "meta": {
512
+ "type": "object",
513
+ "properties": {
514
+ "asRichText": {
515
+ "type": "boolean"
516
+ }
517
+ },
518
+ "additionalProperties": false
519
+ },
520
+ "attributes": {
521
+ "type": "object",
522
+ "properties": {
523
+ "cols": {
524
+ "type": "number"
525
+ },
526
+ "maxLength": {
527
+ "type": "number"
528
+ },
529
+ "minLength": {
530
+ "type": "number"
531
+ },
532
+ "rows": {
533
+ "type": "number"
534
+ }
535
+ },
536
+ "additionalProperties": false
537
+ }
538
+ },
539
+ "required": [
540
+ "type",
541
+ "meta",
542
+ "attributes"
543
+ ],
544
+ "additionalProperties": false
545
+ },
546
+ {
547
+ "type": "object",
548
+ "properties": {
549
+ "type": {
550
+ "type": "string",
551
+ "const": "text"
552
+ },
553
+ "meta": {
554
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
555
+ },
556
+ "attributes": {
557
+ "type": "object",
558
+ "properties": {
559
+ "maxLength": {
560
+ "type": "number"
561
+ },
562
+ "minLength": {
563
+ "type": "number"
564
+ },
565
+ "pattern": {
566
+ "type": "string"
567
+ }
568
+ },
569
+ "additionalProperties": false
570
+ }
571
+ },
572
+ "required": [
573
+ "type",
574
+ "meta",
575
+ "attributes"
576
+ ],
577
+ "additionalProperties": false
578
+ },
579
+ {
580
+ "type": "object",
581
+ "properties": {
582
+ "type": {
583
+ "type": "string",
584
+ "const": "typeaheadSearch"
585
+ },
586
+ "meta": {
587
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
588
+ },
589
+ "graphQL": {
590
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/6/properties/graphQL"
591
+ }
592
+ },
593
+ "required": [
594
+ "type",
595
+ "meta",
596
+ "graphQL"
597
+ ],
598
+ "additionalProperties": false
599
+ },
600
+ {
601
+ "type": "object",
602
+ "properties": {
603
+ "type": {
604
+ "type": "string",
605
+ "const": "url"
606
+ },
607
+ "meta": {
608
+ "$ref": "#/definitions/AnyTableColumnQuestion/anyOf/0/properties/meta"
609
+ },
610
+ "attributes": {
611
+ "type": "object",
612
+ "properties": {
613
+ "maxLength": {
614
+ "type": "number"
615
+ },
616
+ "minLength": {
617
+ "type": "number"
618
+ },
619
+ "pattern": {
620
+ "type": "string"
621
+ }
622
+ },
623
+ "additionalProperties": false
624
+ }
625
+ },
626
+ "required": [
627
+ "type",
628
+ "meta",
629
+ "attributes"
630
+ ],
631
+ "additionalProperties": false
632
+ }
633
+ ]
634
+ }
635
+ },
636
+ "$schema": "http://json-schema.org/draft-07/schema#"
637
+ }
@@ -10,11 +10,25 @@
10
10
  },
11
11
  "answer": {
12
12
  "type": "boolean"
13
+ },
14
+ "meta": {
15
+ "type": "object",
16
+ "properties": {
17
+ "schemaVersion": {
18
+ "type": "string",
19
+ "const": "1.0"
20
+ }
21
+ },
22
+ "required": [
23
+ "schemaVersion"
24
+ ],
25
+ "additionalProperties": false
13
26
  }
14
27
  },
15
28
  "required": [
16
29
  "type",
17
- "answer"
30
+ "answer",
31
+ "meta"
18
32
  ],
19
33
  "additionalProperties": false
20
34
  }
@@ -13,11 +13,25 @@
13
13
  "items": {
14
14
  "type": "string"
15
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
16
29
  }
17
30
  },
18
31
  "required": [
19
32
  "type",
20
- "answer"
33
+ "answer",
34
+ "meta"
21
35
  ],
22
36
  "additionalProperties": false
23
37
  }