@capillarytech/react-native-hydra-lib 1.7.0-beta.1
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/CHANGELOG.md +252 -0
- package/DEPRECATION_POLICY.md +220 -0
- package/LICENSE +20 -0
- package/MIGRATION.md +361 -0
- package/README.md +491 -0
- package/RELEASE_NOTES.md +528 -0
- package/android/build.gradle +565 -0
- package/android/generated/java/com/hydralib/NativeHydraLibSpec.java +185 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNHydraLibSpec-generated.cpp +248 -0
- package/android/generated/jni/RNHydraLibSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ComponentDescriptors.cpp +24 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ComponentDescriptors.h +26 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/EventEmitters.cpp +18 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/EventEmitters.h +37 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/Props.cpp +39 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/Props.h +47 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/RNHydraLibSpecJSI-generated.cpp +283 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/RNHydraLibSpecJSI.h +395 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ShadowNodes.cpp +19 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/ShadowNodes.h +54 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNHydraLibSpec/States.h +53 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/AndroidManifestNew.xml +16 -0
- package/android/src/main/AndroidManifestNoFirebaseIcon.xml +5 -0
- package/android/src/main/java/com/hydralib/delegates/HydraActivityCallbacks.kt +90 -0
- package/android/src/main/java/com/hydralib/delegates/NonHydraNotificationActivity.kt +43 -0
- package/android/src/main/java/com/hydralib/eventemitter/HydraEventEmitter.kt +150 -0
- package/android/src/main/java/com/hydralib/eventemitter/HydraEventType.kt +44 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationBannerViewManager.kt +121 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationEmbedViewManager.kt +153 -0
- package/android/src/main/java/com/hydralib/gamification/GamificationLoyaltyViewManager.kt +95 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraCore.kt +860 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraExtenstions.kt +331 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInAppMessages.kt +136 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInbox.kt +70 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraInboxUI.kt +54 -0
- package/android/src/main/java/com/hydralib/hydrasdk/HydraPushNotification.kt +299 -0
- package/android/src/main/java/com/hydralib/nativeapis/Hydra.kt +28 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraFirebaseRemoteConfigKeys.kt +76 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraInitializer.kt +130 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraNativeMessaging.kt +18 -0
- package/android/src/main/java/com/hydralib/nativeapis/HydraRemoteConfig.kt +59 -0
- package/android/src/main/java/com/hydralib/utils/RNHydraPreferencesManager.kt +154 -0
- package/android/src/main/java/com/hydralib/utils/ResourceUtil.kt +10 -0
- package/android/src/newarch/HydraLibModule.kt +218 -0
- package/android/src/oldarch/HydraLibModule.kt +258 -0
- package/android/src/rn72OrLess/HydraLibPackage.kt +43 -0
- package/android/src/rn73OrMore/HydraLibPackage.kt +53 -0
- package/ios/Delegates/HydraApplicationDelegate.swift +196 -0
- package/ios/Delegates/HydraFirebaseMessagingDelegate.swift +20 -0
- package/ios/Delegates/HydraUNUserNotificationCenterDelegate.swift +26 -0
- package/ios/EventEmitter/HydraEventEmitter.swift +98 -0
- package/ios/EventEmitter/HydraEventType.swift +28 -0
- package/ios/EventEmitter/HydraNativeEmitterBrigde.h +15 -0
- package/ios/EventEmitter/HydraNativeEmitterBrigde.mm +48 -0
- package/ios/GamificationViews/GamificationBannerViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationBannerViewComponentView.mm +125 -0
- package/ios/GamificationViews/GamificationEmbedViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationEmbedViewComponentView.mm +131 -0
- package/ios/GamificationViews/GamificationLoyaltyViewComponentView.h +14 -0
- package/ios/GamificationViews/GamificationLoyaltyViewComponentView.mm +120 -0
- package/ios/HydraLib.h +16 -0
- package/ios/HydraLib.mm +207 -0
- package/ios/HydraSDK/HydraInAppMessages.swift +93 -0
- package/ios/HydraSDK/HydraInbox.swift +97 -0
- package/ios/HydraSDK/HydraInboxUI.swift +105 -0
- package/ios/HydraSDK/HydraPushNotification.swift +476 -0
- package/ios/HydraSDK/HydraSDKCore.swift +707 -0
- package/ios/NativeAPIs/Hydra.h +34 -0
- package/ios/NativeAPIs/Hydra.mm +47 -0
- package/ios/NativeAPIs/HydraNativeFirebaseRemoteConfigKeys.h +23 -0
- package/ios/NativeAPIs/HydraNativeFirebaseRemoteConfigKeys.mm +80 -0
- package/ios/NativeAPIs/HydraNativeInitializer.h +16 -0
- package/ios/NativeAPIs/HydraNativeInitializer.mm +39 -0
- package/ios/NativeAPIs/HydraNativeMessaging.h +24 -0
- package/ios/NativeAPIs/HydraNativeMessaging.mm +53 -0
- package/ios/NativeAPIs/HydraNativeRemoteConfig.h +27 -0
- package/ios/NativeAPIs/HydraNativeRemoteConfig.mm +89 -0
- package/ios/Utils/HydraExtensions.swift +322 -0
- package/ios/Utils/HydraRNConstants.swift +13 -0
- package/ios/Utils/RNHydraLogger.swift +31 -0
- package/ios/generated/RNHydraLibSpec/ComponentDescriptors.cpp +24 -0
- package/ios/generated/RNHydraLibSpec/ComponentDescriptors.h +26 -0
- package/ios/generated/RNHydraLibSpec/EventEmitters.cpp +18 -0
- package/ios/generated/RNHydraLibSpec/EventEmitters.h +37 -0
- package/ios/generated/RNHydraLibSpec/Props.cpp +39 -0
- package/ios/generated/RNHydraLibSpec/Props.h +47 -0
- package/ios/generated/RNHydraLibSpec/RCTComponentViewHelpers.h +28 -0
- package/ios/generated/RNHydraLibSpec/RNHydraLibSpec-generated.mm +291 -0
- package/ios/generated/RNHydraLibSpec/RNHydraLibSpec.h +167 -0
- package/ios/generated/RNHydraLibSpec/ShadowNodes.cpp +19 -0
- package/ios/generated/RNHydraLibSpec/ShadowNodes.h +54 -0
- package/ios/generated/RNHydraLibSpec/States.cpp +16 -0
- package/ios/generated/RNHydraLibSpec/States.h +53 -0
- package/ios/generated/RNHydraLibSpecJSI-generated.cpp +283 -0
- package/ios/generated/RNHydraLibSpecJSI.h +395 -0
- package/lib/commonjs/GamificationBannerViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationBannerViewNativeComponent.js.map +1 -0
- package/lib/commonjs/GamificationEmbedViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationEmbedViewNativeComponent.js.map +1 -0
- package/lib/commonjs/GamificationLoyaltyViewNativeComponent.js +10 -0
- package/lib/commonjs/GamificationLoyaltyViewNativeComponent.js.map +1 -0
- package/lib/commonjs/NativeHydraLib.js +11 -0
- package/lib/commonjs/NativeHydraLib.js.map +1 -0
- package/lib/commonjs/components/GamificationBannerView.js +15 -0
- package/lib/commonjs/components/GamificationBannerView.js.map +1 -0
- package/lib/commonjs/components/GamificationEmbedView.js +15 -0
- package/lib/commonjs/components/GamificationEmbedView.js.map +1 -0
- package/lib/commonjs/components/GamificationLoyaltyView.js +15 -0
- package/lib/commonjs/components/GamificationLoyaltyView.js.map +1 -0
- package/lib/commonjs/hydra-apis/Hydra.js +43 -0
- package/lib/commonjs/hydra-apis/Hydra.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraCore.js +42 -0
- package/lib/commonjs/hydra-apis/HydraCore.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInAppMessaging.js +24 -0
- package/lib/commonjs/hydra-apis/HydraInAppMessaging.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInbox.js +29 -0
- package/lib/commonjs/hydra-apis/HydraInbox.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraInboxUI.js +18 -0
- package/lib/commonjs/hydra-apis/HydraInboxUI.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraNativeEventEmitter.js +133 -0
- package/lib/commonjs/hydra-apis/HydraNativeEventEmitter.js.map +1 -0
- package/lib/commonjs/hydra-apis/HydraPushNotification.js +21 -0
- package/lib/commonjs/hydra-apis/HydraPushNotification.js.map +1 -0
- package/lib/commonjs/index.js +230 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/HydraAccountConfig.js +41 -0
- package/lib/commonjs/models/HydraAccountConfig.js.map +1 -0
- package/lib/commonjs/models/HydraFirebaseRemoteConfigKeys.js +40 -0
- package/lib/commonjs/models/HydraFirebaseRemoteConfigKeys.js.map +1 -0
- package/lib/commonjs/models/HydraGeoConfig.js +24 -0
- package/lib/commonjs/models/HydraGeoConfig.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppButtonComponent.js +26 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppButtonComponent.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppComponentStyle.js +26 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppComponentStyle.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js +39 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppMessage.js +60 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppMessage.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTemplateType.js +66 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTemplateType.js.map +1 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTextComponent.js +21 -0
- package/lib/commonjs/models/HydraInAppMessage/HydraInAppTextComponent.js.map +1 -0
- package/lib/commonjs/models/HydraLogLevel.js +16 -0
- package/lib/commonjs/models/HydraLogLevel.js.map +1 -0
- package/lib/commonjs/models/HydraNativeEvent.js +27 -0
- package/lib/commonjs/models/HydraNativeEvent.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotification.js +70 -0
- package/lib/commonjs/models/HydraNotification/HydraNotification.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationBody.js +25 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationBody.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCta.js +23 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCta.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCtaType.js +62 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationCtaType.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationExpandedDetails.js +25 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationExpandedDetails.js.map +1 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationGateway.js +13 -0
- package/lib/commonjs/models/HydraNotification/HydraNotificationGateway.js.map +1 -0
- package/lib/commonjs/models/HydraPushPreferences.js +20 -0
- package/lib/commonjs/models/HydraPushPreferences.js.map +1 -0
- package/lib/commonjs/models/HydraUserDetails.js +26 -0
- package/lib/commonjs/models/HydraUserDetails.js.map +1 -0
- package/lib/commonjs/models/HydraVisitorInfo.js +19 -0
- package/lib/commonjs/models/HydraVisitorInfo.js.map +1 -0
- package/lib/commonjs/models/NonHydraNotification.js +18 -0
- package/lib/commonjs/models/NonHydraNotification.js.map +1 -0
- package/lib/commonjs/models/UserState.js +41 -0
- package/lib/commonjs/models/UserState.js.map +1 -0
- package/lib/module/GamificationBannerViewNativeComponent.js +5 -0
- package/lib/module/GamificationBannerViewNativeComponent.js.map +1 -0
- package/lib/module/GamificationEmbedViewNativeComponent.js +5 -0
- package/lib/module/GamificationEmbedViewNativeComponent.js.map +1 -0
- package/lib/module/GamificationLoyaltyViewNativeComponent.js +5 -0
- package/lib/module/GamificationLoyaltyViewNativeComponent.js.map +1 -0
- package/lib/module/NativeHydraLib.js +7 -0
- package/lib/module/NativeHydraLib.js.map +1 -0
- package/lib/module/components/GamificationBannerView.js +10 -0
- package/lib/module/components/GamificationBannerView.js.map +1 -0
- package/lib/module/components/GamificationEmbedView.js +10 -0
- package/lib/module/components/GamificationEmbedView.js.map +1 -0
- package/lib/module/components/GamificationLoyaltyView.js +10 -0
- package/lib/module/components/GamificationLoyaltyView.js.map +1 -0
- package/lib/module/hydra-apis/Hydra.js +37 -0
- package/lib/module/hydra-apis/Hydra.js.map +1 -0
- package/lib/module/hydra-apis/HydraCore.js +36 -0
- package/lib/module/hydra-apis/HydraCore.js.map +1 -0
- package/lib/module/hydra-apis/HydraInAppMessaging.js +18 -0
- package/lib/module/hydra-apis/HydraInAppMessaging.js.map +1 -0
- package/lib/module/hydra-apis/HydraInbox.js +23 -0
- package/lib/module/hydra-apis/HydraInbox.js.map +1 -0
- package/lib/module/hydra-apis/HydraInboxUI.js +12 -0
- package/lib/module/hydra-apis/HydraInboxUI.js.map +1 -0
- package/lib/module/hydra-apis/HydraNativeEventEmitter.js +127 -0
- package/lib/module/hydra-apis/HydraNativeEventEmitter.js.map +1 -0
- package/lib/module/hydra-apis/HydraPushNotification.js +15 -0
- package/lib/module/hydra-apis/HydraPushNotification.js.map +1 -0
- package/lib/module/index.js +36 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/HydraAccountConfig.js +36 -0
- package/lib/module/models/HydraAccountConfig.js.map +1 -0
- package/lib/module/models/HydraFirebaseRemoteConfigKeys.js +35 -0
- package/lib/module/models/HydraFirebaseRemoteConfigKeys.js.map +1 -0
- package/lib/module/models/HydraGeoConfig.js +19 -0
- package/lib/module/models/HydraGeoConfig.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppButtonComponent.js +21 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppButtonComponent.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppComponentStyle.js +21 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppComponentStyle.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js +35 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppMessage.js +55 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppMessage.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTemplateType.js +62 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTemplateType.js.map +1 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTextComponent.js +16 -0
- package/lib/module/models/HydraInAppMessage/HydraInAppTextComponent.js.map +1 -0
- package/lib/module/models/HydraLogLevel.js +12 -0
- package/lib/module/models/HydraLogLevel.js.map +1 -0
- package/lib/module/models/HydraNativeEvent.js +23 -0
- package/lib/module/models/HydraNativeEvent.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotification.js +65 -0
- package/lib/module/models/HydraNotification/HydraNotification.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationBody.js +20 -0
- package/lib/module/models/HydraNotification/HydraNotificationBody.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationCta.js +18 -0
- package/lib/module/models/HydraNotification/HydraNotificationCta.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationCtaType.js +58 -0
- package/lib/module/models/HydraNotification/HydraNotificationCtaType.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationExpandedDetails.js +20 -0
- package/lib/module/models/HydraNotification/HydraNotificationExpandedDetails.js.map +1 -0
- package/lib/module/models/HydraNotification/HydraNotificationGateway.js +9 -0
- package/lib/module/models/HydraNotification/HydraNotificationGateway.js.map +1 -0
- package/lib/module/models/HydraPushPreferences.js +15 -0
- package/lib/module/models/HydraPushPreferences.js.map +1 -0
- package/lib/module/models/HydraUserDetails.js +21 -0
- package/lib/module/models/HydraUserDetails.js.map +1 -0
- package/lib/module/models/HydraVisitorInfo.js +14 -0
- package/lib/module/models/HydraVisitorInfo.js.map +1 -0
- package/lib/module/models/NonHydraNotification.js +13 -0
- package/lib/module/models/NonHydraNotification.js.map +1 -0
- package/lib/module/models/UserState.js +37 -0
- package/lib/module/models/UserState.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/GamificationBannerViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/GamificationEmbedViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationEmbedViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/GamificationLoyaltyViewNativeComponent.d.ts +7 -0
- package/lib/typescript/commonjs/src/GamificationLoyaltyViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/NativeHydraLib.d.ts +46 -0
- package/lib/typescript/commonjs/src/NativeHydraLib.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationBannerView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationBannerView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationEmbedView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationEmbedView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/GamificationLoyaltyView.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/GamificationLoyaltyView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/Hydra.d.ts +15 -0
- package/lib/typescript/commonjs/src/hydra-apis/Hydra.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraCore.d.ts +18 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraCore.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInAppMessaging.d.ts +8 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInAppMessaging.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInbox.d.ts +9 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInboxUI.d.ts +5 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraInboxUI.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraNativeEventEmitter.d.ts +35 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraPushNotification.d.ts +6 -0
- package/lib/typescript/commonjs/src/hydra-apis/HydraPushNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +37 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraAccountConfig.d.ts +14 -0
- package/lib/typescript/commonjs/src/models/HydraAccountConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraFirebaseRemoteConfigKeys.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraFirebaseRemoteConfigKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraGeoConfig.d.ts +14 -0
- package/lib/typescript/commonjs/src/models/HydraGeoConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts +16 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts +10 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppMessage.d.ts +29 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppMessage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts +15 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts +11 -0
- package/lib/typescript/commonjs/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraLogLevel.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/HydraLogLevel.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNativeEvent.d.ts +20 -0
- package/lib/typescript/commonjs/src/models/HydraNativeEvent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotification.d.ts +32 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationBody.d.ts +19 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationBody.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCta.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCta.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCtaType.d.ts +13 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationCtaType.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts +19 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationGateway.d.ts +6 -0
- package/lib/typescript/commonjs/src/models/HydraNotification/HydraNotificationGateway.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraPushPreferences.d.ts +10 -0
- package/lib/typescript/commonjs/src/models/HydraPushPreferences.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraUserDetails.d.ts +16 -0
- package/lib/typescript/commonjs/src/models/HydraUserDetails.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/HydraVisitorInfo.d.ts +6 -0
- package/lib/typescript/commonjs/src/models/HydraVisitorInfo.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/NonHydraNotification.d.ts +9 -0
- package/lib/typescript/commonjs/src/models/NonHydraNotification.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/models/UserState.d.ts +11 -0
- package/lib/typescript/commonjs/src/models/UserState.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/GamificationBannerViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationBannerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/GamificationEmbedViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationEmbedViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/GamificationLoyaltyViewNativeComponent.d.ts +7 -0
- package/lib/typescript/module/src/GamificationLoyaltyViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeHydraLib.d.ts +46 -0
- package/lib/typescript/module/src/NativeHydraLib.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationBannerView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationBannerView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationEmbedView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationEmbedView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/GamificationLoyaltyView.d.ts +6 -0
- package/lib/typescript/module/src/components/GamificationLoyaltyView.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/Hydra.d.ts +15 -0
- package/lib/typescript/module/src/hydra-apis/Hydra.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraCore.d.ts +18 -0
- package/lib/typescript/module/src/hydra-apis/HydraCore.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInAppMessaging.d.ts +8 -0
- package/lib/typescript/module/src/hydra-apis/HydraInAppMessaging.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInbox.d.ts +9 -0
- package/lib/typescript/module/src/hydra-apis/HydraInbox.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraInboxUI.d.ts +5 -0
- package/lib/typescript/module/src/hydra-apis/HydraInboxUI.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraNativeEventEmitter.d.ts +35 -0
- package/lib/typescript/module/src/hydra-apis/HydraNativeEventEmitter.d.ts.map +1 -0
- package/lib/typescript/module/src/hydra-apis/HydraPushNotification.d.ts +6 -0
- package/lib/typescript/module/src/hydra-apis/HydraPushNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +37 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraAccountConfig.d.ts +14 -0
- package/lib/typescript/module/src/models/HydraAccountConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraFirebaseRemoteConfigKeys.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraFirebaseRemoteConfigKeys.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraGeoConfig.d.ts +14 -0
- package/lib/typescript/module/src/models/HydraGeoConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts +16 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppButtonComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts +10 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppComponentStyle.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts +9 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppMessage.d.ts +29 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppMessage.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts +15 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTemplateType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts +11 -0
- package/lib/typescript/module/src/models/HydraInAppMessage/HydraInAppTextComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraLogLevel.d.ts +9 -0
- package/lib/typescript/module/src/models/HydraLogLevel.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNativeEvent.d.ts +20 -0
- package/lib/typescript/module/src/models/HydraNativeEvent.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotification.d.ts +32 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationBody.d.ts +19 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationBody.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCta.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCta.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCtaType.d.ts +13 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationCtaType.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts +19 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationExpandedDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationGateway.d.ts +6 -0
- package/lib/typescript/module/src/models/HydraNotification/HydraNotificationGateway.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraPushPreferences.d.ts +10 -0
- package/lib/typescript/module/src/models/HydraPushPreferences.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraUserDetails.d.ts +16 -0
- package/lib/typescript/module/src/models/HydraUserDetails.d.ts.map +1 -0
- package/lib/typescript/module/src/models/HydraVisitorInfo.d.ts +6 -0
- package/lib/typescript/module/src/models/HydraVisitorInfo.d.ts.map +1 -0
- package/lib/typescript/module/src/models/NonHydraNotification.d.ts +9 -0
- package/lib/typescript/module/src/models/NonHydraNotification.d.ts.map +1 -0
- package/lib/typescript/module/src/models/UserState.d.ts +11 -0
- package/lib/typescript/module/src/models/UserState.d.ts.map +1 -0
- package/package.json +225 -0
- package/react-native-hydra-lib.podspec +256 -0
- package/react-native.config.js +33 -0
- package/sbom.spdx.json +544 -0
- package/scripts/HydraPods.rb +151 -0
- package/scripts/generate-sbom.js +367 -0
- package/scripts/hydra-podspecs/HydraCore.podspec +13 -0
- package/scripts/hydra-podspecs/HydraInAppMessage.podspec +15 -0
- package/scripts/hydra-podspecs/HydraInboxCore.podspec +15 -0
- package/scripts/hydra-podspecs/HydraInboxUI.podspec +15 -0
- package/scripts/hydra-podspecs/HydraPushNotification.podspec +14 -0
- package/scripts/hydra-podspecs/HydraPushNotificationServiceExtension.podspec +15 -0
- package/src/GamificationBannerViewNativeComponent.ts +10 -0
- package/src/GamificationEmbedViewNativeComponent.ts +10 -0
- package/src/GamificationLoyaltyViewNativeComponent.ts +10 -0
- package/src/NativeHydraLib.ts +81 -0
- package/src/components/GamificationBannerView.tsx +10 -0
- package/src/components/GamificationEmbedView.tsx +10 -0
- package/src/components/GamificationLoyaltyView.tsx +10 -0
- package/src/hydra-apis/Hydra.ts +52 -0
- package/src/hydra-apis/HydraCore.ts +76 -0
- package/src/hydra-apis/HydraInAppMessaging.ts +25 -0
- package/src/hydra-apis/HydraInbox.ts +33 -0
- package/src/hydra-apis/HydraInboxUI.ts +10 -0
- package/src/hydra-apis/HydraNativeEventEmitter.ts +216 -0
- package/src/hydra-apis/HydraPushNotification.ts +15 -0
- package/src/index.tsx +71 -0
- package/src/models/HydraAccountConfig.ts +45 -0
- package/src/models/HydraFirebaseRemoteConfigKeys.ts +43 -0
- package/src/models/HydraGeoConfig.ts +27 -0
- package/src/models/HydraInAppMessage/HydraInAppButtonComponent.ts +27 -0
- package/src/models/HydraInAppMessage/HydraInAppComponentStyle.ts +24 -0
- package/src/models/HydraInAppMessage/HydraInAppFeedbackSelectionType.ts +35 -0
- package/src/models/HydraInAppMessage/HydraInAppMessage.ts +89 -0
- package/src/models/HydraInAppMessage/HydraInAppTemplateType.ts +57 -0
- package/src/models/HydraInAppMessage/HydraInAppTextComponent.ts +18 -0
- package/src/models/HydraLogLevel.ts +8 -0
- package/src/models/HydraNativeEvent.ts +19 -0
- package/src/models/HydraNotification/HydraNotification.ts +97 -0
- package/src/models/HydraNotification/HydraNotificationBody.ts +23 -0
- package/src/models/HydraNotification/HydraNotificationCta.ts +20 -0
- package/src/models/HydraNotification/HydraNotificationCtaType.ts +59 -0
- package/src/models/HydraNotification/HydraNotificationExpandedDetails.ts +28 -0
- package/src/models/HydraNotification/HydraNotificationGateway.ts +5 -0
- package/src/models/HydraPushPreferences.ts +16 -0
- package/src/models/HydraUserDetails.ts +31 -0
- package/src/models/HydraVisitorInfo.ts +14 -0
- package/src/models/NonHydraNotification.ts +15 -0
- package/src/models/UserState.ts +33 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class HydraFirebaseRemoteConfigKeys {
|
|
2
|
+
readonly keyForAccountId: string;
|
|
3
|
+
readonly keyForBaseUrl: string;
|
|
4
|
+
readonly keyForSsl: string;
|
|
5
|
+
readonly keyForRemoteDebugLevel: string;
|
|
6
|
+
readonly keyForOrgId?: string;
|
|
7
|
+
readonly keyForGamificationKey?: string;
|
|
8
|
+
readonly keyForGamificationRegion?: string;
|
|
9
|
+
readonly keyForGamificationBaseUrl?: string;
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
keyForAccountId: string,
|
|
13
|
+
keyForBaseUrl: string,
|
|
14
|
+
keyForSsl: string,
|
|
15
|
+
keyForRemoteDebugLevel: string,
|
|
16
|
+
keyForOrgId?: string,
|
|
17
|
+
keyForGamificationKey?: string,
|
|
18
|
+
keyForGamificationRegion?: string,
|
|
19
|
+
keyForGamificationBaseUrl?: string
|
|
20
|
+
) {
|
|
21
|
+
this.keyForAccountId = keyForAccountId;
|
|
22
|
+
this.keyForBaseUrl = keyForBaseUrl;
|
|
23
|
+
this.keyForSsl = keyForSsl;
|
|
24
|
+
this.keyForRemoteDebugLevel = keyForRemoteDebugLevel;
|
|
25
|
+
this.keyForOrgId = keyForOrgId;
|
|
26
|
+
this.keyForGamificationKey = keyForGamificationKey;
|
|
27
|
+
this.keyForGamificationRegion = keyForGamificationRegion;
|
|
28
|
+
this.keyForGamificationBaseUrl = keyForGamificationBaseUrl;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
toJson(): Record<string, any> {
|
|
32
|
+
return {
|
|
33
|
+
keyForAccountId: this.keyForAccountId,
|
|
34
|
+
keyForBaseUrl: this.keyForBaseUrl,
|
|
35
|
+
keyForSsl: this.keyForSsl,
|
|
36
|
+
keyForRemoteDebugLevel: this.keyForRemoteDebugLevel,
|
|
37
|
+
...(this.keyForOrgId !== undefined && { keyForOrgId: this.keyForOrgId }),
|
|
38
|
+
...(this.keyForGamificationKey !== undefined && { keyForGamificationKey: this.keyForGamificationKey }),
|
|
39
|
+
...(this.keyForGamificationRegion !== undefined && { keyForGamificationRegion: this.keyForGamificationRegion }),
|
|
40
|
+
...(this.keyForGamificationBaseUrl !== undefined && { keyForGamificationBaseUrl: this.keyForGamificationBaseUrl }),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class HydraGeoConfig {
|
|
2
|
+
city: string;
|
|
3
|
+
country: string;
|
|
4
|
+
countryCode: string;
|
|
5
|
+
timezone: string | null;
|
|
6
|
+
|
|
7
|
+
constructor(
|
|
8
|
+
city: string,
|
|
9
|
+
country: string,
|
|
10
|
+
countryCode: string,
|
|
11
|
+
timezone: string | null = null
|
|
12
|
+
) {
|
|
13
|
+
this.city = city;
|
|
14
|
+
this.country = country;
|
|
15
|
+
this.countryCode = countryCode;
|
|
16
|
+
this.timezone = timezone;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toJson() {
|
|
20
|
+
return {
|
|
21
|
+
city: this.city,
|
|
22
|
+
country: this.country,
|
|
23
|
+
countryCode: this.countryCode,
|
|
24
|
+
timezone: this.timezone,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HydraNotificationCtaType } from '../HydraNotification/HydraNotificationCtaType';
|
|
2
|
+
import { HydraInAppComponentStyle } from './HydraInAppComponentStyle';
|
|
3
|
+
|
|
4
|
+
export class HydraInAppButtonComponent {
|
|
5
|
+
readonly actionText: string | null;
|
|
6
|
+
readonly action: string | null;
|
|
7
|
+
readonly type: HydraNotificationCtaType | null;
|
|
8
|
+
readonly style: HydraInAppComponentStyle;
|
|
9
|
+
|
|
10
|
+
constructor(json: Record<string, any>) {
|
|
11
|
+
this.actionText = json.actionText;
|
|
12
|
+
this.action = json.action;
|
|
13
|
+
this.type = json.type
|
|
14
|
+
? HydraNotificationCtaType.fromString(json.type)
|
|
15
|
+
: null;
|
|
16
|
+
this.style = new HydraInAppComponentStyle(json.style);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toJson() {
|
|
20
|
+
return {
|
|
21
|
+
actionText: this.actionText,
|
|
22
|
+
action: this.action,
|
|
23
|
+
type: this.type ? this.type.toString() : null,
|
|
24
|
+
style: this.style.toJson(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export class HydraInAppComponentStyle {
|
|
2
|
+
readonly backgroundColor: string | null;
|
|
3
|
+
readonly textColor: string | null;
|
|
4
|
+
readonly fontSize: number | null;
|
|
5
|
+
readonly fontStyle: string | null;
|
|
6
|
+
readonly fontName: string | null;
|
|
7
|
+
|
|
8
|
+
constructor(json: Record<string, any>) {
|
|
9
|
+
this.backgroundColor = json.backgroundColor;
|
|
10
|
+
this.textColor = json.textColor;
|
|
11
|
+
this.fontSize = json.fontSize;
|
|
12
|
+
this.fontStyle = json.fontStyle;
|
|
13
|
+
this.fontName = json.fontName;
|
|
14
|
+
}
|
|
15
|
+
toJson(): Object {
|
|
16
|
+
return {
|
|
17
|
+
backgroundColor: this.backgroundColor,
|
|
18
|
+
textColor: this.textColor,
|
|
19
|
+
fontSize: this.fontSize,
|
|
20
|
+
fontStyle: this.fontStyle,
|
|
21
|
+
fontName: this.fontName,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export enum HydraInAppFeedbackSelectionType {
|
|
4
|
+
single,
|
|
5
|
+
multiple,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export namespace HydraInAppFeedbackSelectionType {
|
|
9
|
+
export function fromString(
|
|
10
|
+
value: string
|
|
11
|
+
): HydraInAppFeedbackSelectionType | null {
|
|
12
|
+
switch (value) {
|
|
13
|
+
case 'SingleSelection':
|
|
14
|
+
case 'singleSelection':
|
|
15
|
+
return HydraInAppFeedbackSelectionType.single;
|
|
16
|
+
case 'MultipleSelection':
|
|
17
|
+
case 'multipleSelection':
|
|
18
|
+
return HydraInAppFeedbackSelectionType.multiple;
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function toString(value: HydraInAppFeedbackSelectionType): string {
|
|
24
|
+
switch (value) {
|
|
25
|
+
case HydraInAppFeedbackSelectionType.single:
|
|
26
|
+
return Platform.OS === 'ios' ? 'singleSelection' : 'SingleSelection';
|
|
27
|
+
case HydraInAppFeedbackSelectionType.multiple:
|
|
28
|
+
return Platform.OS === 'ios'
|
|
29
|
+
? 'multipleSelection'
|
|
30
|
+
: 'MultipleSelection';
|
|
31
|
+
default:
|
|
32
|
+
throw new Error('Invalid HydraInAppFeedbackSelectionType');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { HydraInAppButtonComponent } from './HydraInAppButtonComponent';
|
|
2
|
+
import { HydraInAppFeedbackSelectionType } from './HydraInAppFeedbackSelectionType';
|
|
3
|
+
import { HydraInAppTemplateType } from './HydraInAppTemplateType';
|
|
4
|
+
import { HydraInAppTextComponent } from './HydraInAppTextComponent';
|
|
5
|
+
|
|
6
|
+
export class HydraInAppMessage {
|
|
7
|
+
readonly scope: string;
|
|
8
|
+
readonly campaignId: string | null;
|
|
9
|
+
readonly cuid: string | null;
|
|
10
|
+
readonly senderId: string | null;
|
|
11
|
+
readonly title: HydraInAppTextComponent | null;
|
|
12
|
+
readonly message: HydraInAppTextComponent | null;
|
|
13
|
+
readonly imageUrl: string | null;
|
|
14
|
+
readonly campaignType: string;
|
|
15
|
+
readonly eventAttributes: Record<string, string> | null;
|
|
16
|
+
readonly actionButton: HydraInAppButtonComponent | null;
|
|
17
|
+
readonly negativeButton: HydraInAppButtonComponent | null;
|
|
18
|
+
readonly templateType: HydraInAppTemplateType | null;
|
|
19
|
+
readonly phoneBackgroundColor: string | null;
|
|
20
|
+
readonly layoutBackgroundColor: string | null;
|
|
21
|
+
readonly feedbackSelectionType: HydraInAppFeedbackSelectionType | null;
|
|
22
|
+
readonly feedbackOptions: string[] | null;
|
|
23
|
+
readonly ratingSelectedColor: string | null;
|
|
24
|
+
readonly ratingUnselectedColor: string | null;
|
|
25
|
+
readonly createdAt: Date | null;
|
|
26
|
+
readonly nativeJsonPayload: string | null;
|
|
27
|
+
|
|
28
|
+
constructor(json: Record<string, any>) {
|
|
29
|
+
this.scope = json.scope;
|
|
30
|
+
this.campaignId = json.campaignId;
|
|
31
|
+
this.cuid = json.cuid;
|
|
32
|
+
this.senderId = json.senderId;
|
|
33
|
+
this.title = json.title ? new HydraInAppTextComponent(json.title) : null;
|
|
34
|
+
this.message = json.message
|
|
35
|
+
? new HydraInAppTextComponent(json.message)
|
|
36
|
+
: null;
|
|
37
|
+
this.imageUrl = json.imageUrl;
|
|
38
|
+
this.campaignType = json.campaignType;
|
|
39
|
+
this.eventAttributes = json.eventAttributes;
|
|
40
|
+
this.actionButton = json.actionButton
|
|
41
|
+
? new HydraInAppButtonComponent(json.actionButton)
|
|
42
|
+
: null;
|
|
43
|
+
this.negativeButton = json.negativeButton
|
|
44
|
+
? new HydraInAppButtonComponent(json.negativeButton)
|
|
45
|
+
: null;
|
|
46
|
+
this.templateType = json.templateType
|
|
47
|
+
? HydraInAppTemplateType.fromString(json.templateType)
|
|
48
|
+
: null;
|
|
49
|
+
|
|
50
|
+
this.phoneBackgroundColor = json.phoneBackgroundColor;
|
|
51
|
+
this.layoutBackgroundColor = json.layoutBackgroundColor;
|
|
52
|
+
this.feedbackSelectionType = json.feedbackSelectionType
|
|
53
|
+
? HydraInAppFeedbackSelectionType.fromString(json.feedbackType)
|
|
54
|
+
: null;
|
|
55
|
+
this.feedbackOptions = json.feedbackOptions;
|
|
56
|
+
this.ratingSelectedColor = json.ratingSelectedColor;
|
|
57
|
+
this.ratingUnselectedColor = json.ratingUnselectedColor;
|
|
58
|
+
this.createdAt = json.createdAt ? new Date(json.createdAt) : null;
|
|
59
|
+
this.nativeJsonPayload = json.nativeJsonPayload;
|
|
60
|
+
}
|
|
61
|
+
toJson(): Object {
|
|
62
|
+
return {
|
|
63
|
+
scope: this.scope,
|
|
64
|
+
campaignId: this.campaignId,
|
|
65
|
+
cuid: this.cuid,
|
|
66
|
+
senderId: this.senderId,
|
|
67
|
+
title: this.title ? this.title.toJson() : null,
|
|
68
|
+
message: this.message ? this.message.toJson() : null,
|
|
69
|
+
imageUrl: this.imageUrl,
|
|
70
|
+
campaignType: this.campaignType,
|
|
71
|
+
eventAttributes: this.eventAttributes,
|
|
72
|
+
actionButton: this.actionButton ? this.actionButton.toJson() : null,
|
|
73
|
+
negativeButton: this.negativeButton ? this.negativeButton.toJson() : null,
|
|
74
|
+
templateType: this.templateType
|
|
75
|
+
? HydraInAppTemplateType.toString(this.templateType)
|
|
76
|
+
: null,
|
|
77
|
+
phoneBackgroundColor: this.phoneBackgroundColor,
|
|
78
|
+
layoutBackgroundColor: this.layoutBackgroundColor,
|
|
79
|
+
feedbackType: this.feedbackSelectionType
|
|
80
|
+
? HydraInAppFeedbackSelectionType.toString(this.feedbackSelectionType)
|
|
81
|
+
: null,
|
|
82
|
+
feedbackOptions: this.feedbackOptions,
|
|
83
|
+
ratingSelectedColor: this.ratingSelectedColor,
|
|
84
|
+
ratingUnselectedColor: this.ratingUnselectedColor,
|
|
85
|
+
createdAt: this.createdAt ? this.createdAt.toISOString() : null,
|
|
86
|
+
nativeJsonPayload: this.nativeJsonPayload,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export enum HydraInAppTemplateType {
|
|
2
|
+
badge,
|
|
3
|
+
popup,
|
|
4
|
+
header,
|
|
5
|
+
footer,
|
|
6
|
+
fullScreen,
|
|
7
|
+
rating,
|
|
8
|
+
feedback,
|
|
9
|
+
appRating,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace HydraInAppTemplateType {
|
|
13
|
+
export function fromString(value: string): HydraInAppTemplateType | null {
|
|
14
|
+
switch (value) {
|
|
15
|
+
case 'BADGE':
|
|
16
|
+
return HydraInAppTemplateType.badge;
|
|
17
|
+
case 'POPUP':
|
|
18
|
+
return HydraInAppTemplateType.popup;
|
|
19
|
+
case 'HEADER':
|
|
20
|
+
return HydraInAppTemplateType.header;
|
|
21
|
+
case 'FOOTER':
|
|
22
|
+
return HydraInAppTemplateType.footer;
|
|
23
|
+
case 'FULLSCREEN':
|
|
24
|
+
return HydraInAppTemplateType.fullScreen;
|
|
25
|
+
case 'RATING':
|
|
26
|
+
return HydraInAppTemplateType.rating;
|
|
27
|
+
case 'FEEDBACK':
|
|
28
|
+
return HydraInAppTemplateType.feedback;
|
|
29
|
+
case 'APPRATING':
|
|
30
|
+
return HydraInAppTemplateType.appRating;
|
|
31
|
+
default:
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function toString(value: HydraInAppTemplateType): string {
|
|
36
|
+
switch (value) {
|
|
37
|
+
case HydraInAppTemplateType.badge:
|
|
38
|
+
return 'BADGE';
|
|
39
|
+
case HydraInAppTemplateType.popup:
|
|
40
|
+
return 'POPUP';
|
|
41
|
+
case HydraInAppTemplateType.header:
|
|
42
|
+
return 'HEADER';
|
|
43
|
+
case HydraInAppTemplateType.footer:
|
|
44
|
+
return 'FOOTER';
|
|
45
|
+
case HydraInAppTemplateType.fullScreen:
|
|
46
|
+
return 'FULLSCREEN';
|
|
47
|
+
case HydraInAppTemplateType.rating:
|
|
48
|
+
return 'RATING';
|
|
49
|
+
case HydraInAppTemplateType.feedback:
|
|
50
|
+
return 'FEEDBACK';
|
|
51
|
+
case HydraInAppTemplateType.appRating:
|
|
52
|
+
return 'APPRATING';
|
|
53
|
+
default:
|
|
54
|
+
throw new Error('Invalid HydraInAppTemplateType');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HydraInAppComponentStyle } from './HydraInAppComponentStyle';
|
|
2
|
+
|
|
3
|
+
export class HydraInAppTextComponent {
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly style: HydraInAppComponentStyle;
|
|
6
|
+
|
|
7
|
+
constructor(json: Record<string, any>) {
|
|
8
|
+
this.text = json.text;
|
|
9
|
+
this.style = new HydraInAppComponentStyle(json.style);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
toJson() {
|
|
13
|
+
return {
|
|
14
|
+
text: this.text,
|
|
15
|
+
style: this.style.toJson(),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export enum HydraNativeEvent {
|
|
2
|
+
onTokenAvailable = 'onTokenAvailable',
|
|
3
|
+
onNonHydraNotificationReceived = 'onNonHydraNotificationReceived',
|
|
4
|
+
onNonHydraNotificationClicked = 'onNonHydraNotificationClicked',
|
|
5
|
+
onHydraNotificationReceived = 'onHydraNotificationReceived',
|
|
6
|
+
onHydraNotificationClicked = 'onHydraNotificationClicked',
|
|
7
|
+
onHydraNotificationShown = 'onHydraNotificationShown',
|
|
8
|
+
onHydraNotificationDismissed = 'onHydraNotificationDismissed',
|
|
9
|
+
handleCustomAction = 'handleCustomAction',
|
|
10
|
+
onNotificationCenterDismissed = 'onNotificationCenterDismissed',
|
|
11
|
+
onInboxUpdated = 'onInboxUpdated',
|
|
12
|
+
onHydraSdkInitializationResult = 'onHydraSdkInitializationResult',
|
|
13
|
+
onHydraInAppMessage = 'onHydraInAppMessage',
|
|
14
|
+
onConfigFetchedCallback = 'onConfigFetchedCallback',
|
|
15
|
+
onLegacyFlowReady = 'onLegacyFlowReady',
|
|
16
|
+
onVisitorSessionReady = 'onVisitorSessionReady',
|
|
17
|
+
onUserStateChanged = 'onUserStateChanged',
|
|
18
|
+
onGamificationViewHeightChanged = 'onGamificationViewHeightChanged',
|
|
19
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { HydraNotificationBody } from './HydraNotificationBody';
|
|
3
|
+
import { HydraNotificationExpandedDetails } from './HydraNotificationExpandedDetails';
|
|
4
|
+
import { HydraNotificationGateway } from './HydraNotificationGateway';
|
|
5
|
+
|
|
6
|
+
export class HydraNotification {
|
|
7
|
+
readonly cuid: string | null;
|
|
8
|
+
readonly scope: string | null;
|
|
9
|
+
readonly campaignId: string | null;
|
|
10
|
+
readonly variationId: string | null;
|
|
11
|
+
readonly senderId: string | null;
|
|
12
|
+
readonly senderSource: string | null;
|
|
13
|
+
readonly custom: string | null;
|
|
14
|
+
readonly customData: Record<string, any> | null;
|
|
15
|
+
readonly priority: string | null;
|
|
16
|
+
readonly validity: string | null;
|
|
17
|
+
readonly messageId: string | null;
|
|
18
|
+
readonly gateway: HydraNotificationGateway | null;
|
|
19
|
+
readonly body: HydraNotificationBody | null;
|
|
20
|
+
readonly expandableDetails: HydraNotificationExpandedDetails | null;
|
|
21
|
+
readonly isRead: boolean | null;
|
|
22
|
+
readonly imageIdentifier: string | null;
|
|
23
|
+
readonly accountId: string | null;
|
|
24
|
+
readonly channelId: string | null;
|
|
25
|
+
readonly payload: string | null;
|
|
26
|
+
readonly createdAt: Date | null;
|
|
27
|
+
readonly isExpanded: boolean | null;
|
|
28
|
+
readonly isMessageEllipsized: boolean | null;
|
|
29
|
+
readonly isTitleEllipsized: boolean | null;
|
|
30
|
+
readonly showArrow: boolean | null;
|
|
31
|
+
|
|
32
|
+
constructor(json: Record<string, any>) {
|
|
33
|
+
this.cuid = json.cuid;
|
|
34
|
+
this.scope = json.scope;
|
|
35
|
+
this.campaignId = json.campaignId;
|
|
36
|
+
this.variationId = json.variationId;
|
|
37
|
+
this.senderId = json.senderId;
|
|
38
|
+
this.senderSource = json.senderSource;
|
|
39
|
+
this.custom = json.custom;
|
|
40
|
+
this.customData = json.customData;
|
|
41
|
+
this.priority = json.priority;
|
|
42
|
+
this.validity = json.validity;
|
|
43
|
+
this.messageId = json.messageId;
|
|
44
|
+
this.gateway = json.gateway
|
|
45
|
+
? HydraNotificationGateway[
|
|
46
|
+
json.gateway as keyof typeof HydraNotificationGateway
|
|
47
|
+
]
|
|
48
|
+
: HydraNotificationGateway.unknown;
|
|
49
|
+
this.body = json.body ? new HydraNotificationBody(json.body) : null;
|
|
50
|
+
this.expandableDetails = json.expandableDetails
|
|
51
|
+
? new HydraNotificationExpandedDetails(json.expandableDetails)
|
|
52
|
+
: null;
|
|
53
|
+
this.isRead = json.isRead ? json.isRead === 'true' : false;
|
|
54
|
+
this.imageIdentifier = json.imageIdentifier;
|
|
55
|
+
this.accountId = json.accountId;
|
|
56
|
+
this.channelId = json.channelId;
|
|
57
|
+
this.payload = json.payload;
|
|
58
|
+
this.createdAt = json.createdAt ? new Date(json.createdAt) : null;
|
|
59
|
+
this.isExpanded = json.isExpanded;
|
|
60
|
+
this.isMessageEllipsized = json.isMessageEllipsized;
|
|
61
|
+
this.isTitleEllipsized = json.isTitleEllipsized;
|
|
62
|
+
this.showArrow = json.showArrow;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
toJson(overrideIsReadWith?: boolean): Record<string, any> {
|
|
66
|
+
const isReadValueToUse = overrideIsReadWith ?? this.isRead;
|
|
67
|
+
return {
|
|
68
|
+
cuid: this.cuid,
|
|
69
|
+
scope: this.scope,
|
|
70
|
+
campaignId: this.campaignId,
|
|
71
|
+
variationId: this.variationId,
|
|
72
|
+
senderID: Platform.OS === 'ios' ? this.senderId : null,
|
|
73
|
+
senderId: Platform.OS === 'android' ? this.senderId : null,
|
|
74
|
+
senderSource: this.senderSource,
|
|
75
|
+
custom: this.custom,
|
|
76
|
+
customData: this.customData,
|
|
77
|
+
priority: this.priority,
|
|
78
|
+
validity: this.validity,
|
|
79
|
+
messageId: this.messageId,
|
|
80
|
+
gateway: HydraNotificationGateway[this.gateway!],
|
|
81
|
+
body: this.body ? this.body.toJson() : null,
|
|
82
|
+
expandableDetails: this.expandableDetails
|
|
83
|
+
? this.expandableDetails.toJson()
|
|
84
|
+
: null,
|
|
85
|
+
isRead: isReadValueToUse ? 'true' : 'false',
|
|
86
|
+
imageIdentifier: this.imageIdentifier,
|
|
87
|
+
accountId: this.accountId,
|
|
88
|
+
channelId: this.channelId,
|
|
89
|
+
payload: this.payload,
|
|
90
|
+
createdAt: this.createdAt ? this.createdAt.toISOString() : null,
|
|
91
|
+
isExpanded: this.isExpanded,
|
|
92
|
+
isMessageEllipsized: this.isMessageEllipsized,
|
|
93
|
+
isTitleEllipsized: this.isTitleEllipsized,
|
|
94
|
+
showArrow: this.showArrow,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HydraNotificationCta } from './HydraNotificationCta';
|
|
2
|
+
|
|
3
|
+
export class HydraNotificationBody {
|
|
4
|
+
readonly title: string | null;
|
|
5
|
+
readonly message: string | null;
|
|
6
|
+
readonly cta: HydraNotificationCta | null;
|
|
7
|
+
readonly image: string | null;
|
|
8
|
+
constructor(json: Record<string, any>) {
|
|
9
|
+
this.title = json.title;
|
|
10
|
+
this.message = json.message;
|
|
11
|
+
this.cta = json.cta ? new HydraNotificationCta(json.cta) : null;
|
|
12
|
+
this.image = json.image;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJson() {
|
|
16
|
+
return {
|
|
17
|
+
title: this.title,
|
|
18
|
+
message: this.message,
|
|
19
|
+
cta: this.cta ? this.cta.toJson() : null,
|
|
20
|
+
image: this.image,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HydraNotificationCtaType } from './HydraNotificationCtaType';
|
|
2
|
+
|
|
3
|
+
export class HydraNotificationCta {
|
|
4
|
+
readonly type: HydraNotificationCtaType | null;
|
|
5
|
+
readonly action: string | null;
|
|
6
|
+
readonly actionText: string | null;
|
|
7
|
+
constructor(json: Record<string, any>) {
|
|
8
|
+
this.type = HydraNotificationCtaType.fromString(json.type);
|
|
9
|
+
this.action = json.action;
|
|
10
|
+
this.actionText = json.actionText;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
toJson() {
|
|
14
|
+
return {
|
|
15
|
+
type: HydraNotificationCtaType.toString(this.type),
|
|
16
|
+
action: this.action,
|
|
17
|
+
actionText: this.actionText,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export enum HydraNotificationCtaType {
|
|
4
|
+
external,
|
|
5
|
+
deepLink,
|
|
6
|
+
rating,
|
|
7
|
+
feedback,
|
|
8
|
+
appRating,
|
|
9
|
+
unknown,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace HydraNotificationCtaType {
|
|
13
|
+
export function fromString(
|
|
14
|
+
value: string | null
|
|
15
|
+
): HydraNotificationCtaType | null {
|
|
16
|
+
switch (value) {
|
|
17
|
+
case 'external':
|
|
18
|
+
case 'EXTERNAL_URL':
|
|
19
|
+
return HydraNotificationCtaType.external;
|
|
20
|
+
case 'deepLink':
|
|
21
|
+
case 'DEEP_LINK':
|
|
22
|
+
return HydraNotificationCtaType.deepLink;
|
|
23
|
+
case 'rating':
|
|
24
|
+
case 'RATING':
|
|
25
|
+
return HydraNotificationCtaType.rating;
|
|
26
|
+
case 'feedback':
|
|
27
|
+
case 'FEEDBACK':
|
|
28
|
+
return HydraNotificationCtaType.feedback;
|
|
29
|
+
case 'appRating':
|
|
30
|
+
case 'APPRATING':
|
|
31
|
+
return HydraNotificationCtaType.appRating;
|
|
32
|
+
case null:
|
|
33
|
+
return null;
|
|
34
|
+
default:
|
|
35
|
+
return HydraNotificationCtaType.unknown;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function toString(
|
|
40
|
+
value: HydraNotificationCtaType | null
|
|
41
|
+
): string | null {
|
|
42
|
+
switch (value) {
|
|
43
|
+
case HydraNotificationCtaType.external:
|
|
44
|
+
return Platform.OS === 'ios' ? 'external' : 'EXTERNAL_URL';
|
|
45
|
+
case HydraNotificationCtaType.deepLink:
|
|
46
|
+
return Platform.OS === 'ios' ? 'deepLink' : 'DEEP_LINK';
|
|
47
|
+
case HydraNotificationCtaType.rating:
|
|
48
|
+
return Platform.OS === 'ios' ? 'rating' : 'RATING';
|
|
49
|
+
case HydraNotificationCtaType.feedback:
|
|
50
|
+
return Platform.OS === 'ios' ? 'feedback' : 'FEEDBACK';
|
|
51
|
+
case HydraNotificationCtaType.appRating:
|
|
52
|
+
return Platform.OS === 'ios' ? 'appRating' : 'APPRATING';
|
|
53
|
+
case null:
|
|
54
|
+
return null;
|
|
55
|
+
default:
|
|
56
|
+
return Platform.OS === 'ios' ? 'unknown' : 'UNKNOWN';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HydraNotificationCta } from './HydraNotificationCta';
|
|
2
|
+
|
|
3
|
+
export class HydraNotificationExpandedDetails {
|
|
4
|
+
readonly ctas: HydraNotificationCta[] | null;
|
|
5
|
+
readonly message: string | null;
|
|
6
|
+
readonly image: string | null;
|
|
7
|
+
readonly style: string | null;
|
|
8
|
+
constructor(json: Record<string, any>) {
|
|
9
|
+
this.ctas =
|
|
10
|
+
json.ctas != null
|
|
11
|
+
? json.ctas.map(
|
|
12
|
+
(cta: Record<string, any>) => new HydraNotificationCta(cta)
|
|
13
|
+
)
|
|
14
|
+
: null;
|
|
15
|
+
this.message = json.message;
|
|
16
|
+
this.image = json.image;
|
|
17
|
+
this.style = json.style;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
toJson() {
|
|
21
|
+
return {
|
|
22
|
+
ctas: this.ctas ? this.ctas.map((cta) => cta.toJson()) : null,
|
|
23
|
+
message: this.message,
|
|
24
|
+
image: this.image,
|
|
25
|
+
style: this.style,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class HydraPushPreferences {
|
|
2
|
+
promPushOpted: boolean;
|
|
3
|
+
transPushOpted: boolean;
|
|
4
|
+
|
|
5
|
+
constructor(promPushOpted: boolean, transPushOpted: boolean) {
|
|
6
|
+
this.promPushOpted = promPushOpted;
|
|
7
|
+
this.transPushOpted = transPushOpted;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
toJson() {
|
|
11
|
+
return {
|
|
12
|
+
promPushOpted: this.promPushOpted,
|
|
13
|
+
transPushOpted: this.transPushOpted,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class HydraUserDetails {
|
|
2
|
+
customerId: string;
|
|
3
|
+
firstName: string | null;
|
|
4
|
+
lastName: string | null;
|
|
5
|
+
email: string | null;
|
|
6
|
+
phone: string | null;
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
customerId: string,
|
|
10
|
+
firstName: string | null = null,
|
|
11
|
+
lastName: string | null = null,
|
|
12
|
+
email: string | null = null,
|
|
13
|
+
phone: string | null = null
|
|
14
|
+
) {
|
|
15
|
+
this.customerId = customerId;
|
|
16
|
+
this.firstName = firstName;
|
|
17
|
+
this.lastName = lastName;
|
|
18
|
+
this.email = email;
|
|
19
|
+
this.phone = phone;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toJson() {
|
|
23
|
+
return {
|
|
24
|
+
customerId: this.customerId,
|
|
25
|
+
firstName: this.firstName,
|
|
26
|
+
lastName: this.lastName,
|
|
27
|
+
email: this.email,
|
|
28
|
+
phone: this.phone,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class HydraVisitorInfo {
|
|
2
|
+
visitorId: string;
|
|
3
|
+
|
|
4
|
+
constructor(visitorId: string) {
|
|
5
|
+
this.visitorId = visitorId;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static fromJson(json: Record<string, any> | null): HydraVisitorInfo | null {
|
|
9
|
+
if (!json) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return new HydraVisitorInfo(json.visitorId || '');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class NonHydraNotification {
|
|
2
|
+
readonly title: string | null;
|
|
3
|
+
readonly body: string | null;
|
|
4
|
+
readonly icon: string | null;
|
|
5
|
+
readonly imageUrl: string | null;
|
|
6
|
+
readonly data: Record<string, any> | null;
|
|
7
|
+
constructor(json: Record<string, any>) {
|
|
8
|
+
const notificationObject = json.notification;
|
|
9
|
+
this.data = json.data;
|
|
10
|
+
this.title = notificationObject?.title || this.data?.title;
|
|
11
|
+
this.body = notificationObject?.body || this.data?.message;
|
|
12
|
+
this.icon = notificationObject.icon;
|
|
13
|
+
this.imageUrl = notificationObject.imageUrl;
|
|
14
|
+
}
|
|
15
|
+
}
|