@aws-amplify/notifications 1.6.6-api-v6-models.b3abc9b.0 → 2.0.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/README.md +3 -0
- package/in-app-messaging/package.json +7 -0
- package/in-app-messaging/pinpoint/package.json +7 -0
- package/lib/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +2 -2
- package/lib/eventListeners/eventListeners.js +38 -0
- package/lib/eventListeners/index.d.ts +2 -0
- package/lib/eventListeners/index.js +9 -0
- package/lib/eventListeners/types.d.ts +10 -0
- package/lib/{InAppMessaging/SessionTracker → eventListeners}/types.js +0 -1
- package/lib/inAppMessaging/errors/InAppMessagingError.d.ts +7 -0
- package/lib/inAppMessaging/errors/InAppMessagingError.js +19 -0
- package/lib/inAppMessaging/errors/assertServiceError.d.ts +2 -0
- package/lib/inAppMessaging/errors/assertServiceError.js +19 -0
- package/lib/inAppMessaging/errors/assertValidationError.d.ts +5 -0
- package/lib/inAppMessaging/errors/assertValidationError.js +17 -0
- package/lib/inAppMessaging/errors/index.d.ts +4 -0
- package/lib/inAppMessaging/errors/index.js +14 -0
- package/lib/inAppMessaging/errors/validation.d.ts +8 -0
- package/lib/inAppMessaging/errors/validation.js +27 -0
- package/lib/inAppMessaging/index.d.ts +2 -0
- package/lib/inAppMessaging/index.js +17 -0
- 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.d.ts +26 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +56 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +51 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +79 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +11 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js +27 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.d.ts +12 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +57 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.d.ts +16 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +26 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.d.ts +18 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +27 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.d.ts +18 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +27 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.d.ts +18 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +27 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.d.ts +18 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +27 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.d.ts +32 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +65 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.d.ts +16 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +69 -0
- package/lib/inAppMessaging/providers/pinpoint/index.d.ts +2 -0
- package/lib/inAppMessaging/providers/pinpoint/index.js +17 -0
- package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +4 -0
- package/lib/{InAppMessaging → inAppMessaging/providers/pinpoint/types}/index.js +2 -4
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +37 -0
- package/lib/{PushNotification/Platform/types.js → inAppMessaging/providers/pinpoint/types/inputs.js} +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
- package/lib/{common/AWSPinpointProviderCommon/types.js → inAppMessaging/providers/pinpoint/types/options.js} +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +17 -0
- package/lib/{common/eventListeners/types.js → inAppMessaging/providers/pinpoint/types/outputs.js} +0 -1
- package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +19 -0
- package/lib/inAppMessaging/providers/pinpoint/types/types.js +11 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.d.ts +4 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +9 -0
- package/lib/{InAppMessaging/Providers/AWSPinpointProvider/utils.d.ts → inAppMessaging/providers/pinpoint/utils/helpers.d.ts} +6 -7
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +264 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/index.d.ts +5 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js +20 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +6 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +169 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +17 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +16 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.d.ts +4 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +20 -0
- package/lib/inAppMessaging/types/event.d.ts +6 -0
- package/lib/inAppMessaging/types/event.js +4 -0
- package/lib/inAppMessaging/types/index.d.ts +4 -0
- package/lib/inAppMessaging/types/index.js +4 -0
- package/lib/inAppMessaging/types/inputs.d.ts +19 -0
- package/lib/inAppMessaging/types/inputs.js +4 -0
- package/lib/inAppMessaging/types/message.d.ts +44 -0
- package/lib/inAppMessaging/types/message.js +4 -0
- package/lib/inAppMessaging/types/options.d.ts +4 -0
- package/lib/inAppMessaging/types/options.js +4 -0
- package/lib/inAppMessaging/utils/index.d.ts +1 -0
- package/lib/inAppMessaging/utils/index.js +9 -0
- package/lib/inAppMessaging/utils/statusHelpers.d.ts +13 -0
- package/lib/inAppMessaging/utils/statusHelpers.js +27 -0
- package/lib/index.d.ts +0 -6
- package/lib/index.js +0 -10
- package/lib/pushNotifications/errors/PushNotificationError.d.ts +4 -0
- package/lib/pushNotifications/errors/PushNotificationError.js +16 -0
- package/lib/pushNotifications/errors/errorHelpers.d.ts +9 -0
- package/lib/pushNotifications/errors/errorHelpers.js +35 -0
- package/lib/pushNotifications/errors/index.d.ts +2 -0
- package/lib/pushNotifications/errors/index.js +10 -0
- package/lib/pushNotifications/index.d.ts +3 -0
- package/lib/pushNotifications/index.js +19 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +22 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +26 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +35 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +61 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +31 -0
- package/lib/pushNotifications/providers/pinpoint/apis/index.d.ts +11 -0
- package/lib/pushNotifications/providers/pinpoint/apis/index.js +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +25 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +133 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +35 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +12 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +51 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +12 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +35 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +12 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +36 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +12 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +40 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +22 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/index.d.ts +3 -0
- package/lib/pushNotifications/providers/pinpoint/index.js +17 -0
- package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
- package/lib/pushNotifications/providers/pinpoint/types/analytics.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
- package/lib/pushNotifications/providers/pinpoint/types/apis.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
- package/lib/pushNotifications/providers/pinpoint/types/index.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
- package/lib/pushNotifications/providers/pinpoint/types/inputs.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
- package/lib/pushNotifications/providers/pinpoint/types/options.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
- package/lib/pushNotifications/providers/pinpoint/types/outputs.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.js +4 -0
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +6 -0
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +43 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +7 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +56 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +5 -0
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +25 -0
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +4 -0
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +13 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +17 -0
- package/lib/pushNotifications/types/errors.d.ts +3 -0
- package/lib/pushNotifications/types/errors.js +9 -0
- package/lib/pushNotifications/types/index.d.ts +6 -0
- package/lib/pushNotifications/types/index.js +24 -0
- package/lib/pushNotifications/types/inputs.d.ts +24 -0
- package/lib/pushNotifications/types/inputs.js +4 -0
- package/lib/pushNotifications/types/module.d.ts +31 -0
- package/lib/pushNotifications/types/module.js +4 -0
- package/lib/pushNotifications/types/options.d.ts +4 -0
- package/lib/pushNotifications/types/options.js +4 -0
- package/lib/pushNotifications/types/outputs.d.ts +10 -0
- package/lib/pushNotifications/types/outputs.js +4 -0
- package/lib/pushNotifications/types/pushNotifications.d.ts +4 -0
- package/lib/pushNotifications/types/pushNotifications.js +4 -0
- package/lib/pushNotifications/utils/getPushNotificationUserAgentString.d.ts +2 -0
- package/lib/pushNotifications/utils/getPushNotificationUserAgentString.js +11 -0
- package/lib/pushNotifications/utils/index.d.ts +4 -0
- package/lib/pushNotifications/utils/index.js +15 -0
- package/lib/pushNotifications/utils/initializationManager.d.ts +12 -0
- package/lib/pushNotifications/utils/initializationManager.js +22 -0
- package/lib/pushNotifications/utils/resolveCredentials.d.ts +7 -0
- package/lib/pushNotifications/utils/resolveCredentials.js +16 -0
- package/lib/pushNotifications/utils/tokenManager.d.ts +12 -0
- package/lib/pushNotifications/utils/tokenManager.js +22 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/{common/eventListeners/index.d.ts → eventListeners/eventListeners.d.ts} +2 -2
- package/lib-esm/eventListeners/eventListeners.js +32 -0
- package/lib-esm/eventListeners/index.d.ts +2 -0
- package/lib-esm/{common → eventListeners}/index.js +0 -3
- package/lib-esm/eventListeners/types.d.ts +10 -0
- package/lib-esm/{PushNotification/Platform → eventListeners}/types.js +1 -1
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.d.ts +7 -0
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +15 -0
- package/lib-esm/inAppMessaging/errors/assertServiceError.d.ts +2 -0
- package/lib-esm/inAppMessaging/errors/assertServiceError.js +15 -0
- package/lib-esm/inAppMessaging/errors/assertValidationError.d.ts +5 -0
- package/lib-esm/inAppMessaging/errors/assertValidationError.js +13 -0
- package/lib-esm/inAppMessaging/errors/index.d.ts +4 -0
- package/lib-esm/inAppMessaging/errors/index.js +6 -0
- package/lib-esm/inAppMessaging/errors/validation.d.ts +8 -0
- package/lib-esm/inAppMessaging/errors/validation.js +24 -0
- package/lib-esm/inAppMessaging/index.d.ts +2 -0
- package/lib-esm/inAppMessaging/index.js +3 -0
- 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.d.ts +26 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/dispatchEvent.js +49 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +51 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +75 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +11 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +13 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.d.ts +12 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +53 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.d.ts +16 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +22 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.d.ts +18 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +23 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.d.ts +18 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +23 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.d.ts +18 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +23 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.d.ts +18 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +23 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.d.ts +32 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +61 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.d.ts +16 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +65 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +2 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js +3 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +4 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +3 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +37 -0
- package/lib-esm/{common/AWSPinpointProviderCommon/types.js → inAppMessaging/providers/pinpoint/types/inputs.js} +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
- package/lib-esm/{common/eventListeners/types.js → inAppMessaging/providers/pinpoint/types/options.js} +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +17 -0
- package/lib-esm/{InAppMessaging/SessionTracker/types.js → inAppMessaging/providers/pinpoint/types/outputs.js} +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +19 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.js +8 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.d.ts +4 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +6 -0
- package/lib-esm/{InAppMessaging/Providers/AWSPinpointProvider/utils.d.ts → inAppMessaging/providers/pinpoint/utils/helpers.d.ts} +6 -7
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +246 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.d.ts +5 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/index.js +7 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.d.ts +6 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +163 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +13 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +7 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +12 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.d.ts +4 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +15 -0
- package/lib-esm/inAppMessaging/types/event.d.ts +6 -0
- package/lib-esm/inAppMessaging/types/event.js +3 -0
- package/lib-esm/inAppMessaging/types/index.d.ts +4 -0
- package/lib-esm/inAppMessaging/types/index.js +3 -0
- package/lib-esm/inAppMessaging/types/inputs.d.ts +19 -0
- package/lib-esm/inAppMessaging/types/inputs.js +3 -0
- package/lib-esm/inAppMessaging/types/message.d.ts +44 -0
- package/lib-esm/inAppMessaging/types/message.js +3 -0
- package/lib-esm/inAppMessaging/types/options.d.ts +4 -0
- package/lib-esm/inAppMessaging/types/options.js +3 -0
- package/lib-esm/inAppMessaging/utils/index.d.ts +1 -0
- package/lib-esm/inAppMessaging/utils/index.js +3 -0
- package/lib-esm/inAppMessaging/utils/statusHelpers.d.ts +13 -0
- package/lib-esm/inAppMessaging/utils/statusHelpers.js +21 -0
- package/lib-esm/index.d.ts +0 -6
- package/lib-esm/index.js +1 -5
- package/lib-esm/pushNotifications/errors/PushNotificationError.d.ts +4 -0
- package/lib-esm/pushNotifications/errors/PushNotificationError.js +12 -0
- package/lib-esm/pushNotifications/errors/errorHelpers.d.ts +9 -0
- package/lib-esm/pushNotifications/errors/errorHelpers.js +31 -0
- package/lib-esm/pushNotifications/errors/index.d.ts +2 -0
- package/lib-esm/pushNotifications/errors/index.js +4 -0
- package/lib-esm/pushNotifications/index.d.ts +3 -0
- package/lib-esm/pushNotifications/index.js +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.d.ts +14 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.d.ts +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +22 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.d.ts +53 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +57 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.d.ts +11 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/index.js +13 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.d.ts +17 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +21 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +129 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +8 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.d.ts +43 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +47 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +8 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.d.ts +27 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +31 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +8 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.d.ts +28 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +32 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +8 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.d.ts +32 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +36 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.d.ts +14 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +18 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/index.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +13 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.d.ts +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +5 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +9 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +2 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +3 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +39 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +52 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +5 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +21 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +4 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +6 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.d.ts +7 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/resolveConfig.js +13 -0
- package/lib-esm/pushNotifications/types/errors.d.ts +3 -0
- package/lib-esm/pushNotifications/types/errors.js +6 -0
- package/lib-esm/pushNotifications/types/index.d.ts +6 -0
- package/lib-esm/pushNotifications/types/index.js +8 -0
- package/lib-esm/pushNotifications/types/inputs.d.ts +24 -0
- package/lib-esm/pushNotifications/types/inputs.js +3 -0
- package/lib-esm/pushNotifications/types/module.d.ts +31 -0
- package/lib-esm/pushNotifications/types/module.js +3 -0
- package/lib-esm/pushNotifications/types/options.d.ts +4 -0
- package/lib-esm/pushNotifications/types/options.js +3 -0
- package/lib-esm/pushNotifications/types/outputs.d.ts +10 -0
- package/lib-esm/pushNotifications/types/outputs.js +3 -0
- package/lib-esm/pushNotifications/types/pushNotifications.d.ts +4 -0
- package/lib-esm/pushNotifications/types/pushNotifications.js +3 -0
- package/lib-esm/pushNotifications/utils/getPushNotificationUserAgentString.d.ts +2 -0
- package/lib-esm/pushNotifications/utils/getPushNotificationUserAgentString.js +7 -0
- package/lib-esm/pushNotifications/utils/index.d.ts +4 -0
- package/lib-esm/pushNotifications/utils/index.js +6 -0
- package/lib-esm/pushNotifications/utils/initializationManager.d.ts +12 -0
- package/lib-esm/pushNotifications/utils/initializationManager.js +17 -0
- package/lib-esm/pushNotifications/utils/resolveCredentials.d.ts +7 -0
- package/lib-esm/pushNotifications/utils/resolveCredentials.js +12 -0
- package/lib-esm/pushNotifications/utils/tokenManager.d.ts +12 -0
- package/lib-esm/pushNotifications/utils/tokenManager.js +17 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +104 -38
- package/push-notifications/package.json +7 -0
- package/push-notifications/pinpoint/package.json +7 -0
- package/src/{common/eventListeners/index.ts → eventListeners/eventListeners.ts} +5 -3
- package/src/{common → eventListeners}/index.ts +1 -3
- package/src/{common/eventListeners → eventListeners}/types.ts +6 -2
- package/src/inAppMessaging/errors/InAppMessagingError.ts +21 -0
- package/src/inAppMessaging/errors/assertServiceError.ts +24 -0
- package/src/inAppMessaging/errors/assertValidationError.ts +22 -0
- package/src/inAppMessaging/errors/index.ts +10 -0
- package/src/inAppMessaging/errors/validation.ts +29 -0
- package/src/inAppMessaging/index.ts +39 -0
- package/src/inAppMessaging/providers/pinpoint/apis/clearMessages.ts +26 -0
- package/src/inAppMessaging/providers/pinpoint/apis/dispatchEvent.ts +63 -0
- package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +94 -0
- package/src/inAppMessaging/providers/pinpoint/apis/index.ts +14 -0
- package/src/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.ts +62 -0
- package/src/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.ts +28 -0
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.ts +29 -0
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.ts +29 -0
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.ts +29 -0
- package/src/inAppMessaging/providers/pinpoint/apis/onMessageReceived.ts +29 -0
- package/src/inAppMessaging/providers/pinpoint/apis/setConflictHandler.ts +68 -0
- package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +88 -0
- package/src/inAppMessaging/providers/pinpoint/index.ts +31 -0
- package/src/inAppMessaging/providers/pinpoint/types/index.ts +29 -0
- package/src/inAppMessaging/providers/pinpoint/types/inputs.ts +58 -0
- package/src/inAppMessaging/providers/pinpoint/types/options.ts +9 -0
- package/src/inAppMessaging/providers/pinpoint/types/outputs.ts +24 -0
- package/src/{InAppMessaging/Providers/AWSPinpointProvider → inAppMessaging/providers/pinpoint/types}/types.ts +9 -1
- package/src/inAppMessaging/providers/pinpoint/utils/constants.ts +6 -0
- package/src/{InAppMessaging/Providers/AWSPinpointProvider/utils.ts → inAppMessaging/providers/pinpoint/utils/helpers.ts} +74 -58
- package/src/inAppMessaging/providers/pinpoint/utils/index.ts +18 -0
- package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +210 -0
- package/src/inAppMessaging/providers/pinpoint/utils/resolveConfig.ts +19 -0
- package/src/inAppMessaging/providers/pinpoint/utils/resolveCredentials.ts +20 -0
- package/src/inAppMessaging/providers/pinpoint/utils/userAgent.ts +25 -0
- package/src/inAppMessaging/types/event.ts +14 -0
- package/src/{InAppMessaging → inAppMessaging/types}/index.ts +7 -8
- package/src/inAppMessaging/types/inputs.ts +27 -0
- package/src/inAppMessaging/types/message.ts +62 -0
- package/src/inAppMessaging/types/options.ts +7 -0
- package/src/{PushNotification/Providers → inAppMessaging/utils}/index.ts +5 -1
- package/src/inAppMessaging/utils/statusHelpers.ts +32 -0
- package/src/index.ts +0 -24
- package/src/pushNotifications/errors/PushNotificationError.ts +18 -0
- package/src/pushNotifications/errors/errorHelpers.ts +45 -0
- package/src/pushNotifications/errors/index.ts +5 -0
- package/src/pushNotifications/index.ts +32 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.ts +13 -0
- package/src/pushNotifications/providers/pinpoint/apis/getBadgeCount.ts +21 -0
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/apis/getLaunchNotification.ts +26 -0
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/apis/getPermissionStatus.ts +34 -0
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/identifyUser.ts +62 -0
- package/src/pushNotifications/providers/pinpoint/apis/index.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.ts +209 -0
- package/src/pushNotifications/providers/pinpoint/apis/initializePushNotifications.ts +24 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.ts +11 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationOpened.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.ts +12 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.ts +56 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.ts +12 -0
- package/src/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.ts +40 -0
- package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.ts +11 -0
- package/src/pushNotifications/providers/pinpoint/apis/onTokenReceived.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.native.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/apis/requestPermissions.ts +39 -0
- package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.ts +13 -0
- package/src/pushNotifications/providers/pinpoint/apis/setBadgeCount.ts +21 -0
- package/src/pushNotifications/providers/pinpoint/index.ts +34 -0
- package/src/pushNotifications/providers/pinpoint/types/analytics.ts +14 -0
- package/src/pushNotifications/providers/pinpoint/types/apis.ts +54 -0
- package/src/pushNotifications/providers/pinpoint/types/index.ts +40 -0
- package/src/pushNotifications/providers/pinpoint/types/inputs.ts +31 -0
- package/src/pushNotifications/providers/pinpoint/types/options.ts +9 -0
- package/src/pushNotifications/providers/pinpoint/types/outputs.ts +34 -0
- package/src/pushNotifications/providers/pinpoint/types/pushNotifications.ts +6 -0
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +66 -0
- package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +66 -0
- package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +25 -0
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +7 -0
- package/src/pushNotifications/providers/pinpoint/utils/resolveConfig.ts +16 -0
- package/src/{InAppMessaging/Providers/index.ts → pushNotifications/types/errors.ts} +3 -1
- package/src/pushNotifications/types/index.ts +9 -0
- package/src/pushNotifications/types/inputs.ts +45 -0
- package/src/pushNotifications/types/module.ts +42 -0
- package/src/pushNotifications/types/options.ts +7 -0
- package/src/pushNotifications/types/outputs.ts +28 -0
- package/src/pushNotifications/types/pushNotifications.ts +17 -0
- package/src/pushNotifications/utils/getPushNotificationUserAgentString.ts +15 -0
- package/src/pushNotifications/utils/index.ts +7 -0
- package/src/pushNotifications/utils/initializationManager.ts +20 -0
- package/src/pushNotifications/utils/resolveCredentials.ts +14 -0
- package/src/pushNotifications/utils/tokenManager.ts +20 -0
- package/lib/.tsbuildinfo +0 -3
- package/lib/InAppMessaging/InAppMessaging.d.ts +0 -57
- package/lib/InAppMessaging/InAppMessaging.js +0 -340
- package/lib/InAppMessaging/InAppMessaging.js.map +0 -1
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.d.ts +0 -31
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.js +0 -266
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.d.ts +0 -16
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.js +0 -11
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/utils.js +0 -247
- package/lib/InAppMessaging/Providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib/InAppMessaging/Providers/index.d.ts +0 -1
- package/lib/InAppMessaging/Providers/index.js +0 -7
- package/lib/InAppMessaging/Providers/index.js.map +0 -1
- package/lib/InAppMessaging/SessionTracker/SessionTracker.d.ts +0 -9
- package/lib/InAppMessaging/SessionTracker/SessionTracker.js +0 -68
- package/lib/InAppMessaging/SessionTracker/SessionTracker.js.map +0 -1
- package/lib/InAppMessaging/SessionTracker/SessionTracker.native.d.ts +0 -10
- package/lib/InAppMessaging/SessionTracker/SessionTracker.native.js +0 -53
- package/lib/InAppMessaging/SessionTracker/SessionTracker.native.js.map +0 -1
- package/lib/InAppMessaging/SessionTracker/index.d.ts +0 -3
- package/lib/InAppMessaging/SessionTracker/index.js +0 -8
- package/lib/InAppMessaging/SessionTracker/index.js.map +0 -1
- package/lib/InAppMessaging/SessionTracker/types.d.ts +0 -6
- package/lib/InAppMessaging/SessionTracker/types.js.map +0 -1
- package/lib/InAppMessaging/index.d.ts +0 -2
- package/lib/InAppMessaging/index.js.map +0 -1
- package/lib/InAppMessaging/types.d.ts +0 -87
- package/lib/InAppMessaging/types.js +0 -12
- package/lib/InAppMessaging/types.js.map +0 -1
- package/lib/Notifications.d.ts +0 -24
- package/lib/Notifications.js +0 -94
- package/lib/Notifications.js.map +0 -1
- package/lib/PushNotification/NotEnabledError.d.ts +0 -3
- package/lib/PushNotification/NotEnabledError.js +0 -16
- package/lib/PushNotification/NotEnabledError.js.map +0 -1
- package/lib/PushNotification/Platform/index.d.ts +0 -2
- package/lib/PushNotification/Platform/index.js +0 -26
- package/lib/PushNotification/Platform/index.js.map +0 -1
- package/lib/PushNotification/Platform/index.native.d.ts +0 -2
- package/lib/PushNotification/Platform/index.native.js +0 -8
- package/lib/PushNotification/Platform/index.native.js.map +0 -1
- package/lib/PushNotification/Platform/types.d.ts +0 -5
- package/lib/PushNotification/Platform/types.js.map +0 -1
- package/lib/PushNotification/PlatformNotSupportedError.d.ts +0 -3
- package/lib/PushNotification/PlatformNotSupportedError.js +0 -16
- package/lib/PushNotification/PlatformNotSupportedError.js.map +0 -1
- package/lib/PushNotification/Providers/AWSPinpointProvider/index.d.ts +0 -15
- package/lib/PushNotification/Providers/AWSPinpointProvider/index.js +0 -114
- package/lib/PushNotification/Providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib/PushNotification/Providers/AWSPinpointProvider/types.d.ts +0 -9
- package/lib/PushNotification/Providers/AWSPinpointProvider/types.js +0 -16
- package/lib/PushNotification/Providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib/PushNotification/Providers/AWSPinpointProvider/utils.d.ts +0 -7
- package/lib/PushNotification/Providers/AWSPinpointProvider/utils.js +0 -58
- package/lib/PushNotification/Providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib/PushNotification/Providers/index.d.ts +0 -1
- package/lib/PushNotification/Providers/index.js +0 -7
- package/lib/PushNotification/Providers/index.js.map +0 -1
- package/lib/PushNotification/PushNotification.d.ts +0 -39
- package/lib/PushNotification/PushNotification.js +0 -91
- package/lib/PushNotification/PushNotification.js.map +0 -1
- package/lib/PushNotification/PushNotification.native.d.ts +0 -63
- package/lib/PushNotification/PushNotification.native.js +0 -332
- package/lib/PushNotification/PushNotification.native.js.map +0 -1
- package/lib/PushNotification/index.d.ts +0 -2
- package/lib/PushNotification/index.js +0 -9
- package/lib/PushNotification/index.js.map +0 -1
- package/lib/PushNotification/types.d.ts +0 -77
- package/lib/PushNotification/types.js +0 -12
- package/lib/PushNotification/types.js.map +0 -1
- package/lib/PushNotification/utils.d.ts +0 -3
- package/lib/PushNotification/utils.js +0 -81
- package/lib/PushNotification/utils.js.map +0 -1
- package/lib/common/AWSPinpointProviderCommon/index.d.ts +0 -35
- package/lib/common/AWSPinpointProviderCommon/index.js +0 -280
- package/lib/common/AWSPinpointProviderCommon/index.js.map +0 -1
- package/lib/common/AWSPinpointProviderCommon/types.d.ts +0 -10
- package/lib/common/AWSPinpointProviderCommon/types.js.map +0 -1
- package/lib/common/constants.d.ts +0 -1
- package/lib/common/constants.js +0 -8
- package/lib/common/constants.js.map +0 -1
- package/lib/common/eventListeners/index.js +0 -55
- package/lib/common/eventListeners/index.js.map +0 -1
- package/lib/common/eventListeners/types.d.ts +0 -7
- package/lib/common/eventListeners/types.js.map +0 -1
- package/lib/common/index.d.ts +0 -4
- package/lib/common/index.js +0 -13
- package/lib/common/index.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types.d.ts +0 -39
- package/lib/types.js +0 -5
- package/lib/types.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/InAppMessaging/InAppMessaging.d.ts +0 -57
- package/lib-esm/InAppMessaging/InAppMessaging.js +0 -338
- package/lib-esm/InAppMessaging/InAppMessaging.js.map +0 -1
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.d.ts +0 -31
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.js +0 -264
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.d.ts +0 -16
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.js +0 -9
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/utils.js +0 -245
- package/lib-esm/InAppMessaging/Providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib-esm/InAppMessaging/Providers/index.d.ts +0 -1
- package/lib-esm/InAppMessaging/Providers/index.js +0 -4
- package/lib-esm/InAppMessaging/Providers/index.js.map +0 -1
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.d.ts +0 -9
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.js +0 -65
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.js.map +0 -1
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.d.ts +0 -10
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.js +0 -50
- package/lib-esm/InAppMessaging/SessionTracker/SessionTracker.native.js.map +0 -1
- package/lib-esm/InAppMessaging/SessionTracker/index.d.ts +0 -3
- package/lib-esm/InAppMessaging/SessionTracker/index.js +0 -5
- package/lib-esm/InAppMessaging/SessionTracker/index.js.map +0 -1
- package/lib-esm/InAppMessaging/SessionTracker/types.d.ts +0 -6
- package/lib-esm/InAppMessaging/SessionTracker/types.js.map +0 -1
- package/lib-esm/InAppMessaging/index.d.ts +0 -2
- package/lib-esm/InAppMessaging/index.js +0 -5
- package/lib-esm/InAppMessaging/index.js.map +0 -1
- package/lib-esm/InAppMessaging/types.d.ts +0 -87
- package/lib-esm/InAppMessaging/types.js +0 -10
- package/lib-esm/InAppMessaging/types.js.map +0 -1
- package/lib-esm/Notifications.d.ts +0 -24
- package/lib-esm/Notifications.js +0 -92
- package/lib-esm/Notifications.js.map +0 -1
- package/lib-esm/PushNotification/NotEnabledError.d.ts +0 -3
- package/lib-esm/PushNotification/NotEnabledError.js +0 -14
- package/lib-esm/PushNotification/NotEnabledError.js.map +0 -1
- package/lib-esm/PushNotification/Platform/index.d.ts +0 -2
- package/lib-esm/PushNotification/Platform/index.js +0 -24
- package/lib-esm/PushNotification/Platform/index.js.map +0 -1
- package/lib-esm/PushNotification/Platform/index.native.d.ts +0 -2
- package/lib-esm/PushNotification/Platform/index.native.js +0 -6
- package/lib-esm/PushNotification/Platform/index.native.js.map +0 -1
- package/lib-esm/PushNotification/Platform/types.d.ts +0 -5
- package/lib-esm/PushNotification/Platform/types.js.map +0 -1
- package/lib-esm/PushNotification/PlatformNotSupportedError.d.ts +0 -3
- package/lib-esm/PushNotification/PlatformNotSupportedError.js +0 -14
- package/lib-esm/PushNotification/PlatformNotSupportedError.js.map +0 -1
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.d.ts +0 -15
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.js +0 -112
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/index.js.map +0 -1
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.d.ts +0 -9
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.js +0 -14
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/types.js.map +0 -1
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.d.ts +0 -7
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.js +0 -56
- package/lib-esm/PushNotification/Providers/AWSPinpointProvider/utils.js.map +0 -1
- package/lib-esm/PushNotification/Providers/index.d.ts +0 -1
- package/lib-esm/PushNotification/Providers/index.js +0 -4
- package/lib-esm/PushNotification/Providers/index.js.map +0 -1
- package/lib-esm/PushNotification/PushNotification.d.ts +0 -39
- package/lib-esm/PushNotification/PushNotification.js +0 -89
- package/lib-esm/PushNotification/PushNotification.js.map +0 -1
- package/lib-esm/PushNotification/PushNotification.native.d.ts +0 -63
- package/lib-esm/PushNotification/PushNotification.native.js +0 -330
- package/lib-esm/PushNotification/PushNotification.native.js.map +0 -1
- package/lib-esm/PushNotification/index.d.ts +0 -2
- package/lib-esm/PushNotification/index.js +0 -5
- package/lib-esm/PushNotification/index.js.map +0 -1
- package/lib-esm/PushNotification/types.d.ts +0 -77
- package/lib-esm/PushNotification/types.js +0 -10
- package/lib-esm/PushNotification/types.js.map +0 -1
- package/lib-esm/PushNotification/utils.d.ts +0 -3
- package/lib-esm/PushNotification/utils.js +0 -79
- package/lib-esm/PushNotification/utils.js.map +0 -1
- package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +0 -35
- package/lib-esm/common/AWSPinpointProviderCommon/index.js +0 -278
- package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +0 -1
- package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +0 -10
- package/lib-esm/common/AWSPinpointProviderCommon/types.js.map +0 -1
- package/lib-esm/common/constants.d.ts +0 -1
- package/lib-esm/common/constants.js +0 -6
- package/lib-esm/common/constants.js.map +0 -1
- package/lib-esm/common/eventListeners/index.js +0 -53
- package/lib-esm/common/eventListeners/index.js.map +0 -1
- package/lib-esm/common/eventListeners/types.d.ts +0 -7
- package/lib-esm/common/eventListeners/types.js.map +0 -1
- package/lib-esm/common/index.d.ts +0 -4
- package/lib-esm/common/index.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/types.d.ts +0 -39
- package/lib-esm/types.js +0 -3
- package/lib-esm/types.js.map +0 -1
- package/src/InAppMessaging/InAppMessaging.ts +0 -321
- package/src/InAppMessaging/Providers/AWSPinpointProvider/index.ts +0 -323
- package/src/InAppMessaging/SessionTracker/SessionTracker.native.ts +0 -60
- package/src/InAppMessaging/SessionTracker/SessionTracker.ts +0 -78
- package/src/InAppMessaging/SessionTracker/index.ts +0 -6
- package/src/InAppMessaging/SessionTracker/types.ts +0 -11
- package/src/InAppMessaging/types.ts +0 -142
- package/src/Notifications.ts +0 -90
- package/src/PushNotification/NotEnabledError.ts +0 -11
- package/src/PushNotification/Platform/index.native.ts +0 -9
- package/src/PushNotification/Platform/index.ts +0 -22
- package/src/PushNotification/Platform/types.ts +0 -15
- package/src/PushNotification/PlatformNotSupportedError.ts +0 -9
- package/src/PushNotification/Providers/AWSPinpointProvider/index.ts +0 -137
- package/src/PushNotification/Providers/AWSPinpointProvider/types.ts +0 -13
- package/src/PushNotification/Providers/AWSPinpointProvider/utils.ts +0 -79
- package/src/PushNotification/PushNotification.native.ts +0 -386
- package/src/PushNotification/PushNotification.ts +0 -107
- package/src/PushNotification/index.ts +0 -9
- package/src/PushNotification/types.ts +0 -115
- package/src/PushNotification/utils.ts +0 -112
- package/src/common/AWSPinpointProviderCommon/index.ts +0 -291
- package/src/common/AWSPinpointProviderCommon/types.ts +0 -29
- package/src/common/constants.ts +0 -7
- package/src/types.ts +0 -56
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnTokenReceived } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a listener that will be triggered when a token is received. A token will be received:
|
|
4
|
+
* 1. On every app launch, including the first install
|
|
5
|
+
* 2. When a token changes (this may happen if the service invalidates the token for any reason)
|
|
6
|
+
*
|
|
7
|
+
* @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
|
|
8
|
+
* @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Register a listener
|
|
12
|
+
* onTokenReceived(message => {
|
|
13
|
+
* doSomething(message);
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // Register multiple listeners
|
|
19
|
+
* onTokenReceived(message => {
|
|
20
|
+
* doSomething(message);
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* onTokenReceived(message => {
|
|
24
|
+
* doSomethingElse(message);
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const onTokenReceived: OnTokenReceived;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a listener that will be triggered when a token is received. A token will be received:
|
|
6
|
+
* 1. On every app launch, including the first install
|
|
7
|
+
* 2. When a token changes (this may happen if the service invalidates the token for any reason)
|
|
8
|
+
*
|
|
9
|
+
* @param {OnTokenReceivedInput} input - A callback handler to be invoked with the token.
|
|
10
|
+
* @returns {OnTokenReceivedOutput} - An object with a remove function to remove the listener.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Register a listener
|
|
14
|
+
* onTokenReceived(message => {
|
|
15
|
+
* doSomething(message);
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Register multiple listeners
|
|
21
|
+
* onTokenReceived(message => {
|
|
22
|
+
* doSomething(message);
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* onTokenReceived(message => {
|
|
26
|
+
* doSomethingElse(message);
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export const onTokenReceived = () => {
|
|
31
|
+
throw new PlatformNotSupportedError();
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { addEventListener } from '../../../../eventListeners';
|
|
4
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
5
|
+
export const onTokenReceived = input => {
|
|
6
|
+
assertIsInitialized();
|
|
7
|
+
return addEventListener('tokenReceived', input);
|
|
8
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RequestPermissions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
|
|
4
|
+
* choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
|
|
5
|
+
* granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
|
|
6
|
+
* your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
|
|
7
|
+
*
|
|
8
|
+
* * `alert`: When set to true, requests the ability to display notifications to the user.
|
|
9
|
+
*
|
|
10
|
+
* * `sound`: When set to true, requests the ability to play a sound in response to notifications.
|
|
11
|
+
*
|
|
12
|
+
* * `badge`: When set to true, requests the ability to update the app's badge.
|
|
13
|
+
*
|
|
14
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
15
|
+
* only React Native is supported by this API.
|
|
16
|
+
* @returns A promise that resolves to true if requested permissions are granted or have already previously been
|
|
17
|
+
* granted or false otherwise.
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Request all permissions by default
|
|
21
|
+
* const arePermissionsGranted = await requestPermissions();
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* // Prevent requesting specific permissions
|
|
26
|
+
* const arePermissionsGranted = await requestPermissions({
|
|
27
|
+
* sound: false,
|
|
28
|
+
* badge: false
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const requestPermissions: RequestPermissions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Requests notification permissions from your user. By default, Amplify requests all supported permissions but you can
|
|
6
|
+
* choose not to request specific permissions. The resulting promise will resolve to true if requested permissions are
|
|
7
|
+
* granted (or have previously been granted) or false otherwise. Not all specific permissions are supported by platforms
|
|
8
|
+
* your React Native app can run on but will be safely ignored even on those platforms. Currently supported permissions:
|
|
9
|
+
*
|
|
10
|
+
* * `alert`: When set to true, requests the ability to display notifications to the user.
|
|
11
|
+
*
|
|
12
|
+
* * `sound`: When set to true, requests the ability to play a sound in response to notifications.
|
|
13
|
+
*
|
|
14
|
+
* * `badge`: When set to true, requests the ability to update the app's badge.
|
|
15
|
+
*
|
|
16
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
17
|
+
* only React Native is supported by this API.
|
|
18
|
+
* @returns A promise that resolves to true if requested permissions are granted or have already previously been
|
|
19
|
+
* granted or false otherwise.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* // Request all permissions by default
|
|
23
|
+
* const arePermissionsGranted = await requestPermissions();
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // Prevent requesting specific permissions
|
|
28
|
+
* const arePermissionsGranted = await requestPermissions({
|
|
29
|
+
* sound: false,
|
|
30
|
+
* badge: false
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const requestPermissions = async () => {
|
|
35
|
+
throw new PlatformNotSupportedError();
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
4
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
5
|
+
const { requestPermissions: requestPermissionsNative } = loadAmplifyPushNotification();
|
|
6
|
+
export const requestPermissions = async (input) => {
|
|
7
|
+
assertIsInitialized();
|
|
8
|
+
return requestPermissionsNative(input);
|
|
9
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SetBadgeCount } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
|
|
4
|
+
* to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
|
|
5
|
+
* when your React Native app is running on platforms where badges are not supported.
|
|
6
|
+
*
|
|
7
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
8
|
+
* only React Native is supported by this API.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* setBadgeCount(42);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const setBadgeCount: SetBadgeCount;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Sets the current badge count (the number on the top right corner of your app's icon). Setting the badge count
|
|
6
|
+
* to 0 (zero) will remove the badge from your app's icon. This function is safe to call (but will be ignored) even
|
|
7
|
+
* when your React Native app is running on platforms where badges are not supported.
|
|
8
|
+
*
|
|
9
|
+
* @throws platform: {@link PlatformNotSupportedError} - Thrown if called against an unsupported platform. Currently,
|
|
10
|
+
* only React Native is supported by this API.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* setBadgeCount(42);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export const setBadgeCount = () => {
|
|
17
|
+
throw new PlatformNotSupportedError();
|
|
18
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { loadAmplifyPushNotification } from '@aws-amplify/react-native';
|
|
4
|
+
import { assertIsInitialized } from '../../../errors/errorHelpers';
|
|
5
|
+
const { setBadgeCount: setBadgeCountNative } = loadAmplifyPushNotification();
|
|
6
|
+
export const setBadgeCount = input => {
|
|
7
|
+
assertIsInitialized();
|
|
8
|
+
setBadgeCountNative(input);
|
|
9
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
|
|
2
|
+
export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './types/inputs';
|
|
3
|
+
export { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './types/outputs';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PinpointMessageEvent = 'opened_notification' | 'received_background' | 'received_foreground';
|
|
2
|
+
export type PinpointMessageEventSource = '_campaign' | '_journey';
|
|
3
|
+
export type AnalyticsEventAttributes = {
|
|
4
|
+
source: PinpointMessageEventSource;
|
|
5
|
+
attributes: Record<string, string>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput } from './inputs';
|
|
2
|
+
import { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, RequestPermissionsOutput } from './outputs';
|
|
3
|
+
export type GetBadgeCount = () => Promise<void | GetBadgeCountOutput>;
|
|
4
|
+
export type GetLaunchNotification = () => Promise<GetLaunchNotificationOutput>;
|
|
5
|
+
export type GetPermissionStatus = () => Promise<GetPermissionStatusOutput>;
|
|
6
|
+
export type IdentifyUser = (input: IdentifyUserInput) => Promise<void>;
|
|
7
|
+
export type InitializePushNotifications = () => void;
|
|
8
|
+
export type RequestPermissions = (input?: RequestPermissionsInput) => Promise<RequestPermissionsOutput>;
|
|
9
|
+
export type SetBadgeCount = (input: SetBadgeCountInput) => void;
|
|
10
|
+
export type OnNotificationOpened = (input: OnNotificationOpenedInput) => OnNotificationOpenedOutput;
|
|
11
|
+
export type OnNotificationReceivedInBackground = (input: OnNotificationReceivedInBackgroundInput) => OnNotificationReceivedInBackgroundOutput;
|
|
12
|
+
export type OnNotificationReceivedInForeground = (input: OnNotificationReceivedInForegroundInput) => OnNotificationReceivedInForegroundOutput;
|
|
13
|
+
export type OnTokenReceived = (input: OnTokenReceivedInput) => OnTokenReceivedOutput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AnalyticsEventAttributes, PinpointMessageEvent, PinpointMessageEventSource, } from './analytics';
|
|
2
|
+
export { GetBadgeCount, GetLaunchNotification, GetPermissionStatus, IdentifyUser, InitializePushNotifications, OnNotificationOpened, OnNotificationReceivedInBackground, OnNotificationReceivedInForeground, OnTokenReceived, RequestPermissions, SetBadgeCount, } from './apis';
|
|
3
|
+
export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './inputs';
|
|
4
|
+
export { GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './outputs';
|
|
5
|
+
export { IdentifyUserOptions } from './options';
|
|
6
|
+
export { ChannelType } from './pushNotifications';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IdentifyUserOptions } from './options';
|
|
2
|
+
import { PushNotificationIdentifyUserInput, PushNotificationRequestPermissionsInput, PushNotificationSetBadgeCountInput, PushNotificationOnNotificationOpenedInput, PushNotificationOnNotificationReceivedInBackgroundInput, PushNotificationOnNotificationReceivedInForegroundInput, PushNotificationOnTokenReceivedInput } from '../../../types';
|
|
3
|
+
export type IdentifyUserInput = PushNotificationIdentifyUserInput<IdentifyUserOptions>;
|
|
4
|
+
export type RequestPermissionsInput = PushNotificationRequestPermissionsInput;
|
|
5
|
+
export type SetBadgeCountInput = PushNotificationSetBadgeCountInput;
|
|
6
|
+
export type OnNotificationOpenedInput = PushNotificationOnNotificationOpenedInput;
|
|
7
|
+
export type OnNotificationReceivedInBackgroundInput = PushNotificationOnNotificationReceivedInBackgroundInput;
|
|
8
|
+
export type OnNotificationReceivedInForegroundInput = PushNotificationOnNotificationReceivedInForegroundInput;
|
|
9
|
+
export type OnTokenReceivedInput = PushNotificationOnTokenReceivedInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PushNotificationGetBadgeCountOutput, PushNotificationGetLaunchNotificationOutput, PushNotificationGetPermissionStatusOutput, PushNotificationOnNotificationOpenedOutput, PushNotificationOnNotificationReceivedInBackgroundOutput, PushNotificationOnNotificationReceivedInForegroundOutput, PushNotificationOnTokenReceivedOutput, PushNotificationRequestPermissionsOutput } from '../../../types';
|
|
2
|
+
export type GetBadgeCountOutput = PushNotificationGetBadgeCountOutput;
|
|
3
|
+
export type GetLaunchNotificationOutput = PushNotificationGetLaunchNotificationOutput;
|
|
4
|
+
export type GetPermissionStatusOutput = PushNotificationGetPermissionStatusOutput;
|
|
5
|
+
export type RequestPermissionsOutput = PushNotificationRequestPermissionsOutput;
|
|
6
|
+
export type OnNotificationOpenedOutput = PushNotificationOnNotificationOpenedOutput;
|
|
7
|
+
export type OnNotificationReceivedInBackgroundOutput = PushNotificationOnNotificationReceivedInBackgroundOutput;
|
|
8
|
+
export type OnNotificationReceivedInForegroundOutput = PushNotificationOnNotificationReceivedInForegroundOutput;
|
|
9
|
+
export type OnTokenReceivedOutput = PushNotificationOnTokenReceivedOutput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PinpointMessageEvent } from '../types';
|
|
2
|
+
import { OnPushNotificationMessageHandler } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare const createMessageEventRecorder: (event: PinpointMessageEvent, callback?: Function) => OnPushNotificationMessageHandler;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { record } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
4
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
5
|
+
import { resolveCredentials } from '../../../utils';
|
|
6
|
+
import { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
7
|
+
import { getChannelType } from './getChannelType';
|
|
8
|
+
import { resolveConfig } from './resolveConfig';
|
|
9
|
+
const logger = new ConsoleLogger('PushNotification.recordMessageEvent');
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const createMessageEventRecorder = (event, callback) => async (message) => {
|
|
14
|
+
const { credentials } = await resolveCredentials();
|
|
15
|
+
const { appId, region } = resolveConfig();
|
|
16
|
+
await recordMessageEvent({
|
|
17
|
+
appId,
|
|
18
|
+
credentials,
|
|
19
|
+
event,
|
|
20
|
+
message,
|
|
21
|
+
region,
|
|
22
|
+
});
|
|
23
|
+
callback?.();
|
|
24
|
+
};
|
|
25
|
+
const recordMessageEvent = async ({ appId, credentials, event, message, region, }) => {
|
|
26
|
+
const analyticsEvent = getAnalyticsEvent(message, event);
|
|
27
|
+
if (!analyticsEvent) {
|
|
28
|
+
logger.debug('A notification missing event information was not recorded');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
return record({
|
|
32
|
+
appId,
|
|
33
|
+
category: 'PushNotification',
|
|
34
|
+
channelType: getChannelType(),
|
|
35
|
+
credentials,
|
|
36
|
+
event: analyticsEvent,
|
|
37
|
+
region,
|
|
38
|
+
});
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PinpointAnalyticsEvent } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
2
|
+
import { PinpointMessageEvent } from '../types';
|
|
3
|
+
import { PushNotificationMessage } from '../../../types';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const getAnalyticsEvent: ({ data }: PushNotificationMessage, event: PinpointMessageEvent) => PinpointAnalyticsEvent | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const ANDROID_CAMPAIGN_ACTIVITY_ID_KEY = 'pinpoint.campaign.campaign_activity_id';
|
|
4
|
+
const ANDROID_CAMPAIGN_ID_KEY = 'pinpoint.campaign.campaign_id';
|
|
5
|
+
const ANDROID_CAMPAIGN_TREATMENT_ID_KEY = 'pinpoint.campaign.treatment_id';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export const getAnalyticsEvent = ({ data }, event) => {
|
|
10
|
+
if (!data) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const eventAttributes = getAnalyticsEventAttributes(data);
|
|
14
|
+
if (!eventAttributes) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const { source, attributes } = eventAttributes;
|
|
18
|
+
return {
|
|
19
|
+
attributes,
|
|
20
|
+
name: `${source}.${event}`,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const getAnalyticsEventAttributes = (data) => {
|
|
24
|
+
if (!data) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (data.hasOwnProperty(ANDROID_CAMPAIGN_ID_KEY)) {
|
|
28
|
+
return {
|
|
29
|
+
source: '_campaign',
|
|
30
|
+
attributes: {
|
|
31
|
+
campaign_activity_id: data[ANDROID_CAMPAIGN_ACTIVITY_ID_KEY],
|
|
32
|
+
campaign_id: data[ANDROID_CAMPAIGN_ID_KEY],
|
|
33
|
+
treatment_id: data[ANDROID_CAMPAIGN_TREATMENT_ID_KEY],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const pinpoint = typeof data.pinpoint === 'string'
|
|
38
|
+
? JSON.parse(data.pinpoint)
|
|
39
|
+
: data.pinpoint;
|
|
40
|
+
if (pinpoint?.campaign) {
|
|
41
|
+
return {
|
|
42
|
+
source: '_campaign',
|
|
43
|
+
attributes: pinpoint.campaign,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (pinpoint?.journey) {
|
|
47
|
+
return {
|
|
48
|
+
source: '_journey',
|
|
49
|
+
attributes: pinpoint.journey,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { PlatformNotSupportedError } from '@aws-amplify/core/internals/utils';
|
|
4
|
+
import { getOperatingSystem } from '@aws-amplify/react-native';
|
|
5
|
+
const operatingSystem = getOperatingSystem();
|
|
6
|
+
const isAndroid = operatingSystem === 'android';
|
|
7
|
+
const isIos = operatingSystem === 'ios';
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export const getChannelType = () => {
|
|
12
|
+
if (isAndroid) {
|
|
13
|
+
// FCM was previously known as GCM and continues to be the channel type in Pinpoint
|
|
14
|
+
return 'GCM';
|
|
15
|
+
}
|
|
16
|
+
if (isIos) {
|
|
17
|
+
// If building in debug mode, use the APNs sandbox
|
|
18
|
+
return __DEV__ ? 'APNS_SANDBOX' : 'APNS';
|
|
19
|
+
}
|
|
20
|
+
throw new PlatformNotSupportedError();
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export { createMessageEventRecorder } from './createMessageEventRecorder';
|
|
4
|
+
export { getAnalyticsEvent } from './getAnalyticsEvent';
|
|
5
|
+
export { getChannelType } from './getChannelType';
|
|
6
|
+
export { resolveConfig } from './resolveConfig';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { Amplify } from '@aws-amplify/core';
|
|
4
|
+
import { assert, PushNotificationValidationErrorCode } from '../../../errors';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export const resolveConfig = () => {
|
|
9
|
+
const { appId, region } = Amplify.getConfig().Notifications?.PushNotification?.Pinpoint ?? {};
|
|
10
|
+
assert(!!appId, PushNotificationValidationErrorCode.NoAppId);
|
|
11
|
+
assert(!!region, PushNotificationValidationErrorCode.NoRegion);
|
|
12
|
+
return { appId, region };
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export var PushNotificationErrorCode;
|
|
4
|
+
(function (PushNotificationErrorCode) {
|
|
5
|
+
PushNotificationErrorCode["NotInitialized"] = "NotInitialized";
|
|
6
|
+
})(PushNotificationErrorCode || (PushNotificationErrorCode = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export * from './errors';
|
|
4
|
+
export * from './inputs';
|
|
5
|
+
export * from './module';
|
|
6
|
+
export * from './options';
|
|
7
|
+
export * from './outputs';
|
|
8
|
+
export * from './pushNotifications';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UserProfile } from '@aws-amplify/core';
|
|
2
|
+
import { PushNotificationServiceOptions } from './options';
|
|
3
|
+
import { PushNotificationPermissions } from './module';
|
|
4
|
+
import { OnPushNotificationMessageHandler, OnTokenReceivedHandler } from './pushNotifications';
|
|
5
|
+
export type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
|
|
6
|
+
/**
|
|
7
|
+
* A User ID associated to the current device.
|
|
8
|
+
*/
|
|
9
|
+
userId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Additional information about the user and their device.
|
|
12
|
+
*/
|
|
13
|
+
userProfile: UserProfile;
|
|
14
|
+
/**
|
|
15
|
+
* Options to be passed to the API.
|
|
16
|
+
*/
|
|
17
|
+
options?: ServiceOptions;
|
|
18
|
+
};
|
|
19
|
+
export type PushNotificationRequestPermissionsInput = PushNotificationPermissions;
|
|
20
|
+
export type PushNotificationSetBadgeCountInput = number;
|
|
21
|
+
export type PushNotificationOnNotificationOpenedInput = OnPushNotificationMessageHandler;
|
|
22
|
+
export type PushNotificationOnNotificationReceivedInBackgroundInput = OnPushNotificationMessageHandler;
|
|
23
|
+
export type PushNotificationOnNotificationReceivedInForegroundInput = OnPushNotificationMessageHandler;
|
|
24
|
+
export type PushNotificationOnTokenReceivedInput = OnTokenReceivedHandler;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types here are duplicated from `rtn-push-notifications` as it is not possible to share a source of truth
|
|
3
|
+
* with a package that may conditionally not exist for developers not using push notifications. Modifications
|
|
4
|
+
* made to these types should be reflected in the native module package and vice-versa!
|
|
5
|
+
*/
|
|
6
|
+
interface ApnsPlatformOptions {
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
}
|
|
9
|
+
interface FcmPlatformOptions {
|
|
10
|
+
channelId: string;
|
|
11
|
+
messageId: string;
|
|
12
|
+
senderId: string;
|
|
13
|
+
sendTime: Date;
|
|
14
|
+
}
|
|
15
|
+
export interface PushNotificationMessage {
|
|
16
|
+
title?: string;
|
|
17
|
+
body?: string;
|
|
18
|
+
imageUrl?: string;
|
|
19
|
+
deeplinkUrl?: string;
|
|
20
|
+
goToUrl?: string;
|
|
21
|
+
fcmOptions?: FcmPlatformOptions;
|
|
22
|
+
apnsOptions?: ApnsPlatformOptions;
|
|
23
|
+
data?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
|
|
26
|
+
export interface PushNotificationPermissions extends Partial<Record<string, boolean>> {
|
|
27
|
+
alert?: boolean;
|
|
28
|
+
badge?: boolean;
|
|
29
|
+
sound?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventListenerRemover } from '../../eventListeners';
|
|
2
|
+
import { PushNotificationMessage, PushNotificationPermissionStatus } from '../types';
|
|
3
|
+
export type PushNotificationGetBadgeCountOutput = number | null;
|
|
4
|
+
export type PushNotificationGetLaunchNotificationOutput = PushNotificationMessage | null;
|
|
5
|
+
export type PushNotificationGetPermissionStatusOutput = PushNotificationPermissionStatus;
|
|
6
|
+
export type PushNotificationRequestPermissionsOutput = boolean;
|
|
7
|
+
export type PushNotificationOnNotificationOpenedOutput = EventListenerRemover;
|
|
8
|
+
export type PushNotificationOnNotificationReceivedInBackgroundOutput = EventListenerRemover;
|
|
9
|
+
export type PushNotificationOnNotificationReceivedInForegroundOutput = EventListenerRemover;
|
|
10
|
+
export type PushNotificationOnTokenReceivedOutput = EventListenerRemover;
|