react-native-plaid-link-sdk 12.8.2 → 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.
Files changed (183) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.gitattributes +3 -0
  3. package/.nvmrc +1 -0
  4. package/CHANGELOG.md +1458 -0
  5. package/README.md +17 -277
  6. package/V13_MIGRATION_GUIDE.md +470 -0
  7. package/android/build.gradle +30 -98
  8. package/android/src/main/AndroidManifest.xml +1 -8
  9. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidEmbeddedResultDispatcher.kt +19 -0
  10. package/android/src/main/java/expo/modules/plaidlinksdk/PlaidResultMappers.kt +217 -0
  11. package/android/src/main/java/expo/modules/plaidlinksdk/RNPlaidLinkSdkVersion.kt +5 -0
  12. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkModule.kt +183 -0
  13. package/android/src/main/java/expo/modules/plaidlinksdk/ReactNativePlaidLinkSdkView.kt +69 -0
  14. package/build/PlaidEmbeddedSearchView.d.ts +12 -0
  15. package/build/PlaidEmbeddedSearchView.d.ts.map +1 -0
  16. package/build/PlaidEmbeddedSearchView.js +8 -0
  17. package/build/PlaidEmbeddedSearchView.js.map +1 -0
  18. package/{dist/src/Types.d.ts → build/ReactNativePlaidLinkSdk.types.d.ts} +78 -47
  19. package/build/ReactNativePlaidLinkSdk.types.d.ts.map +1 -0
  20. package/{dist/build → build}/ReactNativePlaidLinkSdk.types.js +82 -71
  21. package/build/ReactNativePlaidLinkSdk.types.js.map +1 -0
  22. package/build/ReactNativePlaidLinkSdkModule.d.ts +16 -0
  23. package/build/ReactNativePlaidLinkSdkModule.d.ts.map +1 -0
  24. package/{dist/build → build}/ReactNativePlaidLinkSdkModule.js +1 -1
  25. package/build/ReactNativePlaidLinkSdkModule.js.map +1 -0
  26. package/build/index.d.ts +13 -0
  27. package/build/index.d.ts.map +1 -0
  28. package/build/index.js +134 -0
  29. package/build/index.js.map +1 -0
  30. package/eslint.config.js +3 -0
  31. package/expo-module.config.json +9 -0
  32. package/ios/Frameworks/LinkKit.xcframework/Info.plist +61 -0
  33. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit-Swift.h +327 -0
  34. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Headers/LinkKit.h +22 -0
  35. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Info.plist +0 -0
  36. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/LinkKit +0 -0
  37. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.abi.json +53681 -0
  38. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.private.swiftinterface +756 -0
  39. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  40. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftinterface +756 -0
  41. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  42. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/Modules/module.modulemap +11 -0
  43. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  44. package/ios/Frameworks/LinkKit.xcframework/ios-arm64/LinkKit.framework/_CodeSignature/CodeResources +205 -0
  45. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit-Swift.h +650 -0
  46. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Headers/LinkKit.h +22 -0
  47. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/LinkKit +0 -0
  48. 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
  49. 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
  50. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftdoc +0 -0
  51. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftinterface +751 -0
  52. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/LinkKit.swiftmodule/arm64-apple-ios-macabi.swiftmodule +0 -0
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Modules/module.modulemap +11 -0
  59. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/Info.plist +59 -0
  60. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +32 -0
  61. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-maccatalyst/LinkKit.framework/Versions/A/_CodeSignature/CodeResources +230 -0
  62. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit-Swift.h +650 -0
  63. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Headers/LinkKit.h +22 -0
  64. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Info.plist +0 -0
  65. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/LinkKit +0 -0
  66. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.abi.json +53681 -0
  67. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +756 -0
  68. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  69. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +756 -0
  70. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/arm64-apple-ios-simulator.swiftmodule +0 -0
  71. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +53681 -0
  72. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +756 -0
  73. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  74. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +756 -0
  75. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/LinkKit.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  76. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/Modules/module.modulemap +11 -0
  77. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/PrivacyInfo.xcprivacy +32 -0
  78. package/ios/Frameworks/LinkKit.xcframework/ios-arm64_x86_64-simulator/LinkKit.framework/_CodeSignature/CodeResources +256 -0
  79. package/ios/ReactNativePlaidLinkSdk.podspec +31 -0
  80. package/ios/src/PlaidEmbeddedSearchView.swift +101 -0
  81. package/ios/src/RNPlaidLinkSdkVersion.swift +19 -0
  82. package/ios/src/ReactNativePlaidLinkSdkModule.swift +555 -0
  83. package/jest.config.js +21 -0
  84. package/jest.setup.js +7 -0
  85. package/package.json +32 -72
  86. package/scripts/check-package-entrypoints.js +146 -0
  87. package/scripts/extract-rn-enums.js +49 -0
  88. package/src/PlaidEmbeddedSearchView.tsx +35 -0
  89. package/src/ReactNativePlaidLinkSdk.types.ts +894 -0
  90. package/src/ReactNativePlaidLinkSdkModule.ts +31 -0
  91. package/src/index.ts +207 -22
  92. package/tsconfig.json +9 -0
  93. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  94. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  95. package/android/gradle.properties +0 -31
  96. package/android/gradlew +0 -174
  97. package/android/gradlew.bat +0 -89
  98. package/android/src/main/java/com/plaid/ActivityResultHandler.java +0 -7
  99. package/android/src/main/java/com/plaid/ActivityResultManager.java +0 -15
  100. package/android/src/main/java/com/plaid/GlobalFunctions.kt +0 -42
  101. package/android/src/main/java/com/plaid/PLKEmbeddedView.kt +0 -161
  102. package/android/src/main/java/com/plaid/PLKEmbeddedViewManager.kt +0 -50
  103. package/android/src/main/java/com/plaid/PlaidModule.kt +0 -291
  104. package/android/src/main/java/com/plaid/PlaidPackage.java +0 -117
  105. package/android/src/main/java/com/plaid/gson/PlaidJsonConverter.kt +0 -94
  106. package/android/src/main/java/com/plaid/gson/RNAccountAdapter.kt +0 -48
  107. package/android/src/main/java/com/plaid/gson/RNEventMetadataAdapter.kt +0 -49
  108. package/android/src/main/java/com/plaid/gson/RNLinkInstitutionAdapter.kt +0 -34
  109. package/android/src/main/res/layout/plk_embedded_view.xml +0 -5
  110. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerDelegate.java +0 -35
  111. package/android/src/paper/java/com/facebook/react/viewmanagers/PLKEmbeddedViewManagerInterface.java +0 -18
  112. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleAndroidSpec.java +0 -64
  113. package/android/src/paper/java/com/plaid/NativePlaidLinkModuleiOSSpec.java +0 -59
  114. package/dist/build/EmbeddedLink/EmbeddedLinkView.d.ts +0 -2
  115. package/dist/build/EmbeddedLink/EmbeddedLinkView.js +0 -56
  116. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  117. package/dist/build/EmbeddedLink/EmbeddedLinkView.web.js +0 -2
  118. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  119. package/dist/build/EmbeddedLink/NativeEmbeddedLinkView.js +0 -3
  120. package/dist/build/PlaidEmbeddedSearchView.d.ts +0 -2
  121. package/dist/build/PlaidEmbeddedSearchView.js +0 -25
  122. package/dist/build/PlaidLink.d.ts +0 -7
  123. package/dist/build/PlaidLink.js +0 -137
  124. package/dist/build/ReactNativePlaidLinkSdk.types.d.ts +0 -108
  125. package/dist/build/ReactNativePlaidLinkSdkModule.d.ts +0 -2
  126. package/dist/build/ReactNativePlaidLinkSdkView.d.ts +0 -2
  127. package/dist/build/ReactNativePlaidLinkSdkView.js +0 -7
  128. package/dist/build/Types.d.ts +0 -108
  129. package/dist/build/Types.js +0 -462
  130. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -2
  131. package/dist/build/fabric/EmbeddedLinkViewNativeComponent.js +0 -3
  132. package/dist/build/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -2
  133. package/dist/build/fabric/NativePlaidLinkModuleAndroid.js +0 -5
  134. package/dist/build/fabric/NativePlaidLinkModuleiOS.d.ts +0 -2
  135. package/dist/build/fabric/NativePlaidLinkModuleiOS.js +0 -5
  136. package/dist/build/fabric/fabricUtils.d.ts +0 -1
  137. package/dist/build/fabric/fabricUtils.js +0 -2
  138. package/dist/build/index.d.ts +0 -14
  139. package/dist/build/index.js +0 -154
  140. package/dist/src/EmbeddedLink/EmbeddedLinkView.d.ts +0 -13
  141. package/dist/src/EmbeddedLink/EmbeddedLinkView.js +0 -55
  142. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.d.ts +0 -1
  143. package/dist/src/EmbeddedLink/EmbeddedLinkView.web.js +0 -1
  144. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.d.ts +0 -2
  145. package/dist/src/EmbeddedLink/NativeEmbeddedLinkView.js +0 -2
  146. package/dist/src/PlaidLink.d.ts +0 -34
  147. package/dist/src/PlaidLink.js +0 -136
  148. package/dist/src/Types.js +0 -463
  149. package/dist/src/__tests__/Types.tests.d.ts +0 -1
  150. package/dist/src/__tests__/Types.tests.js +0 -14
  151. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.d.ts +0 -15
  152. package/dist/src/fabric/EmbeddedLinkViewNativeComponent.js +0 -2
  153. package/dist/src/fabric/NativePlaidLinkModuleAndroid.d.ts +0 -15
  154. package/dist/src/fabric/NativePlaidLinkModuleAndroid.js +0 -4
  155. package/dist/src/fabric/NativePlaidLinkModuleiOS.d.ts +0 -15
  156. package/dist/src/fabric/NativePlaidLinkModuleiOS.js +0 -4
  157. package/dist/src/fabric/fabricUtils.d.ts +0 -1
  158. package/dist/src/fabric/fabricUtils.js +0 -1
  159. package/dist/src/index.d.ts +0 -4
  160. package/dist/src/index.js +0 -5
  161. package/ios/PLKEmbeddedView.m +0 -7
  162. package/ios/PLKEmbeddedView.swift +0 -116
  163. package/ios/PLKEmbeddedViewComponentView.h +0 -28
  164. package/ios/PLKEmbeddedViewComponentView.mm +0 -91
  165. package/ios/PLKEmbeddedViewManager.swift +0 -14
  166. package/ios/PLKFabricHelpers.h +0 -116
  167. package/ios/RNLinksdk-Bridging-Header.h +0 -8
  168. package/ios/RNLinksdk.h +0 -19
  169. package/ios/RNLinksdk.mm +0 -732
  170. package/ios/RNPlaidHelper.h +0 -15
  171. package/ios/RNPlaidHelper.m +0 -33
  172. package/ios/react_native_plaid_link_sdk.h +0 -2
  173. package/react-native-plaid-link-sdk.podspec +0 -40
  174. package/src/EmbeddedLink/EmbeddedLinkView.tsx +0 -95
  175. package/src/EmbeddedLink/EmbeddedLinkView.web.tsx +0 -5
  176. package/src/EmbeddedLink/NativeEmbeddedLinkView.tsx +0 -3
  177. package/src/PlaidLink.tsx +0 -167
  178. package/src/Types.ts +0 -634
  179. package/src/__tests__/Types.tests.ts +0 -15
  180. package/src/fabric/EmbeddedLinkViewNativeComponent.ts +0 -24
  181. package/src/fabric/NativePlaidLinkModuleAndroid.ts +0 -32
  182. package/src/fabric/NativePlaidLinkModuleiOS.ts +0 -33
  183. package/src/fabric/fabricUtils.ts +0 -2
@@ -1,94 +0,0 @@
1
- /*
2
- * Copyright (c) 2020 Plaid Technologies, Inc. <support@plaid.com>
3
- */
4
- package com.plaid.gson
5
-
6
- import com.google.gson.Gson
7
- import com.google.gson.GsonBuilder
8
- import com.plaid.internal.classic.networking.adapter.AccountSubtypeAdapter
9
- import com.plaid.internal.classic.networking.adapter.AccountTypeAdapter
10
- import com.plaid.internal.classic.networking.adapter.LinkAccountVerificationStatusAdapter
11
- import com.plaid.internal.classic.networking.adapter.LinkEventNameAdapter
12
- import com.plaid.internal.classic.networking.adapter.LinkEventViewNameAdapter
13
- import com.plaid.internal.classic.networking.adapter.LinkExitMetadataStatusAdapter
14
- import com.plaid.internal.classic.networking.adapter.PlaidErrorCodeAdapter
15
- import com.plaid.internal.classic.networking.adapter.PlaidErrorTypeAdapter
16
- import com.plaid.link.event.LinkEvent
17
- import com.plaid.link.event.LinkEventMetadata
18
- import com.plaid.link.event.LinkEventName
19
- import com.plaid.link.event.LinkEventViewName
20
- import com.plaid.link.result.LinkAccount
21
- import com.plaid.link.result.LinkAccountSubtype
22
- import com.plaid.link.result.LinkAccountType
23
- import com.plaid.link.result.LinkAccountVerificationStatus
24
- import com.plaid.link.result.LinkErrorCode
25
- import com.plaid.link.result.LinkErrorType
26
- import com.plaid.link.result.LinkExit
27
- import com.plaid.link.result.LinkExitMetadataStatus
28
- import com.plaid.link.result.LinkInstitution
29
- import com.plaid.link.result.LinkSuccess
30
-
31
- class PlaidJsonConverter {
32
-
33
- private val gson: Gson by lazy {
34
- GsonBuilder().apply {
35
- this.registerTypeAdapter(
36
- LinkAccount::class.java,
37
- RNAccountAdapter()
38
- )
39
- this.registerTypeAdapter(
40
- LinkInstitution::class.java,
41
- RNLinkInstitutionAdapter()
42
- )
43
- this.registerTypeAdapter(
44
- LinkAccountType::class.java,
45
- AccountTypeAdapter()
46
- )
47
- this.registerTypeAdapter(
48
- LinkAccountSubtype::class.java,
49
- AccountSubtypeAdapter()
50
- )
51
- this.registerTypeAdapter(
52
- LinkAccountVerificationStatus::class.java,
53
- LinkAccountVerificationStatusAdapter()
54
- )
55
- this.registerTypeAdapter(
56
- LinkEventViewName::class.java,
57
- LinkEventViewNameAdapter()
58
- )
59
- this.registerTypeAdapter(
60
- LinkEventName::class.java,
61
- LinkEventNameAdapter()
62
- )
63
- this.registerTypeAdapter(
64
- LinkEventMetadata::class.java,
65
- RNEventMetadataAdapter()
66
- )
67
- this.registerTypeAdapter(
68
- LinkErrorCode::class.java,
69
- PlaidErrorCodeAdapter()
70
- )
71
- this.registerTypeAdapter(
72
- LinkErrorType::class.java,
73
- PlaidErrorTypeAdapter()
74
- )
75
- this.registerTypeAdapter(
76
- LinkExitMetadataStatus::class.java,
77
- LinkExitMetadataStatusAdapter()
78
- )
79
- }.create()
80
- }
81
-
82
- fun convert(linkSuccess: LinkSuccess): String {
83
- return gson.toJson(linkSuccess)
84
- }
85
-
86
- fun convert(linkExit: LinkExit): String {
87
- return gson.toJson(linkExit)
88
- }
89
-
90
- fun convert(linkEvent: LinkEvent): String {
91
- return gson.toJson(linkEvent)
92
- .replace("event_name", "event")
93
- }
94
- }
@@ -1,48 +0,0 @@
1
- /*
2
- * Copyright (c) 2020 Plaid Technologies, Inc. <support@plaid.com>
3
- */
4
- package com.plaid.gson
5
-
6
- import com.google.gson.JsonDeserializationContext
7
- import com.google.gson.JsonDeserializer
8
- import com.google.gson.JsonElement
9
- import com.google.gson.JsonObject
10
- import com.google.gson.JsonPrimitive
11
- import com.google.gson.JsonSerializationContext
12
- import com.google.gson.JsonSerializer
13
- import com.plaid.link.result.LinkAccount
14
- import java.lang.reflect.Type
15
-
16
- class RNAccountAdapter : JsonSerializer<LinkAccount> {
17
-
18
- override fun serialize(
19
- src: LinkAccount?,
20
- typeOfSrc: Type?,
21
- context: JsonSerializationContext?
22
- ): JsonElement {
23
- if (src == null) {
24
- return JsonObject()
25
- }
26
- val obj = JsonObject().apply {
27
- addProperty("id", src.id)
28
- addProperty("name", src.name)
29
- src.mask?.let {
30
- addProperty("mask", it)
31
- }
32
- src.verificationStatus?.let { status ->
33
- context?.serialize(status)?.asJsonObject?.let {
34
- addProperty("verification_status", it.get("json").asString)
35
- addProperty("verificationStatus", it.get("json").asString)
36
- }
37
- }
38
-
39
- // Special handling around account subtype
40
- val subtype = context?.serialize(src.subtype)?.asJsonObject
41
- subtype?.let {
42
- addProperty("type", it.get("accountType")?.asString)
43
- addProperty("subtype", it.get("json")?.asString)
44
- }
45
- }
46
- return obj
47
- }
48
- }
@@ -1,49 +0,0 @@
1
- package com.plaid.gson
2
-
3
- import com.google.gson.JsonDeserializationContext
4
- import com.google.gson.JsonDeserializer
5
- import com.google.gson.JsonElement
6
- import com.google.gson.JsonObject
7
- import com.google.gson.JsonPrimitive
8
- import com.google.gson.JsonSerializationContext
9
- import com.google.gson.JsonSerializer
10
- import com.plaid.link.event.LinkEventMetadata
11
- import java.lang.reflect.Type
12
-
13
- class RNEventMetadataAdapter : JsonSerializer<LinkEventMetadata> {
14
-
15
- override fun serialize(
16
- src: LinkEventMetadata?,
17
- typeOfSrc: Type?,
18
- context: JsonSerializationContext?
19
- ): JsonElement {
20
- if (src == null) {
21
- return JsonObject()
22
- }
23
- val obj = JsonObject().apply {
24
- addProperty("errorType", src.errorType)
25
- addProperty("errorCode", src.errorCode)
26
- addProperty("errorMessage", src.errorMessage)
27
- addProperty("exitStatus", src.exitStatus)
28
- addProperty("institutionId", src.institutionId)
29
- addProperty("institutionName", src.institutionName)
30
- addProperty("institutionSearchQuery", src.institutionSearchQuery)
31
- addProperty("accountNumberMask", src.accountNumberMask)
32
- addProperty("isUpdateMode", src.isUpdateMode)
33
- addProperty("matchReason", src.matchReason)
34
- addProperty("routingNumber", src.routingNumber)
35
- addProperty("selection", src.selection)
36
- addProperty("linkSessionId", src.linkSessionId)
37
- addProperty("mfaType", src.mfaType)
38
- addProperty("requestId", src.requestId)
39
- addProperty("issueId", src.issueId)
40
- addProperty("issueDescription", src.issueDescription)
41
- addProperty("issueDetectedAt", src.issueDetectedAt)
42
- addProperty("timestamp", src.timestamp)
43
- addProperty("viewName", src.viewName?.jsonValue ?: "")
44
- addProperty("metadata_json", src.metadataJson) // deprecated
45
- addProperty("metadataJson", src.metadataJson)
46
- }
47
- return obj
48
- }
49
- }
@@ -1,34 +0,0 @@
1
- /*
2
- * Copyright (c) 2020 Plaid Technologies, Inc. <support@plaid.com>
3
- */
4
- package com.plaid.gson
5
-
6
- import com.google.gson.JsonDeserializationContext
7
- import com.google.gson.JsonDeserializer
8
- import com.google.gson.JsonElement
9
- import com.google.gson.JsonObject
10
- import com.google.gson.JsonPrimitive
11
- import com.google.gson.JsonSerializationContext
12
- import com.google.gson.JsonSerializer
13
- import com.plaid.link.result.LinkInstitution
14
- import java.lang.reflect.Type
15
-
16
- class RNLinkInstitutionAdapter : JsonSerializer<LinkInstitution> {
17
-
18
- override fun serialize(
19
- src: LinkInstitution?,
20
- typeOfSrc: Type?,
21
- context: JsonSerializationContext?
22
- ): JsonElement {
23
- if (src == null) {
24
- return JsonObject()
25
- }
26
- val obj = JsonObject().apply {
27
- // Replace "institution_id" with "id"
28
- addProperty("id", src.id)
29
- // Replace "institution_name" with "id"
30
- addProperty("name", src.name)
31
- }
32
- return obj
33
- }
34
- }
@@ -1,5 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
- android:id="@+id/embedded_frame_layout"
4
- android:layout_width="match_parent"
5
- android:layout_height="match_parent" />
@@ -1,35 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaDelegate.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
- import androidx.annotation.Nullable;
14
- import com.facebook.react.uimanager.BaseViewManagerDelegate;
15
- import com.facebook.react.uimanager.BaseViewManager;
16
- import com.facebook.react.uimanager.LayoutShadowNode;
17
-
18
- public class PLKEmbeddedViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PLKEmbeddedViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
- public PLKEmbeddedViewManagerDelegate(U viewManager) {
20
- super(viewManager);
21
- }
22
- @Override
23
- public void setProperty(T view, String propName, @Nullable Object value) {
24
- switch (propName) {
25
- case "token":
26
- mViewManager.setToken(view, value == null ? null : (String) value);
27
- break;
28
- case "iOSPresentationStyle":
29
- mViewManager.setIOSPresentationStyle(view, value == null ? null : (String) value);
30
- break;
31
- default:
32
- super.setProperty(view, propName, value);
33
- }
34
- }
35
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GeneratePropsJavaInterface.js
8
- */
9
-
10
- package com.facebook.react.viewmanagers;
11
-
12
- import android.view.View;
13
- import androidx.annotation.Nullable;
14
-
15
- public interface PLKEmbeddedViewManagerInterface<T extends View> {
16
- void setToken(T view, @Nullable String value);
17
- void setIOSPresentationStyle(T view, @Nullable String value);
18
- }
@@ -1,64 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJavaSpec.js
9
- *
10
- * @nolint
11
- */
12
-
13
- package com.plaid;
14
-
15
- import com.facebook.proguard.annotations.DoNotStrip;
16
- import com.facebook.react.bridge.Callback;
17
- import com.facebook.react.bridge.Promise;
18
- import com.facebook.react.bridge.ReactApplicationContext;
19
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
20
- import com.facebook.react.bridge.ReactMethod;
21
- import com.facebook.react.bridge.ReadableMap;
22
- import com.facebook.react.turbomodule.core.interfaces.TurboModule;
23
- import javax.annotation.Nonnull;
24
-
25
- public abstract class NativePlaidLinkModuleAndroidSpec extends ReactContextBaseJavaModule implements TurboModule {
26
- public static final String NAME = "PlaidAndroid";
27
-
28
- public NativePlaidLinkModuleAndroidSpec(ReactApplicationContext reactContext) {
29
- super(reactContext);
30
- }
31
-
32
- @Override
33
- public @Nonnull String getName() {
34
- return NAME;
35
- }
36
-
37
- @ReactMethod
38
- @DoNotStrip
39
- public abstract void createPlaidLink(String token, boolean noLoadingState, String logLevel, Callback onLoad);
40
-
41
- @ReactMethod
42
- @DoNotStrip
43
- public abstract void open(Callback onSuccess, Callback onExit);
44
-
45
- @ReactMethod
46
- @DoNotStrip
47
- public abstract void destroy(Promise promise);
48
-
49
- @ReactMethod
50
- @DoNotStrip
51
- public abstract void startLinkActivityForResult(String token, boolean noLoadingState, String logLevel, Callback onSuccessCallback, Callback onExitCallback);
52
-
53
- @ReactMethod
54
- @DoNotStrip
55
- public abstract void submit(String phoneNumber, String dateOfBirth, ReadableMap params);
56
-
57
- @ReactMethod
58
- @DoNotStrip
59
- public abstract void addListener(String eventName);
60
-
61
- @ReactMethod
62
- @DoNotStrip
63
- public abstract void removeListeners(double count);
64
- }
@@ -1,59 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJavaSpec.js
9
- *
10
- * @nolint
11
- */
12
-
13
- package com.plaid;
14
-
15
- import com.facebook.proguard.annotations.DoNotStrip;
16
- import com.facebook.react.bridge.Callback;
17
- import com.facebook.react.bridge.ReactApplicationContext;
18
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
- import com.facebook.react.bridge.ReactMethod;
20
- import com.facebook.react.bridge.ReadableMap;
21
- import com.facebook.react.turbomodule.core.interfaces.TurboModule;
22
- import javax.annotation.Nonnull;
23
-
24
- public abstract class NativePlaidLinkModuleiOSSpec extends ReactContextBaseJavaModule implements TurboModule {
25
- public static final String NAME = "RNLinksdk";
26
-
27
- public NativePlaidLinkModuleiOSSpec(ReactApplicationContext reactContext) {
28
- super(reactContext);
29
- }
30
-
31
- @Override
32
- public @Nonnull String getName() {
33
- return NAME;
34
- }
35
-
36
- @ReactMethod
37
- @DoNotStrip
38
- public abstract void createPlaidLink(String token, boolean noLoadingState);
39
-
40
- @ReactMethod
41
- @DoNotStrip
42
- public abstract void open(boolean fullScreen, Callback onSuccess, Callback onExit);
43
-
44
- @ReactMethod
45
- @DoNotStrip
46
- public abstract void dismiss();
47
-
48
- @ReactMethod
49
- @DoNotStrip
50
- public abstract void submit(String phoneNumber, String dateOfBirth, ReadableMap params);
51
-
52
- @ReactMethod
53
- @DoNotStrip
54
- public abstract void addListener(String eventName);
55
-
56
- @ReactMethod
57
- @DoNotStrip
58
- public abstract void removeListeners(int count);
59
- }
@@ -1,2 +0,0 @@
1
- export function EmbeddedLinkView(props: any): React.JSX.Element;
2
- import React from 'react';
@@ -1,56 +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
- };
56
- //# sourceMappingURL=EmbeddedLinkView.js.map
@@ -1 +0,0 @@
1
- export function EmbeddedLinkView(): null;
@@ -1,2 +0,0 @@
1
- export const EmbeddedLinkView = () => null;
2
- //# sourceMappingURL=EmbeddedLinkView.web.js.map
@@ -1,2 +0,0 @@
1
- export default NativeEmbeddedLinkView;
2
- import NativeEmbeddedLinkView from '../fabric/EmbeddedLinkViewNativeComponent';
@@ -1,3 +0,0 @@
1
- import NativeEmbeddedLinkView from '../fabric/EmbeddedLinkViewNativeComponent';
2
- export default NativeEmbeddedLinkView;
3
- //# sourceMappingURL=NativeEmbeddedLinkView.js.map
@@ -1,2 +0,0 @@
1
- export function PlaidEmbeddedSearchView(props: any): React.JSX.Element | null;
2
- import * as React from "react";
@@ -1,25 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { requireNativeViewManager } from "expo-modules-core";
13
- import * as React from "react";
14
- import { Platform } from "react-native";
15
- const NativeView = Platform.OS === "ios"
16
- ? requireNativeViewManager("ReactNativePlaidLinkSdk")
17
- : () => null;
18
- export function PlaidEmbeddedSearchView(props) {
19
- if (Platform.OS !== "ios") {
20
- return null;
21
- }
22
- const { onSuccess, onExit, onEvent, onLoad } = props, restProps = __rest(props, ["onSuccess", "onExit", "onEvent", "onLoad"]);
23
- return (<NativeView {...restProps} onSuccess={(event) => onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(event.nativeEvent)} onExit={(event) => onExit === null || onExit === void 0 ? void 0 : onExit(event.nativeEvent)} onEvent={(event) => onEvent === null || onEvent === void 0 ? void 0 : onEvent(event.nativeEvent)} onLoad={(event) => onLoad === null || onLoad === void 0 ? void 0 : onLoad()}/>);
24
- }
25
- //# sourceMappingURL=PlaidEmbeddedSearchView.js.map
@@ -1,7 +0,0 @@
1
- export function usePlaidEmitter(linkEventListener: any): void;
2
- export function create(props: any): void;
3
- export function open(props: any): void;
4
- export function destroy(): Promise<void>;
5
- export function dismissLink(): void;
6
- export function submit(data: any): void;
7
- export function syncFinanceKit(token: string, requestAuthorizationIfNeeded: boolean, simulatedBehavior: any, completion: Function): void;
@@ -1,137 +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
- };
137
- //# sourceMappingURL=PlaidLink.js.map