ardent-cli 0.0.27 → 0.0.28

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1319,7 +1319,7 @@ async function listAction2() {
1319
1319
  }
1320
1320
 
1321
1321
  // src/commands/connector/delete.ts
1322
- async function deleteAction2(name) {
1322
+ async function deleteAction2(name, options = {}) {
1323
1323
  const cached = getCacheEntry("connectors");
1324
1324
  let connector = cached?.data.find((c) => c.name === name);
1325
1325
  if (!connector) {
@@ -1344,13 +1344,15 @@ async function deleteAction2(name) {
1344
1344
  }
1345
1345
  try {
1346
1346
  console.log("Deleting connector...");
1347
- await api.delete(`/v1/connectors/${connector.id}`);
1347
+ const force = options.force ?? false;
1348
+ const path = force ? `/v1/connectors/${connector.id}?force=true` : `/v1/connectors/${connector.id}`;
1349
+ await api.delete(path);
1348
1350
  const currentCache = getCacheEntry("connectors");
1349
1351
  if (currentCache?.data) {
1350
1352
  const updatedConnectors = currentCache.data.filter((c) => c.id !== connector.id);
1351
1353
  setCacheEntry("connectors", updatedConnectors);
1352
1354
  }
1353
- trackEvent("CLI: connector delete succeeded");
1355
+ trackEvent("CLI: connector delete succeeded", { force });
1354
1356
  console.log("\u2713 Connector deleted");
1355
1357
  } catch (err) {
1356
1358
  if (isNetworkError(err)) {
@@ -1367,8 +1369,15 @@ async function deleteAction2(name) {
1367
1369
  console.error(" \u2022 Upgrade your role to Admin");
1368
1370
  process.exit(1);
1369
1371
  }
1372
+ const message = err instanceof Error ? err.message : String(err);
1373
+ const isDrainRefusal = message.includes("Branch still has un-replicated changes") || typeof err === "object" && err !== null && "status" in err && err.status === 409;
1374
+ if (isDrainRefusal) {
1375
+ trackEvent("CLI: connector delete failed", { reason: "drain_refused" });
1376
+ console.error(`\u2717 ${message}`);
1377
+ process.exit(1);
1378
+ }
1370
1379
  trackEvent("CLI: connector delete failed", { reason: "api_error" });
1371
- console.error("\u2717 Failed:", err instanceof Error ? err.message : err);
1380
+ console.error("\u2717 Failed:", message);
1372
1381
  process.exit(1);
1373
1382
  }
1374
1383
  }
@@ -1549,7 +1558,10 @@ connectorCommand.command("switch <name>").description("Switch to a different con
1549
1558
  connectorCommand.command("retry-setup <name>").description(
1550
1559
  "Retry branching engine setup for a connector that didn't finish (status: configuration_verified or validating)"
1551
1560
  ).action(retrySetupAction);
1552
- connectorCommand.command("delete <name>").description("Delete a connector by name").action(deleteAction2);
1561
+ connectorCommand.command("delete <name>").description("Delete a connector by name").option(
1562
+ "--force",
1563
+ "Skip the in-flight WAL/Kafka drain wait. Any un-replicated changes are abandoned and recorded for operator triage."
1564
+ ).action(deleteAction2);
1553
1565
 
1554
1566
  // src/commands/invite/index.ts
1555
1567
  import { Command as Command3 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ardent-cli",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Git for Data infrastructure",
5
5
  "type": "module",
6
6
  "bin": {