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/package.json
CHANGED
|
@@ -1,91 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-plaid-link-sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "React Native Plaid Link SDK",
|
|
5
|
-
"main": "
|
|
6
|
-
"types": "
|
|
7
|
-
"react-native": "src/index.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist/**/*",
|
|
10
|
-
"android/**/*",
|
|
11
|
-
"ios/**/*",
|
|
12
|
-
"react-native-plaid-link-sdk.podspec",
|
|
13
|
-
"src/**/*"
|
|
14
|
-
],
|
|
3
|
+
"version": "13.0.0",
|
|
4
|
+
"description": "React Native Plaid Link SDK (New Architecture & Expo)",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
15
7
|
"scripts": {
|
|
16
|
-
"build": "
|
|
8
|
+
"build": "expo-module build",
|
|
17
9
|
"check:package": "node scripts/check-package-entrypoints.js",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"test": "
|
|
10
|
+
"clean": "expo-module clean",
|
|
11
|
+
"lint": "expo-module lint",
|
|
12
|
+
"test": "expo-module test",
|
|
13
|
+
"prepare": "expo-module prepare",
|
|
14
|
+
"prepublishOnly": "expo-module prepublishOnly",
|
|
15
|
+
"expo-module": "expo-module",
|
|
16
|
+
"open:ios": "xed example/ios",
|
|
17
|
+
"open:android": "open -a \"Android Studio\" example/android",
|
|
18
|
+
"format": "prettier --write \"**/*.{ts,tsx}\""
|
|
21
19
|
},
|
|
22
20
|
"keywords": [
|
|
23
21
|
"react-native",
|
|
24
|
-
"
|
|
22
|
+
"expo",
|
|
23
|
+
"react-native-plaid-link-sdk",
|
|
24
|
+
"ReactNativePlaidLinkSdk"
|
|
25
25
|
],
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"lint-staged": {
|
|
32
|
-
"*.{js,jsx}": [
|
|
33
|
-
"prettier --write",
|
|
34
|
-
"eslint --fix",
|
|
35
|
-
"git add"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
"jest": {
|
|
39
|
-
"testPathIgnorePatterns": [
|
|
40
|
-
"/node_modules/",
|
|
41
|
-
"/dist/",
|
|
42
|
-
"/example/",
|
|
43
|
-
"/FabricExample/",
|
|
44
|
-
"/exampleReactNative76/"
|
|
45
|
-
]
|
|
26
|
+
"repository": "https://github.com/plaid/react-native-plaid-link-sdk",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/plaid/react-native-plaid-link-sdk/issues"
|
|
46
29
|
},
|
|
47
30
|
"author": "Plaid",
|
|
48
31
|
"license": "MIT",
|
|
49
|
-
"
|
|
50
|
-
"react": "*",
|
|
51
|
-
"react-native": "*"
|
|
52
|
-
},
|
|
32
|
+
"homepage": "https://github.com/plaid/react-native-plaid-link-sdk#readme",
|
|
53
33
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@react
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"@types/react-native": "^0.71.3",
|
|
61
|
-
"@types/react-test-renderer": "^16.9.3",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
63
|
-
"@typescript-eslint/parser": "^4.33.0",
|
|
64
|
-
"babel-eslint": "^10.0.3",
|
|
65
|
-
"eslint": "^7.32.0",
|
|
66
|
-
"eslint-plugin-prettier": "^3.1.4",
|
|
67
|
-
"eslint-plugin-react": "^7.16.0",
|
|
68
|
-
"husky": "^3.1.0",
|
|
69
|
-
"jest": "^29.6.1",
|
|
70
|
-
"lint-staged": "^9.4.2",
|
|
71
|
-
"prettier": "^1.18.2",
|
|
72
|
-
"react": "18.2.0",
|
|
73
|
-
"react-native": "0.84.1",
|
|
74
|
-
"typescript": "^4.9.5"
|
|
34
|
+
"@testing-library/react-native": "^13.3.3",
|
|
35
|
+
"@types/jest": "^30.0.0",
|
|
36
|
+
"@types/react": "~19.1.1",
|
|
37
|
+
"expo": "^55.0.8",
|
|
38
|
+
"expo-module-scripts": "^55.0.2",
|
|
39
|
+
"react-native": "0.82.1"
|
|
75
40
|
},
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"android": {
|
|
81
|
-
"javaPackageName": "com.plaid"
|
|
82
|
-
},
|
|
83
|
-
"ios": {
|
|
84
|
-
"modules": {
|
|
85
|
-
"RNLinksdk": {
|
|
86
|
-
"className": "RNLinksdk"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"expo": ">=52.0.0",
|
|
43
|
+
"react": ">=18.0.0",
|
|
44
|
+
"react-native": ">=0.76.0"
|
|
90
45
|
}
|
|
91
46
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const { execFileSync } = require("child_process");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const os = require("os");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const root = path.resolve(__dirname, "..");
|
|
7
|
+
const packageJsonPath = path.join(root, "package.json");
|
|
8
|
+
const packageJson = require(packageJsonPath);
|
|
9
|
+
|
|
10
|
+
function fail(message) {
|
|
11
|
+
console.error(`Package entrypoint check failed: ${message}`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function assertPackageFieldExists(fieldName) {
|
|
16
|
+
const fieldValue = packageJson[fieldName];
|
|
17
|
+
|
|
18
|
+
if (typeof fieldValue !== "string" || fieldValue.length === 0) {
|
|
19
|
+
fail(`package.json field "${fieldName}" must be a non-empty string.`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const absolutePath = path.join(root, fieldValue);
|
|
23
|
+
|
|
24
|
+
if (!fs.existsSync(absolutePath)) {
|
|
25
|
+
fail(
|
|
26
|
+
`package.json field "${fieldName}" points to a missing file: ${fieldValue}`,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return fieldValue;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function parsePackJson(output) {
|
|
34
|
+
for (let start = 0; start < output.length; start += 1) {
|
|
35
|
+
if (output[start] !== "[") {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let depth = 0;
|
|
40
|
+
let inString = false;
|
|
41
|
+
let isEscaped = false;
|
|
42
|
+
|
|
43
|
+
for (let end = start; end < output.length; end += 1) {
|
|
44
|
+
const char = output[end];
|
|
45
|
+
|
|
46
|
+
if (isEscaped) {
|
|
47
|
+
isEscaped = false;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (char === "\\") {
|
|
52
|
+
isEscaped = true;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (char === '"') {
|
|
57
|
+
inString = !inString;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (inString) {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (char === "[") {
|
|
66
|
+
depth += 1;
|
|
67
|
+
} else if (char === "]") {
|
|
68
|
+
depth -= 1;
|
|
69
|
+
|
|
70
|
+
if (depth === 0) {
|
|
71
|
+
const candidate = output.slice(start, end + 1);
|
|
72
|
+
try {
|
|
73
|
+
const parsed = JSON.parse(candidate);
|
|
74
|
+
if (Array.isArray(parsed)) {
|
|
75
|
+
return parsed;
|
|
76
|
+
}
|
|
77
|
+
} catch (_error) {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
fail("npm pack did not return a JSON array in its output.");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const main = assertPackageFieldExists("main");
|
|
89
|
+
const types = assertPackageFieldExists("types");
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
const resolved = require.resolve(root);
|
|
93
|
+
const expected = path.join(root, main);
|
|
94
|
+
|
|
95
|
+
if (resolved !== expected) {
|
|
96
|
+
fail(
|
|
97
|
+
`require.resolve('.') resolved to ${path.relative(
|
|
98
|
+
root,
|
|
99
|
+
resolved,
|
|
100
|
+
)}, expected ${main}`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
fail(`require.resolve('.') failed: ${error.message}`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let packOutput;
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
packOutput = execFileSync("npm", ["pack", "--dry-run", "--json"], {
|
|
111
|
+
cwd: root,
|
|
112
|
+
encoding: "utf8",
|
|
113
|
+
env: {
|
|
114
|
+
...process.env,
|
|
115
|
+
npm_config_cache: path.join(
|
|
116
|
+
os.tmpdir(),
|
|
117
|
+
"react-native-plaid-link-sdk-npm-cache",
|
|
118
|
+
),
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
} catch (error) {
|
|
122
|
+
fail(`npm pack --dry-run --json failed:\n${error.stderr || error.message}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const packResult = parsePackJson(packOutput);
|
|
126
|
+
|
|
127
|
+
const packedFiles = (packResult[0] && packResult[0].files) || [];
|
|
128
|
+
const files = new Set(packedFiles.map((file) => file.path));
|
|
129
|
+
|
|
130
|
+
for (const entrypoint of [main, types]) {
|
|
131
|
+
if (!files.has(entrypoint)) {
|
|
132
|
+
fail(`packed package does not include ${entrypoint}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
for (const forbiddenPrefix of ["coverage/", "dist/", "example/"]) {
|
|
137
|
+
const forbiddenFile = packedFiles.find((file) =>
|
|
138
|
+
file.path.startsWith(forbiddenPrefix),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
if (forbiddenFile) {
|
|
142
|
+
fail(`packed package must not include ${forbiddenFile.path}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
console.log(`Package entrypoints are valid: ${main}, ${types}`);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
function extractEnumValues(source, enumName) {
|
|
5
|
+
const enumMatch = source.match(
|
|
6
|
+
new RegExp(`export\\s+enum\\s+${enumName}\\s*\\{([\\s\\S]*?)\\n\\}`),
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
if (!enumMatch) {
|
|
10
|
+
throw new Error(`Could not find ${enumName}`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return [...enumMatch[1].matchAll(/=\s*"([^"]+)"/g)].map((match) => match[1]);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getReactNativeEnumValues(repoRoot = path.resolve(__dirname, "..")) {
|
|
17
|
+
const source = fs.readFileSync(
|
|
18
|
+
path.join(repoRoot, "src", "ReactNativePlaidLinkSdk.types.ts"),
|
|
19
|
+
"utf8",
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
eventNames: extractEnumValues(source, "LinkEventName"),
|
|
24
|
+
viewNames: extractEnumValues(source, "LinkEventViewName"),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (require.main === module) {
|
|
29
|
+
const values = getReactNativeEnumValues();
|
|
30
|
+
if (process.argv.includes("--json")) {
|
|
31
|
+
process.stdout.write(`${JSON.stringify(values)}\n`);
|
|
32
|
+
} else {
|
|
33
|
+
process.stdout.write(
|
|
34
|
+
[
|
|
35
|
+
"LinkEventName",
|
|
36
|
+
...values.eventNames.map((value) => ` ${value}`),
|
|
37
|
+
"",
|
|
38
|
+
"LinkEventViewName",
|
|
39
|
+
...values.viewNames.map((value) => ` ${value}`),
|
|
40
|
+
"",
|
|
41
|
+
].join("\n"),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
extractEnumValues,
|
|
48
|
+
getReactNativeEnumValues,
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { requireNativeViewManager } from "expo-modules-core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { ViewProps } from "react-native";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
LinkExit,
|
|
7
|
+
LinkEvent,
|
|
8
|
+
LinkSuccess,
|
|
9
|
+
} from "./ReactNativePlaidLinkSdk.types";
|
|
10
|
+
|
|
11
|
+
export type PlaidEmbeddedSearchViewProps = {
|
|
12
|
+
token: string;
|
|
13
|
+
onSuccess?: (success: LinkSuccess) => void;
|
|
14
|
+
onExit?: (exit: LinkExit) => void;
|
|
15
|
+
onEvent?: (event: LinkEvent) => void;
|
|
16
|
+
onLoad?: () => void;
|
|
17
|
+
} & ViewProps;
|
|
18
|
+
|
|
19
|
+
const NativeView: React.ComponentType<any> = requireNativeViewManager(
|
|
20
|
+
"ReactNativePlaidLinkSdk",
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export function PlaidEmbeddedSearchView(props: PlaidEmbeddedSearchViewProps) {
|
|
24
|
+
const { onSuccess, onExit, onEvent, onLoad, ...restProps } = props;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<NativeView
|
|
28
|
+
{...restProps}
|
|
29
|
+
onSuccess={(event: any) => onSuccess?.(event.nativeEvent)}
|
|
30
|
+
onExit={(event: any) => onExit?.(event.nativeEvent)}
|
|
31
|
+
onEvent={(event: any) => onEvent?.(event.nativeEvent)}
|
|
32
|
+
onLoad={(event: any) => onLoad?.()}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|