@encatch/schema 1.0.1-beta.3 → 1.1.0-beta.11
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 +99 -50
- package/dist/esm/index.js.map +3 -3
- package/dist/types/index.d.ts +4 -4
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +250 -33
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +24 -0
- package/dist/types/schemas/fields/answer-schema.d.ts +2 -0
- package/dist/types/schemas/fields/app-props-schema.d.ts +139 -28
- package/dist/types/schemas/fields/field-schema.d.ts +219 -10
- package/dist/types/schemas/fields/form-properties-schema.d.ts +149 -47
- package/dist/types/schemas/fields/other-screen-schema.d.ts +0 -5
- package/dist/types/schemas/fields/theme-schema.d.ts +20 -18
- package/dist/types/schemas/fields/translations-schema.d.ts +121 -16
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -10,13 +10,15 @@ var translationEntrySchema = z.string().min(1).describe("Translated text content
|
|
|
10
10
|
var baseQuestionTranslationFieldsSchema = z.object({
|
|
11
11
|
title: translationEntrySchema.describe("Question title translation"),
|
|
12
12
|
description: translationEntrySchema.optional().describe("Question description translation"),
|
|
13
|
-
errorMessage: translationEntrySchema.optional().describe("Error message translation")
|
|
13
|
+
errorMessage: translationEntrySchema.optional().describe("Error message translation"),
|
|
14
|
+
nextButtonLabel: translationEntrySchema.max(50).optional().describe("Next button label translation when advancing past this question")
|
|
14
15
|
});
|
|
15
16
|
var BASE_QUESTION_TRANSLATION_KEYS = [
|
|
16
17
|
"type",
|
|
17
18
|
"title",
|
|
18
19
|
"description",
|
|
19
|
-
"errorMessage"
|
|
20
|
+
"errorMessage",
|
|
21
|
+
"nextButtonLabel"
|
|
20
22
|
];
|
|
21
23
|
var ratingQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
22
24
|
type: z.literal("rating").describe("Question type identifier"),
|
|
@@ -86,21 +88,17 @@ var annotationQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.ex
|
|
|
86
88
|
noAnnotationText: translationEntrySchema.optional().describe("No annotation display text translation")
|
|
87
89
|
}).describe("Translation schema for annotation questions");
|
|
88
90
|
var welcomeQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
89
|
-
type: z.literal("welcome").describe("Question type identifier")
|
|
90
|
-
buttonLabel: translationEntrySchema.optional().describe("Translated proceed/start button label")
|
|
91
|
+
type: z.literal("welcome").describe("Question type identifier")
|
|
91
92
|
}).describe("Translation schema for welcome screen questions");
|
|
92
93
|
var thankYouQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
93
|
-
type: z.literal("thank_you").describe("Question type identifier")
|
|
94
|
-
buttonLabel: translationEntrySchema.optional().describe(
|
|
95
|
-
"Translated dismiss/done button label"
|
|
96
|
-
)
|
|
94
|
+
type: z.literal("thank_you").describe("Question type identifier")
|
|
97
95
|
}).describe("Translation schema for thank you screen questions");
|
|
98
96
|
var messagePanelQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
99
|
-
type: z.literal("message_panel").describe("Question type identifier")
|
|
100
|
-
buttonLabel: translationEntrySchema.optional().describe(
|
|
101
|
-
"Translated continue/button label"
|
|
102
|
-
)
|
|
97
|
+
type: z.literal("message_panel").describe("Question type identifier")
|
|
103
98
|
}).describe("Translation schema for message panel questions");
|
|
99
|
+
var consentQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
100
|
+
type: z.literal("consent").describe("Question type identifier")
|
|
101
|
+
}).describe("Translation schema for consent questions; description carries the translated checkbox label (markdown supported)");
|
|
104
102
|
var yesNoQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
105
103
|
type: z.literal("yes_no").describe("Question type identifier"),
|
|
106
104
|
yesLabel: translationEntrySchema.optional().describe("Translated Yes label"),
|
|
@@ -172,11 +170,18 @@ var questionTranslationSchema = z.union([
|
|
|
172
170
|
thankYouQuestionTranslationSchema,
|
|
173
171
|
messagePanelQuestionTranslationSchema,
|
|
174
172
|
yesNoQuestionTranslationSchema,
|
|
173
|
+
consentQuestionTranslationSchema,
|
|
175
174
|
ratingMatrixQuestionTranslationSchema,
|
|
176
175
|
matrixSingleChoiceQuestionTranslationSchema,
|
|
177
176
|
matrixMultipleChoiceQuestionTranslationSchema
|
|
178
177
|
]).describe("Union of all question type translation schemas");
|
|
179
178
|
var languageCodeSchema = z.string().min(2).max(10).describe("Language code (e.g., 'en', 'es', 'hi')");
|
|
179
|
+
var sectionTranslationSchema = z.object({
|
|
180
|
+
title: translationEntrySchema.max(200).describe("Section title translation"),
|
|
181
|
+
description: translationEntrySchema.max(1e3).optional().describe("Section description translation"),
|
|
182
|
+
nextButtonLabel: translationEntrySchema.max(50).optional().describe("Next button label translation for this section")
|
|
183
|
+
}).describe("Translation payload for a section in a single language");
|
|
184
|
+
var sectionTranslationsByLanguageSchema = z.record(languageCodeSchema, sectionTranslationSchema).describe("Section translations keyed by language code");
|
|
180
185
|
var questionTranslationsByLanguageSchema = z.record(languageCodeSchema, questionTranslationSchema).describe("Question translations keyed by language code");
|
|
181
186
|
var questionCentricTranslationsSchema = z.record(z.string().uuid(), questionTranslationsByLanguageSchema).describe("Question-centric translations keyed by question ID, then by language code");
|
|
182
187
|
var translationsSchema = questionCentricTranslationsSchema.describe("Question-centric translations at root level");
|
|
@@ -288,7 +293,8 @@ var questionTypeSchema = z2.enum([
|
|
|
288
293
|
"rating_matrix",
|
|
289
294
|
"matrix_single_choice",
|
|
290
295
|
"matrix_multiple_choice",
|
|
291
|
-
"exit_form"
|
|
296
|
+
"exit_form",
|
|
297
|
+
"consent"
|
|
292
298
|
]).describe("Enumeration of all supported question types for form fields");
|
|
293
299
|
var QuestionTypes = {
|
|
294
300
|
RATING: "rating",
|
|
@@ -306,7 +312,8 @@ var QuestionTypes = {
|
|
|
306
312
|
RATING_MATRIX: "rating_matrix",
|
|
307
313
|
MATRIX_SINGLE_CHOICE: "matrix_single_choice",
|
|
308
314
|
MATRIX_MULTIPLE_CHOICE: "matrix_multiple_choice",
|
|
309
|
-
EXIT_FORM: "exit_form"
|
|
315
|
+
EXIT_FORM: "exit_form",
|
|
316
|
+
CONSENT: "consent"
|
|
310
317
|
};
|
|
311
318
|
var validationRuleTypeSchema = z2.enum([
|
|
312
319
|
"required",
|
|
@@ -367,27 +374,19 @@ var visibilityConditionSchema = z2.object({
|
|
|
367
374
|
var sectionSchema = z2.object({
|
|
368
375
|
id: z2.string().describe("Unique identifier for the section"),
|
|
369
376
|
title: z2.string().min(1).max(200).describe("Display title for the section"),
|
|
370
|
-
titleTranslations: z2.record(
|
|
371
|
-
languageCodeSchema,
|
|
372
|
-
z2.string().min(1).max(200)
|
|
373
|
-
).optional().describe("Localized section titles keyed by language code"),
|
|
374
377
|
description: z2.string().max(1e3).optional().describe("Optional detailed description or help text for the section"),
|
|
375
|
-
descriptionTranslations: z2.record(
|
|
376
|
-
languageCodeSchema,
|
|
377
|
-
z2.string().min(1).max(1e3)
|
|
378
|
-
).optional().describe("Localized section descriptions keyed by language code"),
|
|
379
378
|
showTitle: z2.boolean().default(true).describe("Whether to show the section title in the UI"),
|
|
380
379
|
showDescription: z2.boolean().default(true).describe("Whether to show the section description in the UI"),
|
|
381
380
|
nextButtonLabel: z2.string().min(1).max(50).optional().describe("Label for the next button when navigating from this section"),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
z2.string().min(1).max(50)
|
|
385
|
-
).optional().describe(
|
|
386
|
-
"Localized next-button labels for this section keyed by language code"
|
|
381
|
+
translations: sectionTranslationsByLanguageSchema.optional().describe(
|
|
382
|
+
"Per-language section copy (title, optional description and nextButtonLabel), keyed by language code"
|
|
387
383
|
),
|
|
388
384
|
inAppSingleQuestion: z2.boolean().default(false).describe(
|
|
389
385
|
"When true, the native app shows one question at a time within this section"
|
|
390
386
|
),
|
|
387
|
+
isPreviousAllowed: z2.boolean().default(false).optional().describe(
|
|
388
|
+
"When the global previousButton mode is 'auto', controls whether the Previous button is shown for this section. Defaults to false (hidden)."
|
|
389
|
+
),
|
|
391
390
|
questionIds: z2.array(z2.string()).min(1).describe("Array of question IDs that belong to this section")
|
|
392
391
|
}).describe("Schema defining sections that organize questions into logical groups");
|
|
393
392
|
var questionStatusSchema = z2.enum(["D", "P", "A", "S"]);
|
|
@@ -466,6 +465,9 @@ var ChoiceOrderOptions = {
|
|
|
466
465
|
};
|
|
467
466
|
var questionSchema = z2.object({
|
|
468
467
|
id: z2.string().describe("Unique identifier for the question"),
|
|
468
|
+
slug: z2.string().min(1).max(128).optional().describe(
|
|
469
|
+
"Optional stable identifier for the question (e.g. URLs, analytics, or integrations)"
|
|
470
|
+
),
|
|
469
471
|
type: questionTypeSchema.describe(
|
|
470
472
|
"The type of question (rating, single_choice, etc.)"
|
|
471
473
|
),
|
|
@@ -483,7 +485,12 @@ var questionSchema = z2.object({
|
|
|
483
485
|
status: questionStatusSchema.describe(
|
|
484
486
|
"Current status of the question (Draft, Published, etc.)"
|
|
485
487
|
),
|
|
486
|
-
textAlign: z2.enum(["left", "center"]).optional().default("left").describe(
|
|
488
|
+
textAlign: z2.enum(["left", "center", "justify"]).optional().default("left").describe(
|
|
489
|
+
"Text alignment for the question title and description; `justify` is intended for consent questions (full-width justified consent body markdown)"
|
|
490
|
+
),
|
|
491
|
+
nextButtonLabel: z2.string().min(1).max(50).optional().describe(
|
|
492
|
+
"Label for the next button when advancing past this question (overrides section or form defaults when set)"
|
|
493
|
+
)
|
|
487
494
|
}).describe("Base schema for all question types with common properties");
|
|
488
495
|
var ratingQuestionSchema = questionSchema.extend({
|
|
489
496
|
type: z2.literal("rating").describe("Must be exactly 'rating'"),
|
|
@@ -506,7 +513,6 @@ var welcomeQuestionSchema = questionSchema.extend({
|
|
|
506
513
|
type: z2.literal("welcome").describe("Must be exactly 'welcome'"),
|
|
507
514
|
title: z2.string().min(1).max(200).describe("The main heading displayed on the welcome screen"),
|
|
508
515
|
description: z2.string().max(1e3).optional().describe("Optional sub-text body shown below the heading"),
|
|
509
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the proceed/start button (e.g. 'Get Started', 'Begin')"),
|
|
510
516
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the welcome screen")
|
|
511
517
|
}).describe("Schema for a welcome screen displayed at the start or inline within a form");
|
|
512
518
|
var thankYouQuestionSchema = questionSchema.extend({
|
|
@@ -515,7 +521,6 @@ var thankYouQuestionSchema = questionSchema.extend({
|
|
|
515
521
|
description: z2.string().max(1e3).optional().describe(
|
|
516
522
|
"Optional thank you body text; rendered as Markdown where the form supports it"
|
|
517
523
|
),
|
|
518
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the dismiss/done button (e.g. 'Done', 'Close')"),
|
|
519
524
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the thank you screen")
|
|
520
525
|
}).describe(
|
|
521
526
|
"Schema for a thank you screen shown at the end or inline within a form"
|
|
@@ -524,7 +529,6 @@ var messagePanelQuestionSchema = questionSchema.extend({
|
|
|
524
529
|
type: z2.literal("message_panel").describe("Must be exactly 'message_panel'"),
|
|
525
530
|
title: z2.string().min(1).max(200).describe("The main heading displayed on the message panel"),
|
|
526
531
|
description: z2.string().max(1e3).optional().describe("Optional body text shown below the heading"),
|
|
527
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the continue button (e.g. 'Continue', 'Next')"),
|
|
528
532
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the message panel")
|
|
529
533
|
}).describe(
|
|
530
534
|
"Schema for an inline message panel (informational); distinct from welcome for UI semantics and analytics"
|
|
@@ -540,6 +544,11 @@ var yesNoQuestionSchema = questionSchema.extend({
|
|
|
540
544
|
noLabel: z2.string().min(1).max(50).optional().describe("Label for the No option (defaults to 'No' in the UI if omitted)"),
|
|
541
545
|
displayStyle: yesNoDisplayStyleSchema.optional().describe("Layout for the Yes/No controls (horizontal row or vertical stack)")
|
|
542
546
|
}).describe("Schema for yes/no questions with optional custom labels and layout");
|
|
547
|
+
var consentQuestionSchema = questionSchema.extend({
|
|
548
|
+
type: z2.literal("consent").describe("Must be exactly 'consent'")
|
|
549
|
+
}).describe(
|
|
550
|
+
"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)"
|
|
551
|
+
);
|
|
543
552
|
var ratingMatrixDisplayStyleSchema = z2.enum([
|
|
544
553
|
"radio",
|
|
545
554
|
"star",
|
|
@@ -838,6 +847,7 @@ var combinedQuestionSchema = z2.discriminatedUnion("type", [
|
|
|
838
847
|
messagePanelQuestionSchema,
|
|
839
848
|
exitFormQuestionSchema,
|
|
840
849
|
yesNoQuestionSchema,
|
|
850
|
+
consentQuestionSchema,
|
|
841
851
|
ratingMatrixQuestionSchema,
|
|
842
852
|
matrixSingleChoiceQuestionSchema,
|
|
843
853
|
matrixMultipleChoiceQuestionSchema,
|
|
@@ -871,6 +881,7 @@ var AnswerItemSchema = z3.object({
|
|
|
871
881
|
),
|
|
872
882
|
rating: z3.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
873
883
|
yesNo: z3.boolean().optional().describe("Yes/no answer for yes_no questions (true = Yes, false = No)"),
|
|
884
|
+
consent: z3.boolean().optional().describe("Consent answer for consent questions (true = checked/agreed, false = unchecked)"),
|
|
874
885
|
multipleChoiceMultiple: z3.array(z3.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
|
|
875
886
|
singleChoiceOther: z3.string().optional().describe(
|
|
876
887
|
'Free-text "other" answer for single choice questions when allowOther is enabled'
|
|
@@ -923,13 +934,9 @@ import { z as z8 } from "zod";
|
|
|
923
934
|
// src/schemas/fields/other-screen-schema.ts
|
|
924
935
|
import { z as z5 } from "zod";
|
|
925
936
|
var OtherFieldsSchema = z5.object({
|
|
926
|
-
pagination: z5.boolean().describe("Whether to show pagination for multi-page forms"),
|
|
927
937
|
questionNumber: z5.boolean().describe("Whether to display question numbers"),
|
|
928
|
-
pageTitle: z5.boolean().describe("Whether to show page titles in multi-page forms"),
|
|
929
|
-
blockerFeedback: z5.boolean().describe("Whether to show blocker feedback for validation errors"),
|
|
930
938
|
submitButtonLabel: z5.string().min(1).max(50).describe("Text for the submit button"),
|
|
931
939
|
previousButtonLabel: z5.string().min(1).max(50).describe("Text for the previous button in pagination"),
|
|
932
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Text for the next button in pagination"),
|
|
933
940
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),
|
|
934
941
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
935
942
|
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")
|
|
@@ -942,7 +949,6 @@ var LanguagesSchema = z5.array(LanguageFieldSchema).describe("Schema for array o
|
|
|
942
949
|
var OtherFieldsTranslationSchema = z5.object({
|
|
943
950
|
submitButtonLabel: z5.string().min(1).max(50).describe("Translated text for the submit button"),
|
|
944
951
|
previousButtonLabel: z5.string().min(1).max(50).describe("Translated text for the previous button in pagination"),
|
|
945
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Translated text for the next button in pagination"),
|
|
946
952
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),
|
|
947
953
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
948
954
|
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")
|
|
@@ -985,19 +991,29 @@ var ShareableModes = {
|
|
|
985
991
|
DARK: "dark",
|
|
986
992
|
SYSTEM: "system"
|
|
987
993
|
};
|
|
988
|
-
var previousButtonModeSchema = z6.enum(["never", "always", "auto"]).describe(
|
|
994
|
+
var previousButtonModeSchema = z6.enum(["never", "always", "auto"]).describe(
|
|
995
|
+
"Previous button visibility: never (always hidden), always (always shown), or auto (per-section via isPreviousAllowed)"
|
|
996
|
+
);
|
|
997
|
+
var PreviousButtonModes = {
|
|
998
|
+
NEVER: "never",
|
|
999
|
+
ALWAYS: "always",
|
|
1000
|
+
AUTO: "auto"
|
|
1001
|
+
};
|
|
989
1002
|
var featureSettingsSchema = z6.object({
|
|
990
|
-
darkOverlay: z6.boolean().describe("Whether to show a dark overlay behind the widget"),
|
|
991
|
-
closeButton: z6.boolean().describe("Whether to display a close button on the widget"),
|
|
992
|
-
progressBar: z6.boolean().describe("Whether to show a progress bar indicating completion status"),
|
|
993
|
-
showBranding: z6.boolean().describe("Whether to display branding elements on the widget"),
|
|
1003
|
+
darkOverlay: z6.boolean().default(false).describe("Whether to show a dark overlay behind the widget"),
|
|
1004
|
+
closeButton: z6.boolean().default(true).describe("Whether to display a close button on the widget"),
|
|
1005
|
+
progressBar: z6.boolean().default(true).describe("Whether to show a progress bar indicating completion status"),
|
|
1006
|
+
showBranding: z6.boolean().default(true).describe("Whether to display branding elements on the widget"),
|
|
994
1007
|
customPosition: z6.boolean().describe("Whether custom positioning is enabled"),
|
|
995
1008
|
customCss: z6.string().optional().describe("Custom CSS link to apply for the feedback form"),
|
|
996
|
-
shareableMode: shareableModeSchema.optional().describe(
|
|
1009
|
+
shareableMode: shareableModeSchema.optional().default(ShareableModes.LIGHT).describe(
|
|
997
1010
|
"Display mode for the shareable: light, dark, or system preference"
|
|
998
1011
|
),
|
|
999
|
-
|
|
1000
|
-
|
|
1012
|
+
enableShareableKeyboardNavigation: z6.boolean().default(false).describe(
|
|
1013
|
+
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
1014
|
+
),
|
|
1015
|
+
rtl: z6.boolean().default(false).describe("Whether right-to-left text direction is enabled"),
|
|
1016
|
+
previousButton: previousButtonModeSchema.default(PreviousButtonModes.ALWAYS).describe("Previous button: never (hidden) or always (shown)")
|
|
1001
1017
|
}).describe("Feature settings controlling widget UI behavior and appearance");
|
|
1002
1018
|
var themeColorsSchema = z6.object({
|
|
1003
1019
|
theme: z6.string().optional().describe("Theme for a single mode (shadcn variables JSON)")
|
|
@@ -1101,13 +1117,13 @@ var otherConfigurationPropertiesSchema = z8.discriminatedUnion("isEnabled", [
|
|
|
1101
1117
|
// When other configuration is disabled
|
|
1102
1118
|
z8.object({
|
|
1103
1119
|
isEnabled: z8.literal(false).describe("Whether other configuration properties are enabled"),
|
|
1104
|
-
otherFields: OtherFieldsSchema.describe("Other form configuration fields including
|
|
1120
|
+
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
1105
1121
|
translations: z8.record(z8.string(), OtherFieldsTranslationSchema).optional().describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
1106
1122
|
}),
|
|
1107
1123
|
// When other configuration is enabled
|
|
1108
1124
|
z8.object({
|
|
1109
1125
|
isEnabled: z8.literal(true).describe("Whether other configuration properties are enabled"),
|
|
1110
|
-
otherFields: OtherFieldsSchema.describe("Other form configuration fields including
|
|
1126
|
+
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
1111
1127
|
translations: z8.record(z8.string(), OtherFieldsTranslationSchema).describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
1112
1128
|
})
|
|
1113
1129
|
]).describe("Schema for other configuration properties including fields and translations");
|
|
@@ -1195,7 +1211,16 @@ var questionResponseSchema = z11.object({
|
|
|
1195
1211
|
questionId: z11.string().uuid().describe("Unique identifier for the question"),
|
|
1196
1212
|
answer: AnswerSchema.describe("The answer provided for this question"),
|
|
1197
1213
|
type: z11.string().describe("Type of the question (e.g., 'rating', 'single_choice')"),
|
|
1198
|
-
error: z11.string().optional().describe("Error message if any validation failed")
|
|
1214
|
+
error: z11.string().optional().describe("Error message if any validation failed"),
|
|
1215
|
+
isOnPath: z11.boolean().optional().describe(
|
|
1216
|
+
"When present, whether this question was on the respondent's navigation path (e.g. logic jumps); false for questions not reached"
|
|
1217
|
+
),
|
|
1218
|
+
timeSpentMs: z11.number().int().min(0).optional().describe(
|
|
1219
|
+
"Milliseconds the respondent spent on this question (even split across all visible questions in the section)"
|
|
1220
|
+
),
|
|
1221
|
+
isPathTraversed: z11.boolean().optional().describe(
|
|
1222
|
+
"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"
|
|
1223
|
+
)
|
|
1199
1224
|
}).describe("Response to a specific question in the feedback form");
|
|
1200
1225
|
var responseSchema = z11.object({
|
|
1201
1226
|
questions: z11.array(questionResponseSchema).min(1).describe("Array of question responses")
|
|
@@ -1256,8 +1281,11 @@ var feedbackConfigurationItemSchema = z12.object({
|
|
|
1256
1281
|
customPosition: z12.boolean().describe("Whether custom position is enabled"),
|
|
1257
1282
|
customIconPosition: z12.boolean().describe("Whether custom icon position is enabled"),
|
|
1258
1283
|
customCss: z12.string().nullable().optional().describe("Custom CSS link (optional)"),
|
|
1284
|
+
enableShareableKeyboardNavigation: z12.boolean().default(false).describe(
|
|
1285
|
+
"Whether keyboard navigation is enabled for the shareable widget experience"
|
|
1286
|
+
),
|
|
1259
1287
|
rtl: z12.boolean().describe("Whether right-to-left text direction is enabled"),
|
|
1260
|
-
previousButton: z12.enum(["never", "always"
|
|
1288
|
+
previousButton: z12.enum(["never", "always"]).describe("Previous button: never (hidden) or always (shown)")
|
|
1261
1289
|
}).describe("Feature settings for the feedback form"),
|
|
1262
1290
|
selectedIconPosition: z12.string().describe("Selected position for the feedback icon"),
|
|
1263
1291
|
selectedPosition: z12.string().describe("Selected position for the feedback form")
|
|
@@ -1285,6 +1313,16 @@ var formConfigurationResponseSchema = z12.object({
|
|
|
1285
1313
|
formTitle: z12.string().describe("Title of the feedback form"),
|
|
1286
1314
|
formDescription: z12.string().describe("Description of the feedback form")
|
|
1287
1315
|
}).describe("Form configuration response with title and description");
|
|
1316
|
+
var logicJumpRuleSchema = z12.object({
|
|
1317
|
+
jsonLogic: z12.record(z12.string(), z12.unknown()).describe("JSON Logic expression to evaluate"),
|
|
1318
|
+
targetQuestionId: z12.string().describe("Question ID to navigate to when this rule matches")
|
|
1319
|
+
}).describe("A single logic jump rule mapping a condition to a target question");
|
|
1320
|
+
var logicJumpRulesSchema = z12.record(
|
|
1321
|
+
z12.string(),
|
|
1322
|
+
z12.array(logicJumpRuleSchema)
|
|
1323
|
+
).describe(
|
|
1324
|
+
"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."
|
|
1325
|
+
);
|
|
1288
1326
|
var questionnaireFieldsResponseSchema = z12.object({
|
|
1289
1327
|
questions: z12.record(z12.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
1290
1328
|
sections: z12.array(sectionSchema).describe(
|
|
@@ -1295,9 +1333,12 @@ var questionnaireFieldsResponseSchema = z12.object({
|
|
|
1295
1333
|
),
|
|
1296
1334
|
selectedLanguages: LanguagesSchema.describe(
|
|
1297
1335
|
"Array of languages selected for this questionnaire"
|
|
1298
|
-
)
|
|
1336
|
+
),
|
|
1337
|
+
isLogicJumpsEnabled: z12.boolean().optional().default(false).describe("When true, form navigation follows logicJumpRules instead of linear section order"),
|
|
1338
|
+
logicJumpRules: logicJumpRulesSchema.optional().describe("Conditional navigation rules evaluated per question to determine the next question to show"),
|
|
1339
|
+
contextVariables: z12.array(z12.string()).optional().describe("List of context variable keys expected by the form (informational)")
|
|
1299
1340
|
}).describe(
|
|
1300
|
-
"Questionnaire fields response including questions, sections, translations, and
|
|
1341
|
+
"Questionnaire fields response including questions, sections, translations, selected languages, and optional logic jump configuration"
|
|
1301
1342
|
);
|
|
1302
1343
|
var fetchFeedbackDetailsResponseSchema = z12.object({
|
|
1303
1344
|
feedbackConfigurationId: z12.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
@@ -1467,6 +1508,7 @@ export {
|
|
|
1467
1508
|
OtherFieldsSchema,
|
|
1468
1509
|
OtherFieldsTranslationSchema,
|
|
1469
1510
|
Positions,
|
|
1511
|
+
PreviousButtonModes,
|
|
1470
1512
|
PublicationStatuses,
|
|
1471
1513
|
QuestionStatuses,
|
|
1472
1514
|
QuestionTypes,
|
|
@@ -1492,6 +1534,8 @@ export {
|
|
|
1492
1534
|
conditionalIfMetadataSchema,
|
|
1493
1535
|
conditionalIfSchema,
|
|
1494
1536
|
conditionalWhenSchema,
|
|
1537
|
+
consentQuestionSchema,
|
|
1538
|
+
consentQuestionTranslationSchema,
|
|
1495
1539
|
createTranslationProvider,
|
|
1496
1540
|
currentModeSchema,
|
|
1497
1541
|
customEventFieldOperatorSchema,
|
|
@@ -1514,6 +1558,8 @@ export {
|
|
|
1514
1558
|
formConfigSchema,
|
|
1515
1559
|
formConfigurationResponseSchema,
|
|
1516
1560
|
formPropertiesSchema,
|
|
1561
|
+
logicJumpRuleSchema,
|
|
1562
|
+
logicJumpRulesSchema,
|
|
1517
1563
|
longAnswerQuestionSchema,
|
|
1518
1564
|
longAnswerQuestionTranslationSchema,
|
|
1519
1565
|
masterPropertiesSchema,
|
|
@@ -1542,6 +1588,7 @@ export {
|
|
|
1542
1588
|
otherConfigurationPropertiesSchema,
|
|
1543
1589
|
partialFeedbackSchema,
|
|
1544
1590
|
positionSchema,
|
|
1591
|
+
previousButtonModeSchema,
|
|
1545
1592
|
publicationStatusSchema,
|
|
1546
1593
|
queryOutputSchema,
|
|
1547
1594
|
questionCentricTranslationsSchema,
|
|
@@ -1567,6 +1614,8 @@ export {
|
|
|
1567
1614
|
refineTextResponseSchema,
|
|
1568
1615
|
responseSchema,
|
|
1569
1616
|
sectionSchema,
|
|
1617
|
+
sectionTranslationSchema,
|
|
1618
|
+
sectionTranslationsByLanguageSchema,
|
|
1570
1619
|
sessionInfoSchema,
|
|
1571
1620
|
shareableModeSchema,
|
|
1572
1621
|
shortAnswerQuestionSchema,
|