@rdfc/js-runner 0.2.2 → 1.0.0-alpha.1
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 +3 -3
- package/bin/bundle.mjs +30596 -30679
- package/dist/args.js +19 -7
- package/dist/connectors/file.js +3 -3
- package/dist/connectors/http.js +8 -7
- package/dist/connectors/kafka.js +7 -7
- package/dist/connectors/ws.js +5 -5
- package/dist/connectors.d.ts +6 -1
- package/dist/connectors.js +42 -8
- package/dist/index.d.ts +8 -2
- package/dist/index.js +29 -14
- package/dist/profiling.d.ts +6 -0
- package/dist/profiling.js +75 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util.d.ts +2 -2
- package/dist/util.js +1 -1
- package/ontology.ttl +27 -0
- package/package.json +24 -22
- package/processor/test.js +22 -22
- package/dist/index.cjs +0 -655
package/dist/util.d.ts
CHANGED
|
@@ -21,18 +21,18 @@ export declare const CONN2: {
|
|
|
21
21
|
namespace: string;
|
|
22
22
|
custom: (input: string) => string;
|
|
23
23
|
} & {
|
|
24
|
-
path: string;
|
|
25
24
|
install: string;
|
|
26
25
|
build: string;
|
|
27
26
|
GitInstall: string;
|
|
28
27
|
LocalInstall: string;
|
|
29
28
|
url: string;
|
|
30
29
|
procFile: string;
|
|
30
|
+
path: string;
|
|
31
31
|
EnvVariable: string;
|
|
32
32
|
envKey: string;
|
|
33
33
|
envDefault: string;
|
|
34
34
|
} & {
|
|
35
|
-
terms: import("@treecg/types").Namespace<("
|
|
35
|
+
terms: import("@treecg/types").Namespace<("install" | "build" | "GitInstall" | "LocalInstall" | "url" | "procFile" | "path" | "EnvVariable" | "envKey" | "envDefault")[], import("@rdfjs/types").NamedNode<string>, string>;
|
|
36
36
|
};
|
|
37
37
|
export declare const namedNode: typeof DataFactory.namedNode, literal: typeof DataFactory.literal;
|
|
38
38
|
export type Keyed<T> = {
|
package/dist/util.js
CHANGED
|
@@ -68,7 +68,7 @@ export async function load_store(location, store, recursive = true) {
|
|
|
68
68
|
if (recursive) {
|
|
69
69
|
const loc = location.type === "remote" ? location.location : location.baseIRI;
|
|
70
70
|
const other_imports = store.getObjects(namedNode(loc), OWL.terms.imports, null);
|
|
71
|
-
for (
|
|
71
|
+
for (const other of other_imports) {
|
|
72
72
|
await load_store({ location: other.value, type: "remote" }, store, true);
|
|
73
73
|
}
|
|
74
74
|
}
|
package/ontology.ttl
CHANGED
|
@@ -82,6 +82,12 @@ js:JsReaderChannel rdfs:subClassOf :ReaderChannel.
|
|
|
82
82
|
sh:maxCount 1;
|
|
83
83
|
sh:minCount 1;
|
|
84
84
|
sh:class :Channel;
|
|
85
|
+
], [
|
|
86
|
+
sh:path ( );
|
|
87
|
+
sh:name "id";
|
|
88
|
+
sh:maxCount 1;
|
|
89
|
+
sh:minCount 1;
|
|
90
|
+
sh:datatype xsd:iri;
|
|
85
91
|
].
|
|
86
92
|
|
|
87
93
|
js:JsWriterChannel rdfs:subClassOf :WriterChannel.
|
|
@@ -93,6 +99,12 @@ js:JsWriterChannel rdfs:subClassOf :WriterChannel.
|
|
|
93
99
|
sh:maxCount 1;
|
|
94
100
|
sh:minCount 1;
|
|
95
101
|
sh:class :Channel;
|
|
102
|
+
], [
|
|
103
|
+
sh:path ( );
|
|
104
|
+
sh:name "id";
|
|
105
|
+
sh:maxCount 1;
|
|
106
|
+
sh:minCount 1;
|
|
107
|
+
sh:datatype xsd:iri;
|
|
96
108
|
].
|
|
97
109
|
|
|
98
110
|
#
|
|
@@ -167,3 +179,18 @@ js:JsProcessorShape a sh:NodeShape;
|
|
|
167
179
|
sh:minCount 1;
|
|
168
180
|
].
|
|
169
181
|
|
|
182
|
+
js:FileProfilerShape a sh:NodeShape;
|
|
183
|
+
sh:targetClass js:FileProfilerShape;
|
|
184
|
+
sh:property [
|
|
185
|
+
sh:datatype xsd:string;
|
|
186
|
+
sh:path js:path;
|
|
187
|
+
sh:name "path";
|
|
188
|
+
sh:maxCount 1;
|
|
189
|
+
sh:minCount 1;
|
|
190
|
+
], [
|
|
191
|
+
sh:datatype xsd:number;
|
|
192
|
+
sh:path js:intervalMs;
|
|
193
|
+
sh:name "interval";
|
|
194
|
+
sh:maxCount 1;
|
|
195
|
+
].
|
|
196
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdfc/js-runner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"import": "./dist/index.js",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
"js-runner": "bin/bundle.mjs"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsc && tsc-alias
|
|
23
|
-
"build:recompose": "sed -z 's/var __require = (id) => {\\n return import.meta.require(id);\\n};/import Module from \"node:module\";\\nconst __require = Module.createRequire(import.meta.url);/' -i bin/bundle.mjs",
|
|
22
|
+
"build": "tsc && tsc-alias",
|
|
24
23
|
"watch": "tsc -w",
|
|
25
24
|
"test": "vitest run --coverage --coverage.include src",
|
|
26
25
|
"prepare": "husky",
|
|
@@ -32,38 +31,41 @@
|
|
|
32
31
|
"dependencies": {
|
|
33
32
|
"@rdfjs/types": "^1.1.0",
|
|
34
33
|
"@treecg/types": "^0.4.6",
|
|
35
|
-
"command-line-args": "^
|
|
36
|
-
"command-line-usage": "^7.0.
|
|
37
|
-
"debug": "^4.3.
|
|
34
|
+
"command-line-args": "^6.0.0",
|
|
35
|
+
"command-line-usage": "^7.0.3",
|
|
36
|
+
"debug": "^4.3.6",
|
|
38
37
|
"kafkajs": "^2.2.4",
|
|
39
|
-
"n3": "^1.
|
|
40
|
-
"rdf-lens": "^1.
|
|
38
|
+
"n3": "^1.21.0",
|
|
39
|
+
"rdf-lens": "^1.3.0",
|
|
41
40
|
"stream-to-array": "^2.3.0",
|
|
42
41
|
"ws": "^8.18.0"
|
|
43
42
|
},
|
|
44
43
|
"devDependencies": {
|
|
44
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
45
|
+
"@eslint/js": "^9.9.1",
|
|
45
46
|
"@jest/globals": "^29.7.0",
|
|
46
47
|
"@knighted/duel": "^1.0.8",
|
|
47
48
|
"@types/command-line-args": "^5.2.3",
|
|
48
49
|
"@types/command-line-usage": "^5.0.4",
|
|
49
50
|
"@types/debug": "^4.1.12",
|
|
50
|
-
"@types/n3": "^1.16.
|
|
51
|
-
"@types/node": "^
|
|
52
|
-
"@types/ws": "^8.5.
|
|
53
|
-
"
|
|
54
|
-
"@typescript-eslint/
|
|
55
|
-
"@
|
|
56
|
-
"@vitest/coverage-v8": "^1.6.0",
|
|
51
|
+
"@types/n3": "^1.16.5",
|
|
52
|
+
"@types/node": "^22.5.1",
|
|
53
|
+
"@types/ws": "^8.5.12",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.3.0",
|
|
55
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
56
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
57
57
|
"dotenv": "^16.4.5",
|
|
58
|
-
"eslint": "^
|
|
58
|
+
"eslint": "^9.9.1",
|
|
59
59
|
"eslint-config-prettier": "^9.1.0",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
60
|
+
"globals": "^15.9.0",
|
|
61
|
+
"husky": "^9.1.5",
|
|
62
|
+
"lint-staged": "^15.2.9",
|
|
63
|
+
"prettier": "^3.3.3",
|
|
64
|
+
"rollup": "^4.21.1",
|
|
63
65
|
"ts-node": "^10.9.2",
|
|
64
66
|
"tsc-alias": "^1.8.10",
|
|
65
|
-
"typescript": "^5.5.
|
|
66
|
-
"vite-tsconfig-paths": "^
|
|
67
|
-
"vitest": "^
|
|
67
|
+
"typescript": "^5.5.4",
|
|
68
|
+
"vite-tsconfig-paths": "^5.0.1",
|
|
69
|
+
"vitest": "^2.0.5"
|
|
68
70
|
}
|
|
69
71
|
}
|
package/processor/test.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import http from "http";
|
|
2
2
|
|
|
3
3
|
function streamToString(ev) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const datas = [];
|
|
5
|
+
return new Promise((res) => {
|
|
6
|
+
ev.on("data", (d) => datas.push(d));
|
|
7
|
+
ev.on("end", () => res(Buffer.concat(datas)));
|
|
8
|
+
});
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export async function send(msg, writer) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const host = "0.0.0.0";
|
|
13
|
+
const port = 8000;
|
|
14
|
+
const requestListener = async function (req, res) {
|
|
15
|
+
const data = await streamToString(req);
|
|
16
|
+
const ret = `${msg} ${data}`;
|
|
17
|
+
await writer.push(ret);
|
|
18
|
+
res.writeHead(200);
|
|
19
|
+
res.end(ret);
|
|
20
|
+
};
|
|
21
|
+
const server = http.createServer(requestListener);
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
await new Promise((res) => {
|
|
24
|
+
server.listen(port, host, () => {
|
|
25
|
+
console.log(`Server is running on http://${host}:${port} prefix ${msg}`);
|
|
26
|
+
res();
|
|
27
|
+
});
|
|
27
28
|
});
|
|
28
|
-
});
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
return () => writer.push("Hallo!");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export function resc(reader) {
|
|
34
|
-
|
|
34
|
+
reader.data((x) => console.log("data", x));
|
|
35
35
|
}
|