@erdoai/cli 0.101.1 → 0.102.0
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/dist/index.js +32 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6366,20 +6366,39 @@ datasetsCmd.command("from-integration <app>").description("Create a dataset back
|
|
|
6366
6366
|
fail(e);
|
|
6367
6367
|
}
|
|
6368
6368
|
});
|
|
6369
|
-
datasetsCmd.command("configure-integration <dataset-id>").description(
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6369
|
+
datasetsCmd.command("configure-integration <dataset-id>").description(
|
|
6370
|
+
"Set an integration dataset's segment scope and enable canonical sync, or --disable-sync to retire a superseded/stale synced dataset (tears down the warehouse copy and stops it being read or monitored; reversible with --enable-sync)"
|
|
6371
|
+
).option("-s, --segments <csv>", "segment names or ids (see: erdo integrations tables <app>)").option(
|
|
6372
|
+
"--enable-sync",
|
|
6373
|
+
"enable canonical data-platform sync; on its own it restores a retired sync and keeps the saved segment scope"
|
|
6374
|
+
).option(
|
|
6375
|
+
"--disable-sync",
|
|
6376
|
+
"tear down the canonical data-platform sync \u2014 retire a superseded or stale synced dataset; ignores --segments"
|
|
6377
|
+
).action(
|
|
6378
|
+
async (datasetID, opts) => {
|
|
6379
|
+
try {
|
|
6380
|
+
if (opts.enableSync && opts.disableSync) {
|
|
6381
|
+
fail("Pass either --enable-sync or --disable-sync, not both");
|
|
6382
|
+
return;
|
|
6383
|
+
}
|
|
6384
|
+
if (!opts.disableSync && !opts.enableSync && !opts.segments) {
|
|
6385
|
+
fail("--segments is required unless you pass --enable-sync or --disable-sync");
|
|
6386
|
+
return;
|
|
6387
|
+
}
|
|
6388
|
+
const segments = (opts.segments ?? "").split(",").map((segment) => segment.trim()).filter(Boolean);
|
|
6389
|
+
const result = await new ErdoClient().configureIntegrationDataset(datasetID, {
|
|
6390
|
+
segments,
|
|
6391
|
+
enable_sync: opts.enableSync,
|
|
6392
|
+
disable_sync: opts.disableSync
|
|
6393
|
+
});
|
|
6394
|
+
console.log(
|
|
6395
|
+
opts.disableSync ? `Retired sync for dataset ${result.dataset_id} (status: ${result.status}). Re-enable with --enable-sync.` : `Configured dataset ${result.dataset_id}, status: ${result.status}, sync: ${result.sync_enabled ? "enabled" : "unchanged"}`
|
|
6396
|
+
);
|
|
6397
|
+
} catch (e) {
|
|
6398
|
+
fail(e);
|
|
6399
|
+
}
|
|
6381
6400
|
}
|
|
6382
|
-
|
|
6401
|
+
);
|
|
6383
6402
|
var refreshCmd = datasetsCmd.command("refresh").description(
|
|
6384
6403
|
"The recipe that keeps a dataset current, and the triggers that run it \u2014 read it with `show`, install or replace it with `set`, and run it once now with `run`"
|
|
6385
6404
|
);
|