@encatch/schema 1.3.0-beta.4 → 1.3.0-beta.5

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
@@ -2361,8 +2361,10 @@ var formConfigSchema = z13.object({
2361
2361
  }).describe("Configuration information for the feedback form");
2362
2362
  var questionResponseSchema = z13.object({
2363
2363
  questionId: z13.string().uuid().describe("Unique identifier for the question"),
2364
- answer: AnswerSchema.describe("The answer provided for this question"),
2365
- type: z13.string().describe("Type of the question (e.g., 'rating', 'single_choice')"),
2364
+ answer: AnswerSchema.nullable().optional().describe(
2365
+ "The answer provided for this question; null for display-only types (thank_you, welcome, exit_form) or unanswered questions on the respondent's path"
2366
+ ),
2367
+ type: z13.string().optional().describe("Type of the question (e.g., 'rating', 'single_choice')"),
2366
2368
  error: z13.string().optional().describe("Error message if any validation failed"),
2367
2369
  isOnPath: z13.boolean().optional().describe(
2368
2370
  "When present, whether this question was on the respondent's navigation path (e.g. logic jumps); false for questions not reached"
@@ -2405,6 +2407,26 @@ var submitFeedbackSchema = baseSubmitFeedbackSchema.extend({
2405
2407
  response: responseSchema.describe("User responses (required for full submit)")
2406
2408
  }).describe("Full submit feedback request schema (response required)");
2407
2409
  var feedbackRequestSchema = z13.union([partialFeedbackSchema, submitFeedbackSchema]).describe("Union schema for both partial and full feedback submissions");
2410
+ var formDetailsSchema = z13.object({
2411
+ formConfigurationId: z13.string().uuid().describe("Server-issued configuration ID for this form"),
2412
+ feedbackIdentifier: z13.string().optional().describe("Instance identifier for the feedback session"),
2413
+ responseLanguageCode: z13.string().optional().describe("Two-letter language code for the response (e.g., 'en')"),
2414
+ isPartialSubmit: z13.boolean().optional().describe("When true, marks this as a partial (mid-journey) submission"),
2415
+ completionTimeInSeconds: z13.number().int().min(0).optional().describe("Total time taken to complete the form in seconds"),
2416
+ response: z13.object({
2417
+ questions: z13.array(questionResponseSchema).optional().describe("Array of per-question responses"),
2418
+ context: z13.record(z13.string(), z13.unknown()).optional().describe("Liquid variable substitution values from the showForm context option"),
2419
+ contact: z13.record(z13.string(), z13.unknown()).optional().describe("Contact properties from the server for Liquid substitution"),
2420
+ sourceTrackingFieldValues: z13.record(z13.string(), z13.string()).optional().describe("Source tracking field values captured at survey load time")
2421
+ }).optional().describe("User responses to the form questions"),
2422
+ visitedQuestionIds: z13.array(z13.string()).optional().describe("Ordered list of question IDs the respondent actually navigated to"),
2423
+ context: z13.record(z13.string(), z13.union([z13.string(), z13.number(), z13.boolean()])).optional().describe("Caller-provided metadata attached to this submission")
2424
+ }).describe("Form details for an SDK-style submit-form request");
2425
+ var submitFormRequestSchema = z13.object({
2426
+ triggerType: z13.enum(["automatic", "manual"]).optional().describe("Whether the form was triggered automatically or manually"),
2427
+ formDetails: formDetailsSchema.describe("Core submission payload"),
2428
+ $deviceInfo: z13.record(z13.string(), z13.unknown()).optional().describe("Device and SDK metadata automatically injected by the SDK")
2429
+ }).describe("Complete submit-form request envelope (SDK-facing contract)");
2408
2430
 
2409
2431
  // src/schemas/api/fetch-feedback-schema.ts
2410
2432
  import { z as z14 } from "zod";
@@ -2749,6 +2771,7 @@ export {
2749
2771
  focalPointSchema,
2750
2772
  formConfigSchema,
2751
2773
  formConfigurationResponseSchema,
2774
+ formDetailsSchema,
2752
2775
  formPropertiesSchema,
2753
2776
  gradientAttachmentSchema,
2754
2777
  imageAttachmentSchema,
@@ -2840,6 +2863,7 @@ export {
2840
2863
  splitLayoutSchema,
2841
2864
  stackLayoutSchema,
2842
2865
  submitFeedbackSchema,
2866
+ submitFormRequestSchema,
2843
2867
  thankYouQuestionSchema,
2844
2868
  thankYouQuestionTranslationSchema,
2845
2869
  themeColorsSchema,