@zyphe-sdk/core 0.1.15 → 0.1.17
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/index.d.ts +825 -80
- package/dist/index.js +147 -17
- package/dist/index.js.map +1 -1
- package/dist/openapi.d.ts +1320 -91
- package/dist/openapi.json +3121 -404
- package/package.json +10 -1
package/dist/index.js
CHANGED
|
@@ -82,6 +82,23 @@ function constructVerificationSessionUrl({
|
|
|
82
82
|
}
|
|
83
83
|
return baseUrl;
|
|
84
84
|
}
|
|
85
|
+
function getNextStepDetails(flowParams, opts) {
|
|
86
|
+
const client = zypheApiClient(opts);
|
|
87
|
+
return client.GET("/sdk/flow/{flow_id}/vr/next-step", {
|
|
88
|
+
headers: {
|
|
89
|
+
[API_KEY_HEADER]: opts.apiKey
|
|
90
|
+
},
|
|
91
|
+
params: {
|
|
92
|
+
path: {
|
|
93
|
+
flow_id: flowParams.flowId
|
|
94
|
+
},
|
|
95
|
+
query: {
|
|
96
|
+
sandbox: flowParams.isSandbox,
|
|
97
|
+
email: flowParams.email
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
85
102
|
|
|
86
103
|
// src/utils/guards.ts
|
|
87
104
|
var ApiKeyTypes = {
|
|
@@ -120,6 +137,9 @@ function imageProvenanceFromJSON(object) {
|
|
|
120
137
|
case 6:
|
|
121
138
|
case "CITIZENSHIP_IMAGE":
|
|
122
139
|
return 6 /* CITIZENSHIP_IMAGE */;
|
|
140
|
+
case 7:
|
|
141
|
+
case "SELFIE_IMAGE":
|
|
142
|
+
return 7 /* SELFIE_IMAGE */;
|
|
123
143
|
case -1:
|
|
124
144
|
case "UNRECOGNIZED":
|
|
125
145
|
default:
|
|
@@ -140,6 +160,8 @@ function imageProvenanceToJSON(object) {
|
|
|
140
160
|
return "PORTRAIT_IMAGE";
|
|
141
161
|
case 6 /* CITIZENSHIP_IMAGE */:
|
|
142
162
|
return "CITIZENSHIP_IMAGE";
|
|
163
|
+
case 7 /* SELFIE_IMAGE */:
|
|
164
|
+
return "SELFIE_IMAGE";
|
|
143
165
|
case -1 /* UNRECOGNIZED */:
|
|
144
166
|
default:
|
|
145
167
|
return "UNRECOGNIZED";
|
|
@@ -153,6 +175,21 @@ function resultStatusFromJSON(object) {
|
|
|
153
175
|
case 1:
|
|
154
176
|
case "PASSED":
|
|
155
177
|
return 1 /* PASSED */;
|
|
178
|
+
case 2:
|
|
179
|
+
case "PARTIAL":
|
|
180
|
+
return 2 /* PARTIAL */;
|
|
181
|
+
case 3:
|
|
182
|
+
case "REQUIRES_MANUAL_REVIEW":
|
|
183
|
+
return 3 /* REQUIRES_MANUAL_REVIEW */;
|
|
184
|
+
case 4:
|
|
185
|
+
case "REQUIRES_ADMIN_REVIEW":
|
|
186
|
+
return 4 /* REQUIRES_ADMIN_REVIEW */;
|
|
187
|
+
case 5:
|
|
188
|
+
case "MANUALLY_APPROVED":
|
|
189
|
+
return 5 /* MANUALLY_APPROVED */;
|
|
190
|
+
case 6:
|
|
191
|
+
case "MANUALLY_REJECTED":
|
|
192
|
+
return 6 /* MANUALLY_REJECTED */;
|
|
156
193
|
case -1:
|
|
157
194
|
case "UNRECOGNIZED":
|
|
158
195
|
default:
|
|
@@ -165,6 +202,16 @@ function resultStatusToJSON(object) {
|
|
|
165
202
|
return "FAILED";
|
|
166
203
|
case 1 /* PASSED */:
|
|
167
204
|
return "PASSED";
|
|
205
|
+
case 2 /* PARTIAL */:
|
|
206
|
+
return "PARTIAL";
|
|
207
|
+
case 3 /* REQUIRES_MANUAL_REVIEW */:
|
|
208
|
+
return "REQUIRES_MANUAL_REVIEW";
|
|
209
|
+
case 4 /* REQUIRES_ADMIN_REVIEW */:
|
|
210
|
+
return "REQUIRES_ADMIN_REVIEW";
|
|
211
|
+
case 5 /* MANUALLY_APPROVED */:
|
|
212
|
+
return "MANUALLY_APPROVED";
|
|
213
|
+
case 6 /* MANUALLY_REJECTED */:
|
|
214
|
+
return "MANUALLY_REJECTED";
|
|
168
215
|
case -1 /* UNRECOGNIZED */:
|
|
169
216
|
default:
|
|
170
217
|
return "UNRECOGNIZED";
|
|
@@ -722,6 +769,57 @@ var Image = {
|
|
|
722
769
|
return message;
|
|
723
770
|
}
|
|
724
771
|
};
|
|
772
|
+
function createBaseVideo() {
|
|
773
|
+
return { url: "" };
|
|
774
|
+
}
|
|
775
|
+
var Video = {
|
|
776
|
+
encode(message, writer = new BinaryWriter()) {
|
|
777
|
+
if (message.url !== "") {
|
|
778
|
+
writer.uint32(10).string(message.url);
|
|
779
|
+
}
|
|
780
|
+
return writer;
|
|
781
|
+
},
|
|
782
|
+
decode(input, length) {
|
|
783
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
784
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
785
|
+
const message = createBaseVideo();
|
|
786
|
+
while (reader.pos < end) {
|
|
787
|
+
const tag = reader.uint32();
|
|
788
|
+
switch (tag >>> 3) {
|
|
789
|
+
case 1: {
|
|
790
|
+
if (tag !== 10) {
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
message.url = reader.string();
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
798
|
+
break;
|
|
799
|
+
}
|
|
800
|
+
reader.skip(tag & 7);
|
|
801
|
+
}
|
|
802
|
+
return message;
|
|
803
|
+
},
|
|
804
|
+
fromJSON(object) {
|
|
805
|
+
return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
|
|
806
|
+
},
|
|
807
|
+
toJSON(message) {
|
|
808
|
+
const obj = {};
|
|
809
|
+
if (message.url !== "") {
|
|
810
|
+
obj.url = message.url;
|
|
811
|
+
}
|
|
812
|
+
return obj;
|
|
813
|
+
},
|
|
814
|
+
create(base) {
|
|
815
|
+
return Video.fromPartial(base ?? {});
|
|
816
|
+
},
|
|
817
|
+
fromPartial(object) {
|
|
818
|
+
const message = createBaseVideo();
|
|
819
|
+
message.url = object.url ?? "";
|
|
820
|
+
return message;
|
|
821
|
+
}
|
|
822
|
+
};
|
|
725
823
|
function createBaseDocument() {
|
|
726
824
|
return { personalData: void 0, documentData: void 0, addressData: void 0 };
|
|
727
825
|
}
|
|
@@ -806,18 +904,21 @@ var Document = {
|
|
|
806
904
|
}
|
|
807
905
|
};
|
|
808
906
|
function createBaseDetails() {
|
|
809
|
-
return { status: 0,
|
|
907
|
+
return { status: 0, docreaderRequestLog: "", docreaderResponseLog: "", faceapiResponseLog: "" };
|
|
810
908
|
}
|
|
811
909
|
var Details = {
|
|
812
910
|
encode(message, writer = new BinaryWriter()) {
|
|
813
911
|
if (message.status !== 0) {
|
|
814
912
|
writer.uint32(8).int32(message.status);
|
|
815
913
|
}
|
|
816
|
-
if (message.
|
|
817
|
-
writer.uint32(18).string(message.
|
|
914
|
+
if (message.docreaderRequestLog !== "") {
|
|
915
|
+
writer.uint32(18).string(message.docreaderRequestLog);
|
|
916
|
+
}
|
|
917
|
+
if (message.docreaderResponseLog !== "") {
|
|
918
|
+
writer.uint32(26).string(message.docreaderResponseLog);
|
|
818
919
|
}
|
|
819
|
-
if (message.
|
|
820
|
-
writer.uint32(
|
|
920
|
+
if (message.faceapiResponseLog !== "") {
|
|
921
|
+
writer.uint32(34).string(message.faceapiResponseLog);
|
|
821
922
|
}
|
|
822
923
|
return writer;
|
|
823
924
|
},
|
|
@@ -839,14 +940,21 @@ var Details = {
|
|
|
839
940
|
if (tag !== 18) {
|
|
840
941
|
break;
|
|
841
942
|
}
|
|
842
|
-
message.
|
|
943
|
+
message.docreaderRequestLog = reader.string();
|
|
843
944
|
continue;
|
|
844
945
|
}
|
|
845
946
|
case 3: {
|
|
846
947
|
if (tag !== 26) {
|
|
847
948
|
break;
|
|
848
949
|
}
|
|
849
|
-
message.
|
|
950
|
+
message.docreaderResponseLog = reader.string();
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
case 4: {
|
|
954
|
+
if (tag !== 34) {
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
message.faceapiResponseLog = reader.string();
|
|
850
958
|
continue;
|
|
851
959
|
}
|
|
852
960
|
}
|
|
@@ -860,8 +968,9 @@ var Details = {
|
|
|
860
968
|
fromJSON(object) {
|
|
861
969
|
return {
|
|
862
970
|
status: isSet(object.status) ? resultStatusFromJSON(object.status) : 0,
|
|
863
|
-
|
|
864
|
-
|
|
971
|
+
docreaderRequestLog: isSet(object.docreaderRequestLog) ? globalThis.String(object.docreaderRequestLog) : "",
|
|
972
|
+
docreaderResponseLog: isSet(object.docreaderResponseLog) ? globalThis.String(object.docreaderResponseLog) : "",
|
|
973
|
+
faceapiResponseLog: isSet(object.faceapiResponseLog) ? globalThis.String(object.faceapiResponseLog) : ""
|
|
865
974
|
};
|
|
866
975
|
},
|
|
867
976
|
toJSON(message) {
|
|
@@ -869,11 +978,14 @@ var Details = {
|
|
|
869
978
|
if (message.status !== 0) {
|
|
870
979
|
obj.status = resultStatusToJSON(message.status);
|
|
871
980
|
}
|
|
872
|
-
if (message.
|
|
873
|
-
obj.
|
|
981
|
+
if (message.docreaderRequestLog !== "") {
|
|
982
|
+
obj.docreaderRequestLog = message.docreaderRequestLog;
|
|
983
|
+
}
|
|
984
|
+
if (message.docreaderResponseLog !== "") {
|
|
985
|
+
obj.docreaderResponseLog = message.docreaderResponseLog;
|
|
874
986
|
}
|
|
875
|
-
if (message.
|
|
876
|
-
obj.
|
|
987
|
+
if (message.faceapiResponseLog !== "") {
|
|
988
|
+
obj.faceapiResponseLog = message.faceapiResponseLog;
|
|
877
989
|
}
|
|
878
990
|
return obj;
|
|
879
991
|
},
|
|
@@ -883,8 +995,9 @@ var Details = {
|
|
|
883
995
|
fromPartial(object) {
|
|
884
996
|
const message = createBaseDetails();
|
|
885
997
|
message.status = object.status ?? 0;
|
|
886
|
-
message.
|
|
887
|
-
message.
|
|
998
|
+
message.docreaderRequestLog = object.docreaderRequestLog ?? "";
|
|
999
|
+
message.docreaderResponseLog = object.docreaderResponseLog ?? "";
|
|
1000
|
+
message.faceapiResponseLog = object.faceapiResponseLog ?? "";
|
|
888
1001
|
return message;
|
|
889
1002
|
}
|
|
890
1003
|
};
|
|
@@ -894,7 +1007,8 @@ function createBaseMessage() {
|
|
|
894
1007
|
frontImage: void 0,
|
|
895
1008
|
backImage: void 0,
|
|
896
1009
|
otherImage: void 0,
|
|
897
|
-
details: void 0
|
|
1010
|
+
details: void 0,
|
|
1011
|
+
liveness: void 0
|
|
898
1012
|
};
|
|
899
1013
|
}
|
|
900
1014
|
var Message = {
|
|
@@ -914,6 +1028,9 @@ var Message = {
|
|
|
914
1028
|
if (message.details !== void 0) {
|
|
915
1029
|
Details.encode(message.details, writer.uint32(42).fork()).join();
|
|
916
1030
|
}
|
|
1031
|
+
if (message.liveness !== void 0) {
|
|
1032
|
+
Video.encode(message.liveness, writer.uint32(50).fork()).join();
|
|
1033
|
+
}
|
|
917
1034
|
return writer;
|
|
918
1035
|
},
|
|
919
1036
|
decode(input, length) {
|
|
@@ -958,6 +1075,13 @@ var Message = {
|
|
|
958
1075
|
message.details = Details.decode(reader, reader.uint32());
|
|
959
1076
|
continue;
|
|
960
1077
|
}
|
|
1078
|
+
case 6: {
|
|
1079
|
+
if (tag !== 50) {
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
message.liveness = Video.decode(reader, reader.uint32());
|
|
1083
|
+
continue;
|
|
1084
|
+
}
|
|
961
1085
|
}
|
|
962
1086
|
if ((tag & 7) === 4 || tag === 0) {
|
|
963
1087
|
break;
|
|
@@ -972,7 +1096,8 @@ var Message = {
|
|
|
972
1096
|
frontImage: isSet(object.frontImage) ? Image.fromJSON(object.frontImage) : void 0,
|
|
973
1097
|
backImage: isSet(object.backImage) ? Image.fromJSON(object.backImage) : void 0,
|
|
974
1098
|
otherImage: isSet(object.otherImage) ? Image.fromJSON(object.otherImage) : void 0,
|
|
975
|
-
details: isSet(object.details) ? Details.fromJSON(object.details) : void 0
|
|
1099
|
+
details: isSet(object.details) ? Details.fromJSON(object.details) : void 0,
|
|
1100
|
+
liveness: isSet(object.liveness) ? Video.fromJSON(object.liveness) : void 0
|
|
976
1101
|
};
|
|
977
1102
|
},
|
|
978
1103
|
toJSON(message) {
|
|
@@ -992,6 +1117,9 @@ var Message = {
|
|
|
992
1117
|
if (message.details !== void 0) {
|
|
993
1118
|
obj.details = Details.toJSON(message.details);
|
|
994
1119
|
}
|
|
1120
|
+
if (message.liveness !== void 0) {
|
|
1121
|
+
obj.liveness = Video.toJSON(message.liveness);
|
|
1122
|
+
}
|
|
995
1123
|
return obj;
|
|
996
1124
|
},
|
|
997
1125
|
create(base) {
|
|
@@ -1004,6 +1132,7 @@ var Message = {
|
|
|
1004
1132
|
message.backImage = object.backImage !== void 0 && object.backImage !== null ? Image.fromPartial(object.backImage) : void 0;
|
|
1005
1133
|
message.otherImage = object.otherImage !== void 0 && object.otherImage !== null ? Image.fromPartial(object.otherImage) : void 0;
|
|
1006
1134
|
message.details = object.details !== void 0 && object.details !== null ? Details.fromPartial(object.details) : void 0;
|
|
1135
|
+
message.liveness = object.liveness !== void 0 && object.liveness !== null ? Video.fromPartial(object.liveness) : void 0;
|
|
1007
1136
|
return message;
|
|
1008
1137
|
}
|
|
1009
1138
|
};
|
|
@@ -1201,6 +1330,7 @@ export {
|
|
|
1201
1330
|
createVerificationSession,
|
|
1202
1331
|
getDvResult,
|
|
1203
1332
|
getFlowResult,
|
|
1333
|
+
getNextStepDetails,
|
|
1204
1334
|
hexToBytes,
|
|
1205
1335
|
parseSignatureHeader,
|
|
1206
1336
|
timingSafeEqual
|