@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>;
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { __read, __spreadArray, __values } from "tslib";
4
- import { ConsoleLogger } from '@aws-amplify/core/internals/utils';
4
+ import { ConsoleLogger } from '@aws-amplify/core';
5
5
  var logger = new ConsoleLogger('EventBuffer');
6
6
  var EventBuffer = /** @class */ (function () {
7
7
  function EventBuffer(config, getAnalyticsClient) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/analytics",
3
- "version": "7.0.1-console-preview.8f82e46.0+8f82e46",
3
+ "version": "7.0.1-console-preview.8d88eef.0+8d88eef",
4
4
  "description": "Analytics category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -99,10 +99,10 @@
99
99
  "tslib": "^2.5.0"
100
100
  },
101
101
  "peerDependencies": {
102
- "@aws-amplify/core": "6.0.1-console-preview.8f82e46.0+8f82e46"
102
+ "@aws-amplify/core": "6.0.1-console-preview.8d88eef.0+8d88eef"
103
103
  },
104
104
  "devDependencies": {
105
- "@aws-amplify/core": "6.0.1-console-preview.8f82e46.0+8f82e46",
105
+ "@aws-amplify/core": "6.0.1-console-preview.8d88eef.0+8d88eef",
106
106
  "@aws-sdk/types": "3.398.0",
107
107
  "typescript": "5.0.2"
108
108
  },
@@ -150,5 +150,5 @@
150
150
  "<rootDir>/src/setupTests.ts"
151
151
  ]
152
152
  },
153
- "gitHead": "8f82e460c4cdb9e52e0ba7ed8aea90f627a27693"
153
+ "gitHead": "8d88eef4137cef4fbe03d7d3683b5bec59feb7b8"
154
154
  }
@@ -7,10 +7,8 @@ import {
7
7
  resolveCredentials,
8
8
  } from '../../../utils';
9
9
  import { getEventBuffer } from '../utils/getEventBuffer';
10
- import {
11
- AnalyticsAction,
12
- ConsoleLogger,
13
- } from '@aws-amplify/core/internals/utils';
10
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
11
+ import { ConsoleLogger } from '@aws-amplify/core';
14
12
 
15
13
  const logger = new ConsoleLogger('Kinesis');
16
14
 
@@ -10,10 +10,8 @@ import {
10
10
  resolveCredentials,
11
11
  } from '../../../utils';
12
12
  import { fromUtf8 } from '@smithy/util-utf8';
13
- import {
14
- AnalyticsAction,
15
- ConsoleLogger,
16
- } from '@aws-amplify/core/internals/utils';
13
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
14
+ import { ConsoleLogger } from '@aws-amplify/core';
17
15
 
18
16
  const logger = new ConsoleLogger('Kinesis');
19
17
 
@@ -6,10 +6,8 @@ import {
6
6
  getAnalyticsUserAgentString,
7
7
  resolveCredentials,
8
8
  } from '../../../utils';
9
- import {
10
- AnalyticsAction,
11
- ConsoleLogger,
12
- } from '@aws-amplify/core/internals/utils';
9
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
10
+ import { ConsoleLogger } from '@aws-amplify/core';
13
11
 
14
12
  const logger = new ConsoleLogger('KinesisFirehose');
15
13
 
@@ -9,12 +9,10 @@ import {
9
9
  resolveCredentials,
10
10
  } from '../../../utils';
11
11
  import { fromUtf8 } from '@smithy/util-utf8';
12
- import {
13
- AnalyticsAction,
14
- ConsoleLogger as Logger,
15
- } from '@aws-amplify/core/internals/utils';
12
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
13
+ import { ConsoleLogger } from '@aws-amplify/core';
16
14
 
17
- const logger = new Logger('KinesisFirehose');
15
+ const logger = new ConsoleLogger('KinesisFirehose');
18
16
 
19
17
  export const record = ({ streamName, data }: RecordInput): void => {
20
18
  if (!isAnalyticsEnabled()) {
@@ -6,10 +6,8 @@ import {
6
6
  getAnalyticsUserAgentString,
7
7
  resolveCredentials,
8
8
  } from '../../../utils';
9
- import {
10
- AnalyticsAction,
11
- ConsoleLogger,
12
- } from '@aws-amplify/core/internals/utils';
9
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
10
+ import { ConsoleLogger } from '@aws-amplify/core';
13
11
 
14
12
  const logger = new ConsoleLogger('Personalize');
15
13
 
@@ -14,10 +14,8 @@ import {
14
14
  isAnalyticsEnabled,
15
15
  resolveCredentials,
16
16
  } from '../../../utils';
17
- import {
18
- AnalyticsAction,
19
- ConsoleLogger,
20
- } from '@aws-amplify/core/internals/utils';
17
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
18
+ import { ConsoleLogger } from '@aws-amplify/core';
21
19
  import {
22
20
  IDENTIFY_EVENT_TYPE,
23
21
  MEDIA_AUTO_TRACK_EVENT_TYPE,
@@ -3,7 +3,8 @@
3
3
 
4
4
  import { EventBuffer } from '../../../utils';
5
5
  import { PersonalizeBufferEvent, PersonalizeEvent } from '../types';
6
- import { ConsoleLogger, isBrowser } from '@aws-amplify/core/internals/utils';
6
+ import { isBrowser } from '@aws-amplify/core/internals/utils';
7
+ import { ConsoleLogger } from '@aws-amplify/core';
7
8
 
8
9
  enum HTML5_MEDIA_EVENT {
9
10
  'PLAY' = 'play',
@@ -3,10 +3,8 @@
3
3
 
4
4
  import { resolveConfig, resolveCredentials } from '../utils';
5
5
  import { flushEvents as flushEventsCore } from '@aws-amplify/core/internals/providers/pinpoint';
6
- import {
7
- AnalyticsAction,
8
- ConsoleLogger,
9
- } from '@aws-amplify/core/internals/utils';
6
+ import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
7
+ import { ConsoleLogger } from '@aws-amplify/core';
10
8
  import { getAnalyticsUserAgentString } from '../../../utils';
11
9
 
12
10
  const logger = new ConsoleLogger('Analytics');
@@ -2,10 +2,13 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { AnalyticsAction } from '@aws-amplify/core/internals/utils';
5
- import { updateEndpoint } from '@aws-amplify/core/internals/providers/pinpoint';
5
+ import {
6
+ updateEndpoint,
7
+ UpdateEndpointException,
8
+ } from '@aws-amplify/core/internals/providers/pinpoint';
6
9
  import { AnalyticsValidationErrorCode } from '../../../errors';
7
10
  import { getAnalyticsUserAgentString } from '../../../utils';
8
- import { IdentifyUserInput, UpdateEndpointException } from '../types';
11
+ import { IdentifyUserInput } from '../types';
9
12
  import { resolveConfig, resolveCredentials } from '../utils';
10
13
 
11
14
  /**
@@ -60,7 +63,7 @@ export const identifyUser = async ({
60
63
  }: IdentifyUserInput): Promise<void> => {
61
64
  const { credentials, identityId } = await resolveCredentials();
62
65
  const { appId, region } = resolveConfig();
63
- const { userAttributes } = options?.serviceOptions ?? {};
66
+ const { userAttributes } = options ?? {};
64
67
  updateEndpoint({
65
68
  appId,
66
69
  category: 'Analytics',
@@ -1,11 +1,10 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { Hub } from '@aws-amplify/core';
4
+ import { Hub, ConsoleLogger } from '@aws-amplify/core';
5
5
  import {
6
6
  AMPLIFY_SYMBOL,
7
- AnalyticsAction,
8
- ConsoleLogger as Logger,
7
+ AnalyticsAction
9
8
  } from '@aws-amplify/core/internals/utils';
10
9
  import { record as recordCore } from '@aws-amplify/core/internals/providers/pinpoint';
11
10
  import {
@@ -19,7 +18,7 @@ import {
19
18
  import { RecordInput } from '../types';
20
19
  import { resolveConfig, resolveCredentials } from '../utils';
21
20
 
22
- const logger = new Logger('Analytics');
21
+ const logger = new ConsoleLogger('Analytics');
23
22
 
24
23
  /**
25
24
  * Records an Analytic event to Pinpoint. Events will be buffered and periodically sent to Pinpoint.
@@ -1,6 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export { UpdateEndpointException } from './errors';
5
4
  export { RecordInput, IdentifyUserInput } from './inputs';
6
5
  export { IdentifyUserOptions } from './options';
@@ -23,7 +23,5 @@ export type AnalyticsIdentifyUserInput<
23
23
  /**
24
24
  * Options to be passed to the API.
25
25
  */
26
- options?: {
27
- serviceOptions?: ServiceOptions;
28
- };
26
+ options?: ServiceOptions;
29
27
  };
@@ -4,4 +4,4 @@
4
4
  /**
5
5
  * Base type for service options.
6
6
  */
7
- export type AnalyticsServiceOptions = any;
7
+ export type AnalyticsServiceOptions = Record<string, unknown>;
@@ -1,7 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { ConsoleLogger } from '@aws-amplify/core/internals/utils';
4
+ import { ConsoleLogger } from '@aws-amplify/core';
5
5
  import { EventBufferConfig, IAnalyticsClient } from './';
6
6
 
7
7
  const logger = new ConsoleLogger('EventBuffer');
@@ -1,9 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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
- exports.UpdateEndpointException = void 0;
6
- var UpdateEndpointException;
7
- (function (UpdateEndpointException) {
8
- UpdateEndpointException["BadRequestException"] = "BadRequestException";
9
- UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
10
- UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
11
- UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
12
- UpdateEndpointException["NotFoundException"] = "NotFoundException";
13
- UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
14
- UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
15
- })(UpdateEndpointException = exports.UpdateEndpointException || (exports.UpdateEndpointException = {}));
@@ -1,9 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- export var UpdateEndpointException;
4
- (function (UpdateEndpointException) {
5
- UpdateEndpointException["BadRequestException"] = "BadRequestException";
6
- UpdateEndpointException["ForbiddenException"] = "ForbiddenException";
7
- UpdateEndpointException["InternalServerErrorException"] = "InternalServerErrorException";
8
- UpdateEndpointException["MethodNotAllowedException"] = "MethodNotAllowedException";
9
- UpdateEndpointException["NotFoundException"] = "NotFoundException";
10
- UpdateEndpointException["PayloadTooLargeException"] = "PayloadTooLargeException";
11
- UpdateEndpointException["TooManyRequestsException"] = "TooManyRequestsException";
12
- })(UpdateEndpointException || (UpdateEndpointException = {}));
@@ -1,12 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- export enum UpdateEndpointException {
5
- BadRequestException = 'BadRequestException',
6
- ForbiddenException = 'ForbiddenException',
7
- InternalServerErrorException = 'InternalServerErrorException',
8
- MethodNotAllowedException = 'MethodNotAllowedException',
9
- NotFoundException = 'NotFoundException',
10
- PayloadTooLargeException = 'PayloadTooLargeException',
11
- TooManyRequestsException = 'TooManyRequestsException',
12
- }