@encatch/schema 1.1.0-beta.4 → 1.1.0-beta.6
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 +13 -23
- package/dist/esm/index.js.map +2 -2
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +32 -16
- package/dist/types/schemas/fields/app-props-schema.d.ts +31 -16
- package/dist/types/schemas/fields/field-schema.d.ts +33 -6
- package/dist/types/schemas/fields/form-properties-schema.d.ts +31 -26
- package/dist/types/schemas/fields/other-screen-schema.d.ts +0 -5
- package/dist/types/schemas/fields/translations-schema.d.ts +77 -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,20 +88,13 @@ 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");
|
|
104
99
|
var yesNoQuestionTranslationSchema = baseQuestionTranslationFieldsSchema.extend({
|
|
105
100
|
type: z.literal("yes_no").describe("Question type identifier"),
|
|
@@ -478,7 +473,10 @@ var questionSchema = z2.object({
|
|
|
478
473
|
status: questionStatusSchema.describe(
|
|
479
474
|
"Current status of the question (Draft, Published, etc.)"
|
|
480
475
|
),
|
|
481
|
-
textAlign: z2.enum(["left", "center"]).optional().default("left").describe("Text alignment for the question title and description")
|
|
476
|
+
textAlign: z2.enum(["left", "center"]).optional().default("left").describe("Text alignment for the question title and description"),
|
|
477
|
+
nextButtonLabel: z2.string().min(1).max(50).optional().describe(
|
|
478
|
+
"Label for the next button when advancing past this question (overrides section or form defaults when set)"
|
|
479
|
+
)
|
|
482
480
|
}).describe("Base schema for all question types with common properties");
|
|
483
481
|
var ratingQuestionSchema = questionSchema.extend({
|
|
484
482
|
type: z2.literal("rating").describe("Must be exactly 'rating'"),
|
|
@@ -501,7 +499,6 @@ var welcomeQuestionSchema = questionSchema.extend({
|
|
|
501
499
|
type: z2.literal("welcome").describe("Must be exactly 'welcome'"),
|
|
502
500
|
title: z2.string().min(1).max(200).describe("The main heading displayed on the welcome screen"),
|
|
503
501
|
description: z2.string().max(1e3).optional().describe("Optional sub-text body shown below the heading"),
|
|
504
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the proceed/start button (e.g. 'Get Started', 'Begin')"),
|
|
505
502
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the welcome screen")
|
|
506
503
|
}).describe("Schema for a welcome screen displayed at the start or inline within a form");
|
|
507
504
|
var thankYouQuestionSchema = questionSchema.extend({
|
|
@@ -510,7 +507,6 @@ var thankYouQuestionSchema = questionSchema.extend({
|
|
|
510
507
|
description: z2.string().max(1e3).optional().describe(
|
|
511
508
|
"Optional thank you body text; rendered as Markdown where the form supports it"
|
|
512
509
|
),
|
|
513
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the dismiss/done button (e.g. 'Done', 'Close')"),
|
|
514
510
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the thank you screen")
|
|
515
511
|
}).describe(
|
|
516
512
|
"Schema for a thank you screen shown at the end or inline within a form"
|
|
@@ -519,7 +515,6 @@ var messagePanelQuestionSchema = questionSchema.extend({
|
|
|
519
515
|
type: z2.literal("message_panel").describe("Must be exactly 'message_panel'"),
|
|
520
516
|
title: z2.string().min(1).max(200).describe("The main heading displayed on the message panel"),
|
|
521
517
|
description: z2.string().max(1e3).optional().describe("Optional body text shown below the heading"),
|
|
522
|
-
buttonLabel: z2.string().min(1).max(50).optional().describe("Label for the continue button (e.g. 'Continue', 'Next')"),
|
|
523
518
|
imageUrl: z2.string().url().optional().describe("Optional image URL displayed on the message panel")
|
|
524
519
|
}).describe(
|
|
525
520
|
"Schema for an inline message panel (informational); distinct from welcome for UI semantics and analytics"
|
|
@@ -918,13 +913,9 @@ import { z as z8 } from "zod";
|
|
|
918
913
|
// src/schemas/fields/other-screen-schema.ts
|
|
919
914
|
import { z as z5 } from "zod";
|
|
920
915
|
var OtherFieldsSchema = z5.object({
|
|
921
|
-
pagination: z5.boolean().describe("Whether to show pagination for multi-page forms"),
|
|
922
916
|
questionNumber: z5.boolean().describe("Whether to display question numbers"),
|
|
923
|
-
pageTitle: z5.boolean().describe("Whether to show page titles in multi-page forms"),
|
|
924
|
-
blockerFeedback: z5.boolean().describe("Whether to show blocker feedback for validation errors"),
|
|
925
917
|
submitButtonLabel: z5.string().min(1).max(50).describe("Text for the submit button"),
|
|
926
918
|
previousButtonLabel: z5.string().min(1).max(50).describe("Text for the previous button in pagination"),
|
|
927
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Text for the next button in pagination"),
|
|
928
919
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),
|
|
929
920
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
930
921
|
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")
|
|
@@ -937,7 +928,6 @@ var LanguagesSchema = z5.array(LanguageFieldSchema).describe("Schema for array o
|
|
|
937
928
|
var OtherFieldsTranslationSchema = z5.object({
|
|
938
929
|
submitButtonLabel: z5.string().min(1).max(50).describe("Translated text for the submit button"),
|
|
939
930
|
previousButtonLabel: z5.string().min(1).max(50).describe("Translated text for the previous button in pagination"),
|
|
940
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Translated text for the next button in pagination"),
|
|
941
931
|
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),
|
|
942
932
|
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
943
933
|
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")
|
|
@@ -1096,13 +1086,13 @@ var otherConfigurationPropertiesSchema = z8.discriminatedUnion("isEnabled", [
|
|
|
1096
1086
|
// When other configuration is disabled
|
|
1097
1087
|
z8.object({
|
|
1098
1088
|
isEnabled: z8.literal(false).describe("Whether other configuration properties are enabled"),
|
|
1099
|
-
otherFields: OtherFieldsSchema.describe("Other form configuration fields including
|
|
1089
|
+
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
1100
1090
|
translations: z8.record(z8.string(), OtherFieldsTranslationSchema).optional().describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
1101
1091
|
}),
|
|
1102
1092
|
// When other configuration is enabled
|
|
1103
1093
|
z8.object({
|
|
1104
1094
|
isEnabled: z8.literal(true).describe("Whether other configuration properties are enabled"),
|
|
1105
|
-
otherFields: OtherFieldsSchema.describe("Other form configuration fields including
|
|
1095
|
+
otherFields: OtherFieldsSchema.describe("Other form configuration fields including buttons and display options"),
|
|
1106
1096
|
translations: z8.record(z8.string(), OtherFieldsTranslationSchema).describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
1107
1097
|
})
|
|
1108
1098
|
]).describe("Schema for other configuration properties including fields and translations");
|