@dmptool/types 1.0.3 → 1.0.5
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/README.md +25 -3
- package/dist/answers/answer.d.ts +3 -3
- package/dist/answers/index.d.ts +2 -0
- package/dist/answers/index.js +19 -1
- package/dist/questions/dateQuestions.d.ts +6 -6
- package/dist/questions/dateQuestions.js +1 -1
- package/dist/questions/graphQLQuestions.d.ts +36 -36
- package/dist/questions/graphQLQuestions.js +1 -1
- package/dist/questions/index.d.ts +250 -248
- package/dist/questions/index.js +19 -1
- package/dist/questions/optionBasedQuestions.d.ts +6 -6
- package/dist/questions/optionBasedQuestions.js +1 -1
- package/dist/questions/primitiveQuestions.d.ts +42 -42
- package/dist/questions/primitiveQuestions.js +6 -6
- package/dist/questions/question.d.ts +4 -4
- package/dist/questions/question.js +0 -1
- package/dist/questions/tableQuestions.d.ts +248 -248
- package/dist/questions/tableQuestions.js +1 -1
- package/dist/schemas/anyQuestion.schema.json +11 -22
- package/dist/schemas/anyTableColumnQuestion.schema.json +10 -20
- package/dist/schemas/booleanQuestion.schema.json +1 -2
- package/dist/schemas/currencyQuestion.schema.json +1 -2
- package/dist/schemas/datePickerQuestion.schema.json +1 -2
- package/dist/schemas/emailQuestion.schema.json +1 -2
- package/dist/schemas/filteredSearchQuestion.schema.json +1 -2
- package/dist/schemas/numberQuestion.schema.json +1 -2
- package/dist/schemas/selectBoxQuestion.schema.json +1 -2
- package/dist/schemas/tableQuestion.schema.json +11 -22
- package/dist/schemas/textAreaQuestion.schema.json +1 -2
- package/dist/schemas/textQuestion.schema.json +1 -2
- package/dist/schemas/typeaheadSearchQuestion.schema.json +1 -2
- package/dist/schemas/urlQuestion.schema.json +1 -2
- package/package.json +1 -1
package/dist/questions/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AnyQuestionSchema = void 0;
|
|
17
|
+
exports.QuestionSchemaMap = exports.AnyQuestionSchema = void 0;
|
|
18
18
|
const zod_1 = require("zod");
|
|
19
19
|
const primitiveQuestions_1 = require("./primitiveQuestions");
|
|
20
20
|
const dateQuestions_1 = require("./dateQuestions");
|
|
@@ -46,3 +46,21 @@ exports.AnyQuestionSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
46
46
|
graphQLQuestions_1.TypeaheadSearchQuestionSchema,
|
|
47
47
|
primitiveQuestions_1.URLQuestionSchema
|
|
48
48
|
]);
|
|
49
|
+
// Export a mapping between question types and their corresponding question schemas
|
|
50
|
+
exports.QuestionSchemaMap = {
|
|
51
|
+
boolean: primitiveQuestions_1.BooleanQuestionSchema,
|
|
52
|
+
checkBoxes: optionBasedQuestions_1.CheckboxesQuestionSchema,
|
|
53
|
+
currency: primitiveQuestions_1.CurrencyQuestionSchema,
|
|
54
|
+
datePicker: dateQuestions_1.DatePickerQuestionSchema,
|
|
55
|
+
dateRange: dateQuestions_1.DateRangeQuestionSchema,
|
|
56
|
+
email: primitiveQuestions_1.EmailQuestionSchema,
|
|
57
|
+
filteredSearch: graphQLQuestions_1.FilteredSearchQuestionSchema,
|
|
58
|
+
number: primitiveQuestions_1.NumberQuestionSchema,
|
|
59
|
+
radioButtons: optionBasedQuestions_1.RadioButtonsQuestionSchema,
|
|
60
|
+
selectBox: optionBasedQuestions_1.SelectBoxQuestionSchema,
|
|
61
|
+
table: tableQuestions_1.TableQuestionSchema,
|
|
62
|
+
text: primitiveQuestions_1.TextQuestionSchema,
|
|
63
|
+
textArea: primitiveQuestions_1.TextAreaQuestionSchema,
|
|
64
|
+
typeaheadSearch: graphQLQuestions_1.TypeaheadSearchQuestionSchema,
|
|
65
|
+
url: primitiveQuestions_1.URLQuestionSchema
|
|
66
|
+
};
|
|
@@ -189,13 +189,13 @@ export declare const SelectBoxQuestionSchema: z.ZodObject<{
|
|
|
189
189
|
selected?: boolean | undefined;
|
|
190
190
|
};
|
|
191
191
|
}>, "many">;
|
|
192
|
-
attributes: z.ZodObject<{
|
|
192
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
193
193
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
194
194
|
}, "strip", z.ZodTypeAny, {
|
|
195
195
|
multiple?: boolean | undefined;
|
|
196
196
|
}, {
|
|
197
197
|
multiple?: boolean | undefined;
|
|
198
|
-
}
|
|
198
|
+
}>>;
|
|
199
199
|
}, "strip", z.ZodTypeAny, {
|
|
200
200
|
type: "selectBox";
|
|
201
201
|
options: {
|
|
@@ -210,9 +210,9 @@ export declare const SelectBoxQuestionSchema: z.ZodObject<{
|
|
|
210
210
|
schemaVersion: "1.0";
|
|
211
211
|
labelTranslationKey?: string | undefined;
|
|
212
212
|
};
|
|
213
|
-
attributes
|
|
213
|
+
attributes?: {
|
|
214
214
|
multiple?: boolean | undefined;
|
|
215
|
-
};
|
|
215
|
+
} | undefined;
|
|
216
216
|
}, {
|
|
217
217
|
type: "selectBox";
|
|
218
218
|
options: {
|
|
@@ -227,9 +227,9 @@ export declare const SelectBoxQuestionSchema: z.ZodObject<{
|
|
|
227
227
|
schemaVersion: "1.0";
|
|
228
228
|
labelTranslationKey?: string | undefined;
|
|
229
229
|
};
|
|
230
|
-
attributes
|
|
230
|
+
attributes?: {
|
|
231
231
|
multiple?: boolean | undefined;
|
|
232
|
-
};
|
|
232
|
+
} | undefined;
|
|
233
233
|
}>;
|
|
234
234
|
export type CheckboxesQuestionType = z.infer<typeof CheckboxesQuestionSchema>;
|
|
235
235
|
export type RadioButtonsQuestionType = z.infer<typeof RadioButtonsQuestionSchema>;
|
|
@@ -40,5 +40,5 @@ exports.SelectBoxQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object
|
|
|
40
40
|
options: zod_1.z.array(SelectedOptionSchema),
|
|
41
41
|
attributes: zod_1.z.object({
|
|
42
42
|
multiple: zod_1.z.boolean().optional() // Whether to allow multiple selections (default is false)
|
|
43
|
-
})
|
|
43
|
+
}).optional(),
|
|
44
44
|
}));
|
|
@@ -12,31 +12,31 @@ export declare const BooleanQuestionSchema: z.ZodObject<{
|
|
|
12
12
|
}>;
|
|
13
13
|
} & {
|
|
14
14
|
type: z.ZodLiteral<"boolean">;
|
|
15
|
-
attributes: z.ZodObject<{
|
|
15
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
16
16
|
checked: z.ZodOptional<z.ZodBoolean>;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
18
|
checked?: boolean | undefined;
|
|
19
19
|
}, {
|
|
20
20
|
checked?: boolean | undefined;
|
|
21
|
-
}
|
|
21
|
+
}>>;
|
|
22
22
|
}, "strip", z.ZodTypeAny, {
|
|
23
23
|
type: "boolean";
|
|
24
24
|
meta: {
|
|
25
25
|
schemaVersion: "1.0";
|
|
26
26
|
labelTranslationKey?: string | undefined;
|
|
27
27
|
};
|
|
28
|
-
attributes
|
|
28
|
+
attributes?: {
|
|
29
29
|
checked?: boolean | undefined;
|
|
30
|
-
};
|
|
30
|
+
} | undefined;
|
|
31
31
|
}, {
|
|
32
32
|
type: "boolean";
|
|
33
33
|
meta: {
|
|
34
34
|
schemaVersion: "1.0";
|
|
35
35
|
labelTranslationKey?: string | undefined;
|
|
36
36
|
};
|
|
37
|
-
attributes
|
|
37
|
+
attributes?: {
|
|
38
38
|
checked?: boolean | undefined;
|
|
39
|
-
};
|
|
39
|
+
} | undefined;
|
|
40
40
|
}>;
|
|
41
41
|
export declare const NumberQuestionSchema: z.ZodObject<{
|
|
42
42
|
meta: z.ZodObject<{
|
|
@@ -51,7 +51,7 @@ export declare const NumberQuestionSchema: z.ZodObject<{
|
|
|
51
51
|
}>;
|
|
52
52
|
} & {
|
|
53
53
|
type: z.ZodLiteral<"number">;
|
|
54
|
-
attributes: z.ZodObject<{
|
|
54
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
55
55
|
max: z.ZodOptional<z.ZodNumber>;
|
|
56
56
|
min: z.ZodOptional<z.ZodNumber>;
|
|
57
57
|
step: z.ZodOptional<z.ZodNumber>;
|
|
@@ -63,32 +63,32 @@ export declare const NumberQuestionSchema: z.ZodObject<{
|
|
|
63
63
|
max?: number | undefined;
|
|
64
64
|
min?: number | undefined;
|
|
65
65
|
step?: number | undefined;
|
|
66
|
-
}
|
|
66
|
+
}>>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
68
|
type: "number";
|
|
69
69
|
meta: {
|
|
70
70
|
schemaVersion: "1.0";
|
|
71
71
|
labelTranslationKey?: string | undefined;
|
|
72
72
|
};
|
|
73
|
-
attributes
|
|
73
|
+
attributes?: {
|
|
74
74
|
max?: number | undefined;
|
|
75
75
|
min?: number | undefined;
|
|
76
76
|
step?: number | undefined;
|
|
77
|
-
};
|
|
77
|
+
} | undefined;
|
|
78
78
|
}, {
|
|
79
79
|
type: "number";
|
|
80
80
|
meta: {
|
|
81
81
|
schemaVersion: "1.0";
|
|
82
82
|
labelTranslationKey?: string | undefined;
|
|
83
83
|
};
|
|
84
|
-
attributes
|
|
84
|
+
attributes?: {
|
|
85
85
|
max?: number | undefined;
|
|
86
86
|
min?: number | undefined;
|
|
87
87
|
step?: number | undefined;
|
|
88
|
-
};
|
|
88
|
+
} | undefined;
|
|
89
89
|
}>;
|
|
90
90
|
export declare const CurrencyQuestionSchema: z.ZodObject<{
|
|
91
|
-
attributes: z.ZodObject<{
|
|
91
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
92
92
|
max: z.ZodOptional<z.ZodNumber>;
|
|
93
93
|
min: z.ZodOptional<z.ZodNumber>;
|
|
94
94
|
step: z.ZodOptional<z.ZodNumber>;
|
|
@@ -100,7 +100,7 @@ export declare const CurrencyQuestionSchema: z.ZodObject<{
|
|
|
100
100
|
max?: number | undefined;
|
|
101
101
|
min?: number | undefined;
|
|
102
102
|
step?: number | undefined;
|
|
103
|
-
}
|
|
103
|
+
}>>;
|
|
104
104
|
} & {
|
|
105
105
|
type: z.ZodLiteral<"currency">;
|
|
106
106
|
meta: z.ZodObject<{
|
|
@@ -115,21 +115,21 @@ export declare const CurrencyQuestionSchema: z.ZodObject<{
|
|
|
115
115
|
meta: {
|
|
116
116
|
denomination?: string | undefined;
|
|
117
117
|
};
|
|
118
|
-
attributes
|
|
118
|
+
attributes?: {
|
|
119
119
|
max?: number | undefined;
|
|
120
120
|
min?: number | undefined;
|
|
121
121
|
step?: number | undefined;
|
|
122
|
-
};
|
|
122
|
+
} | undefined;
|
|
123
123
|
}, {
|
|
124
124
|
type: "currency";
|
|
125
125
|
meta: {
|
|
126
126
|
denomination?: string | undefined;
|
|
127
127
|
};
|
|
128
|
-
attributes
|
|
128
|
+
attributes?: {
|
|
129
129
|
max?: number | undefined;
|
|
130
130
|
min?: number | undefined;
|
|
131
131
|
step?: number | undefined;
|
|
132
|
-
};
|
|
132
|
+
} | undefined;
|
|
133
133
|
}>;
|
|
134
134
|
export declare const EmailQuestionSchema: z.ZodObject<{
|
|
135
135
|
meta: z.ZodObject<{
|
|
@@ -144,7 +144,7 @@ export declare const EmailQuestionSchema: z.ZodObject<{
|
|
|
144
144
|
}>;
|
|
145
145
|
} & {
|
|
146
146
|
type: z.ZodLiteral<"email">;
|
|
147
|
-
attributes: z.ZodObject<{
|
|
147
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
148
148
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
149
149
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
150
150
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -159,35 +159,35 @@ export declare const EmailQuestionSchema: z.ZodObject<{
|
|
|
159
159
|
minLength?: number | undefined;
|
|
160
160
|
multiple?: boolean | undefined;
|
|
161
161
|
pattern?: string | undefined;
|
|
162
|
-
}
|
|
162
|
+
}>>;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
type: "email";
|
|
165
165
|
meta: {
|
|
166
166
|
schemaVersion: "1.0";
|
|
167
167
|
labelTranslationKey?: string | undefined;
|
|
168
168
|
};
|
|
169
|
-
attributes
|
|
169
|
+
attributes?: {
|
|
170
170
|
maxLength?: number | undefined;
|
|
171
171
|
minLength?: number | undefined;
|
|
172
172
|
multiple?: boolean | undefined;
|
|
173
173
|
pattern?: string | undefined;
|
|
174
|
-
};
|
|
174
|
+
} | undefined;
|
|
175
175
|
}, {
|
|
176
176
|
type: "email";
|
|
177
177
|
meta: {
|
|
178
178
|
schemaVersion: "1.0";
|
|
179
179
|
labelTranslationKey?: string | undefined;
|
|
180
180
|
};
|
|
181
|
-
attributes
|
|
181
|
+
attributes?: {
|
|
182
182
|
maxLength?: number | undefined;
|
|
183
183
|
minLength?: number | undefined;
|
|
184
184
|
multiple?: boolean | undefined;
|
|
185
185
|
pattern?: string | undefined;
|
|
186
|
-
};
|
|
186
|
+
} | undefined;
|
|
187
187
|
}>;
|
|
188
188
|
export declare const TextAreaQuestionSchema: z.ZodObject<{} & {
|
|
189
189
|
type: z.ZodLiteral<"textArea">;
|
|
190
|
-
attributes: z.ZodObject<{
|
|
190
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
191
191
|
cols: z.ZodOptional<z.ZodNumber>;
|
|
192
192
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
193
193
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
@@ -202,7 +202,7 @@ export declare const TextAreaQuestionSchema: z.ZodObject<{} & {
|
|
|
202
202
|
minLength?: number | undefined;
|
|
203
203
|
cols?: number | undefined;
|
|
204
204
|
rows?: number | undefined;
|
|
205
|
-
}
|
|
205
|
+
}>>;
|
|
206
206
|
meta: z.ZodObject<{
|
|
207
207
|
asRichText: z.ZodOptional<z.ZodBoolean>;
|
|
208
208
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -215,23 +215,23 @@ export declare const TextAreaQuestionSchema: z.ZodObject<{} & {
|
|
|
215
215
|
meta: {
|
|
216
216
|
asRichText?: boolean | undefined;
|
|
217
217
|
};
|
|
218
|
-
attributes
|
|
218
|
+
attributes?: {
|
|
219
219
|
maxLength?: number | undefined;
|
|
220
220
|
minLength?: number | undefined;
|
|
221
221
|
cols?: number | undefined;
|
|
222
222
|
rows?: number | undefined;
|
|
223
|
-
};
|
|
223
|
+
} | undefined;
|
|
224
224
|
}, {
|
|
225
225
|
type: "textArea";
|
|
226
226
|
meta: {
|
|
227
227
|
asRichText?: boolean | undefined;
|
|
228
228
|
};
|
|
229
|
-
attributes
|
|
229
|
+
attributes?: {
|
|
230
230
|
maxLength?: number | undefined;
|
|
231
231
|
minLength?: number | undefined;
|
|
232
232
|
cols?: number | undefined;
|
|
233
233
|
rows?: number | undefined;
|
|
234
|
-
};
|
|
234
|
+
} | undefined;
|
|
235
235
|
}>;
|
|
236
236
|
export declare const TextQuestionSchema: z.ZodObject<{
|
|
237
237
|
meta: z.ZodObject<{
|
|
@@ -246,7 +246,7 @@ export declare const TextQuestionSchema: z.ZodObject<{
|
|
|
246
246
|
}>;
|
|
247
247
|
} & {
|
|
248
248
|
type: z.ZodLiteral<"text">;
|
|
249
|
-
attributes: z.ZodObject<{
|
|
249
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
250
250
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
251
251
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
252
252
|
pattern: z.ZodOptional<z.ZodString>;
|
|
@@ -258,29 +258,29 @@ export declare const TextQuestionSchema: z.ZodObject<{
|
|
|
258
258
|
maxLength?: number | undefined;
|
|
259
259
|
minLength?: number | undefined;
|
|
260
260
|
pattern?: string | undefined;
|
|
261
|
-
}
|
|
261
|
+
}>>;
|
|
262
262
|
}, "strip", z.ZodTypeAny, {
|
|
263
263
|
type: "text";
|
|
264
264
|
meta: {
|
|
265
265
|
schemaVersion: "1.0";
|
|
266
266
|
labelTranslationKey?: string | undefined;
|
|
267
267
|
};
|
|
268
|
-
attributes
|
|
268
|
+
attributes?: {
|
|
269
269
|
maxLength?: number | undefined;
|
|
270
270
|
minLength?: number | undefined;
|
|
271
271
|
pattern?: string | undefined;
|
|
272
|
-
};
|
|
272
|
+
} | undefined;
|
|
273
273
|
}, {
|
|
274
274
|
type: "text";
|
|
275
275
|
meta: {
|
|
276
276
|
schemaVersion: "1.0";
|
|
277
277
|
labelTranslationKey?: string | undefined;
|
|
278
278
|
};
|
|
279
|
-
attributes
|
|
279
|
+
attributes?: {
|
|
280
280
|
maxLength?: number | undefined;
|
|
281
281
|
minLength?: number | undefined;
|
|
282
282
|
pattern?: string | undefined;
|
|
283
|
-
};
|
|
283
|
+
} | undefined;
|
|
284
284
|
}>;
|
|
285
285
|
export declare const URLQuestionSchema: z.ZodObject<{
|
|
286
286
|
meta: z.ZodObject<{
|
|
@@ -295,7 +295,7 @@ export declare const URLQuestionSchema: z.ZodObject<{
|
|
|
295
295
|
}>;
|
|
296
296
|
} & {
|
|
297
297
|
type: z.ZodLiteral<"url">;
|
|
298
|
-
attributes: z.ZodObject<{
|
|
298
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
299
299
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
300
300
|
minLength: z.ZodOptional<z.ZodNumber>;
|
|
301
301
|
pattern: z.ZodOptional<z.ZodString>;
|
|
@@ -307,29 +307,29 @@ export declare const URLQuestionSchema: z.ZodObject<{
|
|
|
307
307
|
maxLength?: number | undefined;
|
|
308
308
|
minLength?: number | undefined;
|
|
309
309
|
pattern?: string | undefined;
|
|
310
|
-
}
|
|
310
|
+
}>>;
|
|
311
311
|
}, "strip", z.ZodTypeAny, {
|
|
312
312
|
type: "url";
|
|
313
313
|
meta: {
|
|
314
314
|
schemaVersion: "1.0";
|
|
315
315
|
labelTranslationKey?: string | undefined;
|
|
316
316
|
};
|
|
317
|
-
attributes
|
|
317
|
+
attributes?: {
|
|
318
318
|
maxLength?: number | undefined;
|
|
319
319
|
minLength?: number | undefined;
|
|
320
320
|
pattern?: string | undefined;
|
|
321
|
-
};
|
|
321
|
+
} | undefined;
|
|
322
322
|
}, {
|
|
323
323
|
type: "url";
|
|
324
324
|
meta: {
|
|
325
325
|
schemaVersion: "1.0";
|
|
326
326
|
labelTranslationKey?: string | undefined;
|
|
327
327
|
};
|
|
328
|
-
attributes
|
|
328
|
+
attributes?: {
|
|
329
329
|
maxLength?: number | undefined;
|
|
330
330
|
minLength?: number | undefined;
|
|
331
331
|
pattern?: string | undefined;
|
|
332
|
-
};
|
|
332
|
+
} | undefined;
|
|
333
333
|
}>;
|
|
334
334
|
export type BooleanQuestionType = z.infer<typeof BooleanQuestionSchema>;
|
|
335
335
|
export type CurrencyQuestionType = z.infer<typeof CurrencyQuestionSchema>;
|
|
@@ -8,7 +8,7 @@ exports.BooleanQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
|
8
8
|
type: zod_1.z.literal('boolean'), // The type of question
|
|
9
9
|
attributes: zod_1.z.object({
|
|
10
10
|
checked: zod_1.z.boolean().optional() // If it is checked by default when rendered (default is false)
|
|
11
|
-
})
|
|
11
|
+
}).optional(),
|
|
12
12
|
}));
|
|
13
13
|
// A number question and answer
|
|
14
14
|
exports.NumberQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
@@ -17,7 +17,7 @@ exports.NumberQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
|
17
17
|
max: zod_1.z.number().optional(), // The maximum value (no default)
|
|
18
18
|
min: zod_1.z.number().optional(), // The minimum value (default is 0)
|
|
19
19
|
step: zod_1.z.number().optional() // The step value (use 0.01 or similar for float)
|
|
20
|
-
})
|
|
20
|
+
}).optional(),
|
|
21
21
|
}));
|
|
22
22
|
// Currency question and answer
|
|
23
23
|
exports.CurrencyQuestionSchema = exports.NumberQuestionSchema.merge(zod_1.z.object({
|
|
@@ -34,7 +34,7 @@ exports.EmailQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
|
34
34
|
minLength: zod_1.z.number().optional(), // The minimum length of the email (no default)
|
|
35
35
|
multiple: zod_1.z.boolean().optional(), // Allow multiple emails (default is false; comma separated)
|
|
36
36
|
pattern: zod_1.z.string().optional() // The regex pattern to match (no default)
|
|
37
|
-
})
|
|
37
|
+
}).optional(),
|
|
38
38
|
}));
|
|
39
39
|
// Text area question and answer
|
|
40
40
|
exports.TextAreaQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
@@ -44,7 +44,7 @@ exports.TextAreaQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object(
|
|
|
44
44
|
maxLength: zod_1.z.number().optional(), // The maximum length of the text (no default)
|
|
45
45
|
minLength: zod_1.z.number().optional(), // The minimum length of the text (no default)
|
|
46
46
|
rows: zod_1.z.number().optional() // The number of rows (default is 2)
|
|
47
|
-
}),
|
|
47
|
+
}).optional(),
|
|
48
48
|
meta: zod_1.z.object({
|
|
49
49
|
asRichText: zod_1.z.boolean().optional() // Whether to use rich text (default is false)
|
|
50
50
|
})
|
|
@@ -56,7 +56,7 @@ exports.TextQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
|
56
56
|
maxLength: zod_1.z.number().optional(), // The maximum length of the text (no default)
|
|
57
57
|
minLength: zod_1.z.number().optional(), // The minimum length of the text (no default)
|
|
58
58
|
pattern: zod_1.z.string().optional() // The regex pattern to match (no default)
|
|
59
|
-
}),
|
|
59
|
+
}).optional(),
|
|
60
60
|
}));
|
|
61
61
|
// URL question and answer
|
|
62
62
|
exports.URLQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
@@ -65,5 +65,5 @@ exports.URLQuestionSchema = question_1.QuestionSchema.merge(zod_1.z.object({
|
|
|
65
65
|
maxLength: zod_1.z.number().optional(), // The maximum length of the URL (no default)
|
|
66
66
|
minLength: zod_1.z.number().optional(), // The minimum length of the URL (no default)
|
|
67
67
|
pattern: zod_1.z.string().optional() // The regex pattern to match (no default)
|
|
68
|
-
})
|
|
68
|
+
}).optional(),
|
|
69
69
|
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const CURRENT_SCHEMA_VERSION = "1.0";
|
|
3
|
-
export declare const QuestionTypesEnum: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "
|
|
3
|
+
export declare const QuestionTypesEnum: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
|
|
4
4
|
export declare const QuestionSchema: z.ZodObject<{
|
|
5
|
-
type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "
|
|
5
|
+
type: z.ZodEnum<["boolean", "checkBoxes", "currency", "datePicker", "dateRange", "email", "filteredSearch", "number", "radioButtons", "selectBox", "table", "text", "textArea", "typeaheadSearch", "url"]>;
|
|
6
6
|
meta: z.ZodObject<{
|
|
7
7
|
schemaVersion: z.ZodLiteral<"1.0">;
|
|
8
8
|
labelTranslationKey: z.ZodOptional<z.ZodString>;
|
|
@@ -14,13 +14,13 @@ export declare const QuestionSchema: z.ZodObject<{
|
|
|
14
14
|
labelTranslationKey?: string | undefined;
|
|
15
15
|
}>;
|
|
16
16
|
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "
|
|
17
|
+
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
|
|
18
18
|
meta: {
|
|
19
19
|
schemaVersion: "1.0";
|
|
20
20
|
labelTranslationKey?: string | undefined;
|
|
21
21
|
};
|
|
22
22
|
}, {
|
|
23
|
-
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "
|
|
23
|
+
type: "number" | "boolean" | "checkBoxes" | "currency" | "datePicker" | "dateRange" | "email" | "filteredSearch" | "radioButtons" | "selectBox" | "table" | "text" | "textArea" | "typeaheadSearch" | "url";
|
|
24
24
|
meta: {
|
|
25
25
|
schemaVersion: "1.0";
|
|
26
26
|
labelTranslationKey?: string | undefined;
|