@aws-amplify/analytics 6.0.12-upgrade-uuid-9.20 → 6.0.12

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.0.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@6.0.11...@aws-amplify/analytics@6.0.12) (2023-01-30)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/analytics
9
+
10
+
11
+
12
+
13
+
6
14
  ## [6.0.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@6.0.10...@aws-amplify/analytics@6.0.11) (2023-01-19)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/analytics
@@ -113,7 +113,7 @@ var AWSPinpointProvider = /** @class */ (function () {
113
113
  timestamp = new Date().getTime();
114
114
  // attach the session and eventId
115
115
  this._generateSession(params);
116
- params.event.eventId = uuid_1.v4();
116
+ params.event.eventId = uuid_1.v1();
117
117
  Object.assign(params, { timestamp: timestamp, config: this._config });
118
118
  if (params.event.immediate) {
119
119
  return [2 /*return*/, this._send(params, handlers)];
@@ -161,13 +161,13 @@ var AWSPinpointProvider = /** @class */ (function () {
161
161
  this._buffer && this._buffer.push({ params: params, handlers: handlers });
162
162
  };
163
163
  AWSPinpointProvider.prototype._generateSession = function (params) {
164
- this._sessionId = this._sessionId || uuid_1.v4();
164
+ this._sessionId = this._sessionId || uuid_1.v1();
165
165
  var event = params.event;
166
166
  switch (event.name) {
167
167
  case SESSION_START:
168
168
  // refresh the session id and session start time
169
169
  this._sessionStartTimestamp = new Date().getTime();
170
- this._sessionId = uuid_1.v4();
170
+ this._sessionId = uuid_1.v1();
171
171
  event.session = {
172
172
  Id: this._sessionId,
173
173
  StartTimestamp: new Date(this._sessionStartTimestamp).toISOString(),
@@ -177,7 +177,7 @@ var AWSPinpointProvider = /** @class */ (function () {
177
177
  var stopTimestamp = new Date().getTime();
178
178
  this._sessionStartTimestamp =
179
179
  this._sessionStartTimestamp || new Date().getTime();
180
- this._sessionId = this._sessionId || uuid_1.v4();
180
+ this._sessionId = this._sessionId || uuid_1.v1();
181
181
  event.session = {
182
182
  Id: this._sessionId,
183
183
  Duration: stopTimestamp - this._sessionStartTimestamp,
@@ -190,7 +190,7 @@ var AWSPinpointProvider = /** @class */ (function () {
190
190
  default:
191
191
  this._sessionStartTimestamp =
192
192
  this._sessionStartTimestamp || new Date().getTime();
193
- this._sessionId = this._sessionId || uuid_1.v4();
193
+ this._sessionId = this._sessionId || uuid_1.v1();
194
194
  event.session = {
195
195
  Id: this._sessionId,
196
196
  StartTimestamp: new Date(this._sessionStartTimestamp).toISOString(),
@@ -515,7 +515,7 @@ var AWSPinpointProvider = /** @class */ (function () {
515
515
  endpointId = _a.sent();
516
516
  logger.debug('endpointId from cache', endpointId, 'type', typeof endpointId);
517
517
  if (!endpointId) {
518
- endpointId = uuid_1.v4();
518
+ endpointId = uuid_1.v1();
519
519
  ttl = 1000 * 60 * 60 * 24 * 365 * 100;
520
520
  expiration = new Date().getTime() + ttl;
521
521
  cache_1.Cache.setItem(cacheKey, endpointId, {
@@ -555,7 +555,7 @@ var AWSPinpointProvider = /** @class */ (function () {
555
555
  ? 'GCM'
556
556
  : 'APNS'
557
557
  : undefined;
558
- var tmp = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ channelType: channelType, requestId: uuid_1.v4(), effectiveDate: new Date().toISOString() }, defaultEndpointConfig), event), { attributes: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.attributes), event.attributes), demographic: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, demographicByClientInfo), demographicByClientContext), defaultEndpointConfig.demographic), event.demographic), location: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.location), event.location), metrics: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.metrics), event.metrics), user: {
558
+ var tmp = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ channelType: channelType, requestId: uuid_1.v1(), effectiveDate: new Date().toISOString() }, defaultEndpointConfig), event), { attributes: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.attributes), event.attributes), demographic: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, demographicByClientInfo), demographicByClientContext), defaultEndpointConfig.demographic), event.demographic), location: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.location), event.location), metrics: tslib_1.__assign(tslib_1.__assign({}, defaultEndpointConfig.metrics), event.metrics), user: {
559
559
  userId: event.userId ||
560
560
  defaultEndpointConfig.userId ||
561
561
  credentials.identityId,
@@ -18,7 +18,7 @@ var SessionInfoManager = /** @class */ (function () {
18
18
  function SessionInfoManager(prefixKey) {
19
19
  if (prefixKey === void 0) { prefixKey = ''; }
20
20
  this._isBrowser = core_1.browserOrNode().isBrowser;
21
- this._timerKey = uuid_1.v4().substr(0, 15);
21
+ this._timerKey = uuid_1.v1().substr(0, 15);
22
22
  this._refreshTimer();
23
23
  }
24
24
  SessionInfoManager.prototype._refreshTimer = function () {
@@ -27,7 +27,7 @@ var SessionInfoManager = /** @class */ (function () {
27
27
  }
28
28
  var that = this;
29
29
  this._timer = setInterval(function () {
30
- that._timerKey = uuid_1.v4().substr(0, 15);
30
+ that._timerKey = uuid_1.v1().substr(0, 15);
31
31
  }, TIMER_INTERVAL);
32
32
  };
33
33
  SessionInfoManager.prototype.storeValue = function (key, value) {
@@ -54,7 +54,7 @@ var SessionInfoManager = /** @class */ (function () {
54
54
  var existUserId = sessionInfo.userId;
55
55
  var existSessionId = sessionInfo.sessionId;
56
56
  if (this._isRequireNewSession(userId, existUserId, existSessionId)) {
57
- var newSessionId = uuid_1.v4();
57
+ var newSessionId = uuid_1.v1();
58
58
  this.storeValue(PERSONALIZE_CACHE_USERID, userId);
59
59
  this.storeValue(PERSONALIZE_CACHE_SESSIONID, newSessionId);
60
60
  sessionInfo.sessionId = newSessionId;
@@ -75,7 +75,7 @@ var SessionInfoManager = /** @class */ (function () {
75
75
  sessionInfo.sessionId = this.retrieveValue(PERSONALIZE_CACHE_SESSIONID);
76
76
  sessionInfo.userId = this.retrieveValue(PERSONALIZE_CACHE_USERID);
77
77
  if (isEmpty_1.default(sessionInfo.sessionId)) {
78
- sessionInfo.sessionId = uuid_1.v4();
78
+ sessionInfo.sessionId = uuid_1.v1();
79
79
  this.storeValue(PERSONALIZE_CACHE_SESSIONID, sessionInfo.sessionId);
80
80
  }
81
81
  this.storeValue(PERSONALIZE_CACHE, trackingId);
@@ -14,4 +14,4 @@ var PageViewTracker = /** @class */ (function () {
14
14
  return PageViewTracker;
15
15
  }());
16
16
  exports.PageViewTracker = PageViewTracker;
17
- //# sourceMappingURL=index.native.js.map
17
+ //# sourceMappingURL=reactnative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactnative.js","sourceRoot":"","sources":["../../src/trackers/reactnative.ts"],"names":[],"mappings":";;AAAA,yDAAqD;AAUb,yBAV/B,kCAAc,CAU+B;AARtD;IACC,sBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,mBAAC;AAAD,CAAC,AAFD,IAEC;AAMQ,oCAAY;AAJrB;IACC,yBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,sBAAC;AAAD,CAAC,AAFD,IAEC;AAEsB,0CAAe"}
@@ -4,7 +4,7 @@ import { __assign, __awaiter, __generator, __rest } from "tslib";
4
4
  import { ConsoleLogger as Logger, ClientDevice, Credentials, Signer, Hub, getAmplifyUserAgent, transferKeyToLowerCase, transferKeyToUpperCase, } from '@aws-amplify/core';
5
5
  import { PinpointClient, PutEventsCommand, UpdateEndpointCommand, } from '@aws-sdk/client-pinpoint';
6
6
  import { Cache } from '@aws-amplify/cache';
7
- import { v4 as uuid } from 'uuid';
7
+ import { v1 as uuid } from 'uuid';
8
8
  import EventsBuffer from './EventBuffer';
9
9
  var AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
10
10
  ? Symbol.for('amplify_default')
@@ -1,6 +1,6 @@
1
1
  import isEmpty from 'lodash/isEmpty';
2
2
  import isEqual from 'lodash/isEqual';
3
- import { v4 as uuid } from 'uuid';
3
+ import { v1 as uuid } from 'uuid';
4
4
  import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core';
5
5
  import { Cache } from '@aws-amplify/cache';
6
6
  var PERSONALIZE_CACHE = '_awsct';
@@ -10,4 +10,4 @@ var PageViewTracker = /** @class */ (function () {
10
10
  return PageViewTracker;
11
11
  }());
12
12
  export { EventTracker, PageViewTracker, SessionTracker };
13
- //# sourceMappingURL=index.native.js.map
13
+ //# sourceMappingURL=reactnative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactnative.js","sourceRoot":"","sources":["../../src/trackers/reactnative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IACC,sBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,mBAAC;AAAD,CAAC,AAFD,IAEC;AAED;IACC,yBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,sBAAC;AAAD,CAAC,AAFD,IAEC;AAED,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/analytics",
3
- "version": "6.0.12-upgrade-uuid-9.20+4f041443a",
3
+ "version": "6.0.12",
4
4
  "description": "Analytics category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -27,6 +27,10 @@
27
27
  "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
28
28
  "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 69.26"
29
29
  },
30
+ "react-native": {
31
+ "./lib/index": "./lib-esm/index.js",
32
+ "./lib-esm/trackers": "./lib-esm/trackers/reactnative.js"
33
+ },
30
34
  "repository": {
31
35
  "type": "git",
32
36
  "url": "https://github.com/aws-amplify/amplify-js.git"
@@ -43,8 +47,8 @@
43
47
  "src"
44
48
  ],
45
49
  "dependencies": {
46
- "@aws-amplify/cache": "5.0.12-upgrade-uuid-9.20+4f041443a",
47
- "@aws-amplify/core": "5.0.12-upgrade-uuid-9.20+4f041443a",
50
+ "@aws-amplify/cache": "5.0.12",
51
+ "@aws-amplify/core": "5.0.12",
48
52
  "@aws-sdk/client-firehose": "3.6.1",
49
53
  "@aws-sdk/client-kinesis": "3.6.1",
50
54
  "@aws-sdk/client-personalize-events": "3.6.1",
@@ -52,17 +56,14 @@
52
56
  "@aws-sdk/util-utf8-browser": "3.6.1",
53
57
  "lodash": "^4.17.20",
54
58
  "tslib": "^1.8.0",
55
- "uuid": "9.0.0"
56
- },
57
- "devDependencies": {
58
- "react-native-get-random-values": "1.8.0"
59
+ "uuid": "^3.2.1"
59
60
  },
60
61
  "size-limit": [
61
62
  {
62
63
  "name": "Analytics (Pinpoint)",
63
64
  "path": "./lib-esm/index.js",
64
65
  "import": "{ Amplify, Analytics, AWSPinpointProvider }",
65
- "limit": "56.75 kB"
66
+ "limit": "56.5 kB"
66
67
  },
67
68
  {
68
69
  "name": "Analytics (Kinesis)",
@@ -119,5 +120,5 @@
119
120
  "<rootDir>/src/setupTests.ts"
120
121
  ]
121
122
  },
122
- "gitHead": "4f041443af1debc25dacd3b1da112d776bfd78fd"
123
+ "gitHead": "4794e2d8e9fe102c7108b6d63071bd71af07f76b"
123
124
  }
@@ -28,7 +28,7 @@ import {
28
28
  EventObject,
29
29
  EndpointFailureData,
30
30
  } from '../types';
31
- import { v4 as uuid } from 'uuid';
31
+ import { v1 as uuid } from 'uuid';
32
32
  import EventsBuffer from './EventBuffer';
33
33
 
34
34
  const AMPLIFY_SYMBOL = (
@@ -3,7 +3,7 @@
3
3
  import { SessionInfo } from './DataType';
4
4
  import isEmpty from 'lodash/isEmpty';
5
5
  import isEqual from 'lodash/isEqual';
6
- import { v4 as uuid } from 'uuid';
6
+ import { v1 as uuid } from 'uuid';
7
7
  import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core';
8
8
  import { Cache } from '@aws-amplify/cache';
9
9
 
File without changes
@@ -1,4 +0,0 @@
1
- import 'react-native-get-random-values';
2
- export { Analytics } from './Analytics';
3
- export { AnalyticsProvider } from './types';
4
- export { AWSPinpointProvider, AWSKinesisProvider, AWSKinesisFirehoseProvider, AmazonPersonalizeProvider, } from './Providers';
@@ -1,13 +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
- require("react-native-get-random-values");
6
- var Analytics_1 = require("./Analytics");
7
- exports.Analytics = Analytics_1.Analytics;
8
- var Providers_1 = require("./Providers");
9
- exports.AWSPinpointProvider = Providers_1.AWSPinpointProvider;
10
- exports.AWSKinesisProvider = Providers_1.AWSKinesisProvider;
11
- exports.AWSKinesisFirehoseProvider = Providers_1.AWSKinesisFirehoseProvider;
12
- exports.AmazonPersonalizeProvider = Providers_1.AmazonPersonalizeProvider;
13
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,0CAAwC;AAExC,yCAAwC;AAA/B,gCAAA,SAAS,CAAA;AAElB,yCAKqB;AAJpB,0CAAA,mBAAmB,CAAA;AACnB,yCAAA,kBAAkB,CAAA;AAClB,iDAAA,0BAA0B,CAAA;AAC1B,gDAAA,yBAAyB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/trackers/index.native.ts"],"names":[],"mappings":";;AAAA,yDAAqD;AAUb,yBAV/B,kCAAc,CAU+B;AARtD;IACC,sBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,mBAAC;AAAD,CAAC,AAFD,IAEC;AAMQ,oCAAY;AAJrB;IACC,yBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,sBAAC;AAAD,CAAC,AAFD,IAEC;AAEsB,0CAAe"}
@@ -1,4 +0,0 @@
1
- import 'react-native-get-random-values';
2
- export { Analytics } from './Analytics';
3
- export { AnalyticsProvider } from './types';
4
- export { AWSPinpointProvider, AWSKinesisProvider, AWSKinesisFirehoseProvider, AmazonPersonalizeProvider, } from './Providers';
@@ -1,6 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import 'react-native-get-random-values';
4
- export { Analytics } from './Analytics';
5
- export { AWSPinpointProvider, AWSKinesisProvider, AWSKinesisFirehoseProvider, AmazonPersonalizeProvider, } from './Providers';
6
- //# sourceMappingURL=index.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/trackers/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IACC,sBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,mBAAC;AAAD,CAAC,AAFD,IAEC;AAED;IACC,yBAAY,OAAO,EAAE,IAAI;IAAG,CAAC;IAC9B,sBAAC;AAAD,CAAC,AAFD,IAEC;AAED,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import 'react-native-get-random-values';
5
-
6
- export { Analytics } from './Analytics';
7
- export { AnalyticsProvider } from './types';
8
- export {
9
- AWSPinpointProvider,
10
- AWSKinesisProvider,
11
- AWSKinesisFirehoseProvider,
12
- AmazonPersonalizeProvider,
13
- } from './Providers';