@dmptool/types 1.1.3 → 1.2.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 (76) hide show
  1. package/README.md +119 -47
  2. package/dist/answers/__tests__/answers.spec.js +20 -28
  3. package/dist/answers/__tests__/usage.spec.d.ts +1 -0
  4. package/dist/answers/__tests__/usage.spec.js +175 -0
  5. package/dist/answers/answer.d.ts +12 -15
  6. package/dist/answers/answer.js +3 -4
  7. package/dist/answers/dateAnswers.d.ts +30 -30
  8. package/dist/answers/dateAnswers.js +6 -5
  9. package/dist/answers/graphQLAnswers.d.ts +25 -25
  10. package/dist/answers/graphQLAnswers.js +4 -4
  11. package/dist/answers/index.d.ts +860 -1088
  12. package/dist/answers/index.js +2 -2
  13. package/dist/answers/numberAnswers.d.ts +41 -41
  14. package/dist/answers/numberAnswers.js +8 -8
  15. package/dist/answers/optionBasedAnswers.d.ts +55 -55
  16. package/dist/answers/optionBasedAnswers.js +10 -10
  17. package/dist/answers/tableAnswers.d.ts +811 -1772
  18. package/dist/answers/tableAnswers.js +12 -8
  19. package/dist/answers/textAnswers.d.ts +44 -44
  20. package/dist/answers/textAnswers.js +8 -8
  21. package/dist/questions/__tests__/graphQLQuestions.spec.js +1 -1
  22. package/dist/questions/__tests__/usage.spec.d.ts +8 -0
  23. package/dist/questions/__tests__/usage.spec.js +312 -0
  24. package/dist/questions/dateQuestions.d.ts +81 -82
  25. package/dist/questions/dateQuestions.js +12 -16
  26. package/dist/questions/graphQLQuestions.d.ts +142 -142
  27. package/dist/questions/graphQLQuestions.js +35 -30
  28. package/dist/questions/index.d.ts +1494 -1674
  29. package/dist/questions/index.js +2 -2
  30. package/dist/questions/numberQuestions.d.ts +97 -98
  31. package/dist/questions/numberQuestions.js +7 -19
  32. package/dist/questions/optionBasedQuestions.d.ts +163 -166
  33. package/dist/questions/optionBasedQuestions.js +20 -36
  34. package/dist/questions/question.d.ts +24 -48
  35. package/dist/questions/question.js +78 -17
  36. package/dist/questions/tableQuestions.d.ts +2219 -2231
  37. package/dist/questions/tableQuestions.js +6 -11
  38. package/dist/questions/textQuestions.d.ts +104 -104
  39. package/dist/questions/textQuestions.js +6 -23
  40. package/dist/schemas/affiliationSearchAnswer.schema.json +9 -12
  41. package/dist/schemas/affiliationSearchQuestion.schema.json +30 -36
  42. package/dist/schemas/anyAnswer.schema.json +228 -237
  43. package/dist/schemas/anyQuestion.schema.json +292 -493
  44. package/dist/schemas/anyTableColumnAnswer.schema.json +93 -106
  45. package/dist/schemas/anyTableColumnQuestion.schema.json +164 -325
  46. package/dist/schemas/booleanAnswer.schema.json +8 -11
  47. package/dist/schemas/booleanQuestion.schema.json +7 -10
  48. package/dist/schemas/checkboxesAnswer.schema.json +13 -14
  49. package/dist/schemas/checkboxesQuestion.schema.json +12 -13
  50. package/dist/schemas/currencyAnswer.schema.json +8 -11
  51. package/dist/schemas/currencyQuestion.schema.json +7 -10
  52. package/dist/schemas/dateAnswer.schema.json +8 -11
  53. package/dist/schemas/dateQuestion.schema.json +7 -10
  54. package/dist/schemas/dateRangeAnswer.schema.json +16 -21
  55. package/dist/schemas/dateRangeQuestion.schema.json +38 -20
  56. package/dist/schemas/emailAnswer.schema.json +8 -11
  57. package/dist/schemas/emailQuestion.schema.json +7 -10
  58. package/dist/schemas/multiselectBoxAnswer.schema.json +13 -14
  59. package/dist/schemas/multiselectBoxQuestion.schema.json +14 -14
  60. package/dist/schemas/numberAnswer.schema.json +8 -11
  61. package/dist/schemas/numberQuestion.schema.json +7 -10
  62. package/dist/schemas/numberRangeAnswer.schema.json +17 -22
  63. package/dist/schemas/numberRangeQuestion.schema.json +18 -19
  64. package/dist/schemas/radioButtonsAnswer.schema.json +8 -11
  65. package/dist/schemas/radioButtonsQuestion.schema.json +12 -13
  66. package/dist/schemas/selectBoxAnswer.schema.json +8 -11
  67. package/dist/schemas/selectBoxQuestion.schema.json +18 -15
  68. package/dist/schemas/tableAnswer.schema.json +337 -343
  69. package/dist/schemas/tableQuestion.schema.json +178 -352
  70. package/dist/schemas/textAnswer.schema.json +8 -11
  71. package/dist/schemas/textAreaAnswer.schema.json +8 -11
  72. package/dist/schemas/textAreaQuestion.schema.json +7 -10
  73. package/dist/schemas/textQuestion.schema.json +7 -10
  74. package/dist/schemas/urlAnswer.schema.json +8 -11
  75. package/dist/schemas/urlQuestion.schema.json +7 -10
  76. package/package.json +1 -1
@@ -1,7 +1,21 @@
1
1
  import { z } from "zod";
2
- export declare const BooleanQuestionSchema: z.ZodObject<{} & {
2
+ export declare const BooleanQuestionSchema: z.ZodObject<{
3
+ meta: z.ZodDefault<z.ZodObject<{
4
+ schemaVersion: z.ZodDefault<z.ZodString>;
5
+ title: z.ZodOptional<z.ZodString>;
6
+ usageDescription: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ schemaVersion: string;
9
+ title?: string | undefined;
10
+ usageDescription?: string | undefined;
11
+ }, {
12
+ schemaVersion?: string | undefined;
13
+ title?: string | undefined;
14
+ usageDescription?: string | undefined;
15
+ }>>;
16
+ } & {
3
17
  type: z.ZodLiteral<"boolean">;
4
- attributes: z.ZodOptional<z.ZodObject<{
18
+ attributes: z.ZodDefault<z.ZodObject<{
5
19
  label: z.ZodOptional<z.ZodString>;
6
20
  help: z.ZodOptional<z.ZodString>;
7
21
  labelTranslationKey: z.ZodOptional<z.ZodString>;
@@ -18,33 +32,19 @@ export declare const BooleanQuestionSchema: z.ZodObject<{} & {
18
32
  labelTranslationKey?: string | undefined;
19
33
  checked?: boolean | undefined;
20
34
  }>>;
21
- meta: z.ZodOptional<z.ZodObject<{
22
- schemaVersion: z.ZodLiteral<"1.0">;
23
- } & {
24
- title: z.ZodOptional<z.ZodLiteral<"Yes/No Field">>;
25
- usageDescription: z.ZodOptional<z.ZodLiteral<"For questions that require a simple Yes/No response.">>;
26
- }, "strip", z.ZodTypeAny, {
27
- schemaVersion: "1.0";
28
- title?: "Yes/No Field" | undefined;
29
- usageDescription?: "For questions that require a simple Yes/No response." | undefined;
30
- }, {
31
- schemaVersion: "1.0";
32
- title?: "Yes/No Field" | undefined;
33
- usageDescription?: "For questions that require a simple Yes/No response." | undefined;
34
- }>>;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  type: "boolean";
37
- attributes?: {
37
+ attributes: {
38
38
  checked: boolean;
39
39
  label?: string | undefined;
40
40
  help?: string | undefined;
41
41
  labelTranslationKey?: string | undefined;
42
- } | undefined;
43
- meta?: {
44
- schemaVersion: "1.0";
45
- title?: "Yes/No Field" | undefined;
46
- usageDescription?: "For questions that require a simple Yes/No response." | undefined;
47
- } | undefined;
42
+ };
43
+ meta: {
44
+ schemaVersion: string;
45
+ title?: string | undefined;
46
+ usageDescription?: string | undefined;
47
+ };
48
48
  }, {
49
49
  type: "boolean";
50
50
  attributes?: {
@@ -54,28 +54,28 @@ export declare const BooleanQuestionSchema: z.ZodObject<{} & {
54
54
  checked?: boolean | undefined;
55
55
  } | undefined;
56
56
  meta?: {
57
- schemaVersion: "1.0";
58
- title?: "Yes/No Field" | undefined;
59
- usageDescription?: "For questions that require a simple Yes/No response." | undefined;
57
+ schemaVersion?: string | undefined;
58
+ title?: string | undefined;
59
+ usageDescription?: string | undefined;
60
60
  } | undefined;
61
61
  }>;
62
62
  export declare const CheckboxesQuestionSchema: z.ZodObject<{
63
- attributes: z.ZodOptional<z.ZodObject<{
64
- label: z.ZodOptional<z.ZodString>;
65
- help: z.ZodOptional<z.ZodString>;
66
- labelTranslationKey: z.ZodOptional<z.ZodString>;
63
+ meta: z.ZodDefault<z.ZodObject<{
64
+ schemaVersion: z.ZodDefault<z.ZodString>;
65
+ title: z.ZodOptional<z.ZodString>;
66
+ usageDescription: z.ZodOptional<z.ZodString>;
67
67
  }, "strip", z.ZodTypeAny, {
68
- label?: string | undefined;
69
- help?: string | undefined;
70
- labelTranslationKey?: string | undefined;
68
+ schemaVersion: string;
69
+ title?: string | undefined;
70
+ usageDescription?: string | undefined;
71
71
  }, {
72
- label?: string | undefined;
73
- help?: string | undefined;
74
- labelTranslationKey?: string | undefined;
72
+ schemaVersion?: string | undefined;
73
+ title?: string | undefined;
74
+ usageDescription?: string | undefined;
75
75
  }>>;
76
76
  } & {
77
77
  type: z.ZodLiteral<"checkBoxes">;
78
- options: z.ZodArray<z.ZodObject<{
78
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
79
79
  label: z.ZodDefault<z.ZodString>;
80
80
  value: z.ZodDefault<z.ZodString>;
81
81
  } & {
@@ -88,20 +88,19 @@ export declare const CheckboxesQuestionSchema: z.ZodObject<{
88
88
  value?: string | undefined;
89
89
  label?: string | undefined;
90
90
  checked?: boolean | undefined;
91
- }>, "many">;
92
- meta: z.ZodOptional<z.ZodObject<{
93
- schemaVersion: z.ZodLiteral<"1.0">;
94
- } & {
95
- title: z.ZodOptional<z.ZodLiteral<"Check Boxes">>;
96
- usageDescription: z.ZodOptional<z.ZodLiteral<"For multiple choice questions where users can select multiple options.">>;
91
+ }>, "many">>;
92
+ attributes: z.ZodDefault<z.ZodObject<{
93
+ label: z.ZodOptional<z.ZodString>;
94
+ help: z.ZodOptional<z.ZodString>;
95
+ labelTranslationKey: z.ZodOptional<z.ZodString>;
97
96
  }, "strip", z.ZodTypeAny, {
98
- schemaVersion: "1.0";
99
- title?: "Check Boxes" | undefined;
100
- usageDescription?: "For multiple choice questions where users can select multiple options." | undefined;
97
+ label?: string | undefined;
98
+ help?: string | undefined;
99
+ labelTranslationKey?: string | undefined;
101
100
  }, {
102
- schemaVersion: "1.0";
103
- title?: "Check Boxes" | undefined;
104
- usageDescription?: "For multiple choice questions where users can select multiple options." | undefined;
101
+ label?: string | undefined;
102
+ help?: string | undefined;
103
+ labelTranslationKey?: string | undefined;
105
104
  }>>;
106
105
  }, "strip", z.ZodTypeAny, {
107
106
  options: {
@@ -110,51 +109,51 @@ export declare const CheckboxesQuestionSchema: z.ZodObject<{
110
109
  checked: boolean;
111
110
  }[];
112
111
  type: "checkBoxes";
113
- attributes?: {
112
+ attributes: {
114
113
  label?: string | undefined;
115
114
  help?: string | undefined;
116
115
  labelTranslationKey?: string | undefined;
117
- } | undefined;
118
- meta?: {
119
- schemaVersion: "1.0";
120
- title?: "Check Boxes" | undefined;
121
- usageDescription?: "For multiple choice questions where users can select multiple options." | undefined;
122
- } | undefined;
116
+ };
117
+ meta: {
118
+ schemaVersion: string;
119
+ title?: string | undefined;
120
+ usageDescription?: string | undefined;
121
+ };
123
122
  }, {
124
- options: {
123
+ type: "checkBoxes";
124
+ options?: {
125
125
  value?: string | undefined;
126
126
  label?: string | undefined;
127
127
  checked?: boolean | undefined;
128
- }[];
129
- type: "checkBoxes";
128
+ }[] | undefined;
130
129
  attributes?: {
131
130
  label?: string | undefined;
132
131
  help?: string | undefined;
133
132
  labelTranslationKey?: string | undefined;
134
133
  } | undefined;
135
134
  meta?: {
136
- schemaVersion: "1.0";
137
- title?: "Check Boxes" | undefined;
138
- usageDescription?: "For multiple choice questions where users can select multiple options." | undefined;
135
+ schemaVersion?: string | undefined;
136
+ title?: string | undefined;
137
+ usageDescription?: string | undefined;
139
138
  } | undefined;
140
139
  }>;
141
140
  export declare const RadioButtonsQuestionSchema: z.ZodObject<{
142
- attributes: z.ZodOptional<z.ZodObject<{
143
- label: z.ZodOptional<z.ZodString>;
144
- help: z.ZodOptional<z.ZodString>;
145
- labelTranslationKey: z.ZodOptional<z.ZodString>;
141
+ meta: z.ZodDefault<z.ZodObject<{
142
+ schemaVersion: z.ZodDefault<z.ZodString>;
143
+ title: z.ZodOptional<z.ZodString>;
144
+ usageDescription: z.ZodOptional<z.ZodString>;
146
145
  }, "strip", z.ZodTypeAny, {
147
- label?: string | undefined;
148
- help?: string | undefined;
149
- labelTranslationKey?: string | undefined;
146
+ schemaVersion: string;
147
+ title?: string | undefined;
148
+ usageDescription?: string | undefined;
150
149
  }, {
151
- label?: string | undefined;
152
- help?: string | undefined;
153
- labelTranslationKey?: string | undefined;
150
+ schemaVersion?: string | undefined;
151
+ title?: string | undefined;
152
+ usageDescription?: string | undefined;
154
153
  }>>;
155
154
  } & {
156
155
  type: z.ZodLiteral<"radioButtons">;
157
- options: z.ZodArray<z.ZodObject<{
156
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
158
157
  label: z.ZodDefault<z.ZodString>;
159
158
  value: z.ZodDefault<z.ZodString>;
160
159
  } & {
@@ -167,20 +166,19 @@ export declare const RadioButtonsQuestionSchema: z.ZodObject<{
167
166
  value?: string | undefined;
168
167
  label?: string | undefined;
169
168
  selected?: boolean | undefined;
170
- }>, "many">;
171
- meta: z.ZodOptional<z.ZodObject<{
172
- schemaVersion: z.ZodLiteral<"1.0">;
173
- } & {
174
- title: z.ZodOptional<z.ZodLiteral<"Radio Buttons">>;
175
- usageDescription: z.ZodOptional<z.ZodLiteral<"For multiple choice questions where users select just one option.">>;
169
+ }>, "many">>;
170
+ attributes: z.ZodDefault<z.ZodObject<{
171
+ label: z.ZodOptional<z.ZodString>;
172
+ help: z.ZodOptional<z.ZodString>;
173
+ labelTranslationKey: z.ZodOptional<z.ZodString>;
176
174
  }, "strip", z.ZodTypeAny, {
177
- schemaVersion: "1.0";
178
- title?: "Radio Buttons" | undefined;
179
- usageDescription?: "For multiple choice questions where users select just one option." | undefined;
175
+ label?: string | undefined;
176
+ help?: string | undefined;
177
+ labelTranslationKey?: string | undefined;
180
178
  }, {
181
- schemaVersion: "1.0";
182
- title?: "Radio Buttons" | undefined;
183
- usageDescription?: "For multiple choice questions where users select just one option." | undefined;
179
+ label?: string | undefined;
180
+ help?: string | undefined;
181
+ labelTranslationKey?: string | undefined;
184
182
  }>>;
185
183
  }, "strip", z.ZodTypeAny, {
186
184
  options: {
@@ -189,37 +187,51 @@ export declare const RadioButtonsQuestionSchema: z.ZodObject<{
189
187
  selected: boolean;
190
188
  }[];
191
189
  type: "radioButtons";
192
- attributes?: {
190
+ attributes: {
193
191
  label?: string | undefined;
194
192
  help?: string | undefined;
195
193
  labelTranslationKey?: string | undefined;
196
- } | undefined;
197
- meta?: {
198
- schemaVersion: "1.0";
199
- title?: "Radio Buttons" | undefined;
200
- usageDescription?: "For multiple choice questions where users select just one option." | undefined;
201
- } | undefined;
194
+ };
195
+ meta: {
196
+ schemaVersion: string;
197
+ title?: string | undefined;
198
+ usageDescription?: string | undefined;
199
+ };
202
200
  }, {
203
- options: {
201
+ type: "radioButtons";
202
+ options?: {
204
203
  value?: string | undefined;
205
204
  label?: string | undefined;
206
205
  selected?: boolean | undefined;
207
- }[];
208
- type: "radioButtons";
206
+ }[] | undefined;
209
207
  attributes?: {
210
208
  label?: string | undefined;
211
209
  help?: string | undefined;
212
210
  labelTranslationKey?: string | undefined;
213
211
  } | undefined;
214
212
  meta?: {
215
- schemaVersion: "1.0";
216
- title?: "Radio Buttons" | undefined;
217
- usageDescription?: "For multiple choice questions where users select just one option." | undefined;
213
+ schemaVersion?: string | undefined;
214
+ title?: string | undefined;
215
+ usageDescription?: string | undefined;
218
216
  } | undefined;
219
217
  }>;
220
- export declare const SelectBoxQuestionSchema: z.ZodObject<{} & {
218
+ export declare const SelectBoxQuestionSchema: z.ZodObject<{
219
+ meta: z.ZodDefault<z.ZodObject<{
220
+ schemaVersion: z.ZodDefault<z.ZodString>;
221
+ title: z.ZodOptional<z.ZodString>;
222
+ usageDescription: z.ZodOptional<z.ZodString>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ schemaVersion: string;
225
+ title?: string | undefined;
226
+ usageDescription?: string | undefined;
227
+ }, {
228
+ schemaVersion?: string | undefined;
229
+ title?: string | undefined;
230
+ usageDescription?: string | undefined;
231
+ }>>;
232
+ } & {
221
233
  type: z.ZodLiteral<"selectBox">;
222
- options: z.ZodArray<z.ZodObject<{
234
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
223
235
  label: z.ZodDefault<z.ZodString>;
224
236
  value: z.ZodDefault<z.ZodString>;
225
237
  } & {
@@ -232,37 +244,23 @@ export declare const SelectBoxQuestionSchema: z.ZodObject<{} & {
232
244
  value?: string | undefined;
233
245
  label?: string | undefined;
234
246
  selected?: boolean | undefined;
235
- }>, "many">;
236
- attributes: z.ZodObject<{
247
+ }>, "many">>;
248
+ attributes: z.ZodDefault<z.ZodObject<{
237
249
  label: z.ZodOptional<z.ZodString>;
238
250
  help: z.ZodOptional<z.ZodString>;
239
251
  labelTranslationKey: z.ZodOptional<z.ZodString>;
240
252
  } & {
241
- multiple: z.ZodDefault<z.ZodBoolean>;
253
+ multiple: z.ZodLiteral<false>;
242
254
  }, "strip", z.ZodTypeAny, {
243
- multiple: boolean;
255
+ multiple: false;
244
256
  label?: string | undefined;
245
257
  help?: string | undefined;
246
258
  labelTranslationKey?: string | undefined;
247
259
  }, {
260
+ multiple: false;
248
261
  label?: string | undefined;
249
262
  help?: string | undefined;
250
263
  labelTranslationKey?: string | undefined;
251
- multiple?: boolean | undefined;
252
- }>;
253
- meta: z.ZodOptional<z.ZodObject<{
254
- schemaVersion: z.ZodLiteral<"1.0">;
255
- } & {
256
- title: z.ZodOptional<z.ZodLiteral<"Select Box">>;
257
- usageDescription: z.ZodOptional<z.ZodLiteral<"For questions where users select one option from a list.">>;
258
- }, "strip", z.ZodTypeAny, {
259
- schemaVersion: "1.0";
260
- title?: "Select Box" | undefined;
261
- usageDescription?: "For questions where users select one option from a list." | undefined;
262
- }, {
263
- schemaVersion: "1.0";
264
- title?: "Select Box" | undefined;
265
- usageDescription?: "For questions where users select one option from a list." | undefined;
266
264
  }>>;
267
265
  }, "strip", z.ZodTypeAny, {
268
266
  options: {
@@ -272,37 +270,52 @@ export declare const SelectBoxQuestionSchema: z.ZodObject<{} & {
272
270
  }[];
273
271
  type: "selectBox";
274
272
  attributes: {
275
- multiple: boolean;
273
+ multiple: false;
276
274
  label?: string | undefined;
277
275
  help?: string | undefined;
278
276
  labelTranslationKey?: string | undefined;
279
277
  };
280
- meta?: {
281
- schemaVersion: "1.0";
282
- title?: "Select Box" | undefined;
283
- usageDescription?: "For questions where users select one option from a list." | undefined;
284
- } | undefined;
278
+ meta: {
279
+ schemaVersion: string;
280
+ title?: string | undefined;
281
+ usageDescription?: string | undefined;
282
+ };
285
283
  }, {
286
- options: {
284
+ type: "selectBox";
285
+ options?: {
287
286
  value?: string | undefined;
288
287
  label?: string | undefined;
289
288
  selected?: boolean | undefined;
290
- }[];
291
- type: "selectBox";
292
- attributes: {
289
+ }[] | undefined;
290
+ attributes?: {
291
+ multiple: false;
293
292
  label?: string | undefined;
294
293
  help?: string | undefined;
295
294
  labelTranslationKey?: string | undefined;
296
- multiple?: boolean | undefined;
297
- };
295
+ } | undefined;
298
296
  meta?: {
299
- schemaVersion: "1.0";
300
- title?: "Select Box" | undefined;
301
- usageDescription?: "For questions where users select one option from a list." | undefined;
297
+ schemaVersion?: string | undefined;
298
+ title?: string | undefined;
299
+ usageDescription?: string | undefined;
302
300
  } | undefined;
303
301
  }>;
304
302
  export declare const MultiselectBoxQuestionSchema: z.ZodObject<{
305
- options: z.ZodArray<z.ZodObject<{
303
+ meta: z.ZodDefault<z.ZodObject<{
304
+ schemaVersion: z.ZodDefault<z.ZodString>;
305
+ title: z.ZodOptional<z.ZodString>;
306
+ usageDescription: z.ZodOptional<z.ZodString>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ schemaVersion: string;
309
+ title?: string | undefined;
310
+ usageDescription?: string | undefined;
311
+ }, {
312
+ schemaVersion?: string | undefined;
313
+ title?: string | undefined;
314
+ usageDescription?: string | undefined;
315
+ }>>;
316
+ } & {
317
+ type: z.ZodLiteral<"multiselectBox">;
318
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
306
319
  label: z.ZodDefault<z.ZodString>;
307
320
  value: z.ZodDefault<z.ZodString>;
308
321
  } & {
@@ -315,10 +328,8 @@ export declare const MultiselectBoxQuestionSchema: z.ZodObject<{
315
328
  value?: string | undefined;
316
329
  label?: string | undefined;
317
330
  selected?: boolean | undefined;
318
- }>, "many">;
319
- } & {
320
- type: z.ZodLiteral<"multiselectBox">;
321
- attributes: z.ZodObject<{
331
+ }>, "many">>;
332
+ attributes: z.ZodDefault<z.ZodObject<{
322
333
  label: z.ZodOptional<z.ZodString>;
323
334
  help: z.ZodOptional<z.ZodString>;
324
335
  labelTranslationKey: z.ZodOptional<z.ZodString>;
@@ -334,20 +345,6 @@ export declare const MultiselectBoxQuestionSchema: z.ZodObject<{
334
345
  label?: string | undefined;
335
346
  help?: string | undefined;
336
347
  labelTranslationKey?: string | undefined;
337
- }>;
338
- meta: z.ZodOptional<z.ZodObject<{
339
- schemaVersion: z.ZodLiteral<"1.0">;
340
- } & {
341
- title: z.ZodOptional<z.ZodLiteral<"Multi-select Box">>;
342
- usageDescription: z.ZodOptional<z.ZodLiteral<"For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses.">>;
343
- }, "strip", z.ZodTypeAny, {
344
- schemaVersion: "1.0";
345
- title?: "Multi-select Box" | undefined;
346
- usageDescription?: "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses." | undefined;
347
- }, {
348
- schemaVersion: "1.0";
349
- title?: "Multi-select Box" | undefined;
350
- usageDescription?: "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses." | undefined;
351
348
  }>>;
352
349
  }, "strip", z.ZodTypeAny, {
353
350
  options: {
@@ -362,28 +359,28 @@ export declare const MultiselectBoxQuestionSchema: z.ZodObject<{
362
359
  help?: string | undefined;
363
360
  labelTranslationKey?: string | undefined;
364
361
  };
365
- meta?: {
366
- schemaVersion: "1.0";
367
- title?: "Multi-select Box" | undefined;
368
- usageDescription?: "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses." | undefined;
369
- } | undefined;
362
+ meta: {
363
+ schemaVersion: string;
364
+ title?: string | undefined;
365
+ usageDescription?: string | undefined;
366
+ };
370
367
  }, {
371
- options: {
368
+ type: "multiselectBox";
369
+ options?: {
372
370
  value?: string | undefined;
373
371
  label?: string | undefined;
374
372
  selected?: boolean | undefined;
375
- }[];
376
- type: "multiselectBox";
377
- attributes: {
373
+ }[] | undefined;
374
+ attributes?: {
378
375
  multiple: true;
379
376
  label?: string | undefined;
380
377
  help?: string | undefined;
381
378
  labelTranslationKey?: string | undefined;
382
- };
379
+ } | undefined;
383
380
  meta?: {
384
- schemaVersion: "1.0";
385
- title?: "Multi-select Box" | undefined;
386
- usageDescription?: "For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses." | undefined;
381
+ schemaVersion?: string | undefined;
382
+ title?: string | undefined;
383
+ usageDescription?: string | undefined;
387
384
  } | undefined;
388
385
  }>;
389
386
  export type BooleanQuestionType = z.infer<typeof BooleanQuestionSchema>;
@@ -3,69 +3,53 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MultiselectBoxQuestionSchema = exports.SelectBoxQuestionSchema = exports.RadioButtonsQuestionSchema = exports.CheckboxesQuestionSchema = exports.BooleanQuestionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const question_1 = require("./question");
6
+ const BaseAttributes = question_1.QuestionSchema.shape.attributes;
6
7
  // A select box, radio buttons, or checkboxes option
7
8
  const OptionSchema = zod_1.z.object({
8
9
  label: zod_1.z.string().default('Option A'),
9
10
  value: zod_1.z.string().default('a'),
10
11
  });
11
- const BaseAttributes = question_1.QuestionSchema.shape.attributes;
12
- const BaseMeta = question_1.QuestionSchema.shape.meta;
13
12
  const CheckedOptionSchema = OptionSchema.merge(zod_1.z.object({
14
13
  checked: zod_1.z.boolean().default(false),
15
14
  }));
16
15
  const SelectedOptionSchema = OptionSchema.merge(zod_1.z.object({
17
16
  selected: zod_1.z.boolean().default(false),
18
17
  }));
18
+ const selectBoxAttributes = BaseAttributes.merge(zod_1.z.object({
19
+ multiple: zod_1.z.boolean().default(false)
20
+ }));
19
21
  // Yes/No (boolean) question
20
22
  exports.BooleanQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
21
23
  type: zod_1.z.literal('boolean'),
22
- attributes: BaseAttributes.unwrap().merge(zod_1.z.object({
24
+ attributes: BaseAttributes.merge(zod_1.z.object({
23
25
  checked: zod_1.z.boolean().default(false),
24
- })).optional(),
25
- meta: BaseMeta.unwrap().merge(zod_1.z.object({
26
- title: zod_1.z.literal('Yes/No Field').optional(),
27
- usageDescription: zod_1.z.literal('For questions that require a simple Yes/No response.').optional(),
28
- })).optional()
26
+ })).default({})
29
27
  }));
30
28
  // Check boxes question and answer
31
29
  exports.CheckboxesQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
32
- type: zod_1.z.literal('checkBoxes'), // The type of question
33
- options: zod_1.z.array(CheckedOptionSchema),
34
- meta: BaseMeta.unwrap().merge(zod_1.z.object({
35
- title: zod_1.z.literal('Check Boxes').optional(),
36
- usageDescription: zod_1.z.literal('For multiple choice questions where users can select multiple options.').optional(),
37
- })).optional()
30
+ type: zod_1.z.literal('checkBoxes'),
31
+ options: zod_1.z.array(CheckedOptionSchema).default([{}]),
32
+ attributes: BaseAttributes.default({}),
38
33
  }));
39
34
  // Radio buttons question and answer
40
35
  exports.RadioButtonsQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
41
- type: zod_1.z.literal('radioButtons'), // The type of question
42
- options: zod_1.z.array(SelectedOptionSchema),
43
- meta: BaseMeta.unwrap().merge(zod_1.z.object({
44
- title: zod_1.z.literal('Radio Buttons').optional(),
45
- usageDescription: zod_1.z.literal('For multiple choice questions where users select just one option.').optional(),
46
- })).optional()
36
+ type: zod_1.z.literal('radioButtons'),
37
+ options: zod_1.z.array(SelectedOptionSchema).default([{}]),
38
+ attributes: BaseAttributes.default({})
47
39
  }));
48
40
  // Select box question and answer
49
- const selectBoxAttributes = BaseAttributes.unwrap().merge(zod_1.z.object({
50
- multiple: zod_1.z.boolean().default(false)
51
- }));
52
41
  exports.SelectBoxQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
53
- type: zod_1.z.literal('selectBox'), // The type of question
54
- options: zod_1.z.array(SelectedOptionSchema),
55
- attributes: selectBoxAttributes,
56
- meta: BaseMeta.unwrap().merge(zod_1.z.object({
57
- title: zod_1.z.literal('Select Box').optional(),
58
- usageDescription: zod_1.z.literal('For questions where users select one option from a list.').optional(),
59
- })).optional()
42
+ type: zod_1.z.literal('selectBox'),
43
+ options: zod_1.z.array(SelectedOptionSchema).default([{}]),
44
+ attributes: selectBoxAttributes.merge(zod_1.z.object({
45
+ multiple: zod_1.z.literal(false)
46
+ })).default({ multiple: false })
60
47
  }));
61
48
  // Multi-select box question and answer
62
49
  exports.MultiselectBoxQuestionSchema = exports.SelectBoxQuestionSchema.merge(zod_1.z.object({
63
50
  type: zod_1.z.literal('multiselectBox'),
51
+ options: zod_1.z.array(SelectedOptionSchema).default([{}]),
64
52
  attributes: selectBoxAttributes.merge(zod_1.z.object({
65
- multiple: zod_1.z.literal(true) // Whether to allow multiple selections (default is false)
66
- })),
67
- meta: BaseMeta.unwrap().merge(zod_1.z.object({
68
- title: zod_1.z.literal('Multi-select Box').optional(),
69
- usageDescription: zod_1.z.literal('For questions where multiple answers are valid. Allows users to select several options from a predefined list, providing flexibility in responses.').optional(),
70
- })).optional(),
53
+ multiple: zod_1.z.literal(true)
54
+ })).default({ multiple: true })
71
55
  }));