@vita-mojo/integration-hub 1.0.1-rc.2 → 1.0.1

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/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@vita-mojo/integration-hub",
3
- "version": "1.0.1-rc.2",
4
- "type": "module",
3
+ "version": "1.0.1",
5
4
  "main": "./src/index.js",
6
5
  "types": "./src/index.d.ts",
7
6
  "dependencies": {},
package/src/constants.js CHANGED
@@ -1,17 +1,20 @@
1
- export var IntegrationStatuses;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Epos2IntegrationTypes = exports.Epos2EventTypes = exports.IntegrationStatuses = void 0;
4
+ var IntegrationStatuses;
2
5
  (function (IntegrationStatuses) {
3
6
  IntegrationStatuses["WARNING"] = "warning";
4
7
  IntegrationStatuses["SUCCESS"] = "success";
5
8
  IntegrationStatuses["ERROR"] = "error";
6
- })(IntegrationStatuses || (IntegrationStatuses = {}));
7
- export var Epos2EventTypes;
9
+ })(IntegrationStatuses = exports.IntegrationStatuses || (exports.IntegrationStatuses = {}));
10
+ var Epos2EventTypes;
8
11
  (function (Epos2EventTypes) {
9
12
  Epos2EventTypes["NEW_ORDER"] = "New Order";
10
13
  Epos2EventTypes["ORDER_STATUS"] = "Order Status";
11
- })(Epos2EventTypes || (Epos2EventTypes = {}));
12
- export var Epos2IntegrationTypes;
14
+ })(Epos2EventTypes = exports.Epos2EventTypes || (exports.Epos2EventTypes = {}));
15
+ var Epos2IntegrationTypes;
13
16
  (function (Epos2IntegrationTypes) {
14
17
  Epos2IntegrationTypes["OUTBOUND"] = "outbound";
15
18
  Epos2IntegrationTypes["INBOUND"] = "inbound";
16
- })(Epos2IntegrationTypes || (Epos2IntegrationTypes = {}));
19
+ })(Epos2IntegrationTypes = exports.Epos2IntegrationTypes || (exports.Epos2IntegrationTypes = {}));
17
20
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AACD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,gDAA6B,CAAA;AAC/B,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AACD,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;AACrB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B;AACD,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,gDAA6B,CAAA;AAC/B,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AACD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;AACrB,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC"}
package/src/index.js CHANGED
@@ -1,3 +1,6 @@
1
- export * from './constants';
2
- export * from './logs-aggregator';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./constants"), exports);
5
+ tslib_1.__exportStar(require("./logs-aggregator"), exports);
3
6
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,4DAAkC"}
@@ -1,14 +1,17 @@
1
- import { __awaiter } from "tslib";
2
- import * as R from 'ramda';
3
- import { IntegrationStatuses } from './constants';
4
- import { safeStringify } from './safe-stringify';
5
- export class LogsAggregator {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogsAggregator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const R = require("ramda");
6
+ const constants_1 = require("./constants");
7
+ const safe_stringify_1 = require("./safe-stringify");
8
+ class LogsAggregator {
6
9
  constructor(initialState = {}) {
7
10
  this.initialState = Object.assign({ apiCalls: [] }, initialState);
8
11
  this.aggregatedLogs = Object.assign({}, this.initialState);
9
12
  }
10
13
  captureApiCall(httpClientRequestCallback, { parseRequest, parseResponse, parseError } = {}) {
11
- return (requestConfig) => __awaiter(this, void 0, void 0, function* () {
14
+ return (requestConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
12
15
  let error;
13
16
  let response;
14
17
  try {
@@ -42,7 +45,7 @@ export class LogsAggregator {
42
45
  this.aggregatedLogs = Object.assign(Object.assign({}, this.aggregatedLogs), logToMerge);
43
46
  }
44
47
  dispatchLogs(logFor) {
45
- console.log(safeStringify({
48
+ console.log((0, safe_stringify_1.safeStringify)({
46
49
  log: Object.assign(Object.assign({}, this.aggregatedLogs), { integrationStatus: this.createIntegrationStatus() }),
47
50
  logFor,
48
51
  }));
@@ -54,13 +57,14 @@ export class LogsAggregator {
54
57
  const notNilOrEmpty = R.complement(R.either(R.isNil, R.isEmpty));
55
58
  let status;
56
59
  if (notNilOrEmpty(R.path(['aggregatedLogs', 'error'], this)))
57
- status = IntegrationStatuses.ERROR;
60
+ status = constants_1.IntegrationStatuses.ERROR;
58
61
  else if (notNilOrEmpty(R.path(['aggregatedLogs', 'warnings'], this)) ||
59
62
  notNilOrEmpty(R.path(['aggregatedLogs', 'mappingErrors'], this)))
60
- status = IntegrationStatuses.WARNING;
63
+ status = constants_1.IntegrationStatuses.WARNING;
61
64
  else
62
- status = IntegrationStatuses.SUCCESS;
65
+ status = constants_1.IntegrationStatuses.SUCCESS;
63
66
  return status;
64
67
  }
65
68
  }
69
+ exports.LogsAggregator = LogsAggregator;
66
70
  //# sourceMappingURL=logs-aggregator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logs-aggregator.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/logs-aggregator.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,MAAM,OAAO,cAAc;IAIzB,YAAY,YAAY,GAAG,EAAE;QAC3B,IAAI,CAAC,YAAY,mBAAK,QAAQ,EAAE,EAAE,IAAK,YAAY,CAAE,CAAC;QACtD,IAAI,CAAC,cAAc,qBAAQ,IAAI,CAAC,YAAY,CAAE,CAAC;IACjD,CAAC;IAED,cAAc,CACZ,yBAAwC,EACxC,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,KAA4B,EAAE;QAEvE,OAAO,CACL,aAAiC,EACT,EAAE;YAC1B,IAAI,KAAU,CAAC;YACf,IAAI,QAAa,CAAC;YAElB,IAAI;gBACF,QAAQ,GAAG,MAAM,yBAAyB,CAAC,aAAa,CAAC,CAAC;aAC3D;YAAC,OAAO,CAAC,EAAE;gBACV,KAAK,GAAG,CAAC,CAAC;gBACV,MAAM,CAAC,CA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AC;IAEO,uBAAuB;QAC7B,MAAM,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAEjE,IAAI,MAAM,CAAC;QAEX,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;YAC1D,MAAM,GAAG,+BAAmB,CAAC,KAAK,CAAC;aAChC,IACH,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC;YAC3D,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;YAEhE,MAAM,GAAG,+BAAmB,CAAC,OAAO,CAAC;;YAClC,MAAM,GAAG,+BAAmB,CAAC,OAAO,CAAC;QAE1C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AArFD,wCAqFC"}
@@ -1,10 +1,14 @@
1
- import stringify from 'fast-safe-stringify';
2
- export const safeStringify = (value) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.safeStringify = void 0;
4
+ const fast_safe_stringify_1 = require("fast-safe-stringify");
5
+ const safeStringify = (value) => {
3
6
  try {
4
7
  return JSON.stringify(value);
5
8
  }
6
9
  catch (_a) {
7
- return stringify(value);
10
+ return (0, fast_safe_stringify_1.default)(value);
8
11
  }
9
12
  };
13
+ exports.safeStringify = safeStringify;
10
14
  //# sourceMappingURL=safe-stringify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"safe-stringify.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/safe-stringify.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAU,EAAU,EAAE;IAClD,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC9B;IAAC,WAAM;QACN,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;KACzB;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"safe-stringify.js","sourceRoot":"","sources":["../../../../packages/integration-hub/src/safe-stringify.ts"],"names":[],"mappings":";;;AAAA,6DAA4C;AAErC,MAAM,aAAa,GAAG,CAAC,KAAU,EAAU,EAAE;IAClD,IAAI;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC9B;IAAC,WAAM;QACN,OAAO,IAAA,6BAAS,EAAC,KAAK,CAAC,CAAC;KACzB;AACH,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}