react-native-unit-components 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/UNAppInfo/UNAppInfo.swift +5 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +50 -8
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +18 -11
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +9 -11
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +2 -23
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +12 -6
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +5 -4
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +12 -6
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -3
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +6 -6
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +28 -8
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +49 -37
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +20 -50
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +5 -53
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +6 -6
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/utils/nativeModulesInfo.js +20 -0
- package/lib/commonjs/components/utils/nativeModulesInfo.js.map +1 -0
- package/lib/commonjs/flows/UNFlows.js +19 -0
- package/lib/commonjs/flows/UNFlows.js.map +1 -0
- package/lib/commonjs/flows/card/UNCardFlows.js +33 -0
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +70 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js +22 -0
- package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js +17 -0
- package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
- package/lib/commonjs/messages/nativeMessages/cardMessage.js +2 -8
- package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/unitMessages.js +1 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/commonjs/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
- package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -0
- package/lib/commonjs/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +3 -1
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyHtml.js +4 -10
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +13 -2
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/types/internal/bottomSheet.types.js +14 -0
- package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js +27 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -0
- package/lib/commonjs/types/shared/achCredit.types.js.map +1 -0
- package/lib/commonjs/types/shared/activity.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +20 -2
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js +21 -0
- package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +6 -16
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +3 -1
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +49 -7
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +16 -10
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -7
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -21
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +10 -4
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +3 -2
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +10 -4
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +3 -2
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -2
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +23 -6
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +51 -39
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +20 -51
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +2 -48
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +2 -2
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/utils/nativeModulesInfo.js +13 -0
- package/lib/module/components/utils/nativeModulesInfo.js.map +1 -0
- package/lib/module/flows/UNFlows.js +12 -0
- package/lib/module/flows/UNFlows.js.map +1 -0
- package/lib/module/flows/card/UNCardFlows.js +25 -0
- package/lib/module/flows/card/UNCardFlows.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +63 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/startProvisioning.js +15 -0
- package/lib/module/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/messages/nativeMessages/bottomSheetMessage.js +9 -0
- package/lib/module/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
- package/lib/module/messages/nativeMessages/cardMessage.js +1 -6
- package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/nativeMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -1
- package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/checkMessage.js.map +1 -1
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/messages/webMessages/unitMessages.js +1 -0
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/module/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
- package/lib/module/networking/common/UNNetworkConstants.js.map +1 -0
- package/lib/module/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +4 -1
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -0
- package/lib/module/scripts/html/bodyHtml.js +1 -6
- package/lib/module/scripts/html/bodyHtml.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +13 -2
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/types/internal/bottomSheet.types.js +7 -0
- package/lib/module/types/internal/bottomSheet.types.js.map +1 -0
- package/lib/module/types/internal/webComponent.types.js +19 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -0
- package/lib/module/types/shared/achCredit.types.js.map +1 -0
- package/lib/module/types/shared/activity.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +20 -2
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js +14 -0
- package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +5 -14
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +3 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +2 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +4 -1
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +1 -1
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -1
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -3
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +1 -1
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +3 -3
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +0 -7
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -1
- package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.d.ts +6 -2
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +2 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +1 -9
- package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -2
- package/lib/typescript/components/utils/nativeModulesInfo.d.ts +1 -0
- package/lib/typescript/flows/UNFlows.d.ts +4 -0
- package/lib/typescript/flows/card/UNCardFlows.d.ts +3 -0
- package/lib/typescript/helpers/pushProvisioningService/hooks/useCardWallet.d.ts +7 -0
- package/lib/typescript/helpers/pushProvisioningService/startProvisioning.d.ts +2 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/messages/nativeMessages/bottomSheetMessage.d.ts +9 -0
- package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +0 -16
- package/lib/typescript/messages/nativeMessages/index.d.ts +3 -3
- package/lib/typescript/messages/webMessages/accountMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/checkMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/onLoadMessage.d.ts +3 -3
- package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -1
- package/lib/typescript/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.d.ts +1 -1
- package/lib/typescript/scripts/html/bodyHtml.d.ts +1 -5
- package/lib/typescript/scripts/html/bodyScript.d.ts +1 -0
- package/lib/typescript/types/internal/bottomSheet.types.d.ts +35 -0
- package/lib/typescript/types/internal/webComponent.types.d.ts +16 -0
- package/lib/typescript/{sharedTypes → types/shared}/achCredit.types.d.ts +1 -1
- package/lib/typescript/{sharedTypes → types/shared}/activity.types.d.ts +1 -1
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +9 -0
- package/lib/typescript/unitSdkManager/unitUiManager/unitUiManager.d.ts +6 -0
- package/lib/typescript/webComponent/WebComponent.d.ts +2 -11
- package/lib/typescript/webComponent/html.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +47 -8
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +14 -11
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -11
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -20
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +15 -8
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +4 -3
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +15 -8
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -2
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +9 -3
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +151 -76
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +24 -6
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +72 -41
- package/src/components/UNCardComponent/UNCardComponent.tsx +25 -54
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +3 -49
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -4
- package/src/components/utils/nativeModulesInfo.ts +11 -0
- package/src/flows/UNFlows.ts +13 -0
- package/src/flows/card/UNCardFlows.ts +25 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +67 -0
- package/src/helpers/pushProvisioningService/startProvisioning.ts +20 -0
- package/src/index.tsx +1 -1
- package/src/messages/nativeMessages/bottomSheetMessage.ts +15 -0
- package/src/messages/nativeMessages/cardMessage.ts +1 -24
- package/src/messages/nativeMessages/index.ts +3 -3
- package/src/messages/webMessages/accountMessage.ts +1 -1
- package/src/messages/webMessages/achCreditMessage.ts +1 -1
- package/src/messages/webMessages/bookPaymentMessage.ts +1 -1
- package/src/messages/webMessages/cardMessage.ts +1 -1
- package/src/messages/webMessages/checkMessage.ts +1 -1
- package/src/messages/webMessages/onLoadMessage.ts +3 -3
- package/src/messages/webMessages/unitMessages.ts +3 -2
- package/src/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.ts +1 -1
- package/src/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.ts +3 -1
- package/src/scripts/html/bodyHtml.ts +2 -14
- package/src/scripts/html/bodyScript.ts +13 -3
- package/src/types/internal/bottomSheet.types.ts +43 -0
- package/src/types/internal/webComponent.types.ts +26 -0
- package/src/{sharedTypes → types/shared}/achCredit.types.ts +1 -1
- package/src/{sharedTypes → types/shared}/activity.types.ts +1 -1
- package/src/unitSdkManager/UnitSdkManager.ts +28 -2
- package/src/unitSdkManager/unitUiManager/unitUiManager.ts +13 -0
- package/src/webComponent/WebComponent.tsx +7 -15
- package/src/webComponent/html.ts +3 -1
- package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
- package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
- package/lib/commonjs/sharedTypes/achCredit.types.js.map +0 -1
- package/lib/commonjs/sharedTypes/activity.types.js.map +0 -1
- package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
- package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
- package/lib/module/sharedTypes/achCredit.types.js.map +0 -1
- package/lib/module/sharedTypes/activity.types.js.map +0 -1
- /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/achCredit.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/activity.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/index.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/index.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/account.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/account.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/achCredit.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/activity.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/authorization.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/card.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/card.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/index.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/index.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/payments.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/payments.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/transactions.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/wallet.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
- /package/lib/typescript/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/account.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/authorization.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/bookPayment.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/card.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/checkDeposit.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/index.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/onLoadResponse.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/payments.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/transactions.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/wallet.types.d.ts +0 -0
- /package/src/{sharedTypes → types/shared}/account.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/authorization.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/bookPayment.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/card.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/checkDeposit.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/index.ts +0 -0
- /package/src/{sharedTypes → types/shared}/onLoadResponse.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/payments.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/transactions.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/wallet.types.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { BottomSheetNativeEvent, BottomSheetNativeMessage } from './bottomSheetMessage';\nimport type { SDKEvent, SDKMessage } from './sdkMessage';\n\nexport type NativeMessageType =\n | SDKMessage\n | BottomSheetNativeMessage\n\nexport type NativeEvent =\n | SDKEvent\n | BottomSheetNativeEvent\n\nexport interface NativeMessage {\n type: NativeMessageType,\n details?: NativeEvent\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AccountMessage"],"sources":["accountMessage.ts"],"sourcesContent":["import type { UNAccountData } from '../../
|
|
1
|
+
{"version":3,"names":["AccountMessage"],"sources":["accountMessage.ts"],"sourcesContent":["import type { UNAccountData } from '../../types/shared';\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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["achCreditMessage.ts"],"sourcesContent":["import type { UNACHData } from '../../
|
|
1
|
+
{"version":3,"names":[],"sources":["achCreditMessage.ts"],"sourcesContent":["import type { UNACHData } from '../../types/shared';\n\nexport interface PaymentCreatedEvent {\n data: UNACHData\n}\n\nexport type ACHEvent =\n| PaymentCreatedEvent\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../
|
|
1
|
+
{"version":3,"names":[],"sources":["bookPaymentMessage.ts"],"sourcesContent":["import type { UNBookPaymentData } from '../../types/shared';\n\nexport interface PaymentCreatedEvent {\n data: UNBookPaymentData\n}\n\nexport type BookPaymentEvent =\n| PaymentCreatedEvent\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../
|
|
1
|
+
{"version":3,"names":["CardMessage"],"sources":["cardMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../types/shared';\n\nexport enum CardMessage {\n CARD_ACTIVATED = 'unitCardActivated',\n CARD_STATUS_CHANGED = 'unitCardStatusChanged'\n}\n\nexport interface CardStatusChangedEvent {\n card: UNCardData;\n}\n\nexport interface CardActivatedEvent {\n card: UNCardData;\n}\n\nexport type CardEvent =\n | CardStatusChangedEvent\n | CardActivatedEvent\n"],"mappings":"AAEA,WAAYA,WAAW;AAGtB,WAHWA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckMessage"],"sources":["checkMessage.ts"],"sourcesContent":["import type { UNCheckDepositData } from '../../
|
|
1
|
+
{"version":3,"names":["CheckMessage"],"sources":["checkMessage.ts"],"sourcesContent":["import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';\n\nexport enum CheckMessage {\n // check deposit\n CHECK_DEPOSIT_CREATED = 'unitCheckDepositCreated',\n CHECK_DEPOSIT_RESTART_REQUEST = 'unitCheckDepositRestartRequest'\n}\n\nexport type CheckDepositCreatedEvent = UNCheckDepositData\nexport type CheckDepositRestartRequestEvent = UNCheckDepositData\n\nexport type CheckEvent =\n| CheckDepositCreatedEvent\n| CheckDepositRestartRequestEvent\n"],"mappings":"AAEA,WAAYA,YAAY;AAIvB,WAJWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RESPONSE_KEYS"],"sources":["onLoadMessage.ts"],"sourcesContent":["import type {UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../
|
|
1
|
+
{"version":3,"names":["RESPONSE_KEYS"],"sources":["onLoadMessage.ts"],"sourcesContent":["import type {UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../types/shared';\nimport type { UNAuthorizationData } from '../../types/shared/authorization.types';\nimport type { UNTransactionData } from '../../types/shared/transactions.types';\n\nexport enum RESPONSE_KEYS {\n errors = 'errors',\n card = 'cardResult',\n account = 'accountResult',\n counterpartyAccount = 'counterpartyResult',\n transactions = 'transactionsResult',\n authorization = 'authorizationResult'\n}\n\nexport type CardOnLoadResponse = {\n [RESPONSE_KEYS.card]: UNOnLoadResponseData<UNCardData>\n}\n\nexport type AccountOnLoadResponse = {\n [RESPONSE_KEYS.account]: UNOnLoadResponseData<UNAccountData>\n}\n\nexport type AccountsOnLoadResponse = {\n [RESPONSE_KEYS.account]: UNOnLoadResponseData<[UNAccountData]>\n}\n\nexport type ACHOnLoadResponse = {\n [RESPONSE_KEYS.account]: UNOnLoadResponseData<UNAccountData>,\n [RESPONSE_KEYS.counterpartyAccount]: UNOnLoadResponseData<[UNCounterpartyAccountData]>\n}\n\nexport type ActivityOnLoadResponse = {\n [RESPONSE_KEYS.authorization]: UNOnLoadResponseData<UNAuthorizationData>,\n [RESPONSE_KEYS.transactions]: UNOnLoadResponseData<UNTransactionData>\n}\n\nexport type UnitOnLoadResponseSuccessData =\n | CardOnLoadResponse\n | ACHOnLoadResponse\n | AccountsOnLoadResponse\n | AccountOnLoadResponse\n | ActivityOnLoadResponse\n\nexport type UnitOnLoadResponseEvent =\n | UNError\n | UnitOnLoadResponseSuccessData\n"],"mappings":"AAIA,WAAYA,aAAa;AAOxB,WAPWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}
|
|
@@ -9,5 +9,6 @@ export let UnitMessage;
|
|
|
9
9
|
UnitMessage["UNIT_PLAID_TOKEN_CREATED"] = "unitPlaidLinkTokenCreated";
|
|
10
10
|
UnitMessage["UNIT_REQUEST_EXTERNAL_SDK"] = "unitRequestExternalSdk";
|
|
11
11
|
UnitMessage["UNIT_PLAID_RESPONSE"] = "unitPlaidResponse";
|
|
12
|
+
UnitMessage["PAGE_HEIGHT"] = "PAGE_HEIGHT";
|
|
12
13
|
})(UnitMessage || (UnitMessage = {}));
|
|
13
14
|
//# sourceMappingURL=unitMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { UnitOnLoadResponseEvent } from './onLoadMessage';\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'
|
|
1
|
+
{"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { UnitOnLoadResponseEvent } from './onLoadMessage';\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 PAGE_HEIGHT = 'PAGE_HEIGHT'\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 | UnitOnLoadResponseEvent\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;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNEnvironment","APIHeaders","AUTHORIZATION","CONTENT_TYPE","UNIT_SECURE_URL","sandbox","production"],"sources":["UNNetworkConstants.ts"],"sourcesContent":["import { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';\n\nexport const APIHeaders = {\n AUTHORIZATION: 'Authorization',\n CONTENT_TYPE: 'application/vnd.api+json',\n};\n\nexport const UNIT_SECURE_URL = {\n [UNEnvironment.sandbox]: 'https://secure.api.s.unit.sh',\n [UNEnvironment.production]: 'https://secure.api.unit.co'\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qCAAqC;AAEnE,OAAO,MAAMC,UAAU,GAAG;EACxBC,aAAa,EAAE,eAAe;EAC9BC,YAAY,EAAE;AAChB,CAAC;AAED,OAAO,MAAMC,eAAe,GAAG;EAC7B,CAACJ,aAAa,CAACK,OAAO,GAAG,8BAA8B;EACvD,CAACL,aAAa,CAACM,UAAU,GAAG;AAC9B,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';
|
|
3
|
-
import { UnitSDK } from '
|
|
3
|
+
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
4
|
+
|
|
5
|
+
// TODO: use apiClient class for handling requests.
|
|
6
|
+
|
|
4
7
|
export const getMobileWalletPayload = async (customerToken, cardId, env) => {
|
|
5
8
|
const headers = {
|
|
6
9
|
'Content-Type': APIHeaders.CONTENT_TYPE,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["axios","APIHeaders","UNIT_SECURE_URL","UnitSDK","getMobileWalletPayload","customerToken","cardId","env","headers","CONTENT_TYPE","data","attributes","signedNonce","getSignedNonce","baseURL","response","post","encryptedPayload","payload","error","Promise","reject"],"sources":["UNWalletPayloadRequest.ts"],"sourcesContent":["import axios from 'axios';\nimport { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';\nimport { UnitSDK, UNEnvironment } from '../../unitSdkManager/UnitSdkManager';\n\n// TODO: use apiClient class for handling requests.\n\nexport const getMobileWalletPayload = async (customerToken: string, cardId: string, env: UNEnvironment) => {\n const headers = {\n 'Content-Type': APIHeaders.CONTENT_TYPE,\n 'Authorization': `Bearer ${customerToken}`,\n };\n\n const data = {\n data: {\n attributes: {\n signedNonce: UnitSDK.getSignedNonce(),\n },\n },\n };\n\n const baseURL = `${UNIT_SECURE_URL[env as keyof typeof UNEnvironment]}/cards/${cardId}/mobile-wallet-payload`;\n try {\n const response = await axios.post(\n baseURL,\n data,\n {\n headers: headers,\n });\n const encryptedPayload = response.data.data.attributes.payload;\n return encryptedPayload;\n } catch (error) {\n return Promise.reject(error);\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,eAAe,QAAQ,8BAA8B;AAC1E,SAASC,OAAO,QAAuB,qCAAqC;;AAE5E;;AAEA,OAAO,MAAMC,sBAAsB,GAAG,MAAAA,CAAOC,aAAqB,EAAEC,MAAc,EAAEC,GAAkB,KAAK;EACzG,MAAMC,OAAO,GAAG;IACd,cAAc,EAAEP,UAAU,CAACQ,YAAY;IACvC,eAAe,EAAG,UAASJ,aAAc;EAC3C,CAAC;EAED,MAAMK,IAAI,GAAG;IACXA,IAAI,EAAE;MACJC,UAAU,EAAE;QACVC,WAAW,EAAET,OAAO,CAACU,cAAc;MACrC;IACF;EACF,CAAC;EAED,MAAMC,OAAO,GAAI,GAAEZ,eAAe,CAACK,GAAG,CAAgC,UAASD,MAAO,wBAAuB;EAC7G,IAAI;IACF,MAAMS,QAAQ,GAAG,MAAMf,KAAK,CAACgB,IAAI,CAC/BF,OAAO,EACPJ,IAAI,EACJ;MACEF,OAAO,EAAEA;IACX,CAAC,CAAC;IACJ,MAAMS,gBAAgB,GAAGF,QAAQ,CAACL,IAAI,CAACA,IAAI,CAACC,UAAU,CAACO,OAAO;IAC9D,OAAOD,gBAAgB;EACzB,CAAC,CAAC,OAAOE,KAAK,EAAE;IACd,OAAOC,OAAO,CAACC,MAAM,CAACF,KAAK,CAAC;EAC9B;AACF,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
+
import { PresentationMode } from '../../types/internal/webComponent.types';
|
|
1
2
|
export const webViewId = 'webViewContainer';
|
|
2
|
-
export let PresentationMode;
|
|
3
|
-
(function (PresentationMode) {
|
|
4
|
-
PresentationMode["CoverInjectedHeight"] = "coverInjectedHeight";
|
|
5
|
-
PresentationMode["Inherit"] = "inherit";
|
|
6
|
-
PresentationMode["Default"] = "deafult";
|
|
7
|
-
})(PresentationMode || (PresentationMode = {}));
|
|
8
3
|
export const getHtmlBody = (unitComponent, unitComponentProps, presentationMode) => {
|
|
9
4
|
const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
|
|
10
5
|
switch (presentationMode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["PresentationMode","webViewId","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["import { PresentationMode } from '../../types/internal/webComponent.types';\n\nexport const webViewId = 'webViewContainer';\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,SAASA,gBAAgB,QAAQ,yCAAyC;AAE1E,OAAO,MAAMC,SAAS,GAAG,kBAAkB;AAE3C,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,KAAKL,gBAAgB,CAACO,mBAAmB;MACvC,OAAOC,gCAAgC,CAACF,gBAAgB,CAAC;IAC3D,KAAKN,gBAAgB,CAACS,OAAO;MAC3B,OAAOC,0BAA0B,CAACJ,gBAAgB,CAAC;IACrD;MACE,OAAOA,gBAAgB;EAAC;AAE9B,CAAC;AAED,MAAME,gCAAgC,GAAIG,iBAAyB,IAAK;EACtE,OAAQ;AACV,cAAcV,SAAU;AACxB;AACA,UAAUU,iBAAkB;AAC5B;AACA;AACA,GAAG;AACH,CAAC;AAED,MAAMD,0BAA0B,GAAIC,iBAAyB,IAAK;EAChE,OAAQ;AACV;AACA,QAAQA,iBAAkB;AAC1B;AACA,GAAG;AACH,CAAC"}
|
|
@@ -81,7 +81,7 @@ export const LISTENERS = {
|
|
|
81
81
|
window.addEventListener("${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", (e) => {
|
|
82
82
|
postMessageToSDK({ type: "${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", details: e.detail })
|
|
83
83
|
});
|
|
84
|
-
`,
|
|
84
|
+
`,
|
|
85
85
|
unitPaymentCreated: `
|
|
86
86
|
window.addEventListener("${PaymentMessage.PAYMENT_CREATED}", (e) => {
|
|
87
87
|
const response = e.detail
|
|
@@ -90,7 +90,18 @@ export const LISTENERS = {
|
|
|
90
90
|
}).catch((e) => {
|
|
91
91
|
console.log(e)
|
|
92
92
|
})
|
|
93
|
-
})
|
|
93
|
+
});
|
|
94
|
+
`,
|
|
95
|
+
unitPlaidTokenCreated: `
|
|
96
|
+
window.addEventListener("${UnitMessage.UNIT_PLAID_TOKEN_CREATED}", (e) => {
|
|
97
|
+
const response = e.detail
|
|
98
|
+
response.then((data) => {
|
|
99
|
+
postMessageToSDK({ type: "${UnitMessage.UNIT_PLAID_TOKEN_CREATED}", details: { linkToken: data.data }})
|
|
100
|
+
}).catch((e) => {
|
|
101
|
+
console.log(e)
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
`,
|
|
94
105
|
unitAccountChanged: `
|
|
95
106
|
window.addEventListener("${AccountMessage.UNIT_ACCOUNT_CHANGED}", (e) => {
|
|
96
107
|
const response = e.detail
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PaymentMessage","CardMessage","PageMessage","UnitMessage","AccountMessage","ActivityMessage","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","cardActivated","CARD_ACTIVATED","cardStatusChange","CARD_STATUS_CHANGED","unitRequestExternalSdk","UNIT_REQUEST_EXTERNAL_SDK","unitPaymentCreated","PAYMENT_CREATED","unitAccountChanged","UNIT_ACCOUNT_CHANGED","unitActivityFiltersChanged","UNIT_ACTIVITY_FILTERS_CHANGED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","DISPATCH_PLAID_RESPONSE","UNIT_PLAID_RESPONSE","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_REQUEST_ACCOUNT_ACTION"],"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';\nimport { ActivityMessage } from '../../messages/webMessages/activityMessage';\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 cardActivated: `\n window.addEventListener(\"${CardMessage.CARD_ACTIVATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_ACTIVATED}\", details: { card: data.data }})\n }).catch((e) => {\n console.log(e)\n })\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 })
|
|
1
|
+
{"version":3,"names":["PaymentMessage","CardMessage","PageMessage","UnitMessage","AccountMessage","ActivityMessage","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","cardActivated","CARD_ACTIVATED","cardStatusChange","CARD_STATUS_CHANGED","unitRequestExternalSdk","UNIT_REQUEST_EXTERNAL_SDK","unitPaymentCreated","PAYMENT_CREATED","unitPlaidTokenCreated","UNIT_PLAID_TOKEN_CREATED","unitAccountChanged","UNIT_ACCOUNT_CHANGED","unitActivityFiltersChanged","UNIT_ACTIVITY_FILTERS_CHANGED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","DISPATCH_PLAID_RESPONSE","UNIT_PLAID_RESPONSE","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_REQUEST_ACCOUNT_ACTION"],"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';\nimport { ActivityMessage } from '../../messages/webMessages/activityMessage';\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 cardActivated: `\n window.addEventListener(\"${CardMessage.CARD_ACTIVATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_ACTIVATED}\", details: { card: data.data }})\n }).catch((e) => {\n console.log(e)\n })\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 unitPlaidTokenCreated: `\n window.addEventListener(\"${UnitMessage.UNIT_PLAID_TOKEN_CREATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_PLAID_TOKEN_CREATED}\", details: { linkToken: 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 unitActivityFiltersChanged: `\n window.addEventListener(\"${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}\", (e) => {\n postMessageToSDK({ type: \"${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}\", details: e.detail })\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_ACTIVITY_FILTER_CHANGED_EVENT = `\n const dispatchActivityFilterChangedEvent = (details) => {\n const event = new CustomEvent(\"${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}\",{ detail: 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\nexport const DISPATCH_OPEN_ACTIONS_MENU = `\n const dispatchOpenActionsMenu = (componentName) => {\n document.querySelector(componentName).dispatchEvent(new CustomEvent(\"unitRequestOpenActionsMenu\"))\n }\n`;\n\nexport const DISPATCH_REQUEST_CARD_ACTION = `\n const dispatchRequestCardAction = (action) => {\n document.querySelector(\"unit-elements-card\").dispatchEvent(new CustomEvent(\"unitRequestCardAction\", {detail: {action: action}}))\n }\n`;\n\nexport const DISPATCH_REQUEST_ACCOUNT_ACTION = `\n const dispatchRequestAccountAction = (action) => {\n document.querySelector(\"unit-elements-account\").dispatchEvent(new CustomEvent(\"unitRequestAccountAction\", {detail: {action: action}}))\n }\n`;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,4CAA4C;AAC3E,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,WAAW,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AAMC,4BAA4B,GAAI;AAC7C;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,+BAA+B,GAAI;AAChD;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export let BottomSheetRenderingType;
|
|
2
|
+
(function (BottomSheetRenderingType) {
|
|
3
|
+
BottomSheetRenderingType[BottomSheetRenderingType["Slot"] = 0] = "Slot";
|
|
4
|
+
BottomSheetRenderingType[BottomSheetRenderingType["WebComponent"] = 1] = "WebComponent";
|
|
5
|
+
BottomSheetRenderingType[BottomSheetRenderingType["NativeComponent"] = 2] = "NativeComponent";
|
|
6
|
+
})(BottomSheetRenderingType || (BottomSheetRenderingType = {}));
|
|
7
|
+
//# sourceMappingURL=bottomSheet.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BottomSheetRenderingType"],"sources":["bottomSheet.types.ts"],"sourcesContent":["import type { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';\nimport type { PresentationMode, WebComponentType } from './webComponent.types';\n\nexport enum BottomSheetRenderingType {\n Slot,\n WebComponent,\n NativeComponent\n}\n\nexport type BottomSheetSlotData = {\n // The data that rendered by the web view\n componentName?: WebComponentType,\n componentResourceId?: string,\n requestRenderingEvent: RequestRenderingEvent\n}\n\nexport type WebComponentData = {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n windowParams?: string;\n}\n\nexport type NativeComponentData = {\n component: React.ReactNode,\n}\n\nexport interface SlotRendering {\n type: BottomSheetRenderingType.Slot,\n data: BottomSheetSlotData\n}\n\nexport interface WebComponentRendering {\n type: BottomSheetRenderingType.WebComponent,\n data: WebComponentData\n}\n\nexport interface NativeComponentRendering {\n type: BottomSheetRenderingType.NativeComponent,\n data: NativeComponentData\n}\n"],"mappings":"AAGA,WAAYA,wBAAwB;AAInC,WAJWA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;EAAxBA,wBAAwB,CAAxBA,wBAAwB;AAAA,GAAxBA,wBAAwB,KAAxBA,wBAAwB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export let WebComponentType;
|
|
2
|
+
(function (WebComponentType) {
|
|
3
|
+
WebComponentType["card"] = "unit-elements-card";
|
|
4
|
+
WebComponentType["bookPayment"] = "unit-elements-book-payment";
|
|
5
|
+
WebComponentType["activity"] = "unit-elements-activity";
|
|
6
|
+
WebComponentType["slot"] = "unit-elements-sdk-slot";
|
|
7
|
+
WebComponentType["account"] = "unit-elements-account";
|
|
8
|
+
WebComponentType["checkDeposit"] = "unit-elements-check-deposit";
|
|
9
|
+
WebComponentType["achDebitPayment"] = "unit-elements-ach-debit-payment";
|
|
10
|
+
WebComponentType["achCreditPayment"] = "unit-elements-ach-credit-payment";
|
|
11
|
+
WebComponentType["cardAction"] = "unit-elements-card-action";
|
|
12
|
+
})(WebComponentType || (WebComponentType = {}));
|
|
13
|
+
export let PresentationMode;
|
|
14
|
+
(function (PresentationMode) {
|
|
15
|
+
PresentationMode["CoverInjectedHeight"] = "coverInjectedHeight";
|
|
16
|
+
PresentationMode["Inherit"] = "inherit";
|
|
17
|
+
PresentationMode["Default"] = "deafult";
|
|
18
|
+
})(PresentationMode || (PresentationMode = {}));
|
|
19
|
+
//# sourceMappingURL=webComponent.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebComponentType","PresentationMode"],"sources":["webComponent.types.ts"],"sourcesContent":["export enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n checkDeposit = 'unit-elements-check-deposit',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment',\n\n cardAction = 'unit-elements-card-action',\n}\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"],"mappings":"AAAA,WAAYA,gBAAgB;AAW3B,WAXWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAa5B,WAAYC,gBAAgB;AAY3B,WAZWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type { UNAccountData, UNCounterpartyAccountData } from './account.types';\nimport type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';\nimport type { UNTags, UNRelationship } from './types';\n\nexport type UNACHOnLoadData = {\n [RESPONSE_KEYS.account]: UNAccountData,\n [RESPONSE_KEYS.counterpartyAccount]: [UNCounterpartyAccountData]\n}\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":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["activity.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type { UNAuthorizationData } from './authorization.types';\nimport type { UNTransactionData } from './transactions.types';\n\nexport type UNActivityOnLoadData = {\n [RESPONSE_KEYS.authorization]: UNAuthorizationData,\n [RESPONSE_KEYS.transactions]: UNTransactionData,\n}\n"],"mappings":""}
|
|
@@ -4,31 +4,43 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
4
4
|
import EventBus from '../helpers/EventBus';
|
|
5
5
|
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
6
6
|
import { fetchUnitScript } from './UnitSdk.api';
|
|
7
|
+
import { UnitUiManager } from './unitUiManager/unitUiManager';
|
|
7
8
|
export let UNEnvironment;
|
|
8
9
|
(function (UNEnvironment) {
|
|
9
10
|
UNEnvironment["sandbox"] = "sandbox";
|
|
10
11
|
UNEnvironment["production"] = "production";
|
|
11
12
|
})(UNEnvironment || (UNEnvironment = {}));
|
|
13
|
+
const UNIT_WEB_VERSION = '1';
|
|
12
14
|
export const UNIT_SCRIPT_URL = {
|
|
13
|
-
[UNEnvironment.sandbox]:
|
|
14
|
-
[UNEnvironment.production]:
|
|
15
|
+
[UNEnvironment.sandbox]: `https://ui.s.unit.sh/release/${UNIT_WEB_VERSION}/components.js`,
|
|
16
|
+
[UNEnvironment.production]: `https://ui.unit.co/release/${UNIT_WEB_VERSION}/components.js`
|
|
15
17
|
};
|
|
16
18
|
export class UnitSDK {}
|
|
17
19
|
_defineProperty(UnitSDK, "env", void 0);
|
|
20
|
+
_defineProperty(UnitSDK, "customerToken", void 0);
|
|
18
21
|
_defineProperty(UnitSDK, "theme", void 0);
|
|
19
22
|
_defineProperty(UnitSDK, "language", void 0);
|
|
20
23
|
_defineProperty(UnitSDK, "signedNonce", void 0);
|
|
24
|
+
_defineProperty(UnitSDK, "pushProvisionModule", void 0);
|
|
25
|
+
_defineProperty(UnitSDK, "ui", void 0);
|
|
21
26
|
_defineProperty(UnitSDK, "init", async (env, theme, language) => {
|
|
22
27
|
try {
|
|
23
28
|
UnitSDK.env = env;
|
|
24
29
|
UnitSDK.theme = theme;
|
|
25
30
|
UnitSDK.language = language;
|
|
31
|
+
UnitSDK.ui = new UnitUiManager();
|
|
26
32
|
await fetchUnitScript();
|
|
27
33
|
EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});
|
|
28
34
|
} catch (e) {
|
|
29
35
|
console.log(e);
|
|
30
36
|
}
|
|
31
37
|
});
|
|
38
|
+
_defineProperty(UnitSDK, "setPushProvisioningModule", pushProvisionModule => {
|
|
39
|
+
UnitSDK.pushProvisionModule = pushProvisionModule;
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(UnitSDK, "getPushProvisionModule", () => {
|
|
42
|
+
return UnitSDK.pushProvisionModule;
|
|
43
|
+
});
|
|
32
44
|
_defineProperty(UnitSDK, "setSignedNonce", signedNonce => {
|
|
33
45
|
UnitSDK.signedNonce = signedNonce;
|
|
34
46
|
});
|
|
@@ -44,4 +56,10 @@ _defineProperty(UnitSDK, "getLanguage", () => {
|
|
|
44
56
|
_defineProperty(UnitSDK, "getSignedNonce", () => {
|
|
45
57
|
return UnitSDK.signedNonce;
|
|
46
58
|
});
|
|
59
|
+
_defineProperty(UnitSDK, "setCustomerToken", customerToken => {
|
|
60
|
+
UnitSDK.customerToken = customerToken;
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(UnitSDK, "getCustomerToken", () => {
|
|
63
|
+
return UnitSDK.customerToken;
|
|
64
|
+
});
|
|
47
65
|
//# sourceMappingURL=UnitSdkManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UNEnvironment","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","_defineProperty","env","theme","language","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]:
|
|
1
|
+
{"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UnitUiManager","UNEnvironment","UNIT_WEB_VERSION","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","_defineProperty","env","theme","language","ui","Instance","event","IS_SDK_INITIALIZED","e","console","log","pushProvisionModule","signedNonce","customerToken"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import type { NativeModules } from 'react-native';\nimport EventBus from '../helpers/EventBus';\nimport { SDKMessage } from '../messages/nativeMessages/sdkMessage';\nimport { fetchUnitScript } from './UnitSdk.api';\nimport { UnitUiManager } from './unitUiManager/unitUiManager';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nconst UNIT_WEB_VERSION = '1';\n\nexport const UNIT_SCRIPT_URL = {\n [UNEnvironment.sandbox]: `https://ui.s.unit.sh/release/${UNIT_WEB_VERSION}/components.js`,\n [UNEnvironment.production]: `https://ui.unit.co/release/${UNIT_WEB_VERSION}/components.js`\n};\nexport class UnitSDK {\n protected static env?: UNEnvironment;\n protected static customerToken?: string;\n protected static theme?: string;\n protected static language?: string;\n\n protected static signedNonce?: string;\n protected static pushProvisionModule?: typeof NativeModules;\n\n public static ui: UnitUiManager;\n\n public static init = async (env: UNEnvironment, theme?: string, language?: string) => {\n try {\n this.env = env;\n this.theme = theme;\n this.language = language;\n this.ui = new UnitUiManager();\n await fetchUnitScript();\n EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setPushProvisioningModule = (pushProvisionModule: typeof NativeModules) => {\n this.pushProvisionModule = pushProvisionModule;\n };\n\n public static getPushProvisionModule = () => {\n return this.pushProvisionModule;\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 getLanguage = () => {\n return this.language;\n };\n\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n\n public static setCustomerToken = (customerToken: string) => {\n this.customerToken = customerToken;\n };\n\n public static getCustomerToken = () => {\n return this.customerToken;\n };\n}\n"],"mappings":";;;AACA,OAAOA,QAAQ,MAAM,qBAAqB;AAC1C,SAASC,UAAU,QAAQ,uCAAuC;AAClE,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,aAAa,QAAQ,+BAA+B;AAE7D,WAAYC,aAAa;AAGxB,WAHWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAKzB,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,OAAO,MAAMC,eAAe,GAAG;EAC7B,CAACF,aAAa,CAACG,OAAO,GAAI,gCAA+BF,gBAAiB,gBAAe;EACzF,CAACD,aAAa,CAACI,UAAU,GAAI,8BAA6BH,gBAAiB;AAC7E,CAAC;AACD,OAAO,MAAMI,OAAO,CAAC;AA2DpBC,eAAA,CA3DYD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO,UAWG,OAAOE,GAAkB,EAAEC,KAAc,EAAEC,QAAiB,KAAK;EACpF,IAAI;IAZKJ,OAAO,CAaTE,GAAG,GAAGA,GAAG;IAbPF,OAAO,CAcTG,KAAK,G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
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); }
|
|
4
|
+
import { UNFlows } from '../../flows/UNFlows';
|
|
5
|
+
export class UnitUiManager {
|
|
6
|
+
constructor() {
|
|
7
|
+
_defineProperty(this, "flows", new UNFlows());
|
|
8
|
+
_defineProperty(this, "init", () => {
|
|
9
|
+
this.flows = new UNFlows();
|
|
10
|
+
});
|
|
11
|
+
this.init();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=unitUiManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNFlows","UnitUiManager","constructor","_defineProperty","flows","init"],"sources":["unitUiManager.ts"],"sourcesContent":["import { UNFlows } from '../../flows/UNFlows';\n\nexport class UnitUiManager {\n public flows: UNFlows = new UNFlows();\n\n constructor() {\n this.init();\n }\n\n private init = () => {\n this.flows = new UNFlows();\n };\n}\n"],"mappings":";;;AAAA,SAASA,OAAO,QAAQ,qBAAqB;AAE7C,OAAO,MAAMC,aAAa,CAAC;EAGzBC,WAAWA,CAAA,EAAG;IAAAC,eAAA,gBAFU,IAAIH,OAAO,EAAE;IAAAG,eAAA,eAMtB,MAAM;MACnB,IAAI,CAACC,KAAK,GAAG,IAAIJ,OAAO,EAAE;IAC5B,CAAC;IALC,IAAI,CAACK,IAAI,EAAE;EACb;AAKF"}
|
|
@@ -14,17 +14,6 @@ import { handleRequestDownload } from './WebComponent.utils';
|
|
|
14
14
|
const {
|
|
15
15
|
UNAppInfo
|
|
16
16
|
} = NativeModules;
|
|
17
|
-
export let WebComponentType;
|
|
18
|
-
(function (WebComponentType) {
|
|
19
|
-
WebComponentType["card"] = "unit-elements-card";
|
|
20
|
-
WebComponentType["bookPayment"] = "unit-elements-book-payment";
|
|
21
|
-
WebComponentType["activity"] = "unit-elements-activity";
|
|
22
|
-
WebComponentType["slot"] = "unit-elements-sdk-slot";
|
|
23
|
-
WebComponentType["account"] = "unit-elements-account";
|
|
24
|
-
WebComponentType["checkDeposit"] = "unit-elements-check-deposit";
|
|
25
|
-
WebComponentType["achDebitPayment"] = "unit-elements-ach-debit-payment";
|
|
26
|
-
WebComponentType["achCreditPayment"] = "unit-elements-ach-credit-payment";
|
|
27
|
-
})(WebComponentType || (WebComponentType = {}));
|
|
28
17
|
export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(props, webRef) {
|
|
29
18
|
const [unitScript, setUnitScript] = useState(globalUnitScript);
|
|
30
19
|
const [sourceHtml, setSourceHtml] = useState(null);
|
|
@@ -75,8 +64,9 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
75
64
|
const componentParams = (props.params || '') + themeParam + languageParam;
|
|
76
65
|
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));
|
|
77
66
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');
|
|
67
|
+
newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, props.windowParams || '');
|
|
78
68
|
setSourceHtml(newHtml);
|
|
79
|
-
}, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script]);
|
|
69
|
+
}, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script, props.windowParams]);
|
|
80
70
|
const onMessage = e => {
|
|
81
71
|
const message = JSON.parse(e.nativeEvent.data);
|
|
82
72
|
switch (message.type) {
|
|
@@ -85,7 +75,7 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
85
75
|
break;
|
|
86
76
|
case UnitMessage.UNIT_REQUEST_DOWNLOAD:
|
|
87
77
|
message.details && handleRequestDownload(message.details, () => {
|
|
88
|
-
EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);
|
|
78
|
+
EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW, {});
|
|
89
79
|
});
|
|
90
80
|
break;
|
|
91
81
|
default:
|
|
@@ -116,7 +106,8 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
116
106
|
style: {
|
|
117
107
|
width: width,
|
|
118
108
|
flex: 1,
|
|
119
|
-
opacity: 0.99
|
|
109
|
+
opacity: 0.99,
|
|
110
|
+
backgroundColor: 'transparent'
|
|
120
111
|
},
|
|
121
112
|
source: {
|
|
122
113
|
html: sourceHtml,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","NativeModules","Platform","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","UNAppInfo","WebComponentType","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","componentCurrentLanguage","setComponentCurrentLanguage","language","getLanguage","baseName","setBaseName","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","getAppName","OS","name","getBundleName","replace","error","console","themeParam","languageParam","componentParams","params","newHtml","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","opacity","source","baseUrl","androidHardwareAccelerationDisabled"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { NativeModules, Platform } from 'react-native';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\n\nconst { UNAppInfo } = NativeModules;\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n}\n\nexport enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n checkDeposit = 'unit-elements-check-deposit',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment'\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const [componentCurrentLanguage, setComponentCurrentLanguage] = useState<string | undefined>(props.language ?? UnitSDK.getLanguage());\n const [baseName, setBaseName] = useState<string>();\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await UNAppInfo.getBundleName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n getAppName();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: width, flex: 1, opacity: 0.99 }}\n source={{ html: sourceHtml, baseUrl: `https://${baseName}` }}\n onMessage={onMessage}\n androidHardwareAccelerationDisabled\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ,QAAQ;AAC/C,SAA8BC,WAAW,QAA8B,sCAAsC;AAC7G,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,WAAW,QAA0B,0BAA0B;AACxE,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,+BAA+B;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,qBAAqB,QAAQ,sBAAsB;AAE5D,MAAM;EAAEC;AAAU,CAA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AACxE,OAAO;IACNyE,GAAG,EAAExD,MAAO;IACZyD,eAAe,EAAE,CAAC,GAAG,CAAE;IACvBC,+BAA+B,EAAE,KAAM;IACvCC,yBAAyB,EAAE,IAAK;IAChCC,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAE9D,KAAK,CAAC+D,YAAa;IAClCC,mBAAmB,EAAEhE,KAAK,CAACgE,mBAAoB;IAC/CC,QAAQ,EAAEX,SAAU;IACpBY,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAEjE,UAAW;IAC/BkE,KAAK,EAAE;MAAEpD,KAAK,EAAEA,KAAK;MAAEqD,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAK,CAAE;IAChDC,MAAM,EAAE;MAAErF,IAAI,EAAEkB,UAAU;MAAEoE,OAAO,EAAG,WAAU1D,QAAS;IAAE,CAAE;IAC7D4B,SAAS,EAAEA,SAAU;IACrB+B,mCAAmC;EAAA,EACnC;AAEN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","NativeModules","Platform","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","UNAppInfo","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","componentCurrentLanguage","setComponentCurrentLanguage","language","getLanguage","baseName","setBaseName","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","getAppName","OS","name","getBundleName","replace","error","console","themeParam","languageParam","componentParams","params","newHtml","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","WINDOW_PARAMS","windowParams","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","opacity","backgroundColor","source","baseUrl","androidHardwareAccelerationDisabled"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { NativeModules, Platform } from 'react-native';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\nimport type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';\n\nconst { UNAppInfo } = NativeModules;\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n windowParams?: string;\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const [componentCurrentLanguage, setComponentCurrentLanguage] = useState<string | undefined>(props.language ?? UnitSDK.getLanguage());\n const [baseName, setBaseName] = useState<string>();\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await UNAppInfo.getBundleName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n getAppName();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, props.windowParams || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script, props.windowParams]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW, {});\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: width, flex: 1, opacity: 0.99, backgroundColor: 'transparent' }}\n source={{ html: sourceHtml, baseUrl: `https://${baseName}` }}\n onMessage={onMessage}\n androidHardwareAccelerationDisabled\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ,QAAQ;AAC/C,SAA8BC,WAAW,QAA8B,sCAAsC;AAC7G,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,WAAW,QAAQ,0BAA0B;AACtD,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,+BAA+B;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,qBAAqB,QAAQ,sBAAsB;AAG5D,MAAM;EAAEC;AAAU,CAAC,GAAGd,aAAa;AAiBnC,OAAO,MAAMe,YAAY,gBAAGlB,KAAK,CAACmB,UAAU,CAA6B,SA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Y,EAAE,KAAM;IACpBC,aAAa,EAAEhE,KAAK,CAACiE,YAAa;IAClCC,mBAAmB,EAAElE,KAAK,CAACkE,mBAAoB;IAC/CC,QAAQ,EAAEX,SAAU;IACpBY,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAEnE,UAAW;IAC/BoE,KAAK,EAAE;MAAEtD,KAAK,EAAEA,KAAK;MAAEuD,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE,IAAI;MAAEC,eAAe,EAAE;IAAc,CAAE;IAChFC,MAAM,EAAE;MAAEvF,IAAI,EAAEiB,UAAU;MAAEuE,OAAO,EAAG,WAAU7D,QAAS;IAAE,CAAE;IAC7D8B,SAAS,EAAEA,SAAU;IACrBgC,mCAAmC;EAAA,EACnC;AAEN,CAAC,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEI
|
|
|
3
3
|
export const HTML_PLACEHOLDER = {
|
|
4
4
|
SCRIPT_UNIT: '<SCRIPT_UNIT>',
|
|
5
5
|
BODY: '<BODY_HTML_CODE>',
|
|
6
|
-
SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'
|
|
6
|
+
SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>',
|
|
7
|
+
WINDOW_PARAMS: '<WINDOW_PARAMS>'
|
|
7
8
|
};
|
|
8
9
|
const htmlText = `
|
|
9
10
|
<!DOCTYPE html>
|
|
@@ -17,6 +18,7 @@ const htmlText = `
|
|
|
17
18
|
os: "${Platform.OS}",
|
|
18
19
|
walletName: "${Platform.OS === 'ios' ? 'Apple' : 'Google'}",
|
|
19
20
|
}
|
|
21
|
+
${HTML_PLACEHOLDER.WINDOW_PARAMS}
|
|
20
22
|
</script>
|
|
21
23
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
|
22
24
|
</head>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_ACCOUNT_ACTION","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardActivated","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","unitActivityFiltersChanged"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT, DISPATCH_REQUEST_CARD_ACTION, DISPATCH_OPEN_ACTIONS_MENU, DISPATCH_REQUEST_ACCOUNT_ACTION, DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n </head>\n\n <body style=\"margin: 0;\">\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardActivated}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${LISTENERS.unitAccountChanged}\n\n ${LISTENERS.unitActivityFiltersChanged}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${DISPATCH_OPEN_ACTIONS_MENU}\n\n ${DISPATCH_REQUEST_CARD_ACTION}\n\n ${DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}\n\n ${DISPATCH_REQUEST_ACCOUNT_ACTION}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n </html>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,4BAA4B,EAAEC,0BAA0B,EAAEC,+BAA+B,EAAEC,sCAAsC,QAAQ,4BAA4B;AAE1P,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE;
|
|
1
|
+
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_ACCOUNT_ACTION","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","WINDOW_PARAMS","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardActivated","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","unitActivityFiltersChanged"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT, DISPATCH_REQUEST_CARD_ACTION, DISPATCH_OPEN_ACTIONS_MENU, DISPATCH_REQUEST_ACCOUNT_ACTION, DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>',\n WINDOW_PARAMS: '<WINDOW_PARAMS>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n ${HTML_PLACEHOLDER.WINDOW_PARAMS}\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n </head>\n\n <body style=\"margin: 0;\">\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardActivated}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${LISTENERS.unitAccountChanged}\n\n ${LISTENERS.unitActivityFiltersChanged}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${DISPATCH_OPEN_ACTIONS_MENU}\n\n ${DISPATCH_REQUEST_CARD_ACTION}\n\n ${DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}\n\n ${DISPATCH_REQUEST_ACCOUNT_ACTION}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n </html>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,gBAAgB,EAAEC,4BAA4B,EAAEC,0BAA0B,EAAEC,+BAA+B,EAAEC,sCAAsC,QAAQ,4BAA4B;AAE1P,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE,sBAAsB;EAC1CC,aAAa,EAAE;AACjB,CAAC;AAED,MAAMC,QAAQ,GAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAad,QAAQ,CAACe,EAAG;AACzB,qBAAqBf,QAAQ,CAACe,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAS;AAChE;AACA,MAAMN,gBAAgB,CAACI,aAAc;AACrC;AACA;AACA;AACA;AACA;AACA,MAAMJ,gBAAgB,CAACE,IAAK;AAC5B;AACA;AACA,QAAQR,mBAAoB;AAC5B;AACA,QAAQC,gBAAiB;AACzB;AACA,QAAQF,SAAS,CAACc,YAAa;AAC/B;AACA,QAAQd,SAAS,CAACe,MAAO;AACzB;AACA,QAAQf,SAAS,CAACgB,mBAAoB;AACtC;AACA,QAAQhB,SAAS,CAACiB,gBAAiB;AACnC;AACA,QAAQjB,SAAS,CAACkB,eAAgB;AAClC;AACA,QAAQlB,SAAS,CAACmB,gBAAiB;AACnC;AACA,QAAQnB,SAAS,CAACoB,aAAc;AAChC;AACA,QAAQpB,SAAS,CAACqB,gBAAiB;AACnC;AACA,QAAQrB,SAAS,CAACsB,sBAAuB;AACzC;AACA,QAAQtB,SAAS,CAACuB,kBAAmB;AACrC;AACA,QAAQvB,SAAS,CAACwB,0BAA2B;AAC7C;AACA,QAAQzB,wBAAyB;AACjC;AACA,QAAQK,0BAA2B;AACnC;AACA,QAAQD,4BAA6B;AACrC;AACA,QAAQG,sCAAuC;AAC/C;AACA,QAAQD,+BAAgC;AACxC;AACA,QAAQE,gBAAgB,CAACG,kBAAmB;AAC5C;AACA;AACA;AACA,CAAC;AAED,eAAeE,QAAQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UNOnLoadResponse, UNACHData, UNACHOnLoadData } from '../../
|
|
1
|
+
import type { UNOnLoadResponse, UNACHData, UNACHOnLoadData } from '../../types/shared';
|
|
2
2
|
export interface UNACHCreditComponentProps {
|
|
3
3
|
accountId: string;
|
|
4
4
|
customerToken: string;
|
|
@@ -6,6 +6,7 @@ export interface UNACHCreditComponentProps {
|
|
|
6
6
|
language?: string;
|
|
7
7
|
isAutoFocus?: boolean;
|
|
8
8
|
fee?: number;
|
|
9
|
+
withPlaid?: boolean;
|
|
9
10
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
10
11
|
onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
|
|
11
12
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { UNACHCreditComponentProps } from './UNACHCreditComponent';
|
|
2
|
+
import type WebView from 'react-native-webview';
|
|
3
|
+
import type { LinkSuccess } from 'react-native-plaid-link-sdk';
|
|
2
4
|
export declare const getACHCreditParams: (props: UNACHCreditComponentProps) => string;
|
|
3
|
-
export declare const getACHCreditScript: () => string;
|
|
5
|
+
export declare const getACHCreditScript: (appPackageName?: string) => string;
|
|
6
|
+
export declare const injectUnitPlaidResponse: (currentWeb: WebView | null, success: LinkSuccess) => void;
|
|
@@ -2,6 +2,5 @@ import type { UNACHDebitComponentProps } from './UNACHDebitComponent';
|
|
|
2
2
|
import type WebView from 'react-native-webview';
|
|
3
3
|
import type { LinkSuccess } from 'react-native-plaid-link-sdk';
|
|
4
4
|
export declare const getACHDebitParams: (props: UNACHDebitComponentProps) => string;
|
|
5
|
-
export declare const getAndroidPackageName: () => Promise<any>;
|
|
6
5
|
export declare const getACHDebitScript: (androidPackageName?: string) => string;
|
|
7
6
|
export declare const injectUnitPlaidResponse: (currentWeb: WebView | null, success: LinkSuccess) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { UNOnLoadResponse } from '../../
|
|
3
|
-
import type { UNAccountData } from '../../
|
|
4
|
-
import type { UNAccountMenuAction } from '../../
|
|
2
|
+
import type { UNOnLoadResponse } from '../../types/shared';
|
|
3
|
+
import type { UNAccountData } from '../../types/shared/account.types';
|
|
4
|
+
import type { UNAccountMenuAction } from '../../types/shared';
|
|
5
5
|
export interface UNAccountComponentProps {
|
|
6
6
|
accountId?: string;
|
|
7
7
|
customerToken: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountAction, UNAccountComponentProps } from './UNAccountComponent';
|
|
2
2
|
import { RequestRefreshEvent, RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
|
|
3
3
|
import type WebView from 'react-native-webview';
|
|
4
|
-
import type { UNAccountMenuAction } from 'src/
|
|
4
|
+
import type { UNAccountMenuAction } from 'src/types/shared';
|
|
5
5
|
export declare const getAccountParams: (props: UNAccountComponentProps) => string;
|
|
6
6
|
export declare const getAccountScript: () => string;
|
|
7
7
|
export declare const injectOpenActionsMenuScript: (currentWeb: WebView | null) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UNOnLoadResponse } from '../../
|
|
2
|
-
import type { UNActivityOnLoadData } from '../../
|
|
1
|
+
import type { UNOnLoadResponse } from '../../types/shared';
|
|
2
|
+
import type { UNActivityOnLoadData } from '../../types/shared/activity.types';
|
|
3
3
|
export interface UNActivityComponentProps {
|
|
4
|
-
accountId: string;
|
|
5
4
|
customerToken: string;
|
|
5
|
+
accountId?: string;
|
|
6
6
|
queryFilter?: string;
|
|
7
7
|
theme?: string;
|
|
8
8
|
language?: string;
|