@abaplint/core 2.113.206 → 2.113.207
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/src/abap/2_statements/expressions/entity_association.js +1 -1
- package/build/src/abap/2_statements/statements/method_def.js +1 -1
- package/build/src/abap/2_statements/statements/modify_entities.js +2 -1
- package/build/src/abap/2_statements/statements/read_entities.js +3 -2
- package/build/src/registry.js +1 -1
- package/build/src/rules/cloud_types.js +3 -0
- package/build/src/rules/sql_escape_host_variables.js +12 -6
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ exports.EntityAssociation = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
class EntityAssociation extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[
|
|
7
|
+
return (0, combi_1.regex)(/^[\/\w]+(\\_|\\\\)[\/\_\w\\~]+$/);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.EntityAssociation = EntityAssociation;
|
|
@@ -17,7 +17,7 @@ class MethodDef {
|
|
|
17
17
|
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
18
18
|
const behavior = (0, combi_1.altPrio)("DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED", // todo, this is only from version something
|
|
19
19
|
(0, combi_1.seq)("TABLE FUNCTION", expressions_1.NamespaceSimpleName), // todo, this is only from version something
|
|
20
|
-
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
20
|
+
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY", (0, combi_1.opt)("IMPORTING"), (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
21
21
|
// todo, this is only from version something
|
|
22
22
|
const amdp = (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.optPrio)("READ-ONLY"), "CDS SESSION CLIENT", (0, combi_1.alt)("CURRENT", "DEPENDENT"), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
23
23
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", behavior), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
@@ -21,7 +21,8 @@ class ModifyEntities {
|
|
|
21
21
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
22
22
|
const end = (0, combi_1.optPrio)((0, combi_1.per)(failed, result, mapped, reported));
|
|
23
23
|
const entities = (0, combi_1.seq)((0, combi_1.optPrio)("AUGMENTING"), "ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plusPrio)((0, combi_1.seq)("ENTITY", expressions_1.SimpleName, (0, combi_1.plus)(operation))));
|
|
24
|
-
const
|
|
24
|
+
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, "CREATE BY", expressions_1.AssociationName, fieldsWith);
|
|
25
|
+
const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, deleteFrom, updateFrom, create2));
|
|
25
26
|
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -12,9 +12,10 @@ class ReadEntities {
|
|
|
12
12
|
const all = (0, combi_1.seq)("ALL FIELDS WITH", expressions_1.Source);
|
|
13
13
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
14
14
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
15
|
+
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
15
16
|
const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), (0, combi_1.optPrio)(result));
|
|
16
|
-
const s = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(
|
|
17
|
-
const single = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(all, fields, from), result, (0, combi_1.optPrio)(failed));
|
|
17
|
+
const s = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(reported));
|
|
18
|
+
const single = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(all, fields, from), result, (0, combi_1.optPrio)(failed), (0, combi_1.optPrio)(reported));
|
|
18
19
|
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("READ", (0, combi_1.alt)(s, single)));
|
|
19
20
|
}
|
|
20
21
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -52,10 +52,13 @@ class CloudTypes {
|
|
|
52
52
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
53
53
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
54
54
|
|| obj instanceof Objects.Class
|
|
55
|
+
|| obj instanceof Objects.CDSType
|
|
56
|
+
|| obj instanceof Objects.ChangeDocument
|
|
55
57
|
|| obj instanceof Objects.CDSEntityBuffer
|
|
56
58
|
|| obj instanceof Objects.ApplicationLogObject
|
|
57
59
|
|| obj instanceof Objects.CommunicationScenario
|
|
58
60
|
|| obj instanceof Objects.DataControl
|
|
61
|
+
|| obj instanceof Objects.KnowledgeTransferDocument
|
|
59
62
|
|| obj instanceof Objects.DataDefinition
|
|
60
63
|
|| obj instanceof Objects.DataElement
|
|
61
64
|
|| obj instanceof Objects.Domain
|
|
@@ -45,16 +45,22 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
|
|
|
45
45
|
return [];
|
|
46
46
|
}
|
|
47
47
|
for (const s of file.getStatements()) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
||
|
|
51
|
-
||
|
|
52
|
-
||
|
|
53
|
-
||
|
|
48
|
+
const get = s.get();
|
|
49
|
+
if (get instanceof Statements.UpdateDatabase
|
|
50
|
+
|| get instanceof Statements.ModifyDatabase
|
|
51
|
+
|| get instanceof Statements.Select
|
|
52
|
+
|| get instanceof Statements.SelectLoop
|
|
53
|
+
|| get instanceof Statements.InsertDatabase
|
|
54
|
+
|| get instanceof Statements.DeleteDatabase) {
|
|
54
55
|
for (const o of s.findAllExpressionsMulti([Expressions.SQLSource, Expressions.SQLSourceSimple])) {
|
|
55
56
|
const first = o.getFirstChild();
|
|
56
57
|
if (((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.Source && first.getChildren()[0].get() instanceof Expressions.FieldChain)
|
|
57
58
|
|| ((first === null || first === void 0 ? void 0 : first.get()) instanceof Expressions.SimpleSource3 && first.getChildren()[0].get() instanceof Expressions.FieldChain)) {
|
|
59
|
+
if (get instanceof Statements.ModifyDatabase
|
|
60
|
+
&& first.getFirstToken().getStr().toUpperCase().startsWith("LS_")) {
|
|
61
|
+
// heuristic, might not be correct in all cases
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
58
64
|
const message = "Escape SQL host variables";
|
|
59
65
|
const firstToken = o.getFirstChild().getFirstToken();
|
|
60
66
|
const fix = edit_helper_1.EditHelper.replaceToken(file, firstToken, "@" + (firstToken === null || firstToken === void 0 ? void 0 : firstToken.getStr()));
|