@rdfc/js-runner 3.0.0 → 3.0.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/.idea/LNKD.tech Editor.xml +194 -0
- package/.idea/codeStyles/Project.xml +52 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/js-runner.iml +12 -0
- package/{examples/echo/.idea → .idea}/modules.xml +1 -1
- package/.idea/vcs.xml +6 -0
- package/__tests__/echoProcessor.test.ts +12 -11
- package/dist/args.d.ts +4 -0
- package/dist/args.js +58 -0
- package/dist/connectors/file.d.ts +15 -0
- package/dist/connectors/file.js +89 -0
- package/dist/connectors/http.d.ts +14 -0
- package/dist/connectors/http.js +82 -0
- package/dist/connectors/kafka.d.ts +48 -0
- package/dist/connectors/kafka.js +68 -0
- package/dist/connectors/ws.d.ts +10 -0
- package/dist/connectors/ws.js +72 -0
- package/dist/connectors.d.ts +73 -0
- package/dist/connectors.js +168 -0
- package/dist/index.cjs +732 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +83 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/util.d.ts +71 -0
- package/dist/util.js +92 -0
- package/lib/reader.js +1 -1
- package/lib/runner.d.ts +1 -1
- package/lib/runner.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -21
- package/src/reader.ts +8 -8
- package/src/runner.ts +1 -2
- package/examples/echo/.idea/echo.iml +0 -9
- package/examples/echo/.idea/misc.xml +0 -6
- package/examples/echo/.idea/vcs.xml +0 -7
- package/examples/echo/.swls/config.json +0 -1
- package/examples/echo/index.ttl +0 -3
- package/examples/echo/minimal.ttl +0 -90
- package/examples/echo/shacl.ttl +0 -9
- package/examples/echo/shape.ttl +0 -1339
- package/examples/echo/test.ttl +0 -11
- package/examples/echo/untitled:/types/MyType.ttl +0 -0
- package/file:/home/silvius/Projects/mumo-pipeline/ldes/http_3A_2F_2Fdata.mumo.be_2Fstreams_2Fnodes_2Fdefault/root/index.trig +0 -3
- package/ldes/http_3A_2F_2Fdata.mumo.be_2Fstreams_2Fnodes_2Fdefault/root/index.trig +0 -3
- package/lib/jsonld.d.ts +0 -17
- package/lib/jsonld.js +0 -135
- package/lib/testUtils.d.ts +0 -24
- package/lib/testUtils.js +0 -150
- package/minimal.ttl +0 -99
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdfc/js-runner",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -29,38 +29,38 @@
|
|
|
29
29
|
"license": "ISC",
|
|
30
30
|
"description": "",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@eslint/js": "^9.
|
|
32
|
+
"@eslint/js": "^9.38.0",
|
|
33
33
|
"@rdfjs/types": "^2.0.1",
|
|
34
|
-
"@
|
|
35
|
-
"@types/jest": "^29.5.14",
|
|
34
|
+
"@types/jest": "^30.0.0",
|
|
36
35
|
"@types/jsonld": "^1.5.15",
|
|
37
|
-
"@types/n3": "^1.
|
|
38
|
-
"@types/node": "^22.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
36
|
+
"@types/n3": "^1.26.1",
|
|
37
|
+
"@types/node": "^22.18.12",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
39
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
41
40
|
"@vitest/coverage-v8": "^3.2.4",
|
|
42
41
|
"eslint": "^9.21.0",
|
|
43
|
-
"eslint-config-prettier": "^10.
|
|
44
|
-
"eslint-plugin-prettier": "^5.
|
|
45
|
-
"globals": "^16.
|
|
42
|
+
"eslint-config-prettier": "^10.1.8",
|
|
43
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
44
|
+
"globals": "^16.4.0",
|
|
46
45
|
"husky": "^9.1.7",
|
|
47
|
-
"jest": "^
|
|
48
|
-
"lint-staged": "^15.
|
|
49
|
-
"prettier": "^3.
|
|
50
|
-
"ts-jest": "^29.
|
|
51
|
-
"tsc-alias": "^1.8.
|
|
52
|
-
"typescript": "^5.
|
|
53
|
-
"typescript-eslint": "^8.
|
|
46
|
+
"jest": "^30.2.0",
|
|
47
|
+
"lint-staged": "^15.5.2",
|
|
48
|
+
"prettier": "^3.6.2",
|
|
49
|
+
"ts-jest": "^29.4.5",
|
|
50
|
+
"tsc-alias": "^1.8.16",
|
|
51
|
+
"typescript": "^5.9.3",
|
|
52
|
+
"typescript-eslint": "^8.46.2",
|
|
54
53
|
"vitest": "^3.2.4"
|
|
55
54
|
},
|
|
56
55
|
"dependencies": {
|
|
56
|
+
"@grpc/grpc-js": "^1.14.0",
|
|
57
57
|
"@rdfc/proto": "^0.1.2",
|
|
58
58
|
"@treecg/types": "^0.4.6",
|
|
59
59
|
"jsonld": "^8.3.3",
|
|
60
60
|
"jsonld-streaming-parser": "^5.0.0",
|
|
61
|
-
"n3": "^1.
|
|
62
|
-
"rdf-lens": "^1.3.
|
|
63
|
-
"winston": "^3.
|
|
61
|
+
"n3": "^1.26.0",
|
|
62
|
+
"rdf-lens": "^1.3.6",
|
|
63
|
+
"winston": "^3.18.3",
|
|
64
64
|
"winston-transport": "^4.9.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/reader.ts
CHANGED
|
@@ -18,14 +18,14 @@ import { promisify } from 'util'
|
|
|
18
18
|
|
|
19
19
|
export type Any =
|
|
20
20
|
| {
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
string: string
|
|
22
|
+
}
|
|
23
23
|
| {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
stream: AsyncGenerator<Uint8Array>
|
|
25
|
+
}
|
|
26
26
|
| {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
buffer: Uint8Array
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
export interface Reader {
|
|
31
31
|
readonly uri: string
|
|
@@ -68,7 +68,7 @@ class MyIter<T> implements AsyncIterable<T> {
|
|
|
68
68
|
|
|
69
69
|
async pushStream(chunks: AsyncIterable<DataChunk>, onComplete: () => void) {
|
|
70
70
|
// This is an async generator that transforms DataChunks to Buffers
|
|
71
|
-
const stream = (async function*
|
|
71
|
+
const stream = (async function*(stream) {
|
|
72
72
|
for await (const chunk of stream) {
|
|
73
73
|
yield chunk.data
|
|
74
74
|
}
|
|
@@ -165,7 +165,7 @@ export class ReaderInstance implements Reader {
|
|
|
165
165
|
|
|
166
166
|
close() {
|
|
167
167
|
for (const iter of this.consumers) {
|
|
168
|
-
iter.close(() => {})
|
|
168
|
+
iter.close(() => { })
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
package/src/runner.ts
CHANGED
|
@@ -47,8 +47,7 @@ type ProcessorConfig = {
|
|
|
47
47
|
clazz?: string
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export type FullProc<C extends Proc<
|
|
51
|
-
C extends Proc<infer T> ? T & C : unknown
|
|
50
|
+
export type FullProc<C> = C extends Proc<infer T> ? T & C : never
|
|
52
51
|
export class Runner {
|
|
53
52
|
private readonly readers: { [uri: string]: ReaderInstance } = {}
|
|
54
53
|
private readonly writers: { [uri: string]: WriterInstance } = {}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "disabled": ["shapes"] }
|
package/examples/echo/index.ttl
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
@prefix rdfc: <https://w3id.org/rdf-connect#>.
|
|
2
|
-
@prefix prov: <http://www.w3.org/ns/prov#>.
|
|
3
|
-
@prefix sds: <https://w3id.org/sds#>.
|
|
4
|
-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
|
5
|
-
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
|
6
|
-
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
7
|
-
@prefix sh: <http://www.w3.org/ns/shacl#>.
|
|
8
|
-
|
|
9
|
-
############################################################
|
|
10
|
-
# General statements #
|
|
11
|
-
############################################################
|
|
12
|
-
# sds:Activity is a prov:Activity
|
|
13
|
-
sds:Activity rdfs:subClassOf prov:Activity.
|
|
14
|
-
|
|
15
|
-
# rdfc:Processor too
|
|
16
|
-
rdfc:Processor rdfs:subClassOf sds:Activity.
|
|
17
|
-
|
|
18
|
-
# sds:implementationOf is subClassOf
|
|
19
|
-
sds:implementationOf rdfs:subPropertyOf rdfs:subClassOf.
|
|
20
|
-
|
|
21
|
-
############################################################
|
|
22
|
-
# Javascript statements #
|
|
23
|
-
############################################################
|
|
24
|
-
# specialized for js too
|
|
25
|
-
rdfc:jsImplementationOf rdfs:subPropertyOf sds:implementationOf.
|
|
26
|
-
|
|
27
|
-
# A node runner, runs things that are rdfc:jsImplementationOf rdfc:Processor (aka, rdfs:subClassOf prov:Activity)
|
|
28
|
-
rdfc:NodeRunner a rdfc:Runner;
|
|
29
|
-
rdfc:handlesSubjectsOf rdfc:jsImplementationOf;
|
|
30
|
-
rdfc:command "npx js-runner".
|
|
31
|
-
|
|
32
|
-
# Shape that a Js Processor should fulfil;
|
|
33
|
-
[ ] a sh:NodeShape;
|
|
34
|
-
# We target it with jsImplementationOf
|
|
35
|
-
sh:targetSubjectsOf rdfc:jsImplementationOf;
|
|
36
|
-
sh:property [
|
|
37
|
-
sh:path rdfc:entrypoint;
|
|
38
|
-
sh:name "location";
|
|
39
|
-
sh:minCount 1;
|
|
40
|
-
sh:maxCount 1;
|
|
41
|
-
sh:datatype xsd:string;
|
|
42
|
-
], [
|
|
43
|
-
sh:path rdfc:file;
|
|
44
|
-
sh:name "file";
|
|
45
|
-
sh:minCount 1;
|
|
46
|
-
sh:maxCount 1;
|
|
47
|
-
sh:datatype xsd:string;
|
|
48
|
-
], [
|
|
49
|
-
sh:path rdfc:class;
|
|
50
|
-
sh:name "clazz";
|
|
51
|
-
sh:maxCount 1;
|
|
52
|
-
sh:datatype xsd:string;
|
|
53
|
-
].
|
|
54
|
-
|
|
55
|
-
############################################################
|
|
56
|
-
# Processor statements #
|
|
57
|
-
############################################################
|
|
58
|
-
rdfc:FooBarProcessor a owl:Class, rdfs:Class;
|
|
59
|
-
rdfc:jsImplementationOf rdfc:Processor;
|
|
60
|
-
rdfs:label "My Epic FooBar Processor";
|
|
61
|
-
rdfs:description "FooBars everything!";
|
|
62
|
-
rdfc:entrypoint <./>;
|
|
63
|
-
rdfc:file <./lib/processors.js>;
|
|
64
|
-
rdfc:class "FooBarProcessor".
|
|
65
|
-
|
|
66
|
-
[ ] a sh:NodeShape;
|
|
67
|
-
sh:targetClass rdfc:FooBarProcessor;
|
|
68
|
-
sh:property [
|
|
69
|
-
sh:path rdfc:reader;
|
|
70
|
-
sh:name "reader";
|
|
71
|
-
sh:minCount 1;
|
|
72
|
-
sh:maxCount 1;
|
|
73
|
-
sh:class rdfc:Reader;
|
|
74
|
-
].
|
|
75
|
-
|
|
76
|
-
############################################################
|
|
77
|
-
# Pipeline statements #
|
|
78
|
-
############################################################
|
|
79
|
-
<> a rdfc:Pipeline;
|
|
80
|
-
rdfc:consistsOf [
|
|
81
|
-
rdfc:instantiates rdfc:NodeRunner;
|
|
82
|
-
rdfc:processor <foobar>;
|
|
83
|
-
].
|
|
84
|
-
|
|
85
|
-
# <incomingMessages> a rdfc:Reader.
|
|
86
|
-
<incomingMessages> a rdfc:Reader.
|
|
87
|
-
|
|
88
|
-
<fooBar> a rdfc:FooBarProcessor;
|
|
89
|
-
rdfc:reader <incomingMessages>.
|
|
90
|
-
|