react-native-unit-components 3.1.2-beta.7 → 3.2.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/README.md +77 -1
- package/android/src/main/java/com/unitreactnativecomponents/nativeModules/sharefile/UNShareFile.kt +18 -8
- package/ios/NativeModules/UNShareFile/UNShareFileExportModule.m +7 -0
- package/ios/NativeModules/UNShareFile/UNShareFileModule.swift +54 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +25 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +14 -2
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -1
- package/lib/commonjs/messages/webMessages/veryfiMessages.js +11 -0
- package/lib/commonjs/messages/webMessages/veryfiMessages.js.map +1 -0
- package/lib/commonjs/nativeModulesHelpers/RNShareFile/RNShareFile.js +1 -11
- package/lib/commonjs/nativeModulesHelpers/RNShareFile/RNShareFile.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +18 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/services/veryfiService.js +107 -0
- package/lib/commonjs/services/veryfiService.js.map +1 -0
- package/lib/commonjs/slices/ConfigurationSlice.js +7 -2
- package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -1
- package/lib/commonjs/types/shared/index.js +11 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/types/shared/veryfi.types.js +2 -0
- package/lib/commonjs/types/shared/veryfi.types.js.map +1 -0
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js +4 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.js +8 -3
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js +19 -10
- package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +4 -3
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +27 -3
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +13 -2
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -1
- package/lib/module/messages/webMessages/veryfiMessages.js +5 -0
- package/lib/module/messages/webMessages/veryfiMessages.js.map +1 -0
- package/lib/module/nativeModulesHelpers/RNShareFile/RNShareFile.js +2 -12
- package/lib/module/nativeModulesHelpers/RNShareFile/RNShareFile.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +17 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/services/veryfiService.js +99 -0
- package/lib/module/services/veryfiService.js.map +1 -0
- package/lib/module/slices/ConfigurationSlice.js +5 -1
- package/lib/module/slices/ConfigurationSlice.js.map +1 -1
- package/lib/module/types/shared/index.js +1 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/types/shared/veryfi.types.js +2 -0
- package/lib/module/types/shared/veryfi.types.js.map +1 -0
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js +5 -2
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js.map +1 -1
- package/lib/module/webComponent/WebComponent.js +8 -3
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/WebComponent.utils.js +20 -11
- package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/module/webComponent/html.js +5 -4
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +5 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/veryfiMessages.d.ts +4 -0
- package/lib/typescript/src/messages/webMessages/veryfiMessages.d.ts.map +1 -0
- package/lib/typescript/src/nativeModulesHelpers/RNShareFile/RNShareFile.d.ts +5 -1
- package/lib/typescript/src/nativeModulesHelpers/RNShareFile/RNShareFile.d.ts.map +1 -1
- package/lib/typescript/src/scripts/html/bodyScript.d.ts +2 -0
- package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
- package/lib/typescript/src/services/veryfiService.d.ts +8 -0
- package/lib/typescript/src/services/veryfiService.d.ts.map +1 -0
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts +3 -1
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/index.d.ts +1 -0
- package/lib/typescript/src/types/shared/index.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/veryfi.types.d.ts +7 -0
- package/lib/typescript/src/types/shared/veryfi.types.d.ts.map +1 -0
- package/lib/typescript/src/unitComponentsSdkManager/UnitComponentsSdkManager.d.ts +2 -0
- package/lib/typescript/src/unitComponentsSdkManager/UnitComponentsSdkManager.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/WebComponent.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/WebComponent.utils.d.ts +5 -1
- package/lib/typescript/src/webComponent/WebComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/html.d.ts.map +1 -1
- package/package.json +11 -4
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +1 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +33 -4
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.ts +14 -2
- package/src/messages/webMessages/veryfiMessages.ts +3 -0
- package/src/nativeModulesHelpers/RNShareFile/RNShareFile.ts +5 -15
- package/src/scripts/html/bodyScript.ts +19 -0
- package/src/services/veryfiService.ts +123 -0
- package/src/slices/ConfigurationSlice.ts +7 -2
- package/src/types/shared/index.ts +1 -0
- package/src/types/shared/veryfi.types.ts +6 -0
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.ts +7 -2
- package/src/webComponent/WebComponent.tsx +7 -3
- package/src/webComponent/WebComponent.utils.ts +19 -9
- package/src/webComponent/html.ts +5 -3
package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNCheckDepositComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"UNCheckDepositComponent.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAqB,0BAA0B,EAAkC,MAAM,oBAAoB,CAAC;AAWnJ,MAAM,WAAW,4BAA4B;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,0BAA0B,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACnE,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IACvD,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IACvD,+BAA+B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7C,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5C;;AAoHD,wBAAqF"}
|
package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { UNCheckDepositComponentProps } from './UNCheckDepositComponent';
|
|
2
|
-
|
|
2
|
+
import { type UNVeryfiImage } from '../../services/veryfiService';
|
|
3
|
+
import type WebView from 'react-native-webview';
|
|
4
|
+
import type { UNVeryfiCredentials } from '../../types/shared/veryfi.types';
|
|
5
|
+
export declare const getCheckDepositParams: (props: UNCheckDepositComponentProps, veryfiCredentials?: UNVeryfiCredentials | null) => string;
|
|
3
6
|
export declare const getCheckDepositScript: () => string;
|
|
7
|
+
export declare const injectUnitVeryfiResponse: (currentWeb: WebView | null, images: UNVeryfiImage[]) => void;
|
|
4
8
|
//# sourceMappingURL=UNCheckDepositComponent.utils.d.ts.map
|
package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNCheckDepositComponent.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"UNCheckDepositComponent.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAE9E,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,eAAO,MAAM,qBAAqB,UAAW,4BAA4B,sBAAsB,mBAAmB,GAAG,IAAI,WAWxH,CAAC;AAyBF,eAAO,MAAM,qBAAqB,cAQjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,OAAO,GAAG,IAAI,UAAU,aAAa,EAAE,SAG3F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"veryfiMessages.d.ts","sourceRoot":"","sources":["../../../../../src/messages/webMessages/veryfiMessages.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,oBAAoB,uBAAuB;CAC5C"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
interface Spec extends TurboModule {
|
|
3
|
+
share(base64Data: string, filename: string): Promise<boolean>;
|
|
4
|
+
}
|
|
5
|
+
declare const UNShareFileModule: Spec;
|
|
2
6
|
export default UNShareFileModule;
|
|
3
7
|
//# sourceMappingURL=RNShareFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RNShareFile.d.ts","sourceRoot":"","sources":["../../../../../src/nativeModulesHelpers/RNShareFile/RNShareFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RNShareFile.d.ts","sourceRoot":"","sources":["../../../../../src/nativeModulesHelpers/RNShareFile/RNShareFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAG9C,UAAU,IAAK,SAAQ,WAAW;IAChC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9D;AAED,QAAA,MAAM,iBAAiB,MAA8D,CAAC;AAEtF,eAAe,iBAAiB,CAAC"}
|
|
@@ -42,6 +42,7 @@ export declare const DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT: string;
|
|
|
42
42
|
export declare const DISPATCH_MULTIPLE_CARDS_FILTER_CHANGED_EVENT: string;
|
|
43
43
|
export declare const DISPATCH_CARD_CREATED_EVENT: string;
|
|
44
44
|
export declare const DISPATCH_PLAID_RESPONSE: string;
|
|
45
|
+
export declare const DISPATCH_VERYFI_RESPONSE: string;
|
|
45
46
|
export declare const DISPATCH_PLAID_EXIT: string;
|
|
46
47
|
export declare const DISPATCH_OPEN_PLAID: string;
|
|
47
48
|
export declare const DISPATCH_OPEN_ACTIONS_MENU = "\n const dispatchOpenActionsMenu = (componentName) => {\n document.querySelector(componentName).dispatchEvent(new CustomEvent(\"unitRequestOpenActionsMenu\"))\n }\n";
|
|
@@ -50,5 +51,6 @@ export declare const DISPATCH_REQUEST_HIDE_SENSITIVE_DATA = "\n const dispatc
|
|
|
50
51
|
export declare const DISPATCH_REQUEST_SHOW_SENSITIVE_DATA = "\n const dispatchRequestShowSensitiveData = (componentName) => {\n document.querySelector(componentName).dispatchEvent(new CustomEvent(\"unitRequestShowSensitiveData\"))\n }\n";
|
|
51
52
|
export declare const DISPATCH_REQUEST_ACCOUNT_ACTION = "\n const dispatchRequestAccountAction = (action) => {\n document.querySelector(\"unit-elements-account\").dispatchEvent(new CustomEvent(\"unitRequestAccountAction\", {detail: {action: action}}))\n }\n";
|
|
52
53
|
export declare const DISPATCH_ACCOUNT_CREATED_EVENT: string;
|
|
54
|
+
export declare const DISPATCH_ON_DOWNLOAD = "\n const dispatchOnDownload = (url, error) => {\n const detail = { type: \"unitOnDownload\", url: url };\n if (error) { detail.error = error; }\n const event = new CustomEvent(\"unitOnDownload\", { detail: detail });\n window.dispatchEvent(event);\n }\n";
|
|
53
55
|
export declare const DISPATCH_COUNTERPARTY_DELETED = "\n const dispatchCounterpartyDeletedEvent = (details) => {\n const event = new CustomEvent(\"unitCounterpartyDeleted\",{ detail: { data: details } });\n window.dispatchEvent(event);\n }\n";
|
|
54
56
|
//# sourceMappingURL=bodyScript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodyScript.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/html/bodyScript.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bodyScript.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/html/bodyScript.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,mBAAmB,6NAO/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAO5B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+PrB,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAKpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAKtC,CAAC;AAEF,eAAO,MAAM,sEAAsE,QAIlF,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAKxC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAWpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,4GAIzC,CAAC;AAEF,eAAO,MAAM,sCAAsC,QAKlD,CAAC;AAEF,eAAO,MAAM,4CAA4C,QAKxD,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAMvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAKnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAOpC,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAK/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAK/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,oLAItC,CAAC;AAEF,eAAO,MAAM,4BAA4B,+MAIxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,gMAIhD,CAAC;AAEF,eAAO,MAAM,oCAAoC,iMAIhD,CAAC;AAEF,eAAO,MAAM,+BAA+B,wNAI3C,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAI1C,CAAC;AAEF,eAAO,MAAM,oBAAoB,gRAOhC,CAAC;AAEF,eAAO,MAAM,6BAA6B,wMAKzC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UNVeryfiCredentials } from '../types/shared/veryfi.types';
|
|
2
|
+
export declare const isVeryfiAvailable: () => boolean;
|
|
3
|
+
export interface UNVeryfiImage {
|
|
4
|
+
base64Img: string;
|
|
5
|
+
isFront: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const configureAndShowVeryfiCamera: (credentials: UNVeryfiCredentials, onImages: (images: UNVeryfiImage[]) => void, onError: (error: string) => void) => void;
|
|
8
|
+
//# sourceMappingURL=veryfiService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"veryfiService.d.ts","sourceRoot":"","sources":["../../../../src/services/veryfiService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAWxE,eAAO,MAAM,iBAAiB,QAAO,OAEpC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAYD,eAAO,MAAM,4BAA4B,gBAC1B,mBAAmB,qBACb,aAAa,EAAE,KAAK,IAAI,mBAC1B,MAAM,KAAK,IAAI,KAC/B,IAuFF,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { RootState } from '../store';
|
|
2
|
+
import type { UNVeryfiCredentials } from '../types/shared/veryfi.types';
|
|
2
3
|
export interface ConfigurationState {
|
|
3
4
|
unitScript?: string;
|
|
4
5
|
theme?: string;
|
|
5
6
|
language?: string;
|
|
6
7
|
customerToken?: string;
|
|
8
|
+
veryfiCredentials?: UNVeryfiCredentials;
|
|
7
9
|
}
|
|
8
|
-
export declare const setUnitScript: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setUnitScript">, setLanguage: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setLanguage">, setTheme: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setTheme">, setCustomerToken: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setCustomerToken">;
|
|
10
|
+
export declare const setUnitScript: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setUnitScript">, setLanguage: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setLanguage">, setTheme: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setTheme">, setCustomerToken: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "Configuration/setCustomerToken">, setVeryfiCredentials: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<UNVeryfiCredentials | undefined, "Configuration/setVeryfiCredentials">;
|
|
9
11
|
export declare const selectConfiguration: (state: RootState) => ConfigurationState;
|
|
10
12
|
declare const _default: import("redux").Reducer<ConfigurationState, import("redux").AnyAction>;
|
|
11
13
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationSlice.d.ts","sourceRoot":"","sources":["../../../../src/slices/ConfigurationSlice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurationSlice.d.ts","sourceRoot":"","sources":["../../../../src/slices/ConfigurationSlice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,mBAAmB,CAAC;CACzC;AA0BD,eAAO,MAAQ,aAAa,kHAAE,WAAW,gHAAE,QAAQ,6GAAE,gBAAgB,qHAAE,oBAAoB,oIAA+B,CAAC;AAC3H,eAAO,MAAM,mBAAmB,UAAW,SAAS,uBAAwB,CAAC;;AAC7E,wBAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mCAAmC,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"veryfi.types.d.ts","sourceRoot":"","sources":["../../../../../src/types/shared/veryfi.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -3,6 +3,7 @@ import { UnitComponentsUiManager } from './unitComponentsUiManager/unitComponent
|
|
|
3
3
|
import type { UNFonts } from '../types/shared/fonts.types';
|
|
4
4
|
import type { UNComponentsWebVersioningStrategy } from '../types/shared';
|
|
5
5
|
import { UNComponentsEnvironment } from '../types/shared/env.types';
|
|
6
|
+
import type { UNVeryfiCredentials } from '../types/shared/veryfi.types';
|
|
6
7
|
import { UnitComponentsHelpersManager } from './unitComponentsHelpersManager/UnitComponentsHelpersManager';
|
|
7
8
|
import { UNComponentsSecuritySettings } from '../types/shared/securitySettings';
|
|
8
9
|
export declare class UnitComponentsSDK {
|
|
@@ -34,6 +35,7 @@ export declare class UnitComponentsSDK {
|
|
|
34
35
|
static getSignedNonce: () => string | undefined;
|
|
35
36
|
static setCustomerToken: (customerToken: string) => void;
|
|
36
37
|
static getSdkVersion: () => string;
|
|
38
|
+
static setVeryfiCredentials: (credentials: UNVeryfiCredentials) => void;
|
|
37
39
|
static cleanUserData: () => void;
|
|
38
40
|
}
|
|
39
41
|
//# sourceMappingURL=UnitComponentsSdkManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitComponentsSdkManager.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"UnitComponentsSdkManager.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAA0C,MAAM,kCAAkC,CAAC;AAIxH,qBAAa,iBAAiB;IAC5B,OAAc,EAAE,EAAE,uBAAuB,CAAC;IAC1C,OAAc,OAAO,EAAE,4BAA4B,CAAC;IAEpD,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC/C,SAAS,CAAC,MAAM,CAAC,qBAAqB,EAAE,iCAAiC,CAAC;IAC1E,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAA6C;IAC5G,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IACtC,SAAS,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,OAAO,aAAa,CAAC;IAC5D,SAAS,CAAC,MAAM,CAAC,UAAU,SAAW;IACtC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAErD,OAAc,IAAI,QACX,uBAAuB,UACpB,MAAM,aACH,MAAM,UACT,OAAO,0BACQ,iCAAiC,qBACtC,4BAA4B,mBA4B9C;IAEF,OAAc,aAAa,gBAEzB;IAEF,OAAc,yBAAyB,yBAA0B,oBAAoB,UAEnF;IAEF,OAAc,sBAAsB,+DAElC;IAEF,OAAc,mBAAmB,qCAE/B;IAEF;;OAEG;IACH,OAAc,cAAc,gBAAiB,MAAM,UAEjD;IAEF,OAAc,MAAM,4CAElB;IAEF,OAAc,wBAAwB,0CAEpC;IAEF,OAAc,QAAQ,4BAEpB;IAEF;;OAEG;IACH,OAAc,cAAc,2BAE1B;IAEF,OAAc,gBAAgB,kBAAmB,MAAM,UAErD;IAEF,OAAc,aAAa,eAEzB;IAEF,OAAc,oBAAoB,gBAAiB,mBAAmB,UAEpE;IAEF,OAAc,aAAa,aAIzB;CAEH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebComponent.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/WebComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAapE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAU1F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"WebComponent.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/WebComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAapE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAU1F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,uFA6LvB,CAAC"}
|
|
@@ -3,6 +3,10 @@ import WebView from 'react-native-webview';
|
|
|
3
3
|
export declare const getInfoParams: () => Promise<{
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}>;
|
|
6
|
-
export
|
|
6
|
+
export interface DownloadResult {
|
|
7
|
+
url: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const handleRequestDownload: (details: RequestDownloadEvent) => Promise<DownloadResult>;
|
|
7
11
|
export declare const injectEventToContinue: (currentWeb: WebView | null, eventToContinueEvent: EventToContinueEvent) => void;
|
|
8
12
|
//# sourceMappingURL=WebComponent.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebComponent.utils.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/WebComponent.utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAEjH,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAG3C,eAAO,MAAM,aAAa;;EAazB,CAAC;AAEF,eAAO,MAAM,qBAAqB,YAAmB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"WebComponent.utils.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/WebComponent.utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAEjH,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAG3C,eAAO,MAAM,aAAa;;EAazB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,eAAO,MAAM,qBAAqB,YAAmB,oBAAoB,KAAG,QAAQ,cAAc,CAuBjG,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,OAAO,GAAG,IAAI,wBAAwB,oBAAoB,SAE3G,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/html.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AAEF,QAAA,MAAM,QAAQ,QAuGb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-unit-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Unit React Native components",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
"prepare": "bob build",
|
|
30
30
|
"example": "yarn --cwd example",
|
|
31
31
|
"cleanNodeModules": "rm -rf node_modules",
|
|
32
|
-
"
|
|
32
|
+
"setup-veryfi": "node scripts/setup-veryfi.js",
|
|
33
|
+
"bootstrap": "node scripts/setup-veryfi.js && yarn cleanNodeModules && yarn example cleanNodeModules && yarn example && yarn && yarn example pods",
|
|
33
34
|
"cleanAll": "rm -rf node_modules example/node_modules android/build example/android/build example/ios/pods",
|
|
34
35
|
"installAll": "yarn installOldArch && yarn installNewArch",
|
|
35
|
-
"installOldArch": "yarn install && cd example && yarn install && cd ios && pod install",
|
|
36
|
-
"installNewArch": "yarn install && cd exampleNewArch && yarn install && cd ios && pod install"
|
|
36
|
+
"installOldArch": "node scripts/setup-veryfi.js && yarn install && cd example && yarn install && cd ios && pod install",
|
|
37
|
+
"installNewArch": "node scripts/setup-veryfi.js && yarn install && cd exampleNewArch && yarn install && cd ios && pod install"
|
|
37
38
|
},
|
|
38
39
|
"keywords": [
|
|
39
40
|
"react-native",
|
|
@@ -77,12 +78,18 @@
|
|
|
77
78
|
"@types/react": "^16.14.20"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
81
|
+
"@veryfi/react-native-veryfi-lens": "*",
|
|
80
82
|
"react": "*",
|
|
81
83
|
"react-native": "*",
|
|
82
84
|
"react-native-plaid-link-sdk": "*",
|
|
83
85
|
"react-native-safe-area-context": ">=4.0.0",
|
|
84
86
|
"react-native-webview": "*"
|
|
85
87
|
},
|
|
88
|
+
"peerDependenciesMeta": {
|
|
89
|
+
"@veryfi/react-native-veryfi-lens": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
86
93
|
"dependencies": {
|
|
87
94
|
"@reduxjs/toolkit": "^1.9.5",
|
|
88
95
|
"axios": "^1.7.1",
|
|
@@ -52,6 +52,7 @@ export interface UNActivityComponentProps {
|
|
|
52
52
|
paginationType?: UNActivityComponentPaginationType;
|
|
53
53
|
transactionsPerPage?: number;
|
|
54
54
|
showDeclinedActivity?: boolean;
|
|
55
|
+
showCsvDownload?: boolean;
|
|
55
56
|
// event
|
|
56
57
|
onLoad?: (response: UNComponentsOnLoadResponse<UNActivityOnLoadData>) => void;
|
|
57
58
|
}
|
|
@@ -15,6 +15,7 @@ export const getActivityParams = (props: UNActivityComponentProps) => {
|
|
|
15
15
|
hide-back-to-top="${props.hideBackToTop || false}"
|
|
16
16
|
hide-title="${props.hideTitle || false}"
|
|
17
17
|
show-declined-activity="${props.showDeclinedActivity || false}"
|
|
18
|
+
show-csv-download="${props.showCsvDownload || false}"
|
|
18
19
|
${queryFilterParam}
|
|
19
20
|
${paginationTypeParam}
|
|
20
21
|
${transactionsPerPageParam}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
3
4
|
import { WebComponent } from '../../webComponent/WebComponent';
|
|
4
5
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
5
6
|
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
6
|
-
import { UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
7
|
-
import { getCheckDepositParams, getCheckDepositScript } from './UNCheckDepositComponent.utils';
|
|
7
|
+
import { RequestExternalSdkEvent, UnitComponentsMessage } from '../../messages/webMessages/unitComponentsMessages';
|
|
8
|
+
import { getCheckDepositParams, getCheckDepositScript, injectUnitVeryfiResponse } from './UNCheckDepositComponent.utils';
|
|
8
9
|
import { CheckMessage } from '../../messages/webMessages/checkMessage';
|
|
9
10
|
import type { UNCheckDeposit, UNAccount, UNComponentsError, UNComponentsOnLoadResponse, UNComponentsOnLoadResponseData } from '../../types/shared';
|
|
10
11
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
@@ -13,6 +14,9 @@ import { withReduxStore } from '../../helpers/store/helpers';
|
|
|
13
14
|
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
14
15
|
import { UNBaseView } from '../../nativeComponents/UNBaseView';
|
|
15
16
|
import UNPermissionsModule from '../../nativeModulesHelpers/UNPermissionsHelper/UNPermissionsHelper';
|
|
17
|
+
import { isVeryfiAvailable, configureAndShowVeryfiCamera } from '../../services/veryfiService';
|
|
18
|
+
import type WebView from 'react-native-webview';
|
|
19
|
+
import type { RootState } from '../../store';
|
|
16
20
|
|
|
17
21
|
export interface UNCheckDepositComponentProps {
|
|
18
22
|
accountId: string;
|
|
@@ -31,6 +35,8 @@ export interface UNCheckDepositComponentProps {
|
|
|
31
35
|
const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
|
|
32
36
|
const [height, setHeight] = useState<number>(0);
|
|
33
37
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
38
|
+
const webRef = useRef<WebView>(null);
|
|
39
|
+
const veryfiCredentials = useSelector((state: RootState) => state.configuration.veryfiCredentials);
|
|
34
40
|
|
|
35
41
|
useEffect(() => {
|
|
36
42
|
const requestCameraAccess = async () => {
|
|
@@ -96,6 +102,28 @@ const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
|
|
|
96
102
|
}
|
|
97
103
|
break;
|
|
98
104
|
}
|
|
105
|
+
case UnitComponentsMessage.UNIT_REQUEST_EXTERNAL_SDK: {
|
|
106
|
+
const externalSdkEvent = message.details as RequestExternalSdkEvent;
|
|
107
|
+
if (externalSdkEvent.type !== 'veryfi') return;
|
|
108
|
+
if (!isVeryfiAvailable()) {
|
|
109
|
+
console.warn('Veryfi SDK is not installed — check deposit will use the default web scanner');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!veryfiCredentials) {
|
|
113
|
+
console.error('Veryfi credentials not provided in UnitComponentsSdkManager.init()');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
configureAndShowVeryfiCamera(
|
|
117
|
+
veryfiCredentials,
|
|
118
|
+
(images) => {
|
|
119
|
+
injectUnitVeryfiResponse(webRef.current, images);
|
|
120
|
+
},
|
|
121
|
+
(error) => {
|
|
122
|
+
console.error('Veryfi error:', error);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
99
127
|
}
|
|
100
128
|
};
|
|
101
129
|
|
|
@@ -104,9 +132,10 @@ const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
|
|
|
104
132
|
return (
|
|
105
133
|
<UNBaseView style={style} onLoadError={ handleUnitOnLoad } fallback={<></>}>
|
|
106
134
|
<WebComponent
|
|
135
|
+
ref={webRef}
|
|
107
136
|
type={WebComponentType.checkDeposit}
|
|
108
137
|
presentationMode={presentationMode}
|
|
109
|
-
params={getCheckDepositParams(props)}
|
|
138
|
+
params={getCheckDepositParams(props, veryfiCredentials)}
|
|
110
139
|
script={getCheckDepositScript()}
|
|
111
140
|
onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
|
|
112
141
|
theme={props.theme}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { CheckMessage } from '../../messages/webMessages/checkMessage';
|
|
2
2
|
import type { UNCheckDepositComponentProps } from './UNCheckDepositComponent';
|
|
3
|
-
import { LISTENERS } from '../../scripts/html/bodyScript';
|
|
3
|
+
import { DISPATCH_VERYFI_RESPONSE, LISTENERS } from '../../scripts/html/bodyScript';
|
|
4
|
+
import { isVeryfiAvailable, type UNVeryfiImage } from '../../services/veryfiService';
|
|
5
|
+
import type WebView from 'react-native-webview';
|
|
6
|
+
import type { UNVeryfiCredentials } from '../../types/shared/veryfi.types';
|
|
4
7
|
|
|
5
|
-
export const getCheckDepositParams = (props: UNCheckDepositComponentProps) => {
|
|
8
|
+
export const getCheckDepositParams = (props: UNCheckDepositComponentProps, veryfiCredentials?: UNVeryfiCredentials | null) => {
|
|
6
9
|
const feeParam = props.fee ? `fee="${props.fee}"` : '';
|
|
10
|
+
const useVeryfi = veryfiCredentials && isVeryfiAvailable();
|
|
11
|
+
const versionParam = useVeryfi ? 'version="veryfi"' : '';
|
|
7
12
|
return `
|
|
8
13
|
account-id="${props.accountId}"
|
|
9
14
|
${feeParam}
|
|
15
|
+
${versionParam}
|
|
10
16
|
initial-stage-back-button="${props.initialStageBackButton ?? false}"
|
|
11
17
|
final-stage-done-button="${props.finalStageDoneButton ?? false}"
|
|
12
18
|
`;
|
|
@@ -41,5 +47,11 @@ export const getCheckDepositScript = () => {
|
|
|
41
47
|
${LISTENERS.unitPaymentInitialStageBackButtonClicked}
|
|
42
48
|
${LISTENERS.unitPaymentFinalStageDoneButtonClicked}
|
|
43
49
|
${CHECK_DEPOSIT_LISTENERS.restartRequest}
|
|
50
|
+
${DISPATCH_VERYFI_RESPONSE}
|
|
44
51
|
`;
|
|
45
52
|
};
|
|
53
|
+
|
|
54
|
+
export const injectUnitVeryfiResponse = (currentWeb: WebView | null, images: UNVeryfiImage[]) => {
|
|
55
|
+
const payload = { images };
|
|
56
|
+
currentWeb?.injectJavaScript(`dispatchVeryfiEvent(${JSON.stringify(payload)})`);
|
|
57
|
+
};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
import type {TurboModule} from 'react-native';
|
|
2
|
-
import {
|
|
2
|
+
import {TurboModuleRegistry} from 'react-native';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (Platform.OS === 'android') {
|
|
7
|
-
interface Spec extends TurboModule {
|
|
8
|
-
share(base64pdf: string, filename: string): boolean
|
|
9
|
-
}
|
|
10
|
-
UNShareFileModule = TurboModuleRegistry.getEnforcing<Spec>('UNShareFileModule');
|
|
11
|
-
} else {
|
|
12
|
-
UNShareFileModule = {
|
|
13
|
-
requestAccess: async () => {
|
|
14
|
-
console.warn('Share file module is not available on iOS.');
|
|
15
|
-
return Promise.resolve('Share file module is not available');
|
|
16
|
-
},
|
|
17
|
-
};
|
|
4
|
+
interface Spec extends TurboModule {
|
|
5
|
+
share(base64Data: string, filename: string): Promise<boolean>
|
|
18
6
|
}
|
|
19
7
|
|
|
8
|
+
const UNShareFileModule = TurboModuleRegistry.getEnforcing<Spec>('UNShareFileModule');
|
|
9
|
+
|
|
20
10
|
export default UNShareFileModule;
|
|
@@ -7,6 +7,7 @@ import { ActivityMessage } from '../../messages/webMessages/activityMessage';
|
|
|
7
7
|
import { PlaidMessage } from '../../messages/webMessages/plaidMessages';
|
|
8
8
|
import { PayeeManagementMessage } from '../../messages/webMessages/payeeManagementMessage';
|
|
9
9
|
import { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
10
|
+
import { VeryfiMessage } from '../../messages/webMessages/veryfiMessages';
|
|
10
11
|
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
11
12
|
import { UserDataKeys } from '../../types/internal/unitStore.types';
|
|
12
13
|
|
|
@@ -360,6 +361,15 @@ export const DISPATCH_PLAID_RESPONSE = `
|
|
|
360
361
|
}
|
|
361
362
|
`;
|
|
362
363
|
|
|
364
|
+
export const DISPATCH_VERYFI_RESPONSE = `
|
|
365
|
+
const dispatchVeryfiEvent = (details) => {
|
|
366
|
+
const element = document.querySelector("${WebComponentType.checkDeposit}")
|
|
367
|
+
if (!element) return;
|
|
368
|
+
const event = new CustomEvent("${VeryfiMessage.UNIT_VERYFI_RESPONSE}",{ detail: details })
|
|
369
|
+
element.dispatchEvent(event)
|
|
370
|
+
}
|
|
371
|
+
`;
|
|
372
|
+
|
|
363
373
|
export const DISPATCH_PLAID_EXIT = `
|
|
364
374
|
const dispatchPlaidExit = (details) => {
|
|
365
375
|
const event = new CustomEvent("${PlaidMessage.UNIT_PLAID_EXIT}",{ detail: details })
|
|
@@ -410,6 +420,15 @@ export const DISPATCH_ACCOUNT_CREATED_EVENT = `
|
|
|
410
420
|
}
|
|
411
421
|
`;
|
|
412
422
|
|
|
423
|
+
export const DISPATCH_ON_DOWNLOAD = `
|
|
424
|
+
const dispatchOnDownload = (url, error) => {
|
|
425
|
+
const detail = { type: "unitOnDownload", url: url };
|
|
426
|
+
if (error) { detail.error = error; }
|
|
427
|
+
const event = new CustomEvent("unitOnDownload", { detail: detail });
|
|
428
|
+
window.dispatchEvent(event);
|
|
429
|
+
}
|
|
430
|
+
`;
|
|
431
|
+
|
|
413
432
|
export const DISPATCH_COUNTERPARTY_DELETED = `
|
|
414
433
|
const dispatchCounterpartyDeletedEvent = (details) => {
|
|
415
434
|
const event = new CustomEvent("unitCounterpartyDeleted",{ detail: { data: details } });
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { NativeEventEmitter } from 'react-native';
|
|
2
|
+
import type { UNVeryfiCredentials } from '../types/shared/veryfi.types';
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
let VeryfiLens: any = null;
|
|
6
|
+
try {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
VeryfiLens = require('@veryfi/react-native-veryfi-lens').default;
|
|
9
|
+
} catch {
|
|
10
|
+
// Veryfi SDK not installed — will use web fallback
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const isVeryfiAvailable = (): boolean => {
|
|
14
|
+
return VeryfiLens != null;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface UNVeryfiImage {
|
|
18
|
+
base64Img: string;
|
|
19
|
+
isFront: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const CHECK_SETTINGS = {
|
|
23
|
+
documentTypes: ['check'],
|
|
24
|
+
checksBackIsOn: true,
|
|
25
|
+
blurDetectionIsOn: true,
|
|
26
|
+
autoDocDetectionAndCropIsOn: true,
|
|
27
|
+
dataExtractionEngine: true,
|
|
28
|
+
returnStitchedPDF: true,
|
|
29
|
+
originalImageMaxSizeInMB: 1.4,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const configureAndShowVeryfiCamera = (
|
|
33
|
+
credentials: UNVeryfiCredentials,
|
|
34
|
+
onImages: (images: UNVeryfiImage[]) => void,
|
|
35
|
+
onError: (error: string) => void
|
|
36
|
+
): void => {
|
|
37
|
+
if (!VeryfiLens) {
|
|
38
|
+
onError('Veryfi SDK is not available');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const emitter = new NativeEventEmitter(VeryfiLens.NativeModule);
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
const subscriptions: any[] = [];
|
|
45
|
+
let delivered = false;
|
|
46
|
+
|
|
47
|
+
const cleanup = () => {
|
|
48
|
+
subscriptions.forEach((sub) => sub.remove());
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const deliverImages = (imagePaths: string[]) => {
|
|
52
|
+
if (delivered) return;
|
|
53
|
+
delivered = true;
|
|
54
|
+
|
|
55
|
+
let converted = 0;
|
|
56
|
+
const images: UNVeryfiImage[] = [];
|
|
57
|
+
|
|
58
|
+
imagePaths.forEach((filePath, index) => {
|
|
59
|
+
VeryfiLens.getFileBase64(
|
|
60
|
+
filePath,
|
|
61
|
+
// errorCallback
|
|
62
|
+
() => {
|
|
63
|
+
converted++;
|
|
64
|
+
if (converted === imagePaths.length) {
|
|
65
|
+
cleanup();
|
|
66
|
+
if (images.length > 0) {
|
|
67
|
+
onImages(images);
|
|
68
|
+
} else {
|
|
69
|
+
onError('Failed to convert check images');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
// successCallback
|
|
74
|
+
(base64Data: string) => {
|
|
75
|
+
images.push({
|
|
76
|
+
base64Img: base64Data,
|
|
77
|
+
isFront: index === 1,
|
|
78
|
+
});
|
|
79
|
+
converted++;
|
|
80
|
+
if (converted === imagePaths.length) {
|
|
81
|
+
cleanup();
|
|
82
|
+
onImages(images);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Process images when stitched PDF is ready (matches Android pattern)
|
|
90
|
+
subscriptions.push(
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
+
emitter.addListener(VeryfiLens.Events.onVeryfiLensUpdate, (event: any) => {
|
|
93
|
+
if (event.status === 'inprogress' && event.msg === 'img_stitched_pdf_path') {
|
|
94
|
+
const paths = event.img_original_paths || [];
|
|
95
|
+
if (paths.length > 0) {
|
|
96
|
+
deliverImages(paths);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// No onClose listener — if the user cancels, we simply don't dispatch
|
|
103
|
+
// unitVeryfiResponse, and the web SDK's polling handles the timeout.
|
|
104
|
+
|
|
105
|
+
subscriptions.push(
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
|
+
emitter.addListener(VeryfiLens.Events.onVeryfiLensError, (event: any) => {
|
|
108
|
+
cleanup();
|
|
109
|
+
onError(event.msg || 'Veryfi error');
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const veryfiCredentials = {
|
|
114
|
+
clientId: credentials.clientId,
|
|
115
|
+
userName: credentials.userName,
|
|
116
|
+
apiKey: credentials.apiKey,
|
|
117
|
+
url: credentials.url,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
VeryfiLens.configureWithCredentials(veryfiCredentials, CHECK_SETTINGS, () => {
|
|
121
|
+
VeryfiLens.showCamera();
|
|
122
|
+
});
|
|
123
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { RootState } from '../store';
|
|
3
|
+
import type { UNVeryfiCredentials } from '../types/shared/veryfi.types';
|
|
3
4
|
|
|
4
5
|
export interface ConfigurationState {
|
|
5
6
|
unitScript?: string;
|
|
6
7
|
theme?: string;
|
|
7
8
|
language?: string;
|
|
8
9
|
customerToken?: string;
|
|
10
|
+
veryfiCredentials?: UNVeryfiCredentials;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
const initialState: ConfigurationState = {};
|
|
@@ -25,10 +27,13 @@ const ConfigurationSlice = createSlice({
|
|
|
25
27
|
},
|
|
26
28
|
setCustomerToken(state, action: PayloadAction<string | undefined>) {
|
|
27
29
|
state.customerToken = action.payload;
|
|
28
|
-
}
|
|
30
|
+
},
|
|
31
|
+
setVeryfiCredentials(state, action: PayloadAction<UNVeryfiCredentials | undefined>) {
|
|
32
|
+
state.veryfiCredentials = action.payload;
|
|
33
|
+
},
|
|
29
34
|
},
|
|
30
35
|
});
|
|
31
36
|
|
|
32
|
-
export const { setUnitScript, setLanguage, setTheme, setCustomerToken } = ConfigurationSlice.actions;
|
|
37
|
+
export const { setUnitScript, setLanguage, setTheme, setCustomerToken, setVeryfiCredentials } = ConfigurationSlice.actions;
|
|
33
38
|
export const selectConfiguration = (state: RootState) => state.configuration;
|
|
34
39
|
export default ConfigurationSlice.reducer;
|