react-native-unit-components 1.8.1 → 1.10.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/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +9 -12
- package/android/src/main/java/com/unitreactnativecomponents/appInfo/UNAppInfoModule.kt +59 -0
- package/android/src/main/java/com/unitreactnativecomponents/extensions/ContextExtensions.kt +35 -0
- package/ios/Extensions/Bundle+Extensions.swift +23 -0
- package/ios/UNAppInfo/IOSAppInfo.swift +47 -0
- package/ios/UNAppInfo/UNAppInfoExportModule.m +5 -2
- package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +34 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -4
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -4
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +21 -15
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
- package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +17 -11
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
- package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
- package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +34 -10
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/index.js +27 -0
- package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
- package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +86 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +41 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js +21 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/commonjs/components/index.js +19 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/flows/card/UNCardFlows.js +8 -4
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js +34 -0
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +49 -3
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js +41 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/commonjs/helpers/store/helpers.js +29 -0
- package/lib/commonjs/helpers/store/helpers.js.map +1 -0
- package/lib/commonjs/hooks/useListenerToEvent.js +26 -0
- package/lib/commonjs/hooks/useListenerToEvent.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +30 -6
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +13 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/slices/ConfigurationSlice.js +36 -0
- package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -0
- package/lib/commonjs/slices/SharedEventsSlice.js +28 -0
- package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/commonjs/store/index.js +17 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/store/store.js +20 -0
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/types/internal/errorHelpers.js +20 -0
- package/lib/commonjs/types/internal/errorHelpers.js.map +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
- package/lib/commonjs/types/shared/activity.types.js +7 -0
- package/lib/commonjs/types/shared/activity.types.js.map +1 -1
- package/lib/commonjs/types/shared/error.types.js +29 -0
- package/lib/commonjs/types/shared/error.types.js.map +1 -0
- package/lib/commonjs/types/shared/index.js +33 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/types/shared/multipleCards.types.js +13 -0
- package/lib/commonjs/types/shared/multipleCards.types.js.map +1 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js +4 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/commonjs/types/shared/versioning.types.js +14 -0
- package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +9 -14
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +21 -22
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/commonjs/utils/AppInfo.js +49 -0
- package/lib/commonjs/utils/AppInfo.js.map +1 -0
- package/lib/commonjs/utils/SDKInfo.js +13 -0
- package/lib/commonjs/utils/SDKInfo.js.map +1 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +30 -32
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js +19 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +4 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +5 -3
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/index.js +2 -0
- package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -3
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/index.js +2 -0
- package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +19 -12
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/index.js +2 -0
- package/lib/module/components/UNAccountComponent/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +16 -9
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/index.js +2 -0
- package/lib/module/components/UNActivityComponent/index.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
- package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +34 -9
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCardComponent/index.js +2 -0
- package/lib/module/components/UNCardComponent/index.js.map +1 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
- package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +77 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +33 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js +2 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/module/components/index.js +9 -8
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/flows/card/UNCardFlows.js +8 -3
- package/lib/module/flows/card/UNCardFlows.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/helpers.js +24 -0
- package/lib/module/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +50 -4
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/types.js +34 -0
- package/lib/module/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/module/helpers/store/helpers.js +20 -0
- package/lib/module/helpers/store/helpers.js.map +1 -0
- package/lib/module/hooks/useListenerToEvent.js +19 -0
- package/lib/module/hooks/useListenerToEvent.js.map +1 -0
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/multipleCardsMessage.js +5 -0
- package/lib/module/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/module/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/networking/requests/UNWalletPayloadRequest.js +29 -6
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +10 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/slices/ConfigurationSlice.js +25 -0
- package/lib/module/slices/ConfigurationSlice.js.map +1 -0
- package/lib/module/slices/SharedEventsSlice.js +19 -0
- package/lib/module/slices/SharedEventsSlice.js.map +1 -0
- package/lib/module/slices/pushProvisioningSlice.js +19 -0
- package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/module/store/index.js +2 -0
- package/lib/module/store/index.js.map +1 -0
- package/lib/module/store/store.js +12 -0
- package/lib/module/store/store.js.map +1 -0
- package/lib/module/types/internal/errorHelpers.js +12 -0
- package/lib/module/types/internal/errorHelpers.js.map +1 -0
- package/lib/module/types/internal/webComponent.types.js +1 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -1
- package/lib/module/types/shared/activity.types.js +5 -1
- package/lib/module/types/shared/activity.types.js.map +1 -1
- package/lib/module/types/shared/error.types.js +22 -0
- package/lib/module/types/shared/error.types.js.map +1 -0
- package/lib/module/types/shared/index.js +3 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/types/shared/multipleCards.types.js +6 -0
- package/lib/module/types/shared/multipleCards.types.js.map +1 -0
- package/lib/module/types/shared/onLoadResponse.types.js +1 -1
- package/lib/module/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/module/types/shared/versioning.types.js +7 -0
- package/lib/module/types/shared/versioning.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +9 -12
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
- package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +20 -19
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/module/utils/AppInfo.js +39 -0
- package/lib/module/utils/AppInfo.js.map +1 -0
- package/lib/module/utils/SDKInfo.js +5 -0
- package/lib/module/utils/SDKInfo.js.map +1 -0
- package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
- package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +33 -34
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/WebComponent.utils.js +15 -0
- package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/module/webComponent/html.js +5 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHCreditComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHDebitComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts +3 -2
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
- package/lib/typescript/src/components/UNAccountComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts +5 -1
- package/lib/typescript/src/components/UNActivityComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNBookPaymentComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
- package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.d.ts +2 -2
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/components/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.d.ts +4 -1
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNCardComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +15 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +3 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/helpers/pushProvisioningService/helpers.d.ts +4 -0
- package/lib/typescript/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
- package/lib/typescript/src/helpers/pushProvisioningService/types.d.ts +49 -0
- package/lib/typescript/src/helpers/store/helpers.d.ts +3 -0
- package/lib/typescript/src/hooks/useListenerToEvent.d.ts +9 -0
- package/lib/typescript/{messages → src/messages}/webMessages/index.d.ts +3 -2
- package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts +6 -0
- package/lib/typescript/{messages → src/messages}/webMessages/onLoadMessage.d.ts +7 -3
- package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts +2 -0
- package/lib/typescript/{scripts → src/scripts}/html/bodyScript.d.ts +2 -0
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts +10 -0
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +56 -0
- package/lib/typescript/src/slices/pushProvisioningSlice.d.ts +8 -0
- package/lib/typescript/src/store/index.d.ts +1 -0
- package/lib/typescript/src/store/store.d.ts +76 -0
- package/lib/typescript/src/types/internal/errorHelpers.d.ts +4 -0
- package/lib/typescript/{types → src/types}/internal/webComponent.types.d.ts +1 -0
- package/lib/typescript/{types → src/types}/shared/activity.types.d.ts +5 -1
- package/lib/typescript/src/types/shared/error.types.d.ts +36 -0
- package/lib/typescript/{types → src/types}/shared/index.d.ts +3 -0
- package/lib/typescript/src/types/shared/multipleCards.types.d.ts +6 -0
- package/lib/typescript/src/types/shared/onLoadResponse.types.d.ts +5 -0
- package/lib/typescript/src/types/shared/versioning.types.d.ts +22 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.api.d.ts +1 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts +8 -0
- package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.d.ts +11 -10
- package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
- package/lib/typescript/src/utils/AppInfo.d.ts +4 -0
- package/lib/typescript/src/utils/SDKInfo.d.ts +1 -0
- package/lib/typescript/src/utils/webVersioningStrategy.utils.d.ts +5 -0
- package/lib/typescript/{webComponent → src/webComponent}/WebComponent.utils.d.ts +3 -0
- package/package.json +8 -6
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +7 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
- package/src/components/UNACHCreditComponent/index.ts +1 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
- package/src/components/UNACHDebitComponent/index.ts +1 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +30 -14
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
- package/src/components/UNAccountComponent/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +37 -17
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -1
- package/src/components/UNActivityComponent/index.ts +1 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
- package/src/components/UNBookPaymentComponent/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +59 -32
- package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +18 -13
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/index.ts +1 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +51 -14
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
- package/src/components/UNCardComponent/index.ts +1 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
- package/src/components/UNCheckDepositComponent/index.ts +1 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +119 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +36 -0
- package/src/components/UNMultipleCardsComponent/index.ts +3 -0
- package/src/components/index.ts +9 -8
- package/src/flows/card/UNCardFlows.ts +10 -4
- package/src/helpers/pushProvisioningService/helpers.ts +31 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +46 -7
- package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
- package/src/helpers/pushProvisioningService/types.ts +52 -0
- package/src/helpers/store/helpers.tsx +22 -0
- package/src/hooks/useListenerToEvent.ts +32 -0
- package/src/messages/webMessages/index.ts +3 -0
- package/src/messages/webMessages/multipleCardsMessage.ts +9 -0
- package/src/messages/webMessages/onLoadMessage.ts +14 -3
- package/src/networking/requests/UNWalletPayloadRequest.ts +30 -7
- package/src/scripts/html/bodyScript.ts +13 -1
- package/src/slices/ConfigurationSlice.ts +31 -0
- package/src/slices/SharedEventsSlice.ts +93 -0
- package/src/slices/pushProvisioningSlice.ts +24 -0
- package/src/store/index.ts +1 -0
- package/src/store/store.ts +14 -0
- package/src/types/internal/errorHelpers.ts +22 -0
- package/src/types/internal/webComponent.types.ts +1 -1
- package/src/types/shared/activity.types.ts +6 -1
- package/src/types/shared/error.types.ts +38 -0
- package/src/types/shared/index.ts +3 -0
- package/src/types/shared/multipleCards.types.ts +8 -0
- package/src/types/shared/onLoadResponse.types.ts +2 -12
- package/src/types/shared/versioning.types.ts +28 -0
- package/src/unitSdkManager/UnitSdk.api.ts +10 -10
- package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
- package/src/unitSdkManager/UnitSdkManager.ts +21 -24
- package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
- package/src/utils/AppInfo.ts +40 -0
- package/src/utils/SDKInfo.ts +5 -0
- package/src/utils/webVersioningStrategy.utils.ts +52 -0
- package/src/webComponent/WebComponent.tsx +37 -34
- package/src/webComponent/WebComponent.utils.ts +17 -0
- package/src/webComponent/html.ts +16 -2
- package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +0 -35
- package/ios/UNAppInfo/UNAppInfo.swift +0 -23
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/commonjs/components/utils/nativeModulesInfo.js +0 -20
- package/lib/commonjs/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/commonjs/helpers/EventBus.js +0 -58
- package/lib/commonjs/helpers/EventBus.js.map +0 -1
- package/lib/commonjs/hooks/listenerToBus.js +0 -34
- package/lib/commonjs/hooks/listenerToBus.js.map +0 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/module/components/utils/nativeModulesInfo.js +0 -13
- package/lib/module/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/module/helpers/EventBus.js +0 -51
- package/lib/module/helpers/EventBus.js.map +0 -1
- package/lib/module/hooks/listenerToBus.js +0 -25
- package/lib/module/hooks/listenerToBus.js.map +0 -1
- package/lib/typescript/components/index.d.ts +0 -8
- package/lib/typescript/components/utils/nativeModulesInfo.d.ts +0 -1
- package/lib/typescript/helpers/EventBus.d.ts +0 -13
- package/lib/typescript/hooks/listenerToBus.d.ts +0 -7
- package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +0 -2
- package/lib/typescript/types/shared/onLoadResponse.types.d.ts +0 -14
- package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +0 -3
- package/src/components/utils/nativeModulesInfo.ts +0 -11
- package/src/helpers/EventBus.ts +0 -58
- package/src/hooks/listenerToBus.ts +0 -31
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/typescript/{assets → src/assets}/images/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/UNFlows.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/card/UNCardFlows.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.styles.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/hooks/useCardWallet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/startProvisioning.d.ts +0 -0
- /package/lib/typescript/{hooks → src/hooks}/useAppStateListener.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/bottomSheetMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/index.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/sdkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/accountMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/achCreditMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/activityMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/bookPaymentMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/checkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/pageMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/paymentsMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/unitMessages.d.ts +0 -0
- /package/lib/typescript/{nativeComponent → src/nativeComponent}/UnitAddToWalletButton.d.ts +0 -0
- /package/lib/typescript/{networking → src/networking}/common/UNNetworkConstants.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/bodyHtml.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/fontFaces.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/fonts.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/variables.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/internal/bottomSheet.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/account.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/achCredit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/authorization.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/bookPayment.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/card.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/checkDeposit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/fonts.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/payments.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/transactions.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/wallet.types.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/unitUiManager/unitUiManager.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/WebComponent.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/html.d.ts +0 -0
- /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
2
|
+
export const getMultipleCardsParams = props => {
|
|
3
|
+
const paginationType = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
|
|
4
|
+
const cardsPerPage = props.cardsPerPage ? `cards-per-page="${props.cardsPerPage}"` : '';
|
|
5
|
+
const queryFilter = props.queryFilter ? `query-filter="${props.queryFilter}"` : '';
|
|
6
|
+
return `
|
|
7
|
+
customer-token="${props.customerToken}"
|
|
8
|
+
${paginationType}
|
|
9
|
+
${cardsPerPage}
|
|
10
|
+
disable-card-click="${props.disableCardClick || false}"
|
|
11
|
+
${queryFilter}
|
|
12
|
+
hide-title="${props.hideTitle || false}"
|
|
13
|
+
style="height: 100%"
|
|
14
|
+
`;
|
|
15
|
+
};
|
|
16
|
+
const MULTIPLE_CARDS_LISTENERS = {
|
|
17
|
+
cardClicked: `
|
|
18
|
+
window.addEventListener("${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", (e) => {
|
|
19
|
+
const response = e.detail
|
|
20
|
+
response.then((data) => {
|
|
21
|
+
postMessageToSDK({ type: "${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", details: data.data })
|
|
22
|
+
}).catch((e) => {
|
|
23
|
+
console.log(e)
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
`
|
|
27
|
+
};
|
|
28
|
+
export const getMultipleCardsScript = () => {
|
|
29
|
+
return `
|
|
30
|
+
${MULTIPLE_CARDS_LISTENERS.cardClicked}
|
|
31
|
+
`;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=UNMultipleCardsComponent.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MultipleCardsMessage","getMultipleCardsParams","props","paginationType","cardsPerPage","queryFilter","customerToken","disableCardClick","hideTitle","MULTIPLE_CARDS_LISTENERS","cardClicked","UNIT_MULTIPLE_CARDS_CARD_CLICKED","getMultipleCardsScript"],"sources":["UNMultipleCardsComponent.utils.ts"],"sourcesContent":["import type { UNMultipleCardsComponentProps } from './UNMultipleCardsComponent';\nimport { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';\n\nexport const getMultipleCardsParams = (props: UNMultipleCardsComponentProps) => {\n const paginationType = props.paginationType ? `pagination-type=\"${props.paginationType}\"` : '';\n const cardsPerPage = props.cardsPerPage ? `cards-per-page=\"${props.cardsPerPage}\"` : '';\n const queryFilter = props.queryFilter ? `query-filter=\"${props.queryFilter}\"` : '';\n return `\n customer-token=\"${props.customerToken}\"\n ${paginationType}\n ${cardsPerPage}\n disable-card-click=\"${props.disableCardClick || false}\"\n ${queryFilter}\n hide-title=\"${props.hideTitle || false}\"\n style=\"height: 100%\"\n `;\n};\n\nconst MULTIPLE_CARDS_LISTENERS = {\n cardClicked: `\n window.addEventListener(\"${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}\", details: data.data })\n }).catch((e) => {\n console.log(e)\n })\n });\n `,\n};\n\nexport const getMultipleCardsScript = () => {\n return `\n ${MULTIPLE_CARDS_LISTENERS.cardClicked}\n `;\n};\n"],"mappings":"AACA,SAASA,oBAAoB,QAAQ,iDAAiD;AAEtF,OAAO,MAAMC,sBAAsB,GAAIC,KAAoC,IAAK;EAC9E,MAAMC,cAAc,GAAGD,KAAK,CAACC,cAAc,GAAI,oBAAmBD,KAAK,CAACC,cAAe,GAAE,GAAG,EAAE;EAC9F,MAAMC,YAAY,GAAGF,KAAK,CAACE,YAAY,GAAI,mBAAkBF,KAAK,CAACE,YAAa,GAAE,GAAG,EAAE;EACvF,MAAMC,WAAW,GAAGH,KAAK,CAACG,WAAW,GAAI,iBAAgBH,KAAK,CAACG,WAAY,GAAE,GAAG,EAAE;EAClF,OAAQ;AACV,oBAAoBH,KAAK,CAACI,aAAc;AACxC,IAAIH,cAAe;AACnB,IAAIC,YAAa;AACjB,wBAAwBF,KAAK,CAACK,gBAAgB,IAAI,KAAM;AACxD,IAAIF,WAAY;AAChB,gBAAgBH,KAAK,CAACM,SAAS,IAAI,KAAM;AACzC;AACA,GAAG;AACH,CAAC;AAED,MAAMC,wBAAwB,GAAG;EAC/BC,WAAW,EAAG;AAChB,+BAA+BV,oBAAoB,CAACW,gCAAiC;AACrF;AACA;AACA,oCAAoCX,oBAAoB,CAACW,gCAAiC;AAC1F;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,OAAQ;AACV,OAAOH,wBAAwB,CAACC,WAAY;AAC5C,GAAG;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","UNMultipleCardsComponent","UNMultipleCardsComponentProps"],"sources":["index.ts"],"sourcesContent":["export {\n default as UNMultipleCardsComponent, UNMultipleCardsComponentProps,\n} from './UNMultipleCardsComponent';\n"],"mappings":"AAAA,SACEA,OAAO,IAAIC,wBAAwB,EAAEC,6BAA6B,QAC7D,4BAA4B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from './UNCardComponent
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
1
|
+
export * from './UNCardComponent';
|
|
2
|
+
export * from './UNMultipleCardsComponent';
|
|
3
|
+
export * from './UNBottomSheetComponent';
|
|
4
|
+
export * from './UNBookPaymentComponent';
|
|
5
|
+
export * from './UNActivityComponent';
|
|
6
|
+
export * from './UNAccountComponent';
|
|
7
|
+
export * from './UNCheckDepositComponent';
|
|
8
|
+
export * from './UNACHDebitComponent';
|
|
9
|
+
export * from './UNACHCreditComponent';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent';\nexport * from './UNMultipleCardsComponent';\nexport * from './UNBottomSheetComponent';\nexport * from './UNBookPaymentComponent';\nexport * from './UNActivityComponent';\nexport * from './UNAccountComponent';\nexport * from './UNCheckDepositComponent';\nexport * from './UNACHDebitComponent';\nexport * from './UNACHCreditComponent';\n"],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,4BAA4B;AAC1C,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,sBAAsB;AACpC,cAAc,2BAA2B;AACzC,cAAc,uBAAuB;AACrC,cAAc,wBAAwB"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
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 EventBus from '../../helpers/EventBus';
|
|
5
4
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
6
5
|
import { BottomSheetRenderingType } from '../../types/internal/bottomSheet.types';
|
|
7
6
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
7
|
+
import { useDispatch } from 'react-redux';
|
|
8
|
+
import { setEvent } from '../../slices/SharedEventsSlice';
|
|
8
9
|
export class UNCardFlows {}
|
|
9
10
|
_defineProperty(UNCardFlows, "startPushProvisioning", async (cardId, customerToken) => {
|
|
11
|
+
const dispatch = useDispatch(); //todo: can we use hook here?
|
|
10
12
|
try {
|
|
11
13
|
const addToWalletComponentData = {
|
|
12
14
|
type: WebComponentType.cardAction,
|
|
13
15
|
presentationMode: PresentationMode.CoverInjectedHeight,
|
|
14
16
|
params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`
|
|
15
17
|
};
|
|
16
|
-
const
|
|
18
|
+
const data = {
|
|
17
19
|
type: BottomSheetRenderingType.WebComponent,
|
|
18
20
|
data: addToWalletComponentData
|
|
19
21
|
};
|
|
20
|
-
|
|
22
|
+
dispatch(setEvent({
|
|
23
|
+
key: BottomSheetNativeMessage.START_FLOW,
|
|
24
|
+
data
|
|
25
|
+
}));
|
|
21
26
|
} catch (error) {
|
|
22
27
|
console.error(error);
|
|
23
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["PresentationMode","WebComponentType","BottomSheetRenderingType","BottomSheetNativeMessage","useDispatch","setEvent","UNCardFlows","_defineProperty","cardId","customerToken","dispatch","addToWalletComponentData","type","cardAction","presentationMode","CoverInjectedHeight","params","data","WebComponent","key","START_FLOW","error","console"],"sources":["UNCardFlows.ts"],"sourcesContent":["import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport {\n BottomSheetRenderingType,\n type WebComponentData,\n type WebComponentRendering,\n} from '../../types/internal/bottomSheet.types';\nimport { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';\nimport { useDispatch } from 'react-redux';\nimport { setEvent } from '../../slices/SharedEventsSlice';\n\nexport class UNCardFlows {\n public static startPushProvisioning = async (cardId: string, customerToken: string) => {\n const dispatch = useDispatch(); //todo: can we use hook here?\n try {\n const addToWalletComponentData: WebComponentData = {\n type: WebComponentType.cardAction,\n presentationMode: PresentationMode.CoverInjectedHeight,\n params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,\n };\n\n const data: WebComponentRendering = {\n type: BottomSheetRenderingType.WebComponent,\n data: addToWalletComponentData,\n };\n\n dispatch(setEvent({ key: BottomSheetNativeMessage.START_FLOW, data }));\n } catch (error) {\n console.error(error);\n }\n };\n}\n"],"mappings":";;;AAAA,SAASA,gBAAgB,EAAEC,gBAAgB,QAAQ,yCAAyC;AAC5F,SACEC,wBAAwB,QAGnB,wCAAwC;AAC/C,SAASC,wBAAwB,QAAQ,kDAAkD;AAC3F,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,QAAQ,QAAQ,gCAAgC;AAEzD,OAAO,MAAMC,WAAW,CAAC;AAoBxBC,eAAA,CApBYD,WAAW,2BACgB,OAAOE,MAAc,EAAEC,aAAqB,KAAK;EACrF,MAAMC,QAAQ,GAAGN,WAAW,EAAE,CAAC,CAAC;EAChC,IAAI;IACF,MAAMO,wBAA0C,GAAG;MACjDC,IAAI,EAAEX,gBAAgB,CAACY,UAAU;MACjCC,gBAAgB,EAAEd,gBAAgB,CAACe,mBAAmB;MACtDC,MAAM,EAAG,WAAUR,MAAO,mBAAkBC,aAAc;IAC5D,CAAC;IAED,MAAMQ,IAA2B,GAAG;MAClCL,IAAI,EAAEV,wBAAwB,CAACgB,YAAY;MAC3CD,IAAI,EAAEN;IACR,CAAC;IAEDD,QAAQ,CAACL,QAAQ,CAAC;MAAEc,GAAG,EAAEhB,wBAAwB,CAACiB,UAAU;MAAEH;IAAK,CAAC,CAAC,CAAC;EACxE,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdC,OAAO,CAACD,KAAK,CAACA,KAAK,CAAC;EACtB;AACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { UNVPErrorType } from './types';
|
|
3
|
+
export const isUNVPError = error => {
|
|
4
|
+
return 'code' in error && 'description' in error && 'type' in error && isUNVPErrorType(error.type) && 'correlationId' in error;
|
|
5
|
+
};
|
|
6
|
+
const isUNVPErrorType = type => {
|
|
7
|
+
return Object.values(UNVPErrorType).includes(type);
|
|
8
|
+
};
|
|
9
|
+
export const isUNNativePromiseReject = error => {
|
|
10
|
+
return 'code' in error && 'message' in error;
|
|
11
|
+
};
|
|
12
|
+
export const promiseRejectToUNVPErrorType = error => {
|
|
13
|
+
// validate the shape of a promise reject we get from iOS/Android native
|
|
14
|
+
if (!isUNNativePromiseReject(error)) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const parsedError = JSON.parse(error.message);
|
|
18
|
+
// validate the shape of an error we get from VDE SDK
|
|
19
|
+
if (!isUNVPError(parsedError)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return parsedError.type;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNVPErrorType","isUNVPError","error","isUNVPErrorType","type","Object","values","includes","isUNNativePromiseReject","promiseRejectToUNVPErrorType","parsedError","JSON","parse","message"],"sources":["helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { UNNativePromiseReject, UNVPError, UNVPErrorType } from './types';\n\nexport const isUNVPError = (error: any): error is UNVPError => {\n return 'code' in error &&\n 'description' in error &&\n 'type' in error &&\n isUNVPErrorType(error.type) &&\n 'correlationId' in error;\n};\n\nconst isUNVPErrorType = (type: any): type is UNVPErrorType => {\n return Object.values(UNVPErrorType).includes(type);\n};\n\nexport const isUNNativePromiseReject = (error: any): error is UNNativePromiseReject => {\n return 'code' in error && 'message' in error;\n};\n\nexport const promiseRejectToUNVPErrorType = (error: any): UNVPErrorType | null => {\n // validate the shape of a promise reject we get from iOS/Android native\n if (!isUNNativePromiseReject(error)) {\n return null;\n }\n const parsedError = JSON.parse(error.message);\n // validate the shape of an error we get from VDE SDK\n if (!isUNVPError(parsedError)) {\n return null;\n }\n return parsedError.type;\n};\n"],"mappings":"AAAA;AACA,SAA2CA,aAAa,QAAQ,SAAS;AAEzE,OAAO,MAAMC,WAAW,GAAIC,KAAU,IAAyB;EAC7D,OAAO,MAAM,IAAIA,KAAK,IACpB,aAAa,IAAIA,KAAK,IACtB,MAAM,IAAIA,KAAK,IACfC,eAAe,CAACD,KAAK,CAACE,IAAI,CAAC,IAC3B,eAAe,IAAIF,KAAK;AAC5B,CAAC;AAED,MAAMC,eAAe,GAAIC,IAAS,IAA4B;EAC5D,OAAOC,MAAM,CAACC,MAAM,CAACN,aAAa,CAAC,CAACO,QAAQ,CAACH,IAAI,CAAC;AACpD,CAAC;AAED,OAAO,MAAMI,uBAAuB,GAAIN,KAAU,IAAqC;EACrF,OAAO,MAAM,IAAIA,KAAK,IAAI,SAAS,IAAIA,KAAK;AAC9C,CAAC;AAED,OAAO,MAAMO,4BAA4B,GAAIP,KAAU,IAA2B;EAChF;EACA,IAAI,CAACM,uBAAuB,CAACN,KAAK,CAAC,EAAE;IACnC,OAAO,IAAI;EACb;EACA,MAAMQ,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACV,KAAK,CAACW,OAAO,CAAC;EAC7C;EACA,IAAI,CAACZ,WAAW,CAACS,WAAW,CAAC,EAAE;IAC7B,OAAO,IAAI;EACb;EACA,OAAOA,WAAW,CAACN,IAAI;AACzB,CAAC"}
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { UNWalletCode, UNWalletName } from '../../../types/shared/wallet.types';
|
|
3
3
|
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
4
4
|
import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
|
|
5
|
+
import { useSelector, useDispatch } from 'react-redux';
|
|
6
|
+
import { selectWallet, setSignedNonce } from '../../../slices/pushProvisioningSlice';
|
|
7
|
+
import { useLaunchInitialize } from './useLaunchInitialize';
|
|
8
|
+
import { UNVPErrorType } from '../types';
|
|
9
|
+
import { promiseRejectToUNVPErrorType } from '../helpers';
|
|
10
|
+
import { UNErrorCodes } from '../../../types/shared/error.types';
|
|
11
|
+
import { isUNError } from '../../../types/internal/errorHelpers';
|
|
5
12
|
export const useCardWallet = cardId => {
|
|
6
13
|
const [currentUNWallet, setCurrentUNWallet] = useState();
|
|
14
|
+
const {
|
|
15
|
+
signedNonce
|
|
16
|
+
} = useSelector(selectWallet);
|
|
17
|
+
const {
|
|
18
|
+
initializePushProvisioning
|
|
19
|
+
} = useLaunchInitialize();
|
|
20
|
+
const dispatch = useDispatch();
|
|
21
|
+
const isRecoveringSignedNonceRef = useRef(false);
|
|
22
|
+
const shouldRecoverVPSDKForError = errorType => {
|
|
23
|
+
const recoveringTypes = [UNVPErrorType.PayloadDecryptionFailed, UNVPErrorType.SessionExpired, UNVPErrorType.InvalidNonce];
|
|
24
|
+
return recoveringTypes.includes(errorType);
|
|
25
|
+
};
|
|
7
26
|
useEffect(() => {
|
|
8
27
|
const getEncryptedPayload = async () => {
|
|
9
28
|
const env = UnitSDK.getEnv();
|
|
10
29
|
const customerToken = UnitSDK.getCustomerToken();
|
|
11
30
|
if (!env || !customerToken) return;
|
|
12
|
-
|
|
31
|
+
// In case we use flow
|
|
32
|
+
if (!signedNonce) {
|
|
33
|
+
await initializePushProvisioning();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env, signedNonce);
|
|
13
37
|
return encryptedPayload;
|
|
14
38
|
};
|
|
15
39
|
const getCardWalletData = async () => {
|
|
@@ -17,6 +41,7 @@ export const useCardWallet = cardId => {
|
|
|
17
41
|
if (!currentProvisioningModule) return;
|
|
18
42
|
try {
|
|
19
43
|
const encryptedPayload = await getEncryptedPayload();
|
|
44
|
+
if (!encryptedPayload) return;
|
|
20
45
|
const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({
|
|
21
46
|
encPayload: encryptedPayload
|
|
22
47
|
}));
|
|
@@ -25,11 +50,32 @@ export const useCardWallet = cardId => {
|
|
|
25
50
|
setCurrentUNWallet(unWallet);
|
|
26
51
|
return;
|
|
27
52
|
} catch (error) {
|
|
28
|
-
|
|
53
|
+
console.error('Coudln\'t get card wallet data:', error);
|
|
54
|
+
if (isRecoveringSignedNonceRef.current) return;
|
|
55
|
+
isRecoveringSignedNonceRef.current = true;
|
|
56
|
+
|
|
57
|
+
// handle unit network api errors
|
|
58
|
+
if (isUNError(error)) {
|
|
59
|
+
var _errors$;
|
|
60
|
+
const errors = error.errors;
|
|
61
|
+
// errors will return in an array but hold only a single error element
|
|
62
|
+
if (((_errors$ = errors[0]) === null || _errors$ === void 0 ? void 0 : _errors$.code) === UNErrorCodes.INVALID_NONCE) {
|
|
63
|
+
dispatch(setSignedNonce(null));
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// handle VDE SDK errors
|
|
69
|
+
const errorType = promiseRejectToUNVPErrorType(error);
|
|
70
|
+
if (!errorType) return;
|
|
71
|
+
if (shouldRecoverVPSDKForError(errorType)) {
|
|
72
|
+
dispatch(setSignedNonce(null));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
29
75
|
}
|
|
30
76
|
};
|
|
31
77
|
getCardWalletData();
|
|
32
|
-
}, [cardId]);
|
|
78
|
+
}, [signedNonce, cardId]);
|
|
33
79
|
return {
|
|
34
80
|
currentUNWallet
|
|
35
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useState","UNWalletCode","UNWalletName","UnitSDK","getMobileWalletPayload","useCardWallet","cardId","currentUNWallet","setCurrentUNWallet","getEncryptedPayload","env","getEnv","customerToken","getCustomerToken","encryptedPayload","getCardWalletData","currentProvisioningModule","getPushProvisionModule","walletsResponse","launchGetWallets","JSON","stringify","encPayload","unWallet","parseWalletsResponse","error","
|
|
1
|
+
{"version":3,"names":["useEffect","useState","useRef","UNWalletCode","UNWalletName","UnitSDK","getMobileWalletPayload","useSelector","useDispatch","selectWallet","setSignedNonce","useLaunchInitialize","UNVPErrorType","promiseRejectToUNVPErrorType","UNErrorCodes","isUNError","useCardWallet","cardId","currentUNWallet","setCurrentUNWallet","signedNonce","initializePushProvisioning","dispatch","isRecoveringSignedNonceRef","shouldRecoverVPSDKForError","errorType","recoveringTypes","PayloadDecryptionFailed","SessionExpired","InvalidNonce","includes","getEncryptedPayload","env","getEnv","customerToken","getCustomerToken","encryptedPayload","getCardWalletData","currentProvisioningModule","getPushProvisionModule","walletsResponse","launchGetWallets","JSON","stringify","encPayload","unWallet","parseWalletsResponse","error","console","current","_errors$","errors","code","INVALID_NONCE","parsedWalletsResponse","parse","wallets","Apple","name","status","googleWallet","filter","wallet","Google","Error"],"sources":["useCardWallet.ts"],"sourcesContent":["import { useEffect, useState, useRef } from 'react';\nimport { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';\nimport { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';\nimport { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';\nimport { useSelector, useDispatch } from 'react-redux';\nimport { selectWallet, setSignedNonce } from '../../../slices/pushProvisioningSlice';\nimport { useLaunchInitialize } from './useLaunchInitialize';\nimport { UNVPErrorType } from '../types';\nimport { promiseRejectToUNVPErrorType } from '../helpers';\nimport { UNErrorCodes, UNErrorData } from '../../../types/shared/error.types';\nimport { isUNError } from '../../../types/internal/errorHelpers';\n\nexport type CardToEncryptedPayload = {\n [cardId: string]: string;\n};\n\nexport const useCardWallet = (cardId: string) => {\n const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();\n const { signedNonce } = useSelector(selectWallet);\n const { initializePushProvisioning } = useLaunchInitialize();\n const dispatch = useDispatch();\n const isRecoveringSignedNonceRef = useRef<boolean>(false);\n\n const shouldRecoverVPSDKForError = (errorType: UNVPErrorType) => {\n const recoveringTypes = [UNVPErrorType.PayloadDecryptionFailed, UNVPErrorType.SessionExpired, UNVPErrorType.InvalidNonce];\n return recoveringTypes.includes(errorType);\n };\n\n useEffect(() => {\n const getEncryptedPayload = async () => {\n const env = UnitSDK.getEnv();\n const customerToken = UnitSDK.getCustomerToken();\n if (!env || !customerToken) return;\n // In case we use flow\n if (!signedNonce) {\n await initializePushProvisioning();\n return;\n }\n const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env, signedNonce);\n return encryptedPayload;\n };\n\n const getCardWalletData = async () => {\n const currentProvisioningModule = UnitSDK.getPushProvisionModule();\n if (!currentProvisioningModule) return;\n try {\n const encryptedPayload = await getEncryptedPayload();\n if (!encryptedPayload) return;\n const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));\n const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);\n if (!unWallet) return;\n setCurrentUNWallet(unWallet);\n return;\n } catch (error) {\n console.error('Coudln\\'t get card wallet data:', error);\n if (isRecoveringSignedNonceRef.current) return;\n isRecoveringSignedNonceRef.current = true;\n\n // handle unit network api errors\n if (isUNError(error)) {\n const errors: UNErrorData[] = error.errors;\n // errors will return in an array but hold only a single error element\n if (errors[0]?.code === UNErrorCodes.INVALID_NONCE) {\n dispatch(setSignedNonce(null));\n }\n return;\n }\n\n // handle VDE SDK errors\n const errorType = promiseRejectToUNVPErrorType(error);\n if (!errorType) return;\n if (shouldRecoverVPSDKForError(errorType)) {\n dispatch(setSignedNonce(null));\n return;\n }\n }\n };\n\n getCardWalletData();\n }, [signedNonce, cardId]);\n\n return {\n currentUNWallet\n };\n\n};\n\nconst parseWalletsResponse = (walletsResponse: string): UNWallet | null => {\n try {\n const parsedWalletsResponse = JSON.parse(walletsResponse);\n const wallets = parsedWalletsResponse.wallets;\n\n if (!wallets) return null;\n if (wallets[0].code === UNWalletCode.Apple) {\n return ({ name: UNWalletName.Apple, code: UNWalletCode.Apple, status: wallets[0].status });\n } else {\n const googleWallet = wallets.filter((wallet: { name: UNWalletName }) => {\n return wallet.name === UNWalletName.Google;\n });\n if (!googleWallet) return null;\n return ({ name: UNWalletName.Google, code: UNWalletCode.Google, status: googleWallet[0].status });\n }\n } catch (error) {\n throw new Error('Error parsing wallet response');\n }\n};\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AACnD,SAASC,YAAY,EAAiBC,YAAY,QAAQ,oCAAoC;AAC9F,SAASC,OAAO,QAAQ,wCAAwC;AAChE,SAASC,sBAAsB,QAAQ,qDAAqD;AAC5F,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,YAAY,EAAEC,cAAc,QAAQ,uCAAuC;AACpF,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,4BAA4B,QAAQ,YAAY;AACzD,SAASC,YAAY,QAAqB,mCAAmC;AAC7E,SAASC,SAAS,QAAQ,sCAAsC;AAMhE,OAAO,MAAMC,aAAa,GAAIC,MAAc,IAAK;EAC/C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAGlB,QAAQ,EAAY;EAClE,MAAM;IAAEmB;EAAY,CAAC,GAAGb,WAAW,CAACE,YAAY,CAAC;EACjD,MAAM;IAAEY;EAA2B,CAAC,GAAGV,mBAAmB,EAAE;EAC5D,MAAMW,QAAQ,GAAGd,WAAW,EAAE;EAC9B,MAAMe,0BAA0B,GAAGrB,MAAM,CAAU,KAAK,CAAC;EAEzD,MAAMsB,0BAA0B,GAAIC,SAAwB,IAAK;IAC/D,MAAMC,eAAe,GAAG,CAACd,aAAa,CAACe,uBAAuB,EAAEf,aAAa,CAACgB,cAAc,EAAEhB,aAAa,CAACiB,YAAY,CAAC;IACzH,OAAOH,eAAe,CAACI,QAAQ,CAACL,SAAS,CAAC;EAC5C,CAAC;EAEDzB,SAAS,CAAC,MAAM;IACd,MAAM+B,mBAAmB,GAAG,MAAAA,CAAA,KAAY;MACtC,MAAMC,GAAG,GAAG3B,OAAO,CAAC4B,MAAM,EAAE;MAC5B,MAAMC,aAAa,GAAG7B,OAAO,CAAC8B,gBAAgB,EAAE;MAChD,IAAI,CAACH,GAAG,IAAI,CAACE,aAAa,EAAE;MAC5B;MACA,IAAI,CAACd,WAAW,EAAE;QAChB,MAAMC,0BAA0B,EAAE;QAClC;MACF;MACA,MAAMe,gBAAgB,GAAG,MAAM9B,sBAAsB,CAAC4B,aAAa,EAAEjB,MAAM,EAAEe,GAAG,EAAEZ,WAAW,CAAC;MAC9F,OAAOgB,gBAAgB;IACzB,CAAC;IAED,MAAMC,iBAAiB,GAAG,MAAAA,CAAA,KAAY;MACpC,MAAMC,yBAAyB,GAAGjC,OAAO,CAACkC,sBAAsB,EAAE;MAClE,IAAI,CAACD,yBAAyB,EAAE;MAChC,IAAI;QACF,MAAMF,gBAAgB,GAAG,MAAML,mBAAmB,EAAE;QACpD,IAAI,CAACK,gBAAgB,EAAE;QACvB,MAAMI,eAAe,GAAG,MAAMF,yBAAyB,CAACG,gBAAgB,CAACC,IAAI,CAACC,SAAS,CAAC;UAAEC,UAAU,EAAER;QAAiB,CAAC,CAAC,CAAC;QAC1H,MAAMS,QAAyB,GAAGC,oBAAoB,CAACN,eAAe,CAAC;QACvE,IAAI,CAACK,QAAQ,EAAE;QACf1B,kBAAkB,CAAC0B,QAAQ,CAAC;QAC5B;MACF,CAAC,CAAC,OAAOE,KAAK,EAAE;QACdC,OAAO,CAACD,KAAK,CAAC,iCAAiC,EAAEA,KAAK,CAAC;QACvD,IAAIxB,0BAA0B,CAAC0B,OAAO,EAAE;QACxC1B,0BAA0B,CAAC0B,OAAO,GAAG,IAAI;;QAEzC;QACA,IAAIlC,SAAS,CAACgC,KAAK,CAAC,EAAE;UAAA,IAAAG,QAAA;UACpB,MAAMC,MAAqB,GAAGJ,KAAK,CAACI,MAAM;UAC1C;UACA,IAAI,EAAAD,QAAA,GAAAC,MAAM,CAAC,CAAC,CAAC,cAAAD,QAAA,uBAATA,QAAA,CAAWE,IAAI,MAAKtC,YAAY,CAACuC,aAAa,EAAE;YAClD/B,QAAQ,CAACZ,cAAc,CAAC,IAAI,CAAC,CAAC;UAChC;UACA;QACF;;QAEA;QACA,MAAMe,SAAS,GAAGZ,4BAA4B,CAACkC,KAAK,CAAC;QACrD,IAAI,CAACtB,SAAS,EAAE;QAChB,IAAID,0BAA0B,CAACC,SAAS,CAAC,EAAE;UACzCH,QAAQ,CAACZ,cAAc,CAAC,IAAI,CAAC,CAAC;UAC9B;QACF;MACF;IACF,CAAC;IAED2B,iBAAiB,EAAE;EACrB,CAAC,EAAE,CAACjB,WAAW,EAAEH,MAAM,CAAC,CAAC;EAEzB,OAAO;IACLC;EACF,CAAC;AAEH,CAAC;AAED,MAAM4B,oBAAoB,GAAIN,eAAuB,IAAsB;EACzE,IAAI;IACF,MAAMc,qBAAqB,GAAGZ,IAAI,CAACa,KAAK,CAACf,eAAe,CAAC;IACzD,MAAMgB,OAAO,GAAGF,qBAAqB,CAACE,OAAO;IAE7C,IAAI,CAACA,OAAO,EAAE,OAAO,IAAI;IACzB,IAAIA,OAAO,CAAC,CAAC,CAAC,CAACJ,IAAI,KAAKjD,YAAY,CAACsD,KAAK,EAAE;MAC1C,OAAQ;QAAEC,IAAI,EAAEtD,YAAY,CAACqD,KAAK;QAAEL,IAAI,EAAEjD,YAAY,CAACsD,KAAK;QAAEE,MAAM,EAAEH,OAAO,CAAC,CAAC,CAAC,CAACG;MAAO,CAAC;IAC3F,CAAC,MAAM;MACL,MAAMC,YAAY,GAAGJ,OAAO,CAACK,MAAM,CAAEC,MAA8B,IAAK;QACtE,OAAOA,MAAM,CAACJ,IAAI,KAAKtD,YAAY,CAAC2D,MAAM;MAC5C,CAAC,CAAC;MACF,IAAI,CAACH,YAAY,EAAE,OAAO,IAAI;MAC9B,OAAQ;QAAEF,IAAI,EAAEtD,YAAY,CAAC2D,MAAM;QAAEX,IAAI,EAAEjD,YAAY,CAAC4D,MAAM;QAAEJ,MAAM,EAAEC,YAAY,CAAC,CAAC,CAAC,CAACD;MAAO,CAAC;IAClG;EACF,CAAC,CAAC,OAAOZ,KAAK,EAAE;IACd,MAAM,IAAIiB,KAAK,CAAC,+BAA+B,CAAC;EAClD;AACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
2
|
+
import { useDispatch } from 'react-redux';
|
|
3
|
+
import { setSignedNonce } from '../../../slices/pushProvisioningSlice';
|
|
4
|
+
export const useLaunchInitialize = () => {
|
|
5
|
+
const dispatch = useDispatch();
|
|
6
|
+
const initializePushProvisioning = async () => {
|
|
7
|
+
const pushProvisioningModule = UnitSDK.getPushProvisionModule();
|
|
8
|
+
if (!pushProvisioningModule) {
|
|
9
|
+
console.error('Missing a PushProvisioningModule');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const response = await pushProvisioningModule.launchInitialize();
|
|
14
|
+
console.log(`PushProvisioningModule.launchInitialize: Success \n\n signedNonce : ${response}`);
|
|
15
|
+
const signedNonce = JSON.parse(response).signedNonce;
|
|
16
|
+
dispatch(setSignedNonce(signedNonce));
|
|
17
|
+
} catch (error) {
|
|
18
|
+
// TODO - handle errors
|
|
19
|
+
console.error(error);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
initializePushProvisioning
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useLaunchInitialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UnitSDK","useDispatch","setSignedNonce","useLaunchInitialize","dispatch","initializePushProvisioning","pushProvisioningModule","getPushProvisionModule","console","error","response","launchInitialize","log","signedNonce","JSON","parse"],"sources":["useLaunchInitialize.ts"],"sourcesContent":["import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';\nimport { useDispatch } from 'react-redux';\nimport { setSignedNonce } from '../../../slices/pushProvisioningSlice';\n\nexport const useLaunchInitialize = () => {\n const dispatch = useDispatch();\n\n const initializePushProvisioning = async () => {\n const pushProvisioningModule = UnitSDK.getPushProvisionModule();\n if (!pushProvisioningModule) {\n console.error('Missing a PushProvisioningModule');\n return;\n }\n try {\n const response = await pushProvisioningModule.launchInitialize();\n console.log(`PushProvisioningModule.launchInitialize: Success \\n\\n signedNonce : ${response}`);\n const signedNonce = JSON.parse(response).signedNonce;\n dispatch(setSignedNonce(signedNonce));\n } catch (error) {\n // TODO - handle errors\n console.error(error);\n }\n };\n\n return {\n initializePushProvisioning\n };\n\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,wCAAwC;AAChE,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,cAAc,QAAQ,uCAAuC;AAEtE,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,QAAQ,GAAGH,WAAW,EAAE;EAE9B,MAAMI,0BAA0B,GAAG,MAAAA,CAAA,KAAY;IAC7C,MAAMC,sBAAsB,GAAGN,OAAO,CAACO,sBAAsB,EAAE;IAC/D,IAAI,CAACD,sBAAsB,EAAE;MAC3BE,OAAO,CAACC,KAAK,CAAC,kCAAkC,CAAC;MACjD;IACF;IACA,IAAI;MACF,MAAMC,QAAQ,GAAG,MAAMJ,sBAAsB,CAACK,gBAAgB,EAAE;MAChEH,OAAO,CAACI,GAAG,CAAE,uEAAsEF,QAAS,EAAC,CAAC;MAC9F,MAAMG,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACL,QAAQ,CAAC,CAACG,WAAW;MACpDT,QAAQ,CAACF,cAAc,CAACW,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC,OAAOJ,KAAK,EAAE;MACd;MACAD,OAAO,CAACC,KAAK,CAACA,KAAK,CAAC;IACtB;EACF,CAAC;EAED,OAAO;IACLJ;EACF,CAAC;AAEH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export let UNVPErrorType;
|
|
2
|
+
(function (UNVPErrorType) {
|
|
3
|
+
UNVPErrorType["EmptyAppId"] = "EmptyAppId";
|
|
4
|
+
UNVPErrorType["DeviceAuthenticationFailed"] = "DeviceAuthenticationFailed";
|
|
5
|
+
UNVPErrorType["DeviceRootDetection"] = "DeviceRootDetection";
|
|
6
|
+
UNVPErrorType["HookDetection"] = "HookDetection";
|
|
7
|
+
UNVPErrorType["PlayIntegrityCheckFailed"] = "PlayIntegrityCheckFailed";
|
|
8
|
+
UNVPErrorType["EmptyEncryptedPayload"] = "EmptyEncryptedPayload";
|
|
9
|
+
UNVPErrorType["NoWallets"] = "NoWallets";
|
|
10
|
+
UNVPErrorType["InvalidCardId"] = "InvalidCardId";
|
|
11
|
+
UNVPErrorType["ProvisioningNotAllowed"] = "ProvisioningNotAllowed";
|
|
12
|
+
UNVPErrorType["CancelledByUser"] = "CancelledByUser";
|
|
13
|
+
UNVPErrorType["GoogleWalletCreationFailed"] = "GoogleWalletCreationFailed";
|
|
14
|
+
UNVPErrorType["UnknownErrorOccurred"] = "UnknownErrorOccurred";
|
|
15
|
+
UNVPErrorType["WalletProvisioningInconclusive"] = "WalletProvisioningInconclusive";
|
|
16
|
+
UNVPErrorType["WalletProvisioningError"] = "WalletProvisioningError";
|
|
17
|
+
UNVPErrorType["NetworkFailure"] = "NetworkFailure";
|
|
18
|
+
UNVPErrorType["SessionExpired"] = "SessionExpired";
|
|
19
|
+
UNVPErrorType["InvalidInfo"] = "InvalidInfo";
|
|
20
|
+
UNVPErrorType["PayloadDecryptionFailed"] = "PayloadDecryptionFailed";
|
|
21
|
+
UNVPErrorType["ApiError"] = "ApiError";
|
|
22
|
+
UNVPErrorType["InvalidNonce"] = "InvalidNonce";
|
|
23
|
+
UNVPErrorType["SDKLockout"] = "SDKLockout";
|
|
24
|
+
UNVPErrorType["NoBrowserFound"] = "NoBrowserFound";
|
|
25
|
+
UNVPErrorType["TLCMFeatureNotSupported"] = "TLCMFeatureNotSupported";
|
|
26
|
+
UNVPErrorType["TLCMUnsupportedWallet"] = "TLCMUnsupportedWallet";
|
|
27
|
+
UNVPErrorType["TLCMDetailsNotFoundInPaySdk"] = "TLCMDetailsNotFoundInPaySdk";
|
|
28
|
+
UNVPErrorType["TLCMTokenStatusExists"] = "TLCMTokenStatusExists";
|
|
29
|
+
UNVPErrorType["TLCMInvalidOperationInput"] = "TLCMInvalidOperationInput";
|
|
30
|
+
UNVPErrorType["TLCMInvalidRequest"] = "TLCMInvalidRequest";
|
|
31
|
+
UNVPErrorType["TLCMUpdateStatusNotAllowed"] = "TLCMUpdateStatusNotAllowed";
|
|
32
|
+
UNVPErrorType["TLCMTokenNotFound"] = "TLCMTokenNotFound";
|
|
33
|
+
})(UNVPErrorType || (UNVPErrorType = {}));
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNVPErrorType"],"sources":["types.ts"],"sourcesContent":["export enum UNVPErrorType {\n EmptyAppId = 'EmptyAppId',\n DeviceAuthenticationFailed = 'DeviceAuthenticationFailed',\n DeviceRootDetection = 'DeviceRootDetection',\n HookDetection = 'HookDetection',\n PlayIntegrityCheckFailed = 'PlayIntegrityCheckFailed',\n EmptyEncryptedPayload = 'EmptyEncryptedPayload',\n NoWallets = 'NoWallets',\n InvalidCardId = 'InvalidCardId',\n ProvisioningNotAllowed = 'ProvisioningNotAllowed',\n CancelledByUser = 'CancelledByUser',\n GoogleWalletCreationFailed = 'GoogleWalletCreationFailed',\n UnknownErrorOccurred = 'UnknownErrorOccurred',\n WalletProvisioningInconclusive = 'WalletProvisioningInconclusive',\n WalletProvisioningError = 'WalletProvisioningError',\n NetworkFailure = 'NetworkFailure',\n SessionExpired = 'SessionExpired',\n InvalidInfo = 'InvalidInfo',\n PayloadDecryptionFailed = 'PayloadDecryptionFailed',\n ApiError = 'ApiError',\n InvalidNonce = 'InvalidNonce',\n SDKLockout = 'SDKLockout',\n NoBrowserFound = 'NoBrowserFound',\n TLCMFeatureNotSupported = 'TLCMFeatureNotSupported',\n TLCMUnsupportedWallet = 'TLCMUnsupportedWallet',\n TLCMDetailsNotFoundInPaySdk = 'TLCMDetailsNotFoundInPaySdk',\n TLCMTokenStatusExists = 'TLCMTokenStatusExists',\n TLCMInvalidOperationInput = 'TLCMInvalidOperationInput',\n TLCMInvalidRequest = 'TLCMInvalidRequest',\n TLCMUpdateStatusNotAllowed = 'TLCMUpdateStatusNotAllowed',\n TLCMTokenNotFound = 'TLCMTokenNotFound',\n}\n\nexport interface UNVPError {\n code: string;\n description: string;\n type: UNVPErrorType;\n correlationId: string;\n}\n\nexport type UNNativePromiseReject = {\n code: string;\n message: string;\n}\n\nexport interface UNMobileWalletPayload {\n data: {\n attributes: {\n payload: string;\n };\n };\n}\n"],"mappings":"AAAA,WAAYA,aAAa;AA+BxB,WA/BWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Provider } from 'react-redux';
|
|
4
|
+
import { store } from '../../store';
|
|
5
|
+
export const withReduxStore = Component => {
|
|
6
|
+
const Wrapper = props => {
|
|
7
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
8
|
+
store: store
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Component, props));
|
|
10
|
+
};
|
|
11
|
+
return Wrapper;
|
|
12
|
+
};
|
|
13
|
+
export const withReduxStoreAndRefForwarding = Component => /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
14
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
15
|
+
store: store
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
17
|
+
ref: ref
|
|
18
|
+
}, props)));
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Provider","store","withReduxStore","Component","Wrapper","props","createElement","withReduxStoreAndRefForwarding","forwardRef","ref","_extends"],"sources":["helpers.tsx"],"sourcesContent":["import React from 'react';\nimport { Provider } from 'react-redux';\nimport { store } from '../../store';\n\nexport const withReduxStore = <Props, >(Component: React.ComponentType<any>) => {\n const Wrapper = (props: Props) => {\n return (\n <Provider store={store} >\n <Component {...props} />\n </Provider>\n );\n };\n return Wrapper;\n};\n\nexport const withReduxStoreAndRefForwarding = <Props, Ref>(Component: React.ComponentType<any>) => React.forwardRef<Ref, Props>((props, ref) => {\n return (\n <Provider store={store}>\n <Component ref={ref} {...props} />\n </Provider>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,KAAK,QAAQ,aAAa;AAEnC,OAAO,MAAMC,cAAc,GAAaC,SAAmC,IAAK;EAC9E,MAAMC,OAAO,GAAIC,KAAY,IAAK;IAChC,oBACEN,KAAA,CAAAO,aAAA,CAACN,QAAQ;MAACC,KAAK,EAAEA;IAAM,gBACrBF,KAAA,CAAAO,aAAA,CAACH,SAAS,EAAKE,KAAK,CAAI,CACf;EAEf,CAAC;EACD,OAAOD,OAAO;AAChB,CAAC;AAED,OAAO,MAAMG,8BAA8B,GAAgBJ,SAAmC,iBAAKJ,KAAK,CAACS,UAAU,CAAa,CAACH,KAAK,EAAEI,GAAG,KAAK;EAC9I,oBACEV,KAAA,CAAAO,aAAA,CAACN,QAAQ;IAACC,KAAK,EAAEA;EAAM,gBACrBF,KAAA,CAAAO,aAAA,CAACH,SAAS,EAAAO,QAAA;IAACD,GAAG,EAAEA;EAAI,GAAKJ,KAAK,EAAI,CACzB;AAEf,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
export const useListenerToEvent = listener => {
|
|
6
|
+
const isFirstRun = useRef(true);
|
|
7
|
+
const event = useSelector(state => state.sharedEvents.event);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (isFirstRun.current) {
|
|
10
|
+
isFirstRun.current = false;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (event == null || event == undefined || (event === null || event === void 0 ? void 0 : event.key) != listener.busEventKey) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
listener.action(event.data);
|
|
17
|
+
}, [event]);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useListenerToEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useSelector","useListenerToEvent","listener","isFirstRun","event","state","sharedEvents","current","undefined","key","busEventKey","action","data"],"sources":["useListenerToEvent.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { useEffect, useRef } from 'react';\nimport { useSelector } from 'react-redux';\nimport type { RootState } from '../store';\nimport type { NativeMessageType } from '../messages/nativeMessages';\nimport type { WebViewMessageType } from '../messages/webMessages';\n\nexport type BusEventKey = NativeMessageType | WebViewMessageType\n\ntype EventListener = {\n busEventKey: BusEventKey,\n action: (data: any) => void\n}\n\nexport const useListenerToEvent = (listener: EventListener) => {\n const isFirstRun = useRef(true);\n const event = useSelector((state: RootState) => state.sharedEvents.event);\n useEffect(() => {\n if (isFirstRun.current) {\n isFirstRun.current = false;\n return;\n }\n\n if (event == null || event == undefined || event?.key != listener.busEventKey) {\n return;\n }\n\n listener.action(event.data);\n\n }, [event]);\n};\n"],"mappings":"AAAA;;AAEA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,WAAW,QAAQ,aAAa;AAYzC,OAAO,MAAMC,kBAAkB,GAAIC,QAAuB,IAAK;EAC7D,MAAMC,UAAU,GAAGJ,MAAM,CAAC,IAAI,CAAC;EAC/B,MAAMK,KAAK,GAAGJ,WAAW,CAAEK,KAAgB,IAAKA,KAAK,CAACC,YAAY,CAACF,KAAK,CAAC;EACzEN,SAAS,CAAC,MAAM;IACd,IAAIK,UAAU,CAACI,OAAO,EAAE;MACtBJ,UAAU,CAACI,OAAO,GAAG,KAAK;MAC1B;IACF;IAEA,IAAIH,KAAK,IAAI,IAAI,IAAIA,KAAK,IAAII,SAAS,IAAI,CAAAJ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEK,GAAG,KAAIP,QAAQ,CAACQ,WAAW,EAAE;MAC7E;IACF;IAEAR,QAAQ,CAACS,MAAM,CAACP,KAAK,CAACQ,IAAI,CAAC;EAE7B,CAAC,EAAE,CAACR,KAAK,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { ACHEvent } from './achCreditMessage';\nimport type { BookPaymentEvent } from './bookPaymentMessage';\n\nimport type { CardEvent, CardMessage } from './cardMessage';\nimport type { PageEvent, PageMessage } from './pageMessage';\nimport type { PaymentMessage } from './paymentsMessage';\nimport type { UnitEvent, UnitMessage } from './unitMessages';\nimport type { AccountEvent, AccountMessage } from './accountMessage';\nimport type { CheckEvent, CheckMessage } from './checkMessage';\nimport type { ActivityEvent, ActivityMessage } from './activityMessage';\n\nexport type WebViewMessageType =\n | PageMessage\n | CardMessage\n | UnitMessage\n | PaymentMessage\n | AccountMessage\n | CheckMessage\n | ActivityMessage\n\ntype WebViewEvent =\n | PageEvent\n | UnitEvent\n | CardEvent\n | BookPaymentEvent\n | PaymentMessage\n | ACHEvent\n | AccountEvent\n | CheckEvent\n | ActivityEvent\n\nexport interface WebViewMessage {\n type: WebViewMessageType,\n details?: WebViewEvent\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { ACHEvent } from './achCreditMessage';\nimport type { BookPaymentEvent } from './bookPaymentMessage';\n\nimport type { CardEvent, CardMessage } from './cardMessage';\nimport type { PageEvent, PageMessage } from './pageMessage';\nimport type { PaymentMessage } from './paymentsMessage';\nimport type { UnitEvent, UnitMessage } from './unitMessages';\nimport type { AccountEvent, AccountMessage } from './accountMessage';\nimport type { CheckEvent, CheckMessage } from './checkMessage';\nimport type { ActivityEvent, ActivityMessage } from './activityMessage';\nimport type { MultipleCardsEvent, MultipleCardsMessage } from './multipleCardsMessage';\n\nexport type WebViewMessageType =\n | PageMessage\n | CardMessage\n | MultipleCardsMessage\n | UnitMessage\n | PaymentMessage\n | AccountMessage\n | CheckMessage\n | ActivityMessage\n\ntype WebViewEvent =\n | PageEvent\n | UnitEvent\n | CardEvent\n | MultipleCardsEvent\n | BookPaymentEvent\n | PaymentMessage\n | ACHEvent\n | AccountEvent\n | CheckEvent\n | ActivityEvent\n\nexport interface WebViewMessage {\n type: WebViewMessageType,\n details?: WebViewEvent\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export let MultipleCardsMessage;
|
|
2
|
+
(function (MultipleCardsMessage) {
|
|
3
|
+
MultipleCardsMessage["UNIT_MULTIPLE_CARDS_CARD_CLICKED"] = "unitMultipleCardsCardClicked";
|
|
4
|
+
})(MultipleCardsMessage || (MultipleCardsMessage = {}));
|
|
5
|
+
//# sourceMappingURL=multipleCardsMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MultipleCardsMessage"],"sources":["multipleCardsMessage.ts"],"sourcesContent":["import type { UNCardData } from '../../types/shared';\n\nexport enum MultipleCardsMessage {\n UNIT_MULTIPLE_CARDS_CARD_CLICKED = 'unitMultipleCardsCardClicked',\n}\n\nexport type MultipleCardsCardClickedEvent = UNCardData;\n\nexport type MultipleCardsEvent = MultipleCardsCardClickedEvent\n"],"mappings":"AAEA,WAAYA,oBAAoB;AAE/B,WAFWA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,KAApBA,oBAAoB"}
|
|
@@ -2,9 +2,10 @@ export let RESPONSE_KEYS;
|
|
|
2
2
|
(function (RESPONSE_KEYS) {
|
|
3
3
|
RESPONSE_KEYS["errors"] = "errors";
|
|
4
4
|
RESPONSE_KEYS["card"] = "cardResult";
|
|
5
|
+
RESPONSE_KEYS["cards"] = "cardsResult";
|
|
5
6
|
RESPONSE_KEYS["account"] = "accountResult";
|
|
6
7
|
RESPONSE_KEYS["counterpartyAccount"] = "counterpartyResult";
|
|
7
8
|
RESPONSE_KEYS["transactions"] = "transactionsResult";
|
|
8
|
-
RESPONSE_KEYS["
|
|
9
|
+
RESPONSE_KEYS["authorizations"] = "authorizationsResult";
|
|
9
10
|
})(RESPONSE_KEYS || (RESPONSE_KEYS = {}));
|
|
10
11
|
//# sourceMappingURL=onLoadMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RESPONSE_KEYS"],"sources":["onLoadMessage.ts"],"sourcesContent":["import type {UNAccountData
|
|
1
|
+
{"version":3,"names":["RESPONSE_KEYS"],"sources":["onLoadMessage.ts"],"sourcesContent":["import type {\n UNAccountData,\n UNCounterpartyAccountData,\n UNCardData,\n UNError,\n UNOnLoadResponseData,\n} 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 cards = 'cardsResult',\n account = 'accountResult',\n counterpartyAccount = 'counterpartyResult',\n transactions = 'transactionsResult',\n authorizations = 'authorizationsResult'\n}\n\nexport type CardsOnLoadResponse = {\n [RESPONSE_KEYS.cards]: UNOnLoadResponseData<[UNCardData]>\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.authorizations]: UNOnLoadResponseData<UNAuthorizationData>,\n [RESPONSE_KEYS.transactions]: UNOnLoadResponseData<UNTransactionData>\n}\n\nexport type UnitOnLoadResponseSuccessData =\n | CardOnLoadResponse\n | CardsOnLoadResponse\n | ACHOnLoadResponse\n | AccountsOnLoadResponse\n | AccountOnLoadResponse\n | ActivityOnLoadResponse\n\nexport type UnitOnLoadResponseEvent =\n | UNError\n | UnitOnLoadResponseSuccessData\n"],"mappings":"AAUA,WAAYA,aAAa;AAQxB,WARWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';
|
|
3
|
-
|
|
3
|
+
const isUNMobileWalletPayload = object => {
|
|
4
|
+
return 'data' in object && 'attributes' in object.data && 'payload' in object.data.attributes;
|
|
5
|
+
};
|
|
4
6
|
|
|
5
7
|
// TODO: use apiClient class for handling requests.
|
|
6
8
|
|
|
7
|
-
export const getMobileWalletPayload = async (customerToken, cardId, env) => {
|
|
9
|
+
export const getMobileWalletPayload = async (customerToken, cardId, env, signedNonce) => {
|
|
10
|
+
if (!signedNonce) return;
|
|
8
11
|
const headers = {
|
|
9
12
|
'Content-Type': APIHeaders.CONTENT_TYPE,
|
|
10
13
|
'Authorization': `Bearer ${customerToken}`
|
|
@@ -12,7 +15,7 @@ export const getMobileWalletPayload = async (customerToken, cardId, env) => {
|
|
|
12
15
|
const data = {
|
|
13
16
|
data: {
|
|
14
17
|
attributes: {
|
|
15
|
-
signedNonce:
|
|
18
|
+
signedNonce: signedNonce
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
};
|
|
@@ -21,10 +24,30 @@ export const getMobileWalletPayload = async (customerToken, cardId, env) => {
|
|
|
21
24
|
const response = await axios.post(baseURL, data, {
|
|
22
25
|
headers: headers
|
|
23
26
|
});
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
if (!isUNMobileWalletPayload(response.data)) {
|
|
28
|
+
const error = {
|
|
29
|
+
title: `Couldn't get mobile wallet payload. Status:${response.status} Response data:${response.data}`
|
|
30
|
+
};
|
|
31
|
+
throw error;
|
|
32
|
+
} else {
|
|
33
|
+
const encryptedPayload = response.data.data.attributes.payload;
|
|
34
|
+
return encryptedPayload;
|
|
35
|
+
}
|
|
26
36
|
} catch (error) {
|
|
27
|
-
|
|
37
|
+
// Converts the error into a UNError
|
|
38
|
+
if (axios.isAxiosError(error) && error.response) {
|
|
39
|
+
const unErrors = error.response.data;
|
|
40
|
+
throw unErrors;
|
|
41
|
+
} else if (error instanceof Error) {
|
|
42
|
+
const unexpectedError = {
|
|
43
|
+
title: 'Unexpected error',
|
|
44
|
+
error: error
|
|
45
|
+
};
|
|
46
|
+
throw unexpectedError;
|
|
47
|
+
}
|
|
48
|
+
throw {
|
|
49
|
+
title: `Unexpected error: ${error}`
|
|
50
|
+
};
|
|
28
51
|
}
|
|
29
52
|
};
|
|
30
53
|
//# sourceMappingURL=UNWalletPayloadRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["axios","APIHeaders","UNIT_SECURE_URL","
|
|
1
|
+
{"version":3,"names":["axios","APIHeaders","UNIT_SECURE_URL","isUNMobileWalletPayload","object","data","attributes","getMobileWalletPayload","customerToken","cardId","env","signedNonce","headers","CONTENT_TYPE","baseURL","response","post","error","title","status","encryptedPayload","payload","isAxiosError","unErrors","Error","unexpectedError"],"sources":["UNWalletPayloadRequest.ts"],"sourcesContent":["import axios from 'axios';\nimport { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';\nimport type { UNEnvironment } from '../../unitSdkManager/UnitSdkManager';\nimport type { UNMobileWalletPayload } from '../../helpers/pushProvisioningService/types';\nimport type { UNError, UNErrorData } from '../../types/shared/error.types';\n\nconst isUNMobileWalletPayload = (object: any): object is UNMobileWalletPayload => {\n return 'data' in object &&\n 'attributes' in object.data &&\n 'payload' in object.data.attributes;\n};\n\n// TODO: use apiClient class for handling requests.\n\nexport const getMobileWalletPayload = async (customerToken: string, cardId: string, env: UNEnvironment, signedNonce: string) => {\n if (!signedNonce) return;\n\n const headers = {\n 'Content-Type': APIHeaders.CONTENT_TYPE,\n 'Authorization': `Bearer ${customerToken}`,\n };\n\n const data = {\n data: {\n attributes: {\n signedNonce: signedNonce,\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 if (!isUNMobileWalletPayload(response.data)) {\n const error: UNErrorData = {title: `Couldn't get mobile wallet payload. Status:${response.status} Response data:${response.data}`};\n throw error;\n } else {\n const encryptedPayload = response.data.data.attributes.payload;\n return encryptedPayload;\n }\n } catch (error: unknown) {\n // Converts the error into a UNError\n if (axios.isAxiosError<UNError>(error) && error.response) {\n const unErrors = error.response.data;\n throw unErrors;\n } else if (error instanceof Error) {\n const unexpectedError: UNErrorData = {title: 'Unexpected error', error: error};\n throw unexpectedError;\n }\n throw {title: `Unexpected error: ${error}`};\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,eAAe,QAAQ,8BAA8B;AAK1E,MAAMC,uBAAuB,GAAIC,MAAW,IAAsC;EAChF,OAAO,MAAM,IAAIA,MAAM,IACrB,YAAY,IAAIA,MAAM,CAACC,IAAI,IAC3B,SAAS,IAAID,MAAM,CAACC,IAAI,CAACC,UAAU;AACvC,CAAC;;AAED;;AAEA,OAAO,MAAMC,sBAAsB,GAAG,MAAAA,CAAOC,aAAqB,EAAEC,MAAc,EAAEC,GAAkB,EAAEC,WAAmB,KAAK;EAC9H,IAAI,CAACA,WAAW,EAAE;EAElB,MAAMC,OAAO,GAAG;IACd,cAAc,EAAEX,UAAU,CAACY,YAAY;IACvC,eAAe,EAAG,UAASL,aAAc;EAC3C,CAAC;EAED,MAAMH,IAAI,GAAG;IACXA,IAAI,EAAE;MACJC,UAAU,EAAE;QACVK,WAAW,EAAEA;MACf;IACF;EACF,CAAC;EAED,MAAMG,OAAO,GAAI,GAAEZ,eAAe,CAACQ,GAAG,CAAgC,UAASD,MAAO,wBAAuB;EAC7G,IAAI;IACF,MAAMM,QAAQ,GAAG,MAAMf,KAAK,CAACgB,IAAI,CAC/BF,OAAO,EACPT,IAAI,EACJ;MACEO,OAAO,EAAEA;IACX,CAAC,CAAC;IACJ,IAAI,CAACT,uBAAuB,CAACY,QAAQ,CAACV,IAAI,CAAC,EAAE;MAC3C,MAAMY,KAAkB,GAAG;QAACC,KAAK,EAAG,8CAA6CH,QAAQ,CAACI,MAAO,kBAAiBJ,QAAQ,CAACV,IAAK;MAAC,CAAC;MAClI,MAAMY,KAAK;IACb,CAAC,MAAM;MACL,MAAMG,gBAAgB,GAAGL,QAAQ,CAACV,IAAI,CAACA,IAAI,CAACC,UAAU,CAACe,OAAO;MAC9D,OAAOD,gBAAgB;IACzB;EACF,CAAC,CAAC,OAAOH,KAAc,EAAE;IACvB;IACA,IAAIjB,KAAK,CAACsB,YAAY,CAAUL,KAAK,CAAC,IAAIA,KAAK,CAACF,QAAQ,EAAE;MACxD,MAAMQ,QAAQ,GAAGN,KAAK,CAACF,QAAQ,CAACV,IAAI;MACpC,MAAMkB,QAAQ;IAChB,CAAC,MAAM,IAAIN,KAAK,YAAYO,KAAK,EAAG;MAClC,MAAMC,eAA4B,GAAG;QAACP,KAAK,EAAE,kBAAkB;QAAED,KAAK,EAAEA;MAAK,CAAC;MAC9E,MAAMQ,eAAe;IACvB;IACA,MAAM;MAACP,KAAK,EAAG,qBAAoBD,KAAM;IAAC,CAAC;EAC7C;AACF,CAAC"}
|
|
@@ -152,6 +152,16 @@ export const DISPATCH_REQUEST_CARD_ACTION = `
|
|
|
152
152
|
document.querySelector("unit-elements-card").dispatchEvent(new CustomEvent("unitRequestCardAction", {detail: {action: action}}))
|
|
153
153
|
}
|
|
154
154
|
`;
|
|
155
|
+
export const DISPATCH_REQUEST_HIDE_SENSITIVE_DATA = `
|
|
156
|
+
const dispatchRequestHideSensitiveData = (componentName) => {
|
|
157
|
+
document.querySelector(componentName).dispatchEvent(new CustomEvent("unitRequestHideSensitiveData"))
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
160
|
+
export const DISPATCH_REQUEST_SHOW_SENSITIVE_DATA = `
|
|
161
|
+
const dispatchRequestShowSensitiveData = (componentName) => {
|
|
162
|
+
document.querySelector(componentName).dispatchEvent(new CustomEvent("unitRequestShowSensitiveData"))
|
|
163
|
+
}
|
|
164
|
+
`;
|
|
155
165
|
export const DISPATCH_REQUEST_ACCOUNT_ACTION = `
|
|
156
166
|
const dispatchRequestAccountAction = (action) => {
|
|
157
167
|
document.querySelector("unit-elements-account").dispatchEvent(new CustomEvent("unitRequestAccountAction", {detail: {action: action}}))
|