@abaplint/runtime 2.0.6 → 2.0.9
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/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# @abaplint/runtime
|
|
2
|
-
|
|
1
|
+
# @abaplint/runtime
|
|
2
|
+
|
|
3
3
|
Runtime
|
package/build/src/db/db.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { ICharacter } from "../types/_character";
|
|
|
36
36
|
import { FieldSymbol, Structure, Table } from "../types";
|
|
37
37
|
import { INumeric } from "../types/_numeric";
|
|
38
38
|
import { ICallFunctionOptions } from "./call_function";
|
|
39
|
+
import { SelectDatabaseOptions } from "../db/db";
|
|
39
40
|
export declare class Statements {
|
|
40
41
|
append: typeof append;
|
|
41
42
|
assert: typeof assert;
|
|
@@ -70,7 +71,7 @@ export declare class Statements {
|
|
|
70
71
|
insertDatabase(table: string | ICharacter, options: IInsertDatabaseOptions): Promise<number>;
|
|
71
72
|
message(options: IMessageOptions): Promise<void>;
|
|
72
73
|
modifyDatabase(table: string | ICharacter, options: IModifyDatabaseOptions): Promise<void>;
|
|
73
|
-
select(target: Structure | Table | FieldSymbol, select:
|
|
74
|
+
select(target: Structure | Table | FieldSymbol, select: SelectDatabaseOptions): Promise<void>;
|
|
74
75
|
updateDatabase(table: string | ICharacter, options: IUpdateDatabaseOptions): Promise<number>;
|
|
75
76
|
callFunction(options: ICallFunctionOptions): Promise<void>;
|
|
76
77
|
write(source: INumeric | ICharacter | FieldSymbol | string | number, options?: IWriteOptions): void;
|
|
@@ -27,8 +27,13 @@ function replace(input) {
|
|
|
27
27
|
replace = input.with.get();
|
|
28
28
|
}
|
|
29
29
|
if (input.all === true) {
|
|
30
|
-
|
|
31
|
-
temp = temp.replace(
|
|
30
|
+
if (input.regex) {
|
|
31
|
+
temp = temp.replace(new RegExp(input.regex.get(), "g"), replace);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
while (temp.replace(search, replace) !== temp) {
|
|
35
|
+
temp = temp.replace(search, replace);
|
|
36
|
+
}
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
else {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Context } from "../context";
|
|
2
|
+
import { SelectDatabaseOptions } from "../db/db";
|
|
2
3
|
import { FieldSymbol, Structure, Table } from "../types";
|
|
3
4
|
export declare class SelectDatabase {
|
|
4
5
|
private readonly context;
|
|
5
6
|
constructor(context: Context);
|
|
6
|
-
select(target: Structure | Table | FieldSymbol,
|
|
7
|
+
select(target: Structure | Table | FieldSymbol, input: SelectDatabaseOptions): Promise<void>;
|
|
7
8
|
}
|
|
@@ -7,9 +7,9 @@ class SelectDatabase {
|
|
|
7
7
|
constructor(context) {
|
|
8
8
|
this.context = context;
|
|
9
9
|
}
|
|
10
|
-
async select(target,
|
|
10
|
+
async select(target, input) {
|
|
11
11
|
var _a;
|
|
12
|
-
const { rows: rows } = await this.context.defaultDB().select(
|
|
12
|
+
const { rows: rows } = await this.context.defaultDB().select(input);
|
|
13
13
|
if (target instanceof types_1.FieldSymbol) {
|
|
14
14
|
if (target.isAssigned() === false) {
|
|
15
15
|
throw "select, fs not assigned";
|
|
@@ -33,7 +33,8 @@ class SelectDatabase {
|
|
|
33
33
|
else if (target instanceof types_1.Table) {
|
|
34
34
|
for (const row of rows) {
|
|
35
35
|
const targetRow = (0, clone_1.clone)(target.getRowType());
|
|
36
|
-
for (
|
|
36
|
+
for (let columnName in row) {
|
|
37
|
+
columnName = columnName.toLowerCase();
|
|
37
38
|
// todo, non structured table = table with simple rows
|
|
38
39
|
// @ts-ignore
|
|
39
40
|
(_a = targetRow.get()[columnName]) === null || _a === void 0 ? void 0 : _a.set(row[columnName]);
|
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@abaplint/runtime",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Transpiler - Runtime",
|
|
5
|
-
"main": "build/src/index.js",
|
|
6
|
-
"typings": "build/src/index.d.ts",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"compile": "tsc",
|
|
13
|
-
"publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
-
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
-
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
16
|
-
"test": "npm run compile && mocha"
|
|
17
|
-
},
|
|
18
|
-
"mocha": {
|
|
19
|
-
"recursive": true,
|
|
20
|
-
"reporter": "progress",
|
|
21
|
-
"spec": "build/test/**/*.js",
|
|
22
|
-
"require": "source-map-support/register"
|
|
23
|
-
},
|
|
24
|
-
"keywords": [
|
|
25
|
-
"ABAP",
|
|
26
|
-
"abaplint"
|
|
27
|
-
],
|
|
28
|
-
"author": "abaplint",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/chai": "^4.3.
|
|
32
|
-
"@types/mocha": "^9.1.0",
|
|
33
|
-
"@types/sql.js": "^1.4.3",
|
|
34
|
-
"chai": "^4.3.6",
|
|
35
|
-
"mocha": "^9.2.2",
|
|
36
|
-
"source-map-support": "^0.5.21",
|
|
37
|
-
"typescript": "^4.6.3"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@abaplint/runtime",
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"description": "Transpiler - Runtime",
|
|
5
|
+
"main": "build/src/index.js",
|
|
6
|
+
"typings": "build/src/index.d.ts",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/abaplint/transpiler.git"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"compile": "tsc",
|
|
13
|
+
"publish:major": "npm --no-git-tag-version version major && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
14
|
+
"publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
15
|
+
"publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public",
|
|
16
|
+
"test": "npm run compile && mocha"
|
|
17
|
+
},
|
|
18
|
+
"mocha": {
|
|
19
|
+
"recursive": true,
|
|
20
|
+
"reporter": "progress",
|
|
21
|
+
"spec": "build/test/**/*.js",
|
|
22
|
+
"require": "source-map-support/register"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ABAP",
|
|
26
|
+
"abaplint"
|
|
27
|
+
],
|
|
28
|
+
"author": "abaplint",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/chai": "^4.3.1",
|
|
32
|
+
"@types/mocha": "^9.1.0",
|
|
33
|
+
"@types/sql.js": "^1.4.3",
|
|
34
|
+
"chai": "^4.3.6",
|
|
35
|
+
"mocha": "^9.2.2",
|
|
36
|
+
"source-map-support": "^0.5.21",
|
|
37
|
+
"typescript": "^4.6.3"
|
|
38
|
+
}
|
|
39
|
+
}
|