@qaecy/cue-cli 0.0.15 → 0.0.19
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/main.js +175 -31
- package/package.json +3 -3
- package/readme.md +14 -0
package/main.js
CHANGED
|
@@ -67,20 +67,20 @@ var init_worker_pool = __esm({
|
|
|
67
67
|
}
|
|
68
68
|
_next() {
|
|
69
69
|
if (this.queue.length > 0 && this.idleWorkers.length > 0) {
|
|
70
|
-
const { filePath, resolve, reject } = this.queue.shift();
|
|
70
|
+
const { filePath, resolve: resolve2, reject } = this.queue.shift();
|
|
71
71
|
const worker = this.idleWorkers.pop();
|
|
72
72
|
worker._currentCallback = (result) => {
|
|
73
73
|
if (result.error)
|
|
74
74
|
reject(new Error(result.error));
|
|
75
75
|
else
|
|
76
|
-
|
|
76
|
+
resolve2(result.hash);
|
|
77
77
|
};
|
|
78
78
|
worker.postMessage(filePath);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
hashFile(filePath) {
|
|
82
|
-
return new Promise((
|
|
83
|
-
this.queue.push({ filePath, resolve, reject });
|
|
82
|
+
return new Promise((resolve2, reject) => {
|
|
83
|
+
this.queue.push({ filePath, resolve: resolve2, reject });
|
|
84
84
|
this._next();
|
|
85
85
|
});
|
|
86
86
|
}
|
|
@@ -93,8 +93,8 @@ var init_worker_pool = __esm({
|
|
|
93
93
|
|
|
94
94
|
// apps/desktop/cue-cli/src/main.ts
|
|
95
95
|
var import_commander = require("commander");
|
|
96
|
-
var
|
|
97
|
-
var
|
|
96
|
+
var import_fs8 = require("fs");
|
|
97
|
+
var import_path5 = require("path");
|
|
98
98
|
|
|
99
99
|
// apps/desktop/cue-cli/src/variables.ts
|
|
100
100
|
var import_path = require("path");
|
|
@@ -119,7 +119,7 @@ var IGNORED_LOCAL = {
|
|
|
119
119
|
|
|
120
120
|
// libs/js/sync-tools/src/lib/compare-local-remote.ts
|
|
121
121
|
function compareLocalRemote(localFiles, remoteFiles) {
|
|
122
|
-
return new Promise((
|
|
122
|
+
return new Promise((resolve2) => {
|
|
123
123
|
const localByContentUUID = /* @__PURE__ */ new Map();
|
|
124
124
|
const localBylocationUUID = /* @__PURE__ */ new Map();
|
|
125
125
|
for (const lf of localFiles) {
|
|
@@ -180,7 +180,7 @@ function compareLocalRemote(localFiles, remoteFiles) {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
const synctPctSize = totalSize > 0 ? syncSize / totalSize : 1;
|
|
183
|
-
|
|
183
|
+
resolve2({
|
|
184
184
|
localNotOnRemote,
|
|
185
185
|
localNotOnRemotePathOnly,
|
|
186
186
|
remoteNotOnLocal,
|
|
@@ -212,6 +212,7 @@ var BUCKET_RAW = "spaces_raw_eu_west6";
|
|
|
212
212
|
var BUCKET_PROCESSED = "spaces_processed_eu_west6";
|
|
213
213
|
var BUCKET_LOGS = "spaces_logs_eu_west6";
|
|
214
214
|
var BUCKET_PUBLIC = "cue_public_eu_west6";
|
|
215
|
+
var BUCKET_PERSISTENCE = "db_persistence_eu_west6";
|
|
215
216
|
var COLLECTION_CHAT_SESSIONS = "chatSessions";
|
|
216
217
|
var COLLECTION_ORGANIZATIONS = "organizations";
|
|
217
218
|
var COLLECTION_PROJECTS = "projects";
|
|
@@ -227,9 +228,10 @@ var import_firestore = require("firebase/firestore");
|
|
|
227
228
|
var import_auth = require("firebase/auth");
|
|
228
229
|
var import_app = require("firebase/app");
|
|
229
230
|
var CueFirebase = class _CueFirebase {
|
|
231
|
+
static _instance;
|
|
232
|
+
_muted = true;
|
|
233
|
+
_emulator = false;
|
|
230
234
|
constructor(config, auth, muted = false) {
|
|
231
|
-
this._muted = true;
|
|
232
|
-
this._emulator = false;
|
|
233
235
|
this._muted = muted;
|
|
234
236
|
this._init(config, auth);
|
|
235
237
|
}
|
|
@@ -243,6 +245,28 @@ var CueFirebase = class _CueFirebase {
|
|
|
243
245
|
}
|
|
244
246
|
return _CueFirebase._instance;
|
|
245
247
|
}
|
|
248
|
+
_functionAcceptTerms;
|
|
249
|
+
_functionEmitMessage;
|
|
250
|
+
_functionGetUserInfo;
|
|
251
|
+
_functionChangeUserRoleOnProject;
|
|
252
|
+
_functionInviteUserToProject;
|
|
253
|
+
_functionRemoveUserFromProject;
|
|
254
|
+
_storageProcessed;
|
|
255
|
+
_storageRaw;
|
|
256
|
+
_storageLogs;
|
|
257
|
+
_storageChatSessions;
|
|
258
|
+
_storagePublic;
|
|
259
|
+
_storagePersistence;
|
|
260
|
+
_collectionChatSessions;
|
|
261
|
+
_collectionOrganizations;
|
|
262
|
+
_collectionProjects;
|
|
263
|
+
_collectionRDFWriting;
|
|
264
|
+
_collectionAPIKeys;
|
|
265
|
+
_collectionUsers;
|
|
266
|
+
_collectionUserTermsAcceptance;
|
|
267
|
+
_collectionTiers;
|
|
268
|
+
_auth;
|
|
269
|
+
_app;
|
|
246
270
|
get functionAcceptTerms() {
|
|
247
271
|
return this._functionAcceptTerms;
|
|
248
272
|
}
|
|
@@ -276,6 +300,9 @@ var CueFirebase = class _CueFirebase {
|
|
|
276
300
|
get storagePublic() {
|
|
277
301
|
return this._storagePublic;
|
|
278
302
|
}
|
|
303
|
+
get storagePersistence() {
|
|
304
|
+
return this._storagePersistence;
|
|
305
|
+
}
|
|
279
306
|
get collectionChatSessions() {
|
|
280
307
|
return this._collectionChatSessions;
|
|
281
308
|
}
|
|
@@ -347,6 +374,7 @@ var CueFirebase = class _CueFirebase {
|
|
|
347
374
|
this._storageChatSessions = (0, import_storage.getStorage)(app, BUCKET_CHAT_SESSIONS);
|
|
348
375
|
this._storageLogs = (0, import_storage.getStorage)(app, BUCKET_LOGS);
|
|
349
376
|
this._storagePublic = (0, import_storage.getStorage)(app, BUCKET_PUBLIC);
|
|
377
|
+
this._storagePersistence = (0, import_storage.getStorage)(app, BUCKET_PERSISTENCE);
|
|
350
378
|
this._collectionChatSessions = (0, import_firestore.collection)(
|
|
351
379
|
(0, import_firestore.getFirestore)(app),
|
|
352
380
|
COLLECTION_CHAT_SESSIONS
|
|
@@ -384,6 +412,8 @@ var CueFirebase = class _CueFirebase {
|
|
|
384
412
|
throw new Error("Storage logs is not initialized");
|
|
385
413
|
if (this._storagePublic === void 0)
|
|
386
414
|
throw new Error("Storage public is not initialized");
|
|
415
|
+
if (this._storagePersistence === void 0)
|
|
416
|
+
throw new Error("Storage persistence is not initialized");
|
|
387
417
|
if (this._app === void 0)
|
|
388
418
|
throw new Error("App is not initialized");
|
|
389
419
|
const functions = (0, import_functions.getFunctions)(this._app, GCP_REGION);
|
|
@@ -395,6 +425,7 @@ var CueFirebase = class _CueFirebase {
|
|
|
395
425
|
(0, import_storage.connectStorageEmulator)(this._storageChatSessions, "localhost", 9199);
|
|
396
426
|
(0, import_storage.connectStorageEmulator)(this._storageLogs, "localhost", 9199);
|
|
397
427
|
(0, import_storage.connectStorageEmulator)(this._storagePublic, "localhost", 9199);
|
|
428
|
+
(0, import_storage.connectStorageEmulator)(this._storagePersistence, "localhost", 9199);
|
|
398
429
|
if (!this._muted)
|
|
399
430
|
console.info("Firebase emulators attached");
|
|
400
431
|
}
|
|
@@ -3782,20 +3813,20 @@ var extractIdsFromRawPath = (filePath) => {
|
|
|
3782
3813
|
const projectId = pathParts[0];
|
|
3783
3814
|
const fileName = pathParts.pop() ?? "";
|
|
3784
3815
|
const suffix = `.${fileName.split(".").pop()?.toLowerCase()}`;
|
|
3785
|
-
const documentUUID = fileName.
|
|
3816
|
+
const documentUUID = fileName.replace(/\.[^.]+$/, "");
|
|
3786
3817
|
return { projectId, documentUUID, suffix };
|
|
3787
3818
|
};
|
|
3788
3819
|
|
|
3789
3820
|
// libs/js/id-builders/src/lib/md5-builder.ts
|
|
3790
3821
|
var import_spark_md5 = __toESM(require("spark-md5"));
|
|
3791
3822
|
async function fromReadStream(readStream) {
|
|
3792
|
-
return new Promise((
|
|
3823
|
+
return new Promise((resolve2, reject) => {
|
|
3793
3824
|
const spark = new import_spark_md5.default.ArrayBuffer();
|
|
3794
3825
|
readStream.on("data", (chunk) => {
|
|
3795
3826
|
spark.append(chunk);
|
|
3796
3827
|
});
|
|
3797
3828
|
readStream.on("end", () => {
|
|
3798
|
-
|
|
3829
|
+
resolve2(spark.end());
|
|
3799
3830
|
});
|
|
3800
3831
|
readStream.on("error", (err) => reject(err));
|
|
3801
3832
|
});
|
|
@@ -4405,11 +4436,11 @@ async function retryWithBackoff(fn, maxRetries, delayMs, label) {
|
|
|
4405
4436
|
}
|
|
4406
4437
|
async function _doGzip(filePath) {
|
|
4407
4438
|
const gzFilePath = `${filePath}.gz`;
|
|
4408
|
-
await new Promise((
|
|
4439
|
+
await new Promise((resolve2, reject) => {
|
|
4409
4440
|
const gzip = (0, import_zlib.createGzip)();
|
|
4410
4441
|
const source = (0, import_fs3.createReadStream)(filePath);
|
|
4411
4442
|
const dest = (0, import_fs2.createWriteStream)(gzFilePath);
|
|
4412
|
-
(0, import_promises4.pipeline)(source, gzip, dest).then(
|
|
4443
|
+
(0, import_promises4.pipeline)(source, gzip, dest).then(resolve2).catch(reject);
|
|
4413
4444
|
});
|
|
4414
4445
|
await (0, import_promises5.unlink)(filePath);
|
|
4415
4446
|
}
|
|
@@ -5663,8 +5694,13 @@ var prefixes2 = {
|
|
|
5663
5694
|
"xsd": prefixCC["xsd"]
|
|
5664
5695
|
};
|
|
5665
5696
|
|
|
5666
|
-
// libs/js/rdf-document-writers/src/lib/
|
|
5697
|
+
// libs/js/rdf-document-writers/src/lib/custom-template-parser.ts
|
|
5667
5698
|
var import_n33 = require("n3");
|
|
5699
|
+
var { namedNode: namedNode3, literal: literal2 } = import_n33.DataFactory;
|
|
5700
|
+
var a2 = namedNode3("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
|
|
5701
|
+
|
|
5702
|
+
// libs/js/rdf-document-writers/src/lib/document-file.ts
|
|
5703
|
+
var import_n34 = require("n3");
|
|
5668
5704
|
|
|
5669
5705
|
// libs/js/rdf-document-writers/src/lib/file-suffix.ts
|
|
5670
5706
|
function getFileSuffix(filename) {
|
|
@@ -5676,17 +5712,17 @@ function getFileSuffix(filename) {
|
|
|
5676
5712
|
}
|
|
5677
5713
|
|
|
5678
5714
|
// libs/js/rdf-document-writers/src/lib/document-file.ts
|
|
5679
|
-
var { namedNode:
|
|
5680
|
-
var
|
|
5715
|
+
var { namedNode: namedNode4, literal: literal3 } = import_n34.DataFactory;
|
|
5716
|
+
var a3 = namedNode4("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
|
|
5681
5717
|
|
|
5682
5718
|
// libs/js/rdf-document-writers/src/lib/serialize-rdf.ts
|
|
5683
5719
|
async function serializeRDF(namespace, writer) {
|
|
5684
|
-
return new Promise((
|
|
5720
|
+
return new Promise((resolve2, reject) => {
|
|
5685
5721
|
writer.end((err, res) => {
|
|
5686
5722
|
if (err)
|
|
5687
5723
|
reject(err);
|
|
5688
|
-
|
|
5689
|
-
${res}`);
|
|
5724
|
+
resolve2(namespace !== "" ? `@base <${namespace}>.
|
|
5725
|
+
${res}` : res);
|
|
5690
5726
|
});
|
|
5691
5727
|
});
|
|
5692
5728
|
}
|
|
@@ -5750,7 +5786,7 @@ async function uploadFile(file, spaceId, userId, providerId) {
|
|
|
5750
5786
|
let lastError = null;
|
|
5751
5787
|
while (attempt < maxRetries) {
|
|
5752
5788
|
try {
|
|
5753
|
-
await new Promise((
|
|
5789
|
+
await new Promise((resolve2, reject) => {
|
|
5754
5790
|
const uploadTask = (0, import_storage5.uploadBytesResumable)(fileRef, fileBuffer, {
|
|
5755
5791
|
customMetadata: rawFileMetadata
|
|
5756
5792
|
});
|
|
@@ -5776,7 +5812,7 @@ async function uploadFile(file, spaceId, userId, providerId) {
|
|
|
5776
5812
|
});
|
|
5777
5813
|
reject(error);
|
|
5778
5814
|
},
|
|
5779
|
-
() =>
|
|
5815
|
+
() => resolve2()
|
|
5780
5816
|
);
|
|
5781
5817
|
if (!uploadTask) {
|
|
5782
5818
|
console.error("[uploadFile] Upload task could not be created:", {
|
|
@@ -5874,6 +5910,9 @@ async function publishMessage(topicName, data, useEmulator) {
|
|
|
5874
5910
|
}
|
|
5875
5911
|
|
|
5876
5912
|
// apps/desktop/cue-cli/src/cue-cli-sync.ts
|
|
5913
|
+
var import_promises7 = require("fs/promises");
|
|
5914
|
+
var import_fs6 = require("fs");
|
|
5915
|
+
var import_path4 = require("path");
|
|
5877
5916
|
async function syncHandler(options) {
|
|
5878
5917
|
const { space, path, verbose, provider, emulators, zip } = options;
|
|
5879
5918
|
try {
|
|
@@ -5881,8 +5920,28 @@ async function syncHandler(options) {
|
|
|
5881
5920
|
if (verbose)
|
|
5882
5921
|
console.info("Building sync base \u23F3");
|
|
5883
5922
|
const qh = async (query) => queryHandler(query, space, emulators);
|
|
5884
|
-
const
|
|
5885
|
-
|
|
5923
|
+
const resolvedPath = (0, import_path4.resolve)(path);
|
|
5924
|
+
const pathStat = await (0, import_promises7.stat)(resolvedPath);
|
|
5925
|
+
const isFile = pathStat.isFile();
|
|
5926
|
+
let localFiles;
|
|
5927
|
+
if (isFile) {
|
|
5928
|
+
if (verbose)
|
|
5929
|
+
console.info(`Path is a file, syncing single file: ${resolvedPath}`);
|
|
5930
|
+
const md5 = await fromReadStream((0, import_fs6.createReadStream)(resolvedPath));
|
|
5931
|
+
const relativePath = (0, import_path4.basename)(resolvedPath);
|
|
5932
|
+
const contentUUID = contextBasedGuid(md5);
|
|
5933
|
+
const locationUUID = generateFileUUID(relativePath, provider);
|
|
5934
|
+
localFiles = [{
|
|
5935
|
+
relativePath,
|
|
5936
|
+
fullPath: resolvedPath,
|
|
5937
|
+
md5,
|
|
5938
|
+
contentUUID,
|
|
5939
|
+
locationUUID,
|
|
5940
|
+
mtimeMs: pathStat.mtimeMs,
|
|
5941
|
+
size: pathStat.size
|
|
5942
|
+
}];
|
|
5943
|
+
} else {
|
|
5944
|
+
localFiles = await listLocalFiles(
|
|
5886
5945
|
path,
|
|
5887
5946
|
provider,
|
|
5888
5947
|
verbose,
|
|
@@ -5890,9 +5949,9 @@ async function syncHandler(options) {
|
|
|
5890
5949
|
IGNORED_LOCAL,
|
|
5891
5950
|
HASH_WORKER_PATH,
|
|
5892
5951
|
zip
|
|
5893
|
-
)
|
|
5894
|
-
|
|
5895
|
-
|
|
5952
|
+
);
|
|
5953
|
+
}
|
|
5954
|
+
const remoteFiles = await listRemoteFiles(space, provider, qh, verbose);
|
|
5896
5955
|
const report = await compareLocalRemote(localFiles, remoteFiles);
|
|
5897
5956
|
if (verbose) {
|
|
5898
5957
|
console.info("Built sync base \u2705");
|
|
@@ -5948,7 +6007,7 @@ async function syncHandler(options) {
|
|
|
5948
6007
|
continue;
|
|
5949
6008
|
}
|
|
5950
6009
|
}
|
|
5951
|
-
const zipDeletePromise = zip ? deleteUnzipped(path) : Promise.resolve();
|
|
6010
|
+
const zipDeletePromise = zip && !isFile ? deleteUnzipped(path) : Promise.resolve();
|
|
5952
6011
|
if (verbose && report.localNotOnRemotePathOnly.length)
|
|
5953
6012
|
console.info(
|
|
5954
6013
|
`Starting sync of missing file locations (on provider "${provider}") \u23F3`
|
|
@@ -6006,13 +6065,97 @@ async function syncHandler(options) {
|
|
|
6006
6065
|
}
|
|
6007
6066
|
}
|
|
6008
6067
|
|
|
6068
|
+
// apps/desktop/cue-cli/src/cue-cli-util-remove-rdf-star.ts
|
|
6069
|
+
var import_fs7 = require("fs");
|
|
6070
|
+
var import_zlib2 = require("zlib");
|
|
6071
|
+
|
|
6072
|
+
// libs/js/rdf-tools/src/lib/nq-to-nt.ts
|
|
6073
|
+
var import_n35 = require("n3");
|
|
6074
|
+
var { quad, defaultGraph } = import_n35.DataFactory;
|
|
6075
|
+
|
|
6076
|
+
// libs/js/rdf-tools/src/lib/remove-rdf-star.ts
|
|
6077
|
+
var import_n36 = require("n3");
|
|
6078
|
+
var import_stream2 = require("stream");
|
|
6079
|
+
function isRDFStarTerm(term) {
|
|
6080
|
+
return term.termType === "Quad";
|
|
6081
|
+
}
|
|
6082
|
+
function removeRDFStar(inputStream, starCount) {
|
|
6083
|
+
const parser = new import_n36.Parser({ format: "N-Quads*" });
|
|
6084
|
+
const outputStream = new import_stream2.PassThrough();
|
|
6085
|
+
const writer = new import_n36.StreamWriter({ format: "N-Quads" });
|
|
6086
|
+
writer.pipe(outputStream);
|
|
6087
|
+
let count = 0;
|
|
6088
|
+
parser.parse(inputStream, (error, quad2, prefixes3) => {
|
|
6089
|
+
if (error) {
|
|
6090
|
+
outputStream.emit("error", error);
|
|
6091
|
+
writer.end();
|
|
6092
|
+
return;
|
|
6093
|
+
}
|
|
6094
|
+
if (quad2) {
|
|
6095
|
+
if (!isRDFStarTerm(quad2.subject) && !isRDFStarTerm(quad2.object)) {
|
|
6096
|
+
writer.write(quad2);
|
|
6097
|
+
} else if (starCount) {
|
|
6098
|
+
count++;
|
|
6099
|
+
starCount(count);
|
|
6100
|
+
}
|
|
6101
|
+
} else {
|
|
6102
|
+
console.log("Finished processing input stream of RDF*, ending writer.");
|
|
6103
|
+
writer.end();
|
|
6104
|
+
}
|
|
6105
|
+
});
|
|
6106
|
+
return outputStream;
|
|
6107
|
+
}
|
|
6108
|
+
|
|
6109
|
+
// apps/desktop/cue-cli/src/cue-cli-util-remove-rdf-star.ts
|
|
6110
|
+
async function utilRemoveRdfStarHandler(options) {
|
|
6111
|
+
const { input, output, verbose } = options;
|
|
6112
|
+
const isGzipped = input.endsWith(".gz");
|
|
6113
|
+
if (verbose)
|
|
6114
|
+
console.info(`Input: ${input} (${isGzipped ? "gzipped" : "plain"})`);
|
|
6115
|
+
if (verbose)
|
|
6116
|
+
console.info(`Output: ${output}`);
|
|
6117
|
+
const fileStream = (0, import_fs7.createReadStream)(input);
|
|
6118
|
+
const inputStream = isGzipped ? fileStream.pipe((0, import_zlib2.createGunzip)()) : fileStream;
|
|
6119
|
+
let removed = 0;
|
|
6120
|
+
const cleanStream = removeRDFStar(inputStream, (count) => {
|
|
6121
|
+
removed = count;
|
|
6122
|
+
if (verbose && count % 1e3 === 0) {
|
|
6123
|
+
console.info(`Removed RDF-star triples so far: ${count}`);
|
|
6124
|
+
}
|
|
6125
|
+
});
|
|
6126
|
+
const writeStream = (0, import_fs7.createWriteStream)(output);
|
|
6127
|
+
if (isGzipped) {
|
|
6128
|
+
const gzip = (0, import_zlib2.createGzip)();
|
|
6129
|
+
gzip.pipe(writeStream);
|
|
6130
|
+
for await (const chunk of cleanStream) {
|
|
6131
|
+
gzip.write(chunk);
|
|
6132
|
+
}
|
|
6133
|
+
gzip.end();
|
|
6134
|
+
await new Promise((resolve2, reject) => {
|
|
6135
|
+
writeStream.on("finish", resolve2);
|
|
6136
|
+
writeStream.on("error", reject);
|
|
6137
|
+
gzip.on("error", reject);
|
|
6138
|
+
});
|
|
6139
|
+
} else {
|
|
6140
|
+
for await (const chunk of cleanStream) {
|
|
6141
|
+
writeStream.write(chunk);
|
|
6142
|
+
}
|
|
6143
|
+
writeStream.end();
|
|
6144
|
+
await new Promise((resolve2, reject) => {
|
|
6145
|
+
writeStream.on("finish", resolve2);
|
|
6146
|
+
writeStream.on("error", reject);
|
|
6147
|
+
});
|
|
6148
|
+
}
|
|
6149
|
+
console.info(`Done. Removed ${removed} RDF-star triple(s). Output written to: ${output}`);
|
|
6150
|
+
}
|
|
6151
|
+
|
|
6009
6152
|
// apps/desktop/cue-cli/src/main.ts
|
|
6010
6153
|
var packageJson;
|
|
6011
6154
|
try {
|
|
6012
|
-
packageJson = JSON.parse((0,
|
|
6155
|
+
packageJson = JSON.parse((0, import_fs8.readFileSync)((0, import_path5.join)(__dirname, "package.json"), "utf8"));
|
|
6013
6156
|
} catch {
|
|
6014
6157
|
try {
|
|
6015
|
-
packageJson = JSON.parse((0,
|
|
6158
|
+
packageJson = JSON.parse((0, import_fs8.readFileSync)((0, import_path5.join)(__dirname, "../package.json"), "utf8"));
|
|
6016
6159
|
} catch {
|
|
6017
6160
|
packageJson = { version: "0.0.0" };
|
|
6018
6161
|
console.warn("Could not find package.json, using fallback version");
|
|
@@ -6025,4 +6168,5 @@ program.command("dump").description("Dump Cue Knowledge Graph data to file\n
|
|
|
6025
6168
|
program.command("compare").description("Compares folder content to files already updated to Cue").requiredOption("-s, --space <id>", "Specify the space ID (required)").requiredOption("-p, --path <id>", "Specify the folder path (required)").option("-k, --key <api-key>", "Specify the API key (or set CUE_API_KEY env variable)").option("--provider <provider ID>", "Specify the provider ID (eg. sharepoint, drive, dropbox) or leave empty for default provider", "").option("-v, --verbose", "Enable verbose output", false).option("-e, --emulators", "Uses emulators for sync", false).option("-z, --zip", "Include zipped content (will temporarily unzip files with same logic as when syncing and delete them again after the comparison)", false).action(compareHandler);
|
|
6026
6169
|
program.command("dump-processed").description("Dump processed files to local folder").requiredOption("-s, --space <id>", "Specify the space ID (required)").requiredOption("-p, --processor <id>", "Id of the processor to dump processed files from (required) [eg. writers-blob, processors-cad-files]").option("-k, --key <api-key>", "Specify the API key (or set CUE_API_KEY env variable)").option("-v, --verbose", "Enable verbose output", false).option("-e, --emulators", "Uses emulators for sync", false).action(dumpProcessedHandler);
|
|
6027
6170
|
program.command("repair-ttl").description("Repair TTL files in the specified space").requiredOption("-s, --space <id>", "Specify the space ID (required)").requiredOption("-p, --processor <id>", "Id of the processor to repair TTL files (required) [eg. writers-blob, processors-cad-files]").requiredOption("-f, --from <subString>", "Substring (Regex) to replace in the TTL file (required)").requiredOption("-t, --to <substituteString>", "Substring to replace in the TTL file (required)").option("-k, --key <api-key>", "Specify the API key (or set CUE_API_KEY env variable)").option("-v, --verbose", "Enable verbose output", false).option("-e, --emulators", "Uses emulators for sync", false).action(repairTtlHandler);
|
|
6171
|
+
program.command("util-remove-rdf-star").description("Remove RDF-star (quoted) triples from an NQuads file. Supports .nq and .nq.gz input/output.").requiredOption("-i, --input <path>", "Input file path (.nq or .nq.gz)").requiredOption("-o, --output <path>", "Output file path (.nq or .nq.gz)").option("-v, --verbose", "Enable verbose output", false).action(utilRemoveRdfStarHandler);
|
|
6028
6172
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qaecy/cue-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Cue CLI for QAECY platform",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"jsonld": "8.3.3",
|
|
21
21
|
"jszip": "3.10.1",
|
|
22
22
|
"n3": "1.26.0",
|
|
23
|
-
"oxigraph": "0.5.
|
|
23
|
+
"oxigraph": "0.5.3",
|
|
24
24
|
"protobufjs": "7.5.4",
|
|
25
25
|
"spark-md5": "3.0.2",
|
|
26
26
|
"sparqljs": "3.7.3",
|
|
27
27
|
"tslib": "2.3.0",
|
|
28
28
|
"uuid": "9.0.0",
|
|
29
|
-
"axios": "1.13.
|
|
29
|
+
"axios": "1.13.2"
|
|
30
30
|
},
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=18"
|
package/readme.md
CHANGED
|
@@ -32,3 +32,17 @@ To sync the current dir to the space with id `<space-id>` under the provider id
|
|
|
32
32
|
| `-v, --verbose` | Enable verbose output | `false` |
|
|
33
33
|
| `-e, --emulators` | Use emulators for sync | `false` |
|
|
34
34
|
| `-z, --zip` | Include zipped content. Will be unzipped to `<zip_path>_unzipped`. Max uncompressed size: 500 MB, max recursion depth: 3. Cleans up unzipped files after sync. | `false` |
|
|
35
|
+
|
|
36
|
+
### util-remove-rdf-star
|
|
37
|
+
|
|
38
|
+
Remove RDF-star (quoted triple) statements from an NQuads file. Supports both plain `.nq` and gzipped `.nq.gz` files. If the input is gzipped the output will also be gzipped.
|
|
39
|
+
|
|
40
|
+
`npx @qaecy/cue-cli util-remove-rdf-star -i <input.nq.gz> -o <output.nq.gz> -v`
|
|
41
|
+
|
|
42
|
+
#### Options
|
|
43
|
+
|
|
44
|
+
| Option | Description | Default |
|
|
45
|
+
|----------------------|-----------------------------------------|---------|
|
|
46
|
+
| `-i, --input <path>` | Input file path (`.nq` or `.nq.gz`) (required) | N/A |
|
|
47
|
+
| `-o, --output <path>`| Output file path (`.nq` or `.nq.gz`) (required) | N/A |
|
|
48
|
+
| `-v, --verbose` | Enable verbose output | `false` |
|