@tsocial/tvweb-sdk-types 5.38.6 → 5.40.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.
Files changed (2) hide show
  1. package/build/index.d.ts +183 -157
  2. 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;
@@ -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>;
@@ -1433,6 +1465,13 @@ type ReadIDCardOptions = {
1433
1465
  customErrors?: CustomErrors;
1434
1466
  customTheme?: Record<string, any>;
1435
1467
  uploadFromDevice?: UploadFromDeviceConfig;
1468
+ /**
1469
+ * Show the "how to scan" QR instruction popup before QR scanning starts.
1470
+ * Default `true`. Only an explicit `false` hides it; QR scanning then starts immediately.
1471
+ * Applies to the QR step inside ID capture and the standalone QR step.
1472
+ * The invalid-QR popup (Retry / Skip) is not affected.
1473
+ */
1474
+ enableQrScanGuideline?: boolean;
1436
1475
  };
1437
1476
  type ReadIDCardWithApiCallOptions = Omit<ReadIDCardOptions, 'clientSettings'> & {
1438
1477
  apiCredentials: APICredentials;
@@ -1566,6 +1605,17 @@ type FaceAuthenticationOptions = (BaseFaceAuthenticationOptions & {
1566
1605
  apiCheck?: false;
1567
1606
  clientSettings: Record<string, any>;
1568
1607
  });
1608
+ type CompareFacesOptions = {
1609
+ accessKey: string;
1610
+ secretKey: string;
1611
+ apiUrl: string;
1612
+ image1: string;
1613
+ image2: string;
1614
+ xRequestId?: string;
1615
+ xRequestId2?: string;
1616
+ onSuccess: (result: any) => void;
1617
+ onError: (error: any) => void;
1618
+ };
1569
1619
 
1570
1620
  declare class BaseTVWebSDK {
1571
1621
  #private;
@@ -1600,11 +1650,11 @@ declare class BaseTVWebSDK {
1600
1650
  * @private
1601
1651
  */
1602
1652
  setupBeforeRender: () => void;
1603
- readIDCardWithApiCall(props: ReadIDCardWithApiCallOptions): Promise<void>;
1604
- readIDCardUIOnly(props: ReadIDCardOptions): Promise<void>;
1605
- livenessDetection(props: LivenessDetectionOptions): Promise<void>;
1606
- faceAuthentication(props: FaceAuthenticationOptions): Promise<void>;
1607
- compareFaces({ accessKey, secretKey, apiUrl, image1, image2, onSuccess, onError }: any): void;
1653
+ readIDCardWithApiCall(options: ReadIDCardWithApiCallOptions): Promise<void>;
1654
+ readIDCardUIOnly(options: ReadIDCardOptions): Promise<void>;
1655
+ livenessDetection(options: LivenessDetectionOptions): Promise<void>;
1656
+ faceAuthentication(options: FaceAuthenticationOptions): Promise<void>;
1657
+ compareFaces({ accessKey, secretKey, apiUrl, image1, image2, xRequestId, xRequestId2, onSuccess, onError, }: CompareFacesOptions): void;
1608
1658
  destroyView: () => void;
1609
1659
  closeSDK: () => void;
1610
1660
  }
@@ -1670,102 +1720,84 @@ declare const defaultSteps: ({
1670
1720
  enableConfirmPopup: boolean;
1671
1721
  })[];
1672
1722
 
1673
- declare namespace defaultClientSettings {
1674
- namespace data {
1675
- let country: string;
1676
- namespace settings {
1677
- namespace sdk_settings {
1678
- namespace id_detection_settings {
1679
- let show_hold_still_progress: boolean;
1680
- let show_auto_capture_toggle: boolean;
1681
- namespace auto_capture {
1682
- let enable: boolean;
1683
- let show_capture_button: boolean;
1684
- let wait_for_best_image_time_ms: number;
1685
- }
1686
- namespace manual_capture {
1687
- let wait_for_best_image_time_ms_1: number;
1688
- export { wait_for_best_image_time_ms_1 as wait_for_best_image_time_ms };
1689
- }
1690
- namespace card_type_check {
1691
- let enable_1: boolean;
1692
- export { enable_1 as enable };
1693
- }
1694
- namespace track_card_coordinates {
1695
- let enable_2: boolean;
1696
- export { enable_2 as enable };
1697
- export let max_length: number;
1698
- }
1699
- namespace blur_check {
1700
- let enable_3: boolean;
1701
- export { enable_3 as enable };
1702
- export let large_blurry_threshold_auto: number;
1703
- export let large_blurry_threshold_manual: number;
1704
- export let small_blurry_threshold_auto: number;
1705
- export let small_blurry_threshold_manual: number;
1706
- export let large_blurry_decimal: number;
1707
- export let small_blurry_decimal: number;
1708
- }
1709
- namespace blur_check_generic {
1710
- let enable_4: boolean;
1711
- export { enable_4 as enable };
1712
- let large_blurry_threshold_auto_1: number;
1713
- export { large_blurry_threshold_auto_1 as large_blurry_threshold_auto };
1714
- let large_blurry_threshold_manual_1: number;
1715
- export { large_blurry_threshold_manual_1 as large_blurry_threshold_manual };
1716
- let small_blurry_threshold_auto_1: number;
1717
- export { small_blurry_threshold_auto_1 as small_blurry_threshold_auto };
1718
- let small_blurry_threshold_manual_1: number;
1719
- export { small_blurry_threshold_manual_1 as small_blurry_threshold_manual };
1720
- let large_blurry_decimal_1: number;
1721
- export { large_blurry_decimal_1 as large_blurry_decimal };
1722
- let small_blurry_decimal_1: number;
1723
- export { small_blurry_decimal_1 as small_blurry_decimal };
1724
- export namespace full_face_image_ratio {
1725
- let top: number;
1726
- let right: number;
1727
- let left: number;
1728
- let bottom: number;
1729
- }
1730
- }
1731
- namespace face_check_generic {
1732
- namespace front_side {
1733
- let enable_5: boolean;
1734
- export { enable_5 as enable };
1735
- }
1736
- namespace back_side {
1737
- let enable_6: boolean;
1738
- export { enable_6 as enable };
1739
- }
1740
- }
1741
- namespace flashlight_settings {
1742
- let activation_delay_ms_back: number;
1743
- let activation_delay_ms_front: number;
1744
- let duration_ms_back: number;
1745
- let duration_ms_front: number;
1746
- let enable_back: boolean;
1747
- let enable_front: boolean;
1748
- }
1749
- namespace glare_check {
1750
- let enable_7: boolean;
1751
- export { enable_7 as enable };
1752
- export let threshold: number;
1753
- }
1754
- namespace glare_check_generic {
1755
- let enable_8: boolean;
1756
- export { enable_8 as enable };
1757
- let threshold_1: number;
1758
- export { threshold_1 as threshold };
1759
- }
1760
- let disable_capture_button_if_alert: boolean;
1761
- namespace exif_data_settings {
1762
- let enable_9: boolean;
1763
- export { enable_9 as enable };
1764
- }
1765
- namespace id_detection {
1766
- let enable_10: boolean;
1767
- export { enable_10 as enable };
1768
- export let card_type_model_mapping: {
1723
+ declare const defaultClientSettings: {
1724
+ data: {
1725
+ country: string;
1726
+ settings: {
1727
+ sdk_settings: {
1728
+ id_detection_settings: {
1729
+ show_hold_still_progress: boolean;
1730
+ show_auto_capture_toggle: boolean;
1731
+ auto_capture: {
1732
+ enable: boolean;
1733
+ show_capture_button: boolean;
1734
+ wait_for_best_image_time_ms: number;
1735
+ };
1736
+ manual_capture: {
1737
+ wait_for_best_image_time_ms: number;
1738
+ };
1739
+ card_type_check: {
1740
+ enable: boolean;
1741
+ };
1742
+ track_card_coordinates: {
1743
+ enable: boolean;
1744
+ max_length: number;
1745
+ };
1746
+ blur_check: {
1747
+ enable: boolean;
1748
+ large_blurry_threshold_auto: number;
1749
+ large_blurry_threshold_manual: number;
1750
+ small_blurry_threshold_auto: number;
1751
+ small_blurry_threshold_manual: number;
1752
+ large_blurry_decimal: number;
1753
+ small_blurry_decimal: number;
1754
+ };
1755
+ blur_check_generic: {
1756
+ enable: boolean;
1757
+ large_blurry_threshold_auto: number;
1758
+ large_blurry_threshold_manual: number;
1759
+ small_blurry_threshold_auto: number;
1760
+ small_blurry_threshold_manual: number;
1761
+ large_blurry_decimal: number;
1762
+ small_blurry_decimal: number;
1763
+ full_face_image_ratio: {
1764
+ top: number;
1765
+ right: number;
1766
+ left: number;
1767
+ bottom: number;
1768
+ };
1769
+ };
1770
+ face_check_generic: {
1771
+ front_side: {
1772
+ enable: boolean;
1773
+ };
1774
+ back_side: {
1775
+ enable: boolean;
1776
+ };
1777
+ };
1778
+ flashlight_settings: {
1779
+ activation_delay_ms_back: number;
1780
+ activation_delay_ms_front: number;
1781
+ duration_ms_back: number;
1782
+ duration_ms_front: number;
1783
+ enable_back: boolean;
1784
+ enable_front: boolean;
1785
+ };
1786
+ glare_check: {
1787
+ enable: boolean;
1788
+ threshold: number;
1789
+ };
1790
+ glare_check_generic: {
1791
+ enable: boolean;
1792
+ threshold: number;
1793
+ };
1794
+ disable_capture_button_if_alert: boolean;
1795
+ exif_data_settings: {
1796
+ enable: boolean;
1797
+ };
1798
+ id_detection: {
1799
+ enable: boolean;
1800
+ card_type_model_mapping: {
1769
1801
  'vn.national_id': {
1770
1802
  model: string;
1771
1803
  force_off_detection: boolean;
@@ -1791,65 +1823,59 @@ declare namespace defaultClientSettings {
1791
1823
  force_off_detection: boolean;
1792
1824
  };
1793
1825
  };
1794
- }
1795
- namespace limit_time_settings {
1796
- let enable_11: boolean;
1797
- export { enable_11 as enable };
1798
- export let limit_time_second: number;
1799
- export let video_partial_length_seconds: number;
1800
- export let max_retry_count: number;
1801
- export let non_stoppable: boolean;
1802
- }
1803
- namespace record_video {
1804
- let enable_record_full_session_front: boolean;
1805
- let enable_record_full_session_back: boolean;
1806
- let enable_record_from_capture_bestframe_front: boolean;
1807
- let enable_record_from_capture_bestframe_back: boolean;
1808
- let video_frame_size_width: null;
1809
- let video_frame_size_height: null;
1810
- let bitrate: number;
1811
- let fps: number;
1812
- }
1813
- namespace save_frame_settings {
1814
- let enable_12: boolean;
1815
- export { enable_12 as enable };
1816
- export let frames_interval_ms: number;
1817
- export let quality: number;
1818
- }
1819
- namespace scan_qr_settings {
1820
- let enable_13: boolean;
1821
- export { enable_13 as enable };
1822
- export let enable_validation: boolean;
1823
- export let enable_scan_background: boolean;
1824
- let limit_time_second_1: number;
1825
- export { limit_time_second_1 as limit_time_second };
1826
- let non_stoppable_1: boolean;
1827
- export { non_stoppable_1 as non_stoppable };
1828
- let max_retry_count_1: number;
1829
- export { max_retry_count_1 as max_retry_count };
1830
- export let scan_via_image: null;
1831
- export let scan_via_step: null;
1832
- }
1833
- namespace virtual_cam_hashes {
1834
- let web: boolean;
1835
- let mobile: boolean;
1836
- }
1837
- namespace image_settings {
1838
- let ideal_width: null;
1839
- let ideal_height: null;
1840
- let ideal_width_mobile_web: null;
1841
- let ideal_height_mobile_web: null;
1842
- let image_quality: number;
1843
- }
1844
- }
1845
- }
1846
- }
1847
- }
1848
- }
1826
+ };
1827
+ limit_time_settings: {
1828
+ enable: boolean;
1829
+ limit_time_second: number;
1830
+ video_partial_length_seconds: number;
1831
+ max_retry_count: number;
1832
+ non_stoppable: boolean;
1833
+ };
1834
+ record_video: {
1835
+ enable_record_full_session_front: boolean;
1836
+ enable_record_full_session_back: boolean;
1837
+ enable_record_from_capture_bestframe_front: boolean;
1838
+ enable_record_from_capture_bestframe_back: boolean;
1839
+ video_frame_size_width: null;
1840
+ video_frame_size_height: null;
1841
+ bitrate: number;
1842
+ fps: number;
1843
+ };
1844
+ save_frame_settings: {
1845
+ enable: boolean;
1846
+ frames_interval_ms: number;
1847
+ quality: number;
1848
+ };
1849
+ scan_qr_settings: {
1850
+ enable: boolean;
1851
+ enable_validation: boolean;
1852
+ enable_scan_background: boolean;
1853
+ limit_time_second: number;
1854
+ non_stoppable: boolean;
1855
+ max_retry_count: number;
1856
+ scan_via_image: null;
1857
+ scan_via_step: null;
1858
+ };
1859
+ virtual_cam_hashes: {
1860
+ web: boolean;
1861
+ mobile: boolean;
1862
+ };
1863
+ image_settings: {
1864
+ ideal_width: null;
1865
+ ideal_height: null;
1866
+ ideal_width_mobile_web: null;
1867
+ ideal_height_mobile_web: null;
1868
+ image_quality: number;
1869
+ };
1870
+ };
1871
+ };
1872
+ };
1873
+ };
1874
+ };
1849
1875
 
1850
1876
  declare class TVWebSDK extends BaseTVWebSDK {
1851
1877
  constructor(props: BaseTVWebSDKProps);
1852
1878
  }
1853
1879
 
1854
1880
  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 };
1881
+ 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.38.6",
3
+ "version": "5.40.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.38.6",
25
+ "@tsocial/tvweb-sdk": "5.40.0",
26
26
  "typescript": "^5.3.3"
27
27
  },
28
- "gitHead": "5373d37725046a0a75dcec7eee126a2861f06638"
28
+ "gitHead": "94dc2bbbeca9a2577840da334ed0c84308b2f71d"
29
29
  }