@encatch/schema 1.2.0-beta.2 → 1.2.0-beta.4

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 CHANGED
@@ -930,12 +930,12 @@ var csatQuestionSchema = questionSchema.extend({
930
930
  scale: csatScaleSchema.optional().default(5).describe("Number of response points (2\u20135); 2 and 4 have no neutral option, default is 5"),
931
931
  displayStyle: csatDisplayStyleSchema.optional().default("emoji").describe("How response options are rendered \u2014 emoji faces (default) or text buttons"),
932
932
  multicolor: z2.boolean().optional().default(false).describe("Whether to apply distinct colors to negative, neutral, and positive segments"),
933
- negativeColor: z2.string().max(50).optional().describe("Color for negative response options (semantic values -2, -1); any valid CSS color; used when multicolor is true"),
934
- neutralColor: z2.string().max(50).optional().describe("Color for the neutral response option (semantic value 0); any valid CSS color; used when multicolor is true"),
935
- positiveColor: z2.string().max(50).optional().describe("Color for positive response options (semantic values 1, 2); any valid CSS color; used when multicolor is true"),
933
+ negativeColor: z2.string().max(50).optional().describe("Color for negative response options (lower half of scale); any valid CSS color; used when multicolor is true"),
934
+ neutralColor: z2.string().max(50).optional().describe("Color for the neutral midpoint option (odd scales only: scale 3 = value 2, scale 5 = value 3); any valid CSS color; used when multicolor is true"),
935
+ positiveColor: z2.string().max(50).optional().describe("Color for positive response options (upper half of scale); any valid CSS color; used when multicolor is true"),
936
936
  showLabels: z2.boolean().optional().default(false).describe("Whether to render per-point labels below each response option"),
937
- scaleLabels: z2.record(z2.string(), z2.string().max(100)).optional().describe("Per-point label text keyed by semantic value string ('-2', '-1', '0', '1', '2')")
938
- }).describe("Schema for a CSAT (Customer Satisfaction Score) question using a 2\u20135 point semantic scale");
937
+ scaleLabels: z2.record(z2.string(), z2.string().max(100)).optional().describe("Per-point label text keyed by value string ('1'\u2013'5'); keys must match the chosen scale size")
938
+ }).describe("Schema for a CSAT (Customer Satisfaction Score) question using an industry-standard 1-to-N positive scale (N = 2\u20135)");
939
939
  var opinionScaleQuestionSchema = questionSchema.extend({
940
940
  type: z2.literal("opinion_scale").describe("Must be exactly 'opinion_scale'"),
941
941
  startValue: z2.union([z2.literal(0), z2.literal(1)]).optional().default(0).describe("Starting value of the scale \u2014 0 (default) or 1"),
@@ -1185,23 +1185,29 @@ var QnaWithAiPairSchema = z3.object({
1185
1185
  answer: z3.string().describe("The AI-generated answer based on the knowledge base")
1186
1186
  }).describe("A single Q&A exchange between the respondent and the AI");
1187
1187
  var QnaWithAiAnswerSchema = z3.array(QnaWithAiPairSchema).describe("Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session");
1188
- var SchedulerAnswerSchema = z3.object({
1189
- provider: z3.enum(["google_calendar", "calendly"]).describe("The calendar integration used to make the booking"),
1190
- slotStart: z3.string().describe("ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')"),
1191
- slotEnd: z3.string().describe("ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')"),
1192
- eventId: z3.string().optional().describe("Calendar event ID (Google Calendar) or Calendly event UUID"),
1193
- bookedAt: z3.string().describe("ISO 8601 datetime when the respondent completed the booking")
1194
- }).describe("Answer for a scheduler question");
1188
+ var SchedulerAnswerSchema = z3.discriminatedUnion("provider", [
1189
+ z3.object({
1190
+ provider: z3.literal("google_calendar").describe("The calendar integration used to make the booking"),
1191
+ bookedAt: z3.string().describe("Unix timestamp in seconds as a string when the respondent confirmed the booking")
1192
+ }),
1193
+ z3.object({
1194
+ provider: z3.literal("calendly").describe("The calendar integration used to make the booking"),
1195
+ slotStart: z3.string().describe("ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')"),
1196
+ slotEnd: z3.string().describe("ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')"),
1197
+ eventId: z3.string().optional().describe("Calendly event UUID"),
1198
+ bookedAt: z3.string().describe("Unix timestamp in seconds as a string when the respondent completed the booking")
1199
+ })
1200
+ ]).describe("Answer for a scheduler question");
1195
1201
  var AnswerItemSchema = z3.object({
1196
1202
  nps: z3.number().optional().describe("Net Promoter Score value (e.g., 0-10)"),
1197
1203
  nestedSelection: z3.array(z3.string()).optional().describe("Array of selected nested option IDs"),
1198
1204
  longText: z3.string().optional().describe("Long text answer, e.g., paragraph or essay"),
1199
1205
  shortAnswer: z3.string().optional().describe("Short text answer, e.g., single sentence or word"),
1200
- singleChoice: z3.string().optional().describe("single selected option ID (for single choice questions)"),
1206
+ singleChoice: z3.string().optional().describe("Single selected option value for single choice questions"),
1201
1207
  rating: z3.number().optional().describe("Star rating value (e.g., 1-5)"),
1202
1208
  yesNo: z3.boolean().optional().describe("Yes/no answer for yes_no questions (true = Yes, false = No)"),
1203
1209
  consent: z3.boolean().optional().describe("Consent answer for consent questions (true = checked/agreed, false = unchecked)"),
1204
- multipleChoiceMultiple: z3.array(z3.string()).optional().describe("Array of selected option IDs for multiple choice questions"),
1210
+ multipleChoiceMultiple: z3.array(z3.string()).optional().describe("Array of selected option values for multiple choice questions"),
1205
1211
  singleChoiceOther: z3.string().optional().describe('Free-text "other" answer for single choice questions when allowOther is enabled'),
1206
1212
  multipleChoiceOther: z3.string().optional().describe('Free-text "other" answer for multiple choice questions when allowOther is enabled'),
1207
1213
  annotation: AnnotationSchema.optional().describe(
@@ -1222,15 +1228,14 @@ var AnswerItemSchema = z3.object({
1222
1228
  // Date question
1223
1229
  date: z3.string().optional().describe("Answer for a date question; ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM)"),
1224
1230
  // CSAT question
1225
- csat: z3.number().optional().describe("Answer for a CSAT question; semantic value: -2, -1, 0, 1, or 2"),
1231
+ csat: z3.number().optional().describe("Answer for a CSAT question; industry-standard value: 1 (lowest/worst) to N (highest/best) where N is the scale size (2\u20135)"),
1226
1232
  // Opinion scale question
1227
1233
  opinionScale: z3.number().optional().describe("Answer for an opinion scale question; the selected numeric value on the scale"),
1228
- // Ranking question — ordered array of option IDs; index 0 = rank 1
1229
- ranking: z3.array(z3.string()).optional().describe("Answer for a ranking question; ordered array of option IDs where index 0 is rank 1"),
1230
- // Picture choice — single selection
1231
- pictureChoice: z3.string().optional().describe("Answer for a picture choice question (single selection); the selected option ID"),
1232
- // Picture choice multiple selection
1233
- pictureChoiceMultiple: z3.array(z3.string()).optional().describe("Answer for a picture choice question (multiple selection); array of selected option IDs"),
1234
+ // Ranking question — ordered array of option values; index 0 = rank 1
1235
+ ranking: z3.array(z3.string()).optional().describe("Answer for a ranking question; ordered array of option values where index 0 is rank 1"),
1236
+ // Picture choice — always an array of selected option values (single selection = one-element array)
1237
+ pictureChoice: z3.array(z3.string()).optional().describe("Answer for a picture choice question; array of selected option values (single selection produces a one-element array)"),
1238
+ pictureChoiceOther: z3.string().optional().describe('Free-text "other" answer for picture choice questions when allowOther is enabled'),
1234
1239
  // Signature question
1235
1240
  signature: SignatureAnswerSchema.optional().describe("Answer for a signature question"),
1236
1241
  // File upload question
@@ -1238,7 +1243,7 @@ var AnswerItemSchema = z3.object({
1238
1243
  // Email question
1239
1244
  email: z3.string().optional().describe("Answer for an email question; the submitted email address"),
1240
1245
  // Number question
1241
- number: z3.number().optional().describe("Answer for a number question; the submitted numeric value"),
1246
+ number: z3.string().optional().describe("Answer for a number question; the submitted numeric value as a string"),
1242
1247
  // Website question
1243
1248
  website: z3.string().optional().describe("Answer for a website question; the submitted URL"),
1244
1249
  // Phone number question
@@ -1799,8 +1804,11 @@ var fetchFeedbackDetailsSchema = z13.object({
1799
1804
  }).strict().describe("Request schema for fetching specific feedback form details");
1800
1805
  var formConfigurationResponseSchema = z13.object({
1801
1806
  formTitle: z13.string().describe("Title of the feedback form"),
1802
- formDescription: z13.string().describe("Description of the feedback form")
1803
- }).describe("Form configuration response with title and description");
1807
+ formDescription: z13.string().describe("Description of the feedback form"),
1808
+ respondentsCount: z13.number().int().min(0).optional().describe(
1809
+ "Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the welcome badge"
1810
+ )
1811
+ }).describe("Form configuration response with title, description, and optional respondent count");
1804
1812
  var logicJumpRuleSchema = z13.object({
1805
1813
  jsonLogic: z13.record(z13.string(), z13.unknown()).describe("JSON Logic expression to evaluate"),
1806
1814
  targetQuestionId: z13.string().describe("Question ID to navigate to when this rule matches")
@@ -1832,7 +1840,7 @@ var fetchFeedbackDetailsResponseSchema = z13.object({
1832
1840
  feedbackConfigurationId: z13.string().uuid().describe("Unique identifier for the feedback configuration"),
1833
1841
  feedbackIdentifier: z13.string().uuid().describe("Unique identifier for this specific feedback instance"),
1834
1842
  formConfiguration: formConfigurationResponseSchema.describe(
1835
- "Form configuration with title and description"
1843
+ "Form configuration including title, description, and optional respondent count for the welcome badge"
1836
1844
  ),
1837
1845
  questionnaireFields: questionnaireFieldsResponseSchema.describe(
1838
1846
  "Questionnaire structure including questions, sections, translations, and languages"
@@ -1842,8 +1850,7 @@ var fetchFeedbackDetailsResponseSchema = z13.object({
1842
1850
  ),
1843
1851
  appearanceProperties: appearancePropertiesSchema.describe(
1844
1852
  "Appearance properties including theme configuration"
1845
- ),
1846
- respondentsCount: z13.number().int().min(0).optional().describe("Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the badge")
1853
+ )
1847
1854
  }).strict().describe(
1848
1855
  "Complete response schema for fetchFeedbackDetails API using existing field schemas"
1849
1856
  );