@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.
@@ -10,7 +10,7 @@ export { platformCompletionCtaSchema, completionCtaSecondarySchema, completionCt
10
10
  export { customEventFieldOperatorSchema, customEventFieldSchema, conditionalIfMetadataSchema, queryOutputSchema, conditionalIfSchema, triggerActionSchema, conditionalWhenSchema, filterConditionSchema, categorySpecificFiltersSchema, whoSchema, audienceSegmentSchema, audienceTriggerPropertiesSchema, type CustomEventFieldOperator, type CustomEventField, type ConditionalIfMetadata, type QueryOutput, type ConditionalIf, type TriggerAction, type ConditionalWhen, type FilterCondition, type CategorySpecificFilters, type Who, type AudienceSegment, type AudienceTriggerProperties, } from "./schemas/fields/auto-trigger-schema";
11
11
  export { masterPropertiesSchema, type MasterProperties, } from "./schemas/fields/other-properties-schema";
12
12
  export { deviceThemeSchema, deviceInfoSchema, sessionInfoSchema, deviceSessionInfoSchema, userPropertiesSchema, userInfoSchema, DeviceThemes, type DeviceTheme, type DeviceInfo, type SessionInfo, type DeviceSessionInfo, type UserProperties, type UserInfo, } from "./schemas/api/other-schema";
13
- export { formConfigSchema, questionResponseSchema, responseSchema, matchedTriggerPropertiesSchema, baseSubmitFeedbackSchema, partialFeedbackSchema, submitFeedbackSchema, feedbackRequestSchema, type FormConfig, type QuestionResponse, type Response, type MatchedTriggerProperties, type BaseSubmitFeedback, type PartialFeedback, type SubmitFeedback, type FeedbackRequest, } from "./schemas/api/submit-feedback-schema";
13
+ export { formConfigSchema, questionResponseSchema, responseSchema, matchedTriggerPropertiesSchema, baseSubmitFeedbackSchema, partialFeedbackSchema, submitFeedbackSchema, feedbackRequestSchema, formDetailsSchema, submitFormRequestSchema, type FormConfig, type QuestionResponse, type Response, type MatchedTriggerProperties, type BaseSubmitFeedback, type PartialFeedback, type SubmitFeedback, type FeedbackRequest, type FormDetails, type FormDetailsResponse, type SubmitFormRequest, } from "./schemas/api/submit-feedback-schema";
14
14
  export { feedbackConfigurationItemSchema, fetchFormConfigSchema, fetchConfigurationListSchema, fetchFeedbackDetailsSchema, formConfigurationResponseSchema, questionnaireFieldsResponseSchema, fetchFeedbackDetailsResponseSchema, fetchConfigurationListResponseSchema, logicJumpRuleSchema, logicJumpRulesSchema, type FeedbackConfigurationItem, type FetchFormConfig, type FetchConfigurationListRequest, type FetchFeedbackDetailsRequest, type FormConfigurationResponse, type QuestionnaireFieldsResponse, type FetchFeedbackDetailsResponse, type FetchConfigurationListResponse, type LogicJumpRule, type LogicJumpRules, } from "./schemas/api/fetch-feedback-schema";
15
15
  export { RefineTextParams, RefineTextResponse, RefineTextData, refineTextDataSchema, refineTextParamsSchema, refineTextResponseSchema, } from "./schemas/api/refine-text-schema";
16
16
  export { objectToCamel, objectToSnake, toSnake, toCamel, toPascal, objectToPascal, } from "./helpers/case-convert-helper";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Compile-time helpers used to guarantee that the hand-authored, Zod-free
3
+ * public interfaces stay in lock-step with their Zod `z.infer` counterparts.
4
+ *
5
+ * These are pure type-level utilities — they emit no runtime code and are never
6
+ * re-exported from the package entrypoint, so they never leak into consumer
7
+ * (SDK) type bundles.
8
+ */
9
+ /** True when `A` and `B` are mutually assignable (tuple-wrapped to avoid union distribution). */
10
+ export type MutuallyAssignable<A, B> = [A] extends [B] ? [B] extends [A] ? true : false : false;
11
+ /** True when `A` and `B` expose the exact same set of top-level keys. */
12
+ export type SameKeys<A, B> = [keyof A] extends [keyof B] ? [keyof B] extends [keyof A] ? true : false : false;
13
+ /**
14
+ * True when interface `I` is a faithful, drift-free representation of schema
15
+ * type `S` — i.e. structurally interchangeable AND with an identical key set.
16
+ */
17
+ export type MatchesSchema<I, S> = MutuallyAssignable<I, S> extends true ? SameKeys<I, S> extends true ? true : false : false;
18
+ /** Compiles only when `T` is exactly `true`; otherwise raises a type error. */
19
+ export type AssertTrue<T extends true> = T;
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import type { Answer } from "../fields/answer-schema";
2
3
  export declare const formConfigSchema: z.ZodObject<{
3
4
  feedbackIdentifier: z.ZodString;
4
5
  feedbackConfigurationId: z.ZodString;
@@ -8,7 +9,7 @@ export declare const formConfigSchema: z.ZodObject<{
8
9
  }, z.core.$strip>;
9
10
  export declare const questionResponseSchema: z.ZodObject<{
10
11
  questionId: z.ZodString;
11
- answer: z.ZodObject<{
12
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12
13
  nps: z.ZodOptional<z.ZodNumber>;
13
14
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
15
  longText: z.ZodOptional<z.ZodString>;
@@ -107,8 +108,8 @@ export declare const questionResponseSchema: z.ZodObject<{
107
108
  upiIntentUri: z.ZodOptional<z.ZodString>;
108
109
  selfReported: z.ZodLiteral<true>;
109
110
  }, z.core.$strip>>;
110
- }, z.core.$strip>;
111
- type: z.ZodString;
111
+ }, z.core.$strip>>>;
112
+ type: z.ZodOptional<z.ZodString>;
112
113
  error: z.ZodOptional<z.ZodString>;
113
114
  isOnPath: z.ZodOptional<z.ZodBoolean>;
114
115
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -117,7 +118,7 @@ export declare const questionResponseSchema: z.ZodObject<{
117
118
  export declare const responseSchema: z.ZodObject<{
118
119
  questions: z.ZodArray<z.ZodObject<{
119
120
  questionId: z.ZodString;
120
- answer: z.ZodObject<{
121
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
121
122
  nps: z.ZodOptional<z.ZodNumber>;
122
123
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
124
  longText: z.ZodOptional<z.ZodString>;
@@ -216,8 +217,8 @@ export declare const responseSchema: z.ZodObject<{
216
217
  upiIntentUri: z.ZodOptional<z.ZodString>;
217
218
  selfReported: z.ZodLiteral<true>;
218
219
  }, z.core.$strip>>;
219
- }, z.core.$strip>;
220
- type: z.ZodString;
220
+ }, z.core.$strip>>>;
221
+ type: z.ZodOptional<z.ZodString>;
221
222
  error: z.ZodOptional<z.ZodString>;
222
223
  isOnPath: z.ZodOptional<z.ZodBoolean>;
223
224
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -317,7 +318,7 @@ export declare const partialFeedbackSchema: z.ZodObject<{
317
318
  response: z.ZodOptional<z.ZodObject<{
318
319
  questions: z.ZodArray<z.ZodObject<{
319
320
  questionId: z.ZodString;
320
- answer: z.ZodObject<{
321
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
321
322
  nps: z.ZodOptional<z.ZodNumber>;
322
323
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
323
324
  longText: z.ZodOptional<z.ZodString>;
@@ -416,8 +417,8 @@ export declare const partialFeedbackSchema: z.ZodObject<{
416
417
  upiIntentUri: z.ZodOptional<z.ZodString>;
417
418
  selfReported: z.ZodLiteral<true>;
418
419
  }, z.core.$strip>>;
419
- }, z.core.$strip>;
420
- type: z.ZodString;
420
+ }, z.core.$strip>>>;
421
+ type: z.ZodOptional<z.ZodString>;
421
422
  error: z.ZodOptional<z.ZodString>;
422
423
  isOnPath: z.ZodOptional<z.ZodBoolean>;
423
424
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -470,7 +471,7 @@ export declare const submitFeedbackSchema: z.ZodObject<{
470
471
  response: z.ZodObject<{
471
472
  questions: z.ZodArray<z.ZodObject<{
472
473
  questionId: z.ZodString;
473
- answer: z.ZodObject<{
474
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
474
475
  nps: z.ZodOptional<z.ZodNumber>;
475
476
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
476
477
  longText: z.ZodOptional<z.ZodString>;
@@ -569,8 +570,8 @@ export declare const submitFeedbackSchema: z.ZodObject<{
569
570
  upiIntentUri: z.ZodOptional<z.ZodString>;
570
571
  selfReported: z.ZodLiteral<true>;
571
572
  }, z.core.$strip>>;
572
- }, z.core.$strip>;
573
- type: z.ZodString;
573
+ }, z.core.$strip>>>;
574
+ type: z.ZodOptional<z.ZodString>;
574
575
  error: z.ZodOptional<z.ZodString>;
575
576
  isOnPath: z.ZodOptional<z.ZodBoolean>;
576
577
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -623,7 +624,7 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
623
624
  response: z.ZodOptional<z.ZodObject<{
624
625
  questions: z.ZodArray<z.ZodObject<{
625
626
  questionId: z.ZodString;
626
- answer: z.ZodObject<{
627
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
627
628
  nps: z.ZodOptional<z.ZodNumber>;
628
629
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
629
630
  longText: z.ZodOptional<z.ZodString>;
@@ -722,8 +723,8 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
722
723
  upiIntentUri: z.ZodOptional<z.ZodString>;
723
724
  selfReported: z.ZodLiteral<true>;
724
725
  }, z.core.$strip>>;
725
- }, z.core.$strip>;
726
- type: z.ZodString;
726
+ }, z.core.$strip>>>;
727
+ type: z.ZodOptional<z.ZodString>;
727
728
  error: z.ZodOptional<z.ZodString>;
728
729
  isOnPath: z.ZodOptional<z.ZodBoolean>;
729
730
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -775,7 +776,7 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
775
776
  response: z.ZodObject<{
776
777
  questions: z.ZodArray<z.ZodObject<{
777
778
  questionId: z.ZodString;
778
- answer: z.ZodObject<{
779
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
779
780
  nps: z.ZodOptional<z.ZodNumber>;
780
781
  nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
781
782
  longText: z.ZodOptional<z.ZodString>;
@@ -874,8 +875,8 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
874
875
  upiIntentUri: z.ZodOptional<z.ZodString>;
875
876
  selfReported: z.ZodLiteral<true>;
876
877
  }, z.core.$strip>>;
877
- }, z.core.$strip>;
878
- type: z.ZodString;
878
+ }, z.core.$strip>>>;
879
+ type: z.ZodOptional<z.ZodString>;
879
880
  error: z.ZodOptional<z.ZodString>;
880
881
  isOnPath: z.ZodOptional<z.ZodBoolean>;
881
882
  timeSpentMs: z.ZodOptional<z.ZodNumber>;
@@ -883,11 +884,299 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
883
884
  }, z.core.$strip>>;
884
885
  }, z.core.$strip>;
885
886
  }, z.core.$strip>]>;
887
+ export declare const formDetailsSchema: z.ZodObject<{
888
+ formConfigurationId: z.ZodString;
889
+ feedbackIdentifier: z.ZodOptional<z.ZodString>;
890
+ responseLanguageCode: z.ZodOptional<z.ZodString>;
891
+ isPartialSubmit: z.ZodOptional<z.ZodBoolean>;
892
+ completionTimeInSeconds: z.ZodOptional<z.ZodNumber>;
893
+ response: z.ZodOptional<z.ZodObject<{
894
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
895
+ questionId: z.ZodString;
896
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
897
+ nps: z.ZodOptional<z.ZodNumber>;
898
+ nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
899
+ longText: z.ZodOptional<z.ZodString>;
900
+ shortAnswer: z.ZodOptional<z.ZodString>;
901
+ singleChoice: z.ZodOptional<z.ZodString>;
902
+ rating: z.ZodOptional<z.ZodNumber>;
903
+ yesNo: z.ZodOptional<z.ZodBoolean>;
904
+ consent: z.ZodOptional<z.ZodBoolean>;
905
+ multipleChoiceMultiple: z.ZodOptional<z.ZodArray<z.ZodString>>;
906
+ singleChoiceOther: z.ZodOptional<z.ZodString>;
907
+ multipleChoiceOther: z.ZodOptional<z.ZodString>;
908
+ annotation: z.ZodOptional<z.ZodObject<{
909
+ fileType: z.ZodString;
910
+ fileName: z.ZodString;
911
+ markers: z.ZodArray<z.ZodObject<{
912
+ markerNo: z.ZodString;
913
+ timeline: z.ZodString;
914
+ comment: z.ZodString;
915
+ }, z.core.$strip>>;
916
+ }, z.core.$strip>>;
917
+ ratingMatrix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
918
+ matrixSingleChoice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
919
+ matrixMultipleChoice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
920
+ others: z.ZodOptional<z.ZodString>;
921
+ date: z.ZodOptional<z.ZodString>;
922
+ csat: z.ZodOptional<z.ZodNumber>;
923
+ opinionScale: z.ZodOptional<z.ZodNumber>;
924
+ ranking: z.ZodOptional<z.ZodArray<z.ZodString>>;
925
+ pictureChoice: z.ZodOptional<z.ZodArray<z.ZodString>>;
926
+ pictureChoiceOther: z.ZodOptional<z.ZodString>;
927
+ signature: z.ZodOptional<z.ZodObject<{
928
+ mode: z.ZodEnum<{
929
+ type: "type";
930
+ draw: "draw";
931
+ upload: "upload";
932
+ }>;
933
+ fileUrl: z.ZodOptional<z.ZodString>;
934
+ typedName: z.ZodOptional<z.ZodString>;
935
+ }, z.core.$strip>>;
936
+ fileUpload: z.ZodOptional<z.ZodArray<z.ZodObject<{
937
+ fileUrl: z.ZodString;
938
+ fileName: z.ZodString;
939
+ fileSizeMb: z.ZodNumber;
940
+ mimeType: z.ZodOptional<z.ZodString>;
941
+ }, z.core.$strip>>>;
942
+ email: z.ZodOptional<z.ZodString>;
943
+ number: z.ZodOptional<z.ZodString>;
944
+ website: z.ZodOptional<z.ZodString>;
945
+ phoneNumber: z.ZodOptional<z.ZodObject<{
946
+ countryCode: z.ZodString;
947
+ number: z.ZodString;
948
+ e164: z.ZodOptional<z.ZodString>;
949
+ }, z.core.$strip>>;
950
+ address: z.ZodOptional<z.ZodObject<{
951
+ addressLine1: z.ZodOptional<z.ZodString>;
952
+ addressLine2: z.ZodOptional<z.ZodString>;
953
+ city: z.ZodOptional<z.ZodString>;
954
+ stateProvince: z.ZodOptional<z.ZodString>;
955
+ postalCode: z.ZodOptional<z.ZodString>;
956
+ country: z.ZodOptional<z.ZodString>;
957
+ }, z.core.$strip>>;
958
+ videoAudio: z.ZodOptional<z.ZodObject<{
959
+ mode: z.ZodEnum<{
960
+ video: "video";
961
+ audio: "audio";
962
+ photo: "photo";
963
+ text: "text";
964
+ }>;
965
+ fileUrl: z.ZodOptional<z.ZodString>;
966
+ text: z.ZodOptional<z.ZodString>;
967
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
968
+ transcriptText: z.ZodOptional<z.ZodString>;
969
+ }, z.core.$strip>>;
970
+ scheduler: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
971
+ provider: z.ZodLiteral<"google_calendar">;
972
+ bookedAt: z.ZodString;
973
+ }, z.core.$strip>, z.ZodObject<{
974
+ provider: z.ZodLiteral<"calendly">;
975
+ slotStart: z.ZodString;
976
+ slotEnd: z.ZodString;
977
+ eventId: z.ZodOptional<z.ZodString>;
978
+ bookedAt: z.ZodString;
979
+ }, z.core.$strip>], "provider">>;
980
+ qnaWithAi: z.ZodOptional<z.ZodArray<z.ZodObject<{
981
+ question: z.ZodString;
982
+ answer: z.ZodString;
983
+ }, z.core.$strip>>>;
984
+ paymentsUpi: z.ZodOptional<z.ZodObject<{
985
+ transactionId: z.ZodString;
986
+ encatchPaymentReference: z.ZodString;
987
+ amount: z.ZodString;
988
+ currency: z.ZodLiteral<"INR">;
989
+ payeeVpa: z.ZodString;
990
+ payeeName: z.ZodOptional<z.ZodString>;
991
+ sourceEmail: z.ZodOptional<z.ZodString>;
992
+ upiIntentUri: z.ZodOptional<z.ZodString>;
993
+ selfReported: z.ZodLiteral<true>;
994
+ }, z.core.$strip>>;
995
+ }, z.core.$strip>>>;
996
+ type: z.ZodOptional<z.ZodString>;
997
+ error: z.ZodOptional<z.ZodString>;
998
+ isOnPath: z.ZodOptional<z.ZodBoolean>;
999
+ timeSpentMs: z.ZodOptional<z.ZodNumber>;
1000
+ isPathTraversed: z.ZodOptional<z.ZodBoolean>;
1001
+ }, z.core.$strip>>>;
1002
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1003
+ contact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1004
+ sourceTrackingFieldValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1005
+ }, z.core.$strip>>;
1006
+ visitedQuestionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1007
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1008
+ }, z.core.$strip>;
1009
+ export declare const submitFormRequestSchema: z.ZodObject<{
1010
+ triggerType: z.ZodOptional<z.ZodEnum<{
1011
+ automatic: "automatic";
1012
+ manual: "manual";
1013
+ }>>;
1014
+ formDetails: z.ZodObject<{
1015
+ formConfigurationId: z.ZodString;
1016
+ feedbackIdentifier: z.ZodOptional<z.ZodString>;
1017
+ responseLanguageCode: z.ZodOptional<z.ZodString>;
1018
+ isPartialSubmit: z.ZodOptional<z.ZodBoolean>;
1019
+ completionTimeInSeconds: z.ZodOptional<z.ZodNumber>;
1020
+ response: z.ZodOptional<z.ZodObject<{
1021
+ questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1022
+ questionId: z.ZodString;
1023
+ answer: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1024
+ nps: z.ZodOptional<z.ZodNumber>;
1025
+ nestedSelection: z.ZodOptional<z.ZodArray<z.ZodString>>;
1026
+ longText: z.ZodOptional<z.ZodString>;
1027
+ shortAnswer: z.ZodOptional<z.ZodString>;
1028
+ singleChoice: z.ZodOptional<z.ZodString>;
1029
+ rating: z.ZodOptional<z.ZodNumber>;
1030
+ yesNo: z.ZodOptional<z.ZodBoolean>;
1031
+ consent: z.ZodOptional<z.ZodBoolean>;
1032
+ multipleChoiceMultiple: z.ZodOptional<z.ZodArray<z.ZodString>>;
1033
+ singleChoiceOther: z.ZodOptional<z.ZodString>;
1034
+ multipleChoiceOther: z.ZodOptional<z.ZodString>;
1035
+ annotation: z.ZodOptional<z.ZodObject<{
1036
+ fileType: z.ZodString;
1037
+ fileName: z.ZodString;
1038
+ markers: z.ZodArray<z.ZodObject<{
1039
+ markerNo: z.ZodString;
1040
+ timeline: z.ZodString;
1041
+ comment: z.ZodString;
1042
+ }, z.core.$strip>>;
1043
+ }, z.core.$strip>>;
1044
+ ratingMatrix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
1045
+ matrixSingleChoice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1046
+ matrixMultipleChoice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
1047
+ others: z.ZodOptional<z.ZodString>;
1048
+ date: z.ZodOptional<z.ZodString>;
1049
+ csat: z.ZodOptional<z.ZodNumber>;
1050
+ opinionScale: z.ZodOptional<z.ZodNumber>;
1051
+ ranking: z.ZodOptional<z.ZodArray<z.ZodString>>;
1052
+ pictureChoice: z.ZodOptional<z.ZodArray<z.ZodString>>;
1053
+ pictureChoiceOther: z.ZodOptional<z.ZodString>;
1054
+ signature: z.ZodOptional<z.ZodObject<{
1055
+ mode: z.ZodEnum<{
1056
+ type: "type";
1057
+ draw: "draw";
1058
+ upload: "upload";
1059
+ }>;
1060
+ fileUrl: z.ZodOptional<z.ZodString>;
1061
+ typedName: z.ZodOptional<z.ZodString>;
1062
+ }, z.core.$strip>>;
1063
+ fileUpload: z.ZodOptional<z.ZodArray<z.ZodObject<{
1064
+ fileUrl: z.ZodString;
1065
+ fileName: z.ZodString;
1066
+ fileSizeMb: z.ZodNumber;
1067
+ mimeType: z.ZodOptional<z.ZodString>;
1068
+ }, z.core.$strip>>>;
1069
+ email: z.ZodOptional<z.ZodString>;
1070
+ number: z.ZodOptional<z.ZodString>;
1071
+ website: z.ZodOptional<z.ZodString>;
1072
+ phoneNumber: z.ZodOptional<z.ZodObject<{
1073
+ countryCode: z.ZodString;
1074
+ number: z.ZodString;
1075
+ e164: z.ZodOptional<z.ZodString>;
1076
+ }, z.core.$strip>>;
1077
+ address: z.ZodOptional<z.ZodObject<{
1078
+ addressLine1: z.ZodOptional<z.ZodString>;
1079
+ addressLine2: z.ZodOptional<z.ZodString>;
1080
+ city: z.ZodOptional<z.ZodString>;
1081
+ stateProvince: z.ZodOptional<z.ZodString>;
1082
+ postalCode: z.ZodOptional<z.ZodString>;
1083
+ country: z.ZodOptional<z.ZodString>;
1084
+ }, z.core.$strip>>;
1085
+ videoAudio: z.ZodOptional<z.ZodObject<{
1086
+ mode: z.ZodEnum<{
1087
+ video: "video";
1088
+ audio: "audio";
1089
+ photo: "photo";
1090
+ text: "text";
1091
+ }>;
1092
+ fileUrl: z.ZodOptional<z.ZodString>;
1093
+ text: z.ZodOptional<z.ZodString>;
1094
+ durationSeconds: z.ZodOptional<z.ZodNumber>;
1095
+ transcriptText: z.ZodOptional<z.ZodString>;
1096
+ }, z.core.$strip>>;
1097
+ scheduler: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1098
+ provider: z.ZodLiteral<"google_calendar">;
1099
+ bookedAt: z.ZodString;
1100
+ }, z.core.$strip>, z.ZodObject<{
1101
+ provider: z.ZodLiteral<"calendly">;
1102
+ slotStart: z.ZodString;
1103
+ slotEnd: z.ZodString;
1104
+ eventId: z.ZodOptional<z.ZodString>;
1105
+ bookedAt: z.ZodString;
1106
+ }, z.core.$strip>], "provider">>;
1107
+ qnaWithAi: z.ZodOptional<z.ZodArray<z.ZodObject<{
1108
+ question: z.ZodString;
1109
+ answer: z.ZodString;
1110
+ }, z.core.$strip>>>;
1111
+ paymentsUpi: z.ZodOptional<z.ZodObject<{
1112
+ transactionId: z.ZodString;
1113
+ encatchPaymentReference: z.ZodString;
1114
+ amount: z.ZodString;
1115
+ currency: z.ZodLiteral<"INR">;
1116
+ payeeVpa: z.ZodString;
1117
+ payeeName: z.ZodOptional<z.ZodString>;
1118
+ sourceEmail: z.ZodOptional<z.ZodString>;
1119
+ upiIntentUri: z.ZodOptional<z.ZodString>;
1120
+ selfReported: z.ZodLiteral<true>;
1121
+ }, z.core.$strip>>;
1122
+ }, z.core.$strip>>>;
1123
+ type: z.ZodOptional<z.ZodString>;
1124
+ error: z.ZodOptional<z.ZodString>;
1125
+ isOnPath: z.ZodOptional<z.ZodBoolean>;
1126
+ timeSpentMs: z.ZodOptional<z.ZodNumber>;
1127
+ isPathTraversed: z.ZodOptional<z.ZodBoolean>;
1128
+ }, z.core.$strip>>>;
1129
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1130
+ contact: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1131
+ sourceTrackingFieldValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1132
+ }, z.core.$strip>>;
1133
+ visitedQuestionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1134
+ context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1135
+ }, z.core.$strip>;
1136
+ $deviceInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1137
+ }, z.core.$strip>;
886
1138
  export type FormConfig = z.infer<typeof formConfigSchema>;
887
- export type QuestionResponse = z.infer<typeof questionResponseSchema>;
888
1139
  export type Response = z.infer<typeof responseSchema>;
889
1140
  export type MatchedTriggerProperties = z.infer<typeof matchedTriggerPropertiesSchema>;
890
1141
  export type BaseSubmitFeedback = z.infer<typeof baseSubmitFeedbackSchema>;
891
1142
  export type PartialFeedback = z.infer<typeof partialFeedbackSchema>;
892
1143
  export type SubmitFeedback = z.infer<typeof submitFeedbackSchema>;
893
1144
  export type FeedbackRequest = z.infer<typeof feedbackRequestSchema>;
1145
+ /** Response to a specific question in the feedback form. */
1146
+ export interface QuestionResponse {
1147
+ questionId: string;
1148
+ /**
1149
+ * The answer provided for this question; null for display-only types
1150
+ * (thank_you, welcome, exit_form) or unanswered questions on the path.
1151
+ */
1152
+ answer?: Answer | null;
1153
+ type?: string;
1154
+ error?: string;
1155
+ isOnPath?: boolean;
1156
+ timeSpentMs?: number;
1157
+ isPathTraversed?: boolean;
1158
+ }
1159
+ /** User responses nested inside an SDK-style submit-form request. */
1160
+ export interface FormDetailsResponse {
1161
+ questions?: QuestionResponse[];
1162
+ context?: Record<string, unknown>;
1163
+ contact?: Record<string, unknown>;
1164
+ sourceTrackingFieldValues?: Record<string, string>;
1165
+ }
1166
+ /** Form details for an SDK-style submit-form request. */
1167
+ export interface FormDetails {
1168
+ formConfigurationId: string;
1169
+ feedbackIdentifier?: string;
1170
+ responseLanguageCode?: string;
1171
+ isPartialSubmit?: boolean;
1172
+ completionTimeInSeconds?: number;
1173
+ response?: FormDetailsResponse;
1174
+ visitedQuestionIds?: string[];
1175
+ context?: Record<string, string | number | boolean>;
1176
+ }
1177
+ /** Complete submit-form request envelope (SDK-facing contract). */
1178
+ export interface SubmitFormRequest {
1179
+ triggerType?: "automatic" | "manual";
1180
+ formDetails: FormDetails;
1181
+ $deviceInfo?: Record<string, unknown>;
1182
+ }
@@ -288,17 +288,121 @@ export declare const AnswerSchema: z.ZodObject<{
288
288
  selfReported: z.ZodLiteral<true>;
289
289
  }, z.core.$strip>>;
290
290
  }, z.core.$strip>;
291
- export type AnnotationMarker = z.infer<typeof AnnotationMarkerSchema>;
292
- export type Annotation = z.infer<typeof AnnotationSchema>;
293
- export type SignatureAnswer = z.infer<typeof SignatureAnswerSchema>;
294
- export type FileUploadAnswerItem = z.infer<typeof FileUploadAnswerItemSchema>;
295
- export type FileUploadAnswer = z.infer<typeof FileUploadAnswerSchema>;
296
- export type PhoneNumberAnswer = z.infer<typeof PhoneNumberAnswerSchema>;
297
- export type AddressAnswer = z.infer<typeof AddressAnswerSchema>;
298
- export type VideoAudioAnswer = z.infer<typeof VideoAudioAnswerSchema>;
299
- export type SchedulerAnswer = z.infer<typeof SchedulerAnswerSchema>;
300
- export type QnaWithAiPair = z.infer<typeof QnaWithAiPairSchema>;
301
- export type QnaWithAiAnswer = z.infer<typeof QnaWithAiAnswerSchema>;
302
- export type PaymentsUpiAnswer = z.infer<typeof PaymentsUpiAnswerSchema>;
303
- export type AnswerItem = z.infer<typeof AnswerItemSchema>;
304
- export type Answer = z.infer<typeof AnswerSchema>;
291
+ /** A single annotation marker placed on a file. */
292
+ export interface AnnotationMarker {
293
+ markerNo: string;
294
+ timeline: string;
295
+ comment: string;
296
+ }
297
+ /** Annotation answer containing file metadata and markers. */
298
+ export interface Annotation {
299
+ fileType: string;
300
+ fileName: string;
301
+ markers: AnnotationMarker[];
302
+ }
303
+ /** Answer for a signature question. */
304
+ export interface SignatureAnswer {
305
+ mode: "type" | "draw" | "upload";
306
+ fileUrl?: string;
307
+ typedName?: string;
308
+ }
309
+ /** Metadata for a single uploaded file. */
310
+ export interface FileUploadAnswerItem {
311
+ fileUrl: string;
312
+ fileName: string;
313
+ fileSizeMb: number;
314
+ mimeType?: string;
315
+ }
316
+ /** Answer for a file upload question; array supports single and multiple uploads. */
317
+ export type FileUploadAnswer = FileUploadAnswerItem[];
318
+ /** Answer for a phone number question. */
319
+ export interface PhoneNumberAnswer {
320
+ countryCode: string;
321
+ number: string;
322
+ e164?: string;
323
+ }
324
+ /** Answer for an address question. */
325
+ export interface AddressAnswer {
326
+ addressLine1?: string;
327
+ addressLine2?: string;
328
+ city?: string;
329
+ stateProvince?: string;
330
+ postalCode?: string;
331
+ country?: string;
332
+ }
333
+ /** Answer for a video / audio / photo / text question. */
334
+ export interface VideoAudioAnswer {
335
+ mode: "video" | "audio" | "photo" | "text";
336
+ fileUrl?: string;
337
+ text?: string;
338
+ durationSeconds?: number;
339
+ transcriptText?: string;
340
+ }
341
+ /** Answer for a scheduler question; shape depends on the calendar provider. */
342
+ export type SchedulerAnswer = {
343
+ provider: "google_calendar";
344
+ bookedAt: string;
345
+ } | {
346
+ provider: "calendly";
347
+ slotStart: string;
348
+ slotEnd: string;
349
+ eventId?: string;
350
+ bookedAt: string;
351
+ };
352
+ /** A single Q&A exchange between the respondent and the AI. */
353
+ export interface QnaWithAiPair {
354
+ question: string;
355
+ answer: string;
356
+ }
357
+ /** Answer for a qna_with_ai question; ordered transcript of Q&A pairs. */
358
+ export type QnaWithAiAnswer = QnaWithAiPair[];
359
+ /** Answer for a payments_upi question; self-reported UPI transaction reference. */
360
+ export interface PaymentsUpiAnswer {
361
+ transactionId: string;
362
+ encatchPaymentReference: string;
363
+ amount: string;
364
+ currency: "INR";
365
+ payeeVpa: string;
366
+ payeeName?: string;
367
+ sourceEmail?: string;
368
+ upiIntentUri?: string;
369
+ selfReported: true;
370
+ }
371
+ /** Flexible answer item supporting every question type. */
372
+ export interface AnswerItem {
373
+ nps?: number;
374
+ nestedSelection?: string[];
375
+ longText?: string;
376
+ shortAnswer?: string;
377
+ singleChoice?: string;
378
+ rating?: number;
379
+ yesNo?: boolean;
380
+ consent?: boolean;
381
+ multipleChoiceMultiple?: string[];
382
+ singleChoiceOther?: string;
383
+ multipleChoiceOther?: string;
384
+ annotation?: Annotation;
385
+ ratingMatrix?: Record<string, number | string>;
386
+ matrixSingleChoice?: Record<string, string>;
387
+ matrixMultipleChoice?: Record<string, string[]>;
388
+ others?: string;
389
+ date?: string;
390
+ csat?: number;
391
+ opinionScale?: number;
392
+ ranking?: string[];
393
+ pictureChoice?: string[];
394
+ pictureChoiceOther?: string;
395
+ signature?: SignatureAnswer;
396
+ fileUpload?: FileUploadAnswer;
397
+ email?: string;
398
+ number?: string;
399
+ website?: string;
400
+ phoneNumber?: PhoneNumberAnswer;
401
+ address?: AddressAnswer;
402
+ videoAudio?: VideoAudioAnswer;
403
+ scheduler?: SchedulerAnswer;
404
+ qnaWithAi?: QnaWithAiAnswer;
405
+ paymentsUpi?: PaymentsUpiAnswer;
406
+ }
407
+ /** All supported question answer shapes. */
408
+ export type Answer = AnswerItem;
@@ -0,0 +1,10 @@
1
+ import { Translations } from './translations-schema';
2
+ import { Languages, LanguageField } from './other-screen-schema';
3
+ export declare const exampleTranslations: Translations;
4
+ export declare const availableLanguages: Languages;
5
+ export declare const translationProvider: import("./translations-schema").TranslationProvider;
6
+ export declare function getLanguageDisplayName(languageCode: string): string;
7
+ export declare function getSupportedLanguages(): LanguageField[];
8
+ export declare function demonstrateUsage(): void;
9
+ export type { Translations } from './translations-schema';
10
+ export type { Languages, LanguageField } from './other-screen-schema';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encatch/schema",
3
- "version": "1.3.0-beta.4",
3
+ "version": "1.3.0-beta.5",
4
4
  "description": "TypeScript schema definitions using Zod for validation and type inference of encatch product",
5
5
  "homepage": "https://encatch.com",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "types"
27
27
  ],
28
28
  "author": "",
29
- "license": "AGPL-3.0",
29
+ "license": "MIT",
30
30
  "dependencies": {
31
31
  "@types/node": "^25.7.0",
32
32
  "typescript": "^6.0.3",