@encatch/schema 1.1.0 → 1.2.0-beta.0
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 +425 -28
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +2441 -395
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +372 -0
- package/dist/types/schemas/fields/answer-schema.d.ts +196 -0
- package/dist/types/schemas/fields/app-props-schema.d.ts +1046 -18
- package/dist/types/schemas/fields/field-schema.d.ts +2438 -240
- package/dist/types/schemas/fields/form-properties-schema.d.ts +1058 -17
- package/dist/types/schemas/fields/other-screen-schema.d.ts +6 -0
- package/dist/types/schemas/fields/theme-schema.d.ts +2 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -294,7 +294,22 @@ var questionTypeSchema = z2.enum([
|
|
|
294
294
|
"matrix_single_choice",
|
|
295
295
|
"matrix_multiple_choice",
|
|
296
296
|
"exit_form",
|
|
297
|
-
"consent"
|
|
297
|
+
"consent",
|
|
298
|
+
"date",
|
|
299
|
+
"csat",
|
|
300
|
+
"opinion_scale",
|
|
301
|
+
"ranking",
|
|
302
|
+
"picture_choice",
|
|
303
|
+
"signature",
|
|
304
|
+
"file_upload",
|
|
305
|
+
"email",
|
|
306
|
+
"number",
|
|
307
|
+
"website",
|
|
308
|
+
"phone_number",
|
|
309
|
+
"address",
|
|
310
|
+
"video_audio",
|
|
311
|
+
"scheduler",
|
|
312
|
+
"qna_with_ai"
|
|
298
313
|
]).describe("Enumeration of all supported question types for form fields");
|
|
299
314
|
var QuestionTypes = {
|
|
300
315
|
RATING: "rating",
|
|
@@ -313,7 +328,22 @@ var QuestionTypes = {
|
|
|
313
328
|
MATRIX_SINGLE_CHOICE: "matrix_single_choice",
|
|
314
329
|
MATRIX_MULTIPLE_CHOICE: "matrix_multiple_choice",
|
|
315
330
|
EXIT_FORM: "exit_form",
|
|
316
|
-
CONSENT: "consent"
|
|
331
|
+
CONSENT: "consent",
|
|
332
|
+
DATE: "date",
|
|
333
|
+
CSAT: "csat",
|
|
334
|
+
OPINION_SCALE: "opinion_scale",
|
|
335
|
+
RANKING: "ranking",
|
|
336
|
+
PICTURE_CHOICE: "picture_choice",
|
|
337
|
+
SIGNATURE: "signature",
|
|
338
|
+
FILE_UPLOAD: "file_upload",
|
|
339
|
+
EMAIL: "email",
|
|
340
|
+
NUMBER: "number",
|
|
341
|
+
WEBSITE: "website",
|
|
342
|
+
PHONE_NUMBER: "phone_number",
|
|
343
|
+
ADDRESS: "address",
|
|
344
|
+
VIDEO_AUDIO: "video_audio",
|
|
345
|
+
SCHEDULER: "scheduler",
|
|
346
|
+
QNA_WITH_AI: "qna_with_ai"
|
|
317
347
|
};
|
|
318
348
|
var validationRuleTypeSchema = z2.enum([
|
|
319
349
|
"required",
|
|
@@ -426,23 +456,27 @@ var multipleChoiceDisplayStyleSchema = z2.enum([
|
|
|
426
456
|
"radio",
|
|
427
457
|
"list",
|
|
428
458
|
"chip",
|
|
429
|
-
"dropdown"
|
|
459
|
+
"dropdown",
|
|
460
|
+
"autosuggest"
|
|
430
461
|
]);
|
|
431
462
|
var MultipleChoiceDisplayStyles = {
|
|
432
463
|
RADIO: "radio",
|
|
433
464
|
LIST: "list",
|
|
434
465
|
CHIP: "chip",
|
|
435
|
-
DROPDOWN: "dropdown"
|
|
466
|
+
DROPDOWN: "dropdown",
|
|
467
|
+
AUTOSUGGEST: "autosuggest"
|
|
436
468
|
};
|
|
437
469
|
var multipleChoiceMultipleDisplayStyleSchema = z2.enum([
|
|
438
470
|
"checkbox",
|
|
439
471
|
"list",
|
|
440
|
-
"chip"
|
|
472
|
+
"chip",
|
|
473
|
+
"autosuggest"
|
|
441
474
|
]);
|
|
442
475
|
var MultipleChoiceMultipleDisplayStyles = {
|
|
443
476
|
CHECKBOX: "checkbox",
|
|
444
477
|
LIST: "list",
|
|
445
|
-
CHIP: "chip"
|
|
478
|
+
CHIP: "chip",
|
|
479
|
+
AUTOSUGGEST: "autosuggest"
|
|
446
480
|
};
|
|
447
481
|
var yesNoDisplayStyleSchema = z2.enum(["horizontal", "vertical"]);
|
|
448
482
|
var YesNoDisplayStyles = {
|
|
@@ -490,7 +524,8 @@ var questionSchema = z2.object({
|
|
|
490
524
|
),
|
|
491
525
|
nextButtonLabel: z2.string().min(1).max(50).default("Next").describe(
|
|
492
526
|
"Label for the next button when advancing past this question (overrides section or form defaults when set)"
|
|
493
|
-
)
|
|
527
|
+
),
|
|
528
|
+
showQuestionTitle: z2.boolean().default(true).describe("Whether to display the question title; defaults to true")
|
|
494
529
|
}).describe("Base schema for all question types with common properties");
|
|
495
530
|
var ratingQuestionSchema = questionSchema.extend({
|
|
496
531
|
type: z2.literal("rating").describe("Must be exactly 'rating'"),
|
|
@@ -645,6 +680,7 @@ var questionOptionSchema = z2.object({
|
|
|
645
680
|
id: z2.string().describe("Unique identifier for this option (system time milliseconds)"),
|
|
646
681
|
value: z2.string().min(1).max(100).describe("The internal value used for this option"),
|
|
647
682
|
label: z2.string().min(1).max(200).describe("The display text shown to users for this option"),
|
|
683
|
+
hint: z2.string().max(300).optional().describe("Optional short description shown below the option label to help respondents understand what they are selecting or ranking"),
|
|
648
684
|
describe: z2.string().max(500).optional().describe(
|
|
649
685
|
"LLM tool call description providing context about this option"
|
|
650
686
|
),
|
|
@@ -670,7 +706,8 @@ var multipleChoiceSingleQuestionSchema = questionSchema.extend({
|
|
|
670
706
|
otherTextConfig: z2.object({
|
|
671
707
|
minChars: z2.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
672
708
|
maxChars: z2.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
673
|
-
placeholder: z2.string().max(200).optional().describe("Placeholder text for the other text input")
|
|
709
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
710
|
+
showLimitIndicatorThreshold: z2.number().int().min(0).optional().describe("Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show")
|
|
674
711
|
}).optional().describe('Configuration for the custom "other" text input'),
|
|
675
712
|
randomizeOptions: z2.boolean().optional().default(false).describe("Whether to randomize the order of options"),
|
|
676
713
|
options: z2.array(questionOptionSchema).min(1).max(50).describe("Array of options for user selection (1-50 options)")
|
|
@@ -682,7 +719,8 @@ var multipleChoiceMultipleQuestionSchema = questionSchema.extend({
|
|
|
682
719
|
otherTextConfig: z2.object({
|
|
683
720
|
minChars: z2.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
684
721
|
maxChars: z2.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
685
|
-
placeholder: z2.string().max(200).optional().describe("Placeholder text for the other text input")
|
|
722
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
723
|
+
showLimitIndicatorThreshold: z2.number().int().min(0).optional().describe("Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show")
|
|
686
724
|
}).optional().describe('Configuration for the custom "other" text input'),
|
|
687
725
|
minSelections: z2.number().int().min(0).optional().describe("Minimum number of options that must be selected"),
|
|
688
726
|
maxSelections: z2.number().int().min(1).optional().describe("Maximum number of options that can be selected"),
|
|
@@ -710,7 +748,10 @@ var npsQuestionSchema = questionSchema.extend({
|
|
|
710
748
|
minLabel: z2.string().max(100).optional().describe("Label for the minimum NPS value (0)"),
|
|
711
749
|
maxLabel: z2.string().max(100).optional().describe("Label for the maximum NPS value (10)"),
|
|
712
750
|
scaleLabels: z2.record(z2.string().regex(/^\d+$/), z2.string().max(50)).optional().describe("Custom labels for specific NPS values (0-10)"),
|
|
713
|
-
prepopulatedValue: z2.number().int().min(0).max(10).optional().describe("Default value to pre-select (0-10)")
|
|
751
|
+
prepopulatedValue: z2.number().int().min(0).max(10).optional().describe("Default value to pre-select (0-10)"),
|
|
752
|
+
detractorColor: z2.string().max(50).optional().describe("Color applied to detractor scores (0\u20136); accepts any valid CSS color value (hex, rgb, hsl, named)"),
|
|
753
|
+
passiveColor: z2.string().max(50).optional().describe("Color applied to passive scores (7\u20138); accepts any valid CSS color value"),
|
|
754
|
+
promoterColor: z2.string().max(50).optional().describe("Color applied to promoter scores (9\u201310); accepts any valid CSS color value")
|
|
714
755
|
}).refine(
|
|
715
756
|
(data) => {
|
|
716
757
|
if (data.scaleLabels) {
|
|
@@ -731,6 +772,7 @@ var shortAnswerQuestionSchema = questionSchema.extend({
|
|
|
731
772
|
type: z2.literal("short_answer").describe("Must be exactly 'short_answer'"),
|
|
732
773
|
maxCharacters: z2.number().int().min(1).max(1e4).optional().describe("Maximum number of characters allowed"),
|
|
733
774
|
minCharacters: z2.number().int().min(0).optional().describe("Minimum number of characters required"),
|
|
775
|
+
showLimitIndicatorThreshold: z2.number().int().min(0).optional().describe("Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"),
|
|
734
776
|
placeholder: z2.string().max(200).optional().describe("Placeholder text shown in the input field"),
|
|
735
777
|
enableRegexValidation: z2.boolean().optional().default(false).describe("Whether to enable regex pattern validation"),
|
|
736
778
|
regexPattern: z2.string().optional().describe("Regular expression pattern for validation"),
|
|
@@ -778,6 +820,7 @@ var longAnswerQuestionSchema = questionSchema.extend({
|
|
|
778
820
|
"Maximum number of characters allowed (higher limit for long text)"
|
|
779
821
|
),
|
|
780
822
|
minCharacters: z2.number().int().min(0).optional().describe("Minimum number of characters required"),
|
|
823
|
+
showLimitIndicatorThreshold: z2.number().int().min(0).optional().describe("Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"),
|
|
781
824
|
rows: z2.number().int().min(1).max(20).optional().describe("Number of textarea rows to display (1-20)"),
|
|
782
825
|
placeholder: z2.string().max(500).optional().describe("Placeholder text for the textarea (longer for long text)"),
|
|
783
826
|
enableEnhanceWithAi: z2.boolean().optional().default(false).describe("Whether to enable AI enhancement features"),
|
|
@@ -839,6 +882,225 @@ var nestedDropdownQuestionSchema = questionSchema.extend({
|
|
|
839
882
|
).describe(
|
|
840
883
|
"Schema for nested dropdown questions with hierarchical option structure"
|
|
841
884
|
);
|
|
885
|
+
var dateFormatSchema = z2.enum([
|
|
886
|
+
"MM/DD/YYYY",
|
|
887
|
+
"DD/MM/YYYY",
|
|
888
|
+
"YYYY/MM/DD"
|
|
889
|
+
]);
|
|
890
|
+
var DateFormats = {
|
|
891
|
+
MM_DD_YYYY: "MM/DD/YYYY",
|
|
892
|
+
DD_MM_YYYY: "DD/MM/YYYY",
|
|
893
|
+
YYYY_MM_DD: "YYYY/MM/DD"
|
|
894
|
+
};
|
|
895
|
+
var dateSeparatorSchema = z2.enum(["/", "-", "."]);
|
|
896
|
+
var DateSeparators = {
|
|
897
|
+
SLASH: "/",
|
|
898
|
+
DASH: "-",
|
|
899
|
+
DOT: "."
|
|
900
|
+
};
|
|
901
|
+
var dateQuestionSchema = questionSchema.extend({
|
|
902
|
+
type: z2.literal("date").describe("Must be exactly 'date'"),
|
|
903
|
+
format: dateFormatSchema.optional().default("DD/MM/YYYY").describe("Order of day, month, and year segments in the input"),
|
|
904
|
+
separator: dateSeparatorSchema.optional().default("/").describe("Character used to separate day, month, and year segments"),
|
|
905
|
+
includeTime: z2.boolean().optional().default(false).describe("Whether to also collect a time (HH:MM) alongside the date"),
|
|
906
|
+
minDate: z2.string().optional().describe("Earliest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no lower bound is enforced"),
|
|
907
|
+
maxDate: z2.string().optional().describe("Latest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no upper bound is enforced"),
|
|
908
|
+
placeholder: z2.string().max(50).optional().describe("Placeholder text shown in the date input"),
|
|
909
|
+
prepopulatedValue: z2.string().optional().describe("Default date value in ISO 8601 format (YYYY-MM-DD) to pre-fill the input")
|
|
910
|
+
}).describe("Schema for a date question that collects a structured date (and optionally time) from the respondent");
|
|
911
|
+
var csatScaleSchema = z2.union([
|
|
912
|
+
z2.literal(2),
|
|
913
|
+
z2.literal(3),
|
|
914
|
+
z2.literal(4),
|
|
915
|
+
z2.literal(5)
|
|
916
|
+
]);
|
|
917
|
+
var CsatScales = {
|
|
918
|
+
TWO: 2,
|
|
919
|
+
THREE: 3,
|
|
920
|
+
FOUR: 4,
|
|
921
|
+
FIVE: 5
|
|
922
|
+
};
|
|
923
|
+
var csatDisplayStyleSchema = z2.enum(["emoji", "text"]);
|
|
924
|
+
var CsatDisplayStyles = {
|
|
925
|
+
EMOJI: "emoji",
|
|
926
|
+
TEXT: "text"
|
|
927
|
+
};
|
|
928
|
+
var csatQuestionSchema = questionSchema.extend({
|
|
929
|
+
type: z2.literal("csat").describe("Must be exactly 'csat'"),
|
|
930
|
+
scale: csatScaleSchema.optional().default(5).describe("Number of response points (2\u20135); 2 and 4 have no neutral option, default is 5"),
|
|
931
|
+
displayStyle: csatDisplayStyleSchema.optional().default("emoji").describe("How response options are rendered \u2014 emoji faces (default) or text buttons"),
|
|
932
|
+
multicolor: z2.boolean().optional().default(false).describe("Whether to apply distinct colors to negative, neutral, and positive segments"),
|
|
933
|
+
negativeColor: z2.string().max(50).optional().describe("Color for negative response options (semantic values -2, -1); any valid CSS color; used when multicolor is true"),
|
|
934
|
+
neutralColor: z2.string().max(50).optional().describe("Color for the neutral response option (semantic value 0); any valid CSS color; used when multicolor is true"),
|
|
935
|
+
positiveColor: z2.string().max(50).optional().describe("Color for positive response options (semantic values 1, 2); any valid CSS color; used when multicolor is true"),
|
|
936
|
+
showLabels: z2.boolean().optional().default(false).describe("Whether to render per-point labels below each response option"),
|
|
937
|
+
scaleLabels: z2.record(z2.string(), z2.string().max(100)).optional().describe("Per-point label text keyed by semantic value string ('-2', '-1', '0', '1', '2')")
|
|
938
|
+
}).describe("Schema for a CSAT (Customer Satisfaction Score) question using a 2\u20135 point semantic scale");
|
|
939
|
+
var opinionScaleQuestionSchema = questionSchema.extend({
|
|
940
|
+
type: z2.literal("opinion_scale").describe("Must be exactly 'opinion_scale'"),
|
|
941
|
+
startValue: z2.union([z2.literal(0), z2.literal(1)]).optional().default(0).describe("Starting value of the scale \u2014 0 (default) or 1"),
|
|
942
|
+
steps: z2.number().int().min(5).max(11).optional().default(11).describe("Number of points on the scale (5\u201311); default 11 gives a 0\u201310 or 1\u201311 range depending on startValue"),
|
|
943
|
+
minLabel: z2.string().max(100).optional().describe("Optional label anchoring the low end of the scale (e.g. 'Not at all likely')"),
|
|
944
|
+
maxLabel: z2.string().max(100).optional().describe("Optional label anchoring the high end of the scale (e.g. 'Extremely likely')")
|
|
945
|
+
}).describe("Schema for an opinion scale question \u2014 a horizontal numeric button scale with configurable range and optional end labels");
|
|
946
|
+
var rankingDisplayStyleSchema = z2.enum(["drag_drop", "dropdown", "up_down"]);
|
|
947
|
+
var RankingDisplayStyles = {
|
|
948
|
+
DRAG_DROP: "drag_drop",
|
|
949
|
+
DROPDOWN: "dropdown",
|
|
950
|
+
UP_DOWN: "up_down"
|
|
951
|
+
};
|
|
952
|
+
var rankingQuestionSchema = questionSchema.extend({
|
|
953
|
+
type: z2.literal("ranking").describe("Must be exactly 'ranking'"),
|
|
954
|
+
options: z2.array(questionOptionSchema).min(2).max(30).describe("List of items to rank (2\u201330 items); each item supports an optional hint for clarification"),
|
|
955
|
+
randomizeOptions: z2.boolean().optional().default(false).describe("Whether to shuffle item order per respondent to avoid position bias"),
|
|
956
|
+
displayStyle: rankingDisplayStyleSchema.optional().default("drag_drop").describe("Interaction mode \u2014 drag_drop (default) for drag-and-drop reordering, dropdown for selecting a rank number per item, up_down for arrow button reordering"),
|
|
957
|
+
maxRank: z2.number().int().min(1).optional().describe("Maximum number of items the respondent must rank (e.g. 3 = 'rank your top 3'); when absent all items must be ranked")
|
|
958
|
+
}).refine(
|
|
959
|
+
(data) => data.maxRank === void 0 || data.maxRank <= data.options.length,
|
|
960
|
+
{
|
|
961
|
+
message: "maxRank cannot exceed the number of options",
|
|
962
|
+
path: ["maxRank"]
|
|
963
|
+
}
|
|
964
|
+
).describe("Schema for a ranking question where respondents order items by preference");
|
|
965
|
+
var pictureChoiceQuestionSchema = questionSchema.extend({
|
|
966
|
+
type: z2.literal("picture_choice").describe("Must be exactly 'picture_choice'"),
|
|
967
|
+
options: z2.array(questionOptionSchema).min(1).max(50).describe("Array of options; each should include an imageUrl for the picture to display"),
|
|
968
|
+
multiple: z2.boolean().optional().default(false).describe("When true respondents may select more than one image; when false (default) only one image can be selected"),
|
|
969
|
+
minSelections: z2.number().int().min(1).optional().describe("Minimum number of images the respondent must select (only applies when multiple is true)"),
|
|
970
|
+
maxSelections: z2.number().int().min(1).optional().describe("Maximum number of images the respondent may select (only applies when multiple is true)"),
|
|
971
|
+
supersize: z2.boolean().optional().default(false).describe("Whether to display images at an enlarged size"),
|
|
972
|
+
showLabels: z2.boolean().optional().default(true).describe("Whether to show the text label below each image"),
|
|
973
|
+
randomizeOptions: z2.boolean().optional().default(false).describe("Whether to shuffle image order per respondent to avoid position bias"),
|
|
974
|
+
allowOther: z2.boolean().optional().default(false).describe('Whether to include a free-text "other" option'),
|
|
975
|
+
otherTextConfig: z2.object({
|
|
976
|
+
minChars: z2.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
977
|
+
maxChars: z2.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
978
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
979
|
+
showLimitIndicatorThreshold: z2.number().int().min(0).optional().describe("Show the character limit indicator once the user has typed this many characters; 0 = show immediately, absent = never show")
|
|
980
|
+
}).optional().describe('Configuration for the custom "other" text input')
|
|
981
|
+
}).refine(
|
|
982
|
+
(data) => {
|
|
983
|
+
if (data.minSelections !== void 0 && data.maxSelections !== void 0) {
|
|
984
|
+
return data.minSelections <= data.maxSelections;
|
|
985
|
+
}
|
|
986
|
+
return true;
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
message: "minSelections cannot be greater than maxSelections",
|
|
990
|
+
path: ["minSelections"]
|
|
991
|
+
}
|
|
992
|
+
).describe("Schema for a picture choice question where respondents select from image-based options");
|
|
993
|
+
var signatureModeSchema = z2.enum(["type", "draw", "upload"]);
|
|
994
|
+
var SignatureModes = {
|
|
995
|
+
TYPE: "type",
|
|
996
|
+
DRAW: "draw",
|
|
997
|
+
UPLOAD: "upload"
|
|
998
|
+
};
|
|
999
|
+
var signatureQuestionSchema = questionSchema.extend({
|
|
1000
|
+
type: z2.literal("signature").describe("Must be exactly 'signature'"),
|
|
1001
|
+
allowedModes: z2.array(signatureModeSchema).min(1).optional().describe("Which signing methods the respondent can choose from (type, draw, upload); when absent all three are enabled"),
|
|
1002
|
+
defaultMode: signatureModeSchema.optional().describe("Which signing tab is pre-selected when the question is first shown; when absent the platform chooses"),
|
|
1003
|
+
collectSignerEmail: z2.boolean().optional().default(true).describe("Whether to auto-collect the signer's email so a signed PDF copy can be sent to them; set to false if the form already collects an email via signerEmailFieldId or another question"),
|
|
1004
|
+
signerEmailFieldId: z2.string().optional().describe("ID of an existing email question in the form whose value will be used as the signer's email address, instead of auto-appending a new email prompt"),
|
|
1005
|
+
penColor: z2.string().max(50).optional().describe("Stroke color for the draw canvas; any valid CSS color; when absent the theme foreground color is used"),
|
|
1006
|
+
penWidth: z2.number().int().min(1).max(20).optional().describe("Pen stroke thickness in pixels for the draw canvas (1\u201320); when absent the renderer default (typically 2) is used"),
|
|
1007
|
+
backgroundColor: z2.string().max(50).optional().describe("Background color of the draw canvas; any valid CSS color; when absent the canvas is transparent and inherits the form background"),
|
|
1008
|
+
canvasHeight: z2.number().int().min(60).max(600).optional().describe("Draw canvas height in logical pixels (60\u2013600); width always fills the container; when absent the renderer chooses a sensible default (typically 200)"),
|
|
1009
|
+
clearButtonLabel: z2.string().max(50).optional().describe("Label for the clear/redo button in draw mode; when absent the platform default label or icon is shown")
|
|
1010
|
+
}).describe("Schema for a signature question where respondents can type, draw, or upload their electronic signature");
|
|
1011
|
+
var fileUploadQuestionSchema = questionSchema.extend({
|
|
1012
|
+
type: z2.literal("file_upload").describe("Must be exactly 'file_upload'"),
|
|
1013
|
+
allowedFileTypes: z2.array(z2.string()).min(1).optional().describe("MIME types and/or file extensions the respondent is allowed to upload (e.g. ['image/jpeg', '.pdf']); when absent all file types are accepted"),
|
|
1014
|
+
maxFileSizeMb: z2.number().int().min(1).max(100).optional().describe("Maximum size per uploaded file in megabytes (1\u2013100); when absent the platform enforces its own ceiling"),
|
|
1015
|
+
multiple: z2.boolean().optional().default(false).describe("When true the respondent may upload more than one file in a single question; when false (default) only one file is accepted"),
|
|
1016
|
+
maxFiles: z2.number().int().min(1).max(20).optional().describe("Maximum number of files the respondent may upload (1\u201320); only applies when multiple is true; when absent no per-question file count limit is enforced"),
|
|
1017
|
+
placeholder: z2.string().max(200).optional().describe("Text shown inside the upload dropzone to guide respondents (e.g. 'Drop your CV here or click to browse')")
|
|
1018
|
+
}).describe("Schema for a file upload question where respondents can attach one or more files from their device");
|
|
1019
|
+
var emailQuestionSchema = questionSchema.extend({
|
|
1020
|
+
type: z2.literal("email").describe("Must be exactly 'email'"),
|
|
1021
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text shown inside the email input"),
|
|
1022
|
+
prepopulatedValue: z2.string().optional().describe("Default email address to pre-fill the input (e.g. passed via URL param or hidden field)")
|
|
1023
|
+
}).describe("Schema for an email question that only accepts correctly formatted email addresses");
|
|
1024
|
+
var numberQuestionSchema = questionSchema.extend({
|
|
1025
|
+
type: z2.literal("number").describe("Must be exactly 'number'"),
|
|
1026
|
+
min: z2.number().optional().describe("Minimum allowed value (inclusive); when absent no lower bound is enforced"),
|
|
1027
|
+
max: z2.number().optional().describe("Maximum allowed value (inclusive); when absent no upper bound is enforced"),
|
|
1028
|
+
allowDecimal: z2.boolean().optional().default(false).describe("Whether decimal (non-integer) values are accepted; Typeform restricts to whole numbers only, making this a differentiator"),
|
|
1029
|
+
allowNegative: z2.boolean().optional().default(false).describe("Whether negative values are accepted; Typeform restricts to positive numbers only, making this a differentiator"),
|
|
1030
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text shown inside the number input"),
|
|
1031
|
+
prepopulatedValue: z2.number().optional().describe("Default numeric value to pre-fill the input"),
|
|
1032
|
+
unit: z2.string().max(20).optional().describe("Unit label displayed beside the input (e.g. 'kg', '$', 'years')")
|
|
1033
|
+
}).refine(
|
|
1034
|
+
(data) => data.min === void 0 || data.max === void 0 || data.min <= data.max,
|
|
1035
|
+
{
|
|
1036
|
+
message: "min cannot be greater than max",
|
|
1037
|
+
path: ["min"]
|
|
1038
|
+
}
|
|
1039
|
+
).describe("Schema for a number question that only accepts numeric input with configurable range and format constraints");
|
|
1040
|
+
var websiteQuestionSchema = questionSchema.extend({
|
|
1041
|
+
type: z2.literal("website").describe("Must be exactly 'website'"),
|
|
1042
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text shown inside the URL input (e.g. 'https://yoursite.com')"),
|
|
1043
|
+
prepopulatedValue: z2.string().optional().describe("Default URL to pre-fill the input")
|
|
1044
|
+
}).describe("Schema for a website question that collects a URL with built-in format validation");
|
|
1045
|
+
var phoneNumberQuestionSchema = questionSchema.extend({
|
|
1046
|
+
type: z2.literal("phone_number").describe("Must be exactly 'phone_number'"),
|
|
1047
|
+
defaultCountryCode: z2.string().max(2).optional().describe("ISO 3166-1 alpha-2 country code to pre-select in the country picker (e.g. 'US', 'IN'); when absent the platform uses the device/locale default"),
|
|
1048
|
+
allowCountryChange: z2.boolean().optional().default(true).describe("Whether the respondent can change the country code; when false the default country is locked"),
|
|
1049
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text shown inside the phone number input"),
|
|
1050
|
+
prepopulatedValue: z2.string().optional().describe("Default phone number to pre-fill the input; E.164 format recommended (e.g. '+14155552671')")
|
|
1051
|
+
}).describe("Schema for a phone number question with country code picker and country-specific format validation");
|
|
1052
|
+
var addressSubFieldConfigSchema = z2.object({
|
|
1053
|
+
enabled: z2.boolean().default(true).describe("Whether this sub-field is shown in the question"),
|
|
1054
|
+
required: z2.boolean().default(false).describe("Whether the respondent must fill in this sub-field"),
|
|
1055
|
+
placeholder: z2.string().max(200).optional().describe("Placeholder text for this sub-field input")
|
|
1056
|
+
}).describe("Configuration for an individual address sub-field");
|
|
1057
|
+
var addressQuestionSchema = questionSchema.extend({
|
|
1058
|
+
type: z2.literal("address").describe("Must be exactly 'address'"),
|
|
1059
|
+
addressLine1: addressSubFieldConfigSchema.optional().describe("Configuration for the primary street address line"),
|
|
1060
|
+
addressLine2: addressSubFieldConfigSchema.optional().describe("Configuration for the secondary address line (apartment, suite, etc.); hidden by default"),
|
|
1061
|
+
city: addressSubFieldConfigSchema.optional().describe("Configuration for the city/town sub-field"),
|
|
1062
|
+
stateProvince: addressSubFieldConfigSchema.optional().describe("Configuration for the state, region, or province sub-field"),
|
|
1063
|
+
postalCode: addressSubFieldConfigSchema.optional().describe("Configuration for the ZIP/postal code sub-field"),
|
|
1064
|
+
country: addressSubFieldConfigSchema.optional().describe("Configuration for the country sub-field"),
|
|
1065
|
+
defaultCountry: z2.string().max(2).optional().describe("ISO 3166-1 alpha-2 country code to pre-select in the country dropdown (e.g. 'US', 'GB')")
|
|
1066
|
+
}).describe("Schema for an address question that collects a full structured address on a single screen");
|
|
1067
|
+
var videoAudioModeSchema = z2.enum(["video", "audio", "text"]);
|
|
1068
|
+
var VideoAudioModes = {
|
|
1069
|
+
VIDEO: "video",
|
|
1070
|
+
AUDIO: "audio",
|
|
1071
|
+
TEXT: "text"
|
|
1072
|
+
};
|
|
1073
|
+
var videoAudioQuestionSchema = questionSchema.extend({
|
|
1074
|
+
type: z2.literal("video_audio").describe("Must be exactly 'video_audio'"),
|
|
1075
|
+
allowedModes: z2.array(videoAudioModeSchema).min(1).optional().describe("Which answer types the respondent can choose from (video, audio, text); when absent all three are enabled"),
|
|
1076
|
+
defaultMode: videoAudioModeSchema.optional().describe("Which mode tab is pre-selected when the question opens; when absent the platform chooses"),
|
|
1077
|
+
maxDurationSeconds: z2.number().int().min(5).max(600).optional().describe("Maximum recording length in seconds (5\u2013600); Typeform hardcodes 120s with no config, making this a differentiator; when absent the platform default applies"),
|
|
1078
|
+
maxFileSizeMb: z2.number().int().min(1).max(500).optional().describe("Maximum size in megabytes for uploaded pre-recorded files (1\u2013500); when absent the platform ceiling applies"),
|
|
1079
|
+
allowUpload: z2.boolean().optional().default(true).describe("Whether the respondent can upload a pre-recorded file in addition to recording live"),
|
|
1080
|
+
placeholder: z2.string().max(200).optional().describe("Instructional text shown to the respondent before they begin recording")
|
|
1081
|
+
}).describe("Schema for a video and audio question where respondents can record or upload a video, audio clip, or text answer");
|
|
1082
|
+
var schedulerProviderSchema = z2.enum(["google_calendar", "calendly"]);
|
|
1083
|
+
var SchedulerProviders = {
|
|
1084
|
+
GOOGLE_CALENDAR: "google_calendar",
|
|
1085
|
+
CALENDLY: "calendly"
|
|
1086
|
+
};
|
|
1087
|
+
var schedulerQuestionSchema = questionSchema.extend({
|
|
1088
|
+
type: z2.literal("scheduler").describe("Must be exactly 'scheduler'"),
|
|
1089
|
+
provider: schedulerProviderSchema.optional().describe("Which calendar integration to use (google_calendar or calendly); when absent the platform uses whatever is connected"),
|
|
1090
|
+
calendarId: z2.string().optional().describe("Specific Google Calendar ID or Calendly event-type URL/slug to book from; when absent the default calendar or event type is used"),
|
|
1091
|
+
showIntroScreen: z2.boolean().optional().default(true).describe("Whether to show the Calendly event intro screen (account name, event name, duration) before the time picker; only applies when provider is 'calendly'"),
|
|
1092
|
+
autofillNameFieldId: z2.string().optional().describe("ID of a prior Short Text or Name question whose answer is pre-filled into the Calendly booking name field; only applies when provider is 'calendly'"),
|
|
1093
|
+
autofillEmailFieldId: z2.string().optional().describe("ID of a prior Email question whose answer is pre-filled into the Calendly booking email field; only applies when provider is 'calendly'"),
|
|
1094
|
+
placeholder: z2.string().max(200).optional().describe("Instructional text shown above the calendar picker to guide the respondent")
|
|
1095
|
+
}).describe("Schema for a scheduler question where respondents book a time slot directly within the form via Google Calendar or Calendly");
|
|
1096
|
+
var qnaWithAiQuestionSchema = questionSchema.extend({
|
|
1097
|
+
type: z2.literal("qna_with_ai").describe("Must be exactly 'qna_with_ai'"),
|
|
1098
|
+
knowledgeBase: z2.string().max(2e4).describe("The knowledge base content the AI draws from when answering respondent questions; Markdown formatting is recommended; up to 20,000 characters"),
|
|
1099
|
+
maxResponseLength: z2.number().int().min(50).max(2e3).optional().describe("Maximum number of characters per AI-generated response (50\u20132000); Typeform hardcodes 300, making this configurable a differentiator; when absent the platform default (300) applies"),
|
|
1100
|
+
maxQaPairs: z2.number().int().min(1).max(100).optional().describe("Maximum number of Q&A exchanges allowed per submission (1\u2013100); Typeform hardcodes 20, making this configurable a differentiator; when absent the platform default (20) applies"),
|
|
1101
|
+
placeholder: z2.string().max(200).optional().describe("Hint text shown in the respondent's question input field (e.g. 'Ask me anything about this event...')"),
|
|
1102
|
+
askButtonLabel: z2.string().max(50).optional().describe("Label for the submit/ask button; when absent the platform default (e.g. 'Ask AI') is shown")
|
|
1103
|
+
}).describe("Schema for a Q&A with AI question where respondents ask questions and receive AI-generated answers drawn from a configurable knowledge base");
|
|
842
1104
|
var combinedQuestionSchema = z2.discriminatedUnion("type", [
|
|
843
1105
|
ratingQuestionSchema,
|
|
844
1106
|
annotationQuestionSchema,
|
|
@@ -856,7 +1118,22 @@ var combinedQuestionSchema = z2.discriminatedUnion("type", [
|
|
|
856
1118
|
npsQuestionSchema,
|
|
857
1119
|
shortAnswerQuestionSchema,
|
|
858
1120
|
longAnswerQuestionSchema,
|
|
859
|
-
nestedDropdownQuestionSchema
|
|
1121
|
+
nestedDropdownQuestionSchema,
|
|
1122
|
+
dateQuestionSchema,
|
|
1123
|
+
csatQuestionSchema,
|
|
1124
|
+
opinionScaleQuestionSchema,
|
|
1125
|
+
rankingQuestionSchema,
|
|
1126
|
+
pictureChoiceQuestionSchema,
|
|
1127
|
+
signatureQuestionSchema,
|
|
1128
|
+
fileUploadQuestionSchema,
|
|
1129
|
+
emailQuestionSchema,
|
|
1130
|
+
numberQuestionSchema,
|
|
1131
|
+
websiteQuestionSchema,
|
|
1132
|
+
phoneNumberQuestionSchema,
|
|
1133
|
+
addressQuestionSchema,
|
|
1134
|
+
videoAudioQuestionSchema,
|
|
1135
|
+
schedulerQuestionSchema,
|
|
1136
|
+
qnaWithAiQuestionSchema
|
|
860
1137
|
]);
|
|
861
1138
|
|
|
862
1139
|
// src/schemas/fields/answer-schema.ts
|
|
@@ -871,24 +1148,62 @@ var AnnotationSchema = z3.object({
|
|
|
871
1148
|
fileName: z3.string(),
|
|
872
1149
|
markers: z3.array(AnnotationMarkerSchema)
|
|
873
1150
|
});
|
|
1151
|
+
var SignatureAnswerSchema = z3.object({
|
|
1152
|
+
mode: z3.enum(["type", "draw", "upload"]).describe("The signing method the respondent used"),
|
|
1153
|
+
fileUrl: z3.string().optional().describe("Secure URL to the signature artifact for draw and upload modes"),
|
|
1154
|
+
typedName: z3.string().optional().describe("The name the respondent typed for type mode")
|
|
1155
|
+
}).describe("Answer for a signature question");
|
|
1156
|
+
var FileUploadAnswerItemSchema = z3.object({
|
|
1157
|
+
fileUrl: z3.string().describe("Secure URL to the uploaded file"),
|
|
1158
|
+
fileName: z3.string().describe("Original filename as provided by the respondent"),
|
|
1159
|
+
fileSizeMb: z3.number().describe("File size in megabytes"),
|
|
1160
|
+
mimeType: z3.string().optional().describe("MIME type of the uploaded file (e.g. 'application/pdf', 'image/jpeg')")
|
|
1161
|
+
}).describe("Metadata for a single uploaded file");
|
|
1162
|
+
var FileUploadAnswerSchema = z3.array(FileUploadAnswerItemSchema).describe("Answer for a file upload question; array supports single and multiple file uploads");
|
|
1163
|
+
var PhoneNumberAnswerSchema = z3.object({
|
|
1164
|
+
countryCode: z3.string().describe("Dialing country code including the + prefix (e.g. '+1', '+91')"),
|
|
1165
|
+
number: z3.string().describe("Local phone number without the country code"),
|
|
1166
|
+
e164: z3.string().optional().describe("Full phone number in E.164 format (e.g. '+14155552671')")
|
|
1167
|
+
}).describe("Answer for a phone number question");
|
|
1168
|
+
var AddressAnswerSchema = z3.object({
|
|
1169
|
+
addressLine1: z3.string().optional().describe("Primary street address line"),
|
|
1170
|
+
addressLine2: z3.string().optional().describe("Secondary address line (apartment, suite, etc.)"),
|
|
1171
|
+
city: z3.string().optional().describe("City or town"),
|
|
1172
|
+
stateProvince: z3.string().optional().describe("State, region, or province"),
|
|
1173
|
+
postalCode: z3.string().optional().describe("ZIP or postal code"),
|
|
1174
|
+
country: z3.string().optional().describe("Country name or ISO 3166-1 alpha-2 code")
|
|
1175
|
+
}).describe("Answer for an address question");
|
|
1176
|
+
var VideoAudioAnswerSchema = z3.object({
|
|
1177
|
+
mode: z3.enum(["video", "audio", "text"]).describe("The answer mode the respondent chose"),
|
|
1178
|
+
fileUrl: z3.string().optional().describe("Secure URL to the recorded or uploaded video/audio file"),
|
|
1179
|
+
text: z3.string().optional().describe("Written answer for text mode"),
|
|
1180
|
+
durationSeconds: z3.number().optional().describe("Actual recording length in seconds for video and audio modes"),
|
|
1181
|
+
transcriptText: z3.string().optional().describe("Auto-generated transcript for video and audio recordings")
|
|
1182
|
+
}).describe("Answer for a video and audio question");
|
|
1183
|
+
var QnaWithAiPairSchema = z3.object({
|
|
1184
|
+
question: z3.string().describe("The question the respondent asked"),
|
|
1185
|
+
answer: z3.string().describe("The AI-generated answer based on the knowledge base")
|
|
1186
|
+
}).describe("A single Q&A exchange between the respondent and the AI");
|
|
1187
|
+
var QnaWithAiAnswerSchema = z3.array(QnaWithAiPairSchema).describe("Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session");
|
|
1188
|
+
var SchedulerAnswerSchema = z3.object({
|
|
1189
|
+
provider: z3.enum(["google_calendar", "calendly"]).describe("The calendar integration used to make the booking"),
|
|
1190
|
+
slotStart: z3.string().describe("ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')"),
|
|
1191
|
+
slotEnd: z3.string().describe("ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')"),
|
|
1192
|
+
eventId: z3.string().optional().describe("Calendar event ID (Google Calendar) or Calendly event UUID"),
|
|
1193
|
+
bookedAt: z3.string().describe("ISO 8601 datetime when the respondent completed the booking")
|
|
1194
|
+
}).describe("Answer for a scheduler question");
|
|
874
1195
|
var AnswerItemSchema = z3.object({
|
|
875
1196
|
nps: z3.number().optional().describe("Net Promoter Score value (e.g., 0-10)"),
|
|
876
1197
|
nestedSelection: z3.array(z3.string()).optional().describe("Array of selected nested option IDs"),
|
|
877
1198
|
longText: z3.string().optional().describe("Long text answer, e.g., paragraph or essay"),
|
|
878
1199
|
shortAnswer: z3.string().optional().describe("Short text answer, e.g., single sentence or word"),
|
|
879
|
-
singleChoice: z3.string().optional().describe(
|
|
880
|
-
"single selected option ID (for single choice questions)"
|
|
881
|
-
),
|
|
1200
|
+
singleChoice: z3.string().optional().describe("single selected option ID (for single choice questions)"),
|
|
882
1201
|
rating: z3.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
883
1202
|
yesNo: z3.boolean().optional().describe("Yes/no answer for yes_no questions (true = Yes, false = No)"),
|
|
884
1203
|
consent: z3.boolean().optional().describe("Consent answer for consent questions (true = checked/agreed, false = unchecked)"),
|
|
885
1204
|
multipleChoiceMultiple: z3.array(z3.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
|
|
886
|
-
singleChoiceOther: z3.string().optional().describe(
|
|
887
|
-
|
|
888
|
-
),
|
|
889
|
-
multipleChoiceOther: z3.string().optional().describe(
|
|
890
|
-
'Free-text "other" answer for multiple choice questions when allowOther is enabled'
|
|
891
|
-
),
|
|
1205
|
+
singleChoiceOther: z3.string().optional().describe('Free-text "other" answer for single choice questions when allowOther is enabled'),
|
|
1206
|
+
multipleChoiceOther: z3.string().optional().describe('Free-text "other" answer for multiple choice questions when allowOther is enabled'),
|
|
892
1207
|
annotation: AnnotationSchema.optional().describe(
|
|
893
1208
|
"Annotation object containing file and marker details"
|
|
894
1209
|
),
|
|
@@ -903,7 +1218,39 @@ var AnswerItemSchema = z3.object({
|
|
|
903
1218
|
),
|
|
904
1219
|
others: z3.string().optional().describe(
|
|
905
1220
|
"For multiple choice questions and single choice questions, this is the value of the other option"
|
|
906
|
-
)
|
|
1221
|
+
),
|
|
1222
|
+
// Date question
|
|
1223
|
+
date: z3.string().optional().describe("Answer for a date question; ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM)"),
|
|
1224
|
+
// CSAT question
|
|
1225
|
+
csat: z3.number().optional().describe("Answer for a CSAT question; semantic value: -2, -1, 0, 1, or 2"),
|
|
1226
|
+
// Opinion scale question
|
|
1227
|
+
opinionScale: z3.number().optional().describe("Answer for an opinion scale question; the selected numeric value on the scale"),
|
|
1228
|
+
// Ranking question — ordered array of option IDs; index 0 = rank 1
|
|
1229
|
+
ranking: z3.array(z3.string()).optional().describe("Answer for a ranking question; ordered array of option IDs where index 0 is rank 1"),
|
|
1230
|
+
// Picture choice — single selection
|
|
1231
|
+
pictureChoice: z3.string().optional().describe("Answer for a picture choice question (single selection); the selected option ID"),
|
|
1232
|
+
// Picture choice — multiple selection
|
|
1233
|
+
pictureChoiceMultiple: z3.array(z3.string()).optional().describe("Answer for a picture choice question (multiple selection); array of selected option IDs"),
|
|
1234
|
+
// Signature question
|
|
1235
|
+
signature: SignatureAnswerSchema.optional().describe("Answer for a signature question"),
|
|
1236
|
+
// File upload question
|
|
1237
|
+
fileUpload: FileUploadAnswerSchema.optional().describe("Answer for a file upload question; array supports single and multiple file uploads"),
|
|
1238
|
+
// Email question
|
|
1239
|
+
email: z3.string().optional().describe("Answer for an email question; the submitted email address"),
|
|
1240
|
+
// Number question
|
|
1241
|
+
number: z3.number().optional().describe("Answer for a number question; the submitted numeric value"),
|
|
1242
|
+
// Website question
|
|
1243
|
+
website: z3.string().optional().describe("Answer for a website question; the submitted URL"),
|
|
1244
|
+
// Phone number question
|
|
1245
|
+
phoneNumber: PhoneNumberAnswerSchema.optional().describe("Answer for a phone number question"),
|
|
1246
|
+
// Address question
|
|
1247
|
+
address: AddressAnswerSchema.optional().describe("Answer for an address question"),
|
|
1248
|
+
// Video and audio question
|
|
1249
|
+
videoAudio: VideoAudioAnswerSchema.optional().describe("Answer for a video and audio question"),
|
|
1250
|
+
// Scheduler question
|
|
1251
|
+
scheduler: SchedulerAnswerSchema.optional().describe("Answer for a scheduler question"),
|
|
1252
|
+
// Q&A with AI question
|
|
1253
|
+
qnaWithAi: QnaWithAiAnswerSchema.optional().describe("Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session")
|
|
907
1254
|
}).describe(
|
|
908
1255
|
"Flexible answer item supporting various question types and custom fields"
|
|
909
1256
|
);
|
|
@@ -939,7 +1286,10 @@ var OtherFieldsSchema = z5.object({
|
|
|
939
1286
|
previousButtonLabel: z5.string().min(1).max(50).describe("Text for the previous button in pagination"),
|
|
940
1287
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),
|
|
941
1288
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
942
|
-
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")
|
|
1289
|
+
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)"),
|
|
1290
|
+
remindMeLaterButtonLabel: z5.string().max(50).optional().describe("Label for the remind me later button; when absent or blank the button is not shown"),
|
|
1291
|
+
estimatedCompletionLabel: z5.string().max(100).optional().describe("Estimated completion time label shown on the welcome or first screen (e.g. 'Takes about 2 minutes'); when absent the label is not shown"),
|
|
1292
|
+
respondentsShowMinThreshold: z5.number().int().min(1).optional().describe("Minimum number of respondents required before the respondents badge is shown; when absent the badge is never shown")
|
|
943
1293
|
}).describe("Schema for other form configuration fields");
|
|
944
1294
|
var LanguageFieldSchema = z5.object({
|
|
945
1295
|
value: z5.string().min(1).max(10).describe("Language code (e.g., 'en', 'es', 'fr')"),
|
|
@@ -951,7 +1301,10 @@ var OtherFieldsTranslationSchema = z5.object({
|
|
|
951
1301
|
previousButtonLabel: z5.string().min(1).max(50).describe("Translated text for the previous button in pagination"),
|
|
952
1302
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),
|
|
953
1303
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
954
|
-
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")
|
|
1304
|
+
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)"),
|
|
1305
|
+
remindMeLaterButtonLabel: z5.string().max(50).optional().describe("Translated label for the remind me later button"),
|
|
1306
|
+
estimatedCompletionLabel: z5.string().max(100).optional().describe("Translated estimated completion time label"),
|
|
1307
|
+
respondentsLabel: z5.string().max(100).optional().describe("Translated label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time")
|
|
955
1308
|
}).describe("Schema for other form configuration field translations");
|
|
956
1309
|
|
|
957
1310
|
// src/schemas/fields/theme-schema.ts
|
|
@@ -1005,7 +1358,7 @@ var featureSettingsSchema = z6.object({
|
|
|
1005
1358
|
progressBar: z6.boolean().default(true).describe("Whether to show a progress bar indicating completion status"),
|
|
1006
1359
|
showBranding: z6.boolean().default(true).describe("Whether to display branding elements on the widget"),
|
|
1007
1360
|
customPosition: z6.boolean().describe("Whether custom positioning is enabled"),
|
|
1008
|
-
customCss: z6.string().optional().describe("Custom CSS
|
|
1361
|
+
customCss: z6.string().optional().describe("Custom CSS to apply \u2014 either a URL ending in .css or raw CSS text"),
|
|
1009
1362
|
fontFamily: z6.string().optional().default("default").describe("Font family to use for the widget"),
|
|
1010
1363
|
shareableMode: shareableModeSchema.optional().default(ShareableModes.LIGHT).describe(
|
|
1011
1364
|
"Display mode for the shareable: light, dark, or system preference"
|
|
@@ -1014,7 +1367,8 @@ var featureSettingsSchema = z6.object({
|
|
|
1014
1367
|
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
1015
1368
|
),
|
|
1016
1369
|
rtl: z6.boolean().default(false).describe("Whether right-to-left text direction is enabled"),
|
|
1017
|
-
previousButton: previousButtonModeSchema.default(PreviousButtonModes.ALWAYS).describe("Previous button: never (hidden) or always (shown)")
|
|
1370
|
+
previousButton: previousButtonModeSchema.default(PreviousButtonModes.ALWAYS).describe("Previous button: never (hidden) or always (shown)"),
|
|
1371
|
+
maxDialogHeightPercentInApp: z6.number().int().min(10).max(100).optional().describe("Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100); when absent the dialog uses its default height")
|
|
1018
1372
|
}).describe("Feature settings controlling widget UI behavior and appearance");
|
|
1019
1373
|
var themeColorsSchema = z6.object({
|
|
1020
1374
|
theme: z6.string().optional().describe("Theme for a single mode (shadcn variables JSON)")
|
|
@@ -1414,7 +1768,8 @@ var feedbackConfigurationItemSchema = z13.object({
|
|
|
1414
1768
|
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
1415
1769
|
),
|
|
1416
1770
|
rtl: z13.boolean().describe("Whether right-to-left text direction is enabled"),
|
|
1417
|
-
previousButton: z13.enum(["never", "always"]).describe("Previous button: never (hidden) or always (shown)")
|
|
1771
|
+
previousButton: z13.enum(["never", "always"]).describe("Previous button: never (hidden) or always (shown)"),
|
|
1772
|
+
maxDialogHeightPercentInApp: z13.number().int().min(10).max(100).optional().describe("Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100)")
|
|
1418
1773
|
}).describe("Feature settings for the feedback form"),
|
|
1419
1774
|
selectedIconPosition: z13.string().describe("Selected position for the feedback icon"),
|
|
1420
1775
|
selectedPosition: z13.string().describe("Selected position for the feedback form")
|
|
@@ -1483,7 +1838,8 @@ var fetchFeedbackDetailsResponseSchema = z13.object({
|
|
|
1483
1838
|
),
|
|
1484
1839
|
appearanceProperties: appearancePropertiesSchema.describe(
|
|
1485
1840
|
"Appearance properties including theme configuration"
|
|
1486
|
-
)
|
|
1841
|
+
),
|
|
1842
|
+
respondentsCount: z13.number().int().min(0).optional().describe("Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the badge")
|
|
1487
1843
|
}).strict().describe(
|
|
1488
1844
|
"Complete response schema for fetchFeedbackDetails API using existing field schemas"
|
|
1489
1845
|
);
|
|
@@ -1603,7 +1959,7 @@ var appPropsSchema = z15.object({
|
|
|
1603
1959
|
"Multi-language translations for questions and form content (optional)"
|
|
1604
1960
|
),
|
|
1605
1961
|
onSectionChange: z15.function({
|
|
1606
|
-
input: [z15.number()],
|
|
1962
|
+
input: [z15.number(), z15.string()],
|
|
1607
1963
|
output: z15.void()
|
|
1608
1964
|
}).optional().describe("Optional callback function triggered when section changes"),
|
|
1609
1965
|
onClose: z15.function({
|
|
@@ -1623,13 +1979,20 @@ var appPropsSchema = z15.object({
|
|
|
1623
1979
|
// src/index.ts
|
|
1624
1980
|
import { z as z16 } from "zod";
|
|
1625
1981
|
export {
|
|
1982
|
+
AddressAnswerSchema,
|
|
1626
1983
|
AnnotationMarkerSchema,
|
|
1627
1984
|
AnnotationSchema,
|
|
1628
1985
|
AnswerItemSchema,
|
|
1629
1986
|
AnswerSchema,
|
|
1630
1987
|
ChoiceOrderOptions,
|
|
1988
|
+
CsatDisplayStyles,
|
|
1989
|
+
CsatScales,
|
|
1631
1990
|
CurrentModes,
|
|
1991
|
+
DateFormats,
|
|
1992
|
+
DateSeparators,
|
|
1632
1993
|
DeviceThemes,
|
|
1994
|
+
FileUploadAnswerItemSchema,
|
|
1995
|
+
FileUploadAnswerSchema,
|
|
1633
1996
|
LanguageFieldSchema,
|
|
1634
1997
|
LanguagesSchema,
|
|
1635
1998
|
LayoutAttachmentTypes,
|
|
@@ -1638,20 +2001,32 @@ export {
|
|
|
1638
2001
|
MultipleChoiceMultipleDisplayStyles,
|
|
1639
2002
|
OtherFieldsSchema,
|
|
1640
2003
|
OtherFieldsTranslationSchema,
|
|
2004
|
+
PhoneNumberAnswerSchema,
|
|
1641
2005
|
Positions,
|
|
1642
2006
|
PreviousButtonModes,
|
|
1643
2007
|
PublicationStatuses,
|
|
2008
|
+
QnaWithAiAnswerSchema,
|
|
2009
|
+
QnaWithAiPairSchema,
|
|
1644
2010
|
QuestionStatuses,
|
|
1645
2011
|
QuestionTypes,
|
|
2012
|
+
RankingDisplayStyles,
|
|
1646
2013
|
RatingDisplayStyles,
|
|
1647
2014
|
RatingMatrixDisplayStyles,
|
|
1648
2015
|
RatingRepresentationSizes,
|
|
2016
|
+
SchedulerAnswerSchema,
|
|
2017
|
+
SchedulerProviders,
|
|
1649
2018
|
ShareableModes,
|
|
2019
|
+
SignatureAnswerSchema,
|
|
2020
|
+
SignatureModes,
|
|
1650
2021
|
ThemeModes,
|
|
1651
2022
|
TranslationProvider,
|
|
1652
2023
|
ValidationRuleTypes,
|
|
2024
|
+
VideoAudioAnswerSchema,
|
|
2025
|
+
VideoAudioModes,
|
|
1653
2026
|
VisibilityConditionOperators,
|
|
1654
2027
|
YesNoDisplayStyles,
|
|
2028
|
+
addressQuestionSchema,
|
|
2029
|
+
addressSubFieldConfigSchema,
|
|
1655
2030
|
annotationQuestionSchema,
|
|
1656
2031
|
annotationQuestionTranslationSchema,
|
|
1657
2032
|
appPropsSchema,
|
|
@@ -1669,12 +2044,19 @@ export {
|
|
|
1669
2044
|
consentQuestionSchema,
|
|
1670
2045
|
consentQuestionTranslationSchema,
|
|
1671
2046
|
createTranslationProvider,
|
|
2047
|
+
csatDisplayStyleSchema,
|
|
2048
|
+
csatQuestionSchema,
|
|
2049
|
+
csatScaleSchema,
|
|
1672
2050
|
currentModeSchema,
|
|
1673
2051
|
customEventFieldOperatorSchema,
|
|
1674
2052
|
customEventFieldSchema,
|
|
2053
|
+
dateFormatSchema,
|
|
2054
|
+
dateQuestionSchema,
|
|
2055
|
+
dateSeparatorSchema,
|
|
1675
2056
|
deviceInfoSchema,
|
|
1676
2057
|
deviceSessionInfoSchema,
|
|
1677
2058
|
deviceThemeSchema,
|
|
2059
|
+
emailQuestionSchema,
|
|
1678
2060
|
exitFormQuestionSchema,
|
|
1679
2061
|
externalPublishingPropertiesSchema,
|
|
1680
2062
|
featureSettingsSchema,
|
|
@@ -1686,6 +2068,7 @@ export {
|
|
|
1686
2068
|
fetchFeedbackDetailsResponseSchema,
|
|
1687
2069
|
fetchFeedbackDetailsSchema,
|
|
1688
2070
|
fetchFormConfigSchema,
|
|
2071
|
+
fileUploadQuestionSchema,
|
|
1689
2072
|
filterConditionSchema,
|
|
1690
2073
|
floatLayoutSchema,
|
|
1691
2074
|
focalPointSchema,
|
|
@@ -1720,14 +2103,19 @@ export {
|
|
|
1720
2103
|
nestedSelectionQuestionTranslationSchema,
|
|
1721
2104
|
npsQuestionSchema,
|
|
1722
2105
|
npsQuestionTranslationSchema,
|
|
2106
|
+
numberQuestionSchema,
|
|
1723
2107
|
objectToCamel,
|
|
1724
2108
|
objectToPascal,
|
|
1725
2109
|
objectToSnake,
|
|
2110
|
+
opinionScaleQuestionSchema,
|
|
1726
2111
|
otherConfigurationPropertiesSchema,
|
|
1727
2112
|
partialFeedbackSchema,
|
|
2113
|
+
phoneNumberQuestionSchema,
|
|
2114
|
+
pictureChoiceQuestionSchema,
|
|
1728
2115
|
positionSchema,
|
|
1729
2116
|
previousButtonModeSchema,
|
|
1730
2117
|
publicationStatusSchema,
|
|
2118
|
+
qnaWithAiQuestionSchema,
|
|
1731
2119
|
queryOutputSchema,
|
|
1732
2120
|
questionCentricTranslationsSchema,
|
|
1733
2121
|
questionOptionSchema,
|
|
@@ -1737,6 +2125,8 @@ export {
|
|
|
1737
2125
|
questionTranslationSchema,
|
|
1738
2126
|
questionTypeSchema,
|
|
1739
2127
|
questionnaireFieldsResponseSchema,
|
|
2128
|
+
rankingDisplayStyleSchema,
|
|
2129
|
+
rankingQuestionSchema,
|
|
1740
2130
|
ratingDisplayStyleSchema,
|
|
1741
2131
|
ratingMatrixDisplayStyleSchema,
|
|
1742
2132
|
ratingMatrixQuestionSchema,
|
|
@@ -1751,6 +2141,8 @@ export {
|
|
|
1751
2141
|
refineTextParamsSchema,
|
|
1752
2142
|
refineTextResponseSchema,
|
|
1753
2143
|
responseSchema,
|
|
2144
|
+
schedulerProviderSchema,
|
|
2145
|
+
schedulerQuestionSchema,
|
|
1754
2146
|
sectionLayoutSchema,
|
|
1755
2147
|
sectionLayoutVariantSchema,
|
|
1756
2148
|
sectionSchema,
|
|
@@ -1760,6 +2152,8 @@ export {
|
|
|
1760
2152
|
shareableModeSchema,
|
|
1761
2153
|
shortAnswerQuestionSchema,
|
|
1762
2154
|
shortAnswerQuestionTranslationSchema,
|
|
2155
|
+
signatureModeSchema,
|
|
2156
|
+
signatureQuestionSchema,
|
|
1763
2157
|
singleChoiceQuestionTranslationSchema,
|
|
1764
2158
|
splitLayoutSchema,
|
|
1765
2159
|
stackLayoutSchema,
|
|
@@ -1781,8 +2175,11 @@ export {
|
|
|
1781
2175
|
validationRuleSchema,
|
|
1782
2176
|
validationRuleTypeSchema,
|
|
1783
2177
|
videoAttachmentSchema,
|
|
2178
|
+
videoAudioModeSchema,
|
|
2179
|
+
videoAudioQuestionSchema,
|
|
1784
2180
|
visibilityConditionSchema,
|
|
1785
2181
|
wallpaperLayoutSchema,
|
|
2182
|
+
websiteQuestionSchema,
|
|
1786
2183
|
welcomeQuestionSchema,
|
|
1787
2184
|
welcomeQuestionTranslationSchema,
|
|
1788
2185
|
whoSchema,
|