@tsocial/tvweb-sdk.omg 0.0.0-beta.20251211-144711 → 0.0.0-beta.20251211-162126

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.
@@ -1,10 +1,10 @@
1
1
  declare const ScannerType: {
2
- ID_CARD: string;
3
- QR_CODE: string;
2
+ readonly ID_CARD: "id_card";
3
+ readonly QR_CODE: "qr_code";
4
4
  };
5
5
 
6
6
  declare const defaultSteps: ({
7
- scannerType: string;
7
+ scannerType: "id_card";
8
8
  title: string;
9
9
  description: string;
10
10
  titleIcon: string;
@@ -12,7 +12,7 @@ declare const defaultSteps: ({
12
12
  cardType: "vn.national_id";
13
13
  enableConfirmPopup: boolean;
14
14
  } | {
15
- scannerType: string;
15
+ scannerType: "id_card";
16
16
  title: string;
17
17
  description: string;
18
18
  titleIcon: string;
@@ -1409,8 +1409,9 @@ declare const _default: {
1409
1409
  'passive_liveness_v2.instruction.capturing_done': string;
1410
1410
  };
1411
1411
  type Translation = typeof _default;
1412
- interface CustomTexts extends Translation {
1413
- }
1412
+ type CustomTexts = Partial<Translation> & {
1413
+ [key: string]: string;
1414
+ };
1414
1415
  interface BlazefaceModel {
1415
1416
  load(params?: {
1416
1417
  modelUrl?: string;
@@ -1432,6 +1433,30 @@ declare global {
1432
1433
  tv_model_backend_init?: string[];
1433
1434
  }
1434
1435
  }
1436
+
1437
+ type NestedPartial<T> = {
1438
+ [K in keyof T]?: T[K] extends object ? NestedPartial<T[K]> : T[K];
1439
+ };
1440
+ type IdCardModelUrlsWithModelName = Record<keyof typeof IdCardModelName, string>;
1441
+ type TfScriptUrls = {
1442
+ tfUrl: string;
1443
+ tfBackendWasmUrl: string;
1444
+ tfBackendCpuUrl: string;
1445
+ tfBackendWebGlUrl: string;
1446
+ tfLiteUrl: string;
1447
+ blazefaceScriptUrl: string;
1448
+ };
1449
+ type ResourceUrls = {
1450
+ blazefaceModelUrl: string;
1451
+ opencvUrl: string;
1452
+ opencvWasmUrl: string;
1453
+ idCardModelUrl: string;
1454
+ wechatQRModelsUrl: string;
1455
+ closeEyesModelUrl: string;
1456
+ qualifyModelUrl: string;
1457
+ tfScriptUrls: TfScriptUrls;
1458
+ idCardModelUrls: IdCardModelUrlsWithModelName;
1459
+ };
1435
1460
  /**
1436
1461
  * Interface for configuring service settings. All properties are optional.
1437
1462
  */
@@ -1472,12 +1497,13 @@ type BaseTVWebSDKProps = {
1472
1497
  lang?: 'vi' | 'en' | 'es-mx';
1473
1498
  assetRoot?: string;
1474
1499
  resourceRoot?: string;
1475
- customUrls?: Record<string, string>;
1500
+ customUrls?: NestedPartial<ResourceUrls>;
1476
1501
  enableAntiDebug?: boolean;
1477
- warmupMessage: string;
1478
- baseComponent: Record<string, any>;
1502
+ warmupMessage?: string;
1503
+ baseComponent?: Record<string, any>;
1504
+ component?: Record<string, any>;
1479
1505
  country?: 'vn' | 'ph';
1480
- idCardContext: Record<string, any>;
1506
+ idCardContext?: Record<string, any>;
1481
1507
  exifKey?: string;
1482
1508
  themeVersion?: 'v1' | 'v2';
1483
1509
  enableVoice?: boolean;
@@ -1547,7 +1573,13 @@ type APICredentials = {
1547
1573
  fallbackUrls?: string[];
1548
1574
  };
1549
1575
  type LogCredentials = APICredentials & {
1550
- userId: string;
1576
+ userId?: string;
1577
+ enable?: boolean;
1578
+ logSignature?: {
1579
+ timestamp: string;
1580
+ signature: string;
1581
+ logUrl: string;
1582
+ };
1551
1583
  };
1552
1584
  type ErrorObject = {
1553
1585
  code: string;
@@ -1580,10 +1612,11 @@ type ReadIDCardOptions = {
1580
1612
  customTexts?: CustomTexts;
1581
1613
  customErrors?: CustomErrors;
1582
1614
  };
1583
- type ReadIDCardWithApiCallOptions = ReadIDCardOptions & {
1615
+ type ReadIDCardWithApiCallOptions = Omit<ReadIDCardOptions, 'clientSettings'> & {
1584
1616
  apiCredentials: APICredentials;
1585
1617
  serviceSettings?: ServiceSettings;
1586
1618
  flowId?: FlowId;
1619
+ clientSettings?: Record<string, any>;
1587
1620
  };
1588
1621
  type LivenessDetectionDoneResult = {};
1589
1622
  type Frame = {
@@ -1592,12 +1625,10 @@ type Frame = {
1592
1625
  metadata: string;
1593
1626
  index: number;
1594
1627
  };
1595
- type LivenessDetectionOptions = {
1628
+ type BaseLivenessDetectionOptions = {
1596
1629
  mode: typeof Mode[keyof typeof Mode];
1597
1630
  onLivenessDetectionDone: (result: LivenessDetectionDoneResult) => void;
1598
1631
  onError: (error: ErrorObject) => void;
1599
- clientSettings: Record<string, any>;
1600
- apiCheck?: boolean;
1601
1632
  apiCredentials?: APICredentials;
1602
1633
  customErrors?: CustomErrors;
1603
1634
  onProcessing?: () => void;
@@ -1615,6 +1646,13 @@ type LivenessDetectionOptions = {
1615
1646
  serviceSettings?: ServiceSettings;
1616
1647
  flowId?: FlowId;
1617
1648
  };
1649
+ type LivenessDetectionOptions = (BaseLivenessDetectionOptions & {
1650
+ apiCheck: true;
1651
+ clientSettings?: Record<string, any>;
1652
+ }) | (BaseLivenessDetectionOptions & {
1653
+ apiCheck?: false;
1654
+ clientSettings: Record<string, any>;
1655
+ });
1618
1656
  type FaceImage = {
1619
1657
  id?: string;
1620
1658
  base64?: string;
@@ -1647,17 +1685,15 @@ type FaceAuthenticationResult = {
1647
1685
  faceType?: 'selfie' | 'id_card' | null;
1648
1686
  apiResult?: any;
1649
1687
  };
1650
- type FaceAuthenticationOptions = {
1688
+ type BaseFaceAuthenticationOptions = {
1651
1689
  mode: typeof FaceAuthenticationMode[keyof typeof FaceAuthenticationMode];
1652
1690
  authMethod: typeof FaceAuthMethod[keyof typeof FaceAuthMethod];
1653
1691
  onDone: (result: FaceAuthenticationResult) => void;
1654
1692
  onError: (error: ErrorObject) => void;
1655
- onReset?: () => void;
1656
- clientSettings: Record<string, any>;
1657
- apiCheck?: boolean;
1658
1693
  apiCredentials?: APICredentials;
1659
- onClose?: () => void;
1660
- authType?: string;
1694
+ customErrors?: CustomErrors;
1695
+ onProcessing?: () => void;
1696
+ onReset?: () => void;
1661
1697
  captureFrameSettings?: {
1662
1698
  enable: boolean;
1663
1699
  framesIntervalTime: number;
@@ -1666,13 +1702,24 @@ type FaceAuthenticationOptions = {
1666
1702
  onFramesCaptured?: (frames: Frame[]) => void;
1667
1703
  outputEncryptionSettings?: OutputEncryptionSettings;
1668
1704
  logCredentials?: LogCredentials;
1669
- flowId?: FlowId;
1670
- serviceSettings?: ServiceSettings;
1671
1705
  customTexts?: CustomTexts;
1706
+ onClose?: () => void;
1707
+ serviceSettings?: ServiceSettings;
1708
+ flowId?: FlowId;
1672
1709
  };
1710
+ type FaceAuthenticationOptions = (BaseFaceAuthenticationOptions & {
1711
+ apiCheck: true;
1712
+ clientSettings?: Record<string, any>;
1713
+ }) | (BaseFaceAuthenticationOptions & {
1714
+ apiCheck?: false;
1715
+ clientSettings: Record<string, any>;
1716
+ });
1673
1717
 
1674
1718
  declare class BaseTVWebSDK {
1719
+ #private;
1675
1720
  container: HTMLElement;
1721
+ component: Record<string, any>;
1722
+ commonSettings: Record<string, any>;
1676
1723
  constructor(constructorProps: BaseTVWebSDKProps);
1677
1724
  /**
1678
1725
  * Check the ability to open the camera of the current device.
@@ -1743,10 +1790,10 @@ declare class SDKAdapter {
1743
1790
  }
1744
1791
 
1745
1792
  declare class TVWebSDK extends BaseTVWebSDK {
1746
- constructor(props: any);
1747
- livenessDetection(props: any): void;
1748
- readIDCardUIOnly(props: any): void;
1749
- readIDCardWithApiCall(props: any): void;
1793
+ constructor(props: BaseTVWebSDKProps);
1794
+ livenessDetection(props: LivenessDetectionOptions): void;
1795
+ readIDCardUIOnly(props: ReadIDCardOptions): void;
1796
+ readIDCardWithApiCall(props: ReadIDCardWithApiCallOptions): void;
1750
1797
  }
1751
1798
 
1752
1799
  export { index$1 as Constants, TVWebSDK as SDK, SDKAdapter, ScannerType, defaultClientSettings, defaultSteps as defaultReadIDCardSteps, getSDKVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsocial/tvweb-sdk.omg",
3
- "version": "0.0.0-beta.20251211-144711",
3
+ "version": "0.0.0-beta.20251211-162126",
4
4
  "description": "TV Web SDK - The Standalone SDK",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -28,14 +28,14 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@tsocial/trustvision-sdk": "2.12.4",
31
- "@tsocial/tvweb-builder": "0.0.0-beta.20251211-144711",
32
- "@tsocial/tvweb-core": "0.0.0-beta.20251211-144711",
33
- "@tsocial/tvweb-ui": "0.0.0-beta.20251211-144711",
31
+ "@tsocial/tvweb-builder": "0.0.0-beta.20251211-162126",
32
+ "@tsocial/tvweb-core": "0.0.0-beta.20251211-162126",
33
+ "@tsocial/tvweb-ui": "0.0.0-beta.20251211-162126",
34
34
  "invariant": "^2.2.4",
35
35
  "react": "^16.14.0",
36
36
  "react-app-polyfill": "^2.0.0",
37
37
  "react-dom": "^16.14.0",
38
38
  "styled-components": "^6.1.12"
39
39
  },
40
- "gitHead": "c307187330101547484d87394864dce39e930d39"
40
+ "gitHead": "94ed3819a64f6c8930910845545ba62e6331d914"
41
41
  }