@aws-amplify/notifications 2.0.1-console-preview.d745d43.0 → 2.0.1-ssr-api.df60e41.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/lib/eventListeners/eventListeners.js +7 -4
- package/lib/eventListeners/index.js +4 -4
- package/lib/eventListeners/types.d.ts +2 -2
- package/lib/eventListeners/types.js +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js +1 -1
- package/lib/inAppMessaging/errors/assertServiceError.js +1 -1
- package/lib/inAppMessaging/errors/assertValidationError.js +1 -1
- package/lib/inAppMessaging/errors/index.js +6 -6
- package/lib/inAppMessaging/errors/validation.js +1 -1
- package/lib/inAppMessaging/index.d.ts +1 -1
- package/lib/inAppMessaging/index.js +12 -11
- package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/clearMessages.js +26 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +10 -8
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +8 -7
- package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js +13 -11
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +11 -11
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +3 -3
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +2 -2
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +9 -9
- package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js +12 -11
- package/lib/inAppMessaging/providers/pinpoint/types/index.js +2 -2
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib/inAppMessaging/providers/pinpoint/types/types.js +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +38 -24
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js +11 -11
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +8 -8
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +3 -3
- package/lib/inAppMessaging/types/event.d.ts +2 -2
- package/lib/inAppMessaging/types/event.js +0 -1
- package/lib/inAppMessaging/types/index.js +0 -1
- package/lib/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib/inAppMessaging/types/inputs.js +0 -1
- package/lib/inAppMessaging/types/message.d.ts +3 -3
- package/lib/inAppMessaging/types/message.js +0 -1
- package/lib/inAppMessaging/types/options.d.ts +1 -1
- package/lib/inAppMessaging/types/options.js +0 -1
- package/lib/inAppMessaging/utils/index.js +4 -4
- package/lib/inAppMessaging/utils/statusHelpers.js +6 -4
- package/lib/index.js +0 -1
- package/lib/pushNotifications/errors/PushNotificationError.js +1 -1
- package/lib/pushNotifications/errors/errorHelpers.js +5 -4
- package/lib/pushNotifications/errors/index.js +4 -4
- package/lib/pushNotifications/index.js +13 -13
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +9 -8
- package/lib/pushNotifications/providers/pinpoint/apis/index.js +12 -12
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +45 -36
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +5 -4
- package/lib/pushNotifications/providers/pinpoint/index.js +12 -12
- package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib/pushNotifications/providers/pinpoint/types/analytics.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib/pushNotifications/providers/pinpoint/types/apis.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/index.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +10 -8
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +4 -3
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +7 -5
- package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +6 -5
- package/lib/pushNotifications/types/errors.js +1 -1
- package/lib/pushNotifications/types/index.js +19 -3
- package/lib/pushNotifications/types/inputs.d.ts +7 -7
- package/lib/pushNotifications/types/inputs.js +0 -1
- package/lib/pushNotifications/types/options.d.ts +1 -1
- package/lib/pushNotifications/types/options.js +0 -1
- package/lib/pushNotifications/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/types/outputs.js +0 -1
- package/lib/pushNotifications/types/pushNotifications.d.ts +3 -3
- package/lib/pushNotifications/types/pushNotifications.js +0 -1
- package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +3 -2
- package/lib/pushNotifications/utils/index.d.ts +1 -1
- package/lib/pushNotifications/utils/index.js +8 -8
- package/lib/pushNotifications/utils/initializationManager.js +5 -3
- package/lib/pushNotifications/utils/resolveCredentials.js +5 -4
- package/lib/pushNotifications/utils/tokenManager.js +5 -3
- package/lib/tsconfig.tsbuildinfo +1 -7201
- package/lib-esm/eventListeners/eventListeners.js +0 -1
- package/lib-esm/eventListeners/index.js +0 -1
- package/lib-esm/eventListeners/types.d.ts +2 -2
- package/lib-esm/eventListeners/types.js +1 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js +0 -1
- package/lib-esm/inAppMessaging/errors/index.js +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js +0 -1
- package/lib-esm/inAppMessaging/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/index.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.d.ts +13 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/clearMessages.js +22 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +2 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +0 -1
- package/lib-esm/inAppMessaging/types/event.d.ts +2 -2
- package/lib-esm/inAppMessaging/types/event.js +1 -1
- package/lib-esm/inAppMessaging/types/index.js +1 -1
- package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/inputs.js +1 -1
- package/lib-esm/inAppMessaging/types/message.d.ts +3 -3
- package/lib-esm/inAppMessaging/types/message.js +1 -1
- package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/options.js +1 -1
- package/lib-esm/inAppMessaging/utils/index.js +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js +0 -1
- package/lib-esm/index.js +0 -1
- package/lib-esm/pushNotifications/errors/PushNotificationError.js +0 -1
- package/lib-esm/pushNotifications/errors/errorHelpers.js +0 -1
- package/lib-esm/pushNotifications/errors/index.js +0 -1
- package/lib-esm/pushNotifications/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +2 -3
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +30 -23
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +1 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +2 -2
- package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +1 -2
- package/lib-esm/pushNotifications/types/errors.js +0 -1
- package/lib-esm/pushNotifications/types/index.js +4 -1
- package/lib-esm/pushNotifications/types/inputs.d.ts +7 -7
- package/lib-esm/pushNotifications/types/inputs.js +1 -1
- package/lib-esm/pushNotifications/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/types/options.js +1 -1
- package/lib-esm/pushNotifications/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/types/outputs.js +1 -1
- package/lib-esm/pushNotifications/types/pushNotifications.d.ts +3 -3
- package/lib-esm/pushNotifications/types/pushNotifications.js +1 -1
- package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +0 -1
- package/lib-esm/pushNotifications/utils/index.d.ts +1 -1
- package/lib-esm/pushNotifications/utils/index.js +1 -2
- package/lib-esm/pushNotifications/utils/initializationManager.js +0 -1
- package/lib-esm/pushNotifications/utils/resolveCredentials.js +0 -1
- package/lib-esm/pushNotifications/utils/tokenManager.js +0 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -7201
- package/package.json +51 -14
- package/src/inAppMessaging/index.ts +1 -0
- package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
- package/src/inAppMessaging/providers/pinpoint/apis/index.ts +1 -0
- package/src/inAppMessaging/providers/pinpoint/index.ts +1 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +5 -2
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +50 -40
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +5 -4
- package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +3 -3
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +2 -1
- package/src/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.ts +1 -1
- package/src/pushNotifications/types/pushNotifications.ts +1 -1
- package/src/pushNotifications/utils/index.ts +1 -1
- package/lib/eventListeners/eventListeners.js.map +0 -1
- package/lib/eventListeners/index.js.map +0 -1
- package/lib/eventListeners/types.js.map +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib/inAppMessaging/errors/index.js.map +0 -1
- package/lib/inAppMessaging/errors/validation.js.map +0 -1
- package/lib/inAppMessaging/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib/inAppMessaging/types/event.js.map +0 -1
- package/lib/inAppMessaging/types/index.js.map +0 -1
- package/lib/inAppMessaging/types/inputs.js.map +0 -1
- package/lib/inAppMessaging/types/message.js.map +0 -1
- package/lib/inAppMessaging/types/options.js.map +0 -1
- package/lib/inAppMessaging/utils/index.js.map +0 -1
- package/lib/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/pushNotifications/errors/PushNotificationError.js.map +0 -1
- package/lib/pushNotifications/errors/errorHelpers.js.map +0 -1
- package/lib/pushNotifications/errors/index.js.map +0 -1
- package/lib/pushNotifications/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
- package/lib/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
- package/lib/pushNotifications/types/errors.js.map +0 -1
- package/lib/pushNotifications/types/index.js.map +0 -1
- package/lib/pushNotifications/types/inputs.js.map +0 -1
- package/lib/pushNotifications/types/options.js.map +0 -1
- package/lib/pushNotifications/types/outputs.js.map +0 -1
- package/lib/pushNotifications/types/pushNotifications.js.map +0 -1
- package/lib/pushNotifications/utils/index.js.map +0 -1
- package/lib/pushNotifications/utils/initializationManager.js.map +0 -1
- package/lib/pushNotifications/utils/resolveConfig.js.map +0 -1
- package/lib/pushNotifications/utils/resolveCredentials.js.map +0 -1
- package/lib/pushNotifications/utils/tokenManager.js.map +0 -1
- package/lib-esm/eventListeners/eventListeners.js.map +0 -1
- package/lib-esm/eventListeners/index.js.map +0 -1
- package/lib-esm/eventListeners/types.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertServiceError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/assertValidationError.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/index.js.map +0 -1
- package/lib-esm/inAppMessaging/errors/validation.js.map +0 -1
- package/lib-esm/inAppMessaging/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js.map +0 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js.map +0 -1
- package/lib-esm/inAppMessaging/types/event.js.map +0 -1
- package/lib-esm/inAppMessaging/types/index.js.map +0 -1
- package/lib-esm/inAppMessaging/types/inputs.js.map +0 -1
- package/lib-esm/inAppMessaging/types/message.js.map +0 -1
- package/lib-esm/inAppMessaging/types/options.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/index.js.map +0 -1
- package/lib-esm/inAppMessaging/utils/statusHelpers.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/pushNotifications/errors/PushNotificationError.js.map +0 -1
- package/lib-esm/pushNotifications/errors/errorHelpers.js.map +0 -1
- package/lib-esm/pushNotifications/errors/index.js.map +0 -1
- package/lib-esm/pushNotifications/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js.map +0 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js.map +0 -1
- package/lib-esm/pushNotifications/types/errors.js.map +0 -1
- package/lib-esm/pushNotifications/types/index.js.map +0 -1
- package/lib-esm/pushNotifications/types/inputs.js.map +0 -1
- package/lib-esm/pushNotifications/types/options.js.map +0 -1
- package/lib-esm/pushNotifications/types/outputs.js.map +0 -1
- package/lib-esm/pushNotifications/types/pushNotifications.js.map +0 -1
- package/lib-esm/pushNotifications/utils/index.js.map +0 -1
- package/lib-esm/pushNotifications/utils/initializationManager.js.map +0 -1
- package/lib-esm/pushNotifications/utils/resolveConfig.js.map +0 -1
- package/lib-esm/pushNotifications/utils/resolveCredentials.js.map +0 -1
- package/lib-esm/pushNotifications/utils/tokenManager.js.map +0 -1
- /package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
- /package/lib/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
- /package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
- /package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.d.ts +0 -0
- /package/src/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.ts +0 -0
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.addEventListener = exports.notifyEventListenersAndAwaitHandlers = exports.notifyEventListeners = void 0;
|
|
5
6
|
const eventListeners = {};
|
|
6
|
-
|
|
7
|
+
const notifyEventListeners = (type, ...args) => {
|
|
7
8
|
eventListeners[type]?.forEach(listener => {
|
|
8
9
|
listener.handleEvent(...args);
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.notifyEventListeners = notifyEventListeners;
|
|
13
|
+
const notifyEventListenersAndAwaitHandlers = (type, ...args) => Promise.all(Array.from(eventListeners[type] ?? []).map(async (listener) => {
|
|
12
14
|
try {
|
|
13
15
|
await listener.handleEvent(...args);
|
|
14
16
|
}
|
|
@@ -16,7 +18,8 @@ exports.notifyEventListenersAndAwaitHandlers = (type, ...args) => Promise.all(Ar
|
|
|
16
18
|
throw err;
|
|
17
19
|
}
|
|
18
20
|
}));
|
|
19
|
-
exports.
|
|
21
|
+
exports.notifyEventListenersAndAwaitHandlers = notifyEventListenersAndAwaitHandlers;
|
|
22
|
+
const addEventListener = (type, handler) => {
|
|
20
23
|
// If there is no listener set for the event type, just create it
|
|
21
24
|
if (!eventListeners[type]) {
|
|
22
25
|
eventListeners[type] = new Set();
|
|
@@ -32,4 +35,4 @@ exports.addEventListener = (type, handler) => {
|
|
|
32
35
|
remove: () => listener.remove(),
|
|
33
36
|
};
|
|
34
37
|
};
|
|
35
|
-
|
|
38
|
+
exports.addEventListener = addEventListener;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.notifyEventListenersAndAwaitHandlers = exports.notifyEventListeners = exports.addEventListener = void 0;
|
|
5
6
|
var eventListeners_1 = require("./eventListeners");
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
8
|
-
exports
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
7
|
+
Object.defineProperty(exports, "addEventListener", { enumerable: true, get: function () { return eventListeners_1.addEventListener; } });
|
|
8
|
+
Object.defineProperty(exports, "notifyEventListeners", { enumerable: true, get: function () { return eventListeners_1.notifyEventListeners; } });
|
|
9
|
+
Object.defineProperty(exports, "notifyEventListenersAndAwaitHandlers", { enumerable: true, get: function () { return eventListeners_1.notifyEventListenersAndAwaitHandlers; } });
|
|
@@ -4,7 +4,7 @@ export interface EventListener<EventHandler extends Function> {
|
|
|
4
4
|
handleEvent: EventHandler;
|
|
5
5
|
remove: () => void;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type EventType = InAppMessageInteractionEvent | PushNotificationEvent;
|
|
8
|
+
export type EventListenerRemover = {
|
|
9
9
|
remove: () => void;
|
|
10
10
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.InAppMessagingError = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
@@ -16,4 +17,3 @@ class InAppMessagingError extends utils_1.AmplifyError {
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
exports.InAppMessagingError = InAppMessagingError;
|
|
19
|
-
//# sourceMappingURL=InAppMessagingError.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.assertServiceError = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const InAppMessagingError_1 = require("./InAppMessagingError");
|
|
7
8
|
function assertServiceError(error) {
|
|
@@ -16,4 +17,3 @@ function assertServiceError(error) {
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
exports.assertServiceError = assertServiceError;
|
|
19
|
-
//# sourceMappingURL=assertServiceError.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.assertValidationError = void 0;
|
|
5
6
|
const InAppMessagingError_1 = require("./InAppMessagingError");
|
|
6
7
|
const validation_1 = require("./validation");
|
|
7
8
|
/**
|
|
@@ -14,4 +15,3 @@ function assertValidationError(assertion, name) {
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
exports.assertValidationError = assertValidationError;
|
|
17
|
-
//# sourceMappingURL=assertValidationError.js.map
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.validationErrorMap = exports.InAppMessagingValidationErrorCode = exports.assertServiceError = exports.assertValidationError = exports.InAppMessagingError = void 0;
|
|
5
6
|
var InAppMessagingError_1 = require("./InAppMessagingError");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "InAppMessagingError", { enumerable: true, get: function () { return InAppMessagingError_1.InAppMessagingError; } });
|
|
7
8
|
var assertValidationError_1 = require("./assertValidationError");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "assertValidationError", { enumerable: true, get: function () { return assertValidationError_1.assertValidationError; } });
|
|
9
10
|
var assertServiceError_1 = require("./assertServiceError");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "assertServiceError", { enumerable: true, get: function () { return assertServiceError_1.assertServiceError; } });
|
|
11
12
|
var validation_1 = require("./validation");
|
|
12
|
-
exports
|
|
13
|
-
exports
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
13
|
+
Object.defineProperty(exports, "InAppMessagingValidationErrorCode", { enumerable: true, get: function () { return validation_1.InAppMessagingValidationErrorCode; } });
|
|
14
|
+
Object.defineProperty(exports, "validationErrorMap", { enumerable: true, get: function () { return validation_1.validationErrorMap; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.validationErrorMap = exports.InAppMessagingValidationErrorCode = void 0;
|
|
5
6
|
var InAppMessagingValidationErrorCode;
|
|
6
7
|
(function (InAppMessagingValidationErrorCode) {
|
|
7
8
|
InAppMessagingValidationErrorCode["NoAppId"] = "NoAppId";
|
|
@@ -24,4 +25,3 @@ exports.validationErrorMap = {
|
|
|
24
25
|
recoverySuggestion: 'Please make sure to first call `initializePushNotifications`.',
|
|
25
26
|
},
|
|
26
27
|
};
|
|
27
|
-
//# sourceMappingURL=validation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, IdentifyUserInput, DispatchEventInput, SetConflictHandlerInput, OnMessageActionTakenInput, OnMessageDismissedInput, OnMessageDisplayedInput, OnMessageReceivedInput, NotifyMessageInteractionInput, OnMessageReceivedOutput, OnMessageActionTakenOutput, OnMessageDismissedOutput, OnMessageDisplayedOutput, } from './providers/pinpoint';
|
|
1
|
+
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, clearMessages, IdentifyUserInput, DispatchEventInput, SetConflictHandlerInput, OnMessageActionTakenInput, OnMessageDismissedInput, OnMessageDisplayedInput, OnMessageReceivedInput, NotifyMessageInteractionInput, OnMessageReceivedOutput, OnMessageActionTakenOutput, OnMessageDismissedOutput, OnMessageDisplayedOutput, } from './providers/pinpoint';
|
|
2
2
|
export { InAppMessage, InAppMessageAction, InAppMessageContent, InAppMessageLayout, InAppMessageTextAlign, InAppMessageButton, InAppMessageImage, InAppMessageStyle, } from './types';
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.clearMessages = exports.notifyMessageInteraction = exports.onMessageActionTaken = exports.onMessageDismissed = exports.onMessageDisplayed = exports.onMessageReceived = exports.initializeInAppMessaging = exports.setConflictHandler = exports.dispatchEvent = exports.syncMessages = exports.identifyUser = void 0;
|
|
5
6
|
var pinpoint_1 = require("./providers/pinpoint");
|
|
6
|
-
exports
|
|
7
|
-
exports
|
|
8
|
-
exports
|
|
9
|
-
exports
|
|
10
|
-
exports
|
|
11
|
-
exports
|
|
12
|
-
exports
|
|
13
|
-
exports
|
|
14
|
-
exports
|
|
15
|
-
exports
|
|
16
|
-
|
|
7
|
+
Object.defineProperty(exports, "identifyUser", { enumerable: true, get: function () { return pinpoint_1.identifyUser; } });
|
|
8
|
+
Object.defineProperty(exports, "syncMessages", { enumerable: true, get: function () { return pinpoint_1.syncMessages; } });
|
|
9
|
+
Object.defineProperty(exports, "dispatchEvent", { enumerable: true, get: function () { return pinpoint_1.dispatchEvent; } });
|
|
10
|
+
Object.defineProperty(exports, "setConflictHandler", { enumerable: true, get: function () { return pinpoint_1.setConflictHandler; } });
|
|
11
|
+
Object.defineProperty(exports, "initializeInAppMessaging", { enumerable: true, get: function () { return pinpoint_1.initializeInAppMessaging; } });
|
|
12
|
+
Object.defineProperty(exports, "onMessageReceived", { enumerable: true, get: function () { return pinpoint_1.onMessageReceived; } });
|
|
13
|
+
Object.defineProperty(exports, "onMessageDisplayed", { enumerable: true, get: function () { return pinpoint_1.onMessageDisplayed; } });
|
|
14
|
+
Object.defineProperty(exports, "onMessageDismissed", { enumerable: true, get: function () { return pinpoint_1.onMessageDismissed; } });
|
|
15
|
+
Object.defineProperty(exports, "onMessageActionTaken", { enumerable: true, get: function () { return pinpoint_1.onMessageActionTaken; } });
|
|
16
|
+
Object.defineProperty(exports, "notifyMessageInteraction", { enumerable: true, get: function () { return pinpoint_1.notifyMessageInteraction; } });
|
|
17
|
+
Object.defineProperty(exports, "clearMessages", { enumerable: true, get: function () { return pinpoint_1.clearMessages; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clear locally cached messages.
|
|
3
|
+
*
|
|
4
|
+
* @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown if In App messaging hasn't been initialized.
|
|
5
|
+
* @returns A promise that will resolve when the operation is complete.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Clear locally cached messages.
|
|
9
|
+
* await clearMessages();
|
|
10
|
+
*
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function clearMessages(): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.clearMessages = void 0;
|
|
6
|
+
const core_1 = require("@aws-amplify/core");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const utils_2 = require("../../../utils");
|
|
9
|
+
/**
|
|
10
|
+
* Clear locally cached messages.
|
|
11
|
+
*
|
|
12
|
+
* @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown if In App messaging hasn't been initialized.
|
|
13
|
+
* @returns A promise that will resolve when the operation is complete.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Clear locally cached messages.
|
|
17
|
+
* await clearMessages();
|
|
18
|
+
*
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
async function clearMessages() {
|
|
22
|
+
(0, utils_2.assertIsInitialized)();
|
|
23
|
+
const key = `${utils_1.PINPOINT_KEY_PREFIX}${utils_1.STORAGE_KEY_SUFFIX}`;
|
|
24
|
+
return await core_1.defaultStorage.removeItem(key);
|
|
25
|
+
}
|
|
26
|
+
exports.clearMessages = clearMessages;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
4
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
|
|
8
|
+
exports.dispatchEvent = void 0;
|
|
6
9
|
const utils_1 = require("../utils");
|
|
7
|
-
const flatten_1 =
|
|
10
|
+
const flatten_1 = __importDefault(require("lodash/flatten"));
|
|
8
11
|
const core_1 = require("@aws-amplify/core");
|
|
9
12
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
10
13
|
const errors_1 = require("../../../errors");
|
|
@@ -35,20 +38,19 @@ const utils_2 = require("../../../utils");
|
|
|
35
38
|
* ```
|
|
36
39
|
*/
|
|
37
40
|
async function dispatchEvent(input) {
|
|
38
|
-
utils_2.assertIsInitialized();
|
|
41
|
+
(0, utils_2.assertIsInitialized)();
|
|
39
42
|
try {
|
|
40
43
|
const key = `${utils_1.PINPOINT_KEY_PREFIX}${utils_1.STORAGE_KEY_SUFFIX}`;
|
|
41
44
|
const cachedMessages = await core_1.defaultStorage.getItem(key);
|
|
42
|
-
const messages = await utils_1.processInAppMessages(cachedMessages ? JSON.parse(cachedMessages) : [], input);
|
|
43
|
-
const flattenedMessages = flatten_1.default(messages);
|
|
45
|
+
const messages = await (0, utils_1.processInAppMessages)(cachedMessages ? JSON.parse(cachedMessages) : [], input);
|
|
46
|
+
const flattenedMessages = (0, flatten_1.default)(messages);
|
|
44
47
|
if (flattenedMessages.length > 0) {
|
|
45
|
-
eventListeners_1.notifyEventListeners('messageReceived', setConflictHandler_1.conflictHandler(flattenedMessages));
|
|
48
|
+
(0, eventListeners_1.notifyEventListeners)('messageReceived', (0, setConflictHandler_1.conflictHandler)(flattenedMessages));
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
catch (error) {
|
|
49
|
-
errors_1.assertServiceError(error);
|
|
52
|
+
(0, errors_1.assertServiceError)(error);
|
|
50
53
|
throw error;
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
exports.dispatchEvent = dispatchEvent;
|
|
54
|
-
//# sourceMappingURL=dispatchEvent.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IdentifyUserInput } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
|
|
3
4
|
* profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
|
|
@@ -47,4 +48,4 @@
|
|
|
47
48
|
* },
|
|
48
49
|
* });
|
|
49
50
|
*/
|
|
50
|
-
export declare const identifyUser: ({ userId, userProfile, options, }:
|
|
51
|
+
export declare const identifyUser: ({ userId, userProfile, options, }: IdentifyUserInput) => Promise<void>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.identifyUser = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
|
|
7
8
|
const utils_2 = require("../utils");
|
|
@@ -55,12 +56,12 @@ const utils_3 = require("../../../utils");
|
|
|
55
56
|
* },
|
|
56
57
|
* });
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
-
utils_3.assertIsInitialized();
|
|
60
|
-
const { credentials, identityId } = await utils_2.resolveCredentials();
|
|
61
|
-
const { appId, region } = utils_2.resolveConfig();
|
|
59
|
+
const identifyUser = async ({ userId, userProfile, options, }) => {
|
|
60
|
+
(0, utils_3.assertIsInitialized)();
|
|
61
|
+
const { credentials, identityId } = await (0, utils_2.resolveCredentials)();
|
|
62
|
+
const { appId, region } = (0, utils_2.resolveConfig)();
|
|
62
63
|
const { address, optOut, userAttributes } = options ?? {};
|
|
63
|
-
pinpoint_1.updateEndpoint({
|
|
64
|
+
(0, pinpoint_1.updateEndpoint)({
|
|
64
65
|
address,
|
|
65
66
|
channelType: utils_2.CHANNEL_TYPE,
|
|
66
67
|
optOut,
|
|
@@ -72,7 +73,7 @@ exports.identifyUser = async ({ userId, userProfile, options, }) => {
|
|
|
72
73
|
userAttributes,
|
|
73
74
|
userId,
|
|
74
75
|
userProfile,
|
|
75
|
-
userAgentValue: utils_2.getInAppMessagingUserAgentString(utils_1.InAppMessagingAction.IdentifyUser),
|
|
76
|
+
userAgentValue: (0, utils_2.getInAppMessagingUserAgentString)(utils_1.InAppMessagingAction.IdentifyUser),
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
|
|
79
|
+
exports.identifyUser = identifyUser;
|
|
@@ -8,3 +8,4 @@ export { onMessageDismissed } from './onMessageDismissed';
|
|
|
8
8
|
export { onMessageDisplayed } from './onMessageDisplayed';
|
|
9
9
|
export { onMessageActionTaken } from './onMessageActionTaken';
|
|
10
10
|
export { notifyMessageInteraction } from './notifyMessageInteraction';
|
|
11
|
+
export { clearMessages } from './clearMessages';
|
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.clearMessages = exports.notifyMessageInteraction = exports.onMessageActionTaken = exports.onMessageDisplayed = exports.onMessageDismissed = exports.onMessageReceived = exports.initializeInAppMessaging = exports.setConflictHandler = exports.dispatchEvent = exports.syncMessages = exports.identifyUser = void 0;
|
|
5
6
|
var identifyUser_1 = require("./identifyUser");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "identifyUser", { enumerable: true, get: function () { return identifyUser_1.identifyUser; } });
|
|
7
8
|
var syncMessages_1 = require("./syncMessages");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "syncMessages", { enumerable: true, get: function () { return syncMessages_1.syncMessages; } });
|
|
9
10
|
var dispatchEvent_1 = require("./dispatchEvent");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "dispatchEvent", { enumerable: true, get: function () { return dispatchEvent_1.dispatchEvent; } });
|
|
11
12
|
var setConflictHandler_1 = require("./setConflictHandler");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "setConflictHandler", { enumerable: true, get: function () { return setConflictHandler_1.setConflictHandler; } });
|
|
13
14
|
var initializeInAppMessaging_1 = require("./initializeInAppMessaging");
|
|
14
|
-
exports
|
|
15
|
+
Object.defineProperty(exports, "initializeInAppMessaging", { enumerable: true, get: function () { return initializeInAppMessaging_1.initializeInAppMessaging; } });
|
|
15
16
|
var onMessageReceived_1 = require("./onMessageReceived");
|
|
16
|
-
exports
|
|
17
|
+
Object.defineProperty(exports, "onMessageReceived", { enumerable: true, get: function () { return onMessageReceived_1.onMessageReceived; } });
|
|
17
18
|
var onMessageDismissed_1 = require("./onMessageDismissed");
|
|
18
|
-
exports
|
|
19
|
+
Object.defineProperty(exports, "onMessageDismissed", { enumerable: true, get: function () { return onMessageDismissed_1.onMessageDismissed; } });
|
|
19
20
|
var onMessageDisplayed_1 = require("./onMessageDisplayed");
|
|
20
|
-
exports
|
|
21
|
+
Object.defineProperty(exports, "onMessageDisplayed", { enumerable: true, get: function () { return onMessageDisplayed_1.onMessageDisplayed; } });
|
|
21
22
|
var onMessageActionTaken_1 = require("./onMessageActionTaken");
|
|
22
|
-
exports
|
|
23
|
+
Object.defineProperty(exports, "onMessageActionTaken", { enumerable: true, get: function () { return onMessageActionTaken_1.onMessageActionTaken; } });
|
|
23
24
|
var notifyMessageInteraction_1 = require("./notifyMessageInteraction");
|
|
24
|
-
exports
|
|
25
|
-
|
|
25
|
+
Object.defineProperty(exports, "notifyMessageInteraction", { enumerable: true, get: function () { return notifyMessageInteraction_1.notifyMessageInteraction; } });
|
|
26
|
+
var clearMessages_1 = require("./clearMessages");
|
|
27
|
+
Object.defineProperty(exports, "clearMessages", { enumerable: true, get: function () { return clearMessages_1.clearMessages; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.initializeInAppMessaging = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
7
8
|
const helpers_1 = require("../utils/helpers");
|
|
@@ -22,36 +23,35 @@ const utils_3 = require("../../../utils");
|
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
25
|
function initializeInAppMessaging() {
|
|
25
|
-
if (utils_3.isInitialized()) {
|
|
26
|
+
if ((0, utils_3.isInitialized)()) {
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
// register with the session listener
|
|
29
30
|
utils_1.sessionListener.addStateChangeListener(utils_2.sessionStateChangeHandler, true);
|
|
30
31
|
// wire up default Pinpoint message event handling
|
|
31
|
-
eventListeners_1.addEventListener('messageDisplayed', (message) => {
|
|
32
|
-
helpers_1.recordAnalyticsEvent(types_1.PinpointMessageEvent.MESSAGE_DISPLAYED, message);
|
|
33
|
-
utils_2.incrementMessageCounts(message.id);
|
|
32
|
+
(0, eventListeners_1.addEventListener)('messageDisplayed', (message) => {
|
|
33
|
+
(0, helpers_1.recordAnalyticsEvent)(types_1.PinpointMessageEvent.MESSAGE_DISPLAYED, message);
|
|
34
|
+
(0, utils_2.incrementMessageCounts)(message.id);
|
|
34
35
|
});
|
|
35
|
-
eventListeners_1.addEventListener('messageDismissed', (message) => {
|
|
36
|
-
helpers_1.recordAnalyticsEvent(types_1.PinpointMessageEvent.MESSAGE_DISMISSED, message);
|
|
36
|
+
(0, eventListeners_1.addEventListener)('messageDismissed', (message) => {
|
|
37
|
+
(0, helpers_1.recordAnalyticsEvent)(types_1.PinpointMessageEvent.MESSAGE_DISMISSED, message);
|
|
37
38
|
});
|
|
38
|
-
eventListeners_1.addEventListener('messageActionTaken', (message) => {
|
|
39
|
-
helpers_1.recordAnalyticsEvent(types_1.PinpointMessageEvent.MESSAGE_ACTION_TAKEN, message);
|
|
39
|
+
(0, eventListeners_1.addEventListener)('messageActionTaken', (message) => {
|
|
40
|
+
(0, helpers_1.recordAnalyticsEvent)(types_1.PinpointMessageEvent.MESSAGE_ACTION_TAKEN, message);
|
|
40
41
|
});
|
|
41
42
|
// listen to analytics hub events
|
|
42
43
|
core_1.Hub.listen('analytics', analyticsListener);
|
|
43
|
-
utils_3.initialize();
|
|
44
|
+
(0, utils_3.initialize)();
|
|
44
45
|
}
|
|
45
46
|
exports.initializeInAppMessaging = initializeInAppMessaging;
|
|
46
47
|
function analyticsListener({ payload, }) {
|
|
47
48
|
const { event, data } = payload;
|
|
48
49
|
switch (event) {
|
|
49
50
|
case 'record': {
|
|
50
|
-
dispatchEvent_1.dispatchEvent(data);
|
|
51
|
+
(0, dispatchEvent_1.dispatchEvent)(data);
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
54
|
default:
|
|
54
55
|
break;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
//# sourceMappingURL=initializeInAppMessaging.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.notifyMessageInteraction = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
7
8
|
/**
|
|
@@ -19,8 +20,7 @@ const utils_1 = require("../../../utils");
|
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
22
|
function notifyMessageInteraction({ type, message, }) {
|
|
22
|
-
utils_1.assertIsInitialized();
|
|
23
|
-
eventListeners_1.notifyEventListeners(type, message);
|
|
23
|
+
(0, utils_1.assertIsInitialized)();
|
|
24
|
+
(0, eventListeners_1.notifyEventListeners)(type, message);
|
|
24
25
|
}
|
|
25
26
|
exports.notifyMessageInteraction = notifyMessageInteraction;
|
|
26
|
-
//# sourceMappingURL=notifyMessageInteraction.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onMessageActionTaken = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
7
8
|
/**
|
|
@@ -20,8 +21,7 @@ const utils_1 = require("../../../utils");
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
function onMessageActionTaken(input) {
|
|
23
|
-
utils_1.assertIsInitialized();
|
|
24
|
-
return eventListeners_1.addEventListener('messageActionTaken', input);
|
|
24
|
+
(0, utils_1.assertIsInitialized)();
|
|
25
|
+
return (0, eventListeners_1.addEventListener)('messageActionTaken', input);
|
|
25
26
|
}
|
|
26
27
|
exports.onMessageActionTaken = onMessageActionTaken;
|
|
27
|
-
//# sourceMappingURL=onMessageActionTaken.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onMessageDismissed = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
7
8
|
/**
|
|
@@ -20,8 +21,7 @@ const utils_1 = require("../../../utils");
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
function onMessageDismissed(input) {
|
|
23
|
-
utils_1.assertIsInitialized();
|
|
24
|
-
return eventListeners_1.addEventListener('messageDismissed', input);
|
|
24
|
+
(0, utils_1.assertIsInitialized)();
|
|
25
|
+
return (0, eventListeners_1.addEventListener)('messageDismissed', input);
|
|
25
26
|
}
|
|
26
27
|
exports.onMessageDismissed = onMessageDismissed;
|
|
27
|
-
//# sourceMappingURL=onMessageDismissed.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onMessageDisplayed = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
7
8
|
/**
|
|
@@ -20,8 +21,7 @@ const utils_1 = require("../../../utils");
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
function onMessageDisplayed(input) {
|
|
23
|
-
utils_1.assertIsInitialized();
|
|
24
|
-
return eventListeners_1.addEventListener('messageDisplayed', input);
|
|
24
|
+
(0, utils_1.assertIsInitialized)();
|
|
25
|
+
return (0, eventListeners_1.addEventListener)('messageDisplayed', input);
|
|
25
26
|
}
|
|
26
27
|
exports.onMessageDisplayed = onMessageDisplayed;
|
|
27
|
-
//# sourceMappingURL=onMessageDisplayed.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.onMessageReceived = void 0;
|
|
5
6
|
const eventListeners_1 = require("../../../../eventListeners");
|
|
6
7
|
const utils_1 = require("../../../utils");
|
|
7
8
|
/**
|
|
@@ -20,8 +21,7 @@ const utils_1 = require("../../../utils");
|
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
23
|
function onMessageReceived(input) {
|
|
23
|
-
utils_1.assertIsInitialized();
|
|
24
|
-
return eventListeners_1.addEventListener('messageReceived', input);
|
|
24
|
+
(0, utils_1.assertIsInitialized)();
|
|
25
|
+
return (0, eventListeners_1.addEventListener)('messageReceived', input);
|
|
25
26
|
}
|
|
26
27
|
exports.onMessageReceived = onMessageReceived;
|
|
27
|
-
//# sourceMappingURL=onMessageReceived.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.setConflictHandler = exports.conflictHandler = void 0;
|
|
5
6
|
const utils_1 = require("../../../utils");
|
|
6
7
|
exports.conflictHandler = defaultConflictHandler;
|
|
7
8
|
/**
|
|
@@ -34,7 +35,7 @@ exports.conflictHandler = defaultConflictHandler;
|
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
37
|
function setConflictHandler(input) {
|
|
37
|
-
utils_1.assertIsInitialized();
|
|
38
|
+
(0, utils_1.assertIsInitialized)();
|
|
38
39
|
exports.conflictHandler = input;
|
|
39
40
|
}
|
|
40
41
|
exports.setConflictHandler = setConflictHandler;
|
|
@@ -62,4 +63,3 @@ function defaultConflictHandler(messages) {
|
|
|
62
63
|
// always return the top sorted
|
|
63
64
|
return sorted[0];
|
|
64
65
|
}
|
|
65
|
-
//# sourceMappingURL=setConflictHandler.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.syncMessages = void 0;
|
|
5
6
|
const utils_1 = require("@aws-amplify/core/internals/utils");
|
|
6
7
|
const pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
|
|
7
8
|
const core_1 = require("@aws-amplify/core");
|
|
@@ -25,7 +26,7 @@ const utils_3 = require("../../../utils");
|
|
|
25
26
|
* ```
|
|
26
27
|
*/
|
|
27
28
|
async function syncMessages() {
|
|
28
|
-
utils_3.assertIsInitialized();
|
|
29
|
+
(0, utils_3.assertIsInitialized)();
|
|
29
30
|
const messages = await fetchInAppMessages();
|
|
30
31
|
if (!messages || messages.length === 0) {
|
|
31
32
|
return;
|
|
@@ -35,35 +36,34 @@ async function syncMessages() {
|
|
|
35
36
|
await core_1.defaultStorage.setItem(key, JSON.stringify(messages));
|
|
36
37
|
}
|
|
37
38
|
catch (error) {
|
|
38
|
-
errors_1.assertServiceError(error);
|
|
39
|
+
(0, errors_1.assertServiceError)(error);
|
|
39
40
|
throw error;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
exports.syncMessages = syncMessages;
|
|
43
44
|
async function fetchInAppMessages() {
|
|
44
45
|
try {
|
|
45
|
-
const { credentials, identityId } = await utils_2.resolveCredentials();
|
|
46
|
-
const { appId, region } = utils_2.resolveConfig();
|
|
47
|
-
const endpointId = await pinpoint_1.resolveEndpointId({
|
|
46
|
+
const { credentials, identityId } = await (0, utils_2.resolveCredentials)();
|
|
47
|
+
const { appId, region } = (0, utils_2.resolveConfig)();
|
|
48
|
+
const endpointId = await (0, pinpoint_1.resolveEndpointId)({
|
|
48
49
|
appId,
|
|
49
50
|
category: utils_2.CATEGORY,
|
|
50
51
|
channelType: utils_2.CHANNEL_TYPE,
|
|
51
52
|
credentials,
|
|
52
53
|
identityId,
|
|
53
54
|
region,
|
|
54
|
-
userAgentValue: utils_2.getInAppMessagingUserAgentString(utils_1.InAppMessagingAction.SyncMessages),
|
|
55
|
+
userAgentValue: (0, utils_2.getInAppMessagingUserAgentString)(utils_1.InAppMessagingAction.SyncMessages),
|
|
55
56
|
});
|
|
56
57
|
const input = {
|
|
57
58
|
ApplicationId: appId,
|
|
58
59
|
EndpointId: endpointId,
|
|
59
60
|
};
|
|
60
|
-
const response = await pinpoint_2.getInAppMessages({ credentials, region }, input);
|
|
61
|
+
const response = await (0, pinpoint_2.getInAppMessages)({ credentials, region }, input);
|
|
61
62
|
const { InAppMessageCampaigns: messages } = response.InAppMessagesResponse ?? {};
|
|
62
63
|
return messages;
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
65
|
-
errors_1.assertServiceError(error);
|
|
66
|
+
(0, errors_1.assertServiceError)(error);
|
|
66
67
|
throw error;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
//# sourceMappingURL=syncMessages.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, } from './apis';
|
|
1
|
+
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, clearMessages, } from './apis';
|
|
2
2
|
export { IdentifyUserInput, DispatchEventInput, SetConflictHandlerInput, OnMessageActionTakenInput, OnMessageDismissedInput, OnMessageDisplayedInput, OnMessageReceivedInput, NotifyMessageInteractionInput, OnMessageReceivedOutput, OnMessageActionTakenOutput, OnMessageDismissedOutput, OnMessageDisplayedOutput, } from './types';
|