@encatch/schema 0.1.36 → 0.1.37
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/esm/index.js +20 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +26 -0
- package/dist/types/schemas/api/other-schema.d.ts +2 -0
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +13 -0
- package/dist/types/schemas/fields/answer-schema.d.ts +4 -0
- package/dist/types/schemas/fields/app-props-schema.d.ts +12 -0
- package/dist/types/schemas/fields/field-schema.d.ts +24 -0
- package/dist/types/schemas/fields/form-properties-schema.d.ts +12 -0
- package/package.json +26 -24
package/dist/esm/index.js
CHANGED
|
@@ -215,12 +215,24 @@ var nestedOptionSchema = z.lazy(
|
|
|
215
215
|
var multipleChoiceSingleQuestionSchema = questionSchema.extend({
|
|
216
216
|
type: z.literal("single_choice").describe("Must be exactly 'single_choice'"),
|
|
217
217
|
displayStyle: multipleChoiceDisplayStyleSchema.optional().describe("Visual style for displaying options"),
|
|
218
|
+
allowOther: z.boolean().optional().default(false).describe('Whether to allow a custom "other" option'),
|
|
219
|
+
otherTextConfig: z.object({
|
|
220
|
+
minChars: z.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
221
|
+
maxChars: z.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
222
|
+
placeholder: z.string().max(200).optional().describe("Placeholder text for the other text input")
|
|
223
|
+
}).optional().describe('Configuration for the custom "other" text input'),
|
|
218
224
|
randomizeOptions: z.boolean().optional().default(false).describe("Whether to randomize the order of options"),
|
|
219
225
|
options: z.array(questionOptionSchema).min(1).max(50).describe("Array of options for user selection (1-50 options)")
|
|
220
226
|
}).describe("Schema for single-choice multiple selection questions");
|
|
221
227
|
var multipleChoiceMultipleQuestionSchema = questionSchema.extend({
|
|
222
228
|
type: z.literal("multiple_choice_multiple").describe("Must be exactly 'multiple_choice_multiple'"),
|
|
223
229
|
displayStyle: multipleChoiceMultipleDisplayStyleSchema.optional().describe("Visual style for displaying multiple options"),
|
|
230
|
+
allowOther: z.boolean().optional().default(false).describe('Whether to allow a custom "other" option'),
|
|
231
|
+
otherTextConfig: z.object({
|
|
232
|
+
minChars: z.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
233
|
+
maxChars: z.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
234
|
+
placeholder: z.string().max(200).optional().describe("Placeholder text for the other text input")
|
|
235
|
+
}).optional().describe('Configuration for the custom "other" text input'),
|
|
224
236
|
minSelections: z.number().int().min(0).optional().describe("Minimum number of options that must be selected"),
|
|
225
237
|
maxSelections: z.number().int().min(1).optional().describe("Maximum number of options that can be selected"),
|
|
226
238
|
randomizeOptions: z.boolean().optional().default(false).describe("Whether to randomize the order of options"),
|
|
@@ -413,6 +425,12 @@ var AnswerItemSchema = z2.object({
|
|
|
413
425
|
),
|
|
414
426
|
rating: z2.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
415
427
|
multipleChoiceMultiple: z2.array(z2.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
|
|
428
|
+
singleChoiceOther: z2.string().optional().describe(
|
|
429
|
+
'Free-text "other" answer for single choice questions when allowOther is enabled'
|
|
430
|
+
),
|
|
431
|
+
multipleChoiceOther: z2.string().optional().describe(
|
|
432
|
+
'Free-text "other" answer for multiple choice questions when allowOther is enabled'
|
|
433
|
+
),
|
|
416
434
|
annotation: AnnotationSchema.optional().describe(
|
|
417
435
|
"Annotation object containing file and marker details"
|
|
418
436
|
),
|
|
@@ -1033,7 +1051,8 @@ var deviceInfoSchema = z10.object({
|
|
|
1033
1051
|
$osVersion: z10.string().describe("Version of the operating system"),
|
|
1034
1052
|
$appVersion: z10.string().describe("Version of the application"),
|
|
1035
1053
|
$app: z10.string().describe("Browser or application being used"),
|
|
1036
|
-
$language: z10.string().describe("Language preference (e.g., 'en-GB')")
|
|
1054
|
+
$language: z10.string().describe("Language preference (e.g., 'en-GB')"),
|
|
1055
|
+
$deviceId: z10.string().describe("Unique device identifier")
|
|
1037
1056
|
}).describe("Device information collected from the client");
|
|
1038
1057
|
var sessionInfoSchema = z10.object({
|
|
1039
1058
|
$sessionId: z10.string().uuid().describe("Unique session identifier"),
|