@aws-amplify/analytics 7.0.92-unstable.a361dd1.0 → 7.0.92
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/dist/cjs/providers/pinpoint/apis/configureAutoTrack.js +2 -0
- package/dist/cjs/providers/pinpoint/apis/configureAutoTrack.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/flushEvents.js +2 -0
- package/dist/cjs/providers/pinpoint/apis/flushEvents.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/identifyUser.js +2 -0
- package/dist/cjs/providers/pinpoint/apis/identifyUser.js.map +1 -1
- package/dist/cjs/providers/pinpoint/apis/record.js +2 -0
- package/dist/cjs/providers/pinpoint/apis/record.js.map +1 -1
- package/dist/esm/providers/pinpoint/apis/configureAutoTrack.d.ts +2 -0
- package/dist/esm/providers/pinpoint/apis/configureAutoTrack.mjs +2 -0
- package/dist/esm/providers/pinpoint/apis/configureAutoTrack.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
- package/dist/esm/providers/pinpoint/apis/flushEvents.mjs +2 -0
- package/dist/esm/providers/pinpoint/apis/flushEvents.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/apis/identifyUser.d.ts +2 -0
- package/dist/esm/providers/pinpoint/apis/identifyUser.mjs +2 -0
- package/dist/esm/providers/pinpoint/apis/identifyUser.mjs.map +1 -1
- package/dist/esm/providers/pinpoint/apis/record.d.ts +2 -0
- package/dist/esm/providers/pinpoint/apis/record.mjs +2 -0
- package/dist/esm/providers/pinpoint/apis/record.mjs.map +1 -1
- package/package.json +109 -109
- package/src/providers/pinpoint/apis/configureAutoTrack.ts +2 -0
- package/src/providers/pinpoint/apis/flushEvents.ts +2 -0
- package/src/providers/pinpoint/apis/identifyUser.ts +2 -0
- package/src/providers/pinpoint/apis/record.ts +2 -0
|
@@ -20,6 +20,8 @@ const emitTrackingEvent = (eventName, attributes) => {
|
|
|
20
20
|
* configured events are detected within your application. This can include: DOM element events (via the `event`
|
|
21
21
|
* tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).
|
|
22
22
|
*
|
|
23
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
24
|
+
*
|
|
23
25
|
* @remark Only session tracking is currently supported on React Native.
|
|
24
26
|
*
|
|
25
27
|
* @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureAutoTrack.js","sources":["../../../../../src/providers/pinpoint/apis/configureAutoTrack.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.configureAutoTrack = void 0;\nconst utils_1 = require(\"../../../utils\");\nconst record_1 = require(\"./record\");\n// Configured Tracker instances for Pinpoint\nconst configuredTrackers = {};\n// Callback that will emit an appropriate event to Pinpoint when required by the Tracker\nconst emitTrackingEvent = (eventName, attributes) => {\n (0, record_1.record)({\n name: eventName,\n attributes,\n });\n};\n/**\n * Configures automatic event tracking for Pinpoint. This API will automatically transmit an analytic event when\n * configured events are detected within your application. This can include: DOM element events (via the `event`\n * tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).\n *\n * @remark Only session tracking is currently supported on React Native.\n *\n * @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n */\nconst configureAutoTrack = (input) => {\n (0, utils_1.validateTrackerConfiguration)(input);\n // Initialize or update this provider's trackers\n (0, utils_1.updateProviderTrackers)(input, emitTrackingEvent, configuredTrackers);\n};\nexports.configureAutoTrack = configureAutoTrack;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC;AACA,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,KAAK;AACrD,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE;AACzB,QAAQ,IAAI,EAAE,SAAS;AACvB,QAAQ,UAAU;AAClB,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACtC,IAAI,IAAI,OAAO,CAAC,4BAA4B,EAAE,KAAK,CAAC;AACpD;AACA,IAAI,IAAI,OAAO,CAAC,sBAAsB,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;AACrF,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
1
|
+
{"version":3,"file":"configureAutoTrack.js","sources":["../../../../../src/providers/pinpoint/apis/configureAutoTrack.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.configureAutoTrack = void 0;\nconst utils_1 = require(\"../../../utils\");\nconst record_1 = require(\"./record\");\n// Configured Tracker instances for Pinpoint\nconst configuredTrackers = {};\n// Callback that will emit an appropriate event to Pinpoint when required by the Tracker\nconst emitTrackingEvent = (eventName, attributes) => {\n (0, record_1.record)({\n name: eventName,\n attributes,\n });\n};\n/**\n * Configures automatic event tracking for Pinpoint. This API will automatically transmit an analytic event when\n * configured events are detected within your application. This can include: DOM element events (via the `event`\n * tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @remark Only session tracking is currently supported on React Native.\n *\n * @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n */\nconst configureAutoTrack = (input) => {\n (0, utils_1.validateTrackerConfiguration)(input);\n // Initialize or update this provider's trackers\n (0, utils_1.updateProviderTrackers)(input, emitTrackingEvent, configuredTrackers);\n};\nexports.configureAutoTrack = configureAutoTrack;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;AACpC;AACA,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,KAAK;AACrD,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE;AACzB,QAAQ,IAAI,EAAE,SAAS;AACvB,QAAQ,UAAU;AAClB,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACtC,IAAI,IAAI,OAAO,CAAC,4BAA4B,EAAE,KAAK,CAAC;AACpD;AACA,IAAI,IAAI,OAAO,CAAC,sBAAsB,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;AACrF,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
|
|
@@ -13,6 +13,8 @@ const logger = new core_1.ConsoleLogger('Analytics');
|
|
|
13
13
|
/**
|
|
14
14
|
* Flushes all buffered Pinpoint events to the service.
|
|
15
15
|
*
|
|
16
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
17
|
+
*
|
|
16
18
|
* @note
|
|
17
19
|
* This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking
|
|
18
20
|
* this API may not be included in the flush.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flushEvents.js","sources":["../../../../../src/providers/pinpoint/apis/flushEvents.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.flushEvents = void 0;\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_2 = require(\"../utils\");\nconst utils_3 = require(\"../../../utils\");\nconst logger = new core_1.ConsoleLogger('Analytics');\n/**\n * Flushes all buffered Pinpoint events to the service.\n *\n * @note\n * This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking\n * this API may not be included in the flush.\n */\nconst flushEvents = () => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = (0, utils_2.resolveConfig)();\n (0, utils_2.resolveCredentials)()\n .then(({ credentials, identityId }) => {\n (0, pinpoint_1.flushEvents)({\n appId,\n region,\n credentials,\n identityId,\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n userAgentValue: (0, utils_3.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.Record),\n });\n })\n .catch(e => {\n logger.warn('Failed to flush events', e);\n });\n};\nexports.flushEvents = flushEvents;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,E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/providers/pinpoint/apis/flushEvents.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.flushEvents = void 0;\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_2 = require(\"../utils\");\nconst utils_3 = require(\"../../../utils\");\nconst logger = new core_1.ConsoleLogger('Analytics');\n/**\n * Flushes all buffered Pinpoint events to the service.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @note\n * This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking\n * this API may not be included in the flush.\n */\nconst flushEvents = () => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = (0, utils_2.resolveConfig)();\n (0, utils_2.resolveCredentials)()\n .then(({ credentials, identityId }) => {\n (0, pinpoint_1.flushEvents)({\n appId,\n region,\n credentials,\n identityId,\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n userAgentValue: (0, utils_3.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.Record),\n });\n })\n .catch(e => {\n logger.warn('Failed to flush events', e);\n });\n};\nexports.flushEvents = flushEvents;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,WAAW,GAAG,MAAM;AAC5B,MAAM,UAAU,GAAG,OAAO,CAAC,gDAAgD,CAAC;AAC5E,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,OAAO,CAAC,aAAa,GAAG;AAC7G,IAAI,IAAI,OAAO,CAAC,kBAAkB;AAClC,SAAS,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK;AAC/C,QAAQ,IAAI,UAAU,CAAC,WAAW,EAAE;AACpC,YAAY,KAAK;AACjB,YAAY,MAAM;AAClB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,UAAU;AACtB,YAAY,SAAS;AACrB,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,YAAY,cAAc,EAAE,IAAI,OAAO,CAAC,2BAA2B,EAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;AACpG,SAAS,CAAC;AACV,IAAI,CAAC;AACL,SAAS,KAAK,CAAC,CAAC,IAAI;AACpB,QAAQ,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAChD,IAAI,CAAC,CAAC;AACN,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,WAAW;;"}
|
|
@@ -13,6 +13,8 @@ const utils_3 = require("../utils");
|
|
|
13
13
|
* profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
|
|
14
14
|
* the same `userId`.
|
|
15
15
|
*
|
|
16
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
17
|
+
*
|
|
16
18
|
* @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
|
|
17
19
|
* API.
|
|
18
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifyUser.js","sources":["../../../../../src/providers/pinpoint/apis/identifyUser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.identifyUser = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst utils_2 = require(\"../../../utils\");\nconst utils_3 = require(\"../utils\");\n/**\n * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user\n * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using\n * the same `userId`.\n *\n * @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint\n * API.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @returns A promise that will resolve when the operation is complete.\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint with some additional demographics\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * demographic: {\n * platform: 'ios',\n * timezone: 'America/Los_Angeles'\n * }\n * }\n * });\n */\nconst identifyUser = async ({ userId, userProfile, options, }) => {\n const { credentials, identityId } = await (0, utils_3.resolveCredentials)();\n const { appId, region } = (0, utils_3.resolveConfig)();\n const { userAttributes } = options ?? {};\n await (0, pinpoint_1.updateEndpoint)({\n appId,\n category: 'Analytics',\n credentials,\n identityId,\n region,\n userAttributes,\n userId,\n userProfile,\n userAgentValue: (0, utils_2.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.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CAAC;AACtG,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
1
|
+
{"version":3,"file":"identifyUser.js","sources":["../../../../../src/providers/pinpoint/apis/identifyUser.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.identifyUser = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst utils_2 = require(\"../../../utils\");\nconst utils_3 = require(\"../utils\");\n/**\n * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user\n * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using\n * the same `userId`.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint\n * API.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @returns A promise that will resolve when the operation is complete.\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint with some additional demographics\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * demographic: {\n * platform: 'ios',\n * timezone: 'America/Los_Angeles'\n * }\n * }\n * });\n */\nconst identifyUser = async ({ userId, userProfile, options, }) => {\n const { credentials, identityId } = await (0, utils_3.resolveCredentials)();\n const { appId, region } = (0, utils_3.resolveConfig)();\n const { userAttributes } = options ?? {};\n await (0, pinpoint_1.updateEndpoint)({\n appId,\n category: 'Analytics',\n credentials,\n identityId,\n region,\n userAttributes,\n userId,\n userProfile,\n userAgentValue: (0, utils_2.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.IdentifyUser),\n });\n};\nexports.identifyUser = identifyUser;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,YAAY,GAAG,MAAM;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,gDAAgD,CAAC;AAC5E,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,KAAK;AAClE,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,OAAO,CAAC,kBAAkB,GAAG;AAC/E,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,aAAa,GAAG;AAC1D,IAAI,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE;AAC5C,IAAI,MAAM,IAAI,UAAU,CAAC,cAAc,EAAE;AACzC,QAAQ,KAAK;AACb,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,cAAc,EAAE,IAAI,OAAO,CAAC,2BAA2B,EAAE,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC;AACtG,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
@@ -14,6 +14,8 @@ const logger = new core_1.ConsoleLogger('Analytics');
|
|
|
14
14
|
/**
|
|
15
15
|
* Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
|
|
16
16
|
*
|
|
17
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
18
|
+
*
|
|
17
19
|
* @param params The input object used to construct the request.
|
|
18
20
|
*
|
|
19
21
|
* @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.record = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst errors_1 = require(\"../../../errors\");\nconst utils_2 = require(\"../../../utils\");\nconst utils_3 = require(\"../utils\");\nconst logger = new core_1.ConsoleLogger('Analytics');\n/**\n * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.\n *\n * @param params The input object used to construct the request.\n *\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint\n * record({ name: eventName })\n * ```\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint with metrics & custom attributes\n * record({\n * name: eventName,\n * attributes: {\n * 'my-attribute': attributeValue\n * },\n * metrics: {\n * 'my-metric': metricValue\n * }\n * })\n * ```\n */\nconst record = (input) => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = (0, utils_3.resolveConfig)();\n if (!(0, utils_2.isAnalyticsEnabled)()) {\n logger.debug('Analytics is disabled, event will not be recorded.');\n return;\n }\n (0, errors_1.assertValidationError)(!!input.name, errors_1.AnalyticsValidationErrorCode.NoEventName);\n (0, utils_3.resolveCredentials)()\n .then(({ credentials, identityId }) => {\n core_1.Hub.dispatch('analytics', { event: 'record', data: input, message: 'Recording Analytics event' }, 'Analytics', utils_1.AMPLIFY_SYMBOL);\n (0, pinpoint_1.record)({\n appId,\n category: 'Analytics',\n credentials,\n event: input,\n identityId,\n region,\n userAgentValue: (0, utils_2.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.Record),\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n });\n })\n .catch(e => {\n // An error occured while fetching credentials or persisting the event to the buffer\n logger.warn('Failed to record event.', e);\n });\n};\nexports.record = record;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,MAAM,GAAG,MAAM;AACvB,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,gDAAgD,CAAC;AAC5E,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;AACpD;AACA;AACA;AACA;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AS,KAAK,CAAC,CAAC,IAAI;AACpB;AACA,QAAQ,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;AACjD,IAAI,CAAC,CAAC;AACN,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;;"}
|
|
1
|
+
{"version":3,"file":"record.js","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.record = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst pinpoint_1 = require(\"@aws-amplify/core/internals/providers/pinpoint\");\nconst errors_1 = require(\"../../../errors\");\nconst utils_2 = require(\"../../../utils\");\nconst utils_3 = require(\"../utils\");\nconst logger = new core_1.ConsoleLogger('Analytics');\n/**\n * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @param params The input object used to construct the request.\n *\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint\n * record({ name: eventName })\n * ```\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint with metrics & custom attributes\n * record({\n * name: eventName,\n * attributes: {\n * 'my-attribute': attributeValue\n * },\n * metrics: {\n * 'my-metric': metricValue\n * }\n * })\n * ```\n */\nconst record = (input) => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = (0, utils_3.resolveConfig)();\n if (!(0, utils_2.isAnalyticsEnabled)()) {\n logger.debug('Analytics is disabled, event will not be recorded.');\n return;\n }\n (0, errors_1.assertValidationError)(!!input.name, errors_1.AnalyticsValidationErrorCode.NoEventName);\n (0, utils_3.resolveCredentials)()\n .then(({ credentials, identityId }) => {\n core_1.Hub.dispatch('analytics', { event: 'record', data: input, message: 'Recording Analytics event' }, 'Analytics', utils_1.AMPLIFY_SYMBOL);\n (0, pinpoint_1.record)({\n appId,\n category: 'Analytics',\n credentials,\n event: input,\n identityId,\n region,\n userAgentValue: (0, utils_2.getAnalyticsUserAgentString)(utils_1.AnalyticsAction.Record),\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n });\n })\n .catch(e => {\n // An error occured while fetching credentials or persisting the event to the buffer\n logger.warn('Failed to record event.', e);\n });\n};\nexports.record = record;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,MAAM,GAAG,MAAM;AACvB,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,gDAAgD,CAAC;AAC5E,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;AACnC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,KAAK;AAC1B,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,IAAI,OAAO,CAAC,aAAa,GAAG;AAC7G,IAAI,IAAI,CAAC,IAAI,OAAO,CAAC,kBAAkB,GAAG,EAAE;AAC5C,QAAQ,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC;AAC1E,QAAQ;AACR,IAAI;AACJ,IAAI,IAAI,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,4BAA4B,CAAC,WAAW,CAAC;AACxG,IAAI,IAAI,OAAO,CAAC,kBAAkB;AAClC,SAAS,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK;AAC/C,QAAQ,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC;AACrJ,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE;AAC/B,YAAY,KAAK;AACjB,YAAY,QAAQ,EAAE,WAAW;AACjC,YAAY,WAAW;AACvB,YAAY,KAAK,EAAE,KAAK;AACxB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc,EAAE,IAAI,OAAO,CAAC,2BAA2B,EAAE,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC;AACpG,YAAY,UAAU;AACtB,YAAY,SAAS;AACrB,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,SAAS,CAAC;AACV,IAAI,CAAC;AACL,SAAS,KAAK,CAAC,CAAC,IAAI;AACpB;AACA,QAAQ,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;AACjD,IAAI,CAAC,CAAC;AACN,CAAC;AACD,OAAO,CAAC,MAAM,GAAG,MAAM;;"}
|
|
@@ -4,6 +4,8 @@ import { ConfigureAutoTrackInput } from '../types';
|
|
|
4
4
|
* configured events are detected within your application. This can include: DOM element events (via the `event`
|
|
5
5
|
* tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).
|
|
6
6
|
*
|
|
7
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
8
|
+
*
|
|
7
9
|
* @remark Only session tracking is currently supported on React Native.
|
|
8
10
|
*
|
|
9
11
|
* @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.
|
|
@@ -22,6 +22,8 @@ const emitTrackingEvent = (eventName, attributes) => {
|
|
|
22
22
|
* configured events are detected within your application. This can include: DOM element events (via the `event`
|
|
23
23
|
* tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).
|
|
24
24
|
*
|
|
25
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
26
|
+
*
|
|
25
27
|
* @remark Only session tracking is currently supported on React Native.
|
|
26
28
|
*
|
|
27
29
|
* @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureAutoTrack.mjs","sources":["../../../../../src/providers/pinpoint/apis/configureAutoTrack.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { updateProviderTrackers, validateTrackerConfiguration, } from '../../../utils';\nimport { record } from './record';\n// Configured Tracker instances for Pinpoint\nconst configuredTrackers = {};\n// Callback that will emit an appropriate event to Pinpoint when required by the Tracker\nconst emitTrackingEvent = (eventName, attributes) => {\n record({\n name: eventName,\n attributes,\n });\n};\n/**\n * Configures automatic event tracking for Pinpoint. This API will automatically transmit an analytic event when\n * configured events are detected within your application. This can include: DOM element events (via the `event`\n * tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).\n *\n * @remark Only session tracking is currently supported on React Native.\n *\n * @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n */\nexport const configureAutoTrack = (input) => {\n validateTrackerConfiguration(input);\n // Initialize or update this provider's trackers\n updateProviderTrackers(input, emitTrackingEvent, configuredTrackers);\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAGA;AACA,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,KAAK;AACrD,IAAI,MAAM,CAAC;AACX,QAAQ,IAAI,EAAE,SAAS;AACvB,QAAQ,UAAU;AAClB,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK;AAC7C,IAAI,4BAA4B,CAAC,KAAK,CAAC;AACvC;AACA,IAAI,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;AACxE;;;;"}
|
|
1
|
+
{"version":3,"file":"configureAutoTrack.mjs","sources":["../../../../../src/providers/pinpoint/apis/configureAutoTrack.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { updateProviderTrackers, validateTrackerConfiguration, } from '../../../utils';\nimport { record } from './record';\n// Configured Tracker instances for Pinpoint\nconst configuredTrackers = {};\n// Callback that will emit an appropriate event to Pinpoint when required by the Tracker\nconst emitTrackingEvent = (eventName, attributes) => {\n record({\n name: eventName,\n attributes,\n });\n};\n/**\n * Configures automatic event tracking for Pinpoint. This API will automatically transmit an analytic event when\n * configured events are detected within your application. This can include: DOM element events (via the `event`\n * tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @remark Only session tracking is currently supported on React Native.\n *\n * @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n */\nexport const configureAutoTrack = (input) => {\n validateTrackerConfiguration(input);\n // Initialize or update this provider's trackers\n updateProviderTrackers(input, emitTrackingEvent, configuredTrackers);\n};\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AAGA;AACA,MAAM,kBAAkB,GAAG,EAAE;AAC7B;AACA,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,KAAK;AACrD,IAAI,MAAM,CAAC;AACX,QAAQ,IAAI,EAAE,SAAS;AACvB,QAAQ,UAAU;AAClB,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK;AAC7C,IAAI,4BAA4B,CAAC,KAAK,CAAC;AACvC;AACA,IAAI,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;AACxE;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flushes all buffered Pinpoint events to the service.
|
|
3
3
|
*
|
|
4
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
5
|
+
*
|
|
4
6
|
* @note
|
|
5
7
|
* This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking
|
|
6
8
|
* this API may not be included in the flush.
|
|
@@ -16,6 +16,8 @@ const logger = new ConsoleLogger('Analytics');
|
|
|
16
16
|
/**
|
|
17
17
|
* Flushes all buffered Pinpoint events to the service.
|
|
18
18
|
*
|
|
19
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
20
|
+
*
|
|
19
21
|
* @note
|
|
20
22
|
* This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking
|
|
21
23
|
* this API may not be included in the flush.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flushEvents.mjs","sources":["../../../../../src/providers/pinpoint/apis/flushEvents.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { flushEvents as flushEventsCore } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { AnalyticsAction } from '@aws-amplify/core/internals/utils';\nimport { ConsoleLogger } from '@aws-amplify/core';\nimport { resolveConfig, resolveCredentials } from '../utils';\nimport { getAnalyticsUserAgentString } from '../../../utils';\nconst logger = new ConsoleLogger('Analytics');\n/**\n * Flushes all buffered Pinpoint events to the service.\n *\n * @note\n * This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking\n * this API may not be included in the flush.\n */\nexport const flushEvents = () => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = resolveConfig();\n resolveCredentials()\n .then(({ credentials, identityId }) => {\n flushEventsCore({\n appId,\n region,\n credentials,\n identityId,\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.Record),\n });\n })\n .catch(e => {\n logger.warn('Failed to flush events', e);\n });\n};\n"],"names":["flushEventsCore"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAMA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG,MAAM;AACjC,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE;AAChG,IAAI,kBAAkB;AACtB,SAAS,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK;AAC/C,QAAQA,aAAe,CAAC;AACxB,YAAY,KAAK;AACjB,YAAY,MAAM;AAClB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,UAAU;AACtB,YAAY,SAAS;AACrB,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,YAAY,cAAc,EAAE,2BAA2B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC/E,SAAS,CAAC;AACV,IAAI,CAAC;AACL,SAAS,KAAK,CAAC,CAAC,IAAI;AACpB,QAAQ,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAChD,IAAI,CAAC,CAAC;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"flushEvents.mjs","sources":["../../../../../src/providers/pinpoint/apis/flushEvents.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { flushEvents as flushEventsCore } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { AnalyticsAction } from '@aws-amplify/core/internals/utils';\nimport { ConsoleLogger } from '@aws-amplify/core';\nimport { resolveConfig, resolveCredentials } from '../utils';\nimport { getAnalyticsUserAgentString } from '../../../utils';\nconst logger = new ConsoleLogger('Analytics');\n/**\n * Flushes all buffered Pinpoint events to the service.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @note\n * This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking\n * this API may not be included in the flush.\n */\nexport const flushEvents = () => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = resolveConfig();\n resolveCredentials()\n .then(({ credentials, identityId }) => {\n flushEventsCore({\n appId,\n region,\n credentials,\n identityId,\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.Record),\n });\n })\n .catch(e => {\n logger.warn('Failed to flush events', e);\n });\n};\n"],"names":["flushEventsCore"],"mappings":";;;;;;;;;;;;AAAA;AACA;AAMA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG,MAAM;AACjC,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE;AAChG,IAAI,kBAAkB;AACtB,SAAS,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK;AAC/C,QAAQA,aAAe,CAAC;AACxB,YAAY,KAAK;AACjB,YAAY,MAAM;AAClB,YAAY,WAAW;AACvB,YAAY,UAAU;AACtB,YAAY,UAAU;AACtB,YAAY,SAAS;AACrB,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,YAAY,cAAc,EAAE,2BAA2B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC/E,SAAS,CAAC;AACV,IAAI,CAAC;AACL,SAAS,KAAK,CAAC,CAAC,IAAI;AACpB,QAAQ,MAAM,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;AAChD,IAAI,CAAC,CAAC;AACN;;;;"}
|
|
@@ -4,6 +4,8 @@ import { IdentifyUserInput } from '../types';
|
|
|
4
4
|
* profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
|
|
5
5
|
* the same `userId`.
|
|
6
6
|
*
|
|
7
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
8
|
+
*
|
|
7
9
|
* @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
|
|
8
10
|
* API.
|
|
9
11
|
*
|
|
@@ -17,6 +17,8 @@ import { resolveCredentials } from '../utils/resolveCredentials.mjs';
|
|
|
17
17
|
* profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
|
|
18
18
|
* the same `userId`.
|
|
19
19
|
*
|
|
20
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
21
|
+
*
|
|
20
22
|
* @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
|
|
21
23
|
* API.
|
|
22
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identifyUser.mjs","sources":["../../../../../src/providers/pinpoint/apis/identifyUser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AnalyticsAction } from '@aws-amplify/core/internals/utils';\nimport { updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { getAnalyticsUserAgentString } from '../../../utils';\nimport { resolveConfig, resolveCredentials } from '../utils';\n/**\n * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user\n * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using\n * the same `userId`.\n *\n * @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint\n * API.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @returns A promise that will resolve when the operation is complete.\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint with some additional demographics\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * demographic: {\n * platform: 'ios',\n * timezone: 'America/Los_Angeles'\n * }\n * }\n * });\n */\nexport const identifyUser = async ({ userId, userProfile, options, }) => {\n const { credentials, identityId } = await resolveCredentials();\n const { appId, region } = resolveConfig();\n const { userAttributes } = options ?? {};\n await updateEndpoint({\n appId,\n category: 'Analytics',\n credentials,\n identityId,\n region,\n userAttributes,\n userId,\n userProfile,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.IdentifyUser),\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,YAAY,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,KAAK;AACzE,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,EAAE;AAClE,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE;AAC7C,IAAI,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE;AAC5C,IAAI,MAAM,cAAc,CAAC;AACzB,QAAQ,KAAK;AACb,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,cAAc,EAAE,2BAA2B,CAAC,eAAe,CAAC,YAAY,CAAC;AACjF,KAAK,CAAC;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"identifyUser.mjs","sources":["../../../../../src/providers/pinpoint/apis/identifyUser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AnalyticsAction } from '@aws-amplify/core/internals/utils';\nimport { updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { getAnalyticsUserAgentString } from '../../../utils';\nimport { resolveConfig, resolveCredentials } from '../utils';\n/**\n * Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user\n * profile and activities or actions in your application. Activity can be tracked across devices & platforms by using\n * the same `userId`.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint\n * API.\n *\n * @throws service: {@link UpdateEndpointException} - Thrown when the underlying Pinpoint service returns an error.\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @returns A promise that will resolve when the operation is complete.\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * }\n * });\n * ```\n *\n * @example\n * ```ts\n * // Identify a user with Pinpoint with some additional demographics\n * await identifyUser({\n * userId,\n * userProfile: {\n * email: 'userEmail@example.com'\n * customProperties: {\n * phoneNumber: ['555-555-5555'],\n * },\n * demographic: {\n * platform: 'ios',\n * timezone: 'America/Los_Angeles'\n * }\n * }\n * });\n */\nexport const identifyUser = async ({ userId, userProfile, options, }) => {\n const { credentials, identityId } = await resolveCredentials();\n const { appId, region } = resolveConfig();\n const { userAttributes } = options ?? {};\n await updateEndpoint({\n appId,\n category: 'Analytics',\n credentials,\n identityId,\n region,\n userAttributes,\n userId,\n userProfile,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.IdentifyUser),\n });\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,YAAY,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,KAAK;AACzE,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,EAAE;AAClE,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE;AAC7C,IAAI,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE;AAC5C,IAAI,MAAM,cAAc,CAAC;AACzB,QAAQ,KAAK;AACb,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,cAAc,EAAE,2BAA2B,CAAC,eAAe,CAAC,YAAY,CAAC;AACjF,KAAK,CAAC;AACN;;;;"}
|
|
@@ -2,6 +2,8 @@ import { RecordInput } from '../types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
|
|
4
4
|
*
|
|
5
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
6
|
+
*
|
|
5
7
|
* @param params The input object used to construct the request.
|
|
6
8
|
*
|
|
7
9
|
* @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library
|
|
@@ -18,6 +18,8 @@ const logger = new ConsoleLogger('Analytics');
|
|
|
18
18
|
/**
|
|
19
19
|
* Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
|
|
20
20
|
*
|
|
21
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
22
|
+
*
|
|
21
23
|
* @param params The input object used to construct the request.
|
|
22
24
|
*
|
|
23
25
|
* @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.mjs","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger, Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL, AnalyticsAction, } from '@aws-amplify/core/internals/utils';\nimport { record as recordCore } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { AnalyticsValidationErrorCode, assertValidationError, } from '../../../errors';\nimport { getAnalyticsUserAgentString, isAnalyticsEnabled, } from '../../../utils';\nimport { resolveConfig, resolveCredentials } from '../utils';\nconst logger = new ConsoleLogger('Analytics');\n/**\n * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.\n *\n * @param params The input object used to construct the request.\n *\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint\n * record({ name: eventName })\n * ```\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint with metrics & custom attributes\n * record({\n * name: eventName,\n * attributes: {\n * 'my-attribute': attributeValue\n * },\n * metrics: {\n * 'my-metric': metricValue\n * }\n * })\n * ```\n */\nexport const record = (input) => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = resolveConfig();\n if (!isAnalyticsEnabled()) {\n logger.debug('Analytics is disabled, event will not be recorded.');\n return;\n }\n assertValidationError(!!input.name, AnalyticsValidationErrorCode.NoEventName);\n resolveCredentials()\n .then(({ credentials, identityId }) => {\n Hub.dispatch('analytics', { event: 'record', data: input, message: 'Recording Analytics event' }, 'Analytics', AMPLIFY_SYMBOL);\n recordCore({\n appId,\n category: 'Analytics',\n credentials,\n event: input,\n identityId,\n region,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.Record),\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n });\n })\n .catch(e => {\n // An error occured while fetching credentials or persisting the event to the buffer\n logger.warn('Failed to record event.', e);\n });\n};\n"],"names":["recordCore"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAOA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG,CAAC,KAAK,KAAK;AACjC,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE;AAChG,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;AAC/B,QAAQ,MAAM,CAAC,KAAK,CAAC,oDAAoD,CAAC;AAC1E,QAAQ;AACR,IAAI;AACJ,IAAI,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,4BAA4B,CAAC,WAAW,CAAC;AACjF,IAAI,kBAAkB;AACtB,SAAS,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK;AAC/C,QAAQ,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B,EAAE,EAAE,WAAW,EAAE,cAAc,CAAC;AACtI,QAAQA,QAAU,CAAC;AACnB,YAAY,KAAK;AACjB,YAAY,QAAQ,EAAE,WAAW;AACjC,YAAY,WAAW;AACvB,YAAY,KAAK,EAAE,KAAK;AACxB,YAAY,UAAU;AACtB,YAAY,MAAM;AAClB,YAAY,cAAc,EAAE,2BAA2B,CAAC,eAAe,CAAC,MAAM,CAAC;AAC/E,YAAY,UAAU;AACtB,YAAY,SAAS;AACrB,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,SAAS,CAAC;AACV,IAAI,CAAC;AACL,SAAS,KAAK,CAAC,CAAC,IAAI;AACpB;AACA,QAAQ,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,CAAC;AACjD,IAAI,CAAC,CAAC;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"record.mjs","sources":["../../../../../src/providers/pinpoint/apis/record.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger, Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL, AnalyticsAction, } from '@aws-amplify/core/internals/utils';\nimport { record as recordCore } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { AnalyticsValidationErrorCode, assertValidationError, } from '../../../errors';\nimport { getAnalyticsUserAgentString, isAnalyticsEnabled, } from '../../../utils';\nimport { resolveConfig, resolveCredentials } from '../utils';\nconst logger = new ConsoleLogger('Analytics');\n/**\n * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.\n *\n * @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.\n *\n * @param params The input object used to construct the request.\n *\n * @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library\n * configuration is incorrect.\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint\n * record({ name: eventName })\n * ```\n *\n * @example\n * ```ts\n * // Send an event to Pinpoint with metrics & custom attributes\n * record({\n * name: eventName,\n * attributes: {\n * 'my-attribute': attributeValue\n * },\n * metrics: {\n * 'my-metric': metricValue\n * }\n * })\n * ```\n */\nexport const record = (input) => {\n const { appId, region, bufferSize, flushSize, flushInterval, resendLimit } = resolveConfig();\n if (!isAnalyticsEnabled()) {\n logger.debug('Analytics is disabled, event will not be recorded.');\n return;\n }\n assertValidationError(!!input.name, AnalyticsValidationErrorCode.NoEventName);\n resolveCredentials()\n .then(({ credentials, identityId }) => {\n Hub.dispatch('analytics', { event: 'record', data: input, message: 'Recording Analytics event' }, 'Analytics', AMPLIFY_SYMBOL);\n recordCore({\n appId,\n category: 'Analytics',\n credentials,\n event: input,\n identityId,\n region,\n userAgentValue: getAnalyticsUserAgentString(AnalyticsAction.Record),\n bufferSize,\n flushSize,\n flushInterval,\n resendLimit,\n });\n })\n .catch(e => {\n // An error occured while fetching credentials or persisting the event to the buffer\n logger.warn('Failed to record event.', e);\n });\n};\n"],"names":["recordCore"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AAOA,MAAM,MAAM,GAAG,IAAI,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,CAAC,CAAC;AACN;;;;"}
|
package/package.json
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
2
|
+
"name": "@aws-amplify/analytics",
|
|
3
|
+
"version": "7.0.92",
|
|
4
|
+
"description": "Analytics category of aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"react-native": "./dist/cjs/index.js",
|
|
8
|
+
"typings": "./dist/esm/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
|
|
15
|
+
"build-with-test": "npm run clean && npm run test && npm run build",
|
|
16
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
17
|
+
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
|
|
18
|
+
"build:watch": "npm run build:esm-cjs -- --watch",
|
|
19
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
20
|
+
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
21
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
22
|
+
"format": "echo \"Not implemented\"",
|
|
23
|
+
"lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
|
|
24
|
+
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
|
|
25
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 71.4"
|
|
26
|
+
},
|
|
27
|
+
"typesVersions": {
|
|
28
|
+
">=4.2": {
|
|
29
|
+
"pinpoint": [
|
|
30
|
+
"./dist/esm/providers/pinpoint/index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"kinesis": [
|
|
33
|
+
"./dist/esm/providers/kinesis/index.d.ts"
|
|
34
|
+
],
|
|
35
|
+
"kinesis-firehose": [
|
|
36
|
+
"./dist/esm/providers/kinesis-firehose/index.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"personalize": [
|
|
39
|
+
"./dist/esm/providers/personalize/index.d.ts"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"react-native": "./dist/cjs/index.js",
|
|
46
|
+
"types": "./dist/esm/index.d.ts",
|
|
47
|
+
"import": "./dist/esm/index.mjs",
|
|
48
|
+
"require": "./dist/cjs/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./pinpoint": {
|
|
51
|
+
"react-native": "./dist/cjs/providers/pinpoint/index.js",
|
|
52
|
+
"types": "./dist/esm/providers/pinpoint/index.d.ts",
|
|
53
|
+
"import": "./dist/esm/providers/pinpoint/index.mjs",
|
|
54
|
+
"require": "./dist/cjs/providers/pinpoint/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./kinesis": {
|
|
57
|
+
"react-native": "./dist/cjs/providers/kinesis/index.js",
|
|
58
|
+
"types": "./dist/esm/providers/kinesis/index.d.ts",
|
|
59
|
+
"import": "./dist/esm/providers/kinesis/index.mjs",
|
|
60
|
+
"require": "./dist/cjs/providers/kinesis/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./kinesis-firehose": {
|
|
63
|
+
"react-native": "./dist/cjs/providers/kinesis-firehose/index.js",
|
|
64
|
+
"types": "./dist/esm/providers/kinesis-firehose/index.d.ts",
|
|
65
|
+
"import": "./dist/esm/providers/kinesis-firehose/index.mjs",
|
|
66
|
+
"require": "./dist/cjs/providers/kinesis-firehose/index.js"
|
|
67
|
+
},
|
|
68
|
+
"./personalize": {
|
|
69
|
+
"react-native": "./dist/cjs/providers/personalize/index.js",
|
|
70
|
+
"types": "./dist/esm/providers/personalize/index.d.ts",
|
|
71
|
+
"import": "./dist/esm/providers/personalize/index.mjs",
|
|
72
|
+
"require": "./dist/cjs/providers/personalize/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./package.json": "./package.json"
|
|
75
|
+
},
|
|
76
|
+
"repository": {
|
|
77
|
+
"type": "git",
|
|
78
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
79
|
+
},
|
|
80
|
+
"author": "Amazon Web Services",
|
|
81
|
+
"license": "Apache-2.0",
|
|
82
|
+
"bugs": {
|
|
83
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
84
|
+
},
|
|
85
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
86
|
+
"files": [
|
|
87
|
+
"dist/cjs",
|
|
88
|
+
"dist/esm",
|
|
89
|
+
"src",
|
|
90
|
+
"pinpoint",
|
|
91
|
+
"kinesis",
|
|
92
|
+
"kinesis-firehose",
|
|
93
|
+
"personalize"
|
|
94
|
+
],
|
|
95
|
+
"dependencies": {
|
|
96
|
+
"@aws-sdk/client-firehose": "3.723.0",
|
|
97
|
+
"@aws-sdk/client-kinesis": "3.723.0",
|
|
98
|
+
"@aws-sdk/client-personalize-events": "3.723.0",
|
|
99
|
+
"@smithy/util-utf8": "2.0.0",
|
|
100
|
+
"tslib": "^2.5.0"
|
|
101
|
+
},
|
|
102
|
+
"peerDependencies": {
|
|
103
|
+
"@aws-amplify/core": "^6.1.0"
|
|
104
|
+
},
|
|
105
|
+
"devDependencies": {
|
|
106
|
+
"@aws-amplify/core": "6.16.0",
|
|
107
|
+
"@aws-amplify/react-native": "1.3.2",
|
|
108
|
+
"@aws-sdk/types": "3.723.0"
|
|
109
|
+
},
|
|
110
|
+
"gitHead": "07bd4bd1d05d07fa516fb596fb1712ef812ed20c"
|
|
111
111
|
}
|
|
@@ -36,6 +36,8 @@ const emitTrackingEvent = (
|
|
|
36
36
|
* configured events are detected within your application. This can include: DOM element events (via the `event`
|
|
37
37
|
* tracker), session events (via the `session` tracker), and page view events (via the `pageView` tracker).
|
|
38
38
|
*
|
|
39
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
40
|
+
*
|
|
39
41
|
* @remark Only session tracking is currently supported on React Native.
|
|
40
42
|
*
|
|
41
43
|
* @param {ConfigureAutoTrackInput} params The input object to configure auto track behavior.
|
|
@@ -13,6 +13,8 @@ const logger = new ConsoleLogger('Analytics');
|
|
|
13
13
|
/**
|
|
14
14
|
* Flushes all buffered Pinpoint events to the service.
|
|
15
15
|
*
|
|
16
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
17
|
+
*
|
|
16
18
|
* @note
|
|
17
19
|
* This API will make a best-effort attempt to flush events from the buffer. Events recorded immediately after invoking
|
|
18
20
|
* this API may not be included in the flush.
|
|
@@ -17,6 +17,8 @@ import { resolveConfig, resolveCredentials } from '../utils';
|
|
|
17
17
|
* profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
|
|
18
18
|
* the same `userId`.
|
|
19
19
|
*
|
|
20
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
21
|
+
*
|
|
20
22
|
* @param {IdentifyUserInput} params The input object used to construct requests sent to Pinpoint's UpdateEndpoint
|
|
21
23
|
* API.
|
|
22
24
|
*
|
|
@@ -24,6 +24,8 @@ const logger = new ConsoleLogger('Analytics');
|
|
|
24
24
|
/**
|
|
25
25
|
* Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
|
|
26
26
|
*
|
|
27
|
+
* @deprecated AWS will end support for Amazon Pinpoint on October 30, 2026.
|
|
28
|
+
*
|
|
27
29
|
* @param params The input object used to construct the request.
|
|
28
30
|
*
|
|
29
31
|
* @throws validation: {@link AnalyticsValidationErrorCode} - Thrown when the provided parameters or library
|