@encatch/schema 1.3.0 → 1.4.0
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 +849 -575
- package/dist/esm/index.js.map +3 -3
- package/dist/types/helpers/csat-emoji-helper.d.ts +52 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/internal/type-assert.d.ts +19 -0
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +128 -72
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +314 -25
- package/dist/types/schemas/fields/answer-schema.d.ts +121 -17
- package/dist/types/schemas/fields/app-props-schema.d.ts +82 -36
- package/dist/types/schemas/fields/field-schema.d.ts +135 -85
- package/dist/types/schemas/fields/form-properties-schema.d.ts +88 -36
- package/dist/types/schemas/fields/theme-schema.d.ts +23 -0
- package/dist/types/schemas/fields/translations-schema.d.ts +75 -0
- package/package.json +2 -2
- package/dist/types/schemas/fields/translations-example.d.ts +0 -10
|
@@ -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>;
|
|
@@ -73,9 +74,9 @@ export declare const questionResponseSchema: z.ZodObject<{
|
|
|
73
74
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
74
75
|
mode: z.ZodEnum<{
|
|
75
76
|
video: "video";
|
|
76
|
-
text: "text";
|
|
77
77
|
audio: "audio";
|
|
78
78
|
photo: "photo";
|
|
79
|
+
text: "text";
|
|
79
80
|
}>;
|
|
80
81
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
81
82
|
text: 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>;
|
|
@@ -182,9 +183,9 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
182
183
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
183
184
|
mode: z.ZodEnum<{
|
|
184
185
|
video: "video";
|
|
185
|
-
text: "text";
|
|
186
186
|
audio: "audio";
|
|
187
187
|
photo: "photo";
|
|
188
|
+
text: "text";
|
|
188
189
|
}>;
|
|
189
190
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
190
191
|
text: 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>;
|
|
@@ -382,9 +383,9 @@ export declare const partialFeedbackSchema: z.ZodObject<{
|
|
|
382
383
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
383
384
|
mode: z.ZodEnum<{
|
|
384
385
|
video: "video";
|
|
385
|
-
text: "text";
|
|
386
386
|
audio: "audio";
|
|
387
387
|
photo: "photo";
|
|
388
|
+
text: "text";
|
|
388
389
|
}>;
|
|
389
390
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
390
391
|
text: 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>;
|
|
@@ -535,9 +536,9 @@ export declare const submitFeedbackSchema: z.ZodObject<{
|
|
|
535
536
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
536
537
|
mode: z.ZodEnum<{
|
|
537
538
|
video: "video";
|
|
538
|
-
text: "text";
|
|
539
539
|
audio: "audio";
|
|
540
540
|
photo: "photo";
|
|
541
|
+
text: "text";
|
|
541
542
|
}>;
|
|
542
543
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
543
544
|
text: 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>;
|
|
@@ -688,9 +689,9 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
688
689
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
689
690
|
mode: z.ZodEnum<{
|
|
690
691
|
video: "video";
|
|
691
|
-
text: "text";
|
|
692
692
|
audio: "audio";
|
|
693
693
|
photo: "photo";
|
|
694
|
+
text: "text";
|
|
694
695
|
}>;
|
|
695
696
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
696
697
|
text: 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>;
|
|
@@ -840,9 +841,9 @@ export declare const feedbackRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
840
841
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
841
842
|
mode: z.ZodEnum<{
|
|
842
843
|
video: "video";
|
|
843
|
-
text: "text";
|
|
844
844
|
audio: "audio";
|
|
845
845
|
photo: "photo";
|
|
846
|
+
text: "text";
|
|
846
847
|
}>;
|
|
847
848
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
848
849
|
text: 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
|
+
}
|
|
@@ -50,9 +50,9 @@ export declare const AddressAnswerSchema: z.ZodObject<{
|
|
|
50
50
|
export declare const VideoAudioAnswerSchema: z.ZodObject<{
|
|
51
51
|
mode: z.ZodEnum<{
|
|
52
52
|
video: "video";
|
|
53
|
-
text: "text";
|
|
54
53
|
audio: "audio";
|
|
55
54
|
photo: "photo";
|
|
55
|
+
text: "text";
|
|
56
56
|
}>;
|
|
57
57
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
58
58
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -153,9 +153,9 @@ export declare const AnswerItemSchema: z.ZodObject<{
|
|
|
153
153
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
154
154
|
mode: z.ZodEnum<{
|
|
155
155
|
video: "video";
|
|
156
|
-
text: "text";
|
|
157
156
|
audio: "audio";
|
|
158
157
|
photo: "photo";
|
|
158
|
+
text: "text";
|
|
159
159
|
}>;
|
|
160
160
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
161
161
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -253,9 +253,9 @@ export declare const AnswerSchema: z.ZodObject<{
|
|
|
253
253
|
videoAudio: z.ZodOptional<z.ZodObject<{
|
|
254
254
|
mode: z.ZodEnum<{
|
|
255
255
|
video: "video";
|
|
256
|
-
text: "text";
|
|
257
256
|
audio: "audio";
|
|
258
257
|
photo: "photo";
|
|
258
|
+
text: "text";
|
|
259
259
|
}>;
|
|
260
260
|
fileUrl: z.ZodOptional<z.ZodString>;
|
|
261
261
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -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
|
-
|
|
292
|
-
export
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
export
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
export
|
|
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;
|