@tsocial/tvweb-sdk-types 5.38.5 → 5.39.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/build/index.d.ts +77 -12
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
|
@@ -1159,6 +1159,7 @@ declare const _default: {
|
|
|
1159
1159
|
upload_invalid_file_type: string;
|
|
1160
1160
|
upload_processing_failed: string;
|
|
1161
1161
|
image_preview_unavailable: string;
|
|
1162
|
+
upload_type_menu_label: string;
|
|
1162
1163
|
front_card_title: string;
|
|
1163
1164
|
back_card_title: string;
|
|
1164
1165
|
front_card_description: string;
|
|
@@ -1214,24 +1215,24 @@ type Translation = typeof _default;
|
|
|
1214
1215
|
type CustomTexts = Partial<Translation> & {
|
|
1215
1216
|
[key: string]: string;
|
|
1216
1217
|
};
|
|
1217
|
-
interface BlazefaceModel {
|
|
1218
|
+
interface BlazefaceModel$1 {
|
|
1218
1219
|
load(params?: {
|
|
1219
1220
|
modelUrl?: string;
|
|
1220
1221
|
}): Promise<any>;
|
|
1221
1222
|
}
|
|
1222
|
-
interface TFLite {
|
|
1223
|
+
interface TFLite$1 {
|
|
1223
1224
|
loadTFLiteModel(data: Uint8Array, options?: Record<string, any>): Promise<any>;
|
|
1224
1225
|
}
|
|
1225
|
-
interface TensorFlow {
|
|
1226
|
+
interface TensorFlow$1 {
|
|
1226
1227
|
enableProdMode(): Promise<void>;
|
|
1227
1228
|
setBackend(backend: string): Promise<void>;
|
|
1228
1229
|
ready(): Promise<void>;
|
|
1229
1230
|
}
|
|
1230
1231
|
declare global {
|
|
1231
1232
|
interface Window {
|
|
1232
|
-
tf: TensorFlow;
|
|
1233
|
-
blazeface: BlazefaceModel;
|
|
1234
|
-
tflite: TFLite;
|
|
1233
|
+
tf: TensorFlow$1;
|
|
1234
|
+
blazeface: BlazefaceModel$1;
|
|
1235
|
+
tflite: TFLite$1;
|
|
1235
1236
|
tv_model_backend_init?: string[];
|
|
1236
1237
|
}
|
|
1237
1238
|
}
|
|
@@ -1331,6 +1332,13 @@ type ReadIDCardResult = {
|
|
|
1331
1332
|
cardSide: 'front' | 'back';
|
|
1332
1333
|
cardType: string;
|
|
1333
1334
|
source?: 'capture' | 'upload';
|
|
1335
|
+
/** Id of the upload type the image was uploaded with (uploads only). A back-side upload inherits the front's type. */
|
|
1336
|
+
uploadTypeId?: string;
|
|
1337
|
+
/**
|
|
1338
|
+
* True when no further step will run (last configured step, or an upload type with `hasBackSide: false`).
|
|
1339
|
+
* Close the SDK when true.
|
|
1340
|
+
*/
|
|
1341
|
+
isLastStep: boolean;
|
|
1334
1342
|
image: {
|
|
1335
1343
|
blob: Blob;
|
|
1336
1344
|
encrypted?: {
|
|
@@ -1385,8 +1393,11 @@ type APICredentials = {
|
|
|
1385
1393
|
secretKey: string;
|
|
1386
1394
|
apiUrl: string;
|
|
1387
1395
|
fallbackUrls?: string[];
|
|
1396
|
+
xRequestId?: string;
|
|
1397
|
+
xRequestId2?: string;
|
|
1388
1398
|
};
|
|
1389
1399
|
type LogCredentials = APICredentials & {
|
|
1400
|
+
/** @deprecated prefer `xRequestId`; kept as a fallback for existing integrations */
|
|
1390
1401
|
userId?: string;
|
|
1391
1402
|
enable?: boolean;
|
|
1392
1403
|
logSignature?: {
|
|
@@ -1412,9 +1423,30 @@ type IDCardStep = {
|
|
|
1412
1423
|
enableConfirmPopup?: boolean;
|
|
1413
1424
|
};
|
|
1414
1425
|
type CardTypeString = 'vn.national_id' | 'vn.cmnd_old' | 'vn.cmnd_new' | 'vn.cccd' | 'vn.cccd_new' | 'vn.tcc' | 'vn.passport' | 'ph.national_id' | 'ph.nid' | 'global.passport';
|
|
1426
|
+
type UploadType = {
|
|
1427
|
+
/** Unique, host-defined id. Returned on results as `uploadTypeId`. */
|
|
1428
|
+
id: string;
|
|
1429
|
+
/**
|
|
1430
|
+
* Menu row label, localized by the host. Shown only when there are 2+ entries;
|
|
1431
|
+
* when missing or empty, `id` is shown instead.
|
|
1432
|
+
*/
|
|
1433
|
+
title: string;
|
|
1434
|
+
/**
|
|
1435
|
+
* false = the flow ends after this upload: the result has `isLastStep: true`, the remaining
|
|
1436
|
+
* steps are skipped, and the host closes the SDK (destroyView) in onStepDone.
|
|
1437
|
+
*/
|
|
1438
|
+
hasBackSide: boolean;
|
|
1439
|
+
};
|
|
1415
1440
|
type UploadFromDeviceConfig = {
|
|
1416
1441
|
enable: boolean;
|
|
1417
1442
|
enableConfirmPopup?: boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* Upload types offered by the upload button. Omitted or `[]` = one generic upload per side (as before).
|
|
1445
|
+
* 1 entry: the file picker opens directly. 2+ entries: a menu opens first.
|
|
1446
|
+
* Back side: the picker opens directly; the button shows only if an entry has `hasBackSide: true`.
|
|
1447
|
+
* A list with no valid entry hides the button. Invalid entries are dropped with a console.warn.
|
|
1448
|
+
*/
|
|
1449
|
+
uploadTypes?: UploadType[];
|
|
1418
1450
|
};
|
|
1419
1451
|
type ReadIDCardOptions = {
|
|
1420
1452
|
clientSettings: Record<string, any>;
|
|
@@ -1566,6 +1598,17 @@ type FaceAuthenticationOptions = (BaseFaceAuthenticationOptions & {
|
|
|
1566
1598
|
apiCheck?: false;
|
|
1567
1599
|
clientSettings: Record<string, any>;
|
|
1568
1600
|
});
|
|
1601
|
+
type CompareFacesOptions = {
|
|
1602
|
+
accessKey: string;
|
|
1603
|
+
secretKey: string;
|
|
1604
|
+
apiUrl: string;
|
|
1605
|
+
image1: string;
|
|
1606
|
+
image2: string;
|
|
1607
|
+
xRequestId?: string;
|
|
1608
|
+
xRequestId2?: string;
|
|
1609
|
+
onSuccess: (result: any) => void;
|
|
1610
|
+
onError: (error: any) => void;
|
|
1611
|
+
};
|
|
1569
1612
|
|
|
1570
1613
|
declare class BaseTVWebSDK {
|
|
1571
1614
|
#private;
|
|
@@ -1600,11 +1643,11 @@ declare class BaseTVWebSDK {
|
|
|
1600
1643
|
* @private
|
|
1601
1644
|
*/
|
|
1602
1645
|
setupBeforeRender: () => void;
|
|
1603
|
-
readIDCardWithApiCall(
|
|
1604
|
-
readIDCardUIOnly(
|
|
1605
|
-
livenessDetection(
|
|
1606
|
-
faceAuthentication(
|
|
1607
|
-
compareFaces({ accessKey, secretKey, apiUrl, image1, image2, onSuccess, onError }:
|
|
1646
|
+
readIDCardWithApiCall(options: ReadIDCardWithApiCallOptions): Promise<void>;
|
|
1647
|
+
readIDCardUIOnly(options: ReadIDCardOptions): Promise<void>;
|
|
1648
|
+
livenessDetection(options: LivenessDetectionOptions): Promise<void>;
|
|
1649
|
+
faceAuthentication(options: FaceAuthenticationOptions): Promise<void>;
|
|
1650
|
+
compareFaces({ accessKey, secretKey, apiUrl, image1, image2, xRequestId, xRequestId2, onSuccess, onError, }: CompareFacesOptions): void;
|
|
1608
1651
|
destroyView: () => void;
|
|
1609
1652
|
closeSDK: () => void;
|
|
1610
1653
|
}
|
|
@@ -1652,6 +1695,28 @@ declare const ScannerType: {
|
|
|
1652
1695
|
readonly QR_CODE: "qr_code";
|
|
1653
1696
|
};
|
|
1654
1697
|
|
|
1698
|
+
interface BlazefaceModel {
|
|
1699
|
+
load(params?: {
|
|
1700
|
+
modelUrl?: string;
|
|
1701
|
+
}): Promise<any>;
|
|
1702
|
+
}
|
|
1703
|
+
interface TFLite {
|
|
1704
|
+
loadTFLiteModel(data: Uint8Array, options?: Record<string, any>): Promise<any>;
|
|
1705
|
+
}
|
|
1706
|
+
interface TensorFlow {
|
|
1707
|
+
enableProdMode(): Promise<void>;
|
|
1708
|
+
setBackend(backend: string): Promise<void>;
|
|
1709
|
+
ready(): Promise<void>;
|
|
1710
|
+
}
|
|
1711
|
+
declare global {
|
|
1712
|
+
interface Window {
|
|
1713
|
+
tf: TensorFlow;
|
|
1714
|
+
blazeface: BlazefaceModel;
|
|
1715
|
+
tflite: TFLite;
|
|
1716
|
+
tv_model_backend_init?: string[];
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1655
1720
|
declare const defaultSteps: ({
|
|
1656
1721
|
scannerType: "id_card";
|
|
1657
1722
|
title: string;
|
|
@@ -1852,4 +1917,4 @@ declare class TVWebSDK extends BaseTVWebSDK {
|
|
|
1852
1917
|
}
|
|
1853
1918
|
|
|
1854
1919
|
export { index$1 as Constants, TVWebSDK as SDK, SDKAdapter, ScannerType, defaultClientSettings, defaultSteps as defaultReadIDCardSteps, getSDKVersion };
|
|
1855
|
-
export type { BaseTVWebSDKProps, FaceAuthenticationOptions, FaceAuthenticationResult, IDCardStep, LivenessDetectionDoneResult, LivenessDetectionOptions, ReadIDCardOptions, ReadIDCardResult, ReadIDCardWithApiCallOptions, VideoFrame };
|
|
1920
|
+
export type { BaseTVWebSDKProps, FaceAuthenticationOptions, FaceAuthenticationResult, IDCardStep, LivenessDetectionDoneResult, LivenessDetectionOptions, ReadIDCardOptions, ReadIDCardResult, ReadIDCardWithApiCallOptions, UploadFromDeviceConfig, UploadType, VideoFrame };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsocial/tvweb-sdk-types",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.39.0",
|
|
4
4
|
"description": "TypeScript definitions for the TV Web SDK standalone (UMD/CDN) bundle — types window.TVWebSDK",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Toan Trieu <toan.trieu@trustingsocial.com>",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsocial/tvweb-sdk": "5.
|
|
25
|
+
"@tsocial/tvweb-sdk": "5.39.0",
|
|
26
26
|
"typescript": "^5.3.3"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "aba8c75e4b86a49cd75100a595e41d4c1ae05001"
|
|
29
29
|
}
|