@abaplint/cli 2.120.48 → 2.120.50

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/cli.js +166 -25
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -63109,6 +63109,9 @@ const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
63109
63109
  const Types = __importStar(__webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js"));
63110
63110
  const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "../core/build/src/xml_utils.js");
63111
63111
  const domain_1 = __webpack_require__(/*! ./domain */ "../core/build/src/objects/domain.js");
63112
+ const _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
63113
+ const identifier_1 = __webpack_require__(/*! ../abap/1_lexer/tokens/identifier */ "../core/build/src/abap/1_lexer/tokens/identifier.js");
63114
+ const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
63112
63115
  class DataElement extends _abstract_object_1.AbstractObject {
63113
63116
  constructor() {
63114
63117
  super(...arguments);
@@ -63129,6 +63132,17 @@ class DataElement extends _abstract_object_1.AbstractObject {
63129
63132
  allowNamespace: true,
63130
63133
  };
63131
63134
  }
63135
+ getIdentifier() {
63136
+ const xmlIdentifier = super.getIdentifier();
63137
+ if (xmlIdentifier) {
63138
+ return xmlIdentifier;
63139
+ }
63140
+ const file = this.getAFFFile();
63141
+ if (file === undefined) {
63142
+ return undefined;
63143
+ }
63144
+ return new _identifier_1.Identifier(new identifier_1.Identifier(new position_1.Position(1, 1), this.getName()), file.getFilename());
63145
+ }
63132
63146
  setDirty() {
63133
63147
  this.parsedXML = undefined;
63134
63148
  this.parsedType = undefined;
@@ -63176,7 +63190,6 @@ class DataElement extends _abstract_object_1.AbstractObject {
63176
63190
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dtelmaster;
63177
63191
  }
63178
63192
  parseType(reg) {
63179
- var _a;
63180
63193
  const references = [];
63181
63194
  let lookup = undefined;
63182
63195
  this.parse();
@@ -63188,7 +63201,53 @@ class DataElement extends _abstract_object_1.AbstractObject {
63188
63201
  return this.parsedType;
63189
63202
  }
63190
63203
  const ddic = new ddic_1.DDIC(reg);
63191
- if (this.parsedXML.refkind === "D") {
63204
+ const lookupPredefinedType = () => {
63205
+ var _a, _b;
63206
+ if (((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.datatype) === undefined || this.parsedXML.datatype === "") {
63207
+ return { type: new Types.UnknownType("DATATYPE unexpectely empty in " + this.getName()) };
63208
+ }
63209
+ return { type: ddic.textToType({
63210
+ text: this.parsedXML.datatype,
63211
+ length: this.parsedXML.leng,
63212
+ decimals: this.parsedXML.decimals,
63213
+ infoText: this.getName(),
63214
+ qualifiedName: this.getName(),
63215
+ conversionExit: undefined,
63216
+ ddicName: this.getName(),
63217
+ description: (_b = this.parsedXML.texts) === null || _b === void 0 ? void 0 : _b.heading,
63218
+ }) };
63219
+ };
63220
+ if (this.parsedXML.affCategory === "referenceToPredefinedType") {
63221
+ const predefined = lookupPredefinedType();
63222
+ lookup = predefined.type instanceof Types.UnknownType
63223
+ ? predefined
63224
+ : { type: new Types.DataReference(predefined.type, this.getName()) };
63225
+ }
63226
+ else if (this.parsedXML.affCategory === "referenceDictionaryType") {
63227
+ if (this.parsedXML.domname === undefined || this.parsedXML.domname === "") {
63228
+ lookup = { type: new Types.UnknownType("Type name unexpectely empty in " + this.getName()) };
63229
+ }
63230
+ else {
63231
+ const referenced = ddic.lookup(this.parsedXML.domname);
63232
+ lookup = referenced.type instanceof Types.UnknownType
63233
+ ? referenced
63234
+ : Object.assign(Object.assign({}, referenced), { type: new Types.DataReference(referenced.type, this.getName()) });
63235
+ }
63236
+ }
63237
+ else if (this.parsedXML.affCategory === "referenceClasIntType") {
63238
+ if (this.parsedXML.domname === undefined || this.parsedXML.domname === "") {
63239
+ lookup = { type: new Types.UnknownType("Type name unexpectely empty in " + this.getName()) };
63240
+ }
63241
+ else {
63242
+ lookup = ddic.lookupObject(this.parsedXML.domname);
63243
+ }
63244
+ }
63245
+ else if (this.parsedXML.affCategory !== undefined
63246
+ && this.parsedXML.affCategory !== "domain"
63247
+ && this.parsedXML.affCategory !== "predefinedType") {
63248
+ lookup = { type: new Types.UnknownType("Unknown AFF data type category " + this.parsedXML.affCategory + " in " + this.getName()) };
63249
+ }
63250
+ else if (this.parsedXML.refkind === "D") {
63192
63251
  if (this.parsedXML.domname === undefined || this.parsedXML.domname === "") {
63193
63252
  lookup = { type: new Types.UnknownType("DOMNAME unexpectely empty in " + this.getName()) };
63194
63253
  }
@@ -63205,21 +63264,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
63205
63264
  }
63206
63265
  }
63207
63266
  else {
63208
- if (this.parsedXML.datatype === undefined || this.parsedXML.datatype === "") {
63209
- lookup = { type: new Types.UnknownType("DATATYPE unexpectely empty in " + this.getName()) };
63210
- }
63211
- else {
63212
- lookup = { type: ddic.textToType({
63213
- text: this.parsedXML.datatype,
63214
- length: this.parsedXML.leng,
63215
- decimals: this.parsedXML.decimals,
63216
- infoText: this.getName(),
63217
- qualifiedName: this.getName(),
63218
- conversionExit: undefined,
63219
- ddicName: this.getName(),
63220
- description: (_a = this.parsedXML.texts) === null || _a === void 0 ? void 0 : _a.heading,
63221
- }) };
63222
- }
63267
+ lookup = lookupPredefinedType();
63223
63268
  }
63224
63269
  }
63225
63270
  if (lookup.object) {
@@ -63234,17 +63279,52 @@ class DataElement extends _abstract_object_1.AbstractObject {
63234
63279
  return lookup.type;
63235
63280
  }
63236
63281
  parse() {
63237
- var _a, _b, _c, _d, _e, _f, _g;
63282
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
63238
63283
  if (this.parsedXML !== undefined) {
63239
63284
  return { updated: false, runtime: 0 };
63240
63285
  }
63241
63286
  const start = Date.now();
63242
63287
  this.parsedXML = {};
63288
+ const jsonFile = this.getAFFFile();
63289
+ if (jsonFile) {
63290
+ try {
63291
+ const parsed = JSON.parse(jsonFile.getRaw());
63292
+ const typeInformation = parsed.dataTypeInformation;
63293
+ const predefinedType = typeInformation === null || typeInformation === void 0 ? void 0 : typeInformation.predefinedType;
63294
+ const fieldLabels = parsed.fieldLabels;
63295
+ this.parsedXML = {
63296
+ description: (_a = parsed.header) === null || _a === void 0 ? void 0 : _a.description,
63297
+ affCategory: typeInformation === null || typeInformation === void 0 ? void 0 : typeInformation.category,
63298
+ refkind: (typeInformation === null || typeInformation === void 0 ? void 0 : typeInformation.category) === "domain" ? "D" : undefined,
63299
+ domname: typeInformation === null || typeInformation === void 0 ? void 0 : typeInformation.typeName,
63300
+ datatype: predefinedType === null || predefinedType === void 0 ? void 0 : predefinedType.dataType,
63301
+ leng: (_b = predefinedType === null || predefinedType === void 0 ? void 0 : predefinedType.length) === null || _b === void 0 ? void 0 : _b.toString(),
63302
+ decimals: (_c = predefinedType === null || predefinedType === void 0 ? void 0 : predefinedType.decimals) === null || _c === void 0 ? void 0 : _c.toString(),
63303
+ texts: {
63304
+ short: fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.short,
63305
+ medium: fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.medium,
63306
+ long: fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.long,
63307
+ heading: fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.heading,
63308
+ },
63309
+ textMaxLengths: {
63310
+ short: (_d = fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.shortLength) === null || _d === void 0 ? void 0 : _d.toString(),
63311
+ medium: (_e = fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.mediumLength) === null || _e === void 0 ? void 0 : _e.toString(),
63312
+ long: (_f = fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.longLength) === null || _f === void 0 ? void 0 : _f.toString(),
63313
+ heading: (_g = fieldLabels === null || fieldLabels === void 0 ? void 0 : fieldLabels.headingLength) === null || _g === void 0 ? void 0 : _g.toString(),
63314
+ },
63315
+ };
63316
+ }
63317
+ catch (_q) {
63318
+ // handled by parseType()
63319
+ }
63320
+ const end = Date.now();
63321
+ return { updated: true, runtime: end - start };
63322
+ }
63243
63323
  const parsed = super.parseRaw2();
63244
63324
  if (parsed === undefined) {
63245
63325
  return { updated: false, runtime: 0 };
63246
63326
  }
63247
- const dd04v = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DD04V;
63327
+ const dd04v = (_k = (_j = (_h = parsed.abapGit) === null || _h === void 0 ? void 0 : _h["asx:abap"]) === null || _j === void 0 ? void 0 : _j["asx:values"]) === null || _k === void 0 ? void 0 : _k.DD04V;
63248
63328
  this.parsedXML = {
63249
63329
  description: dd04v === null || dd04v === void 0 ? void 0 : dd04v.DDTEXT,
63250
63330
  refkind: dd04v === null || dd04v === void 0 ? void 0 : dd04v.REFKIND,
@@ -63267,7 +63347,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
63267
63347
  },
63268
63348
  };
63269
63349
  this.parsedXML.textsTranslations = [];
63270
- for (const item of (0, xml_utils_1.xmlToArray)((_g = (_f = (_e = (_d = parsed.abapGit) === null || _d === void 0 ? void 0 : _d["asx:abap"]) === null || _e === void 0 ? void 0 : _e["asx:values"]) === null || _f === void 0 ? void 0 : _f.DD04_TEXTS) === null || _g === void 0 ? void 0 : _g.item)) {
63350
+ for (const item of (0, xml_utils_1.xmlToArray)((_p = (_o = (_m = (_l = parsed.abapGit) === null || _l === void 0 ? void 0 : _l["asx:abap"]) === null || _m === void 0 ? void 0 : _m["asx:values"]) === null || _o === void 0 ? void 0 : _o.DD04_TEXTS) === null || _p === void 0 ? void 0 : _p.item)) {
63271
63351
  this.parsedXML.textsTranslations.push({
63272
63352
  language: item.DDLANGUAGE,
63273
63353
  description: item.DDTEXT,
@@ -63280,6 +63360,9 @@ class DataElement extends _abstract_object_1.AbstractObject {
63280
63360
  const end = Date.now();
63281
63361
  return { updated: true, runtime: end - start };
63282
63362
  }
63363
+ getAFFFile() {
63364
+ return this.getFiles().find(file => file.getFilename().toLowerCase().endsWith(".dtel.json"));
63365
+ }
63283
63366
  }
63284
63367
  exports.DataElement = DataElement;
63285
63368
  //# sourceMappingURL=data_element.js.map
@@ -63426,16 +63509,21 @@ const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../cor
63426
63509
  const Types = __importStar(__webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js"));
63427
63510
  const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
63428
63511
  const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "../core/build/src/xml_utils.js");
63512
+ const _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
63513
+ const identifier_1 = __webpack_require__(/*! ../abap/1_lexer/tokens/identifier */ "../core/build/src/abap/1_lexer/tokens/identifier.js");
63514
+ const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
63429
63515
  class Domain extends _abstract_object_1.AbstractObject {
63430
63516
  getType() {
63431
63517
  return "DOMA";
63432
63518
  }
63433
63519
  getDescription() {
63434
63520
  var _a;
63521
+ this.parse();
63435
63522
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
63436
63523
  }
63437
63524
  getConversionExit() {
63438
63525
  var _a;
63526
+ this.parse();
63439
63527
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.conversionExit;
63440
63528
  }
63441
63529
  getDataType() {
@@ -63449,6 +63537,17 @@ class Domain extends _abstract_object_1.AbstractObject {
63449
63537
  allowNamespace: true,
63450
63538
  };
63451
63539
  }
63540
+ getIdentifier() {
63541
+ const xmlIdentifier = super.getIdentifier();
63542
+ if (xmlIdentifier) {
63543
+ return xmlIdentifier;
63544
+ }
63545
+ const file = this.getAFFFile();
63546
+ if (file === undefined) {
63547
+ return undefined;
63548
+ }
63549
+ return new _identifier_1.Identifier(new identifier_1.Identifier(new position_1.Position(1, 1), this.getName()), file.getFilename());
63550
+ }
63452
63551
  setDirty() {
63453
63552
  this.parsedXML = undefined;
63454
63553
  super.setDirty();
@@ -63475,18 +63574,57 @@ class Domain extends _abstract_object_1.AbstractObject {
63475
63574
  });
63476
63575
  }
63477
63576
  parse() {
63478
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
63577
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
63578
+ var _v, _w;
63479
63579
  if (this.parsedXML) {
63480
63580
  return { updated: false, runtime: 0 };
63481
63581
  }
63482
63582
  const start = Date.now();
63483
63583
  this.parsedXML = {};
63584
+ const jsonFile = this.getAFFFile();
63585
+ if (jsonFile) {
63586
+ try {
63587
+ const parsed = JSON.parse(jsonFile.getRaw());
63588
+ const language = (_a = parsed.header) === null || _a === void 0 ? void 0 : _a.originalLanguage;
63589
+ const values = [];
63590
+ for (const fixedValue of (_v = parsed.fixedValues) !== null && _v !== void 0 ? _v : []) {
63591
+ values.push({
63592
+ low: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.fixedValue,
63593
+ high: "",
63594
+ description: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.description,
63595
+ language: language,
63596
+ });
63597
+ }
63598
+ for (const interval of (_w = parsed.fixedValueIntervals) !== null && _w !== void 0 ? _w : []) {
63599
+ values.push({
63600
+ low: interval === null || interval === void 0 ? void 0 : interval.lowLimit,
63601
+ high: interval === null || interval === void 0 ? void 0 : interval.highLimit,
63602
+ description: interval === null || interval === void 0 ? void 0 : interval.description,
63603
+ language: language,
63604
+ });
63605
+ }
63606
+ this.parsedXML = {
63607
+ description: (_b = parsed.header) === null || _b === void 0 ? void 0 : _b.description,
63608
+ datatype: (_c = parsed.format) === null || _c === void 0 ? void 0 : _c.dataType,
63609
+ length: (_e = (_d = parsed.format) === null || _d === void 0 ? void 0 : _d.length) === null || _e === void 0 ? void 0 : _e.toString(),
63610
+ decimals: (_g = (_f = parsed.format) === null || _f === void 0 ? void 0 : _f.decimals) === null || _g === void 0 ? void 0 : _g.toString(),
63611
+ conversionExit: (_h = parsed.outputCharacteristics) === null || _h === void 0 ? void 0 : _h.conversionRoutine,
63612
+ values: values,
63613
+ valuesTranslations: [],
63614
+ };
63615
+ }
63616
+ catch (_x) {
63617
+ // handled by parseType()
63618
+ }
63619
+ const end = Date.now();
63620
+ return { updated: true, runtime: end - start };
63621
+ }
63484
63622
  const parsed = super.parseRaw2();
63485
63623
  if (parsed === undefined) {
63486
63624
  return { updated: false, runtime: 0 };
63487
63625
  }
63488
- const dd01v = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DD01V;
63489
- const dd07v_tab = (0, xml_utils_1.xmlToArray)((_g = (_f = (_e = (_d = parsed.abapGit) === null || _d === void 0 ? void 0 : _d["asx:abap"]) === null || _e === void 0 ? void 0 : _e["asx:values"]) === null || _f === void 0 ? void 0 : _f.DD07V_TAB) === null || _g === void 0 ? void 0 : _g.DD07V);
63626
+ const dd01v = (_l = (_k = (_j = parsed.abapGit) === null || _j === void 0 ? void 0 : _j["asx:abap"]) === null || _k === void 0 ? void 0 : _k["asx:values"]) === null || _l === void 0 ? void 0 : _l.DD01V;
63627
+ const dd07v_tab = (0, xml_utils_1.xmlToArray)((_q = (_p = (_o = (_m = parsed.abapGit) === null || _m === void 0 ? void 0 : _m["asx:abap"]) === null || _o === void 0 ? void 0 : _o["asx:values"]) === null || _p === void 0 ? void 0 : _p.DD07V_TAB) === null || _q === void 0 ? void 0 : _q.DD07V);
63490
63628
  const values = [];
63491
63629
  for (const ddo7v of dd07v_tab) {
63492
63630
  const value = {
@@ -63497,7 +63635,7 @@ class Domain extends _abstract_object_1.AbstractObject {
63497
63635
  };
63498
63636
  values.push(value);
63499
63637
  }
63500
- const dd07v_texts = (0, xml_utils_1.xmlToArray)((_l = (_k = (_j = (_h = parsed.abapGit) === null || _h === void 0 ? void 0 : _h["asx:abap"]) === null || _j === void 0 ? void 0 : _j["asx:values"]) === null || _k === void 0 ? void 0 : _k.DD07_TEXTS) === null || _l === void 0 ? void 0 : _l.item);
63638
+ const dd07v_texts = (0, xml_utils_1.xmlToArray)((_u = (_t = (_s = (_r = parsed.abapGit) === null || _r === void 0 ? void 0 : _r["asx:abap"]) === null || _s === void 0 ? void 0 : _s["asx:values"]) === null || _t === void 0 ? void 0 : _t.DD07_TEXTS) === null || _u === void 0 ? void 0 : _u.item);
63501
63639
  const translationValues = [];
63502
63640
  for (const dd07v of dd07v_texts) {
63503
63641
  const value = {
@@ -63528,6 +63666,9 @@ class Domain extends _abstract_object_1.AbstractObject {
63528
63666
  var _b;
63529
63667
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.valuesTranslations) !== null && _b !== void 0 ? _b : [];
63530
63668
  }
63669
+ getAFFFile() {
63670
+ return this.getFiles().find(file => file.getFilename().toLowerCase().endsWith(".doma.json"));
63671
+ }
63531
63672
  }
63532
63673
  exports.Domain = Domain;
63533
63674
  //# sourceMappingURL=domain.js.map
@@ -70408,7 +70549,7 @@ class Registry {
70408
70549
  }
70409
70550
  static abaplintVersion() {
70410
70551
  // magic, see build script "version.js"
70411
- return "2.120.48";
70552
+ return "2.120.50";
70412
70553
  }
70413
70554
  getDDICReferences() {
70414
70555
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.48",
3
+ "version": "2.120.50",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.48",
42
+ "@abaplint/core": "^2.120.50",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",