react-native-unit-components 1.11.0 → 1.12.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 (263) hide show
  1. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +2 -0
  2. package/android/src/main/java/com/unitreactnativecomponents/unStoreManager/UNStoreManager.kt +36 -0
  3. package/ios/UNStoreManager/UNStoreManager.swift +28 -0
  4. package/ios/UNStoreManager/UNStoreManagerExportModule.m +8 -0
  5. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -1
  6. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  7. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -1
  8. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  9. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +36 -51
  10. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  11. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +133 -12
  12. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  13. package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +62 -19
  14. package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
  15. package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +57 -38
  16. package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
  17. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +132 -0
  18. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -0
  19. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +96 -0
  20. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -0
  21. package/lib/commonjs/components/UNPayeeManagementComponent/index.js +21 -0
  22. package/lib/commonjs/components/UNPayeeManagementComponent/index.js.map +1 -0
  23. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +104 -0
  24. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -0
  25. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js +37 -0
  26. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js.map +1 -0
  27. package/lib/commonjs/components/UNWhiteLabelAppComponent/index.js +21 -0
  28. package/lib/commonjs/components/UNWhiteLabelAppComponent/index.js.map +1 -0
  29. package/lib/commonjs/components/index.js +22 -0
  30. package/lib/commonjs/components/index.js.map +1 -1
  31. package/lib/commonjs/index.js +1 -8
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/messages/webMessages/payeeManagementMessage.js +15 -0
  34. package/lib/commonjs/messages/webMessages/payeeManagementMessage.js.map +1 -0
  35. package/lib/commonjs/messages/webMessages/plaidMessages.js +14 -0
  36. package/lib/commonjs/messages/webMessages/plaidMessages.js.map +1 -0
  37. package/lib/commonjs/messages/webMessages/unitMessages.js +3 -2
  38. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
  39. package/lib/commonjs/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.js +23 -0
  40. package/lib/commonjs/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.js.map +1 -0
  41. package/lib/commonjs/networking/common/UNNetworkConstants.js +3 -3
  42. package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -1
  43. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +1 -0
  44. package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  45. package/lib/commonjs/scripts/html/bodyHtml.js +1 -1
  46. package/lib/commonjs/scripts/html/bodyScript.js +110 -4
  47. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  48. package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -1
  49. package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -1
  50. package/lib/commonjs/types/internal/bottomSheet.types.js +5 -0
  51. package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -1
  52. package/lib/commonjs/types/internal/unitStore.types.js +13 -0
  53. package/lib/commonjs/types/internal/unitStore.types.js.map +1 -0
  54. package/lib/commonjs/types/internal/webComponent.types.js +2 -0
  55. package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
  56. package/lib/commonjs/types/shared/env.types.js +12 -0
  57. package/lib/commonjs/types/shared/env.types.js.map +1 -0
  58. package/lib/commonjs/types/shared/index.js +22 -0
  59. package/lib/commonjs/types/shared/index.js.map +1 -1
  60. package/lib/commonjs/types/shared/payeeManagement.types.js +17 -0
  61. package/lib/commonjs/types/shared/payeeManagement.types.js.map +1 -0
  62. package/lib/commonjs/types/shared/payments.types.js +18 -1
  63. package/lib/commonjs/types/shared/payments.types.js.map +1 -1
  64. package/lib/commonjs/unitSdkManager/UnitSdk.api.js +1 -3
  65. package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
  66. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +1 -1
  67. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +10 -6
  68. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  69. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +3 -3
  70. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -1
  71. package/lib/commonjs/unitSdkManager/unitHelpersManager/UnitHelpersManager.js +16 -0
  72. package/lib/commonjs/unitSdkManager/unitHelpersManager/UnitHelpersManager.js.map +1 -0
  73. package/lib/commonjs/utils/windowUnitStore.js +11 -0
  74. package/lib/commonjs/utils/windowUnitStore.js.map +1 -0
  75. package/lib/commonjs/webComponent/WebComponent.js +51 -14
  76. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  77. package/lib/commonjs/webComponent/html.js +11 -0
  78. package/lib/commonjs/webComponent/html.js.map +1 -1
  79. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -1
  80. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  81. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -1
  82. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  83. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +37 -52
  84. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  85. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +131 -8
  86. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  87. package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +63 -21
  88. package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
  89. package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +57 -38
  90. package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
  91. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +124 -0
  92. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -0
  93. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +82 -0
  94. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -0
  95. package/lib/module/components/UNPayeeManagementComponent/index.js +2 -0
  96. package/lib/module/components/UNPayeeManagementComponent/index.js.map +1 -0
  97. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +95 -0
  98. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -0
  99. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js +28 -0
  100. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js.map +1 -0
  101. package/lib/module/components/UNWhiteLabelAppComponent/index.js +2 -0
  102. package/lib/module/components/UNWhiteLabelAppComponent/index.js.map +1 -0
  103. package/lib/module/components/index.js +2 -0
  104. package/lib/module/components/index.js.map +1 -1
  105. package/lib/module/index.js +1 -1
  106. package/lib/module/index.js.map +1 -1
  107. package/lib/module/messages/webMessages/payeeManagementMessage.js +9 -0
  108. package/lib/module/messages/webMessages/payeeManagementMessage.js.map +1 -0
  109. package/lib/module/messages/webMessages/plaidMessages.js +8 -0
  110. package/lib/module/messages/webMessages/plaidMessages.js.map +1 -0
  111. package/lib/module/messages/webMessages/unitMessages.js +3 -2
  112. package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
  113. package/lib/module/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.js +17 -0
  114. package/lib/module/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.js.map +1 -0
  115. package/lib/module/networking/common/UNNetworkConstants.js +1 -1
  116. package/lib/module/networking/common/UNNetworkConstants.js.map +1 -1
  117. package/lib/module/networking/requests/UNWalletPayloadRequest.js +1 -0
  118. package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  119. package/lib/module/scripts/html/bodyHtml.js +1 -1
  120. package/lib/module/scripts/html/bodyScript.js +109 -3
  121. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  122. package/lib/module/slices/ConfigurationSlice.js.map +1 -1
  123. package/lib/module/slices/SharedEventsSlice.js.map +1 -1
  124. package/lib/module/types/internal/bottomSheet.types.js +5 -0
  125. package/lib/module/types/internal/bottomSheet.types.js.map +1 -1
  126. package/lib/module/types/internal/unitStore.types.js +8 -0
  127. package/lib/module/types/internal/unitStore.types.js.map +1 -0
  128. package/lib/module/types/internal/webComponent.types.js +2 -0
  129. package/lib/module/types/internal/webComponent.types.js.map +1 -1
  130. package/lib/module/types/shared/env.types.js +6 -0
  131. package/lib/module/types/shared/env.types.js.map +1 -0
  132. package/lib/module/types/shared/index.js +2 -0
  133. package/lib/module/types/shared/index.js.map +1 -1
  134. package/lib/module/types/shared/payeeManagement.types.js +11 -0
  135. package/lib/module/types/shared/payeeManagement.types.js.map +1 -0
  136. package/lib/module/types/shared/payments.types.js +17 -0
  137. package/lib/module/types/shared/payments.types.js.map +1 -1
  138. package/lib/module/unitSdkManager/UnitSdk.api.js +2 -4
  139. package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
  140. package/lib/module/unitSdkManager/UnitSdk.constants.js +1 -1
  141. package/lib/module/unitSdkManager/UnitSdkManager.js +8 -5
  142. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  143. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +1 -1
  144. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -1
  145. package/lib/module/unitSdkManager/unitHelpersManager/UnitHelpersManager.js +9 -0
  146. package/lib/module/unitSdkManager/unitHelpersManager/UnitHelpersManager.js.map +1 -0
  147. package/lib/module/utils/windowUnitStore.js +4 -0
  148. package/lib/module/utils/windowUnitStore.js.map +1 -0
  149. package/lib/module/webComponent/WebComponent.js +51 -15
  150. package/lib/module/webComponent/WebComponent.js.map +1 -1
  151. package/lib/module/webComponent/html.js +12 -1
  152. package/lib/module/webComponent/html.js.map +1 -1
  153. package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
  154. package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
  155. package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts.map +1 -1
  156. package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -4
  157. package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts.map +1 -1
  158. package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.d.ts.map +1 -1
  159. package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts.map +1 -1
  160. package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts +1 -1
  161. package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts.map +1 -1
  162. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts +27 -0
  163. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts.map +1 -0
  164. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.d.ts +15 -0
  165. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.d.ts.map +1 -0
  166. package/lib/typescript/src/components/UNPayeeManagementComponent/index.d.ts +2 -0
  167. package/lib/typescript/src/components/UNPayeeManagementComponent/index.d.ts.map +1 -0
  168. package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.d.ts +10 -0
  169. package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.d.ts.map +1 -0
  170. package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.d.ts +7 -0
  171. package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.d.ts.map +1 -0
  172. package/lib/typescript/src/components/UNWhiteLabelAppComponent/index.d.ts +2 -0
  173. package/lib/typescript/src/components/UNWhiteLabelAppComponent/index.d.ts.map +1 -0
  174. package/lib/typescript/src/components/index.d.ts +2 -0
  175. package/lib/typescript/src/components/index.d.ts.map +1 -1
  176. package/lib/typescript/src/index.d.ts +1 -1
  177. package/lib/typescript/src/index.d.ts.map +1 -1
  178. package/lib/typescript/src/messages/webMessages/index.d.ts +4 -2
  179. package/lib/typescript/src/messages/webMessages/index.d.ts.map +1 -1
  180. package/lib/typescript/src/messages/webMessages/payeeManagementMessage.d.ts +19 -0
  181. package/lib/typescript/src/messages/webMessages/payeeManagementMessage.d.ts.map +1 -0
  182. package/lib/typescript/src/messages/webMessages/plaidMessages.d.ts +24 -0
  183. package/lib/typescript/src/messages/webMessages/plaidMessages.d.ts.map +1 -0
  184. package/lib/typescript/src/messages/webMessages/unitMessages.d.ts +12 -3
  185. package/lib/typescript/src/messages/webMessages/unitMessages.d.ts.map +1 -1
  186. package/lib/typescript/src/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.d.ts +7 -0
  187. package/lib/typescript/src/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.d.ts.map +1 -0
  188. package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts +1 -1
  189. package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts.map +1 -1
  190. package/lib/typescript/src/scripts/html/bodyScript.d.ts +12 -0
  191. package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
  192. package/lib/typescript/src/slices/ConfigurationSlice.d.ts.map +1 -1
  193. package/lib/typescript/src/slices/SharedEventsSlice.d.ts +21 -2
  194. package/lib/typescript/src/slices/SharedEventsSlice.d.ts.map +1 -1
  195. package/lib/typescript/src/store/store.d.ts +24 -0
  196. package/lib/typescript/src/store/store.d.ts.map +1 -1
  197. package/lib/typescript/src/types/internal/bottomSheet.types.d.ts +29 -16
  198. package/lib/typescript/src/types/internal/bottomSheet.types.d.ts.map +1 -1
  199. package/lib/typescript/src/types/internal/unitStore.types.d.ts +5 -0
  200. package/lib/typescript/src/types/internal/unitStore.types.d.ts.map +1 -0
  201. package/lib/typescript/src/types/internal/webComponent.types.d.ts +3 -1
  202. package/lib/typescript/src/types/internal/webComponent.types.d.ts.map +1 -1
  203. package/lib/typescript/src/types/shared/env.types.d.ts +5 -0
  204. package/lib/typescript/src/types/shared/env.types.d.ts.map +1 -0
  205. package/lib/typescript/src/types/shared/index.d.ts +2 -0
  206. package/lib/typescript/src/types/shared/index.d.ts.map +1 -1
  207. package/lib/typescript/src/types/shared/payeeManagement.types.d.ts +48 -0
  208. package/lib/typescript/src/types/shared/payeeManagement.types.d.ts.map +1 -0
  209. package/lib/typescript/src/types/shared/payments.types.d.ts +17 -3
  210. package/lib/typescript/src/types/shared/payments.types.d.ts.map +1 -1
  211. package/lib/typescript/src/unitSdkManager/UnitSdk.api.d.ts.map +1 -1
  212. package/lib/typescript/src/unitSdkManager/UnitSdkManager.d.ts +5 -5
  213. package/lib/typescript/src/unitSdkManager/UnitSdkManager.d.ts.map +1 -1
  214. package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts +1 -1
  215. package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts.map +1 -1
  216. package/lib/typescript/src/unitSdkManager/unitHelpersManager/UnitHelpersManager.d.ts +6 -0
  217. package/lib/typescript/src/unitSdkManager/unitHelpersManager/UnitHelpersManager.d.ts.map +1 -0
  218. package/lib/typescript/src/utils/windowUnitStore.d.ts +3 -0
  219. package/lib/typescript/src/utils/windowUnitStore.d.ts.map +1 -0
  220. package/lib/typescript/src/webComponent/WebComponent.d.ts.map +1 -1
  221. package/lib/typescript/src/webComponent/html.d.ts.map +1 -1
  222. package/package.json +2 -2
  223. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +2 -1
  224. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +2 -1
  225. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +45 -58
  226. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +153 -9
  227. package/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx +81 -21
  228. package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +54 -36
  229. package/src/components/UNCardComponent/UNCardComponent.tsx +1 -1
  230. package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.tsx +153 -0
  231. package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.ts +87 -0
  232. package/src/components/UNPayeeManagementComponent/index.ts +1 -0
  233. package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.tsx +124 -0
  234. package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.ts +35 -0
  235. package/src/components/UNWhiteLabelAppComponent/index.ts +1 -0
  236. package/src/components/index.ts +2 -0
  237. package/src/index.tsx +1 -1
  238. package/src/messages/webMessages/index.ts +6 -0
  239. package/src/messages/webMessages/payeeManagementMessage.ts +26 -0
  240. package/src/messages/webMessages/plaidMessages.ts +29 -0
  241. package/src/messages/webMessages/unitMessages.ts +13 -2
  242. package/src/nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper.ts +19 -0
  243. package/src/networking/common/UNNetworkConstants.ts +1 -1
  244. package/src/networking/requests/UNWalletPayloadRequest.ts +2 -1
  245. package/src/scripts/html/bodyHtml.ts +1 -1
  246. package/src/scripts/html/bodyScript.ts +113 -3
  247. package/src/slices/ConfigurationSlice.ts +1 -2
  248. package/src/slices/SharedEventsSlice.ts +28 -1
  249. package/src/types/internal/bottomSheet.types.ts +34 -15
  250. package/src/types/internal/unitStore.types.ts +6 -0
  251. package/src/types/internal/webComponent.types.ts +2 -0
  252. package/src/types/shared/env.types.ts +4 -0
  253. package/src/types/shared/index.ts +2 -0
  254. package/src/types/shared/payeeManagement.types.ts +49 -0
  255. package/src/types/shared/payments.types.ts +20 -2
  256. package/src/unitSdkManager/UnitSdk.api.ts +2 -4
  257. package/src/unitSdkManager/UnitSdk.constants.ts +1 -1
  258. package/src/unitSdkManager/UnitSdkManager.ts +12 -6
  259. package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +3 -1
  260. package/src/unitSdkManager/unitHelpersManager/UnitHelpersManager.ts +11 -0
  261. package/src/utils/windowUnitStore.ts +5 -0
  262. package/src/webComponent/WebComponent.tsx +60 -23
  263. package/src/webComponent/html.ts +14 -1
@@ -0,0 +1,153 @@
1
+ import React, { useRef } from 'react';
2
+ import type WebView from 'react-native-webview';
3
+ import {
4
+ RequestRefreshEvent,
5
+ UnitMessage,
6
+ } from '../../messages/webMessages/unitMessages';
7
+ import { WebComponent } from '../../webComponent/WebComponent';
8
+ import type { WebViewMessage } from '../../messages/webMessages';
9
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
10
+ import { withReduxStore } from '../../helpers/store/helpers';
11
+ import { UNPayeeConnectedAccount, UNPayeeCounterparty, UNPayeeManagementComponentPaginationType, UNPayeeManagementMenuItem, UNPlaidAccountFilter } from '../../types/shared';
12
+ import { getPayeeParams, getPayeeManagementScript, injectRefreshEventIfNeeded, injectUnitPlaidResponse, injectUnitOpenPlaid, injectUnitPlaidExit } from './UNPayeeManagementComponent.utils';
13
+ import { BottomSheetRenderingType, BottomSheetSlotData, SlotRendering } from '../../types/internal/bottomSheet.types';
14
+ import { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
15
+ import { useDispatch } from 'react-redux';
16
+ import { setEvent } from '../../slices/SharedEventsSlice';
17
+ import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
18
+ import { useListenerToEvent } from '../../hooks/useListenerToEvent';
19
+ import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
20
+ import { OpenPlaidEvent, PlaidMessage } from '../../messages/webMessages/plaidMessages';
21
+ import { PayeeConnectedAccountEvent, PayeeCounterpartyEvent, PayeeManagementMessage, PayeeMicroDepositeConnectionEvent } from '../../messages/webMessages/payeeManagementMessage';
22
+
23
+ export interface UNPayeeManagementComponentProps {
24
+ // inputs
25
+ customerToken: string;
26
+ menuItems?: UNPayeeManagementMenuItem[];
27
+ queryFilter?: string;
28
+ paginationType?: UNPayeeManagementComponentPaginationType;
29
+ counterPartiesPerPage?: number;
30
+
31
+ // ui
32
+ theme?: string;
33
+ language?: string;
34
+
35
+ hideTitle?: boolean;
36
+ hideCounterpartyActionsButton?: boolean;
37
+
38
+ menuPlaceholder?: string;
39
+ flowPlaceholder?: string;
40
+ payeeCreationPlaceholder?: string;
41
+ microDepositConnectionPlaceholder?: string;
42
+
43
+ plaidAccountFilters?: UNPlaidAccountFilter[];
44
+ plaidLinkCustomizationName?: string;
45
+
46
+ // events
47
+ onCounterpartyCreated?: (counterparty: UNPayeeCounterparty) => void;
48
+ onCounterpartyDeleted?: (counterparty: UNPayeeCounterparty) => void;
49
+
50
+ onConnectedAccountCreated?: (connectedAccount: UNPayeeConnectedAccount) => void;
51
+ onMicroDepositConnectionCreated?: (onnectedAccount: UNPayeeCounterparty) => void;
52
+ onMicroDepositConnectionRejected?: (connectedAccount: UNPayeeConnectedAccount) => void;
53
+ }
54
+
55
+ const UNPayeeManagementComponent = (props: UNPayeeManagementComponentProps) => {
56
+ const dispatch = useDispatch();
57
+ const webRef = useRef<WebView>(null);
58
+
59
+ const requestRefresh = (data: RequestRefreshEvent) => {
60
+ injectRefreshEventIfNeeded(webRef.current, data);
61
+ };
62
+
63
+ const openPlaid = (openPlaidData: OpenPlaidEvent) => {
64
+ injectUnitOpenPlaid(webRef.current, openPlaidData);
65
+
66
+ const linkToken = openPlaidData.plaidLinkToken.attributes.linkToken;
67
+
68
+ linkToken && openLink({
69
+ tokenConfig: { noLoadingState: false, token: linkToken },
70
+ onSuccess: (success: LinkSuccess) => {
71
+ injectUnitPlaidResponse(webRef.current, success);
72
+ },
73
+ onExit: exit => {
74
+ injectUnitPlaidExit(webRef.current, exit.error);
75
+ },
76
+ }).catch(e => {
77
+ console.error(e);
78
+ });
79
+ };
80
+
81
+ const reportCounterpartyDeleted = (counterparty: UNPayeeCounterparty) => {
82
+ props.onCounterpartyDeleted && props.onCounterpartyDeleted(counterparty);
83
+ };
84
+
85
+ useListenerToEvent({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
86
+ useListenerToEvent({ busEventKey: PlaidMessage.UNIT_OPEN_PLAID, action: openPlaid });
87
+ useListenerToEvent({ busEventKey: PayeeManagementMessage.UNIT_COUNTERPARTY_DELETED, action: reportCounterpartyDeleted });
88
+
89
+ const handleRequestRendering = (requestRenderingEvent : RequestRenderingEvent) => {
90
+ switch (requestRenderingEvent.data.nativeComponentName) {
91
+ default: {
92
+ const slotData: BottomSheetSlotData = {
93
+ componentName: requestRenderingEvent.data.nativeComponentName,
94
+ requestRenderingEvent: requestRenderingEvent,
95
+ };
96
+ const data = {
97
+ type: BottomSheetRenderingType.Slot,
98
+ data: slotData,
99
+ } as SlotRendering;
100
+ dispatch(setEvent({ key: BottomSheetNativeMessage.REQUEST_RENDERING, data }));
101
+ }
102
+ }
103
+ };
104
+
105
+ const handleMessage = (message: WebViewMessage) => {
106
+ switch (message.type) {
107
+ case UnitMessage.UNIT_REQUEST_RENDERING: {
108
+ const requestRenderingEvent = message.details as RequestRenderingEvent;
109
+ handleRequestRendering(requestRenderingEvent);
110
+ break;
111
+ }
112
+ case UnitMessage.UNIT_ON_LOAD: {
113
+ break;
114
+ }
115
+ case PayeeManagementMessage.UNIT_CONNECTED_ACCOUNT_CREATED: {
116
+ const account: UNPayeeConnectedAccount = (message.details as PayeeConnectedAccountEvent).account;
117
+ props.onConnectedAccountCreated && props.onConnectedAccountCreated(account);
118
+ break;
119
+ }
120
+ case PayeeManagementMessage.UNIT_COUNTERPARTY_CREATED: {
121
+ const counterparty: UNPayeeCounterparty = (message.details as PayeeCounterpartyEvent).counterparty;
122
+ props.onCounterpartyCreated && props.onCounterpartyCreated(counterparty);
123
+ break;
124
+ }
125
+ case PayeeManagementMessage.UNIT_MICRO_DEPOSIT_CONNECTION_CREATED: {
126
+ const counterparty: UNPayeeCounterparty = (message.details as PayeeMicroDepositeConnectionEvent).account;
127
+ props.onMicroDepositConnectionCreated && props.onMicroDepositConnectionCreated(counterparty);
128
+ break;
129
+ }
130
+ case PayeeManagementMessage.UNIT_MICRO_DEPOSIT_CONNECTION_REJECTED: {
131
+ const account: UNPayeeConnectedAccount = (message.details as PayeeConnectedAccountEvent).account;
132
+ props.onMicroDepositConnectionRejected && props.onMicroDepositConnectionRejected(account);
133
+ break;
134
+ }
135
+ }
136
+ };
137
+
138
+ return (
139
+ <WebComponent
140
+ ref={webRef}
141
+ type={WebComponentType.payeeManagement}
142
+ presentationMode={PresentationMode.Inherit}
143
+ params={getPayeeParams(props)}
144
+ script={getPayeeManagementScript()}
145
+ theme={props.theme}
146
+ nestedScrollEnabled={true}
147
+ language={props.language}
148
+ onMessage={message => handleMessage(message)}
149
+ />
150
+ );
151
+ };
152
+
153
+ export default withReduxStore<UNPayeeManagementComponentProps>(UNPayeeManagementComponent);
@@ -0,0 +1,87 @@
1
+ import { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';
2
+ import type WebView from 'react-native-webview';
3
+ import type { UNAccountMenuAction } from '../../types/shared';
4
+ import { WebComponentType } from '../../types/internal/webComponent.types';
5
+ import { UNPayeeManagementComponentProps } from './UNPayeeManagementComponent';
6
+ import { DISPATCH_OPEN_PLAID, DISPATCH_PLAID_EXIT, DISPATCH_PLAID_RESPONSE, DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
7
+ import { LinkError, LinkSuccess } from 'react-native-plaid-link-sdk';
8
+ import { OpenPlaidEvent } from '../../messages/webMessages/plaidMessages';
9
+
10
+ export const getPayeeParams = (props: UNPayeeManagementComponentProps) => {
11
+ const menuItemsParam = props.menuItems ? `menu-items="${props.menuItems.join()}"` : '';
12
+ const queryFilterParam = props.queryFilter ? `query-filter="${props.queryFilter}"` : '';
13
+ const paginationTypeParam = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
14
+
15
+ const plaidAccountFiltersParam = props.plaidAccountFilters ? `plaid-account-filters="${props.plaidAccountFilters.join()}"` : '';
16
+ const plaidLinkCustomizationNameParam = props.plaidLinkCustomizationName ? `plaid-link-customization-name="${props.plaidLinkCustomizationName}"` : '';
17
+
18
+ const counterPartiesPerPageParam = props.counterPartiesPerPage ? `counterparties-per-page="${props.counterPartiesPerPage}"` : '';
19
+
20
+ const menuPlaceholderParam = props.menuPlaceholder ? `menu-placeholder="${props.menuPlaceholder}"` : '';
21
+ const flowPlaceholderParam = props.flowPlaceholder ? `flow-placeholder="${props.flowPlaceholder}"` : '';
22
+ const payeeCreationPlaceholderParam = props.payeeCreationPlaceholder ? `payee-creation-placeholder="${props.payeeCreationPlaceholder}"` : '';
23
+ const microDepositConnectionPlaceholderParam = props.microDepositConnectionPlaceholder ? `micro-deposit-connection-placeholder="${props.microDepositConnectionPlaceholder}"` : '';
24
+ return `
25
+ customer-token="${props.customerToken}"
26
+ ${menuItemsParam}
27
+ ${queryFilterParam}
28
+ ${paginationTypeParam}
29
+ ${counterPartiesPerPageParam}
30
+ hide-title="${props.hideTitle || false}"
31
+ hide-counterparty-actions-button="${props.hideCounterpartyActionsButton || false}"
32
+ ${menuPlaceholderParam}
33
+ ${flowPlaceholderParam}
34
+ ${payeeCreationPlaceholderParam}
35
+ ${microDepositConnectionPlaceholderParam}
36
+ ${plaidAccountFiltersParam}
37
+ ${plaidLinkCustomizationNameParam}
38
+ style="height: 100%"
39
+ `;
40
+ };
41
+
42
+ export const getPayeeManagementScript = () => {
43
+ return `
44
+ ${LISTENERS.unitCounterpartyCreated}
45
+ ${LISTENERS.unitConnectedAccountCreated}
46
+ ${LISTENERS.unitMicroDepositConnectionCreated}
47
+ ${LISTENERS.unitMicroDepositConnectionRejected}
48
+ ${LISTENERS.requestRefresh}
49
+ ${DISPATCH_PLAID_RESPONSE}
50
+ ${DISPATCH_PLAID_EXIT}
51
+ ${DISPATCH_OPEN_PLAID}
52
+ ${DISPATCH_REQUEST_REFRESH}
53
+ `;
54
+ };
55
+
56
+ export const injectOpenActionsMenuScript = (currentWeb: WebView | null) => {
57
+ currentWeb?.injectJavaScript(`dispatchOpenActionsMenu('${WebComponentType.account}')`);
58
+ };
59
+
60
+ export const injectRequestAccountActionScript = (currentWeb: WebView | null, action: UNAccountMenuAction) => {
61
+ currentWeb?.injectJavaScript(`dispatchRequestAccountAction('${action}')`);
62
+ };
63
+
64
+ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null) => {
65
+ if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.payeeManagement.valueOf())) {
66
+ currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
67
+ }
68
+ };
69
+
70
+ export const injectUnitOpenPlaid = (currentWeb: WebView | null, openPlaidData: OpenPlaidEvent) => {
71
+ currentWeb?.injectJavaScript(`dispatchOpenPlaidEvent(${JSON.stringify({ data: openPlaidData })})`);
72
+ };
73
+
74
+ export const injectUnitPlaidResponse = (currentWeb: WebView | null, success: LinkSuccess) => {
75
+ const successObj = { data: { publicToken: success.publicToken, metadata: JSON.parse(success.metadata.metadataJson ?? '{}') } };
76
+ currentWeb?.injectJavaScript(`dispatchPlaidEvent(${JSON.stringify(successObj)})`);
77
+ };
78
+
79
+ export const injectUnitPlaidExit = (currentWeb: WebView | null, plaidLinkError: LinkError | null | undefined) => {
80
+ // Android & iOS are not consist - we will extract the needed fields from the LinkError/errorJson
81
+ const errorJson = JSON.parse(plaidLinkError?.errorJson ?? '{}');
82
+ const type = plaidLinkError?.errorType ?? errorJson['error_type'] ?? '';
83
+ const code = plaidLinkError?.errorCode ?? errorJson['error_code'] ?? '';
84
+ const message = plaidLinkError?.errorMessage ?? errorJson['error_message'] ?? '';
85
+ const error = { error_type: type, error_code: code, error_message: message };
86
+ currentWeb?.injectJavaScript(`dispatchPlaidExit(${JSON.stringify(error)})`);
87
+ };
@@ -0,0 +1 @@
1
+ export { default as UNPayeeManagementComponent, UNPayeeManagementComponentProps } from './UNPayeeManagementComponent';
@@ -0,0 +1,124 @@
1
+ import React, { useRef } from 'react';
2
+ import { WebComponent } from '../../webComponent/WebComponent';
3
+ import { withReduxStore } from '../../helpers/store/helpers';
4
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
5
+ import { RequestRefreshEvent, RequestRenderingEvent, UnitMessage, UnitWhiteLabelAppEvent } from '../../messages/webMessages/unitMessages';
6
+ import type { WebViewMessage } from '../../messages/webMessages';
7
+ import {
8
+ BottomSheetRenderingType,
9
+ SlotRendering,
10
+ } from '../../types/internal/bottomSheet.types';
11
+ import type { BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
12
+ import { setEvent } from '../../slices/SharedEventsSlice';
13
+ import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
14
+ import { useDispatch } from 'react-redux';
15
+ import { useListenerToEvent } from '../../hooks/useListenerToEvent';
16
+ import WebView from 'react-native-webview';
17
+ import {
18
+ getWhiteLabelAppParams,
19
+ getWhiteLabelAppScript,
20
+ injectRefreshEventIfNeeded,
21
+ } from './UNWhiteLabelAppComponent.utils';
22
+ import { UserDataKeys } from '../../types/internal/unitStore.types';
23
+ import { PageMessage } from '../../messages/webMessages/pageMessage';
24
+ import UNStoreManagerHelper from '../../nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper';
25
+ import { ActivityMessage } from '../../messages/webMessages/activityMessage';
26
+ import { setItemInWindowUnitStore } from '../../utils/windowUnitStore';
27
+
28
+ export interface UNWhiteLabelAppComponentProps {
29
+ // inputs
30
+ customerToken?: string;
31
+ jwtToken?: string;
32
+
33
+ // ui
34
+ theme?: string;
35
+ language?: string;
36
+ }
37
+
38
+ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
39
+ const webRef = useRef<WebView>(null);
40
+
41
+ const dispatch = useDispatch();
42
+
43
+ const handleWebViewMessage = (message: WebViewMessage) => {
44
+ switch (message.type) {
45
+ case UnitMessage.UNIT_REQUEST_RENDERING: {
46
+
47
+ const slotData: BottomSheetSlotData = {
48
+ componentName: WebComponentType.whiteLabelApp,
49
+ requestRenderingEvent: message.details as RequestRenderingEvent,
50
+ };
51
+
52
+ const data = {
53
+ type: BottomSheetRenderingType.Slot,
54
+ data: slotData,
55
+ } as SlotRendering;
56
+
57
+ dispatch(setEvent({ key: BottomSheetNativeMessage.REQUEST_RENDERING, data }));
58
+ break;
59
+ }
60
+ case UnitMessage.UNIT_WHITE_LABEL_APP_ON_LOAD: {
61
+ const data = message.details as UnitWhiteLabelAppEvent;
62
+ if (data.attributes.customerToken) {
63
+ UNStoreManagerHelper.saveValue(UserDataKeys.unitCustomerToken, data.attributes.customerToken);
64
+ // Upon receiving a new token, the web interface updates the window. Therefore, we (only) store it for subsequent windows.
65
+ // updateWindowUnitStore();
66
+ }
67
+ break;
68
+ }
69
+
70
+ case PageMessage.PAGE_LOADED:
71
+ updateWindowUnitStore();
72
+ }
73
+ };
74
+
75
+ const updateWindowUnitStore = async () => {
76
+ /**
77
+ * The 2FA-token (verifiedToken) is managed for all the components in UNWebComponent.
78
+ */
79
+ try {
80
+ const token = await UNStoreManagerHelper.getValue(UserDataKeys.unitCustomerToken);
81
+ if (token) {
82
+ setItemInWindowUnitStore(webRef.current, UserDataKeys.unitCustomerToken, token + ' s');
83
+ }
84
+ } catch (e) {
85
+ console.log(e);
86
+ }
87
+ };
88
+
89
+ const requestRefresh = (data: RequestRefreshEvent) => {
90
+ injectRefreshEventIfNeeded(webRef.current, data);
91
+ };
92
+
93
+ const dispatchActivityFiltersChanged = (query: string) => {
94
+ webRef.current?.injectJavaScript(`dispatchActivityFilterChangedEvent('${query}')`);
95
+ };
96
+
97
+ useListenerToEvent({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
98
+ useListenerToEvent({
99
+ busEventKey: ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED,
100
+ action: dispatchActivityFiltersChanged,
101
+ });
102
+
103
+ const renderWebView = () => {
104
+ return (
105
+ <WebComponent
106
+ ref={webRef}
107
+ type={WebComponentType.whiteLabelApp}
108
+ presentationMode={PresentationMode.Inherit}
109
+ params={getWhiteLabelAppParams(props)}
110
+ onMessage={handleWebViewMessage}
111
+ isScrollable={true}
112
+ theme={props.theme}
113
+ language={props.language}
114
+ script={getWhiteLabelAppScript()}
115
+ />
116
+ );
117
+ };
118
+
119
+ return (
120
+ renderWebView()
121
+ );
122
+ };
123
+
124
+ export default withReduxStore<UNWhiteLabelAppComponentProps>(UNWhiteLabelAppComponent);
@@ -0,0 +1,35 @@
1
+ import WebView from 'react-native-webview';
2
+ import { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';
3
+ import { UNWhiteLabelAppComponentProps } from './UNWhiteLabelAppComponent';
4
+ import { DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
5
+
6
+ export const getWhiteLabelAppParams = (props: UNWhiteLabelAppComponentProps) => {
7
+ // customer token is the preferred way to authenticate
8
+ if (props.customerToken) {
9
+ return `
10
+ customer-token="${props.customerToken}"
11
+ `;
12
+ }
13
+
14
+ if (props.jwtToken) {
15
+ return `
16
+ jwt-token="${props.jwtToken}"
17
+ `;
18
+ }
19
+
20
+ return '';
21
+ };
22
+
23
+ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null) => {
24
+ if (requestRefreshEvent) {
25
+ currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
26
+ }
27
+ };
28
+
29
+ export const getWhiteLabelAppScript = () => {
30
+ return `
31
+ ${DISPATCH_REQUEST_REFRESH}
32
+
33
+ ${LISTENERS.unitWhiteLabelAppOnLoad}
34
+ `;
35
+ };
@@ -0,0 +1 @@
1
+ export { default as UNWhiteLabelAppComponent, UNWhiteLabelAppComponentProps } from './UNWhiteLabelAppComponent';
@@ -9,3 +9,5 @@ export * from './UNACHDebitComponent';
9
9
  export * from './UNACHCreditComponent';
10
10
  export * from './UNProgramDetailsComponent';
11
11
  export * from './UNNextRepaymentComponent';
12
+ export * from './UNWhiteLabelAppComponent';
13
+ export * from './UNPayeeManagementComponent';
package/src/index.tsx CHANGED
@@ -2,4 +2,4 @@ export * from './components';
2
2
 
3
3
  export * from './types/shared';
4
4
 
5
- export { UnitSDK, UNEnvironment } from './unitSdkManager/UnitSdkManager';
5
+ export { UnitSDK } from './unitSdkManager/UnitSdkManager';
@@ -9,6 +9,8 @@ import type { AccountEvent, AccountMessage } from './accountMessage';
9
9
  import type { CheckEvent, CheckMessage } from './checkMessage';
10
10
  import type { ActivityEvent, ActivityMessage } from './activityMessage';
11
11
  import type { MultipleCardsEvent, MultipleCardsMessage } from './multipleCardsMessage';
12
+ import { PlaidEvent, PlaidMessage } from './plaidMessages';
13
+ import { PayeeManagementMessage, PayeeManagementEvent } from './payeeManagementMessage';
12
14
 
13
15
  export type WebViewMessageType =
14
16
  | PageMessage
@@ -19,6 +21,8 @@ export type WebViewMessageType =
19
21
  | AccountMessage
20
22
  | CheckMessage
21
23
  | ActivityMessage
24
+ | PlaidMessage
25
+ | PayeeManagementMessage
22
26
 
23
27
  type WebViewEvent =
24
28
  | PageEvent
@@ -31,6 +35,8 @@ type WebViewEvent =
31
35
  | AccountEvent
32
36
  | CheckEvent
33
37
  | ActivityEvent
38
+ | PlaidEvent
39
+ | PayeeManagementEvent
34
40
 
35
41
  export interface WebViewMessage {
36
42
  type: WebViewMessageType,
@@ -0,0 +1,26 @@
1
+ import type { UNPayeeConnectedAccount, UNPayeeCounterparty } from '../../types/shared';
2
+
3
+ export enum PayeeManagementMessage {
4
+ UNIT_COUNTERPARTY_CREATED = 'unitCounterpartyCreated',
5
+ UNIT_COUNTERPARTY_DELETED = 'unitCounterpartyDeleted',
6
+ UNIT_CONNECTED_ACCOUNT_CREATED = 'unitConnectedAccountCreated',
7
+ UNIT_MICRO_DEPOSIT_CONNECTION_CREATED = 'unitMicroDepositConnectionCreated',
8
+ UNIT_MICRO_DEPOSIT_CONNECTION_REJECTED = 'unitMicroDepositConnectionRejected',
9
+ }
10
+
11
+ export interface PayeeConnectedAccountEvent {
12
+ account: UNPayeeConnectedAccount;
13
+ }
14
+
15
+ export interface PayeeCounterpartyEvent {
16
+ counterparty: UNPayeeCounterparty;
17
+ }
18
+
19
+ export interface PayeeMicroDepositeConnectionEvent {
20
+ account: UNPayeeCounterparty;
21
+ }
22
+
23
+ export type PayeeManagementEvent =
24
+ | PayeeConnectedAccountEvent
25
+ | PayeeCounterpartyEvent
26
+ | PayeeMicroDepositeConnectionEvent
@@ -0,0 +1,29 @@
1
+ export enum PlaidMessage {
2
+ UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',
3
+ UNIT_OPEN_PLAID = 'unitOpenPlaid',
4
+ UNIT_PLAID_RESPONSE = 'unitPlaidResponse',
5
+ UNIT_PLAID_EXIT = 'unitPlaidExit',
6
+ }
7
+
8
+ export interface PlaidTokenCreatedEvent {
9
+ linkToken: PlaidLinkTokenData;
10
+ }
11
+
12
+ export interface OpenPlaidEvent {
13
+ plaidLinkToken: PlaidLinkTokenData,
14
+ connectedAccountId?: string
15
+ }
16
+
17
+ export interface PlaidLinkTokenData {
18
+ type: string,
19
+ attributes: PlaidLinkTokenAttributes
20
+ }
21
+
22
+ interface PlaidLinkTokenAttributes {
23
+ linkToken: string,
24
+ expiration: string
25
+ }
26
+
27
+ export type PlaidEvent =
28
+ | PlaidTokenCreatedEvent
29
+ | OpenPlaidEvent
@@ -1,5 +1,6 @@
1
1
  import type { UnitOnLoadResponseEvent } from './onLoadMessage';
2
2
  import { BottomSheetNativePlaceType } from '../../types/internal/bottomSheet.types';
3
+ import { WebComponentType } from '../../types/internal/webComponent.types';
3
4
 
4
5
  export enum UnitMessage {
5
6
  UNIT_REQUEST_RENDERING = 'unitRequestRendering',
@@ -8,10 +9,11 @@ export enum UnitMessage {
8
9
  UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',
9
10
  UNIT_ON_LOAD = 'unitOnLoad',
10
11
  UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload',
11
- UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',
12
12
  UNIT_REQUEST_EXTERNAL_SDK = 'unitRequestExternalSdk',
13
13
  UNIT_REQUEST_LEFT_TO_SPEND_DETAILS = 'unitRequestLeftToSpendDetails',
14
- UNIT_PLAID_RESPONSE = 'unitPlaidResponse',
14
+ UNIT_MULTI_FACTOR_AUTH_FINISHED = 'unitMultiFactorAuthFinished',
15
+ UNIT_WHITE_LABEL_APP_ON_LOAD = 'unitWhiteLabelAppOnLoad',
16
+ UNIT_UNAUTHORIZED_TOKEN = 'unitUnauthorizedToken'
15
17
  }
16
18
 
17
19
  export enum UnitRequestRefreshEventTypes {
@@ -24,6 +26,7 @@ export interface RequestRenderingEvent {
24
26
 
25
27
  export interface RequestRenderingEventData {
26
28
  actionType?: string,
29
+ nativeComponentName?: WebComponentType,
27
30
  nativePlace: BottomSheetNativePlaceType,
28
31
  nativeComponent: string,
29
32
  }
@@ -62,6 +65,13 @@ interface PlaidLinkTokenAttributes {
62
65
  expiration: string
63
66
  }
64
67
 
68
+ export interface UnitWhiteLabelAppEvent {
69
+ type: 'customerToken';
70
+ attributes: {
71
+ customerToken: string;
72
+ };
73
+ }
74
+
65
75
  export interface RequestExternalSdkEvent {
66
76
  type: string;
67
77
  }
@@ -74,3 +84,4 @@ export type UnitEvent =
74
84
  | RequestDownloadEvent
75
85
  | PlaidTokenCreatedEvent
76
86
  | RequestExternalSdkEvent
87
+ | UnitWhiteLabelAppEvent
@@ -0,0 +1,19 @@
1
+ import { NativeModules } from 'react-native';
2
+
3
+ const { UNStoreManager } = NativeModules;
4
+
5
+ class UNStoreManagerHelper {
6
+ static saveValue(key: string, value: string) {
7
+ UNStoreManager.saveValue(key, value);
8
+ }
9
+
10
+ static async getValue(key: string): Promise<string> {
11
+ return UNStoreManager.getValue(key);
12
+ }
13
+
14
+ static cleanValue(key: string) {
15
+ UNStoreManager.cleanValue(key);
16
+ }
17
+ }
18
+
19
+ export default UNStoreManagerHelper;
@@ -1,4 +1,4 @@
1
- import { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
1
+ import { UNEnvironment } from '../../types/shared/env.types';
2
2
 
3
3
  export const APIHeaders = {
4
4
  AUTHORIZATION: 'Authorization',
@@ -1,9 +1,10 @@
1
1
  import axios from 'axios';
2
2
  import { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';
3
- import type { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
4
3
  import type { UNMobileWalletPayload } from '../../helpers/pushProvisioningService/types';
5
4
  import type { UNError, UNErrorData } from '../../types/shared/error.types';
5
+ import { UNEnvironment } from '../../types/shared/env.types';
6
6
 
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  const isUNMobileWalletPayload = (object: any): object is UNMobileWalletPayload => {
8
9
  return 'data' in object &&
9
10
  'attributes' in object.data &&
@@ -18,7 +18,7 @@ export const getHtmlBody = (unitComponent: string, unitComponentProps?: string,
18
18
  const getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {
19
19
  return `
20
20
  <div id=${webViewId}>
21
- <div style="height: 100%; display: block; padding: 1px;">
21
+ <div style="height: 100%; display: block;">
22
22
  ${currentUnitScript}
23
23
  </div>
24
24
  </div>