@abaplint/core 2.120.49 → 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.
@@ -2080,6 +2080,7 @@ declare class Domain extends AbstractObject {
2080
2080
  maxLength: number;
2081
2081
  allowNamespace: boolean;
2082
2082
  };
2083
+ getIdentifier(): Identifier | undefined;
2083
2084
  setDirty(): void;
2084
2085
  parseType(reg: IRegistry, dataElement?: string, description?: string): AbstractType;
2085
2086
  parse(): {
@@ -2088,6 +2089,7 @@ declare class Domain extends AbstractObject {
2088
2089
  };
2089
2090
  getFixedValues(): DomainValue[];
2090
2091
  getFixedValuesTranslations(): DomainValueTranslation[];
2092
+ private getAFFFile;
2091
2093
  }
2092
2094
 
2093
2095
  declare interface DomainValue {
@@ -38,16 +38,21 @@ const _abstract_object_1 = require("./_abstract_object");
38
38
  const Types = __importStar(require("../abap/types/basic"));
39
39
  const ddic_1 = require("../ddic");
40
40
  const xml_utils_1 = require("../xml_utils");
41
+ const _identifier_1 = require("../abap/4_file_information/_identifier");
42
+ const identifier_1 = require("../abap/1_lexer/tokens/identifier");
43
+ const position_1 = require("../position");
41
44
  class Domain extends _abstract_object_1.AbstractObject {
42
45
  getType() {
43
46
  return "DOMA";
44
47
  }
45
48
  getDescription() {
46
49
  var _a;
50
+ this.parse();
47
51
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
48
52
  }
49
53
  getConversionExit() {
50
54
  var _a;
55
+ this.parse();
51
56
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.conversionExit;
52
57
  }
53
58
  getDataType() {
@@ -61,6 +66,17 @@ class Domain extends _abstract_object_1.AbstractObject {
61
66
  allowNamespace: true,
62
67
  };
63
68
  }
69
+ getIdentifier() {
70
+ const xmlIdentifier = super.getIdentifier();
71
+ if (xmlIdentifier) {
72
+ return xmlIdentifier;
73
+ }
74
+ const file = this.getAFFFile();
75
+ if (file === undefined) {
76
+ return undefined;
77
+ }
78
+ return new _identifier_1.Identifier(new identifier_1.Identifier(new position_1.Position(1, 1), this.getName()), file.getFilename());
79
+ }
64
80
  setDirty() {
65
81
  this.parsedXML = undefined;
66
82
  super.setDirty();
@@ -87,18 +103,57 @@ class Domain extends _abstract_object_1.AbstractObject {
87
103
  });
88
104
  }
89
105
  parse() {
90
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
106
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
107
+ var _v, _w;
91
108
  if (this.parsedXML) {
92
109
  return { updated: false, runtime: 0 };
93
110
  }
94
111
  const start = Date.now();
95
112
  this.parsedXML = {};
113
+ const jsonFile = this.getAFFFile();
114
+ if (jsonFile) {
115
+ try {
116
+ const parsed = JSON.parse(jsonFile.getRaw());
117
+ const language = (_a = parsed.header) === null || _a === void 0 ? void 0 : _a.originalLanguage;
118
+ const values = [];
119
+ for (const fixedValue of (_v = parsed.fixedValues) !== null && _v !== void 0 ? _v : []) {
120
+ values.push({
121
+ low: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.fixedValue,
122
+ high: "",
123
+ description: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.description,
124
+ language: language,
125
+ });
126
+ }
127
+ for (const interval of (_w = parsed.fixedValueIntervals) !== null && _w !== void 0 ? _w : []) {
128
+ values.push({
129
+ low: interval === null || interval === void 0 ? void 0 : interval.lowLimit,
130
+ high: interval === null || interval === void 0 ? void 0 : interval.highLimit,
131
+ description: interval === null || interval === void 0 ? void 0 : interval.description,
132
+ language: language,
133
+ });
134
+ }
135
+ this.parsedXML = {
136
+ description: (_b = parsed.header) === null || _b === void 0 ? void 0 : _b.description,
137
+ datatype: (_c = parsed.format) === null || _c === void 0 ? void 0 : _c.dataType,
138
+ length: (_e = (_d = parsed.format) === null || _d === void 0 ? void 0 : _d.length) === null || _e === void 0 ? void 0 : _e.toString(),
139
+ decimals: (_g = (_f = parsed.format) === null || _f === void 0 ? void 0 : _f.decimals) === null || _g === void 0 ? void 0 : _g.toString(),
140
+ conversionExit: (_h = parsed.outputCharacteristics) === null || _h === void 0 ? void 0 : _h.conversionRoutine,
141
+ values: values,
142
+ valuesTranslations: [],
143
+ };
144
+ }
145
+ catch (_x) {
146
+ // handled by parseType()
147
+ }
148
+ const end = Date.now();
149
+ return { updated: true, runtime: end - start };
150
+ }
96
151
  const parsed = super.parseRaw2();
97
152
  if (parsed === undefined) {
98
153
  return { updated: false, runtime: 0 };
99
154
  }
100
- 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;
101
- 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);
155
+ 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;
156
+ 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);
102
157
  const values = [];
103
158
  for (const ddo7v of dd07v_tab) {
104
159
  const value = {
@@ -109,7 +164,7 @@ class Domain extends _abstract_object_1.AbstractObject {
109
164
  };
110
165
  values.push(value);
111
166
  }
112
- 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);
167
+ 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);
113
168
  const translationValues = [];
114
169
  for (const dd07v of dd07v_texts) {
115
170
  const value = {
@@ -140,6 +195,9 @@ class Domain extends _abstract_object_1.AbstractObject {
140
195
  var _b;
141
196
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.valuesTranslations) !== null && _b !== void 0 ? _b : [];
142
197
  }
198
+ getAFFFile() {
199
+ return this.getFiles().find(file => file.getFilename().toLowerCase().endsWith(".doma.json"));
200
+ }
143
201
  }
144
202
  exports.Domain = Domain;
145
203
  //# sourceMappingURL=domain.js.map
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.49";
78
+ return "2.120.50";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.49",
3
+ "version": "2.120.50",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",