@encatch/schema 0.1.14 → 0.1.16
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 +94 -77
- package/dist/esm/index.js.map +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/schemas/fields/auto-trigger-schema.d.ts +71 -0
- package/dist/types/schemas/fields/field-schema.d.ts +50 -50
- package/dist/types/schemas/fields/form-properties-schema.d.ts +11 -0
- package/dist/types/schemas/fields/form-schema.d.ts +13 -13
- package/dist/types/schemas/fields/other-screen-schema.d.ts +2 -2
- package/dist/types/schemas/fields/theme-schema.d.ts +11 -11
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -14,14 +14,14 @@ var questionTypeSchema = z.enum([
|
|
|
14
14
|
"annotation"
|
|
15
15
|
]).describe("Enumeration of all supported question types for form fields");
|
|
16
16
|
var QuestionTypes = {
|
|
17
|
-
RATING:
|
|
18
|
-
SINGLE_CHOICE:
|
|
19
|
-
NPS:
|
|
20
|
-
NESTED_SELECTION:
|
|
21
|
-
MULTIPLE_CHOICE_MULTIPLE:
|
|
22
|
-
SHORT_ANSWER:
|
|
23
|
-
LONG_TEXT:
|
|
24
|
-
ANNOTATION:
|
|
17
|
+
RATING: "rating",
|
|
18
|
+
SINGLE_CHOICE: "single_choice",
|
|
19
|
+
NPS: "nps",
|
|
20
|
+
NESTED_SELECTION: "nested_selection",
|
|
21
|
+
MULTIPLE_CHOICE_MULTIPLE: "multiple_choice_multiple",
|
|
22
|
+
SHORT_ANSWER: "short_answer",
|
|
23
|
+
LONG_TEXT: "long_text",
|
|
24
|
+
ANNOTATION: "annotation"
|
|
25
25
|
};
|
|
26
26
|
var validationRuleTypeSchema = z.enum([
|
|
27
27
|
"required",
|
|
@@ -35,15 +35,15 @@ var validationRuleTypeSchema = z.enum([
|
|
|
35
35
|
"custom"
|
|
36
36
|
]).describe("Enumeration of all supported validation rule types");
|
|
37
37
|
var ValidationRuleTypes = {
|
|
38
|
-
REQUIRED:
|
|
39
|
-
MIN:
|
|
40
|
-
MAX:
|
|
41
|
-
MIN_LENGTH:
|
|
42
|
-
MAX_LENGTH:
|
|
43
|
-
PATTERN:
|
|
44
|
-
EMAIL:
|
|
45
|
-
URL:
|
|
46
|
-
CUSTOM:
|
|
38
|
+
REQUIRED: "required",
|
|
39
|
+
MIN: "min",
|
|
40
|
+
MAX: "max",
|
|
41
|
+
MIN_LENGTH: "minLength",
|
|
42
|
+
MAX_LENGTH: "maxLength",
|
|
43
|
+
PATTERN: "pattern",
|
|
44
|
+
EMAIL: "email",
|
|
45
|
+
URL: "url",
|
|
46
|
+
CUSTOM: "custom"
|
|
47
47
|
};
|
|
48
48
|
var validationRuleSchema = z.object({
|
|
49
49
|
type: validationRuleTypeSchema.describe("Type of validation rule to apply"),
|
|
@@ -62,14 +62,14 @@ var visibilityConditionOperatorSchema = z.enum([
|
|
|
62
62
|
"is_not_empty"
|
|
63
63
|
]).describe("Enumeration of all supported visibility condition operators");
|
|
64
64
|
var VisibilityConditionOperators = {
|
|
65
|
-
EQUALS:
|
|
66
|
-
NOT_EQUALS:
|
|
67
|
-
CONTAINS:
|
|
68
|
-
NOT_CONTAINS:
|
|
69
|
-
GREATER_THAN:
|
|
70
|
-
LESS_THAN:
|
|
71
|
-
IS_EMPTY:
|
|
72
|
-
IS_NOT_EMPTY:
|
|
65
|
+
EQUALS: "equals",
|
|
66
|
+
NOT_EQUALS: "not_equals",
|
|
67
|
+
CONTAINS: "contains",
|
|
68
|
+
NOT_CONTAINS: "not_contains",
|
|
69
|
+
GREATER_THAN: "greater_than",
|
|
70
|
+
LESS_THAN: "less_than",
|
|
71
|
+
IS_EMPTY: "is_empty",
|
|
72
|
+
IS_NOT_EMPTY: "is_not_empty"
|
|
73
73
|
};
|
|
74
74
|
var visibilityConditionSchema = z.object({
|
|
75
75
|
field: z.string().describe("ID of the field to check against"),
|
|
@@ -86,10 +86,10 @@ var sectionSchema = z.object({
|
|
|
86
86
|
}).describe("Schema defining sections that organize questions into logical groups");
|
|
87
87
|
var questionStatusSchema = z.enum(["D", "P", "A", "S"]);
|
|
88
88
|
var QuestionStatuses = {
|
|
89
|
-
DRAFT:
|
|
90
|
-
PUBLISHED:
|
|
91
|
-
ARCHIVED:
|
|
92
|
-
SUSPENDED:
|
|
89
|
+
DRAFT: "D",
|
|
90
|
+
PUBLISHED: "P",
|
|
91
|
+
ARCHIVED: "A",
|
|
92
|
+
SUSPENDED: "S"
|
|
93
93
|
};
|
|
94
94
|
var ratingDisplayStyleSchema = z.enum([
|
|
95
95
|
"star",
|
|
@@ -100,12 +100,12 @@ var ratingDisplayStyleSchema = z.enum([
|
|
|
100
100
|
"emoji-exp"
|
|
101
101
|
]);
|
|
102
102
|
var RatingDisplayStyles = {
|
|
103
|
-
STAR:
|
|
104
|
-
HEART:
|
|
105
|
-
THUMBS_UP:
|
|
106
|
-
DIAMOND:
|
|
107
|
-
EMOJI:
|
|
108
|
-
EMOJI_EXP:
|
|
103
|
+
STAR: "star",
|
|
104
|
+
HEART: "heart",
|
|
105
|
+
THUMBS_UP: "thumbs_up",
|
|
106
|
+
DIAMOND: "diamond",
|
|
107
|
+
EMOJI: "emoji",
|
|
108
|
+
EMOJI_EXP: "emoji_exp"
|
|
109
109
|
};
|
|
110
110
|
var ratingRepresentationSizeSchema = z.enum([
|
|
111
111
|
"small",
|
|
@@ -113,9 +113,9 @@ var ratingRepresentationSizeSchema = z.enum([
|
|
|
113
113
|
"large"
|
|
114
114
|
]);
|
|
115
115
|
var RatingRepresentationSizes = {
|
|
116
|
-
SMALL:
|
|
117
|
-
MEDIUM:
|
|
118
|
-
LARGE:
|
|
116
|
+
SMALL: "small",
|
|
117
|
+
MEDIUM: "medium",
|
|
118
|
+
LARGE: "large"
|
|
119
119
|
};
|
|
120
120
|
var multipleChoiceDisplayStyleSchema = z.enum([
|
|
121
121
|
"radio",
|
|
@@ -124,10 +124,10 @@ var multipleChoiceDisplayStyleSchema = z.enum([
|
|
|
124
124
|
"dropdown"
|
|
125
125
|
]);
|
|
126
126
|
var MultipleChoiceDisplayStyles = {
|
|
127
|
-
RADIO:
|
|
128
|
-
LIST:
|
|
129
|
-
CHIP:
|
|
130
|
-
DROPDOWN:
|
|
127
|
+
RADIO: "radio",
|
|
128
|
+
LIST: "list",
|
|
129
|
+
CHIP: "chip",
|
|
130
|
+
DROPDOWN: "dropdown"
|
|
131
131
|
};
|
|
132
132
|
var multipleChoiceMultipleDisplayStyleSchema = z.enum([
|
|
133
133
|
"checkbox",
|
|
@@ -135,9 +135,9 @@ var multipleChoiceMultipleDisplayStyleSchema = z.enum([
|
|
|
135
135
|
"chip"
|
|
136
136
|
]);
|
|
137
137
|
var MultipleChoiceMultipleDisplayStyles = {
|
|
138
|
-
CHECKBOX:
|
|
139
|
-
LIST:
|
|
140
|
-
CHIP:
|
|
138
|
+
CHECKBOX: "checkbox",
|
|
139
|
+
LIST: "list",
|
|
140
|
+
CHIP: "chip"
|
|
141
141
|
};
|
|
142
142
|
var choiceOrderOptionSchema = z.enum([
|
|
143
143
|
"randomize",
|
|
@@ -147,11 +147,11 @@ var choiceOrderOptionSchema = z.enum([
|
|
|
147
147
|
"none"
|
|
148
148
|
]);
|
|
149
149
|
var ChoiceOrderOptions = {
|
|
150
|
-
RANDOMIZE:
|
|
151
|
-
FLIP:
|
|
152
|
-
ROTATE:
|
|
153
|
-
ASCENDING:
|
|
154
|
-
NONE:
|
|
150
|
+
RANDOMIZE: "randomize",
|
|
151
|
+
FLIP: "flip",
|
|
152
|
+
ROTATE: "rotate",
|
|
153
|
+
ASCENDING: "ascending",
|
|
154
|
+
NONE: "none"
|
|
155
155
|
};
|
|
156
156
|
var questionSchema = z.object({
|
|
157
157
|
id: z.string().describe("Unique identifier for the question"),
|
|
@@ -475,22 +475,22 @@ var AnswerSchema = z2.discriminatedUnion("type", [
|
|
|
475
475
|
import { z as z3 } from "zod";
|
|
476
476
|
var surveyTypeSchema = z3.enum(["R", "O"]).describe("Enumeration of feedback types: R=Recurring, O=One-time");
|
|
477
477
|
var SurveyTypes = {
|
|
478
|
-
RECURRING:
|
|
479
|
-
ONE_TIME:
|
|
478
|
+
RECURRING: "R",
|
|
479
|
+
ONE_TIME: "O"
|
|
480
480
|
};
|
|
481
481
|
var yesNoSchema = z3.enum(["Y", "N"]).describe("Yes/No enumeration using Y/N values");
|
|
482
482
|
var YesNoValues = {
|
|
483
|
-
YES:
|
|
484
|
-
NO:
|
|
483
|
+
YES: "Y",
|
|
484
|
+
NO: "N"
|
|
485
485
|
};
|
|
486
486
|
var recurringUnitSchema = z3.enum(["minutes", "hours", "days", "weeks", "months", "years"]).describe("Time units for recurring feedback schedules");
|
|
487
487
|
var RecurringUnits = {
|
|
488
|
-
MINUTES:
|
|
489
|
-
HOURS:
|
|
490
|
-
DAYS:
|
|
491
|
-
WEEKS:
|
|
492
|
-
MONTHS:
|
|
493
|
-
YEARS:
|
|
488
|
+
MINUTES: "minutes",
|
|
489
|
+
HOURS: "hours",
|
|
490
|
+
DAYS: "days",
|
|
491
|
+
WEEKS: "weeks",
|
|
492
|
+
MONTHS: "months",
|
|
493
|
+
YEARS: "years"
|
|
494
494
|
};
|
|
495
495
|
var frequencyAndSchedulingPropertiesSchema = z3.object({
|
|
496
496
|
surveyType: surveyTypeSchema.describe("Type of feedback: R for recurring, O for one-time"),
|
|
@@ -546,9 +546,9 @@ var externalPublishingPropertiesSchema = z3.object({
|
|
|
546
546
|
}).describe("Schema defining external publishing and sharing properties for feedback");
|
|
547
547
|
var publicationStatusSchema = z3.enum(["P", "D", "A"]).describe("Publication status: P=Published, D=Draft, A=Archived");
|
|
548
548
|
var PublicationStatuses = {
|
|
549
|
-
PUBLISHED:
|
|
550
|
-
DRAFT:
|
|
551
|
-
ARCHIVED:
|
|
549
|
+
PUBLISHED: "P",
|
|
550
|
+
DRAFT: "D",
|
|
551
|
+
ARCHIVED: "A"
|
|
552
552
|
};
|
|
553
553
|
var feedbackConfigurationSchema = z3.object({
|
|
554
554
|
form_title: z3.string().describe("Title of the feedback form"),
|
|
@@ -737,8 +737,8 @@ __name(createTranslationProvider, "createTranslationProvider");
|
|
|
737
737
|
import { z as z5 } from "zod";
|
|
738
738
|
var dismissBehaviorSchema = z5.enum(["fade", "manual"]).describe("How the end screen should be dismissed (fade out or manual dismissal)");
|
|
739
739
|
var DismissBehaviors = {
|
|
740
|
-
FADE:
|
|
741
|
-
MANUAL:
|
|
740
|
+
FADE: "fade",
|
|
741
|
+
MANUAL: "manual"
|
|
742
742
|
};
|
|
743
743
|
var WelcomeScreenFieldsSchema = z5.object({
|
|
744
744
|
title: z5.string().min(1).max(200).describe("The main title displayed on the welcome screen"),
|
|
@@ -797,20 +797,20 @@ var positionSchema = z6.enum([
|
|
|
797
797
|
"bottom-right"
|
|
798
798
|
]).describe("Available positions for widget placement");
|
|
799
799
|
var Positions = {
|
|
800
|
-
TOP_LEFT:
|
|
801
|
-
TOP_CENTER:
|
|
802
|
-
TOP_RIGHT:
|
|
803
|
-
MIDDLE_LEFT:
|
|
804
|
-
MIDDLE_CENTER:
|
|
805
|
-
MIDDLE_RIGHT:
|
|
806
|
-
BOTTOM_LEFT:
|
|
807
|
-
BOTTOM_CENTER:
|
|
808
|
-
BOTTOM_RIGHT:
|
|
800
|
+
TOP_LEFT: "top-left",
|
|
801
|
+
TOP_CENTER: "top-center",
|
|
802
|
+
TOP_RIGHT: "top-right",
|
|
803
|
+
MIDDLE_LEFT: "middle-left",
|
|
804
|
+
MIDDLE_CENTER: "middle-center",
|
|
805
|
+
MIDDLE_RIGHT: "middle-right",
|
|
806
|
+
BOTTOM_LEFT: "bottom-left",
|
|
807
|
+
BOTTOM_CENTER: "bottom-center",
|
|
808
|
+
BOTTOM_RIGHT: "bottom-right"
|
|
809
809
|
};
|
|
810
810
|
var themeModeSchema = z6.enum(["light", "dark"]).describe("Available theme modes for the widget");
|
|
811
811
|
var ThemeModes = {
|
|
812
|
-
LIGHT:
|
|
813
|
-
DARK:
|
|
812
|
+
LIGHT: "light",
|
|
813
|
+
DARK: "dark"
|
|
814
814
|
};
|
|
815
815
|
var featureSettingsSchema = z6.object({
|
|
816
816
|
darkOverlay: z6.boolean().describe("Whether to show a dark overlay behind the widget"),
|
|
@@ -843,6 +843,19 @@ var themeConfigurationSchema = z6.object({
|
|
|
843
843
|
|
|
844
844
|
// src/schemas/fields/auto-trigger-schema.ts
|
|
845
845
|
import { z as z7 } from "zod";
|
|
846
|
+
var customEventFieldOperatorSchema = z7.object({
|
|
847
|
+
name: z7.string().describe("The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')"),
|
|
848
|
+
label: z7.string().describe("Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')")
|
|
849
|
+
}).describe("Schema defining an operator for custom event fields");
|
|
850
|
+
var customEventFieldSchema = z7.object({
|
|
851
|
+
name: z7.string().describe("The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')"),
|
|
852
|
+
label: z7.string().describe("Human-readable label for the field"),
|
|
853
|
+
placeholder: z7.string().describe("Placeholder text for input fields"),
|
|
854
|
+
operators: z7.array(customEventFieldOperatorSchema).min(1).describe("Array of available operators for this field")
|
|
855
|
+
}).describe("Schema defining a custom event field with its operators");
|
|
856
|
+
var conditionalIfMetadataSchema = z7.object({
|
|
857
|
+
customEventFields: z7.array(customEventFieldSchema).optional().describe("Array of custom event fields with their operators and labels")
|
|
858
|
+
}).describe("Schema defining metadata for conditional if clauses");
|
|
846
859
|
var queryOutputSchema = z7.object({
|
|
847
860
|
query: z7.string().describe("The structured query definition as a JSON string"),
|
|
848
861
|
naturalLanguage: z7.string().describe("Human-readable description of the query conditions"),
|
|
@@ -852,7 +865,8 @@ var queryOutputSchema = z7.object({
|
|
|
852
865
|
var conditionalIfSchema = z7.object({
|
|
853
866
|
id: z7.string().describe("Unique identifier for this condition"),
|
|
854
867
|
event: z7.string().describe("The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')"),
|
|
855
|
-
queryOutput: queryOutputSchema.describe("The query conditions to evaluate when the event occurs")
|
|
868
|
+
queryOutput: queryOutputSchema.describe("The query conditions to evaluate when the event occurs"),
|
|
869
|
+
metadata: conditionalIfMetadataSchema.optional().describe("Optional metadata containing custom event fields and their configurations")
|
|
856
870
|
}).describe("Schema defining the 'if' condition for auto-trigger logic");
|
|
857
871
|
var triggerActionSchema = z7.object({
|
|
858
872
|
triggerType: z7.string().describe("The type of action to perform (e.g., 'delay', 'scroll', 'immediately')"),
|
|
@@ -1019,9 +1033,12 @@ export {
|
|
|
1019
1033
|
categorySpecificFiltersSchema,
|
|
1020
1034
|
choiceOrderOptionSchema,
|
|
1021
1035
|
combinedQuestionSchema,
|
|
1036
|
+
conditionalIfMetadataSchema,
|
|
1022
1037
|
conditionalIfSchema,
|
|
1023
1038
|
conditionalWhenSchema,
|
|
1024
1039
|
createTranslationProvider,
|
|
1040
|
+
customEventFieldOperatorSchema,
|
|
1041
|
+
customEventFieldSchema,
|
|
1025
1042
|
dismissBehaviorSchema,
|
|
1026
1043
|
endScreenPropertiesSchema,
|
|
1027
1044
|
externalPublishingPropertiesSchema,
|