@wraps.dev/cli 3.7.0 → 3.8.0

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
@@ -27936,6 +27936,30 @@ function displayStatus(status2) {
27936
27936
  `${pc10.bold("Integration:")} ${pc10.cyan(status2.integrationLevel)}`,
27937
27937
  `${pc10.bold("Region:")} ${pc10.cyan(status2.region)}`
27938
27938
  ];
27939
+ if (status2.sending) {
27940
+ const { sandbox, sandboxUncertain } = status2.sending;
27941
+ if (sandboxUncertain) {
27942
+ infoLines.push(
27943
+ `${pc10.bold("Sending:")} ${pc10.yellow("could not determine (SES unreachable)")}`
27944
+ );
27945
+ } else if (sandbox) {
27946
+ infoLines.push(
27947
+ `${pc10.bold("Sending:")} ${pc10.yellow("SANDBOX")} ${pc10.dim("\u2014 you can only send to verified addresses")}`
27948
+ );
27949
+ } else {
27950
+ infoLines.push(`${pc10.bold("Sending:")} ${pc10.green("production")}`);
27951
+ }
27952
+ if (status2.sending.sentLast24Hours !== void 0 || status2.sending.max24HourSend !== void 0 || status2.sending.maxSendRate !== void 0) {
27953
+ infoLines.push(
27954
+ `${pc10.bold("Quota:")} ${pc10.cyan(`${status2.sending.sentLast24Hours ?? 0}/${status2.sending.max24HourSend ?? 0}`)} sent (24h) ${pc10.dim(`\xB7 max rate ${status2.sending.maxSendRate ?? 0}/s`)}`
27955
+ );
27956
+ }
27957
+ }
27958
+ if (status2.cloudFormationStacks && status2.cloudFormationStacks.length > 0) {
27959
+ infoLines.push(
27960
+ `${pc10.bold("CloudFormation stacks:")} ${pc10.cyan(status2.cloudFormationStacks.join(", "))}`
27961
+ );
27962
+ }
27939
27963
  if (status2.domains.length > 0) {
27940
27964
  const PURPOSE_DISPLAY = {
27941
27965
  transactional: "Transactional",
@@ -51799,6 +51823,7 @@ async function emailStatus(options) {
51799
51823
  }
51800
51824
  }
51801
51825
  let stackOutputs = {};
51826
+ let cloudFormationStacks;
51802
51827
  try {
51803
51828
  await ensurePulumiWorkDir({ accountId: identity.accountId, region });
51804
51829
  const stack = await pulumi24.automation.LocalWorkspace.selectStack({
@@ -51807,17 +51832,32 @@ async function emailStatus(options) {
51807
51832
  });
51808
51833
  stackOutputs = await stack.outputs();
51809
51834
  } catch (_error) {
51810
- progress.stop();
51811
- clack35.log.error("No email infrastructure found");
51812
- console.log(
51813
- `
51835
+ const cfCheck = await findWrapsCloudFormationStacks(region);
51836
+ if (cfCheck.checked && cfCheck.stacks.length > 0) {
51837
+ cloudFormationStacks = cfCheck.stacks;
51838
+ } else {
51839
+ progress.stop();
51840
+ clack35.log.error("No email infrastructure found");
51841
+ if (!cfCheck.checked) {
51842
+ console.log(
51843
+ pc37.dim(
51844
+ "\nCould not check for CloudFormation stacks (missing cloudformation:DescribeStacks).\n"
51845
+ )
51846
+ );
51847
+ }
51848
+ console.log(
51849
+ `
51814
51850
  Run ${pc37.cyan("wraps email init")} to deploy email infrastructure.
51815
51851
  `
51816
- );
51817
- process.exit(1);
51818
- return;
51852
+ );
51853
+ process.exit(1);
51854
+ return;
51855
+ }
51819
51856
  }
51820
- const domains = await listSESDomains(region);
51857
+ const [domains, sesAccountStatus] = await Promise.all([
51858
+ listSESDomains(region),
51859
+ getSESAccountStatus(region)
51860
+ ]);
51821
51861
  const { SESv2Client: SESv2Client12, GetEmailIdentityCommand: GetEmailIdentityCommand7 } = await import("@aws-sdk/client-sesv2");
51822
51862
  const sesv2Client = new SESv2Client12({ region });
51823
51863
  const metadata = await loadConnectionMetadata(identity.accountId, region);
@@ -51880,7 +51920,16 @@ Run ${pc37.cyan("wraps email init")} to deploy email infrastructure.
51880
51920
  customTrackingDomain: stackOutputs.customTrackingDomain?.value,
51881
51921
  httpsEnabled: stackOutputs.httpsTrackingEnabled?.value,
51882
51922
  cloudFrontDomain: stackOutputs.cloudFrontDomain?.value
51883
- } : void 0
51923
+ } : void 0,
51924
+ sending: {
51925
+ sandbox: sesAccountStatus.isSandbox,
51926
+ sandboxUncertain: sesAccountStatus.sandboxUncertain ?? false,
51927
+ max24HourSend: sesAccountStatus.sendQuota?.max24HourSend,
51928
+ maxSendRate: sesAccountStatus.sendQuota?.maxSendRate,
51929
+ sentLast24Hours: sesAccountStatus.sendQuota?.sentLast24Hours,
51930
+ enforcementStatus: sesAccountStatus.enforcementStatus
51931
+ },
51932
+ cloudFormationStacks
51884
51933
  };
51885
51934
  if (isJsonMode()) {
51886
51935
  jsonSuccess("email.status", statusData);
@@ -52734,6 +52783,32 @@ import { join as join14 } from "path";
52734
52783
 
52735
52784
  // ../template-render/src/mustache-case.ts
52736
52785
  init_esm_shims();
52786
+ var HANDLEBARS_BLOCK_HELPERS = /* @__PURE__ */ new Set(["if", "unless", "each", "with"]);
52787
+ function normalizePlainTextMustaches(text14, canonicalVars) {
52788
+ const canonicalByLower = /* @__PURE__ */ new Map();
52789
+ for (const name of canonicalVars) {
52790
+ canonicalByLower.set(name.toLowerCase(), name);
52791
+ }
52792
+ function restoreIdentifier(name) {
52793
+ return canonicalByLower.get(name.toLowerCase()) ?? name;
52794
+ }
52795
+ return text14.replace(
52796
+ /\{\{([#/]?)([A-Z][A-Z0-9_]*(?:\.[A-Z0-9_]+)*)((?:\s+[A-Z0-9_.]+)*)\s*\}\}/g,
52797
+ (match, sigil, name, args) => {
52798
+ const lower = name.toLowerCase();
52799
+ const isHelper = lower === "else" || HANDLEBARS_BLOCK_HELPERS.has(lower);
52800
+ const restoredArgs = args.split(/\s+/).filter(Boolean).map(restoreIdentifier).join(" ");
52801
+ if (isHelper) {
52802
+ const suffix = restoredArgs ? ` ${restoredArgs}` : "";
52803
+ return `{{${sigil}${lower}${suffix}}}`;
52804
+ }
52805
+ if (!args && canonicalByLower.has(lower)) {
52806
+ return `{{${sigil}${canonicalByLower.get(lower)}}}`;
52807
+ }
52808
+ return match;
52809
+ }
52810
+ );
52811
+ }
52737
52812
  function toSesVariableName(name) {
52738
52813
  if (!name.includes(".")) {
52739
52814
  return name;
@@ -53207,37 +53282,6 @@ import pc40 from "picocolors";
53207
53282
 
53208
53283
  // src/utils/email/template-render.ts
53209
53284
  init_esm_shims();
53210
-
53211
- // src/utils/email/template-mustache-case.ts
53212
- init_esm_shims();
53213
- var HANDLEBARS_BLOCK_HELPERS = /* @__PURE__ */ new Set(["if", "unless", "each", "with"]);
53214
- function normalizePlainTextMustaches(text14, canonicalVars) {
53215
- const canonicalByLower = /* @__PURE__ */ new Map();
53216
- for (const name of canonicalVars) {
53217
- canonicalByLower.set(name.toLowerCase(), name);
53218
- }
53219
- function restoreIdentifier(name) {
53220
- return canonicalByLower.get(name.toLowerCase()) ?? name;
53221
- }
53222
- return text14.replace(
53223
- /\{\{([#/]?)([A-Z][A-Z0-9_]*(?:\.[A-Z0-9_]+)*)((?:\s+[A-Z0-9_.]+)*)\s*\}\}/g,
53224
- (match, sigil, name, args) => {
53225
- const lower = name.toLowerCase();
53226
- const isHelper = lower === "else" || HANDLEBARS_BLOCK_HELPERS.has(lower);
53227
- const restoredArgs = args.split(/\s+/).filter(Boolean).map(restoreIdentifier).join(" ");
53228
- if (isHelper) {
53229
- const suffix = restoredArgs ? ` ${restoredArgs}` : "";
53230
- return `{{${sigil}${lower}${suffix}}}`;
53231
- }
53232
- if (!args && canonicalByLower.has(lower)) {
53233
- return `{{${sigil}${canonicalByLower.get(lower)}}}`;
53234
- }
53235
- return match;
53236
- }
53237
- );
53238
- }
53239
-
53240
- // src/utils/email/template-render.ts
53241
53285
  async function renderTemplateWithProxy(Component) {
53242
53286
  const accessedProps = /* @__PURE__ */ new Set();
53243
53287
  const props = new Proxy({}, {