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