@abaplint/core 2.91.37 → 2.92.0

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.
@@ -150,6 +150,15 @@ declare class AnyType extends AbstractType {
150
150
  toCDS(): string;
151
151
  }
152
152
 
153
+ declare class APIReleaseState extends AbstractObject {
154
+ getType(): string;
155
+ getAllowedNaming(): {
156
+ maxLength: number;
157
+ allowNamespace: boolean;
158
+ };
159
+ getDescription(): string | undefined;
160
+ }
161
+
153
162
  declare class Append implements IStatement {
154
163
  getMatcher(): IStatementRunnable;
155
164
  }
@@ -2773,9 +2782,12 @@ declare interface IFunctionModuleParameter {
2773
2782
  declare interface IGlobalConfig {
2774
2783
  /** input files, glob format */
2775
2784
  files: string;
2785
+ skipGeneratedBOPFInterfaces?: boolean;
2786
+ skipGeneratedFunctionGroups?: boolean;
2776
2787
  skipGeneratedGatewayClasses?: boolean;
2777
2788
  skipGeneratedPersistentClasses?: boolean;
2778
- skipGeneratedFunctionGroups?: boolean;
2789
+ skipGeneratedProxyClasses?: boolean;
2790
+ skipGeneratedProxyInterfaces?: boolean;
2779
2791
  /** Clone and parse dependencies specified in .apack-manifest.xml if it is present */
2780
2792
  useApackDependencies?: boolean;
2781
2793
  /** Do not report any issues for includes without main programs */
@@ -3213,6 +3225,7 @@ export declare interface IRegistry {
3213
3225
  parseAsync(input?: IRunInput): Promise<IRegistry>;
3214
3226
  addDependencies(files: readonly IFile[]): IRegistry;
3215
3227
  addDependency(file: IFile): IRegistry;
3228
+ removeDependency(obj: IObject): void;
3216
3229
  isDependency(obj: IObject): boolean;
3217
3230
  isFileDependency(filename: string): boolean;
3218
3231
  findIssues(input?: IRunInput): readonly Issue[];
@@ -3958,6 +3971,7 @@ declare class ObjectReferenceType extends AbstractType {
3958
3971
  declare namespace Objects {
3959
3972
  export {
3960
3973
  ActivationVariant,
3974
+ APIReleaseState,
3961
3975
  AssignmentServiceToAuthorizationGroup,
3962
3976
  AuthorizationCheckField,
3963
3977
  AuthorizationGroup,
@@ -4455,7 +4469,6 @@ declare class RefreshControl implements IStatement {
4455
4469
  export declare class Registry implements IRegistry {
4456
4470
  private readonly objects;
4457
4471
  private readonly objectsByType;
4458
- /** object containing filenames of dependencies */
4459
4472
  private readonly dependencies;
4460
4473
  private readonly references;
4461
4474
  private conf;
@@ -4476,9 +4489,11 @@ export declare class Registry implements IRegistry {
4476
4489
  addFile(file: IFile): IRegistry;
4477
4490
  updateFile(file: IFile): IRegistry;
4478
4491
  removeFile(file: IFile): IRegistry;
4492
+ private _addFiles;
4479
4493
  addFiles(files: readonly IFile[]): IRegistry;
4480
4494
  addDependencies(files: readonly IFile[]): IRegistry;
4481
4495
  addDependency(file: IFile): IRegistry;
4496
+ removeDependency(obj: IObject): void;
4482
4497
  isDependency(obj: IObject): boolean;
4483
4498
  isFileDependency(filename: string): boolean;
4484
4499
  findObjectForFile(file: IFile): IObject | undefined;
@@ -7,7 +7,8 @@ const tokens_1 = require("../../1_lexer/tokens");
7
7
  const _1 = require(".");
8
8
  class SQLTarget extends combi_1.Expression {
9
9
  getRunnable() {
10
- const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.tok)(tokens_1.At)), _1.Target));
10
+ const n = (0, combi_1.ver)(version_1.Version.v754, "NEW");
11
+ const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.opt)(n), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.tok)(tokens_1.At)), _1.Target));
11
12
  return (0, combi_1.altPrio)(at, _1.Target);
12
13
  }
13
14
  }
@@ -26,7 +26,9 @@ class MethodCallParam {
26
26
  }
27
27
  }
28
28
  }
29
- else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.Source) {
29
+ else if (child instanceof nodes_1.ExpressionNode
30
+ && (child.get() instanceof Expressions.Source
31
+ || child.get() instanceof Expressions.ConstantString)) {
30
32
  if (!(method instanceof basic_1.VoidType) && method.getParameters().getImporting().length === 0) {
31
33
  throw new Error("Method \"" + method.getName() + "\" has no importing parameters");
32
34
  }
@@ -46,7 +48,10 @@ class MethodCallParam {
46
48
  else {
47
49
  targetType = method;
48
50
  }
49
- const sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
51
+ let sourceType = new basic_1.StringType();
52
+ if (child.get() instanceof Expressions.Source) {
53
+ sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
54
+ }
50
55
  if (sourceType === undefined) {
51
56
  throw new Error("No source type determined, method source");
52
57
  }
@@ -74,7 +74,8 @@ class FunctionModuleDefinition {
74
74
  this.parameters.push({
75
75
  name: param.PARAMETER,
76
76
  direction: FunctionModuleParameterDirection.tables,
77
- type: param.DBSTRUCT,
77
+ // table types are stored in TYP
78
+ type: param.DBSTRUCT || param.TYP,
78
79
  });
79
80
  }
80
81
  }
@@ -42,14 +42,19 @@ class Config {
42
42
  if (ver) {
43
43
  version = ver;
44
44
  }
45
+ // defaults: dont skip anything, report everything. The user can decide to skip stuff
46
+ // its difficult to debug errors not being reported
45
47
  const config = {
46
48
  global: {
47
49
  files: "/src/**/*.*",
48
50
  exclude: [],
49
51
  noIssues: [],
50
- skipGeneratedGatewayClasses: true,
51
- skipGeneratedPersistentClasses: true,
52
- skipGeneratedFunctionGroups: true,
52
+ skipGeneratedBOPFInterfaces: false,
53
+ skipGeneratedFunctionGroups: false,
54
+ skipGeneratedGatewayClasses: false,
55
+ skipGeneratedPersistentClasses: false,
56
+ skipGeneratedProxyClasses: false,
57
+ skipGeneratedProxyInterfaces: false,
53
58
  useApackDependencies: false,
54
59
  skipIncludesWithoutMain: false,
55
60
  },
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIReleaseState = void 0;
4
+ const _abstract_object_1 = require("./_abstract_object");
5
+ class APIReleaseState extends _abstract_object_1.AbstractObject {
6
+ getType() {
7
+ return "APIS";
8
+ }
9
+ getAllowedNaming() {
10
+ return {
11
+ maxLength: 200,
12
+ allowNamespace: true,
13
+ };
14
+ }
15
+ getDescription() {
16
+ // todo
17
+ return undefined;
18
+ }
19
+ }
20
+ exports.APIReleaseState = APIReleaseState;
21
+ //# sourceMappingURL=api_release_state.js.map
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./activation_variant"), exports);
18
+ __exportStar(require("./api_release_state"), exports);
18
19
  __exportStar(require("./assignment_service_to_authorization_group"), exports);
19
20
  __exportStar(require("./authorization_check_field"), exports);
20
21
  __exportStar(require("./authorization_group"), exports);
@@ -60,7 +60,6 @@ class Registry {
60
60
  constructor(conf) {
61
61
  this.objects = {};
62
62
  this.objectsByType = {};
63
- /** object containing filenames of dependencies */
64
63
  this.dependencies = {};
65
64
  this.issues = [];
66
65
  this.conf = conf ? conf : config_1.Config.getDefault();
@@ -68,7 +67,7 @@ class Registry {
68
67
  }
69
68
  static abaplintVersion() {
70
69
  // magic, see build script "version.sh"
71
- return "2.91.37";
70
+ return "2.92.0";
72
71
  }
73
72
  getDDICReferences() {
74
73
  return this.references;
@@ -143,6 +142,7 @@ class Registry {
143
142
  return this;
144
143
  }
145
144
  inErrorNamespace(name) {
145
+ // todo: performance? cache regexp?
146
146
  const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, "i");
147
147
  return reg.test(name);
148
148
  }
@@ -163,7 +163,7 @@ class Registry {
163
163
  }
164
164
  return this;
165
165
  }
166
- addFiles(files) {
166
+ _addFiles(files, dependency) {
167
167
  var _a;
168
168
  const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])
169
169
  .map(pattern => new RegExp(pattern, "i"));
@@ -173,28 +173,60 @@ class Registry {
173
173
  if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {
174
174
  continue;
175
175
  }
176
- const found = this.findOrCreate(f.getObjectName(), f.getObjectType());
176
+ let found = this.findOrCreate(f.getObjectName(), f.getObjectType());
177
+ if (dependency === false && found && this.isDependency(found)) {
178
+ this.removeDependency(found);
179
+ found = this.findOrCreate(f.getObjectName(), f.getObjectType());
180
+ }
177
181
  found.addFile(f);
178
182
  }
179
183
  return this;
180
184
  }
185
+ addFiles(files) {
186
+ this._addFiles(files, false);
187
+ return this;
188
+ }
181
189
  addDependencies(files) {
182
190
  for (const f of files) {
183
- this.dependencies[f.getFilename().toUpperCase()] = true;
191
+ this.addDependency(f);
184
192
  }
185
- return this.addFiles(files);
193
+ return this;
186
194
  }
187
195
  addDependency(file) {
188
- this.dependencies[file.getFilename().toUpperCase()] = true;
189
- this.addFile(file);
196
+ var _a;
197
+ const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
198
+ if (type === undefined) {
199
+ return this;
200
+ }
201
+ const name = file.getObjectName().toUpperCase();
202
+ if (this.dependencies[type] === undefined) {
203
+ this.dependencies[type] = {};
204
+ }
205
+ this.dependencies[type][name] = true;
206
+ this._addFiles([file], true);
190
207
  return this;
191
208
  }
209
+ removeDependency(obj) {
210
+ var _a;
211
+ (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];
212
+ this.removeObject(obj);
213
+ }
192
214
  isDependency(obj) {
193
- const filename = obj.getFiles()[0].getFilename().toUpperCase();
194
- return this.dependencies[filename] === true;
215
+ var _a;
216
+ return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;
195
217
  }
196
218
  isFileDependency(filename) {
197
- return this.dependencies[filename.toUpperCase()] === true;
219
+ var _a, _b;
220
+ const f = this.getFileByName(filename);
221
+ if (f === undefined) {
222
+ return false;
223
+ }
224
+ const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
225
+ if (type === undefined) {
226
+ return false;
227
+ }
228
+ const name = f.getObjectName().toUpperCase();
229
+ return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;
198
230
  }
199
231
  // assumption: the file is already in the registry
200
232
  findObjectForFile(file) {
@@ -36,7 +36,7 @@ CALL FUNCTION 'ZRFC'
36
36
  };
37
37
  }
38
38
  getMessage() {
39
- return "RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE.";
39
+ return "RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE";
40
40
  }
41
41
  getConfig() {
42
42
  return this.conf;
@@ -10,7 +10,7 @@ class SkipLogic {
10
10
  }
11
11
  skip(obj) {
12
12
  const global = this.reg.getConfig().getGlobal();
13
- if (global.skipGeneratedGatewayClasses
13
+ if (global.skipGeneratedGatewayClasses === true
14
14
  && obj instanceof objects_1.Class
15
15
  && this.isGeneratedGatewayClass(obj)) {
16
16
  return true;
@@ -24,23 +24,29 @@ class SkipLogic {
24
24
  return true;
25
25
  }
26
26
  }
27
- else if (global.skipGeneratedPersistentClasses
27
+ else if (global.skipGeneratedPersistentClasses === true
28
28
  && obj instanceof objects_1.Class
29
29
  && this.isGeneratedPersistentClass(obj)) {
30
30
  return true;
31
31
  }
32
- else if (global.skipGeneratedFunctionGroups
32
+ else if (global.skipGeneratedFunctionGroups === true
33
33
  && obj instanceof objects_1.FunctionGroup
34
34
  && this.isGeneratedFunctionGroup(obj)) {
35
35
  return true;
36
36
  }
37
- else if (obj instanceof objects_1.Class && this.isGeneratedProxyClass(obj)) {
37
+ else if (global.skipGeneratedProxyClasses === true
38
+ && obj instanceof objects_1.Class
39
+ && this.isGeneratedProxyClass(obj)) {
38
40
  return true;
39
41
  }
40
- else if (obj instanceof objects_1.Interface && this.isGeneratedProxyInterface(obj)) {
42
+ else if (global.skipGeneratedProxyInterfaces === true
43
+ && obj instanceof objects_1.Interface
44
+ && this.isGeneratedProxyInterface(obj)) {
41
45
  return true;
42
46
  }
43
- else if (obj instanceof objects_1.Interface && this.isGeneratedBOPFInterface(obj)) {
47
+ else if (global.skipGeneratedBOPFInterfaces === true
48
+ && obj instanceof objects_1.Interface
49
+ && this.isGeneratedBOPFInterface(obj)) {
44
50
  return true;
45
51
  }
46
52
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.91.37",
3
+ "version": "2.92.0",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -45,10 +45,10 @@
45
45
  },
46
46
  "homepage": "https://abaplint.org",
47
47
  "devDependencies": {
48
- "@microsoft/api-extractor": "^7.29.3",
48
+ "@microsoft/api-extractor": "^7.29.5",
49
49
  "@types/chai": "^4.3.3",
50
50
  "@types/mocha": "^9.1.1",
51
- "@types/node": "^18.7.11",
51
+ "@types/node": "^18.7.13",
52
52
  "chai": "^4.3.6",
53
53
  "eslint": "^8.22.0",
54
54
  "mocha": "^10.0.0",