@qaecy/cue-cli 0.0.5
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/cue-cli-compare.js +903 -0
- package/cue-cli-sync.js +5322 -0
- package/hash-worker.js +21 -0
- package/main.js +7 -0
- package/package.json +37 -0
package/hash-worker.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// apps/desktop/cue-cli/src/hash-worker.js
|
|
2
|
+
var { parentPort } = require("worker_threads");
|
|
3
|
+
var { createReadStream } = require("fs");
|
|
4
|
+
var SparkMD5 = require("spark-md5");
|
|
5
|
+
function hashFile(path) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const spark = new SparkMD5.ArrayBuffer();
|
|
8
|
+
const stream = createReadStream(path);
|
|
9
|
+
stream.on("data", (chunk) => spark.append(chunk));
|
|
10
|
+
stream.on("end", () => resolve(spark.end()));
|
|
11
|
+
stream.on("error", (err) => reject(err));
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
parentPort.on("message", async (filePath) => {
|
|
15
|
+
try {
|
|
16
|
+
const hash = await hashFile(filePath);
|
|
17
|
+
parentPort.postMessage({ filePath, hash });
|
|
18
|
+
} catch (err) {
|
|
19
|
+
parentPort.postMessage({ filePath, error: err.message });
|
|
20
|
+
}
|
|
21
|
+
});
|
package/main.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// apps/desktop/cue-cli/src/main.ts
|
|
4
|
+
var import_commander = require("commander");
|
|
5
|
+
var program = new import_commander.Command();
|
|
6
|
+
program.name("cue-cli").command("sync [command]", "Sync files to Cue").command("compare [command]", "Compare to files in Cue").command("dump [command]", "Dump Cue Knowledge Graph data to file").command("dump-processed [command]", "Dump processed files to local folder").command("saturate [command]", "Saturate Cue Knowledge Graph data").command("fix [command]", "Fix an NQuads dump file to update old RDF* syntax").command("repair-ttl [command]", "Repair TTL files in the specified space").command("schemas [command]", "Builds TypeScript or Python artifacts from RDF Schemas").command("artefacts [command]", "Builds quad artefacts from a Jelly file").description("Cue Command Line Interface").version("0.0.5");
|
|
7
|
+
program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@qaecy/cue-cli",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Cue CLI for QAECY platform",
|
|
5
|
+
"main": "main.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"cue-cli": "main.js",
|
|
8
|
+
"cue-cli-sync": "cue-cli-sync.js",
|
|
9
|
+
"cue-cli-compare": "cue-cli-compare.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"main.js",
|
|
13
|
+
"cue-cli-sync.js",
|
|
14
|
+
"cue-cli-compare.js",
|
|
15
|
+
"hash-worker.js",
|
|
16
|
+
"assets/"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@google-cloud/pubsub": "4.4.1",
|
|
20
|
+
"commander": "13.1.0",
|
|
21
|
+
"firebase": "12.4.0",
|
|
22
|
+
"jsonld": "8.3.3",
|
|
23
|
+
"jszip": "3.10.1",
|
|
24
|
+
"n3": "1.24.0",
|
|
25
|
+
"oxigraph": "0.4.9",
|
|
26
|
+
"protobufjs": "7.5.4",
|
|
27
|
+
"spark-md5": "3.0.2",
|
|
28
|
+
"sparqljs": "3.7.1",
|
|
29
|
+
"tslib": "2.3.0",
|
|
30
|
+
"uuid": "9.0.0",
|
|
31
|
+
"axios": "1.13.1"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"type": "commonjs"
|
|
37
|
+
}
|