@aws-amplify/notifications 2.0.1-console-preview.11cf989.0 → 2.0.1-console-preview.4ae78ed.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.
Files changed (129) hide show
  1. package/lib/common/AWSPinpointProviderCommon/index.d.ts +2 -2
  2. package/lib/common/AWSPinpointProviderCommon/index.js +1 -1
  3. package/lib/common/AWSPinpointProviderCommon/index.js.map +1 -1
  4. package/lib/common/AWSPinpointProviderCommon/types.d.ts +2 -2
  5. package/lib/inAppMessaging/index.d.ts +0 -1
  6. package/lib/inAppMessaging/index.js +0 -2
  7. package/lib/inAppMessaging/index.js.map +1 -1
  8. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +55 -2
  9. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js +89 -4
  10. package/lib/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +1 -1
  11. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js +1 -2
  12. package/lib/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +1 -1
  13. package/lib/inAppMessaging/providers/pinpoint/types/errors.d.ts +9 -0
  14. package/lib/inAppMessaging/providers/pinpoint/types/errors.js +15 -0
  15. package/lib/inAppMessaging/providers/pinpoint/types/errors.js.map +1 -0
  16. package/lib/inAppMessaging/providers/pinpoint/types/index.d.ts +3 -0
  17. package/lib/inAppMessaging/providers/pinpoint/types/index.js +7 -0
  18. package/lib/inAppMessaging/providers/pinpoint/types/index.js.map +1 -0
  19. package/lib/inAppMessaging/providers/pinpoint/types/inputs.d.ts +6 -0
  20. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js +5 -0
  21. package/lib/inAppMessaging/providers/pinpoint/types/inputs.js.map +1 -0
  22. package/lib/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
  23. package/lib/inAppMessaging/providers/pinpoint/types/options.js +5 -0
  24. package/lib/inAppMessaging/providers/pinpoint/types/options.js.map +1 -0
  25. package/lib/inAppMessaging/types/config.d.ts +5 -0
  26. package/lib/inAppMessaging/types/config.js +3 -0
  27. package/lib/inAppMessaging/types/config.js.map +1 -0
  28. package/lib/inAppMessaging/types/event.d.ts +6 -0
  29. package/lib/inAppMessaging/types/event.js +5 -0
  30. package/lib/inAppMessaging/types/event.js.map +1 -0
  31. package/lib/inAppMessaging/types/index.d.ts +5 -0
  32. package/lib/inAppMessaging/types/index.js +5 -0
  33. package/lib/inAppMessaging/types/index.js.map +1 -0
  34. package/lib/inAppMessaging/types/inputs.d.ts +21 -0
  35. package/lib/inAppMessaging/types/inputs.js +5 -0
  36. package/lib/inAppMessaging/types/inputs.js.map +1 -0
  37. package/lib/inAppMessaging/types/message.d.ts +44 -0
  38. package/lib/inAppMessaging/types/message.js +5 -0
  39. package/lib/inAppMessaging/types/message.js.map +1 -0
  40. package/lib/inAppMessaging/types/options.d.ts +4 -0
  41. package/lib/inAppMessaging/types/options.js +5 -0
  42. package/lib/inAppMessaging/types/options.js.map +1 -0
  43. package/lib/index.d.ts +1 -2
  44. package/lib/index.js +0 -2
  45. package/lib/index.js.map +1 -1
  46. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js +4 -4
  47. package/lib/pushNotifications/providers/AWSPinpointProvider/index.js.map +1 -1
  48. package/lib/pushNotifications/types.d.ts +3 -9
  49. package/lib-esm/common/AWSPinpointProviderCommon/index.d.ts +2 -2
  50. package/lib-esm/common/AWSPinpointProviderCommon/index.js +1 -1
  51. package/lib-esm/common/AWSPinpointProviderCommon/index.js.map +1 -1
  52. package/lib-esm/common/AWSPinpointProviderCommon/types.d.ts +2 -2
  53. package/lib-esm/inAppMessaging/index.d.ts +0 -1
  54. package/lib-esm/inAppMessaging/index.js +0 -1
  55. package/lib-esm/inAppMessaging/index.js.map +1 -1
  56. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.d.ts +55 -2
  57. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js +89 -3
  58. package/lib-esm/inAppMessaging/providers/pinpoint/apis/identifyUser.js.map +1 -1
  59. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js +2 -3
  60. package/lib-esm/inAppMessaging/providers/pinpoint/apis/syncMessages.js.map +1 -1
  61. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.d.ts +9 -0
  62. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js +13 -0
  63. package/lib-esm/inAppMessaging/providers/pinpoint/types/errors.js.map +1 -0
  64. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.d.ts +3 -0
  65. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js +4 -0
  66. package/lib-esm/inAppMessaging/providers/pinpoint/types/index.js.map +1 -0
  67. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.d.ts +6 -0
  68. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js +3 -0
  69. package/lib-esm/inAppMessaging/providers/pinpoint/types/inputs.js.map +1 -0
  70. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.d.ts +5 -0
  71. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js +3 -0
  72. package/lib-esm/inAppMessaging/providers/pinpoint/types/options.js.map +1 -0
  73. package/lib-esm/inAppMessaging/types/config.d.ts +5 -0
  74. package/lib-esm/inAppMessaging/types/config.js +1 -0
  75. package/lib-esm/inAppMessaging/types/config.js.map +1 -0
  76. package/lib-esm/inAppMessaging/types/event.d.ts +6 -0
  77. package/lib-esm/inAppMessaging/types/event.js +3 -0
  78. package/lib-esm/inAppMessaging/types/event.js.map +1 -0
  79. package/lib-esm/inAppMessaging/types/index.d.ts +5 -0
  80. package/lib-esm/inAppMessaging/types/index.js +3 -0
  81. package/lib-esm/inAppMessaging/types/index.js.map +1 -0
  82. package/lib-esm/inAppMessaging/types/inputs.d.ts +21 -0
  83. package/lib-esm/inAppMessaging/types/inputs.js +3 -0
  84. package/lib-esm/inAppMessaging/types/inputs.js.map +1 -0
  85. package/lib-esm/inAppMessaging/types/message.d.ts +44 -0
  86. package/lib-esm/inAppMessaging/types/message.js +3 -0
  87. package/lib-esm/inAppMessaging/types/message.js.map +1 -0
  88. package/lib-esm/inAppMessaging/types/options.d.ts +4 -0
  89. package/lib-esm/inAppMessaging/types/options.js +3 -0
  90. package/lib-esm/inAppMessaging/types/options.js.map +1 -0
  91. package/lib-esm/index.d.ts +1 -2
  92. package/lib-esm/index.js +0 -1
  93. package/lib-esm/index.js.map +1 -1
  94. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js +4 -4
  95. package/lib-esm/pushNotifications/providers/AWSPinpointProvider/index.js.map +1 -1
  96. package/lib-esm/pushNotifications/types.d.ts +3 -9
  97. package/package.json +4 -4
  98. package/src/common/AWSPinpointProviderCommon/index.ts +3 -3
  99. package/src/common/AWSPinpointProviderCommon/types.ts +2 -2
  100. package/src/inAppMessaging/index.ts +0 -13
  101. package/src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts +90 -7
  102. package/src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts +2 -6
  103. package/src/inAppMessaging/providers/pinpoint/types/errors.ts +12 -0
  104. package/src/inAppMessaging/providers/pinpoint/types/index.ts +6 -0
  105. package/src/inAppMessaging/providers/pinpoint/types/inputs.ts +11 -0
  106. package/src/inAppMessaging/providers/pinpoint/types/options.ts +9 -0
  107. package/src/inAppMessaging/types/config.ts +8 -0
  108. package/src/inAppMessaging/types/event.ts +14 -0
  109. package/src/inAppMessaging/types/index.ts +8 -0
  110. package/src/inAppMessaging/types/inputs.ts +29 -0
  111. package/src/inAppMessaging/types/message.ts +62 -0
  112. package/src/inAppMessaging/types/options.ts +7 -0
  113. package/src/index.ts +1 -14
  114. package/src/pushNotifications/providers/AWSPinpointProvider/index.ts +13 -20
  115. package/src/pushNotifications/types.ts +8 -9
  116. package/lib/inAppMessaging/providers/pinpoint/utils/utils.d.ts +0 -17
  117. package/lib/inAppMessaging/providers/pinpoint/utils/utils.js +0 -243
  118. package/lib/inAppMessaging/providers/pinpoint/utils/utils.js.map +0 -1
  119. package/lib/inAppMessaging/types.d.ts +0 -87
  120. package/lib/inAppMessaging/types.js +0 -12
  121. package/lib/inAppMessaging/types.js.map +0 -1
  122. package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.d.ts +0 -17
  123. package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.js +0 -241
  124. package/lib-esm/inAppMessaging/providers/pinpoint/utils/utils.js.map +0 -1
  125. package/lib-esm/inAppMessaging/types.d.ts +0 -87
  126. package/lib-esm/inAppMessaging/types.js +0 -10
  127. package/lib-esm/inAppMessaging/types.js.map +0 -1
  128. package/src/inAppMessaging/providers/pinpoint/utils/utils.ts +0 -304
  129. package/src/inAppMessaging/types.ts +0 -142
@@ -1,7 +1,7 @@
1
1
  import { ConsoleLogger } from '@aws-amplify/core/internals/utils';
2
2
  import { Event as AWSPinpointAnalyticsEvent } from '@aws-amplify/core/internals/aws-clients/pinpoint';
3
3
  import { NotificationsCategory, NotificationsSubCategory, NotificationsProvider, UserInfo } from '../../types';
4
- import { AWSPinpointUserInfo } from './types';
4
+ import { PinpointUserInfo } from './types';
5
5
  export default abstract class AWSPinpointProviderCommon implements NotificationsProvider {
6
6
  static category: NotificationsCategory;
7
7
  static providerName: string;
@@ -28,7 +28,7 @@ export default abstract class AWSPinpointProviderCommon implements Notifications
28
28
  protected init: () => Promise<void>;
29
29
  private getUserAgentValue;
30
30
  protected recordAnalyticsEvent: (event: AWSPinpointAnalyticsEvent) => Promise<void>;
31
- protected updateEndpoint: (userId?: string, userInfo?: AWSPinpointUserInfo) => Promise<void>;
31
+ protected updateEndpoint: (userId?: string, userInfo?: PinpointUserInfo) => Promise<void>;
32
32
  private getEndpointId;
33
33
  private getCredentials;
34
34
  private assertNotEmptyConfiguration;
@@ -80,7 +80,7 @@ var AWSPinpointProviderCommon = /** @class */ (function () {
80
80
  else {
81
81
  customUserAgentDetails = {
82
82
  category: Category.InAppMessaging,
83
- action: InAppMessagingAction.None,
83
+ action: InAppMessagingAction.IdentifyUser,
84
84
  };
85
85
  }
86
86
  return getAmplifyUserAgent(customUserAgentDetails);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/AWSPinpointProviderCommon/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EACN,QAAQ,EACR,YAAY,EAGZ,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAEN,SAAS,EAET,cAAc,GAEd,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAUlC;IAYC,mCAAY,MAAM;QAAlB,iBAIC;;QATS,WAAM,GAAwB,EAAE,CAAC;QACjC,wBAAmB,GAAG,KAAK,CAAC;QAC5B,gBAAW,GAAG,KAAK,CAAC;QAqC9B,iBAAY,GAAG,UAAO,MAAc,EAAE,QAAkB;;;;;6BACnD,CAAC,IAAI,CAAC,WAAW,EAAjB,wBAAiB;wBACpB,qBAAM,IAAI,CAAC,IAAI,EAAE,EAAA;;wBAAjB,SAAiB,CAAC;;;;wBAGlB,qBAAM,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAA;;wBAA3C,SAA2C,CAAC;;;;wBAE5C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAG,CAAC,CAAC;wBACjD,MAAM,KAAG,CAAC;;;;aAEX,CAAC;QAEQ,SAAI,GAAG;;;;;wBACV,KAA0B,IAAI,CAAC,MAAM,EAAnC,UAAU,gBAAA,EAAE,OAAO,aAAA,CAAiB;wBACtC,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;;;;6BAGvC,CAAA,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU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AA,AAjRD,IAiRC;eAjR6B,yBAAyB"}
@@ -1,9 +1,9 @@
1
1
  import { UserInfo } from '../../types';
2
- export interface AWSPinpointProviderConfig {
2
+ export interface PinpointProviderConfig {
3
3
  appId: string;
4
4
  region: string;
5
5
  }
6
- export interface AWSPinpointUserInfo extends UserInfo {
6
+ export interface PinpointUserInfo extends UserInfo {
7
7
  address?: string;
8
8
  optOut?: 'ALL' | 'NONE';
9
9
  }
@@ -1,2 +1 @@
1
1
  export { identifyUser, syncMessages } from './providers/pinpoint';
2
- export { InAppMessage, InAppMessageAction, InAppMessageButton, InAppMessageContent, InAppMessageImage, InAppMessageInteractionEvent, InAppMessageLayout, InAppMessageStyle, InAppMessageTextAlign, InAppMessagingConfig, InAppMessagingEvent, } from './types';
@@ -1,5 +1,4 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { identifyUser, syncMessages } from './providers/pinpoint';
4
- export { InAppMessageInteractionEvent, } from './types';
5
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inAppMessaging/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAMN,4BAA4B,GAM5B,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inAppMessaging/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,2 +1,55 @@
1
- import { UserInfo } from '../../../../types';
2
- export declare function identifyUser(userId: string, userInfo: UserInfo): Promise<void>;
1
+ /**
2
+ * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
3
+ * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
4
+ * the same `userId`.
5
+ *
6
+ * @param {IdentifyUserParameters} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
7
+ * API.
8
+ *
9
+ * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
10
+ * @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown when the provided parameters or library
11
+ * configuration is incorrect.
12
+ *
13
+ * @returns A promise that will resolve when the operation is complete.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // Identify a user with Pinpoint
18
+ * await identifyUser({
19
+ * userId,
20
+ * userProfile: {
21
+ * email: 'userEmail@example.com'
22
+ * customProperties: {
23
+ * phoneNumber: ['555-555-5555'],
24
+ * },
25
+ * }
26
+ * });
27
+ * ```
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * // Identify a user with Pinpoint specific options
32
+ * await identifyUser({
33
+ * userId,
34
+ * userProfile: {
35
+ * email: 'userEmail@example.com'
36
+ * customProperties: {
37
+ * phoneNumber: ['555-555-5555'],
38
+ * },
39
+ * demographic: {
40
+ * platform: 'ios',
41
+ * timezone: 'America/Los_Angeles'
42
+ * }
43
+ * },
44
+ * options: {
45
+ * serviceOptions: {
46
+ * address: 'device-address',
47
+ * optOut: 'NONE',
48
+ * userAttributes: {
49
+ * interests: ['food']
50
+ * },
51
+ * },
52
+ * },
53
+ * });
54
+ */
55
+ export declare const identifyUser: ({ userId, userProfile, options, }: import("../../../types").InAppMessagingIdentifyUserInput<import("@aws-amplify/core/lib-esm/providers/pinpoint").PinpointServiceOptions>) => Promise<void>;
@@ -1,6 +1,92 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export function identifyUser(userId, userInfo) {
4
- throw new Error('WIP');
5
- }
3
+ import { __awaiter, __generator } from "tslib";
4
+ import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
5
+ import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
6
+ import { CATEGORY, CHANNEL_TYPE, getInAppMessagingUserAgentString, resolveConfig, resolveCredentials, } from '../utils';
7
+ /**
8
+ * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
9
+ * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
10
+ * the same `userId`.
11
+ *
12
+ * @param {IdentifyUserParameters} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
13
+ * API.
14
+ *
15
+ * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
16
+ * @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown when the provided parameters or library
17
+ * configuration is incorrect.
18
+ *
19
+ * @returns A promise that will resolve when the operation is complete.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * // Identify a user with Pinpoint
24
+ * await identifyUser({
25
+ * userId,
26
+ * userProfile: {
27
+ * email: 'userEmail@example.com'
28
+ * customProperties: {
29
+ * phoneNumber: ['555-555-5555'],
30
+ * },
31
+ * }
32
+ * });
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Identify a user with Pinpoint specific options
38
+ * await identifyUser({
39
+ * userId,
40
+ * userProfile: {
41
+ * email: 'userEmail@example.com'
42
+ * customProperties: {
43
+ * phoneNumber: ['555-555-5555'],
44
+ * },
45
+ * demographic: {
46
+ * platform: 'ios',
47
+ * timezone: 'America/Los_Angeles'
48
+ * }
49
+ * },
50
+ * options: {
51
+ * serviceOptions: {
52
+ * address: 'device-address',
53
+ * optOut: 'NONE',
54
+ * userAttributes: {
55
+ * interests: ['food']
56
+ * },
57
+ * },
58
+ * },
59
+ * });
60
+ */
61
+ export var identifyUser = function (_a) {
62
+ var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
63
+ return __awaiter(void 0, void 0, void 0, function () {
64
+ var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
65
+ var _e;
66
+ return __generator(this, function (_f) {
67
+ switch (_f.label) {
68
+ case 0: return [4 /*yield*/, resolveCredentials()];
69
+ case 1:
70
+ _b = _f.sent(), credentials = _b.credentials, identityId = _b.identityId;
71
+ _c = resolveConfig(), appId = _c.appId, region = _c.region;
72
+ _d = (_e = options === null || options === void 0 ? void 0 : options.serviceOptions) !== null && _e !== void 0 ? _e : {}, address = _d.address, optOut = _d.optOut, userAttributes = _d.userAttributes;
73
+ updateEndpoint({
74
+ address: address,
75
+ channelType: CHANNEL_TYPE,
76
+ optOut: optOut,
77
+ appId: appId,
78
+ category: CATEGORY,
79
+ credentials: credentials,
80
+ identityId: identityId,
81
+ region: region,
82
+ userAttributes: userAttributes,
83
+ userId: userId,
84
+ userProfile: userProfile,
85
+ userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.IdentifyUser),
86
+ });
87
+ return [2 /*return*/];
88
+ }
89
+ });
90
+ });
91
+ };
6
92
  //# sourceMappingURL=identifyUser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identifyUser.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,MAAM,UAAU,YAAY,CAC3B,MAAc,EACd,QAAkB;IAElB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
1
+ {"version":3,"file":"identifyUser.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAEhF,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,gCAAgC,EAChC,aAAa,EACb,kBAAkB,GAClB,MAAM,UAAU,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,CAAC,IAAM,YAAY,GAAG,UAAO,EAIf;QAHnB,kBAAM,EACN,4BAAW,EACX,oBAAO;;;;;;wBAE6B,qBAAM,kBAAkB,EAAE,EAAA;;oBAAxD,KAA8B,SAA0B,EAAtD,WAAW,iBAAA,EAAE,UAAU,gBAAA;oBACzB,KAAoB,aAAa,EAAE,EAAjC,KAAK,WAAA,EAAE,MAAM,YAAA,CAAqB;oBACpC,WAAsC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,mCAAI,EAAE,EAAjE,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,cAAc,oBAAA,CAAmC;oBAC1E,cAAc,CAAC;wBACd,OAAO,SAAA;wBACP,WAAW,EAAE,YAAY;wBACzB,MAAM,QAAA;wBACN,KAAK,OAAA;wBACL,QAAQ,EAAE,QAAQ;wBAClB,WAAW,aAAA;wBACX,UAAU,YAAA;wBACV,MAAM,QAAA;wBACN,cAAc,gBAAA;wBACd,MAAM,QAAA;wBACN,WAAW,aAAA;wBACX,cAAc,EAAE,gCAAgC,CAC/C,oBAAoB,CAAC,YAAY,CACjC;qBACD,CAAC,CAAC;;;;;CACH,CAAC"}
@@ -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 { __awaiter, __generator } from "tslib";
4
- import { InAppMessagingAction, } from '@aws-amplify/core/internals/utils';
4
+ import { InAppMessagingAction } from '@aws-amplify/core/internals/utils';
5
5
  import { updateEndpoint, getEndpointId, } from '@aws-amplify/core/internals/providers/pinpoint';
6
6
  import { defaultStorage } from '@aws-amplify/core';
7
7
  import { resolveConfig, resolveCredentials, getInAppMessagingUserAgentString, STORAGE_KEY_SUFFIX, PINPOINT_KEY_PREFIX, CATEGORY, CHANNEL_TYPE, } from '../utils';
@@ -74,8 +74,7 @@ function fetchInAppMessages() {
74
74
  credentials: credentials,
75
75
  identityId: identityId,
76
76
  region: region,
77
- // TODO(V6): Update InAppMessagingAction.None
78
- userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.None),
77
+ userAgentValue: getInAppMessagingUserAgentString(InAppMessagingAction.SyncMessages),
79
78
  })];
80
79
  case 3:
81
80
  _c.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"syncMessages.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/apis/syncMessages.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EACN,oBAAoB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,cAAc,EACd,aAAa,GACb,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACN,aAAa,EACb,kBAAkB,EAClB,gCAAgC,EAChC,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,YAAY,GACZ,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,gBAAgB,GAGhB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACN,iCAAiC,EACjC,kBAAkB,EAClB,qBAAqB,GACrB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAgB,YAAY;;;;;wBAChB,qBAAM,kBAAkB,EAAE,EAAA;;oBAArC,QAAQ,GAAG,SAA0B;oBAC3C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;wBAC1B,sBAAO;qBACP;;;;oBAEM,GAAG,GAAG,KAAG,mBAAmB,GAAG,kBAAoB,CAAC;oBAC1D,qBAAM,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAA;;oBAA3D,SAA2D,CAAC;;;;oBAE5D,kBAAkB,CAAC,OAAK,CAAC,CAAC;oBAC1B,MAAM,OAAK,CAAC;;;;;CAEb;AAED,SAAe,kBAAkB;;;;;;;oBAEK,qBAAM,kBAAkB,EAAE,EAAA;;oB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,EAAE,QAAQ;4BAClB,WAAW,EAAE,YAAY;4BACzB,WAAW,aAAA;4BACX,UAAU,YAAA;4BACV,MAAM,QAAA;4BACN,cAAc,EAAE,gCAAgC,CAC/C,oBAAoB,CAAC,YAAY,CACjC;yBACD,CAAC,EAAA;;oBAVF,SAUE,CAAC;oBAEU,qBAAM,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAA;;oBAAjD,UAAU,GAAG,SAAoC,CAAC;;;oBAGnD,qBAAqB,CACpB,CAAC,CAAC,UAAU,EACZ,iCAAiC,CAAC,YAAY,CAC9C,CAAC;oBAEI,KAAK,GAA0B;wBACpC,aAAa,EAAE,KAAK;wBACpB,UAAU,EAAE,UAAU;qBACtB,CAAC;oBACuC,qBAAM,gBAAgB,CAC9D,EAAE,WAAW,aAAA,EAAE,MAAM,QAAA,EAAE,EACvB,KAAK,CACL,EAAA;;oBAHK,QAAQ,GAA2B,SAGxC;oBAC8B,QAAQ,GAAK,QAAQ,CAAC,qBAAqB,sBAAnC,CAAoC;oBAC3E,sBAAO,QAAQ,EAAC;;;oBAEhB,kBAAkB,CAAC,OAAK,CAAC,CAAC;oBAC1B,MAAM,OAAK,CAAC;;;;;CAEb"}
@@ -0,0 +1,9 @@
1
+ export declare enum UpdateEndpointException {
2
+ BadRequestException = "BadRequestException",
3
+ ForbiddenException = "ForbiddenException",
4
+ InternalServerErrorException = "InternalServerErrorException",
5
+ MethodNotAllowedException = "MethodNotAllowedException",
6
+ NotFoundException = "NotFoundException",
7
+ PayloadTooLargeException = "PayloadTooLargeException",
8
+ TooManyRequestsException = "TooManyRequestsException"
9
+ }
@@ -0,0 +1,13 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export var UpdateEndpointException;
4
+ (function (UpdateEndpointException) {
5
+ UpdateEndpointException["BadRequestException"] = "BadRequestException";
6
+ UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
7
+ UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
8
+ UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
9
+ UpdateEndpointException["NotFoundException"] = "NotFoundException";
10
+ UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
11
+ UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
12
+ })(UpdateEndpointException || (UpdateEndpointException = {}));
13
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/types/errors.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,MAAM,CAAN,IAAY,uBAQX;AARD,WAAY,uBAAuB;IAClC,sEAA2C,CAAA;IAC3C,oEAAyC,CAAA;IACzC,wFAA6D,CAAA;IAC7D,kFAAuD,CAAA;IACvD,kEAAuC,CAAA;IACvC,gFAAqD,CAAA;IACrD,gFAAqD,CAAA;AACtD,CAAC,EARW,uBAAuB,KAAvB,uBAAuB,QAQlC"}
@@ -0,0 +1,3 @@
1
+ export { UpdateEndpointException } from './errors';
2
+ export { IdentifyUserInput } from './inputs';
3
+ export { IdentifyUserOptions } from './options';
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { UpdateEndpointException } from './errors';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { IdentifyUserOptions } from '.';
2
+ import { InAppMessagingIdentifyUserInput } from '../../../types';
3
+ /**
4
+ * Input type for Pinpoint identifyUser API.
5
+ */
6
+ export declare type IdentifyUserInput = InAppMessagingIdentifyUserInput<IdentifyUserOptions>;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/types/inputs.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,5 @@
1
+ import { PinpointServiceOptions } from '@aws-amplify/core/internals/providers/pinpoint';
2
+ /**
3
+ * Options specific to Pinpoint identityUser.
4
+ */
5
+ export declare type IdentifyUserOptions = PinpointServiceOptions;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/types/options.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,5 @@
1
+ import { PinpointProviderConfig } from '../../common/AWSPinpointProviderCommon/types';
2
+ export interface InAppMessagingConfig {
3
+ listenForAnalyticsEvents?: boolean;
4
+ AWSPinpoint?: PinpointProviderConfig;
5
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export declare type InAppMessageInteractionEvent = 'messageReceived' | 'messageDisplayed' | 'messageDismissed' | 'messageActionTaken';
2
+ export declare type InAppMessagingEvent = {
3
+ name: string;
4
+ attributes?: Record<string, string>;
5
+ metrics?: Record<string, number>;
6
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/event.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,5 @@
1
+ export { InAppMessagingServiceOptions } from './options';
2
+ export { InAppMessagingIdentifyUserInput } from './inputs';
3
+ export { InAppMessagingConfig } from './config';
4
+ export { InAppMessageInteractionEvent, InAppMessagingEvent } from './event';
5
+ export { InAppMessage } from './message';
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,21 @@
1
+ import { UserProfile } from '@aws-amplify/core';
2
+ import { InAppMessagingServiceOptions } from '.';
3
+ /**
4
+ * Input type for `identifyUser`.
5
+ */
6
+ export declare type InAppMessagingIdentifyUserInput<ServiceOptions extends InAppMessagingServiceOptions = InAppMessagingServiceOptions> = {
7
+ /**
8
+ * A User ID associated to the current device.
9
+ */
10
+ userId: string;
11
+ /**
12
+ * Additional information about the user and their device.
13
+ */
14
+ userProfile: UserProfile;
15
+ /**
16
+ * Options to be passed to the API.
17
+ */
18
+ options?: {
19
+ serviceOptions?: ServiceOptions;
20
+ };
21
+ };
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=inputs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputs.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/inputs.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,44 @@
1
+ export declare type InAppMessageLayout = 'BOTTOM_BANNER' | 'CAROUSEL' | 'FULL_SCREEN' | 'MIDDLE_BANNER' | 'MODAL' | 'TOP_BANNER';
2
+ export declare type InAppMessageAction = 'CLOSE' | 'DEEP_LINK' | 'LINK';
3
+ export declare type InAppMessageTextAlign = 'center' | 'left' | 'right';
4
+ interface InAppMessageContainer {
5
+ style?: InAppMessageStyle;
6
+ }
7
+ interface InAppMessageHeader {
8
+ content: string;
9
+ style?: InAppMessageStyle;
10
+ }
11
+ interface InAppMessageBody {
12
+ content: string;
13
+ style?: InAppMessageStyle;
14
+ }
15
+ export interface InAppMessageImage {
16
+ src: string;
17
+ }
18
+ export interface InAppMessageButton {
19
+ title: string;
20
+ action: InAppMessageAction;
21
+ url?: string;
22
+ style?: InAppMessageStyle;
23
+ }
24
+ export interface InAppMessageStyle {
25
+ backgroundColor?: string;
26
+ borderRadius?: number;
27
+ color?: string;
28
+ textAlign?: InAppMessageTextAlign;
29
+ }
30
+ export interface InAppMessageContent {
31
+ container?: InAppMessageContainer;
32
+ header?: InAppMessageHeader;
33
+ body?: InAppMessageBody;
34
+ image?: InAppMessageImage;
35
+ primaryButton?: InAppMessageButton;
36
+ secondaryButton?: InAppMessageButton;
37
+ }
38
+ export interface InAppMessage {
39
+ id: string;
40
+ layout: InAppMessageLayout;
41
+ content: InAppMessageContent[];
42
+ metadata?: any;
43
+ }
44
+ export {};
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/message.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Base type for service options.
3
+ */
4
+ export declare type InAppMessagingServiceOptions = any;
@@ -0,0 +1,3 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/inAppMessaging/types/options.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
@@ -1,5 +1,4 @@
1
1
  export { AWSPinpointProviderCommon } from './common';
2
- export { AWSPinpointUserInfo } from './common/AWSPinpointProviderCommon/types';
3
- export { InAppMessage, InAppMessageAction, InAppMessageButton, InAppMessageContent, InAppMessageImage, InAppMessageInteractionEvent, InAppMessageLayout, InAppMessageStyle, InAppMessageTextAlign, InAppMessagingConfig, InAppMessagingEvent, } from './inAppMessaging';
2
+ export { PinpointUserInfo } from './common/AWSPinpointProviderCommon/types';
4
3
  export { PushNotificationMessage, PushNotificationPermissions, PushNotificationPermissionStatus, } from './pushNotifications/types';
5
4
  export { NotificationsConfig, UserInfo } from './types';
package/lib-esm/index.js CHANGED
@@ -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
3
  export { AWSPinpointProviderCommon } from './common';
4
- export { InAppMessageInteractionEvent, } from './inAppMessaging';
5
4
  export { PushNotificationPermissionStatus, } from './pushNotifications/types';
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAMN,4BAA4B,GAM5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGN,gCAAgC,GAChC,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAGN,gCAAgC,GAChC,MAAM,2BAA2B,CAAC"}
@@ -15,18 +15,18 @@ var AWSPinpointProvider = /** @class */ (function (_super) {
15
15
  // some configuration steps should not be re-run even if provider is re-configured for some reason
16
16
  if (!_this.configured) {
17
17
  // wire up default Pinpoint message event handling
18
- addEventListener(0 /* BACKGROUND_MESSAGE_RECEIVED */, function (message) {
18
+ addEventListener('backgroundMessageReceived', function (message) {
19
19
  return _this.recordMessageEvent(message, AWSPinpointMessageEvent.BACKGROUND_MESSAGE_RECEIVED);
20
20
  });
21
- addEventListener(1 /* FOREGROUND_MESSAGE_RECEIVED */, function (message) {
21
+ addEventListener('foregroundMessageReceived', function (message) {
22
22
  return _this.recordMessageEvent(message, AWSPinpointMessageEvent.FOREGROUND_MESSAGE_RECEIVED);
23
23
  });
24
- var launchNotificationOpenedListener_1 = addEventListener(2 /* LAUNCH_NOTIFICATION_OPENED */, function (message) {
24
+ var launchNotificationOpenedListener_1 = addEventListener('launchNotificationsOpened', function (message) {
25
25
  _this.recordMessageEvent(message, AWSPinpointMessageEvent.NOTIFICATION_OPENED);
26
26
  // once we are done with it we can remove the listener
27
27
  launchNotificationOpenedListener_1 === null || launchNotificationOpenedListener_1 === void 0 ? void 0 : launchNotificationOpenedListener_1.remove();
28
28
  });
29
- addEventListener(3 /* NOTIFICATION_OPENED */, function (message) {
29
+ addEventListener('notificationOpened', function (message) {
30
30
  _this.recordMessageEvent(message, AWSPinpointMessageEvent.NOTIFICATION_OPENED);
31
31
  // if we are in this state, we no longer need the listener as the app was launched via some other means
32
32
  launchNotificationOpenedListener_1 === null || launchNotificationOpenedListener_1 === void 0 ? void 0 : launchNotificationOpenedListener_1.remove();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pushNotifications/providers/AWSPinpointProvider/index.ts"],"names":[],"m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,kCAAgC,uBAAhC,kCAAgC,CAAE,MAAM,GAAG;gBAC5C,CAAC,CAAC,CAAC;aACH;YAED,KAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,OAAO,KAAI,CAAC,MAAM,CAAC;QACpB,CAAC,CAAC;QAEF,oBAAc,GAAG,UAAO,OAAe;;gBACtC,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;;aACvB,CAAC;QAEM,oBAAc,GAAG;YACxB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC,CAAC;QAEM,wBAAkB,GAAG,UAC5B,OAAgC,EAChC,KAA8B;;gBAE9B,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;;aACvB,CAAC;;IAxEF,CAAC;IAED;;OAEG;IACH,4CAAc,GAAd;QACC,OAAO,mBAAmB,CAAC,WAAW,CAAC;IACxC,CAAC;IAbM,+BAAW,GAA6B,kBAAkB,CAAC;IA+EnE,0BAAC;CAAA,AAnFD,CACS,yBAAyB,GAkFjC;eAnFoB,mBAAmB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pushNotifications/providers/AWSPinpointProvider/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAO9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC;IACS,uCAAyB;IAOjC;QAAA,YACC,kBAAM,MAAM,CAAC,SACb;QAJO,gBAAU,GAAG,KAAK,CAAC;QAa3B,eAAS,GAAG,UAAC,MAAW;YAAX,uBAAA,EAAA,WAAW;YACvB,KAAI,CAAC,MAAM,yBACP,iBAAM,SAAS,aAAC,MAAM,CAAC,KAC1B,YAAY,EAAE,EAAE,WAAW,EAAE,KAAI,CAAC,cAAc,EAAE,EAAE,G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AAC,KAAK,CAAC,CAAC;;aACvB,CAAC;;IApEF,CAAC;IAED;;OAEG;IACH,4CAAc,GAAd;QACC,OAAO,mBAAmB,CAAC,WAAW,CAAC;IACxC,CAAC;IAbM,+BAAW,GAA6B,kBAAkB,CAAC;IA2EnE,0BAAC;CAAA,AA/ED,CACS,yBAAyB,GA8EjC;eA/EoB,mBAAmB"}
@@ -1,5 +1,5 @@
1
1
  import { EventListener } from '../common';
2
- import { AWSPinpointProviderConfig } from '../common/AWSPinpointProviderCommon/types';
2
+ import { PinpointProviderConfig } from '../common/AWSPinpointProviderCommon/types';
3
3
  import { NotificationsProvider, NotificationsSubCategory as NotificationsSubCategories, UserInfo } from '../types';
4
4
  export declare type NotificationsSubCategory = Extract<NotificationsSubCategories, 'PushNotification'>;
5
5
  export interface PushNotificationInterface {
@@ -25,7 +25,7 @@ export interface PushNotificationProvider extends NotificationsProvider {
25
25
  registerDevice(token: string): Promise<void>;
26
26
  }
27
27
  export interface PushNotificationConfig {
28
- AWSPinpoint?: AWSPinpointProviderConfig;
28
+ Pinpoint?: PinpointProviderConfig;
29
29
  }
30
30
  export interface PushNotificationMessage {
31
31
  title?: string;
@@ -59,13 +59,7 @@ export declare enum PushNotificationPermissionStatus {
59
59
  }
60
60
  export declare type OnTokenReceivedHandler = (token: string) => any;
61
61
  export declare type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => any;
62
- export declare const enum PushNotificationEvent {
63
- BACKGROUND_MESSAGE_RECEIVED = 0,
64
- FOREGROUND_MESSAGE_RECEIVED = 1,
65
- LAUNCH_NOTIFICATION_OPENED = 2,
66
- NOTIFICATION_OPENED = 3,
67
- TOKEN_RECEIVED = 4
68
- }
62
+ export declare type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationsOpened' | 'notificationOpened' | 'tokenReceived';
69
63
  export interface NormalizedValues {
70
64
  body?: string;
71
65
  imageUrl?: string;