@wraps.dev/cli 3.6.1 → 3.7.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
@@ -44912,10 +44912,14 @@ async function putTrackingDomain(sesv22, configSetName, trackingDomain, httpsPol
44912
44912
  new PutConfigurationSetTrackingOptionsCommand({
44913
44913
  ConfigurationSetName: configSetName,
44914
44914
  CustomRedirectDomain: trackingDomain,
44915
- ...httpsPolicy ? { HttpsPolicy: httpsPolicy } : {}
44915
+ HttpsPolicy: httpsPolicy
44916
44916
  })
44917
44917
  );
44918
44918
  }
44919
+ function trackingHttpsPolicy(trackingHttps) {
44920
+ return trackingHttps?.status === "active" ? "REQUIRE" : "OPTIONAL";
44921
+ }
44922
+ var HTTP_TRACKING_CONSEQUENCE = "Until then, https:// links in your emails will show recipients a certificate warning when clicked.";
44919
44923
  async function clearTrackingDomain(region, configSetName) {
44920
44924
  const ses = new SESClient4({ region });
44921
44925
  await ses.send(
@@ -45902,7 +45906,12 @@ async function applyTrackingDomain(ctx, value) {
45902
45906
  const host = value.toLowerCase();
45903
45907
  let appliedAt;
45904
45908
  try {
45905
- await putTrackingDomain(ctx.sesClient, ctx.candidate.configSetName, host);
45909
+ await putTrackingDomain(
45910
+ ctx.sesClient,
45911
+ ctx.candidate.configSetName,
45912
+ host,
45913
+ trackingHttpsPolicy(ctx.candidate.trackingHttps)
45914
+ );
45906
45915
  appliedAt = (/* @__PURE__ */ new Date()).toISOString();
45907
45916
  } catch (error) {
45908
45917
  if (!isTrackingDomainNotReady(error)) {
@@ -46024,6 +46033,26 @@ async function applyTrackingHttps(ctx, enable) {
46024
46033
  validationRecordPushed: result.validationRecordPushed
46025
46034
  };
46026
46035
  }
46036
+ function reportTrackingHttpsEnabled(candidate, httpsResult, reopenHint) {
46037
+ if (candidate.trackingHttps?.status === "active") {
46038
+ clack24.log.success(
46039
+ `HTTPS active (${candidate.trackingHttps.distributionDomain})`
46040
+ );
46041
+ return;
46042
+ }
46043
+ clack24.log.info(
46044
+ pc26.dim(
46045
+ `Certificate validation usually takes 5\u201330 minutes. ${reopenHint} ${HTTP_TRACKING_CONSEQUENCE}`
46046
+ )
46047
+ );
46048
+ if (httpsResult.pendingValidationRecord) {
46049
+ clack24.log.info(
46050
+ `${httpsResult.validationRecordPushed ? "Certificate validation record (created for you):" : "Add this DNS record to validate the certificate:"}
46051
+ ${pc26.cyan(httpsResult.pendingValidationRecord.name)}
46052
+ Type: ${httpsResult.pendingValidationRecord.type} Value: ${httpsResult.pendingValidationRecord.value}`
46053
+ );
46054
+ }
46055
+ }
46027
46056
  async function applyFlagMode(args) {
46028
46057
  const {
46029
46058
  opensFlag,
@@ -46154,6 +46183,25 @@ async function applyFlagMode(args) {
46154
46183
  } else {
46155
46184
  clack24.log.success(`Tracking domain set to ${trackingDomainFlag}`);
46156
46185
  await offerTrackingCname(ctx, trackingDomainFlag.toLowerCase());
46186
+ if (trackingHttpsFlag === void 0) {
46187
+ try {
46188
+ const httpsResult = await applyTrackingHttps(ctx, true);
46189
+ reportTrackingHttpsEnabled(
46190
+ candidate,
46191
+ httpsResult,
46192
+ `Re-run ${pc26.cyan(`wraps email domains config --domain ${candidate.domain} --tracking-https`)} once it's ISSUED.`
46193
+ );
46194
+ } catch (error) {
46195
+ clack24.log.warn(
46196
+ `Could not enable HTTPS for tracking links: ${describeTrackingHttpsError(error)}`
46197
+ );
46198
+ clack24.log.info(
46199
+ pc26.dim(
46200
+ `Retry later with: ${pc26.cyan(`wraps email domains config --domain ${candidate.domain} --tracking-https`)}. ${HTTP_TRACKING_CONSEQUENCE}`
46201
+ )
46202
+ );
46203
+ }
46204
+ }
46157
46205
  }
46158
46206
  trackCommand("email:domains:config", {
46159
46207
  success: true,
@@ -46393,24 +46441,11 @@ async function applyInteractiveMode(args) {
46393
46441
  }
46394
46442
  httpsProgress.stop();
46395
46443
  if (enabling) {
46396
- if (candidate.trackingHttps?.status === "active") {
46397
- clack24.log.success(
46398
- `HTTPS active (${candidate.trackingHttps.distributionDomain})`
46399
- );
46400
- } else {
46401
- clack24.log.info(
46402
- pc26.dim(
46403
- "Certificate validation usually takes 5\u201330 minutes. Reopen this menu once it's ISSUED."
46404
- )
46405
- );
46406
- if (httpsResult.pendingValidationRecord) {
46407
- clack24.log.info(
46408
- `${httpsResult.validationRecordPushed ? "Certificate validation record (created for you):" : "Add this DNS record to validate the certificate:"}
46409
- ${pc26.cyan(httpsResult.pendingValidationRecord.name)}
46410
- Type: ${httpsResult.pendingValidationRecord.type} Value: ${httpsResult.pendingValidationRecord.value}`
46411
- );
46412
- }
46413
- }
46444
+ reportTrackingHttpsEnabled(
46445
+ candidate,
46446
+ httpsResult,
46447
+ "Reopen this menu once it's ISSUED."
46448
+ );
46414
46449
  } else {
46415
46450
  clack24.log.success("HTTPS disabled for tracking links");
46416
46451
  }
@@ -46441,6 +46476,34 @@ async function applyInteractiveMode(args) {
46441
46476
  `Tracking domain set to ${value.toLowerCase()}`
46442
46477
  );
46443
46478
  await offerTrackingCname(ctx, value.toLowerCase());
46479
+ if (!candidate.trackingHttps) {
46480
+ const wantsHttps = await clack24.confirm({
46481
+ message: `Enable HTTPS for tracking links? ${pc26.dim("(creates a CloudFront distribution + certificate in your account)")}`,
46482
+ initialValue: true
46483
+ });
46484
+ if (!clack24.isCancel(wantsHttps) && wantsHttps) {
46485
+ const setupHttpsProgress = new DeploymentProgress();
46486
+ try {
46487
+ const httpsResult = await setupHttpsProgress.execute(
46488
+ "Enabling HTTPS",
46489
+ async () => applyTrackingHttps(ctx, true)
46490
+ );
46491
+ setupHttpsProgress.stop();
46492
+ reportTrackingHttpsEnabled(
46493
+ candidate,
46494
+ httpsResult,
46495
+ "Reopen this menu once it's ISSUED."
46496
+ );
46497
+ } catch (error) {
46498
+ setupHttpsProgress.stop();
46499
+ if (error instanceof WrapsError) {
46500
+ clack24.log.error(error.message);
46501
+ } else {
46502
+ throw error;
46503
+ }
46504
+ }
46505
+ }
46506
+ }
46444
46507
  break;
46445
46508
  }
46446
46509
  case "delivery": {
@@ -46874,7 +46937,8 @@ async function verifyDomain(options) {
46874
46937
  await putTrackingDomain(
46875
46938
  sesClient,
46876
46939
  targetConfigSetName,
46877
- trackedEntry.trackingDomain
46940
+ trackedEntry.trackingDomain,
46941
+ trackingHttpsPolicy(trackedEntry.trackingHttps)
46878
46942
  );
46879
46943
  trackedEntry.trackingDomainAppliedAt = (/* @__PURE__ */ new Date()).toISOString();
46880
46944
  addDomainToMetadata(metadata, trackedEntry);
@@ -47263,7 +47327,12 @@ Run ${pc27.cyan("wraps email init")} first to deploy email infrastructure.
47263
47327
  if (trackingDomain) {
47264
47328
  await progress.execute("Setting custom tracking domain", async () => {
47265
47329
  try {
47266
- await putTrackingDomain(sesClient, configSetName, trackingDomain);
47330
+ await putTrackingDomain(
47331
+ sesClient,
47332
+ configSetName,
47333
+ trackingDomain,
47334
+ "OPTIONAL"
47335
+ );
47267
47336
  trackingDomainAppliedAt = (/* @__PURE__ */ new Date()).toISOString();
47268
47337
  } catch (error) {
47269
47338
  if (!isTrackingDomainNotReady(error)) throw error;
@@ -47317,7 +47386,7 @@ Run ${pc27.cyan("wraps email init")} first to deploy email infrastructure.
47317
47386
  );
47318
47387
  clack25.log.info(
47319
47388
  pc27.dim(
47320
- `Retry later with: ${pc27.cyan(`wraps email domains config --domain ${domain} --tracking-https`)}`
47389
+ `Retry later with: ${pc27.cyan(`wraps email domains config --domain ${domain} --tracking-https`)}. ${HTTP_TRACKING_CONSEQUENCE}`
47321
47390
  )
47322
47391
  );
47323
47392
  }
@@ -47325,7 +47394,7 @@ Run ${pc27.cyan("wraps email init")} first to deploy email infrastructure.
47325
47394
  if (trackingHttpsResult?.trackingHttps.status === "pending" && !isJsonMode()) {
47326
47395
  clack25.log.info(
47327
47396
  pc27.dim(
47328
- `Certificate validation usually takes 5\u201330 minutes. Then run: ${pc27.cyan(`wraps email domains config --domain ${domain} --tracking-https`)}`
47397
+ `Certificate validation usually takes 5\u201330 minutes. Then run: ${pc27.cyan(`wraps email domains config --domain ${domain} --tracking-https`)}. ${HTTP_TRACKING_CONSEQUENCE}`
47329
47398
  )
47330
47399
  );
47331
47400
  }
@@ -47512,6 +47581,7 @@ async function listDomains() {
47512
47581
  (identity) => identity.IdentityType === "DOMAIN" || identity.IdentityName && !identity.IdentityName.includes("@")
47513
47582
  );
47514
47583
  let trackedDomains = [];
47584
+ let trackingHttpsByDomain = /* @__PURE__ */ new Map();
47515
47585
  try {
47516
47586
  const awsIdentity = await validateAWSCredentials();
47517
47587
  const metadata = await loadConnectionMetadata(
@@ -47520,6 +47590,15 @@ async function listDomains() {
47520
47590
  );
47521
47591
  if (metadata) {
47522
47592
  trackedDomains = getAllTrackedDomains(metadata);
47593
+ const emailConfig = metadata.services.email?.config;
47594
+ trackingHttpsByDomain = new Map(
47595
+ (emailConfig?.additionalDomains ?? []).map(
47596
+ (d6) => [d6.domain, d6.trackingHttps]
47597
+ )
47598
+ );
47599
+ if (emailConfig?.domain && emailConfig.tracking?.httpsEnabled) {
47600
+ trackingHttpsByDomain.set(emailConfig.domain, { status: "active" });
47601
+ }
47523
47602
  }
47524
47603
  } catch {
47525
47604
  }
@@ -47574,7 +47653,8 @@ Run ${pc27.cyan("wraps email domains add")} to add a domain.
47574
47653
  managed: !!tracked,
47575
47654
  isPrimary: tracked?.isPrimary ?? false,
47576
47655
  purpose: tracked?.purpose,
47577
- trackingDomain: tracked?.trackingDomain ?? null
47656
+ trackingDomain: tracked?.trackingDomain ?? null,
47657
+ trackingHttps: trackingHttpsByDomain.get(d6.name)?.status ?? null
47578
47658
  };
47579
47659
  }),
47580
47660
  totalCount: sesDomains.length,
@@ -47588,7 +47668,7 @@ Run ${pc27.cyan("wraps email domains add")} to add a domain.
47588
47668
  const statusIcon = d6.verified ? pc27.green("\u2713") : pc27.yellow("\u23F1");
47589
47669
  const dkimIcon = d6.dkimStatus === "SUCCESS" ? pc27.green("\u2713 SUCCESS") : pc27.yellow(`\u23F1 ${d6.dkimStatus}`);
47590
47670
  const label = tracked.isPrimary ? pc27.dim("Primary") : pc27.dim(PURPOSE_LABELS[tracked.purpose || "other"] || "General");
47591
- const trackingSuffix = tracked.trackingDomain ? ` ${pc27.dim("\u2192")} ${tracked.trackingDomain}` : "";
47671
+ const trackingSuffix = tracked.trackingDomain ? ` ${pc27.dim("\u2192")} ${tracked.trackingDomain} ${trackingHttpsByDomain.get(d6.name)?.status === "active" ? pc27.dim("(https)") : pc27.yellow("(http)")}` : "";
47592
47672
  return ` ${statusIcon} ${pc27.bold(d6.name.padEnd(30))} ${label.padEnd(24)} DKIM: ${dkimIcon}${trackingSuffix}`;
47593
47673
  });
47594
47674
  clack25.note(managedLines.join("\n"), "Managed by Wraps");
@@ -68345,50 +68425,90 @@ function showHelp() {
68345
68425
  );
68346
68426
  console.log("Email Commands:");
68347
68427
  console.log(
68348
- ` ${pc72.cyan("email init")} Deploy new email infrastructure`
68428
+ ` ${pc72.cyan("email init")} Deploy new email infrastructure`
68429
+ );
68430
+ console.log(
68431
+ ` ${pc72.cyan("email check")} Check email deliverability for a domain`
68432
+ );
68433
+ console.log(
68434
+ ` ${pc72.cyan("email connect")} Connect to existing AWS SES`
68435
+ );
68436
+ console.log(
68437
+ ` ${pc72.cyan("email status")} Show email infrastructure details`
68438
+ );
68439
+ console.log(
68440
+ ` ${pc72.cyan("email plan")} Show SES pricing plan and cheaper options`
68441
+ );
68442
+ console.log(` ${pc72.cyan("email test")} Send a test email`);
68443
+ console.log(
68444
+ ` ${pc72.cyan("email verify")} Verify domain DNS records`
68349
68445
  );
68350
68446
  console.log(
68351
- ` ${pc72.cyan("email check")} Check email deliverability for a domain`
68447
+ ` ${pc72.cyan("email sync")} Apply CLI updates to infrastructure`
68352
68448
  );
68449
+ console.log(` ${pc72.cyan("email upgrade")} Add features`);
68353
68450
  console.log(
68354
- ` ${pc72.cyan("email connect")} Connect to existing AWS SES`
68451
+ ` ${pc72.cyan("email restore")} Restore original configuration`
68355
68452
  );
68356
68453
  console.log(
68357
- ` ${pc72.cyan("email status")} Show email infrastructure details`
68454
+ ` ${pc72.cyan("email destroy")} Remove email infrastructure`
68358
68455
  );
68359
68456
  console.log(
68360
- ` ${pc72.cyan("email plan")} Show SES pricing plan and cheaper options`
68457
+ ` ${pc72.cyan("email doctor")} Diagnose and clean up email infrastructure`
68361
68458
  );
68362
- console.log(` ${pc72.cyan("email test")} Send a test email`);
68363
- console.log(` ${pc72.cyan("email verify")} Verify domain DNS records`);
68459
+ console.log(` ${pc72.cyan("email domains add")} Add a domain to SES`);
68460
+ console.log(` ${pc72.cyan("email domains list")} List all domains`);
68461
+ console.log(` ${pc72.cyan("email domains remove")} Remove a domain`);
68364
68462
  console.log(
68365
- ` ${pc72.cyan("email sync")} Apply CLI updates to infrastructure`
68463
+ ` ${pc72.cyan("email domains verify")} Check domain verification status`
68366
68464
  );
68367
- console.log(` ${pc72.cyan("email upgrade")} Add features`);
68368
68465
  console.log(
68369
- ` ${pc72.cyan("email restore")} Restore original configuration`
68466
+ ` ${pc72.cyan("email domains get-dkim")} Show DKIM tokens for a domain`
68370
68467
  );
68371
68468
  console.log(
68372
- ` ${pc72.cyan("email destroy")} Remove email infrastructure`
68469
+ ` ${pc72.cyan("email domains config")} Configure domain tracking, TLS, and archiving`
68373
68470
  );
68374
68471
  console.log(
68375
- ` ${pc72.cyan("email doctor")} Diagnose and clean up email infrastructure`
68472
+ ` ${pc72.cyan("email inbound init")} Enable inbound email receiving`
68376
68473
  );
68377
- console.log(` ${pc72.cyan("email domains add")} Add a domain to SES`);
68378
- console.log(` ${pc72.cyan("email domains list")} List all domains`);
68379
- console.log(` ${pc72.cyan("email domains remove")} Remove a domain`);
68380
68474
  console.log(
68381
- ` ${pc72.cyan("email inbound init")} Enable inbound email receiving`
68475
+ ` ${pc72.cyan("email inbound status")} Show inbound email status`
68382
68476
  );
68383
- console.log(` ${pc72.cyan("email inbound status")} Show inbound email status`);
68384
68477
  console.log(
68385
- ` ${pc72.cyan("email inbound verify")} Verify inbound DNS records`
68478
+ ` ${pc72.cyan("email inbound verify")} Verify inbound DNS records`
68386
68479
  );
68387
68480
  console.log(
68388
- ` ${pc72.cyan("email inbound test")} Send test email and verify receipt`
68481
+ ` ${pc72.cyan("email inbound test")} Send test email and verify receipt`
68389
68482
  );
68390
68483
  console.log(
68391
- ` ${pc72.cyan("email inbound destroy")} Remove inbound email infrastructure
68484
+ ` ${pc72.cyan("email inbound add")} Add an inbound receiving domain`
68485
+ );
68486
+ console.log(
68487
+ ` ${pc72.cyan("email inbound remove")} Remove an inbound receiving domain`
68488
+ );
68489
+ console.log(
68490
+ ` ${pc72.cyan("email inbound destroy")} Remove inbound email infrastructure`
68491
+ );
68492
+ console.log(
68493
+ ` ${pc72.cyan("email reply init")} Set up signed reply-to threading`
68494
+ );
68495
+ console.log(
68496
+ ` ${pc72.cyan("email reply rotate")} Rotate the reply-threading signing secret`
68497
+ );
68498
+ console.log(
68499
+ ` ${pc72.cyan("email reply status")} Show reply-threading status`
68500
+ );
68501
+ console.log(
68502
+ ` ${pc72.cyan("email reply destroy")} Remove reply-threading infrastructure`
68503
+ );
68504
+ console.log(
68505
+ ` ${pc72.cyan("email reply decode")} Decode a reply-to address`
68506
+ );
68507
+ console.log(
68508
+ ` ${pc72.cyan("email logs list")} List recent email sends`
68509
+ );
68510
+ console.log(
68511
+ ` ${pc72.cyan("email logs get")} Show details for one message
68392
68512
  `
68393
68513
  );
68394
68514
  console.log("Agent Commands:");
@@ -68422,7 +68542,10 @@ function showHelp() {
68422
68542
  ` ${pc72.cyan("email workflows validate")} Validate workflow files`
68423
68543
  );
68424
68544
  console.log(
68425
- ` ${pc72.cyan("email workflows push")} Push workflows to dashboard
68545
+ ` ${pc72.cyan("email workflows push")} Push workflows to dashboard`
68546
+ );
68547
+ console.log(
68548
+ ` ${pc72.cyan("workflow init")} Scaffold a cross-channel workflow (email \u2192 SMS)
68426
68549
  `
68427
68550
  );
68428
68551
  console.log("SMS Commands:");