@abaplint/runtime 2.7.13 → 2.7.15

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.
@@ -15,6 +15,14 @@ import { ClassicError } from "./classic_error";
15
15
  import { Console } from "./console/console";
16
16
  import { MemoryConsole } from "./console/memory_console";
17
17
  export { UnitTestResult, RFC, types, DB, MemoryConsole };
18
+ export type RuntimeDatabaseOptions = {
19
+ schemaPrefix?: string;
20
+ tablePrefix?: string;
21
+ };
22
+ export type RuntimeOptions = {
23
+ console?: Console;
24
+ database?: RuntimeDatabaseOptions;
25
+ };
18
26
  export declare class ABAP {
19
27
  FunctionModules: {
20
28
  [name: string]: any;
@@ -49,5 +57,6 @@ export declare class ABAP {
49
57
  expandDynamic: typeof expandDynamic;
50
58
  ClassicError: typeof ClassicError;
51
59
  readonly context: Context;
52
- constructor(console?: Console);
60
+ readonly dbo: RuntimeDatabaseOptions;
61
+ constructor(input?: RuntimeOptions);
53
62
  }
@@ -23,7 +23,7 @@ const standard_out_console_1 = require("./console/standard_out_console");
23
23
  const memory_console_1 = require("./console/memory_console");
24
24
  Object.defineProperty(exports, "MemoryConsole", { enumerable: true, get: function () { return memory_console_1.MemoryConsole; } });
25
25
  class ABAP {
26
- constructor(console) {
26
+ constructor(input) {
27
27
  // global objects
28
28
  this.FunctionModules = {};
29
29
  this.Classes = {};
@@ -42,8 +42,15 @@ class ABAP {
42
42
  this.expandDynamic = expand_dynamic_1.expandDynamic;
43
43
  this.ClassicError = classic_error_1.ClassicError;
44
44
  this.context = new context_1.Context();
45
- this.console = console ? console : new standard_out_console_1.StandardOutConsole();
45
+ this.console = (input === null || input === void 0 ? void 0 : input.console) ? input === null || input === void 0 ? void 0 : input.console : new standard_out_console_1.StandardOutConsole();
46
46
  this.context.console = this.console;
47
+ this.dbo = (input === null || input === void 0 ? void 0 : input.database) || { schemaPrefix: "", tablePrefix: "" };
48
+ if (this.dbo.schemaPrefix === undefined) {
49
+ this.dbo.schemaPrefix = "";
50
+ }
51
+ if (this.dbo.tablePrefix === undefined) {
52
+ this.dbo.tablePrefix = "";
53
+ }
47
54
  this.statements = new statements_1.Statements(this.context);
48
55
  // todo, this should not be a singleton, it should be part of this instance
49
56
  // todo, move to context
@@ -55,9 +55,21 @@ function createData(target, options) {
55
55
  else if (options.name.trimEnd() === "STRING") {
56
56
  target.assign(new types_1.String());
57
57
  }
58
+ else if (options.name.trimEnd() === "XSTRING") {
59
+ target.assign(new types_1.XString());
60
+ }
58
61
  else if (options.name.trimEnd() === "I") {
59
62
  target.assign(new types_1.Integer());
60
63
  }
64
+ else if (options.name.trimEnd() === "T") {
65
+ target.assign(new types_1.Time());
66
+ }
67
+ else if (options.name.trimEnd() === "D") {
68
+ target.assign(new types_1.Date());
69
+ }
70
+ else if (options.name.trimEnd() === "F") {
71
+ target.assign(new types_1.Float());
72
+ }
61
73
  else {
62
74
  (0, throw_error_1.throwError)("CX_SY_CREATE_DATA_ERROR");
63
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.13",
3
+ "version": "2.7.15",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",