@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.
Files changed (160) hide show
  1. package/CHANGELOG.md +0 -8
  2. package/lib/.tsbuildinfo +3 -0
  3. package/lib/Analytics.d.ts +87 -0
  4. package/lib/Analytics.js +53 -95
  5. package/lib/Analytics.js.map +1 -1
  6. package/lib/Providers/AWSKinesisFirehoseProvider.d.ts +12 -0
  7. package/lib/Providers/AWSKinesisFirehoseProvider.js +4 -30
  8. package/lib/Providers/AWSKinesisFirehoseProvider.js.map +1 -1
  9. package/lib/Providers/AWSKinesisProvider.d.ts +43 -0
  10. package/lib/Providers/AWSKinesisProvider.js +7 -56
  11. package/lib/Providers/AWSKinesisProvider.js.map +1 -1
  12. package/lib/Providers/AWSPinpointProvider.d.ts +70 -0
  13. package/lib/Providers/AWSPinpointProvider.js +32 -107
  14. package/lib/Providers/AWSPinpointProvider.js.map +1 -1
  15. package/lib/Providers/AmazonPersonalizeHelper/DataType.d.ts +40 -0
  16. package/lib/Providers/AmazonPersonalizeHelper/MediaAutoTrack.d.ts +20 -0
  17. package/lib/Providers/AmazonPersonalizeHelper/MediaAutoTrack.js.map +1 -1
  18. package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.d.ts +17 -0
  19. package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.js +7 -9
  20. package/lib/Providers/AmazonPersonalizeHelper/SessionInfoManager.js.map +1 -1
  21. package/lib/Providers/AmazonPersonalizeHelper/index.d.ts +3 -0
  22. package/lib/Providers/AmazonPersonalizeHelper/index.js +4 -5
  23. package/lib/Providers/AmazonPersonalizeHelper/index.js.map +1 -1
  24. package/lib/Providers/AmazonPersonalizeProvider.d.ts +76 -0
  25. package/lib/Providers/AmazonPersonalizeProvider.js +9 -61
  26. package/lib/Providers/AmazonPersonalizeProvider.js.map +1 -1
  27. package/lib/Providers/EventBuffer.d.ts +30 -0
  28. package/lib/Providers/EventBuffer.js +7 -62
  29. package/lib/Providers/EventBuffer.js.map +1 -1
  30. package/lib/Providers/index.d.ts +4 -0
  31. package/lib/index.d.ts +3 -0
  32. package/lib/index.js +7 -20
  33. package/lib/index.js.map +1 -1
  34. package/lib/setupTests.d.ts +1 -0
  35. package/lib/trackers/EventTracker.d.ts +9 -0
  36. package/lib/trackers/EventTracker.js +6 -55
  37. package/lib/trackers/EventTracker.js.map +1 -1
  38. package/lib/trackers/PageViewTracker.d.ts +12 -0
  39. package/lib/trackers/PageViewTracker.js +11 -60
  40. package/lib/trackers/PageViewTracker.js.map +1 -1
  41. package/lib/trackers/SessionTracker-rn.d.ts +12 -0
  42. package/lib/trackers/SessionTracker-rn.js +7 -56
  43. package/lib/trackers/SessionTracker-rn.js.map +1 -1
  44. package/lib/trackers/SessionTracker.d.ts +14 -0
  45. package/lib/trackers/SessionTracker.js +8 -57
  46. package/lib/trackers/SessionTracker.js.map +1 -1
  47. package/lib/trackers/index.d.ts +3 -0
  48. package/lib/trackers/index.js +3 -3
  49. package/lib/trackers/index.js.map +1 -1
  50. package/lib/trackers/reactnative.d.ts +8 -0
  51. package/lib/types/Analytics.d.ts +66 -0
  52. package/lib/types/Provider.d.ts +10 -0
  53. package/lib/types/Provider.js +2 -12
  54. package/lib/types/Provider.js.map +1 -1
  55. package/lib/types/Providers/AWSKinesisProvider.d.ts +5 -0
  56. package/lib/types/Providers/AWSPinpointProvider.d.ts +50 -0
  57. package/lib/types/Providers/AmazonPersonalizeProvider.d.ts +7 -0
  58. package/lib/types/Providers/index.d.ts +1 -0
  59. package/lib/types/index.d.ts +3 -0
  60. package/lib/types/index.js +2 -12
  61. package/lib/types/index.js.map +1 -1
  62. package/lib/utils/AppUtils.d.ts +2 -0
  63. package/lib/utils/AppUtils.native.d.ts +2 -0
  64. package/lib/utils/MethodEmbed.d.ts +11 -0
  65. package/lib/utils/MethodEmbed.js +4 -37
  66. package/lib/utils/MethodEmbed.js.map +1 -1
  67. package/lib/vendor/dom-utils/closest.d.ts +12 -0
  68. package/lib/vendor/dom-utils/delegate.d.ts +18 -0
  69. package/lib/vendor/dom-utils/dispatch.d.ts +17 -0
  70. package/lib/vendor/dom-utils/get-attributes.d.ts +11 -0
  71. package/lib/vendor/dom-utils/index.d.ts +7 -0
  72. package/lib/vendor/dom-utils/matches.d.ts +11 -0
  73. package/lib/vendor/dom-utils/matches.js +1 -1
  74. package/lib/vendor/dom-utils/matches.js.map +1 -1
  75. package/lib/vendor/dom-utils/parents.d.ts +10 -0
  76. package/lib/vendor/dom-utils/parse-url.d.ts +9 -0
  77. package/lib/vendor/dom-utils/parse-url.js +1 -1
  78. package/lib/vendor/dom-utils/parse-url.js.map +1 -1
  79. package/lib-esm/.tsbuildinfo +3 -0
  80. package/lib-esm/Analytics.d.ts +3 -12
  81. package/lib-esm/Analytics.js +41 -83
  82. package/lib-esm/Analytics.js.map +1 -1
  83. package/lib-esm/Providers/AWSKinesisFirehoseProvider.d.ts +0 -4
  84. package/lib-esm/Providers/AWSKinesisFirehoseProvider.js +3 -29
  85. package/lib-esm/Providers/AWSKinesisFirehoseProvider.js.map +1 -1
  86. package/lib-esm/Providers/AWSKinesisProvider.d.ts +0 -4
  87. package/lib-esm/Providers/AWSKinesisProvider.js +3 -52
  88. package/lib-esm/Providers/AWSKinesisProvider.js.map +1 -1
  89. package/lib-esm/Providers/AWSPinpointProvider.d.ts +0 -4
  90. package/lib-esm/Providers/AWSPinpointProvider.js +8 -80
  91. package/lib-esm/Providers/AWSPinpointProvider.js.map +1 -1
  92. package/lib-esm/Providers/AmazonPersonalizeHelper/MediaAutoTrack.js.map +1 -1
  93. package/lib-esm/Providers/AmazonPersonalizeHelper/SessionInfoManager.js +3 -3
  94. package/lib-esm/Providers/AmazonPersonalizeHelper/SessionInfoManager.js.map +1 -1
  95. package/lib-esm/Providers/AmazonPersonalizeHelper/index.d.ts +3 -3
  96. package/lib-esm/Providers/AmazonPersonalizeHelper/index.js +2 -2
  97. package/lib-esm/Providers/AmazonPersonalizeHelper/index.js.map +1 -1
  98. package/lib-esm/Providers/AmazonPersonalizeProvider.d.ts +0 -4
  99. package/lib-esm/Providers/AmazonPersonalizeProvider.js +5 -54
  100. package/lib-esm/Providers/AmazonPersonalizeProvider.js.map +1 -1
  101. package/lib-esm/Providers/EventBuffer.js +1 -56
  102. package/lib-esm/Providers/EventBuffer.js.map +1 -1
  103. package/lib-esm/index.d.ts +3 -8
  104. package/lib-esm/index.js +4 -19
  105. package/lib-esm/index.js.map +1 -1
  106. package/lib-esm/trackers/EventTracker.d.ts +0 -4
  107. package/lib-esm/trackers/EventTracker.js +5 -54
  108. package/lib-esm/trackers/EventTracker.js.map +1 -1
  109. package/lib-esm/trackers/PageViewTracker.d.ts +0 -4
  110. package/lib-esm/trackers/PageViewTracker.js +8 -57
  111. package/lib-esm/trackers/PageViewTracker.js.map +1 -1
  112. package/lib-esm/trackers/SessionTracker-rn.d.ts +0 -4
  113. package/lib-esm/trackers/SessionTracker-rn.js +3 -52
  114. package/lib-esm/trackers/SessionTracker-rn.js.map +1 -1
  115. package/lib-esm/trackers/SessionTracker.d.ts +0 -4
  116. package/lib-esm/trackers/SessionTracker.js +5 -54
  117. package/lib-esm/trackers/SessionTracker.js.map +1 -1
  118. package/lib-esm/trackers/index.d.ts +3 -3
  119. package/lib-esm/trackers/index.js +3 -3
  120. package/lib-esm/trackers/index.js.map +1 -1
  121. package/lib-esm/types/Provider.js +2 -12
  122. package/lib-esm/types/Provider.js.map +1 -1
  123. package/lib-esm/types/index.js +2 -12
  124. package/lib-esm/types/index.js.map +1 -1
  125. package/lib-esm/utils/MethodEmbed.d.ts +0 -4
  126. package/lib-esm/utils/MethodEmbed.js +3 -36
  127. package/lib-esm/utils/MethodEmbed.js.map +1 -1
  128. package/lib-esm/vendor/dom-utils/matches.js +2 -2
  129. package/lib-esm/vendor/dom-utils/matches.js.map +1 -1
  130. package/lib-esm/vendor/dom-utils/parse-url.js +2 -2
  131. package/lib-esm/vendor/dom-utils/parse-url.js.map +1 -1
  132. package/package.json +13 -9
  133. package/src/Analytics.ts +48 -54
  134. package/src/Providers/AWSKinesisFirehoseProvider.ts +2 -17
  135. package/src/Providers/AWSKinesisProvider.ts +2 -17
  136. package/src/Providers/AWSPinpointProvider.ts +12 -25
  137. package/src/Providers/AmazonPersonalizeHelper/DataType.ts +2 -12
  138. package/src/Providers/AmazonPersonalizeHelper/MediaAutoTrack.ts +2 -12
  139. package/src/Providers/AmazonPersonalizeHelper/SessionInfoManager.ts +5 -16
  140. package/src/Providers/AmazonPersonalizeHelper/index.ts +11 -15
  141. package/src/Providers/AmazonPersonalizeProvider.ts +6 -23
  142. package/src/index.ts +10 -21
  143. package/src/trackers/EventTracker.ts +4 -19
  144. package/src/trackers/PageViewTracker.ts +7 -22
  145. package/src/trackers/SessionTracker-rn.ts +2 -17
  146. package/src/trackers/SessionTracker.ts +9 -19
  147. package/src/trackers/index.ts +3 -3
  148. package/src/types/Analytics.ts +2 -12
  149. package/src/types/Provider.ts +2 -12
  150. package/src/types/index.ts +2 -12
  151. package/src/utils/MethodEmbed.ts +2 -17
  152. package/src/vendor/dom-utils/matches.ts +2 -2
  153. package/src/vendor/dom-utils/parse-url.ts +2 -2
  154. package/build.js +0 -5
  155. package/dist/aws-amplify-analytics.js +0 -67617
  156. package/dist/aws-amplify-analytics.js.map +0 -1
  157. package/dist/aws-amplify-analytics.min.js +0 -26
  158. package/dist/aws-amplify-analytics.min.js.map +0 -1
  159. package/index.js +0 -7
  160. package/webpack.config.dev.js +0 -6
@@ -1,25 +1,15 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 { pageViewTrackOpts } from '../types';
15
5
  import { MethodEmbed } from '../utils/MethodEmbed';
16
- import { ConsoleLogger as Logger, JS } from '@aws-amplify/core';
6
+ import { ConsoleLogger as Logger, browserOrNode } from '@aws-amplify/core';
17
7
 
18
8
  const logger = new Logger('PageViewTracker');
19
9
  const PREV_URL_KEY = 'aws-amplify-analytics-prevUrl';
20
10
 
21
11
  const getUrl = () => {
22
- if (!JS.browserOrNode().isBrowser) return '';
12
+ if (!browserOrNode().isBrowser) return '';
23
13
  else return window.location.origin + window.location.pathname;
24
14
  };
25
15
 
@@ -71,7 +61,7 @@ export class PageViewTracker {
71
61
 
72
62
  private async _pageViewTrackDefault() {
73
63
  if (
74
- !JS.browserOrNode().isBrowser ||
64
+ !browserOrNode().isBrowser ||
75
65
  !window.addEventListener ||
76
66
  !window.sessionStorage
77
67
  ) {
@@ -106,7 +96,7 @@ export class PageViewTracker {
106
96
 
107
97
  private async _trackFunc() {
108
98
  if (
109
- !JS.browserOrNode().isBrowser ||
99
+ !browserOrNode().isBrowser ||
110
100
  !window.addEventListener ||
111
101
  !history.pushState ||
112
102
  !window.sessionStorage
@@ -143,7 +133,7 @@ export class PageViewTracker {
143
133
 
144
134
  private _pageViewTrackSPA() {
145
135
  if (
146
- !JS.browserOrNode().isBrowser ||
136
+ !browserOrNode().isBrowser ||
147
137
  !window.addEventListener ||
148
138
  !history.pushState
149
139
  ) {
@@ -165,8 +155,3 @@ export class PageViewTracker {
165
155
  }
166
156
  }
167
157
  }
168
-
169
- /**
170
- * @deprecated use named import
171
- */
172
- export default PageViewTracker;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  // the session tracker for react native
15
5
 
@@ -142,8 +132,3 @@ export class SessionTracker {
142
132
  return this._config;
143
133
  }
144
134
  }
145
-
146
- /**
147
- * @deprecated use named import
148
- */
149
- export default SessionTracker;
@@ -1,19 +1,14 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  // the session tracker for web
15
5
 
16
- import { ConsoleLogger as Logger, Hub, JS, Constants } from '@aws-amplify/core';
6
+ import {
7
+ ConsoleLogger as Logger,
8
+ Hub,
9
+ Constants,
10
+ browserOrNode,
11
+ } from '@aws-amplify/core';
17
12
  import { SessionTrackOpts } from '../types';
18
13
 
19
14
  const logger = new Logger('SessionTracker');
@@ -45,7 +40,7 @@ export class SessionTracker {
45
40
  }
46
41
 
47
42
  private _envCheck() {
48
- if (!JS.browserOrNode().isBrowser) {
43
+ if (!browserOrNode().isBrowser) {
49
44
  return false;
50
45
  }
51
46
 
@@ -182,8 +177,3 @@ export class SessionTracker {
182
177
  return this._config;
183
178
  }
184
179
  }
185
-
186
- /**
187
- * @deprecated use named import
188
- */
189
- export default SessionTracker;
@@ -1,3 +1,3 @@
1
- export { default as PageViewTracker } from './PageViewTracker';
2
- export { default as EventTracker } from './EventTracker';
3
- export { default as SessionTracker } from './SessionTracker';
1
+ export { PageViewTracker } from './PageViewTracker';
2
+ export { EventTracker } from './EventTracker';
3
+ export { SessionTracker } from './SessionTracker';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  * Analytics instance options
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  export interface PromiseHandlers {
15
5
  resolve: Function;
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  export * from './Analytics';
15
5
  export * from './Provider';
@@ -1,15 +1,5 @@
1
- /*
2
- * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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
  const lists: MethodEmbed[] = [];
15
5
 
@@ -57,8 +47,3 @@ function getInstance(context, methodName): MethodEmbed {
57
47
 
58
48
  return instance;
59
49
  }
60
-
61
- /**
62
- * @deprecated use named import
63
- */
64
- export default MethodEmbed;
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
3
3
  */
4
4
 
5
- import { JS } from '@aws-amplify/core';
5
+ import { browserOrNode } from '@aws-amplify/core';
6
6
 
7
7
  const proto =
8
- JS.browserOrNode().isBrowser && window['Element']
8
+ browserOrNode().isBrowser && window['Element']
9
9
  ? window['Element'].prototype
10
10
  : null;
11
11
 
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) 2017, Philip Walton <philip@philipwalton.com>
3
3
  */
4
4
 
5
- import { JS } from '@aws-amplify/core';
5
+ import { browserOrNode } from '@aws-amplify/core';
6
6
 
7
7
  const HTTP_PORT = '80';
8
8
  const HTTPS_PORT = '443';
9
9
  const DEFAULT_PORT = RegExp(':(' + HTTP_PORT + '|' + HTTPS_PORT + ')$');
10
10
 
11
- const a = JS.browserOrNode().isBrowser ? document.createElement('a') : null;
11
+ const a = browserOrNode().isBrowser ? document.createElement('a') : null;
12
12
  const cache = {};
13
13
 
14
14
  /**
package/build.js DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const build = require('../../scripts/build');
4
-
5
- build(process.argv[2], process.argv[3]);