@abaplint/transpiler-cli 2.1.24 → 2.1.27

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.
Files changed (2) hide show
  1. package/build/bundle.js +1 -1
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -13073,7 +13073,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
13073
13073
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
13074
13074
 
13075
13075
  "use strict";
13076
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DatabaseSetup = void 0;\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst sqlite_database_schema_1 = __webpack_require__(/*! ./sqlite_database_schema */ \"./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js\");\r\nclass DatabaseSetup {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n return {\r\n schemas: {\r\n sqlite: new sqlite_database_schema_1.SQLiteDatabaseSchema(this.reg).run(),\r\n hdb: \"todo\",\r\n pg: \"todo\",\r\n },\r\n insert: this.buildInsert(),\r\n };\r\n }\r\n ////////////////////\r\n buildInsert() {\r\n let insert = \"\";\r\n // INSERT data\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.MessageClass) {\r\n insert += this.messageClass(obj);\r\n }\r\n }\r\n insert += this.t000Insert();\r\n return insert;\r\n }\r\n t000Insert() {\r\n const obj = this.reg.getObject(\"TABL\", \"T000\");\r\n if (obj === undefined) {\r\n return \"\";\r\n }\r\n const type = obj.parseType(this.reg);\r\n if (type instanceof abaplint.BasicTypes.StructureType && type.getComponents().length === 3) {\r\n // todo, this should take the client number from the settings\r\n return `INSERT INTO t000 VALUES ('123', '', '');\\n`;\r\n }\r\n else {\r\n return \"\";\r\n }\r\n }\r\n messageClass(msag) {\r\n // ignore if T100 is unknown\r\n if (this.reg.getObject(\"TABL\", \"T100\") === undefined) {\r\n return \"\";\r\n }\r\n let ret = \"\";\r\n for (const m of msag.getMessages()) {\r\n ret += `INSERT INTO t100 VALUES ('E', '${msag.getName()}', '${m.getNumber()}', '${m.getMessage().replace(/\\'/g, \"''\")}');\\n`;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.DatabaseSetup = DatabaseSetup;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/index.js?");
13076
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DatabaseSetup = void 0;\r\n/* eslint-disable max-len */\r\nconst abaplint = __webpack_require__(/*! @abaplint/core */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst sqlite_database_schema_1 = __webpack_require__(/*! ./sqlite_database_schema */ \"./node_modules/@abaplint/transpiler/build/src/db/sqlite_database_schema.js\");\r\nclass DatabaseSetup {\r\n constructor(reg) {\r\n this.reg = reg;\r\n }\r\n run() {\r\n return {\r\n schemas: {\r\n sqlite: new sqlite_database_schema_1.SQLiteDatabaseSchema(this.reg).run(),\r\n hdb: \"todo\",\r\n pg: \"todo\",\r\n },\r\n insert: this.buildInsert(),\r\n };\r\n }\r\n ////////////////////\r\n buildInsert() {\r\n let insert = \"\";\r\n // INSERT data\r\n for (const obj of this.reg.getObjects()) {\r\n if (obj instanceof abaplint.Objects.MessageClass) {\r\n insert += this.insertT100(obj);\r\n }\r\n else if (obj instanceof abaplint.Objects.Class\r\n || obj instanceof abaplint.Objects.Interface) {\r\n insert += this.insertREPOSRC(obj);\r\n }\r\n }\r\n insert += this.insertT000();\r\n return insert;\r\n }\r\n insertREPOSRC(obj) {\r\n var _a;\r\n if (this.reg.getObject(\"TABL\", \"REPOSRC\") === undefined) {\r\n return \"\";\r\n }\r\n const name = obj.getName().toUpperCase();\r\n const raw = (_a = obj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getRaw();\r\n if (raw === undefined) {\r\n return \"\";\r\n }\r\n return `INSERT INTO reposrc ('PROGNAME', 'DATA') VALUES ('${name}', '${this.escape(raw)}');\\n`;\r\n }\r\n insertT000() {\r\n const tabl = this.reg.getObject(\"TABL\", \"T000\");\r\n if (tabl === undefined) {\r\n return \"\";\r\n }\r\n const type = tabl.parseType(this.reg);\r\n if (type instanceof abaplint.BasicTypes.StructureType && type.getComponents().length >= 3) {\r\n // todo, this should take the client number from the settings\r\n return `INSERT INTO t000 ('MANDT', 'CCCATEGORY', 'CCNOCLIIND') VALUES ('123', '', '');\\n`;\r\n }\r\n else {\r\n return \"\";\r\n }\r\n }\r\n insertT100(msag) {\r\n // ignore if T100 is unknown\r\n if (this.reg.getObject(\"TABL\", \"T100\") === undefined) {\r\n return \"\";\r\n }\r\n let ret = \"\";\r\n for (const m of msag.getMessages()) {\r\n ret += `INSERT INTO t100 ('SPRSL', 'ARBGB', 'MSGNR', 'TEXT') VALUES ('E', '${msag.getName()}', '${m.getNumber()}', '${this.escape(m.getMessage())}');\\n`;\r\n }\r\n return ret;\r\n }\r\n escape(value) {\r\n let ret = value.replace(/\\'/g, \"''\");\r\n // statements are inside a javascript string stemplate\r\n ret = ret.replace(/\\\\/g, \"\\\\\\\\\");\r\n ret = ret.replace(/`/g, \"\\\\`\");\r\n return ret;\r\n }\r\n}\r\nexports.DatabaseSetup = DatabaseSetup;\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/transpiler-cli/./node_modules/@abaplint/transpiler/build/src/db/index.js?");
13077
13077
 
13078
13078
  /***/ }),
13079
13079
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.1.24",
3
+ "version": "2.1.27",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,7 +25,7 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.1.24",
28
+ "@abaplint/transpiler": "^2.1.27",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",