@wraps.dev/cli 2.5.1 → 2.5.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
|
@@ -737,7 +737,9 @@ var init_events = __esm({
|
|
|
737
737
|
import * as clack from "@clack/prompts";
|
|
738
738
|
import pc2 from "picocolors";
|
|
739
739
|
function isAWSError(error) {
|
|
740
|
-
if (!(error instanceof Error))
|
|
740
|
+
if (!(error instanceof Error)) {
|
|
741
|
+
return false;
|
|
742
|
+
}
|
|
741
743
|
const awsErrorNames = [
|
|
742
744
|
"ExpiredTokenException",
|
|
743
745
|
"InvalidClientTokenId",
|
|
@@ -754,7 +756,9 @@ function isAWSError(error) {
|
|
|
754
756
|
return awsErrorNames.includes(error.name) || "$metadata" in error;
|
|
755
757
|
}
|
|
756
758
|
function isPulumiError(error) {
|
|
757
|
-
if (!(error instanceof Error))
|
|
759
|
+
if (!(error instanceof Error)) {
|
|
760
|
+
return false;
|
|
761
|
+
}
|
|
758
762
|
return error.message?.includes("pulumi") || error.message?.includes("Pulumi") || error.message?.includes("resource") || error.message?.includes("creating") || error.message?.includes("AccessDenied");
|
|
759
763
|
}
|
|
760
764
|
function parseAWSError(error) {
|
|
@@ -805,7 +809,9 @@ function parsePulumiError(error) {
|
|
|
805
809
|
return { code: "PULUMI_ERROR" };
|
|
806
810
|
}
|
|
807
811
|
function sanitizeErrorMessage(error) {
|
|
808
|
-
if (!error)
|
|
812
|
+
if (!error) {
|
|
813
|
+
return "Unknown error";
|
|
814
|
+
}
|
|
809
815
|
let message = error instanceof Error ? error.message : String(error);
|
|
810
816
|
message = message.replace(/\b\d{12}\b/g, "[ACCOUNT_ID]");
|
|
811
817
|
message = message.replace(
|
|
@@ -5059,12 +5065,22 @@ async function createDNSRecordsForProvider(credentials, data, selectedCategories
|
|
|
5059
5065
|
data.mailFromDomain
|
|
5060
5066
|
);
|
|
5061
5067
|
let recordsCreated = 0;
|
|
5062
|
-
if (categories.has("dkim"))
|
|
5063
|
-
|
|
5064
|
-
|
|
5068
|
+
if (categories.has("dkim")) {
|
|
5069
|
+
recordsCreated += data.dkimTokens.length;
|
|
5070
|
+
}
|
|
5071
|
+
if (categories.has("spf")) {
|
|
5072
|
+
recordsCreated += 1;
|
|
5073
|
+
}
|
|
5074
|
+
if (categories.has("dmarc")) {
|
|
5075
|
+
recordsCreated += 1;
|
|
5076
|
+
}
|
|
5065
5077
|
if (data.mailFromDomain) {
|
|
5066
|
-
if (categories.has("mailfrom_mx"))
|
|
5067
|
-
|
|
5078
|
+
if (categories.has("mailfrom_mx")) {
|
|
5079
|
+
recordsCreated += 1;
|
|
5080
|
+
}
|
|
5081
|
+
if (categories.has("mailfrom_spf")) {
|
|
5082
|
+
recordsCreated += 1;
|
|
5083
|
+
}
|
|
5068
5084
|
}
|
|
5069
5085
|
return {
|
|
5070
5086
|
success: true,
|
|
@@ -5366,10 +5382,18 @@ async function detectAvailableDNSProviders(domain, region) {
|
|
|
5366
5382
|
hint: "I'll add DNS records myself"
|
|
5367
5383
|
});
|
|
5368
5384
|
return providers.sort((a, b) => {
|
|
5369
|
-
if (a.provider === "manual")
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
if (
|
|
5385
|
+
if (a.provider === "manual") {
|
|
5386
|
+
return 1;
|
|
5387
|
+
}
|
|
5388
|
+
if (b.provider === "manual") {
|
|
5389
|
+
return -1;
|
|
5390
|
+
}
|
|
5391
|
+
if (a.detected && !b.detected) {
|
|
5392
|
+
return -1;
|
|
5393
|
+
}
|
|
5394
|
+
if (!a.detected && b.detected) {
|
|
5395
|
+
return 1;
|
|
5396
|
+
}
|
|
5373
5397
|
return 0;
|
|
5374
5398
|
});
|
|
5375
5399
|
}
|
|
@@ -7591,6 +7615,8 @@ async function createCdnBucket(config2) {
|
|
|
7591
7615
|
"https://*.wraps.dev",
|
|
7592
7616
|
"http://localhost:3000",
|
|
7593
7617
|
"http://localhost:3001",
|
|
7618
|
+
"http://localhost:3002",
|
|
7619
|
+
"http://localhost:3003",
|
|
7594
7620
|
"http://localhost:4000",
|
|
7595
7621
|
"http://localhost:5173",
|
|
7596
7622
|
"http://localhost:5174",
|
|
@@ -15584,8 +15610,12 @@ async function checkIAMPermissions(userArn, actions, region) {
|
|
|
15584
15610
|
const actionName = result.EvalActionName;
|
|
15585
15611
|
const decision = result.EvalDecision;
|
|
15586
15612
|
if (decision === "allowed") {
|
|
15587
|
-
if (actionName)
|
|
15588
|
-
|
|
15613
|
+
if (actionName) {
|
|
15614
|
+
allowedActions.push(actionName);
|
|
15615
|
+
}
|
|
15616
|
+
} else if (actionName) {
|
|
15617
|
+
deniedActions.push(actionName);
|
|
15618
|
+
}
|
|
15589
15619
|
}
|
|
15590
15620
|
}
|
|
15591
15621
|
return {
|
|
@@ -15615,7 +15645,9 @@ async function checkIAMPermissions(userArn, actions, region) {
|
|
|
15615
15645
|
}
|
|
15616
15646
|
}
|
|
15617
15647
|
function formatDeniedActions(actions) {
|
|
15618
|
-
if (actions.length === 0)
|
|
15648
|
+
if (actions.length === 0) {
|
|
15649
|
+
return "";
|
|
15650
|
+
}
|
|
15619
15651
|
const byService = {};
|
|
15620
15652
|
for (const action of actions) {
|
|
15621
15653
|
const [service, actionName] = action.split(":");
|
|
@@ -18725,9 +18757,9 @@ Run ${pc24.cyan("wraps email init")} or ${pc24.cyan("wraps sms init")} first.
|
|
|
18725
18757
|
let webhookSecret;
|
|
18726
18758
|
let needsDeployment = false;
|
|
18727
18759
|
if (hasEmail) {
|
|
18728
|
-
const emailConfig = metadata.services.email
|
|
18729
|
-
const existingSecret = metadata.services.email
|
|
18730
|
-
if (!emailConfig
|
|
18760
|
+
const emailConfig = metadata.services.email?.config;
|
|
18761
|
+
const existingSecret = metadata.services.email?.webhookSecret;
|
|
18762
|
+
if (!emailConfig?.eventTracking?.enabled) {
|
|
18731
18763
|
progress.stop();
|
|
18732
18764
|
log21.warn(
|
|
18733
18765
|
"Event tracking must be enabled to connect to the Wraps Platform."
|
|
@@ -18756,8 +18788,8 @@ Run ${pc24.cyan("wraps email init")} or ${pc24.cyan("wraps sms init")} first.
|
|
|
18756
18788
|
"BOUNCE",
|
|
18757
18789
|
"COMPLAINT"
|
|
18758
18790
|
],
|
|
18759
|
-
dynamoDBHistory: emailConfig
|
|
18760
|
-
archiveRetention: emailConfig
|
|
18791
|
+
dynamoDBHistory: emailConfig?.eventTracking?.dynamoDBHistory ?? false,
|
|
18792
|
+
archiveRetention: emailConfig?.eventTracking?.archiveRetention ?? "90days"
|
|
18761
18793
|
}
|
|
18762
18794
|
};
|
|
18763
18795
|
needsDeployment = true;
|
|
@@ -18828,7 +18860,7 @@ Run ${pc24.cyan("wraps email init")} or ${pc24.cyan("wraps sms init")} first.
|
|
|
18828
18860
|
provider: metadata.provider,
|
|
18829
18861
|
region,
|
|
18830
18862
|
vercel: vercelConfig,
|
|
18831
|
-
emailConfig: metadata.services.email
|
|
18863
|
+
emailConfig: metadata.services.email?.config,
|
|
18832
18864
|
webhook: webhookSecret ? {
|
|
18833
18865
|
awsAccountNumber: metadata.accountId,
|
|
18834
18866
|
webhookSecret
|