@encatch/schema 0.1.29 → 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 +82 -25
- 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/api/submit-feedback-schema.d.ts +36 -32
- package/dist/types/schemas/fields/answer-schema.d.ts +20 -20
- package/dist/types/schemas/fields/app-props-schema.d.ts +721 -0
- package/dist/types/schemas/fields/form-properties-schema.d.ts +39 -15
- package/dist/types/schemas/fields/other-screen-schema.d.ts +6 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -394,25 +394,25 @@ var combinedQuestionSchema = z.discriminatedUnion("type", [
|
|
|
394
394
|
// src/schemas/fields/answer-schema.ts
|
|
395
395
|
import { z as z2 } from "zod";
|
|
396
396
|
var AnnotationMarkerSchema = z2.object({
|
|
397
|
-
|
|
397
|
+
markerNo: z2.string(),
|
|
398
398
|
timeline: z2.string(),
|
|
399
399
|
comment: z2.string()
|
|
400
400
|
});
|
|
401
401
|
var AnnotationSchema = z2.object({
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
fileType: z2.string(),
|
|
403
|
+
fileName: z2.string(),
|
|
404
404
|
markers: z2.array(AnnotationMarkerSchema)
|
|
405
405
|
});
|
|
406
406
|
var AnswerItemSchema = z2.object({
|
|
407
407
|
nps: z2.number().optional().describe("Net Promoter Score value (e.g., 0-10)"),
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
408
|
+
nestedSelection: z2.array(z2.string()).optional().describe("Array of selected nested option IDs"),
|
|
409
|
+
longText: z2.string().optional().describe("Long text answer, e.g., paragraph or essay"),
|
|
410
|
+
shortAnswer: z2.string().optional().describe("Short text answer, e.g., single sentence or word"),
|
|
411
|
+
singleChoice: z2.string().optional().describe(
|
|
412
412
|
"single selected option ID (for single choice questions)"
|
|
413
413
|
),
|
|
414
414
|
rating: z2.number().optional().describe("Star rating value (e.g., 1-5)"),
|
|
415
|
-
|
|
415
|
+
multipleChoiceMultiple: z2.array(z2.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
|
|
416
416
|
annotation: AnnotationSchema.optional().describe(
|
|
417
417
|
"Annotation object containing file and marker details"
|
|
418
418
|
),
|
|
@@ -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
|
|
@@ -963,21 +969,21 @@ var appearancePropertiesSchema = z8.object({
|
|
|
963
969
|
themeConfiguration: themeConfigurationSchema.describe("Theme configuration including colors, features, and positioning")
|
|
964
970
|
}).describe("Schema for appearance properties including theme configuration");
|
|
965
971
|
var formPropertiesSchema = z8.object({
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
972
|
+
feedbackConfigurationId: z8.uuid().describe("Unique identifier for the feedback configuration"),
|
|
973
|
+
feedbackConfiguration: feedbackConfigurationSchema.describe("Configuration properties for the feedback form"),
|
|
974
|
+
questionnaireFields: z8.object({
|
|
969
975
|
questions: z8.record(z8.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
970
976
|
sections: z8.array(sectionSchema).describe("Array of sections that organize questions into logical groups"),
|
|
971
|
-
|
|
977
|
+
selectedLanguages: LanguagesSchema.describe("Array of languages selected for this questionnaire"),
|
|
972
978
|
translations: translationsSchema.describe("Multi-language translations for questions and form content")
|
|
973
979
|
}).describe("Fields defining the questionnaire structure, questions, sections, selected languages, and translations"),
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
980
|
+
frequencyAndSchedulingProperties: frequencyAndSchedulingPropertiesSchema.describe("Properties controlling when and how often the feedback is shown"),
|
|
981
|
+
externalPublishingProperties: externalPublishingPropertiesSchema.describe("Properties controlling external sharing and publishing of feedback results"),
|
|
982
|
+
audienceTriggerProperties: audienceTriggerPropertiesSchema.describe("Properties defining audience targeting and trigger conditions for the feedback form"),
|
|
983
|
+
otherConfigurationProperties: otherConfigurationPropertiesSchema.describe("Additional configuration properties including form display options and translations"),
|
|
984
|
+
welcomeScreenProperties: welcomeScreenPropertiesSchema.describe("Welcome screen configuration including content and translations"),
|
|
985
|
+
endScreenProperties: endScreenPropertiesSchema.describe("End screen configuration including content, dismissal behavior, and translations"),
|
|
986
|
+
appearanceProperties: appearancePropertiesSchema.describe("Appearance configuration including themes, colors, and UI feature settings")
|
|
981
987
|
}).describe("Complete schema for all feedback-level properties including scheduling, publishing, audience targeting, configuration, screens, and appearance");
|
|
982
988
|
|
|
983
989
|
// src/schemas/fields/other-properties-schema.ts
|
|
@@ -1049,7 +1055,8 @@ var formConfigSchema = z11.object({
|
|
|
1049
1055
|
var questionResponseSchema = z11.object({
|
|
1050
1056
|
questionId: z11.string().uuid().describe("Unique identifier for the question"),
|
|
1051
1057
|
answer: AnswerSchema.describe("The answer provided for this question"),
|
|
1052
|
-
type: z11.string().describe("Type of the question (e.g., 'rating', 'single_choice')")
|
|
1058
|
+
type: z11.string().describe("Type of the question (e.g., 'rating', 'single_choice')"),
|
|
1059
|
+
error: z11.string().optional().describe("Error message if any validation failed")
|
|
1053
1060
|
}).describe("Response to a specific question in the feedback form");
|
|
1054
1061
|
var responseSchema = z11.object({
|
|
1055
1062
|
questions: z11.array(questionResponseSchema).min(1).describe("Array of question responses")
|
|
@@ -1267,14 +1274,62 @@ function objectToPascal(obj) {
|
|
|
1267
1274
|
}
|
|
1268
1275
|
__name(objectToPascal, "objectToPascal");
|
|
1269
1276
|
|
|
1270
|
-
// src/
|
|
1277
|
+
// src/schemas/fields/app-props-schema.ts
|
|
1271
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";
|
|
1272
1326
|
export {
|
|
1273
1327
|
AnnotationMarkerSchema,
|
|
1274
1328
|
AnnotationSchema,
|
|
1275
1329
|
AnswerItemSchema,
|
|
1276
1330
|
AnswerSchema,
|
|
1277
1331
|
ChoiceOrderOptions,
|
|
1332
|
+
CurrentModes,
|
|
1278
1333
|
DeviceThemes,
|
|
1279
1334
|
DismissBehaviors,
|
|
1280
1335
|
EndFieldsTranslationSchema,
|
|
@@ -1303,6 +1358,7 @@ export {
|
|
|
1303
1358
|
YesNoValues,
|
|
1304
1359
|
annotationQuestionSchema,
|
|
1305
1360
|
annotationQuestionTranslationSchema,
|
|
1361
|
+
appPropsSchema,
|
|
1306
1362
|
appearancePropertiesSchema,
|
|
1307
1363
|
audienceSegmentSchema,
|
|
1308
1364
|
audienceTriggerPropertiesSchema,
|
|
@@ -1314,6 +1370,7 @@ export {
|
|
|
1314
1370
|
conditionalIfSchema,
|
|
1315
1371
|
conditionalWhenSchema,
|
|
1316
1372
|
createTranslationProvider,
|
|
1373
|
+
currentModeSchema,
|
|
1317
1374
|
customEventFieldOperatorSchema,
|
|
1318
1375
|
customEventFieldSchema,
|
|
1319
1376
|
deviceInfoSchema,
|
|
@@ -1401,6 +1458,6 @@ export {
|
|
|
1401
1458
|
welcomeScreenPropertiesSchema,
|
|
1402
1459
|
whoSchema,
|
|
1403
1460
|
yesNoSchema,
|
|
1404
|
-
|
|
1461
|
+
z15 as z
|
|
1405
1462
|
};
|
|
1406
1463
|
//# sourceMappingURL=index.js.map
|