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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["configureStore","wallet","store","reducer"],"sources":["store.ts"],"sourcesContent":["import { configureStore } from '@reduxjs/toolkit';\nimport wallet from '../slices/pushProvisioningSlice';\n\nexport const store = configureStore({\n reducer: {\n wallet
|
|
1
|
+
{"version":3,"names":["configureStore","wallet","configuration","sharedEvents","store","reducer"],"sources":["store.ts"],"sourcesContent":["import { configureStore } from '@reduxjs/toolkit';\nimport wallet from '../slices/pushProvisioningSlice';\nimport configuration from '../slices/ConfigurationSlice';\nimport sharedEvents from '../slices/SharedEventsSlice';\n\nexport const store = configureStore({\n reducer: {\n wallet,\n configuration,\n sharedEvents,\n },\n});\n\nexport type RootState = ReturnType<typeof store.getState>;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,kBAAkB;AACjD,OAAOC,MAAM,MAAM,iCAAiC;AACpD,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,YAAY,MAAM,6BAA6B;AAEtD,OAAO,MAAMC,KAAK,GAAGJ,cAAc,CAAC;EAClCK,OAAO,EAAE;IACPJ,MAAM;IACNC,aAAa;IACbC;EACF;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
const isUNErrorData = obj => {
|
|
4
|
+
return typeof obj === 'object' && 'title' in obj;
|
|
5
|
+
};
|
|
6
|
+
export const isUNErrorDataArray = arr => {
|
|
7
|
+
return Array.isArray(arr) && arr.every(item => isUNErrorData(item));
|
|
8
|
+
};
|
|
9
|
+
export const isUNError = error => {
|
|
10
|
+
return 'errors' in error && isUNErrorDataArray(error.errors);
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=errorHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isUNErrorData","obj","isUNErrorDataArray","arr","Array","isArray","every","item","isUNError","error","errors"],"sources":["errorHelpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { UNErrorData } from '../shared/error.types';\nimport type { UNError } from '../shared';\n\nconst isUNErrorData = (obj: any): obj is UNErrorData => {\n return (\n typeof obj === 'object' &&\n 'title' in obj\n );\n};\n\nexport const isUNErrorDataArray = (arr: any): arr is UNErrorData[] => {\n return (\n Array.isArray(arr) &&\n arr.every((item) => isUNErrorData(item))\n );\n};\n\nexport const isUNError = (error: any): error is UNError => {\n return 'errors' in error && isUNErrorDataArray(error.errors);\n};\n"],"mappings":"AAAA;;AAKA,MAAMA,aAAa,GAAIC,GAAQ,IAAyB;EACtD,OACE,OAAOA,GAAG,KAAK,QAAQ,IACvB,OAAO,IAAIA,GAAG;AAElB,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAIC,GAAQ,IAA2B;EACpE,OACEC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,IAClBA,GAAG,CAACG,KAAK,CAAEC,IAAI,IAAKP,aAAa,CAACO,IAAI,CAAC,CAAC;AAE5C,CAAC;AAED,OAAO,MAAMC,SAAS,GAAIC,KAAU,IAAuB;EACzD,OAAO,QAAQ,IAAIA,KAAK,IAAIP,kBAAkB,CAACO,KAAK,CAACC,MAAM,CAAC;AAC9D,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export let WebComponentType;
|
|
2
2
|
(function (WebComponentType) {
|
|
3
3
|
WebComponentType["card"] = "unit-elements-card";
|
|
4
|
+
WebComponentType["multipleCards"] = "unit-elements-multiple-cards";
|
|
4
5
|
WebComponentType["bookPayment"] = "unit-elements-book-payment";
|
|
5
6
|
WebComponentType["activity"] = "unit-elements-activity";
|
|
6
7
|
WebComponentType["slot"] = "unit-elements-sdk-slot";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebComponentType","PresentationMode"],"sources":["webComponent.types.ts"],"sourcesContent":["export enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n checkDeposit = 'unit-elements-check-deposit',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment',\n
|
|
1
|
+
{"version":3,"names":["WebComponentType","PresentationMode"],"sources":["webComponent.types.ts"],"sourcesContent":["export enum WebComponentType {\n card = 'unit-elements-card',\n multipleCards = 'unit-elements-multiple-cards',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n checkDeposit = 'unit-elements-check-deposit',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment',\n cardAction = 'unit-elements-card-action',\n}\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n"],"mappings":"AAAA,WAAYA,gBAAgB;AAW3B,WAXWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAa5B,WAAYC,gBAAgB;AAY3B,WAZWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export let UNActivityComponentPaginationType;
|
|
2
|
+
(function (UNActivityComponentPaginationType) {
|
|
3
|
+
UNActivityComponentPaginationType["infiniteScroll"] = "infiniteScroll";
|
|
4
|
+
UNActivityComponentPaginationType["pagination"] = "pagination";
|
|
5
|
+
})(UNActivityComponentPaginationType || (UNActivityComponentPaginationType = {}));
|
|
2
6
|
//# sourceMappingURL=activity.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["activity.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type { UNAuthorizationData } from './authorization.types';\nimport type { UNTransactionData } from './transactions.types';\n\nexport type UNActivityOnLoadData = {\n [RESPONSE_KEYS.
|
|
1
|
+
{"version":3,"names":["UNActivityComponentPaginationType"],"sources":["activity.types.ts"],"sourcesContent":["import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';\nimport type { UNAuthorizationData } from './authorization.types';\nimport type { UNTransactionData } from './transactions.types';\n\nexport const enum UNActivityComponentPaginationType {\n infiniteScroll = 'infiniteScroll',\n pagination = 'pagination'\n}\n\nexport type UNActivityOnLoadData = {\n [RESPONSE_KEYS.authorizations]: UNAuthorizationData,\n [RESPONSE_KEYS.transactions]: UNTransactionData,\n}\n"],"mappings":"AAIA,WAAkBA,iCAAiC;AAGlD,WAHiBA,iCAAiC;EAAjCA,iCAAiC;EAAjCA,iCAAiC;AAAA,GAAjCA,iCAAiC,KAAjCA,iCAAiC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export let UNErrorCodes;
|
|
2
|
+
(function (UNErrorCodes) {
|
|
3
|
+
UNErrorCodes["FEATURE_DISABLED"] = "feature_disabled";
|
|
4
|
+
UNErrorCodes["INVALID_VALUE"] = "invalid_value";
|
|
5
|
+
UNErrorCodes["LIMITS_EXCEEDED"] = "limits_exceeded";
|
|
6
|
+
UNErrorCodes["NOT_FOUND"] = "not_found";
|
|
7
|
+
UNErrorCodes["ACCOUNT_CUSTOMER_MISMATCH"] = "account_customer_mismatch";
|
|
8
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_ACCOUNT_STATUS"] = "not_supported_for_account_status";
|
|
9
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_ACCOUNT_TYPE"] = "not_supported_for_account_type";
|
|
10
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_CARD"] = "not_supported_for_card";
|
|
11
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_CARD_STATUS"] = "not_supported_for_card_status";
|
|
12
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_CARD_TYPE"] = "not_supported_for_card_type";
|
|
13
|
+
UNErrorCodes["INVALID_NONCE"] = "invalid_nonce";
|
|
14
|
+
UNErrorCodes["NOT_SUPPORTED_FOR_PAYMENT_TYPE"] = "not_supported_for_payment_type";
|
|
15
|
+
UNErrorCodes["PAYMENT_INVALID"] = "payment_invalid";
|
|
16
|
+
UNErrorCodes["UNAUTHORIZED"] = "unauthorized";
|
|
17
|
+
UNErrorCodes["FORBIDDEN"] = "forbidden";
|
|
18
|
+
UNErrorCodes["ALREADY_EXISTS"] = "already_exists";
|
|
19
|
+
UNErrorCodes["CUSTOMER_NAME_UNDELIVERABLE"] = "customer_name_undeliverable";
|
|
20
|
+
UNErrorCodes["CUSTOMER_ADDRESS_UNDELIVERABLE"] = "customer_address_undeliverable";
|
|
21
|
+
})(UNErrorCodes || (UNErrorCodes = {}));
|
|
22
|
+
//# sourceMappingURL=error.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNErrorCodes"],"sources":["error.types.ts"],"sourcesContent":["export type UNError = {\n errors: UNErrorData[]\n}\n\nexport type UNErrorData = {\n status?: string,\n title: string,\n detail?: string,\n details?: string,\n meta?: UNErrorMeta\n code?: UNErrorCodes,\n error?: Error\n}\n\ninterface UNErrorMeta {\n meta: Record<string, string>,\n}\n\nexport enum UNErrorCodes {\n FEATURE_DISABLED = 'feature_disabled',\n INVALID_VALUE = 'invalid_value',\n LIMITS_EXCEEDED = 'limits_exceeded',\n NOT_FOUND = 'not_found',\n ACCOUNT_CUSTOMER_MISMATCH = 'account_customer_mismatch',\n NOT_SUPPORTED_FOR_ACCOUNT_STATUS = 'not_supported_for_account_status',\n NOT_SUPPORTED_FOR_ACCOUNT_TYPE = 'not_supported_for_account_type',\n NOT_SUPPORTED_FOR_CARD = 'not_supported_for_card',\n NOT_SUPPORTED_FOR_CARD_STATUS = 'not_supported_for_card_status',\n NOT_SUPPORTED_FOR_CARD_TYPE = 'not_supported_for_card_type',\n INVALID_NONCE = 'invalid_nonce',\n NOT_SUPPORTED_FOR_PAYMENT_TYPE = 'not_supported_for_payment_type',\n PAYMENT_INVALID = 'payment_invalid',\n UNAUTHORIZED = 'unauthorized',\n FORBIDDEN = 'forbidden',\n ALREADY_EXISTS = 'already_exists',\n CUSTOMER_NAME_UNDELIVERABLE = 'customer_name_undeliverable',\n CUSTOMER_ADDRESS_UNDELIVERABLE = 'customer_address_undeliverable',\n}\n"],"mappings":"AAkBA,WAAYA,YAAY;AAmBvB,WAnBWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY"}
|
|
@@ -7,5 +7,7 @@ export * from './account.types';
|
|
|
7
7
|
export * from './checkDeposit.types';
|
|
8
8
|
export * from './activity.types';
|
|
9
9
|
export * from './fonts.types';
|
|
10
|
+
export * from './error.types';
|
|
10
11
|
export * from './versioning.types';
|
|
12
|
+
export * from './multipleCards.types';
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\nexport * from './account.types';\nexport * from './checkDeposit.types';\nexport * from './activity.types';\nexport * from './fonts.types';\nexport * from './versioning.types';\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,eAAe;AAC7B,cAAc,oBAAoB"}
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\nexport * from './account.types';\nexport * from './checkDeposit.types';\nexport * from './activity.types';\nexport * from './fonts.types';\nexport * from './error.types';\nexport * from './versioning.types';\nexport * from './multipleCards.types';\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,oBAAoB;AAClC,cAAc,uBAAuB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export let UNMultipleCardsComponentPaginationType;
|
|
2
|
+
(function (UNMultipleCardsComponentPaginationType) {
|
|
3
|
+
UNMultipleCardsComponentPaginationType["infiniteScroll"] = "infiniteScroll";
|
|
4
|
+
UNMultipleCardsComponentPaginationType["pagination"] = "pagination";
|
|
5
|
+
})(UNMultipleCardsComponentPaginationType || (UNMultipleCardsComponentPaginationType = {}));
|
|
6
|
+
//# sourceMappingURL=multipleCards.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNMultipleCardsComponentPaginationType"],"sources":["multipleCards.types.ts"],"sourcesContent":["import type { UNCardData } from './card.types';\n\nexport const enum UNMultipleCardsComponentPaginationType {\n infiniteScroll = 'infiniteScroll',\n pagination = 'pagination'\n}\n\nexport type UNMultipleCardsOnLoadData = UNCardData[];\n"],"mappings":"AAEA,WAAkBA,sCAAsC;AAGvD,WAHiBA,sCAAsC;EAAtCA,sCAAsC;EAAtCA,sCAAsC;AAAA,GAAtCA,sCAAsC,KAAtCA,sCAAsC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=onLoadResponse.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":[],"sources":["onLoadResponse.types.ts"],"sourcesContent":["import type { UNError } from './error.types';\n\nexport type UNOnLoadResponseData<T> = {\n data: T,\n}\n\nexport type UNOnLoadResponse<T> =\n | UNOnLoadResponseData<T>\n | UNError\n"],"mappings":""}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import EventBus from '../helpers/EventBus';
|
|
2
|
-
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
3
1
|
import { UnitSDK } from './UnitSdkManager';
|
|
4
2
|
import { getUnitScriptUrl } from './UnitSdkManager.utils.internal';
|
|
3
|
+
import { store } from '../store/store';
|
|
4
|
+
import { setUnitScript, selectConfiguration } from '../slices/ConfigurationSlice';
|
|
5
5
|
let isLoadingScript = false;
|
|
6
|
-
|
|
7
|
-
/** globalUnitScript is exported ONLY to our project components **/
|
|
8
|
-
export let globalUnitScript = '';
|
|
9
6
|
export const fetchUnitScript = async () => {
|
|
7
|
+
const configurationState = selectConfiguration(store.getState());
|
|
8
|
+
const globalUnitScript = configurationState.unitScript;
|
|
10
9
|
const env = UnitSDK.getEnv();
|
|
11
10
|
const webVersioningStrategy = UnitSDK.getWebVersioningStrategy();
|
|
12
11
|
if (isLoadingScript || globalUnitScript || !env) {
|
|
@@ -18,11 +17,7 @@ export const fetchUnitScript = async () => {
|
|
|
18
17
|
const unitScriptRes = await fetch(getUnitScriptUrl(env, webVersioningStrategy));
|
|
19
18
|
const unitScript = await unitScriptRes.text();
|
|
20
19
|
if (unitScript) {
|
|
21
|
-
|
|
22
|
-
unitScript
|
|
23
|
-
};
|
|
24
|
-
EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);
|
|
25
|
-
globalUnitScript = unitScript;
|
|
20
|
+
store.dispatch(setUnitScript(unitScript));
|
|
26
21
|
}
|
|
27
22
|
return null;
|
|
28
23
|
} catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["UnitSDK","getUnitScriptUrl","store","setUnitScript","selectConfiguration","isLoadingScript","fetchUnitScript","configurationState","getState","globalUnitScript","unitScript","env","getEnv","webVersioningStrategy","getWebVersioningStrategy","unitScriptRes","fetch","text","dispatch","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import { UnitSDK } from './UnitSdkManager';\n\nimport { getUnitScriptUrl } from './UnitSdkManager.utils.internal';\nimport { store } from '../store/store';\nimport { setUnitScript, selectConfiguration } from '../slices/ConfigurationSlice';\n\nlet isLoadingScript = false;\n\nexport const fetchUnitScript = async () => {\n const configurationState = selectConfiguration(store.getState());\n const globalUnitScript = configurationState.unitScript;\n const env = UnitSDK.getEnv();\n const webVersioningStrategy = UnitSDK.getWebVersioningStrategy();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(getUnitScriptUrl(env, webVersioningStrategy));\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n store.dispatch(setUnitScript(unitScript));\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,kBAAkB;AAE1C,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,aAAa,EAAEC,mBAAmB,QAAQ,8BAA8B;AAEjF,IAAIC,eAAe,GAAG,KAAK;AAE3B,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAAY;EACzC,MAAMC,kBAAkB,GAAGH,mBAAmB,CAACF,KAAK,CAACM,QAAQ,EAAE,CAAC;EAChE,MAAMC,gBAAgB,GAAGF,kBAAkB,CAACG,UAAU;EACtD,MAAMC,GAAG,GAAGX,OAAO,CAACY,MAAM,EAAE;EAC5B,MAAMC,qBAAqB,GAAGb,OAAO,CAACc,wBAAwB,EAAE;EAChE,IAAIT,eAAe,IAAII,gBAAgB,IAAI,CAACE,GAAG,EAAE;IAC/C;IACA,OAAO,IAAI;EACb;EACAN,eAAe,GAAG,IAAI;EACtB,IAAI;IACF,MAAMU,aAAa,GAAG,MAAMC,KAAK,CAACf,gBAAgB,CAACU,GAAG,EAAEE,qBAAqB,CAAC,CAAC;IAC/E,MAAMH,UAAU,GAAG,MAAMK,aAAa,CAACE,IAAI,EAAE;IAC7C,IAAIP,UAAU,EAAE;MACdR,KAAK,CAACgB,QAAQ,CAACf,aAAa,CAACO,UAAU,CAAC,CAAC;IAC3C;IACA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOS,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;IACd,OAAO,IAAI;EACb,CAAC,SAAS;IACRd,eAAe,GAAG,KAAK;EACzB;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { UNVersioningStrategyType } from '../types/shared';
|
|
|
2
2
|
const WEB_SDK_RECOMMENDED_STRATEGY = {
|
|
3
3
|
type: UNVersioningStrategyType.upToNextMinor,
|
|
4
4
|
major: 1,
|
|
5
|
-
minor:
|
|
5
|
+
minor: 3
|
|
6
6
|
};
|
|
7
7
|
export const UNSDKConstants = {
|
|
8
8
|
webSDKRecommendedStrategy: WEB_SDK_RECOMMENDED_STRATEGY
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNVersioningStrategyType","WEB_SDK_RECOMMENDED_STRATEGY","type","upToNextMinor","major","minor","UNSDKConstants","webSDKRecommendedStrategy"],"sources":["UnitSdk.constants.ts"],"sourcesContent":["import { UNVersioningStrategyType, UNWebVersioningStrategy } from '../types/shared';\n\nconst WEB_SDK_RECOMMENDED_STRATEGY: UNWebVersioningStrategy = {\n type: UNVersioningStrategyType.upToNextMinor,\n major: 1,\n minor:
|
|
1
|
+
{"version":3,"names":["UNVersioningStrategyType","WEB_SDK_RECOMMENDED_STRATEGY","type","upToNextMinor","major","minor","UNSDKConstants","webSDKRecommendedStrategy"],"sources":["UnitSdk.constants.ts"],"sourcesContent":["import { UNVersioningStrategyType, UNWebVersioningStrategy } from '../types/shared';\n\nconst WEB_SDK_RECOMMENDED_STRATEGY: UNWebVersioningStrategy = {\n type: UNVersioningStrategyType.upToNextMinor,\n major: 1,\n minor: 3,\n};\n\nexport const UNSDKConstants = {\n webSDKRecommendedStrategy: WEB_SDK_RECOMMENDED_STRATEGY,\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAiC,iBAAiB;AAEnF,MAAMC,4BAAqD,GAAG;EAC5DC,IAAI,EAAEF,wBAAwB,CAACG,aAAa;EAC5CC,KAAK,EAAE,CAAC;EACRC,KAAK,EAAE;AACT,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;EAC5BC,yBAAyB,EAAEN;AAC7B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
-
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
6
4
|
import { fetchUnitScript } from './UnitSdk.api';
|
|
7
5
|
import { UnitUiManager } from './unitUiManager/unitUiManager';
|
|
8
6
|
import { warnClientIfNeeded } from '../utils/webVersioningStrategy.utils';
|
|
9
7
|
import { UNSDKConstants } from './UnitSdk.constants';
|
|
8
|
+
import { setTheme, setLanguage } from '../slices/ConfigurationSlice';
|
|
9
|
+
import { store } from '../store/store';
|
|
10
10
|
export let UNEnvironment;
|
|
11
11
|
(function (UNEnvironment) {
|
|
12
12
|
UNEnvironment["sandbox"] = "sandbox";
|
|
@@ -17,8 +17,6 @@ _defineProperty(UnitSDK, "ui", void 0);
|
|
|
17
17
|
_defineProperty(UnitSDK, "env", void 0);
|
|
18
18
|
_defineProperty(UnitSDK, "webVersioningStrategy", void 0);
|
|
19
19
|
_defineProperty(UnitSDK, "customerToken", void 0);
|
|
20
|
-
_defineProperty(UnitSDK, "theme", void 0);
|
|
21
|
-
_defineProperty(UnitSDK, "language", void 0);
|
|
22
20
|
_defineProperty(UnitSDK, "fonts", void 0);
|
|
23
21
|
_defineProperty(UnitSDK, "signedNonce", void 0);
|
|
24
22
|
_defineProperty(UnitSDK, "pushProvisionModule", void 0);
|
|
@@ -27,13 +25,12 @@ _defineProperty(UnitSDK, "init", async function (env, theme, language, fonts) {
|
|
|
27
25
|
try {
|
|
28
26
|
UnitSDK.env = env;
|
|
29
27
|
UnitSDK.webVersioningStrategy = webVersioningStrategy;
|
|
30
|
-
UnitSDK.theme = theme;
|
|
31
|
-
UnitSDK.language = language;
|
|
32
28
|
UnitSDK.fonts = fonts;
|
|
29
|
+
store.dispatch(setTheme(theme));
|
|
30
|
+
store.dispatch(setLanguage(language));
|
|
33
31
|
UnitSDK.ui = new UnitUiManager();
|
|
34
32
|
warnClientIfNeeded(UnitSDK.webVersioningStrategy);
|
|
35
33
|
await fetchUnitScript();
|
|
36
|
-
EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});
|
|
37
34
|
} catch (e) {
|
|
38
35
|
console.log(e);
|
|
39
36
|
}
|
|
@@ -45,8 +42,8 @@ _defineProperty(UnitSDK, "getPushProvisionModule", () => {
|
|
|
45
42
|
return UnitSDK.pushProvisionModule;
|
|
46
43
|
});
|
|
47
44
|
/**
|
|
48
|
-
* @deprecated - Unit SDK is managing the signedNonce, no need to provide it
|
|
49
|
-
*/
|
|
45
|
+
* @deprecated - Unit SDK is managing the signedNonce, no need to provide it
|
|
46
|
+
*/
|
|
50
47
|
_defineProperty(UnitSDK, "setSignedNonce", signedNonce => {
|
|
51
48
|
UnitSDK.signedNonce = signedNonce;
|
|
52
49
|
});
|
|
@@ -56,18 +53,12 @@ _defineProperty(UnitSDK, "getEnv", () => {
|
|
|
56
53
|
_defineProperty(UnitSDK, "getWebVersioningStrategy", () => {
|
|
57
54
|
return UnitSDK.webVersioningStrategy;
|
|
58
55
|
});
|
|
59
|
-
_defineProperty(UnitSDK, "getTheme", () => {
|
|
60
|
-
return UnitSDK.theme;
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(UnitSDK, "getLanguage", () => {
|
|
63
|
-
return UnitSDK.language;
|
|
64
|
-
});
|
|
65
56
|
_defineProperty(UnitSDK, "getFonts", () => {
|
|
66
57
|
return UnitSDK.fonts;
|
|
67
58
|
});
|
|
68
59
|
/**
|
|
69
|
-
* @deprecated - Unit SDK is managing the signedNonce, no need to provide it
|
|
70
|
-
*/
|
|
60
|
+
* @deprecated - Unit SDK is managing the signedNonce, no need to provide it
|
|
61
|
+
*/
|
|
71
62
|
_defineProperty(UnitSDK, "getSignedNonce", () => {
|
|
72
63
|
return UnitSDK.signedNonce;
|
|
73
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["fetchUnitScript","UnitUiManager","warnClientIfNeeded","UNSDKConstants","setTheme","setLanguage","store","UNEnvironment","UnitSDK","_defineProperty","env","theme","language","fonts","webVersioningStrategy","arguments","length","undefined","webSDKRecommendedStrategy","dispatch","ui","e","console","log","pushProvisionModule","signedNonce","customerToken"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import type { NativeModules } from 'react-native';\nimport { fetchUnitScript } from './UnitSdk.api';\nimport { UnitUiManager } from './unitUiManager/unitUiManager';\nimport type { UNFonts } from '../types/shared/fonts.types';\nimport { warnClientIfNeeded } from '../utils/webVersioningStrategy.utils';\nimport { UNSDKConstants } from './UnitSdk.constants';\nimport type { UNWebVersioningStrategy } from '../types/shared';\nimport { setTheme, setLanguage } from '../slices/ConfigurationSlice';\nimport { store } from '../store/store';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nexport class UnitSDK {\n public static ui: UnitUiManager;\n protected static env?: UNEnvironment;\n protected static webVersioningStrategy: UNWebVersioningStrategy;\n protected static customerToken?: string;\n protected static fonts?: UNFonts;\n protected static signedNonce?: string;\n protected static pushProvisionModule?: typeof NativeModules;\n\n public static init = async (env: UNEnvironment, theme?: string, language?: string, fonts?: UNFonts, webVersioningStrategy: UNWebVersioningStrategy = UNSDKConstants.webSDKRecommendedStrategy) => {\n try {\n this.env = env;\n this.webVersioningStrategy = webVersioningStrategy;\n this.fonts = fonts;\n store.dispatch(setTheme(theme));\n store.dispatch(setLanguage(language));\n this.ui = new UnitUiManager();\n warnClientIfNeeded(this.webVersioningStrategy);\n await fetchUnitScript();\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setPushProvisioningModule = (pushProvisionModule: typeof NativeModules) => {\n this.pushProvisionModule = pushProvisionModule;\n };\n\n public static getPushProvisionModule = () => {\n return this.pushProvisionModule;\n };\n\n /**\n * @deprecated - Unit SDK is managing the signedNonce, no need to provide it\n */\n public static setSignedNonce = (signedNonce: string) => {\n this.signedNonce = signedNonce;\n };\n\n public static getEnv = () => {\n return this.env;\n };\n\n public static getWebVersioningStrategy = () => {\n return this.webVersioningStrategy;\n };\n\n public static getFonts = () => {\n return this.fonts;\n };\n\n /**\n * @deprecated - Unit SDK is managing the signedNonce, no need to provide it\n */\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n\n public static setCustomerToken = (customerToken: string) => {\n this.customerToken = customerToken;\n };\n\n public static getCustomerToken = () => {\n return this.customerToken;\n };\n\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AAG,CAACF,CAAC,CAAC;EAChB;AACF,CAAC;AAAAZ,eAAA,CAtBUD,OAAO,+BAwByBgB,mBAAyC,IAAK;EAxB9EhB,OAAO,CAyBXgB,mBAAmB,GAAGA,mBAAmB;AAChD,CAAC;AAAAf,eAAA,CA1BUD,OAAO,4BA4BqB,MAAM;EAC3C,OA7BSA,OAAO,CA6BJgB,mBAAmB;AACjC,CAAC;AAED;AACF;AACA;AAFEf,eAAA,CAhCWD,OAAO,oBAmCciB,WAAmB,IAAK;EAnC7CjB,OAAO,CAoCXiB,WAAW,GAAGA,WAAW;AAChC,CAAC;AAAAhB,eAAA,CArCUD,OAAO,YAuCK,MAAM;EAC3B,OAxCSA,OAAO,CAwCJE,GAAG;AACjB,CAAC;AAAAD,eAAA,CAzCUD,OAAO,8BA2CuB,MAAM;EAC7C,OA5CSA,OAAO,CA4CJM,qBAAqB;AACnC,CAAC;AAAAL,eAAA,CA7CUD,OAAO,cA+CO,MAAM;EAC7B,OAhDSA,OAAO,CAgDJK,KAAK;AACnB,CAAC;AAED;AACF;AACA;AAFEJ,eAAA,CAnDWD,OAAO,oBAsDa,MAAM;EACnC,OAvDSA,OAAO,CAuDJiB,WAAW;AACzB,CAAC;AAAAhB,eAAA,CAxDUD,OAAO,sBA0DgBkB,aAAqB,IAAK;EA1DjDlB,OAAO,CA2DXkB,aAAa,GAAGA,aAAa;AACpC,CAAC;AAAAjB,eAAA,CA5DUD,OAAO,sBA8De,MAAM;EACrC,OA/DSA,OAAO,CA+DJkB,aAAa;AAC3B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
const {
|
|
3
|
+
AndroidAppInfo,
|
|
4
|
+
IOSAppInfo
|
|
5
|
+
} = NativeModules;
|
|
6
|
+
const appInfoModule = Platform.OS === 'android' ? AndroidAppInfo : IOSAppInfo;
|
|
7
|
+
export const getAppName = async () => {
|
|
8
|
+
try {
|
|
9
|
+
const response = await appInfoModule.getAppName();
|
|
10
|
+
return response;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error(error);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export const getVersion = async () => {
|
|
16
|
+
try {
|
|
17
|
+
const response = await appInfoModule.getVersion();
|
|
18
|
+
return response;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error(error);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const getBuildNumber = async () => {
|
|
24
|
+
try {
|
|
25
|
+
const response = await appInfoModule.getBuildNumber();
|
|
26
|
+
return response;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
console.error(error);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const getAppIdentifier = async () => {
|
|
32
|
+
try {
|
|
33
|
+
const response = await appInfoModule.getAppIdentifier();
|
|
34
|
+
return response;
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=AppInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","AndroidAppInfo","IOSAppInfo","appInfoModule","OS","getAppName","response","error","console","getVersion","getBuildNumber","getAppIdentifier"],"sources":["AppInfo.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst { AndroidAppInfo, IOSAppInfo } = NativeModules;\n\nconst appInfoModule = Platform.OS === 'android' ? AndroidAppInfo : IOSAppInfo;\n\nexport const getAppName = async () => {\n try {\n const response = await appInfoModule.getAppName();\n return response;\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getVersion = async () => {\n try {\n const response = await appInfoModule.getVersion();\n return response;\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getBuildNumber = async () => {\n try {\n const response = await appInfoModule.getBuildNumber();\n return response;\n } catch (error) {\n console.error(error);\n }\n};\n\nexport const getAppIdentifier = async () => {\n try {\n const response = await appInfoModule.getAppIdentifier();\n return response;\n } catch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ion","version"],"sources":["SDKInfo.ts"],"sourcesContent":["import Package from '../../package.json';\n\nexport const getSDKVersion = () => {\n return Package.version;\n};\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,oBAAoB;AAExC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,OAAOD,OAAO,CAACE,OAAO;AACxB,CAAC"}
|
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
5
|
import { WebView } from 'react-native-webview';
|
|
5
|
-
import EventBus from '../helpers/EventBus';
|
|
6
6
|
import html, { HTML_PLACEHOLDER } from './html';
|
|
7
7
|
import { UnitMessage } from '../messages/webMessages/unitMessages';
|
|
8
|
-
import { useListenerToBus } from '../hooks/listenerToBus';
|
|
9
8
|
import { getHtmlBody } from '../scripts/html/bodyHtml';
|
|
10
|
-
import { fetchUnitScript
|
|
9
|
+
import { fetchUnitScript } from '../unitSdkManager/UnitSdk.api';
|
|
11
10
|
import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
|
|
12
|
-
import {
|
|
13
|
-
import { handleRequestDownload } from './WebComponent.utils';
|
|
11
|
+
import { getInfoParams, handleRequestDownload } from './WebComponent.utils';
|
|
14
12
|
import { getFontFacesString } from '../scripts/html/fontFaces';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = NativeModules;
|
|
13
|
+
import { setEvent } from '../slices/SharedEventsSlice';
|
|
14
|
+
import * as AppInfo from '../utils/AppInfo';
|
|
18
15
|
export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(props, webRef) {
|
|
19
|
-
const
|
|
16
|
+
const dispatch = useDispatch();
|
|
17
|
+
const unitScript = useSelector(state => state.configuration.unitScript);
|
|
18
|
+
const globalTheme = useSelector(state => state.configuration.theme);
|
|
19
|
+
const globalLanguage = useSelector(state => state.configuration.language);
|
|
20
20
|
const [sourceHtml, setSourceHtml] = useState(null);
|
|
21
|
-
const [componentCurrentTheme, setComponentCurrentTheme] = useState(props.theme ?? UnitSDK.getTheme());
|
|
22
|
-
const [componentCurrentLanguage, setComponentCurrentLanguage] = useState(props.language ?? UnitSDK.getLanguage());
|
|
23
21
|
const [baseName, setBaseName] = useState();
|
|
24
|
-
const
|
|
25
|
-
setUnitScript(data.unitScript);
|
|
26
|
-
};
|
|
27
|
-
const updateInitializedParams = () => {
|
|
28
|
-
setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());
|
|
29
|
-
setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());
|
|
30
|
-
};
|
|
31
|
-
useListenerToBus({
|
|
32
|
-
busEventKey: SDKMessage.IS_SCRIPT_FETCHED,
|
|
33
|
-
action: updateUnitScript
|
|
34
|
-
});
|
|
35
|
-
useListenerToBus({
|
|
36
|
-
busEventKey: SDKMessage.IS_SDK_INITIALIZED,
|
|
37
|
-
action: updateInitializedParams
|
|
38
|
-
});
|
|
22
|
+
const [infoParams, setInfoParams] = useState({});
|
|
39
23
|
useEffect(() => {
|
|
40
24
|
const getAppName = async () => {
|
|
41
25
|
// For iOS, we extend the app name from the HTML to display a prettier access request message.
|
|
42
26
|
// On Android, there is no request message sent from HTML.
|
|
43
27
|
try {
|
|
44
28
|
if (Platform.OS == 'ios') {
|
|
45
|
-
const name = await
|
|
29
|
+
const name = await AppInfo.getAppName();
|
|
46
30
|
setBaseName(name.replace(/ /g, '-'));
|
|
47
31
|
} else {
|
|
48
32
|
// android
|
|
@@ -52,32 +36,47 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
52
36
|
console.error(error);
|
|
53
37
|
}
|
|
54
38
|
};
|
|
39
|
+
const updateInfoParams = async () => {
|
|
40
|
+
const infoParams = await getInfoParams();
|
|
41
|
+
setInfoParams(infoParams);
|
|
42
|
+
};
|
|
55
43
|
getAppName();
|
|
44
|
+
updateInfoParams();
|
|
56
45
|
}, []);
|
|
57
46
|
useEffect(() => {
|
|
58
47
|
if (!unitScript) {
|
|
59
48
|
fetchUnitScript();
|
|
60
49
|
return;
|
|
61
50
|
}
|
|
51
|
+
const componentCurrentTheme = props.theme ?? globalTheme;
|
|
52
|
+
const componentCurrentLanguage = props.language ?? globalLanguage;
|
|
62
53
|
const themeParam = componentCurrentTheme ? ` theme="${componentCurrentTheme}"` : '';
|
|
63
54
|
const languageParam = componentCurrentLanguage ? ` language="${componentCurrentLanguage}"` : '';
|
|
64
55
|
const componentParams = (props.params || '') + themeParam + languageParam;
|
|
65
56
|
const fontFaces = getFontFacesString(UnitSDK.getFonts());
|
|
57
|
+
const windowInfoParams = `window.UnitMobileSDKConfig['info'] = ${JSON.stringify(infoParams)}`;
|
|
58
|
+
const windowParams = `${windowInfoParams}; ${props.windowParams || ''}`;
|
|
66
59
|
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));
|
|
67
60
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);
|
|
68
61
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');
|
|
69
|
-
newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS,
|
|
62
|
+
newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, windowParams);
|
|
70
63
|
setSourceHtml(newHtml);
|
|
71
|
-
}, [props.params, unitScript, props.presentationMode,
|
|
64
|
+
}, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, infoParams]);
|
|
72
65
|
const onMessage = e => {
|
|
73
66
|
const message = JSON.parse(e.nativeEvent.data);
|
|
74
67
|
switch (message.type) {
|
|
75
68
|
case UnitMessage.UNIT_REQUEST_REFRESH:
|
|
76
|
-
message.details &&
|
|
69
|
+
message.details && dispatch(setEvent({
|
|
70
|
+
key: UnitMessage.UNIT_REQUEST_REFRESH,
|
|
71
|
+
data: message.details
|
|
72
|
+
}));
|
|
77
73
|
break;
|
|
78
74
|
case UnitMessage.UNIT_REQUEST_DOWNLOAD:
|
|
79
75
|
message.details && handleRequestDownload(message.details, () => {
|
|
80
|
-
|
|
76
|
+
dispatch(setEvent({
|
|
77
|
+
key: UnitMessage.UNIT_REQUEST_CLOSE_FLOW,
|
|
78
|
+
data: {}
|
|
79
|
+
}));
|
|
81
80
|
});
|
|
82
81
|
break;
|
|
83
82
|
default:
|
|
@@ -89,7 +88,6 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
89
88
|
if (props.handleScroll) {
|
|
90
89
|
props.handleScroll(event);
|
|
91
90
|
}
|
|
92
|
-
return null;
|
|
93
91
|
};
|
|
94
92
|
if (!baseName) {
|
|
95
93
|
return null;
|
|
@@ -116,7 +114,8 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
116
114
|
baseUrl: Platform.OS === 'android' ? `https://${baseName}` : ''
|
|
117
115
|
},
|
|
118
116
|
onMessage: onMessage,
|
|
119
|
-
|
|
117
|
+
androidLayerType: "hardware",
|
|
118
|
+
webviewDebuggingEnabled: __DEV__
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
//# sourceMappingURL=WebComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","NativeModules","Platform","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","getFontFacesString","UNAppInfo","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","componentCurrentLanguage","setComponentCurrentLanguage","language","getLanguage","baseName","setBaseName","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","getAppName","OS","name","getBundleName","replace","error","console","themeParam","languageParam","componentParams","params","fontFaces","getFonts","newHtml","BODY","type","valueOf","presentationMode","FONT_FACES","SCRIPT_FROM_NATIVE","script","WINDOW_PARAMS","windowParams","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","width","flex","opacity","backgroundColor","source","baseUrl","androidHardwareAccelerationDisabled"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { NativeModules, Platform } from 'react-native';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\nimport type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';\nimport { getFontFacesString } from '../scripts/html/fontFaces';\n\nconst { UNAppInfo } = NativeModules;\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n windowParams?: string;\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const [componentCurrentLanguage, setComponentCurrentLanguage] = useState<string | undefined>(props.language ?? UnitSDK.getLanguage());\n const [baseName, setBaseName] = useState<string>();\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await UNAppInfo.getBundleName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n getAppName();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n\n const fontFaces = getFontFacesString(UnitSDK.getFonts());\n\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, props.windowParams || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script, props.windowParams]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW, {});\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: '100%', flex: 1, opacity: 0.99, backgroundColor: 'transparent' }}\n source={{ html: sourceHtml, baseUrl: Platform.OS === 'android' ? `https://${baseName}` : ''}}\n onMessage={onMessage}\n androidHardwareAccelerationDisabled\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAO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AAC,CAAC;QACJ;MACF;QACEzD,KAAK,CAAC8C,SAAS,IAAI9C,KAAK,CAAC8C,SAAS,CAACE,OAAO,CAAC;IAAC;EAElD,CAAC;EAED,IAAI,CAAC5C,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAMsD,SAAS,GAAIH,KAAU,IAAK;IAChC,IAAIvD,KAAK,CAAC2D,YAAY,EAAE;MACtB3D,KAAK,CAAC2D,YAAY,CAACJ,KAAK,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC;EAED,IAAI,CAACzC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,oBACEnC,KAAA,CAAAiF,aAAA,CAAC5E,OAAO;IACN6E,GAAG,EAAE5D,MAAO;IACZ6D,eAAe,EAAE,CAAC,GAAG,CAAE;IACvBC,+BAA+B,EAAE,KAAM;IACvCC,yBAAyB,EAAE,IAAK;IAChCC,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAElE,KAAK,CAACmE,YAAa;IAClCC,mBAAmB,EAAEpE,KAAK,CAACoE,mBAAoB;IAC/CC,QAAQ,EAAEX,SAAU;IACpBY,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAErE,UAAW;IAC/BsE,KAAK,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE,IAAI;MAAEC,eAAe,EAAE;IAAc,CAAE;IACjFC,MAAM,EAAE;MAAE3F,IAAI,EAAEkB,UAAU;MAAE0E,OAAO,EAAE/F,QAAQ,CAACyC,EAAE,KAAK,SAAS,GAAK,WAAUV,QAAS,EAAC,GAAG;IAAE,CAAE;IAC9FgC,SAAS,EAAEA,SAAU;IACrBiC,mCAAmC;EAAA,EACnC;AAEN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Platform","useDispatch","useSelector","WebView","html","HTML_PLACEHOLDER","UnitMessage","getHtmlBody","fetchUnitScript","UnitSDK","getInfoParams","handleRequestDownload","getFontFacesString","setEvent","AppInfo","WebComponent","forwardRef","props","webRef","dispatch","unitScript","state","configuration","globalTheme","theme","globalLanguage","language","sourceHtml","setSourceHtml","baseName","setBaseName","infoParams","setInfoParams","getAppName","OS","name","replace","error","console","updateInfoParams","componentCurrentTheme","componentCurrentLanguage","themeParam","languageParam","componentParams","params","fontFaces","getFonts","windowInfoParams","JSON","stringify","windowParams","newHtml","BODY","type","valueOf","presentationMode","FONT_FACES","SCRIPT_FROM_NATIVE","script","WINDOW_PARAMS","onMessage","e","message","parse","nativeEvent","data","UNIT_REQUEST_REFRESH","details","key","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","event","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","width","flex","opacity","backgroundColor","source","baseUrl","androidLayerType","webviewDebuggingEnabled","__DEV__"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { getHtmlBody } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\n\nimport { getInfoParams, handleRequestDownload } from './WebComponent.utils';\nimport type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';\nimport { getFontFacesString } from '../scripts/html/fontFaces';\nimport type { RootState } from '../store';\nimport { setEvent } from '../slices/SharedEventsSlice';\nimport * as AppInfo from '../utils/AppInfo';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n windowParams?: string;\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const dispatch = useDispatch();\n const unitScript = useSelector((state: RootState) => state.configuration.unitScript);\n const globalTheme = useSelector((state: RootState) => state.configuration.theme);\n const globalLanguage = useSelector((state: RootState) => state.configuration.language);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [baseName, setBaseName] = useState<string>();\n const [infoParams, setInfoParams] = useState<{ [key: string]: string }>({});\n\n useEffect(() => {\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await AppInfo.getAppName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n const updateInfoParams = async () => {\n const infoParams = await getInfoParams();\n setInfoParams(infoParams);\n };\n\n getAppName();\n updateInfoParams();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const componentCurrentTheme = props.theme ?? globalTheme;\n const componentCurrentLanguage = props.language ?? globalLanguage;\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n\n const fontFaces = getFontFacesString(UnitSDK.getFonts());\n\n const windowInfoParams = `window.UnitMobileSDKConfig['info'] = ${JSON.stringify(infoParams)}`;\n const windowParams = `${windowInfoParams}; ${props.windowParams || ''}`;\n\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, windowParams);\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, infoParams]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n dispatch(setEvent({\n key: UnitMessage.UNIT_REQUEST_REFRESH,\n data: message.details as RequestRefreshEvent,\n }));\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n dispatch(setEvent({ key: UnitMessage.UNIT_REQUEST_CLOSE_FLOW, data: {} }));\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode='never'\n injectedJavaScript={unitScript}\n style={{ width: '100%', flex: 1, opacity: 0.99, backgroundColor: 'transparent' }}\n source={{ html: sourceHtml, baseUrl: Platform.OS === 'android' ? `https://${baseName}` : '' }}\n onMessage={onMessage}\n androidLayerType='hardware'\n webviewDebuggingEnabled={__DEV__}\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SA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|
|
2
2
|
import { Share, NativeModules, Platform } from 'react-native';
|
|
3
|
+
import * as SDKInfo from '../utils/SDKInfo';
|
|
4
|
+
import * as AppInfo from '../utils/AppInfo';
|
|
3
5
|
const {
|
|
4
6
|
RNShareFile
|
|
5
7
|
} = NativeModules;
|
|
8
|
+
export const getInfoParams = async () => {
|
|
9
|
+
const appVersion = await AppInfo.getVersion();
|
|
10
|
+
const appBuildNumber = await AppInfo.getBuildNumber();
|
|
11
|
+
const appIdentifier = await AppInfo.getAppIdentifier();
|
|
12
|
+
const infoParams = {};
|
|
13
|
+
infoParams['sdkVersion'] = SDKInfo.getSDKVersion();
|
|
14
|
+
infoParams['sdkPlatform'] = 'React Native';
|
|
15
|
+
infoParams['os'] = Platform.OS == 'android' ? 'Android' : 'iOS';
|
|
16
|
+
infoParams['hostedAppVersion'] = appVersion;
|
|
17
|
+
infoParams['hostedAppBuildNumber'] = appBuildNumber;
|
|
18
|
+
infoParams['hostedAppIdentifier'] = appIdentifier;
|
|
19
|
+
return infoParams;
|
|
20
|
+
};
|
|
6
21
|
export const handleRequestDownload = async (details, onReadyToShare) => {
|
|
7
22
|
if (details.fileType === 'application/pdf') {
|
|
8
23
|
const res = await axios.get(details.url, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["axios","Share","NativeModules","Platform","RNShareFile","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","
|
|
1
|
+
{"version":3,"names":["axios","Share","NativeModules","Platform","SDKInfo","AppInfo","RNShareFile","getInfoParams","appVersion","getVersion","appBuildNumber","getBuildNumber","appIdentifier","getAppIdentifier","infoParams","getSDKVersion","OS","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","share","fileName"],"sources":["WebComponent.utils.ts"],"sourcesContent":["import axios from 'axios';\nimport { Share, NativeModules, Platform } from 'react-native';\nimport * as SDKInfo from '../utils/SDKInfo';\nimport * as AppInfo from '../utils/AppInfo';\nimport type { RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nconst { RNShareFile } = NativeModules;\n\nexport const getInfoParams = async () => {\n const appVersion = await AppInfo.getVersion();\n const appBuildNumber = await AppInfo.getBuildNumber();\n const appIdentifier = await AppInfo.getAppIdentifier();\n\n const infoParams: { [key: string]: string } = {};\n infoParams['sdkVersion'] = SDKInfo.getSDKVersion();\n infoParams['sdkPlatform'] = 'React Native';\n infoParams['os'] = Platform.OS == 'android' ? 'Android' : 'iOS';\n infoParams['hostedAppVersion'] = appVersion;\n infoParams['hostedAppBuildNumber'] = appBuildNumber;\n infoParams['hostedAppIdentifier'] = appIdentifier;\n return infoParams;\n};\n\nexport const handleRequestDownload = async (details: RequestDownloadEvent, onReadyToShare: () => void) => {\n if (details.fileType === 'application/pdf') {\n const res = await axios.get(details.url, {\n headers: {\n 'Authorization': `Bearer ${details.accessToken}`\n },\n responseEncoding: 'base64',\n responseType: 'arraybuffer'\n });\n\n const base64Data = res.request._response;\n\n onReadyToShare();\n\n if (Platform.OS === 'ios') {\n Share.share({ url: `data:application/pdf;base64,${base64Data}` });\n } else {\n RNShareFile.share(base64Data, details.fileName);\n }\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAC7D,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGJ,aAAa;AAErC,OAAO,MAAMK,aAAa,GAAG,MAAAA,CAAA,KAAY;EACvC,MAAMC,UAAU,GAAG,MAAMH,OAAO,CAACI,UAAU,EAAE;EAC7C,MAAMC,cAAc,GAAG,MAAML,OAAO,CAACM,cAAc,EAAE;EACrD,MAAMC,aAAa,GAAG,MAAMP,OAAO,CAACQ,gBAAgB,EAAE;EAEtD,MAAMC,UAAqC,GAAG,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