@aws-amplify/analytics 7.0.1-console-preview.8f82e46.0 → 7.0.1-console-preview.8d88eef.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 (52) hide show
  1. package/lib/providers/kinesis/apis/flushEvents.js +2 -1
  2. package/lib/providers/kinesis/apis/record.js +2 -1
  3. package/lib/providers/kinesis-firehose/apis/flushEvents.js +2 -1
  4. package/lib/providers/kinesis-firehose/apis/record.js +2 -1
  5. package/lib/providers/personalize/apis/flushEvents.js +2 -1
  6. package/lib/providers/personalize/apis/record.js +2 -1
  7. package/lib/providers/personalize/utils/autoTrackMedia.js +2 -1
  8. package/lib/providers/pinpoint/apis/flushEvents.js +2 -1
  9. package/lib/providers/pinpoint/apis/identifyUser.js +4 -5
  10. package/lib/providers/pinpoint/apis/record.js +1 -1
  11. package/lib/providers/pinpoint/types/index.d.ts +0 -1
  12. package/lib/providers/pinpoint/types/index.js +0 -3
  13. package/lib/tsconfig.tsbuildinfo +1 -1
  14. package/lib/types/inputs.d.ts +1 -3
  15. package/lib/types/options.d.ts +1 -1
  16. package/lib/utils/eventBuffer/EventBuffer.js +2 -2
  17. package/lib-esm/providers/kinesis/apis/flushEvents.js +2 -1
  18. package/lib-esm/providers/kinesis/apis/record.js +2 -1
  19. package/lib-esm/providers/kinesis-firehose/apis/flushEvents.js +2 -1
  20. package/lib-esm/providers/kinesis-firehose/apis/record.js +3 -2
  21. package/lib-esm/providers/personalize/apis/flushEvents.js +2 -1
  22. package/lib-esm/providers/personalize/apis/record.js +2 -1
  23. package/lib-esm/providers/personalize/utils/autoTrackMedia.js +2 -1
  24. package/lib-esm/providers/pinpoint/apis/flushEvents.js +2 -1
  25. package/lib-esm/providers/pinpoint/apis/identifyUser.js +5 -6
  26. package/lib-esm/providers/pinpoint/apis/record.js +3 -3
  27. package/lib-esm/providers/pinpoint/types/index.d.ts +0 -1
  28. package/lib-esm/providers/pinpoint/types/index.js +1 -1
  29. package/lib-esm/tsconfig.tsbuildinfo +1 -1
  30. package/lib-esm/types/inputs.d.ts +1 -3
  31. package/lib-esm/types/options.d.ts +1 -1
  32. package/lib-esm/utils/eventBuffer/EventBuffer.js +1 -1
  33. package/package.json +4 -4
  34. package/src/providers/kinesis/apis/flushEvents.ts +2 -4
  35. package/src/providers/kinesis/apis/record.ts +2 -4
  36. package/src/providers/kinesis-firehose/apis/flushEvents.ts +2 -4
  37. package/src/providers/kinesis-firehose/apis/record.ts +3 -5
  38. package/src/providers/personalize/apis/flushEvents.ts +2 -4
  39. package/src/providers/personalize/apis/record.ts +2 -4
  40. package/src/providers/personalize/utils/autoTrackMedia.ts +2 -1
  41. package/src/providers/pinpoint/apis/flushEvents.ts +2 -4
  42. package/src/providers/pinpoint/apis/identifyUser.ts +6 -3
  43. package/src/providers/pinpoint/apis/record.ts +3 -4
  44. package/src/providers/pinpoint/types/index.ts +0 -1
  45. package/src/types/inputs.ts +1 -3
  46. package/src/types/options.ts +1 -1
  47. package/src/utils/eventBuffer/EventBuffer.ts +1 -1
  48. package/lib/providers/pinpoint/types/errors.d.ts +0 -9
  49. package/lib/providers/pinpoint/types/errors.js +0 -15
  50. package/lib-esm/providers/pinpoint/types/errors.d.ts +0 -9
  51. package/lib-esm/providers/pinpoint/types/errors.js +0 -12
  52. package/src/providers/pinpoint/types/errors.ts +0 -12
@@ -15,7 +15,5 @@ export type AnalyticsIdentifyUserInput<ServiceOptions extends AnalyticsServiceOp
15
15
  /**
16
16
  * Options to be passed to the API.
17
17
  */
18
- options?: {
19
- serviceOptions?: ServiceOptions;
20
- };
18
+ options?: ServiceOptions;
21
19
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Base type for service options.
3
3
  */
4
- export type AnalyticsServiceOptions = any;
4
+ export type AnalyticsServiceOptions = Record<string, unknown>;
@@ -4,8 +4,8 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.EventBuffer = void 0;
6
6
  var tslib_1 = require("tslib");
7
- var utils_1 = require("@aws-amplify/core/internals/utils");
8
- var logger = new utils_1.ConsoleLogger('EventBuffer');
7
+ var core_1 = require("@aws-amplify/core");
8
+ var logger = new core_1.ConsoleLogger('EventBuffer');
9
9
  var EventBuffer = /** @class */ (function () {
10
10
  function EventBuffer(config, getAnalyticsClient) {
11
11
  this.list = [];
@@ -3,7 +3,8 @@
3
3
  import { resolveConfig } from '../utils/resolveConfig';
4
4
  import { getAnalyticsUserAgentString, resolveCredentials, } from '../../../utils';
5
5
  import { getEventBuffer } from '../utils/getEventBuffer';
6
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
6
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
7
+ import { ConsoleLogger } from '@aws-amplify/core';
7
8
  var logger = new ConsoleLogger('Kinesis');
8
9
  /**
9
10
  * Flushes all buffered Kinesis events to the service.
@@ -4,7 +4,8 @@ import { getEventBuffer } from '../utils/getEventBuffer';
4
4
  import { resolveConfig } from '../utils/resolveConfig';
5
5
  import { getAnalyticsUserAgentString, isAnalyticsEnabled, resolveCredentials, } from '../../../utils';
6
6
  import { fromUtf8 } from '@smithy/util-utf8';
7
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
7
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
8
+ import { ConsoleLogger } from '@aws-amplify/core';
8
9
  var logger = new ConsoleLogger('Kinesis');
9
10
  export var record = function (_a) {
10
11
  var streamName = _a.streamName, partitionKey = _a.partitionKey, data = _a.data;
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { getEventBuffer, resolveConfig } from '../utils';
4
4
  import { getAnalyticsUserAgentString, resolveCredentials, } from '../../../utils';
5
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
5
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
6
+ import { ConsoleLogger } from '@aws-amplify/core';
6
7
  var logger = new ConsoleLogger('KinesisFirehose');
7
8
  /**
8
9
  * Flushes all buffered Kinesis events to the service.
@@ -3,8 +3,9 @@
3
3
  import { getEventBuffer, resolveConfig } from '../utils';
4
4
  import { getAnalyticsUserAgentString, isAnalyticsEnabled, resolveCredentials, } from '../../../utils';
5
5
  import { fromUtf8 } from '@smithy/util-utf8';
6
- import { AnalyticsAction, ConsoleLogger as Logger, } from '@aws-amplify/core/internals/utils';
7
- var logger = new Logger('KinesisFirehose');
6
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
7
+ import { ConsoleLogger } from '@aws-amplify/core';
8
+ var logger = new ConsoleLogger('KinesisFirehose');
8
9
  export var record = function (_a) {
9
10
  var streamName = _a.streamName, data = _a.data;
10
11
  if (!isAnalyticsEnabled()) {
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { getEventBuffer, resolveConfig } from '../utils';
4
4
  import { getAnalyticsUserAgentString, resolveCredentials, } from '../../../utils';
5
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
5
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
6
+ import { ConsoleLogger } from '@aws-amplify/core';
6
7
  var logger = new ConsoleLogger('Personalize');
7
8
  /**
8
9
  * Flushes all buffered Personalize events to the service.
@@ -3,7 +3,8 @@
3
3
  import { __awaiter, __generator } from "tslib";
4
4
  import { autoTrackMedia, getEventBuffer, resolveCachedSession, resolveConfig, updateCachedSession, } from '../utils';
5
5
  import { getAnalyticsUserAgentString, isAnalyticsEnabled, resolveCredentials, } from '../../../utils';
6
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
6
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
7
+ import { ConsoleLogger } from '@aws-amplify/core';
7
8
  import { IDENTIFY_EVENT_TYPE, MEDIA_AUTO_TRACK_EVENT_TYPE, } from '../utils/constants';
8
9
  var logger = new ConsoleLogger('Personalize');
9
10
  export var record = function (_a) {
@@ -1,7 +1,8 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __assign, __awaiter, __generator, __rest } from "tslib";
4
- import { ConsoleLogger, isBrowser } from '@aws-amplify/core/internals/utils';
4
+ import { isBrowser } from '@aws-amplify/core/internals/utils';
5
+ import { ConsoleLogger } from '@aws-amplify/core';
5
6
  var HTML5_MEDIA_EVENT;
6
7
  (function (HTML5_MEDIA_EVENT) {
7
8
  HTML5_MEDIA_EVENT["PLAY"] = "play";
@@ -2,7 +2,8 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { resolveConfig, resolveCredentials } from '../utils';
4
4
  import { flushEvents as flushEventsCore } from '@aws-amplify/core/internals/providers/pinpoint';
5
- import { AnalyticsAction, ConsoleLogger, } from '@aws-amplify/core/internals/utils';
5
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
6
+ import { ConsoleLogger } from '@aws-amplify/core';
6
7
  import { getAnalyticsUserAgentString } from '../../../utils';
7
8
  var logger = new ConsoleLogger('Analytics');
8
9
  /**
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __awaiter, __generator } from "tslib";
4
4
  import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
5
- import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
5
+ import { updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';
6
6
  import { getAnalyticsUserAgentString } from '../../../utils';
7
7
  import { resolveConfig, resolveCredentials } from '../utils';
8
8
  /**
@@ -54,14 +54,13 @@ export var identifyUser = function (_a) {
54
54
  var userId = _a.userId, userProfile = _a.userProfile, options = _a.options;
55
55
  return __awaiter(void 0, void 0, void 0, function () {
56
56
  var _b, credentials, identityId, _c, appId, region, userAttributes;
57
- var _d;
58
- return __generator(this, function (_e) {
59
- switch (_e.label) {
57
+ return __generator(this, function (_d) {
58
+ switch (_d.label) {
60
59
  case 0: return [4 /*yield*/, resolveCredentials()];
61
60
  case 1:
62
- _b = _e.sent(), credentials = _b.credentials, identityId = _b.identityId;
61
+ _b = _d.sent(), credentials = _b.credentials, identityId = _b.identityId;
63
62
  _c = resolveConfig(), appId = _c.appId, region = _c.region;
64
- userAttributes = ((_d = options === null || options === void 0 ? void 0 : options.serviceOptions) !== null && _d !== void 0 ? _d : {}).userAttributes;
63
+ userAttributes = (options !== null && options !== void 0 ? options : {}).userAttributes;
65
64
  updateEndpoint({
66
65
  appId: appId,
67
66
  category: 'Analytics',
@@ -1,12 +1,12 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { Hub } from '@aws-amplify/core';
4
- import { AMPLIFY_SYMBOL, AnalyticsAction, ConsoleLogger as Logger, } from '@aws-amplify/core/internals/utils';
3
+ import { Hub, ConsoleLogger } from '@aws-amplify/core';
4
+ import { AMPLIFY_SYMBOL, AnalyticsAction } from '@aws-amplify/core/internals/utils';
5
5
  import { record as recordCore } from '@aws-amplify/core/internals/providers/pinpoint';
6
6
  import { AnalyticsValidationErrorCode, assertValidationError, } from '../../../errors';
7
7
  import { getAnalyticsUserAgentString, isAnalyticsEnabled, } from '../../../utils';
8
8
  import { resolveConfig, resolveCredentials } from '../utils';
9
- var logger = new Logger('Analytics');
9
+ var logger = new ConsoleLogger('Analytics');
10
10
  /**
11
11
  * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
12
12
  *
@@ -1,3 +1,2 @@
1
- export { UpdateEndpointException } from './errors';
2
1
  export { RecordInput, IdentifyUserInput } from './inputs';
3
2
  export { IdentifyUserOptions } from './options';
@@ -1,3 +1,3 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { UpdateEndpointException } from './errors';
3
+ export {};