react-native-unit-components 1.0.4 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/README.md +108 -8
  2. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +6 -1
  3. package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +35 -0
  4. package/lib/commonjs/assets/images/index.js +0 -2
  5. package/lib/commonjs/assets/images/index.js.map +1 -1
  6. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +64 -0
  7. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -0
  8. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +31 -0
  9. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -0
  10. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +108 -0
  11. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -0
  12. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +58 -0
  13. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -0
  14. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +11 -29
  15. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  16. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +0 -11
  17. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  18. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +14 -22
  19. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  20. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +0 -8
  21. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  22. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -23
  23. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  24. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +3 -9
  25. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
  26. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
  27. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +8 -59
  28. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  29. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +0 -3
  30. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -1
  31. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +0 -10
  32. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  33. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +8 -29
  34. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  35. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js +0 -3
  36. package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js.map +1 -1
  37. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +13 -41
  38. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  39. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +3 -17
  40. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  41. package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js +0 -2
  42. package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +1 -1
  43. package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js +2 -9
  44. package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  45. package/lib/commonjs/components/index.js +22 -10
  46. package/lib/commonjs/components/index.js.map +1 -1
  47. package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +5 -47
  48. package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
  49. package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +0 -5
  50. package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
  51. package/lib/commonjs/helpers/EventBus.js +4 -17
  52. package/lib/commonjs/helpers/EventBus.js.map +1 -1
  53. package/lib/commonjs/hooks/listenerToBus.js +14 -14
  54. package/lib/commonjs/hooks/listenerToBus.js.map +1 -1
  55. package/lib/commonjs/hooks/useAppStateListener.js +1 -6
  56. package/lib/commonjs/hooks/useAppStateListener.js.map +1 -1
  57. package/lib/commonjs/index.js +0 -5
  58. package/lib/commonjs/index.js.map +1 -1
  59. package/lib/commonjs/messages/nativeMessages/cardMessage.js +1 -18
  60. package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
  61. package/lib/commonjs/messages/nativeMessages/sdkMessage.js +0 -1
  62. package/lib/commonjs/messages/nativeMessages/sdkMessage.js.map +1 -1
  63. package/lib/commonjs/messages/webMessages/accountMessage.js +12 -0
  64. package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -0
  65. package/lib/commonjs/messages/webMessages/achCreditMessage.js +6 -0
  66. package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -0
  67. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js +0 -7
  68. package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
  69. package/lib/commonjs/messages/webMessages/cardMessage.js +0 -1
  70. package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
  71. package/lib/commonjs/messages/webMessages/index.js.map +1 -1
  72. package/lib/commonjs/messages/webMessages/pageMessage.js +0 -1
  73. package/lib/commonjs/messages/webMessages/pageMessage.js.map +1 -1
  74. package/lib/commonjs/messages/webMessages/paymentsMessage.js +12 -0
  75. package/lib/commonjs/messages/webMessages/paymentsMessage.js.map +1 -0
  76. package/lib/commonjs/messages/webMessages/unitMessages.js +3 -1
  77. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
  78. package/lib/commonjs/nativeComponent/UnitAddToWalletButton.js +0 -2
  79. package/lib/commonjs/nativeComponent/UnitAddToWalletButton.js.map +1 -1
  80. package/lib/commonjs/scripts/html/bodyHtml.js +0 -8
  81. package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
  82. package/lib/commonjs/scripts/html/bodyScript.js +35 -6
  83. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  84. package/lib/commonjs/sharedTypes/account.types.js +31 -0
  85. package/lib/commonjs/sharedTypes/account.types.js.map +1 -0
  86. package/lib/commonjs/sharedTypes/achCredit.types.js +6 -0
  87. package/lib/commonjs/sharedTypes/achCredit.types.js.map +1 -0
  88. package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -1
  89. package/lib/commonjs/sharedTypes/card.types.js.map +1 -1
  90. package/lib/commonjs/sharedTypes/index.js +33 -6
  91. package/lib/commonjs/sharedTypes/index.js.map +1 -1
  92. package/lib/commonjs/sharedTypes/onLoadResponse.types.js.map +1 -1
  93. package/lib/commonjs/sharedTypes/payments.types.js +12 -0
  94. package/lib/commonjs/sharedTypes/payments.types.js.map +1 -0
  95. package/lib/commonjs/sharedTypes/types.js.map +1 -1
  96. package/lib/commonjs/sharedTypes/wallet.types.js +13 -4
  97. package/lib/commonjs/sharedTypes/wallet.types.js.map +1 -1
  98. package/lib/commonjs/styles/variables.js.map +1 -1
  99. package/lib/commonjs/unitSdkManager/UnitSdk.api.js +1 -15
  100. package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
  101. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +3 -20
  102. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  103. package/lib/commonjs/webComponent/WebComponent.js +7 -36
  104. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  105. package/lib/commonjs/webComponent/WebComponent.utils.js +0 -7
  106. package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
  107. package/lib/commonjs/webComponent/html.js +9 -8
  108. package/lib/commonjs/webComponent/html.js.map +1 -1
  109. package/lib/module/assets/images/index.js.map +1 -1
  110. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +55 -0
  111. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -0
  112. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +23 -0
  113. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -0
  114. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +99 -0
  115. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -0
  116. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +48 -0
  117. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -0
  118. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +11 -11
  119. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  120. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  121. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +13 -9
  122. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  123. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  124. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -11
  125. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  126. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +3 -3
  127. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
  128. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
  129. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +8 -35
  130. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  131. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -1
  132. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
  133. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +9 -13
  134. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
  135. package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js.map +1 -1
  136. package/lib/module/components/UNCardComponent/UNCardComponent.js +13 -20
  137. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  138. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +3 -1
  139. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  140. package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +1 -1
  141. package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js +1 -2
  142. package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +1 -1
  143. package/lib/module/components/index.js +2 -0
  144. package/lib/module/components/index.js.map +1 -1
  145. package/lib/module/helpers/BottomSheet/BottomSheet.js +5 -31
  146. package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
  147. package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +2 -1
  148. package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
  149. package/lib/module/helpers/EventBus.js +4 -15
  150. package/lib/module/helpers/EventBus.js.map +1 -1
  151. package/lib/module/hooks/listenerToBus.js +14 -10
  152. package/lib/module/hooks/listenerToBus.js.map +1 -1
  153. package/lib/module/hooks/useAppStateListener.js +0 -2
  154. package/lib/module/hooks/useAppStateListener.js.map +1 -1
  155. package/lib/module/index.js.map +1 -1
  156. package/lib/module/messages/nativeMessages/cardMessage.js +0 -16
  157. package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
  158. package/lib/module/messages/nativeMessages/sdkMessage.js +0 -1
  159. package/lib/module/messages/nativeMessages/sdkMessage.js.map +1 -1
  160. package/lib/module/messages/webMessages/accountMessage.js +5 -0
  161. package/lib/module/messages/webMessages/accountMessage.js.map +1 -0
  162. package/lib/module/messages/webMessages/achCreditMessage.js +2 -0
  163. package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -0
  164. package/lib/module/messages/webMessages/bookPaymentMessage.js +1 -5
  165. package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
  166. package/lib/module/messages/webMessages/cardMessage.js +0 -1
  167. package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
  168. package/lib/module/messages/webMessages/index.js.map +1 -1
  169. package/lib/module/messages/webMessages/pageMessage.js +0 -1
  170. package/lib/module/messages/webMessages/pageMessage.js.map +1 -1
  171. package/lib/module/messages/webMessages/paymentsMessage.js +5 -0
  172. package/lib/module/messages/webMessages/paymentsMessage.js.map +1 -0
  173. package/lib/module/messages/webMessages/unitMessages.js +3 -1
  174. package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
  175. package/lib/module/nativeComponent/UnitAddToWalletButton.js.map +1 -1
  176. package/lib/module/scripts/html/bodyHtml.js +0 -7
  177. package/lib/module/scripts/html/bodyHtml.js.map +1 -1
  178. package/lib/module/scripts/html/bodyScript.js +33 -1
  179. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  180. package/lib/module/sharedTypes/account.types.js +23 -0
  181. package/lib/module/sharedTypes/account.types.js.map +1 -0
  182. package/lib/module/sharedTypes/achCredit.types.js +2 -0
  183. package/lib/module/sharedTypes/achCredit.types.js.map +1 -0
  184. package/lib/module/sharedTypes/bookPayment.types.js.map +1 -1
  185. package/lib/module/sharedTypes/card.types.js.map +1 -1
  186. package/lib/module/sharedTypes/index.js +3 -0
  187. package/lib/module/sharedTypes/index.js.map +1 -1
  188. package/lib/module/sharedTypes/onLoadResponse.types.js.map +1 -1
  189. package/lib/module/sharedTypes/payments.types.js +5 -0
  190. package/lib/module/sharedTypes/payments.types.js.map +1 -0
  191. package/lib/module/sharedTypes/types.js.map +1 -1
  192. package/lib/module/sharedTypes/wallet.types.js +11 -3
  193. package/lib/module/sharedTypes/wallet.types.js.map +1 -1
  194. package/lib/module/styles/variables.js.map +1 -1
  195. package/lib/module/unitSdkManager/UnitSdk.api.js +1 -6
  196. package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
  197. package/lib/module/unitSdkManager/UnitSdkManager.js +3 -12
  198. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  199. package/lib/module/webComponent/WebComponent.js +7 -18
  200. package/lib/module/webComponent/WebComponent.js.map +1 -1
  201. package/lib/module/webComponent/WebComponent.utils.js +0 -1
  202. package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
  203. package/lib/module/webComponent/html.js +9 -5
  204. package/lib/module/webComponent/html.js.map +1 -1
  205. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +11 -0
  206. package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +3 -0
  207. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +11 -0
  208. package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +7 -0
  209. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +4 -2
  210. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -2
  211. package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -2
  212. package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +1 -1
  213. package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +5 -2
  214. package/lib/typescript/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.d.ts +1 -1
  215. package/lib/typescript/components/index.d.ts +2 -0
  216. package/lib/typescript/helpers/EventBus.d.ts +1 -1
  217. package/lib/typescript/hooks/listenerToBus.d.ts +2 -2
  218. package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +4 -13
  219. package/lib/typescript/messages/nativeMessages/index.d.ts +2 -2
  220. package/lib/typescript/messages/nativeMessages/sdkMessage.d.ts +1 -1
  221. package/lib/typescript/messages/webMessages/accountMessage.d.ts +8 -0
  222. package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +5 -0
  223. package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -4
  224. package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
  225. package/lib/typescript/messages/webMessages/index.d.ts +6 -3
  226. package/lib/typescript/messages/webMessages/pageMessage.d.ts +1 -1
  227. package/lib/typescript/messages/webMessages/paymentsMessage.d.ts +3 -0
  228. package/lib/typescript/messages/webMessages/unitMessages.d.ts +21 -3
  229. package/lib/typescript/nativeComponent/UnitAddToWalletButton.d.ts +1 -1
  230. package/lib/typescript/scripts/html/bodyScript.d.ts +4 -0
  231. package/lib/typescript/sharedTypes/account.types.d.ts +114 -0
  232. package/lib/typescript/sharedTypes/achCredit.types.d.ts +31 -0
  233. package/lib/typescript/sharedTypes/bookPayment.types.d.ts +12 -13
  234. package/lib/typescript/sharedTypes/card.types.d.ts +18 -18
  235. package/lib/typescript/sharedTypes/index.d.ts +3 -0
  236. package/lib/typescript/sharedTypes/onLoadResponse.types.d.ts +3 -3
  237. package/lib/typescript/sharedTypes/payments.types.d.ts +12 -0
  238. package/lib/typescript/sharedTypes/types.d.ts +7 -7
  239. package/lib/typescript/sharedTypes/wallet.types.d.ts +11 -2
  240. package/lib/typescript/webComponent/WebComponent.d.ts +3 -1
  241. package/package.json +4 -2
  242. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +73 -0
  243. package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +26 -0
  244. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +117 -0
  245. package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +48 -0
  246. package/src/components/UNAccountComponent/UNAccountComponent.tsx +13 -7
  247. package/src/components/UNActivityComponent/UNActivityComponent.tsx +16 -7
  248. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +6 -5
  249. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +3 -3
  250. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +13 -5
  251. package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +9 -10
  252. package/src/components/UNCardComponent/UNCardComponent.tsx +18 -11
  253. package/src/components/UNCardComponent/UNCardComponent.utils.ts +3 -0
  254. package/src/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.ts +1 -1
  255. package/src/components/index.ts +2 -0
  256. package/src/helpers/BottomSheet/BottomSheet.tsx +3 -7
  257. package/src/hooks/listenerToBus.ts +15 -10
  258. package/src/messages/nativeMessages/cardMessage.ts +5 -15
  259. package/src/messages/webMessages/accountMessage.ts +12 -0
  260. package/src/messages/webMessages/achCreditMessage.ts +8 -0
  261. package/src/messages/webMessages/bookPaymentMessage.ts +0 -4
  262. package/src/messages/webMessages/index.ts +10 -2
  263. package/src/messages/webMessages/paymentsMessage.ts +3 -0
  264. package/src/messages/webMessages/unitMessages.ts +27 -3
  265. package/src/scripts/html/bodyScript.ts +36 -2
  266. package/src/sharedTypes/account.types.ts +117 -0
  267. package/src/sharedTypes/achCredit.types.ts +32 -0
  268. package/src/sharedTypes/bookPayment.types.ts +11 -12
  269. package/src/sharedTypes/card.types.ts +18 -18
  270. package/src/sharedTypes/index.ts +3 -0
  271. package/src/sharedTypes/onLoadResponse.types.ts +5 -5
  272. package/src/sharedTypes/payments.types.ts +14 -0
  273. package/src/sharedTypes/types.ts +8 -8
  274. package/src/sharedTypes/wallet.types.ts +13 -3
  275. package/src/webComponent/WebComponent.tsx +5 -5
  276. package/src/webComponent/html.ts +9 -5
  277. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  278. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  279. package/ios/UnitReactNativeComponents.xcodeproj/project.xcworkspace/xcuserdata/alonshprung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  280. package/ios/UnitReactNativeComponents.xcodeproj/xcuserdata/alonshprung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
@@ -0,0 +1,5 @@
1
+ export let AccountMessage;
2
+ (function (AccountMessage) {
3
+ AccountMessage["UNIT_ACCOUNT_CHANGED"] = "unitAccountChanged";
4
+ })(AccountMessage || (AccountMessage = {}));
5
+ //# sourceMappingURL=accountMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AccountMessage"],"sources":["accountMessage.ts"],"sourcesContent":["import type { UNAccountData } from '../../sharedTypes';\n\nexport enum AccountMessage {\n UNIT_ACCOUNT_CHANGED = 'unitAccountChanged'\n}\n\nexport interface AccountChangedEvent {\n account: UNAccountData;\n}\n\nexport type AccountEvent =\n | AccountChangedEvent\n"],"mappings":"AAEA,WAAYA,cAAc;AAEzB,WAFWA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=achCreditMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["achCreditMessage.ts"],"sourcesContent":["import type { UNACHData } from '../../sharedTypes';\n\nexport interface PaymentCreatedEvent {\n data: UNACHData\n}\n\nexport type ACHEvent =\n| PaymentCreatedEvent\n"],"mappings":""}
@@ -1,6 +1,2 @@
1
- export let BookPaymentMessage;
2
-
3
- (function (BookPaymentMessage) {
4
- BookPaymentMessage["PAYMENT_CREATED"] = "unitPaymentCreated";
5
- })(BookPaymentMessage || (BookPaymentMessage = {}));
1
+ export {};
6
2
  //# sourceMappingURL=bookPaymentMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BookPaymentMessage"],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../sharedTypes';\n\nexport enum BookPaymentMessage {\n PAYMENT_CREATED = 'unitPaymentCreated'\n}\n\nexport interface PaymentCreatedEvent {\n data: UNBookPaymentData\n}\n\nexport type BookPaymentEvent =\n| PaymentCreatedEvent\n"],"mappings":"AAEA,WAAYA,kBAAZ;;WAAYA,kB;EAAAA,kB;GAAAA,kB,KAAAA,kB"}
1
+ {"version":3,"names":[],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../sharedTypes';\n\nexport interface PaymentCreatedEvent {\n data: UNBookPaymentData\n}\n\nexport type BookPaymentEvent =\n| PaymentCreatedEvent\n"],"mappings":""}
@@ -1,5 +1,4 @@
1
1
  export let CardMessage;
2
-
3
2
  (function (CardMessage) {
4
3
  CardMessage["CARD_STATUS_CHANGED"] = "unitCardStatusChanged";
5
4
  })(CardMessage || (CardMessage = {}));
@@ -1 +1 @@
1
- {"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../sharedTypes';\n\nexport enum CardMessage {\n CARD_STATUS_CHANGED = 'unitCardStatusChanged'\n}\n\nexport interface CardStatusChangedEvent {\n card: UNCardData;\n}\n\nexport type CardEvent =\n | CardStatusChangedEvent\n"],"mappings":"AAEA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
1
+ {"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../sharedTypes';\n\nexport enum CardMessage {\n CARD_STATUS_CHANGED = 'unitCardStatusChanged'\n}\n\nexport interface CardStatusChangedEvent {\n card: UNCardData;\n}\n\nexport type CardEvent =\n | CardStatusChangedEvent\n"],"mappings":"AAEA,WAAYA,WAAW;AAEtB,WAFWA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { BookPaymentEvent, BookPaymentMessage } from './bookPaymentMessage';\nimport type { CardEvent, CardMessage } from './cardMessage';\nimport type { PageEvent, PageMessage } from './pageMessage';\nimport type { UnitEvent, UnitMessage } from './unitMessages';\n\nexport type WebViewMessageType =\n | PageMessage\n | CardMessage\n | UnitMessage\n | BookPaymentMessage\n\ntype WebViewEvent =\n | PageEvent\n | UnitEvent\n | CardEvent\n | BookPaymentEvent\n\nexport interface WebViewMessage {\n type: WebViewMessageType,\n details?: WebViewEvent\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { ACHEvent } from './achCreditMessage';\nimport type { BookPaymentEvent } from './bookPaymentMessage';\n\nimport type { CardEvent, CardMessage } from './cardMessage';\nimport type { PageEvent, PageMessage } from './pageMessage';\nimport type { PaymentMessage } from './paymentsMessage';\nimport type { UnitEvent, UnitMessage } from './unitMessages';\nimport type { AccountEvent, AccountMessage } from './accountMessage';\n\nexport type WebViewMessageType =\n | PageMessage\n | CardMessage\n | UnitMessage\n | PaymentMessage\n | AccountMessage\n\ntype WebViewEvent =\n | PageEvent\n | UnitEvent\n | CardEvent\n | BookPaymentEvent\n | PaymentMessage\n | ACHEvent\n | AccountEvent\n\nexport interface WebViewMessage {\n type: WebViewMessageType,\n details?: WebViewEvent\n}\n"],"mappings":""}
@@ -1,5 +1,4 @@
1
1
  export let PageMessage;
2
-
3
2
  (function (PageMessage) {
4
3
  PageMessage["PAGE_LOADED"] = "pageLoaded";
5
4
  PageMessage["PAGE_HEIGHT"] = "pageHeight";
@@ -1 +1 @@
1
- {"version":3,"names":["PageMessage"],"sources":["pageMessage.ts"],"sourcesContent":["export enum PageMessage {\n PAGE_LOADED = 'pageLoaded',\n PAGE_HEIGHT = 'pageHeight',\n}\n\nexport interface HeightEvent {\n height: number;\n}\n\nexport type PageEvent =\n | HeightEvent\n"],"mappings":"AAAA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
1
+ {"version":3,"names":["PageMessage"],"sources":["pageMessage.ts"],"sourcesContent":["export enum PageMessage {\n PAGE_LOADED = 'pageLoaded',\n PAGE_HEIGHT = 'pageHeight',\n}\n\nexport interface HeightEvent {\n height: number;\n}\n\nexport type PageEvent =\n | HeightEvent\n"],"mappings":"AAAA,WAAYA,WAAW;AAGtB,WAHWA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
@@ -0,0 +1,5 @@
1
+ export let PaymentMessage;
2
+ (function (PaymentMessage) {
3
+ PaymentMessage["PAYMENT_CREATED"] = "unitPaymentCreated";
4
+ })(PaymentMessage || (PaymentMessage = {}));
5
+ //# sourceMappingURL=paymentsMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PaymentMessage"],"sources":["paymentsMessage.ts"],"sourcesContent":["export enum PaymentMessage {\n PAYMENT_CREATED = 'unitPaymentCreated'\n}\n"],"mappings":"AAAA,WAAYA,cAAc;AAEzB,WAFWA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc"}
@@ -1,5 +1,4 @@
1
1
  export let UnitMessage;
2
-
3
2
  (function (UnitMessage) {
4
3
  UnitMessage["UNIT_REQUEST_RENDERING"] = "unitRequestRendering";
5
4
  UnitMessage["UNIT_REQUEST_REFRESH"] = "unitRequestRefresh";
@@ -7,5 +6,8 @@ export let UnitMessage;
7
6
  UnitMessage["UNIT_REQUEST_OPEN_LINK"] = "unitRequestOpenLink";
8
7
  UnitMessage["UNIT_ON_LOAD"] = "unitOnLoad";
9
8
  UnitMessage["UNIT_REQUEST_DOWNLOAD"] = "unitRequestDownload";
9
+ UnitMessage["UNIT_PLAID_TOKEN_CREATED"] = "unitPlaidLinkTokenCreated";
10
+ UnitMessage["UNIT_REQUEST_EXTERNAL_SDK"] = "unitRequestExternalSdk";
11
+ UnitMessage["UNIT_PLAID_RESPONSE"] = "unitPlaidResponse";
10
12
  })(UnitMessage || (UnitMessage = {}));
11
13
  //# sourceMappingURL=unitMessages.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { ResponseUnitOnLoadEvent } from '../../sharedTypes';\n\nexport enum UnitMessage {\n UNIT_REQUEST_RENDERING = 'unitRequestRendering',\n UNIT_REQUEST_REFRESH = 'unitRequestRefresh',\n UNIT_REQUEST_CLOSE_FLOW = 'unitRequestCloseFlow',\n UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',\n UNIT_ON_LOAD = 'unitOnLoad',\n UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload'\n}\nexport interface RequestRenderingEvent {\n data: RequestRenderingEventData\n}\n\nexport interface RequestRenderingEventData {\n actionType?: string,\n nativePlace: string,\n nativeComponent: string,\n}\n\nexport interface RequestRefreshEvent {\n refEvent: string;\n dependencies: string[];\n resourceId: string;\n}\n\nexport interface RequestOpenLinkEvent {\n href: string;\n target: string\n}\n\nexport interface RequestDownloadEvent {\n url: string\n accessToken: string\n fileType: string\n responseType: string\n fileName: string\n}\n\nexport type UnitEvent =\n | RequestRenderingEvent\n | RequestRefreshEvent\n | RequestOpenLinkEvent\n | ResponseUnitOnLoadEvent\n | RequestDownloadEvent\n"],"mappings":"AAEA,WAAYA,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W"}
1
+ {"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { UNResponseUnitOnLoadEvent } from '../../sharedTypes';\n\nexport enum UnitMessage {\n UNIT_REQUEST_RENDERING = 'unitRequestRendering',\n UNIT_REQUEST_REFRESH = 'unitRequestRefresh',\n UNIT_REQUEST_CLOSE_FLOW = 'unitRequestCloseFlow',\n UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',\n UNIT_ON_LOAD = 'unitOnLoad',\n UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload',\n UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',\n UNIT_REQUEST_EXTERNAL_SDK = 'unitRequestExternalSdk',\n UNIT_PLAID_RESPONSE = 'unitPlaidResponse'\n\n}\nexport interface RequestRenderingEvent {\n data: RequestRenderingEventData\n}\n\nexport interface RequestRenderingEventData {\n actionType?: string,\n nativePlace: string,\n nativeComponent: string,\n}\n\nexport interface RequestRefreshEvent {\n refEvent: string;\n dependencies: string[];\n resourceId: string;\n}\n\nexport interface RequestOpenLinkEvent {\n href: string;\n target: string\n}\n\nexport interface RequestDownloadEvent {\n url: string\n accessToken: string\n fileType: string\n responseType: string\n fileName: string\n}\n\nexport interface PlaidTokenCreatedEvent {\n linkToken: PlaidLinkTokenData\n}\n\nexport interface PlaidLinkTokenData {\n type: string,\n attributes: PlaidLinkTokenAttributes\n}\n\ninterface PlaidLinkTokenAttributes {\n linkToken: string,\n expiration: string\n}\n\nexport interface RequestExternalSdkEvent {\n type: string\n}\n\nexport type UnitEvent =\n | RequestRenderingEvent\n | RequestRefreshEvent\n | RequestOpenLinkEvent\n | UNResponseUnitOnLoadEvent\n | RequestDownloadEvent\n | PlaidTokenCreatedEvent\n | RequestExternalSdkEvent\n"],"mappings":"AAEA,WAAYA,WAAW;AAWtB,WAXWA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"names":["requireNativeComponent","UnitAddToWalletButtonView"],"sources":["UnitAddToWalletButton.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n} from 'react-native';\n\ntype UnitAddToWalletButtonViewProps = {\n style: object;\n onAddToWalletClicked: () => void;\n};\n\nconst UnitAddToWalletButtonView = requireNativeComponent<UnitAddToWalletButtonViewProps>('UnitAddToWalletButtonView');\n\nexport default UnitAddToWalletButtonView;\n"],"mappings":"AAAA,SACEA,sBADF,QAEO,cAFP;AASA,MAAMC,yBAAyB,GAAGD,sBAAsB,CAAiC,2BAAjC,CAAxD;AAEA,eAAeC,yBAAf"}
1
+ {"version":3,"names":["requireNativeComponent","UnitAddToWalletButtonView"],"sources":["UnitAddToWalletButton.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n} from 'react-native';\n\ntype UnitAddToWalletButtonViewProps = {\n style: object;\n onAddToWalletClicked: () => void;\n};\n\nconst UnitAddToWalletButtonView = requireNativeComponent<UnitAddToWalletButtonViewProps>('UnitAddToWalletButtonView');\n\nexport default UnitAddToWalletButtonView;\n"],"mappings":"AAAA,SACEA,sBAAsB,QACjB,cAAc;AAOrB,MAAMC,yBAAyB,GAAGD,sBAAsB,CAAiC,2BAA2B,CAAC;AAErH,eAAeC,yBAAyB"}
@@ -1,27 +1,21 @@
1
1
  export const webViewId = 'webViewContainer';
2
2
  export let PresentationMode;
3
-
4
3
  (function (PresentationMode) {
5
4
  PresentationMode["CoverInjectedHeight"] = "coverInjectedHeight";
6
5
  PresentationMode["Inherit"] = "inherit";
7
6
  PresentationMode["Default"] = "deafult";
8
7
  })(PresentationMode || (PresentationMode = {}));
9
-
10
8
  export const getHtmlBody = (unitComponent, unitComponentProps, presentationMode) => {
11
9
  const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
12
-
13
10
  switch (presentationMode) {
14
11
  case PresentationMode.CoverInjectedHeight:
15
12
  return getCoverInjectedHeightBodyScript(currentComponent);
16
-
17
13
  case PresentationMode.Inherit:
18
14
  return getInheritParentSizeScript(currentComponent);
19
-
20
15
  default:
21
16
  return currentComponent;
22
17
  }
23
18
  };
24
-
25
19
  const getCoverInjectedHeightBodyScript = currentUnitScript => {
26
20
  return `
27
21
  <div id=${webViewId}>
@@ -31,7 +25,6 @@ const getCoverInjectedHeightBodyScript = currentUnitScript => {
31
25
  </div>
32
26
  `;
33
27
  };
34
-
35
28
  const getInheritParentSizeScript = currentUnitScript => {
36
29
  return `
37
30
  <div style="height: 100vh">
@@ -1 +1 @@
1
- {"version":3,"names":["webViewId","PresentationMode","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["export const webViewId = 'webViewContainer';\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n\nexport const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {\n const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;\n\n switch (presentationMode) {\n case PresentationMode.CoverInjectedHeight:\n return getCoverInjectedHeightBodyScript(currentComponent);\n case PresentationMode.Inherit:\n return getInheritParentSizeScript(currentComponent);\n default:\n return currentComponent;\n }\n};\n\nconst getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {\n return `\n <div id=${webViewId}>\n <div style=\"height: 100%; display: block; padding: 1px;\">\n ${currentUnitScript}\n </div>\n </div>\n `;\n};\n\nconst getInheritParentSizeScript = (currentUnitScript: string) => {\n return `\n <div style=\"height: 100vh\">\n ${currentUnitScript}\n </div>\n `;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG,kBAAlB;AAEP,WAAYC,gBAAZ;;WAAYA,gB;EAAAA,gB;EAAAA,gB;EAAAA,gB;GAAAA,gB,KAAAA,gB;;AAcZ,OAAO,MAAMC,WAAW,GAAG,CAACC,aAAD,EAAwBC,kBAAxB,EAAqDC,gBAArD,KAA6F;EACtH,MAAMC,gBAAgB,GAAI,IAAGH,aAAc,IAAGC,kBAAkB,IAAI,EAAG,SAAQD,aAAc,GAA7F;;EAEA,QAAQE,gBAAR;IACE,KAAKJ,gBAAgB,CAACM,mBAAtB;MACE,OAAOC,gCAAgC,CAACF,gBAAD,CAAvC;;IACF,KAAKL,gBAAgB,CAACQ,OAAtB;MACE,OAAOC,0BAA0B,CAACJ,gBAAD,CAAjC;;IACF;MACE,OAAOA,gBAAP;EANJ;AAQD,CAXM;;AAaP,MAAME,gCAAgC,GAAIG,iBAAD,IAA+B;EACtE,OAAQ;AACV,cAAcX,SAAU;AACxB;AACA,UAAUW,iBAAkB;AAC5B;AACA;AACA,GANE;AAOD,CARD;;AAUA,MAAMD,0BAA0B,GAAIC,iBAAD,IAA+B;EAChE,OAAQ;AACV;AACA,QAAQA,iBAAkB;AAC1B;AACA,GAJE;AAKD,CAND"}
1
+ {"version":3,"names":["webViewId","PresentationMode","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["export const webViewId = 'webViewContainer';\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n\nexport const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {\n const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;\n\n switch (presentationMode) {\n case PresentationMode.CoverInjectedHeight:\n return getCoverInjectedHeightBodyScript(currentComponent);\n case PresentationMode.Inherit:\n return getInheritParentSizeScript(currentComponent);\n default:\n return currentComponent;\n }\n};\n\nconst getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {\n return `\n <div id=${webViewId}>\n <div style=\"height: 100%; display: block; padding: 1px;\">\n ${currentUnitScript}\n </div>\n </div>\n `;\n};\n\nconst getInheritParentSizeScript = (currentUnitScript: string) => {\n return `\n <div style=\"height: 100vh\">\n ${currentUnitScript}\n </div>\n `;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG,kBAAkB;AAE3C,WAAYC,gBAAgB;AAY3B,WAZWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAc5B,OAAO,MAAMC,WAAW,GAAGA,CAACC,aAAqB,EAAEC,kBAA2B,EAAEC,gBAAmC,KAAK;EACtH,MAAMC,gBAAgB,GAAI,IAAGH,aAAc,IAAGC,kBAAkB,IAAI,EAAG,SAAQD,aAAc,GAAE;EAE/F,QAAQE,gBAAgB;IACtB,KAAKJ,gBAAgB,CAACM,mBAAmB;MACvC,OAAOC,gCAAgC,CAACF,gBAAgB,CAAC;IAC3D,KAAKL,gBAAgB,CAACQ,OAAO;MAC3B,OAAOC,0BAA0B,CAACJ,gBAAgB,CAAC;IACrD;MACE,OAAOA,gBAAgB;EAAC;AAE9B,CAAC;AAED,MAAME,gCAAgC,GAAIG,iBAAyB,IAAK;EACtE,OAAQ;AACV,cAAcX,SAAU;AACxB;AACA,UAAUW,iBAAkB;AAC5B;AACA;AACA,GAAG;AACH,CAAC;AAED,MAAMD,0BAA0B,GAAIC,iBAAyB,IAAK;EAChE,OAAQ;AACV;AACA,QAAQA,iBAAkB;AAC1B;AACA,GAAG;AACH,CAAC"}
@@ -1,6 +1,8 @@
1
+ import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
1
2
  import { CardMessage } from '../../messages/webMessages/cardMessage';
2
3
  import { PageMessage } from '../../messages/webMessages/pageMessage';
3
4
  import { UnitMessage } from '../../messages/webMessages/unitMessages';
5
+ import { AccountMessage } from '../../messages/webMessages/accountMessage';
4
6
  export const POST_MESSAGE_TO_SDK = `
5
7
  const postMessageToSDK = (message) => {
6
8
  if ('ReactNativeWebView' in window) {
@@ -58,7 +60,31 @@ export const LISTENERS = {
58
60
  window.addEventListener("${CardMessage.CARD_STATUS_CHANGED}", (e) => {
59
61
  const response = e.detail
60
62
  response.then((data) => {
61
- postMessageToSDK({ type: "${CardMessage.CARD_STATUS_CHANGED}", details: { card: JSON.stringify(data.data) }})
63
+ postMessageToSDK({ type: "${CardMessage.CARD_STATUS_CHANGED}", details: { card: data.data }})
64
+ }).catch((e) => {
65
+ console.log(e)
66
+ })
67
+ });
68
+ `,
69
+ unitRequestExternalSdk: `
70
+ window.addEventListener("${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", (e) => {
71
+ postMessageToSDK({ type: "${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", details: e.detail })
72
+ });
73
+ `,
74
+ unitPaymentCreated: `
75
+ window.addEventListener("${PaymentMessage.PAYMENT_CREATED}", (e) => {
76
+ const response = e.detail
77
+ response.then((data) => {
78
+ postMessageToSDK({ type: "${PaymentMessage.PAYMENT_CREATED}", details: { data: data.data }})
79
+ }).catch((e) => {
80
+ console.log(e)
81
+ })
82
+ });`,
83
+ unitAccountChanged: `
84
+ window.addEventListener("${AccountMessage.UNIT_ACCOUNT_CHANGED}", (e) => {
85
+ const response = e.detail
86
+ response.then((data) => {
87
+ postMessageToSDK({ type: "${AccountMessage.UNIT_ACCOUNT_CHANGED}", details: { account: data.data }})
62
88
  }).catch((e) => {
63
89
  console.log(e)
64
90
  })
@@ -77,4 +103,10 @@ export const DISPATCH_REQUEST_REFRESH = `
77
103
  window.dispatchEvent(event)
78
104
  }
79
105
  `;
106
+ export const DISPATCH_PLAID_RESPONSE = `
107
+ const dispatchPlaidEvent = (details) => {
108
+ const event = new CustomEvent("${UnitMessage.UNIT_PLAID_RESPONSE}",{ detail: details })
109
+ window.dispatchEvent(event)
110
+ }
111
+ `;
80
112
  //# sourceMappingURL=bodyScript.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CardMessage","PageMessage","UnitMessage","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","PAGE_HEIGHT","LISTENERS","isPageLoaded","PAGE_LOADED","requestRendering","UNIT_REQUEST_RENDERING","requestRefresh","UNIT_REQUEST_REFRESH","onLoad","UNIT_ON_LOAD","requestCloseFlow","UNIT_REQUEST_CLOSE_FLOW","requestOpenLink","UNIT_REQUEST_OPEN_LINK","unitRequestDownload","UNIT_REQUEST_DOWNLOAD","cardStatusChange","CARD_STATUS_CHANGED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH"],"sources":["bodyScript.ts"],"sourcesContent":["import { CardMessage } from '../../messages/webMessages/cardMessage';\nimport { PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\n\nexport const POST_MESSAGE_TO_SDK = `\n const postMessageToSDK = (message) => {\n if ('ReactNativeWebView' in window) {\n const messageString = JSON.stringify(message)\n window['ReactNativeWebView'].postMessage(messageString)\n }\n }\n`;\n\nexport const POST_PAGE_HEIGHT = `\n const postHeight = () => {\n setTimeout(() => {\n const height = window.document.documentElement.getBoundingClientRect().height\n postMessageToSDK({ type: \"${PageMessage.PAGE_HEIGHT}\", details: { height } })\n })\n }\n`;\n\nexport const LISTENERS = {\n isPageLoaded: `\n window.addEventListener('DOMContentLoaded', e => {\n postMessageToSDK({ type: \"${PageMessage.PAGE_LOADED}\" })\n });\n `,\n requestRendering: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_RENDERING}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_RENDERING}\", details: { data: e.detail }})\n });\n `,\n requestRefresh: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_REFRESH}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_REFRESH}\", details: e.detail })\n });\n `,\n onLoad: `\n window.addEventListener(\"${UnitMessage.UNIT_ON_LOAD}\", (e) => {\n postHeight()\n postMessageToSDK({ type: \"${UnitMessage.UNIT_ON_LOAD}\", details: e.detail })\n });\n `,\n requestCloseFlow: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\" })\n });\n `,\n requestOpenLink: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", details: e.detail })\n });\n `,\n unitRequestDownload: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", details: e.detail })\n });\n `,\n cardStatusChange: `\n window.addEventListener(\"${CardMessage.CARD_STATUS_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_STATUS_CHANGED}\", details: { card: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `\n};\n\nexport const DISPATCH_RENDERING_EVENT = `\n const dispatchRenderingEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_RENDERING}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_REQUEST_REFRESH = `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n"],"mappings":"AAAA,SAASA,WAAT,QAA4B,wCAA5B;AACA,SAASC,WAAT,QAA4B,wCAA5B;AACA,SAASC,WAAT,QAA4B,yCAA5B;AAEA,OAAO,MAAMC,mBAAmB,GAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAPO;AASP,OAAO,MAAMC,gBAAgB,GAAI;AACjC;AACA;AACA;AACA,kCAAkCH,WAAW,CAACI,WAAY;AAC1D;AACA;AACA,CAPO;AASP,OAAO,MAAMC,SAAS,GAAG;EACvBC,YAAY,EAAG;AACjB;AACA,kCAAkCN,WAAW,CAACO,WAAY;AAC1D;AACA,GALyB;EAMvBC,gBAAgB,EAAG;AACrB,+BAA+BP,WAAW,CAACQ,sBAAuB;AAClE,kCAAkCR,WAAW,CAACQ,sBAAuB;AACrE;AACA,GAVyB;EAWvBC,cAAc,EAAG;AACnB,+BAA+BT,WAAW,CAACU,oBAAqB;AAChE,kCAAkCV,WAAW,CAACU,oBAAqB;AACnE;AACA,GAfyB;EAgBvBC,MAAM,EAAG;AACX,+BAA+BX,WAAW,CAACY,YAAa;AACxD;AACA,kCAAkCZ,WAAW,CAACY,YAAa;AAC3D;AACA,GArByB;EAsBvBC,gBAAgB,EAAG;AACrB,+BAA+Bb,WAAW,CAACc,uBAAwB;AACnE,kCAAkCd,WAAW,CAACc,uBAAwB;AACtE;AACA,GA1ByB;EA2BvBC,eAAe,EAAG;AACpB,+BAA+Bf,WAAW,CAACgB,sBAAuB;AAClE,kCAAkChB,WAAW,CAACgB,sBAAuB;AACrE;AACA,GA/ByB;EAgCvBC,mBAAmB,EAAG;AACxB,+BAA+BjB,WAAW,CAACkB,qBAAsB;AACjE,kCAAkClB,WAAW,CAACkB,qBAAsB;AACpE;AACA,GApCyB;EAqCvBC,gBAAgB,EAAG;AACrB,+BAA+BrB,WAAW,CAACsB,mBAAoB;AAC/D;AACA;AACA,oCAAoCtB,WAAW,CAACsB,mBAAoB;AACpE;AACA;AACA;AACA;AACA;AA9CyB,CAAlB;AAiDP,OAAO,MAAMC,wBAAwB,GAAI;AACzC;AACA,qCAAqCrB,WAAW,CAACQ,sBAAuB;AACxE;AACA;AACA,CALO;AAOP,OAAO,MAAMc,wBAAwB,GAAI;AACzC;AACA,qCAAqCtB,WAAW,CAACU,oBAAqB;AACtE;AACA;AACA,CALO"}
1
+ {"version":3,"names":["PaymentMessage","CardMessage","PageMessage","UnitMessage","AccountMessage","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","PAGE_HEIGHT","LISTENERS","isPageLoaded","PAGE_LOADED","requestRendering","UNIT_REQUEST_RENDERING","requestRefresh","UNIT_REQUEST_REFRESH","onLoad","UNIT_ON_LOAD","requestCloseFlow","UNIT_REQUEST_CLOSE_FLOW","requestOpenLink","UNIT_REQUEST_OPEN_LINK","unitRequestDownload","UNIT_REQUEST_DOWNLOAD","cardStatusChange","CARD_STATUS_CHANGED","unitRequestExternalSdk","UNIT_REQUEST_EXTERNAL_SDK","unitPaymentCreated","PAYMENT_CREATED","unitAccountChanged","UNIT_ACCOUNT_CHANGED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH","DISPATCH_PLAID_RESPONSE","UNIT_PLAID_RESPONSE"],"sources":["bodyScript.ts"],"sourcesContent":["import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';\nimport { CardMessage } from '../../messages/webMessages/cardMessage';\nimport { PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { AccountMessage } from '../../messages/webMessages/accountMessage';\n\nexport const POST_MESSAGE_TO_SDK = `\n const postMessageToSDK = (message) => {\n if ('ReactNativeWebView' in window) {\n const messageString = JSON.stringify(message)\n window['ReactNativeWebView'].postMessage(messageString)\n }\n }\n`;\n\nexport const POST_PAGE_HEIGHT = `\n const postHeight = () => {\n setTimeout(() => {\n const height = window.document.documentElement.getBoundingClientRect().height\n postMessageToSDK({ type: \"${PageMessage.PAGE_HEIGHT}\", details: { height } })\n })\n }\n`;\n\nexport const LISTENERS = {\n isPageLoaded: `\n window.addEventListener('DOMContentLoaded', e => {\n postMessageToSDK({ type: \"${PageMessage.PAGE_LOADED}\" })\n });\n `,\n requestRendering: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_RENDERING}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_RENDERING}\", details: { data: e.detail }})\n });\n `,\n requestRefresh: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_REFRESH}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_REFRESH}\", details: e.detail })\n });\n `,\n onLoad: `\n window.addEventListener(\"${UnitMessage.UNIT_ON_LOAD}\", (e) => {\n postHeight()\n postMessageToSDK({ type: \"${UnitMessage.UNIT_ON_LOAD}\", details: e.detail })\n });\n `,\n requestCloseFlow: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\" })\n });\n `,\n requestOpenLink: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", details: e.detail })\n });\n `,\n unitRequestDownload: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", details: e.detail })\n });\n `,\n cardStatusChange: `\n window.addEventListener(\"${CardMessage.CARD_STATUS_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_STATUS_CHANGED}\", details: { card: data.data }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `,\n unitRequestExternalSdk: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}\", details: e.detail })\n });\n`,\n unitPaymentCreated:`\n window.addEventListener(\"${PaymentMessage.PAYMENT_CREATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${PaymentMessage.PAYMENT_CREATED}\", details: { data: data.data }})\n }).catch((e) => {\n console.log(e)\n })\n });`\n ,\n unitAccountChanged: `\n window.addEventListener(\"${AccountMessage.UNIT_ACCOUNT_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${AccountMessage.UNIT_ACCOUNT_CHANGED}\", details: { account: data.data }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `,\n};\n\nexport const DISPATCH_RENDERING_EVENT = `\n const dispatchRenderingEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_RENDERING}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_REQUEST_REFRESH = `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_PLAID_RESPONSE = `\n const dispatchPlaidEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_PLAID_RESPONSE}\",{ detail: details })\n window.dispatchEvent(event)\n }\n`;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,4CAA4C;AAC3E,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,WAAW,QAAQ,yCAAyC;AACrE,SAASC,cAAc,QAAQ,2CAA2C;AAE1E,OAAO,MAAMC,mBAAmB,GAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAI;AACjC;AACA;AACA;AACA,kCAAkCJ,WAAW,CAACK,WAAY;AAC1D;AACA;AACA,CAAC;AAED,OAAO,MAAMC,SAAS,GAAG;EACvBC,YAAY,EAAG;AACjB;AACA,kCAAkCP,WAAW,CAACQ,WAAY;AAC1D;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+BR,WAAW,CAACS,sBAAuB;AAClE,kCAAkCT,WAAW,CAACS,sBAAuB;AACrE;AACA,GAAG;EACDC,cAAc,EAAG;AACnB,+BAA+BV,WAAW,CAACW,oBAAqB;AAChE,kCAAkCX,WAAW,CAACW,oBAAqB;AACnE;AACA,GAAG;EACDC,MAAM,EAAG;AACX,+BAA+BZ,WAAW,CAACa,YAAa;AACxD;AACA,kCAAkCb,WAAW,CAACa,YAAa;AAC3D;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+Bd,WAAW,CAACe,uBAAwB;AACnE,kCAAkCf,WAAW,CAACe,uBAAwB;AACtE;AACA,GAAG;EACDC,eAAe,EAAG;AACpB,+BAA+BhB,WAAW,CAACiB,sBAAuB;AAClE,kCAAkCjB,WAAW,CAACiB,sBAAuB;AACrE;AACA,GAAG;EACDC,mBAAmB,EAAG;AACxB,+BAA+BlB,WAAW,CAACmB,qBAAsB;AACjE,kCAAkCnB,WAAW,CAACmB,qBAAsB;AACpE;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+BtB,WAAW,CAACuB,mBAAoB;AAC/D;AACA;AACA,oCAAoCvB,WAAW,CAACuB,mBAAoB;AACpE;AACA;AACA;AACA;AACA,GAAG;EACDC,sBAAsB,EAAG;AAC3B,6BAA6BtB,WAAW,CAACuB,yBAA0B;AACnE,gCAAgCvB,WAAW,CAACuB,yBAA0B;AACtE;AACA,CAAC;EACCC,kBAAkB,EAAE;AACtB,6BAA6B3B,cAAc,CAAC4B,eAAgB;AAC5D;AACA;AACA,oCAAoC5B,cAAc,CAAC4B,eAAgB;AACnE;AACA;AACA;AACA,MAAM;EAEJC,kBAAkB,EAAG;AACvB,+BAA+BzB,cAAc,CAAC0B,oBAAqB;AACnE;AACA;AACA,oCAAoC1B,cAAc,CAAC0B,oBAAqB;AACxE;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,wBAAwB,GAAI;AACzC;AACA,qCAAqC5B,WAAW,CAACS,sBAAuB;AACxE;AACA;AACA,CAAC;AAED,OAAO,MAAMoB,wBAAwB,GAAI;AACzC;AACA,qCAAqC7B,WAAW,CAACW,oBAAqB;AACtE;AACA;AACA,CAAC;AAED,OAAO,MAAMmB,uBAAuB,GAAI;AACxC;AACA,qCAAqC9B,WAAW,CAAC+B,mBAAoB;AACrE;AACA;AACA,CAAC"}
@@ -0,0 +1,23 @@
1
+ var UNAccountStatus;
2
+ (function (UNAccountStatus) {
3
+ UNAccountStatus["Open"] = "Open";
4
+ UNAccountStatus["Closed"] = "Closed";
5
+ UNAccountStatus["Frozen"] = "Frozen";
6
+ })(UNAccountStatus || (UNAccountStatus = {}));
7
+ export let UNCloseReason;
8
+ (function (UNCloseReason) {
9
+ UNCloseReason["Fraud"] = "Fraud";
10
+ UNCloseReason["ByCustomer"] = "ByCustomer";
11
+ })(UNCloseReason || (UNCloseReason = {}));
12
+ export let UNFraudReason;
13
+ (function (UNFraudReason) {
14
+ UNFraudReason["ACHActivity"] = "ACHActivity";
15
+ UNFraudReason["CardActivity"] = "CardActivity";
16
+ UNFraudReason["CheckActivity"] = "CheckActivity";
17
+ UNFraudReason["ApplicationHistory"] = "ApplicationHistory";
18
+ UNFraudReason["AccountActivity"] = "AccountActivity";
19
+ UNFraudReason["ClientIdentified"] = "ClientIdentified";
20
+ UNFraudReason["IdentityTheft"] = "IdentityTheft";
21
+ UNFraudReason["LinkedToFraudulentCustomer"] = "LinkedToFraudulentCustomer";
22
+ })(UNFraudReason || (UNFraudReason = {}));
23
+ //# sourceMappingURL=account.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UNAccountStatus","UNCloseReason","UNFraudReason"],"sources":["account.types.ts"],"sourcesContent":["import type { UNRelationship, UNTags } from './types';\n\nexport type UNAccountData = UNDepositAccount | UNBatchAccount | UNCreditAccount\n\nenum UNAccountStatus {\n Open = \"Open\",\n Closed = \"Closed\",\n Frozen = \"Frozen\",\n}\n\nexport enum UNCloseReason {\n Fraud = \"Fraud\",\n ByCustomer = \"ByCustomer\",\n}\n\nexport enum UNFraudReason {\n ACHActivity = \"ACHActivity\",\n CardActivity = \"CardActivity\",\n CheckActivity = \"CheckActivity\",\n ApplicationHistory = \"ApplicationHistory\",\n AccountActivity = \"AccountActivity\",\n ClientIdentified = \"ClientIdentified\",\n IdentityTheft = \"IdentityTheft\",\n LinkedToFraudulentCustomer = \"LinkedToFraudulentCustomer\",\n}\n\nexport type UNDepositAccount = {\n id: string\n type: \"depositAccount\"\n attributes: {\n createdAt: string\n updatedAt?: string\n name: string\n depositProduct: string\n routingNumber: string\n accountNumber: string\n maskedAccountNumber?: string\n secondaryAccountNumber?: {\n routingNumber: string\n accountNumber: string\n }\n balance: number\n hold: number\n reserve: number\n available: number\n overdraftLimit?: number\n currency: string\n tags: UNTags\n status: UNAccountStatus\n closeReason?: string\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n isOverdrawnWithinLimit?: boolean\n }\n relationships: {\n customer?: UNRelationship\n customers?: UNRelationship\n org: UNRelationship\n }\n // included?: Individual[]\n}\n\nexport type UNBatchAccount = {\n id: string\n type: \"batchAccount\"\n attributes: {\n createdAt: Date\n updatedAt?: Date\n name: string\n depositProduct: string\n routingNumber: string\n accountNumber: string\n maskedAccountNumber?: string\n balance: number\n hold: number\n reserve: number\n available: number\n currency: string\n status: \"Open\" | \"Closed\"\n closeReason?: string\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n tags?: {[key: string]: string}\n }\n relationships: {\n org: UNRelationship\n }\n}\n\nexport type UNCreditAccount = {\n id: string\n type: \"creditAccount\"\n attributes: {\n createdAt: Date\n updatedAt?: Date\n name: string\n creditTerms: string\n balance: number\n hold: number\n reserve: number\n available: number\n creditLimit: number\n currency: string\n tags: {[key: string]: string}\n status: UNAccountStatus\n closeReason?: UNCloseReason\n fraudReason?: UNFraudReason\n closeReasonText?: string\n freezeReason?: string\n }\n relationships: {\n customer: UNRelationship,\n org: UNRelationship\n }\n}\n"],"mappings":"IAIKA,eAAe;AAAA,WAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;AAAA,GAAfA,eAAe,KAAfA,eAAe;AAMpB,WAAYC,aAAa;AAGxB,WAHWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAKzB,WAAYC,aAAa;AASxB,WATWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=achCredit.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNACHData = {\n type: 'achPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: UNPaymentStatus,\n settlementDate?: Date,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: UNTags,\n addenda?: string\n\t\tcounterparty: UNAchCounterparty\n\t\texpectedCompletionDate?: Date\n\t\tcounterpartyVerificationMethod?:keyof typeof UNCounterpartyVerificationMethod\n\t\tsameDay?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer?: UNRelationship,\n customers?: UNRelationship,\n counterpartyAccount: UNRelationship,\n counterpartyCustomer: UNRelationship,\n transaction: UNRelationship,\n recurringPayment: UNRelationship\n }\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type { Tags, Relationship } from './types';\n\ntype BookPaymentStatus = 'Sent' | 'Rejected'\n\nexport type UNBookPaymentData = {\n type: 'bookPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: BookPaymentStatus,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: Tags,\n },\n relationships: {\n account: Relationship,\n customer?: Relationship,\n customers?: Relationship,\n counterpartyAccount: Relationship,\n counterpartyCustomer: Relationship,\n transaction: Relationship,\n recurringPayment: Relationship\n }\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type { UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNBookPaymentData = {\n type: 'bookPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: UNPaymentStatus,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: UNTags,\n },\n relationships: {\n account: UNRelationship,\n customer?: UNRelationship,\n customers?: UNRelationship,\n counterpartyAccount: UNRelationship,\n counterpartyCustomer: UNRelationship,\n transaction: UNRelationship,\n recurringPayment: UNRelationship\n }\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["card.types.ts"],"sourcesContent":["import type { Address, FullName, Limits, Relationship, Tags } from './types';\n\nexport type UNCardData = IndividualDebitCard | BusinessDebitCard\n\ntype CardStatus = 'Active' | 'Inactive' | 'Stolen' | 'Lost' | 'Frozen' | 'ClosedByCustomer' | 'SuspectedFraud'\n\nexport type IndividualDebitCard = {\n id: string,\n type: 'individualDebitCard' | 'individualVirtualDebitCard',\n attributes: {\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: CardStatus,\n shippingAddress?: Address, /* not exists in virtual card */\n updatedAt?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Tags,\n limits?: Limits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: Relationship,\n customer: Relationship\n }\n}\n\nexport type BusinessDebitCard = {\n id: string,\n type: 'businessDebitCard' | 'businessVirtualDebitCard',\n attributes: {\n fullName: FullName,\n dateOfBirth: string,\n address: Address,\n shippingAddress?: Address,\n phone: string,\n email: string,\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: CardStatus,\n updatedAt?: string,\n ssn?: string,\n passport?: string,\n nationality?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Record<string, string>\n limits?: Limits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: Relationship,\n customer: Relationship\n }\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["card.types.ts"],"sourcesContent":["import type { UNAddress, UNFullName, UNLimits, UNRelationship, UNTags } from './types';\n\nexport type UNCardData = UNIndividualDebitCard | UNBusinessDebitCard\n\ntype UNCardStatus = 'Active' | 'Inactive' | 'Stolen' | 'Lost' | 'Frozen' | 'ClosedByCustomer' | 'SuspectedFraud'\n\nexport type UNIndividualDebitCard = {\n id: string,\n type: 'individualDebitCard' | 'individualVirtualDebitCard',\n attributes: {\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: UNCardStatus,\n shippingAddress?: UNAddress, /* not exists in virtual card */\n updatedAt?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: UNTags,\n limits?: UNLimits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer: UNRelationship\n }\n}\n\nexport type UNBusinessDebitCard = {\n id: string,\n type: 'businessDebitCard' | 'businessVirtualDebitCard',\n attributes: {\n fullName: UNFullName,\n dateOfBirth: string,\n address: UNAddress,\n shippingAddress?: UNAddress,\n phone: string,\n email: string,\n createdAt: string,\n last4Digits: string,\n expirationDate: string,\n status: UNCardStatus,\n updatedAt?: string,\n ssn?: string,\n passport?: string,\n nationality?: string,\n design?: string,\n additionalEmbossedText?: string,\n idempotencyKey?: string,\n tags?: Record<string, string>\n limits?: UNLimits,\n printOnlyBusinessName?: boolean\n },\n relationships: {\n account: UNRelationship,\n customer: UNRelationship\n }\n}\n"],"mappings":""}
@@ -1,4 +1,7 @@
1
1
  export * from './bookPayment.types';
2
2
  export * from './card.types';
3
3
  export * from './onLoadResponse.types';
4
+ export * from './achCredit.types';
5
+ export * from './payments.types';
6
+ export * from "./account.types";
4
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\n"],"mappings":"AAAA,cAAc,qBAAd;AACA,cAAc,cAAd;AACA,cAAc,wBAAd"}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\nexport * from \"./account.types\";\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { UNCardData } from '../sharedTypes';\n\nexport type SuccessResponseUnitOnLoad = {\n /*\n Object since the current response data types from 'Activities' and 'BookPayment' do not have documentation.\n When things are determined, we may update it\n */\n data: UNCardData | Object,\n included: [Object],\n errors: null\n}\n\nexport type ErrorResponseUnitOnLoad = {\n errors: [\n {\n status: string,\n title: string,\n detail?: string,\n details?: string,\n meta?: Record<string, string>\n }\n ]\n}\nexport type ResponseUnitOnLoadEvent =\n | SuccessResponseUnitOnLoad\n | ErrorResponseUnitOnLoad\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport type { UNCardData } from '../sharedTypes';\n\nexport type UNSuccessResponseUnitOnLoad = {\n /*\n Object since the current response data types from 'Activities' and 'BookPayment' do not have documentation.\n When things are determined, we may update it\n */\n data: UNCardData | Object,\n included: [Object],\n errors: null\n}\n\nexport type UNErrorResponseUnitOnLoad = {\n errors: [\n {\n status: string,\n title: string,\n detail?: string,\n details?: string,\n meta?: Record<string, string>\n }\n ]\n}\nexport type UNResponseUnitOnLoadEvent =\n | UNSuccessResponseUnitOnLoad\n | UNErrorResponseUnitOnLoad\n"],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export let UNCounterpartyVerificationMethod;
2
+ (function (UNCounterpartyVerificationMethod) {
3
+ UNCounterpartyVerificationMethod["Plaid"] = "Plaid";
4
+ })(UNCounterpartyVerificationMethod || (UNCounterpartyVerificationMethod = {}));
5
+ //# sourceMappingURL=payments.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["UNCounterpartyVerificationMethod"],"sources":["payments.types.ts"],"sourcesContent":["export type UNPaymentStatus = 'Sent' | 'Rejected'\n\nexport type UNAchCounterparty = {\n\tname: string\n\taccountNumber: string\n\troutingNumber: string\n\taccountType: UNAccountType\n}\n\ntype UNAccountType = 'Savings' | 'Checking'\n\nexport enum UNCounterpartyVerificationMethod {\n\tPlaid = 'Plaid',\n}\n"],"mappings":"AAWA,WAAYA,gCAAgC;AAE3C,WAFWA,gCAAgC;EAAhCA,gCAAgC;AAAA,GAAhCA,gCAAgC,KAAhCA,gCAAgC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type Address = {\n street: string,\n street2?: string,\n city: string,\n state: string,\n postalCode: string,\n country: string\n}\n\nexport type Limits = {\n dailyWithdrawal?: string | number,\n dailyPurchase?: string | number,\n monthlyWithdrawal?: string | number,\n monthlyPurchase?: string | number,\n}\n\ntype Data = {\n type: string,\n id: string\n}\n\nexport type Relationship = {\n data:\n | null\n | []\n | Data\n | Data[]\n}\n\nexport type FullName = {\n first: string,\n last: string\n}\n\nexport type Tags = Record<string, string> // TODO: specify Tag type\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type UNAddress = {\n street: string,\n street2?: string,\n city: string,\n state: string,\n postalCode: string,\n country: string\n}\n\nexport type UNLimits = {\n dailyWithdrawal?: string | number,\n dailyPurchase?: string | number,\n monthlyWithdrawal?: string | number,\n monthlyPurchase?: string | number,\n}\n\ntype UNData = {\n type: string,\n id: string\n}\n\nexport type UNRelationship = {\n data:\n | null\n | []\n | UNData\n | UNData[]\n}\n\nexport type UNFullName = {\n first: string,\n last: string\n}\n\nexport type UNTags = Record<string, string> // TODO: specify Tag type\n"],"mappings":""}
@@ -1,14 +1,22 @@
1
1
  export let UNWalletCode;
2
-
3
2
  (function (UNWalletCode) {
4
3
  UNWalletCode["Apple"] = "ApplePayPushProvision";
5
4
  UNWalletCode["Google"] = "GooglePayPushProvision";
6
5
  })(UNWalletCode || (UNWalletCode = {}));
7
-
8
6
  export let UNWalletName;
9
-
10
7
  (function (UNWalletName) {
11
8
  UNWalletName["Apple"] = "APPLE";
12
9
  UNWalletName["Google"] = "GOOGLE";
13
10
  })(UNWalletName || (UNWalletName = {}));
11
+ export let UNCardAddToWalletStatus;
12
+ (function (UNCardAddToWalletStatus) {
13
+ UNCardAddToWalletStatus[UNCardAddToWalletStatus["pending"] = 0] = "pending";
14
+ UNCardAddToWalletStatus["readyToProvisioning"] = "ReadyToProvision";
15
+ UNCardAddToWalletStatus["addedToWallet"] = "AlreadyProvisioned";
16
+ UNCardAddToWalletStatus["iosProvisionedInCurrentDevice"] = "ProvisionedInCurrentDevice";
17
+ UNCardAddToWalletStatus["iosProvisionedInPairedDevice"] = "ProvisionedInPairedDevice";
18
+ UNCardAddToWalletStatus["androidNotInstalled"] = "NotInstalled";
19
+ UNCardAddToWalletStatus["androidWalletSetupNotCompleted"] = "WalletSetupNotCompleted";
20
+ UNCardAddToWalletStatus["androidWalletAppUpdateAvailable"] = "WalletAppUpdateAvailable";
21
+ })(UNCardAddToWalletStatus || (UNCardAddToWalletStatus = {}));
14
22
  //# sourceMappingURL=wallet.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["UNWalletCode","UNWalletName"],"sources":["wallet.types.ts"],"sourcesContent":["import type { CardAddToWalletStatus } from 'src/messages/nativeMessages/cardMessage';\n\nexport enum UNWalletCode {\n Apple = 'ApplePayPushProvision',\n Google = 'GooglePayPushProvision',\n}\n\nexport enum UNWalletName {\n Apple = 'APPLE',\n Google = 'GOOGLE',\n}\n\nexport interface UNWallet {\n name: string;\n code: string;\n status: CardAddToWalletStatus\n}\n"],"mappings":"AAEA,WAAYA,YAAZ;;WAAYA,Y;EAAAA,Y;EAAAA,Y;GAAAA,Y,KAAAA,Y;;AAKZ,WAAYC,YAAZ;;WAAYA,Y;EAAAA,Y;EAAAA,Y;GAAAA,Y,KAAAA,Y"}
1
+ {"version":3,"names":["UNWalletCode","UNWalletName","UNCardAddToWalletStatus"],"sources":["wallet.types.ts"],"sourcesContent":["export enum UNWalletCode {\n Apple = 'ApplePayPushProvision',\n Google = 'GooglePayPushProvision',\n}\n\nexport enum UNWalletName {\n Apple = 'APPLE',\n Google = 'GOOGLE',\n}\n\nexport interface UNWallet {\n name: string;\n code: string;\n status: UNCardAddToWalletStatus\n}\n\nexport enum UNCardAddToWalletStatus {\n pending,\n readyToProvisioning = 'ReadyToProvision',\n addedToWallet = 'AlreadyProvisioned',\n iosProvisionedInCurrentDevice = 'ProvisionedInCurrentDevice',\n iosProvisionedInPairedDevice = 'ProvisionedInPairedDevice',\n androidNotInstalled = 'NotInstalled',\n androidWalletSetupNotCompleted = 'WalletSetupNotCompleted',\n androidWalletAppUpdateAvailable = 'WalletAppUpdateAvailable'\n\n}\n"],"mappings":"AAAA,WAAYA,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAKxB,WAAYC,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAWxB,WAAYC,uBAAuB;AAUlC,WAVWA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"names":["VARIABLES","COLORS","WHITE","BLACK","BLUE","GREY","SILVER_FLAKE"],"sources":["variables.ts"],"sourcesContent":["export const VARIABLES = {\n COLORS: {\n WHITE: '#ffffff',\n BLACK: '#000000',\n BLUE: '#005fF0',\n GREY: '#bbbbbb',\n SILVER_FLAKE: '#D5DDE0'\n }\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,MAAM,EAAE;IACNC,KAAK,EAAE,SADD;IAENC,KAAK,EAAE,SAFD;IAGNC,IAAI,EAAE,SAHA;IAINC,IAAI,EAAE,SAJA;IAKNC,YAAY,EAAE;EALR;AADe,CAAlB"}
1
+ {"version":3,"names":["VARIABLES","COLORS","WHITE","BLACK","BLUE","GREY","SILVER_FLAKE"],"sources":["variables.ts"],"sourcesContent":["export const VARIABLES = {\n COLORS: {\n WHITE: '#ffffff',\n BLACK: '#000000',\n BLUE: '#005fF0',\n GREY: '#bbbbbb',\n SILVER_FLAKE: '#D5DDE0'\n }\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,MAAM,EAAE;IACNC,KAAK,EAAE,SAAS;IAChBC,KAAK,EAAE,SAAS;IAChBC,IAAI,EAAE,SAAS;IACfC,IAAI,EAAE,SAAS;IACfC,YAAY,EAAE;EAChB;AACF,CAAC"}
@@ -2,23 +2,19 @@ import EventBus from '../helpers/EventBus';
2
2
  import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
3
3
  import { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';
4
4
  let isLoadingScript = false;
5
- /** globalUnitScript is exported ONLY to our project components **/
6
5
 
6
+ /** globalUnitScript is exported ONLY to our project components **/
7
7
  export let globalUnitScript = '';
8
8
  export const fetchUnitScript = async () => {
9
9
  const env = UnitSDK.getEnv();
10
-
11
10
  if (isLoadingScript || globalUnitScript || !env) {
12
11
  // init function is called and success OR in progress
13
12
  return null;
14
13
  }
15
-
16
14
  isLoadingScript = true;
17
-
18
15
  try {
19
16
  const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);
20
17
  const unitScript = await unitScriptRes.text();
21
-
22
18
  if (unitScript) {
23
19
  const scriptFetchData = {
24
20
  unitScript
@@ -26,7 +22,6 @@ export const fetchUnitScript = async () => {
26
22
  EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);
27
23
  globalUnitScript = unitScript;
28
24
  }
29
-
30
25
  return null;
31
26
  } catch (e) {
32
27
  console.log(e);
@@ -1 +1 @@
1
- {"version":3,"names":["EventBus","SDKMessage","UnitSDK","UNIT_SCRIPT_URL","isLoadingScript","globalUnitScript","fetchUnitScript","env","getEnv","unitScriptRes","fetch","unitScript","text","scriptFetchData","Instance","event","IS_SCRIPT_FETCHED","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';\n\nlet isLoadingScript = false;\n\n/** globalUnitScript is exported ONLY to our project components **/\nexport let globalUnitScript = '';\n\nexport const fetchUnitScript = async () => {\n const env = UnitSDK.getEnv();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n const scriptFetchData: SdkScriptFetched = { unitScript };\n EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);\n globalUnitScript = unitScript;\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,qBAArB;AACA,SAASC,UAAT,QAA6C,uCAA7C;AACA,SAASC,OAAT,EAAkBC,eAAlB,QAAyC,kBAAzC;AAEA,IAAIC,eAAe,GAAG,KAAtB;AAEA;;AACA,OAAO,IAAIC,gBAAgB,GAAG,EAAvB;AAEP,OAAO,MAAMC,eAAe,GAAG,YAAY;EACzC,MAAMC,GAAG,GAAGL,OAAO,CAACM,MAAR,EAAZ;;EACA,IAAIJ,eAAe,IAAIC,gBAAnB,IAAuC,CAACE,GAA5C,EAAiD;IAC/C;IACA,OAAO,IAAP;EACD;;EACDH,eAAe,GAAG,IAAlB;;EACA,IAAI;IACF,MAAMK,aAAa,GAAG,MAAMC,KAAK,CAACP,eAAe,CAACI,GAAD,CAAhB,CAAjC;IACA,MAAMI,UAAU,GAAG,MAAMF,aAAa,CAACG,IAAd,EAAzB;;IACA,IAAID,UAAJ,EAAgB;MACd,MAAME,eAAiC,GAAG;QAAEF;MAAF,CAA1C;MACAX,QAAQ,CAACc,QAAT,CAAkBC,KAAlB,CAAwBd,UAAU,CAACe,iBAAnC,EAAsDH,eAAtD;MACAR,gBAAgB,GAAGM,UAAnB;IACD;;IACD,OAAO,IAAP;EACD,CATD,CASE,OAAOM,CAAP,EAAU;IACVC,OAAO,CAACC,GAAR,CAAYF,CAAZ;IACA,OAAO,IAAP;EACD,CAZD,SAYU;IACRb,eAAe,GAAG,KAAlB;EACD;AACF,CAtBM"}
1
+ {"version":3,"names":["EventBus","SDKMessage","UnitSDK","UNIT_SCRIPT_URL","isLoadingScript","globalUnitScript","fetchUnitScript","env","getEnv","unitScriptRes","fetch","unitScript","text","scriptFetchData","Instance","event","IS_SCRIPT_FETCHED","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';\n\nlet isLoadingScript = false;\n\n/** globalUnitScript is exported ONLY to our project components **/\nexport let globalUnitScript = '';\n\nexport const fetchUnitScript = async () => {\n const env = UnitSDK.getEnv();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n const scriptFetchData: SdkScriptFetched = { unitScript };\n EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);\n globalUnitScript = unitScript;\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,qBAAqB;AAC1C,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,OAAO,EAAEC,eAAe,QAAQ,kBAAkB;AAE3D,IAAIC,eAAe,GAAG,KAAK;;AAE3B;AACA,OAAO,IAAIC,gBAAgB,GAAG,EAAE;AAEhC,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAAY;EACzC,MAAMC,GAAG,GAAGL,OAAO,CAACM,MAAM,EAAE;EAC5B,IAAIJ,eAAe,IAAIC,gBAAgB,IAAI,CAACE,GAAG,EAAE;IAC/C;IACA,OAAO,IAAI;EACb;EACAH,eAAe,GAAG,IAAI;EACtB,IAAI;IACF,MAAMK,aAAa,GAAG,MAAMC,KAAK,CAACP,eAAe,CAACI,GAAG,CAAC,CAAC;IACvD,MAAMI,UAAU,GAAG,MAAMF,aAAa,CAACG,IAAI,EAAE;IAC7C,IAAID,UAAU,EAAE;MACd,MAAME,eAAiC,GAAG;QAAEF;MAAW,CAAC;MACxDX,QAAQ,CAACc,QAAQ,CAACC,KAAK,CAACd,UAAU,CAACe,iBAAiB,EAAEH,eAAe,CAAC;MACtER,gBAAgB,GAAGM,UAAU;IAC/B;IACA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOM,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;IACd,OAAO,IAAI;EACb,CAAC,SAAS;IACRb,eAAe,GAAG,KAAK;EACzB;AACF,CAAC"}
@@ -1,27 +1,22 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
4
  import EventBus from '../helpers/EventBus';
4
5
  import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
5
6
  import { fetchUnitScript } from './UnitSdk.api';
6
7
  export let UNEnvironment;
7
-
8
8
  (function (UNEnvironment) {
9
9
  UNEnvironment["sandbox"] = "sandbox";
10
10
  UNEnvironment["production"] = "production";
11
11
  })(UNEnvironment || (UNEnvironment = {}));
12
-
13
12
  export const UNIT_SCRIPT_URL = {
14
13
  [UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',
15
14
  [UNEnvironment.production]: 'https://ui.unit.co/components.js'
16
15
  };
17
16
  export class UnitSDK {}
18
-
19
17
  _defineProperty(UnitSDK, "env", void 0);
20
-
21
18
  _defineProperty(UnitSDK, "theme", void 0);
22
-
23
19
  _defineProperty(UnitSDK, "signedNonce", void 0);
24
-
25
20
  _defineProperty(UnitSDK, "init", async (env, theme) => {
26
21
  try {
27
22
  UnitSDK.env = env;
@@ -32,19 +27,15 @@ _defineProperty(UnitSDK, "init", async (env, theme) => {
32
27
  console.log(e);
33
28
  }
34
29
  });
35
-
36
30
  _defineProperty(UnitSDK, "setSignedNonce", signedNonce => {
37
31
  UnitSDK.signedNonce = signedNonce;
38
32
  });
39
-
40
33
  _defineProperty(UnitSDK, "getEnv", () => {
41
34
  return UnitSDK.env;
42
35
  });
43
-
44
36
  _defineProperty(UnitSDK, "getTheme", () => {
45
37
  return UnitSDK.theme;
46
38
  });
47
-
48
39
  _defineProperty(UnitSDK, "getSignedNonce", () => {
49
40
  return UnitSDK.signedNonce;
50
41
  });
@@ -1 +1 @@
1
- {"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UNEnvironment","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","env","theme","Instance","event","IS_SDK_INITIALIZED","e","console","log","signedNonce"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage } from '../messages/nativeMessages/sdkMessage';\nimport { fetchUnitScript } from './UnitSdk.api';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nexport const UNIT_SCRIPT_URL = {\n [UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',\n [UNEnvironment.production]: 'https://ui.unit.co/components.js'\n};\nexport class UnitSDK {\n protected static env?: UNEnvironment;\n protected static theme?: string;\n protected static signedNonce?: string;\n\n public static init = async (env: UNEnvironment, theme?: string) => {\n try {\n this.env = env;\n this.theme = theme;\n await fetchUnitScript();\n EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setSignedNonce = (signedNonce: string) => {\n this.signedNonce = signedNonce;\n };\n\n public static getEnv = () => {\n return this.env;\n };\n\n public static getTheme = () => {\n return this.theme;\n };\n\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n}\n"],"mappings":";;AAAA,OAAOA,QAAP,MAAqB,qBAArB;AACA,SAASC,UAAT,QAA2B,uCAA3B;AACA,SAASC,eAAT,QAAgC,eAAhC;AAEA,WAAYC,aAAZ;;WAAYA,a;EAAAA,a;EAAAA,a;GAAAA,a,KAAAA,a;;AAKZ,OAAO,MAAMC,eAAe,GAAG;EAC7B,CAACD,aAAa,CAACE,OAAf,GAAyB,oCADI;EAE7B,CAACF,aAAa,CAACG,UAAf,GAA4B;AAFC,CAAxB;AAIP,OAAO,MAAMC,OAAN,CAAc;;gBAARA,O;;gBAAAA,O;;gBAAAA,O;;gBAAAA,O,UAKU,OAAOC,GAAP,EAA2BC,KAA3B,KAA8C;EACjE,IAAI;IANKF,OAOP,CAAKC,GAAL,GAAWA,GAAX;IAPOD,OAQP,CAAKE,KAAL,GAAaA,KAAb;IACA,MAAMP,eAAe,EAArB;IACAF,QAAQ,CAACU,QAAT,CAAkBC,KAAlB,CAAwBV,UAAU,CAACW,kBAAnC,EAAuD,EAAvD;EACD,CALD,CAKE,OAAOC,CAAP,EAAU;IACVC,OAAO,CAACC,GAAR,CAAYF,CAAZ;EACD;AACF,C;;gBAdUN,O,oBAgBqBS,WAAD,IAAyB;EAhB7CT,OAiBT,CAAKS,WAAL,GAAmBA,WAAnB;AACD,C;;gBAlBUT,O,YAoBY,MAAM;EAC3B,OArBSA,OAqBF,CAAKC,GAAZ;AACD,C;;gBAtBUD,O,cAwBc,MAAM;EAC7B,OAzBSA,OAyBF,CAAKE,KAAZ;AACD,C;;gBA1BUF,O,oBA4BoB,MAAM;EACnC,OA7BSA,OA6BF,CAAKS,WAAZ;AACD,C"}
1
+ {"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UNEnvironment","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","_defineProperty","env","theme","Instance","event","IS_SDK_INITIALIZED","e","console","log","signedNonce"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage } from '../messages/nativeMessages/sdkMessage';\nimport { fetchUnitScript } from './UnitSdk.api';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nexport const UNIT_SCRIPT_URL = {\n [UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',\n [UNEnvironment.production]: 'https://ui.unit.co/components.js'\n};\nexport class UnitSDK {\n protected static env?: UNEnvironment;\n protected static theme?: string;\n protected static signedNonce?: string;\n\n public static init = async (env: UNEnvironment, theme?: string) => {\n try {\n this.env = env;\n this.theme = theme;\n await fetchUnitScript();\n EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setSignedNonce = (signedNonce: string) => {\n this.signedNonce = signedNonce;\n };\n\n public static getEnv = () => {\n return this.env;\n };\n\n public static getTheme = () => {\n return this.theme;\n };\n\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n}\n"],"mappings":";;;AAAA,OAAOA,QAAQ,MAAM,qBAAqB;AAC1C,SAASC,UAAU,QAAQ,uCAAuC;AAClE,SAASC,eAAe,QAAQ,eAAe;AAE/C,WAAYC,aAAa;AAGxB,WAHWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAKzB,OAAO,MAAMC,eAAe,GAAG;EAC7B,CAACD,aAAa,CAACE,OAAO,GAAG,oCAAoC;EAC7D,CAACF,aAAa,CAACG,UAAU,GAAG;AAC9B,CAAC;AACD,OAAO,MAAMC,OAAO,CAAC;AA+BpBC,eAAA,CA/BYD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO,UAKG,OAAOE,GAAkB,EAAEC,KAAc,KAAK;EACjE,IAAI;IANKH,OAAO,CAOTE,GAAG,GAAGA,GAAG;IAPPF,OAAO,CAQTG,KAAK,GAAGA,KAAK;IAClB,MAAMR,eAAe,EAAE;IACvBF,QAAQ,CAACW,QAAQ,CAACC,KAAK,CAACX,UAAU,CAACY,kBAAkB,EAAE,CAAC,CAAC,CAAC;EAC5D,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;EAChB;AACF,CAAC;AAAAN,eAAA,CAdUD,OAAO,oBAgBcU,WAAmB,IAAK;EAhB7CV,OAAO,CAiBXU,WAAW,GAAGA,WAAW;AAChC,CAAC;AAAAT,eAAA,CAlBUD,OAAO,YAoBK,MAAM;EAC3B,OArBSA,OAAO,CAqBJE,GAAG;AACjB,CAAC;AAAAD,eAAA,CAtBUD,OAAO,cAwBO,MAAM;EAC7B,OAzBSA,OAAO,CAyBJG,KAAK;AACnB,CAAC;AAAAF,eAAA,CA1BUD,OAAO,oBA4Ba,MAAM;EACnC,OA7BSA,OAAO,CA6BJU,WAAW;AACzB,CAAC"}