@encatch/schema 0.1.22 → 0.1.23
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
CHANGED
|
@@ -393,84 +393,39 @@ var combinedQuestionSchema = z.discriminatedUnion("type", [
|
|
|
393
393
|
|
|
394
394
|
// src/schemas/fields/answer-schema.ts
|
|
395
395
|
import { z as z2 } from "zod";
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
})
|
|
406
|
-
|
|
407
|
-
)
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
"
|
|
415
|
-
)
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
value: z2.number().describe(
|
|
419
|
-
"The numerical value representing the position on the scale (e.g., 1-5, 1-10)"
|
|
420
|
-
)
|
|
421
|
-
}).describe(
|
|
422
|
-
"A scale answer where the user selects a numerical value on a scale"
|
|
423
|
-
);
|
|
424
|
-
var ContinuousSumAnswerSchema = z2.object({
|
|
425
|
-
type: z2.literal("continuous_sum").describe("Indicates this is a continuous sum answer"),
|
|
426
|
-
values: z2.array(
|
|
427
|
-
z2.object({
|
|
428
|
-
optionId: z2.string().describe("The ID of the option being rated"),
|
|
429
|
-
value: z2.number().describe("The numerical value assigned to this option")
|
|
430
|
-
})
|
|
431
|
-
).describe(
|
|
432
|
-
"Array of option-value pairs where the sum of all values represents a total allocation"
|
|
433
|
-
)
|
|
434
|
-
}).describe(
|
|
435
|
-
"A continuous sum answer where users distribute values across multiple options that add up to a total"
|
|
436
|
-
);
|
|
437
|
-
var RankingAnswerSchema = z2.object({
|
|
438
|
-
type: z2.literal("ranking").describe("Indicates this is a ranking answer"),
|
|
439
|
-
ranks: z2.array(
|
|
440
|
-
z2.object({
|
|
441
|
-
optionId: z2.string().describe("The ID of the option being ranked"),
|
|
442
|
-
rank: z2.number().describe(
|
|
443
|
-
"The rank position of this option (lower numbers indicate higher preference)"
|
|
444
|
-
)
|
|
445
|
-
})
|
|
446
|
-
).describe(
|
|
447
|
-
"Array of option-rank pairs showing the user's preference ordering"
|
|
396
|
+
var AnnotationMarkerSchema = z2.object({
|
|
397
|
+
marker_no: z2.string(),
|
|
398
|
+
timeline: z2.string(),
|
|
399
|
+
comment: z2.string()
|
|
400
|
+
});
|
|
401
|
+
var AnnotationSchema = z2.object({
|
|
402
|
+
file_type: z2.string(),
|
|
403
|
+
file_name: z2.string(),
|
|
404
|
+
markers: z2.array(AnnotationMarkerSchema)
|
|
405
|
+
});
|
|
406
|
+
var AnswerItemSchema = z2.object({
|
|
407
|
+
nps: z2.number().optional().describe("Net Promoter Score value (e.g., 0-10)"),
|
|
408
|
+
nested_selection: z2.array(z2.string()).optional().describe("Array of selected nested option IDs"),
|
|
409
|
+
long_text: z2.string().optional().describe("Long text answer, e.g., paragraph or essay"),
|
|
410
|
+
short_answer: z2.string().optional().describe("Short text answer, e.g., single sentence or word"),
|
|
411
|
+
single_choice: z2.string().optional().describe(
|
|
412
|
+
"Array with a single selected option ID (for single choice questions)"
|
|
413
|
+
),
|
|
414
|
+
rating: z2.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
415
|
+
multiple_choice_multiple: z2.array(z2.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
|
|
416
|
+
annotation: AnnotationSchema.optional().describe(
|
|
417
|
+
"Annotation object containing file and marker details"
|
|
448
418
|
)
|
|
449
|
-
}).describe(
|
|
450
|
-
"
|
|
451
|
-
);
|
|
452
|
-
var TextAnswerSchema = z2.object({
|
|
453
|
-
type: z2.literal("text").describe("Indicates this is a text-based answer"),
|
|
454
|
-
values: z2.array(
|
|
455
|
-
z2.object({
|
|
456
|
-
fieldId: z2.string().describe("The ID of the text field"),
|
|
457
|
-
text: z2.string().describe("The text content entered by the user")
|
|
458
|
-
})
|
|
459
|
-
).describe("Array of field-text pairs for multiple text input fields")
|
|
460
|
-
}).describe(
|
|
461
|
-
"A text answer containing responses to one or more text input fields"
|
|
462
|
-
);
|
|
463
|
-
var AnswerSchema = z2.discriminatedUnion("type", [
|
|
464
|
-
SimpleAnswerSchema,
|
|
465
|
-
ChoiceAnswerSchema,
|
|
466
|
-
MultipleChoiceAnswerSchema,
|
|
467
|
-
ScaleAnswerSchema,
|
|
468
|
-
ContinuousSumAnswerSchema,
|
|
469
|
-
RankingAnswerSchema,
|
|
470
|
-
TextAnswerSchema
|
|
471
|
-
]).describe(
|
|
472
|
-
"A union of all possible answer types discriminated by the 'type' field"
|
|
419
|
+
}).catchall(z2.any()).describe(
|
|
420
|
+
"Flexible answer item supporting various question types and custom fields"
|
|
473
421
|
);
|
|
422
|
+
var QuestionsResponseSchema = z2.object({
|
|
423
|
+
question_id: z2.string(),
|
|
424
|
+
title: z2.string(),
|
|
425
|
+
answer: AnswerItemSchema,
|
|
426
|
+
type: z2.string()
|
|
427
|
+
});
|
|
428
|
+
var AnswerSchema = AnswerItemSchema;
|
|
474
429
|
|
|
475
430
|
// src/schemas/fields/form-schema.ts
|
|
476
431
|
import { z as z3 } from "zod";
|
|
@@ -1203,17 +1158,17 @@ var fetchConfigurationListResponseSchema = z12.object({
|
|
|
1203
1158
|
// src/index.ts
|
|
1204
1159
|
import { z as z13 } from "zod";
|
|
1205
1160
|
export {
|
|
1161
|
+
AnnotationMarkerSchema,
|
|
1162
|
+
AnnotationSchema,
|
|
1163
|
+
AnswerItemSchema,
|
|
1206
1164
|
AnswerSchema,
|
|
1207
|
-
ChoiceAnswerSchema,
|
|
1208
1165
|
ChoiceOrderOptions,
|
|
1209
|
-
ContinuousSumAnswerSchema,
|
|
1210
1166
|
DeviceThemes,
|
|
1211
1167
|
DismissBehaviors,
|
|
1212
1168
|
EndFieldsTranslationSchema,
|
|
1213
1169
|
EndScreenFieldsSchema,
|
|
1214
1170
|
LanguageFieldSchema,
|
|
1215
1171
|
LanguagesSchema,
|
|
1216
|
-
MultipleChoiceAnswerSchema,
|
|
1217
1172
|
MultipleChoiceDisplayStyles,
|
|
1218
1173
|
MultipleChoiceMultipleDisplayStyles,
|
|
1219
1174
|
OtherFieldsSchema,
|
|
@@ -1222,14 +1177,11 @@ export {
|
|
|
1222
1177
|
PublicationStatuses,
|
|
1223
1178
|
QuestionStatuses,
|
|
1224
1179
|
QuestionTypes,
|
|
1225
|
-
|
|
1180
|
+
QuestionsResponseSchema,
|
|
1226
1181
|
RatingDisplayStyles,
|
|
1227
1182
|
RatingRepresentationSizes,
|
|
1228
1183
|
RecurringUnits,
|
|
1229
|
-
ScaleAnswerSchema,
|
|
1230
|
-
SimpleAnswerSchema,
|
|
1231
1184
|
SurveyTypes,
|
|
1232
|
-
TextAnswerSchema,
|
|
1233
1185
|
ThemeModes,
|
|
1234
1186
|
TranslationProvider,
|
|
1235
1187
|
UserActions,
|