@availity/analytics-core 3.1.1 → 3.1.5

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,44 @@
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
+ ## 3.1.5 (2021-12-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **analytics-core:** recursive getComposedPath calls should be spread ([e39d180](https://github.com/Availity/sdk-js/commit/e39d180d7a0a348b52367bea8a87e6e9b0a98252))
12
+
13
+
14
+
15
+
16
+
17
+ ## 3.1.4 (2021-11-16)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **analytics-core:** update types and error msg ([8c03422](https://github.com/Availity/sdk-js/commit/8c03422b8ced4c60738616905ce98b1523663f83))
23
+
24
+
25
+
26
+
27
+
28
+ ## [3.1.3](https://github.com/Availity/sdk-js/compare/@availity/analytics-core@3.1.2...@availity/analytics-core@3.1.3) (2021-10-29)
29
+
30
+ **Note:** Version bump only for package @availity/analytics-core
31
+
32
+
33
+
34
+
35
+
36
+ ## [3.1.2](https://github.com/Availity/sdk-js/compare/@availity/analytics-core@3.1.1...@availity/analytics-core@3.1.2) (2021-10-22)
37
+
38
+ **Note:** Version bump only for package @availity/analytics-core
39
+
40
+
41
+
42
+
43
+
6
44
  ## [3.1.1](https://github.com/Availity/sdk-js/compare/@availity/analytics-core@3.1.0...@availity/analytics-core@3.1.1) (2021-10-20)
7
45
 
8
46
  **Note:** Version bump only for package @availity/analytics-core
package/lib/analytics.js CHANGED
@@ -19,6 +19,8 @@ require("core-js/modules/es.function.name.js");
19
19
 
20
20
  require("core-js/modules/es.array.slice.js");
21
21
 
22
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
23
+
22
24
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
23
25
 
24
26
  var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
@@ -227,7 +229,7 @@ var AvAnalytics = function AvAnalytics(plugins) {
227
229
 
228
230
  this.trackPageView = function (url) {
229
231
  // hashchanges are an object so we want to grab the new url from it
230
- if (typeof url === 'object') {
232
+ if ((0, _typeof2["default"])(url) === 'object') {
231
233
  url = url.newURL;
232
234
  }
233
235
 
@@ -257,7 +259,7 @@ var AvAnalytics = function AvAnalytics(plugins) {
257
259
  // if plugins or promise are undefined,
258
260
  // or if either is skipped and pageTracking boolean is used in their place
259
261
  if (!plugins || !promise) {
260
- throw new Error('[plugins], and [promise] must be defined');
262
+ throw new Error('[plugins] and [promise] must be defined');
261
263
  }
262
264
 
263
265
  this.plugins = Array.isArray(plugins) ? plugins : [plugins];
package/lib/dma.js CHANGED
@@ -16,6 +16,8 @@ require("core-js/modules/es.object.get-own-property-descriptor.js");
16
16
 
17
17
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
18
 
19
+ var _typeof = require("@babel/runtime/helpers/typeof");
20
+
19
21
  Object.defineProperty(exports, "__esModule", {
20
22
  value: true
21
23
  });
@@ -35,7 +37,7 @@ var _plugin = _interopRequireDefault(require("./plugin"));
35
37
 
36
38
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
39
 
38
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
40
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
41
 
40
42
  var schema = yup.object().shape({
41
43
  level: yup.string().optional(),
package/lib/index.js CHANGED
@@ -17,16 +17,16 @@ Object.defineProperty(exports, "AvAnalyticsPlugin", {
17
17
  return _plugin["default"];
18
18
  }
19
19
  });
20
- Object.defineProperty(exports, "AvSplunkAnalytics", {
20
+ Object.defineProperty(exports, "AvDmaAnalytics", {
21
21
  enumerable: true,
22
22
  get: function get() {
23
- return _splunk["default"];
23
+ return _dma["default"];
24
24
  }
25
25
  });
26
- Object.defineProperty(exports, "AvDmaAnalytics", {
26
+ Object.defineProperty(exports, "AvSplunkAnalytics", {
27
27
  enumerable: true,
28
28
  get: function get() {
29
- return _dma["default"];
29
+ return _splunk["default"];
30
30
  }
31
31
  });
32
32
 
package/lib/util.js CHANGED
@@ -1,14 +1,20 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  require("core-js/modules/es.regexp.exec");
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
8
- exports.getComposedPath = exports.camelCase = exports.isPluginEnabled = exports.isValidEventTypeOnTarget = exports.isModifiedEvent = exports.isLeftClickEvent = void 0;
10
+ exports.isValidEventTypeOnTarget = exports.isPluginEnabled = exports.isModifiedEvent = exports.isLeftClickEvent = exports.getComposedPath = exports.camelCase = void 0;
11
+
12
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
13
 
10
14
  require("core-js/modules/es.string.replace.js");
11
15
 
16
+ require("core-js/modules/es.array.concat.js");
17
+
12
18
  var isLeftClickEvent = function isLeftClickEvent(event) {
13
19
  return event.button === 0;
14
20
  };
@@ -64,7 +70,7 @@ var getComposedPath = function getComposedPath(node) {
64
70
  }
65
71
 
66
72
  if (parent !== undefined) {
67
- return [node, getComposedPath(parent)];
73
+ return [node].concat((0, _toConsumableArray2["default"])(getComposedPath(parent)));
68
74
  }
69
75
 
70
76
  return [node];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/analytics-core",
3
- "version": "3.1.1",
3
+ "version": "3.1.5",
4
4
  "description": "Analytics base configuration for sdk-js",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -10,13 +10,13 @@
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "gitHead": "c42cc2727c45a2e42f28bd9b69360cc5303238e9",
13
+ "gitHead": "9e866c001205ac3765a3385ac8ed4a8b66962372",
14
14
  "dependencies": {
15
- "@babel/runtime": "^7.10.2",
15
+ "@babel/runtime": "^7.15.4",
16
16
  "core-js": "^3.12.1",
17
- "yup": "^0.28.4"
17
+ "yup": "^0.32.9"
18
18
  },
19
19
  "devDependencies": {
20
- "@availity/api-axios": "^6.0.3"
20
+ "@availity/api-axios": "^6.0.5"
21
21
  }
22
22
  }
package/src/analytics.js CHANGED
@@ -12,7 +12,7 @@ export default class AvAnalytics {
12
12
  // if plugins or promise are undefined,
13
13
  // or if either is skipped and pageTracking boolean is used in their place
14
14
  if (!plugins || !promise) {
15
- throw new Error('[plugins], and [promise] must be defined');
15
+ throw new Error('[plugins] and [promise] must be defined');
16
16
  }
17
17
 
18
18
  this.plugins = Array.isArray(plugins) ? plugins : [plugins];
@@ -23,7 +23,7 @@ describe('AvAnalytics', () => {
23
23
  test('AvAnalytics should throw error without plugins or Promise', () => {
24
24
  expect(() => {
25
25
  mockAvAnalytics = new AvAnalytics();
26
- }).toThrow('[plugins], and [promise] must be defined');
26
+ }).toThrow('[plugins] and [promise] must be defined');
27
27
  });
28
28
 
29
29
  test('AvAnalytics should cast plugins to an array', () => {
@@ -45,8 +45,7 @@ describe('analytics-core utils', () => {
45
45
  expect(getComposedPath({ host: {} }).length).toBe(2);
46
46
  expect(getComposedPath({ defaultView: {} }).length).toBe(2);
47
47
 
48
- const result =
49
- '[{"parentNode":{"host":{"defaultView":{}}}},[{"host":{"defaultView":{}}},[{"defaultView":{}},[{}]]]]';
48
+ const result = '[{"parentNode":{"host":{"defaultView":{}}}},{"host":{"defaultView":{}}},{"defaultView":{}},{}]';
50
49
  const nested = getComposedPath({ parentNode: { host: { defaultView: {} } } });
51
50
  expect(JSON.stringify(nested)).toEqual(result);
52
51
  });
package/src/util.js CHANGED
@@ -32,7 +32,7 @@ export const getComposedPath = (node) => {
32
32
  }
33
33
 
34
34
  if (parent !== undefined) {
35
- return [node, getComposedPath(parent)];
35
+ return [node, ...getComposedPath(parent)];
36
36
  }
37
37
 
38
38
  return [node];
@@ -27,7 +27,7 @@ declare class AvAnalytics {
27
27
 
28
28
  trackEvent(properties: any): Promise<any[]>;
29
29
 
30
- trackPageView(url: string): Promise<any[]>;
30
+ trackPageView(url?: string): Promise<any[]>;
31
31
  }
32
32
 
33
33
  export default AvAnalytics;