@dmptool/types 1.0.5 → 1.0.7

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 (45) hide show
  1. package/README.md +5 -4
  2. package/dist/answers/__tests__/answers.spec.js +59 -7
  3. package/dist/answers/answer.d.ts +3 -3
  4. package/dist/answers/dateAnswers.d.ts +5 -5
  5. package/dist/answers/dateAnswers.js +3 -3
  6. package/dist/answers/index.d.ts +892 -513
  7. package/dist/answers/index.js +3 -2
  8. package/dist/answers/primitiveAnswers.d.ts +39 -0
  9. package/dist/answers/primitiveAnswers.js +8 -1
  10. package/dist/answers/tableAnswers.d.ts +1639 -32
  11. package/dist/answers/tableAnswers.js +10 -3
  12. package/dist/questions/__tests__/dateQuestions.spec.js +20 -20
  13. package/dist/questions/__tests__/primitiveQuestions.spec.js +92 -0
  14. package/dist/questions/__tests__/tableQuestion.spec.d.ts +1 -0
  15. package/dist/questions/__tests__/tableQuestion.spec.js +73 -0
  16. package/dist/questions/dateQuestions.d.ts +19 -19
  17. package/dist/questions/dateQuestions.js +8 -8
  18. package/dist/questions/graphQLQuestions.d.ts +20 -20
  19. package/dist/questions/graphQLQuestions.js +1 -1
  20. package/dist/questions/index.d.ts +1875 -1380
  21. package/dist/questions/index.js +3 -2
  22. package/dist/questions/optionBasedQuestions.js +1 -1
  23. package/dist/questions/primitiveQuestions.d.ts +214 -0
  24. package/dist/questions/primitiveQuestions.js +20 -3
  25. package/dist/questions/question.d.ts +4 -4
  26. package/dist/questions/question.js +2 -1
  27. package/dist/questions/tableQuestions.d.ts +2176 -145
  28. package/dist/questions/tableQuestions.js +7 -3
  29. package/dist/schemas/anyAnswer.schema.json +144 -119
  30. package/dist/schemas/anyQuestion.schema.json +161 -132
  31. package/dist/schemas/anyTableColumnAnswer.schema.json +1 -1
  32. package/dist/schemas/anyTableColumnQuestion.schema.json +20 -3
  33. package/dist/schemas/currencyQuestion.schema.json +10 -0
  34. package/dist/schemas/dateAnswer.schema.json +37 -0
  35. package/dist/schemas/datePickerAnswer.schema.json +4 -4
  36. package/dist/schemas/datePickerQuestion.schema.json +6 -5
  37. package/dist/schemas/dateQuestion.schema.json +51 -0
  38. package/dist/schemas/dateRangeQuestion.schema.json +1 -1
  39. package/dist/schemas/filteredSearchQuestion.schema.json +1 -2
  40. package/dist/schemas/numberRangeAnswer.schema.json +50 -0
  41. package/dist/schemas/numberRangeQuestion.schema.json +106 -0
  42. package/dist/schemas/tableAnswer.schema.json +349 -324
  43. package/dist/schemas/tableQuestion.schema.json +497 -468
  44. package/dist/schemas/textAreaQuestion.schema.json +10 -0
  45. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TableQuestionSchema = exports.AnyTableColumnQuestionSchema = void 0;
3
+ exports.TableQuestionSchema = exports.TableColumn = exports.AnyTableColumnQuestionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const primitiveQuestions_1 = require("./primitiveQuestions");
6
6
  const dateQuestions_1 = require("./dateQuestions");
@@ -12,7 +12,7 @@ exports.AnyTableColumnQuestionSchema = zod_1.z.discriminatedUnion('type', [
12
12
  primitiveQuestions_1.BooleanQuestionSchema,
13
13
  optionBasedQuestions_1.CheckboxesQuestionSchema,
14
14
  primitiveQuestions_1.CurrencyQuestionSchema,
15
- dateQuestions_1.DatePickerQuestionSchema,
15
+ dateQuestions_1.DateQuestionSchema,
16
16
  dateQuestions_1.DateRangeQuestionSchema,
17
17
  primitiveQuestions_1.EmailQuestionSchema,
18
18
  graphQLQuestions_1.FilteredSearchQuestionSchema,
@@ -24,10 +24,14 @@ exports.AnyTableColumnQuestionSchema = zod_1.z.discriminatedUnion('type', [
24
24
  graphQLQuestions_1.TypeaheadSearchQuestionSchema,
25
25
  primitiveQuestions_1.URLQuestionSchema
26
26
  ]);
27
+ exports.TableColumn = zod_1.z.object({
28
+ heading: zod_1.z.string().optional(), // The heading of the column
29
+ content: exports.AnyTableColumnQuestionSchema, // The question for the column
30
+ });
27
31
  // Table question and answer
28
32
  exports.TableQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
29
33
  type: zod_1.z.literal('table'), // The type of question
30
- columns: zod_1.z.array(exports.AnyTableColumnQuestionSchema), // The columns of the table (note: tables cannot be nested)
34
+ columns: zod_1.z.array(exports.TableColumn), // The columns of the table
31
35
  attributes: zod_1.z.object({
32
36
  canAddRows: zod_1.z.boolean().optional(), // Whether to allow adding rows (default is true)
33
37
  canRemoveRows: zod_1.z.boolean().optional(), // Whether to allow removing rows (default is true)
@@ -84,7 +84,7 @@
84
84
  "properties": {
85
85
  "type": {
86
86
  "type": "string",
87
- "const": "datePicker"
87
+ "const": "date"
88
88
  },
89
89
  "answer": {
90
90
  "type": "string"
@@ -255,122 +255,147 @@
255
255
  "answer": {
256
256
  "type": "array",
257
257
  "items": {
258
- "anyOf": [
259
- {
260
- "$ref": "#/definitions/AnyAnswer/anyOf/0"
261
- },
262
- {
263
- "$ref": "#/definitions/AnyAnswer/anyOf/1"
264
- },
265
- {
266
- "$ref": "#/definitions/AnyAnswer/anyOf/2"
267
- },
268
- {
269
- "$ref": "#/definitions/AnyAnswer/anyOf/3"
270
- },
271
- {
272
- "$ref": "#/definitions/AnyAnswer/anyOf/4"
273
- },
274
- {
275
- "$ref": "#/definitions/AnyAnswer/anyOf/5"
276
- },
277
- {
278
- "$ref": "#/definitions/AnyAnswer/anyOf/6"
279
- },
280
- {
281
- "$ref": "#/definitions/AnyAnswer/anyOf/7"
282
- },
283
- {
284
- "$ref": "#/definitions/AnyAnswer/anyOf/8"
285
- },
286
- {
287
- "$ref": "#/definitions/AnyAnswer/anyOf/9"
288
- },
289
- {
290
- "type": "object",
291
- "properties": {
292
- "type": {
293
- "type": "string",
294
- "const": "text"
258
+ "type": "object",
259
+ "properties": {
260
+ "columns": {
261
+ "type": "array",
262
+ "items": {
263
+ "type": "object",
264
+ "properties": {
265
+ "heading": {
266
+ "type": "string"
267
+ },
268
+ "content": {
269
+ "anyOf": [
270
+ {
271
+ "$ref": "#/definitions/AnyAnswer/anyOf/0"
272
+ },
273
+ {
274
+ "$ref": "#/definitions/AnyAnswer/anyOf/1"
275
+ },
276
+ {
277
+ "$ref": "#/definitions/AnyAnswer/anyOf/2"
278
+ },
279
+ {
280
+ "$ref": "#/definitions/AnyAnswer/anyOf/3"
281
+ },
282
+ {
283
+ "$ref": "#/definitions/AnyAnswer/anyOf/4"
284
+ },
285
+ {
286
+ "$ref": "#/definitions/AnyAnswer/anyOf/5"
287
+ },
288
+ {
289
+ "$ref": "#/definitions/AnyAnswer/anyOf/6"
290
+ },
291
+ {
292
+ "$ref": "#/definitions/AnyAnswer/anyOf/7"
293
+ },
294
+ {
295
+ "$ref": "#/definitions/AnyAnswer/anyOf/8"
296
+ },
297
+ {
298
+ "$ref": "#/definitions/AnyAnswer/anyOf/9"
299
+ },
300
+ {
301
+ "type": "object",
302
+ "properties": {
303
+ "type": {
304
+ "type": "string",
305
+ "const": "text"
306
+ },
307
+ "answer": {
308
+ "type": "string"
309
+ },
310
+ "meta": {
311
+ "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
312
+ }
313
+ },
314
+ "required": [
315
+ "type",
316
+ "answer",
317
+ "meta"
318
+ ],
319
+ "additionalProperties": false
320
+ },
321
+ {
322
+ "type": "object",
323
+ "properties": {
324
+ "type": {
325
+ "type": "string",
326
+ "const": "textArea"
327
+ },
328
+ "answer": {
329
+ "type": "string"
330
+ },
331
+ "meta": {
332
+ "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
333
+ }
334
+ },
335
+ "required": [
336
+ "type",
337
+ "answer",
338
+ "meta"
339
+ ],
340
+ "additionalProperties": false
341
+ },
342
+ {
343
+ "type": "object",
344
+ "properties": {
345
+ "type": {
346
+ "type": "string",
347
+ "const": "typeaheadSearch"
348
+ },
349
+ "answer": {
350
+ "type": "string"
351
+ },
352
+ "meta": {
353
+ "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
354
+ }
355
+ },
356
+ "required": [
357
+ "type",
358
+ "answer",
359
+ "meta"
360
+ ],
361
+ "additionalProperties": false
362
+ },
363
+ {
364
+ "type": "object",
365
+ "properties": {
366
+ "type": {
367
+ "type": "string",
368
+ "const": "url"
369
+ },
370
+ "answer": {
371
+ "type": "string"
372
+ },
373
+ "meta": {
374
+ "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
375
+ }
376
+ },
377
+ "required": [
378
+ "type",
379
+ "answer",
380
+ "meta"
381
+ ],
382
+ "additionalProperties": false
383
+ }
384
+ ]
385
+ }
295
386
  },
296
- "answer": {
297
- "type": "string"
298
- },
299
- "meta": {
300
- "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
301
- }
302
- },
303
- "required": [
304
- "type",
305
- "answer",
306
- "meta"
307
- ],
308
- "additionalProperties": false
309
- },
310
- {
311
- "type": "object",
312
- "properties": {
313
- "type": {
314
- "type": "string",
315
- "const": "textArea"
316
- },
317
- "answer": {
318
- "type": "string"
319
- },
320
- "meta": {
321
- "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
322
- }
323
- },
324
- "required": [
325
- "type",
326
- "answer",
327
- "meta"
328
- ],
329
- "additionalProperties": false
330
- },
331
- {
332
- "type": "object",
333
- "properties": {
334
- "type": {
335
- "type": "string",
336
- "const": "typeaheadSearch"
337
- },
338
- "answer": {
339
- "type": "string"
340
- },
341
- "meta": {
342
- "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
343
- }
344
- },
345
- "required": [
346
- "type",
347
- "answer",
348
- "meta"
349
- ],
350
- "additionalProperties": false
351
- },
352
- {
353
- "type": "object",
354
- "properties": {
355
- "type": {
356
- "type": "string",
357
- "const": "url"
358
- },
359
- "answer": {
360
- "type": "string"
361
- },
362
- "meta": {
363
- "$ref": "#/definitions/AnyAnswer/anyOf/0/properties/meta"
364
- }
365
- },
366
- "required": [
367
- "type",
368
- "answer",
369
- "meta"
370
- ],
371
- "additionalProperties": false
387
+ "required": [
388
+ "heading",
389
+ "content"
390
+ ],
391
+ "additionalProperties": false
392
+ }
372
393
  }
373
- ]
394
+ },
395
+ "required": [
396
+ "columns"
397
+ ],
398
+ "additionalProperties": false
374
399
  }
375
400
  },
376
401
  "meta": {
@@ -385,16 +410,16 @@
385
410
  "additionalProperties": false
386
411
  },
387
412
  {
388
- "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/anyOf/10"
413
+ "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/properties/columns/items/properties/content/anyOf/10"
389
414
  },
390
415
  {
391
- "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/anyOf/11"
416
+ "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/properties/columns/items/properties/content/anyOf/11"
392
417
  },
393
418
  {
394
- "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/anyOf/12"
419
+ "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/properties/columns/items/properties/content/anyOf/12"
395
420
  },
396
421
  {
397
- "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/anyOf/13"
422
+ "$ref": "#/definitions/AnyAnswer/anyOf/10/properties/answer/items/properties/columns/items/properties/content/anyOf/13"
398
423
  }
399
424
  ]
400
425
  }