@encatch/schema 0.1.15 → 0.1.18
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 +293 -100
- package/dist/esm/index.js.map +4 -4
- package/dist/types/index.d.ts +4 -1
- package/dist/types/schemas/api/feedback-actions-schema.d.ts +0 -0
- package/dist/types/schemas/api/feedback-fetch-schema.d.ts +0 -0
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +1354 -0
- package/dist/types/schemas/api/other-schema.d.ts +68 -0
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +381 -0
- package/dist/types/schemas/fields/field-schema.d.ts +52 -50
- package/dist/types/schemas/fields/form-properties-schema.d.ts +1 -0
- package/dist/types/schemas/fields/form-schema.d.ts +18 -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"),
|
|
@@ -325,7 +325,8 @@ var longAnswerQuestionSchema = questionSchema.extend({
|
|
|
325
325
|
maxEnhancements: z.number().int().min(1).max(10).optional().describe("Maximum number of AI enhancements allowed"),
|
|
326
326
|
maxTokenAllowed: z.number().int().min(1).max(25e3).optional().describe(
|
|
327
327
|
"Maximum tokens allowed for AI processing (higher for long text)"
|
|
328
|
-
)
|
|
328
|
+
),
|
|
329
|
+
minCharactersToEnhance: z.number().int().min(1).optional().describe("Minimum characters needed to trigger AI enhancement")
|
|
329
330
|
}).refine(
|
|
330
331
|
(data) => {
|
|
331
332
|
if (data.minCharacters !== void 0 && data.maxCharacters !== void 0) {
|
|
@@ -475,22 +476,22 @@ var AnswerSchema = z2.discriminatedUnion("type", [
|
|
|
475
476
|
import { z as z3 } from "zod";
|
|
476
477
|
var surveyTypeSchema = z3.enum(["R", "O"]).describe("Enumeration of feedback types: R=Recurring, O=One-time");
|
|
477
478
|
var SurveyTypes = {
|
|
478
|
-
RECURRING:
|
|
479
|
-
ONE_TIME:
|
|
479
|
+
RECURRING: "R",
|
|
480
|
+
ONE_TIME: "O"
|
|
480
481
|
};
|
|
481
482
|
var yesNoSchema = z3.enum(["Y", "N"]).describe("Yes/No enumeration using Y/N values");
|
|
482
483
|
var YesNoValues = {
|
|
483
|
-
YES:
|
|
484
|
-
NO:
|
|
484
|
+
YES: "Y",
|
|
485
|
+
NO: "N"
|
|
485
486
|
};
|
|
486
487
|
var recurringUnitSchema = z3.enum(["minutes", "hours", "days", "weeks", "months", "years"]).describe("Time units for recurring feedback schedules");
|
|
487
488
|
var RecurringUnits = {
|
|
488
|
-
MINUTES:
|
|
489
|
-
HOURS:
|
|
490
|
-
DAYS:
|
|
491
|
-
WEEKS:
|
|
492
|
-
MONTHS:
|
|
493
|
-
YEARS:
|
|
489
|
+
MINUTES: "minutes",
|
|
490
|
+
HOURS: "hours",
|
|
491
|
+
DAYS: "days",
|
|
492
|
+
WEEKS: "weeks",
|
|
493
|
+
MONTHS: "months",
|
|
494
|
+
YEARS: "years"
|
|
494
495
|
};
|
|
495
496
|
var frequencyAndSchedulingPropertiesSchema = z3.object({
|
|
496
497
|
surveyType: surveyTypeSchema.describe("Type of feedback: R for recurring, O for one-time"),
|
|
@@ -546,35 +547,39 @@ var externalPublishingPropertiesSchema = z3.object({
|
|
|
546
547
|
}).describe("Schema defining external publishing and sharing properties for feedback");
|
|
547
548
|
var publicationStatusSchema = z3.enum(["P", "D", "A"]).describe("Publication status: P=Published, D=Draft, A=Archived");
|
|
548
549
|
var PublicationStatuses = {
|
|
549
|
-
PUBLISHED:
|
|
550
|
-
DRAFT:
|
|
551
|
-
ARCHIVED:
|
|
550
|
+
PUBLISHED: "P",
|
|
551
|
+
DRAFT: "D",
|
|
552
|
+
ARCHIVED: "A"
|
|
552
553
|
};
|
|
554
|
+
var durationSchema = z3.object({
|
|
555
|
+
from: z3.string().describe("Start date and time for the duration (ISO format or custom format)"),
|
|
556
|
+
to: z3.string().describe("End date and time for the duration (ISO format or custom format)")
|
|
557
|
+
}).describe("Duration range for when something is active");
|
|
553
558
|
var feedbackConfigurationSchema = z3.object({
|
|
554
559
|
form_title: z3.string().describe("Title of the feedback form"),
|
|
555
560
|
form_description: z3.string().describe("Description of the feedback form"),
|
|
556
|
-
duration:
|
|
557
|
-
|
|
558
|
-
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(\+|\-)\d{2}:\d{2}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
duration: durationSchema.refine(
|
|
562
|
+
(data) => {
|
|
563
|
+
const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(\+|\-)\d{2}:\d{2}$/;
|
|
564
|
+
return isoRegex.test(data.from) && isoRegex.test(data.to);
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
message: "Duration dates must be in valid ISO format with timezone",
|
|
568
|
+
path: ["from"]
|
|
569
|
+
}
|
|
570
|
+
).refine(
|
|
571
|
+
(data) => {
|
|
572
|
+
const start = new Date(data.from);
|
|
573
|
+
const end = new Date(data.to);
|
|
574
|
+
return end > start;
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
message: "End date must be after start date",
|
|
578
|
+
path: ["to"]
|
|
579
|
+
}
|
|
580
|
+
).describe("Duration period for the feedback"),
|
|
566
581
|
is_published: publicationStatusSchema.describe("Publication status of the feedback form")
|
|
567
|
-
}).
|
|
568
|
-
(data) => {
|
|
569
|
-
const start = new Date(data.duration.from);
|
|
570
|
-
const end = new Date(data.duration.to);
|
|
571
|
-
return end > start;
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
message: "End date must be after start date",
|
|
575
|
-
path: ["duration", "to"]
|
|
576
|
-
}
|
|
577
|
-
).describe("Schema defining feedback configuration properties");
|
|
582
|
+
}).describe("Schema defining feedback configuration properties");
|
|
578
583
|
|
|
579
584
|
// src/schemas/fields/form-properties-schema.ts
|
|
580
585
|
import { z as z8 } from "zod";
|
|
@@ -737,8 +742,8 @@ __name(createTranslationProvider, "createTranslationProvider");
|
|
|
737
742
|
import { z as z5 } from "zod";
|
|
738
743
|
var dismissBehaviorSchema = z5.enum(["fade", "manual"]).describe("How the end screen should be dismissed (fade out or manual dismissal)");
|
|
739
744
|
var DismissBehaviors = {
|
|
740
|
-
FADE:
|
|
741
|
-
MANUAL:
|
|
745
|
+
FADE: "fade",
|
|
746
|
+
MANUAL: "manual"
|
|
742
747
|
};
|
|
743
748
|
var WelcomeScreenFieldsSchema = z5.object({
|
|
744
749
|
title: z5.string().min(1).max(200).describe("The main title displayed on the welcome screen"),
|
|
@@ -797,20 +802,20 @@ var positionSchema = z6.enum([
|
|
|
797
802
|
"bottom-right"
|
|
798
803
|
]).describe("Available positions for widget placement");
|
|
799
804
|
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:
|
|
805
|
+
TOP_LEFT: "top-left",
|
|
806
|
+
TOP_CENTER: "top-center",
|
|
807
|
+
TOP_RIGHT: "top-right",
|
|
808
|
+
MIDDLE_LEFT: "middle-left",
|
|
809
|
+
MIDDLE_CENTER: "middle-center",
|
|
810
|
+
MIDDLE_RIGHT: "middle-right",
|
|
811
|
+
BOTTOM_LEFT: "bottom-left",
|
|
812
|
+
BOTTOM_CENTER: "bottom-center",
|
|
813
|
+
BOTTOM_RIGHT: "bottom-right"
|
|
809
814
|
};
|
|
810
815
|
var themeModeSchema = z6.enum(["light", "dark"]).describe("Available theme modes for the widget");
|
|
811
816
|
var ThemeModes = {
|
|
812
|
-
LIGHT:
|
|
813
|
-
DARK:
|
|
817
|
+
LIGHT: "light",
|
|
818
|
+
DARK: "dark"
|
|
814
819
|
};
|
|
815
820
|
var featureSettingsSchema = z6.object({
|
|
816
821
|
darkOverlay: z6.boolean().describe("Whether to show a dark overlay behind the widget"),
|
|
@@ -989,13 +994,176 @@ var masterPropertiesSchema = z9.object({
|
|
|
989
994
|
feedback_interval_duration: z9.number().int().positive().describe("Duration in seconds for feedback interval between two auto triggered feedbacks")
|
|
990
995
|
}).describe("Master properties configuration for global survey settings");
|
|
991
996
|
|
|
992
|
-
// src/
|
|
997
|
+
// src/schemas/api/other-schema.ts
|
|
993
998
|
import { z as z10 } from "zod";
|
|
999
|
+
var deviceThemeSchema = z10.enum(["light", "dark", "system"]).describe("Enumeration of supported theme modes");
|
|
1000
|
+
var DeviceThemes = {
|
|
1001
|
+
LIGHT: "light",
|
|
1002
|
+
DARK: "dark",
|
|
1003
|
+
SYSTEM: "system"
|
|
1004
|
+
};
|
|
1005
|
+
var deviceInfoSchema = z10.object({
|
|
1006
|
+
deviceType: z10.string().describe("Type of device being used"),
|
|
1007
|
+
timezone: z10.string().describe("Device timezone (e.g., 'Asia/Calcutta')"),
|
|
1008
|
+
theme: deviceThemeSchema.describe("Current theme mode preference"),
|
|
1009
|
+
os: z10.string().describe("Operating system running on the device"),
|
|
1010
|
+
osVersion: z10.string().describe("Version of the operating system"),
|
|
1011
|
+
appVersion: z10.string().describe("Version of the application"),
|
|
1012
|
+
app: z10.string().describe("Browser or application being used"),
|
|
1013
|
+
language: z10.string().describe("Language preference (e.g., 'en-GB')")
|
|
1014
|
+
}).describe("Device information collected from the client");
|
|
1015
|
+
var sessionInfoSchema = z10.object({
|
|
1016
|
+
sessionId: z10.string().uuid().describe("Unique session identifier")
|
|
1017
|
+
}).describe("Session information for tracking user sessions");
|
|
1018
|
+
var deviceSessionInfoSchema = z10.object({
|
|
1019
|
+
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
1020
|
+
sessionInfo: sessionInfoSchema.describe("Session information")
|
|
1021
|
+
}).describe("Combined device and session information");
|
|
1022
|
+
var userPropertiesSchema = z10.object({
|
|
1023
|
+
$counter: z10.record(z10.string(), z10.number().int()).describe("Counter properties for user tracking (can be positive or negative)").optional(),
|
|
1024
|
+
$set: z10.record(z10.string(), z10.any()).describe("Properties to set for the user").optional(),
|
|
1025
|
+
$setOnce: z10.record(z10.string(), z10.any()).describe("Properties to set once for the user (won't overwrite existing values)").optional(),
|
|
1026
|
+
$unset: z10.array(z10.string()).describe("Array of property names to unset/remove from the user").optional()
|
|
1027
|
+
}).passthrough().describe("User properties including counters, set operations, and other dynamic data");
|
|
1028
|
+
var userInfoSchema = z10.object({
|
|
1029
|
+
userName: z10.string().email().describe("User's email address as username"),
|
|
1030
|
+
properties: userPropertiesSchema.describe("User properties and counters")
|
|
1031
|
+
}).describe("User information including identification and properties");
|
|
1032
|
+
|
|
1033
|
+
// src/schemas/api/submit-feedback-schema.ts
|
|
1034
|
+
import { z as z11 } from "zod";
|
|
1035
|
+
var userActionSchema = z11.enum(["V", "S"]).describe("User action: V for view, S for submit");
|
|
1036
|
+
var UserActions = {
|
|
1037
|
+
VIEW: "V",
|
|
1038
|
+
SUBMIT: "S"
|
|
1039
|
+
};
|
|
1040
|
+
var formConfigSchema = z11.object({
|
|
1041
|
+
feedbackIdentifier: z11.string().uuid().describe("Unique identifier for the feedback instance"),
|
|
1042
|
+
feedbackConfigurationId: z11.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
1043
|
+
completionTimeInSeconds: z11.number().int().min(0).describe("Time taken to complete the feedback in seconds"),
|
|
1044
|
+
userAction: userActionSchema.describe("Action performed by the user"),
|
|
1045
|
+
responseLanguageCode: z11.string().length(2).describe("Language code for the response (e.g., 'en', 'es')")
|
|
1046
|
+
}).describe("Configuration information for the feedback form");
|
|
1047
|
+
var questionResponseSchema = z11.object({
|
|
1048
|
+
questionId: z11.string().uuid().describe("Unique identifier for the question"),
|
|
1049
|
+
answer: AnswerSchema.describe("The answer provided for this question"),
|
|
1050
|
+
type: z11.string().describe("Type of the question (e.g., 'rating', 'single_choice')")
|
|
1051
|
+
}).describe("Response to a specific question in the feedback form");
|
|
1052
|
+
var responseSchema = z11.object({
|
|
1053
|
+
questions: z11.array(questionResponseSchema).min(1).describe("Array of question responses")
|
|
1054
|
+
}).describe("User responses to feedback questions");
|
|
1055
|
+
var matchedTriggerPropertiesSchema = z11.object({
|
|
1056
|
+
customEventName: z11.string().nullable().describe("Custom event name that triggered the feedback"),
|
|
1057
|
+
currentPath: z11.string().describe("Current page path where feedback was triggered"),
|
|
1058
|
+
eventType: z11.string().describe("Type of event that triggered the feedback")
|
|
1059
|
+
}).passthrough().describe("Properties of the trigger that matched for this feedback");
|
|
1060
|
+
var baseSubmitFeedbackSchema = z11.object({
|
|
1061
|
+
formConfig: formConfigSchema.describe("Form configuration information"),
|
|
1062
|
+
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
1063
|
+
sessionInfo: sessionInfoSchema.describe("Session information"),
|
|
1064
|
+
userInfo: userInfoSchema.optional().describe("User information (optional)"),
|
|
1065
|
+
matchedTriggerProperties: matchedTriggerPropertiesSchema.describe(
|
|
1066
|
+
"Properties of the matched trigger"
|
|
1067
|
+
)
|
|
1068
|
+
}).describe("Base submit feedback request schema");
|
|
1069
|
+
var viewFeedbackSchema = baseSubmitFeedbackSchema.extend({
|
|
1070
|
+
formConfig: formConfigSchema.extend({
|
|
1071
|
+
userAction: z11.literal("V").describe("Action performed by the user (view)")
|
|
1072
|
+
})
|
|
1073
|
+
}).strict().describe("View feedback request schema (no response required)");
|
|
1074
|
+
var submitFeedbackSchema = baseSubmitFeedbackSchema.extend({
|
|
1075
|
+
formConfig: formConfigSchema.extend({
|
|
1076
|
+
userAction: z11.literal("S").describe("Action performed by the user (submit)")
|
|
1077
|
+
}),
|
|
1078
|
+
response: responseSchema.describe("User responses (required for submit)")
|
|
1079
|
+
}).strict().describe("Submit feedback request schema (response required)");
|
|
1080
|
+
var feedbackRequestSchema = z11.union([
|
|
1081
|
+
viewFeedbackSchema,
|
|
1082
|
+
submitFeedbackSchema
|
|
1083
|
+
]).describe("Union schema for both view and submit feedback requests");
|
|
1084
|
+
|
|
1085
|
+
// src/schemas/api/fetch-feedback-schema.ts
|
|
1086
|
+
import { z as z12 } from "zod";
|
|
1087
|
+
var feedbackConfigurationItemSchema = z12.object({
|
|
1088
|
+
feedbackConfigurationId: z12.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
1089
|
+
feedbackTitle: z12.string().describe("Title of the feedback configuration"),
|
|
1090
|
+
duration: durationSchema.describe("Active duration for this feedback configuration"),
|
|
1091
|
+
triggerProperties: audienceTriggerPropertiesSchema.describe("Trigger properties including auto/manual settings and audience segments"),
|
|
1092
|
+
appearanceProperties: z12.object({
|
|
1093
|
+
themes: z12.object({
|
|
1094
|
+
light: z12.object({
|
|
1095
|
+
brandColor: z12.string().describe("Brand color for light theme"),
|
|
1096
|
+
overlayColor: z12.string().describe("Overlay color for light theme"),
|
|
1097
|
+
textColor: z12.string().describe("Text color for light theme"),
|
|
1098
|
+
backgroundColor: z12.string().describe("Background color for light theme")
|
|
1099
|
+
}).describe("Light theme colors"),
|
|
1100
|
+
dark: z12.object({
|
|
1101
|
+
brandColor: z12.string().describe("Brand color for dark theme"),
|
|
1102
|
+
overlayColor: z12.string().describe("Overlay color for dark theme"),
|
|
1103
|
+
textColor: z12.string().describe("Text color for dark theme"),
|
|
1104
|
+
backgroundColor: z12.string().describe("Background color for dark theme")
|
|
1105
|
+
}).describe("Dark theme colors")
|
|
1106
|
+
}).nullable().optional().describe("Theme configuration (optional)"),
|
|
1107
|
+
featureSettings: z12.object({
|
|
1108
|
+
darkOverlay: z12.boolean().describe("Whether to show dark overlay"),
|
|
1109
|
+
closeButton: z12.boolean().describe("Whether to show close button"),
|
|
1110
|
+
progressBar: z12.boolean().describe("Whether to show progress bar"),
|
|
1111
|
+
showBranding: z12.boolean().describe("Whether to show branding"),
|
|
1112
|
+
customPosition: z12.boolean().describe("Whether custom position is enabled"),
|
|
1113
|
+
customIconPosition: z12.boolean().describe("Whether custom icon position is enabled"),
|
|
1114
|
+
customCss: z12.string().nullable().optional().describe("Custom CSS link (optional)")
|
|
1115
|
+
}).describe("Feature settings for the feedback form"),
|
|
1116
|
+
selectedIconPosition: z12.string().describe("Selected position for the feedback icon"),
|
|
1117
|
+
selectedPosition: z12.string().describe("Selected position for the feedback form")
|
|
1118
|
+
}).describe("Appearance properties for the feedback form")
|
|
1119
|
+
}).describe("Individual feedback configuration item in the list");
|
|
1120
|
+
var fetchFormConfigSchema = z12.object({
|
|
1121
|
+
feedbackConfigurationId: z12.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
1122
|
+
responseLanguageCode: z12.string().length(2).describe("Language code for the response (e.g., 'en', 'es')")
|
|
1123
|
+
}).describe("Form configuration for fetching feedback details");
|
|
1124
|
+
var fetchConfigurationListSchema = z12.object({
|
|
1125
|
+
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
1126
|
+
sessionInfo: sessionInfoSchema.describe("Session information"),
|
|
1127
|
+
userInfo: userInfoSchema.optional().describe("User information (optional)")
|
|
1128
|
+
}).strict().describe("Request schema for fetching available feedback configurations");
|
|
1129
|
+
var fetchFeedbackDetailsSchema = z12.object({
|
|
1130
|
+
formConfig: fetchFormConfigSchema.describe("Form configuration for the specific feedback"),
|
|
1131
|
+
deviceInfo: deviceInfoSchema.describe("Device information"),
|
|
1132
|
+
sessionInfo: sessionInfoSchema.describe("Session information"),
|
|
1133
|
+
userInfo: userInfoSchema.optional().describe("User information (optional)")
|
|
1134
|
+
}).strict().describe("Request schema for fetching specific feedback form details");
|
|
1135
|
+
var formConfigurationResponseSchema = z12.object({
|
|
1136
|
+
formTitle: z12.string().describe("Title of the feedback form"),
|
|
1137
|
+
formDescription: z12.string().describe("Description of the feedback form")
|
|
1138
|
+
}).describe("Form configuration response with title and description");
|
|
1139
|
+
var questionnaireFieldsResponseSchema = z12.object({
|
|
1140
|
+
questions: z12.record(z12.string(), combinedQuestionSchema).describe("Collection of questions keyed by their string identifiers"),
|
|
1141
|
+
sections: z12.array(sectionSchema).describe("Array of sections that organize questions into logical groups"),
|
|
1142
|
+
translations: z12.record(z12.string(), z12.any()).describe("Translations object (can be empty or contain language-specific translations)"),
|
|
1143
|
+
selectedLanguages: LanguagesSchema.describe("Array of languages selected for this questionnaire")
|
|
1144
|
+
}).describe("Questionnaire fields response including questions, sections, translations, and selected languages");
|
|
1145
|
+
var fetchFeedbackDetailsResponseSchema = z12.object({
|
|
1146
|
+
feedbackConfigurationId: z12.string().uuid().describe("Unique identifier for the feedback configuration"),
|
|
1147
|
+
feedbackIdentifier: z12.string().uuid().describe("Unique identifier for this specific feedback instance"),
|
|
1148
|
+
formConfiguration: formConfigurationResponseSchema.describe("Form configuration with title and description"),
|
|
1149
|
+
questionnaireFields: questionnaireFieldsResponseSchema.describe("Questionnaire structure including questions, sections, translations, and languages"),
|
|
1150
|
+
otherConfigurationProperties: otherConfigurationPropertiesSchema.describe("Other configuration properties using existing schema"),
|
|
1151
|
+
welcomeScreenProperties: welcomeScreenPropertiesSchema.describe("Welcome screen properties using existing schema"),
|
|
1152
|
+
endScreenProperties: endScreenPropertiesSchema.describe("End screen properties using existing schema")
|
|
1153
|
+
}).strict().describe("Complete response schema for fetchFeedbackDetails API using existing field schemas");
|
|
1154
|
+
var fetchConfigurationListResponseSchema = z12.object({
|
|
1155
|
+
masterProperties: masterPropertiesSchema.describe("Master properties for global survey settings"),
|
|
1156
|
+
feedbackConfiguration: z12.array(feedbackConfigurationItemSchema).describe("Array of available feedback configurations")
|
|
1157
|
+
}).strict().describe("Response schema for fetchConfigurationList API");
|
|
1158
|
+
|
|
1159
|
+
// src/index.ts
|
|
1160
|
+
import { z as z13 } from "zod";
|
|
994
1161
|
export {
|
|
995
1162
|
AnswerSchema,
|
|
996
1163
|
ChoiceAnswerSchema,
|
|
997
1164
|
ChoiceOrderOptions,
|
|
998
1165
|
ContinuousSumAnswerSchema,
|
|
1166
|
+
DeviceThemes,
|
|
999
1167
|
DismissBehaviors,
|
|
1000
1168
|
EndFieldsTranslationSchema,
|
|
1001
1169
|
EndScreenFieldsSchema,
|
|
@@ -1020,6 +1188,7 @@ export {
|
|
|
1020
1188
|
TextAnswerSchema,
|
|
1021
1189
|
ThemeModes,
|
|
1022
1190
|
TranslationProvider,
|
|
1191
|
+
UserActions,
|
|
1023
1192
|
ValidationRuleTypes,
|
|
1024
1193
|
VisibilityConditionOperators,
|
|
1025
1194
|
WelcomeFieldsTranslationSchema,
|
|
@@ -1030,6 +1199,7 @@ export {
|
|
|
1030
1199
|
appearancePropertiesSchema,
|
|
1031
1200
|
audienceSegmentSchema,
|
|
1032
1201
|
audienceTriggerPropertiesSchema,
|
|
1202
|
+
baseSubmitFeedbackSchema,
|
|
1033
1203
|
categorySpecificFiltersSchema,
|
|
1034
1204
|
choiceOrderOptionSchema,
|
|
1035
1205
|
combinedQuestionSchema,
|
|
@@ -1039,18 +1209,32 @@ export {
|
|
|
1039
1209
|
createTranslationProvider,
|
|
1040
1210
|
customEventFieldOperatorSchema,
|
|
1041
1211
|
customEventFieldSchema,
|
|
1212
|
+
deviceInfoSchema,
|
|
1213
|
+
deviceSessionInfoSchema,
|
|
1214
|
+
deviceThemeSchema,
|
|
1042
1215
|
dismissBehaviorSchema,
|
|
1216
|
+
durationSchema,
|
|
1043
1217
|
endScreenPropertiesSchema,
|
|
1044
1218
|
externalPublishingPropertiesSchema,
|
|
1045
1219
|
featureSettingsSchema,
|
|
1220
|
+
feedbackConfigurationItemSchema,
|
|
1046
1221
|
feedbackConfigurationSchema,
|
|
1222
|
+
feedbackRequestSchema,
|
|
1223
|
+
fetchConfigurationListResponseSchema,
|
|
1224
|
+
fetchConfigurationListSchema,
|
|
1225
|
+
fetchFeedbackDetailsResponseSchema,
|
|
1226
|
+
fetchFeedbackDetailsSchema,
|
|
1227
|
+
fetchFormConfigSchema,
|
|
1047
1228
|
filterConditionSchema,
|
|
1229
|
+
formConfigSchema,
|
|
1230
|
+
formConfigurationResponseSchema,
|
|
1048
1231
|
formPropertiesSchema,
|
|
1049
1232
|
frequencyAndSchedulingPropertiesSchema,
|
|
1050
1233
|
languageTranslationsSchema,
|
|
1051
1234
|
longAnswerQuestionSchema,
|
|
1052
1235
|
longAnswerTranslationsSchema,
|
|
1053
1236
|
masterPropertiesSchema,
|
|
1237
|
+
matchedTriggerPropertiesSchema,
|
|
1054
1238
|
multipleChoiceDisplayStyleSchema,
|
|
1055
1239
|
multipleChoiceMultipleDisplayStyleSchema,
|
|
1056
1240
|
multipleChoiceMultipleQuestionSchema,
|
|
@@ -1066,19 +1250,24 @@ export {
|
|
|
1066
1250
|
publicationStatusSchema,
|
|
1067
1251
|
queryOutputSchema,
|
|
1068
1252
|
questionOptionSchema,
|
|
1253
|
+
questionResponseSchema,
|
|
1069
1254
|
questionSchema,
|
|
1070
1255
|
questionStatusSchema,
|
|
1071
1256
|
questionTranslationsSchema,
|
|
1072
1257
|
questionTypeSchema,
|
|
1258
|
+
questionnaireFieldsResponseSchema,
|
|
1073
1259
|
ratingDisplayStyleSchema,
|
|
1074
1260
|
ratingQuestionSchema,
|
|
1075
1261
|
ratingRepresentationSizeSchema,
|
|
1076
1262
|
ratingTranslationsSchema,
|
|
1077
1263
|
recurringUnitSchema,
|
|
1264
|
+
responseSchema,
|
|
1078
1265
|
sectionSchema,
|
|
1266
|
+
sessionInfoSchema,
|
|
1079
1267
|
shortAnswerQuestionSchema,
|
|
1080
1268
|
shortAnswerTranslationsSchema,
|
|
1081
1269
|
singleChoiceTranslationsSchema,
|
|
1270
|
+
submitFeedbackSchema,
|
|
1082
1271
|
surveyTypeSchema,
|
|
1083
1272
|
themeColorsSchema,
|
|
1084
1273
|
themeConfigurationSchema,
|
|
@@ -1087,12 +1276,16 @@ export {
|
|
|
1087
1276
|
translationEntrySchema,
|
|
1088
1277
|
translationsSchema,
|
|
1089
1278
|
triggerActionSchema,
|
|
1279
|
+
userActionSchema,
|
|
1280
|
+
userInfoSchema,
|
|
1281
|
+
userPropertiesSchema,
|
|
1090
1282
|
validationRuleSchema,
|
|
1091
1283
|
validationRuleTypeSchema,
|
|
1284
|
+
viewFeedbackSchema,
|
|
1092
1285
|
visibilityConditionSchema,
|
|
1093
1286
|
welcomeScreenPropertiesSchema,
|
|
1094
1287
|
whoSchema,
|
|
1095
1288
|
yesNoSchema,
|
|
1096
|
-
|
|
1289
|
+
z13 as z
|
|
1097
1290
|
};
|
|
1098
1291
|
//# sourceMappingURL=index.js.map
|