react-native-unit-components 1.9.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 +2 -2
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -2
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +11 -7
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +13 -9
- 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/UNBottomSheetComponent/UNBottomSheetComponent.js +22 -8
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js +7 -2
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +11 -8
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- 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 +11 -0
- 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 +32 -2
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/types.js +41 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.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 +27 -3
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.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/store/store.js +5 -1
- package/lib/commonjs/store/store.js.map +1 -1
- 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 +22 -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/unitSdkManager/UnitSdk.api.js +6 -13
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +8 -18
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- 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/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/module/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -2
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -2
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +11 -6
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +13 -8
- 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/UNBottomSheetComponent/UNBottomSheetComponent.js +22 -8
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js +7 -2
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +12 -8
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- 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 +1 -0
- 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 +35 -5
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/types.js +34 -0
- package/lib/module/helpers/pushProvisioningService/types.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 +27 -3
- package/lib/module/networking/requests/UNWalletPayloadRequest.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/store/store.js +5 -1
- package/lib/module/store/store.js.map +1 -1
- 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 +2 -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/unitSdkManager/UnitSdk.api.js +5 -10
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.js +8 -17
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- 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/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/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts +3 -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/{components → src/components}/index.d.ts +1 -0
- package/lib/typescript/src/helpers/pushProvisioningService/helpers.d.ts +4 -0
- package/lib/typescript/src/helpers/pushProvisioningService/types.d.ts +49 -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/{networking → src/networking}/requests/UNWalletPayloadRequest.d.ts +1 -1
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts +10 -0
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +56 -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 +2 -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/unitSdkManager/UnitSdk.api.d.ts +1 -0
- package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.d.ts +4 -8
- package/lib/typescript/src/utils/AppInfo.d.ts +4 -0
- package/lib/typescript/src/utils/SDKInfo.d.ts +1 -0
- package/lib/typescript/{webComponent → src/webComponent}/WebComponent.utils.d.ts +3 -0
- package/package.json +3 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +2 -2
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +2 -2
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +25 -12
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +33 -16
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -1
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +42 -16
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx +7 -2
- package/src/components/UNCardComponent/UNCardComponent.tsx +11 -10
- 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 +1 -0
- package/src/flows/card/UNCardFlows.ts +10 -4
- package/src/helpers/pushProvisioningService/helpers.ts +31 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +35 -6
- package/src/helpers/pushProvisioningService/types.ts +52 -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 +25 -4
- package/src/slices/ConfigurationSlice.ts +31 -0
- package/src/slices/SharedEventsSlice.ts +93 -0
- package/src/store/store.ts +6 -2
- 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 +2 -0
- package/src/types/shared/multipleCards.types.ts +8 -0
- package/src/types/shared/onLoadResponse.types.ts +2 -12
- package/src/unitSdkManager/UnitSdk.api.ts +5 -8
- package/src/unitSdkManager/UnitSdk.constants.ts +1 -1
- package/src/unitSdkManager/UnitSdkManager.ts +8 -20
- package/src/utils/AppInfo.ts +40 -0
- package/src/utils/SDKInfo.ts +5 -0
- package/src/webComponent/WebComponent.tsx +37 -34
- package/src/webComponent/WebComponent.utils.ts +17 -0
- package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +0 -35
- package/ios/UNAppInfo/UNAppInfo.swift +0 -23
- 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/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/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/store/store.d.ts +0 -6
- 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/typescript/{assets → src/assets}/images/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNAccountComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNActivityComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/index.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.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 → src/components}/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/components/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCardComponent/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/index.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/hooks/useLaunchInitialize.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/startProvisioning.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/store/helpers.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/bodyScript.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/fontFaces.d.ts +0 -0
- /package/lib/typescript/{slices → src/slices}/pushProvisioningSlice.d.ts +0 -0
- /package/lib/typescript/{store → src/store}/index.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/versioning.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/wallet.types.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdk.constants.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.utils.internal.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/unitUiManager/unitUiManager.d.ts +0 -0
- /package/lib/typescript/{utils → src/utils}/webVersioningStrategy.utils.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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _pageMessage = require("../../messages/webMessages/pageMessage");
|
|
10
|
+
var _WebComponent = require("../../webComponent/WebComponent");
|
|
11
|
+
var _webComponent = require("../../types/internal/webComponent.types");
|
|
12
|
+
var _helpers = require("../../helpers/store/helpers");
|
|
13
|
+
var _UNMultipleCardsComponent = require("./UNMultipleCardsComponent.utils");
|
|
14
|
+
var _unitMessages = require("../../messages/webMessages/unitMessages");
|
|
15
|
+
var _onLoadMessage = require("../../messages/webMessages/onLoadMessage");
|
|
16
|
+
var _multipleCardsMessage = require("../../messages/webMessages/multipleCardsMessage");
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
const DEFAULT_HEIGHT = _reactNative.Dimensions.get('window').height * 0.5;
|
|
20
|
+
const UNMultipleCardsComponent = props => {
|
|
21
|
+
const webRef = (0, _react.useRef)(null);
|
|
22
|
+
const [defaultHeight, setDefaultHeight] = (0, _react.useState)();
|
|
23
|
+
const cardClicked = card => {
|
|
24
|
+
if (props.onCardClicked) {
|
|
25
|
+
props.onCardClicked(card);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const handleUnitOnLoad = response => {
|
|
29
|
+
if (!props.onLoad) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (_onLoadMessage.RESPONSE_KEYS.errors in response) {
|
|
33
|
+
props.onLoad(response);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (_onLoadMessage.RESPONSE_KEYS.cards in response) {
|
|
37
|
+
// MultipleCardsOnLoadResponse;
|
|
38
|
+
props.onLoad(response[_onLoadMessage.RESPONSE_KEYS.cards]);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.error('On Load Error: unexpected response type');
|
|
42
|
+
return;
|
|
43
|
+
};
|
|
44
|
+
const handleWebViewMessage = message => {
|
|
45
|
+
if (!message || !message.details) return;
|
|
46
|
+
switch (message.type) {
|
|
47
|
+
case _unitMessages.UnitMessage.UNIT_ON_LOAD:
|
|
48
|
+
handleUnitOnLoad(message.details);
|
|
49
|
+
break;
|
|
50
|
+
case _pageMessage.PageMessage.PAGE_HEIGHT:
|
|
51
|
+
{
|
|
52
|
+
const currentHeight = message.details.height;
|
|
53
|
+
currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
case _multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED:
|
|
57
|
+
{
|
|
58
|
+
cardClicked(message.details);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const renderMultipleCardsWebView = () => {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
|
|
64
|
+
ref: webRef,
|
|
65
|
+
type: _webComponent.WebComponentType.multipleCards,
|
|
66
|
+
presentationMode: _webComponent.PresentationMode.Inherit,
|
|
67
|
+
params: (0, _UNMultipleCardsComponent.getMultipleCardsParams)(props),
|
|
68
|
+
script: (0, _UNMultipleCardsComponent.getMultipleCardsScript)(),
|
|
69
|
+
onMessage: message => handleWebViewMessage(message),
|
|
70
|
+
nestedScrollEnabled: true,
|
|
71
|
+
theme: props.theme,
|
|
72
|
+
language: props.language
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
if (!defaultHeight) {
|
|
76
|
+
return renderMultipleCardsWebView();
|
|
77
|
+
}
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
79
|
+
style: {
|
|
80
|
+
height: defaultHeight
|
|
81
|
+
}
|
|
82
|
+
}, renderMultipleCardsWebView());
|
|
83
|
+
};
|
|
84
|
+
var _default = (0, _helpers.withReduxStore)(UNMultipleCardsComponent);
|
|
85
|
+
exports.default = _default;
|
|
86
|
+
//# sourceMappingURL=UNMultipleCardsComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_pageMessage","_WebComponent","_webComponent","_helpers","_UNMultipleCardsComponent","_unitMessages","_onLoadMessage","_multipleCardsMessage","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_HEIGHT","Dimensions","height","UNMultipleCardsComponent","props","webRef","useRef","defaultHeight","setDefaultHeight","useState","cardClicked","card","onCardClicked","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","cards","console","error","handleWebViewMessage","message","details","type","UnitMessage","UNIT_ON_LOAD","PageMessage","PAGE_HEIGHT","currentHeight","MultipleCardsMessage","UNIT_MULTIPLE_CARDS_CARD_CLICKED","renderMultipleCardsWebView","createElement","WebComponent","ref","WebComponentType","multipleCards","presentationMode","PresentationMode","Inherit","params","getMultipleCardsParams","script","getMultipleCardsScript","onMessage","nestedScrollEnabled","theme","language","View","style","_default","withReduxStore","exports"],"sources":["UNMultipleCardsComponent.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { WebComponent } from '../../webComponent/WebComponent';\n\nimport type WebView from 'react-native-webview';\n\nimport { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';\nimport { withReduxStore } from '../../helpers/store/helpers';\nimport { getMultipleCardsParams, getMultipleCardsScript } from './UNMultipleCardsComponent.utils';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\nimport type { UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\nimport { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type {\n UNCardData,\n UNError,\n UNMultipleCardsComponentPaginationType,\n UNMultipleCardsOnLoadData,\n UNOnLoadResponse,\n UNOnLoadResponseData,\n} from '../../types/shared';\nimport { MultipleCardsCardClickedEvent, MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';\n\nconst DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;\n\nexport interface UNMultipleCardsComponentProps {\n // inputs\n customerToken: string;\n\n // ui\n paginationType?: UNMultipleCardsComponentPaginationType;\n cardsPerPage?: number;\n disableCardClick?: boolean;\n theme?: string;\n language?: string;\n queryFilter?: string;\n hideTitle?: boolean;\n\n // events\n onLoad?: (response: UNOnLoadResponse<UNMultipleCardsOnLoadData>) => void;\n onCardClicked?: (card: UNCardData) => void;\n}\n\nconst UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {\n const webRef = useRef<WebView>(null);\n const [defaultHeight, setDefaultHeight] = useState<number>();\n\n const cardClicked = (card: UNCardData) => {\n if (props.onCardClicked) {\n props.onCardClicked(card);\n }\n };\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.cards in response) {\n // MultipleCardsOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.cards] as UNOnLoadResponseData<UNMultipleCardsOnLoadData>);\n return;\n }\n\n console.error('On Load Error: unexpected response type');\n return;\n };\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (!message || !message.details) return;\n switch (message.type) {\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case PageMessage.PAGE_HEIGHT: {\n const currentHeight = (message.details as HeightEvent).height;\n currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);\n break;\n }\n case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED: {\n cardClicked(message.details as MultipleCardsCardClickedEvent);\n }\n }\n };\n\n const renderMultipleCardsWebView = () => {\n return (\n <WebComponent\n ref={webRef}\n type={WebComponentType.multipleCards}\n presentationMode={PresentationMode.Inherit}\n params={getMultipleCardsParams(props)}\n script={getMultipleCardsScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n nestedScrollEnabled={true}\n theme={props.theme}\n language={props.language}\n />\n );\n };\n\n if (!defaultHeight) {\n return renderMultipleCardsWebView();\n }\n\n return (\n <View style={{ height: defaultHeight }}>\n {renderMultipleCardsWebView()}\n </View>\n );\n};\n\nexport default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAIA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,yBAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAEA,IAAAQ,cAAA,GAAAR,OAAA;AASA,IAAAS,qBAAA,GAAAT,OAAA;AAAsH,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OA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AE9B,MAAO;MACZmB,IAAI,EAAEY,8BAAgB,CAACC,aAAc;MACrCC,gBAAgB,EAAEC,8BAAgB,CAACC,OAAQ;MAC3CC,MAAM,EAAE,IAAAC,gDAAsB,EAACtC,KAAK,CAAE;MACtCuC,MAAM,EAAE,IAAAC,gDAAsB,GAAG;MACjCC,SAAS,EAAGvB,OAAuB,IAAKD,oBAAoB,CAACC,OAAO,CAAE;MACtEwB,mBAAmB,EAAE,IAAK;MAC1BC,KAAK,EAAE3C,KAAK,CAAC2C,KAAM;MACnBC,QAAQ,EAAE5C,KAAK,CAAC4C;IAAS,EACzB;EAEN,CAAC;EAED,IAAI,CAACzC,aAAa,EAAE;IAClB,OAAOyB,0BAA0B,EAAE;EACrC;EAEA,oBACElE,MAAA,CAAAmB,OAAA,CAAAgD,aAAA,CAAChE,YAAA,CAAAgF,IAAI;IAACC,KAAK,EAAE;MAAEhD,MAAM,EAAEK;IAAc;EAAE,GACpCyB,0BAA0B,EAAE,CACxB;AAEX,CAAC;AAAC,IAAAmB,QAAA,GAEa,IAAAC,uBAAc,EAAgCjD,wBAAwB,CAAC;AAAAkD,OAAA,CAAApE,OAAA,GAAAkE,QAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMultipleCardsScript = exports.getMultipleCardsParams = void 0;
|
|
7
|
+
var _multipleCardsMessage = require("../../messages/webMessages/multipleCardsMessage");
|
|
8
|
+
const getMultipleCardsParams = props => {
|
|
9
|
+
const paginationType = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
|
|
10
|
+
const cardsPerPage = props.cardsPerPage ? `cards-per-page="${props.cardsPerPage}"` : '';
|
|
11
|
+
const queryFilter = props.queryFilter ? `query-filter="${props.queryFilter}"` : '';
|
|
12
|
+
return `
|
|
13
|
+
customer-token="${props.customerToken}"
|
|
14
|
+
${paginationType}
|
|
15
|
+
${cardsPerPage}
|
|
16
|
+
disable-card-click="${props.disableCardClick || false}"
|
|
17
|
+
${queryFilter}
|
|
18
|
+
hide-title="${props.hideTitle || false}"
|
|
19
|
+
style="height: 100%"
|
|
20
|
+
`;
|
|
21
|
+
};
|
|
22
|
+
exports.getMultipleCardsParams = getMultipleCardsParams;
|
|
23
|
+
const MULTIPLE_CARDS_LISTENERS = {
|
|
24
|
+
cardClicked: `
|
|
25
|
+
window.addEventListener("${_multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", (e) => {
|
|
26
|
+
const response = e.detail
|
|
27
|
+
response.then((data) => {
|
|
28
|
+
postMessageToSDK({ type: "${_multipleCardsMessage.MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", details: data.data })
|
|
29
|
+
}).catch((e) => {
|
|
30
|
+
console.log(e)
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
`
|
|
34
|
+
};
|
|
35
|
+
const getMultipleCardsScript = () => {
|
|
36
|
+
return `
|
|
37
|
+
${MULTIPLE_CARDS_LISTENERS.cardClicked}
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
exports.getMultipleCardsScript = getMultipleCardsScript;
|
|
41
|
+
//# sourceMappingURL=UNMultipleCardsComponent.utils.js.map
|
package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_multipleCardsMessage","require","getMultipleCardsParams","props","paginationType","cardsPerPage","queryFilter","customerToken","disableCardClick","hideTitle","exports","MULTIPLE_CARDS_LISTENERS","cardClicked","MultipleCardsMessage","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,IAAAA,qBAAA,GAAAC,OAAA;AAEO,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;AAACC,OAAA,CAAAR,sBAAA,GAAAA,sBAAA;AAEF,MAAMS,wBAAwB,GAAG;EAC/BC,WAAW,EAAG;AAChB,+BAA+BC,0CAAoB,CAACC,gCAAiC;AACrF;AACA;AACA,oCAAoCD,0CAAoB,CAACC,gCAAiC;AAC1F;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,OAAQ;AACV,OAAOJ,wBAAwB,CAACC,WAAY;AAC5C,GAAG;AACH,CAAC;AAACF,OAAA,CAAAK,sBAAA,GAAAA,sBAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "UNMultipleCardsComponent", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _UNMultipleCardsComponent.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "UNMultipleCardsComponentProps", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _UNMultipleCardsComponent.UNMultipleCardsComponentProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _UNMultipleCardsComponent = _interopRequireWildcard(require("./UNMultipleCardsComponent"));
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_UNMultipleCardsComponent","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["index.ts"],"sourcesContent":["export {\n default as UNMultipleCardsComponent, UNMultipleCardsComponentProps,\n} from './UNMultipleCardsComponent';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEoC,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
|
|
@@ -14,6 +14,17 @@ Object.keys(_UNCardComponent).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
var _UNMultipleCardsComponent = require("./UNMultipleCardsComponent");
|
|
18
|
+
Object.keys(_UNMultipleCardsComponent).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _UNMultipleCardsComponent[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _UNMultipleCardsComponent[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
17
28
|
var _UNBottomSheetComponent = require("./UNBottomSheetComponent");
|
|
18
29
|
Object.keys(_UNBottomSheetComponent).forEach(function (key) {
|
|
19
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_UNCardComponent","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_UNBottomSheetComponent","_UNBookPaymentComponent","_UNActivityComponent","_UNAccountComponent","_UNCheckDepositComponent","_UNACHDebitComponent","_UNACHCreditComponent"],"sources":["index.ts"],"sourcesContent":["export * from './UNCardComponent';\nexport * from './UNBottomSheetComponent';\nexport * from './UNBookPaymentComponent';\nexport * from './UNActivityComponent';\nexport * from './UNAccountComponent';\nexport * from './UNCheckDepositComponent';\nexport * from './UNACHDebitComponent';\nexport * from './UNACHCreditComponent';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,
|
|
1
|
+
{"version":3,"names":["_UNCardComponent","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_UNMultipleCardsComponent","_UNBottomSheetComponent","_UNBookPaymentComponent","_UNActivityComponent","_UNAccountComponent","_UNCheckDepositComponent","_UNACHDebitComponent","_UNACHCreditComponent"],"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,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OA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AA;AAAA;AACA,IAAAW,oBAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,oBAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,oBAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,oBAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,qBAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,qBAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,qBAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,qBAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -4,28 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UNCardFlows = void 0;
|
|
7
|
-
var _EventBus = _interopRequireDefault(require("../../helpers/EventBus"));
|
|
8
7
|
var _webComponent = require("../../types/internal/webComponent.types");
|
|
9
8
|
var _bottomSheet = require("../../types/internal/bottomSheet.types");
|
|
10
9
|
var _bottomSheetMessage = require("../../messages/nativeMessages/bottomSheetMessage");
|
|
11
|
-
|
|
10
|
+
var _reactRedux = require("react-redux");
|
|
11
|
+
var _SharedEventsSlice = require("../../slices/SharedEventsSlice");
|
|
12
12
|
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; }
|
|
13
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
14
14
|
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); }
|
|
15
15
|
class UNCardFlows {}
|
|
16
16
|
exports.UNCardFlows = UNCardFlows;
|
|
17
17
|
_defineProperty(UNCardFlows, "startPushProvisioning", async (cardId, customerToken) => {
|
|
18
|
+
const dispatch = (0, _reactRedux.useDispatch)(); //todo: can we use hook here?
|
|
18
19
|
try {
|
|
19
20
|
const addToWalletComponentData = {
|
|
20
21
|
type: _webComponent.WebComponentType.cardAction,
|
|
21
22
|
presentationMode: _webComponent.PresentationMode.CoverInjectedHeight,
|
|
22
23
|
params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`
|
|
23
24
|
};
|
|
24
|
-
const
|
|
25
|
+
const data = {
|
|
25
26
|
type: _bottomSheet.BottomSheetRenderingType.WebComponent,
|
|
26
27
|
data: addToWalletComponentData
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
dispatch((0, _SharedEventsSlice.setEvent)({
|
|
30
|
+
key: _bottomSheetMessage.BottomSheetNativeMessage.START_FLOW,
|
|
31
|
+
data
|
|
32
|
+
}));
|
|
29
33
|
} catch (error) {
|
|
30
34
|
console.error(error);
|
|
31
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_webComponent","require","_bottomSheet","_bottomSheetMessage","_reactRedux","_SharedEventsSlice","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","UNCardFlows","exports","cardId","customerToken","dispatch","useDispatch","addToWalletComponentData","type","WebComponentType","cardAction","presentationMode","PresentationMode","CoverInjectedHeight","params","data","BottomSheetRenderingType","WebComponent","setEvent","BottomSheetNativeMessage","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,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAA0D,SAAAK,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA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{
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.promiseRejectToUNVPErrorType = exports.isUNVPError = exports.isUNNativePromiseReject = void 0;
|
|
7
|
+
var _types = require("./types");
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
9
|
+
|
|
10
|
+
const isUNVPError = error => {
|
|
11
|
+
return 'code' in error && 'description' in error && 'type' in error && isUNVPErrorType(error.type) && 'correlationId' in error;
|
|
12
|
+
};
|
|
13
|
+
exports.isUNVPError = isUNVPError;
|
|
14
|
+
const isUNVPErrorType = type => {
|
|
15
|
+
return Object.values(_types.UNVPErrorType).includes(type);
|
|
16
|
+
};
|
|
17
|
+
const isUNNativePromiseReject = error => {
|
|
18
|
+
return 'code' in error && 'message' in error;
|
|
19
|
+
};
|
|
20
|
+
exports.isUNNativePromiseReject = isUNNativePromiseReject;
|
|
21
|
+
const promiseRejectToUNVPErrorType = error => {
|
|
22
|
+
// validate the shape of a promise reject we get from iOS/Android native
|
|
23
|
+
if (!isUNNativePromiseReject(error)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const parsedError = JSON.parse(error.message);
|
|
27
|
+
// validate the shape of an error we get from VDE SDK
|
|
28
|
+
if (!isUNVPError(parsedError)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return parsedError.type;
|
|
32
|
+
};
|
|
33
|
+
exports.promiseRejectToUNVPErrorType = promiseRejectToUNVPErrorType;
|
|
34
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_types","require","isUNVPError","error","isUNVPErrorType","type","exports","Object","values","UNVPErrorType","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":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AADA;;AAGO,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;AAACG,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AAEF,MAAME,eAAe,GAAIC,IAAS,IAA4B;EAC5D,OAAOE,MAAM,CAACC,MAAM,CAACC,oBAAa,CAAC,CAACC,QAAQ,CAACL,IAAI,CAAC;AACpD,CAAC;AAEM,MAAMM,uBAAuB,GAAIR,KAAU,IAAqC;EACrF,OAAO,MAAM,IAAIA,KAAK,IAAI,SAAS,IAAIA,KAAK;AAC9C,CAAC;AAACG,OAAA,CAAAK,uBAAA,GAAAA,uBAAA;AAEK,MAAMC,4BAA4B,GAAIT,KAAU,IAA2B;EAChF;EACA,IAAI,CAACQ,uBAAuB,CAACR,KAAK,CAAC,EAAE;IACnC,OAAO,IAAI;EACb;EACA,MAAMU,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACZ,KAAK,CAACa,OAAO,CAAC;EAC7C;EACA,IAAI,CAACd,WAAW,CAACW,WAAW,CAAC,EAAE;IAC7B,OAAO,IAAI;EACb;EACA,OAAOA,WAAW,CAACR,IAAI;AACzB,CAAC;AAACC,OAAA,CAAAM,4BAAA,GAAAA,4BAAA"}
|
|
@@ -11,6 +11,10 @@ var _UNWalletPayloadRequest = require("../../../networking/requests/UNWalletPayl
|
|
|
11
11
|
var _reactRedux = require("react-redux");
|
|
12
12
|
var _pushProvisioningSlice = require("../../../slices/pushProvisioningSlice");
|
|
13
13
|
var _useLaunchInitialize = require("./useLaunchInitialize");
|
|
14
|
+
var _types = require("../types");
|
|
15
|
+
var _helpers = require("../helpers");
|
|
16
|
+
var _error = require("../../../types/shared/error.types");
|
|
17
|
+
var _errorHelpers = require("../../../types/internal/errorHelpers");
|
|
14
18
|
const useCardWallet = cardId => {
|
|
15
19
|
const [currentUNWallet, setCurrentUNWallet] = (0, _react.useState)();
|
|
16
20
|
const {
|
|
@@ -19,12 +23,17 @@ const useCardWallet = cardId => {
|
|
|
19
23
|
const {
|
|
20
24
|
initializePushProvisioning
|
|
21
25
|
} = (0, _useLaunchInitialize.useLaunchInitialize)();
|
|
26
|
+
const dispatch = (0, _reactRedux.useDispatch)();
|
|
27
|
+
const isRecoveringSignedNonceRef = (0, _react.useRef)(false);
|
|
28
|
+
const shouldRecoverVPSDKForError = errorType => {
|
|
29
|
+
const recoveringTypes = [_types.UNVPErrorType.PayloadDecryptionFailed, _types.UNVPErrorType.SessionExpired, _types.UNVPErrorType.InvalidNonce];
|
|
30
|
+
return recoveringTypes.includes(errorType);
|
|
31
|
+
};
|
|
22
32
|
(0, _react.useEffect)(() => {
|
|
23
33
|
const getEncryptedPayload = async () => {
|
|
24
34
|
const env = _UnitSdkManager.UnitSDK.getEnv();
|
|
25
35
|
const customerToken = _UnitSdkManager.UnitSDK.getCustomerToken();
|
|
26
36
|
if (!env || !customerToken) return;
|
|
27
|
-
|
|
28
37
|
// In case we use flow
|
|
29
38
|
if (!signedNonce) {
|
|
30
39
|
await initializePushProvisioning();
|
|
@@ -47,7 +56,28 @@ const useCardWallet = cardId => {
|
|
|
47
56
|
setCurrentUNWallet(unWallet);
|
|
48
57
|
return;
|
|
49
58
|
} catch (error) {
|
|
50
|
-
|
|
59
|
+
console.error('Coudln\'t get card wallet data:', error);
|
|
60
|
+
if (isRecoveringSignedNonceRef.current) return;
|
|
61
|
+
isRecoveringSignedNonceRef.current = true;
|
|
62
|
+
|
|
63
|
+
// handle unit network api errors
|
|
64
|
+
if ((0, _errorHelpers.isUNError)(error)) {
|
|
65
|
+
var _errors$;
|
|
66
|
+
const errors = error.errors;
|
|
67
|
+
// errors will return in an array but hold only a single error element
|
|
68
|
+
if (((_errors$ = errors[0]) === null || _errors$ === void 0 ? void 0 : _errors$.code) === _error.UNErrorCodes.INVALID_NONCE) {
|
|
69
|
+
dispatch((0, _pushProvisioningSlice.setSignedNonce)(null));
|
|
70
|
+
}
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// handle VDE SDK errors
|
|
75
|
+
const errorType = (0, _helpers.promiseRejectToUNVPErrorType)(error);
|
|
76
|
+
if (!errorType) return;
|
|
77
|
+
if (shouldRecoverVPSDKForError(errorType)) {
|
|
78
|
+
dispatch((0, _pushProvisioningSlice.setSignedNonce)(null));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
51
81
|
}
|
|
52
82
|
};
|
|
53
83
|
getCardWalletData();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_wallet","_UnitSdkManager","_UNWalletPayloadRequest","_reactRedux","_pushProvisioningSlice","_useLaunchInitialize","useCardWallet","cardId","currentUNWallet","setCurrentUNWallet","useState","signedNonce","useSelector","selectWallet","initializePushProvisioning","useLaunchInitialize","useEffect","getEncryptedPayload","env","UnitSDK","getEnv","customerToken","getCustomerToken","encryptedPayload","getMobileWalletPayload","getCardWalletData","currentProvisioningModule","getPushProvisionModule","walletsResponse","launchGetWallets","JSON","stringify","encPayload","unWallet","parseWalletsResponse","error","
|
|
1
|
+
{"version":3,"names":["_react","require","_wallet","_UnitSdkManager","_UNWalletPayloadRequest","_reactRedux","_pushProvisioningSlice","_useLaunchInitialize","_types","_helpers","_error","_errorHelpers","useCardWallet","cardId","currentUNWallet","setCurrentUNWallet","useState","signedNonce","useSelector","selectWallet","initializePushProvisioning","useLaunchInitialize","dispatch","useDispatch","isRecoveringSignedNonceRef","useRef","shouldRecoverVPSDKForError","errorType","recoveringTypes","UNVPErrorType","PayloadDecryptionFailed","SessionExpired","InvalidNonce","includes","useEffect","getEncryptedPayload","env","UnitSDK","getEnv","customerToken","getCustomerToken","encryptedPayload","getMobileWalletPayload","getCardWalletData","currentProvisioningModule","getPushProvisionModule","walletsResponse","launchGetWallets","JSON","stringify","encPayload","unWallet","parseWalletsResponse","error","console","current","isUNError","_errors$","errors","code","UNErrorCodes","INVALID_NONCE","setSignedNonce","promiseRejectToUNVPErrorType","exports","parsedWalletsResponse","parse","wallets","UNWalletCode","Apple","name","UNWalletName","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,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAMO,MAAMW,aAAa,GAAIC,MAAc,IAAK;EAC/C,MAAM,CAACC,eAAe,EAAEC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,GAAY;EAClE,MAAM;IAAEC;EAAY,CAAC,GAAG,IAAAC,uBAAW,EAACC,mCAAY,CAAC;EACjD,MAAM;IAAEC;EAA2B,CAAC,GAAG,IAAAC,wCAAmB,GAAE;EAC5D,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,GAAE;EAC9B,MAAMC,0BAA0B,GAAG,IAAAC,aAAM,EAAU,KAAK,CAAC;EAEzD,MAAMC,0BAA0B,GAAIC,SAAwB,IAAK;IAC/D,MAAMC,eAAe,GAAG,CAACC,oBAAa,CAACC,uBAAuB,EAAED,oBAAa,CAACE,cAAc,EAAEF,oBAAa,CAACG,YAAY,CAAC;IACzH,OAAOJ,eAAe,CAACK,QAAQ,CAACN,SAAS,CAAC;EAC5C,CAAC;EAED,I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F,IAAI,CAACH,YAAY,EAAE,OAAO,IAAI;MAC9B,OAAQ;QAAEH,IAAI,EAAEC,oBAAY,CAACK,MAAM;QAAEjB,IAAI,EAAES,oBAAY,CAACQ,MAAM;QAAEJ,MAAM,EAAEC,YAAY,CAAC,CAAC,CAAC,CAACD;MAAO,CAAC;IAClG;EACF,CAAC,CAAC,OAAOnB,KAAK,EAAE;IACd,MAAM,IAAIwB,KAAK,CAAC,+BAA+B,CAAC;EAClD;AACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UNVPErrorType = void 0;
|
|
7
|
+
let UNVPErrorType;
|
|
8
|
+
exports.UNVPErrorType = UNVPErrorType;
|
|
9
|
+
(function (UNVPErrorType) {
|
|
10
|
+
UNVPErrorType["EmptyAppId"] = "EmptyAppId";
|
|
11
|
+
UNVPErrorType["DeviceAuthenticationFailed"] = "DeviceAuthenticationFailed";
|
|
12
|
+
UNVPErrorType["DeviceRootDetection"] = "DeviceRootDetection";
|
|
13
|
+
UNVPErrorType["HookDetection"] = "HookDetection";
|
|
14
|
+
UNVPErrorType["PlayIntegrityCheckFailed"] = "PlayIntegrityCheckFailed";
|
|
15
|
+
UNVPErrorType["EmptyEncryptedPayload"] = "EmptyEncryptedPayload";
|
|
16
|
+
UNVPErrorType["NoWallets"] = "NoWallets";
|
|
17
|
+
UNVPErrorType["InvalidCardId"] = "InvalidCardId";
|
|
18
|
+
UNVPErrorType["ProvisioningNotAllowed"] = "ProvisioningNotAllowed";
|
|
19
|
+
UNVPErrorType["CancelledByUser"] = "CancelledByUser";
|
|
20
|
+
UNVPErrorType["GoogleWalletCreationFailed"] = "GoogleWalletCreationFailed";
|
|
21
|
+
UNVPErrorType["UnknownErrorOccurred"] = "UnknownErrorOccurred";
|
|
22
|
+
UNVPErrorType["WalletProvisioningInconclusive"] = "WalletProvisioningInconclusive";
|
|
23
|
+
UNVPErrorType["WalletProvisioningError"] = "WalletProvisioningError";
|
|
24
|
+
UNVPErrorType["NetworkFailure"] = "NetworkFailure";
|
|
25
|
+
UNVPErrorType["SessionExpired"] = "SessionExpired";
|
|
26
|
+
UNVPErrorType["InvalidInfo"] = "InvalidInfo";
|
|
27
|
+
UNVPErrorType["PayloadDecryptionFailed"] = "PayloadDecryptionFailed";
|
|
28
|
+
UNVPErrorType["ApiError"] = "ApiError";
|
|
29
|
+
UNVPErrorType["InvalidNonce"] = "InvalidNonce";
|
|
30
|
+
UNVPErrorType["SDKLockout"] = "SDKLockout";
|
|
31
|
+
UNVPErrorType["NoBrowserFound"] = "NoBrowserFound";
|
|
32
|
+
UNVPErrorType["TLCMFeatureNotSupported"] = "TLCMFeatureNotSupported";
|
|
33
|
+
UNVPErrorType["TLCMUnsupportedWallet"] = "TLCMUnsupportedWallet";
|
|
34
|
+
UNVPErrorType["TLCMDetailsNotFoundInPaySdk"] = "TLCMDetailsNotFoundInPaySdk";
|
|
35
|
+
UNVPErrorType["TLCMTokenStatusExists"] = "TLCMTokenStatusExists";
|
|
36
|
+
UNVPErrorType["TLCMInvalidOperationInput"] = "TLCMInvalidOperationInput";
|
|
37
|
+
UNVPErrorType["TLCMInvalidRequest"] = "TLCMInvalidRequest";
|
|
38
|
+
UNVPErrorType["TLCMUpdateStatusNotAllowed"] = "TLCMUpdateStatusNotAllowed";
|
|
39
|
+
UNVPErrorType["TLCMTokenNotFound"] = "TLCMTokenNotFound";
|
|
40
|
+
})(UNVPErrorType || (exports.UNVPErrorType = UNVPErrorType = {}));
|
|
41
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNVPErrorType","exports"],"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":";;;;;;IAAYA,aAAa;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAAA,WAAbA,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,KAAAC,OAAA,CAAAD,aAAA,GAAbA,aAAa"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useListenerToEvent = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactRedux = require("react-redux");
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
+
|
|
11
|
+
const useListenerToEvent = listener => {
|
|
12
|
+
const isFirstRun = (0, _react.useRef)(true);
|
|
13
|
+
const event = (0, _reactRedux.useSelector)(state => state.sharedEvents.event);
|
|
14
|
+
(0, _react.useEffect)(() => {
|
|
15
|
+
if (isFirstRun.current) {
|
|
16
|
+
isFirstRun.current = false;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (event == null || event == undefined || (event === null || event === void 0 ? void 0 : event.key) != listener.busEventKey) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
listener.action(event.data);
|
|
23
|
+
}, [event]);
|
|
24
|
+
};
|
|
25
|
+
exports.useListenerToEvent = useListenerToEvent;
|
|
26
|
+
//# sourceMappingURL=useListenerToEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactRedux","useListenerToEvent","listener","isFirstRun","useRef","event","useSelector","state","sharedEvents","useEffect","current","undefined","key","busEventKey","action","data","exports"],"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":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAHA;;AAeO,MAAME,kBAAkB,GAAIC,QAAuB,IAAK;EAC7D,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAC/B,MAAMC,KAAK,GAAG,IAAAC,uBAAW,EAAEC,KAAgB,IAAKA,KAAK,CAACC,YAAY,CAACH,KAAK,CAAC;EACzE,IAAAI,gBAAS,EAAC,MAAM;IACd,IAAIN,UAAU,CAACO,OAAO,EAAE;MACtBP,UAAU,CAACO,OAAO,GAAG,KAAK;MAC1B;IACF;IAEA,IAAIL,KAAK,IAAI,IAAI,IAAIA,KAAK,IAAIM,SAAS,IAAI,CAAAN,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,GAAG,KAAIV,QAAQ,CAACW,WAAW,EAAE;MAC7E;IACF;IAEAX,QAAQ,CAACY,MAAM,CAACT,KAAK,CAACU,IAAI,CAAC;EAE7B,CAAC,EAAE,CAACV,KAAK,CAAC,CAAC;AACb,CAAC;AAACW,OAAA,CAAAf,kBAAA,GAAAA,kBAAA"}
|
|
@@ -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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MultipleCardsMessage = void 0;
|
|
7
|
+
let MultipleCardsMessage;
|
|
8
|
+
exports.MultipleCardsMessage = MultipleCardsMessage;
|
|
9
|
+
(function (MultipleCardsMessage) {
|
|
10
|
+
MultipleCardsMessage["UNIT_MULTIPLE_CARDS_CARD_CLICKED"] = "unitMultipleCardsCardClicked";
|
|
11
|
+
})(MultipleCardsMessage || (exports.MultipleCardsMessage = MultipleCardsMessage = {}));
|
|
12
|
+
//# sourceMappingURL=multipleCardsMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MultipleCardsMessage","exports"],"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":";;;;;;IAEYA,oBAAoB;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AAAA,WAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,KAAAC,OAAA,CAAAD,oBAAA,GAApBA,oBAAoB"}
|
|
@@ -9,9 +9,10 @@ exports.RESPONSE_KEYS = RESPONSE_KEYS;
|
|
|
9
9
|
(function (RESPONSE_KEYS) {
|
|
10
10
|
RESPONSE_KEYS["errors"] = "errors";
|
|
11
11
|
RESPONSE_KEYS["card"] = "cardResult";
|
|
12
|
+
RESPONSE_KEYS["cards"] = "cardsResult";
|
|
12
13
|
RESPONSE_KEYS["account"] = "accountResult";
|
|
13
14
|
RESPONSE_KEYS["counterpartyAccount"] = "counterpartyResult";
|
|
14
15
|
RESPONSE_KEYS["transactions"] = "transactionsResult";
|
|
15
|
-
RESPONSE_KEYS["
|
|
16
|
+
RESPONSE_KEYS["authorizations"] = "authorizationsResult";
|
|
16
17
|
})(RESPONSE_KEYS || (exports.RESPONSE_KEYS = RESPONSE_KEYS = {}));
|
|
17
18
|
//# sourceMappingURL=onLoadMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RESPONSE_KEYS","exports"],"sources":["onLoadMessage.ts"],"sourcesContent":["import type {UNAccountData
|
|
1
|
+
{"version":3,"names":["RESPONSE_KEYS","exports"],"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":";;;;;;IAUYA,aAAa;AAAAC,OAAA,CAAAD,aAAA,GAAAA,aAAA;AAAA,WAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAAC,OAAA,CAAAD,aAAA,GAAbA,aAAa"}
|