@rdfc/js-runner 3.0.1 → 3.0.3

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.
Files changed (49) hide show
  1. package/.github/workflows/build-test.yml +24 -0
  2. package/README.md +4 -0
  3. package/__tests__/echoProcessor.test.ts +11 -12
  4. package/bun.lock +820 -0
  5. package/lib/logger.d.ts +1 -0
  6. package/lib/logger.js +19 -9
  7. package/lib/reader.js +1 -1
  8. package/lib/runner.d.ts +1 -0
  9. package/lib/runner.js +8 -4
  10. package/lib/testUtils/duplex.d.ts +2 -2
  11. package/lib/testUtils/duplex.js +1 -1
  12. package/lib/testUtils/index.js +2 -3
  13. package/lib/tsconfig.tsbuildinfo +1 -1
  14. package/package.json +25 -24
  15. package/src/logger.ts +15 -7
  16. package/src/reader.ts +8 -8
  17. package/src/runner.ts +14 -3
  18. package/src/testUtils/duplex.ts +2 -5
  19. package/src/testUtils/index.ts +1 -3
  20. package/.idea/LNKD.tech Editor.xml +0 -194
  21. package/.idea/codeStyles/Project.xml +0 -52
  22. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  23. package/.idea/copilot.data.migration.agent.xml +0 -6
  24. package/.idea/copilot.data.migration.ask.xml +0 -6
  25. package/.idea/copilot.data.migration.ask2agent.xml +0 -6
  26. package/.idea/copilot.data.migration.edit.xml +0 -6
  27. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  28. package/.idea/js-runner.iml +0 -12
  29. package/.idea/modules.xml +0 -8
  30. package/.idea/vcs.xml +0 -6
  31. package/dist/args.d.ts +0 -4
  32. package/dist/args.js +0 -58
  33. package/dist/connectors/file.d.ts +0 -15
  34. package/dist/connectors/file.js +0 -89
  35. package/dist/connectors/http.d.ts +0 -14
  36. package/dist/connectors/http.js +0 -82
  37. package/dist/connectors/kafka.d.ts +0 -48
  38. package/dist/connectors/kafka.js +0 -68
  39. package/dist/connectors/ws.d.ts +0 -10
  40. package/dist/connectors/ws.js +0 -72
  41. package/dist/connectors.d.ts +0 -73
  42. package/dist/connectors.js +0 -168
  43. package/dist/index.cjs +0 -732
  44. package/dist/index.d.ts +0 -42
  45. package/dist/index.js +0 -83
  46. package/dist/tsconfig.tsbuildinfo +0 -1
  47. package/dist/util.d.ts +0 -71
  48. package/dist/util.js +0 -92
  49. package/jest.config.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdfc/js-runner",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "main": "lib/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -25,42 +25,43 @@
25
25
  ]
26
26
  },
27
27
  "keywords": [],
28
- "author": "",
29
- "license": "ISC",
30
- "description": "",
28
+ "author": "Arthur Vercruysse",
29
+ "contributors": [
30
+ "Ieben Smessaert",
31
+ "Julián Rojas"
32
+ ],
33
+ "license": "MIT",
34
+ "description": "JavaScript runner implementation for RDF-Connect",
31
35
  "devDependencies": {
32
- "@eslint/js": "^9.38.0",
36
+ "@eslint/js": "^10.0.1",
33
37
  "@rdfjs/types": "^2.0.1",
34
- "@types/jest": "^30.0.0",
35
38
  "@types/jsonld": "^1.5.15",
36
39
  "@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",
40
- "@vitest/coverage-v8": "^3.2.4",
41
- "eslint": "^9.21.0",
40
+ "@types/node": "^25.3.3",
41
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
42
+ "@typescript-eslint/parser": "^8.56.1",
43
+ "@vitest/coverage-v8": "^4.0.18",
44
+ "eslint": "^10.0.2",
42
45
  "eslint-config-prettier": "^10.1.8",
43
- "eslint-plugin-prettier": "^5.5.4",
44
- "globals": "^16.4.0",
46
+ "eslint-plugin-prettier": "^5.5.5",
47
+ "globals": "^17.3.0",
45
48
  "husky": "^9.1.7",
46
- "jest": "^30.2.0",
47
- "lint-staged": "^15.5.2",
48
- "prettier": "^3.6.2",
49
- "ts-jest": "^29.4.5",
49
+ "lint-staged": "^16.3.0",
50
+ "prettier": "^3.8.1",
50
51
  "tsc-alias": "^1.8.16",
51
52
  "typescript": "^5.9.3",
52
- "typescript-eslint": "^8.46.2",
53
- "vitest": "^3.2.4"
53
+ "typescript-eslint": "^8.56.1",
54
+ "vitest": "^4.0.18"
54
55
  },
55
56
  "dependencies": {
56
- "@grpc/grpc-js": "^1.14.0",
57
+ "@grpc/grpc-js": "^1.14.3",
57
58
  "@rdfc/proto": "^0.1.2",
58
59
  "@treecg/types": "^0.4.6",
59
- "jsonld": "^8.3.3",
60
- "jsonld-streaming-parser": "^5.0.0",
61
- "n3": "^1.26.0",
60
+ "jsonld": "^9.0.0",
61
+ "jsonld-streaming-parser": "^5.0.1",
62
+ "n3": "^2.0.1",
62
63
  "rdf-lens": "^1.3.6",
63
- "winston": "^3.18.3",
64
+ "winston": "^3.19.0",
64
65
  "winston-transport": "^4.9.0"
65
66
  }
66
67
  }
package/src/logger.ts CHANGED
@@ -8,6 +8,7 @@ export class RpcTransport extends Transport {
8
8
  private readonly stream: grpc.ClientWritableStream<LogMessage>
9
9
  private readonly entities: string[]
10
10
  private readonly aliases: string[]
11
+ private draining: boolean
11
12
 
12
13
  constructor(opts: {
13
14
  stream: grpc.ClientWritableStream<LogMessage>
@@ -19,23 +20,30 @@ export class RpcTransport extends Transport {
19
20
  this.stream = opts.stream
20
21
  this.entities = opts.entities
21
22
  this.aliases = opts.aliases || []
23
+ this.draining = true
24
+
25
+ this.stream.on('drain', () => {
26
+ this.draining = true
27
+ })
22
28
  }
23
29
 
24
30
  log(info: LogEntry, callback: () => void) {
25
- if (!this.stream.closed) {
26
- this.stream.write(
27
- {
31
+ if (!this.stream.closed && !this.stream.destroyed && this.stream.writable) {
32
+ if (this.draining) {
33
+ const ok = this.stream.write({
28
34
  msg: info.message,
29
35
  level: info.level,
30
36
  entities: this.entities,
31
37
  aliases: this.aliases,
32
- },
33
- callback,
34
- )
38
+ })
39
+ if (!ok) {
40
+ this.draining = false
41
+ }
42
+ }
35
43
  } else {
36
44
  console.log('Output stream closed')
37
- callback()
38
45
  }
46
+ callback()
39
47
  }
40
48
 
41
49
  withEntity(entity: string): RpcTransport {
package/src/reader.ts CHANGED
@@ -18,14 +18,14 @@ import { promisify } from 'util'
18
18
 
19
19
  export type Any =
20
20
  | {
21
- string: string
22
- }
21
+ string: string
22
+ }
23
23
  | {
24
- stream: AsyncGenerator<Uint8Array>
25
- }
24
+ stream: AsyncGenerator<Uint8Array>
25
+ }
26
26
  | {
27
- buffer: Uint8Array
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*(stream) {
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
@@ -74,7 +74,7 @@ export class Runner {
74
74
  this.logger = logger
75
75
  }
76
76
 
77
- async addProcessor<P extends Proc<unknown>>(
77
+ async createProcessor<P extends Proc<unknown>>(
78
78
  proc: Processor,
79
79
  ): Promise<FullProc<P>> {
80
80
  const procLogger = createLogger({
@@ -93,7 +93,9 @@ export class Runner {
93
93
  )
94
94
  .map((x) => x.object.value)
95
95
 
96
- this.logger.info('parsing ' + proc.uri + ' type ' + ty)
96
+ this.logger.info(
97
+ `Parsing processor '${proc.uri}' of type(s) [${ty.join(', ')}]`,
98
+ )
97
99
  const args = this.shapes.lenses[RDFL.TypedExtract].execute({
98
100
  id: new NamedNode(proc.uri),
99
101
  quads: this.quads,
@@ -103,9 +105,18 @@ export class Runner {
103
105
  const jsProgram = await import(config.file)
104
106
  const clazz = jsProgram[config.clazz || 'default']
105
107
  const instance: Proc<unknown> = new clazz(args, procLogger)
108
+
109
+ return <FullProc<P>>instance
110
+ }
111
+
112
+ async addProcessor<P extends Proc<unknown>>(
113
+ proc: Processor,
114
+ ): Promise<FullProc<P>> {
115
+ const instance = await this.createProcessor<P>(proc)
116
+
106
117
  await instance.init()
107
118
 
108
- this.logger.info('inited ' + proc.uri + ' type ' + ty)
119
+ this.logger.info(`Initiated processor '${proc.uri}'`)
109
120
 
110
121
  this.processors.push(instance)
111
122
  this.processorTransforms.push(instance.transform())
@@ -1,8 +1,5 @@
1
1
  import { Duplex } from 'stream'
2
- import type {
3
- ClientDuplexStream,
4
- InterceptingCallInterface,
5
- } from '@grpc/grpc-js'
2
+ import type { ClientDuplexStream, InterceptingCall } from '@grpc/grpc-js'
6
3
  import { AuthContext } from '@grpc/grpc-js/build/src/auth-context'
7
4
 
8
5
  type Matcher<Req, T> = (req: Req) => T | undefined
@@ -23,7 +20,7 @@ export class MockClientDuplexStream<Req, Res>
23
20
 
24
21
  public readonly id: number
25
22
 
26
- call?: InterceptingCallInterface | undefined
23
+ call?: InterceptingCall | undefined
27
24
  constructor() {
28
25
  super({ objectMode: true })
29
26
  this.id = count++
@@ -5,7 +5,6 @@ import {
5
5
  Processor as ProcConfig,
6
6
  ToRunner,
7
7
  } from '@rdfc/proto'
8
- import {} from '../reexports'
9
8
  import { extractShapes } from 'rdf-lens'
10
9
  import { NamedNode, Parser, Writer as N3Writer } from 'n3'
11
10
  import { readFile } from 'fs/promises'
@@ -359,12 +358,11 @@ export class ProcHelper<T extends Processor<unknown>> {
359
358
  pipeline: new N3Writer().quadsToString(this.quads),
360
359
  })
361
360
 
362
- const proc = await this.runner.addProcessor<T>({
361
+ return await this.runner.createProcessor<T>({
363
362
  config: JSON.stringify(this.config),
364
363
  arguments: '',
365
364
  uri,
366
365
  })
367
- return proc
368
366
  }
369
367
  }
370
368
 
@@ -1,194 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="http://lnkd.tech/editor#BuiltinGlobalGraphs">
4
- <option name="disabled">
5
- <set>
6
- <option value="DC_AM" />
7
- <option value="DC_E" />
8
- <option value="DC_T" />
9
- <option value="DC_TYPE" />
10
- <option value="FOAF" />
11
- <option value="FOAF_ORG" />
12
- <option value="ML_XS" />
13
- <option value="OWL2" />
14
- <option value="RDF" />
15
- <option value="RDFS" />
16
- <option value="SHACL" />
17
- <option value="SHACL_SHACL" />
18
- <option value="SKOS" />
19
- <option value="SKOS_ORG" />
20
- <option value="SPIN_MODELING" />
21
- <option value="SPIN_MODELING_ORG" />
22
- <option value="SPIN_SPARQL" />
23
- <option value="SPIN_SPARQL_ORG" />
24
- <option value="SPIN_STD" />
25
- <option value="SPIN_STD_ORG" />
26
- <option value="VANN" />
27
- <option value="VOAF" />
28
- <option value="schemaorg_all_http" />
29
- <option value="schemaorg_all_https" />
30
- </set>
31
- </option>
32
- </component>
33
- <component name="http://lnkd.tech/editor#GlobalGraphsAssignments">
34
- <option name="assignments">
35
- <map>
36
- <entry key="urn:tag:lnslr.eu,2018:java:eu.lunisolar.lava.rdfvocab.get.lava.LavaCatalog">
37
- <value>
38
- <map>
39
- <entry key="http://purl.org/dc/dcam">
40
- <value>
41
- <set>
42
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/58ABCE836B2D0022BF4C4C921A8C34C6E2F4B4AB015C4649FCAFD9572ED4DB47" />
43
- </set>
44
- </value>
45
- </entry>
46
- <entry key="http://purl.org/dc/dcmitype">
47
- <value>
48
- <set>
49
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/F987B11D556E556FEF95D7E9410C1C561FC1B7AC05CCD457128DC8962641B01E" />
50
- </set>
51
- </value>
52
- </entry>
53
- <entry key="http://purl.org/dc/elements/1.1">
54
- <value>
55
- <set>
56
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/FFB46B7A21E40344B93BC4AD2E6808B24DD53E261995EC3A926DF6BCD87BBFA5" />
57
- </set>
58
- </value>
59
- </entry>
60
- <entry key="http://purl.org/dc/terms">
61
- <value>
62
- <set>
63
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/13DF401072DD7015BF9D75162F3E41C8138075304B7B9CC1AA1E9C16DB976797" />
64
- </set>
65
- </value>
66
- </entry>
67
- <entry key="http://purl.org/vocab/vann">
68
- <value>
69
- <set>
70
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/96DE3675A0EAE0C2979D58A21FB808417E0C75DA18EFB9FEB050135BBAC790CA" />
71
- </set>
72
- </value>
73
- </entry>
74
- <entry key="http://purl.org/vocommons/voaf">
75
- <value>
76
- <set>
77
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/8FF39E5D8A3A8DBE88C790E499F2DAA0FC520CD825EBBE59E79A388361839150" />
78
- </set>
79
- </value>
80
- </entry>
81
- <entry key="http://schema.org">
82
- <value>
83
- <set>
84
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/62854C817CF24454C9FC1D9DDB605C7B6A4FDE0FF574960D40B0E150166997B6" />
85
- </set>
86
- </value>
87
- </entry>
88
- <entry key="http://spinrdf.org/sp">
89
- <value>
90
- <set>
91
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/FD2A599D1CE5D78A65896D5CE0A34553533715EE61388AD5F6E2AC75CF36FE94" />
92
- </set>
93
- </value>
94
- </entry>
95
- <entry key="http://spinrdf.org/spin">
96
- <value>
97
- <set>
98
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/CC3E56C1F2BC6D4213BAF662C0A1FEB97ED968FA21D6C0ED7E44887747C74BC3" />
99
- </set>
100
- </value>
101
- </entry>
102
- <entry key="http://spinrdf.org/spl">
103
- <value>
104
- <set>
105
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/EAD726323D0CC38A6FD1D332E1781E2601C32537102E82A0995E7FBA87BEF306" />
106
- </set>
107
- </value>
108
- </entry>
109
- <entry key="http://www.w3.org/1999/02/22-rdf-syntax-ns">
110
- <value>
111
- <set>
112
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/93D52B1A5824C7DD6504CA79C16205C0B740A0BA68B7A14952780F52561186A2" />
113
- </set>
114
- </value>
115
- </entry>
116
- <entry key="http://www.w3.org/2000/01/rdf-schema">
117
- <value>
118
- <set>
119
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/164A70B28D9AC4B828EEC7D9E4B548A9465A5E2C154D53A142CC5E18566E04EC" />
120
- </set>
121
- </value>
122
- </entry>
123
- <entry key="http://www.w3.org/2002/07/owl">
124
- <value>
125
- <set>
126
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/718FA1DB7840D3315BFCE94398543F91437EF6FE933054FD93F5471D19262FC5" />
127
- </set>
128
- </value>
129
- </entry>
130
- <entry key="http://www.w3.org/2004/02/skos/core">
131
- <value>
132
- <set>
133
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/2D0AC9174D7C53393C546802A19669534B44590EA00D807F4C149C6FFB4CF6BB" />
134
- </set>
135
- </value>
136
- </entry>
137
- <entry key="http://www.w3.org/ns/shacl">
138
- <value>
139
- <set>
140
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/0E5D8AEA0EAB98A072D4A02FAAEE1EE914EC99EAB2CA473429726FAED4A13F69" />
141
- </set>
142
- </value>
143
- </entry>
144
- <entry key="http://www.w3.org/ns/shacl-shacl">
145
- <value>
146
- <set>
147
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/250D6274CADC8FA5359D5DBC28BC943F1DE01ADB7FFC3369681216B583122E4A" />
148
- </set>
149
- </value>
150
- </entry>
151
- <entry key="http://xmlns.com/foaf/0.1">
152
- <value>
153
- <set>
154
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/630DAF410F3C34ED9FE7302E4A8A5439488B68375789E7CF5DD137892DAC6789" />
155
- </set>
156
- </value>
157
- </entry>
158
- <entry key="https://schema.org">
159
- <value>
160
- <set>
161
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/24D9BBA4119AA8C8708767B12B3BCACBC8BB8750CDB111F573996899AA29F089" />
162
- </set>
163
- </value>
164
- </entry>
165
- <entry key="urn:tag:lnkd.tech,2020:MissingLink:XMLDataTypes">
166
- <value>
167
- <set>
168
- <option value="urn:tag:lnkd.tech,2023:digest:sha-256/E7430AD6C9345DEC6A8C7E0665607B34D1F6B6FDC47A30FAC3FB146179213174" />
169
- </set>
170
- </value>
171
- </entry>
172
- </map>
173
- </value>
174
- </entry>
175
- </map>
176
- </option>
177
- </component>
178
- <component name="http://lnkd.tech/editor#GraphVisibilityConfig">
179
- <option name="visibility">
180
- <map>
181
- <entry key="DOCUMENTATION">
182
- <value>
183
- <Visibility />
184
- </value>
185
- </entry>
186
- <entry key="GENERAL">
187
- <value>
188
- <Visibility />
189
- </value>
190
- </entry>
191
- </map>
192
- </option>
193
- </component>
194
- </project>
@@ -1,52 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- </HTMLCodeStyleSettings>
6
- <JSCodeStyleSettings version="0">
7
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
- <option name="FORCE_QUOTE_STYlE" value="true" />
10
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
11
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
12
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
13
- </JSCodeStyleSettings>
14
- <TypeScriptCodeStyleSettings version="0">
15
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
16
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
17
- <option name="FORCE_QUOTE_STYlE" value="true" />
18
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
19
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
20
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
21
- </TypeScriptCodeStyleSettings>
22
- <VueCodeStyleSettings>
23
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
24
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
25
- </VueCodeStyleSettings>
26
- <codeStyleSettings language="HTML">
27
- <option name="SOFT_MARGINS" value="80" />
28
- <indentOptions>
29
- <option name="CONTINUATION_INDENT_SIZE" value="4" />
30
- </indentOptions>
31
- </codeStyleSettings>
32
- <codeStyleSettings language="JavaScript">
33
- <option name="INDENT_CASE_FROM_SWITCH" value="false" />
34
- <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
35
- <option name="ALIGN_MULTILINE_FOR" value="false" />
36
- <option name="SOFT_MARGINS" value="80" />
37
- </codeStyleSettings>
38
- <codeStyleSettings language="TypeScript">
39
- <option name="INDENT_CASE_FROM_SWITCH" value="false" />
40
- <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
41
- <option name="ALIGN_MULTILINE_FOR" value="false" />
42
- <option name="SOFT_MARGINS" value="80" />
43
- </codeStyleSettings>
44
- <codeStyleSettings language="Vue">
45
- <option name="SOFT_MARGINS" value="80" />
46
- <indentOptions>
47
- <option name="INDENT_SIZE" value="4" />
48
- <option name="TAB_SIZE" value="4" />
49
- </indentOptions>
50
- </codeStyleSettings>
51
- </code_scheme>
52
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AskMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Ask2AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="EditMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/js-runner.iml" filepath="$PROJECT_DIR$/.idea/js-runner.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
package/dist/args.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type Args = {
2
- input: string
3
- }
4
- export declare function getArgs(): Args
package/dist/args.js DELETED
@@ -1,58 +0,0 @@
1
- import commandLineArgs from 'command-line-args'
2
- import commandLineUsage from 'command-line-usage'
3
- const optionDefinitions = [
4
- {
5
- name: 'input',
6
- type: String,
7
- defaultOption: true,
8
- summary: 'Specify what input file to start up',
9
- },
10
- {
11
- name: 'help',
12
- alias: 'h',
13
- type: Boolean,
14
- description: 'Display this help message',
15
- },
16
- ]
17
- const sections = [
18
- {
19
- header: 'Js-runner',
20
- content:
21
- 'JS-runner is part of the {italic connector architecture}. Starting from an input file start up all JsProcessors that are defined. Please do not use blank nodes, skolemize your data somewhere else!',
22
- },
23
- {
24
- header: 'Synopsis',
25
- content: '$ js-runner <input>',
26
- },
27
- {
28
- header: 'Command List',
29
- content: [
30
- { name: 'input', summary: 'Specify what input file to start up' },
31
- ],
32
- },
33
- {
34
- optionList: [optionDefinitions[1]],
35
- },
36
- ]
37
- function validArgs(args) {
38
- if (!args.input) return false
39
- return true
40
- }
41
- function printUsage() {
42
- const usage = commandLineUsage(sections)
43
- console.log(usage)
44
- process.exit(0)
45
- }
46
- export function getArgs() {
47
- let args
48
- try {
49
- args = commandLineArgs(optionDefinitions)
50
- } catch (e) {
51
- console.error(e)
52
- printUsage()
53
- }
54
- if (args.help || !validArgs(args)) {
55
- printUsage()
56
- }
57
- return args
58
- }
@@ -1,15 +0,0 @@
1
- import { ReaderConstructor, WriterConstructor } from '../connectors.js'
2
- export interface FileReaderConfig {
3
- path: string
4
- onReplace: boolean
5
- readFirstContent?: boolean
6
- encoding?: string
7
- }
8
- export interface FileWriterConfig {
9
- path: string
10
- onReplace: boolean
11
- readFirstContent?: boolean
12
- encoding?: string
13
- }
14
- export declare const startFileStreamReader: ReaderConstructor<FileReaderConfig>
15
- export declare const startFileStreamWriter: WriterConstructor<FileWriterConfig>