veryfi-lens-wasm 2.0.13-beta.2 → 2.1.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/components/video.js +2 -2
- package/package.json +1 -1
- package/veryfi-lens.js +15 -47
package/components/video.js
CHANGED
|
@@ -29,7 +29,7 @@ export const createVideo = (container) => {
|
|
|
29
29
|
video.style.maxWidth = 'none';
|
|
30
30
|
video.style.top = '0';
|
|
31
31
|
video.style.left = '0';
|
|
32
|
-
video.style.transform = isLandscape ? '
|
|
32
|
+
video.style.transform = isLandscape ? 'none' : 'scale(1.5)';
|
|
33
33
|
video.style.objectFit = isLandscape ? 'cover' : 'cover';
|
|
34
34
|
} else {
|
|
35
35
|
video.style.position = 'absolute';
|
|
@@ -38,7 +38,7 @@ export const createVideo = (container) => {
|
|
|
38
38
|
video.style.maxWidth = '500px';
|
|
39
39
|
video.style.top = '';
|
|
40
40
|
video.style.left = '';
|
|
41
|
-
video.style.transform = '
|
|
41
|
+
video.style.transform = 'none';
|
|
42
42
|
video.style.objectFit = 'cover';
|
|
43
43
|
}
|
|
44
44
|
} else {
|
package/package.json
CHANGED
package/veryfi-lens.js
CHANGED
|
@@ -1056,7 +1056,7 @@ const VeryfiLens = (function () {
|
|
|
1056
1056
|
try {
|
|
1057
1057
|
state.updateHandler && state.updateHandler({ status: 'validation_started' });
|
|
1058
1058
|
const response = await fetch(
|
|
1059
|
-
|
|
1059
|
+
"https://lens.veryfi.com/rest/validate_partner",
|
|
1060
1060
|
{
|
|
1061
1061
|
method: 'POST',
|
|
1062
1062
|
headers: {
|
|
@@ -1123,6 +1123,7 @@ const VeryfiLens = (function () {
|
|
|
1123
1123
|
headers: {
|
|
1124
1124
|
"Content-Type": "application/json",
|
|
1125
1125
|
"CLIENT-ID": state.clientId,
|
|
1126
|
+
"SESSION-ID": state.clientData.session
|
|
1126
1127
|
},
|
|
1127
1128
|
body: JSON.stringify(payload)
|
|
1128
1129
|
}
|
|
@@ -1151,51 +1152,18 @@ const VeryfiLens = (function () {
|
|
|
1151
1152
|
const spinner = createSpinner(document.body, 'Submitting document...');
|
|
1152
1153
|
spinner.show();
|
|
1153
1154
|
state.updateHandler && state.updateHandler({ status: 'submission_started' });
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
case 'checks':
|
|
1157
|
-
calculatedUrl = "document"
|
|
1158
|
-
break;
|
|
1159
|
-
case 'caps':
|
|
1160
|
-
calculatedUrl = "ocr";
|
|
1161
|
-
break;
|
|
1162
|
-
case 'code_strips':
|
|
1163
|
-
calculatedUrl = "ocr";
|
|
1164
|
-
break;
|
|
1165
|
-
default:
|
|
1166
|
-
calculatedUrl = "document";
|
|
1167
|
-
}
|
|
1168
|
-
const processDocumentUrl = `https://lens.veryfi.com/api/${calculatedUrl}`;
|
|
1155
|
+
|
|
1156
|
+
const processDocumentUrl = "https://lens.veryfi.com/api/document";
|
|
1169
1157
|
const deviceData = await getDeviceData();
|
|
1170
1158
|
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
state.lensFlavor === 'checks' ? 'checks' :
|
|
1174
|
-
|
|
1175
|
-
state.
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
const ocr_type = state.lensFlavor === 'caps' ? 'pesico_caps' : 'pepsico_codes';
|
|
1180
|
-
|
|
1181
|
-
let requestBody;
|
|
1182
|
-
if (isOcrFlavor) {
|
|
1183
|
-
requestBody = {
|
|
1184
|
-
"file_data": image,
|
|
1185
|
-
"ocr_type": ocr_type,
|
|
1186
|
-
"meta.device_data.uuid": state.uuidv4,
|
|
1187
|
-
...state.customData
|
|
1188
|
-
};
|
|
1189
|
-
} else {
|
|
1190
|
-
requestBody = {
|
|
1191
|
-
image: image,
|
|
1192
|
-
doc_type: computedDocType,
|
|
1193
|
-
resource: "api",
|
|
1194
|
-
client_name: state.clientData.client_name,
|
|
1195
|
-
device_data: deviceData,
|
|
1196
|
-
...state.customData
|
|
1197
|
-
};
|
|
1198
|
-
}
|
|
1159
|
+
const requestBody = {
|
|
1160
|
+
image: image,
|
|
1161
|
+
doc_type: state.lensFlavor === 'checks' ? 'checks' : 'documents',
|
|
1162
|
+
resource: "api",
|
|
1163
|
+
client_name: state.clientData.client_name,
|
|
1164
|
+
device_data: deviceData,
|
|
1165
|
+
...state.customData
|
|
1166
|
+
};
|
|
1199
1167
|
|
|
1200
1168
|
const requestOptions = {
|
|
1201
1169
|
method: 'POST',
|
|
@@ -1997,8 +1965,8 @@ const VeryfiLens = (function () {
|
|
|
1997
1965
|
}
|
|
1998
1966
|
};
|
|
1999
1967
|
|
|
2000
|
-
const getDeviceData = async () => {
|
|
2001
|
-
// await generateDeviceIDifNeeded();
|
|
1968
|
+
const getDeviceData = async () => {
|
|
1969
|
+
// await generateDeviceIDifNeeded(); // Already called in init
|
|
2002
1970
|
const browserData = await getBrowserData();
|
|
2003
1971
|
const UAData = flattenObject(parseUA());
|
|
2004
1972
|
|
|
@@ -2069,7 +2037,7 @@ const VeryfiLens = (function () {
|
|
|
2069
2037
|
FingerprintJS.defaultScriptUrlPattern
|
|
2070
2038
|
]
|
|
2071
2039
|
});
|
|
2072
|
-
const result = await fp.get({ timeout: 20000 });
|
|
2040
|
+
const result = await fp.get({ timeout: 20000 });
|
|
2073
2041
|
state.visitorId = result.visitorId;
|
|
2074
2042
|
state.debug_mode && console.log("Basic fingerprint obtained:", state.visitorId);
|
|
2075
2043
|
} catch (error) {
|