@wraps.dev/cli 2.11.9 → 2.11.10
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
|
@@ -4473,12 +4473,25 @@ var init_metadata = __esm({
|
|
|
4473
4473
|
}
|
|
4474
4474
|
});
|
|
4475
4475
|
|
|
4476
|
+
// src/constants.ts
|
|
4477
|
+
function getDefaultRegion() {
|
|
4478
|
+
return process.env.AWS_REGION || DEFAULT_AWS_REGION;
|
|
4479
|
+
}
|
|
4480
|
+
var DEFAULT_AWS_REGION;
|
|
4481
|
+
var init_constants = __esm({
|
|
4482
|
+
"src/constants.ts"() {
|
|
4483
|
+
"use strict";
|
|
4484
|
+
init_esm_shims();
|
|
4485
|
+
DEFAULT_AWS_REGION = "us-east-1";
|
|
4486
|
+
}
|
|
4487
|
+
});
|
|
4488
|
+
|
|
4476
4489
|
// src/infrastructure/shared/resource-checks.ts
|
|
4477
4490
|
async function roleExists(roleName) {
|
|
4478
4491
|
try {
|
|
4479
4492
|
const { IAMClient: IAMClient4, GetRoleCommand: GetRoleCommand3 } = await import("@aws-sdk/client-iam");
|
|
4480
4493
|
const iam9 = new IAMClient4({
|
|
4481
|
-
region:
|
|
4494
|
+
region: getDefaultRegion()
|
|
4482
4495
|
});
|
|
4483
4496
|
await iam9.send(new GetRoleCommand3({ RoleName: roleName }));
|
|
4484
4497
|
return true;
|
|
@@ -4494,7 +4507,7 @@ async function tableExists(tableName) {
|
|
|
4494
4507
|
try {
|
|
4495
4508
|
const { DynamoDBClient: DynamoDBClient6, DescribeTableCommand: DescribeTableCommand2 } = await import("@aws-sdk/client-dynamodb");
|
|
4496
4509
|
const dynamodb3 = new DynamoDBClient6({
|
|
4497
|
-
region:
|
|
4510
|
+
region: getDefaultRegion()
|
|
4498
4511
|
});
|
|
4499
4512
|
await dynamodb3.send(new DescribeTableCommand2({ TableName: tableName }));
|
|
4500
4513
|
return true;
|
|
@@ -4510,7 +4523,7 @@ async function sqsQueueExists(queueName) {
|
|
|
4510
4523
|
try {
|
|
4511
4524
|
const { SQSClient, GetQueueUrlCommand } = await import("@aws-sdk/client-sqs");
|
|
4512
4525
|
const sqs5 = new SQSClient({
|
|
4513
|
-
region:
|
|
4526
|
+
region: getDefaultRegion()
|
|
4514
4527
|
});
|
|
4515
4528
|
const response = await sqs5.send(
|
|
4516
4529
|
new GetQueueUrlCommand({ QueueName: queueName })
|
|
@@ -4524,7 +4537,7 @@ async function snsTopicExists(topicName) {
|
|
|
4524
4537
|
try {
|
|
4525
4538
|
const { SNSClient: SNSClient2, ListTopicsCommand: ListTopicsCommand2 } = await import("@aws-sdk/client-sns");
|
|
4526
4539
|
const sns3 = new SNSClient2({
|
|
4527
|
-
region:
|
|
4540
|
+
region: getDefaultRegion()
|
|
4528
4541
|
});
|
|
4529
4542
|
let nextToken;
|
|
4530
4543
|
do {
|
|
@@ -4548,7 +4561,7 @@ async function lambdaFunctionExists(functionName) {
|
|
|
4548
4561
|
try {
|
|
4549
4562
|
const { LambdaClient: LambdaClient2, GetFunctionCommand } = await import("@aws-sdk/client-lambda");
|
|
4550
4563
|
const lambda4 = new LambdaClient2({
|
|
4551
|
-
region:
|
|
4564
|
+
region: getDefaultRegion()
|
|
4552
4565
|
});
|
|
4553
4566
|
await lambda4.send(new GetFunctionCommand({ FunctionName: functionName }));
|
|
4554
4567
|
return true;
|
|
@@ -4564,6 +4577,7 @@ var init_resource_checks = __esm({
|
|
|
4564
4577
|
"src/infrastructure/shared/resource-checks.ts"() {
|
|
4565
4578
|
"use strict";
|
|
4566
4579
|
init_esm_shims();
|
|
4580
|
+
init_constants();
|
|
4567
4581
|
}
|
|
4568
4582
|
});
|
|
4569
4583
|
|
|
@@ -4788,7 +4802,7 @@ async function findEventSourceMapping(functionName, queueArn) {
|
|
|
4788
4802
|
try {
|
|
4789
4803
|
const { LambdaClient: LambdaClient2, ListEventSourceMappingsCommand } = await import("@aws-sdk/client-lambda");
|
|
4790
4804
|
const lambda4 = new LambdaClient2({
|
|
4791
|
-
region:
|
|
4805
|
+
region: getDefaultRegion()
|
|
4792
4806
|
});
|
|
4793
4807
|
const response = await lambda4.send(
|
|
4794
4808
|
new ListEventSourceMappingsCommand({
|
|
@@ -4857,7 +4871,8 @@ async function deployLambdaFunctions(config2) {
|
|
|
4857
4871
|
]
|
|
4858
4872
|
}),
|
|
4859
4873
|
tags: {
|
|
4860
|
-
ManagedBy: "wraps-cli"
|
|
4874
|
+
ManagedBy: "wraps-cli",
|
|
4875
|
+
Service: "email"
|
|
4861
4876
|
}
|
|
4862
4877
|
});
|
|
4863
4878
|
new aws7.iam.RolePolicyAttachment("wraps-email-lambda-basic-execution", {
|
|
@@ -4922,6 +4937,7 @@ async function deployLambdaFunctions(config2) {
|
|
|
4922
4937
|
environment: lambdaEnvironment,
|
|
4923
4938
|
tags: {
|
|
4924
4939
|
ManagedBy: "wraps-cli",
|
|
4940
|
+
Service: "email",
|
|
4925
4941
|
Description: "Process SES email events from SQS and store in DynamoDB"
|
|
4926
4942
|
}
|
|
4927
4943
|
},
|
|
@@ -4980,6 +4996,7 @@ var init_lambda = __esm({
|
|
|
4980
4996
|
"src/infrastructure/resources/lambda.ts"() {
|
|
4981
4997
|
"use strict";
|
|
4982
4998
|
init_esm_shims();
|
|
4999
|
+
init_constants();
|
|
4983
5000
|
init_resource_checks();
|
|
4984
5001
|
nodeBuiltins = builtinModules.flatMap((m) => [m, `node:${m}`]);
|
|
4985
5002
|
}
|
|
@@ -5296,7 +5313,7 @@ function retentionToAWSPeriod2(retention) {
|
|
|
5296
5313
|
}
|
|
5297
5314
|
}
|
|
5298
5315
|
async function createMailManagerArchive(config2) {
|
|
5299
|
-
const region = config2.region ||
|
|
5316
|
+
const region = config2.region || getDefaultRegion();
|
|
5300
5317
|
const archiveName = `wraps-${config2.name}-archive`;
|
|
5301
5318
|
const mailManagerClient = new MailManagerClient({ region });
|
|
5302
5319
|
const sesClient = new SESv2Client2({ region });
|
|
@@ -5398,6 +5415,7 @@ var init_mail_manager = __esm({
|
|
|
5398
5415
|
"src/infrastructure/resources/mail-manager.ts"() {
|
|
5399
5416
|
"use strict";
|
|
5400
5417
|
init_esm_shims();
|
|
5418
|
+
init_constants();
|
|
5401
5419
|
}
|
|
5402
5420
|
});
|
|
5403
5421
|
|
|
@@ -9877,12 +9895,13 @@ async function createServiceIAMRole(config2) {
|
|
|
9877
9895
|
|
|
9878
9896
|
// src/infrastructure/vercel-oidc.ts
|
|
9879
9897
|
init_esm_shims();
|
|
9898
|
+
init_constants();
|
|
9880
9899
|
import * as aws3 from "@pulumi/aws";
|
|
9881
9900
|
async function getExistingOIDCProviderArn(url) {
|
|
9882
9901
|
try {
|
|
9883
9902
|
const { IAMClient: IAMClient4, ListOpenIDConnectProvidersCommand } = await import("@aws-sdk/client-iam");
|
|
9884
9903
|
const iam9 = new IAMClient4({
|
|
9885
|
-
region:
|
|
9904
|
+
region: getDefaultRegion()
|
|
9886
9905
|
});
|
|
9887
9906
|
const response = await iam9.send(new ListOpenIDConnectProvidersCommand({}));
|
|
9888
9907
|
const expectedArnSuffix = url.replace("https://", "");
|
|
@@ -14862,6 +14881,7 @@ async function createAlertingResources(config2) {
|
|
|
14862
14881
|
displayName: "Wraps Email Alerts",
|
|
14863
14882
|
tags: {
|
|
14864
14883
|
ManagedBy: "wraps-cli",
|
|
14884
|
+
Service: "email",
|
|
14865
14885
|
Description: "Alert notifications for email reputation and health"
|
|
14866
14886
|
}
|
|
14867
14887
|
});
|
|
@@ -14908,6 +14928,7 @@ async function createAlertingResources(config2) {
|
|
|
14908
14928
|
// Don't alarm if no data (no emails sent)
|
|
14909
14929
|
tags: {
|
|
14910
14930
|
ManagedBy: "wraps-cli",
|
|
14931
|
+
Service: "email",
|
|
14911
14932
|
Severity: "warning"
|
|
14912
14933
|
}
|
|
14913
14934
|
}
|
|
@@ -14931,6 +14952,7 @@ async function createAlertingResources(config2) {
|
|
|
14931
14952
|
treatMissingData: "notBreaching",
|
|
14932
14953
|
tags: {
|
|
14933
14954
|
ManagedBy: "wraps-cli",
|
|
14955
|
+
Service: "email",
|
|
14934
14956
|
Severity: "critical"
|
|
14935
14957
|
}
|
|
14936
14958
|
}
|
|
@@ -14952,6 +14974,7 @@ async function createAlertingResources(config2) {
|
|
|
14952
14974
|
treatMissingData: "notBreaching",
|
|
14953
14975
|
tags: {
|
|
14954
14976
|
ManagedBy: "wraps-cli",
|
|
14977
|
+
Service: "email",
|
|
14955
14978
|
Severity: "warning"
|
|
14956
14979
|
}
|
|
14957
14980
|
}
|
|
@@ -14973,6 +14996,7 @@ async function createAlertingResources(config2) {
|
|
|
14973
14996
|
treatMissingData: "notBreaching",
|
|
14974
14997
|
tags: {
|
|
14975
14998
|
ManagedBy: "wraps-cli",
|
|
14999
|
+
Service: "email",
|
|
14976
15000
|
Severity: "critical"
|
|
14977
15001
|
}
|
|
14978
15002
|
}
|
|
@@ -14998,6 +15022,7 @@ async function createAlertingResources(config2) {
|
|
|
14998
15022
|
treatMissingData: "notBreaching",
|
|
14999
15023
|
tags: {
|
|
15000
15024
|
ManagedBy: "wraps-cli",
|
|
15025
|
+
Service: "email",
|
|
15001
15026
|
Severity: "warning"
|
|
15002
15027
|
}
|
|
15003
15028
|
});
|
|
@@ -15046,7 +15071,8 @@ async function createDynamoDBTables(_config) {
|
|
|
15046
15071
|
attributeName: "expiresAt"
|
|
15047
15072
|
},
|
|
15048
15073
|
tags: {
|
|
15049
|
-
ManagedBy: "wraps-cli"
|
|
15074
|
+
ManagedBy: "wraps-cli",
|
|
15075
|
+
Service: "email"
|
|
15050
15076
|
}
|
|
15051
15077
|
},
|
|
15052
15078
|
{
|
|
@@ -15100,7 +15126,8 @@ async function createEventBridgeResources(config2) {
|
|
|
15100
15126
|
// We capture all by not filtering on detail-type
|
|
15101
15127
|
}),
|
|
15102
15128
|
tags: {
|
|
15103
|
-
ManagedBy: "wraps-cli"
|
|
15129
|
+
ManagedBy: "wraps-cli",
|
|
15130
|
+
Service: "email"
|
|
15104
15131
|
}
|
|
15105
15132
|
});
|
|
15106
15133
|
new aws6.sqs.QueuePolicy("wraps-email-events-queue-policy", {
|
|
@@ -15178,7 +15205,8 @@ async function createEventBridgeResources(config2) {
|
|
|
15178
15205
|
]
|
|
15179
15206
|
}),
|
|
15180
15207
|
tags: {
|
|
15181
|
-
ManagedBy: "wraps-cli"
|
|
15208
|
+
ManagedBy: "wraps-cli",
|
|
15209
|
+
Service: "email"
|
|
15182
15210
|
}
|
|
15183
15211
|
});
|
|
15184
15212
|
new aws6.iam.RolePolicy("wraps-webhook-policy", {
|
|
@@ -15326,7 +15354,8 @@ async function createIAMRole(config2) {
|
|
|
15326
15354
|
oidcProvider: config2.oidcProvider,
|
|
15327
15355
|
vercelTeamSlug: config2.vercelTeamSlug,
|
|
15328
15356
|
vercelProjectName: config2.vercelProjectName,
|
|
15329
|
-
policyStatements: statements
|
|
15357
|
+
policyStatements: statements,
|
|
15358
|
+
extraTags: { Service: "email" }
|
|
15330
15359
|
});
|
|
15331
15360
|
}
|
|
15332
15361
|
|
|
@@ -15399,6 +15428,7 @@ async function createSESResources(config2) {
|
|
|
15399
15428
|
},
|
|
15400
15429
|
tags: {
|
|
15401
15430
|
ManagedBy: "wraps-cli",
|
|
15431
|
+
Service: "email",
|
|
15402
15432
|
Description: "Wraps email tracking configuration set"
|
|
15403
15433
|
}
|
|
15404
15434
|
};
|
|
@@ -15487,7 +15517,8 @@ async function createSESResources(config2) {
|
|
|
15487
15517
|
nextSigningKeyLength: "RSA_2048_BIT"
|
|
15488
15518
|
},
|
|
15489
15519
|
tags: {
|
|
15490
|
-
ManagedBy: "wraps-cli"
|
|
15520
|
+
ManagedBy: "wraps-cli",
|
|
15521
|
+
Service: "email"
|
|
15491
15522
|
}
|
|
15492
15523
|
});
|
|
15493
15524
|
dkimTokens = domainIdentity.dkimSigningAttributes.apply(
|
|
@@ -15525,6 +15556,7 @@ async function createSESResources(config2) {
|
|
|
15525
15556
|
|
|
15526
15557
|
// src/infrastructure/resources/smtp-credentials.ts
|
|
15527
15558
|
init_esm_shims();
|
|
15559
|
+
init_constants();
|
|
15528
15560
|
import { createHmac as createHmac2 } from "crypto";
|
|
15529
15561
|
import * as aws9 from "@pulumi/aws";
|
|
15530
15562
|
function convertToSMTPPassword2(secretAccessKey, region) {
|
|
@@ -15548,7 +15580,7 @@ async function userExists(userName) {
|
|
|
15548
15580
|
try {
|
|
15549
15581
|
const { IAMClient: IAMClient4, GetUserCommand } = await import("@aws-sdk/client-iam");
|
|
15550
15582
|
const iam9 = new IAMClient4({
|
|
15551
|
-
region:
|
|
15583
|
+
region: getDefaultRegion()
|
|
15552
15584
|
});
|
|
15553
15585
|
await iam9.send(new GetUserCommand({ UserName: userName }));
|
|
15554
15586
|
return true;
|
|
@@ -15568,6 +15600,7 @@ async function createSMTPCredentials(config2) {
|
|
|
15568
15600
|
name: userName,
|
|
15569
15601
|
tags: {
|
|
15570
15602
|
ManagedBy: "wraps-cli",
|
|
15603
|
+
Service: "email",
|
|
15571
15604
|
Purpose: "SES SMTP Authentication"
|
|
15572
15605
|
}
|
|
15573
15606
|
},
|
|
@@ -15620,6 +15653,7 @@ async function createSQSResources() {
|
|
|
15620
15653
|
// 14 days
|
|
15621
15654
|
tags: {
|
|
15622
15655
|
ManagedBy: "wraps-cli",
|
|
15656
|
+
Service: "email",
|
|
15623
15657
|
Description: "Dead letter queue for failed SES event processing"
|
|
15624
15658
|
}
|
|
15625
15659
|
});
|
|
@@ -15640,6 +15674,7 @@ async function createSQSResources() {
|
|
|
15640
15674
|
),
|
|
15641
15675
|
tags: {
|
|
15642
15676
|
ManagedBy: "wraps-cli",
|
|
15677
|
+
Service: "email",
|
|
15643
15678
|
Description: "Queue for SES email events from EventBridge"
|
|
15644
15679
|
}
|
|
15645
15680
|
});
|
|
@@ -28529,6 +28564,7 @@ import pc39 from "picocolors";
|
|
|
28529
28564
|
|
|
28530
28565
|
// src/infrastructure/sms-stack.ts
|
|
28531
28566
|
init_esm_shims();
|
|
28567
|
+
init_constants();
|
|
28532
28568
|
import * as aws18 from "@pulumi/aws";
|
|
28533
28569
|
import * as pulumi24 from "@pulumi/pulumi";
|
|
28534
28570
|
init_resource_checks();
|
|
@@ -28648,7 +28684,7 @@ async function findExistingPhoneNumber(phoneNumberType) {
|
|
|
28648
28684
|
try {
|
|
28649
28685
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
28650
28686
|
const client = new PinpointSMSVoiceV2Client5({
|
|
28651
|
-
region:
|
|
28687
|
+
region: getDefaultRegion()
|
|
28652
28688
|
});
|
|
28653
28689
|
const numberTypeMap = {
|
|
28654
28690
|
simulator: "SIMULATOR",
|