react-native-plaid-link-sdk 12.8.3 → 13.0.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/.eslintrc.js +5 -0
- package/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/CHANGELOG.md +1458 -0
- package/README.md +17 -278
- package/V13_MIGRATION_GUIDE.md +470 -0
- package/android/build.gradle +30 -98
- package/android/src/main/AndroidManifest.xml +1 -8
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
- package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
- package/build/PlaidEmbeddedSearchView.d.ts +12 -0
- package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
- package/build/PlaidEmbeddedSearchView.js +8 -0
- package/build/PlaidEmbeddedSearchView.js.map +1 -0
- package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
- package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
- package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
- package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
- package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
- package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +134 -0
- package/build/index.js.map +1 -0
- package/eslint.config.js +3 -0
- package/expo-module.config.json +9 -0
- package/ios/Frameworks/LinkKit.xcframework/Info.plist +61 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +205 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.abi.json +52299 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.private.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.abi.json +52299 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.private.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftinterface +751 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/x86_64-apple-ios-macabi.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +59 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +230 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53681 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +756 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
- package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
- package/ios/ReactNativePlaidLinkSdk.podspec +31 -0
- package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
- package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
- package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
- package/jest.config.js +21 -0
- package/jest.setup.js +7 -0
- package/package.json +31 -76
- package/scripts/check-package-entrypoints.js +146 -0
- package/scripts/extract-rn-enums.js +49 -0
- package/src/PlaidEmbeddedSearchView.tsx +35 -0
- package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
- package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
- package/src/index.ts +207 -22
- package/tsconfig.json +9 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/android/gradle.properties +0 -31
- package/android/gradlew +0 -174
- package/android/gradlew.bat +0 -89
- package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
- package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
- package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
- package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
- package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
- package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
- package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
- package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
- package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
- package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
- package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
- package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
- package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
- package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
- package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
- package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
- package/dist/build/PlaidEmbeddedSearchView.js +0 -25
- package/dist/build/PlaidLink.d.ts +0 -7
- package/dist/build/PlaidLink.js +0 -137
- package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
- package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
- package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
- package/dist/build/Types.d.ts +0 -108
- package/dist/build/Types.js +0 -462
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
- package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
- package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
- package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
- package/dist/build/fabric/fabricUtils.d.ts +0 -1
- package/dist/build/fabric/fabricUtils.js +0 -2
- package/dist/build/index.d.ts +0 -14
- package/dist/build/index.js +0 -154
- package/dist/scripts/check-package-entrypoints.d.ts +0 -1
- package/dist/scripts/check-package-entrypoints.js +0 -61
- package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
- package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
- package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
- package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
- package/dist/src/PlaidLink.d.ts +0 -34
- package/dist/src/PlaidLink.js +0 -136
- package/dist/src/Types.js +0 -463
- package/dist/src/__tests__/Types.tests.d.ts +0 -1
- package/dist/src/__tests__/Types.tests.js +0 -14
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
- package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
- package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
- package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
- package/dist/src/fabric/fabricUtils.d.ts +0 -1
- package/dist/src/fabric/fabricUtils.js +0 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -5
- package/ios/PLKEmbeddedView.m +0 -7
- package/ios/PLKEmbeddedView.swift +0 -116
- package/ios/PLKEmbeddedViewComponentView.h +0 -28
- package/ios/PLKEmbeddedViewComponentView.mm +0 -91
- package/ios/PLKEmbeddedViewManager.swift +0 -14
- package/ios/PLKFabricHelpers.h +0 -116
- package/ios/RNLinksdk-Bridging-Header.h +0 -8
- package/ios/RNLinksdk.h +0 -19
- package/ios/RNLinksdk.mm +0 -732
- package/ios/RNPlaidHelper.h +0 -15
- package/ios/RNPlaidHelper.m +0 -33
- package/ios/react_native_plaid_link_sdk.h +0 -2
- package/react-native-plaid-link-sdk.podspec +0 -40
- package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
- package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
- package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
- package/src/PlaidLink.tsx +0 -167
- package/src/Types.ts +0 -634
- package/src/__tests__/Types.tests.ts +0 -15
- package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
- package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
- package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
- package/src/fabric/fabricUtils.ts +0 -2
package/dist/build/index.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { Platform } from "react-native";
|
|
11
|
-
import { FinanceKitSyncBehavior, } from "./ReactNativePlaidLinkSdk.types";
|
|
12
|
-
import NativePlaidModule from "./ReactNativePlaidLinkSdkModule";
|
|
13
|
-
let successSub = null;
|
|
14
|
-
let exitSub = null;
|
|
15
|
-
let eventSub = null;
|
|
16
|
-
function cleanupListeners() {
|
|
17
|
-
successSub === null || successSub === void 0 ? void 0 : successSub.remove();
|
|
18
|
-
exitSub === null || exitSub === void 0 ? void 0 : exitSub.remove();
|
|
19
|
-
eventSub === null || eventSub === void 0 ? void 0 : eventSub.remove();
|
|
20
|
-
successSub = null;
|
|
21
|
-
exitSub = null;
|
|
22
|
-
eventSub = null;
|
|
23
|
-
}
|
|
24
|
-
export function createPlaidLinkSession(config) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
try {
|
|
27
|
-
cleanupListeners();
|
|
28
|
-
successSub = NativePlaidModule.addListener("onSuccess", (success) => {
|
|
29
|
-
config.onSuccess(success);
|
|
30
|
-
cleanupListeners();
|
|
31
|
-
});
|
|
32
|
-
exitSub = NativePlaidModule.addListener("onExit", (exit) => {
|
|
33
|
-
config.onExit(exit);
|
|
34
|
-
cleanupListeners();
|
|
35
|
-
});
|
|
36
|
-
eventSub = NativePlaidModule.addListener("onEvent", (event) => {
|
|
37
|
-
config.onEvent(event);
|
|
38
|
-
});
|
|
39
|
-
yield NativePlaidModule.createPlaidLinkSession(config.token);
|
|
40
|
-
console.log("[PlaidLink] createPlaidLinkSession - returning session");
|
|
41
|
-
return {
|
|
42
|
-
open: (fullScreen = false) => {
|
|
43
|
-
console.log("[PlaidLink] open called", fullScreen);
|
|
44
|
-
return NativePlaidModule.openLinkSession(fullScreen);
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
console.error("[PlaidLink] createPlaidLinkSession failed:", e);
|
|
50
|
-
throw e;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export function createPlaidLayerSession(config) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
try {
|
|
57
|
-
cleanupListeners();
|
|
58
|
-
console.log("[PlaidLink] createPlaidLayerSession - setting up listeners");
|
|
59
|
-
console.log("[PlaidLink] onEvent callback provided:", typeof config.onEvent);
|
|
60
|
-
successSub = NativePlaidModule.addListener("onSuccess", (success) => {
|
|
61
|
-
console.log("[PlaidLink] JS received onSuccess event");
|
|
62
|
-
config.onSuccess(success);
|
|
63
|
-
cleanupListeners();
|
|
64
|
-
});
|
|
65
|
-
exitSub = NativePlaidModule.addListener("onExit", (exit) => {
|
|
66
|
-
var _a;
|
|
67
|
-
console.log("[PlaidLink] JS received onExit event");
|
|
68
|
-
(_a = config.onExit) === null || _a === void 0 ? void 0 : _a.call(config, exit);
|
|
69
|
-
cleanupListeners();
|
|
70
|
-
});
|
|
71
|
-
eventSub = NativePlaidModule.addListener("onEvent", (event) => {
|
|
72
|
-
var _a;
|
|
73
|
-
console.log("[PlaidLink] JS received onEvent:", event.eventName);
|
|
74
|
-
(_a = config.onEvent) === null || _a === void 0 ? void 0 : _a.call(config, event);
|
|
75
|
-
});
|
|
76
|
-
console.log("[PlaidLink] Listeners registered, creating native session");
|
|
77
|
-
yield NativePlaidModule.createPlaidLayerSession(config.token);
|
|
78
|
-
console.log("[PlaidLink] createPlaidLayerSession - returning session");
|
|
79
|
-
return {
|
|
80
|
-
open: () => {
|
|
81
|
-
console.log("[PlaidLink] layer open called");
|
|
82
|
-
return NativePlaidModule.openLayerSession();
|
|
83
|
-
},
|
|
84
|
-
submit: (data) => {
|
|
85
|
-
console.log("[PlaidLink] layer submit called", data);
|
|
86
|
-
return NativePlaidModule.submitLayerData(data.phoneNumber, data.dateOfBirth, data.params);
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
catch (e) {
|
|
91
|
-
console.error("[PlaidLink] createPlaidLayerSession failed:", e);
|
|
92
|
-
throw e;
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
export function createPlaidHeadlessSession(config) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
try {
|
|
99
|
-
cleanupListeners();
|
|
100
|
-
console.log("[PlaidLink] createPlaidHeadlessSession - setting up listeners");
|
|
101
|
-
successSub = NativePlaidModule.addListener("onSuccess", (success) => {
|
|
102
|
-
console.log("[PlaidLink] JS received onSuccess event");
|
|
103
|
-
config.onSuccess(success);
|
|
104
|
-
cleanupListeners();
|
|
105
|
-
});
|
|
106
|
-
exitSub = NativePlaidModule.addListener("onExit", (exit) => {
|
|
107
|
-
console.log("[PlaidLink] JS received onExit event");
|
|
108
|
-
config.onExit(exit);
|
|
109
|
-
cleanupListeners();
|
|
110
|
-
});
|
|
111
|
-
eventSub = NativePlaidModule.addListener("onEvent", (event) => {
|
|
112
|
-
console.log("[PlaidLink] JS received onEvent:", event.eventName);
|
|
113
|
-
config.onEvent(event);
|
|
114
|
-
});
|
|
115
|
-
console.log("[PlaidLink] Listeners registered, creating native headless session");
|
|
116
|
-
yield NativePlaidModule.createPlaidHeadlessSession(config.token);
|
|
117
|
-
console.log("[PlaidLink] createPlaidHeadlessSession - returning session");
|
|
118
|
-
if (config.onLoad) {
|
|
119
|
-
config.onLoad();
|
|
120
|
-
}
|
|
121
|
-
return {
|
|
122
|
-
start: () => {
|
|
123
|
-
console.log("[PlaidLink] headless start called");
|
|
124
|
-
return NativePlaidModule.startHeadlessSession();
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
catch (e) {
|
|
129
|
-
console.error("[PlaidLink] createPlaidHeadlessSession failed:", e);
|
|
130
|
-
throw e;
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
export function syncFinanceKit(config) {
|
|
135
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
var _a, _b;
|
|
137
|
-
if (Platform.OS === "android") {
|
|
138
|
-
throw new Error("FinanceKit is only available on iOS");
|
|
139
|
-
}
|
|
140
|
-
try {
|
|
141
|
-
console.log("[PlaidLink] syncFinanceKit called");
|
|
142
|
-
yield NativePlaidModule.syncFinanceKit(config.token, (_a = config.requestAuthorizationIfNeeded) !== null && _a !== void 0 ? _a : true, (_b = config.syncBehavior) !== null && _b !== void 0 ? _b : FinanceKitSyncBehavior.LIVE);
|
|
143
|
-
console.log("[PlaidLink] syncFinanceKit completed successfully");
|
|
144
|
-
}
|
|
145
|
-
catch (e) {
|
|
146
|
-
console.error("[PlaidLink] syncFinanceKit failed:", e);
|
|
147
|
-
throw e;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
export { PlaidEmbeddedSearchView, } from "./PlaidEmbeddedSearchView";
|
|
152
|
-
export { default } from "./ReactNativePlaidLinkSdkModule";
|
|
153
|
-
export * from "./ReactNativePlaidLinkSdk.types";
|
|
154
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const { execFileSync } = require('child_process');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const os = require('os');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const root = path.resolve(__dirname, '..');
|
|
7
|
-
const packageJsonPath = path.join(root, 'package.json');
|
|
8
|
-
const packageJson = require(packageJsonPath);
|
|
9
|
-
function fail(message) {
|
|
10
|
-
console.error(`Package entrypoint check failed: ${message}`);
|
|
11
|
-
process.exit(1);
|
|
12
|
-
}
|
|
13
|
-
function assertPackageFieldExists(fieldName) {
|
|
14
|
-
const fieldValue = packageJson[fieldName];
|
|
15
|
-
if (typeof fieldValue !== 'string' || fieldValue.length === 0) {
|
|
16
|
-
fail(`package.json field "${fieldName}" must be a non-empty string.`);
|
|
17
|
-
}
|
|
18
|
-
const absolutePath = path.join(root, fieldValue);
|
|
19
|
-
if (!fs.existsSync(absolutePath)) {
|
|
20
|
-
fail(`package.json field "${fieldName}" points to a missing file: ${fieldValue}`);
|
|
21
|
-
}
|
|
22
|
-
return fieldValue;
|
|
23
|
-
}
|
|
24
|
-
const main = assertPackageFieldExists('main');
|
|
25
|
-
const types = assertPackageFieldExists('types');
|
|
26
|
-
try {
|
|
27
|
-
const resolved = require.resolve(root);
|
|
28
|
-
const expected = path.join(root, main);
|
|
29
|
-
if (resolved !== expected) {
|
|
30
|
-
fail(`require.resolve('.') resolved to ${path.relative(root, resolved)}, expected ${main}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
fail(`require.resolve('.') failed: ${error.message}`);
|
|
35
|
-
}
|
|
36
|
-
let packOutput;
|
|
37
|
-
try {
|
|
38
|
-
packOutput = execFileSync('npm', ['pack', '--dry-run', '--json'], {
|
|
39
|
-
cwd: root,
|
|
40
|
-
encoding: 'utf8',
|
|
41
|
-
env: Object.assign(Object.assign({}, process.env), { npm_config_cache: path.join(os.tmpdir(), 'react-native-plaid-link-sdk-npm-cache') }),
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
fail(`npm pack --dry-run --json failed:\n${error.stderr || error.message}`);
|
|
46
|
-
}
|
|
47
|
-
let packResult;
|
|
48
|
-
try {
|
|
49
|
-
packResult = JSON.parse(packOutput);
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
fail(`npm pack did not return valid JSON: ${error.message}`);
|
|
53
|
-
}
|
|
54
|
-
const packedFiles = (packResult[0] && packResult[0].files) || [];
|
|
55
|
-
const files = new Set(packedFiles.map(file => file.path));
|
|
56
|
-
for (const entrypoint of [main, types]) {
|
|
57
|
-
if (!files.has(entrypoint)) {
|
|
58
|
-
fail(`packed package does not include ${entrypoint}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
console.log(`Package entrypoints are valid: ${main}, ${types}`);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import { LinkSuccessListener, LinkExitListener, LinkIOSPresentationStyle, LinkOnEventListener } from '../Types';
|
|
4
|
-
type EmbeddedLinkProps = {
|
|
5
|
-
token: string;
|
|
6
|
-
iOSPresentationStyle: LinkIOSPresentationStyle;
|
|
7
|
-
onEvent: LinkOnEventListener | undefined;
|
|
8
|
-
onSuccess: LinkSuccessListener;
|
|
9
|
-
onExit: LinkExitListener | undefined;
|
|
10
|
-
style: StyleProp<ViewStyle> | undefined;
|
|
11
|
-
};
|
|
12
|
-
export declare const EmbeddedLinkView: React.FC<EmbeddedLinkProps>;
|
|
13
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import NativeEmbeddedLinkView from './NativeEmbeddedLinkView';
|
|
3
|
-
class EmbeddedEvent {
|
|
4
|
-
constructor(event) {
|
|
5
|
-
this.eventName = event.eventName;
|
|
6
|
-
this.metadata = event.metadata;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
class EmbeddedExit {
|
|
10
|
-
constructor(event) {
|
|
11
|
-
this.error = event.error;
|
|
12
|
-
this.metadata = event.metadata;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
class EmbeddedSuccess {
|
|
16
|
-
constructor(event) {
|
|
17
|
-
this.publicToken = event.publicToken;
|
|
18
|
-
this.metadata = event.metadata;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export const EmbeddedLinkView = (props) => {
|
|
22
|
-
const { token, iOSPresentationStyle, onEvent, onSuccess, onExit, style } = props;
|
|
23
|
-
const onEmbeddedEvent = (event) => {
|
|
24
|
-
switch (event.nativeEvent.embeddedEventName) {
|
|
25
|
-
case 'onSuccess': {
|
|
26
|
-
if (!onSuccess) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const embeddedSuccess = new EmbeddedSuccess(event.nativeEvent);
|
|
30
|
-
onSuccess(embeddedSuccess);
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
case 'onExit': {
|
|
34
|
-
if (!onExit) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const embeddedExit = new EmbeddedExit(event.nativeEvent);
|
|
38
|
-
onExit(embeddedExit);
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
case 'onEvent': {
|
|
42
|
-
if (!onEvent) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const embeddedEvent = new EmbeddedEvent(event.nativeEvent);
|
|
46
|
-
onEvent(embeddedEvent);
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
default: {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
return <NativeEmbeddedLinkView token={token} iOSPresentationStyle={iOSPresentationStyle.toString()} onEmbeddedEvent={onEmbeddedEvent} style={style}/>;
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const EmbeddedLinkView: () => null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const EmbeddedLinkView = () => null;
|
package/dist/src/PlaidLink.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { LinkEventListener, LinkOpenProps, LinkTokenConfiguration, FinanceKitError, SubmissionData } from './Types';
|
|
2
|
-
/**
|
|
3
|
-
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
|
|
4
|
-
* The listener is cleaned up when this view is unmounted
|
|
5
|
-
*
|
|
6
|
-
* @param LinkEventListener the listener to call
|
|
7
|
-
*/
|
|
8
|
-
export declare const usePlaidEmitter: (linkEventListener: LinkEventListener) => void;
|
|
9
|
-
export declare const create: (props: LinkTokenConfiguration) => void;
|
|
10
|
-
export declare const open: (props: LinkOpenProps) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Clears any previously created Plaid session and associated resources
|
|
13
|
-
* that were captured during a prior call to create(). This method should
|
|
14
|
-
* be invoked before starting a new layer session with create() to ensure
|
|
15
|
-
* proper cleanup and avoid conflicts from lingering state or resources.
|
|
16
|
-
*/
|
|
17
|
-
export declare const destroy: () => Promise<void>;
|
|
18
|
-
export declare const dismissLink: () => void;
|
|
19
|
-
export declare const submit: (data: SubmissionData) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Function to sync the user's transactions from their Apple card.
|
|
22
|
-
*
|
|
23
|
-
* @param {string} token - The `LinkToken` your server retrieved from the /link/token/create endpoint from the Plaid API.
|
|
24
|
-
* This token must be associated with an accessToken.
|
|
25
|
-
* @param {boolean} requestAuthorizationIfNeeded - Indicates if the user should be prompted to authorize the sync if
|
|
26
|
-
* they have not already done so.
|
|
27
|
-
* @param {function} completion - A callback function that is called when the sync has completed.
|
|
28
|
-
*
|
|
29
|
-
* @warning This method only works on iOS >= 17.4.
|
|
30
|
-
* @warning This method is not supported on Android or MacCatalyst.
|
|
31
|
-
* @warning This method can only be used once the user has granted access to their Apple card via a standard Link Session.
|
|
32
|
-
* @warning This method requires that your app has been granted FinanceKit access from Apple.
|
|
33
|
-
*/
|
|
34
|
-
export declare const syncFinanceKit: (token: string, requestAuthorizationIfNeeded: boolean, simulatedBehavior: boolean, completion: (error?: FinanceKitError) => void) => void;
|
package/dist/src/PlaidLink.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var _a;
|
|
11
|
-
import { useEffect } from 'react';
|
|
12
|
-
import { NativeEventEmitter, Platform } from 'react-native';
|
|
13
|
-
import { LinkIOSPresentationStyle, LinkLogLevel, FinanceKitErrorType, } from './Types';
|
|
14
|
-
import RNLinksdkAndroid from './fabric/NativePlaidLinkModuleAndroid';
|
|
15
|
-
import RNLinksdkiOS from './fabric/NativePlaidLinkModuleiOS';
|
|
16
|
-
const RNLinksdk = (_a = (Platform.OS === 'android' ? RNLinksdkAndroid : RNLinksdkiOS)) !== null && _a !== void 0 ? _a : undefined;
|
|
17
|
-
/**
|
|
18
|
-
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
|
|
19
|
-
* The listener is cleaned up when this view is unmounted
|
|
20
|
-
*
|
|
21
|
-
* @param LinkEventListener the listener to call
|
|
22
|
-
*/
|
|
23
|
-
export const usePlaidEmitter = (linkEventListener) => {
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const emitter = new NativeEventEmitter(RNLinksdk);
|
|
26
|
-
const listener = emitter.addListener('onEvent', linkEventListener);
|
|
27
|
-
// Clean up after this effect:
|
|
28
|
-
return function cleanup() {
|
|
29
|
-
listener.remove();
|
|
30
|
-
};
|
|
31
|
-
}, []);
|
|
32
|
-
};
|
|
33
|
-
export const create = (props) => {
|
|
34
|
-
var _a, _b, _c, _d;
|
|
35
|
-
let token = props.token;
|
|
36
|
-
let noLoadingState = (_a = props.noLoadingState) !== null && _a !== void 0 ? _a : false;
|
|
37
|
-
if (Platform.OS === 'android') {
|
|
38
|
-
RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.createPlaidLink(token, noLoadingState, (_b = props.logLevel) !== null && _b !== void 0 ? _b : LinkLogLevel.ERROR, (_c = props.onLoad) !== null && _c !== void 0 ? _c : (() => { }));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const onLoad = (_d = props.onLoad) !== null && _d !== void 0 ? _d : (() => { });
|
|
42
|
-
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.createPlaidLink(token, noLoadingState, onLoad);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export const open = (props) => {
|
|
46
|
-
if (Platform.OS === 'android') {
|
|
47
|
-
RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.open((result) => {
|
|
48
|
-
if (props.onSuccess != null) {
|
|
49
|
-
props.onSuccess(result);
|
|
50
|
-
}
|
|
51
|
-
}, (result) => {
|
|
52
|
-
if (props.onExit != null) {
|
|
53
|
-
if (result.error != null && result.error.displayMessage != null) {
|
|
54
|
-
//TODO(RNSDK-118): Remove errorDisplayMessage field in next major update.
|
|
55
|
-
result.error.errorDisplayMessage = result.error.displayMessage;
|
|
56
|
-
}
|
|
57
|
-
props.onExit(result);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
let presentFullScreen = props.iOSPresentationStyle == LinkIOSPresentationStyle.FULL_SCREEN;
|
|
63
|
-
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.open(presentFullScreen, (result) => {
|
|
64
|
-
if (props.onSuccess != null) {
|
|
65
|
-
props.onSuccess(result);
|
|
66
|
-
}
|
|
67
|
-
}, (error, result) => {
|
|
68
|
-
if (props.onExit != null) {
|
|
69
|
-
if (error) {
|
|
70
|
-
var data = result || {};
|
|
71
|
-
data.error = error;
|
|
72
|
-
props.onExit(data);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
props.onExit(result);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Clears any previously created Plaid session and associated resources
|
|
83
|
-
* that were captured during a prior call to create(). This method should
|
|
84
|
-
* be invoked before starting a new layer session with create() to ensure
|
|
85
|
-
* proper cleanup and avoid conflicts from lingering state or resources.
|
|
86
|
-
*/
|
|
87
|
-
export const destroy = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
-
if (Platform.OS === 'android') {
|
|
89
|
-
yield (RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.destroy());
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
export const dismissLink = () => {
|
|
93
|
-
if (Platform.OS === 'ios') {
|
|
94
|
-
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.dismiss();
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
export const submit = (data) => {
|
|
98
|
-
if (Platform.OS === 'android') {
|
|
99
|
-
RNLinksdkAndroid === null || RNLinksdkAndroid === void 0 ? void 0 : RNLinksdkAndroid.submit(data.phoneNumber, data.dateOfBirth, data.params);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.submit(data.phoneNumber, data.dateOfBirth, data.params);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Function to sync the user's transactions from their Apple card.
|
|
107
|
-
*
|
|
108
|
-
* @param {string} token - The `LinkToken` your server retrieved from the /link/token/create endpoint from the Plaid API.
|
|
109
|
-
* This token must be associated with an accessToken.
|
|
110
|
-
* @param {boolean} requestAuthorizationIfNeeded - Indicates if the user should be prompted to authorize the sync if
|
|
111
|
-
* they have not already done so.
|
|
112
|
-
* @param {function} completion - A callback function that is called when the sync has completed.
|
|
113
|
-
*
|
|
114
|
-
* @warning This method only works on iOS >= 17.4.
|
|
115
|
-
* @warning This method is not supported on Android or MacCatalyst.
|
|
116
|
-
* @warning This method can only be used once the user has granted access to their Apple card via a standard Link Session.
|
|
117
|
-
* @warning This method requires that your app has been granted FinanceKit access from Apple.
|
|
118
|
-
*/
|
|
119
|
-
export const syncFinanceKit = (token, requestAuthorizationIfNeeded, simulatedBehavior, completion) => {
|
|
120
|
-
if (Platform.OS === 'android') {
|
|
121
|
-
completion({
|
|
122
|
-
type: FinanceKitErrorType.Unknown,
|
|
123
|
-
message: "FinanceKit is unavailable on Android!",
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
RNLinksdkiOS === null || RNLinksdkiOS === void 0 ? void 0 : RNLinksdkiOS.syncFinanceKit(token, requestAuthorizationIfNeeded, simulatedBehavior, () => {
|
|
128
|
-
completion();
|
|
129
|
-
}, (error) => {
|
|
130
|
-
completion({
|
|
131
|
-
type: error.type,
|
|
132
|
-
message: error.message,
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
};
|