@abaplint/transpiler-cli 2.11.47 → 2.11.49

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 +114 -23
  2. package/package.json +2 -2
package/build/bundle.js CHANGED
@@ -77747,6 +77747,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
77747
77747
  const sqlite_database_schema_1 = __webpack_require__(/*! ./schema_generation/sqlite_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/sqlite_database_schema.js");
77748
77748
  const pg_database_schema_1 = __webpack_require__(/*! ./schema_generation/pg_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/pg_database_schema.js");
77749
77749
  const snowflake_database_schema_1 = __webpack_require__(/*! ./schema_generation/snowflake_database_schema */ "./node_modules/@abaplint/transpiler/build/src/db/schema_generation/snowflake_database_schema.js");
77750
+ const populate_tables_1 = __webpack_require__(/*! ./populate_tables */ "./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js");
77750
77751
  /////////////////////////
77751
77752
  // NOTES
77752
77753
  /////////////////////////
@@ -77790,23 +77791,64 @@ class DatabaseSetup {
77790
77791
  buildInsert(options) {
77791
77792
  // note: avoid hitting maximum statement size by splitting into multiple statements
77792
77793
  const insert = [];
77794
+ const populateTables = new populate_tables_1.PopulateTables(this.reg);
77793
77795
  // INSERT data
77794
77796
  for (const obj of this.reg.getObjects()) {
77795
77797
  if (obj instanceof abaplint.Objects.MessageClass) {
77796
- insert.push(...this.insertT100(obj));
77798
+ insert.push(...populateTables.insertT100(obj));
77797
77799
  }
77798
77800
  else if (obj instanceof abaplint.Objects.Class
77799
77801
  || obj instanceof abaplint.Objects.Interface) {
77800
- if (options?.skipReposrc !== true) {
77801
- insert.push(this.insertREPOSRC(obj));
77802
+ if (options?.populateTables?.reposrc !== false) {
77803
+ insert.push(populateTables.insertREPOSRC(obj));
77804
+ }
77805
+ if (options?.populateTables?.seosubco !== false) {
77806
+ insert.push(...populateTables.insertSEOSUBCO(obj));
77807
+ }
77808
+ if (options?.populateTables?.seosubcodf !== false) {
77809
+ insert.push(...populateTables.insertSEOSUBCODF(obj));
77810
+ }
77811
+ if (options?.populateTables?.seosubcotx !== false) {
77812
+ insert.push(...populateTables.insertSEOSUBCOTX(obj));
77802
77813
  }
77803
77814
  }
77804
77815
  }
77805
- insert.push(this.insertT000());
77816
+ insert.push(populateTables.insertT000());
77806
77817
  return insert;
77807
77818
  }
77819
+ }
77820
+ exports.DatabaseSetup = DatabaseSetup;
77821
+ //# sourceMappingURL=index.js.map
77822
+
77823
+ /***/ }),
77824
+
77825
+ /***/ "./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js":
77826
+ /*!***************************************************************************!*\
77827
+ !*** ./node_modules/@abaplint/transpiler/build/src/db/populate_tables.js ***!
77828
+ \***************************************************************************/
77829
+ /***/ ((__unused_webpack_module, exports) => {
77830
+
77831
+ "use strict";
77832
+
77833
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
77834
+ exports.PopulateTables = void 0;
77835
+ class PopulateTables {
77836
+ hasREPOSRC;
77837
+ hasSEOSUBCO;
77838
+ hasSEOSUBCODF;
77839
+ hasSEOSUBCOTX;
77840
+ hasT000;
77841
+ hasT100;
77842
+ constructor(reg) {
77843
+ this.hasREPOSRC = reg.getObject("TABL", "REPOSRC") !== undefined;
77844
+ this.hasSEOSUBCO = reg.getObject("TABL", "SEOSUBCO") !== undefined;
77845
+ this.hasSEOSUBCODF = reg.getObject("TABL", "SEOSUBCODF") !== undefined;
77846
+ this.hasSEOSUBCOTX = reg.getObject("TABL", "SEOSUBCOTX") !== undefined;
77847
+ this.hasT000 = reg.getObject("TABL", "T000") !== undefined;
77848
+ this.hasT100 = reg.getObject("TABL", "T100") !== undefined;
77849
+ }
77808
77850
  insertREPOSRC(obj) {
77809
- if (this.reg.getObject("TABL", "REPOSRC") === undefined) {
77851
+ if (!this.hasREPOSRC) {
77810
77852
  return "";
77811
77853
  }
77812
77854
  const name = obj.getName().toUpperCase();
@@ -77816,24 +77858,9 @@ class DatabaseSetup {
77816
77858
  }
77817
77859
  return `INSERT INTO reposrc ('PROGNAME', 'DATA') VALUES ('${name.padEnd(40, " ")}', '${this.escape(raw)}');`;
77818
77860
  }
77819
- insertT000() {
77820
- const tabl = this.reg.getObject("TABL", "T000");
77821
- if (tabl === undefined) {
77822
- return "";
77823
- }
77824
- const type = tabl.parseType(this.reg);
77825
- if (type instanceof abaplint.BasicTypes.StructureType && type.getComponents().length >= 3) {
77826
- // todo, this should take the client number from the settings
77827
- return `INSERT INTO t000 ('mandt', 'cccategory', 'ccnocliind') VALUES ('123', '', '');`;
77828
- }
77829
- else {
77830
- return "";
77831
- }
77832
- }
77833
77861
  insertT100(msag) {
77834
77862
  // ignore if T100 is unknown
77835
- const obj = this.reg.getObject("TABL", "T100");
77836
- if (obj === undefined) {
77863
+ if (!this.hasT100) {
77837
77864
  return [];
77838
77865
  }
77839
77866
  const ret = [];
@@ -77842,6 +77869,70 @@ class DatabaseSetup {
77842
77869
  }
77843
77870
  return ret;
77844
77871
  }
77872
+ insertSEOSUBCO(obj) {
77873
+ const def = obj.getDefinition();
77874
+ const ret = [];
77875
+ if (def === undefined || !this.hasSEOSUBCO) {
77876
+ return [];
77877
+ }
77878
+ for (const method of def.getMethodDefinitions().getAll()) {
77879
+ for (const parameter of method.getParameters().getAll()) {
77880
+ ret.push(`INSERT INTO "seosubco" ("clsname", "cmpname", "sconame") VALUES ('${obj.getName()}', '${method.getName().toUpperCase()}', '${parameter.getName().toUpperCase()}');`);
77881
+ }
77882
+ }
77883
+ return ret;
77884
+ }
77885
+ insertSEOSUBCODF(obj) {
77886
+ const def = obj.getDefinition();
77887
+ const ret = [];
77888
+ if (def === undefined || !this.hasSEOSUBCODF) {
77889
+ return [];
77890
+ }
77891
+ for (const method of def.getMethodDefinitions().getAll()) {
77892
+ let editorder = 0;
77893
+ const optionalParameters = method.getParameters().getOptional();
77894
+ for (const parameter of method.getParameters().getAll()) {
77895
+ editorder++;
77896
+ let pardecltyp = "";
77897
+ if (parameter.getMeta().includes("importing" /* abaplint.IdentifierMeta.MethodImporting */)) {
77898
+ pardecltyp = "0";
77899
+ }
77900
+ else if (parameter.getMeta().includes("changing" /* abaplint.IdentifierMeta.MethodChanging */)) {
77901
+ pardecltyp = "2";
77902
+ }
77903
+ else if (parameter.getMeta().includes("returning" /* abaplint.IdentifierMeta.MethodReturning */)) {
77904
+ pardecltyp = "3";
77905
+ }
77906
+ else if (parameter.getMeta().includes("exporting" /* abaplint.IdentifierMeta.MethodExporting */)) {
77907
+ pardecltyp = "1";
77908
+ }
77909
+ const paroptionl = optionalParameters.includes(parameter.getName()) ? "X" : " ";
77910
+ const type = parameter.getType().getQualifiedName()?.toUpperCase() || "";
77911
+ ret.push(`INSERT INTO "seosubcodf" ("clsname", "cmpname", "sconame", "version", "editorder", "pardecltyp", "type", "paroptionl") VALUES ('${obj.getName()}', '${method.getName().toUpperCase()}', '${parameter.getName().toUpperCase()}', 'A', ${editorder}, '${pardecltyp}', '${type}', '${paroptionl}');`);
77912
+ }
77913
+ }
77914
+ return ret;
77915
+ }
77916
+ insertSEOSUBCOTX(obj) {
77917
+ const def = obj.getDefinition();
77918
+ const ret = [];
77919
+ if (def === undefined || !this.hasSEOSUBCOTX) {
77920
+ return [];
77921
+ }
77922
+ for (const method of def.getMethodDefinitions().getAll()) {
77923
+ for (const parameter of method.getParameters().getAll()) {
77924
+ ret.push(`INSERT INTO "seosubcotx" ("clsname", "cmpname", "sconame", "langu", "descript") VALUES ('${obj.getName()}', '${method.getName().toUpperCase()}', '${parameter.getName().toUpperCase()}', 'E', 'todo');`);
77925
+ }
77926
+ }
77927
+ return ret;
77928
+ }
77929
+ insertT000() {
77930
+ if (!this.hasT000) {
77931
+ return "";
77932
+ }
77933
+ // todo, this should take the client number from the settings
77934
+ return `INSERT INTO t000 ('mandt', 'cccategory', 'ccnocliind') VALUES ('123', '', '');`;
77935
+ }
77845
77936
  escape(value) {
77846
77937
  let ret = value.replace(/\'/g, "''");
77847
77938
  // statements are inside a javascript string stemplate
@@ -77851,8 +77942,8 @@ class DatabaseSetup {
77851
77942
  return ret;
77852
77943
  }
77853
77944
  }
77854
- exports.DatabaseSetup = DatabaseSetup;
77855
- //# sourceMappingURL=index.js.map
77945
+ exports.PopulateTables = PopulateTables;
77946
+ //# sourceMappingURL=populate_tables.js.map
77856
77947
 
77857
77948
  /***/ }),
77858
77949
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.11.47",
3
+ "version": "2.11.49",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
30
  "@abaplint/core": "^2.113.185",
31
- "@abaplint/transpiler": "^2.11.47",
31
+ "@abaplint/transpiler": "^2.11.49",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.3.0",
34
34
  "@types/progress": "^2.0.7",