@settlemint/sdk-cli 2.4.0-pr0b5fc197 → 2.4.0-pr11c56f22

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/cli.js CHANGED
@@ -263840,7 +263840,7 @@ function pruneCurrentEnv(currentEnv, env2) {
263840
263840
  var package_default = {
263841
263841
  name: "@settlemint/sdk-cli",
263842
263842
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
263843
- version: "2.4.0-pr0b5fc197",
263843
+ version: "2.4.0-pr11c56f22",
263844
263844
  type: "module",
263845
263845
  private: false,
263846
263846
  license: "FSL-1.1-MIT",
@@ -263891,9 +263891,9 @@ var package_default = {
263891
263891
  "@inquirer/input": "4.1.12",
263892
263892
  "@inquirer/password": "4.0.15",
263893
263893
  "@inquirer/select": "4.2.3",
263894
- "@settlemint/sdk-js": "2.4.0-pr0b5fc197",
263895
- "@settlemint/sdk-utils": "2.4.0-pr0b5fc197",
263896
- "@settlemint/sdk-viem": "2.4.0-pr0b5fc197",
263894
+ "@settlemint/sdk-js": "2.4.0-pr11c56f22",
263895
+ "@settlemint/sdk-utils": "2.4.0-pr11c56f22",
263896
+ "@settlemint/sdk-viem": "2.4.0-pr11c56f22",
263897
263897
  "@types/node": "24.0.8",
263898
263898
  "@types/semver": "7.7.0",
263899
263899
  "@types/which": "3.0.4",
@@ -326488,6 +326488,9 @@ function addClusterServiceArgs(cmd2) {
326488
326488
  // src/commands/platform/utils/wait-for-completion.ts
326489
326489
  class TimeoutError2 extends Error {
326490
326490
  }
326491
+
326492
+ class DeploymentFailedError extends Error {
326493
+ }
326491
326494
  async function waitForCompletion({
326492
326495
  settlemint,
326493
326496
  type: type4,
@@ -326505,6 +326508,7 @@ async function waitForCompletion({
326505
326508
  if (!service || !("read" in service)) {
326506
326509
  throw new Error(`Service ${serviceType} does not support status checking`);
326507
326510
  }
326511
+ let hasRestarted = false;
326508
326512
  function showSpinner() {
326509
326513
  return spinner({
326510
326514
  startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
@@ -326517,8 +326521,7 @@ async function waitForCompletion({
326517
326521
  if (resource.status === "FAILED") {
326518
326522
  updateStatus(spinner2, `${capitalizeFirstLetter2(type4)} failed to ${getActionLabel(action)}`);
326519
326523
  if (restartOnError) {
326520
- note(`Restarting ${capitalizeFirstLetter2(type4)}`);
326521
- await service.restart(uniqueName);
326524
+ throw new DeploymentFailedError;
326522
326525
  }
326523
326526
  return false;
326524
326527
  }
@@ -326541,15 +326544,24 @@ async function waitForCompletion({
326541
326544
  try {
326542
326545
  return await showSpinner();
326543
326546
  } catch (error45) {
326544
- const isTimeoutError = error45 instanceof SpinnerError && error45.originalError instanceof TimeoutError2;
326545
- if (restartIfTimeout && isTimeoutError) {
326547
+ if (!hasRestarted && shouldRestart(error45, restartIfTimeout)) {
326546
326548
  note(`Restarting ${capitalizeFirstLetter2(type4)}`);
326549
+ hasRestarted = true;
326547
326550
  await service.restart(uniqueName);
326548
326551
  return showSpinner();
326549
326552
  }
326550
326553
  throw error45;
326551
326554
  }
326552
326555
  }
326556
+ function shouldRestart(error45, restartIfTimeout) {
326557
+ const isSpinnerError = error45 instanceof SpinnerError;
326558
+ const isDeploymentFailedError = error45 instanceof DeploymentFailedError || isSpinnerError && error45.originalError instanceof DeploymentFailedError;
326559
+ if (isDeploymentFailedError) {
326560
+ return true;
326561
+ }
326562
+ const isTimeoutError = error45 instanceof TimeoutError2 || isSpinnerError && error45.originalError instanceof TimeoutError2;
326563
+ return restartIfTimeout && isTimeoutError;
326564
+ }
326553
326565
  function updateStatus(spinner2, message) {
326554
326566
  if (spinner2) {
326555
326567
  spinner2.text = message;
@@ -330768,4 +330780,4 @@ async function sdkCliCommand(argv = process.argv) {
330768
330780
  // src/cli.ts
330769
330781
  sdkCliCommand();
330770
330782
 
330771
- //# debugId=9C9F3CE8DEEE8B9A64756E2164756E21
330783
+ //# debugId=8B8815AD805B488464756E2164756E21