@tsocial/tvweb-sdk.vib 5.1.1 → 5.3.1

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.
@@ -45,13 +45,32 @@
45
45
  </label>
46
46
  </div>
47
47
  <div>
48
- Api check:
48
+ Api check
49
49
  <select id="select-api-check">
50
50
  <option value="false">false</option>
51
51
  <option value="true" selected>true</option>
52
52
  </select>
53
53
  </div>
54
54
 
55
+ <div style="margin-top: 10px;">
56
+ <label>
57
+ Cached User ID
58
+ <input id="user-id" readonly style="width: 300px" />
59
+ </label>
60
+ <button onclick="clearUserId()">Clear user id (x-request-id)</button>
61
+ </div>
62
+
63
+ <div style="display: inline-block; margin-top: 10px;">
64
+ <div>
65
+ Tracking config
66
+ <select id="select-tracking-config-template" onchange="onSelectTrackingConfigTemplate()">
67
+ <option value="0" selected>default</option>
68
+ <option value="1">Engineering test (...9fe5)</option>
69
+ </select>
70
+ </div>
71
+ <textarea cols="55" rows="8" id="tracking-config"></textarea>
72
+ </div>
73
+
55
74
  <hr />
56
75
  <h4>Extract ID Info</h4>
57
76
  <div style="display: inline-block; margin-right: 20px;">
@@ -147,6 +166,8 @@
147
166
  const inputAccessKey = document.getElementById("access-key");
148
167
  const inputSecretKey = document.getElementById("secret-key");
149
168
  const inputApiUrl = document.getElementById("api-url");
169
+ const userIdEl = document.getElementById("user-id");
170
+ const trackingConfigEl = document.getElementById("tracking-config");
150
171
  const readIdCardLoadingEl = document.getElementById("read-id-card-loading");
151
172
  const customStepTimeConstraintsEl = document.getElementById("custom-step-time-constraints");
152
173
  const statusWarmupReadIDCardEl = document.getElementById("status-warmup-read-id-card");
@@ -157,6 +178,22 @@
157
178
  inputAccessKey.value = "f051dfd3-8a6e-4a15-a4e8-7ea8cdc84a31";
158
179
  inputSecretKey.value = "vgiKCenoKvhPq79KABbFmxCBu6WX1tdw";
159
180
  inputApiUrl.value = "https://tv-testing.trustingsocial.com/api";
181
+ userIdEl.value = JSON.parse(localStorage.getItem("user-id"));
182
+
183
+ const trackingConfigTemplates = [
184
+ TVWebSDK.TrackingContext.defaultTrackingConfig,
185
+ {
186
+ "enable": true,
187
+ "accessKey": "4df5f9b9-f34d-4ffa-829f-aa4889bc9fe5",
188
+ "secretKey": "dQDfxkVYXfAxpdReqdOd1zJP4pJ088Y7",
189
+ "apiUrl": "https://tv-testing.trustingsocial.com/api",
190
+ "userId": ""
191
+ },
192
+ ];
193
+ function onSelectTrackingConfigTemplate() {
194
+ const selected = document.getElementById("select-tracking-config-template").value;
195
+ trackingConfigEl.value = JSON.stringify(trackingConfigTemplates[selected], null, 2);
196
+ }
160
197
 
161
198
  Object.keys(TVWebSDK.Constants.Mode).forEach((k) => {
162
199
  const option = document.createElement("option");
@@ -175,6 +212,12 @@
175
212
  customStepTimeConstraintsEl.value = JSON.stringify(customStepTimeConstraintsData, null, 2);
176
213
  idCardSettingsEl.value = JSON.stringify(TVWebSDK.defaultClientSettings, null, 2);
177
214
  idCardStepsEl.value = JSON.stringify(TVWebSDK.defaultReadIDCardSteps, null, 2);
215
+ trackingConfigEl.value = JSON.stringify(TVWebSDK.TrackingContext.defaultTrackingConfig, null, 2);
216
+
217
+ function clearUserId() {
218
+ window.localStorage.removeItem('user-id');
219
+ userIdEl.value = JSON.parse(localStorage.getItem("user-id"));
220
+ }
178
221
 
179
222
  function runWarmUpReadIDCard() {
180
223
  statusWarmupReadIDCardEl.innerHTML = "..."
@@ -254,14 +297,17 @@
254
297
  detectIdCard: handleDetectIdCard,
255
298
  onStepDone: handleStepDoneIDCard,
256
299
  steps: JSON.parse(idCardStepsEl.value),
300
+ tracking: JSON.parse(trackingConfigEl.value),
257
301
  }
258
302
 
259
303
  if (apiCheck) {
260
304
  console.log('With api call')
261
305
  tv.readIDCardWithApiCall({
262
- accessKey: inputAccessKey.value,
263
- secretKey: inputSecretKey.value,
264
- apiUrl: inputApiUrl.value,
306
+ apiCredentials: {
307
+ accessKey: inputAccessKey.value,
308
+ secretKey: inputSecretKey.value,
309
+ apiUrl: inputApiUrl.value,
310
+ },
265
311
  ...commonProps,
266
312
  })
267
313
  } else {
@@ -283,7 +329,11 @@
283
329
  apiUrl: inputApiUrl.value,
284
330
  onLivenessDetectionDone: handleLivenessDetectionDone,
285
331
  customStepTimeConstraints: JSON.parse(customStepTimeConstraintsEl.value),
286
- captureFrameData: true,
332
+ captureFrameSettings: {
333
+ enable: true,
334
+ framesIntervalTime: 180,
335
+ framesBatchLength: 0,
336
+ },
287
337
  onError: (e) => {
288
338
  livenessLoadingEl.style.display = "none";
289
339
  startLivenessBtn.disabled = false;
@@ -331,7 +381,7 @@
331
381
  }
332
382
 
333
383
  function handleLivenessDetectionDone(result) {
334
- const { frontalFaces, apiCheckPassed, steps, videoRecord } = result;
384
+ const { frontalFaces, apiCheckPassed, steps } = result;
335
385
  const apiCheck = selectApiCheckEl.value === "true";
336
386
  resultLivenessDetectionEl.innerHTML = "";
337
387
 
@@ -365,13 +415,6 @@
365
415
  resultLivenessDetectionEl.appendChild(
366
416
  document.createTextNode("Video:")
367
417
  );
368
- if (videoRecord.length) {
369
- const videoEl = document.createElement("video");
370
- videoEl.width = "200";
371
- videoEl.controls = "controls";
372
- videoEl.src = URL.createObjectURL(videoRecord[0]);
373
- resultLivenessDetectionEl.appendChild(videoEl);
374
- }
375
418
  } else {
376
419
  livenessLoadingEl.style.display = "none";
377
420
  startLivenessBtn.disabled = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsocial/tvweb-sdk.vib",
3
- "version": "5.1.1",
3
+ "version": "5.3.1",
4
4
  "description": "TV Web SDK - The Standalone VIB SDK",
5
5
  "keywords": [],
6
6
  "author": "Nha Hoang <nha.hoang@trustingsocial.com>, Son T. Ng <son.nguyen.thai@trustingsocial.com>",
@@ -23,9 +23,9 @@
23
23
  "test": "echo \"Error: run tests from root\" && exit 1"
24
24
  },
25
25
  "dependencies": {
26
- "@tsocial/trustvision-sdk": "2.10.0",
27
- "@tsocial/tvweb-core": "^5.1.1",
28
- "@tsocial/tvweb-ui": "^5.1.1",
26
+ "@tsocial/trustvision-sdk": "2.10.1",
27
+ "@tsocial/tvweb-core": "^5.3.1",
28
+ "@tsocial/tvweb-ui": "^5.3.1",
29
29
  "invariant": "^2.2.4",
30
30
  "react": "^16.14.0",
31
31
  "react-app-polyfill": "^2.0.0",
@@ -33,7 +33,7 @@
33
33
  "styled-components": "^5.2.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@tsocial/tvweb-builder": "^5.1.1"
36
+ "@tsocial/tvweb-builder": "^5.3.1"
37
37
  },
38
- "gitHead": "d8358928a0cd61d11a34f7b26338a44727986e59"
38
+ "gitHead": "ef8db18cecf2542422137773e636ccdccface4bf"
39
39
  }
Binary file