@wraps.dev/cli 2.17.15 → 2.17.17
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 +39 -12
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/{index-CNn3fWLq.js → index-41T2hONy.js} +45 -45
- package/dist/console/index.html +1 -1
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/index.js +37 -37
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/package.json +18 -6
package/dist/cli.js
CHANGED
|
@@ -83,6 +83,13 @@ __export(s3_state_exports, {
|
|
|
83
83
|
import { existsSync, statSync } from "fs";
|
|
84
84
|
import { readdir, writeFile } from "fs/promises";
|
|
85
85
|
import { join } from "path";
|
|
86
|
+
function has404StatusCode(error) {
|
|
87
|
+
if (!(error instanceof Error)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
const metadataError = error;
|
|
91
|
+
return metadataError.$metadata?.httpStatusCode === 404;
|
|
92
|
+
}
|
|
86
93
|
function getStateBucketName(accountId, region) {
|
|
87
94
|
return `wraps-state-${accountId}-${region}`;
|
|
88
95
|
}
|
|
@@ -97,7 +104,7 @@ async function stateBucketExists(accountId, region) {
|
|
|
97
104
|
await client.send(new HeadBucketCommand({ Bucket: bucketName }));
|
|
98
105
|
return true;
|
|
99
106
|
} catch (error) {
|
|
100
|
-
if (error instanceof Error && (error.name === "NotFound" || error.name === "NoSuchBucket" || error
|
|
107
|
+
if (error instanceof Error && (error.name === "NotFound" || error.name === "NoSuchBucket" || has404StatusCode(error))) {
|
|
101
108
|
return false;
|
|
102
109
|
}
|
|
103
110
|
throw error;
|
|
@@ -119,7 +126,7 @@ async function ensureStateBucket(accountId, region) {
|
|
|
119
126
|
await client.send(new HeadBucketCommand({ Bucket: bucketName }));
|
|
120
127
|
return bucketName;
|
|
121
128
|
} catch (error) {
|
|
122
|
-
const isNotFound = error instanceof Error && (error.name === "NotFound" || error.name === "NoSuchBucket" || error
|
|
129
|
+
const isNotFound = error instanceof Error && (error.name === "NotFound" || error.name === "NoSuchBucket" || has404StatusCode(error));
|
|
123
130
|
if (!isNotFound) {
|
|
124
131
|
throw error;
|
|
125
132
|
}
|
|
@@ -239,7 +246,7 @@ async function downloadMetadata(bucketName, accountId, region) {
|
|
|
239
246
|
}
|
|
240
247
|
return JSON.parse(body);
|
|
241
248
|
} catch (error) {
|
|
242
|
-
if (error instanceof Error && (error.name === "NoSuchKey" || error
|
|
249
|
+
if (error instanceof Error && (error.name === "NoSuchKey" || has404StatusCode(error))) {
|
|
243
250
|
return null;
|
|
244
251
|
}
|
|
245
252
|
throw error;
|
|
@@ -1291,7 +1298,8 @@ function classifyDNSError(error) {
|
|
|
1291
1298
|
}
|
|
1292
1299
|
function isAWSNotFoundError(error) {
|
|
1293
1300
|
if (!(error instanceof Error)) return false;
|
|
1294
|
-
|
|
1301
|
+
const awsError = error;
|
|
1302
|
+
return error.name === "NotFoundException" || error.name === "NoSuchEntityException" || error.name === "NoSuchEntity" || error.name === "ResourceNotFoundException" || awsError.$metadata?.httpStatusCode === 404;
|
|
1295
1303
|
}
|
|
1296
1304
|
function isPulumiError(error) {
|
|
1297
1305
|
if (!(error instanceof Error)) {
|
|
@@ -4416,9 +4424,13 @@ function createConnectionMetadata(accountId, region, provider, emailConfig, pres
|
|
|
4416
4424
|
}
|
|
4417
4425
|
};
|
|
4418
4426
|
}
|
|
4427
|
+
function setConfigValue(config2, key, value) {
|
|
4428
|
+
config2[key] = value;
|
|
4429
|
+
}
|
|
4419
4430
|
function applyConfigUpdates(existingConfig, updates) {
|
|
4420
4431
|
const result = { ...existingConfig };
|
|
4421
|
-
for (const
|
|
4432
|
+
for (const key of Object.keys(updates)) {
|
|
4433
|
+
const value = updates[key];
|
|
4422
4434
|
if (value === void 0) {
|
|
4423
4435
|
continue;
|
|
4424
4436
|
}
|
|
@@ -4472,7 +4484,7 @@ function applyConfigUpdates(existingConfig, updates) {
|
|
|
4472
4484
|
...value
|
|
4473
4485
|
};
|
|
4474
4486
|
} else {
|
|
4475
|
-
result
|
|
4487
|
+
setConfigValue(result, key, value);
|
|
4476
4488
|
}
|
|
4477
4489
|
}
|
|
4478
4490
|
return result;
|
|
@@ -17077,7 +17089,8 @@ async function userExists(userName) {
|
|
|
17077
17089
|
await iam10.send(new GetUserCommand({ UserName: userName }));
|
|
17078
17090
|
return true;
|
|
17079
17091
|
} catch (error) {
|
|
17080
|
-
|
|
17092
|
+
const iamError = error;
|
|
17093
|
+
if (error instanceof Error && (iamError.name === "NoSuchEntityException" || iamError.Code === "NoSuchEntity")) {
|
|
17081
17094
|
return false;
|
|
17082
17095
|
}
|
|
17083
17096
|
return false;
|
|
@@ -28143,6 +28156,7 @@ import pc36 from "picocolors";
|
|
|
28143
28156
|
init_events();
|
|
28144
28157
|
init_aws();
|
|
28145
28158
|
init_config();
|
|
28159
|
+
init_errors();
|
|
28146
28160
|
init_fs();
|
|
28147
28161
|
init_json_output();
|
|
28148
28162
|
init_metadata();
|
|
@@ -28668,7 +28682,7 @@ You can try the manual flow: ${pc36.cyan("wraps auth logout")} then ${pc36.cyan(
|
|
|
28668
28682
|
const duration = Date.now() - startTime;
|
|
28669
28683
|
const errorCode = error instanceof Error ? error.name : "UNKNOWN_ERROR";
|
|
28670
28684
|
trackError(errorCode, "platform:connect", {
|
|
28671
|
-
message:
|
|
28685
|
+
message: sanitizeErrorMessage(error)
|
|
28672
28686
|
});
|
|
28673
28687
|
trackCommand("platform:connect", {
|
|
28674
28688
|
success: false,
|
|
@@ -28946,7 +28960,7 @@ ${pc36.bold("Next Steps:")}`);
|
|
|
28946
28960
|
const duration = Date.now() - startTime;
|
|
28947
28961
|
const errorCode = error instanceof Error ? error.name : "UNKNOWN_ERROR";
|
|
28948
28962
|
trackError(errorCode, "platform:connect", {
|
|
28949
|
-
message:
|
|
28963
|
+
message: sanitizeErrorMessage(error)
|
|
28950
28964
|
});
|
|
28951
28965
|
trackCommand("platform:connect", {
|
|
28952
28966
|
success: false,
|
|
@@ -29418,10 +29432,16 @@ import { createHttpTerminator } from "http-terminator";
|
|
|
29418
29432
|
|
|
29419
29433
|
// src/console/middleware/auth.ts
|
|
29420
29434
|
init_esm_shims();
|
|
29435
|
+
import { timingSafeEqual } from "crypto";
|
|
29421
29436
|
function authenticateToken(expectedToken) {
|
|
29422
29437
|
return (req, res, next) => {
|
|
29423
29438
|
const token = req.query.token || req.headers["x-auth-token"];
|
|
29424
|
-
if (!token
|
|
29439
|
+
if (!token) {
|
|
29440
|
+
return res.status(401).json({ error: "Unauthorized" });
|
|
29441
|
+
}
|
|
29442
|
+
const expectedBuf = Buffer.from(expectedToken);
|
|
29443
|
+
const tokenBuf = Buffer.from(token);
|
|
29444
|
+
if (expectedBuf.length !== tokenBuf.length || !timingSafeEqual(expectedBuf, tokenBuf)) {
|
|
29425
29445
|
return res.status(401).json({ error: "Unauthorized" });
|
|
29426
29446
|
}
|
|
29427
29447
|
next();
|
|
@@ -30815,6 +30835,13 @@ async function fetchEmailSettings(roleArn, region, configSetName, domain) {
|
|
|
30815
30835
|
}
|
|
30816
30836
|
|
|
30817
30837
|
// src/console/routes/settings.ts
|
|
30838
|
+
function isMissingDnsRecordError(error) {
|
|
30839
|
+
if (!(error instanceof Error)) {
|
|
30840
|
+
return false;
|
|
30841
|
+
}
|
|
30842
|
+
const dnsError = error;
|
|
30843
|
+
return dnsError.code === "ENODATA" || dnsError.code === "ENOTFOUND";
|
|
30844
|
+
}
|
|
30818
30845
|
function createSettingsRouter(config2) {
|
|
30819
30846
|
const router = createRouter6();
|
|
30820
30847
|
router.get("/deployment", async (_req, res) => {
|
|
@@ -30883,7 +30910,7 @@ function createSettingsRouter(config2) {
|
|
|
30883
30910
|
});
|
|
30884
30911
|
} catch (error) {
|
|
30885
30912
|
console.error("[Verify] Error verifying tracking domain:", error);
|
|
30886
|
-
if (
|
|
30913
|
+
if (isMissingDnsRecordError(error)) {
|
|
30887
30914
|
return res.json({
|
|
30888
30915
|
verified: false,
|
|
30889
30916
|
error: "No CNAME record found for this domain"
|
|
@@ -30917,7 +30944,7 @@ function createSettingsRouter(config2) {
|
|
|
30917
30944
|
});
|
|
30918
30945
|
} catch (error) {
|
|
30919
30946
|
console.error("[Verify] Error verifying DMARC:", error);
|
|
30920
|
-
if (
|
|
30947
|
+
if (isMissingDnsRecordError(error)) {
|
|
30921
30948
|
return res.json({
|
|
30922
30949
|
verified: false,
|
|
30923
30950
|
error: "No DMARC record found for this domain"
|