@abaplint/core 2.94.18 → 2.94.20
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 +13 -1
- package/build/src/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/sql_field_and_value.js +14 -0
- package/build/src/abap/2_statements/statements/update_database.js +1 -2
- package/build/src/abap/5_syntax/global_definitions/find_global_definitions.js +1 -0
- package/build/src/objects/authorization_check_field.js +47 -0
- package/build/src/objects/lock_object.js +14 -3
- package/build/src/registry.js +1 -1
- package/build/src/rules/check_ddic.js +2 -0
- package/package.json +2 -2
package/build/abaplint.d.ts
CHANGED
|
@@ -304,12 +304,19 @@ declare class AuthorityCheck implements IStatement {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
declare class AuthorizationCheckField extends AbstractObject {
|
|
307
|
+
private parsedXML;
|
|
307
308
|
getType(): string;
|
|
308
309
|
getAllowedNaming(): {
|
|
309
310
|
maxLength: number;
|
|
310
311
|
allowNamespace: boolean;
|
|
311
312
|
};
|
|
312
313
|
getDescription(): string | undefined;
|
|
314
|
+
getDataElementName(): string | undefined;
|
|
315
|
+
parseType(reg: IRegistry): AbstractType;
|
|
316
|
+
parse(): {
|
|
317
|
+
updated: boolean;
|
|
318
|
+
runtime: number;
|
|
319
|
+
};
|
|
313
320
|
}
|
|
314
321
|
|
|
315
322
|
declare class AuthorizationGroup extends AbstractObject {
|
|
@@ -2051,6 +2058,7 @@ declare namespace Expressions {
|
|
|
2051
2058
|
SQLCompareOperator,
|
|
2052
2059
|
SQLCompare,
|
|
2053
2060
|
SQLCond,
|
|
2061
|
+
SQLFieldAndValue,
|
|
2054
2062
|
SQLFieldListLoop,
|
|
2055
2063
|
SQLFieldList,
|
|
2056
2064
|
SQLFieldName,
|
|
@@ -3702,7 +3710,7 @@ declare class LockObject extends AbstractObject {
|
|
|
3702
3710
|
allowNamespace: boolean;
|
|
3703
3711
|
};
|
|
3704
3712
|
getPrimaryTable(): string | undefined;
|
|
3705
|
-
parseType(reg: IRegistry):
|
|
3713
|
+
parseType(reg: IRegistry): AbstractType;
|
|
3706
3714
|
parse(): {
|
|
3707
3715
|
updated: boolean;
|
|
3708
3716
|
runtime: number;
|
|
@@ -5189,6 +5197,10 @@ declare class SQLField extends Expression {
|
|
|
5189
5197
|
getRunnable(): IStatementRunnable;
|
|
5190
5198
|
}
|
|
5191
5199
|
|
|
5200
|
+
declare class SQLFieldAndValue extends Expression {
|
|
5201
|
+
getRunnable(): IStatementRunnable;
|
|
5202
|
+
}
|
|
5203
|
+
|
|
5192
5204
|
declare class SQLFieldList extends Expression {
|
|
5193
5205
|
getRunnable(): IStatementRunnable;
|
|
5194
5206
|
}
|
|
@@ -175,6 +175,7 @@ __exportStar(require("./sql_client"), exports);
|
|
|
175
175
|
__exportStar(require("./sql_compare_operator"), exports);
|
|
176
176
|
__exportStar(require("./sql_compare"), exports);
|
|
177
177
|
__exportStar(require("./sql_cond"), exports);
|
|
178
|
+
__exportStar(require("./sql_field_and_value"), exports);
|
|
178
179
|
__exportStar(require("./sql_field_list_loop"), exports);
|
|
179
180
|
__exportStar(require("./sql_field_list"), exports);
|
|
180
181
|
__exportStar(require("./sql_field_name"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQLFieldAndValue = void 0;
|
|
4
|
+
const combi_1 = require("../combi");
|
|
5
|
+
const sql_field_name_1 = require("./sql_field_name");
|
|
6
|
+
const sql_source_1 = require("./sql_source");
|
|
7
|
+
class SQLFieldAndValue extends combi_1.Expression {
|
|
8
|
+
getRunnable() {
|
|
9
|
+
const param = (0, combi_1.seq)(sql_field_name_1.SQLFieldName, "=", sql_source_1.SQLSource);
|
|
10
|
+
return param;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SQLFieldAndValue = SQLFieldAndValue;
|
|
14
|
+
//# sourceMappingURL=sql_field_and_value.js.map
|
|
@@ -5,8 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const expressions_1 = require("../expressions");
|
|
6
6
|
class UpdateDatabase {
|
|
7
7
|
getMatcher() {
|
|
8
|
-
const
|
|
9
|
-
const parameters = (0, combi_1.seq)(param, (0, combi_1.star)((0, combi_1.seq)((0, combi_1.opt)(","), param)));
|
|
8
|
+
const parameters = (0, combi_1.seq)(expressions_1.SQLFieldAndValue, (0, combi_1.star)((0, combi_1.seq)((0, combi_1.opt)(","), expressions_1.SQLFieldAndValue)));
|
|
10
9
|
const set = (0, combi_1.seq)("SET", (0, combi_1.alt)(parameters, expressions_1.Dynamic), (0, combi_1.opt)((0, combi_1.seq)("WHERE", expressions_1.SQLCond)));
|
|
11
10
|
const fromTable = (0, combi_1.seq)("FROM", (0, combi_1.opt)("TABLE"), expressions_1.SQLSource);
|
|
12
11
|
const ret = (0, combi_1.seq)("UPDATE", expressions_1.DatabaseTable, (0, combi_1.opt)(expressions_1.SQLClient), (0, combi_1.opt)(expressions_1.DatabaseConnection), (0, combi_1.opt)((0, combi_1.alt)(fromTable, set)));
|
|
@@ -28,6 +28,7 @@ class FindGlobalDefinitions {
|
|
|
28
28
|
|| o instanceof objects_1.View
|
|
29
29
|
|| o instanceof objects_1.TableType
|
|
30
30
|
|| o instanceof objects_1.LockObject
|
|
31
|
+
|| o instanceof objects_1.AuthorizationCheckField
|
|
31
32
|
|| o instanceof objects_1.Table) {
|
|
32
33
|
o.parseType(this.reg); // make sure the references are set after parsing finishes
|
|
33
34
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizationCheckField = void 0;
|
|
4
|
+
const basic_1 = require("../abap/types/basic");
|
|
5
|
+
const ddic_1 = require("../ddic");
|
|
4
6
|
const _abstract_object_1 = require("./_abstract_object");
|
|
5
7
|
class AuthorizationCheckField extends _abstract_object_1.AbstractObject {
|
|
6
8
|
getType() {
|
|
@@ -16,6 +18,51 @@ class AuthorizationCheckField extends _abstract_object_1.AbstractObject {
|
|
|
16
18
|
// todo
|
|
17
19
|
return undefined;
|
|
18
20
|
}
|
|
21
|
+
getDataElementName() {
|
|
22
|
+
var _a;
|
|
23
|
+
this.parse();
|
|
24
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.rollname;
|
|
25
|
+
}
|
|
26
|
+
parseType(reg) {
|
|
27
|
+
var _a;
|
|
28
|
+
this.parse();
|
|
29
|
+
const references = [];
|
|
30
|
+
const ddic = new ddic_1.DDIC(reg);
|
|
31
|
+
if ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.rollname) {
|
|
32
|
+
const found = ddic.lookupDataElement(this.parsedXML.rollname);
|
|
33
|
+
if (found.object) {
|
|
34
|
+
references.push({ object: found.object });
|
|
35
|
+
reg.getDDICReferences().setUsing(this, references);
|
|
36
|
+
return found.type;
|
|
37
|
+
}
|
|
38
|
+
else if (ddic.inErrorNamespace(this.parsedXML.rollname)) {
|
|
39
|
+
return new basic_1.UnknownType(this.parsedXML.rollname + " not found");
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return new basic_1.VoidType(this.parsedXML.rollname);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return new basic_1.UnknownType("Parsing error");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
parse() {
|
|
50
|
+
var _a;
|
|
51
|
+
if (this.parsedXML) {
|
|
52
|
+
return { updated: false, runtime: 0 };
|
|
53
|
+
}
|
|
54
|
+
const start = Date.now();
|
|
55
|
+
this.parsedXML = {};
|
|
56
|
+
const parsed = super.parseRaw2();
|
|
57
|
+
if (parsed === undefined
|
|
58
|
+
|| parsed.abapGit === undefined
|
|
59
|
+
|| parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
|
|
60
|
+
return { updated: false, runtime: 0 };
|
|
61
|
+
}
|
|
62
|
+
this.parsedXML.rollname = (_a = parsed.abapGit["asx:abap"]["asx:values"].AUTHX) === null || _a === void 0 ? void 0 : _a.ROLLNAME;
|
|
63
|
+
const end = Date.now();
|
|
64
|
+
return { updated: true, runtime: end - start };
|
|
65
|
+
}
|
|
19
66
|
}
|
|
20
67
|
exports.AuthorizationCheckField = AuthorizationCheckField;
|
|
21
68
|
//# sourceMappingURL=authorization_check_field.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LockObject = void 0;
|
|
4
|
+
const basic_1 = require("../abap/types/basic");
|
|
4
5
|
const ddic_1 = require("../ddic");
|
|
5
6
|
const _abstract_object_1 = require("./_abstract_object");
|
|
6
7
|
class LockObject extends _abstract_object_1.AbstractObject {
|
|
@@ -19,17 +20,27 @@ class LockObject extends _abstract_object_1.AbstractObject {
|
|
|
19
20
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.primaryTable;
|
|
20
21
|
}
|
|
21
22
|
parseType(reg) {
|
|
22
|
-
var _a
|
|
23
|
+
var _a;
|
|
23
24
|
this.parse();
|
|
24
25
|
const references = [];
|
|
25
26
|
const ddic = new ddic_1.DDIC(reg);
|
|
26
27
|
if ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.primaryTable) {
|
|
27
|
-
const found = ddic.lookupTableOrView2(
|
|
28
|
+
const found = ddic.lookupTableOrView2(this.parsedXML.primaryTable);
|
|
28
29
|
if (found) {
|
|
29
30
|
references.push({ object: found });
|
|
31
|
+
reg.getDDICReferences().setUsing(this, references);
|
|
32
|
+
return found.parseType(reg);
|
|
33
|
+
}
|
|
34
|
+
else if (ddic.inErrorNamespace(this.parsedXML.primaryTable)) {
|
|
35
|
+
return new basic_1.UnknownType(this.parsedXML.primaryTable + " not found");
|
|
30
36
|
}
|
|
37
|
+
else {
|
|
38
|
+
return new basic_1.VoidType(this.parsedXML.primaryTable);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return new basic_1.UnknownType("Parsing error");
|
|
31
43
|
}
|
|
32
|
-
reg.getDDICReferences().setUsing(this, references);
|
|
33
44
|
}
|
|
34
45
|
parse() {
|
|
35
46
|
var _a, _b;
|
package/build/src/registry.js
CHANGED
|
@@ -40,6 +40,8 @@ class CheckDDIC {
|
|
|
40
40
|
|| obj instanceof Objects.Domain
|
|
41
41
|
|| obj instanceof Objects.Table
|
|
42
42
|
|| obj instanceof Objects.View
|
|
43
|
+
|| obj instanceof Objects.AuthorizationCheckField
|
|
44
|
+
|| obj instanceof Objects.LockObject
|
|
43
45
|
|| obj instanceof Objects.TableType) {
|
|
44
46
|
found = obj.parseType(this.reg);
|
|
45
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.94.
|
|
3
|
+
"version": "2.94.20",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "^4.9.4"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"fast-xml-parser": "^4.0.
|
|
63
|
+
"fast-xml-parser": "^4.0.13",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
65
|
"vscode-languageserver-types": "^3.17.2"
|
|
66
66
|
}
|