@wraps.dev/cli 2.23.1 → 2.23.3

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.
Binary file
package/dist/cli.js CHANGED
@@ -528,6 +528,9 @@ function parsePulumiError(error) {
528
528
  if (message.includes("stack is currently locked")) {
529
529
  return { code: "STACK_LOCKED" };
530
530
  }
531
+ if (/ENOENT[:\s].*\bpulumi\b|spawn pulumi ENOENT/.test(message)) {
532
+ return { code: "NOT_INSTALLED" };
533
+ }
531
534
  return { code: "PULUMI_ERROR" };
532
535
  }
533
536
  function redactSensitiveValues(input) {
@@ -795,6 +798,8 @@ function pulumiErrorToWrapsError(code, iamAction, service, resourceName, resourc
795
798
  );
796
799
  case "STACK_LOCKED":
797
800
  return errors.stackLocked();
801
+ case "NOT_INSTALLED":
802
+ return errors.pulumiNotInstalled();
798
803
  case "SES_PERMISSION_DENIED":
799
804
  return errors.sesPermissionDenied(iamAction || "unknown");
800
805
  case "DYNAMODB_PERMISSION_DENIED":
@@ -5578,7 +5583,7 @@ __export(metadata_exports, {
5578
5583
  });
5579
5584
  import { randomBytes } from "crypto";
5580
5585
  import { existsSync as existsSync5 } from "fs";
5581
- import { readFile as readFile2, writeFile as writeFile3 } from "fs/promises";
5586
+ import { chmod as chmod2, readFile as readFile2, writeFile as writeFile3 } from "fs/promises";
5582
5587
  import { join as join6 } from "path";
5583
5588
  function getConnectionsDir() {
5584
5589
  return join6(getWrapsDir(), "connections");
@@ -5690,6 +5695,7 @@ async function saveConnectionMetadataLocal(metadata) {
5690
5695
  const metadataPath = getMetadataPath(metadata.accountId, metadata.region);
5691
5696
  const content = JSON.stringify(metadata, null, 2);
5692
5697
  await writeFile3(metadataPath, content, "utf-8");
5698
+ await chmod2(metadataPath, 384);
5693
5699
  }
5694
5700
  async function saveConnectionMetadata(metadata) {
5695
5701
  await ensureConnectionsDir();
@@ -5697,6 +5703,7 @@ async function saveConnectionMetadata(metadata) {
5697
5703
  try {
5698
5704
  const content = JSON.stringify(metadata, null, 2);
5699
5705
  await writeFile3(metadataPath, content, "utf-8");
5706
+ await chmod2(metadataPath, 384);
5700
5707
  } catch (error) {
5701
5708
  console.error(
5702
5709
  "Error saving connection metadata:",
@@ -8033,7 +8040,11 @@ async function createMailManagerArchive(config2) {
8033
8040
  );
8034
8041
  archiveArn = getResult.ArchiveArn;
8035
8042
  }
8036
- } catch {
8043
+ } catch (error) {
8044
+ const detail = error instanceof Error ? error.message : String(error);
8045
+ throw new Error(
8046
+ `Failed to list existing Mail Manager archives in ${region}: ${detail}`
8047
+ );
8037
8048
  }
8038
8049
  if (!archiveId) {
8039
8050
  for (let attempt = 1; attempt <= MAX_NAME_ATTEMPTS; attempt++) {
@@ -8059,7 +8070,8 @@ async function createMailManagerArchive(config2) {
8059
8070
  }
8060
8071
  break;
8061
8072
  } catch (error) {
8062
- if (error instanceof Error && error.name === "ConflictException" && attempt < MAX_NAME_ATTEMPTS) {
8073
+ const isConflict = error instanceof Error && (error.name === "ConflictException" || error.message.includes("ConflictException"));
8074
+ if (isConflict && attempt < MAX_NAME_ATTEMPTS) {
8063
8075
  continue;
8064
8076
  }
8065
8077
  throw error;
@@ -34300,6 +34312,13 @@ async function selfhostDestroy(options) {
34300
34312
  process.exit(0);
34301
34313
  }
34302
34314
  }
34315
+ const wasAutoInstalled = await progress.execute(
34316
+ "Checking Pulumi CLI installation",
34317
+ async () => await ensurePulumiInstalled()
34318
+ );
34319
+ if (wasAutoInstalled) {
34320
+ progress.info("Pulumi CLI was automatically installed");
34321
+ }
34303
34322
  await progress.execute(
34304
34323
  "Destroying self-hosted infrastructure (this may take 2-3 minutes)",
34305
34324
  async () => {