@aws-amplify/notifications 2.0.1-api-v6-models.9351bcf.0 → 2.0.1-api-v6-models.58f2536.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/in-app-messaging/package.json +4 -4
- package/lib/eventListeners/eventListeners.js +19 -37
- package/lib/eventListeners/index.js +4 -3
- package/lib/eventListeners/types.d.ts +2 -2
- package/lib/inAppMessaging/errors/InAppMessagingError.js +8 -11
- package/lib/inAppMessaging/errors/assertServiceError.js +3 -2
- package/lib/inAppMessaging/errors/assertValidationError.js +5 -4
- package/lib/inAppMessaging/errors/index.js +6 -5
- package/lib/inAppMessaging/errors/validation.js +7 -7
- package/lib/inAppMessaging/index.d.ts +2 -1
- package/lib/inAppMessaging/index.js +12 -10
- 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 +26 -38
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +24 -35
- package/lib/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib/inAppMessaging/providers/pinpoint/apis/index.js +13 -10
- package/lib/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +21 -21
- package/lib/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +6 -6
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageActionTaken.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDismissed.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageDisplayed.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/onMessageReceived.js +5 -4
- package/lib/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +6 -6
- package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +46 -76
- package/lib/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/index.js +12 -10
- package/lib/inAppMessaging/providers/pinpoint/types/index.js +2 -1
- package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib/inAppMessaging/providers/pinpoint/types/types.js +1 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/constants.js +1 -0
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +3 -3
- package/lib/inAppMessaging/providers/pinpoint/utils/helpers.js +114 -110
- package/lib/inAppMessaging/providers/pinpoint/utils/index.js +11 -10
- package/lib/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +116 -191
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +9 -8
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +1 -1
- package/lib/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +9 -15
- package/lib/inAppMessaging/providers/pinpoint/utils/userAgent.js +6 -5
- package/lib/inAppMessaging/types/event.d.ts +2 -2
- package/lib/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib/inAppMessaging/types/message.d.ts +3 -3
- package/lib/inAppMessaging/types/options.d.ts +1 -1
- package/lib/inAppMessaging/utils/index.js +4 -3
- package/lib/inAppMessaging/utils/statusHelpers.js +8 -5
- package/lib/index.js +1 -0
- package/lib/pushNotifications/errors/PushNotificationError.js +8 -11
- package/lib/pushNotifications/errors/errorHelpers.js +14 -13
- package/lib/pushNotifications/errors/index.js +4 -3
- package/lib/pushNotifications/index.d.ts +1 -1
- package/lib/pushNotifications/index.js +13 -12
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +9 -10
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +25 -36
- package/lib/pushNotifications/providers/pinpoint/apis/index.js +12 -11
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +90 -115
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +4 -2
- package/lib/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +7 -5
- package/lib/pushNotifications/providers/pinpoint/index.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/index.js +12 -11
- package/lib/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +33 -49
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +17 -13
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/getChannelType.js +9 -7
- package/lib/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib/pushNotifications/providers/pinpoint/utils/index.js +7 -4
- package/lib/pushNotifications/providers/pinpoint/utils/resolveConfig.js +17 -0
- package/lib/pushNotifications/types/errors.js +1 -0
- package/lib/pushNotifications/types/index.d.ts +1 -0
- package/lib/pushNotifications/types/index.js +20 -2
- package/lib/pushNotifications/types/inputs.d.ts +9 -8
- package/lib/pushNotifications/types/module.d.ts +31 -0
- package/lib/pushNotifications/types/options.d.ts +1 -1
- package/lib/pushNotifications/types/outputs.d.ts +8 -8
- package/lib/pushNotifications/types/pushNotifications.d.ts +4 -5
- package/lib/pushNotifications/utils/getPushNotificationUserAgentString.js +11 -0
- package/lib/pushNotifications/utils/index.d.ts +1 -1
- package/lib/pushNotifications/utils/index.js +8 -7
- package/lib/pushNotifications/utils/initializationManager.js +8 -9
- package/lib/pushNotifications/utils/resolveCredentials.d.ts +1 -1
- package/lib/pushNotifications/utils/resolveCredentials.js +9 -15
- package/lib/pushNotifications/utils/tokenManager.js +6 -3
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/eventListeners/eventListeners.js +15 -37
- package/lib-esm/eventListeners/types.d.ts +2 -2
- package/lib-esm/eventListeners/types.js +1 -0
- package/lib-esm/inAppMessaging/errors/InAppMessagingError.js +6 -11
- package/lib-esm/inAppMessaging/errors/assertValidationError.js +2 -2
- package/lib-esm/inAppMessaging/errors/validation.js +6 -7
- package/lib-esm/inAppMessaging/index.d.ts +2 -1
- package/lib-esm/inAppMessaging/index.js +1 -1
- 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 +15 -31
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +2 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +18 -31
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/index.js +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/initializeInAppMessaging.js +5 -6
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/notifyMessageInteraction.js +1 -2
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/setConflictHandler.js +4 -5
- package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +38 -69
- package/lib-esm/inAppMessaging/providers/pinpoint/index.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/index.js +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +8 -8
- package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.d.ts +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/types/outputs.js +1 -0
- package/lib-esm/inAppMessaging/providers/pinpoint/types/types.d.ts +6 -6
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/constants.js +4 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.d.ts +3 -3
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/helpers.js +85 -97
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.js +111 -187
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveConfig.js +3 -4
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.d.ts +1 -1
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/resolveCredentials.js +5 -13
- package/lib-esm/inAppMessaging/providers/pinpoint/utils/userAgent.js +2 -2
- package/lib-esm/inAppMessaging/types/event.d.ts +2 -2
- package/lib-esm/inAppMessaging/types/event.js +1 -0
- package/lib-esm/inAppMessaging/types/index.js +1 -0
- package/lib-esm/inAppMessaging/types/inputs.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/inputs.js +1 -0
- package/lib-esm/inAppMessaging/types/message.d.ts +3 -3
- package/lib-esm/inAppMessaging/types/message.js +1 -0
- package/lib-esm/inAppMessaging/types/options.d.ts +1 -1
- package/lib-esm/inAppMessaging/types/options.js +1 -0
- package/lib-esm/inAppMessaging/utils/statusHelpers.js +3 -3
- package/lib-esm/index.js +1 -0
- package/lib-esm/pushNotifications/errors/PushNotificationError.js +6 -11
- package/lib-esm/pushNotifications/errors/errorHelpers.js +8 -9
- package/lib-esm/pushNotifications/index.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getBadgeCount.native.js +5 -8
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getLaunchNotification.native.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/getPermissionStatus.native.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/identifyUser.native.js +20 -33
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/initializePushNotifications.native.js +76 -103
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationOpened.native.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInBackground.native.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onNotificationReceivedInForeground.native.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/onTokenReceived.native.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/requestPermissions.native.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.js +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/apis/setBadgeCount.native.js +2 -2
- package/lib-esm/pushNotifications/providers/pinpoint/index.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.d.ts +3 -3
- package/lib-esm/pushNotifications/providers/pinpoint/types/analytics.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.d.ts +11 -11
- package/lib-esm/pushNotifications/providers/pinpoint/types/apis.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/index.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.d.ts +7 -7
- package/lib-esm/pushNotifications/providers/pinpoint/types/inputs.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/options.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/providers/pinpoint/types/outputs.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.d.ts +1 -1
- package/lib-esm/pushNotifications/providers/pinpoint/types/pushNotifications.js +1 -0
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.js +27 -45
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.d.ts +3 -2
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.js +15 -13
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/getChannelType.js +5 -5
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.d.ts +2 -1
- package/lib-esm/pushNotifications/providers/pinpoint/utils/index.js +2 -1
- package/lib-esm/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.js +4 -5
- package/lib-esm/pushNotifications/types/index.d.ts +1 -0
- package/lib-esm/pushNotifications/types/index.js +5 -0
- package/lib-esm/pushNotifications/types/inputs.d.ts +9 -8
- package/lib-esm/pushNotifications/types/inputs.js +1 -0
- package/lib-esm/pushNotifications/types/module.d.ts +31 -0
- package/lib-esm/pushNotifications/{Platform/types.js → types/module.js} +1 -0
- package/lib-esm/pushNotifications/types/options.d.ts +1 -1
- package/lib-esm/pushNotifications/types/options.js +1 -0
- package/lib-esm/pushNotifications/types/outputs.d.ts +8 -8
- package/lib-esm/pushNotifications/types/outputs.js +1 -0
- package/lib-esm/pushNotifications/types/pushNotifications.d.ts +4 -5
- package/lib-esm/pushNotifications/types/pushNotifications.js +1 -0
- package/lib-esm/pushNotifications/{providers/pinpoint/utils → utils}/getPushNotificationUserAgentString.js +4 -6
- package/lib-esm/pushNotifications/utils/index.d.ts +1 -1
- package/lib-esm/pushNotifications/utils/index.js +1 -1
- package/lib-esm/pushNotifications/utils/initializationManager.js +5 -9
- package/lib-esm/pushNotifications/utils/resolveCredentials.d.ts +1 -1
- package/lib-esm/pushNotifications/utils/resolveCredentials.js +5 -13
- package/lib-esm/pushNotifications/utils/tokenManager.js +3 -3
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -30
- package/src/inAppMessaging/index.ts +12 -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/inAppMessaging/providers/pinpoint/utils/helpers.ts +38 -28
- package/src/inAppMessaging/providers/pinpoint/utils/messageProcessingHelpers.ts +25 -9
- package/src/inAppMessaging/providers/pinpoint/utils/resolveConfig.ts +1 -1
- package/src/pushNotifications/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 +51 -41
- 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/index.ts +1 -0
- package/src/pushNotifications/providers/pinpoint/utils/createMessageEventRecorder.ts +5 -4
- package/src/pushNotifications/providers/pinpoint/utils/getAnalyticsEvent.ts +7 -4
- package/src/pushNotifications/providers/pinpoint/utils/getChannelType.ts +1 -1
- package/src/pushNotifications/providers/pinpoint/utils/index.ts +2 -1
- package/src/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.ts +2 -2
- package/src/pushNotifications/types/index.ts +1 -0
- package/src/pushNotifications/types/inputs.ts +1 -1
- package/src/pushNotifications/types/module.ts +42 -0
- package/src/pushNotifications/types/outputs.ts +1 -1
- package/src/pushNotifications/types/pushNotifications.ts +2 -7
- package/src/pushNotifications/utils/index.ts +1 -1
- package/lib/inAppMessaging/providers/index.d.ts +0 -2
- package/lib/inAppMessaging/providers/index.js +0 -15
- package/lib/pushNotifications/Platform/index.d.ts +0 -2
- package/lib/pushNotifications/Platform/index.js +0 -25
- package/lib/pushNotifications/Platform/index.native.d.ts +0 -2
- package/lib/pushNotifications/Platform/index.native.js +0 -7
- package/lib/pushNotifications/Platform/types.d.ts +0 -5
- package/lib/pushNotifications/providers/pinpoint/utils/getPushNotificationUserAgentString.js +0 -11
- package/lib/pushNotifications/utils/resolveConfig.js +0 -16
- package/lib/tsconfig.build.tsbuildinfo +0 -8667
- package/lib-esm/inAppMessaging/providers/index.d.ts +0 -2
- package/lib-esm/inAppMessaging/providers/index.js +0 -3
- package/lib-esm/pushNotifications/Platform/index.d.ts +0 -2
- package/lib-esm/pushNotifications/Platform/index.js +0 -23
- package/lib-esm/pushNotifications/Platform/index.native.d.ts +0 -2
- package/lib-esm/pushNotifications/Platform/index.native.js +0 -5
- package/lib-esm/pushNotifications/Platform/types.d.ts +0 -5
- package/lib-esm/tsconfig.build.tsbuildinfo +0 -7115
- package/src/inAppMessaging/providers/index.ts +0 -38
- package/src/pushNotifications/Platform/index.native.ts +0 -9
- package/src/pushNotifications/Platform/index.ts +0 -22
- package/src/pushNotifications/Platform/types.ts +0 -15
- /package/lib/pushNotifications/{utils → providers/pinpoint/utils}/resolveConfig.d.ts +0 -0
- /package/lib/pushNotifications/{Platform/types.js → types/module.js} +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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { __awaiter, __generator } from "tslib";
|
|
4
3
|
import { PINPOINT_KEY_PREFIX, STORAGE_KEY_SUFFIX, processInAppMessages, } from '../utils';
|
|
5
4
|
import flatten from 'lodash/flatten';
|
|
6
5
|
import { defaultStorage } from '@aws-amplify/core';
|
|
@@ -32,34 +31,19 @@ import { assertIsInitialized } from '../../../utils';
|
|
|
32
31
|
* await dispatchEvent({ name: 'test_event' });
|
|
33
32
|
* ```
|
|
34
33
|
*/
|
|
35
|
-
export function dispatchEvent(input) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case 3:
|
|
51
|
-
messages = _a.sent();
|
|
52
|
-
flattenedMessages = flatten(messages);
|
|
53
|
-
if (flattenedMessages.length > 0) {
|
|
54
|
-
notifyEventListeners('messageReceived', conflictHandler(flattenedMessages));
|
|
55
|
-
}
|
|
56
|
-
return [3 /*break*/, 5];
|
|
57
|
-
case 4:
|
|
58
|
-
error_1 = _a.sent();
|
|
59
|
-
assertServiceError(error_1);
|
|
60
|
-
throw error_1;
|
|
61
|
-
case 5: return [2 /*return*/];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
34
|
+
export async function dispatchEvent(input) {
|
|
35
|
+
assertIsInitialized();
|
|
36
|
+
try {
|
|
37
|
+
const key = `${PINPOINT_KEY_PREFIX}${STORAGE_KEY_SUFFIX}`;
|
|
38
|
+
const cachedMessages = await defaultStorage.getItem(key);
|
|
39
|
+
const messages = await processInAppMessages(cachedMessages ? JSON.parse(cachedMessages) : [], input);
|
|
40
|
+
const flattenedMessages = flatten(messages);
|
|
41
|
+
if (flattenedMessages.length > 0) {
|
|
42
|
+
notifyEventListeners('messageReceived', conflictHandler(flattenedMessages));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
assertServiceError(error);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
65
49
|
}
|
|
@@ -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>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { __awaiter, __generator } from "tslib";
|
|
4
3
|
import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
|
|
5
4
|
import { updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
6
5
|
import { CATEGORY, CHANNEL_TYPE, getInAppMessagingUserAgentString, resolveConfig, resolveCredentials, } from '../utils';
|
|
@@ -54,35 +53,23 @@ import { assertIsInitialized } from '../../../utils';
|
|
|
54
53
|
* },
|
|
55
54
|
* });
|
|
56
55
|
*/
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
category: CATEGORY,
|
|
76
|
-
credentials: credentials,
|
|
77
|
-
identityId: identityId,
|
|
78
|
-
region: region,
|
|
79
|
-
userAttributes: userAttributes,
|
|
80
|
-
userId: userId,
|
|
81
|
-
userProfile: userProfile,
|
|
82
|
-
userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.IdentifyUser),
|
|
83
|
-
});
|
|
84
|
-
return [2 /*return*/];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
56
|
+
export const identifyUser = async ({ userId, userProfile, options, }) => {
|
|
57
|
+
assertIsInitialized();
|
|
58
|
+
const { credentials, identityId } = await resolveCredentials();
|
|
59
|
+
const { appId, region } = resolveConfig();
|
|
60
|
+
const { address, optOut, userAttributes } = options ?? {};
|
|
61
|
+
updateEndpoint({
|
|
62
|
+
address,
|
|
63
|
+
channelType: CHANNEL_TYPE,
|
|
64
|
+
optOut,
|
|
65
|
+
appId,
|
|
66
|
+
category: CATEGORY,
|
|
67
|
+
credentials,
|
|
68
|
+
identityId,
|
|
69
|
+
region,
|
|
70
|
+
userAttributes,
|
|
71
|
+
userId,
|
|
72
|
+
userProfile,
|
|
73
|
+
userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.IdentifyUser),
|
|
87
74
|
});
|
|
88
75
|
};
|
|
@@ -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';
|
|
@@ -10,3 +10,4 @@ export { onMessageDismissed } from './onMessageDismissed';
|
|
|
10
10
|
export { onMessageDisplayed } from './onMessageDisplayed';
|
|
11
11
|
export { onMessageActionTaken } from './onMessageActionTaken';
|
|
12
12
|
export { notifyMessageInteraction } from './notifyMessageInteraction';
|
|
13
|
+
export { clearMessages } from './clearMessages';
|
|
@@ -26,23 +26,22 @@ export function initializeInAppMessaging() {
|
|
|
26
26
|
// register with the session listener
|
|
27
27
|
sessionListener.addStateChangeListener(sessionStateChangeHandler, true);
|
|
28
28
|
// wire up default Pinpoint message event handling
|
|
29
|
-
addEventListener('messageDisplayed',
|
|
29
|
+
addEventListener('messageDisplayed', (message) => {
|
|
30
30
|
recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_DISPLAYED, message);
|
|
31
31
|
incrementMessageCounts(message.id);
|
|
32
32
|
});
|
|
33
|
-
addEventListener('messageDismissed',
|
|
33
|
+
addEventListener('messageDismissed', (message) => {
|
|
34
34
|
recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_DISMISSED, message);
|
|
35
35
|
});
|
|
36
|
-
addEventListener('messageActionTaken',
|
|
36
|
+
addEventListener('messageActionTaken', (message) => {
|
|
37
37
|
recordAnalyticsEvent(PinpointMessageEvent.MESSAGE_ACTION_TAKEN, message);
|
|
38
38
|
});
|
|
39
39
|
// listen to analytics hub events
|
|
40
40
|
Hub.listen('analytics', analyticsListener);
|
|
41
41
|
initialize();
|
|
42
42
|
}
|
|
43
|
-
function analyticsListener(
|
|
44
|
-
|
|
45
|
-
var event = payload.event, data = payload.data;
|
|
43
|
+
function analyticsListener({ payload, }) {
|
|
44
|
+
const { event, data } = payload;
|
|
46
45
|
switch (event) {
|
|
47
46
|
case 'record': {
|
|
48
47
|
dispatchEvent(data);
|
|
@@ -16,8 +16,7 @@ import { assertIsInitialized } from '../../../utils';
|
|
|
16
16
|
* });
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
export function notifyMessageInteraction(
|
|
20
|
-
var type = _a.type, message = _a.message;
|
|
19
|
+
export function notifyMessageInteraction({ type, message, }) {
|
|
21
20
|
assertIsInitialized();
|
|
22
21
|
notifyEventListeners(type, message);
|
|
23
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { assertIsInitialized } from '../../../utils';
|
|
4
|
-
export
|
|
4
|
+
export let conflictHandler = defaultConflictHandler;
|
|
5
5
|
/**
|
|
6
6
|
* Set a conflict handler that will be used to resolve conflicts that may emerge
|
|
7
7
|
* when matching events with synced messages.
|
|
@@ -38,10 +38,9 @@ export function setConflictHandler(input) {
|
|
|
38
38
|
function defaultConflictHandler(messages) {
|
|
39
39
|
// default behavior is to return the message closest to expiry
|
|
40
40
|
// this function assumes that messages processed by providers already filters out expired messages
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var endDateB = (_b = b.metadata) === null || _b === void 0 ? void 0 : _b.endDate;
|
|
41
|
+
const sorted = messages.sort((a, b) => {
|
|
42
|
+
const endDateA = a.metadata?.endDate;
|
|
43
|
+
const endDateB = b.metadata?.endDate;
|
|
45
44
|
// if both message end dates are falsy or have the same date string, treat them as equal
|
|
46
45
|
if (endDateA === endDateB) {
|
|
47
46
|
return 0;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { __awaiter, __generator } from "tslib";
|
|
4
3
|
import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
|
|
5
4
|
import { resolveEndpointId } from '@aws-amplify/core/internals/providers/pinpoint';
|
|
6
5
|
import { defaultStorage } from '@aws-amplify/core';
|
|
@@ -23,74 +22,44 @@ import { assertIsInitialized } from '../../../utils';
|
|
|
23
22
|
*
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
|
-
export function syncMessages() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
case 2:
|
|
41
|
-
_a.trys.push([2, 4, , 5]);
|
|
42
|
-
key = "" + PINPOINT_KEY_PREFIX + STORAGE_KEY_SUFFIX;
|
|
43
|
-
return [4 /*yield*/, defaultStorage.setItem(key, JSON.stringify(messages))];
|
|
44
|
-
case 3:
|
|
45
|
-
_a.sent();
|
|
46
|
-
return [3 /*break*/, 5];
|
|
47
|
-
case 4:
|
|
48
|
-
error_1 = _a.sent();
|
|
49
|
-
assertServiceError(error_1);
|
|
50
|
-
throw error_1;
|
|
51
|
-
case 5: return [2 /*return*/];
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
25
|
+
export async function syncMessages() {
|
|
26
|
+
assertIsInitialized();
|
|
27
|
+
const messages = await fetchInAppMessages();
|
|
28
|
+
if (!messages || messages.length === 0) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const key = `${PINPOINT_KEY_PREFIX}${STORAGE_KEY_SUFFIX}`;
|
|
33
|
+
await defaultStorage.setItem(key, JSON.stringify(messages));
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
assertServiceError(error);
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
55
39
|
}
|
|
56
|
-
function fetchInAppMessages() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return [4 /*yield*/, resolveEndpointId({
|
|
69
|
-
appId: appId,
|
|
70
|
-
category: CATEGORY,
|
|
71
|
-
channelType: CHANNEL_TYPE,
|
|
72
|
-
credentials: credentials,
|
|
73
|
-
identityId: identityId,
|
|
74
|
-
region: region,
|
|
75
|
-
userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.SyncMessages),
|
|
76
|
-
})];
|
|
77
|
-
case 2:
|
|
78
|
-
endpointId = _d.sent();
|
|
79
|
-
input = {
|
|
80
|
-
ApplicationId: appId,
|
|
81
|
-
EndpointId: endpointId,
|
|
82
|
-
};
|
|
83
|
-
return [4 /*yield*/, getInAppMessages({ credentials: credentials, region: region }, input)];
|
|
84
|
-
case 3:
|
|
85
|
-
response = _d.sent();
|
|
86
|
-
messages = ((_a = response.InAppMessagesResponse) !== null && _a !== void 0 ? _a : {}).InAppMessageCampaigns;
|
|
87
|
-
return [2 /*return*/, messages];
|
|
88
|
-
case 4:
|
|
89
|
-
error_2 = _d.sent();
|
|
90
|
-
assertServiceError(error_2);
|
|
91
|
-
throw error_2;
|
|
92
|
-
case 5: return [2 /*return*/];
|
|
93
|
-
}
|
|
40
|
+
async function fetchInAppMessages() {
|
|
41
|
+
try {
|
|
42
|
+
const { credentials, identityId } = await resolveCredentials();
|
|
43
|
+
const { appId, region } = resolveConfig();
|
|
44
|
+
const endpointId = await resolveEndpointId({
|
|
45
|
+
appId,
|
|
46
|
+
category: CATEGORY,
|
|
47
|
+
channelType: CHANNEL_TYPE,
|
|
48
|
+
credentials,
|
|
49
|
+
identityId,
|
|
50
|
+
region,
|
|
51
|
+
userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.SyncMessages),
|
|
94
52
|
});
|
|
95
|
-
|
|
53
|
+
const input = {
|
|
54
|
+
ApplicationId: appId,
|
|
55
|
+
EndpointId: endpointId,
|
|
56
|
+
};
|
|
57
|
+
const response = await getInAppMessages({ credentials, region }, input);
|
|
58
|
+
const { InAppMessageCampaigns: messages } = response.InAppMessagesResponse ?? {};
|
|
59
|
+
return messages;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
assertServiceError(error);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
96
65
|
}
|
|
@@ -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';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, } from './apis';
|
|
3
|
+
export { identifyUser, syncMessages, dispatchEvent, setConflictHandler, initializeInAppMessaging, onMessageReceived, onMessageDisplayed, onMessageDismissed, onMessageActionTaken, notifyMessageInteraction, clearMessages, } from './apis';
|
|
@@ -3,35 +3,35 @@ import { InAppMessage, InAppMessageInteractionEvent, InAppMessagingEvent, InAppM
|
|
|
3
3
|
/**
|
|
4
4
|
* Input type for Pinpoint identifyUser API.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type IdentifyUserInput = InAppMessagingIdentifyUserInput<IdentifyUserOptions>;
|
|
7
7
|
/**
|
|
8
8
|
* Input type for Pinpoint dispatchEvent API.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type DispatchEventInput = InAppMessagingEvent;
|
|
11
11
|
/**
|
|
12
12
|
* Input type for Pinpoint SetConflictHandler API.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export type SetConflictHandlerInput = InAppMessageConflictHandler;
|
|
15
15
|
/**
|
|
16
16
|
* Input type for OnMessageReceived API.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type OnMessageReceivedInput = OnMessageInteractionEventHandler;
|
|
19
19
|
/**
|
|
20
20
|
* Input type for OnMessageDisplayed API.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export type OnMessageDisplayedInput = OnMessageInteractionEventHandler;
|
|
23
23
|
/**
|
|
24
24
|
* Input type for OnMessageDismissed API.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type OnMessageDismissedInput = OnMessageInteractionEventHandler;
|
|
27
27
|
/**
|
|
28
28
|
* Input type for OnMessageActionTaken API.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type OnMessageActionTakenInput = OnMessageInteractionEventHandler;
|
|
31
31
|
/**
|
|
32
32
|
* Input type for NotifyMessageInteraction API.
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type NotifyMessageInteractionInput = {
|
|
35
35
|
message: InAppMessage;
|
|
36
36
|
type: InAppMessageInteractionEvent;
|
|
37
37
|
};
|
|
@@ -2,16 +2,16 @@ import { EventListenerRemover } from '../../../../eventListeners';
|
|
|
2
2
|
/**
|
|
3
3
|
* Output type for OnMessageReceived API.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type OnMessageReceivedOutput = EventListenerRemover;
|
|
6
6
|
/**
|
|
7
7
|
* Output type for OnMessageDisplayed API.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type OnMessageDisplayedOutput = EventListenerRemover;
|
|
10
10
|
/**
|
|
11
11
|
* Output type for OnMessageDismissed API.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type OnMessageDismissedOutput = EventListenerRemover;
|
|
14
14
|
/**
|
|
15
15
|
* Output type for OnMessageActionTaken API.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type OnMessageActionTakenOutput = EventListenerRemover;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { InAppMessage } from '../../../types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type InAppMessageCountMap = Record<string, number>;
|
|
3
|
+
export type DailyInAppMessageCounter = {
|
|
4
4
|
count: number;
|
|
5
5
|
lastCountTimestamp: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type InAppMessageCounts = {
|
|
8
8
|
sessionCount: number;
|
|
9
9
|
dailyCount: number;
|
|
10
10
|
totalCount: number;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type MetricsComparator = (metricsVal: number, eventVal: number) => boolean;
|
|
13
13
|
export declare enum PinpointMessageEvent {
|
|
14
14
|
MESSAGE_DISPLAYED = "_inapp.message_displayed",
|
|
15
15
|
MESSAGE_DISMISSED = "_inapp.message_dismissed",
|
|
16
16
|
MESSAGE_ACTION_TAKEN = "_inapp.message_clicked"
|
|
17
17
|
}
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type InAppMessageConflictHandler = (messages: InAppMessage[]) => InAppMessage;
|
|
19
|
+
export type OnMessageInteractionEventHandler = (message: InAppMessage) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export const PINPOINT_KEY_PREFIX = 'Pinpoint';
|
|
4
|
+
export const STORAGE_KEY_SUFFIX = '_inAppMessages';
|
|
5
|
+
export const CATEGORY = 'InAppMessaging';
|
|
6
|
+
export const CHANNEL_TYPE = 'IN_APP';
|
|
@@ -5,13 +5,13 @@ import { MetricsComparator, PinpointMessageEvent } from '../types';
|
|
|
5
5
|
export declare const logger: ConsoleLogger;
|
|
6
6
|
export declare const recordAnalyticsEvent: (event: PinpointMessageEvent, message: InAppMessage) => void;
|
|
7
7
|
export declare const getStartOfDay: () => string;
|
|
8
|
-
export declare const matchesEventType: ({ CampaignId, Schedule }: PinpointInAppMessage, { name: eventType }: InAppMessagingEvent) =>
|
|
8
|
+
export declare const matchesEventType: ({ CampaignId, Schedule }: PinpointInAppMessage, { name: eventType }: InAppMessagingEvent) => boolean;
|
|
9
9
|
export declare const matchesAttributes: ({ CampaignId, Schedule }: PinpointInAppMessage, { attributes }: InAppMessagingEvent) => boolean;
|
|
10
10
|
export declare const matchesMetrics: ({ CampaignId, Schedule }: PinpointInAppMessage, { metrics }: InAppMessagingEvent) => boolean;
|
|
11
|
-
export declare const getComparator: (operator
|
|
11
|
+
export declare const getComparator: (operator?: string) => MetricsComparator | undefined;
|
|
12
12
|
export declare const isBeforeEndDate: ({ Schedule, }: PinpointInAppMessage) => boolean;
|
|
13
13
|
export declare const isQuietTime: (message: PinpointInAppMessage) => boolean;
|
|
14
14
|
export declare const clearMemo: () => void;
|
|
15
|
-
export declare const interpretLayout: (layout:
|
|
15
|
+
export declare const interpretLayout: (layout: NonNullable<PinpointInAppMessage['InAppMessage']>['Layout']) => InAppMessageLayout;
|
|
16
16
|
export declare const extractContent: ({ InAppMessage: message, }: PinpointInAppMessage) => InAppMessageContent[];
|
|
17
17
|
export declare const extractMetadata: ({ InAppMessage, Priority, Schedule, TreatmentId, }: PinpointInAppMessage) => any;
|