@encatch/schema 0.1.30 → 0.1.31
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 +61 -5
- package/dist/esm/index.js.map +4 -4
- package/dist/types/index.d.ts +2 -1
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +14 -2
- package/dist/types/schemas/fields/app-props-schema.d.ts +721 -0
- package/dist/types/schemas/fields/form-properties-schema.d.ts +28 -4
- package/dist/types/schemas/fields/other-screen-schema.d.ts +6 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -769,7 +769,10 @@ var OtherFieldsSchema = z5.object({
|
|
|
769
769
|
blockerFeedback: z5.boolean().describe("Whether to show blocker feedback for validation errors"),
|
|
770
770
|
submitButtonLabel: z5.string().min(1).max(50).describe("Text for the submit button"),
|
|
771
771
|
previousButtonLabel: z5.string().min(1).max(50).describe("Text for the previous button in pagination"),
|
|
772
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Text for the next button in pagination")
|
|
772
|
+
nextButtonLabel: z5.string().min(1).max(50).describe("Text for the next button in pagination"),
|
|
773
|
+
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),
|
|
774
|
+
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
775
|
+
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")
|
|
773
776
|
}).describe("Schema for other form configuration fields");
|
|
774
777
|
var LanguageFieldSchema = z5.object({
|
|
775
778
|
value: z5.string().min(1).max(10).describe("Language code (e.g., 'en', 'es', 'fr')"),
|
|
@@ -780,7 +783,10 @@ var LanguagesSchema = z5.array(LanguageFieldSchema).describe("Schema for array o
|
|
|
780
783
|
var OtherFieldsTranslationSchema = z5.object({
|
|
781
784
|
submitButtonLabel: z5.string().min(1).max(50).describe("Translated text for the submit button"),
|
|
782
785
|
previousButtonLabel: z5.string().min(1).max(50).describe("Translated text for the previous button in pagination"),
|
|
783
|
-
nextButtonLabel: z5.string().min(1).max(50).describe("Translated text for the next button in pagination")
|
|
786
|
+
nextButtonLabel: z5.string().min(1).max(50).describe("Translated text for the next button in pagination"),
|
|
787
|
+
aiEnhancementSuccessMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),
|
|
788
|
+
aiEnhancementCooldownErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),
|
|
789
|
+
aiEnhancementMaxReachedErrorMessage: z5.string().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")
|
|
784
790
|
}).describe("Schema for other form configuration field translations");
|
|
785
791
|
|
|
786
792
|
// src/schemas/fields/theme-schema.ts
|
|
@@ -921,7 +927,7 @@ var otherConfigurationPropertiesSchema = z8.discriminatedUnion("isEnabled", [
|
|
|
921
927
|
// When other configuration is disabled
|
|
922
928
|
z8.object({
|
|
923
929
|
isEnabled: z8.literal(false).describe("Whether other configuration properties are enabled"),
|
|
924
|
-
otherFields: OtherFieldsSchema.
|
|
930
|
+
otherFields: OtherFieldsSchema.describe("Other form configuration fields including pagination, buttons, and display options"),
|
|
925
931
|
translations: z8.record(z8.string(), OtherFieldsTranslationSchema).optional().describe("Translations for other configuration field labels and buttons keyed by language code")
|
|
926
932
|
}),
|
|
927
933
|
// When other configuration is enabled
|
|
@@ -1268,14 +1274,62 @@ function objectToPascal(obj) {
|
|
|
1268
1274
|
}
|
|
1269
1275
|
__name(objectToPascal, "objectToPascal");
|
|
1270
1276
|
|
|
1271
|
-
// src/
|
|
1277
|
+
// src/schemas/fields/app-props-schema.ts
|
|
1272
1278
|
import { z as z14 } from "zod";
|
|
1279
|
+
var currentModeSchema = z14.enum(["light", "dark"]).describe("Current theme mode of the application");
|
|
1280
|
+
var CurrentModes = {
|
|
1281
|
+
LIGHT: "light",
|
|
1282
|
+
DARK: "dark"
|
|
1283
|
+
};
|
|
1284
|
+
var appPropsSchema = z14.object({
|
|
1285
|
+
theme: themesSchema.describe(
|
|
1286
|
+
"Theme configuration including light and dark theme colors"
|
|
1287
|
+
),
|
|
1288
|
+
currentMode: currentModeSchema.describe(
|
|
1289
|
+
"Current theme mode (light or dark)"
|
|
1290
|
+
),
|
|
1291
|
+
currentLanguage: LanguageFieldSchema.describe(
|
|
1292
|
+
"Currently selected language configuration"
|
|
1293
|
+
),
|
|
1294
|
+
questions: z14.record(z14.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
1295
|
+
questionLanguages: LanguagesSchema.describe(
|
|
1296
|
+
"Available languages for questions"
|
|
1297
|
+
),
|
|
1298
|
+
otherConfigurationProperties: otherConfigurationPropertiesSchema.describe(
|
|
1299
|
+
"Other configuration properties including form display options and translations"
|
|
1300
|
+
),
|
|
1301
|
+
welcomeScreenProperties: welcomeScreenPropertiesSchema.optional().describe("Welcome screen configuration (optional)"),
|
|
1302
|
+
endScreenProperties: endScreenPropertiesSchema.optional().describe("End screen configuration (optional)"),
|
|
1303
|
+
translations: translationsSchema.optional().describe(
|
|
1304
|
+
"Multi-language translations for questions and form content (optional)"
|
|
1305
|
+
),
|
|
1306
|
+
onSectionChange: z14.function({
|
|
1307
|
+
input: [z14.number()],
|
|
1308
|
+
output: z14.void()
|
|
1309
|
+
}).optional().describe("Optional callback function triggered when section changes"),
|
|
1310
|
+
onClose: z14.function({
|
|
1311
|
+
input: [],
|
|
1312
|
+
output: z14.void()
|
|
1313
|
+
}).optional().describe("Optional callback function triggered when the form is closed"),
|
|
1314
|
+
sections: z14.array(sectionSchema).describe(
|
|
1315
|
+
"Array of sections that organize questions into logical groups"
|
|
1316
|
+
),
|
|
1317
|
+
themeSettings: themeConfigurationSchema.describe(
|
|
1318
|
+
"Complete theme configuration including colors, features, and positioning"
|
|
1319
|
+
)
|
|
1320
|
+
}).describe(
|
|
1321
|
+
"Schema for application props interface containing all form configuration and state"
|
|
1322
|
+
);
|
|
1323
|
+
|
|
1324
|
+
// src/index.ts
|
|
1325
|
+
import { z as z15 } from "zod";
|
|
1273
1326
|
export {
|
|
1274
1327
|
AnnotationMarkerSchema,
|
|
1275
1328
|
AnnotationSchema,
|
|
1276
1329
|
AnswerItemSchema,
|
|
1277
1330
|
AnswerSchema,
|
|
1278
1331
|
ChoiceOrderOptions,
|
|
1332
|
+
CurrentModes,
|
|
1279
1333
|
DeviceThemes,
|
|
1280
1334
|
DismissBehaviors,
|
|
1281
1335
|
EndFieldsTranslationSchema,
|
|
@@ -1304,6 +1358,7 @@ export {
|
|
|
1304
1358
|
YesNoValues,
|
|
1305
1359
|
annotationQuestionSchema,
|
|
1306
1360
|
annotationQuestionTranslationSchema,
|
|
1361
|
+
appPropsSchema,
|
|
1307
1362
|
appearancePropertiesSchema,
|
|
1308
1363
|
audienceSegmentSchema,
|
|
1309
1364
|
audienceTriggerPropertiesSchema,
|
|
@@ -1315,6 +1370,7 @@ export {
|
|
|
1315
1370
|
conditionalIfSchema,
|
|
1316
1371
|
conditionalWhenSchema,
|
|
1317
1372
|
createTranslationProvider,
|
|
1373
|
+
currentModeSchema,
|
|
1318
1374
|
customEventFieldOperatorSchema,
|
|
1319
1375
|
customEventFieldSchema,
|
|
1320
1376
|
deviceInfoSchema,
|
|
@@ -1402,6 +1458,6 @@ export {
|
|
|
1402
1458
|
welcomeScreenPropertiesSchema,
|
|
1403
1459
|
whoSchema,
|
|
1404
1460
|
yesNoSchema,
|
|
1405
|
-
|
|
1461
|
+
z15 as z
|
|
1406
1462
|
};
|
|
1407
1463
|
//# sourceMappingURL=index.js.map
|