@aws-amplify/analytics 5.2.28 → 5.2.29-unstable.2
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 +0 -8
- package/lib/.tsbuildinfo +3 -0
- package/lib/Analytics.d.ts +87 -0
- package/lib/Analytics.js +53 -95
- package/lib/Analytics.js.map +1 -1
- package/lib/Providers/AWSKinesisFirehoseProvider.d.ts +12 -0
- package/lib/Providers/AWSKinesisFirehoseProvider.js +4 -30
- package/lib/Providers/AWSKinesisFirehoseProvider.js.map +1 -1
- package/lib/Providers/AWSKinesisProvider.d.ts +43 -0
- package/lib/Providers/AWSKinesisProvider.js +7 -56
- package/lib/Providers/AWSKinesisProvider.js.map +1 -1
- package/lib/Providers/AWSPinpointProvider.d.ts +70 -0
- package/lib/Providers/AWSPinpointProvider.js +32 -107
- package/lib/Providers/AWSPinpointProvider.js.map +1 -1
- package/lib/Providers/AmazonPersonalizeHelper/DataType.d.ts +40 -0
- package/lib/Providers/AmazonPersonalizeHelper/MediaAutoTrack.d.ts +20 -0
- package/lib/Providers/AmazonPersonalizeHelper/MediaAutoTrack.js.map +1 -1
- package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.d.ts +17 -0
- package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.js +7 -9
- package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.js.map +1 -1
- package/lib/Providers/AmazonPersonalizeHelper/index.d.ts +3 -0
- package/lib/Providers/AmazonPersonalizeHelper/index.js +4 -5
- package/lib/Providers/AmazonPersonalizeHelper/index.js.map +1 -1
- package/lib/Providers/AmazonPersonalizeProvider.d.ts +76 -0
- package/lib/Providers/AmazonPersonalizeProvider.js +9 -61
- package/lib/Providers/AmazonPersonalizeProvider.js.map +1 -1
- package/lib/Providers/EventBuffer.d.ts +30 -0
- package/lib/Providers/EventBuffer.js +7 -62
- package/lib/Providers/EventBuffer.js.map +1 -1
- package/lib/Providers/index.d.ts +4 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +7 -20
- package/lib/index.js.map +1 -1
- package/lib/setupTests.d.ts +1 -0
- package/lib/trackers/EventTracker.d.ts +9 -0
- package/lib/trackers/EventTracker.js +6 -55
- package/lib/trackers/EventTracker.js.map +1 -1
- package/lib/trackers/PageViewTracker.d.ts +12 -0
- package/lib/trackers/PageViewTracker.js +11 -60
- package/lib/trackers/PageViewTracker.js.map +1 -1
- package/lib/trackers/SessionTracker-rn.d.ts +12 -0
- package/lib/trackers/SessionTracker-rn.js +7 -56
- package/lib/trackers/SessionTracker-rn.js.map +1 -1
- package/lib/trackers/SessionTracker.d.ts +14 -0
- package/lib/trackers/SessionTracker.js +8 -57
- package/lib/trackers/SessionTracker.js.map +1 -1
- package/lib/trackers/index.d.ts +3 -0
- package/lib/trackers/index.js +3 -3
- package/lib/trackers/index.js.map +1 -1
- package/lib/trackers/reactnative.d.ts +8 -0
- package/lib/types/Analytics.d.ts +66 -0
- package/lib/types/Provider.d.ts +10 -0
- package/lib/types/Provider.js +2 -12
- package/lib/types/Provider.js.map +1 -1
- package/lib/types/Providers/AWSKinesisProvider.d.ts +5 -0
- package/lib/types/Providers/AWSPinpointProvider.d.ts +50 -0
- package/lib/types/Providers/AmazonPersonalizeProvider.d.ts +7 -0
- package/lib/types/Providers/index.d.ts +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +2 -12
- package/lib/types/index.js.map +1 -1
- package/lib/utils/AppUtils.d.ts +2 -0
- package/lib/utils/AppUtils.native.d.ts +2 -0
- package/lib/utils/MethodEmbed.d.ts +11 -0
- package/lib/utils/MethodEmbed.js +4 -37
- package/lib/utils/MethodEmbed.js.map +1 -1
- package/lib/vendor/dom-utils/closest.d.ts +12 -0
- package/lib/vendor/dom-utils/delegate.d.ts +18 -0
- package/lib/vendor/dom-utils/dispatch.d.ts +17 -0
- package/lib/vendor/dom-utils/get-attributes.d.ts +11 -0
- package/lib/vendor/dom-utils/index.d.ts +7 -0
- package/lib/vendor/dom-utils/matches.d.ts +11 -0
- package/lib/vendor/dom-utils/matches.js +1 -1
- package/lib/vendor/dom-utils/matches.js.map +1 -1
- package/lib/vendor/dom-utils/parents.d.ts +10 -0
- package/lib/vendor/dom-utils/parse-url.d.ts +9 -0
- package/lib/vendor/dom-utils/parse-url.js +1 -1
- package/lib/vendor/dom-utils/parse-url.js.map +1 -1
- package/lib-esm/.tsbuildinfo +3 -0
- package/lib-esm/Analytics.d.ts +3 -12
- package/lib-esm/Analytics.js +41 -83
- package/lib-esm/Analytics.js.map +1 -1
- package/lib-esm/Providers/AWSKinesisFirehoseProvider.d.ts +0 -4
- package/lib-esm/Providers/AWSKinesisFirehoseProvider.js +3 -29
- package/lib-esm/Providers/AWSKinesisFirehoseProvider.js.map +1 -1
- package/lib-esm/Providers/AWSKinesisProvider.d.ts +0 -4
- package/lib-esm/Providers/AWSKinesisProvider.js +3 -52
- package/lib-esm/Providers/AWSKinesisProvider.js.map +1 -1
- package/lib-esm/Providers/AWSPinpointProvider.d.ts +0 -4
- package/lib-esm/Providers/AWSPinpointProvider.js +8 -80
- package/lib-esm/Providers/AWSPinpointProvider.js.map +1 -1
- package/lib-esm/Providers/AmazonPersonalizeHelper/MediaAutoTrack.js.map +1 -1
- package/lib-esm/Providers/AmazonPersonalizeHelper/SessionInfoManager.js +3 -3
- package/lib-esm/Providers/AmazonPersonalizeHelper/SessionInfoManager.js.map +1 -1
- package/lib-esm/Providers/AmazonPersonalizeHelper/index.d.ts +3 -3
- package/lib-esm/Providers/AmazonPersonalizeHelper/index.js +2 -2
- package/lib-esm/Providers/AmazonPersonalizeHelper/index.js.map +1 -1
- package/lib-esm/Providers/AmazonPersonalizeProvider.d.ts +0 -4
- package/lib-esm/Providers/AmazonPersonalizeProvider.js +5 -54
- package/lib-esm/Providers/AmazonPersonalizeProvider.js.map +1 -1
- package/lib-esm/Providers/EventBuffer.js +1 -56
- package/lib-esm/Providers/EventBuffer.js.map +1 -1
- package/lib-esm/index.d.ts +3 -8
- package/lib-esm/index.js +4 -19
- package/lib-esm/index.js.map +1 -1
- package/lib-esm/trackers/EventTracker.d.ts +0 -4
- package/lib-esm/trackers/EventTracker.js +5 -54
- package/lib-esm/trackers/EventTracker.js.map +1 -1
- package/lib-esm/trackers/PageViewTracker.d.ts +0 -4
- package/lib-esm/trackers/PageViewTracker.js +8 -57
- package/lib-esm/trackers/PageViewTracker.js.map +1 -1
- package/lib-esm/trackers/SessionTracker-rn.d.ts +0 -4
- package/lib-esm/trackers/SessionTracker-rn.js +3 -52
- package/lib-esm/trackers/SessionTracker-rn.js.map +1 -1
- package/lib-esm/trackers/SessionTracker.d.ts +0 -4
- package/lib-esm/trackers/SessionTracker.js +5 -54
- package/lib-esm/trackers/SessionTracker.js.map +1 -1
- package/lib-esm/trackers/index.d.ts +3 -3
- package/lib-esm/trackers/index.js +3 -3
- package/lib-esm/trackers/index.js.map +1 -1
- package/lib-esm/types/Provider.js +2 -12
- package/lib-esm/types/Provider.js.map +1 -1
- package/lib-esm/types/index.js +2 -12
- package/lib-esm/types/index.js.map +1 -1
- package/lib-esm/utils/MethodEmbed.d.ts +0 -4
- package/lib-esm/utils/MethodEmbed.js +3 -36
- package/lib-esm/utils/MethodEmbed.js.map +1 -1
- package/lib-esm/vendor/dom-utils/matches.js +2 -2
- package/lib-esm/vendor/dom-utils/matches.js.map +1 -1
- package/lib-esm/vendor/dom-utils/parse-url.js +2 -2
- package/lib-esm/vendor/dom-utils/parse-url.js.map +1 -1
- package/package.json +13 -9
- package/src/Analytics.ts +48 -54
- package/src/Providers/AWSKinesisFirehoseProvider.ts +2 -17
- package/src/Providers/AWSKinesisProvider.ts +2 -17
- package/src/Providers/AWSPinpointProvider.ts +12 -25
- package/src/Providers/AmazonPersonalizeHelper/DataType.ts +2 -12
- package/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts +2 -12
- package/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts +5 -16
- package/src/Providers/AmazonPersonalizeHelper/index.ts +11 -15
- package/src/Providers/AmazonPersonalizeProvider.ts +6 -23
- package/src/index.ts +10 -21
- package/src/trackers/EventTracker.ts +4 -19
- package/src/trackers/PageViewTracker.ts +7 -22
- package/src/trackers/SessionTracker-rn.ts +2 -17
- package/src/trackers/SessionTracker.ts +9 -19
- package/src/trackers/index.ts +3 -3
- package/src/types/Analytics.ts +2 -12
- package/src/types/Provider.ts +2 -12
- package/src/types/index.ts +2 -12
- package/src/utils/MethodEmbed.ts +2 -17
- package/src/vendor/dom-utils/matches.ts +2 -2
- package/src/vendor/dom-utils/parse-url.ts +2 -2
- package/build.js +0 -5
- package/dist/aws-amplify-analytics.js +0 -67617
- package/dist/aws-amplify-analytics.js.map +0 -1
- package/dist/aws-amplify-analytics.min.js +0 -26
- package/dist/aws-amplify-analytics.min.js.map +0 -1
- package/index.js +0 -7
- package/webpack.config.dev.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matches.js","sourceRoot":"","sources":["../../../src/vendor/dom-utils/matches.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"matches.js","sourceRoot":"","sources":["../../../src/vendor/dom-utils/matches.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,IAAM,KAAK,GACV,aAAa,EAAE,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC;IAC7C,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS;IAC7B,CAAC,CAAC,IAAI,CAAC;AAET,IAAM,aAAa,GAAG,KAAK;IAC1B,CAAC,CAAC,KAAK,CAAC,OAAO;QACb,aAAa;QACb,KAAK,CAAC,eAAe;QACrB,aAAa;QACb,KAAK,CAAC,qBAAqB;QAC3B,aAAa;QACb,KAAK,CAAC,kBAAkB;QACxB,aAAa;QACb,KAAK,CAAC,iBAAiB;QACvB,aAAa;QACb,KAAK,CAAC,gBAAgB;IACxB,CAAC,CAAC,IAAI,CAAC;AAER;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,OAAO,EAAE,IAAI;IACpC,kBAAkB;IAClB,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,IAAI,IAAI,EAAE;QAC9C,8CAA8C;QAC9C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,EAAE;YACpD,OAAO,CACN,OAAO,KAAK,IAAI,IAAI,eAAe,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,CACxE,CAAC;SACF;aAAM,IAAI,QAAQ,IAAI,IAAI,EAAE;YAC5B,qDAAqD;YACrD,gCAAgC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,SAAA,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC5C,IAAI,OAAO,KAAK,IAAI,IAAI,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC;oBAAE,OAAO,IAAI,CAAC;aACpE;SACD;KACD;IACD,2BAA2B;IAC3B,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,OAAO,EAAE,QAAQ;IACzC,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC/C,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC5D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,SAAA,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7C,IAAI,IAAI,KAAK,OAAO;YAAE,OAAO,IAAI,CAAC;KAClC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { browserOrNode } from '@aws-amplify/core';
|
|
5
5
|
var HTTP_PORT = '80';
|
|
6
6
|
var HTTPS_PORT = '443';
|
|
7
7
|
var DEFAULT_PORT = RegExp(':(' + HTTP_PORT + '|' + HTTPS_PORT + ')$');
|
|
8
|
-
var a =
|
|
8
|
+
var a = browserOrNode().isBrowser ? document.createElement('a') : null;
|
|
9
9
|
var cache = {};
|
|
10
10
|
/**
|
|
11
11
|
* Parses the given url and returns an object mimicing a `Location` object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-url.js","sourceRoot":"","sources":["../../../src/vendor/dom-utils/parse-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"parse-url.js","sourceRoot":"","sources":["../../../src/vendor/dom-utils/parse-url.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,IAAM,SAAS,GAAG,IAAI,CAAC;AACvB,IAAM,UAAU,GAAG,KAAK,CAAC;AACzB,IAAM,YAAY,GAAG,MAAM,CAAC,IAAI,GAAG,SAAS,GAAG,GAAG,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;AAExE,IAAM,CAAC,GAAG,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,IAAM,KAAK,GAAG,EAAE,CAAC;AAEjB;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAC;IACzB,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,mEAAmE;IACnE,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAEhD,IAAI,KAAK,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;IAEb,6EAA6E;IAC7E,6EAA6E;IAC7E,6EAA6E;IAC7E,8EAA8E;IAC9E,qDAAqD;IACrD,2EAA2E;IAC3E,mBAAmB;IACnB,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE5E,+BAA+B;IAC/B,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvE,gEAAgE;IAChE,IAAI,GAAG,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAEhC,6DAA6D;IAC7D,oEAAoE;IACpE,wBAAwB;IACxB,IAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IAE9C,2DAA2D;IAC3D,IAAM,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;IAEpE,+DAA+D;IAC/D,wBAAwB;IACxB,IAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC;IAE9E,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,MAAA;QACJ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,QAAA;QACN,QAAQ,UAAA;QACR,IAAI,MAAA;QACJ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM;KAChB,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/analytics",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.29-unstable.2+55e13f5a7",
|
|
4
4
|
"description": "Analytics category of aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
7
7
|
"typings": "./lib-esm/index.d.ts",
|
|
8
8
|
"sideEffects": [
|
|
9
|
-
"./src/Analytics.ts",
|
|
10
9
|
"./lib/Analytics.js",
|
|
11
|
-
"./lib-esm/Analytics.js"
|
|
12
|
-
"./dist/aws-amplify-analytics.js",
|
|
13
|
-
"./dist/aws-amplify-analytics.min.js"
|
|
10
|
+
"./lib-esm/Analytics.js"
|
|
14
11
|
],
|
|
15
12
|
"publishConfig": {
|
|
16
13
|
"access": "public"
|
|
@@ -26,7 +23,8 @@
|
|
|
26
23
|
"build": "npm run clean && npm run build:esm && npm run build:cjs",
|
|
27
24
|
"clean": "rimraf lib-esm lib dist",
|
|
28
25
|
"format": "echo \"Not implemented\"",
|
|
29
|
-
"lint": "tslint 'src/**/*.ts'"
|
|
26
|
+
"lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
|
|
27
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 69.26"
|
|
30
28
|
},
|
|
31
29
|
"react-native": {
|
|
32
30
|
"./lib/index": "./lib-esm/index.js",
|
|
@@ -42,15 +40,21 @@
|
|
|
42
40
|
"url": "https://github.com/aws/aws-amplify/issues"
|
|
43
41
|
},
|
|
44
42
|
"homepage": "https://aws-amplify.github.io/",
|
|
43
|
+
"files": [
|
|
44
|
+
"lib",
|
|
45
|
+
"lib-esm",
|
|
46
|
+
"src"
|
|
47
|
+
],
|
|
45
48
|
"dependencies": {
|
|
46
|
-
"@aws-amplify/cache": "4.0.
|
|
47
|
-
"@aws-amplify/core": "4.7.
|
|
49
|
+
"@aws-amplify/cache": "4.0.64-unstable.2+55e13f5a7",
|
|
50
|
+
"@aws-amplify/core": "4.7.13-unstable.2+55e13f5a7",
|
|
48
51
|
"@aws-sdk/client-firehose": "3.6.1",
|
|
49
52
|
"@aws-sdk/client-kinesis": "3.6.1",
|
|
50
53
|
"@aws-sdk/client-personalize-events": "3.6.1",
|
|
51
54
|
"@aws-sdk/client-pinpoint": "3.6.1",
|
|
52
55
|
"@aws-sdk/util-utf8-browser": "3.6.1",
|
|
53
56
|
"lodash": "^4.17.20",
|
|
57
|
+
"tslib": "^1.8.0",
|
|
54
58
|
"uuid": "^3.2.1"
|
|
55
59
|
},
|
|
56
60
|
"jest": {
|
|
@@ -101,5 +105,5 @@
|
|
|
101
105
|
"<rootDir>/src/setupTests.ts"
|
|
102
106
|
]
|
|
103
107
|
},
|
|
104
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "55e13f5a77488793f97b9c7ffe963aaa0c687884"
|
|
105
109
|
}
|
package/src/Analytics.ts
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import {
|
|
15
5
|
Amplify,
|
|
16
6
|
ConsoleLogger as Logger,
|
|
17
7
|
Hub,
|
|
18
|
-
|
|
8
|
+
parseAWSExports,
|
|
19
9
|
} from '@aws-amplify/core';
|
|
20
10
|
import { AWSPinpointProvider } from './Providers/AWSPinpointProvider';
|
|
21
11
|
|
|
@@ -83,6 +73,7 @@ export class AnalyticsClass {
|
|
|
83
73
|
Hub.listen('auth', listener);
|
|
84
74
|
Hub.listen('storage', listener);
|
|
85
75
|
Hub.listen('analytics', listener);
|
|
76
|
+
Hub.listen('core', listener);
|
|
86
77
|
}
|
|
87
78
|
|
|
88
79
|
public getModuleName() {
|
|
@@ -95,7 +86,7 @@ export class AnalyticsClass {
|
|
|
95
86
|
public configure(config?) {
|
|
96
87
|
if (!config) return this._config;
|
|
97
88
|
logger.debug('configure Analytics', config);
|
|
98
|
-
const amplifyConfig =
|
|
89
|
+
const amplifyConfig = parseAWSExports(config);
|
|
99
90
|
this._config = Object.assign(
|
|
100
91
|
{},
|
|
101
92
|
this._config,
|
|
@@ -217,7 +208,15 @@ export class AnalyticsClass {
|
|
|
217
208
|
* @return - A promise which resolves if buffer doesn't overflow
|
|
218
209
|
*/
|
|
219
210
|
public async startSession(provider?: string) {
|
|
220
|
-
const
|
|
211
|
+
const event = { name: '_session.start' };
|
|
212
|
+
const params = { event, provider };
|
|
213
|
+
|
|
214
|
+
dispatchAnalyticsEvent(
|
|
215
|
+
'record',
|
|
216
|
+
event,
|
|
217
|
+
'Recording Analytics session start event'
|
|
218
|
+
);
|
|
219
|
+
|
|
221
220
|
return this._sendEvent(params);
|
|
222
221
|
}
|
|
223
222
|
|
|
@@ -227,7 +226,15 @@ export class AnalyticsClass {
|
|
|
227
226
|
* @return - A promise which resolves if buffer doesn't overflow
|
|
228
227
|
*/
|
|
229
228
|
public async stopSession(provider?: string) {
|
|
230
|
-
const
|
|
229
|
+
const event = { name: '_session.stop' };
|
|
230
|
+
const params = { event, provider };
|
|
231
|
+
|
|
232
|
+
dispatchAnalyticsEvent(
|
|
233
|
+
'record',
|
|
234
|
+
event,
|
|
235
|
+
'Recording Analytics session stop event'
|
|
236
|
+
);
|
|
237
|
+
|
|
231
238
|
return this._sendEvent(params);
|
|
232
239
|
}
|
|
233
240
|
|
|
@@ -239,43 +246,11 @@ export class AnalyticsClass {
|
|
|
239
246
|
public async record(
|
|
240
247
|
event: AnalyticsEvent | PersonalizeAnalyticsEvent | KinesisAnalyticsEvent,
|
|
241
248
|
provider?: string
|
|
242
|
-
);
|
|
243
|
-
/**
|
|
244
|
-
* Record one analytic event and send it to Pinpoint
|
|
245
|
-
* @deprecated Use the new syntax and pass in the event as an object instead.
|
|
246
|
-
* @param eventName - The name of the event
|
|
247
|
-
* @param [attributes] - Attributes of the event
|
|
248
|
-
* @param [metrics] - Event metrics
|
|
249
|
-
* @return - A promise which resolves if buffer doesn't overflow
|
|
250
|
-
*/
|
|
251
|
-
public async record(
|
|
252
|
-
eventName: string,
|
|
253
|
-
attributes?: EventAttributes,
|
|
254
|
-
metrics?: EventMetrics
|
|
255
|
-
);
|
|
256
|
-
public async record(
|
|
257
|
-
event:
|
|
258
|
-
| string
|
|
259
|
-
| AnalyticsEvent
|
|
260
|
-
| PersonalizeAnalyticsEvent
|
|
261
|
-
| KinesisAnalyticsEvent,
|
|
262
|
-
providerOrAttributes?: string | EventAttributes,
|
|
263
|
-
metrics?: EventMetrics
|
|
264
249
|
) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
event: {
|
|
270
|
-
name: event,
|
|
271
|
-
attributes: providerOrAttributes,
|
|
272
|
-
metrics,
|
|
273
|
-
},
|
|
274
|
-
provider: 'AWSPinpoint',
|
|
275
|
-
};
|
|
276
|
-
} else {
|
|
277
|
-
params = { event, provider: providerOrAttributes };
|
|
278
|
-
}
|
|
250
|
+
const params = { event, provider };
|
|
251
|
+
|
|
252
|
+
dispatchAnalyticsEvent('record', params.event, 'Recording Analytics event');
|
|
253
|
+
|
|
279
254
|
return this._sendEvent(params);
|
|
280
255
|
}
|
|
281
256
|
|
|
@@ -347,6 +322,8 @@ export class AnalyticsClass {
|
|
|
347
322
|
let endpointUpdated = false;
|
|
348
323
|
let authConfigured = false;
|
|
349
324
|
let analyticsConfigured = false;
|
|
325
|
+
let credentialsConfigured = false;
|
|
326
|
+
|
|
350
327
|
const listener = capsule => {
|
|
351
328
|
const { channel, payload } = capsule;
|
|
352
329
|
logger.debug('on hub capsule ' + channel, payload);
|
|
@@ -361,6 +338,9 @@ const listener = capsule => {
|
|
|
361
338
|
case 'analytics':
|
|
362
339
|
analyticsEvent(payload);
|
|
363
340
|
break;
|
|
341
|
+
case 'core':
|
|
342
|
+
coreEvent(payload);
|
|
343
|
+
break;
|
|
364
344
|
default:
|
|
365
345
|
break;
|
|
366
346
|
}
|
|
@@ -415,7 +395,7 @@ const authEvent = payload => {
|
|
|
415
395
|
return recordAuthEvent('auth_fail');
|
|
416
396
|
case 'configured':
|
|
417
397
|
authConfigured = true;
|
|
418
|
-
if (
|
|
398
|
+
if (analyticsConfigured) {
|
|
419
399
|
sendEvents();
|
|
420
400
|
}
|
|
421
401
|
break;
|
|
@@ -429,7 +409,21 @@ const analyticsEvent = payload => {
|
|
|
429
409
|
switch (event) {
|
|
430
410
|
case 'pinpointProvider_configured':
|
|
431
411
|
analyticsConfigured = true;
|
|
432
|
-
if (authConfigured
|
|
412
|
+
if (authConfigured || credentialsConfigured) {
|
|
413
|
+
sendEvents();
|
|
414
|
+
}
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
const coreEvent = payload => {
|
|
420
|
+
const { event } = payload;
|
|
421
|
+
if (!event) return;
|
|
422
|
+
|
|
423
|
+
switch (event) {
|
|
424
|
+
case 'credentials_configured':
|
|
425
|
+
credentialsConfigured = true;
|
|
426
|
+
if (analyticsConfigured) {
|
|
433
427
|
sendEvents();
|
|
434
428
|
}
|
|
435
429
|
break;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import { ConsoleLogger as Logger } from '@aws-amplify/core';
|
|
15
5
|
import { AWSKinesisProvider } from './AWSKinesisProvider';
|
|
@@ -111,8 +101,3 @@ export class AWSKinesisFirehoseProvider extends AWSKinesisProvider {
|
|
|
111
101
|
return true;
|
|
112
102
|
}
|
|
113
103
|
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @deprecated use named import
|
|
117
|
-
*/
|
|
118
|
-
export default AWSKinesisFirehoseProvider;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import {
|
|
15
5
|
ConsoleLogger as Logger,
|
|
@@ -251,8 +241,3 @@ export class AWSKinesisProvider implements AnalyticsProvider {
|
|
|
251
241
|
});
|
|
252
242
|
}
|
|
253
243
|
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* @deprecated use named import
|
|
257
|
-
*/
|
|
258
|
-
export default AWSKinesisProvider;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import {
|
|
15
5
|
ConsoleLogger as Logger,
|
|
16
6
|
ClientDevice,
|
|
17
7
|
Credentials,
|
|
18
8
|
Signer,
|
|
19
|
-
JS,
|
|
20
9
|
Hub,
|
|
21
10
|
getAmplifyUserAgent,
|
|
11
|
+
transferKeyToLowerCase,
|
|
12
|
+
transferKeyToUpperCase,
|
|
22
13
|
} from '@aws-amplify/core';
|
|
23
14
|
import {
|
|
24
15
|
EventsBatch,
|
|
@@ -27,7 +18,7 @@ import {
|
|
|
27
18
|
PutEventsCommandInput,
|
|
28
19
|
UpdateEndpointCommand,
|
|
29
20
|
} from '@aws-sdk/client-pinpoint';
|
|
30
|
-
import Cache from '@aws-amplify/cache';
|
|
21
|
+
import { Cache } from '@aws-amplify/cache';
|
|
31
22
|
|
|
32
23
|
import {
|
|
33
24
|
AnalyticsProvider,
|
|
@@ -40,10 +31,11 @@ import {
|
|
|
40
31
|
import { v1 as uuid } from 'uuid';
|
|
41
32
|
import EventsBuffer from './EventBuffer';
|
|
42
33
|
|
|
43
|
-
const AMPLIFY_SYMBOL = (
|
|
44
|
-
typeof Symbol.for === 'function'
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
const AMPLIFY_SYMBOL = (
|
|
35
|
+
typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'
|
|
36
|
+
? Symbol.for('amplify_default')
|
|
37
|
+
: '@@amplify_default'
|
|
38
|
+
) as Symbol;
|
|
47
39
|
|
|
48
40
|
const dispatchAnalyticsEvent = (event, data) => {
|
|
49
41
|
Hub.dispatch('analytics', { event, data }, 'Analytics', AMPLIFY_SYMBOL);
|
|
@@ -395,7 +387,7 @@ export class AWSPinpointProvider implements AnalyticsProvider {
|
|
|
395
387
|
|
|
396
388
|
const request = this._endpointRequest(
|
|
397
389
|
config,
|
|
398
|
-
|
|
390
|
+
transferKeyToLowerCase(
|
|
399
391
|
event,
|
|
400
392
|
[],
|
|
401
393
|
['attributes', 'userAttributes', 'Attributes', 'UserAttributes']
|
|
@@ -706,7 +698,7 @@ export class AWSPinpointProvider implements AnalyticsProvider {
|
|
|
706
698
|
immediate,
|
|
707
699
|
...ret
|
|
708
700
|
} = tmp;
|
|
709
|
-
return
|
|
701
|
+
return transferKeyToUpperCase(
|
|
710
702
|
ret,
|
|
711
703
|
[],
|
|
712
704
|
['metrics', 'userAttributes', 'attributes']
|
|
@@ -735,8 +727,3 @@ export class AWSPinpointProvider implements AnalyticsProvider {
|
|
|
735
727
|
}
|
|
736
728
|
}
|
|
737
729
|
}
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* @deprecated use named import
|
|
741
|
-
*/
|
|
742
|
-
export default AWSPinpointProvider;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
import { ICredentials } from '@aws-amplify/core';
|
|
14
4
|
|
|
15
5
|
interface BasePayload {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
import { RequestParams } from './DataType';
|
|
14
4
|
|
|
15
5
|
enum HTML5_MEDIA_EVENT {
|
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
import { SessionInfo } from './DataType';
|
|
14
4
|
import isEmpty from 'lodash/isEmpty';
|
|
15
5
|
import isEqual from 'lodash/isEqual';
|
|
16
6
|
import { v1 as uuid } from 'uuid';
|
|
17
|
-
import { ConsoleLogger as Logger,
|
|
18
|
-
|
|
19
|
-
import Cache from '@aws-amplify/cache';
|
|
7
|
+
import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core';
|
|
8
|
+
import { Cache } from '@aws-amplify/cache';
|
|
20
9
|
|
|
21
10
|
const PERSONALIZE_CACHE = '_awsct';
|
|
22
11
|
const PERSONALIZE_CACHE_USERID = '_awsct_uid';
|
|
@@ -34,7 +23,7 @@ export class SessionInfoManager {
|
|
|
34
23
|
private _timerKey;
|
|
35
24
|
|
|
36
25
|
constructor(prefixKey = '') {
|
|
37
|
-
this._isBrowser =
|
|
26
|
+
this._isBrowser = browserOrNode().isBrowser;
|
|
38
27
|
this._timerKey = uuid().substr(0, 15);
|
|
39
28
|
this._refreshTimer();
|
|
40
29
|
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
export * from './DataType';
|
|
14
|
-
export * from './SessionInfoManager';
|
|
15
|
-
export * from './MediaAutoTrack';
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export {
|
|
4
|
+
EventData,
|
|
5
|
+
RecordEventListPayload,
|
|
6
|
+
RecordEventPayload,
|
|
7
|
+
RequestParams,
|
|
8
|
+
SessionInfo,
|
|
9
|
+
} from './DataType';
|
|
10
|
+
export { SessionInfoManager } from './SessionInfoManager';
|
|
11
|
+
export { MediaAutoTrack } from './MediaAutoTrack';
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import {
|
|
15
5
|
ConsoleLogger as Logger,
|
|
16
6
|
Credentials,
|
|
17
|
-
JS,
|
|
18
7
|
getAmplifyUserAgent,
|
|
8
|
+
browserOrNode,
|
|
19
9
|
} from '@aws-amplify/core';
|
|
20
10
|
import {
|
|
21
11
|
PersonalizeEventsClient,
|
|
@@ -67,7 +57,7 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider {
|
|
|
67
57
|
this._config.trackingId
|
|
68
58
|
);
|
|
69
59
|
}
|
|
70
|
-
this._isBrowser =
|
|
60
|
+
this._isBrowser = browserOrNode().isBrowser;
|
|
71
61
|
|
|
72
62
|
// flush event buffer
|
|
73
63
|
this._setupTimer();
|
|
@@ -260,10 +250,8 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider {
|
|
|
260
250
|
const events: RecordEventPayload[] = [];
|
|
261
251
|
for (let i = 0; i < groupLen; i += 1) {
|
|
262
252
|
const params: RequestParams = group.shift();
|
|
263
|
-
const eventPayload: RecordEventPayload =
|
|
264
|
-
params,
|
|
265
|
-
sessionInfo
|
|
266
|
-
);
|
|
253
|
+
const eventPayload: RecordEventPayload =
|
|
254
|
+
this._generateSingleRecordPayload(params, sessionInfo);
|
|
267
255
|
events.push(eventPayload);
|
|
268
256
|
}
|
|
269
257
|
const payload = <PutEventsCommandInput>{};
|
|
@@ -407,8 +395,3 @@ export class AmazonPersonalizeProvider implements AnalyticsProvider {
|
|
|
407
395
|
});
|
|
408
396
|
}
|
|
409
397
|
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* @deprecated use named import
|
|
413
|
-
*/
|
|
414
|
-
export default AmazonPersonalizeProvider;
|
package/src/index.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export * from './Providers';
|
|
4
|
+
export { Analytics } from './Analytics';
|
|
5
|
+
export { AnalyticsProvider } from './types';
|
|
6
|
+
export {
|
|
7
|
+
AWSPinpointProvider,
|
|
8
|
+
AWSKinesisProvider,
|
|
9
|
+
AWSKinesisFirehoseProvider,
|
|
10
|
+
AmazonPersonalizeProvider,
|
|
11
|
+
} from './Providers';
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
13
3
|
|
|
14
4
|
import { delegate } from '../vendor/dom-utils';
|
|
15
5
|
import { EventTrackOpts } from '../types';
|
|
16
|
-
import { ConsoleLogger as Logger,
|
|
6
|
+
import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core';
|
|
17
7
|
|
|
18
8
|
const logger = new Logger('EventTracker');
|
|
19
9
|
|
|
@@ -30,7 +20,7 @@ export class EventTracker {
|
|
|
30
20
|
private _delegates;
|
|
31
21
|
|
|
32
22
|
constructor(tracker, opts) {
|
|
33
|
-
if (!
|
|
23
|
+
if (!browserOrNode().isBrowser || !window.addEventListener) {
|
|
34
24
|
logger.debug('not in the supported web environment');
|
|
35
25
|
return;
|
|
36
26
|
}
|
|
@@ -123,8 +113,3 @@ export class EventTracker {
|
|
|
123
113
|
});
|
|
124
114
|
}
|
|
125
115
|
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* @deprecated use named import
|
|
129
|
-
*/
|
|
130
|
-
export default EventTracker;
|