@golemio/core 1.6.6-dev.837110606 → 1.6.6-dev.837591395

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,3 +1,4 @@
1
+ import { ParserOptions } from "xml2js";
1
2
  export interface IJSONSettings {
2
3
  /** Path to the sub-property which contains the results (separated by dot), e.g. "result.objects" */
3
4
  resultsPath: string;
@@ -12,7 +13,7 @@ export interface IXMLSettings {
12
13
  /** Path to the sub-property which contains the results (separated by dot), e.g. "result.objects" */
13
14
  resultsPath: string;
14
15
  /** XML2JS library parameters */
15
- xml2jsParams: object;
16
+ xml2jsParams: ParserOptions;
16
17
  }
17
18
  export interface IDataTypeStrategy {
18
19
  setDataTypeSettings(settings: IJSONSettings | ICSVSettings | IXMLSettings): void;
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.XMLDataTypeStrategy = void 0;
16
16
  const utils_1 = require("../../../helpers/utils");
17
17
  const errors_1 = require("@golemio/errors");
18
- const xml2js_es6_promise_1 = __importDefault(require("xml2js-es6-promise"));
18
+ const xml2js_1 = __importDefault(require("xml2js"));
19
19
  class XMLDataTypeStrategy {
20
20
  constructor(settings) {
21
21
  this.dataTypeSettings = settings;
@@ -30,7 +30,7 @@ class XMLDataTypeStrategy {
30
30
  parseData(data) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
32
  try {
33
- let parsed = yield (0, xml2js_es6_promise_1.default)(data, this.dataTypeSettings.xml2jsParams);
33
+ let parsed = yield xml2js_1.default.parseStringPromise(data, this.dataTypeSettings.xml2jsParams);
34
34
  parsed = (0, utils_1.getSubProperty)(this.dataTypeSettings.resultsPath, parsed);
35
35
  if (this.filter) {
36
36
  parsed = parsed.filter(this.filter);
@@ -1 +1 @@
1
- {"version":3,"file":"XMLDataTypeStrategy.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/datatype-strategy/XMLDataTypeStrategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAgD;AAEhD,4CAA8C;AAC9C,4EAAwC;AAExC,MAAa,mBAAmB;IAI5B,YAAY,QAAsB;QAC9B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEM,mBAAmB,CAAC,QAAsB;QAC7C,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;IACrC,CAAC;IAEM,SAAS,CAAC,cAAkC;QAC/C,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC;IACjC,CAAC;IAEY,SAAS,CAAC,IAAS;;YAC5B,IAAI;gBACA,IAAI,MAAM,GAAG,MAAM,IAAA,4BAAM,EAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBACpE,MAAM,GAAG,IAAA,sBAAc,EAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gBACnE,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBACvC;gBACD,OAAO,MAAM,CAAC;aACjB;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,oBAAW,CAAC,kCAAkC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aACrG;QACL,CAAC;KAAA;CACJ;AA7BD,kDA6BC"}
1
+ {"version":3,"file":"XMLDataTypeStrategy.js","sourceRoot":"","sources":["../../../../src/integration-engine/datasources/datatype-strategy/XMLDataTypeStrategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAgD;AAEhD,4CAA8C;AAC9C,oDAA4B;AAE5B,MAAa,mBAAmB;IAI5B,YAAY,QAAsB;QAC9B,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEM,mBAAmB,CAAC,QAAsB;QAC7C,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;IACrC,CAAC;IAEM,SAAS,CAAC,cAAkC;QAC/C,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC;IACjC,CAAC;IAEY,SAAS,CAAC,IAAS;;YAC5B,IAAI;gBACA,IAAI,MAAM,GAAG,MAAM,gBAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;gBACvF,MAAM,GAAG,IAAA,sBAAc,EAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gBACnE,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBACvC;gBACD,OAAO,MAAM,CAAC;aACjB;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,oBAAW,CAAC,kCAAkC,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aACrG;QACL,CAAC;KAAA;CACJ;AA7BD,kDA6BC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/core",
3
- "version": "1.6.6-dev.837110606",
3
+ "version": "1.6.6-dev.837591395",
4
4
  "description": "Golemio Core Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,6 +47,7 @@
47
47
  "@types/ssh2-sftp-client": "^5.3.1",
48
48
  "@types/supertest": "^2.0.11",
49
49
  "@types/uuid": "^8.3.4",
50
+ "@types/xml2js": "^0.4.11",
50
51
  "@types/yauzl": "^2.10.0",
51
52
  "chai": "4.2.0",
52
53
  "chai-as-promised": "7.1.1",
@@ -129,10 +130,8 @@
129
130
  "sequelize": "^6.29.0",
130
131
  "ssh2-sftp-client": "^7.1.0",
131
132
  "tsyringe": "^4.7.0",
132
- "xml2js-es6-promise": "^1.1.1",
133
+ "xml2js": "^0.5.0",
133
134
  "yauzl": "^2.10.0"
134
135
  },
135
- "overrides": {
136
- "xml2js": "0.5.0"
137
- }
136
+ "overrides": {}
138
137
  }