@encatch/schema 0.1.21 → 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 +38 -85
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +68 -120
- package/dist/types/schemas/fields/answer-schema.d.ts +72 -70
- package/dist/types/schemas/fields/form-properties-schema.d.ts +1 -0
- package/dist/types/schemas/fields/form-schema.d.ts +3 -0
- package/package.json +1 -1
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";
|
|
@@ -545,11 +500,12 @@ var externalPublishingPropertiesSchema = z3.object({
|
|
|
545
500
|
isShareable: z3.boolean().describe("Whether the feedback results can be shared externally"),
|
|
546
501
|
isEmailShareable: z3.boolean().describe("Whether the feedback can be shared via email")
|
|
547
502
|
}).describe("Schema defining external publishing and sharing properties for feedback");
|
|
548
|
-
var publicationStatusSchema = z3.enum(["P", "D", "A"]).describe("Publication status: P=Published, D=Draft, A=Archived");
|
|
503
|
+
var publicationStatusSchema = z3.enum(["P", "D", "A", "S"]).describe("Publication status: P=Published, D=Draft, A=Archived, S=Stopped");
|
|
549
504
|
var PublicationStatuses = {
|
|
550
505
|
PUBLISHED: "P",
|
|
551
506
|
DRAFT: "D",
|
|
552
|
-
ARCHIVED: "A"
|
|
507
|
+
ARCHIVED: "A",
|
|
508
|
+
STOPPED: "S"
|
|
553
509
|
};
|
|
554
510
|
var feedbackConfigurationSchema = z3.object({
|
|
555
511
|
form_title: z3.string().describe("Title of the feedback form"),
|
|
@@ -1202,17 +1158,17 @@ var fetchConfigurationListResponseSchema = z12.object({
|
|
|
1202
1158
|
// src/index.ts
|
|
1203
1159
|
import { z as z13 } from "zod";
|
|
1204
1160
|
export {
|
|
1161
|
+
AnnotationMarkerSchema,
|
|
1162
|
+
AnnotationSchema,
|
|
1163
|
+
AnswerItemSchema,
|
|
1205
1164
|
AnswerSchema,
|
|
1206
|
-
ChoiceAnswerSchema,
|
|
1207
1165
|
ChoiceOrderOptions,
|
|
1208
|
-
ContinuousSumAnswerSchema,
|
|
1209
1166
|
DeviceThemes,
|
|
1210
1167
|
DismissBehaviors,
|
|
1211
1168
|
EndFieldsTranslationSchema,
|
|
1212
1169
|
EndScreenFieldsSchema,
|
|
1213
1170
|
LanguageFieldSchema,
|
|
1214
1171
|
LanguagesSchema,
|
|
1215
|
-
MultipleChoiceAnswerSchema,
|
|
1216
1172
|
MultipleChoiceDisplayStyles,
|
|
1217
1173
|
MultipleChoiceMultipleDisplayStyles,
|
|
1218
1174
|
OtherFieldsSchema,
|
|
@@ -1221,14 +1177,11 @@ export {
|
|
|
1221
1177
|
PublicationStatuses,
|
|
1222
1178
|
QuestionStatuses,
|
|
1223
1179
|
QuestionTypes,
|
|
1224
|
-
|
|
1180
|
+
QuestionsResponseSchema,
|
|
1225
1181
|
RatingDisplayStyles,
|
|
1226
1182
|
RatingRepresentationSizes,
|
|
1227
1183
|
RecurringUnits,
|
|
1228
|
-
ScaleAnswerSchema,
|
|
1229
|
-
SimpleAnswerSchema,
|
|
1230
1184
|
SurveyTypes,
|
|
1231
|
-
TextAnswerSchema,
|
|
1232
1185
|
ThemeModes,
|
|
1233
1186
|
TranslationProvider,
|
|
1234
1187
|
UserActions,
|