@wraps.dev/cli 2.18.1 → 2.18.2

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
@@ -3245,10 +3245,11 @@ var init_cloudflare = __esm({
3245
3245
  return response.json();
3246
3246
  }
3247
3247
  async createRecord(name, type, content, priority) {
3248
+ const recordContent = type === "TXT" ? `"${content}"` : content;
3248
3249
  const body = {
3249
3250
  name,
3250
3251
  type,
3251
- content,
3252
+ content: recordContent,
3252
3253
  ttl: 1800,
3253
3254
  proxied: false
3254
3255
  // Must not be proxied for email records
@@ -9694,7 +9695,7 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
9694
9695
  import { join as join21 } from "path";
9695
9696
  import { Readable } from "stream";
9696
9697
  import { pipeline } from "stream/promises";
9697
- import { cancel as cancel29, confirm as confirm25, intro as intro50, isCancel as isCancel34, log as log49 } from "@clack/prompts";
9698
+ import { cancel as cancel30, confirm as confirm25, intro as intro50, isCancel as isCancel34, log as log49 } from "@clack/prompts";
9698
9699
  import pc57 from "picocolors";
9699
9700
  function isStandaloneInstall() {
9700
9701
  return process.execPath.includes(".wraps/runtime");
@@ -9757,7 +9758,7 @@ async function update(currentVersion) {
9757
9758
  message: `Update to v${latestVersion}?`
9758
9759
  });
9759
9760
  if (isCancel34(shouldUpdate) || !shouldUpdate) {
9760
- cancel29("Update cancelled.");
9761
+ cancel30("Update cancelled.");
9761
9762
  return;
9762
9763
  }
9763
9764
  const { platform: platform2, arch } = detectPlatformArch();
@@ -18994,6 +18995,7 @@ init_events();
18994
18995
  init_aws();
18995
18996
  init_fs();
18996
18997
  init_json_output();
18998
+ init_metadata();
18997
18999
  init_output();
18998
19000
  init_scanner();
18999
19001
  import { DeleteTableCommand, DynamoDBClient as DynamoDBClient2 } from "@aws-sdk/client-dynamodb";
@@ -19105,7 +19107,29 @@ async function emailDoctor(options) {
19105
19107
  "Validating AWS credentials",
19106
19108
  async () => validateAWSCredentials()
19107
19109
  );
19108
- const region = options.region || await getAWSRegion();
19110
+ let region = options.region || await getAWSRegion();
19111
+ if (!(options.region || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION)) {
19112
+ const emailConnections = await findConnectionsWithService(
19113
+ identity.accountId,
19114
+ "email"
19115
+ );
19116
+ if (emailConnections.length === 1) {
19117
+ region = emailConnections[0].region;
19118
+ } else if (emailConnections.length > 1 && !isJsonMode()) {
19119
+ const selectedRegion = await clack19.select({
19120
+ message: "Multiple email deployments found. Which region?",
19121
+ options: emailConnections.map((conn) => ({
19122
+ value: conn.region,
19123
+ label: conn.region
19124
+ }))
19125
+ });
19126
+ if (clack19.isCancel(selectedRegion)) {
19127
+ clack19.cancel("Operation cancelled");
19128
+ process.exit(0);
19129
+ }
19130
+ region = selectedRegion;
19131
+ }
19132
+ }
19109
19133
  const scan = await progress.execute(
19110
19134
  "Scanning AWS resources",
19111
19135
  async () => scanAWSResources(region)
@@ -19120,9 +19144,8 @@ async function emailDoctor(options) {
19120
19144
  workDir: getPulumiWorkDir()
19121
19145
  });
19122
19146
  hasStack = true;
19123
- } catch (error) {
19124
- const isStackNotFound = error instanceof Error && error.message.includes("no stack named");
19125
- if (!isStackNotFound) throw error;
19147
+ } catch (_error) {
19148
+ hasStack = false;
19126
19149
  }
19127
19150
  progress.stop();
19128
19151
  const results = runResourceDiagnostics(wrapsResources, hasStack);
@@ -22420,19 +22443,16 @@ async function emailStatus(options) {
22420
22443
  workDir: getPulumiWorkDir()
22421
22444
  });
22422
22445
  stackOutputs = await stack.outputs();
22423
- } catch (error) {
22424
- if (error instanceof Error && (error.message.includes("no stack named") || error.message.includes("not found"))) {
22425
- progress.stop();
22426
- clack28.log.error("No email infrastructure found");
22427
- console.log(
22428
- `
22446
+ } catch (_error) {
22447
+ progress.stop();
22448
+ clack28.log.error("No email infrastructure found");
22449
+ console.log(
22450
+ `
22429
22451
  Run ${pc30.cyan("wraps email init")} to deploy email infrastructure.
22430
22452
  `
22431
- );
22432
- process.exit(1);
22433
- return;
22434
- }
22435
- throw error;
22453
+ );
22454
+ process.exit(1);
22455
+ return;
22436
22456
  }
22437
22457
  const domains = await listSESDomains(region);
22438
22458
  const { SESv2Client: SESv2Client9, GetEmailIdentityCommand: GetEmailIdentityCommand7 } = await import("@aws-sdk/client-sesv2");
@@ -28780,7 +28800,7 @@ import {
28780
28800
  IAMClient as IAMClient3,
28781
28801
  PutRolePolicyCommand
28782
28802
  } from "@aws-sdk/client-iam";
28783
- import { confirm as confirm17, intro as intro33, isCancel as isCancel23, log as log35, outro as outro20, select as select15 } from "@clack/prompts";
28803
+ import { confirm as confirm17, intro as intro33, isCancel as isCancel23, log as log35, outro as outro20, select as select16 } from "@clack/prompts";
28784
28804
  import * as pulumi22 from "@pulumi/pulumi";
28785
28805
  import pc40 from "picocolors";
28786
28806
  init_events();
@@ -29131,7 +29151,7 @@ async function resolveOrganization() {
29131
29151
  if (orgs.length === 1) {
29132
29152
  return orgs[0];
29133
29153
  }
29134
- const selected = await select15({
29154
+ const selected = await select16({
29135
29155
  message: "Which organization should this AWS account connect to?",
29136
29156
  options: orgs.map((org) => ({
29137
29157
  value: org.id,
@@ -29427,7 +29447,7 @@ Run ${pc40.cyan("wraps email init")} or ${pc40.cyan("wraps sms init")} first.
29427
29447
  log35.info(
29428
29448
  `Already connected to Wraps Platform (AWS Account: ${pc40.cyan(metadata.accountId)})`
29429
29449
  );
29430
- const action = await select15({
29450
+ const action = await select16({
29431
29451
  message: "What would you like to do?",
29432
29452
  options: [
29433
29453
  {