@wraps.dev/cli 2.20.0 → 2.20.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
|
@@ -7270,7 +7270,8 @@ function domainToConfigSetName(domain) {
|
|
|
7270
7270
|
return `${PREFIX}${slug}`;
|
|
7271
7271
|
}
|
|
7272
7272
|
const hash = createHash("sha256").update(domain).digest("hex").slice(0, 8);
|
|
7273
|
-
const
|
|
7273
|
+
const rawSlugPart = slug.length > MAX_SLUG_WITH_HASH ? slug.slice(0, MAX_SLUG_WITH_HASH) : slug;
|
|
7274
|
+
const slugPart = rawSlugPart.replace(/-+$/, "");
|
|
7274
7275
|
return `${PREFIX}${slugPart}-${hash}`;
|
|
7275
7276
|
}
|
|
7276
7277
|
var PREFIX, MAX_LENGTH, MAX_SLUG, MAX_SLUG_WITH_HASH;
|
|
@@ -9710,9 +9711,9 @@ var init_test = __esm({
|
|
|
9710
9711
|
"use strict";
|
|
9711
9712
|
init_esm_shims();
|
|
9712
9713
|
init_events();
|
|
9714
|
+
init_config_set_slug();
|
|
9713
9715
|
init_ses_simulator();
|
|
9714
9716
|
init_verification();
|
|
9715
|
-
init_config_set_slug();
|
|
9716
9717
|
init_aws();
|
|
9717
9718
|
init_errors();
|
|
9718
9719
|
init_json_output();
|
|
@@ -19587,7 +19588,10 @@ async function emailDestroy(options) {
|
|
|
19587
19588
|
try {
|
|
19588
19589
|
const { SQSClient, GetQueueUrlCommand, DeleteQueueCommand } = await import("@aws-sdk/client-sqs");
|
|
19589
19590
|
const sqsClient = new SQSClient({ region });
|
|
19590
|
-
for (const queueName of [
|
|
19591
|
+
for (const queueName of [
|
|
19592
|
+
"wraps-email-events",
|
|
19593
|
+
"wraps-email-events-dlq"
|
|
19594
|
+
]) {
|
|
19591
19595
|
try {
|
|
19592
19596
|
const { QueueUrl } = await sqsClient.send(
|
|
19593
19597
|
new GetQueueUrlCommand({ QueueName: queueName })
|
|
@@ -19601,6 +19605,21 @@ async function emailDestroy(options) {
|
|
|
19601
19605
|
} catch {
|
|
19602
19606
|
}
|
|
19603
19607
|
}
|
|
19608
|
+
try {
|
|
19609
|
+
const { SESv2Client: SESv2Client9, DeleteConfigurationSetCommand: DeleteConfigSet } = await import("@aws-sdk/client-sesv2");
|
|
19610
|
+
const sesv22 = new SESv2Client9({ region });
|
|
19611
|
+
const additionalDomains = emailConfig?.additionalDomains ?? [];
|
|
19612
|
+
for (const d of additionalDomains) {
|
|
19613
|
+
if (!d.configSetName) continue;
|
|
19614
|
+
try {
|
|
19615
|
+
await sesv22.send(
|
|
19616
|
+
new DeleteConfigSet({ ConfigurationSetName: d.configSetName })
|
|
19617
|
+
);
|
|
19618
|
+
} catch {
|
|
19619
|
+
}
|
|
19620
|
+
}
|
|
19621
|
+
} catch {
|
|
19622
|
+
}
|
|
19604
19623
|
await deleteConnectionMetadata(identity.accountId, region);
|
|
19605
19624
|
progress.stop();
|
|
19606
19625
|
if (isJsonMode()) {
|
|
@@ -19968,13 +19987,13 @@ init_esm_shims();
|
|
|
19968
19987
|
init_client();
|
|
19969
19988
|
init_events();
|
|
19970
19989
|
init_dns();
|
|
19990
|
+
init_config_set_slug();
|
|
19971
19991
|
init_aws();
|
|
19972
19992
|
init_errors();
|
|
19973
19993
|
init_json_output();
|
|
19974
19994
|
init_metadata();
|
|
19975
19995
|
init_output();
|
|
19976
19996
|
init_prompts();
|
|
19977
|
-
init_config_set_slug();
|
|
19978
19997
|
import { Resolver as Resolver2 } from "dns/promises";
|
|
19979
19998
|
import {
|
|
19980
19999
|
CreateConfigurationSetCommand,
|
|
@@ -20465,7 +20484,8 @@ Run ${pc23.cyan("wraps email init")} first to deploy email infrastructure.
|
|
|
20465
20484
|
})
|
|
20466
20485
|
);
|
|
20467
20486
|
} catch (err) {
|
|
20468
|
-
if (err.name !== "AlreadyExistsException")
|
|
20487
|
+
if (err.name !== "AlreadyExistsException")
|
|
20488
|
+
throw err;
|
|
20469
20489
|
}
|
|
20470
20490
|
try {
|
|
20471
20491
|
await sesClient.send(
|
|
@@ -20480,7 +20500,8 @@ Run ${pc23.cyan("wraps email init")} first to deploy email infrastructure.
|
|
|
20480
20500
|
})
|
|
20481
20501
|
);
|
|
20482
20502
|
} catch (err) {
|
|
20483
|
-
if (err.name !== "AlreadyExistsException")
|
|
20503
|
+
if (err.name !== "AlreadyExistsException")
|
|
20504
|
+
throw err;
|
|
20484
20505
|
}
|
|
20485
20506
|
});
|
|
20486
20507
|
if (domainAlreadyExists) {
|
|
@@ -22631,9 +22652,17 @@ async function init2(options) {
|
|
|
22631
22652
|
if (!options.quick && preset !== "custom" && emailConfig.tracking?.enabled) {
|
|
22632
22653
|
const purpose = await promptDomainPurpose();
|
|
22633
22654
|
if (purpose === "transactional") {
|
|
22634
|
-
emailConfig.tracking = {
|
|
22655
|
+
emailConfig.tracking = {
|
|
22656
|
+
...emailConfig.tracking,
|
|
22657
|
+
opens: false,
|
|
22658
|
+
clicks: false
|
|
22659
|
+
};
|
|
22635
22660
|
} else if (purpose === "marketing" || purpose === "notifications") {
|
|
22636
|
-
emailConfig.tracking = {
|
|
22661
|
+
emailConfig.tracking = {
|
|
22662
|
+
...emailConfig.tracking,
|
|
22663
|
+
opens: true,
|
|
22664
|
+
clicks: true
|
|
22665
|
+
};
|
|
22637
22666
|
} else {
|
|
22638
22667
|
const trackOpens = await clack26.confirm({
|
|
22639
22668
|
message: "Track email opens?",
|
|
@@ -26559,13 +26588,16 @@ ${pc35.bold("Current Configuration:")}
|
|
|
26559
26588
|
value: "hosting-provider",
|
|
26560
26589
|
label: "Change hosting provider",
|
|
26561
26590
|
hint: metadata.provider === "vercel" ? `Currently: Vercel (${metadata.vercel?.teamSlug || "configured"})` : `Currently: ${metadata.provider} \u2192 Switch to Vercel OIDC, etc.`
|
|
26562
|
-
},
|
|
26563
|
-
{
|
|
26564
|
-
value: "per-domain-config-sets",
|
|
26565
|
-
label: "Per-domain configuration sets",
|
|
26566
|
-
hint: "Create dedicated SES config sets for each additional domain"
|
|
26567
26591
|
}
|
|
26568
26592
|
);
|
|
26593
|
+
const unmigratedCount = (metadata.services.email?.config.additionalDomains ?? []).filter((d) => !d.configSetName).length;
|
|
26594
|
+
if (unmigratedCount > 0) {
|
|
26595
|
+
upgradeOptions.push({
|
|
26596
|
+
value: "per-domain-config-sets",
|
|
26597
|
+
label: "Per-domain configuration sets",
|
|
26598
|
+
hint: `Migrate ${unmigratedCount} additional domain(s) to dedicated SES config sets`
|
|
26599
|
+
});
|
|
26600
|
+
}
|
|
26569
26601
|
if (options.action) {
|
|
26570
26602
|
upgradeAction = options.action;
|
|
26571
26603
|
} else {
|
|
@@ -27735,14 +27767,19 @@ ${pc35.bold("SMTP Credentials for Legacy Systems")}
|
|
|
27735
27767
|
await progress.execute(
|
|
27736
27768
|
`Creating config set for ${d.domain}`,
|
|
27737
27769
|
async () => {
|
|
27738
|
-
|
|
27739
|
-
|
|
27740
|
-
|
|
27741
|
-
|
|
27742
|
-
|
|
27743
|
-
|
|
27744
|
-
|
|
27745
|
-
|
|
27770
|
+
try {
|
|
27771
|
+
await sesClient.send(
|
|
27772
|
+
new CreateConfigurationSetCommand2({
|
|
27773
|
+
ConfigurationSetName: configSetName,
|
|
27774
|
+
SuppressionOptions: {
|
|
27775
|
+
SuppressedReasons: ["BOUNCE", "COMPLAINT"]
|
|
27776
|
+
}
|
|
27777
|
+
})
|
|
27778
|
+
);
|
|
27779
|
+
} catch (err) {
|
|
27780
|
+
if (err.name !== "AlreadyExistsException")
|
|
27781
|
+
throw err;
|
|
27782
|
+
}
|
|
27746
27783
|
}
|
|
27747
27784
|
);
|
|
27748
27785
|
const allEvents = [
|
|
@@ -27765,17 +27802,22 @@ ${pc35.bold("SMTP Credentials for Legacy Systems")}
|
|
|
27765
27802
|
await progress.execute(
|
|
27766
27803
|
`Adding EventBridge destination for ${d.domain}`,
|
|
27767
27804
|
async () => {
|
|
27768
|
-
|
|
27769
|
-
|
|
27770
|
-
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
|
|
27776
|
-
|
|
27777
|
-
|
|
27778
|
-
|
|
27805
|
+
try {
|
|
27806
|
+
await sesClient.send(
|
|
27807
|
+
new CreateConfigurationSetEventDestinationCommand2({
|
|
27808
|
+
ConfigurationSetName: configSetName,
|
|
27809
|
+
EventDestinationName: "wraps-email-eventbridge",
|
|
27810
|
+
EventDestination: {
|
|
27811
|
+
Enabled: true,
|
|
27812
|
+
MatchingEventTypes: matchingEventTypes,
|
|
27813
|
+
EventBridgeDestination: { EventBusArn: eventBusArn }
|
|
27814
|
+
}
|
|
27815
|
+
})
|
|
27816
|
+
);
|
|
27817
|
+
} catch (err) {
|
|
27818
|
+
if (err.name !== "AlreadyExistsException")
|
|
27819
|
+
throw err;
|
|
27820
|
+
}
|
|
27779
27821
|
}
|
|
27780
27822
|
);
|
|
27781
27823
|
d.configSetName = configSetName;
|