@erdoai/cli 0.101.0 → 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 +43 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1087,10 +1087,12 @@ var ErdoClient = class {
|
|
|
1087
1087
|
return this.request("POST", "/v1/datasets-ensure", input);
|
|
1088
1088
|
}
|
|
1089
1089
|
// Correct which dataset carries a purpose. Pass `purpose` to set one,
|
|
1090
|
-
// `clear_purpose` to remove it
|
|
1091
|
-
//
|
|
1092
|
-
//
|
|
1093
|
-
//
|
|
1090
|
+
// `clear_purpose` to remove it. Setting a purpose another dataset carries is
|
|
1091
|
+
// an atomic MOVE — the old carrier is cleared in the same transaction — and
|
|
1092
|
+
// the response warns naming the dataset it moved from. Pass
|
|
1093
|
+
// `purpose_sibling: true` only to declare a deliberate parallel carrier (a
|
|
1094
|
+
// separate program a human chose to run), which leaves the other carriers
|
|
1095
|
+
// alone.
|
|
1094
1096
|
setDatasetPurpose(slug, input) {
|
|
1095
1097
|
return this.request("POST", `/v1/datasets/${encodeURIComponent(slug)}/schema`, input);
|
|
1096
1098
|
}
|
|
@@ -6152,8 +6154,11 @@ datasetsCmd.command("ensure <purpose>").description(
|
|
|
6152
6154
|
}
|
|
6153
6155
|
});
|
|
6154
6156
|
datasetsCmd.command("set-purpose <slug> [purpose]").description(
|
|
6155
|
-
"Set (or with --clear, remove) the dataset's purpose \u2014 the org-vocabulary role `datasets purposes` reports. Use it to CORRECT a purpose that names the wrong dataset: one purpose maps to one dataset per org, so a purpose left on the wrong one points everything that resolves through the vocabulary at the wrong rows.
|
|
6157
|
+
"Set (or with --clear, remove) the dataset's purpose \u2014 the org-vocabulary role `datasets purposes` reports. Use it to CORRECT a purpose that names the wrong dataset: one purpose maps to one dataset per org, so a purpose left on the wrong one points everything that resolves through the vocabulary at the wrong rows. Setting a purpose another dataset carries is an atomic MOVE: the old carrier is cleared in the same transaction, so one call on the right dataset lands it (the response says which dataset it moved from). Use --sibling only when deliberately running a parallel table for the same purpose."
|
|
6156
6158
|
).option("--clear", "remove the dataset's purpose instead of setting one").option(
|
|
6159
|
+
"--sibling",
|
|
6160
|
+
"declare this dataset a deliberate parallel carrier of the purpose (a separate program a human chose to run) instead of moving the purpose off other datasets"
|
|
6161
|
+
).option(
|
|
6157
6162
|
"--description <text>",
|
|
6158
6163
|
"description for a purpose new to this org; ignored when the org already has an entry for it"
|
|
6159
6164
|
).action(async (slug, purpose, opts) => {
|
|
@@ -6169,6 +6174,7 @@ datasetsCmd.command("set-purpose <slug> [purpose]").description(
|
|
|
6169
6174
|
const res = await new ErdoClient().setDatasetPurpose(slug, {
|
|
6170
6175
|
...purpose ? { purpose } : {},
|
|
6171
6176
|
...opts.clear ? { clear_purpose: true } : {},
|
|
6177
|
+
...opts.sibling ? { purpose_sibling: true } : {},
|
|
6172
6178
|
...opts.description ? { purpose_description: opts.description } : {}
|
|
6173
6179
|
});
|
|
6174
6180
|
for (const w of res.warnings ?? []) console.error(`warning: ${w}`);
|
|
@@ -6360,20 +6366,39 @@ datasetsCmd.command("from-integration <app>").description("Create a dataset back
|
|
|
6360
6366
|
fail(e);
|
|
6361
6367
|
}
|
|
6362
6368
|
});
|
|
6363
|
-
datasetsCmd.command("configure-integration <dataset-id>").description(
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
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
|
+
}
|
|
6375
6400
|
}
|
|
6376
|
-
|
|
6401
|
+
);
|
|
6377
6402
|
var refreshCmd = datasetsCmd.command("refresh").description(
|
|
6378
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`"
|
|
6379
6404
|
);
|