@abaplint/core 2.95.14 → 2.95.16
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.
package/build/abaplint.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
class SQLFieldList extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)));
|
|
10
|
+
const old = (0, combi_1.starPrio)(_1.SQLField);
|
|
11
|
+
return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.SQLFieldList = SQLFieldList;
|
|
@@ -43,10 +43,13 @@ class CreateObject {
|
|
|
43
43
|
if (found instanceof basic_1.VoidType) {
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
+
else if (found instanceof basic_1.UnknownType) {
|
|
47
|
+
throw new Error("Target type unknown, " + t.concatTokens());
|
|
48
|
+
}
|
|
46
49
|
else if (!(found instanceof basic_1.ObjectReferenceType)
|
|
47
50
|
&& !(found instanceof basic_1.AnyType)
|
|
48
51
|
&& !(found instanceof basic_1.GenericObjectReferenceType)) {
|
|
49
|
-
throw new Error("Target must be an object reference");
|
|
52
|
+
throw new Error("Target must be an object reference, " + t.concatTokens());
|
|
50
53
|
}
|
|
51
54
|
else if (found instanceof basic_1.GenericObjectReferenceType && type === undefined) {
|
|
52
55
|
throw new Error("Generic type, cannot be instantiated");
|
|
@@ -5,6 +5,7 @@ const _abstract_object_1 = require("./_abstract_object");
|
|
|
5
5
|
const Types = require("../abap/types/basic");
|
|
6
6
|
const ddic_1 = require("../ddic");
|
|
7
7
|
const basic_1 = require("../abap/types/basic");
|
|
8
|
+
const xml_utils_1 = require("../xml_utils");
|
|
8
9
|
class TableType extends _abstract_object_1.AbstractObject {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
@@ -27,44 +28,78 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
27
28
|
this.parsedXML = undefined;
|
|
28
29
|
super.setDirty();
|
|
29
30
|
}
|
|
31
|
+
buildTableOptions() {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
const tableOptions = {
|
|
34
|
+
withHeader: false,
|
|
35
|
+
secondary: [],
|
|
36
|
+
};
|
|
37
|
+
for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
|
|
38
|
+
const fields = [];
|
|
39
|
+
for (const f of ((_b = this.parsedXML) === null || _b === void 0 ? void 0 : _b.dd42v) || []) {
|
|
40
|
+
if (f.keyname === k.keyname) {
|
|
41
|
+
fields.push(f.keyfield);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let accessType = basic_1.TableAccessType.standard;
|
|
45
|
+
switch (k.accessmode) {
|
|
46
|
+
case "S":
|
|
47
|
+
accessType = basic_1.TableAccessType.sorted;
|
|
48
|
+
break;
|
|
49
|
+
case "H":
|
|
50
|
+
accessType = basic_1.TableAccessType.hashed;
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
(_c = tableOptions.secondary) === null || _c === void 0 ? void 0 : _c.push({
|
|
56
|
+
name: k.keyname,
|
|
57
|
+
type: accessType,
|
|
58
|
+
keyFields: fields,
|
|
59
|
+
isUnique: k.unique,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return tableOptions;
|
|
63
|
+
}
|
|
30
64
|
parseType(reg) {
|
|
31
65
|
this.parseXML();
|
|
32
66
|
const ddic = new ddic_1.DDIC(reg);
|
|
33
67
|
const references = [];
|
|
34
68
|
let type;
|
|
69
|
+
const tableOptions = this.buildTableOptions();
|
|
35
70
|
if (this.parsedXML === undefined) {
|
|
36
71
|
type = new Types.UnknownType("Table Type, parser error", this.getName());
|
|
37
72
|
}
|
|
38
73
|
else if (this.parsedXML.rowkind === "S") {
|
|
39
74
|
const lookup = ddic.lookupTableOrView(this.parsedXML.rowtype);
|
|
40
|
-
type = new Types.TableType(lookup.type,
|
|
75
|
+
type = new Types.TableType(lookup.type, tableOptions, this.getName());
|
|
41
76
|
if (lookup.object) {
|
|
42
77
|
references.push({ object: lookup.object });
|
|
43
78
|
}
|
|
44
79
|
}
|
|
45
80
|
else if (this.parsedXML.rowkind === "E") {
|
|
46
81
|
const lookup = ddic.lookupDataElement(this.parsedXML.rowtype);
|
|
47
|
-
type = new Types.TableType(lookup.type,
|
|
82
|
+
type = new Types.TableType(lookup.type, tableOptions, this.getName());
|
|
48
83
|
if (lookup.object) {
|
|
49
84
|
references.push({ object: lookup.object });
|
|
50
85
|
}
|
|
51
86
|
}
|
|
52
87
|
else if (this.parsedXML.rowkind === "L") {
|
|
53
88
|
const lookup = ddic.lookupTableType(this.parsedXML.rowtype);
|
|
54
|
-
type = new Types.TableType(lookup.type,
|
|
89
|
+
type = new Types.TableType(lookup.type, tableOptions, this.getName());
|
|
55
90
|
if (lookup.object) {
|
|
56
91
|
references.push({ object: lookup.object });
|
|
57
92
|
}
|
|
58
93
|
}
|
|
59
94
|
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "OBJECT") {
|
|
60
|
-
type = new Types.TableType(new basic_1.GenericObjectReferenceType(),
|
|
95
|
+
type = new Types.TableType(new basic_1.GenericObjectReferenceType(), tableOptions, this.getName());
|
|
61
96
|
}
|
|
62
97
|
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype === "DATA") {
|
|
63
|
-
type = new Types.TableType(new basic_1.DataReference(new basic_1.AnyType()),
|
|
98
|
+
type = new Types.TableType(new basic_1.DataReference(new basic_1.AnyType()), tableOptions, this.getName());
|
|
64
99
|
}
|
|
65
100
|
else if (this.parsedXML.rowkind === "R" && this.parsedXML.rowtype !== undefined) {
|
|
66
101
|
const lookup = ddic.lookupObject(this.parsedXML.rowtype);
|
|
67
|
-
type = new Types.TableType(lookup.type,
|
|
102
|
+
type = new Types.TableType(lookup.type, tableOptions, this.getName());
|
|
68
103
|
if (lookup.object) {
|
|
69
104
|
references.push({ object: lookup.object });
|
|
70
105
|
}
|
|
@@ -75,7 +110,7 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
75
110
|
}
|
|
76
111
|
else {
|
|
77
112
|
const row = ddic.textToType(this.parsedXML.datatype, this.parsedXML.leng, this.parsedXML.decimals, this.getName());
|
|
78
|
-
type = new Types.TableType(row,
|
|
113
|
+
type = new Types.TableType(row, tableOptions, this.getName());
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
else {
|
|
@@ -86,20 +121,39 @@ class TableType extends _abstract_object_1.AbstractObject {
|
|
|
86
121
|
}
|
|
87
122
|
////////////////////
|
|
88
123
|
parseXML() {
|
|
124
|
+
var _a, _b;
|
|
89
125
|
if (this.parsedXML !== undefined) {
|
|
90
126
|
return;
|
|
91
127
|
}
|
|
92
|
-
this.parsedXML = {
|
|
128
|
+
this.parsedXML = {
|
|
129
|
+
dd42v: [],
|
|
130
|
+
dd43v: [],
|
|
131
|
+
};
|
|
93
132
|
const parsed = super.parseRaw2();
|
|
94
133
|
if (parsed === undefined || parsed.abapGit === undefined) {
|
|
95
134
|
return;
|
|
96
135
|
}
|
|
97
|
-
const
|
|
136
|
+
const values = parsed.abapGit["asx:abap"]["asx:values"];
|
|
137
|
+
const dd40v = values.DD40V;
|
|
98
138
|
this.parsedXML.rowtype = dd40v.ROWTYPE ? dd40v.ROWTYPE : "";
|
|
99
139
|
this.parsedXML.rowkind = dd40v.ROWKIND ? dd40v.ROWKIND : "";
|
|
100
140
|
this.parsedXML.datatype = dd40v.DATATYPE;
|
|
101
141
|
this.parsedXML.leng = dd40v.LENG;
|
|
102
142
|
this.parsedXML.decimals = dd40v.DECIMALS;
|
|
143
|
+
for (const x of (0, xml_utils_1.xmlToArray)((_a = values.DD42V) === null || _a === void 0 ? void 0 : _a.DD42V)) {
|
|
144
|
+
this.parsedXML.dd42v.push({
|
|
145
|
+
keyname: x.SECKEYNAME || "",
|
|
146
|
+
keyfield: x.KEYFIELD || "",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
for (const x of (0, xml_utils_1.xmlToArray)((_b = values.DD43V) === null || _b === void 0 ? void 0 : _b.DD43V)) {
|
|
150
|
+
this.parsedXML.dd43v.push({
|
|
151
|
+
keyname: x.SECKEYNAME || "",
|
|
152
|
+
accessmode: x.ACCESSMODE || "",
|
|
153
|
+
kind: x.KIND || "",
|
|
154
|
+
unique: x.SECKEYUNIQUE === "X",
|
|
155
|
+
});
|
|
156
|
+
}
|
|
103
157
|
}
|
|
104
158
|
}
|
|
105
159
|
exports.TableType = TableType;
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.95.
|
|
3
|
+
"version": "2.95.16",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://abaplint.org",
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@microsoft/api-extractor": "^7.34.
|
|
50
|
+
"@microsoft/api-extractor": "^7.34.4",
|
|
51
51
|
"@types/chai": "^4.3.4",
|
|
52
52
|
"@types/mocha": "^10.0.1",
|
|
53
53
|
"@types/node": "^18.13.0",
|
|
54
54
|
"chai": "^4.3.7",
|
|
55
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.34.0",
|
|
56
56
|
"mocha": "^10.2.0",
|
|
57
57
|
"c8": "^7.12.0",
|
|
58
58
|
"source-map-support": "^0.5.21",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "^4.9.5"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"fast-xml-parser": "^4.1.
|
|
63
|
+
"fast-xml-parser": "^4.1.2",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
65
|
"vscode-languageserver-types": "^3.17.2"
|
|
66
66
|
}
|