@encatch/schema 1.3.0-beta.0 → 1.3.0-beta.1
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 +824 -749
- package/dist/esm/index.js.map +4 -4
- package/dist/types/index.d.ts +1 -0
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +190 -66
- package/dist/types/schemas/fields/app-props-schema.d.ts +101 -33
- package/dist/types/schemas/fields/completion-cta-schema.d.ts +51 -0
- package/dist/types/schemas/fields/field-schema.d.ts +193 -69
- package/dist/types/schemas/fields/form-properties-schema.d.ts +101 -33
- package/dist/types/schemas/fields/translations-schema.d.ts +30 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
4
|
// src/schemas/fields/field-schema.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z3 } from "zod";
|
|
6
6
|
|
|
7
7
|
// src/schemas/fields/translations-schema.ts
|
|
8
8
|
import { z } from "zod";
|
|
@@ -164,7 +164,15 @@ var welcomeQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.exten
|
|
|
164
164
|
type: z.literal("welcome").describe("Question type identifier")
|
|
165
165
|
}).describe("Translation schema for welcome screen questions");
|
|
166
166
|
var thankYouQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
167
|
-
type: z.literal("thank_you").describe("Question type identifier")
|
|
167
|
+
type: z.literal("thank_you").describe("Question type identifier"),
|
|
168
|
+
completionCta: z.object({
|
|
169
|
+
label: translationEntrySchema.optional().describe("Translated label for the primary CTA button"),
|
|
170
|
+
secondary: z.object({
|
|
171
|
+
label: translationEntrySchema.optional().describe("Translated label for the secondary dismiss button")
|
|
172
|
+
}).optional().describe("Translated labels for the secondary dismiss button")
|
|
173
|
+
}).optional().describe(
|
|
174
|
+
"Translations for completionCta button labels; only label fields are translatable \u2014 platform action configs (url, route, action) are locale-agnostic"
|
|
175
|
+
)
|
|
168
176
|
}).describe("Translation schema for thank you screen questions");
|
|
169
177
|
var messagePanelQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
170
178
|
type: z.literal("message_panel").describe("Question type identifier")
|
|
@@ -366,8 +374,66 @@ function createTranslationProvider(translations, defaultLanguage = "en") {
|
|
|
366
374
|
}
|
|
367
375
|
__name(createTranslationProvider, "createTranslationProvider");
|
|
368
376
|
|
|
377
|
+
// src/schemas/fields/completion-cta-schema.ts
|
|
378
|
+
import { z as z2 } from "zod";
|
|
379
|
+
var platformCompletionCtaSchema = z2.discriminatedUnion("action", [
|
|
380
|
+
z2.object({ action: z2.literal("dismiss") }).describe("Close/dismiss the form \u2014 fires form:complete then closes the embed"),
|
|
381
|
+
z2.object({
|
|
382
|
+
action: z2.literal("app_navigate"),
|
|
383
|
+
route: z2.string().min(1).max(500).describe(
|
|
384
|
+
"App-specific route string passed to the host via form:ctaTriggered; the host is responsible for navigation"
|
|
385
|
+
)
|
|
386
|
+
}).describe(
|
|
387
|
+
"Delegate navigation to the host app via form:ctaTriggered event with the route string; web engine does not navigate"
|
|
388
|
+
),
|
|
389
|
+
z2.object({
|
|
390
|
+
action: z2.literal("redirect_internal"),
|
|
391
|
+
url: z2.string().min(1).max(2e3).describe(
|
|
392
|
+
"Target URL; on web opens in the same tab (_self); on native opens in an in-app browser (SFSafariView / Custom Tab)"
|
|
393
|
+
)
|
|
394
|
+
}).describe(
|
|
395
|
+
"Redirect within the current context \u2014 same tab on web, in-app browser on native"
|
|
396
|
+
),
|
|
397
|
+
z2.object({
|
|
398
|
+
action: z2.literal("redirect_external"),
|
|
399
|
+
url: z2.string().min(1).max(2e3).describe(
|
|
400
|
+
"Target URL; on web opens in a new tab (_blank); on native opens the system/external browser"
|
|
401
|
+
)
|
|
402
|
+
}).describe(
|
|
403
|
+
"Redirect to an external context \u2014 new tab on web, system browser on native"
|
|
404
|
+
)
|
|
405
|
+
]).describe(
|
|
406
|
+
"Per-surface CTA action; discriminated on 'action' field \u2014 each variant carries only the fields relevant to its action"
|
|
407
|
+
);
|
|
408
|
+
var completionCtaSecondarySchema = z2.object({
|
|
409
|
+
label: z2.string().min(1).max(100).describe(
|
|
410
|
+
"Label for the secondary dismiss button (e.g. 'Not right now'); always triggers dismiss"
|
|
411
|
+
)
|
|
412
|
+
}).describe(
|
|
413
|
+
"Optional secondary button on thank_you screens; action is always dismiss \u2014 use to give respondents a soft exit alongside the primary CTA"
|
|
414
|
+
);
|
|
415
|
+
var completionCtaSchema = z2.object({
|
|
416
|
+
label: z2.string().min(1).max(100).optional().describe(
|
|
417
|
+
"Label for the primary CTA button; falls back to nextButtonLabel \u2192 section nextButtonLabel \u2192 'Done' when absent"
|
|
418
|
+
),
|
|
419
|
+
autoTriggerDelayMs: z2.number().int().min(0).max(3e4).optional().describe(
|
|
420
|
+
"When set, automatically fires the primary action after this many milliseconds; fires for all actions including dismiss (e.g. set to 0 for immediate silent redirect, 3000 for auto-close after 3 s); when absent the action is manual only"
|
|
421
|
+
),
|
|
422
|
+
inApp: platformCompletionCtaSchema.optional().describe(
|
|
423
|
+
"CTA action used when the form is rendered inside a host app \u2014 native WebView, web-sdk iframe, React Native / Flutter SDK bridge pages"
|
|
424
|
+
),
|
|
425
|
+
link: platformCompletionCtaSchema.optional().describe(
|
|
426
|
+
"CTA action used when the form is rendered as a standalone shareable URL (browser tab or full-page embed)"
|
|
427
|
+
),
|
|
428
|
+
secondary: completionCtaSecondarySchema.optional().describe(
|
|
429
|
+
"Optional secondary dismiss button shown on thank_you screens alongside a non-dismiss primary CTA; not shown when the primary action is already dismiss or when completionCta falls back to nextButtonLabel"
|
|
430
|
+
)
|
|
431
|
+
}).describe(
|
|
432
|
+
"Optional completion CTA configuration for thank_you and exit_form questions; controls what happens after form submission \u2014 redirect, in-app navigation, or dismiss \u2014 with separate settings per rendering surface (inApp / link)"
|
|
433
|
+
);
|
|
434
|
+
|
|
369
435
|
// src/schemas/fields/field-schema.ts
|
|
370
|
-
var questionTypeSchema =
|
|
436
|
+
var questionTypeSchema = z3.enum([
|
|
371
437
|
"rating",
|
|
372
438
|
"single_choice",
|
|
373
439
|
"nps",
|
|
@@ -437,7 +503,7 @@ var QuestionTypes = {
|
|
|
437
503
|
QNA_WITH_AI: "qna_with_ai",
|
|
438
504
|
PAYMENTS_UPI: "payments_upi"
|
|
439
505
|
};
|
|
440
|
-
var validationRuleTypeSchema =
|
|
506
|
+
var validationRuleTypeSchema = z3.enum([
|
|
441
507
|
"required",
|
|
442
508
|
"min",
|
|
443
509
|
"max",
|
|
@@ -459,13 +525,13 @@ var ValidationRuleTypes = {
|
|
|
459
525
|
URL: "url",
|
|
460
526
|
CUSTOM: "custom"
|
|
461
527
|
};
|
|
462
|
-
var validationRuleSchema =
|
|
528
|
+
var validationRuleSchema = z3.object({
|
|
463
529
|
type: validationRuleTypeSchema.describe("Type of validation rule to apply"),
|
|
464
|
-
value:
|
|
465
|
-
message:
|
|
466
|
-
describe:
|
|
530
|
+
value: z3.union([z3.string(), z3.number(), z3.boolean()]).optional().describe("Value for the validation rule (string, number, or boolean)"),
|
|
531
|
+
message: z3.string().optional().describe("Custom error message when validation fails"),
|
|
532
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this validation rule")
|
|
467
533
|
}).describe("Schema defining validation rules for question responses");
|
|
468
|
-
var visibilityConditionOperatorSchema =
|
|
534
|
+
var visibilityConditionOperatorSchema = z3.enum([
|
|
469
535
|
"equals",
|
|
470
536
|
"not_equals",
|
|
471
537
|
"contains",
|
|
@@ -485,44 +551,44 @@ var VisibilityConditionOperators = {
|
|
|
485
551
|
IS_EMPTY: "is_empty",
|
|
486
552
|
IS_NOT_EMPTY: "is_not_empty"
|
|
487
553
|
};
|
|
488
|
-
var visibilityConditionSchema =
|
|
489
|
-
field:
|
|
554
|
+
var visibilityConditionSchema = z3.object({
|
|
555
|
+
field: z3.string().describe("ID of the field to check against"),
|
|
490
556
|
operator: visibilityConditionOperatorSchema.describe(
|
|
491
557
|
"Comparison operator for the condition"
|
|
492
558
|
),
|
|
493
|
-
value:
|
|
494
|
-
describe:
|
|
559
|
+
value: z3.union([z3.string(), z3.number(), z3.boolean()]).optional().describe("Value to compare against (string, number, or boolean)"),
|
|
560
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this visibility condition")
|
|
495
561
|
}).describe(
|
|
496
562
|
"Schema defining conditions that control when questions are visible"
|
|
497
563
|
);
|
|
498
|
-
var sectionSchema =
|
|
499
|
-
id:
|
|
500
|
-
title:
|
|
501
|
-
description:
|
|
502
|
-
showTitle:
|
|
503
|
-
showDescription:
|
|
504
|
-
nextButtonLabel:
|
|
564
|
+
var sectionSchema = z3.object({
|
|
565
|
+
id: z3.string().describe("Unique identifier for the section"),
|
|
566
|
+
title: z3.string().min(1).max(200).describe("Display title for the section"),
|
|
567
|
+
description: z3.string().max(1e3).optional().describe("Optional detailed description or help text for the section"),
|
|
568
|
+
showTitle: z3.boolean().default(true).describe("Whether to show the section title in the UI"),
|
|
569
|
+
showDescription: z3.boolean().default(true).describe("Whether to show the section description in the UI"),
|
|
570
|
+
nextButtonLabel: z3.string().min(1).max(50).optional().describe("Label for the next button when navigating from this section"),
|
|
505
571
|
translations: sectionTranslationsByLanguageSchema.optional().describe(
|
|
506
572
|
"Per-language section copy (title, optional description and nextButtonLabel), keyed by language code"
|
|
507
573
|
),
|
|
508
|
-
inAppSingleQuestion:
|
|
574
|
+
inAppSingleQuestion: z3.boolean().default(false).describe(
|
|
509
575
|
"When true, the native app shows one question at a time within this section"
|
|
510
576
|
),
|
|
511
|
-
isPreviousAllowed:
|
|
577
|
+
isPreviousAllowed: z3.boolean().default(false).optional().describe(
|
|
512
578
|
"When the global previousButton mode is 'auto', controls whether the Previous button is shown for this section. Defaults to false (hidden)."
|
|
513
579
|
),
|
|
514
|
-
questionIds:
|
|
580
|
+
questionIds: z3.array(z3.string()).min(1).describe("Array of question IDs that belong to this section")
|
|
515
581
|
}).describe(
|
|
516
582
|
"Schema defining sections that organize questions into logical groups"
|
|
517
583
|
);
|
|
518
|
-
var questionStatusSchema =
|
|
584
|
+
var questionStatusSchema = z3.enum(["D", "P", "A", "S"]);
|
|
519
585
|
var QuestionStatuses = {
|
|
520
586
|
DRAFT: "D",
|
|
521
587
|
PUBLISHED: "P",
|
|
522
588
|
ARCHIVED: "A",
|
|
523
589
|
SUSPENDED: "S"
|
|
524
590
|
};
|
|
525
|
-
var ratingDisplayStyleSchema =
|
|
591
|
+
var ratingDisplayStyleSchema = z3.enum([
|
|
526
592
|
"star",
|
|
527
593
|
"heart",
|
|
528
594
|
"thumbs-up",
|
|
@@ -538,7 +604,7 @@ var RatingDisplayStyles = {
|
|
|
538
604
|
EMOJI: "emoji",
|
|
539
605
|
EMOJI_EXP: "emoji_exp"
|
|
540
606
|
};
|
|
541
|
-
var ratingRepresentationSizeSchema =
|
|
607
|
+
var ratingRepresentationSizeSchema = z3.enum([
|
|
542
608
|
"small",
|
|
543
609
|
"medium",
|
|
544
610
|
"large"
|
|
@@ -548,7 +614,7 @@ var RatingRepresentationSizes = {
|
|
|
548
614
|
MEDIUM: "medium",
|
|
549
615
|
LARGE: "large"
|
|
550
616
|
};
|
|
551
|
-
var multipleChoiceDisplayStyleSchema =
|
|
617
|
+
var multipleChoiceDisplayStyleSchema = z3.enum([
|
|
552
618
|
"radio",
|
|
553
619
|
"list",
|
|
554
620
|
"chip",
|
|
@@ -562,7 +628,7 @@ var MultipleChoiceDisplayStyles = {
|
|
|
562
628
|
DROPDOWN: "dropdown",
|
|
563
629
|
AUTOSUGGEST: "autosuggest"
|
|
564
630
|
};
|
|
565
|
-
var multipleChoiceMultipleDisplayStyleSchema =
|
|
631
|
+
var multipleChoiceMultipleDisplayStyleSchema = z3.enum([
|
|
566
632
|
"checkbox",
|
|
567
633
|
"list",
|
|
568
634
|
"chip",
|
|
@@ -574,12 +640,12 @@ var MultipleChoiceMultipleDisplayStyles = {
|
|
|
574
640
|
CHIP: "chip",
|
|
575
641
|
AUTOSUGGEST: "autosuggest"
|
|
576
642
|
};
|
|
577
|
-
var yesNoDisplayStyleSchema =
|
|
643
|
+
var yesNoDisplayStyleSchema = z3.enum(["horizontal", "vertical"]);
|
|
578
644
|
var YesNoDisplayStyles = {
|
|
579
645
|
HORIZONTAL: "horizontal",
|
|
580
646
|
VERTICAL: "vertical"
|
|
581
647
|
};
|
|
582
|
-
var choiceOrderOptionSchema =
|
|
648
|
+
var choiceOrderOptionSchema = z3.enum([
|
|
583
649
|
"randomize",
|
|
584
650
|
"flip",
|
|
585
651
|
"rotate",
|
|
@@ -593,96 +659,102 @@ var ChoiceOrderOptions = {
|
|
|
593
659
|
ASCENDING: "ascending",
|
|
594
660
|
NONE: "none"
|
|
595
661
|
};
|
|
596
|
-
var questionSchema =
|
|
597
|
-
id:
|
|
598
|
-
slug:
|
|
662
|
+
var questionSchema = z3.object({
|
|
663
|
+
id: z3.string().describe("Unique identifier for the question"),
|
|
664
|
+
slug: z3.string().min(1).max(128).optional().describe(
|
|
599
665
|
"Optional stable identifier for the question (e.g. URLs, analytics, or integrations)"
|
|
600
666
|
),
|
|
601
667
|
type: questionTypeSchema.describe(
|
|
602
668
|
"The type of question (rating, single_choice, etc.)"
|
|
603
669
|
),
|
|
604
|
-
title:
|
|
605
|
-
description:
|
|
606
|
-
describe:
|
|
670
|
+
title: z3.string().min(1).max(200).describe("The main title/question text displayed to users"),
|
|
671
|
+
description: z3.string().max(1e3).optional().describe("Optional detailed description or help text"),
|
|
672
|
+
describe: z3.string().max(2e3).optional().describe(
|
|
607
673
|
"LLM tool call description for better AI understanding and context"
|
|
608
674
|
),
|
|
609
|
-
required:
|
|
610
|
-
isHidden:
|
|
611
|
-
errorMessage:
|
|
612
|
-
validations:
|
|
613
|
-
visibility:
|
|
614
|
-
sectionId:
|
|
675
|
+
required: z3.boolean().default(false).describe("Whether this question must be answered"),
|
|
676
|
+
isHidden: z3.boolean().default(false).describe("When true, the question is hidden from the form UI"),
|
|
677
|
+
errorMessage: z3.string().max(500).optional().describe("Custom error message when validation fails"),
|
|
678
|
+
validations: z3.array(validationRuleSchema).optional().default([]).describe("Array of validation rules to apply"),
|
|
679
|
+
visibility: z3.array(visibilityConditionSchema).optional().default([]).describe("Conditions that control when this question is shown"),
|
|
680
|
+
sectionId: z3.string().optional().describe("ID of the section this question belongs to"),
|
|
615
681
|
status: questionStatusSchema.describe(
|
|
616
682
|
"Current status of the question (Draft, Published, etc.)"
|
|
617
683
|
),
|
|
618
|
-
textAlign:
|
|
684
|
+
textAlign: z3.enum(["left", "center", "justify"]).optional().default("left").describe(
|
|
619
685
|
"Text alignment for the question title and description; `justify` is intended for consent questions (full-width justified consent body markdown)"
|
|
620
686
|
),
|
|
621
|
-
nextButtonLabel:
|
|
687
|
+
nextButtonLabel: z3.string().min(1).max(50).default("Next").describe(
|
|
622
688
|
"Label for the next button when advancing past this question (overrides section or form defaults when set)"
|
|
623
689
|
),
|
|
624
|
-
showQuestionTitle:
|
|
625
|
-
questionMediaUrl:
|
|
690
|
+
showQuestionTitle: z3.boolean().default(true).describe("Whether to display the question title; defaults to true"),
|
|
691
|
+
questionMediaUrl: z3.string().url().optional().describe(
|
|
626
692
|
"Optional URL for media (image or video) displayed alongside the question"
|
|
627
693
|
),
|
|
628
|
-
questionMediaType:
|
|
694
|
+
questionMediaType: z3.enum(["image", "video", "youtube", "vimeo"]).optional().describe(
|
|
629
695
|
"Type of media referenced by questionMediaUrl; one of 'image', 'video', 'youtube', or 'vimeo'"
|
|
630
696
|
)
|
|
631
697
|
}).describe("Base schema for all question types with common properties");
|
|
632
698
|
var ratingQuestionSchema = questionSchema.extend({
|
|
633
|
-
type:
|
|
634
|
-
showLabels:
|
|
635
|
-
minLabel:
|
|
636
|
-
maxLabel:
|
|
699
|
+
type: z3.literal("rating").describe("Must be exactly 'rating'"),
|
|
700
|
+
showLabels: z3.boolean().optional().describe("Whether to show min/max labels"),
|
|
701
|
+
minLabel: z3.string().max(100).optional().describe("Label for the minimum rating value"),
|
|
702
|
+
maxLabel: z3.string().max(100).optional().describe("Label for the maximum rating value"),
|
|
637
703
|
displayStyle: ratingDisplayStyleSchema.optional().describe("Visual style for rating display"),
|
|
638
|
-
numberOfRatings:
|
|
704
|
+
numberOfRatings: z3.number().int().min(1).max(10).describe("Number of rating options (1-10)"),
|
|
639
705
|
representationSize: ratingRepresentationSizeSchema.optional().describe("Size of rating visual elements"),
|
|
640
|
-
color:
|
|
706
|
+
color: z3.string().regex(/^#[0-9A-F]{6}$/i, "Must be a valid hex color").optional().describe("Hex color for rating elements")
|
|
641
707
|
}).describe("Schema for rating questions with customizable display options");
|
|
642
708
|
var annotationQuestionSchema = questionSchema.extend({
|
|
643
|
-
type:
|
|
644
|
-
annotationText:
|
|
645
|
-
noAnnotationText:
|
|
709
|
+
type: z3.literal("annotation").describe("Must be exactly 'annotation'"),
|
|
710
|
+
annotationText: z3.string().max(1e3).optional().describe("Text to display when annotation is provided"),
|
|
711
|
+
noAnnotationText: z3.string().max(500).optional().describe("Text to display when no annotation is provided")
|
|
646
712
|
}).describe(
|
|
647
713
|
"Schema for annotation questions that provide additional context or instructions"
|
|
648
714
|
);
|
|
649
715
|
var welcomeQuestionSchema = questionSchema.extend({
|
|
650
|
-
type:
|
|
651
|
-
title:
|
|
652
|
-
description:
|
|
653
|
-
imageUrl:
|
|
716
|
+
type: z3.literal("welcome").describe("Must be exactly 'welcome'"),
|
|
717
|
+
title: z3.string().min(1).max(200).describe("The main heading displayed on the welcome screen"),
|
|
718
|
+
description: z3.string().max(1e3).optional().describe("Optional sub-text body shown below the heading"),
|
|
719
|
+
imageUrl: z3.string().url().optional().describe("Optional image URL displayed on the welcome screen")
|
|
654
720
|
}).describe(
|
|
655
721
|
"Schema for a welcome screen displayed at the start or inline within a form"
|
|
656
722
|
);
|
|
657
723
|
var thankYouQuestionSchema = questionSchema.extend({
|
|
658
|
-
type:
|
|
659
|
-
title:
|
|
660
|
-
description:
|
|
724
|
+
type: z3.literal("thank_you").describe("Must be exactly 'thank_you'"),
|
|
725
|
+
title: z3.string().min(1).max(200).describe("The main heading displayed on the thank you screen"),
|
|
726
|
+
description: z3.string().max(1e3).optional().describe(
|
|
661
727
|
"Optional thank you body text; rendered as Markdown where the form supports it"
|
|
662
728
|
),
|
|
663
|
-
imageUrl:
|
|
729
|
+
imageUrl: z3.string().url().optional().describe("Optional image URL displayed on the thank you screen"),
|
|
730
|
+
completionCta: completionCtaSchema.optional().describe(
|
|
731
|
+
"Optional CTA shown after submission; supports primary + optional secondary (dismiss) buttons, per-surface action routing (inApp / link), and optional auto-trigger timer; when absent the engine falls back to nextButtonLabel as a single dismiss button"
|
|
732
|
+
)
|
|
664
733
|
}).describe(
|
|
665
734
|
"Schema for a thank you screen shown at the end or inline within a form"
|
|
666
735
|
);
|
|
667
736
|
var messagePanelQuestionSchema = questionSchema.extend({
|
|
668
|
-
type:
|
|
669
|
-
title:
|
|
670
|
-
description:
|
|
671
|
-
imageUrl:
|
|
737
|
+
type: z3.literal("message_panel").describe("Must be exactly 'message_panel'"),
|
|
738
|
+
title: z3.string().min(1).max(200).describe("The main heading displayed on the message panel"),
|
|
739
|
+
description: z3.string().max(1e3).optional().describe("Optional body text shown below the heading"),
|
|
740
|
+
imageUrl: z3.string().url().optional().describe("Optional image URL displayed on the message panel")
|
|
672
741
|
}).describe(
|
|
673
742
|
"Schema for an inline message panel (informational); distinct from welcome for UI semantics and analytics"
|
|
674
743
|
);
|
|
675
744
|
var exitFormQuestionSchema = questionSchema.extend({
|
|
676
|
-
type:
|
|
745
|
+
type: z3.literal("exit_form").describe("Must be exactly 'exit_form'"),
|
|
746
|
+
completionCta: completionCtaSchema.optional().describe(
|
|
747
|
+
"Optional silent completion action fired when the exit_form terminal is reached; no UI is shown \u2014 use redirect_internal / redirect_external for silent redirects or app_navigate for host routing; autoTriggerDelayMs defaults to 0 (immediate) when a configured action is present"
|
|
748
|
+
)
|
|
677
749
|
}).describe(
|
|
678
750
|
"Schema for an exit marker that silently ends the survey; carries no UI and captures no answer \u2014 intended for branch logic paths that should terminate without showing a thank-you screen"
|
|
679
751
|
);
|
|
680
752
|
var yesNoQuestionSchema = questionSchema.extend({
|
|
681
|
-
type:
|
|
682
|
-
yesLabel:
|
|
753
|
+
type: z3.literal("yes_no").describe("Must be exactly 'yes_no'"),
|
|
754
|
+
yesLabel: z3.string().min(1).max(50).optional().describe(
|
|
683
755
|
"Label for the Yes option (defaults to 'Yes' in the UI if omitted)"
|
|
684
756
|
),
|
|
685
|
-
noLabel:
|
|
757
|
+
noLabel: z3.string().min(1).max(50).optional().describe(
|
|
686
758
|
"Label for the No option (defaults to 'No' in the UI if omitted)"
|
|
687
759
|
),
|
|
688
760
|
displayStyle: yesNoDisplayStyleSchema.optional().describe(
|
|
@@ -692,11 +764,11 @@ var yesNoQuestionSchema = questionSchema.extend({
|
|
|
692
764
|
"Schema for yes/no questions with optional custom labels and layout"
|
|
693
765
|
);
|
|
694
766
|
var consentQuestionSchema = questionSchema.extend({
|
|
695
|
-
type:
|
|
767
|
+
type: z3.literal("consent").describe("Must be exactly 'consent'")
|
|
696
768
|
}).describe(
|
|
697
769
|
"Schema for a single-checkbox consent question; use description (rendered as markdown) for the checkbox label text and any policy/terms links; answer is boolean (true = checked)"
|
|
698
770
|
);
|
|
699
|
-
var ratingMatrixDisplayStyleSchema =
|
|
771
|
+
var ratingMatrixDisplayStyleSchema = z3.enum([
|
|
700
772
|
"radio",
|
|
701
773
|
"star",
|
|
702
774
|
"emoji",
|
|
@@ -708,82 +780,82 @@ var RatingMatrixDisplayStyles = {
|
|
|
708
780
|
EMOJI: "emoji",
|
|
709
781
|
BUTTON: "button"
|
|
710
782
|
};
|
|
711
|
-
var ratingMatrixStatementSchema =
|
|
712
|
-
id:
|
|
783
|
+
var ratingMatrixStatementSchema = z3.object({
|
|
784
|
+
id: z3.string().describe(
|
|
713
785
|
"Unique identifier for this statement (system time milliseconds)"
|
|
714
786
|
),
|
|
715
|
-
value:
|
|
716
|
-
label:
|
|
717
|
-
describe:
|
|
787
|
+
value: z3.string().min(1).max(100).describe("Internal value / export key for this statement"),
|
|
788
|
+
label: z3.string().min(1).max(200).describe("Display text shown to users for this statement"),
|
|
789
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this statement")
|
|
718
790
|
}).describe("Schema for an individual statement (row) in a rating matrix");
|
|
719
|
-
var ratingMatrixScalePointSchema =
|
|
720
|
-
id:
|
|
721
|
-
value:
|
|
791
|
+
var ratingMatrixScalePointSchema = z3.object({
|
|
792
|
+
id: z3.string().describe("Unique identifier for this scale point"),
|
|
793
|
+
value: z3.union([z3.number(), z3.string()]).describe(
|
|
722
794
|
"Stored response value for this scale point (number or string)"
|
|
723
795
|
),
|
|
724
|
-
label:
|
|
725
|
-
describe:
|
|
796
|
+
label: z3.string().min(1).max(200).describe("Display label shown for this scale point"),
|
|
797
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this scale point")
|
|
726
798
|
}).describe("Schema for a single point on a custom rating scale");
|
|
727
|
-
var ratingMatrixScaleSchema =
|
|
799
|
+
var ratingMatrixScaleSchema = z3.discriminatedUnion("kind", [
|
|
728
800
|
// Likert: symmetric ordinal scale -2…+2, explicit scale points with labels
|
|
729
|
-
|
|
730
|
-
kind:
|
|
731
|
-
scalePoints:
|
|
801
|
+
z3.object({
|
|
802
|
+
kind: z3.literal("likert").describe("Symmetric ordinal scale (-2 to +2)"),
|
|
803
|
+
scalePoints: z3.array(ratingMatrixScalePointSchema).min(2).max(10).describe("Scale points with display labels for each column")
|
|
732
804
|
}),
|
|
733
805
|
// Numerical: 1…N points where N is 2, 3, 4, or 5, explicit scale points with labels
|
|
734
|
-
|
|
735
|
-
kind:
|
|
736
|
-
scalePoints:
|
|
737
|
-
pointCount:
|
|
806
|
+
z3.object({
|
|
807
|
+
kind: z3.literal("numerical").describe("Numerical scale from 1 to N"),
|
|
808
|
+
scalePoints: z3.array(ratingMatrixScalePointSchema).min(2).max(10).describe("Scale points with display labels for each column"),
|
|
809
|
+
pointCount: z3.union([z3.literal(2), z3.literal(3), z3.literal(4), z3.literal(5)]).describe("Number of scale points (2, 3, 4, or 5)")
|
|
738
810
|
}),
|
|
739
811
|
// Custom: consumer defines each point's value and label
|
|
740
|
-
|
|
741
|
-
kind:
|
|
742
|
-
scalePoints:
|
|
812
|
+
z3.object({
|
|
813
|
+
kind: z3.literal("custom").describe("Custom scale with user-defined points and values"),
|
|
814
|
+
scalePoints: z3.array(ratingMatrixScalePointSchema).min(2).max(10).describe("Scale points with display labels for each column")
|
|
743
815
|
})
|
|
744
816
|
]).describe("Scale configuration for rating matrix questions");
|
|
745
817
|
var ratingMatrixQuestionSchema = questionSchema.extend({
|
|
746
|
-
type:
|
|
747
|
-
statements:
|
|
818
|
+
type: z3.literal("rating_matrix").describe("Must be exactly 'rating_matrix'"),
|
|
819
|
+
statements: z3.array(ratingMatrixStatementSchema).min(1).max(10).describe("Statements (rows) users will rate on the shared scale (1-10)"),
|
|
748
820
|
scale: ratingMatrixScaleSchema.describe(
|
|
749
821
|
"Scale configuration shared across all statement rows"
|
|
750
822
|
),
|
|
751
823
|
displayStyle: ratingMatrixDisplayStyleSchema.optional().describe(
|
|
752
824
|
"Visual representation of scale points per row (radio buttons, stars, emoji, or buttons)"
|
|
753
825
|
),
|
|
754
|
-
randomizeStatements:
|
|
826
|
+
randomizeStatements: z3.boolean().optional().default(false).describe("Whether to randomize the order of statements")
|
|
755
827
|
}).describe(
|
|
756
828
|
"Schema for rating matrix questions with multiple statements on a shared scale"
|
|
757
829
|
);
|
|
758
|
-
var matrixRowSchema =
|
|
759
|
-
id:
|
|
760
|
-
value:
|
|
761
|
-
label:
|
|
762
|
-
describe:
|
|
830
|
+
var matrixRowSchema = z3.object({
|
|
831
|
+
id: z3.string().describe("Unique identifier for this row (system time milliseconds)"),
|
|
832
|
+
value: z3.string().min(1).max(100).describe("Internal value / export key for this row"),
|
|
833
|
+
label: z3.string().min(1).max(200).describe("Display text shown to users for this row"),
|
|
834
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this row")
|
|
763
835
|
}).describe("Schema for an individual row in a matrix choice question");
|
|
764
|
-
var matrixColumnSchema =
|
|
765
|
-
id:
|
|
766
|
-
value:
|
|
767
|
-
label:
|
|
768
|
-
describe:
|
|
836
|
+
var matrixColumnSchema = z3.object({
|
|
837
|
+
id: z3.string().describe("Unique identifier for this column (system time milliseconds)"),
|
|
838
|
+
value: z3.string().min(1).max(100).describe("Internal value / export key for this column"),
|
|
839
|
+
label: z3.string().min(1).max(200).describe("Display label shown for this column"),
|
|
840
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this column")
|
|
769
841
|
}).describe("Schema for an individual column in a matrix choice question");
|
|
770
842
|
var matrixSingleChoiceQuestionSchema = questionSchema.extend({
|
|
771
|
-
type:
|
|
772
|
-
rows:
|
|
773
|
-
columns:
|
|
774
|
-
randomizeRows:
|
|
775
|
-
randomizeColumns:
|
|
843
|
+
type: z3.literal("matrix_single_choice").describe("Must be exactly 'matrix_single_choice'"),
|
|
844
|
+
rows: z3.array(matrixRowSchema).min(1).max(20).describe("Row items (1-20 rows)"),
|
|
845
|
+
columns: z3.array(matrixColumnSchema).min(2).max(10).describe("Column options shared across all rows (2-10 columns)"),
|
|
846
|
+
randomizeRows: z3.boolean().optional().default(false).describe("Whether to randomize the order of rows"),
|
|
847
|
+
randomizeColumns: z3.boolean().optional().default(false).describe("Whether to randomize the order of columns")
|
|
776
848
|
}).describe(
|
|
777
849
|
"Schema for matrix single-choice questions where one column is selected per row"
|
|
778
850
|
);
|
|
779
851
|
var matrixMultipleChoiceQuestionSchema = questionSchema.extend({
|
|
780
|
-
type:
|
|
781
|
-
rows:
|
|
782
|
-
columns:
|
|
783
|
-
minSelectionsPerRow:
|
|
784
|
-
maxSelectionsPerRow:
|
|
785
|
-
randomizeRows:
|
|
786
|
-
randomizeColumns:
|
|
852
|
+
type: z3.literal("matrix_multiple_choice").describe("Must be exactly 'matrix_multiple_choice'"),
|
|
853
|
+
rows: z3.array(matrixRowSchema).min(1).max(20).describe("Row items (1-20 rows)"),
|
|
854
|
+
columns: z3.array(matrixColumnSchema).min(2).max(10).describe("Column options shared across all rows (2-10 columns)"),
|
|
855
|
+
minSelectionsPerRow: z3.number().int().min(0).optional().describe("Minimum number of columns a user must select per row"),
|
|
856
|
+
maxSelectionsPerRow: z3.number().int().min(1).optional().describe("Maximum number of columns a user can select per row"),
|
|
857
|
+
randomizeRows: z3.boolean().optional().default(false).describe("Whether to randomize the order of rows"),
|
|
858
|
+
randomizeColumns: z3.boolean().optional().default(false).describe("Whether to randomize the order of columns")
|
|
787
859
|
}).refine(
|
|
788
860
|
(data) => {
|
|
789
861
|
if (data.minSelectionsPerRow !== void 0 && data.maxSelectionsPerRow !== void 0) {
|
|
@@ -798,64 +870,64 @@ var matrixMultipleChoiceQuestionSchema = questionSchema.extend({
|
|
|
798
870
|
).describe(
|
|
799
871
|
"Schema for matrix multiple-choice questions where one or more columns can be selected per row"
|
|
800
872
|
);
|
|
801
|
-
var questionOptionSchema =
|
|
802
|
-
id:
|
|
803
|
-
value:
|
|
804
|
-
label:
|
|
805
|
-
hint:
|
|
873
|
+
var questionOptionSchema = z3.object({
|
|
874
|
+
id: z3.string().describe("Unique identifier for this option (system time milliseconds)"),
|
|
875
|
+
value: z3.string().min(1).max(100).describe("The internal value used for this option"),
|
|
876
|
+
label: z3.string().min(1).max(200).describe("The display text shown to users for this option"),
|
|
877
|
+
hint: z3.string().max(300).optional().describe(
|
|
806
878
|
"Optional short description shown below the option label to help respondents understand what they are selecting or ranking"
|
|
807
879
|
),
|
|
808
|
-
describe:
|
|
880
|
+
describe: z3.string().max(500).optional().describe(
|
|
809
881
|
"LLM tool call description providing context about this option"
|
|
810
882
|
),
|
|
811
|
-
imageUrl:
|
|
883
|
+
imageUrl: z3.string().url().optional().describe("Optional image URL to display with this option")
|
|
812
884
|
}).describe("Schema for individual options in choice-based questions");
|
|
813
|
-
var nestedOptionSchema =
|
|
814
|
-
() =>
|
|
815
|
-
id:
|
|
885
|
+
var nestedOptionSchema = z3.lazy(
|
|
886
|
+
() => z3.object({
|
|
887
|
+
id: z3.string().describe(
|
|
816
888
|
"Unique identifier for this nested option (system time milliseconds)"
|
|
817
889
|
),
|
|
818
|
-
value:
|
|
819
|
-
label:
|
|
820
|
-
describe:
|
|
821
|
-
imageUrl:
|
|
822
|
-
hint:
|
|
890
|
+
value: z3.string().min(1).max(100).describe("The internal value used for this nested option"),
|
|
891
|
+
label: z3.string().min(1).max(200).describe("The display text shown for this nested option"),
|
|
892
|
+
describe: z3.string().max(500).optional().describe("LLM tool call description for this nested option context"),
|
|
893
|
+
imageUrl: z3.string().url().optional().describe("Optional image URL for this nested option"),
|
|
894
|
+
hint: z3.string().max(500).optional().describe(
|
|
823
895
|
"Optional hint text to help users understand this nested option"
|
|
824
896
|
),
|
|
825
|
-
children:
|
|
897
|
+
children: z3.array(nestedOptionSchema).optional().default([]).describe("Array of child options for hierarchical structure")
|
|
826
898
|
}).describe("Schema for nested options with hierarchical structure support")
|
|
827
899
|
);
|
|
828
900
|
var multipleChoiceSingleQuestionSchema = questionSchema.extend({
|
|
829
|
-
type:
|
|
901
|
+
type: z3.literal("single_choice").describe("Must be exactly 'single_choice'"),
|
|
830
902
|
displayStyle: multipleChoiceDisplayStyleSchema.optional().describe("Visual style for displaying options"),
|
|
831
|
-
allowOther:
|
|
832
|
-
otherTextConfig:
|
|
833
|
-
minChars:
|
|
834
|
-
maxChars:
|
|
835
|
-
placeholder:
|
|
836
|
-
showLimitIndicatorThreshold:
|
|
903
|
+
allowOther: z3.boolean().optional().default(false).describe('Whether to allow a custom "other" option'),
|
|
904
|
+
otherTextConfig: z3.object({
|
|
905
|
+
minChars: z3.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
906
|
+
maxChars: z3.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
907
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
908
|
+
showLimitIndicatorThreshold: z3.number().int().min(0).optional().describe(
|
|
837
909
|
"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"
|
|
838
910
|
)
|
|
839
911
|
}).optional().describe('Configuration for the custom "other" text input'),
|
|
840
|
-
randomizeOptions:
|
|
841
|
-
options:
|
|
912
|
+
randomizeOptions: z3.boolean().optional().default(false).describe("Whether to randomize the order of options"),
|
|
913
|
+
options: z3.array(questionOptionSchema).min(1).max(50).describe("Array of options for user selection (1-50 options)")
|
|
842
914
|
}).describe("Schema for single-choice multiple selection questions");
|
|
843
915
|
var multipleChoiceMultipleQuestionSchema = questionSchema.extend({
|
|
844
|
-
type:
|
|
916
|
+
type: z3.literal("multiple_choice_multiple").describe("Must be exactly 'multiple_choice_multiple'"),
|
|
845
917
|
displayStyle: multipleChoiceMultipleDisplayStyleSchema.optional().describe("Visual style for displaying multiple options"),
|
|
846
|
-
allowOther:
|
|
847
|
-
otherTextConfig:
|
|
848
|
-
minChars:
|
|
849
|
-
maxChars:
|
|
850
|
-
placeholder:
|
|
851
|
-
showLimitIndicatorThreshold:
|
|
918
|
+
allowOther: z3.boolean().optional().default(false).describe('Whether to allow a custom "other" option'),
|
|
919
|
+
otherTextConfig: z3.object({
|
|
920
|
+
minChars: z3.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
921
|
+
maxChars: z3.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
922
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
923
|
+
showLimitIndicatorThreshold: z3.number().int().min(0).optional().describe(
|
|
852
924
|
"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"
|
|
853
925
|
)
|
|
854
926
|
}).optional().describe('Configuration for the custom "other" text input'),
|
|
855
|
-
minSelections:
|
|
856
|
-
maxSelections:
|
|
857
|
-
randomizeOptions:
|
|
858
|
-
options:
|
|
927
|
+
minSelections: z3.number().int().min(0).optional().describe("Minimum number of options that must be selected"),
|
|
928
|
+
maxSelections: z3.number().int().min(1).optional().describe("Maximum number of options that can be selected"),
|
|
929
|
+
randomizeOptions: z3.boolean().optional().default(false).describe("Whether to randomize the order of options"),
|
|
930
|
+
options: z3.array(questionOptionSchema).min(1).max(50).describe("Array of options for user selection (1-50 options)")
|
|
859
931
|
}).refine(
|
|
860
932
|
(data) => {
|
|
861
933
|
if (data.minSelections !== void 0 && data.maxSelections !== void 0) {
|
|
@@ -872,20 +944,20 @@ var multipleChoiceMultipleQuestionSchema = questionSchema.extend({
|
|
|
872
944
|
"Schema for multiple-choice questions allowing multiple selections"
|
|
873
945
|
);
|
|
874
946
|
var npsQuestionSchema = questionSchema.extend({
|
|
875
|
-
type:
|
|
876
|
-
min:
|
|
877
|
-
max:
|
|
878
|
-
minLabel:
|
|
879
|
-
maxLabel:
|
|
880
|
-
scaleLabels:
|
|
881
|
-
prepopulatedValue:
|
|
882
|
-
detractorColor:
|
|
947
|
+
type: z3.literal("nps").describe("Must be exactly 'nps'"),
|
|
948
|
+
min: z3.literal(0).describe("NPS always starts at 0"),
|
|
949
|
+
max: z3.literal(10).describe("NPS always ends at 10"),
|
|
950
|
+
minLabel: z3.string().max(100).optional().describe("Label for the minimum NPS value (0)"),
|
|
951
|
+
maxLabel: z3.string().max(100).optional().describe("Label for the maximum NPS value (10)"),
|
|
952
|
+
scaleLabels: z3.record(z3.string().regex(/^\d+$/), z3.string().max(50)).optional().describe("Custom labels for specific NPS values (0-10)"),
|
|
953
|
+
prepopulatedValue: z3.number().int().min(0).max(10).optional().describe("Default value to pre-select (0-10)"),
|
|
954
|
+
detractorColor: z3.string().max(50).optional().describe(
|
|
883
955
|
"Color applied to detractor scores (0\u20136); accepts any valid CSS color value (hex, rgb, hsl, named)"
|
|
884
956
|
),
|
|
885
|
-
passiveColor:
|
|
957
|
+
passiveColor: z3.string().max(50).optional().describe(
|
|
886
958
|
"Color applied to passive scores (7\u20138); accepts any valid CSS color value"
|
|
887
959
|
),
|
|
888
|
-
promoterColor:
|
|
960
|
+
promoterColor: z3.string().max(50).optional().describe(
|
|
889
961
|
"Color applied to promoter scores (9\u201310); accepts any valid CSS color value"
|
|
890
962
|
)
|
|
891
963
|
}).refine(
|
|
@@ -905,19 +977,19 @@ var npsQuestionSchema = questionSchema.extend({
|
|
|
905
977
|
}
|
|
906
978
|
).describe("Schema for Net Promoter Score questions with 0-10 scale");
|
|
907
979
|
var shortAnswerQuestionSchema = questionSchema.extend({
|
|
908
|
-
type:
|
|
909
|
-
maxCharacters:
|
|
910
|
-
minCharacters:
|
|
911
|
-
showLimitIndicatorThreshold:
|
|
980
|
+
type: z3.literal("short_answer").describe("Must be exactly 'short_answer'"),
|
|
981
|
+
maxCharacters: z3.number().int().min(1).max(1e4).optional().describe("Maximum number of characters allowed"),
|
|
982
|
+
minCharacters: z3.number().int().min(0).optional().describe("Minimum number of characters required"),
|
|
983
|
+
showLimitIndicatorThreshold: z3.number().int().min(0).optional().describe(
|
|
912
984
|
"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"
|
|
913
985
|
),
|
|
914
|
-
placeholder:
|
|
915
|
-
enableRegexValidation:
|
|
916
|
-
regexPattern:
|
|
917
|
-
enableEnhanceWithAi:
|
|
918
|
-
promptTemplate:
|
|
919
|
-
maxTokenAllowed:
|
|
920
|
-
minCharactersToEnhance:
|
|
986
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text shown in the input field"),
|
|
987
|
+
enableRegexValidation: z3.boolean().optional().default(false).describe("Whether to enable regex pattern validation"),
|
|
988
|
+
regexPattern: z3.string().optional().describe("Regular expression pattern for validation"),
|
|
989
|
+
enableEnhanceWithAi: z3.boolean().optional().default(false).describe("Whether to enable AI enhancement features"),
|
|
990
|
+
promptTemplate: z3.string().max(2e3).optional().describe("Template for AI enhancement prompts"),
|
|
991
|
+
maxTokenAllowed: z3.number().int().min(1).max(1e4).optional().describe("Maximum tokens allowed for AI processing"),
|
|
992
|
+
minCharactersToEnhance: z3.number().int().min(1).optional().describe("Minimum characters needed to trigger AI enhancement")
|
|
921
993
|
}).refine(
|
|
922
994
|
(data) => {
|
|
923
995
|
if (data.minCharacters !== void 0 && data.maxCharacters !== void 0) {
|
|
@@ -953,22 +1025,22 @@ var shortAnswerQuestionSchema = questionSchema.extend({
|
|
|
953
1025
|
}
|
|
954
1026
|
).describe("Schema for short answer questions with optional AI enhancement");
|
|
955
1027
|
var longAnswerQuestionSchema = questionSchema.extend({
|
|
956
|
-
type:
|
|
957
|
-
maxCharacters:
|
|
1028
|
+
type: z3.literal("long_text").describe("Must be exactly 'long_text'"),
|
|
1029
|
+
maxCharacters: z3.number().int().min(1).max(5e4).optional().describe(
|
|
958
1030
|
"Maximum number of characters allowed (higher limit for long text)"
|
|
959
1031
|
),
|
|
960
|
-
minCharacters:
|
|
961
|
-
showLimitIndicatorThreshold:
|
|
1032
|
+
minCharacters: z3.number().int().min(0).optional().describe("Minimum number of characters required"),
|
|
1033
|
+
showLimitIndicatorThreshold: z3.number().int().min(0).optional().describe(
|
|
962
1034
|
"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show"
|
|
963
1035
|
),
|
|
964
|
-
rows:
|
|
965
|
-
placeholder:
|
|
966
|
-
enableEnhanceWithAi:
|
|
967
|
-
promptTemplate:
|
|
968
|
-
maxTokenAllowed:
|
|
1036
|
+
rows: z3.number().int().min(1).max(20).optional().describe("Number of textarea rows to display (1-20)"),
|
|
1037
|
+
placeholder: z3.string().max(500).optional().describe("Placeholder text for the textarea (longer for long text)"),
|
|
1038
|
+
enableEnhanceWithAi: z3.boolean().optional().default(false).describe("Whether to enable AI enhancement features"),
|
|
1039
|
+
promptTemplate: z3.string().max(2e3).optional().describe("Template for AI enhancement prompts"),
|
|
1040
|
+
maxTokenAllowed: z3.number().int().min(1).max(25e3).optional().describe(
|
|
969
1041
|
"Maximum tokens allowed for AI processing (higher for long text)"
|
|
970
1042
|
),
|
|
971
|
-
minCharactersToEnhance:
|
|
1043
|
+
minCharactersToEnhance: z3.number().int().min(1).optional().describe("Minimum characters needed to trigger AI enhancement")
|
|
972
1044
|
}).refine(
|
|
973
1045
|
(data) => {
|
|
974
1046
|
if (data.minCharacters !== void 0 && data.maxCharacters !== void 0) {
|
|
@@ -995,19 +1067,19 @@ var longAnswerQuestionSchema = questionSchema.extend({
|
|
|
995
1067
|
"Schema for long answer questions with rich text support and AI enhancement"
|
|
996
1068
|
);
|
|
997
1069
|
var nestedDropdownQuestionSchema = questionSchema.extend({
|
|
998
|
-
type:
|
|
999
|
-
placeholder:
|
|
1000
|
-
options:
|
|
1070
|
+
type: z3.literal("nested_selection").describe("Must be exactly 'nested_selection'"),
|
|
1071
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text for the nested dropdown"),
|
|
1072
|
+
options: z3.array(nestedOptionSchema).min(1).max(100).describe(
|
|
1001
1073
|
"Array of nested options for hierarchical selection (1-100 options)"
|
|
1002
1074
|
),
|
|
1003
|
-
displayStyle:
|
|
1075
|
+
displayStyle: z3.literal("list").describe("Fixed display style for nested dropdowns"),
|
|
1004
1076
|
choiceOrderOption: choiceOrderOptionSchema.optional().default("none").describe("How to order the nested choices"),
|
|
1005
|
-
preserveLastChoices:
|
|
1006
|
-
prepopulatedValue:
|
|
1007
|
-
allowOther:
|
|
1008
|
-
otherColumnName:
|
|
1009
|
-
maxDepth:
|
|
1010
|
-
cascadeLabels:
|
|
1077
|
+
preserveLastChoices: z3.number().int().min(0).max(10).optional().describe("Number of choice levels to preserve (0-10)"),
|
|
1078
|
+
prepopulatedValue: z3.string().max(1e3).optional().describe("Default value to pre-populate"),
|
|
1079
|
+
allowOther: z3.boolean().optional().default(false).describe('Whether to allow custom "other" options'),
|
|
1080
|
+
otherColumnName: z3.string().max(100).optional().describe('Column name for storing custom "other" values'),
|
|
1081
|
+
maxDepth: z3.number().int().min(1).max(10).optional().describe("Maximum nesting depth allowed (1-10)"),
|
|
1082
|
+
cascadeLabels: z3.boolean().optional().default(false).describe("Whether to cascade labels from parent options")
|
|
1011
1083
|
}).refine(
|
|
1012
1084
|
(data) => {
|
|
1013
1085
|
if (data.allowOther && !data.otherColumnName) {
|
|
@@ -1022,7 +1094,7 @@ var nestedDropdownQuestionSchema = questionSchema.extend({
|
|
|
1022
1094
|
).describe(
|
|
1023
1095
|
"Schema for nested dropdown questions with hierarchical option structure"
|
|
1024
1096
|
);
|
|
1025
|
-
var dateFormatSchema =
|
|
1097
|
+
var dateFormatSchema = z3.enum([
|
|
1026
1098
|
"MM/DD/YYYY",
|
|
1027
1099
|
"DD/MM/YYYY",
|
|
1028
1100
|
"YYYY/MM/DD"
|
|
@@ -1032,40 +1104,40 @@ var DateFormats = {
|
|
|
1032
1104
|
DD_MM_YYYY: "DD/MM/YYYY",
|
|
1033
1105
|
YYYY_MM_DD: "YYYY/MM/DD"
|
|
1034
1106
|
};
|
|
1035
|
-
var dateSeparatorSchema =
|
|
1107
|
+
var dateSeparatorSchema = z3.enum(["/", "-", "."]);
|
|
1036
1108
|
var DateSeparators = {
|
|
1037
1109
|
SLASH: "/",
|
|
1038
1110
|
DASH: "-",
|
|
1039
1111
|
DOT: "."
|
|
1040
1112
|
};
|
|
1041
1113
|
var dateQuestionSchema = questionSchema.extend({
|
|
1042
|
-
type:
|
|
1114
|
+
type: z3.literal("date").describe("Must be exactly 'date'"),
|
|
1043
1115
|
format: dateFormatSchema.optional().default("DD/MM/YYYY").describe("Order of day, month, and year segments in the input"),
|
|
1044
1116
|
separator: dateSeparatorSchema.optional().default("/").describe("Character used to separate day, month, and year segments"),
|
|
1045
|
-
includeTime:
|
|
1046
|
-
minDate:
|
|
1117
|
+
includeTime: z3.boolean().optional().default(false).describe("Whether to also collect a time (HH:MM) alongside the date"),
|
|
1118
|
+
minDate: z3.string().optional().describe(
|
|
1047
1119
|
"Earliest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no lower bound is enforced"
|
|
1048
1120
|
),
|
|
1049
|
-
maxDate:
|
|
1121
|
+
maxDate: z3.string().optional().describe(
|
|
1050
1122
|
"Latest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no upper bound is enforced"
|
|
1051
1123
|
),
|
|
1052
|
-
placeholder:
|
|
1053
|
-
segmentLabelDD:
|
|
1124
|
+
placeholder: z3.string().max(50).optional().describe("Placeholder text shown in the date input"),
|
|
1125
|
+
segmentLabelDD: z3.string().max(40).optional().describe(
|
|
1054
1126
|
"Visible label above the day segment; when absent a locale default is used"
|
|
1055
1127
|
),
|
|
1056
|
-
segmentLabelMM:
|
|
1057
|
-
segmentLabelYYYY:
|
|
1058
|
-
prepopulatedValue:
|
|
1128
|
+
segmentLabelMM: z3.string().max(40).optional().describe("Visible label above the month segment"),
|
|
1129
|
+
segmentLabelYYYY: z3.string().max(40).optional().describe("Visible label above the year segment"),
|
|
1130
|
+
prepopulatedValue: z3.string().optional().describe(
|
|
1059
1131
|
"Default date value in ISO 8601 format (YYYY-MM-DD) to pre-fill the input"
|
|
1060
1132
|
)
|
|
1061
1133
|
}).describe(
|
|
1062
1134
|
"Schema for a date question that collects a structured date (and optionally time) from the respondent"
|
|
1063
1135
|
);
|
|
1064
|
-
var csatScaleSchema =
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1136
|
+
var csatScaleSchema = z3.union([
|
|
1137
|
+
z3.literal(2),
|
|
1138
|
+
z3.literal(3),
|
|
1139
|
+
z3.literal(4),
|
|
1140
|
+
z3.literal(5)
|
|
1069
1141
|
]);
|
|
1070
1142
|
var CsatScales = {
|
|
1071
1143
|
TWO: 2,
|
|
@@ -1073,56 +1145,56 @@ var CsatScales = {
|
|
|
1073
1145
|
FOUR: 4,
|
|
1074
1146
|
FIVE: 5
|
|
1075
1147
|
};
|
|
1076
|
-
var csatDisplayStyleSchema =
|
|
1148
|
+
var csatDisplayStyleSchema = z3.enum(["emoji", "text"]);
|
|
1077
1149
|
var CsatDisplayStyles = {
|
|
1078
1150
|
EMOJI: "emoji",
|
|
1079
1151
|
TEXT: "text"
|
|
1080
1152
|
};
|
|
1081
1153
|
var csatQuestionSchema = questionSchema.extend({
|
|
1082
|
-
type:
|
|
1154
|
+
type: z3.literal("csat").describe("Must be exactly 'csat'"),
|
|
1083
1155
|
scale: csatScaleSchema.optional().default(5).describe(
|
|
1084
1156
|
"Number of response points (2\u20135); 2 and 4 have no neutral option, default is 5"
|
|
1085
1157
|
),
|
|
1086
1158
|
displayStyle: csatDisplayStyleSchema.optional().default("emoji").describe(
|
|
1087
1159
|
"How response options are rendered \u2014 emoji faces (default) or text buttons"
|
|
1088
1160
|
),
|
|
1089
|
-
multicolor:
|
|
1161
|
+
multicolor: z3.boolean().optional().default(false).describe(
|
|
1090
1162
|
"Whether to apply distinct colors to negative, neutral, and positive segments"
|
|
1091
1163
|
),
|
|
1092
|
-
negativeColor:
|
|
1164
|
+
negativeColor: z3.string().max(50).optional().describe(
|
|
1093
1165
|
"Color for negative response options (lower half of scale); any valid CSS color; used when multicolor is true"
|
|
1094
1166
|
),
|
|
1095
|
-
neutralColor:
|
|
1167
|
+
neutralColor: z3.string().max(50).optional().describe(
|
|
1096
1168
|
"Color for the neutral midpoint option (odd scales only: scale 3 = value 2, scale 5 = value 3); any valid CSS color; used when multicolor is true"
|
|
1097
1169
|
),
|
|
1098
|
-
positiveColor:
|
|
1170
|
+
positiveColor: z3.string().max(50).optional().describe(
|
|
1099
1171
|
"Color for positive response options (upper half of scale); any valid CSS color; used when multicolor is true"
|
|
1100
1172
|
),
|
|
1101
|
-
showLabels:
|
|
1173
|
+
showLabels: z3.boolean().optional().default(false).describe(
|
|
1102
1174
|
"Whether to render per-point labels below each response option"
|
|
1103
1175
|
),
|
|
1104
|
-
scaleLabels:
|
|
1176
|
+
scaleLabels: z3.record(z3.string(), z3.string().max(100)).optional().describe(
|
|
1105
1177
|
"Per-point label text keyed by value string ('1'\u2013'5'); keys must match the chosen scale size"
|
|
1106
1178
|
)
|
|
1107
1179
|
}).describe(
|
|
1108
1180
|
"Schema for a CSAT (Customer Satisfaction Score) question using an industry-standard 1-to-N positive scale (N = 2\u20135)"
|
|
1109
1181
|
);
|
|
1110
1182
|
var opinionScaleQuestionSchema = questionSchema.extend({
|
|
1111
|
-
type:
|
|
1112
|
-
startValue:
|
|
1113
|
-
steps:
|
|
1183
|
+
type: z3.literal("opinion_scale").describe("Must be exactly 'opinion_scale'"),
|
|
1184
|
+
startValue: z3.union([z3.literal(0), z3.literal(1)]).optional().default(0).describe("Starting value of the scale \u2014 0 (default) or 1"),
|
|
1185
|
+
steps: z3.number().int().min(5).max(11).optional().default(11).describe(
|
|
1114
1186
|
"Number of points on the scale (5\u201311); default 11 gives a 0\u201310 or 1\u201311 range depending on startValue"
|
|
1115
1187
|
),
|
|
1116
|
-
minLabel:
|
|
1188
|
+
minLabel: z3.string().max(100).optional().describe(
|
|
1117
1189
|
"Optional label anchoring the low end of the scale (e.g. 'Not at all likely')"
|
|
1118
1190
|
),
|
|
1119
|
-
maxLabel:
|
|
1191
|
+
maxLabel: z3.string().max(100).optional().describe(
|
|
1120
1192
|
"Optional label anchoring the high end of the scale (e.g. 'Extremely likely')"
|
|
1121
1193
|
)
|
|
1122
1194
|
}).describe(
|
|
1123
1195
|
"Schema for an opinion scale question \u2014 a horizontal numeric button scale with configurable range and optional end labels"
|
|
1124
1196
|
);
|
|
1125
|
-
var rankingDisplayStyleSchema =
|
|
1197
|
+
var rankingDisplayStyleSchema = z3.enum([
|
|
1126
1198
|
"drag_drop",
|
|
1127
1199
|
"dropdown",
|
|
1128
1200
|
"up_down"
|
|
@@ -1133,17 +1205,17 @@ var RankingDisplayStyles = {
|
|
|
1133
1205
|
UP_DOWN: "up_down"
|
|
1134
1206
|
};
|
|
1135
1207
|
var rankingQuestionSchema = questionSchema.extend({
|
|
1136
|
-
type:
|
|
1137
|
-
options:
|
|
1208
|
+
type: z3.literal("ranking").describe("Must be exactly 'ranking'"),
|
|
1209
|
+
options: z3.array(questionOptionSchema).min(2).max(30).describe(
|
|
1138
1210
|
"List of items to rank (2\u201330 items); each item supports an optional hint for clarification"
|
|
1139
1211
|
),
|
|
1140
|
-
randomizeOptions:
|
|
1212
|
+
randomizeOptions: z3.boolean().optional().default(false).describe(
|
|
1141
1213
|
"Whether to shuffle item order per respondent to avoid position bias"
|
|
1142
1214
|
),
|
|
1143
1215
|
displayStyle: rankingDisplayStyleSchema.optional().default("drag_drop").describe(
|
|
1144
1216
|
"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"
|
|
1145
1217
|
),
|
|
1146
|
-
maxRank:
|
|
1218
|
+
maxRank: z3.number().int().min(1).optional().describe(
|
|
1147
1219
|
"Maximum number of items the respondent must rank (e.g. 3 = 'rank your top 3'); when absent all items must be ranked"
|
|
1148
1220
|
)
|
|
1149
1221
|
}).refine(
|
|
@@ -1156,30 +1228,30 @@ var rankingQuestionSchema = questionSchema.extend({
|
|
|
1156
1228
|
"Schema for a ranking question where respondents order items by preference"
|
|
1157
1229
|
);
|
|
1158
1230
|
var pictureChoiceQuestionSchema = questionSchema.extend({
|
|
1159
|
-
type:
|
|
1160
|
-
options:
|
|
1231
|
+
type: z3.literal("picture_choice").describe("Must be exactly 'picture_choice'"),
|
|
1232
|
+
options: z3.array(questionOptionSchema).min(1).max(50).describe(
|
|
1161
1233
|
"Array of options; each should include an imageUrl for the picture to display"
|
|
1162
1234
|
),
|
|
1163
|
-
multiple:
|
|
1235
|
+
multiple: z3.boolean().optional().default(false).describe(
|
|
1164
1236
|
"When true respondents may select more than one image; when false (default) only one image can be selected"
|
|
1165
1237
|
),
|
|
1166
|
-
minSelections:
|
|
1238
|
+
minSelections: z3.number().int().min(1).optional().describe(
|
|
1167
1239
|
"Minimum number of images the respondent must select (only applies when multiple is true)"
|
|
1168
1240
|
),
|
|
1169
|
-
maxSelections:
|
|
1241
|
+
maxSelections: z3.number().int().min(1).optional().describe(
|
|
1170
1242
|
"Maximum number of images the respondent may select (only applies when multiple is true)"
|
|
1171
1243
|
),
|
|
1172
|
-
supersize:
|
|
1173
|
-
showLabels:
|
|
1174
|
-
randomizeOptions:
|
|
1244
|
+
supersize: z3.boolean().optional().default(false).describe("Whether to display images at an enlarged size"),
|
|
1245
|
+
showLabels: z3.boolean().optional().default(true).describe("Whether to show the text label below each image"),
|
|
1246
|
+
randomizeOptions: z3.boolean().optional().default(false).describe(
|
|
1175
1247
|
"Whether to shuffle image order per respondent to avoid position bias"
|
|
1176
1248
|
),
|
|
1177
|
-
allowOther:
|
|
1178
|
-
otherTextConfig:
|
|
1179
|
-
minChars:
|
|
1180
|
-
maxChars:
|
|
1181
|
-
placeholder:
|
|
1182
|
-
showLimitIndicatorThreshold:
|
|
1249
|
+
allowOther: z3.boolean().optional().default(false).describe('Whether to include a free-text "other" option'),
|
|
1250
|
+
otherTextConfig: z3.object({
|
|
1251
|
+
minChars: z3.number().int().min(0).optional().describe("Minimum number of characters required for the other text"),
|
|
1252
|
+
maxChars: z3.number().int().min(1).optional().describe("Maximum number of characters allowed for the other text"),
|
|
1253
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text for the other text input"),
|
|
1254
|
+
showLimitIndicatorThreshold: z3.number().int().min(0).optional().describe(
|
|
1183
1255
|
"Show the character limit indicator once the user has typed this many characters; 0 = show immediately, absent = never show"
|
|
1184
1256
|
)
|
|
1185
1257
|
}).optional().describe('Configuration for the custom "other" text input')
|
|
@@ -1197,111 +1269,111 @@ var pictureChoiceQuestionSchema = questionSchema.extend({
|
|
|
1197
1269
|
).describe(
|
|
1198
1270
|
"Schema for a picture choice question where respondents select from image-based options"
|
|
1199
1271
|
);
|
|
1200
|
-
var signatureModeSchema =
|
|
1272
|
+
var signatureModeSchema = z3.enum(["type", "draw", "upload"]);
|
|
1201
1273
|
var SignatureModes = {
|
|
1202
1274
|
TYPE: "type",
|
|
1203
1275
|
DRAW: "draw",
|
|
1204
1276
|
UPLOAD: "upload"
|
|
1205
1277
|
};
|
|
1206
1278
|
var signatureQuestionSchema = questionSchema.extend({
|
|
1207
|
-
type:
|
|
1208
|
-
allowedModes:
|
|
1279
|
+
type: z3.literal("signature").describe("Must be exactly 'signature'"),
|
|
1280
|
+
allowedModes: z3.array(signatureModeSchema).min(1).optional().describe(
|
|
1209
1281
|
"Which signing methods the respondent can choose from (type, draw, upload); when absent all three are enabled"
|
|
1210
1282
|
),
|
|
1211
1283
|
defaultMode: signatureModeSchema.optional().describe(
|
|
1212
1284
|
"Which signing tab is pre-selected when the question is first shown; when absent the platform chooses"
|
|
1213
1285
|
),
|
|
1214
|
-
collectSignerEmail:
|
|
1286
|
+
collectSignerEmail: z3.boolean().optional().default(true).describe(
|
|
1215
1287
|
"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"
|
|
1216
1288
|
),
|
|
1217
|
-
signerEmailFieldId:
|
|
1289
|
+
signerEmailFieldId: z3.string().optional().describe(
|
|
1218
1290
|
"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"
|
|
1219
1291
|
),
|
|
1220
|
-
penColor:
|
|
1292
|
+
penColor: z3.string().max(50).optional().describe(
|
|
1221
1293
|
"Stroke color for the draw canvas; any valid CSS color; when absent the theme foreground color is used"
|
|
1222
1294
|
),
|
|
1223
|
-
penWidth:
|
|
1295
|
+
penWidth: z3.number().int().min(1).max(20).optional().describe(
|
|
1224
1296
|
"Pen stroke thickness in pixels for the draw canvas (1\u201320); when absent the renderer default (typically 2) is used"
|
|
1225
1297
|
),
|
|
1226
|
-
backgroundColor:
|
|
1298
|
+
backgroundColor: z3.string().max(50).optional().describe(
|
|
1227
1299
|
"Background color of the draw canvas; any valid CSS color; when absent the canvas is transparent and inherits the form background"
|
|
1228
1300
|
),
|
|
1229
|
-
canvasHeight:
|
|
1301
|
+
canvasHeight: z3.number().int().min(60).max(600).optional().describe(
|
|
1230
1302
|
"Draw canvas height in logical pixels (60\u2013600); width always fills the container; when absent the renderer chooses a sensible default (typically 200)"
|
|
1231
1303
|
),
|
|
1232
|
-
clearButtonLabel:
|
|
1304
|
+
clearButtonLabel: z3.string().max(50).optional().describe(
|
|
1233
1305
|
"Label for the clear/redo button in draw mode; when absent the platform default label or icon is shown"
|
|
1234
1306
|
),
|
|
1235
|
-
placeholder:
|
|
1307
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1236
1308
|
"Optional shared fallback copy for draw-canvas and upload-zone hints when their dedicated fields are unset"
|
|
1237
1309
|
),
|
|
1238
|
-
modeTabLabelType:
|
|
1310
|
+
modeTabLabelType: z3.string().max(80).optional().describe(
|
|
1239
1311
|
"Custom visible label for the Type tab; when absent only the tab icon is shown (use aria-label on the client)"
|
|
1240
1312
|
),
|
|
1241
|
-
modeTabLabelDraw:
|
|
1313
|
+
modeTabLabelDraw: z3.string().max(80).optional().describe(
|
|
1242
1314
|
"Custom visible label for the Draw tab; when absent only the tab icon is shown"
|
|
1243
1315
|
),
|
|
1244
|
-
modeTabLabelUpload:
|
|
1316
|
+
modeTabLabelUpload: z3.string().max(80).optional().describe(
|
|
1245
1317
|
"Custom visible label for the Upload tab; when absent only the tab icon is shown"
|
|
1246
1318
|
),
|
|
1247
|
-
drawCanvasHint:
|
|
1319
|
+
drawCanvasHint: z3.string().max(200).optional().describe(
|
|
1248
1320
|
"Hint shown on the empty draw canvas (e.g. 'Draw your signature here'); falls back to placeholder then platform default"
|
|
1249
1321
|
),
|
|
1250
|
-
uploadZonePrimary:
|
|
1322
|
+
uploadZonePrimary: z3.string().max(200).optional().describe(
|
|
1251
1323
|
"Main prompt on the upload drop zone when idle (e.g. click to upload); falls back to placeholder then default"
|
|
1252
1324
|
),
|
|
1253
|
-
uploadZoneDrag:
|
|
1325
|
+
uploadZoneDrag: z3.string().max(120).optional().describe(
|
|
1254
1326
|
"Short prompt when dragging a file over the upload zone; falls back to platform default"
|
|
1255
1327
|
)
|
|
1256
1328
|
}).describe(
|
|
1257
1329
|
"Schema for a signature question where respondents can type, draw, or upload their electronic signature"
|
|
1258
1330
|
);
|
|
1259
1331
|
var fileUploadQuestionSchema = questionSchema.extend({
|
|
1260
|
-
type:
|
|
1261
|
-
allowedFileTypes:
|
|
1332
|
+
type: z3.literal("file_upload").describe("Must be exactly 'file_upload'"),
|
|
1333
|
+
allowedFileTypes: z3.array(z3.string()).min(1).optional().describe(
|
|
1262
1334
|
"MIME types and/or file extensions the respondent is allowed to upload (e.g. ['image/jpeg', '.pdf']); when absent all file types are accepted"
|
|
1263
1335
|
),
|
|
1264
|
-
maxFileSizeMb:
|
|
1336
|
+
maxFileSizeMb: z3.number().int().min(1).max(100).optional().describe(
|
|
1265
1337
|
"Maximum size per uploaded file in megabytes (1\u2013100); when absent the platform enforces its own ceiling"
|
|
1266
1338
|
),
|
|
1267
|
-
multiple:
|
|
1339
|
+
multiple: z3.boolean().optional().default(false).describe(
|
|
1268
1340
|
"When true the respondent may upload more than one file in a single question; when false (default) only one file is accepted"
|
|
1269
1341
|
),
|
|
1270
|
-
maxFiles:
|
|
1342
|
+
maxFiles: z3.number().int().min(1).max(20).optional().describe(
|
|
1271
1343
|
"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"
|
|
1272
1344
|
),
|
|
1273
|
-
placeholder:
|
|
1345
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1274
1346
|
"Text shown inside the upload dropzone to guide respondents (e.g. 'Drop your CV here or click to browse')"
|
|
1275
1347
|
)
|
|
1276
1348
|
}).describe(
|
|
1277
1349
|
"Schema for a file upload question where respondents can attach one or more files from their device"
|
|
1278
1350
|
);
|
|
1279
1351
|
var emailQuestionSchema = questionSchema.extend({
|
|
1280
|
-
type:
|
|
1281
|
-
placeholder:
|
|
1282
|
-
prepopulatedValue:
|
|
1352
|
+
type: z3.literal("email").describe("Must be exactly 'email'"),
|
|
1353
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text shown inside the email input"),
|
|
1354
|
+
prepopulatedValue: z3.string().optional().describe(
|
|
1283
1355
|
"Default email address to pre-fill the input (e.g. passed via URL param or hidden field)"
|
|
1284
1356
|
)
|
|
1285
1357
|
}).describe(
|
|
1286
1358
|
"Schema for an email question that only accepts correctly formatted email addresses"
|
|
1287
1359
|
);
|
|
1288
1360
|
var numberQuestionSchema = questionSchema.extend({
|
|
1289
|
-
type:
|
|
1290
|
-
min:
|
|
1361
|
+
type: z3.literal("number").describe("Must be exactly 'number'"),
|
|
1362
|
+
min: z3.number().optional().describe(
|
|
1291
1363
|
"Minimum allowed value (inclusive); when absent no lower bound is enforced"
|
|
1292
1364
|
),
|
|
1293
|
-
max:
|
|
1365
|
+
max: z3.number().optional().describe(
|
|
1294
1366
|
"Maximum allowed value (inclusive); when absent no upper bound is enforced"
|
|
1295
1367
|
),
|
|
1296
|
-
allowDecimal:
|
|
1368
|
+
allowDecimal: z3.boolean().optional().default(false).describe(
|
|
1297
1369
|
"Whether decimal (non-integer) values are accepted; Typeform restricts to whole numbers only, making this a differentiator"
|
|
1298
1370
|
),
|
|
1299
|
-
allowNegative:
|
|
1371
|
+
allowNegative: z3.boolean().optional().default(false).describe(
|
|
1300
1372
|
"Whether negative values are accepted; Typeform restricts to positive numbers only, making this a differentiator"
|
|
1301
1373
|
),
|
|
1302
|
-
placeholder:
|
|
1303
|
-
prepopulatedValue:
|
|
1304
|
-
unit:
|
|
1374
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text shown inside the number input"),
|
|
1375
|
+
prepopulatedValue: z3.number().optional().describe("Default numeric value to pre-fill the input"),
|
|
1376
|
+
unit: z3.string().max(10).optional().describe(
|
|
1305
1377
|
"Unit label displayed beside the input (e.g. 'kg', '$', 'years')"
|
|
1306
1378
|
)
|
|
1307
1379
|
}).refine(
|
|
@@ -1314,39 +1386,39 @@ var numberQuestionSchema = questionSchema.extend({
|
|
|
1314
1386
|
"Schema for a number question that only accepts numeric input with configurable range and format constraints"
|
|
1315
1387
|
);
|
|
1316
1388
|
var websiteQuestionSchema = questionSchema.extend({
|
|
1317
|
-
type:
|
|
1318
|
-
placeholder:
|
|
1389
|
+
type: z3.literal("website").describe("Must be exactly 'website'"),
|
|
1390
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1319
1391
|
"Placeholder text shown inside the URL input (e.g. 'https://yoursite.com')"
|
|
1320
1392
|
),
|
|
1321
|
-
prepopulatedValue:
|
|
1393
|
+
prepopulatedValue: z3.string().optional().describe("Default URL to pre-fill the input")
|
|
1322
1394
|
}).describe(
|
|
1323
1395
|
"Schema for a website question that collects a URL with built-in format validation"
|
|
1324
1396
|
);
|
|
1325
1397
|
var phoneNumberQuestionSchema = questionSchema.extend({
|
|
1326
|
-
type:
|
|
1327
|
-
defaultCountryCode:
|
|
1398
|
+
type: z3.literal("phone_number").describe("Must be exactly 'phone_number'"),
|
|
1399
|
+
defaultCountryCode: z3.string().max(2).optional().describe(
|
|
1328
1400
|
"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"
|
|
1329
1401
|
),
|
|
1330
|
-
allowCountryChange:
|
|
1402
|
+
allowCountryChange: z3.boolean().optional().default(true).describe(
|
|
1331
1403
|
"Whether the respondent can change the country code; when false the default country is locked"
|
|
1332
1404
|
),
|
|
1333
|
-
placeholder:
|
|
1334
|
-
prepopulatedValue:
|
|
1405
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text shown inside the phone number input"),
|
|
1406
|
+
prepopulatedValue: z3.string().optional().describe(
|
|
1335
1407
|
"Default phone number to pre-fill the input; E.164 format recommended (e.g. '+14155552671')"
|
|
1336
1408
|
)
|
|
1337
1409
|
}).describe(
|
|
1338
1410
|
"Schema for a phone number question with country code picker and country-specific format validation"
|
|
1339
1411
|
);
|
|
1340
|
-
var addressSubFieldConfigSchema =
|
|
1341
|
-
enabled:
|
|
1342
|
-
required:
|
|
1343
|
-
placeholder:
|
|
1344
|
-
label:
|
|
1412
|
+
var addressSubFieldConfigSchema = z3.object({
|
|
1413
|
+
enabled: z3.boolean().default(true).describe("Whether this sub-field is shown in the question"),
|
|
1414
|
+
required: z3.boolean().default(false).describe("Whether the respondent must fill in this sub-field"),
|
|
1415
|
+
placeholder: z3.string().max(200).optional().describe("Placeholder text for this sub-field input"),
|
|
1416
|
+
label: z3.string().max(120).optional().describe(
|
|
1345
1417
|
"Visible caption above this sub-field; defaults to built-in copy when omitted"
|
|
1346
1418
|
)
|
|
1347
1419
|
}).describe("Configuration for an individual address sub-field");
|
|
1348
1420
|
var addressQuestionSchema = questionSchema.extend({
|
|
1349
|
-
type:
|
|
1421
|
+
type: z3.literal("address").describe("Must be exactly 'address'"),
|
|
1350
1422
|
addressLine1: addressSubFieldConfigSchema.optional().describe("Configuration for the primary street address line"),
|
|
1351
1423
|
addressLine2: addressSubFieldConfigSchema.optional().describe(
|
|
1352
1424
|
"Configuration for the secondary address line (apartment, suite, etc.); hidden by default"
|
|
@@ -1355,13 +1427,13 @@ var addressQuestionSchema = questionSchema.extend({
|
|
|
1355
1427
|
stateProvince: addressSubFieldConfigSchema.optional().describe("Configuration for the state, region, or province sub-field"),
|
|
1356
1428
|
postalCode: addressSubFieldConfigSchema.optional().describe("Configuration for the ZIP/postal code sub-field"),
|
|
1357
1429
|
country: addressSubFieldConfigSchema.optional().describe("Configuration for the country sub-field"),
|
|
1358
|
-
defaultCountry:
|
|
1430
|
+
defaultCountry: z3.string().max(2).optional().describe(
|
|
1359
1431
|
"ISO 3166-1 alpha-2 country code to pre-select in the country dropdown (e.g. 'US', 'GB')"
|
|
1360
1432
|
)
|
|
1361
1433
|
}).describe(
|
|
1362
1434
|
"Schema for an address question that collects a full structured address on a single screen"
|
|
1363
1435
|
);
|
|
1364
|
-
var videoAudioModeSchema =
|
|
1436
|
+
var videoAudioModeSchema = z3.enum(["video", "audio", "photo", "text"]);
|
|
1365
1437
|
var VideoAudioModes = {
|
|
1366
1438
|
VIDEO: "video",
|
|
1367
1439
|
AUDIO: "audio",
|
|
@@ -1369,186 +1441,186 @@ var VideoAudioModes = {
|
|
|
1369
1441
|
TEXT: "text"
|
|
1370
1442
|
};
|
|
1371
1443
|
var videoAudioQuestionSchema = questionSchema.extend({
|
|
1372
|
-
type:
|
|
1373
|
-
allowedModes:
|
|
1444
|
+
type: z3.literal("video_audio").describe("Must be exactly 'video_audio'"),
|
|
1445
|
+
allowedModes: z3.array(videoAudioModeSchema).min(1).optional().describe(
|
|
1374
1446
|
"Which answer types the respondent can choose from (video, audio, photo, text); when absent all four are enabled"
|
|
1375
1447
|
),
|
|
1376
1448
|
defaultMode: videoAudioModeSchema.optional().describe(
|
|
1377
1449
|
"Which mode tab is pre-selected when the question opens; when absent the platform chooses"
|
|
1378
1450
|
),
|
|
1379
|
-
maxDurationSeconds:
|
|
1451
|
+
maxDurationSeconds: z3.number().int().min(5).max(600).optional().describe(
|
|
1380
1452
|
"Maximum recording length in seconds (5\u2013600); Typeform hardcodes 120s with no config, making this a differentiator; when absent the platform default applies"
|
|
1381
1453
|
),
|
|
1382
|
-
maxFileSizeMb:
|
|
1454
|
+
maxFileSizeMb: z3.number().int().min(1).max(500).optional().describe(
|
|
1383
1455
|
"Maximum size in megabytes for uploaded pre-recorded files (1\u2013500); when absent the platform ceiling applies"
|
|
1384
1456
|
),
|
|
1385
|
-
allowUpload:
|
|
1457
|
+
allowUpload: z3.boolean().optional().default(true).describe(
|
|
1386
1458
|
"Whether the respondent can upload a file in addition to recording or capturing live (video, audio, or photo)"
|
|
1387
1459
|
),
|
|
1388
|
-
placeholder:
|
|
1460
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1389
1461
|
"Instructional text shown to the respondent before they begin recording or capturing"
|
|
1390
1462
|
),
|
|
1391
|
-
modeTabLabelVideo:
|
|
1463
|
+
modeTabLabelVideo: z3.string().max(80).optional().describe(
|
|
1392
1464
|
"Custom tab label for video mode in the respondent UI; when absent defaults to 'Video'"
|
|
1393
1465
|
),
|
|
1394
|
-
modeTabLabelAudio:
|
|
1466
|
+
modeTabLabelAudio: z3.string().max(80).optional().describe(
|
|
1395
1467
|
"Custom tab label for audio mode; when absent defaults to 'Audio'"
|
|
1396
1468
|
),
|
|
1397
|
-
modeTabLabelPhoto:
|
|
1469
|
+
modeTabLabelPhoto: z3.string().max(80).optional().describe(
|
|
1398
1470
|
"Custom tab label for photo mode; when absent defaults to 'Photo'"
|
|
1399
1471
|
),
|
|
1400
|
-
modeTabLabelText:
|
|
1472
|
+
modeTabLabelText: z3.string().max(80).optional().describe(
|
|
1401
1473
|
"Custom tab label for text mode; when absent defaults to 'Text'"
|
|
1402
1474
|
),
|
|
1403
|
-
recordButtonLabel:
|
|
1404
|
-
uploadMediaButtonLabel:
|
|
1475
|
+
recordButtonLabel: z3.string().max(80).optional().describe("Label for the Record button in video/audio modes"),
|
|
1476
|
+
uploadMediaButtonLabel: z3.string().max(80).optional().describe(
|
|
1405
1477
|
"Label for the upload control in video/audio modes when uploads are allowed"
|
|
1406
1478
|
),
|
|
1407
|
-
videoIdleHint:
|
|
1479
|
+
videoIdleHint: z3.string().max(200).optional().describe(
|
|
1408
1480
|
"Hint shown over the video preview when idle; falls back to placeholder then built-in copy"
|
|
1409
1481
|
),
|
|
1410
|
-
photoEmptyHint:
|
|
1482
|
+
photoEmptyHint: z3.string().max(200).optional().describe(
|
|
1411
1483
|
"Hint in the empty photo preview area; falls back to placeholder then built-in copy"
|
|
1412
1484
|
),
|
|
1413
|
-
photoUseCameraButtonLabel:
|
|
1414
|
-
photoUploadImageButtonLabel:
|
|
1485
|
+
photoUseCameraButtonLabel: z3.string().max(80).optional().describe("Label for the Use camera button in photo mode"),
|
|
1486
|
+
photoUploadImageButtonLabel: z3.string().max(80).optional().describe("Label for the upload image button in photo mode")
|
|
1415
1487
|
}).describe(
|
|
1416
1488
|
"Schema for a video, audio, and photo question where respondents can record or upload media or enter a text answer"
|
|
1417
1489
|
);
|
|
1418
|
-
var schedulerProviderSchema =
|
|
1490
|
+
var schedulerProviderSchema = z3.enum(["google_calendar", "calendly"]);
|
|
1419
1491
|
var SchedulerProviders = {
|
|
1420
1492
|
GOOGLE_CALENDAR: "google_calendar",
|
|
1421
1493
|
CALENDLY: "calendly"
|
|
1422
1494
|
};
|
|
1423
1495
|
var schedulerQuestionSchema = questionSchema.extend({
|
|
1424
|
-
type:
|
|
1496
|
+
type: z3.literal("scheduler").describe("Must be exactly 'scheduler'"),
|
|
1425
1497
|
provider: schedulerProviderSchema.optional().describe(
|
|
1426
1498
|
"Which calendar integration to use (google_calendar or calendly); when absent the platform uses whatever is connected"
|
|
1427
1499
|
),
|
|
1428
|
-
calendarId:
|
|
1500
|
+
calendarId: z3.string().optional().describe(
|
|
1429
1501
|
"Specific Google Calendar ID or Calendly event-type URL/slug to book from; when absent the default calendar or event type is used"
|
|
1430
1502
|
),
|
|
1431
|
-
showIntroScreen:
|
|
1503
|
+
showIntroScreen: z3.boolean().optional().default(true).describe(
|
|
1432
1504
|
"Whether to show the Calendly event intro screen (account name, event name, duration) before the time picker; only applies when provider is 'calendly'"
|
|
1433
1505
|
),
|
|
1434
|
-
autofillNameFieldId:
|
|
1506
|
+
autofillNameFieldId: z3.string().optional().describe(
|
|
1435
1507
|
"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'"
|
|
1436
1508
|
),
|
|
1437
|
-
autofillEmailFieldId:
|
|
1509
|
+
autofillEmailFieldId: z3.string().optional().describe(
|
|
1438
1510
|
"ID of a prior Email question whose answer is pre-filled into the Calendly booking email field; only applies when provider is 'calendly'"
|
|
1439
1511
|
),
|
|
1440
|
-
placeholder:
|
|
1512
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1441
1513
|
"Fallback text for the book-a-meeting button when scheduleMeetingLabel is unset; also used as a secondary fallback in the CTA copy chain"
|
|
1442
1514
|
),
|
|
1443
|
-
scheduleMeetingLabel:
|
|
1515
|
+
scheduleMeetingLabel: z3.string().max(200).optional().describe(
|
|
1444
1516
|
"Primary label on the book-a-meeting button and modal; when absent uses placeholder then the built-in default (e.g. 'Schedule a meeting')"
|
|
1445
1517
|
)
|
|
1446
1518
|
}).describe(
|
|
1447
1519
|
"Schema for a scheduler question where respondents book a time slot directly within the form via Google Calendar or Calendly"
|
|
1448
1520
|
);
|
|
1449
1521
|
var qnaWithAiQuestionSchema = questionSchema.extend({
|
|
1450
|
-
type:
|
|
1451
|
-
knowledgeBase:
|
|
1522
|
+
type: z3.literal("qna_with_ai").describe("Must be exactly 'qna_with_ai'"),
|
|
1523
|
+
knowledgeBase: z3.string().max(2e4).describe(
|
|
1452
1524
|
"The knowledge base content the AI draws from when answering respondent questions; Markdown formatting is recommended; up to 20,000 characters"
|
|
1453
1525
|
),
|
|
1454
|
-
maxResponseLength:
|
|
1526
|
+
maxResponseLength: z3.number().int().min(50).max(2e3).optional().describe(
|
|
1455
1527
|
"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"
|
|
1456
1528
|
),
|
|
1457
|
-
maxQaPairs:
|
|
1529
|
+
maxQaPairs: z3.number().int().min(1).max(100).optional().describe(
|
|
1458
1530
|
"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"
|
|
1459
1531
|
),
|
|
1460
|
-
placeholder:
|
|
1532
|
+
placeholder: z3.string().max(200).optional().describe(
|
|
1461
1533
|
"Hint text shown in the respondent's question input field (e.g. 'Ask me anything about this event...')"
|
|
1462
1534
|
),
|
|
1463
|
-
askButtonLabel:
|
|
1535
|
+
askButtonLabel: z3.string().max(50).optional().describe(
|
|
1464
1536
|
"Label for the submit/ask button; when absent the platform default (e.g. 'Ask AI') is shown"
|
|
1465
1537
|
),
|
|
1466
|
-
emptyStateHint:
|
|
1538
|
+
emptyStateHint: z3.string().max(200).optional().describe(
|
|
1467
1539
|
"Message in the empty chat area (e.g. 'Ask the AI a question to get started.'); when absent uses placeholder then a built-in default"
|
|
1468
1540
|
),
|
|
1469
|
-
pairsRemainingTemplate:
|
|
1541
|
+
pairsRemainingTemplate: z3.string().max(160).optional().describe(
|
|
1470
1542
|
"Counter when under the limit; use tokens {remaining} and {max} (e.g. '{remaining} of {max} questions remaining'); when absent the client uses built-in English with pluralization"
|
|
1471
1543
|
),
|
|
1472
|
-
pairsLimitReachedTemplate:
|
|
1544
|
+
pairsLimitReachedTemplate: z3.string().max(160).optional().describe(
|
|
1473
1545
|
"Counter when the exchange limit is reached; use token {max}; when absent the client uses built-in English with pluralization"
|
|
1474
1546
|
)
|
|
1475
1547
|
}).describe(
|
|
1476
1548
|
"Schema for a Q&A with AI question where respondents ask questions and receive AI-generated answers drawn from a configurable knowledge base"
|
|
1477
1549
|
);
|
|
1478
|
-
var paymentsUpiAmountConfigSchema =
|
|
1479
|
-
|
|
1480
|
-
mode:
|
|
1481
|
-
amount:
|
|
1550
|
+
var paymentsUpiAmountConfigSchema = z3.discriminatedUnion("mode", [
|
|
1551
|
+
z3.object({
|
|
1552
|
+
mode: z3.literal("fixed").describe("A fixed amount configured by the form builder"),
|
|
1553
|
+
amount: z3.number().positive().describe("Fixed amount to request in INR")
|
|
1482
1554
|
}),
|
|
1483
|
-
|
|
1484
|
-
mode:
|
|
1485
|
-
minAmount:
|
|
1486
|
-
maxAmount:
|
|
1487
|
-
defaultAmount:
|
|
1555
|
+
z3.object({
|
|
1556
|
+
mode: z3.literal("range").describe("Respondent enters an amount within the configured range"),
|
|
1557
|
+
minAmount: z3.number().positive().describe("Minimum allowed amount in INR"),
|
|
1558
|
+
maxAmount: z3.number().positive().describe("Maximum allowed amount in INR"),
|
|
1559
|
+
defaultAmount: z3.number().positive().optional().describe("Optional initial amount shown to the respondent")
|
|
1488
1560
|
}),
|
|
1489
|
-
|
|
1490
|
-
mode:
|
|
1491
|
-
sources:
|
|
1492
|
-
|
|
1493
|
-
sourceQuestionId:
|
|
1561
|
+
z3.object({
|
|
1562
|
+
mode: z3.literal("question_mappings").describe("Amount is summed from one or more previous question answers"),
|
|
1563
|
+
sources: z3.array(
|
|
1564
|
+
z3.object({
|
|
1565
|
+
sourceQuestionId: z3.string().describe(
|
|
1494
1566
|
"ID of the prior question whose answer contributes to the amount"
|
|
1495
1567
|
),
|
|
1496
|
-
mappings:
|
|
1497
|
-
|
|
1498
|
-
answerValue:
|
|
1499
|
-
amount:
|
|
1568
|
+
mappings: z3.array(
|
|
1569
|
+
z3.object({
|
|
1570
|
+
answerValue: z3.string().describe("Previous question answer value to match"),
|
|
1571
|
+
amount: z3.number().nonnegative().describe(
|
|
1500
1572
|
"Amount to add in INR when this answer is selected"
|
|
1501
1573
|
),
|
|
1502
|
-
label:
|
|
1574
|
+
label: z3.string().max(120).optional().describe("Optional display label for this mapped amount")
|
|
1503
1575
|
})
|
|
1504
1576
|
).min(1).describe("Answer-to-amount mappings for this source question")
|
|
1505
1577
|
})
|
|
1506
1578
|
).min(1).describe("Previous question sources that contribute to the amount"),
|
|
1507
|
-
fallbackAmount:
|
|
1579
|
+
fallbackAmount: z3.number().nonnegative().optional().describe("Optional amount to use when no source mapping matches")
|
|
1508
1580
|
})
|
|
1509
1581
|
]).superRefine((data, ctx) => {
|
|
1510
1582
|
if (data.mode !== "range") return;
|
|
1511
1583
|
if (data.minAmount > data.maxAmount) {
|
|
1512
1584
|
ctx.addIssue({
|
|
1513
|
-
code:
|
|
1585
|
+
code: z3.ZodIssueCode.custom,
|
|
1514
1586
|
message: "minAmount cannot be greater than maxAmount",
|
|
1515
1587
|
path: ["minAmount"]
|
|
1516
1588
|
});
|
|
1517
1589
|
}
|
|
1518
1590
|
if (data.defaultAmount !== void 0 && (data.defaultAmount < data.minAmount || data.defaultAmount > data.maxAmount)) {
|
|
1519
1591
|
ctx.addIssue({
|
|
1520
|
-
code:
|
|
1592
|
+
code: z3.ZodIssueCode.custom,
|
|
1521
1593
|
message: "defaultAmount must be within minAmount and maxAmount",
|
|
1522
1594
|
path: ["defaultAmount"]
|
|
1523
1595
|
});
|
|
1524
1596
|
}
|
|
1525
1597
|
}).describe("Amount configuration for a payments_upi question");
|
|
1526
1598
|
var paymentsUpiQuestionSchema = questionSchema.extend({
|
|
1527
|
-
type:
|
|
1528
|
-
payeeVpa:
|
|
1599
|
+
type: z3.literal("payments_upi").describe("Must be exactly 'payments_upi'"),
|
|
1600
|
+
payeeVpa: z3.string().min(3).max(255).regex(
|
|
1529
1601
|
/^[\w.\-]+@[\w.\-]+$/,
|
|
1530
1602
|
"payeeVpa must be a valid UPI VPA such as merchant@bank"
|
|
1531
1603
|
).describe("UPI virtual payment address that receives the payment"),
|
|
1532
|
-
payeeName:
|
|
1604
|
+
payeeName: z3.string().max(100).optional().describe("Display name for the UPI payee"),
|
|
1533
1605
|
amount: paymentsUpiAmountConfigSchema.describe(
|
|
1534
1606
|
"How the requested INR amount is determined"
|
|
1535
1607
|
),
|
|
1536
|
-
sourceEmailQuestionId:
|
|
1608
|
+
sourceEmailQuestionId: z3.string().optional().describe(
|
|
1537
1609
|
"Optional ID of the email question whose answer is used for form submission receipt emails"
|
|
1538
1610
|
),
|
|
1539
|
-
transactionNote:
|
|
1611
|
+
transactionNote: z3.string().max(80).optional().describe(
|
|
1540
1612
|
"Short note included in the UPI intent; the platform may append the Encatch reference"
|
|
1541
1613
|
),
|
|
1542
|
-
transactionReferencePrefix:
|
|
1543
|
-
qrLabel:
|
|
1544
|
-
openUpiAppLabel:
|
|
1545
|
-
copyUpiIdLabel:
|
|
1546
|
-
transactionIdLabel:
|
|
1547
|
-
transactionIdPlaceholder:
|
|
1614
|
+
transactionReferencePrefix: z3.string().max(24).optional().describe("Optional prefix for generated Encatch payment references"),
|
|
1615
|
+
qrLabel: z3.string().max(100).optional().describe("Label shown above the UPI QR code"),
|
|
1616
|
+
openUpiAppLabel: z3.string().max(80).optional().describe("Label for the mobile UPI intent button"),
|
|
1617
|
+
copyUpiIdLabel: z3.string().max(80).optional().describe("Label for the copy UPI ID button"),
|
|
1618
|
+
transactionIdLabel: z3.string().max(100).optional().describe("Label for the self-reported transaction ID / UTR input"),
|
|
1619
|
+
transactionIdPlaceholder: z3.string().max(120).optional().describe("Placeholder for the transaction ID / UTR input")
|
|
1548
1620
|
}).describe(
|
|
1549
1621
|
"Schema for a self-reported UPI payment question that renders a UPI QR/intent link and collects the respondent-entered transaction ID"
|
|
1550
1622
|
);
|
|
1551
|
-
var combinedQuestionSchema =
|
|
1623
|
+
var combinedQuestionSchema = z3.discriminatedUnion("type", [
|
|
1552
1624
|
ratingQuestionSchema,
|
|
1553
1625
|
annotationQuestionSchema,
|
|
1554
1626
|
welcomeQuestionSchema,
|
|
@@ -1585,167 +1657,167 @@ var combinedQuestionSchema = z2.discriminatedUnion("type", [
|
|
|
1585
1657
|
]);
|
|
1586
1658
|
|
|
1587
1659
|
// src/schemas/fields/answer-schema.ts
|
|
1588
|
-
import { z as
|
|
1589
|
-
var AnnotationMarkerSchema =
|
|
1590
|
-
markerNo:
|
|
1591
|
-
timeline:
|
|
1592
|
-
comment:
|
|
1660
|
+
import { z as z4 } from "zod";
|
|
1661
|
+
var AnnotationMarkerSchema = z4.object({
|
|
1662
|
+
markerNo: z4.string(),
|
|
1663
|
+
timeline: z4.string(),
|
|
1664
|
+
comment: z4.string()
|
|
1593
1665
|
});
|
|
1594
|
-
var AnnotationSchema =
|
|
1595
|
-
fileType:
|
|
1596
|
-
fileName:
|
|
1597
|
-
markers:
|
|
1666
|
+
var AnnotationSchema = z4.object({
|
|
1667
|
+
fileType: z4.string(),
|
|
1668
|
+
fileName: z4.string(),
|
|
1669
|
+
markers: z4.array(AnnotationMarkerSchema)
|
|
1598
1670
|
});
|
|
1599
|
-
var SignatureAnswerSchema =
|
|
1600
|
-
mode:
|
|
1601
|
-
fileUrl:
|
|
1671
|
+
var SignatureAnswerSchema = z4.object({
|
|
1672
|
+
mode: z4.enum(["type", "draw", "upload"]).describe("The signing method the respondent used"),
|
|
1673
|
+
fileUrl: z4.string().optional().describe(
|
|
1602
1674
|
"Secure URL to the signature artifact for draw and upload modes"
|
|
1603
1675
|
),
|
|
1604
|
-
typedName:
|
|
1676
|
+
typedName: z4.string().optional().describe("The name the respondent typed for type mode")
|
|
1605
1677
|
}).describe("Answer for a signature question");
|
|
1606
|
-
var FileUploadAnswerItemSchema =
|
|
1607
|
-
fileUrl:
|
|
1608
|
-
fileName:
|
|
1609
|
-
fileSizeMb:
|
|
1610
|
-
mimeType:
|
|
1678
|
+
var FileUploadAnswerItemSchema = z4.object({
|
|
1679
|
+
fileUrl: z4.string().describe("Secure URL to the uploaded file"),
|
|
1680
|
+
fileName: z4.string().describe("Original filename as provided by the respondent"),
|
|
1681
|
+
fileSizeMb: z4.number().describe("File size in megabytes"),
|
|
1682
|
+
mimeType: z4.string().optional().describe(
|
|
1611
1683
|
"MIME type of the uploaded file (e.g. 'application/pdf', 'image/jpeg')"
|
|
1612
1684
|
)
|
|
1613
1685
|
}).describe("Metadata for a single uploaded file");
|
|
1614
|
-
var FileUploadAnswerSchema =
|
|
1686
|
+
var FileUploadAnswerSchema = z4.array(FileUploadAnswerItemSchema).describe(
|
|
1615
1687
|
"Answer for a file upload question; array supports single and multiple file uploads"
|
|
1616
1688
|
);
|
|
1617
|
-
var PhoneNumberAnswerSchema =
|
|
1618
|
-
countryCode:
|
|
1689
|
+
var PhoneNumberAnswerSchema = z4.object({
|
|
1690
|
+
countryCode: z4.string().describe(
|
|
1619
1691
|
"Dialing country code including the + prefix (e.g. '+1', '+91')"
|
|
1620
1692
|
),
|
|
1621
|
-
number:
|
|
1622
|
-
e164:
|
|
1693
|
+
number: z4.string().describe("Local phone number without the country code"),
|
|
1694
|
+
e164: z4.string().optional().describe("Full phone number in E.164 format (e.g. '+14155552671')")
|
|
1623
1695
|
}).describe("Answer for a phone number question");
|
|
1624
|
-
var AddressAnswerSchema =
|
|
1625
|
-
addressLine1:
|
|
1626
|
-
addressLine2:
|
|
1627
|
-
city:
|
|
1628
|
-
stateProvince:
|
|
1629
|
-
postalCode:
|
|
1630
|
-
country:
|
|
1696
|
+
var AddressAnswerSchema = z4.object({
|
|
1697
|
+
addressLine1: z4.string().optional().describe("Primary street address line"),
|
|
1698
|
+
addressLine2: z4.string().optional().describe("Secondary address line (apartment, suite, etc.)"),
|
|
1699
|
+
city: z4.string().optional().describe("City or town"),
|
|
1700
|
+
stateProvince: z4.string().optional().describe("State, region, or province"),
|
|
1701
|
+
postalCode: z4.string().optional().describe("ZIP or postal code"),
|
|
1702
|
+
country: z4.string().optional().describe("Country name or ISO 3166-1 alpha-2 code")
|
|
1631
1703
|
}).describe("Answer for an address question");
|
|
1632
|
-
var VideoAudioAnswerSchema =
|
|
1633
|
-
mode:
|
|
1634
|
-
fileUrl:
|
|
1704
|
+
var VideoAudioAnswerSchema = z4.object({
|
|
1705
|
+
mode: z4.enum(["video", "audio", "photo", "text"]).describe("The answer mode the respondent chose"),
|
|
1706
|
+
fileUrl: z4.string().optional().describe(
|
|
1635
1707
|
"Secure URL or temporary data URL to the recorded, captured, or uploaded video, audio, or image file"
|
|
1636
1708
|
),
|
|
1637
|
-
text:
|
|
1638
|
-
durationSeconds:
|
|
1709
|
+
text: z4.string().optional().describe("Written answer for text mode"),
|
|
1710
|
+
durationSeconds: z4.number().optional().describe(
|
|
1639
1711
|
"Actual recording length in seconds for video and audio modes (not used for photo)"
|
|
1640
1712
|
),
|
|
1641
|
-
transcriptText:
|
|
1713
|
+
transcriptText: z4.string().optional().describe("Auto-generated transcript for video and audio recordings")
|
|
1642
1714
|
}).describe("Answer for a video and audio question");
|
|
1643
|
-
var QnaWithAiPairSchema =
|
|
1644
|
-
question:
|
|
1645
|
-
answer:
|
|
1715
|
+
var QnaWithAiPairSchema = z4.object({
|
|
1716
|
+
question: z4.string().describe("The question the respondent asked"),
|
|
1717
|
+
answer: z4.string().describe("The AI-generated answer based on the knowledge base")
|
|
1646
1718
|
}).describe("A single Q&A exchange between the respondent and the AI");
|
|
1647
|
-
var QnaWithAiAnswerSchema =
|
|
1719
|
+
var QnaWithAiAnswerSchema = z4.array(QnaWithAiPairSchema).describe(
|
|
1648
1720
|
"Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session"
|
|
1649
1721
|
);
|
|
1650
|
-
var SchedulerAnswerSchema =
|
|
1651
|
-
|
|
1652
|
-
provider:
|
|
1653
|
-
bookedAt:
|
|
1722
|
+
var SchedulerAnswerSchema = z4.discriminatedUnion("provider", [
|
|
1723
|
+
z4.object({
|
|
1724
|
+
provider: z4.literal("google_calendar").describe("The calendar integration used to make the booking"),
|
|
1725
|
+
bookedAt: z4.string().describe(
|
|
1654
1726
|
"Unix timestamp in seconds as a string when the respondent confirmed the booking"
|
|
1655
1727
|
)
|
|
1656
1728
|
}),
|
|
1657
|
-
|
|
1658
|
-
provider:
|
|
1659
|
-
slotStart:
|
|
1729
|
+
z4.object({
|
|
1730
|
+
provider: z4.literal("calendly").describe("The calendar integration used to make the booking"),
|
|
1731
|
+
slotStart: z4.string().describe(
|
|
1660
1732
|
"ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')"
|
|
1661
1733
|
),
|
|
1662
|
-
slotEnd:
|
|
1734
|
+
slotEnd: z4.string().describe(
|
|
1663
1735
|
"ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')"
|
|
1664
1736
|
),
|
|
1665
|
-
eventId:
|
|
1666
|
-
bookedAt:
|
|
1737
|
+
eventId: z4.string().optional().describe("Calendly event UUID"),
|
|
1738
|
+
bookedAt: z4.string().describe(
|
|
1667
1739
|
"Unix timestamp in seconds as a string when the respondent completed the booking"
|
|
1668
1740
|
)
|
|
1669
1741
|
})
|
|
1670
1742
|
]).describe("Answer for a scheduler question");
|
|
1671
|
-
var PaymentsUpiAnswerSchema =
|
|
1672
|
-
transactionId:
|
|
1743
|
+
var PaymentsUpiAnswerSchema = z4.object({
|
|
1744
|
+
transactionId: z4.string().describe(
|
|
1673
1745
|
"Respondent-entered UPI transaction ID / UTR; self-reported and not verified by Encatch"
|
|
1674
1746
|
),
|
|
1675
|
-
encatchPaymentReference:
|
|
1747
|
+
encatchPaymentReference: z4.string().describe(
|
|
1676
1748
|
"Opaque Encatch-generated reconciliation reference included in the UPI intent"
|
|
1677
1749
|
),
|
|
1678
|
-
amount:
|
|
1750
|
+
amount: z4.string().trim().refine((s) => {
|
|
1679
1751
|
const n = Number(s);
|
|
1680
1752
|
return Number.isFinite(n) && n > 0;
|
|
1681
1753
|
}, { message: "Amount must be a positive numeric value" }).describe(
|
|
1682
1754
|
"INR amount shown to the respondent when the payment instruction was generated, as a decimal string (legacy numeric values are accepted when parsing)"
|
|
1683
1755
|
),
|
|
1684
|
-
currency:
|
|
1685
|
-
payeeVpa:
|
|
1686
|
-
payeeName:
|
|
1687
|
-
sourceEmail:
|
|
1688
|
-
upiIntentUri:
|
|
1689
|
-
selfReported:
|
|
1756
|
+
currency: z4.literal("INR").describe("Currency for UPI payments"),
|
|
1757
|
+
payeeVpa: z4.string().describe("UPI VPA shown to the respondent"),
|
|
1758
|
+
payeeName: z4.string().optional().describe("Payee display name shown to the respondent"),
|
|
1759
|
+
sourceEmail: z4.string().optional().describe("Email address resolved from the configured source email question"),
|
|
1760
|
+
upiIntentUri: z4.string().optional().describe("Generated UPI intent URI shown to the respondent"),
|
|
1761
|
+
selfReported: z4.literal(true).describe(
|
|
1690
1762
|
"Always true: Encatch records this answer but does not verify the payment"
|
|
1691
1763
|
)
|
|
1692
1764
|
}).describe("Answer for a payments_upi question");
|
|
1693
|
-
var AnswerItemSchema =
|
|
1694
|
-
nps:
|
|
1695
|
-
nestedSelection:
|
|
1696
|
-
longText:
|
|
1697
|
-
shortAnswer:
|
|
1698
|
-
singleChoice:
|
|
1699
|
-
rating:
|
|
1700
|
-
yesNo:
|
|
1701
|
-
consent:
|
|
1765
|
+
var AnswerItemSchema = z4.object({
|
|
1766
|
+
nps: z4.number().optional().describe("Net Promoter Score value (e.g., 0-10)"),
|
|
1767
|
+
nestedSelection: z4.array(z4.string()).optional().describe("Array of selected nested option IDs"),
|
|
1768
|
+
longText: z4.string().optional().describe("Long text answer, e.g., paragraph or essay"),
|
|
1769
|
+
shortAnswer: z4.string().optional().describe("Short text answer, e.g., single sentence or word"),
|
|
1770
|
+
singleChoice: z4.string().optional().describe("Single selected option value for single choice questions"),
|
|
1771
|
+
rating: z4.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
1772
|
+
yesNo: z4.boolean().optional().describe("Yes/no answer for yes_no questions (true = Yes, false = No)"),
|
|
1773
|
+
consent: z4.boolean().optional().describe(
|
|
1702
1774
|
"Consent answer for consent questions (true = checked/agreed, false = unchecked)"
|
|
1703
1775
|
),
|
|
1704
|
-
multipleChoiceMultiple:
|
|
1776
|
+
multipleChoiceMultiple: z4.array(z4.string()).optional().describe(
|
|
1705
1777
|
"Array of selected option values for multiple choice questions"
|
|
1706
1778
|
),
|
|
1707
|
-
singleChoiceOther:
|
|
1779
|
+
singleChoiceOther: z4.string().optional().describe(
|
|
1708
1780
|
'Free-text "other" answer for single choice questions when allowOther is enabled'
|
|
1709
1781
|
),
|
|
1710
|
-
multipleChoiceOther:
|
|
1782
|
+
multipleChoiceOther: z4.string().optional().describe(
|
|
1711
1783
|
'Free-text "other" answer for multiple choice questions when allowOther is enabled'
|
|
1712
1784
|
),
|
|
1713
1785
|
annotation: AnnotationSchema.optional().describe(
|
|
1714
1786
|
"Annotation object containing file and marker details"
|
|
1715
1787
|
),
|
|
1716
|
-
ratingMatrix:
|
|
1788
|
+
ratingMatrix: z4.record(z4.string(), z4.union([z4.number(), z4.string()])).optional().describe(
|
|
1717
1789
|
"Rating matrix answers keyed by statement value (export key), value is the selected scale value (number for likert/numerical, string for custom)"
|
|
1718
1790
|
),
|
|
1719
|
-
matrixSingleChoice:
|
|
1791
|
+
matrixSingleChoice: z4.record(z4.string(), z4.string()).optional().describe(
|
|
1720
1792
|
"Matrix single-choice answers keyed by row value (export key), map value is the selected column option value"
|
|
1721
1793
|
),
|
|
1722
|
-
matrixMultipleChoice:
|
|
1794
|
+
matrixMultipleChoice: z4.record(z4.string(), z4.array(z4.string())).optional().describe(
|
|
1723
1795
|
"Matrix multiple-choice answers keyed by row value (export key), map value is array of selected column option values"
|
|
1724
1796
|
),
|
|
1725
|
-
others:
|
|
1797
|
+
others: z4.string().optional().describe(
|
|
1726
1798
|
"For multiple choice questions and single choice questions, this is the value of the other option"
|
|
1727
1799
|
),
|
|
1728
1800
|
// Date question
|
|
1729
|
-
date:
|
|
1801
|
+
date: z4.string().optional().describe(
|
|
1730
1802
|
"Answer for a date question; ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM)"
|
|
1731
1803
|
),
|
|
1732
1804
|
// CSAT question
|
|
1733
|
-
csat:
|
|
1805
|
+
csat: z4.number().optional().describe(
|
|
1734
1806
|
"Answer for a CSAT question; industry-standard value: 1 (lowest/worst) to N (highest/best) where N is the scale size (2\u20135)"
|
|
1735
1807
|
),
|
|
1736
1808
|
// Opinion scale question
|
|
1737
|
-
opinionScale:
|
|
1809
|
+
opinionScale: z4.number().optional().describe(
|
|
1738
1810
|
"Answer for an opinion scale question; the selected numeric value on the scale"
|
|
1739
1811
|
),
|
|
1740
1812
|
// Ranking question — ordered array of option values; index 0 = rank 1
|
|
1741
|
-
ranking:
|
|
1813
|
+
ranking: z4.array(z4.string()).optional().describe(
|
|
1742
1814
|
"Answer for a ranking question; ordered array of option values where index 0 is rank 1"
|
|
1743
1815
|
),
|
|
1744
1816
|
// Picture choice — always an array of selected option values (single selection = one-element array)
|
|
1745
|
-
pictureChoice:
|
|
1817
|
+
pictureChoice: z4.array(z4.string()).optional().describe(
|
|
1746
1818
|
"Answer for a picture choice question; array of selected option values (single selection produces a one-element array)"
|
|
1747
1819
|
),
|
|
1748
|
-
pictureChoiceOther:
|
|
1820
|
+
pictureChoiceOther: z4.string().optional().describe(
|
|
1749
1821
|
'Free-text "other" answer for picture choice questions when allowOther is enabled'
|
|
1750
1822
|
),
|
|
1751
1823
|
// Signature question
|
|
@@ -1757,13 +1829,13 @@ var AnswerItemSchema = z3.object({
|
|
|
1757
1829
|
"Answer for a file upload question; array supports single and multiple file uploads"
|
|
1758
1830
|
),
|
|
1759
1831
|
// Email question
|
|
1760
|
-
email:
|
|
1832
|
+
email: z4.string().optional().describe("Answer for an email question; the submitted email address"),
|
|
1761
1833
|
// Number question
|
|
1762
|
-
number:
|
|
1834
|
+
number: z4.string().optional().describe(
|
|
1763
1835
|
"Answer for a number question; the submitted numeric value as a string"
|
|
1764
1836
|
),
|
|
1765
1837
|
// Website question
|
|
1766
|
-
website:
|
|
1838
|
+
website: z4.string().optional().describe("Answer for a website question; the submitted URL"),
|
|
1767
1839
|
// Phone number question
|
|
1768
1840
|
phoneNumber: PhoneNumberAnswerSchema.optional().describe(
|
|
1769
1841
|
"Answer for a phone number question"
|
|
@@ -1794,62 +1866,62 @@ var AnswerItemSchema = z3.object({
|
|
|
1794
1866
|
var AnswerSchema = AnswerItemSchema;
|
|
1795
1867
|
|
|
1796
1868
|
// src/schemas/fields/form-schema.ts
|
|
1797
|
-
import { z as
|
|
1798
|
-
var externalPublishingPropertiesSchema =
|
|
1799
|
-
isShareable:
|
|
1800
|
-
isEmailShareable:
|
|
1869
|
+
import { z as z5 } from "zod";
|
|
1870
|
+
var externalPublishingPropertiesSchema = z5.object({
|
|
1871
|
+
isShareable: z5.boolean().describe("Whether the feedback results can be shared externally"),
|
|
1872
|
+
isEmailShareable: z5.boolean().describe("Whether the feedback can be shared via email")
|
|
1801
1873
|
}).describe("Schema defining external publishing and sharing properties for feedback");
|
|
1802
|
-
var publicationStatusSchema =
|
|
1874
|
+
var publicationStatusSchema = z5.enum(["P", "D", "A", "S"]).describe("Publication status: P=Published, D=Draft, A=Archived, S=Stopped");
|
|
1803
1875
|
var PublicationStatuses = {
|
|
1804
1876
|
PUBLISHED: "P",
|
|
1805
1877
|
DRAFT: "D",
|
|
1806
1878
|
ARCHIVED: "A",
|
|
1807
1879
|
STOPPED: "S"
|
|
1808
1880
|
};
|
|
1809
|
-
var feedbackConfigurationSchema =
|
|
1810
|
-
formTitle:
|
|
1811
|
-
formDescription:
|
|
1881
|
+
var feedbackConfigurationSchema = z5.object({
|
|
1882
|
+
formTitle: z5.string().describe("Title of the feedback form"),
|
|
1883
|
+
formDescription: z5.string().describe("Description of the feedback form"),
|
|
1812
1884
|
isPublished: publicationStatusSchema.describe("Publication status of the feedback form")
|
|
1813
1885
|
}).describe("Schema defining feedback configuration properties");
|
|
1814
1886
|
|
|
1815
1887
|
// src/schemas/fields/form-properties-schema.ts
|
|
1816
|
-
import { z as
|
|
1888
|
+
import { z as z10 } from "zod";
|
|
1817
1889
|
|
|
1818
1890
|
// src/schemas/fields/other-screen-schema.ts
|
|
1819
|
-
import { z as
|
|
1820
|
-
var OtherFieldsSchema =
|
|
1821
|
-
questionNumber:
|
|
1822
|
-
submitButtonLabel:
|
|
1823
|
-
previousButtonLabel:
|
|
1824
|
-
aiEnhancementSuccessMessage:
|
|
1825
|
-
aiEnhancementCooldownErrorMessage:
|
|
1826
|
-
aiEnhancementMaxReachedErrorMessage:
|
|
1827
|
-
remindMeLaterButtonLabel:
|
|
1828
|
-
estimatedCompletionLabel:
|
|
1829
|
-
respondentsShowMinThreshold:
|
|
1830
|
-
respondentsLabel:
|
|
1831
|
-
windowTitle:
|
|
1891
|
+
import { z as z6 } from "zod";
|
|
1892
|
+
var OtherFieldsSchema = z6.object({
|
|
1893
|
+
questionNumber: z6.boolean().describe("Whether to display question numbers"),
|
|
1894
|
+
submitButtonLabel: z6.string().min(1).max(50).describe("Text for the submit button"),
|
|
1895
|
+
previousButtonLabel: z6.string().min(1).max(50).describe("Text for the previous button in pagination"),
|
|
1896
|
+
aiEnhancementSuccessMessage: z6.string().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),
|
|
1897
|
+
aiEnhancementCooldownErrorMessage: z6.string().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
1898
|
+
aiEnhancementMaxReachedErrorMessage: z6.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)"),
|
|
1899
|
+
remindMeLaterButtonLabel: z6.string().max(50).optional().describe("Label for the remind me later button; when absent or blank the button is not shown"),
|
|
1900
|
+
estimatedCompletionLabel: z6.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"),
|
|
1901
|
+
respondentsShowMinThreshold: z6.number().int().min(1).optional().describe("Minimum number of respondents required before the respondents badge is shown; when absent the badge is never shown"),
|
|
1902
|
+
respondentsLabel: z6.string().max(100).optional().describe("Label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time"),
|
|
1903
|
+
windowTitle: z6.string().max(100).optional().describe("Custom browser window/tab title for the form; when absent the platform uses a default (e.g. the form title or app name)")
|
|
1832
1904
|
}).describe("Schema for other form configuration fields");
|
|
1833
|
-
var LanguageFieldSchema =
|
|
1834
|
-
value:
|
|
1835
|
-
label:
|
|
1905
|
+
var LanguageFieldSchema = z6.object({
|
|
1906
|
+
value: z6.string().min(1).max(10).describe("Language code (e.g., 'en', 'es', 'fr')"),
|
|
1907
|
+
label: z6.string().min(1).max(50).describe("Display name for the language (e.g., 'English', 'Spanish', 'French')")
|
|
1836
1908
|
}).describe("Schema for individual language field with value and label");
|
|
1837
|
-
var LanguagesSchema =
|
|
1838
|
-
var OtherFieldsTranslationSchema =
|
|
1839
|
-
submitButtonLabel:
|
|
1840
|
-
previousButtonLabel:
|
|
1841
|
-
aiEnhancementSuccessMessage:
|
|
1842
|
-
aiEnhancementCooldownErrorMessage:
|
|
1843
|
-
aiEnhancementMaxReachedErrorMessage:
|
|
1844
|
-
remindMeLaterButtonLabel:
|
|
1845
|
-
estimatedCompletionLabel:
|
|
1846
|
-
respondentsLabel:
|
|
1847
|
-
windowTitle:
|
|
1909
|
+
var LanguagesSchema = z6.array(LanguageFieldSchema).describe("Schema for array of available languages");
|
|
1910
|
+
var OtherFieldsTranslationSchema = z6.object({
|
|
1911
|
+
submitButtonLabel: z6.string().min(1).max(50).describe("Translated text for the submit button"),
|
|
1912
|
+
previousButtonLabel: z6.string().min(1).max(50).describe("Translated text for the previous button in pagination"),
|
|
1913
|
+
aiEnhancementSuccessMessage: z6.string().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),
|
|
1914
|
+
aiEnhancementCooldownErrorMessage: z6.string().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
1915
|
+
aiEnhancementMaxReachedErrorMessage: z6.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)"),
|
|
1916
|
+
remindMeLaterButtonLabel: z6.string().max(50).optional().describe("Translated label for the remind me later button"),
|
|
1917
|
+
estimatedCompletionLabel: z6.string().max(100).optional().describe("Translated estimated completion time label"),
|
|
1918
|
+
respondentsLabel: z6.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"),
|
|
1919
|
+
windowTitle: z6.string().max(100).optional().describe("Translated browser window/tab title for the form")
|
|
1848
1920
|
}).describe("Schema for other form configuration field translations");
|
|
1849
1921
|
|
|
1850
1922
|
// src/schemas/fields/theme-schema.ts
|
|
1851
|
-
import { z as
|
|
1852
|
-
var positionSchema =
|
|
1923
|
+
import { z as z7 } from "zod";
|
|
1924
|
+
var positionSchema = z7.enum([
|
|
1853
1925
|
"top-left",
|
|
1854
1926
|
"top-center",
|
|
1855
1927
|
"top-right",
|
|
@@ -1871,12 +1943,12 @@ var Positions = {
|
|
|
1871
1943
|
BOTTOM_CENTER: "bottom-center",
|
|
1872
1944
|
BOTTOM_RIGHT: "bottom-right"
|
|
1873
1945
|
};
|
|
1874
|
-
var themeModeSchema =
|
|
1946
|
+
var themeModeSchema = z7.enum(["light", "dark"]).describe("Available theme modes for the widget");
|
|
1875
1947
|
var ThemeModes = {
|
|
1876
1948
|
LIGHT: "light",
|
|
1877
1949
|
DARK: "dark"
|
|
1878
1950
|
};
|
|
1879
|
-
var shareableModeSchema =
|
|
1951
|
+
var shareableModeSchema = z7.enum(["light", "dark", "system"]).describe(
|
|
1880
1952
|
"Display mode for the shareable widget: light, dark, or system preference"
|
|
1881
1953
|
);
|
|
1882
1954
|
var ShareableModes = {
|
|
@@ -1884,7 +1956,7 @@ var ShareableModes = {
|
|
|
1884
1956
|
DARK: "dark",
|
|
1885
1957
|
SYSTEM: "system"
|
|
1886
1958
|
};
|
|
1887
|
-
var previousButtonModeSchema =
|
|
1959
|
+
var previousButtonModeSchema = z7.enum(["never", "always", "auto"]).describe(
|
|
1888
1960
|
"Previous button visibility: never (always hidden), always (always shown), or auto (per-section via isPreviousAllowed)"
|
|
1889
1961
|
);
|
|
1890
1962
|
var PreviousButtonModes = {
|
|
@@ -1892,58 +1964,58 @@ var PreviousButtonModes = {
|
|
|
1892
1964
|
ALWAYS: "always",
|
|
1893
1965
|
AUTO: "auto"
|
|
1894
1966
|
};
|
|
1895
|
-
var logoPlacementSchema =
|
|
1896
|
-
var logoSizeSchema =
|
|
1897
|
-
var logoSurfaceOverrideSchema =
|
|
1967
|
+
var logoPlacementSchema = z7.enum(["top-left", "top-center", "top-right"]).describe("Where the logo is anchored in the form header");
|
|
1968
|
+
var logoSizeSchema = z7.enum(["small", "medium", "large"]).describe("Rendered display size of the logo within the 96\xD740 px container");
|
|
1969
|
+
var logoSurfaceOverrideSchema = z7.object({
|
|
1898
1970
|
size: logoSizeSchema.optional().describe("Size override for this surface; falls back to the global size"),
|
|
1899
1971
|
placement: logoPlacementSchema.optional().describe("Placement override for this surface; falls back to the global placement"),
|
|
1900
|
-
hidden:
|
|
1901
|
-
disableLink:
|
|
1972
|
+
hidden: z7.boolean().optional().describe("When true, the logo is suppressed on this surface"),
|
|
1973
|
+
disableLink: z7.boolean().optional().describe("When true, the logo is not clickable on this surface")
|
|
1902
1974
|
}).describe("Per-surface overrides for logo display on link/shareable");
|
|
1903
|
-
var logoSchema =
|
|
1904
|
-
href:
|
|
1905
|
-
light:
|
|
1906
|
-
dark:
|
|
1975
|
+
var logoSchema = z7.object({
|
|
1976
|
+
href: z7.object({
|
|
1977
|
+
light: z7.string().url().describe("Logo URL for light mode \u2014 rendered within a 96\xD740 px container"),
|
|
1978
|
+
dark: z7.string().url().optional().describe("Logo URL for dark mode; falls back to light if absent")
|
|
1907
1979
|
}).describe("Logo image URLs per theme mode"),
|
|
1908
1980
|
placement: logoPlacementSchema.default("top-left").describe("Default placement in the form header"),
|
|
1909
1981
|
size: logoSizeSchema.default("medium").describe("Default rendered size of the logo"),
|
|
1910
|
-
linkUrl:
|
|
1911
|
-
altText:
|
|
1912
|
-
surfaces:
|
|
1913
|
-
link:
|
|
1982
|
+
linkUrl: z7.string().url().optional().describe("Optional URL to navigate to when the logo is clicked"),
|
|
1983
|
+
altText: z7.string().max(200).optional().describe("Accessible alt text for the logo image"),
|
|
1984
|
+
surfaces: z7.object({
|
|
1985
|
+
link: z7.object({
|
|
1914
1986
|
mobile: logoSurfaceOverrideSchema.optional().describe("Overrides for link/shareable on mobile viewports"),
|
|
1915
1987
|
others: logoSurfaceOverrideSchema.optional().describe("Overrides for link/shareable on tablet and desktop viewports")
|
|
1916
1988
|
}).optional()
|
|
1917
1989
|
}).optional().describe("Per-surface overrides; logo is link/shareable only \u2014 not rendered in-app")
|
|
1918
1990
|
}).describe("Logo displayed in the form header; applies to link/shareable surfaces only");
|
|
1919
|
-
var featureSettingsSchema =
|
|
1920
|
-
darkOverlay:
|
|
1921
|
-
closeButton:
|
|
1922
|
-
progressBar:
|
|
1923
|
-
showBranding:
|
|
1924
|
-
customPosition:
|
|
1925
|
-
customCss:
|
|
1926
|
-
fontFamily:
|
|
1991
|
+
var featureSettingsSchema = z7.object({
|
|
1992
|
+
darkOverlay: z7.boolean().default(false).describe("Whether to show a dark overlay behind the widget"),
|
|
1993
|
+
closeButton: z7.boolean().default(true).describe("Whether to display a close button on the widget"),
|
|
1994
|
+
progressBar: z7.boolean().default(true).describe("Whether to show a progress bar indicating completion status"),
|
|
1995
|
+
showBranding: z7.boolean().default(true).describe("Whether to display branding elements on the widget"),
|
|
1996
|
+
customPosition: z7.boolean().describe("Whether custom positioning is enabled"),
|
|
1997
|
+
customCss: z7.string().optional().describe("Custom CSS to apply \u2014 either a URL ending in .css or raw CSS text"),
|
|
1998
|
+
fontFamily: z7.string().optional().default("default").describe("Font family to use for the widget"),
|
|
1927
1999
|
shareableMode: shareableModeSchema.optional().default(ShareableModes.LIGHT).describe(
|
|
1928
2000
|
"Display mode for the shareable: light, dark, or system preference"
|
|
1929
2001
|
),
|
|
1930
|
-
enableShareableKeyboardNavigation:
|
|
2002
|
+
enableShareableKeyboardNavigation: z7.boolean().default(false).describe(
|
|
1931
2003
|
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
1932
2004
|
),
|
|
1933
|
-
rtl:
|
|
2005
|
+
rtl: z7.boolean().default(false).describe("Whether right-to-left text direction is enabled"),
|
|
1934
2006
|
previousButton: previousButtonModeSchema.default(PreviousButtonModes.ALWAYS).describe("Previous button: never (hidden) or always (shown)"),
|
|
1935
|
-
maxDialogHeightPercentInApp:
|
|
1936
|
-
faviconUrl:
|
|
2007
|
+
maxDialogHeightPercentInApp: z7.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"),
|
|
2008
|
+
faviconUrl: z7.string().optional().describe("URL of a custom favicon image to display in the browser tab; when absent the platform default favicon is used"),
|
|
1937
2009
|
logo: logoSchema.optional().describe("Optional form-level logo shown in the header on link/shareable surfaces; omit to show no logo")
|
|
1938
2010
|
}).describe("Feature settings controlling widget UI behavior and appearance");
|
|
1939
|
-
var themeColorsSchema =
|
|
1940
|
-
theme:
|
|
2011
|
+
var themeColorsSchema = z7.object({
|
|
2012
|
+
theme: z7.string().optional().describe("Theme for a single mode (shadcn variables JSON)")
|
|
1941
2013
|
}).describe("Theme for a single mode (shadcn variables)");
|
|
1942
|
-
var themesSchema =
|
|
2014
|
+
var themesSchema = z7.object({
|
|
1943
2015
|
light: themeColorsSchema,
|
|
1944
2016
|
dark: themeColorsSchema
|
|
1945
2017
|
}).describe("Complete theme configuration with light and dark variants");
|
|
1946
|
-
var themeConfigurationSchema =
|
|
2018
|
+
var themeConfigurationSchema = z7.object({
|
|
1947
2019
|
themes: themesSchema.describe("Color themes for light and dark modes"),
|
|
1948
2020
|
featureSettings: featureSettingsSchema.describe(
|
|
1949
2021
|
"UI feature settings controlling widget behavior"
|
|
@@ -1959,70 +2031,70 @@ var themeConfigurationSchema = z6.object({
|
|
|
1959
2031
|
);
|
|
1960
2032
|
|
|
1961
2033
|
// src/schemas/fields/auto-trigger-schema.ts
|
|
1962
|
-
import { z as
|
|
1963
|
-
var customEventFieldOperatorSchema =
|
|
1964
|
-
name:
|
|
1965
|
-
label:
|
|
2034
|
+
import { z as z8 } from "zod";
|
|
2035
|
+
var customEventFieldOperatorSchema = z8.object({
|
|
2036
|
+
name: z8.string().describe("The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')"),
|
|
2037
|
+
label: z8.string().describe("Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')")
|
|
1966
2038
|
}).describe("Schema defining an operator for custom event fields");
|
|
1967
|
-
var customEventFieldSchema =
|
|
1968
|
-
name:
|
|
1969
|
-
label:
|
|
1970
|
-
placeholder:
|
|
1971
|
-
operators:
|
|
2039
|
+
var customEventFieldSchema = z8.object({
|
|
2040
|
+
name: z8.string().describe("The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')"),
|
|
2041
|
+
label: z8.string().describe("Human-readable label for the field"),
|
|
2042
|
+
placeholder: z8.string().describe("Placeholder text for input fields"),
|
|
2043
|
+
operators: z8.array(customEventFieldOperatorSchema).min(1).describe("Array of available operators for this field")
|
|
1972
2044
|
}).describe("Schema defining a custom event field with its operators");
|
|
1973
|
-
var conditionalIfMetadataSchema =
|
|
1974
|
-
customEventFields:
|
|
2045
|
+
var conditionalIfMetadataSchema = z8.object({
|
|
2046
|
+
customEventFields: z8.array(customEventFieldSchema).optional().describe("Array of custom event fields with their operators and labels")
|
|
1975
2047
|
}).describe("Schema defining metadata for conditional if clauses");
|
|
1976
|
-
var queryOutputSchema =
|
|
1977
|
-
query:
|
|
1978
|
-
naturalLanguage:
|
|
1979
|
-
jsonLogic:
|
|
1980
|
-
sqlQuery:
|
|
2048
|
+
var queryOutputSchema = z8.object({
|
|
2049
|
+
query: z8.string().describe("The structured query definition as a JSON string"),
|
|
2050
|
+
naturalLanguage: z8.string().describe("Human-readable description of the query conditions"),
|
|
2051
|
+
jsonLogic: z8.string().describe("JSON Logic representation of the query as a JSON string"),
|
|
2052
|
+
sqlQuery: z8.string().describe("SQL representation of the query for database operations")
|
|
1981
2053
|
}).describe("Schema defining query output structure with all fields as strings");
|
|
1982
|
-
var conditionalIfSchema =
|
|
1983
|
-
id:
|
|
1984
|
-
event:
|
|
2054
|
+
var conditionalIfSchema = z8.object({
|
|
2055
|
+
id: z8.string().describe("Unique identifier for this condition"),
|
|
2056
|
+
event: z8.string().describe("The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')"),
|
|
1985
2057
|
queryOutput: queryOutputSchema.describe("The query conditions to evaluate when the event occurs"),
|
|
1986
2058
|
metadata: conditionalIfMetadataSchema.optional().describe("Optional metadata containing custom event fields and their configurations")
|
|
1987
2059
|
}).describe("Schema defining the 'if' condition for auto-trigger logic");
|
|
1988
|
-
var triggerActionSchema =
|
|
1989
|
-
triggerType:
|
|
1990
|
-
delay:
|
|
1991
|
-
scroll:
|
|
2060
|
+
var triggerActionSchema = z8.object({
|
|
2061
|
+
triggerType: z8.string().describe("The type of action to perform (e.g., 'delay', 'scroll', 'immediately')"),
|
|
2062
|
+
delay: z8.number().int().min(0).optional().describe("Delay in seconds before performing the action"),
|
|
2063
|
+
scroll: z8.union([z8.string(), z8.number()]).optional().describe("Scroll position (percentage as string like '75%' or pixel value as number)")
|
|
1992
2064
|
}).describe("Schema defining the action to perform when conditions are met");
|
|
1993
|
-
var conditionalWhenSchema =
|
|
2065
|
+
var conditionalWhenSchema = z8.object({
|
|
1994
2066
|
if: conditionalIfSchema.describe("The condition that must be met"),
|
|
1995
2067
|
then: triggerActionSchema.describe("The action to perform when the condition is met")
|
|
1996
2068
|
}).describe("Schema defining a conditional when clause with if-then logic");
|
|
1997
|
-
var filterConditionSchema =
|
|
1998
|
-
id:
|
|
1999
|
-
category:
|
|
2000
|
-
property:
|
|
2001
|
-
operator:
|
|
2002
|
-
values:
|
|
2003
|
-
tbl_key:
|
|
2069
|
+
var filterConditionSchema = z8.object({
|
|
2070
|
+
id: z8.string().describe("Unique identifier for this filter condition"),
|
|
2071
|
+
category: z8.string().describe("The category this filter belongs to (e.g., 'device', 'user', 'geo_location')"),
|
|
2072
|
+
property: z8.string().describe("The property to filter on (e.g., 'device_type', 'age', 'country')"),
|
|
2073
|
+
operator: z8.string().describe("The comparison operator (e.g., 'equals', 'greaterThan', 'lessThan')"),
|
|
2074
|
+
values: z8.array(z8.string()).min(1).describe("Array of values to compare against"),
|
|
2075
|
+
tbl_key: z8.string().describe("The database table key for this property")
|
|
2004
2076
|
}).describe("Schema defining a single filter condition within a category");
|
|
2005
|
-
var categorySpecificFiltersSchema =
|
|
2006
|
-
device:
|
|
2007
|
-
user:
|
|
2008
|
-
geo_location:
|
|
2077
|
+
var categorySpecificFiltersSchema = z8.object({
|
|
2078
|
+
device: z8.array(filterConditionSchema).optional().describe("Array of device-specific filter conditions"),
|
|
2079
|
+
user: z8.array(filterConditionSchema).optional().describe("Array of user-specific filter conditions"),
|
|
2080
|
+
geo_location: z8.array(filterConditionSchema).optional().describe("Array of geo-location specific filter conditions")
|
|
2009
2081
|
}).describe("Schema defining category-specific filters for audience targeting");
|
|
2010
|
-
var whoSchema =
|
|
2011
|
-
applications:
|
|
2012
|
-
userType:
|
|
2082
|
+
var whoSchema = z8.object({
|
|
2083
|
+
applications: z8.array(z8.string()).min(1).describe("Array of application names this targeting applies to"),
|
|
2084
|
+
userType: z8.string().describe("The type of user this targeting applies to (e.g., 'both', 'new', 'returning')"),
|
|
2013
2085
|
categorySpecificFilters: categorySpecificFiltersSchema.optional().describe("Optional category-specific filters for more granular targeting")
|
|
2014
2086
|
}).describe("Schema defining who the audience targeting applies to");
|
|
2015
|
-
var audienceSegmentSchema =
|
|
2016
|
-
id:
|
|
2017
|
-
name:
|
|
2018
|
-
isImportant:
|
|
2019
|
-
when:
|
|
2087
|
+
var audienceSegmentSchema = z8.object({
|
|
2088
|
+
id: z8.string().describe("Unique identifier for the audience segment"),
|
|
2089
|
+
name: z8.string().min(1).max(200).describe("Display name for the audience segment"),
|
|
2090
|
+
isImportant: z8.boolean().describe("Whether this segment is marked as important for targeting"),
|
|
2091
|
+
when: z8.array(conditionalWhenSchema).min(1).describe("Array of conditional when clauses with if-then logic"),
|
|
2020
2092
|
who: whoSchema.describe("User criteria and conditions defining who belongs to this segment")
|
|
2021
2093
|
}).describe("Schema defining an audience segment for targeting with conditional logic");
|
|
2022
|
-
var audienceTriggerPropertiesSchema =
|
|
2023
|
-
isAuto:
|
|
2024
|
-
isManual:
|
|
2025
|
-
segments:
|
|
2094
|
+
var audienceTriggerPropertiesSchema = z8.object({
|
|
2095
|
+
isAuto: z8.boolean().describe("Whether automatic triggering is enabled for this audience"),
|
|
2096
|
+
isManual: z8.boolean().describe("Whether manual triggering is enabled for this audience"),
|
|
2097
|
+
segments: z8.array(audienceSegmentSchema).min(0).describe("Array of audience segments for targeting conditions")
|
|
2026
2098
|
}).refine(
|
|
2027
2099
|
(data) => {
|
|
2028
2100
|
return data.isAuto || data.isManual;
|
|
@@ -2034,49 +2106,49 @@ var audienceTriggerPropertiesSchema = z7.object({
|
|
|
2034
2106
|
).describe("Schema defining audience trigger properties for form targeting");
|
|
2035
2107
|
|
|
2036
2108
|
// src/schemas/fields/layout-schema.ts
|
|
2037
|
-
import { z as
|
|
2038
|
-
var focalPointSchema =
|
|
2039
|
-
x:
|
|
2040
|
-
y:
|
|
2109
|
+
import { z as z9 } from "zod";
|
|
2110
|
+
var focalPointSchema = z9.object({
|
|
2111
|
+
x: z9.number().min(-1).max(1).describe("Horizontal focal point from -1 (far left) to 1 (far right)"),
|
|
2112
|
+
y: z9.number().min(-1).max(1).describe("Vertical focal point from -1 (top) to 1 (bottom)")
|
|
2041
2113
|
}).describe("Focal point for image cropping and positioning within its container");
|
|
2042
|
-
var imageAttachmentSchema =
|
|
2043
|
-
type:
|
|
2044
|
-
href:
|
|
2045
|
-
properties:
|
|
2046
|
-
description:
|
|
2047
|
-
decorative:
|
|
2114
|
+
var imageAttachmentSchema = z9.object({
|
|
2115
|
+
type: z9.literal("image"),
|
|
2116
|
+
href: z9.string().url().describe("URL of the image asset"),
|
|
2117
|
+
properties: z9.object({
|
|
2118
|
+
description: z9.string().optional().describe("Accessible description of the image (used as alt text when decorative is false)"),
|
|
2119
|
+
decorative: z9.boolean().default(false).describe(
|
|
2048
2120
|
"When true the image is purely visual; screen readers skip it and description is not surfaced as alt text"
|
|
2049
2121
|
),
|
|
2050
|
-
brightness:
|
|
2122
|
+
brightness: z9.number().min(-100).max(100).optional().describe("Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white."),
|
|
2051
2123
|
focalPoint: focalPointSchema.optional()
|
|
2052
2124
|
}).optional().describe("Optional display properties for the image")
|
|
2053
2125
|
}).describe("Image attachment for section layouts");
|
|
2054
|
-
var videoAttachmentSchema =
|
|
2055
|
-
type:
|
|
2056
|
-
href:
|
|
2126
|
+
var videoAttachmentSchema = z9.object({
|
|
2127
|
+
type: z9.literal("video"),
|
|
2128
|
+
href: z9.string().url().describe(
|
|
2057
2129
|
"URL of the video \u2014 YouTube, Vimeo, Pexels, or self-hosted CDN"
|
|
2058
2130
|
),
|
|
2059
|
-
scale:
|
|
2060
|
-
properties:
|
|
2061
|
-
description:
|
|
2062
|
-
decorative:
|
|
2063
|
-
brightness:
|
|
2131
|
+
scale: z9.enum(["0.4", "0.6", "0.8", "1"]).default("0.6").optional().describe("Responsive scale for the video within its container"),
|
|
2132
|
+
properties: z9.object({
|
|
2133
|
+
description: z9.string().optional().describe("Accessible description of the video"),
|
|
2134
|
+
decorative: z9.boolean().default(false).describe("When true the video is purely decorative and screen readers skip it"),
|
|
2135
|
+
brightness: z9.number().min(-100).max(100).optional().describe("Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white.")
|
|
2064
2136
|
}).optional().describe("Optional display properties for the video")
|
|
2065
2137
|
}).describe("Video attachment for section layouts (external embed or self-hosted CDN)");
|
|
2066
|
-
var colorAttachmentSchema =
|
|
2067
|
-
type:
|
|
2068
|
-
value:
|
|
2138
|
+
var colorAttachmentSchema = z9.object({
|
|
2139
|
+
type: z9.literal("color"),
|
|
2140
|
+
value: z9.string().regex(
|
|
2069
2141
|
/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,
|
|
2070
2142
|
"Must be a valid hex color: #RGB, #RRGGBB, or #RRGGBBAA"
|
|
2071
2143
|
).describe("Hex color value e.g. #FF5733 (opaque) or #FF5733CC (with alpha)")
|
|
2072
2144
|
}).describe("Solid color background attachment for section layouts");
|
|
2073
|
-
var gradientAttachmentSchema =
|
|
2074
|
-
type:
|
|
2075
|
-
value:
|
|
2145
|
+
var gradientAttachmentSchema = z9.object({
|
|
2146
|
+
type: z9.literal("gradient"),
|
|
2147
|
+
value: z9.string().min(1).describe(
|
|
2076
2148
|
"CSS gradient string e.g. linear-gradient(135deg, #FF5733, #3498db) or radial-gradient(circle, #FF5733, #3498db)"
|
|
2077
2149
|
)
|
|
2078
2150
|
}).describe("CSS gradient background attachment for section layouts");
|
|
2079
|
-
var layoutAttachmentSchema =
|
|
2151
|
+
var layoutAttachmentSchema = z9.discriminatedUnion("type", [
|
|
2080
2152
|
imageAttachmentSchema,
|
|
2081
2153
|
videoAttachmentSchema,
|
|
2082
2154
|
colorAttachmentSchema,
|
|
@@ -2090,36 +2162,36 @@ var LayoutAttachmentTypes = {
|
|
|
2090
2162
|
COLOR: "color",
|
|
2091
2163
|
GRADIENT: "gradient"
|
|
2092
2164
|
};
|
|
2093
|
-
var stackLayoutSchema =
|
|
2094
|
-
type:
|
|
2095
|
-
align:
|
|
2165
|
+
var stackLayoutSchema = z9.object({
|
|
2166
|
+
type: z9.literal("stack"),
|
|
2167
|
+
align: z9.enum(["left", "center", "cover"]).default("center").optional().describe(
|
|
2096
2168
|
"How the media strip is displayed: 'center' (default, natural size centred at form width), 'left' (natural size left-aligned), 'cover' (full-bleed, fills strip edge-to-edge)"
|
|
2097
2169
|
),
|
|
2098
2170
|
attachment: layoutAttachmentSchema.optional().describe("Background media rendered behind the question content")
|
|
2099
2171
|
}).describe(
|
|
2100
2172
|
"Stack layout: attachment renders as a full-bleed background behind the question"
|
|
2101
2173
|
);
|
|
2102
|
-
var floatLayoutSchema =
|
|
2103
|
-
type:
|
|
2104
|
-
placement:
|
|
2174
|
+
var floatLayoutSchema = z9.object({
|
|
2175
|
+
type: z9.literal("float"),
|
|
2176
|
+
placement: z9.enum(["left", "right"]).describe("Side the media floats on"),
|
|
2105
2177
|
attachment: layoutAttachmentSchema.optional().describe("Media that floats beside the question content")
|
|
2106
2178
|
}).describe(
|
|
2107
2179
|
"Float layout: attachment floats to the left or right of the question content"
|
|
2108
2180
|
);
|
|
2109
|
-
var splitLayoutSchema =
|
|
2110
|
-
type:
|
|
2111
|
-
placement:
|
|
2181
|
+
var splitLayoutSchema = z9.object({
|
|
2182
|
+
type: z9.literal("split"),
|
|
2183
|
+
placement: z9.enum(["left", "right"]).describe("Side the media occupies in the split"),
|
|
2112
2184
|
attachment: layoutAttachmentSchema.optional().describe("Media that occupies its half of the split viewport")
|
|
2113
2185
|
}).describe(
|
|
2114
2186
|
"Split layout: viewport is divided equally between media and question content"
|
|
2115
2187
|
);
|
|
2116
|
-
var wallpaperLayoutSchema =
|
|
2117
|
-
type:
|
|
2188
|
+
var wallpaperLayoutSchema = z9.object({
|
|
2189
|
+
type: z9.literal("wallpaper"),
|
|
2118
2190
|
attachment: layoutAttachmentSchema.optional().describe("Full-page background media")
|
|
2119
2191
|
}).describe(
|
|
2120
2192
|
"Wallpaper layout: attachment stretches or tiles across the entire viewport"
|
|
2121
2193
|
);
|
|
2122
|
-
var sectionLayoutVariantSchema =
|
|
2194
|
+
var sectionLayoutVariantSchema = z9.discriminatedUnion("type", [
|
|
2123
2195
|
stackLayoutSchema,
|
|
2124
2196
|
floatLayoutSchema,
|
|
2125
2197
|
splitLayoutSchema,
|
|
@@ -2133,7 +2205,7 @@ var LayoutTypes = {
|
|
|
2133
2205
|
SPLIT: "split",
|
|
2134
2206
|
WALLPAPER: "wallpaper"
|
|
2135
2207
|
};
|
|
2136
|
-
var layoutSurfaceSchema =
|
|
2208
|
+
var layoutSurfaceSchema = z9.object({
|
|
2137
2209
|
attachment: layoutAttachmentSchema.optional().describe(
|
|
2138
2210
|
"Top-level media displayed inline with the question (separate from the layout's own attachment)"
|
|
2139
2211
|
),
|
|
@@ -2141,9 +2213,9 @@ var layoutSurfaceSchema = z8.object({
|
|
|
2141
2213
|
"How the attachment is positioned relative to the question content"
|
|
2142
2214
|
)
|
|
2143
2215
|
}).describe("Layout configuration for a single rendering surface");
|
|
2144
|
-
var sectionLayoutSchema =
|
|
2216
|
+
var sectionLayoutSchema = z9.object({
|
|
2145
2217
|
inApp: layoutSurfaceSchema.optional().describe("Layout for in-app (native/webview) surfaces"),
|
|
2146
|
-
link:
|
|
2218
|
+
link: z9.object({
|
|
2147
2219
|
mobile: layoutSurfaceSchema.optional().describe("Layout for link-based forms on mobile viewports (phones)"),
|
|
2148
2220
|
others: layoutSurfaceSchema.optional().describe(
|
|
2149
2221
|
"Layout for link-based forms on tablet and desktop viewports"
|
|
@@ -2156,35 +2228,35 @@ var sectionLayoutSchema = z8.object({
|
|
|
2156
2228
|
);
|
|
2157
2229
|
|
|
2158
2230
|
// src/schemas/fields/form-properties-schema.ts
|
|
2159
|
-
var otherConfigurationPropertiesSchema =
|
|
2231
|
+
var otherConfigurationPropertiesSchema = z10.discriminatedUnion("isEnabled", [
|
|
2160
2232
|
// When other configuration is disabled
|
|
2161
|
-
|
|
2162
|
-
isEnabled:
|
|
2233
|
+
z10.object({
|
|
2234
|
+
isEnabled: z10.literal(false).describe("Whether other configuration properties are enabled"),
|
|
2163
2235
|
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
2164
|
-
translations:
|
|
2236
|
+
translations: z10.record(z10.string(), OtherFieldsTranslationSchema).optional().describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
2165
2237
|
}),
|
|
2166
2238
|
// When other configuration is enabled
|
|
2167
|
-
|
|
2168
|
-
isEnabled:
|
|
2239
|
+
z10.object({
|
|
2240
|
+
isEnabled: z10.literal(true).describe("Whether other configuration properties are enabled"),
|
|
2169
2241
|
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
2170
|
-
translations:
|
|
2242
|
+
translations: z10.record(z10.string(), OtherFieldsTranslationSchema).describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
2171
2243
|
})
|
|
2172
2244
|
]).describe("Schema for other configuration properties including fields and translations");
|
|
2173
|
-
var appearancePropertiesSchema =
|
|
2245
|
+
var appearancePropertiesSchema = z10.object({
|
|
2174
2246
|
themeConfiguration: themeConfigurationSchema.describe("Theme configuration including colors, features, and positioning"),
|
|
2175
2247
|
sectionLayoutDefaults: sectionLayoutSchema.optional().describe(
|
|
2176
2248
|
"Default layout applied to sections that have no explicit entry in sectionLayouts. Resolved independently per surface (inApp, link.mobile, link.others)"
|
|
2177
2249
|
),
|
|
2178
|
-
sectionLayouts:
|
|
2250
|
+
sectionLayouts: z10.record(z10.string(), sectionLayoutSchema).optional().describe(
|
|
2179
2251
|
"Per-section layout overrides keyed by section id. Takes precedence over sectionLayoutDefaults. Omit a section to fall back to sectionLayoutDefaults or engine default"
|
|
2180
2252
|
)
|
|
2181
2253
|
}).describe("Schema for appearance properties including theme configuration and per-section layouts");
|
|
2182
|
-
var formPropertiesSchema =
|
|
2183
|
-
feedbackConfigurationId:
|
|
2254
|
+
var formPropertiesSchema = z10.object({
|
|
2255
|
+
feedbackConfigurationId: z10.uuid().describe("Unique identifier for the feedback configuration"),
|
|
2184
2256
|
feedbackConfiguration: feedbackConfigurationSchema.describe("Configuration properties for the feedback form"),
|
|
2185
|
-
questionnaireFields:
|
|
2186
|
-
questions:
|
|
2187
|
-
sections:
|
|
2257
|
+
questionnaireFields: z10.object({
|
|
2258
|
+
questions: z10.record(z10.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
2259
|
+
sections: z10.array(sectionSchema).describe("Array of sections that organize questions into logical groups"),
|
|
2188
2260
|
selectedLanguages: LanguagesSchema.describe("Array of languages selected for this questionnaire"),
|
|
2189
2261
|
translations: translationsSchema.describe("Multi-language translations for questions and form content")
|
|
2190
2262
|
}).describe("Fields defining the questionnaire structure, questions, sections, selected languages, and translations"),
|
|
@@ -2195,91 +2267,91 @@ var formPropertiesSchema = z9.object({
|
|
|
2195
2267
|
}).describe("Complete schema for all feedback-level properties including publishing, audience targeting, configuration, and appearance");
|
|
2196
2268
|
|
|
2197
2269
|
// src/schemas/fields/other-properties-schema.ts
|
|
2198
|
-
import { z as
|
|
2199
|
-
var masterPropertiesSchema =
|
|
2200
|
-
mandatoryFetchConfigAtPaths:
|
|
2201
|
-
configSyncIntervalSeconds:
|
|
2202
|
-
disableAllSurvey:
|
|
2203
|
-
feedbackIntervalDuration:
|
|
2270
|
+
import { z as z11 } from "zod";
|
|
2271
|
+
var masterPropertiesSchema = z11.object({
|
|
2272
|
+
mandatoryFetchConfigAtPaths: z11.array(z11.string()).describe("Array of paths where configuration must be fetched from server when navigated by user"),
|
|
2273
|
+
configSyncIntervalSeconds: z11.number().int().positive().describe("Interval in seconds for configuration synchronization between client and server"),
|
|
2274
|
+
disableAllSurvey: z11.boolean().describe("Flag to disable all surveys globally"),
|
|
2275
|
+
feedbackIntervalDuration: z11.number().int().positive().describe("Duration in seconds for feedback interval between two auto triggered feedbacks")
|
|
2204
2276
|
}).describe("Master properties configuration for global survey settings");
|
|
2205
2277
|
|
|
2206
2278
|
// src/schemas/api/other-schema.ts
|
|
2207
|
-
import { z as
|
|
2208
|
-
var deviceThemeSchema =
|
|
2279
|
+
import { z as z12 } from "zod";
|
|
2280
|
+
var deviceThemeSchema = z12.enum(["light", "dark", "system"]).describe("Enumeration of supported theme modes");
|
|
2209
2281
|
var DeviceThemes = {
|
|
2210
2282
|
LIGHT: "light",
|
|
2211
2283
|
DARK: "dark",
|
|
2212
2284
|
SYSTEM: "system"
|
|
2213
2285
|
};
|
|
2214
|
-
var deviceInfoSchema =
|
|
2215
|
-
$deviceType:
|
|
2216
|
-
$timezone:
|
|
2286
|
+
var deviceInfoSchema = z12.object({
|
|
2287
|
+
$deviceType: z12.string().describe("Type of device being used"),
|
|
2288
|
+
$timezone: z12.string().describe("Device timezone (e.g., 'Asia/Calcutta')"),
|
|
2217
2289
|
$theme: deviceThemeSchema.describe("Current theme mode preference"),
|
|
2218
|
-
$os:
|
|
2219
|
-
$osVersion:
|
|
2220
|
-
$appVersion:
|
|
2221
|
-
$app:
|
|
2222
|
-
$language:
|
|
2223
|
-
$deviceId:
|
|
2290
|
+
$os: z12.string().describe("Operating system running on the device"),
|
|
2291
|
+
$osVersion: z12.string().describe("Version of the operating system"),
|
|
2292
|
+
$appVersion: z12.string().describe("Version of the application"),
|
|
2293
|
+
$app: z12.string().describe("Browser or application being used"),
|
|
2294
|
+
$language: z12.string().describe("Language preference (e.g., 'en-GB')"),
|
|
2295
|
+
$deviceId: z12.string().describe("Unique device identifier")
|
|
2224
2296
|
}).describe("Device information collected from the client");
|
|
2225
|
-
var sessionInfoSchema =
|
|
2226
|
-
$sessionId:
|
|
2227
|
-
$timestamp:
|
|
2297
|
+
var sessionInfoSchema = z12.object({
|
|
2298
|
+
$sessionId: z12.string().uuid().describe("Unique session identifier"),
|
|
2299
|
+
$timestamp: z12.string().optional().describe("ISO timestamp of the session")
|
|
2228
2300
|
}).describe("Session information for tracking user sessions");
|
|
2229
|
-
var deviceSessionInfoSchema =
|
|
2301
|
+
var deviceSessionInfoSchema = z12.object({
|
|
2230
2302
|
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
2231
2303
|
sessionInfo: sessionInfoSchema.describe("Session information")
|
|
2232
2304
|
}).describe("Combined device and session information");
|
|
2233
|
-
var userPropertiesSchema =
|
|
2234
|
-
$counter:
|
|
2305
|
+
var userPropertiesSchema = z12.object({
|
|
2306
|
+
$counter: z12.record(z12.string(), z12.number().int()).describe(
|
|
2235
2307
|
"Counter properties for user tracking (can be positive or negative)"
|
|
2236
2308
|
).optional(),
|
|
2237
|
-
$set:
|
|
2238
|
-
$setOnce:
|
|
2309
|
+
$set: z12.record(z12.string(), z12.any()).describe("Properties to set for the user").optional(),
|
|
2310
|
+
$setOnce: z12.record(z12.string(), z12.any()).describe(
|
|
2239
2311
|
"Properties to set once for the user (won't overwrite existing values)"
|
|
2240
2312
|
).optional(),
|
|
2241
|
-
$unset:
|
|
2313
|
+
$unset: z12.array(z12.string()).describe("Array of property names to unset/remove from the user").optional()
|
|
2242
2314
|
}).loose().describe(
|
|
2243
2315
|
"User properties including counters, set operations, and other dynamic data"
|
|
2244
2316
|
);
|
|
2245
|
-
var userInfoSchema =
|
|
2246
|
-
userName:
|
|
2317
|
+
var userInfoSchema = z12.object({
|
|
2318
|
+
userName: z12.string().email().describe("User's email address as username"),
|
|
2247
2319
|
properties: userPropertiesSchema.describe("User properties and counters")
|
|
2248
2320
|
}).describe("User information including identification and properties");
|
|
2249
2321
|
|
|
2250
2322
|
// src/schemas/api/submit-feedback-schema.ts
|
|
2251
|
-
import { z as
|
|
2252
|
-
var formConfigSchema =
|
|
2253
|
-
feedbackIdentifier:
|
|
2254
|
-
feedbackConfigurationId:
|
|
2255
|
-
completionTimeInSeconds:
|
|
2256
|
-
isPartialSubmit:
|
|
2257
|
-
responseLanguageCode:
|
|
2323
|
+
import { z as z13 } from "zod";
|
|
2324
|
+
var formConfigSchema = z13.object({
|
|
2325
|
+
feedbackIdentifier: z13.string().uuid().describe("Unique identifier for the feedback instance"),
|
|
2326
|
+
feedbackConfigurationId: z13.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
2327
|
+
completionTimeInSeconds: z13.number().int().min(0).describe("Time taken to complete the feedback in seconds"),
|
|
2328
|
+
isPartialSubmit: z13.boolean().describe("Whether this is a partial submission (true) or full submission (false)"),
|
|
2329
|
+
responseLanguageCode: z13.string().length(2).describe("Language code for the response (e.g., 'en', 'es')")
|
|
2258
2330
|
}).describe("Configuration information for the feedback form");
|
|
2259
|
-
var questionResponseSchema =
|
|
2260
|
-
questionId:
|
|
2331
|
+
var questionResponseSchema = z13.object({
|
|
2332
|
+
questionId: z13.string().uuid().describe("Unique identifier for the question"),
|
|
2261
2333
|
answer: AnswerSchema.describe("The answer provided for this question"),
|
|
2262
|
-
type:
|
|
2263
|
-
error:
|
|
2264
|
-
isOnPath:
|
|
2334
|
+
type: z13.string().describe("Type of the question (e.g., 'rating', 'single_choice')"),
|
|
2335
|
+
error: z13.string().optional().describe("Error message if any validation failed"),
|
|
2336
|
+
isOnPath: z13.boolean().optional().describe(
|
|
2265
2337
|
"When present, whether this question was on the respondent's navigation path (e.g. logic jumps); false for questions not reached"
|
|
2266
2338
|
),
|
|
2267
|
-
timeSpentMs:
|
|
2339
|
+
timeSpentMs: z13.number().int().min(0).optional().describe(
|
|
2268
2340
|
"Milliseconds the respondent spent on this question (even split across all visible questions in the section)"
|
|
2269
2341
|
),
|
|
2270
|
-
isPathTraversed:
|
|
2342
|
+
isPathTraversed: z13.boolean().optional().describe(
|
|
2271
2343
|
"Whether this question was on the logical traversal path \u2014 true for visible questions and hidden questions whose rules were evaluated, false for questions never reached"
|
|
2272
2344
|
)
|
|
2273
2345
|
}).describe("Response to a specific question in the feedback form");
|
|
2274
|
-
var responseSchema =
|
|
2275
|
-
questions:
|
|
2346
|
+
var responseSchema = z13.object({
|
|
2347
|
+
questions: z13.array(questionResponseSchema).min(1).describe("Array of question responses")
|
|
2276
2348
|
}).describe("User responses to feedback questions");
|
|
2277
|
-
var matchedTriggerPropertiesSchema =
|
|
2278
|
-
customEventName:
|
|
2279
|
-
currentPath:
|
|
2280
|
-
eventType:
|
|
2349
|
+
var matchedTriggerPropertiesSchema = z13.object({
|
|
2350
|
+
customEventName: z13.string().nullable().describe("Custom event name that triggered the feedback"),
|
|
2351
|
+
currentPath: z13.string().describe("Current page path where feedback was triggered"),
|
|
2352
|
+
eventType: z13.string().describe("Type of event that triggered the feedback")
|
|
2281
2353
|
}).passthrough().describe("Properties of the trigger that matched for this feedback");
|
|
2282
|
-
var baseSubmitFeedbackSchema =
|
|
2354
|
+
var baseSubmitFeedbackSchema = z13.object({
|
|
2283
2355
|
formConfig: formConfigSchema.describe("Form configuration information"),
|
|
2284
2356
|
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
2285
2357
|
sessionInfo: sessionInfoSchema.optional().describe("Session information"),
|
|
@@ -2287,71 +2359,71 @@ var baseSubmitFeedbackSchema = z12.object({
|
|
|
2287
2359
|
matchedTriggerProperties: matchedTriggerPropertiesSchema.optional().describe(
|
|
2288
2360
|
"Properties of the matched trigger"
|
|
2289
2361
|
),
|
|
2290
|
-
customProperties:
|
|
2362
|
+
customProperties: z13.record(z13.string(), z13.unknown()).optional().describe("Custom properties for advanced use cases")
|
|
2291
2363
|
}).describe("Base submit feedback request schema");
|
|
2292
2364
|
var partialFeedbackSchema = baseSubmitFeedbackSchema.extend({
|
|
2293
2365
|
formConfig: formConfigSchema.extend({
|
|
2294
|
-
isPartialSubmit:
|
|
2366
|
+
isPartialSubmit: z13.literal(true).describe("Indicates this is a partial submission")
|
|
2295
2367
|
}),
|
|
2296
2368
|
response: responseSchema.optional().describe("User responses (optional for partial submit)")
|
|
2297
2369
|
}).describe("Partial feedback request schema (response optional)");
|
|
2298
2370
|
var submitFeedbackSchema = baseSubmitFeedbackSchema.extend({
|
|
2299
2371
|
formConfig: formConfigSchema.extend({
|
|
2300
|
-
isPartialSubmit:
|
|
2372
|
+
isPartialSubmit: z13.literal(false).describe("Indicates this is a full submission")
|
|
2301
2373
|
}),
|
|
2302
2374
|
response: responseSchema.describe("User responses (required for full submit)")
|
|
2303
2375
|
}).describe("Full submit feedback request schema (response required)");
|
|
2304
|
-
var feedbackRequestSchema =
|
|
2376
|
+
var feedbackRequestSchema = z13.union([partialFeedbackSchema, submitFeedbackSchema]).describe("Union schema for both partial and full feedback submissions");
|
|
2305
2377
|
|
|
2306
2378
|
// src/schemas/api/fetch-feedback-schema.ts
|
|
2307
|
-
import { z as
|
|
2308
|
-
var feedbackConfigurationItemSchema =
|
|
2309
|
-
feedbackConfigurationId:
|
|
2310
|
-
feedbackTitle:
|
|
2379
|
+
import { z as z14 } from "zod";
|
|
2380
|
+
var feedbackConfigurationItemSchema = z14.object({
|
|
2381
|
+
feedbackConfigurationId: z14.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
2382
|
+
feedbackTitle: z14.string().describe("Title of the feedback configuration"),
|
|
2311
2383
|
// duration: durationSchema
|
|
2312
2384
|
// .describe("Active duration for this feedback configuration"),
|
|
2313
2385
|
triggerProperties: audienceTriggerPropertiesSchema.describe(
|
|
2314
2386
|
"Trigger properties including auto/manual settings and audience segments"
|
|
2315
2387
|
),
|
|
2316
|
-
appearanceProperties:
|
|
2317
|
-
themes:
|
|
2318
|
-
light:
|
|
2319
|
-
theme:
|
|
2388
|
+
appearanceProperties: z14.object({
|
|
2389
|
+
themes: z14.object({
|
|
2390
|
+
light: z14.object({
|
|
2391
|
+
theme: z14.string().optional().describe("Theme for light mode (shadcn variables JSON)")
|
|
2320
2392
|
}).describe("Light theme"),
|
|
2321
|
-
dark:
|
|
2322
|
-
theme:
|
|
2393
|
+
dark: z14.object({
|
|
2394
|
+
theme: z14.string().optional().describe("Theme for dark mode (shadcn variables JSON)")
|
|
2323
2395
|
}).describe("Dark theme")
|
|
2324
2396
|
}).nullable().optional().describe("Theme configuration (optional)"),
|
|
2325
|
-
featureSettings:
|
|
2326
|
-
darkOverlay:
|
|
2327
|
-
closeButton:
|
|
2328
|
-
progressBar:
|
|
2329
|
-
showBranding:
|
|
2330
|
-
customPosition:
|
|
2331
|
-
customIconPosition:
|
|
2332
|
-
customCss:
|
|
2333
|
-
enableShareableKeyboardNavigation:
|
|
2397
|
+
featureSettings: z14.object({
|
|
2398
|
+
darkOverlay: z14.boolean().describe("Whether to show dark overlay"),
|
|
2399
|
+
closeButton: z14.boolean().describe("Whether to show close button"),
|
|
2400
|
+
progressBar: z14.boolean().describe("Whether to show progress bar"),
|
|
2401
|
+
showBranding: z14.boolean().describe("Whether to show branding"),
|
|
2402
|
+
customPosition: z14.boolean().describe("Whether custom position is enabled"),
|
|
2403
|
+
customIconPosition: z14.boolean().describe("Whether custom icon position is enabled"),
|
|
2404
|
+
customCss: z14.string().nullable().optional().describe("Custom CSS link (optional)"),
|
|
2405
|
+
enableShareableKeyboardNavigation: z14.boolean().default(false).describe(
|
|
2334
2406
|
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
2335
2407
|
),
|
|
2336
|
-
rtl:
|
|
2337
|
-
previousButton:
|
|
2338
|
-
maxDialogHeightPercentInApp:
|
|
2408
|
+
rtl: z14.boolean().describe("Whether right-to-left text direction is enabled"),
|
|
2409
|
+
previousButton: z14.enum(["never", "always"]).describe("Previous button: never (hidden) or always (shown)"),
|
|
2410
|
+
maxDialogHeightPercentInApp: z14.number().int().min(10).max(100).optional().describe("Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100)")
|
|
2339
2411
|
}).describe("Feature settings for the feedback form"),
|
|
2340
|
-
selectedIconPosition:
|
|
2341
|
-
selectedPosition:
|
|
2412
|
+
selectedIconPosition: z14.string().describe("Selected position for the feedback icon"),
|
|
2413
|
+
selectedPosition: z14.string().describe("Selected position for the feedback form")
|
|
2342
2414
|
}).describe("Appearance properties for the feedback form")
|
|
2343
2415
|
}).describe("Individual feedback configuration item in the list");
|
|
2344
|
-
var fetchFormConfigSchema =
|
|
2345
|
-
feedbackConfigurationId:
|
|
2346
|
-
responseLanguageCode:
|
|
2416
|
+
var fetchFormConfigSchema = z14.object({
|
|
2417
|
+
feedbackConfigurationId: z14.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
2418
|
+
responseLanguageCode: z14.string().length(2).describe("Language code for the response (e.g., 'en', 'es')")
|
|
2347
2419
|
}).describe("Form configuration for fetching feedback details");
|
|
2348
|
-
var fetchConfigurationListSchema =
|
|
2420
|
+
var fetchConfigurationListSchema = z14.object({
|
|
2349
2421
|
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
2350
2422
|
sessionInfo: sessionInfoSchema.describe("Session information"),
|
|
2351
2423
|
userInfo: userInfoSchema.optional().describe("User information (optional)"),
|
|
2352
|
-
force:
|
|
2424
|
+
force: z14.boolean().optional().describe("Forcefully fetch eligible feedback list (optional)")
|
|
2353
2425
|
}).strict().describe("Request schema for fetching available feedback configurations");
|
|
2354
|
-
var fetchFeedbackDetailsSchema =
|
|
2426
|
+
var fetchFeedbackDetailsSchema = z14.object({
|
|
2355
2427
|
formConfig: fetchFormConfigSchema.describe(
|
|
2356
2428
|
"Form configuration for the specific feedback"
|
|
2357
2429
|
),
|
|
@@ -2359,43 +2431,43 @@ var fetchFeedbackDetailsSchema = z13.object({
|
|
|
2359
2431
|
sessionInfo: sessionInfoSchema.describe("Session information"),
|
|
2360
2432
|
userInfo: userInfoSchema.optional().describe("User information (optional)")
|
|
2361
2433
|
}).strict().describe("Request schema for fetching specific feedback form details");
|
|
2362
|
-
var formConfigurationResponseSchema =
|
|
2363
|
-
formTitle:
|
|
2364
|
-
formDescription:
|
|
2365
|
-
respondentsCount:
|
|
2434
|
+
var formConfigurationResponseSchema = z14.object({
|
|
2435
|
+
formTitle: z14.string().describe("Title of the feedback form"),
|
|
2436
|
+
formDescription: z14.string().describe("Description of the feedback form"),
|
|
2437
|
+
respondentsCount: z14.number().int().min(0).optional().describe(
|
|
2366
2438
|
"Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the welcome badge"
|
|
2367
2439
|
)
|
|
2368
2440
|
}).describe("Form configuration response with title, description, and optional respondent count");
|
|
2369
|
-
var logicJumpRuleSchema =
|
|
2370
|
-
jsonLogic:
|
|
2371
|
-
targetQuestionId:
|
|
2441
|
+
var logicJumpRuleSchema = z14.object({
|
|
2442
|
+
jsonLogic: z14.record(z14.string(), z14.unknown()).describe("JSON Logic expression to evaluate"),
|
|
2443
|
+
targetQuestionId: z14.string().describe("Question ID to navigate to when this rule matches")
|
|
2372
2444
|
}).describe("A single logic jump rule mapping a condition to a target question");
|
|
2373
|
-
var logicJumpRulesSchema =
|
|
2374
|
-
|
|
2375
|
-
|
|
2445
|
+
var logicJumpRulesSchema = z14.record(
|
|
2446
|
+
z14.string(),
|
|
2447
|
+
z14.array(logicJumpRuleSchema)
|
|
2376
2448
|
).describe(
|
|
2377
2449
|
"Logic jump rules keyed by question ID (or '__workflow_start__'). Each entry is an ordered array of rules evaluated top-down; the first matching rule wins."
|
|
2378
2450
|
);
|
|
2379
|
-
var questionnaireFieldsResponseSchema =
|
|
2380
|
-
questions:
|
|
2381
|
-
sections:
|
|
2451
|
+
var questionnaireFieldsResponseSchema = z14.object({
|
|
2452
|
+
questions: z14.record(z14.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
2453
|
+
sections: z14.array(sectionSchema).describe(
|
|
2382
2454
|
"Array of sections that organize questions into logical groups"
|
|
2383
2455
|
),
|
|
2384
|
-
translations:
|
|
2456
|
+
translations: z14.record(z14.string(), z14.any()).describe(
|
|
2385
2457
|
"Translations object (can be empty or contain language-specific translations)"
|
|
2386
2458
|
),
|
|
2387
2459
|
selectedLanguages: LanguagesSchema.describe(
|
|
2388
2460
|
"Array of languages selected for this questionnaire"
|
|
2389
2461
|
),
|
|
2390
|
-
isLogicJumpsEnabled:
|
|
2462
|
+
isLogicJumpsEnabled: z14.boolean().optional().default(false).describe("When true, form navigation follows logicJumpRules instead of linear section order"),
|
|
2391
2463
|
logicJumpRules: logicJumpRulesSchema.optional().describe("Conditional navigation rules evaluated per question to determine the next question to show"),
|
|
2392
|
-
contextVariables:
|
|
2464
|
+
contextVariables: z14.array(z14.string()).optional().describe("List of context variable keys expected by the form (informational)")
|
|
2393
2465
|
}).describe(
|
|
2394
2466
|
"Questionnaire fields response including questions, sections, translations, selected languages, and optional logic jump configuration"
|
|
2395
2467
|
);
|
|
2396
|
-
var fetchFeedbackDetailsResponseSchema =
|
|
2397
|
-
feedbackConfigurationId:
|
|
2398
|
-
feedbackIdentifier:
|
|
2468
|
+
var fetchFeedbackDetailsResponseSchema = z14.object({
|
|
2469
|
+
feedbackConfigurationId: z14.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
2470
|
+
feedbackIdentifier: z14.string().uuid().describe("Unique identifier for this specific feedback instance"),
|
|
2399
2471
|
formConfiguration: formConfigurationResponseSchema.describe(
|
|
2400
2472
|
"Form configuration including title, description, and optional respondent count for the welcome badge"
|
|
2401
2473
|
),
|
|
@@ -2411,30 +2483,30 @@ var fetchFeedbackDetailsResponseSchema = z13.object({
|
|
|
2411
2483
|
}).strict().describe(
|
|
2412
2484
|
"Complete response schema for fetchFeedbackDetails API using existing field schemas"
|
|
2413
2485
|
);
|
|
2414
|
-
var fetchConfigurationListResponseSchema =
|
|
2486
|
+
var fetchConfigurationListResponseSchema = z14.object({
|
|
2415
2487
|
masterProperties: masterPropertiesSchema.describe(
|
|
2416
2488
|
"Master properties for global survey settings"
|
|
2417
2489
|
),
|
|
2418
|
-
feedbackConfiguration:
|
|
2490
|
+
feedbackConfiguration: z14.array(feedbackConfigurationItemSchema).describe("Array of available feedback configurations")
|
|
2419
2491
|
}).strict().describe("Response schema for fetchConfigurationList API");
|
|
2420
2492
|
|
|
2421
2493
|
// src/schemas/api/refine-text-schema.ts
|
|
2422
|
-
import { z as
|
|
2423
|
-
var refineTextParamsSchema =
|
|
2424
|
-
questionId:
|
|
2425
|
-
feedbackConfigurationId:
|
|
2426
|
-
userText:
|
|
2494
|
+
import { z as z15 } from "zod";
|
|
2495
|
+
var refineTextParamsSchema = z15.object({
|
|
2496
|
+
questionId: z15.string().describe("Unique identifier for the question"),
|
|
2497
|
+
feedbackConfigurationId: z15.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
2498
|
+
userText: z15.string().describe("Original text input from the user")
|
|
2427
2499
|
}).strict().describe("Request schema for refining user text input");
|
|
2428
|
-
var refineTextResponseSchema =
|
|
2429
|
-
message:
|
|
2430
|
-
refinedText:
|
|
2431
|
-
status:
|
|
2432
|
-
error:
|
|
2433
|
-
code:
|
|
2500
|
+
var refineTextResponseSchema = z15.object({
|
|
2501
|
+
message: z15.string().optional().describe("Human-readable message"),
|
|
2502
|
+
refinedText: z15.string().optional().describe("Refined/improved version of the user text (success only)"),
|
|
2503
|
+
status: z15.number().optional().describe("HTTP status code (error responses)"),
|
|
2504
|
+
error: z15.string().optional().describe("Error type (error responses)"),
|
|
2505
|
+
code: z15.string().optional().describe("Error code for display mapping")
|
|
2434
2506
|
}).describe("Response schema for refine text API operation");
|
|
2435
|
-
var refineTextDataSchema =
|
|
2436
|
-
userText:
|
|
2437
|
-
refinedText:
|
|
2507
|
+
var refineTextDataSchema = z15.object({
|
|
2508
|
+
userText: z15.string().describe("Original text input from the user"),
|
|
2509
|
+
refinedText: z15.string().describe("Refined/improved version of the user text")
|
|
2438
2510
|
}).describe("Data containing original and refined text (legacy nested format)");
|
|
2439
2511
|
|
|
2440
2512
|
// src/helpers/case-convert-helper.ts
|
|
@@ -2500,13 +2572,13 @@ function objectToPascal(obj) {
|
|
|
2500
2572
|
__name(objectToPascal, "objectToPascal");
|
|
2501
2573
|
|
|
2502
2574
|
// src/schemas/fields/app-props-schema.ts
|
|
2503
|
-
import { z as
|
|
2504
|
-
var currentModeSchema =
|
|
2575
|
+
import { z as z16 } from "zod";
|
|
2576
|
+
var currentModeSchema = z16.enum(["light", "dark"]).describe("Current theme mode of the application");
|
|
2505
2577
|
var CurrentModes = {
|
|
2506
2578
|
LIGHT: "light",
|
|
2507
2579
|
DARK: "dark"
|
|
2508
2580
|
};
|
|
2509
|
-
var appPropsSchema =
|
|
2581
|
+
var appPropsSchema = z16.object({
|
|
2510
2582
|
theme: themesSchema.describe(
|
|
2511
2583
|
"Theme configuration including light and dark theme colors"
|
|
2512
2584
|
),
|
|
@@ -2516,7 +2588,7 @@ var appPropsSchema = z15.object({
|
|
|
2516
2588
|
currentLanguage: LanguageFieldSchema.describe(
|
|
2517
2589
|
"Currently selected language configuration"
|
|
2518
2590
|
),
|
|
2519
|
-
questions:
|
|
2591
|
+
questions: z16.record(z16.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
2520
2592
|
questionLanguages: LanguagesSchema.describe(
|
|
2521
2593
|
"Available languages for questions"
|
|
2522
2594
|
),
|
|
@@ -2526,15 +2598,15 @@ var appPropsSchema = z15.object({
|
|
|
2526
2598
|
translations: translationsSchema.optional().describe(
|
|
2527
2599
|
"Multi-language translations for questions and form content (optional)"
|
|
2528
2600
|
),
|
|
2529
|
-
onSectionChange:
|
|
2530
|
-
input: [
|
|
2531
|
-
output:
|
|
2601
|
+
onSectionChange: z16.function({
|
|
2602
|
+
input: [z16.number(), z16.string()],
|
|
2603
|
+
output: z16.void()
|
|
2532
2604
|
}).optional().describe("Optional callback function triggered when section changes"),
|
|
2533
|
-
onClose:
|
|
2605
|
+
onClose: z16.function({
|
|
2534
2606
|
input: [],
|
|
2535
|
-
output:
|
|
2607
|
+
output: z16.void()
|
|
2536
2608
|
}).optional().describe("Optional callback function triggered when the form is closed"),
|
|
2537
|
-
sections:
|
|
2609
|
+
sections: z16.array(sectionSchema).describe(
|
|
2538
2610
|
"Array of sections that organize questions into logical groups"
|
|
2539
2611
|
),
|
|
2540
2612
|
themeSettings: themeConfigurationSchema.describe(
|
|
@@ -2545,7 +2617,7 @@ var appPropsSchema = z15.object({
|
|
|
2545
2617
|
);
|
|
2546
2618
|
|
|
2547
2619
|
// src/index.ts
|
|
2548
|
-
import { z as
|
|
2620
|
+
import { z as z17 } from "zod";
|
|
2549
2621
|
export {
|
|
2550
2622
|
AddressAnswerSchema,
|
|
2551
2623
|
AnnotationMarkerSchema,
|
|
@@ -2607,6 +2679,8 @@ export {
|
|
|
2607
2679
|
choiceOrderOptionSchema,
|
|
2608
2680
|
colorAttachmentSchema,
|
|
2609
2681
|
combinedQuestionSchema,
|
|
2682
|
+
completionCtaSchema,
|
|
2683
|
+
completionCtaSecondarySchema,
|
|
2610
2684
|
conditionalIfMetadataSchema,
|
|
2611
2685
|
conditionalIfSchema,
|
|
2612
2686
|
conditionalWhenSchema,
|
|
@@ -2685,6 +2759,7 @@ export {
|
|
|
2685
2759
|
paymentsUpiQuestionTranslationSchema,
|
|
2686
2760
|
phoneNumberQuestionSchema,
|
|
2687
2761
|
pictureChoiceQuestionSchema,
|
|
2762
|
+
platformCompletionCtaSchema,
|
|
2688
2763
|
positionSchema,
|
|
2689
2764
|
previousButtonModeSchema,
|
|
2690
2765
|
publicationStatusSchema,
|
|
@@ -2763,6 +2838,6 @@ export {
|
|
|
2763
2838
|
yesNoDisplayStyleSchema,
|
|
2764
2839
|
yesNoQuestionSchema,
|
|
2765
2840
|
yesNoQuestionTranslationSchema,
|
|
2766
|
-
|
|
2841
|
+
z17 as z
|
|
2767
2842
|
};
|
|
2768
2843
|
//# sourceMappingURL=index.js.map
|