@evlop/commons 1.0.146 → 1.0.149

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"}
@@ -1 +1 @@
1
- {"version":3,"file":"restApiMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,yDA4D7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"restApiMiddleware.d.ts","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":"AAgBA,eAAO,MAAM,iBAAiB,yDA4D7B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -10,7 +10,13 @@ const actions_1 = require("../actions");
10
10
  const getUserToken_1 = __importDefault(require("../adapters/getUserToken"));
11
11
  const constants_1 = require("../constants");
12
12
  const lodash_1 = require("lodash");
13
+ const axios_retry_1 = __importDefault(require("axios-retry"));
13
14
  const apiBaseUrl = constants_1.API_BASE_URL || '/api/';
15
+ const httpClient = axios_1.default.create();
16
+ axios_retry_1.default(httpClient, {
17
+ retries: Number.MAX_SAFE_INTEGER,
18
+ retryDelay: (retryNumber) => Math.min(5000, axios_retry_1.default.exponentialDelay(retryNumber)),
19
+ });
14
20
  const restApiMiddleware = (store) => (dispatch) => (action) => {
15
21
  if (action.isRestRequest) {
16
22
  return getUserToken_1.default().then((token) => {
@@ -34,33 +40,33 @@ const restApiMiddleware = (store) => (dispatch) => (action) => {
34
40
  switch (String(action.method).trim().toUpperCase()) {
35
41
  case actions_1.POST: {
36
42
  dispatch({ type: action.types[0] });
37
- return axios_1.default.post(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
43
+ return httpClient.post(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
38
44
  .then(resp => (resp.data))
39
45
  .then(response => dispatch(Object.assign(Object.assign({}, action), { success: true, type: action.types[1], response })))
40
46
  .catch(({ response }) => dispatch({ type: action.types[2], error: true, response }));
41
47
  }
42
48
  case actions_1.PUT:
43
49
  dispatch({ type: action.types[0] });
44
- return axios_1.default.put(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
50
+ return httpClient.put(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
45
51
  .then(resp => (resp.data))
46
52
  .then(response => dispatch(Object.assign(Object.assign({}, action), { success: true, type: action.types[1], response })))
47
53
  .catch(({ response }) => dispatch({ type: action.types[2], error: true, response }));
48
54
  case actions_1.PATCH:
49
55
  dispatch({ type: action.types[0] });
50
- return axios_1.default.patch(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
56
+ return httpClient.patch(endpoint, action.data, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
51
57
  .then(resp => (resp.data))
52
58
  .then(response => dispatch(Object.assign(Object.assign({}, action), { success: true, type: action.types[1], response })))
53
59
  .catch(({ response }) => dispatch({ type: action.types[2], error: true, response }));
54
60
  case actions_1.DELETE:
55
61
  dispatch({ type: action.types[0] });
56
- return axios_1.default.delete(endpoint, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
62
+ return httpClient.delete(endpoint, lodash_1.defaultsDeep(requestOptions, { params: action.params, headers: action.headers }))
57
63
  .then(resp => (resp.data))
58
64
  .then(response => dispatch(Object.assign(Object.assign({}, action), { success: true, type: action.types[1], response })))
59
65
  .catch(({ response }) => dispatch({ type: action.types[2], error: true, response }));
60
66
  default:
61
67
  case actions_1.GET:
62
68
  dispatch({ type: action.types[0] });
63
- return axios_1.default.get(endpoint, lodash_1.defaultsDeep(requestOptions, { params: action.data }, { params: action.params, headers: action.headers }))
69
+ return httpClient.get(endpoint, lodash_1.defaultsDeep(requestOptions, { params: action.data }, { params: action.params, headers: action.headers }))
64
70
  .then(resp => resp.data)
65
71
  .then(response => dispatch(Object.assign(Object.assign({}, action), { success: true, type: action.types[1], response })))
66
72
  .catch(({ response }) => dispatch({ type: action.types[2], error: true, response }));
@@ -1 +1 @@
1
- {"version":3,"file":"restApiMiddleware.js","sourceRoot":"","sources":["../../../src/middlewares/restApiMiddleware.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wCAAyC;AACzC,wCAAwD;AACxD,4EAAoD;AACpD,4CAA0C;AAC1C,mCAA2C;AAE3C,MAAM,UAAU,GAAG,wBAAY,IAA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EAAE,MAAM,CAAC,IAAI,EAAC,EAAE,EAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAC,CAAC,CAAC;yBACjI,IAAI,CAAC,IAAI,CAAA,EAAE,CAAA,IAAI,CAAC,IAAI,CAAC;yBACrB,IAAI,CAAC,QAAQ,CAAA,EAAE,CAAC,QAAQ,iCAAK,MAAM,KAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAE,CAAC;yBACtF,KAAK,CAAC,CAAC,EAAC,QAAQ,EAAC,EAAC,EAAE,CAAA,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC,CAAC;aACzF;QACL,CAAC,CAAC,CAAC;KACN;;QAEG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEhC,CAAC,CAAC;AA5DW,QAAA,iBAAiB,qBA4D5B;AAEF,kBAAe,yBAAiB,CAAC"}
@@ -1,3 +1,6 @@
1
+ import React from "react";
2
+ import { IconIdentifier } from "../constants";
3
+ import { Action } from "../hooks";
1
4
  export declare const SHOW_NOTIFICATION = "notification/show";
2
5
  export declare const REMOVE_NOTIFICATION = "notification/remove";
3
6
  export interface Notification {
@@ -8,16 +11,19 @@ export interface Notification {
8
11
  /**
9
12
  * @description notification title
10
13
  */
11
- title: string;
14
+ title: string | React.ReactNode;
12
15
  /**
13
16
  * @description notification message
14
17
  */
15
- message?: string;
18
+ message?: string | React.ReactNode;
19
+ /**
20
+ * @description notification type
21
+ */
16
22
  type?: 'info' | 'success' | 'error' | 'warning';
17
23
  /**
18
24
  * @description icon for notification
19
25
  */
20
- icon?: string;
26
+ icon?: IconIdentifier | React.ReactNode;
21
27
  /**
22
28
  * @description where should the notification be displayed
23
29
  */
@@ -27,7 +33,8 @@ export interface Notification {
27
33
  */
28
34
  buttons?: Array<{
29
35
  title: string;
30
- action: any;
36
+ type: 'primary' | 'secondary' | 'danger';
37
+ action: Action;
31
38
  }>;
32
39
  /**
33
40
  * @description for how long should the notification be displayed (in millisseconds)
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,GAAC,SAAS,GAAC,OAAO,GAAC,SAAS,CAAC;IAC1C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,KAAK,GAAC,WAAW,GAAC,cAAc,GAAC,QAAQ,GAAC,aAAa,GAAC,UAAU,CAAC;IAC7E;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,GAAG,CAAC;KACf,CAAC,CAAA;IACF;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,iBAAkB,YAAY;;;;;;;;CAGzD,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;CAG7B,CAAC;gCAIoB,MAAM,YAAY,CAAC;AAA1C,wBAgBC"}
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/reducers/notifications.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,E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C,YAAY,EAAE,CAAA;aAC1C;QACL,KAAK,2BAAmB;YACpB,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,EAAE,KAAG,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7C;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.146",
3
+ "version": "1.0.149",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -27,6 +27,8 @@
27
27
  },
28
28
  "optionalDependencies": {},
29
29
  "dependencies": {
30
+ "axios-retry": "^3.3.1",
31
+ "events": "^3.3.0",
30
32
  "moment": "^2.29.1",
31
33
  "react-native-base64": "^0.2.1"
32
34
  },