@evlop/commons 1.0.147 → 1.0.148

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"platformSpecific.d.ts","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,QAAsF,CAAC;AAChH,eAAO,MAAM,UAAU,QAAmG,CAAC"}
1
+ {"version":3,"file":"platformSpecific.d.ts","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,QAAiE,CAAC;AAC3F,eAAO,MAAM,UAAU,QAA6E,CAAC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SOCKET_URL = exports.API_BASE_URL = void 0;
4
- const isNode = typeof process !== 'undefined';
5
- exports.API_BASE_URL = isNode ? process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL : undefined;
6
- exports.SOCKET_URL = isNode ? process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL : undefined;
4
+ exports.API_BASE_URL = process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL;
5
+ exports.SOCKET_URL = process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL;
7
6
  //# sourceMappingURL=platformSpecific.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platformSpecific.js","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC;AAEjC,QAAA,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC;AACnG,QAAA,UAAU,GAAG,MAAM,CAAC,CAAC,CAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC,CAAC,CAAC,SAAS,CAAC"}
1
+ {"version":3,"file":"platformSpecific.js","sourceRoot":"","sources":["../../../src/constants/platformSpecific.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare type TrackListener = (eventName: string, properties: Object) => void;
2
+ declare type UnsubscribeTrackListener = () => void;
3
+ declare class Analytics {
4
+ private eventEmitter;
5
+ track(eventName: string, properties: Object): void;
6
+ onTrack(handleTrack: TrackListener): UnsubscribeTrackListener;
7
+ }
8
+ export declare const analytics: Analytics;
9
+ export default analytics;
10
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/helpers/analytics.ts"],"names":[],"mappings":"AAEA,aAAK,aAAa,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;AACrE,aAAK,wBAAwB,GAAG,MAAM,IAAI,CAAC;AAE3C,cAAM,SAAS;IACX,OAAO,CAAC,YAAY,CAAsB;IAE1C,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAO3C,OAAO,CAAC,WAAW,EAAE,aAAa,GAAG,wBAAwB;CAMhE;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC;AAEzC,eAAe,SAAS,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analytics = void 0;
4
+ const events_1 = require("events");
5
+ class Analytics {
6
+ constructor() {
7
+ this.eventEmitter = new events_1.EventEmitter();
8
+ }
9
+ track(eventName, properties) {
10
+ this.eventEmitter.emit('track', {
11
+ eventName,
12
+ properties,
13
+ });
14
+ }
15
+ onTrack(handleTrack) {
16
+ const handleEvent = ({ eventName, properties }) => handleTrack(eventName, properties);
17
+ this.eventEmitter.addListener('track', handleEvent);
18
+ return () => this.eventEmitter.removeListener('track', handleEvent);
19
+ }
20
+ }
21
+ exports.analytics = new Analytics();
22
+ exports.default = exports.analytics;
23
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/helpers/analytics.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKtC,MAAM,SAAS;IAAf;QACY,iBAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IAe9C,CAAC;IAbG,KAAK,CAAC,SAAiB,EAAE,UAAkB;QACvC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE;YAC5B,SAAS;YACT,UAAU;SACb,CAAC,CAAC;IACP,CAAC;IAED,OAAO,CAAC,WAA0B;QAC9B,MAAM,WAAW,GAAG,CAAC,EAAC,SAAS,EAAE,UAAU,EAAC,EAAC,EAAE,CAAA,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;QACjF,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAC,WAAW,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;CAEJ;AAEY,QAAA,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAEzC,kBAAe,iBAAS,CAAC"}
@@ -4,4 +4,5 @@ export * from './commonStyles';
4
4
  export * from './themeHelpers';
5
5
  export * from './base64';
6
6
  export * from './i18nHelpers';
7
+ export * from './analytics';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -16,4 +16,5 @@ __exportStar(require("./commonStyles"), exports);
16
16
  __exportStar(require("./themeHelpers"), exports);
17
17
  __exportStar(require("./base64"), exports);
18
18
  __exportStar(require("./i18nHelpers"), exports);
19
+ __exportStar(require("./analytics"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.147",
3
+ "version": "1.0.148",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -28,6 +28,7 @@
28
28
  "optionalDependencies": {},
29
29
  "dependencies": {
30
30
  "axios-retry": "^3.3.1",
31
+ "events": "^3.3.0",
31
32
  "moment": "^2.29.1",
32
33
  "react-native-base64": "^0.2.1"
33
34
  },