@trustchex/react-native-sdk 1.464.0 → 1.475.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/android/build.gradle +3 -3
- package/android/src/main/java/com/trustchex/reactnativesdk/camera/TrustchexCameraView.kt +190 -12
- package/ios/Camera/TrustchexCameraView.swift +244 -46
- package/ios/Permission/PermissionModule.m +22 -0
- package/ios/Permission/PermissionModule.swift +67 -0
- package/lib/module/Screens/Debug/MRZTestScreen.js +121 -147
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +24 -3
- package/lib/module/Screens/Dynamic/VerbalConsentScreen.js +1 -1
- package/lib/module/Screens/Dynamic/VideoCallScreen.js +7 -12
- package/lib/module/Screens/Static/ResultScreen.js +9 -1
- package/lib/module/Shared/Components/EIDScanner.js +166 -163
- package/lib/module/Shared/Components/FaceCamera.js +14 -8
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +45 -10
- package/lib/module/Shared/Libs/MRZ_KNOWN_ISSUES.md +112 -0
- package/lib/module/Shared/Libs/PERMISSIONS_MANAGER.md +268 -0
- package/lib/module/Shared/Libs/index.js +20 -0
- package/lib/module/Shared/Libs/mrz.utils.js +570 -16
- package/lib/module/Shared/Libs/mrzFrameAggregator.js +301 -0
- package/lib/module/Shared/Libs/mrzOcrIntegration.js +109 -0
- package/lib/module/Shared/Libs/permissions.utils.js +199 -0
- package/lib/module/Translation/Resources/en.js +1 -0
- package/lib/module/Translation/Resources/tr.js +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/src/Screens/Debug/MRZTestScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Dynamic/VideoCallScreen.d.ts.map +1 -1
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/index.d.ts +20 -0
- package/lib/typescript/src/Shared/Libs/index.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +8 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -1
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts +76 -0
- package/lib/typescript/src/Shared/Libs/mrzFrameAggregator.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/mrzOcrIntegration.d.ts +73 -0
- package/lib/typescript/src/Shared/Libs/mrzOcrIntegration.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/permissions.utils.d.ts +58 -0
- package/lib/typescript/src/Shared/Libs/permissions.utils.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -1
- package/lib/typescript/src/Translation/Resources/tr.d.ts +1 -0
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +14 -10
- package/src/Screens/Debug/MRZTestScreen.tsx +137 -166
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +45 -5
- package/src/Screens/Dynamic/VerbalConsentScreen.tsx +1 -1
- package/src/Screens/Dynamic/VideoCallScreen.tsx +8 -19
- package/src/Screens/Static/ResultScreen.tsx +18 -9
- package/src/Shared/Components/EIDScanner.tsx +210 -160
- package/src/Shared/Components/FaceCamera.tsx +19 -16
- package/src/Shared/Components/IdentityDocumentCamera.tsx +53 -13
- package/src/Shared/Libs/MRZ_KNOWN_ISSUES.md +112 -0
- package/src/Shared/Libs/PERMISSIONS_MANAGER.md +268 -0
- package/src/Shared/Libs/index.ts +63 -0
- package/src/Shared/Libs/mrz.utils.ts +639 -11
- package/src/Shared/Libs/mrzFrameAggregator.ts +370 -0
- package/src/Shared/Libs/mrzOcrIntegration.ts +175 -0
- package/src/Shared/Libs/permissions.utils.ts +251 -0
- package/src/Translation/Resources/en.ts +1 -0
- package/src/Translation/Resources/tr.ts +1 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { default as PermissionManager } from './permissions.utils';
|
|
2
|
+
export type { PermissionType } from './permissions.utils';
|
|
3
|
+
export { SignalingClient } from './SignalingClient';
|
|
4
|
+
export { setDebugMode, setLogLevel, isDebugEnabled, getLogLevel, traceLog, debugLog, infoLog, debugWarn, debugError, logError, logWarn, } from './debug.utils';
|
|
5
|
+
export { default as HTTPClient, HttpClientError, UnauthorizedError, ForbiddenError, NotFoundError, BadRequestError, TooManyRequestsError, InternalServerError, } from './http-client';
|
|
6
|
+
export * from './analytics.utils';
|
|
7
|
+
export type { Rect } from './contains';
|
|
8
|
+
export { getLocalizedCountryName } from './country-display.utils';
|
|
9
|
+
export { getSessionKey, encryptWithAes, decryptWithAes } from './crypto.utils';
|
|
10
|
+
export { default as debounce } from './debounce.utils';
|
|
11
|
+
export { handleDeepLink } from './deeplink.utils';
|
|
12
|
+
export { getSimulatedDemoData, isDemoSession } from './demo.utils';
|
|
13
|
+
export { default as MRZUtils } from './mrz.utils';
|
|
14
|
+
export { NativeDeviceInfo } from './native-device-info.utils';
|
|
15
|
+
export { default as getDeviceInfo } from './native-device-info.utils';
|
|
16
|
+
export { useKeepAwake, enableKeepAwake, disableKeepAwake, isKeepAwakeCurrentlyActive, getKeepAwakeStats, } from './native-keep-awake.utils';
|
|
17
|
+
export { runWithRetry } from './promise.utils';
|
|
18
|
+
export { configureStatusBarForWhiteBackground, useStatusBarWhiteBackground, } from './status-bar.utils';
|
|
19
|
+
export { speak, speakWithDebounce, stopSpeaking, resetLastMessage, initializeTTS, } from './tts.utils';
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,GACR,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,cAAc,mBAAmB,CAAC;AAClC,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,aAAa,CAAC"}
|
|
@@ -10,12 +10,20 @@ export interface MRZValidationResult {
|
|
|
10
10
|
valid: boolean;
|
|
11
11
|
format: MRZFormat;
|
|
12
12
|
fields?: MRZFields;
|
|
13
|
+
/**
|
|
14
|
+
* The corrected MRZ as newline-joined fixed-width lines, when a valid result
|
|
15
|
+
* was produced. This reflects the FULLY recovered MRZ — check-digit-driven
|
|
16
|
+
* field repair, composite recomputation and noisy-frame reconstruction all
|
|
17
|
+
* applied — not the lightweight `fixMRZ` pre-clean. Display this to the user.
|
|
18
|
+
*/
|
|
19
|
+
correctedMrz?: string;
|
|
13
20
|
error?: string;
|
|
14
21
|
}
|
|
15
22
|
declare const _default: {
|
|
16
23
|
fixMRZ: (rawText: string) => string;
|
|
17
24
|
validateMRZ: (mrzText: string, autocorrect?: boolean) => MRZValidationResult;
|
|
18
25
|
validateMRZWithCorrections: (mrzText: string) => MRZValidationResult;
|
|
26
|
+
reconstructMRZCandidates: (rawText: string) => string[][];
|
|
19
27
|
calculateMRZQualityScore: (mrzText: string) => number;
|
|
20
28
|
assessMRZQuality: (mrzText: string) => {
|
|
21
29
|
score: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mrz.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrz.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mrz.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrz.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAepD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;sBAOwB,MAAM,KAAG,MAAM;2BAs2B7B,MAAM,gBACF,OAAO,KACnB,mBAAmB;0CAwIuB,MAAM,KAAG,mBAAmB;wCA3yB9B,MAAM,KAAG,MAAM,EAAE,EAAE;wCAqzBnB,MAAM,KAAG,MAAM;gCAmDvB,MAAM;;;;;+BAnrBP,MAAM,KAAG,OAAO;iCA4Bd,MAAM,KAAG,MAAM;wCAqqBR,MAAM,GAAG,IAAI,KAAG,MAAM,GAAG,IAAI;;AAgBxE,wBAUE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { MRZValidationResult } from './mrz.utils';
|
|
2
|
+
export interface MRZFrameInput {
|
|
3
|
+
/** Raw OCR text for this frame (assembled MRZ blocks, newline-separated). */
|
|
4
|
+
text: string;
|
|
5
|
+
/**
|
|
6
|
+
* Optional per-frame quality weight (higher = sharper/closer). Defaults to 1.
|
|
7
|
+
* A caller can pass e.g. a sharpness/focus estimate or the MRZ block's pixel
|
|
8
|
+
* height so crisper frames dominate the vote, per the research finding that
|
|
9
|
+
* focus-weighted voting beats unweighted.
|
|
10
|
+
*/
|
|
11
|
+
weight?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface MRZConsensus {
|
|
14
|
+
/** Best consensus MRZ (newline-joined fixed-width lines), or null if none yet. */
|
|
15
|
+
mrz: string | null;
|
|
16
|
+
/** Validation of the current consensus (valid only when check digits pass). */
|
|
17
|
+
validation: MRZValidationResult | null;
|
|
18
|
+
/** Number of frames that contributed a usable line-set so far. */
|
|
19
|
+
frames: number;
|
|
20
|
+
/**
|
|
21
|
+
* True when the consensus is valid AND stable — it has not changed across the
|
|
22
|
+
* last `stabilityTarget` contributing frames. Callers should advance only then.
|
|
23
|
+
*/
|
|
24
|
+
stable: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface MRZFrameAggregatorOptions {
|
|
27
|
+
/**
|
|
28
|
+
* How many consecutive contributing frames the valid consensus must remain
|
|
29
|
+
* unchanged before it is considered stable. Default 2.
|
|
30
|
+
*/
|
|
31
|
+
stabilityTarget?: number;
|
|
32
|
+
/** Drop the running tallies after this many frames to bound memory. Default 60. */
|
|
33
|
+
maxFrames?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Stateful aggregator. Feed it one frame's OCR text at a time via `addFrame`;
|
|
37
|
+
* after each it returns the current per-character-voted consensus and whether it
|
|
38
|
+
* is valid + stable. Reset between documents with `reset`.
|
|
39
|
+
*/
|
|
40
|
+
export declare class MRZFrameAggregator {
|
|
41
|
+
private readonly stabilityTarget;
|
|
42
|
+
private readonly maxFrames;
|
|
43
|
+
private tallies;
|
|
44
|
+
private frameCount;
|
|
45
|
+
private lastConsensusMrz;
|
|
46
|
+
private stableStreak;
|
|
47
|
+
private mismatchStreak;
|
|
48
|
+
constructor(options?: MRZFrameAggregatorOptions);
|
|
49
|
+
reset(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Returns true when the incoming frame's identifying region (the line-1 data
|
|
52
|
+
* span that holds the document number) has disagreed with the current
|
|
53
|
+
* consensus for enough consecutive frames to conclude a NEW document is in
|
|
54
|
+
* view — so the caller should drop the stale votes. A few disagreeing frames
|
|
55
|
+
* are tolerated as OCR noise; a sustained disagreement is a document swap.
|
|
56
|
+
*/
|
|
57
|
+
private detectDocumentChange;
|
|
58
|
+
/** Frames contributed so far. */
|
|
59
|
+
get frames(): number;
|
|
60
|
+
private ensureTally;
|
|
61
|
+
/**
|
|
62
|
+
* Ingest one frame and return the current consensus. The frame's lines are
|
|
63
|
+
* voted into the tally for whichever format they match; the consensus is then
|
|
64
|
+
* read out per format and validated, and the best valid (or best-effort)
|
|
65
|
+
* consensus is returned.
|
|
66
|
+
*/
|
|
67
|
+
addFrame(input: MRZFrameInput): MRZConsensus;
|
|
68
|
+
/** Halve all tallies to bound memory while preserving relative vote ratios. */
|
|
69
|
+
private decay;
|
|
70
|
+
/** Read out the winning character per cell for a format. */
|
|
71
|
+
private consensusLines;
|
|
72
|
+
/** Best consensus across all formats seen, validated with check digits. */
|
|
73
|
+
currentConsensus(): MRZConsensus;
|
|
74
|
+
}
|
|
75
|
+
export default MRZFrameAggregator;
|
|
76
|
+
//# sourceMappingURL=mrzFrameAggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mrzFrameAggregator.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrzFrameAggregator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkCvD,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,+EAA+E;IAC/E,UAAU,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkFD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,YAAY,CAAK;IAEzB,OAAO,CAAC,cAAc,CAAK;gBAEf,OAAO,GAAE,yBAA8B;IAKnD,KAAK,IAAI,IAAI;IAQb;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IA0B5B,iCAAiC;IACjC,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,WAAW;IAUnB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY;IAuC5C,+EAA+E;IAC/E,OAAO,CAAC,KAAK;IAab,4DAA4D;IAC5D,OAAO,CAAC,cAAc;IA8BtB,2EAA2E;IAC3E,gBAAgB,IAAI,YAAY;CAgDjC;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { MRZValidationResult } from './mrz.utils';
|
|
2
|
+
/**
|
|
3
|
+
* On-device MRZ ↔ OCR integration test harness.
|
|
4
|
+
*
|
|
5
|
+
* Runs the REAL ML Kit v2 text recognizer (via the native `MLKitModule`) on a
|
|
6
|
+
* still test image, assembles the recognized text exactly like the camera path
|
|
7
|
+
* does, feeds it through `validateMRZWithCorrections`, and reports whether the
|
|
8
|
+
* OCR-misread MRZ was corrected to a check-digit-valid result.
|
|
9
|
+
*
|
|
10
|
+
* This must run on a device/emulator (ML Kit is native) — it is not a jest test.
|
|
11
|
+
* Feed it the synthetic MRZ images under
|
|
12
|
+
* `src/Screens/Debug/__fixtures__/mrz-images/` (generated by
|
|
13
|
+
* `scripts/gen-mrz-test-images.py`), e.g. read with react-native-fs and pass the
|
|
14
|
+
* base64 to `runMrzOcrSuite`. The check-digit-driven correction in
|
|
15
|
+
* `mrz.utils.ts` is what these images exercise end-to-end against real OCR.
|
|
16
|
+
*
|
|
17
|
+
* ML Kit Text Recognition v2:
|
|
18
|
+
* https://developers.google.com/ml-kit/vision/text-recognition/v2
|
|
19
|
+
*/
|
|
20
|
+
interface NativeTextBlock {
|
|
21
|
+
text?: string;
|
|
22
|
+
boundingBox?: {
|
|
23
|
+
left: number;
|
|
24
|
+
top: number;
|
|
25
|
+
right: number;
|
|
26
|
+
bottom: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** A single image-based test case. */
|
|
30
|
+
export interface MrzOcrTestCase {
|
|
31
|
+
/** Human label, e.g. "TD1 specimen — straight-on". */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Base64-encoded JPEG/PNG of the (synthetic) MRZ document. */
|
|
34
|
+
base64: string;
|
|
35
|
+
/**
|
|
36
|
+
* Optional expectations. When omitted, the test passes if the MRZ validates.
|
|
37
|
+
* Provide these for stronger assertions against the known synthetic values.
|
|
38
|
+
*/
|
|
39
|
+
expect?: {
|
|
40
|
+
valid?: boolean;
|
|
41
|
+
documentNumber?: string;
|
|
42
|
+
birthDate?: string;
|
|
43
|
+
expirationDate?: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface MrzOcrTestResult {
|
|
47
|
+
name: string;
|
|
48
|
+
passed: boolean;
|
|
49
|
+
/** Raw text ML Kit produced (joined blocks). Useful for debugging failures. */
|
|
50
|
+
rawOcr: string;
|
|
51
|
+
/** Validation result after correction. */
|
|
52
|
+
validation: MRZValidationResult;
|
|
53
|
+
/** Why it failed (empty when passed). */
|
|
54
|
+
reason?: string;
|
|
55
|
+
/** Time spent in OCR + correction, ms. */
|
|
56
|
+
durationMs: number;
|
|
57
|
+
}
|
|
58
|
+
/** Assemble the OCR blocks into newline-separated text, mirroring the camera path. */
|
|
59
|
+
export declare const assembleOcrText: (blocks: NativeTextBlock[]) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Runs one image through real ML Kit OCR + MRZ correction and checks expectations.
|
|
62
|
+
*/
|
|
63
|
+
export declare const runMrzOcrCase: (testCase: MrzOcrTestCase, now?: () => number) => Promise<MrzOcrTestResult>;
|
|
64
|
+
export interface MrzOcrSuiteResult {
|
|
65
|
+
total: number;
|
|
66
|
+
passed: number;
|
|
67
|
+
failed: number;
|
|
68
|
+
results: MrzOcrTestResult[];
|
|
69
|
+
}
|
|
70
|
+
/** Runs every case sequentially and aggregates pass/fail. */
|
|
71
|
+
export declare const runMrzOcrSuite: (cases: MrzOcrTestCase[]) => Promise<MrzOcrSuiteResult>;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=mrzOcrIntegration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mrzOcrIntegration.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/mrzOcrIntegration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AAEH,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5E;AASD,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,UAAU,EAAE,mBAAmB,CAAC;IAChC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,sFAAsF;AACtF,eAAO,MAAM,eAAe,GAAI,QAAQ,eAAe,EAAE,KAAG,MAI7C,CAAC;AAEhB;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,UAAU,cAAc,EACxB,MAAK,MAAM,MAAiB,KAC3B,OAAO,CAAC,gBAAgB,CAuE1B,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,6DAA6D;AAC7D,eAAO,MAAM,cAAc,GACzB,OAAO,cAAc,EAAE,KACtB,OAAO,CAAC,iBAAiB,CAY3B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type PermissionType = 'camera' | 'microphone' | 'nfc';
|
|
2
|
+
declare class PermissionManager {
|
|
3
|
+
private static permissionCache;
|
|
4
|
+
/**
|
|
5
|
+
* Request a single permission
|
|
6
|
+
*/
|
|
7
|
+
static requestPermission(permission: PermissionType): Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* Request multiple permissions at once
|
|
10
|
+
*/
|
|
11
|
+
static requestPermissions(permissions: PermissionType[]): Promise<Map<PermissionType, boolean>>;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a permission is granted (without requesting)
|
|
14
|
+
*/
|
|
15
|
+
static checkPermission(permission: PermissionType): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Request permission with user-friendly error handling
|
|
18
|
+
*/
|
|
19
|
+
static requestWithFallback(permission: PermissionType, onDenied?: () => void): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Convenience method: Request camera and microphone together (for video recording)
|
|
22
|
+
*/
|
|
23
|
+
static requestCameraAndMicrophone(): Promise<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Convenience method: Request camera only
|
|
26
|
+
*/
|
|
27
|
+
static requestCamera(): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Convenience method: Request microphone only
|
|
30
|
+
*/
|
|
31
|
+
static requestMicrophone(): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Convenience method: Request NFC only
|
|
34
|
+
*/
|
|
35
|
+
static requestNFC(): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Check if camera and microphone are both accessible
|
|
38
|
+
*/
|
|
39
|
+
static hasCameraAndMicrophone(): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Check if camera is accessible
|
|
42
|
+
*/
|
|
43
|
+
static hasCamera(): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Check if microphone is accessible
|
|
46
|
+
*/
|
|
47
|
+
static hasMicrophone(): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Check if NFC is accessible
|
|
50
|
+
*/
|
|
51
|
+
static hasNFC(): Promise<boolean>;
|
|
52
|
+
private static permissionTypeToAndroid;
|
|
53
|
+
private static requestAndroidPermission;
|
|
54
|
+
private static requestIOSPermission;
|
|
55
|
+
private static checkIOSPermission;
|
|
56
|
+
}
|
|
57
|
+
export default PermissionManager;
|
|
58
|
+
//# sourceMappingURL=permissions.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.utils.d.ts","sourceRoot":"","sources":["../../../../../src/Shared/Libs/permissions.utils.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAE7D,cAAM,iBAAiB;IACrB,OAAO,CAAC,MAAM,CAAC,eAAe,CAA2C;IAEzE;;OAEG;WACU,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB5E;;OAEG;WACU,kBAAkB,CAC7B,WAAW,EAAE,cAAc,EAAE,GAC5B,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAyBxC;;OAEG;WACU,eAAe,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAmB1E;;OAEG;WACU,mBAAmB,CAC9B,UAAU,EAAE,cAAc,EAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,OAAO,CAAC;IAYnB;;OAEG;WACU,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC;IAS3D;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9C;;OAEG;WACU,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIlD;;OAEG;WACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI3C;;OAEG;WACU,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC;IAMvD;;OAEG;WACU,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAI1C;;OAEG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9C;;OAEG;WACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAMvC,OAAO,CAAC,MAAM,CAAC,uBAAuB;mBASjB,wBAAwB;mBAQxB,oBAAoB;mBAkCpB,kBAAkB;CA2BxC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -82,6 +82,7 @@ declare const _default: {
|
|
|
82
82
|
'eidScannerScreen.docTypeResidence': string;
|
|
83
83
|
'eidScannerScreen.docTypeVisa': string;
|
|
84
84
|
'eidScannerScreen.expirationDate': string;
|
|
85
|
+
'eidScannerScreen.issuingState': string;
|
|
85
86
|
'eidScannerScreen.mrzText': string;
|
|
86
87
|
'eidScannerScreen.nfcNotSupported': string;
|
|
87
88
|
'eidScannerScreen.nfcNotEnabled': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/en.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyPE"}
|
|
@@ -82,6 +82,7 @@ declare const _default: {
|
|
|
82
82
|
'eidScannerScreen.docTypeResidence': string;
|
|
83
83
|
'eidScannerScreen.docTypeVisa': string;
|
|
84
84
|
'eidScannerScreen.expirationDate': string;
|
|
85
|
+
'eidScannerScreen.issuingState': string;
|
|
85
86
|
'eidScannerScreen.mrzText': string;
|
|
86
87
|
'eidScannerScreen.nfcNotSupported': string;
|
|
87
88
|
'eidScannerScreen.nfcNotEnabled': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../../src/Translation/Resources/tr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA4PE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.475.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustchex/react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.475.0",
|
|
4
4
|
"description": "Trustchex mobile app react native SDK for android or ios devices",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -60,7 +60,16 @@
|
|
|
60
60
|
"@react-navigation/core": "7.12.4",
|
|
61
61
|
"@react-navigation/native": "7.1.18",
|
|
62
62
|
"@react-navigation/native-stack": "7.3.27",
|
|
63
|
-
"@react-navigation/elements": "2.6.5"
|
|
63
|
+
"@react-navigation/elements": "2.6.5",
|
|
64
|
+
"lodash": "4.17.23",
|
|
65
|
+
"brace-expansion": "1.1.13",
|
|
66
|
+
"minimatch": "3.1.4",
|
|
67
|
+
"qs": "6.15.2",
|
|
68
|
+
"ip-address": "10.1.1",
|
|
69
|
+
"uuid": "11.1.1",
|
|
70
|
+
"yaml": "2.8.3",
|
|
71
|
+
"fast-uri": "3.1.2",
|
|
72
|
+
"flatted": "3.4.2"
|
|
64
73
|
},
|
|
65
74
|
"scripts": {
|
|
66
75
|
"example": "yarn workspace @trustchex/react-native-sdk-example",
|
|
@@ -116,7 +125,6 @@
|
|
|
116
125
|
"react-native-svg": "^15.12.0",
|
|
117
126
|
"react-native-tts": "^4.1.1",
|
|
118
127
|
"react-native-video": "^6.16.1",
|
|
119
|
-
"react-native-vision-camera": "^4.7.1",
|
|
120
128
|
"react-native-webrtc": "^124.0.0",
|
|
121
129
|
"react-native-webview": "^13.15.0",
|
|
122
130
|
"release-it": "^17.10.0",
|
|
@@ -129,6 +137,7 @@
|
|
|
129
137
|
"buffer": "^6.0.3",
|
|
130
138
|
"crypto-js": "^4.2.0",
|
|
131
139
|
"elliptic": "^6.6.1",
|
|
140
|
+
"hash.js": "^1.1.7",
|
|
132
141
|
"i18next": "^25.3.2",
|
|
133
142
|
"jpeg2000": "^1.1.1",
|
|
134
143
|
"mrz": "^5.0.1",
|
|
@@ -153,10 +162,8 @@
|
|
|
153
162
|
"react-native-svg": ">=15.12.0",
|
|
154
163
|
"react-native-tts": ">=4.1.1",
|
|
155
164
|
"react-native-video": ">=6.16.1",
|
|
156
|
-
"react-native-vision-camera": ">=4.7.1",
|
|
157
165
|
"react-native-webrtc": ">=124.0.0",
|
|
158
|
-
"react-native-webview": ">=13.15.0"
|
|
159
|
-
"react-native-worklets-core": ">=1.6.2"
|
|
166
|
+
"react-native-webview": ">=13.15.0"
|
|
160
167
|
},
|
|
161
168
|
"peerDependenciesMeta": {
|
|
162
169
|
"@react-navigation/native": {
|
|
@@ -210,9 +217,6 @@
|
|
|
210
217
|
"react-native-video": {
|
|
211
218
|
"optional": false
|
|
212
219
|
},
|
|
213
|
-
"react-native-vision-camera": {
|
|
214
|
-
"optional": false
|
|
215
|
-
},
|
|
216
220
|
"react-native-webrtc": {
|
|
217
221
|
"optional": false
|
|
218
222
|
},
|
|
@@ -231,7 +235,7 @@
|
|
|
231
235
|
"<rootDir>/lib/"
|
|
232
236
|
],
|
|
233
237
|
"transformIgnorePatterns": [
|
|
234
|
-
"node_modules/(?!(uuid|react-native|@react-native|react-native-device-info|react-native-get-random-values|react-native-fs)/)"
|
|
238
|
+
"node_modules/(?!(uuid|mrz|react-native|@react-native|react-native-device-info|react-native-get-random-values|react-native-fs)/)"
|
|
235
239
|
]
|
|
236
240
|
},
|
|
237
241
|
"commitlint": {
|