@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;
@@ -82,7 +82,7 @@ var AWSPinpointProviderCommon = /** @class */ (function () {
82
82
  else {
83
83
  customUserAgentDetails = {
84
84
  category: utils_1.Category.InAppMessaging,
85
- action: utils_1.InAppMessagingAction.None,
85
+ action: utils_1.InAppMessagingAction.IdentifyUser,
86
86
  };
87
87
  }
88
88
  return utils_1.getAmplifyUserAgent(customUserAgentDetails);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/AWSPinpointProviderCommon/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,2DAQ2C;AAC3C,0CAA4D;AAE5D,6EAM0D;AAC1D,6BAAkC;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,CAAA,EAAlC,wBAAkC;wBACrC,qBAAM,OAAO,CAAC,IAAI,EAAE,EAAA;;wBAApB,SAAoB,CAAC;;;6BAGlB,CAAC,UAAU,EAAX,wBAAW;wBACd,KAAA,IAAI,CAAC,MAAM,CAAA;wBAAc,qBAAM,IAAI,CAAC,aAAa,EAAE,EAAA;;w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C,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;iBAC5D;aACD;YACD,OAAO,GAAG,CAAC;QACZ,CAAC,CAAC;QAnQD,+DAA+D;QAC/D,IAAI,CAAC,UAAU,SAAG,oBAAY,CAAC,UAAU,EAAE,mCAAI,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,+CAAW,GAAX;QACC,OAAO,yBAAyB,CAAC,QAAQ,CAAC;IAC3C,CAAC;IAOD;;OAEG;IACH,mDAAe,GAAf;QACC,OAAO,yBAAyB,CAAC,YAAY,CAAC;IAC/C,CAAC;IAED,6CAAS,GAAT,UAAU,MAAW;QAAX,uBAAA,EAAA,WAAW;QACpB,IAAI,CAAC,MAAM,yCAAQ,IAAI,CAAC,MAAM,GAAK,MAAM,CAAE,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,eAAa,IAAI,CAAC,eAAe,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,aAAU,EACrE,IAAI,CAAC,MAAM,CACX,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAzCM,kCAAQ,GAA0B,eAAe,CAAC;IAClD,sCAAY,GAAG,aAAa,CAAC;IA6QrC,gCAAC;CAAA,AAjRD,IAiRC;kBAjR6B,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';
@@ -5,6 +5,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  var pinpoint_1 = require("./providers/pinpoint");
6
6
  exports.identifyUser = pinpoint_1.identifyUser;
7
7
  exports.syncMessages = pinpoint_1.syncMessages;
8
- var types_1 = require("./types");
9
- exports.InAppMessageInteractionEvent = types_1.InAppMessageInteractionEvent;
10
8
  //# 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,iDAAkE;AAAzD,kCAAA,YAAY,CAAA;AAAE,kCAAA,YAAY,CAAA;AACnC,iCAYiB;AANhB,+CAAA,4BAA4B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inAppMessaging/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,iDAAkE;AAAzD,kCAAA,YAAY,CAAA;AAAE,kCAAA,YAAY,CAAA"}
@@ -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>;
@@ -2,8 +2,93 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- function identifyUser(userId, userInfo) {
6
- throw new Error('WIP');
7
- }
8
- exports.identifyUser = identifyUser;
5
+ var tslib_1 = require("tslib");
6
+ var utils_1 = require("@aws-amplify/core/internals/utils");
7
+ var pinpoint_1 = require("@aws-amplify/core/internals/providers/pinpoint");
8
+ var utils_2 = require("../utils");
9
+ /**
10
+ * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
11
+ * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
12
+ * the same `userId`.
13
+ *
14
+ * @param {IdentifyUserParameters} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
15
+ * API.
16
+ *
17
+ * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.
18
+ * @throws validation: {@link InAppMessagingValidationErrorCode} - Thrown when the provided parameters or library
19
+ * configuration is incorrect.
20
+ *
21
+ * @returns A promise that will resolve when the operation is complete.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * // Identify a user with Pinpoint
26
+ * await identifyUser({
27
+ * userId,
28
+ * userProfile: {
29
+ * email: 'userEmail@example.com'
30
+ * customProperties: {
31
+ * phoneNumber: ['555-555-5555'],
32
+ * },
33
+ * }
34
+ * });
35
+ * ```
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * // Identify a user with Pinpoint specific options
40
+ * await identifyUser({
41
+ * userId,
42
+ * userProfile: {
43
+ * email: 'userEmail@example.com'
44
+ * customProperties: {
45
+ * phoneNumber: ['555-555-5555'],
46
+ * },
47
+ * demographic: {
48
+ * platform: 'ios',
49
+ * timezone: 'America/Los_Angeles'
50
+ * }
51
+ * },
52
+ * options: {
53
+ * serviceOptions: {
54
+ * address: 'device-address',
55
+ * optOut: 'NONE',
56
+ * userAttributes: {
57
+ * interests: ['food']
58
+ * },
59
+ * },
60
+ * },
61
+ * });
62
+ */
63
+ exports.identifyUser = function (_a) {
64
+ var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
65
+ return tslib_1.__awaiter(void 0, void 0, void 0, function () {
66
+ var _b, credentials, identityId, _c, appId, region, _d, address, optOut, userAttributes;
67
+ var _e;
68
+ return tslib_1.__generator(this, function (_f) {
69
+ switch (_f.label) {
70
+ case 0: return [4 /*yield*/, utils_2.resolveCredentials()];
71
+ case 1:
72
+ _b = _f.sent(), credentials = _b.credentials, identityId = _b.identityId;
73
+ _c = utils_2.resolveConfig(), appId = _c.appId, region = _c.region;
74
+ _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;
75
+ pinpoint_1.updateEndpoint({
76
+ address: address,
77
+ channelType: utils_2.CHANNEL_TYPE,
78
+ optOut: optOut,
79
+ appId: appId,
80
+ category: utils_2.CATEGORY,
81
+ credentials: credentials,
82
+ identityId: identityId,
83
+ region: region,
84
+ userAttributes: userAttributes,
85
+ userId: userId,
86
+ userProfile: userProfile,
87
+ userAgentValue: utils_2.getInAppMessagingUserAgentString(utils_1.InAppMessagingAction.IdentifyUser),
88
+ });
89
+ return [2 /*return*/];
90
+ }
91
+ });
92
+ });
93
+ };
9
94
  //# 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,SAAgB,YAAY,CAC3B,MAAc,EACd,QAAkB;IAElB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AALD,oCAKC"}
1
+ {"version":3,"file":"identifyUser.js","sourceRoot":"","sources":["../../../../../src/inAppMessaging/providers/pinpoint/apis/identifyUser.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,2DAAyE;AACzE,2EAAgF;AAEhF,kCAMkB;AAGlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACU,QAAA,YAAY,GAAG,UAAO,EAIf;QAHnB,kBAAM,EACN,4BAAW,EACX,oBAAO;;;;;;wBAE6B,qBAAM,0BAAkB,EAAE,EAAA;;oBAAxD,KAA8B,SAA0B,EAAtD,WAAW,iBAAA,EAAE,UAAU,gBAAA;oBACzB,KAAoB,qBAAa,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,yBAAc,CAAC;wBACd,OAAO,SAAA;wBACP,WAAW,EAAE,oBAAY;wBACzB,MAAM,QAAA;wBACN,KAAK,OAAA;wBACL,QAAQ,EAAE,gBAAQ;wBAClB,WAAW,aAAA;wBACX,UAAU,YAAA;wBACV,MAAM,QAAA;wBACN,cAAc,gBAAA;wBACd,MAAM,QAAA;wBACN,WAAW,aAAA;wBACX,cAAc,EAAE,wCAAgC,CAC/C,4BAAoB,CAAC,YAAY,CACjC;qBACD,CAAC,CAAC;;;;;CACH,CAAC"}
@@ -77,8 +77,7 @@ function fetchInAppMessages() {
77
77
  credentials: credentials,
78
78
  identityId: identityId,
79
79
  region: region,
80
- // TODO(V6): Update InAppMessagingAction.None
81
- userAgentValue: utils_2.getInAppMessagingUserAgentString(utils_1.InAppMessagingAction.None),
80
+ userAgentValue: utils_2.getInAppMessagingUserAgentString(utils_1.InAppMessagingAction.SyncMessages),
82
81
  })];
83
82
  case 3:
84
83
  _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,2DAG2C;AAC3C,2EAGwD;AACxD,0CAAmD;AACnD,kCAQkB;AAClB,6EAI0D;AAC1D,0CAIyB;AAEzB;;;;;;;;;;;;;;;;GAgBG;AACH,SAAsB,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,2BAAmB,GAAG,0BAAoB,CAAC;oBAC1D,qBAAM,qBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAA;;oBAA3D,SAA2D,CAAC;;;;oBAE5D,2BAAkB,CAAC,OAAK,CAAC,CAAC;oBAC1B,MAAM,OAAK,CAAC;;;;;CAEb;AAZD,oCAYC;AAED,SAAe,kBAAkB;;;;;;;o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AG,SAAoC,CAAC;;;oBAGnD,8BAAqB,CACpB,CAAC,CAAC,UAAU,EACZ,0CAAiC,CAAC,YAAY,CAC9C,CAAC;oBAEI,KAAK,GAA0B;wBACpC,aAAa,EAAE,KAAK;wBACpB,UAAU,EAAE,UAAU;qBACtB,CAAC;oBACuC,qBAAM,2BAAgB,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,2BAAkB,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,15 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var UpdateEndpointException;
6
+ (function (UpdateEndpointException) {
7
+ UpdateEndpointException["BadRequestException"] = "BadRequestException";
8
+ UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
9
+ UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
10
+ UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
11
+ UpdateEndpointException["NotFoundException"] = "NotFoundException";
12
+ UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
13
+ UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
14
+ })(UpdateEndpointException = exports.UpdateEndpointException || (exports.UpdateEndpointException = {}));
15
+ //# 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,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,GAAvB,+BAAuB,KAAvB,+BAAuB,QAQlC"}
@@ -0,0 +1,3 @@
1
+ export { UpdateEndpointException } from './errors';
2
+ export { IdentifyUserInput } from './inputs';
3
+ export { IdentifyUserOptions } from './options';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var errors_1 = require("./errors");
6
+ exports.UpdateEndpointException = errors_1.UpdateEndpointException;
7
+ //# 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,mCAAmD;AAA1C,2CAAA,uBAAuB,CAAA"}
@@ -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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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,5 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# 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"}
package/lib/index.d.ts CHANGED
@@ -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/index.js CHANGED
@@ -4,8 +4,6 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  var common_1 = require("./common");
6
6
  exports.AWSPinpointProviderCommon = common_1.AWSPinpointProviderCommon;
7
- var inAppMessaging_1 = require("./inAppMessaging");
8
- exports.InAppMessageInteractionEvent = inAppMessaging_1.InAppMessageInteractionEvent;
9
7
  var types_1 = require("./pushNotifications/types");
10
8
  exports.PushNotificationPermissionStatus = types_1.PushNotificationPermissionStatus;
11
9
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,mCAAqD;AAA5C,6CAAA,yBAAyB,CAAA;AAElC,mDAY0B;AANzB,wDAAA,4BAA4B,CAAA;AAO7B,mDAImC;AADlC,mDAAA,gCAAgC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,mCAAqD;AAA5C,6CAAA,yBAAyB,CAAA;AAElC,mDAImC;AADlC,mDAAA,gCAAgC,CAAA"}
@@ -17,18 +17,18 @@ var AWSPinpointProvider = /** @class */ (function (_super) {
17
17
  // some configuration steps should not be re-run even if provider is re-configured for some reason
18
18
  if (!_this.configured) {
19
19
  // wire up default Pinpoint message event handling
20
- common_1.addEventListener(0 /* BACKGROUND_MESSAGE_RECEIVED */, function (message) {
20
+ common_1.addEventListener('backgroundMessageReceived', function (message) {
21
21
  return _this.recordMessageEvent(message, types_1.AWSPinpointMessageEvent.BACKGROUND_MESSAGE_RECEIVED);
22
22
  });
23
- common_1.addEventListener(1 /* FOREGROUND_MESSAGE_RECEIVED */, function (message) {
23
+ common_1.addEventListener('foregroundMessageReceived', function (message) {
24
24
  return _this.recordMessageEvent(message, types_1.AWSPinpointMessageEvent.FOREGROUND_MESSAGE_RECEIVED);
25
25
  });
26
- var launchNotificationOpenedListener_1 = common_1.addEventListener(2 /* LAUNCH_NOTIFICATION_OPENED */, function (message) {
26
+ var launchNotificationOpenedListener_1 = common_1.addEventListener('launchNotificationsOpened', function (message) {
27
27
  _this.recordMessageEvent(message, types_1.AWSPinpointMessageEvent.NOTIFICATION_OPENED);
28
28
  // once we are done with it we can remove the listener
29
29
  launchNotificationOpenedListener_1 === null || launchNotificationOpenedListener_1 === void 0 ? void 0 : launchNotificationOpenedListener_1.remove();
30
30
  });
31
- common_1.addEventListener(3 /* NOTIFICATION_OPENED */, function (message) {
31
+ common_1.addEventListener('notificationOpened', function (message) {
32
32
  _this.recordMessageEvent(message, types_1.AWSPinpointMessageEvent.NOTIFICATION_OPENED);
33
33
  // if we are in this state, we no longer need the listener as the app was launched via some other means
34
34
  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":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,0CAA8E;AAU9E,iCAAkD;AAClD,iCAAoD;AAEpD;IACS,+CAAyB;IAOjC;QAAA,YACC,kBAAM,cAAM,CAAC,SACb;QAJO,gBAAU,GAAG,KAAK,CAAC;QAa3B,eAAS,GAAG,UAAC,MAAW;YAAX,uBAAA,EAAA,WAAW;YACvB,KAAI,CAAC,MAAM,yCACP,iBAAM,SAAS,aAAC,MAAM,CAAC,KAC1B,YAAY,EAAE,EAAE,WAAW,EAAE,KAAI,CAAC,cAAc,EAAE,EAAE,GACpD,CAAC;YAEF,kGAAkG;YAClG,IAAI,CAAC,KAAI,CAAC,UAAU,EAAE;gBACrB,kDAAkD;gBAClD,yBAAgB,sCAEf,UAAA,OAAO;oBACN,OAAA,KAAI,CAAC,kBAAkB,CACtB,OAAO,EACP,+BAAuB,CAAC,2BAA2B,CACnD;gBAHD,CAGC,CACF,CAAC;gBACF,yBAAgB,sCAEf,UAAA,OAAO;oBACN,OAAA,KAAI,CAAC,kBAAkB,CACtB,OAAO,EACP,+BAAuB,CAAC,2BAA2B,CACnD;gBAHD,CAGC,CACF,CAAC;gBACF,IAAM,kCAAgC,GAAG,yBAAgB,qCAExD,UAAA,OAAO;oBACN,KAAI,CAAC,kBAAkB,CACtB,OAAO,EACP,+BAAuB,CAAC,mBAAmB,CAC3C,CAAC;oBACF,sDAAsD;oBACtD,kCAAgC,aAAhC,kCAAgC,uBAAhC,kCAAgC,CAAE,MAAM,GAAG;gBAC5C,CAAC,CACD,CAAC;gBACF,yBAAgB,8BAA4C,UAAA,OAAO;oBAClE,KAAI,CAAC,kBAAkB,CACtB,OAAO,EACP,+BAAuB,CAAC,mBAAmB,CAC3C,CAAC;oBACF,uGAAuG;oBACvG,kCAAgC,aAAhC,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,kCAAyB,GAkFjC;kBAnFoB,mBAAmB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/pushNotifications/providers/AWSPinpointProvider/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,0CAA8E;AAO9E,iCAAkD;AAClD,iCAAiC;AAEjC;IACS,+CAAyB;IAOjC;QAAA,YACC,kBAAM,cAAM,CAAC,SACb;QAJO,gBAAU,GAAG,KAAK,CAAC;QAa3B,eAAS,GAAG,UAAC,MAAW;YAAX,uBAAA,EAAA,WAAW;YACv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,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;;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,kCAAyB,GA8EjC;kBA/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;