@wraps.dev/cli 2.18.1 → 2.18.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.
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
@@ -5978,8 +5979,15 @@ function displaySuccess(outputs) {
5978
5979
  clack8.outro(pc10.green("Email infrastructure deployed successfully!"));
5979
5980
  console.log(lines.join("\n"));
5980
5981
  if (outputs.dnsAutoCreated && outputs.domain) {
5982
+ const providerNames = {
5983
+ route53: "AWS Route53",
5984
+ vercel: "Vercel DNS",
5985
+ cloudflare: "Cloudflare",
5986
+ manual: "Manual"
5987
+ };
5988
+ const providerDisplay = providerNames[outputs.dnsProvider ?? "route53"] ?? "your DNS provider";
5981
5989
  clack8.note(
5982
- `DNS records (DKIM, SPF, DMARC) were automatically created in Route53 for ${pc10.cyan(
5990
+ `DNS records (DKIM, SPF, DMARC) were automatically created in ${providerDisplay} for ${pc10.cyan(
5983
5991
  outputs.domain
5984
5992
  )}.
5985
5993
 
@@ -9694,7 +9702,7 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
9694
9702
  import { join as join21 } from "path";
9695
9703
  import { Readable } from "stream";
9696
9704
  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";
9705
+ import { cancel as cancel30, confirm as confirm25, intro as intro50, isCancel as isCancel34, log as log49 } from "@clack/prompts";
9698
9706
  import pc57 from "picocolors";
9699
9707
  function isStandaloneInstall() {
9700
9708
  return process.execPath.includes(".wraps/runtime");
@@ -9757,7 +9765,7 @@ async function update(currentVersion) {
9757
9765
  message: `Update to v${latestVersion}?`
9758
9766
  });
9759
9767
  if (isCancel34(shouldUpdate) || !shouldUpdate) {
9760
- cancel29("Update cancelled.");
9768
+ cancel30("Update cancelled.");
9761
9769
  return;
9762
9770
  }
9763
9771
  const { platform: platform2, arch } = detectPlatformArch();
@@ -18994,6 +19002,7 @@ init_events();
18994
19002
  init_aws();
18995
19003
  init_fs();
18996
19004
  init_json_output();
19005
+ init_metadata();
18997
19006
  init_output();
18998
19007
  init_scanner();
18999
19008
  import { DeleteTableCommand, DynamoDBClient as DynamoDBClient2 } from "@aws-sdk/client-dynamodb";
@@ -19105,7 +19114,29 @@ async function emailDoctor(options) {
19105
19114
  "Validating AWS credentials",
19106
19115
  async () => validateAWSCredentials()
19107
19116
  );
19108
- const region = options.region || await getAWSRegion();
19117
+ let region = options.region || await getAWSRegion();
19118
+ if (!(options.region || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION)) {
19119
+ const emailConnections = await findConnectionsWithService(
19120
+ identity.accountId,
19121
+ "email"
19122
+ );
19123
+ if (emailConnections.length === 1) {
19124
+ region = emailConnections[0].region;
19125
+ } else if (emailConnections.length > 1 && !isJsonMode()) {
19126
+ const selectedRegion = await clack19.select({
19127
+ message: "Multiple email deployments found. Which region?",
19128
+ options: emailConnections.map((conn) => ({
19129
+ value: conn.region,
19130
+ label: conn.region
19131
+ }))
19132
+ });
19133
+ if (clack19.isCancel(selectedRegion)) {
19134
+ clack19.cancel("Operation cancelled");
19135
+ process.exit(0);
19136
+ }
19137
+ region = selectedRegion;
19138
+ }
19139
+ }
19109
19140
  const scan = await progress.execute(
19110
19141
  "Scanning AWS resources",
19111
19142
  async () => scanAWSResources(region)
@@ -19120,9 +19151,8 @@ async function emailDoctor(options) {
19120
19151
  workDir: getPulumiWorkDir()
19121
19152
  });
19122
19153
  hasStack = true;
19123
- } catch (error) {
19124
- const isStackNotFound = error instanceof Error && error.message.includes("no stack named");
19125
- if (!isStackNotFound) throw error;
19154
+ } catch (_error) {
19155
+ hasStack = false;
19126
19156
  }
19127
19157
  progress.stop();
19128
19158
  const results = runResourceDiagnostics(wrapsResources, hasStack);
@@ -22076,6 +22106,7 @@ ${pc28.yellow(pc28.bold("Configuration Warnings:"))}`);
22076
22106
  tableName: outputs.tableName,
22077
22107
  dnsRecords: void 0,
22078
22108
  dnsAutoCreated,
22109
+ dnsProvider,
22079
22110
  domain: outputs.domain,
22080
22111
  mailFromDomain: outputs.mailFromDomain
22081
22112
  });
@@ -22420,19 +22451,16 @@ async function emailStatus(options) {
22420
22451
  workDir: getPulumiWorkDir()
22421
22452
  });
22422
22453
  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
- `
22454
+ } catch (_error) {
22455
+ progress.stop();
22456
+ clack28.log.error("No email infrastructure found");
22457
+ console.log(
22458
+ `
22429
22459
  Run ${pc30.cyan("wraps email init")} to deploy email infrastructure.
22430
22460
  `
22431
- );
22432
- process.exit(1);
22433
- return;
22434
- }
22435
- throw error;
22461
+ );
22462
+ process.exit(1);
22463
+ return;
22436
22464
  }
22437
22465
  const domains = await listSESDomains(region);
22438
22466
  const { SESv2Client: SESv2Client9, GetEmailIdentityCommand: GetEmailIdentityCommand7 } = await import("@aws-sdk/client-sesv2");
@@ -28780,7 +28808,7 @@ import {
28780
28808
  IAMClient as IAMClient3,
28781
28809
  PutRolePolicyCommand
28782
28810
  } 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";
28811
+ import { confirm as confirm17, intro as intro33, isCancel as isCancel23, log as log35, outro as outro20, select as select16 } from "@clack/prompts";
28784
28812
  import * as pulumi22 from "@pulumi/pulumi";
28785
28813
  import pc40 from "picocolors";
28786
28814
  init_events();
@@ -29131,7 +29159,7 @@ async function resolveOrganization() {
29131
29159
  if (orgs.length === 1) {
29132
29160
  return orgs[0];
29133
29161
  }
29134
- const selected = await select15({
29162
+ const selected = await select16({
29135
29163
  message: "Which organization should this AWS account connect to?",
29136
29164
  options: orgs.map((org) => ({
29137
29165
  value: org.id,
@@ -29427,7 +29455,7 @@ Run ${pc40.cyan("wraps email init")} or ${pc40.cyan("wraps sms init")} first.
29427
29455
  log35.info(
29428
29456
  `Already connected to Wraps Platform (AWS Account: ${pc40.cyan(metadata.accountId)})`
29429
29457
  );
29430
- const action = await select15({
29458
+ const action = await select16({
29431
29459
  message: "What would you like to do?",
29432
29460
  options: [
29433
29461
  {