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