@qaecy/cue-cli 0.0.37 → 0.0.38
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 +34 -2
- package/package.json +1 -1
- package/readme.md +2 -0
package/main.js
CHANGED
|
@@ -7820,6 +7820,27 @@ var CueSyncApi = class {
|
|
|
7820
7820
|
async initBrowserSync(spaceId) {
|
|
7821
7821
|
await this._initPendingBatch(spaceId);
|
|
7822
7822
|
}
|
|
7823
|
+
/**
|
|
7824
|
+
* Pushes filesystem-structure metadata for all provided files directly to the
|
|
7825
|
+
* commands API, without checking what is already on the remote or accounting for
|
|
7826
|
+
* credits. Use this when you want to force-write metadata for every file in a
|
|
7827
|
+
* local path (e.g. to repair missing graph data after a migration).
|
|
7828
|
+
*/
|
|
7829
|
+
async pushAllMetadata(localFiles, options) {
|
|
7830
|
+
this._legacy = options.legacy ?? false;
|
|
7831
|
+
const items = localFiles.map((f) => ({
|
|
7832
|
+
relativePath: f.relativePath,
|
|
7833
|
+
md5: f.md5,
|
|
7834
|
+
size: f.size,
|
|
7835
|
+
providerId: options.providerId,
|
|
7836
|
+
fileContentExists: false
|
|
7837
|
+
}));
|
|
7838
|
+
for (let i = 0; i < items.length; i += FSS_BATCH_CHUNK_SIZE) {
|
|
7839
|
+
await this._postFssBatch(items.slice(i, i + FSS_BATCH_CHUNK_SIZE), options.spaceId);
|
|
7840
|
+
}
|
|
7841
|
+
if (options.verbose)
|
|
7842
|
+
console.info(`Pushed metadata for ${items.length} file(s) \u2705`);
|
|
7843
|
+
}
|
|
7823
7844
|
/**
|
|
7824
7845
|
* Flushes any pending file-location metadata from a previously interrupted sync.
|
|
7825
7846
|
* Safe to call even when there are no new files to upload (e.g. when the process
|
|
@@ -9150,7 +9171,7 @@ function askConfirm(question) {
|
|
|
9150
9171
|
});
|
|
9151
9172
|
}
|
|
9152
9173
|
async function syncHandler(options) {
|
|
9153
|
-
const { space, path, verbose, provider, emulators, zip, legacy } = options;
|
|
9174
|
+
const { space, path, verbose, provider, emulators, zip, legacy, metadataOnly } = options;
|
|
9154
9175
|
try {
|
|
9155
9176
|
const cue = new CueNode({
|
|
9156
9177
|
apiKey: FIREBASE_CONFIG().apiKey,
|
|
@@ -9215,6 +9236,17 @@ async function syncHandler(options) {
|
|
|
9215
9236
|
}
|
|
9216
9237
|
if (verbose)
|
|
9217
9238
|
console.info("Authenticated \u2705\n");
|
|
9239
|
+
if (metadataOnly) {
|
|
9240
|
+
console.info(`Pushing metadata for ${localFiles.length} file(s) \u23F3`);
|
|
9241
|
+
await cue.api.sync.pushAllMetadata(localFiles, {
|
|
9242
|
+
spaceId: space,
|
|
9243
|
+
providerId: provider,
|
|
9244
|
+
verbose,
|
|
9245
|
+
legacy
|
|
9246
|
+
});
|
|
9247
|
+
console.info(`Pushed metadata for ${localFiles.length} file(s) \u2705`);
|
|
9248
|
+
process.exit(0);
|
|
9249
|
+
}
|
|
9218
9250
|
if (verbose)
|
|
9219
9251
|
console.info("Checking sync preview \u23F3");
|
|
9220
9252
|
const preview = await cue.api.sync.previewSync(localFiles, {
|
|
@@ -9493,7 +9525,7 @@ try {
|
|
|
9493
9525
|
}
|
|
9494
9526
|
var program = new import_commander.Command();
|
|
9495
9527
|
program.name("cue-cli").description("Cue Command Line Interface").version(packageJson.version);
|
|
9496
|
-
program.command("sync").description("Sync files 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 be unzipped to path "<zip_path>_unzipped". Max uncompressed size: 500 MB, max recursion depth: 3)', false).option("--legacy", "Write RDF as BLOBs to the processed bucket instead of patching the graph directly", false).action(syncHandler);
|
|
9528
|
+
program.command("sync").description("Sync files 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 be unzipped to path "<zip_path>_unzipped". Max uncompressed size: 500 MB, max recursion depth: 3)', false).option("--legacy", "Write RDF as BLOBs to the processed bucket instead of patching the graph directly", false).option("--metadata-only", "Push filesystem-structure metadata for all local files without checking credits or remote state", false).action(syncHandler);
|
|
9497
9529
|
program.command("dump").description("Dump Cue Knowledge Graph data to file\n Examples:\n $ cue-cli dump -s <space_id> -l -v\n $ cue-cli dump -s <space_id> -j -v").requiredOption("-s, --space <id>", "Specify the space ID (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).option("-q, --query", "Uses a construct query to get the dump rather than using the /data endpoint", false).option("-j, --jelly", "Downloads a Jelly file rather than the standard Gzipped NQuads format", false).option("-l, --load", "Loads the dumped file into a local triplestore (requires emulators)", false).action(dumpHandler);
|
|
9498
9530
|
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);
|
|
9499
9531
|
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);
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -32,6 +32,8 @@ 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
|
+
| `--legacy` | Write RDF metadata as serialised Turtle BLOBs to the processed storage bucket instead of patching the knowledge graph directly. Use this when the ledger and graph services are not yet available for the target environment. | `false` |
|
|
36
|
+
| `--metadata-only` | Push filesystem-structure metadata for every local file directly to the commands API, without checking what is already on the remote, running a credit estimate, or uploading any file content. Useful for repairing missing graph metadata after a migration or interrupted sync. Can be combined with `--legacy` to write the metadata as BLOBs. | `false` |
|
|
35
37
|
|
|
36
38
|
### util-remove-rdf-star
|
|
37
39
|
|