@useblu/blu-lytics 1.0.2 → 1.0.4

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.
@@ -1,11 +1,11 @@
1
1
  export type EventType = 'customEvent' | 'screenEvent' | 'userIdentification';
2
2
  export type PropertiesType = {
3
- [key: string]: string;
3
+ [key: string]: string | boolean | number | string[] | undefined;
4
4
  };
5
5
  export type UserPropertiesType = {
6
6
  email?: string;
7
7
  name?: string;
8
- [key: string]: string | undefined;
8
+ [key: string]: string | boolean | number | any[] | undefined;
9
9
  };
10
10
  export type EventData = {
11
11
  screen?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dispatchers.types.d.ts","sourceRoot":"","sources":["../../src/dispatchers/dispatchers.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"dispatchers.types.d.ts","sourceRoot":"","sources":["../../src/dispatchers/dispatchers.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAC7E,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;CAAE,CAAC;AAClG,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC;CAC9D,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initializers/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAgG1E;;;;;;;GAOG;AACH,QAAA,IAAI,uBAAuB,EAAE,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gBACjB,iBAAiB,GAAG,iBAAiB,EAAE;iBAC5B,eAAe;MACtC,IA0CF,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initializers/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAkG1E;;;;;;;GAOG;AACH,QAAA,IAAI,uBAAuB,EAAE,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gBACjB,iBAAiB,GAAG,iBAAiB,EAAE;iBAC5B,eAAe;MACtC,IA0CF,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -28,8 +28,12 @@ var clarityInitializer = function (environment, apiKey) {
28
28
  * @returns {void}
29
29
  */
30
30
  var fullStoryInitializer = function (environment, apiKey) {
31
- if (isProduction(environment))
31
+ if (isProduction(environment)) {
32
32
  init({ orgId: apiKey });
33
+ }
34
+ else {
35
+ init({ orgId: apiKey, devMode: true });
36
+ }
33
37
  };
34
38
  /**
35
39
  * Initializes MixPanel for error tracking in a web environment.
@@ -40,9 +44,7 @@ var fullStoryInitializer = function (environment, apiKey) {
40
44
  var mixPanelInitializer = function (environment, apiKey) {
41
45
  if (isProduction(environment)) {
42
46
  localStorage.setItem('_bl_mp', apiKey);
43
- mixpanel.init(apiKey, {
44
- track_pageview: true
45
- });
47
+ mixpanel.init(apiKey);
46
48
  localStorage.removeItem('_bl_init');
47
49
  }
48
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mixpanel.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/mixpanel/mixpanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA0CpD,QAAA,MAAM,gBAAgB,EAAE,YAKvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"mixpanel.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/mixpanel/mixpanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA2CpD,QAAA,MAAM,gBAAgB,EAAE,YAKvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import mixpanel from 'mixpanel-browser';
2
13
  var dispatchUserIdentification = function (id, userProperties) {
3
14
  mixpanel.identify(id);
@@ -21,7 +32,8 @@ var dispatchUserIdentification = function (id, userProperties) {
21
32
  mixpanel.people.set(peopleProperties);
22
33
  };
23
34
  var dispatchCustomEvent = function (event, properties) {
24
- mixpanel.track(event, { properties: properties });
35
+ var rest = __rest(properties, []);
36
+ mixpanel.track(event, rest);
25
37
  };
26
38
  var dispatchScreenEvent = function (screen) {
27
39
  mixpanel.track(screen);
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import mixpanel from 'mixpanel-browser';
2
13
  import MixPanelProvider from './mixpanel';
3
14
  jest.mock('mixpanel-browser', function () { return ({
@@ -26,9 +37,12 @@ describe('MixPanelProvider', function () {
26
37
  });
27
38
  test('dispatchCustomEvent should call mixpanel.track with event and properties', function () {
28
39
  var event = 'testEvent';
29
- var properties = { key1: 'value1', key2: 'value2' };
40
+ var properties = {
41
+ key1: 'value1', key2: true, key3: 9.9, key4: ['value1', 'value2']
42
+ };
30
43
  MixPanelProvider.customEvent(event, properties);
31
- expect(mixpanel.track).toHaveBeenCalledWith(event, { properties: properties });
44
+ var rest = __rest(properties, []);
45
+ expect(mixpanel.track).toHaveBeenCalledWith(event, rest);
32
46
  });
33
47
  test('dispatchScreenEvent should call mixpanel.track with screen', function () {
34
48
  var screen = 'testScreen';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,kBAChB,YAAY,EAAE,KAC5B,OAAmE,CAAC;AAEvE,eAAO,MAAM,4BAA4B,aAAc,MAAM,KAAG,IAc/D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,kBAChB,YAAY,EAAE,KAC5B,OAAmE,CAAC;AAEvE,eAAO,MAAM,4BAA4B,aAAc,MAAM,KAAG,IAY/D,CAAC"}
@@ -6,9 +6,7 @@ export var checkIfMixPanelIsInitialized = function (provider) {
6
6
  var apiKey = localStorage === null || localStorage === void 0 ? void 0 : localStorage.getItem('_bl_mp');
7
7
  var wasInitialized = localStorage.getItem('_bl_init');
8
8
  if (!wasInitialized) {
9
- mixpanel.init(apiKey, {
10
- track_pageview: true
11
- });
9
+ mixpanel.init(apiKey);
12
10
  localStorage.removeItem('_bl_mp');
13
11
  localStorage.setItem('_bl_init', 'init');
14
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useblu/blu-lytics",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",