@wraps.dev/cli 2.22.8 → 2.23.1
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/api-lambda.zip +0 -0
- package/dist/cli.js +912 -808
- package/dist/cli.js.map +1 -1
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/dist/selfhost-migrations/0058_email_log_sent_at_idx.sql +1 -0
- package/dist/selfhost-migrations/meta/_journal.json +7 -0
- package/package.json +3 -2
package/dist/cli.js
CHANGED
|
@@ -1605,7 +1605,7 @@ async function needsMigration(localPulumiDir, accountId, region) {
|
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
1607
|
async function migrateLocalPulumiState(localPulumiDir, bucketName, accountId, region) {
|
|
1608
|
-
const
|
|
1608
|
+
const pulumi37 = await import("@pulumi/pulumi/automation/index.js");
|
|
1609
1609
|
const stacksDir = join2(localPulumiDir, ".pulumi", "stacks");
|
|
1610
1610
|
const entries = await readdir(stacksDir);
|
|
1611
1611
|
for (const entry of entries) {
|
|
@@ -1621,12 +1621,12 @@ async function migrateLocalPulumiState(localPulumiDir, bucketName, accountId, re
|
|
|
1621
1621
|
for (const stackFile of stackFiles) {
|
|
1622
1622
|
const stackName = stackFile.replace(".json", "");
|
|
1623
1623
|
try {
|
|
1624
|
-
const localStack = await
|
|
1624
|
+
const localStack = await pulumi37.LocalWorkspace.selectStack({
|
|
1625
1625
|
stackName,
|
|
1626
1626
|
workDir: localPulumiDir
|
|
1627
1627
|
});
|
|
1628
1628
|
const state = await localStack.exportStack();
|
|
1629
|
-
const s3Stack = await
|
|
1629
|
+
const s3Stack = await pulumi37.LocalWorkspace.createOrSelectStack(
|
|
1630
1630
|
{
|
|
1631
1631
|
stackName,
|
|
1632
1632
|
projectName,
|
|
@@ -1748,8 +1748,8 @@ async function ensurePulumiWorkDir(options) {
|
|
|
1748
1748
|
);
|
|
1749
1749
|
return;
|
|
1750
1750
|
} catch (error) {
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1751
|
+
const clack66 = await import("@clack/prompts");
|
|
1752
|
+
clack66.log.warn(
|
|
1753
1753
|
`S3 state backend unavailable (${error instanceof Error ? error.message : error}). Using local state.`
|
|
1754
1754
|
);
|
|
1755
1755
|
}
|
|
@@ -6685,7 +6685,8 @@ var init_output = __esm({
|
|
|
6685
6685
|
return;
|
|
6686
6686
|
}
|
|
6687
6687
|
if (this.currentSpinner) {
|
|
6688
|
-
this.currentSpinner.stop(
|
|
6688
|
+
this.currentSpinner.stop("");
|
|
6689
|
+
this.currentSpinner = null;
|
|
6689
6690
|
}
|
|
6690
6691
|
clack8.log.success(message);
|
|
6691
6692
|
}
|
|
@@ -6697,7 +6698,8 @@ var init_output = __esm({
|
|
|
6697
6698
|
return;
|
|
6698
6699
|
}
|
|
6699
6700
|
if (this.currentSpinner) {
|
|
6700
|
-
this.currentSpinner.stop(
|
|
6701
|
+
this.currentSpinner.stop("");
|
|
6702
|
+
this.currentSpinner = null;
|
|
6701
6703
|
}
|
|
6702
6704
|
clack8.log.error(message);
|
|
6703
6705
|
}
|
|
@@ -6889,23 +6891,23 @@ async function withLockRetry(fn, options) {
|
|
|
6889
6891
|
if (parsed.code !== "STACK_LOCKED") {
|
|
6890
6892
|
throw error;
|
|
6891
6893
|
}
|
|
6892
|
-
const
|
|
6893
|
-
const
|
|
6894
|
+
const clack66 = await import("@clack/prompts");
|
|
6895
|
+
const pc70 = (await import("picocolors")).default;
|
|
6894
6896
|
if (options.autoConfirm) {
|
|
6895
|
-
|
|
6897
|
+
clack66.log.warn(
|
|
6896
6898
|
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
6897
6899
|
);
|
|
6898
6900
|
} else {
|
|
6899
|
-
const shouldClear = await
|
|
6900
|
-
message: `Stack is locked from a previous interrupted run. ${
|
|
6901
|
+
const shouldClear = await clack66.confirm({
|
|
6902
|
+
message: `Stack is locked from a previous interrupted run. ${pc70.yellow("Clear the stale lock and retry?")}`,
|
|
6901
6903
|
initialValue: true
|
|
6902
6904
|
});
|
|
6903
|
-
if (
|
|
6905
|
+
if (clack66.isCancel(shouldClear) || !shouldClear) {
|
|
6904
6906
|
throw errors.stackLocked();
|
|
6905
6907
|
}
|
|
6906
6908
|
}
|
|
6907
6909
|
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
6908
|
-
|
|
6910
|
+
clack66.log.info(
|
|
6909
6911
|
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
6910
6912
|
);
|
|
6911
6913
|
return fn();
|
|
@@ -8364,7 +8366,7 @@ async function deployInboundLambda(config2) {
|
|
|
8364
8366
|
const functionName = "wraps-inbound-email-processor";
|
|
8365
8367
|
const lambdaFunction = new aws17.lambda.Function(functionName, {
|
|
8366
8368
|
name: functionName,
|
|
8367
|
-
runtime: "
|
|
8369
|
+
runtime: "nodejs24.x",
|
|
8368
8370
|
handler: "index.handler",
|
|
8369
8371
|
role: lambdaRole.arn,
|
|
8370
8372
|
code: new pulumi13.asset.FileArchive(inboundProcessorCode),
|
|
@@ -10239,8 +10241,8 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
|
|
|
10239
10241
|
import { join as join23 } from "path";
|
|
10240
10242
|
import { Readable } from "stream";
|
|
10241
10243
|
import { pipeline } from "stream/promises";
|
|
10242
|
-
import { cancel as
|
|
10243
|
-
import
|
|
10244
|
+
import { cancel as cancel36, confirm as confirm30, intro as intro60, isCancel as isCancel41, log as log59 } from "@clack/prompts";
|
|
10245
|
+
import pc68 from "picocolors";
|
|
10244
10246
|
function isStandaloneInstall() {
|
|
10245
10247
|
return process.execPath.includes(".wraps/runtime");
|
|
10246
10248
|
}
|
|
@@ -10269,7 +10271,7 @@ function detectPlatformArch() {
|
|
|
10269
10271
|
return { platform: platform2, arch };
|
|
10270
10272
|
}
|
|
10271
10273
|
async function update(currentVersion) {
|
|
10272
|
-
|
|
10274
|
+
intro60(pc68.bold("Wraps CLI Update"));
|
|
10273
10275
|
const progress = new DeploymentProgress();
|
|
10274
10276
|
const result = await progress.execute(
|
|
10275
10277
|
"Checking for updates...",
|
|
@@ -10281,28 +10283,28 @@ async function update(currentVersion) {
|
|
|
10281
10283
|
}
|
|
10282
10284
|
const { version: latestVersion, release } = result;
|
|
10283
10285
|
if (currentVersion === latestVersion) {
|
|
10284
|
-
progress.succeed(`Already up to date ${
|
|
10286
|
+
progress.succeed(`Already up to date ${pc68.dim(`(v${currentVersion})`)}`);
|
|
10285
10287
|
return;
|
|
10286
10288
|
}
|
|
10287
10289
|
console.log();
|
|
10288
|
-
|
|
10289
|
-
`Current version: ${
|
|
10290
|
-
Latest version: ${
|
|
10290
|
+
log59.info(
|
|
10291
|
+
`Current version: ${pc68.dim(`v${currentVersion}`)}
|
|
10292
|
+
Latest version: ${pc68.cyan(`v${latestVersion}`)}`
|
|
10291
10293
|
);
|
|
10292
10294
|
console.log();
|
|
10293
10295
|
if (!isStandaloneInstall()) {
|
|
10294
|
-
|
|
10296
|
+
log59.info(
|
|
10295
10297
|
`You installed Wraps via npm. Update with:
|
|
10296
10298
|
|
|
10297
|
-
${
|
|
10299
|
+
${pc68.cyan("npm update -g @wraps.dev/cli")}`
|
|
10298
10300
|
);
|
|
10299
10301
|
return;
|
|
10300
10302
|
}
|
|
10301
|
-
const shouldUpdate = await
|
|
10303
|
+
const shouldUpdate = await confirm30({
|
|
10302
10304
|
message: `Update to v${latestVersion}?`
|
|
10303
10305
|
});
|
|
10304
|
-
if (
|
|
10305
|
-
|
|
10306
|
+
if (isCancel41(shouldUpdate) || !shouldUpdate) {
|
|
10307
|
+
cancel36("Update cancelled.");
|
|
10306
10308
|
return;
|
|
10307
10309
|
}
|
|
10308
10310
|
const { platform: platform2, arch } = detectPlatformArch();
|
|
@@ -10369,7 +10371,7 @@ async function update(currentVersion) {
|
|
|
10369
10371
|
});
|
|
10370
10372
|
console.log();
|
|
10371
10373
|
progress.succeed(
|
|
10372
|
-
`Updated to ${
|
|
10374
|
+
`Updated to ${pc68.cyan(`v${latestVersion}`)} successfully!`
|
|
10373
10375
|
);
|
|
10374
10376
|
} finally {
|
|
10375
10377
|
rmSync(tmp, { recursive: true, force: true });
|
|
@@ -10392,8 +10394,8 @@ init_esm_shims();
|
|
|
10392
10394
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10393
10395
|
import { dirname as dirname7, join as join24 } from "path";
|
|
10394
10396
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
10395
|
-
import * as
|
|
10396
|
-
import
|
|
10397
|
+
import * as clack65 from "@clack/prompts";
|
|
10398
|
+
import pc69 from "picocolors";
|
|
10397
10399
|
|
|
10398
10400
|
// src/commands/auth/login.ts
|
|
10399
10401
|
init_esm_shims();
|
|
@@ -24214,12 +24216,12 @@ async function emailLogsList(options) {
|
|
|
24214
24216
|
}
|
|
24215
24217
|
const COL = { time: 8, status: 11, to: 28, subject: 40, msgId: 18 };
|
|
24216
24218
|
const header = pc30.bold("Time".padEnd(COL.time)) + " " + pc30.bold("Status".padEnd(COL.status)) + " " + pc30.bold("To".padEnd(COL.to)) + " " + pc30.bold("Subject".padEnd(COL.subject)) + " " + pc30.bold("Message ID");
|
|
24217
|
-
const rows = data.logs.map((
|
|
24218
|
-
const time = relativeTime(
|
|
24219
|
-
const status2 = padVisible(colorStatus(
|
|
24220
|
-
const to = padVisible(truncate(
|
|
24221
|
-
const subject = padVisible(truncate(
|
|
24222
|
-
const msgId = truncate(
|
|
24219
|
+
const rows = data.logs.map((log61) => {
|
|
24220
|
+
const time = relativeTime(log61.createdAt).padEnd(COL.time);
|
|
24221
|
+
const status2 = padVisible(colorStatus(log61.status), COL.status);
|
|
24222
|
+
const to = padVisible(truncate(log61.recipient, COL.to), COL.to);
|
|
24223
|
+
const subject = padVisible(truncate(log61.subject, COL.subject), COL.subject);
|
|
24224
|
+
const msgId = truncate(log61.messageId, COL.msgId);
|
|
24223
24225
|
return `${time} ${status2} ${to} ${subject} ${msgId}`;
|
|
24224
24226
|
});
|
|
24225
24227
|
clack28.note(
|
|
@@ -24275,32 +24277,32 @@ async function emailLogsGet(options) {
|
|
|
24275
24277
|
}
|
|
24276
24278
|
return;
|
|
24277
24279
|
}
|
|
24278
|
-
const
|
|
24280
|
+
const log61 = await resp.json();
|
|
24279
24281
|
if (isJsonMode()) {
|
|
24280
|
-
jsonSuccess("email.logs.get",
|
|
24282
|
+
jsonSuccess("email.logs.get", log61);
|
|
24281
24283
|
return;
|
|
24282
24284
|
}
|
|
24283
24285
|
const kv = (label, value) => `${pc30.dim(label.padEnd(16))} ${value ?? pc30.dim("\u2014")}`;
|
|
24284
|
-
const sentAt =
|
|
24285
|
-
const deliveredAt =
|
|
24286
|
-
const bouncedAt =
|
|
24287
|
-
const createdAt = new Date(
|
|
24286
|
+
const sentAt = log61.sentAt ? new Date(log61.sentAt).toLocaleString() : null;
|
|
24287
|
+
const deliveredAt = log61.deliveredAt ? new Date(log61.deliveredAt).toLocaleString() : null;
|
|
24288
|
+
const bouncedAt = log61.bouncedAt ? new Date(log61.bouncedAt).toLocaleString() : null;
|
|
24289
|
+
const createdAt = new Date(log61.createdAt).toLocaleString();
|
|
24288
24290
|
const lines = [
|
|
24289
|
-
kv("Message ID:",
|
|
24290
|
-
kv("Status:",
|
|
24291
|
-
kv("To:",
|
|
24292
|
-
kv("From:",
|
|
24293
|
-
kv("Subject:",
|
|
24294
|
-
kv("Source:",
|
|
24291
|
+
kv("Message ID:", log61.messageId),
|
|
24292
|
+
kv("Status:", log61.status ? colorStatus(log61.status) : null),
|
|
24293
|
+
kv("To:", log61.recipient),
|
|
24294
|
+
kv("From:", log61.from),
|
|
24295
|
+
kv("Subject:", log61.subject),
|
|
24296
|
+
kv("Source:", log61.sourceType),
|
|
24295
24297
|
kv("Sent:", sentAt),
|
|
24296
24298
|
kv("Delivered:", deliveredAt),
|
|
24297
24299
|
kv("Bounced:", bouncedAt),
|
|
24298
|
-
...
|
|
24300
|
+
...log61.bouncedSubType ? [kv("Bounce type:", log61.bouncedSubType)] : [],
|
|
24299
24301
|
kv("Created:", createdAt)
|
|
24300
24302
|
];
|
|
24301
24303
|
clack28.note(
|
|
24302
24304
|
lines.join("\n"),
|
|
24303
|
-
`Log Detail \u2014 ${
|
|
24305
|
+
`Log Detail \u2014 ${log61.messageId ?? "(no message id)"}`
|
|
24304
24306
|
);
|
|
24305
24307
|
}
|
|
24306
24308
|
|
|
@@ -26389,7 +26391,7 @@ async function loadWrapsConfig(wrapsDir) {
|
|
|
26389
26391
|
write: false,
|
|
26390
26392
|
format: "esm",
|
|
26391
26393
|
platform: "node",
|
|
26392
|
-
target: "
|
|
26394
|
+
target: "node24",
|
|
26393
26395
|
alias: {
|
|
26394
26396
|
"@wraps.dev/client": join12(shimDir, "wraps-client-shim.mjs")
|
|
26395
26397
|
}
|
|
@@ -26451,7 +26453,7 @@ async function compileForPreview(filePath, slug, wrapsDir) {
|
|
|
26451
26453
|
write: false,
|
|
26452
26454
|
format: "esm",
|
|
26453
26455
|
platform: "node",
|
|
26454
|
-
target: "
|
|
26456
|
+
target: "node24",
|
|
26455
26457
|
jsx: "automatic",
|
|
26456
26458
|
nodePaths: cliNodeModules,
|
|
26457
26459
|
banner: {
|
|
@@ -27100,7 +27102,7 @@ async function compileTemplate(filePath, slug, source, sourceHash, wrapsDir) {
|
|
|
27100
27102
|
write: false,
|
|
27101
27103
|
format: "esm",
|
|
27102
27104
|
platform: "node",
|
|
27103
|
-
target: "
|
|
27105
|
+
target: "node24",
|
|
27104
27106
|
jsx: "automatic",
|
|
27105
27107
|
nodePaths: cliNodeModules,
|
|
27106
27108
|
// Provide require() for CJS dependencies bundled into ESM output
|
|
@@ -30591,7 +30593,7 @@ function durationToSeconds(duration) {
|
|
|
30591
30593
|
write: false,
|
|
30592
30594
|
format: "esm",
|
|
30593
30595
|
platform: "node",
|
|
30594
|
-
target: "
|
|
30596
|
+
target: "node24",
|
|
30595
30597
|
alias: {
|
|
30596
30598
|
"@wraps.dev/client": join17(shimDir, "wraps-client-shim.mjs")
|
|
30597
30599
|
}
|
|
@@ -31528,21 +31530,43 @@ async function licenseGenerate(options) {
|
|
|
31528
31530
|
tier = answer;
|
|
31529
31531
|
}
|
|
31530
31532
|
let expires = options.expires;
|
|
31533
|
+
if (expires === "never") {
|
|
31534
|
+
expires = "9999-12-31";
|
|
31535
|
+
}
|
|
31531
31536
|
if (!expires) {
|
|
31532
|
-
const answer = await clack40.
|
|
31533
|
-
message: "Expiry
|
|
31534
|
-
|
|
31535
|
-
|
|
31536
|
-
|
|
31537
|
-
|
|
31538
|
-
|
|
31539
|
-
|
|
31537
|
+
const answer = await clack40.select({
|
|
31538
|
+
message: "Expiry:",
|
|
31539
|
+
options: [
|
|
31540
|
+
{
|
|
31541
|
+
value: "never",
|
|
31542
|
+
label: "Never",
|
|
31543
|
+
hint: "9999-12-31 \u2014 for self-hosted customers"
|
|
31544
|
+
},
|
|
31545
|
+
{ value: "custom", label: "Custom date", hint: "YYYY-MM-DD" }
|
|
31546
|
+
]
|
|
31540
31547
|
});
|
|
31541
31548
|
if (clack40.isCancel(answer)) {
|
|
31542
31549
|
clack40.cancel("Cancelled.");
|
|
31543
31550
|
process.exit(0);
|
|
31544
31551
|
}
|
|
31545
|
-
|
|
31552
|
+
if (answer === "never") {
|
|
31553
|
+
expires = "9999-12-31";
|
|
31554
|
+
} else {
|
|
31555
|
+
const dateAnswer = await clack40.text({
|
|
31556
|
+
message: "Expiry date (YYYY-MM-DD):",
|
|
31557
|
+
placeholder: "2027-05-13",
|
|
31558
|
+
validate: (v) => {
|
|
31559
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(v)) return "Use YYYY-MM-DD format";
|
|
31560
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
31561
|
+
if (v <= today) return "Expiry date must be in the future";
|
|
31562
|
+
}
|
|
31563
|
+
});
|
|
31564
|
+
if (clack40.isCancel(dateAnswer)) {
|
|
31565
|
+
clack40.cancel("Cancelled.");
|
|
31566
|
+
process.exit(0);
|
|
31567
|
+
}
|
|
31568
|
+
expires = dateAnswer;
|
|
31569
|
+
}
|
|
31546
31570
|
}
|
|
31547
31571
|
const key = generateLicenseKey(tier, expires);
|
|
31548
31572
|
if (isJsonMode()) {
|
|
@@ -33743,7 +33767,7 @@ async function deploySelfhostStack(config2) {
|
|
|
33743
33767
|
});
|
|
33744
33768
|
const lambdaFn = new aws20.lambda.Function("wraps-selfhost-api", {
|
|
33745
33769
|
name: "wraps-selfhost-api",
|
|
33746
|
-
runtime: "
|
|
33770
|
+
runtime: "nodejs24.x",
|
|
33747
33771
|
handler: "lambda.handler",
|
|
33748
33772
|
role: role.arn,
|
|
33749
33773
|
code: new pulumi25.asset.FileArchive(config2.lambdaZipPath),
|
|
@@ -34073,14 +34097,16 @@ async function selfhostDeploy(options) {
|
|
|
34073
34097
|
savedMetadata.timestamp = deployedAt;
|
|
34074
34098
|
await saveConnectionMetadata(savedMetadata);
|
|
34075
34099
|
await progress.execute("Running database migrations", async () => {
|
|
34076
|
-
const {
|
|
34077
|
-
const { drizzle } = await import("drizzle-orm/
|
|
34078
|
-
const { migrate } = await import("drizzle-orm/
|
|
34079
|
-
neonConfig.poolQueryViaFetch = true;
|
|
34100
|
+
const { Pool } = await import("pg");
|
|
34101
|
+
const { drizzle } = await import("drizzle-orm/node-postgres");
|
|
34102
|
+
const { migrate } = await import("drizzle-orm/node-postgres/migrator");
|
|
34080
34103
|
const pool = new Pool({ connectionString: databaseUrl });
|
|
34081
34104
|
const db = drizzle(pool);
|
|
34082
|
-
|
|
34083
|
-
|
|
34105
|
+
try {
|
|
34106
|
+
await migrate(db, { migrationsFolder: bundledMigrationsDir });
|
|
34107
|
+
} finally {
|
|
34108
|
+
await pool.end();
|
|
34109
|
+
}
|
|
34084
34110
|
});
|
|
34085
34111
|
const createStack = async () => {
|
|
34086
34112
|
await ensurePulumiWorkDir({
|
|
@@ -34231,11 +34257,82 @@ async function selfhostDeploy(options) {
|
|
|
34231
34257
|
);
|
|
34232
34258
|
}
|
|
34233
34259
|
|
|
34234
|
-
// src/commands/selfhost/
|
|
34260
|
+
// src/commands/selfhost/destroy.ts
|
|
34235
34261
|
init_esm_shims();
|
|
34236
|
-
|
|
34262
|
+
init_aws();
|
|
34263
|
+
init_fs();
|
|
34264
|
+
init_metadata();
|
|
34265
|
+
init_output();
|
|
34266
|
+
init_pulumi();
|
|
34237
34267
|
import * as clack45 from "@clack/prompts";
|
|
34268
|
+
import * as pulumi27 from "@pulumi/pulumi";
|
|
34238
34269
|
import pc48 from "picocolors";
|
|
34270
|
+
async function selfhostDestroy(options) {
|
|
34271
|
+
clack45.intro(pc48.bold("Wraps Self-Hosted Destroy"));
|
|
34272
|
+
const progress = new DeploymentProgress();
|
|
34273
|
+
const identity = await progress.execute(
|
|
34274
|
+
"Validating AWS credentials",
|
|
34275
|
+
async () => validateAWSCredentials()
|
|
34276
|
+
);
|
|
34277
|
+
const region = options.region || process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1";
|
|
34278
|
+
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34279
|
+
if (!metadata?.services?.selfhost) {
|
|
34280
|
+
clack45.log.error("No self-hosted deployment found.");
|
|
34281
|
+
clack45.log.info(`Run ${pc48.cyan("wraps selfhost deploy")} first.`);
|
|
34282
|
+
process.exit(1);
|
|
34283
|
+
}
|
|
34284
|
+
const selfhostService = metadata.services.selfhost;
|
|
34285
|
+
if (!selfhostService.pulumiStackName) {
|
|
34286
|
+
clack45.log.error("This deployment was created with pnpm selfhost:deploy.");
|
|
34287
|
+
clack45.log.info(`Run ${pc48.cyan("pnpm selfhost:destroy")} instead.`);
|
|
34288
|
+
process.exit(1);
|
|
34289
|
+
}
|
|
34290
|
+
const stackName = selfhostService.pulumiStackName;
|
|
34291
|
+
if (!(options.yes || options.force)) {
|
|
34292
|
+
const confirmed = await clack45.confirm({
|
|
34293
|
+
message: pc48.red(
|
|
34294
|
+
`Destroy self-hosted deployment in ${pc48.cyan(identity.accountId)} / ${pc48.cyan(region)}?`
|
|
34295
|
+
),
|
|
34296
|
+
initialValue: false
|
|
34297
|
+
});
|
|
34298
|
+
if (clack45.isCancel(confirmed) || !confirmed) {
|
|
34299
|
+
clack45.cancel("Destruction cancelled.");
|
|
34300
|
+
process.exit(0);
|
|
34301
|
+
}
|
|
34302
|
+
}
|
|
34303
|
+
await progress.execute(
|
|
34304
|
+
"Destroying self-hosted infrastructure (this may take 2-3 minutes)",
|
|
34305
|
+
async () => {
|
|
34306
|
+
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
34307
|
+
const stack = await pulumi27.automation.LocalWorkspace.selectStack({
|
|
34308
|
+
stackName,
|
|
34309
|
+
workDir: getPulumiWorkDir()
|
|
34310
|
+
});
|
|
34311
|
+
await stack.refresh({ onOutput: () => {
|
|
34312
|
+
} });
|
|
34313
|
+
await withLockRetry(
|
|
34314
|
+
() => withTimeout(
|
|
34315
|
+
stack.destroy({ onOutput: () => {
|
|
34316
|
+
} }),
|
|
34317
|
+
DEFAULT_PULUMI_TIMEOUT_MS,
|
|
34318
|
+
"Pulumi destroy"
|
|
34319
|
+
),
|
|
34320
|
+
{ accountId: identity.accountId, region, autoConfirm: options.force }
|
|
34321
|
+
);
|
|
34322
|
+
await stack.workspace.removeStack(stackName);
|
|
34323
|
+
}
|
|
34324
|
+
);
|
|
34325
|
+
metadata.services.selfhost = void 0;
|
|
34326
|
+
metadata.timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
34327
|
+
await saveConnectionMetadata(metadata);
|
|
34328
|
+
clack45.outro(pc48.green("Self-hosted deployment destroyed."));
|
|
34329
|
+
}
|
|
34330
|
+
|
|
34331
|
+
// src/commands/selfhost/env.ts
|
|
34332
|
+
init_esm_shims();
|
|
34333
|
+
init_events();
|
|
34334
|
+
import * as clack46 from "@clack/prompts";
|
|
34335
|
+
import pc49 from "picocolors";
|
|
34239
34336
|
init_aws();
|
|
34240
34337
|
init_json_output();
|
|
34241
34338
|
init_metadata();
|
|
@@ -34243,7 +34340,7 @@ init_region_resolver();
|
|
|
34243
34340
|
async function selfhostEnv(options) {
|
|
34244
34341
|
const startTime = Date.now();
|
|
34245
34342
|
if (!isJsonMode()) {
|
|
34246
|
-
|
|
34343
|
+
clack46.intro(pc49.bold("Wraps Self-Hosted \u2014 Vercel Environment Variables"));
|
|
34247
34344
|
}
|
|
34248
34345
|
const identity = await validateAWSCredentials();
|
|
34249
34346
|
const region = await resolveRegionForCommand({
|
|
@@ -34254,10 +34351,10 @@ async function selfhostEnv(options) {
|
|
|
34254
34351
|
});
|
|
34255
34352
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34256
34353
|
if (!metadata?.services?.selfhost) {
|
|
34257
|
-
|
|
34354
|
+
clack46.log.error("No self-hosted deployment found");
|
|
34258
34355
|
console.log(
|
|
34259
34356
|
`
|
|
34260
|
-
Run ${
|
|
34357
|
+
Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
34261
34358
|
`
|
|
34262
34359
|
);
|
|
34263
34360
|
process.exit(1);
|
|
@@ -34266,12 +34363,12 @@ Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34266
34363
|
const { config: config2 } = metadata.services.selfhost;
|
|
34267
34364
|
const apiUrl = await reconcileSelfhostApiUrl(metadata, region);
|
|
34268
34365
|
if (!apiUrl) {
|
|
34269
|
-
|
|
34366
|
+
clack46.log.error(
|
|
34270
34367
|
"Self-hosted deployment is incomplete \u2014 API URL is not available yet."
|
|
34271
34368
|
);
|
|
34272
34369
|
console.log(
|
|
34273
34370
|
`
|
|
34274
|
-
The deployment may have failed partway through. Re-run ${
|
|
34371
|
+
The deployment may have failed partway through. Re-run ${pc49.cyan("wraps selfhost deploy")} to complete it.
|
|
34275
34372
|
`
|
|
34276
34373
|
);
|
|
34277
34374
|
process.exit(1);
|
|
@@ -34359,8 +34456,8 @@ The deployment may have failed partway through. Re-run ${pc48.cyan("wraps selfho
|
|
|
34359
34456
|
console.log(
|
|
34360
34457
|
`# AWS_ROLE_ARN=arn:aws:iam::${identity.accountId}:role/<your-vercel-backend-role>`
|
|
34361
34458
|
);
|
|
34362
|
-
|
|
34363
|
-
|
|
34459
|
+
clack46.outro(
|
|
34460
|
+
pc49.dim(
|
|
34364
34461
|
"Paste into Vercel \u2192 Settings \u2192 Environment Variables \u2192 Add from .env"
|
|
34365
34462
|
)
|
|
34366
34463
|
);
|
|
@@ -34373,9 +34470,9 @@ The deployment may have failed partway through. Re-run ${pc48.cyan("wraps selfho
|
|
|
34373
34470
|
// src/commands/selfhost/login.ts
|
|
34374
34471
|
init_esm_shims();
|
|
34375
34472
|
init_events();
|
|
34376
|
-
import * as
|
|
34473
|
+
import * as clack47 from "@clack/prompts";
|
|
34377
34474
|
import open2 from "open";
|
|
34378
|
-
import
|
|
34475
|
+
import pc50 from "picocolors";
|
|
34379
34476
|
init_aws();
|
|
34380
34477
|
init_config();
|
|
34381
34478
|
init_json_output();
|
|
@@ -34384,7 +34481,7 @@ init_region_resolver();
|
|
|
34384
34481
|
async function selfhostLogin(options) {
|
|
34385
34482
|
const startTime = Date.now();
|
|
34386
34483
|
if (!isJsonMode()) {
|
|
34387
|
-
|
|
34484
|
+
clack47.intro(pc50.bold("Wraps Self-Hosted \u203A Sign In"));
|
|
34388
34485
|
}
|
|
34389
34486
|
const identity = await validateAWSCredentials();
|
|
34390
34487
|
const region = await resolveRegionForCommand({
|
|
@@ -34395,19 +34492,19 @@ async function selfhostLogin(options) {
|
|
|
34395
34492
|
});
|
|
34396
34493
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34397
34494
|
if (!metadata?.services?.selfhost) {
|
|
34398
|
-
|
|
34495
|
+
clack47.log.error("No self-hosted deployment found.");
|
|
34399
34496
|
console.log(
|
|
34400
34497
|
`
|
|
34401
|
-
Run ${
|
|
34498
|
+
Run ${pc50.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane first.
|
|
34402
34499
|
`
|
|
34403
34500
|
);
|
|
34404
34501
|
process.exit(1);
|
|
34405
34502
|
return;
|
|
34406
34503
|
}
|
|
34407
34504
|
const { appUrl: baseURL } = metadata.services.selfhost.config;
|
|
34408
|
-
|
|
34505
|
+
clack47.log.info(`Connecting to: ${pc50.cyan(baseURL)}`);
|
|
34409
34506
|
const authClient = createCliAuthClient(baseURL);
|
|
34410
|
-
const spinner11 =
|
|
34507
|
+
const spinner11 = clack47.spinner();
|
|
34411
34508
|
const { data: codeData, error: codeError } = await authClient.device.code({
|
|
34412
34509
|
client_id: "wraps-cli"
|
|
34413
34510
|
});
|
|
@@ -34420,18 +34517,18 @@ Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34420
34517
|
trackError("DEVICE_AUTH_FAILED", "selfhost:login", {
|
|
34421
34518
|
step: "request_code"
|
|
34422
34519
|
});
|
|
34423
|
-
|
|
34424
|
-
`Failed to reach ${
|
|
34520
|
+
clack47.log.error(
|
|
34521
|
+
`Failed to reach ${pc50.cyan(baseURL)}. Make sure the dashboard is deployed and reachable.`
|
|
34425
34522
|
);
|
|
34426
34523
|
throw new Error("Failed to start device authorization.");
|
|
34427
34524
|
}
|
|
34428
34525
|
const { device_code, user_code, interval, expires_in } = codeData;
|
|
34429
34526
|
const formatted = `${user_code.slice(0, 4)}-${user_code.slice(4)}`;
|
|
34430
|
-
|
|
34431
|
-
|
|
34527
|
+
clack47.log.info(`Your code: ${pc50.bold(pc50.cyan(formatted))}`);
|
|
34528
|
+
clack47.log.info(`Visit: ${pc50.underline(`${baseURL}/device`)}`);
|
|
34432
34529
|
try {
|
|
34433
34530
|
await open2(`${baseURL}/device?user_code=${user_code}`);
|
|
34434
|
-
|
|
34531
|
+
clack47.log.info("Opening browser...");
|
|
34435
34532
|
} catch {
|
|
34436
34533
|
}
|
|
34437
34534
|
spinner11.start("Waiting for approval...");
|
|
@@ -34461,20 +34558,20 @@ Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34461
34558
|
duration_ms: Date.now() - startTime,
|
|
34462
34559
|
method: "device"
|
|
34463
34560
|
});
|
|
34464
|
-
|
|
34561
|
+
clack47.log.success("Signed in to your self-hosted Wraps instance.");
|
|
34465
34562
|
if (organizations.length === 1) {
|
|
34466
|
-
|
|
34563
|
+
clack47.log.info(`Organization: ${pc50.cyan(organizations[0].name)}`);
|
|
34467
34564
|
} else if (organizations.length > 1) {
|
|
34468
|
-
|
|
34565
|
+
clack47.log.info(`${organizations.length} organizations available`);
|
|
34469
34566
|
} else {
|
|
34470
|
-
|
|
34471
|
-
`No organizations found. Create one at ${
|
|
34567
|
+
clack47.log.info(
|
|
34568
|
+
`No organizations found. Create one at ${pc50.underline(`${baseURL}/onboarding`)} and run ${pc50.cyan("wraps selfhost login")} again.`
|
|
34472
34569
|
);
|
|
34473
34570
|
}
|
|
34474
34571
|
if (isJsonMode()) {
|
|
34475
34572
|
jsonSuccess("selfhost.login", { tokenType: "session", organizations });
|
|
34476
34573
|
} else {
|
|
34477
|
-
|
|
34574
|
+
clack47.outro(pc50.green("Done!"));
|
|
34478
34575
|
}
|
|
34479
34576
|
return;
|
|
34480
34577
|
}
|
|
@@ -34494,7 +34591,7 @@ Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34494
34591
|
});
|
|
34495
34592
|
trackError("ACCESS_DENIED", "selfhost:login", { step: "poll_token" });
|
|
34496
34593
|
spinner11.stop("Denied.");
|
|
34497
|
-
|
|
34594
|
+
clack47.log.error("Authorization was denied.");
|
|
34498
34595
|
throw new Error("Authorization was denied.");
|
|
34499
34596
|
}
|
|
34500
34597
|
if (errorCode === "expired_token") break;
|
|
@@ -34507,7 +34604,7 @@ Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34507
34604
|
});
|
|
34508
34605
|
trackError("DEVICE_CODE_EXPIRED", "selfhost:login", { step: "poll_token" });
|
|
34509
34606
|
spinner11.stop("Expired.");
|
|
34510
|
-
|
|
34607
|
+
clack47.log.error(
|
|
34511
34608
|
"Device code expired. Run `wraps selfhost login` to try again."
|
|
34512
34609
|
);
|
|
34513
34610
|
throw new Error("Device code expired.");
|
|
@@ -34521,11 +34618,11 @@ init_config();
|
|
|
34521
34618
|
init_json_output();
|
|
34522
34619
|
init_metadata();
|
|
34523
34620
|
init_region_resolver();
|
|
34524
|
-
import * as
|
|
34525
|
-
import
|
|
34621
|
+
import * as clack48 from "@clack/prompts";
|
|
34622
|
+
import pc51 from "picocolors";
|
|
34526
34623
|
async function selfhostLogout(options) {
|
|
34527
34624
|
if (!isJsonMode()) {
|
|
34528
|
-
|
|
34625
|
+
clack48.intro(pc51.bold("Wraps Self-Hosted \u203A Sign Out"));
|
|
34529
34626
|
}
|
|
34530
34627
|
const identity = await validateAWSCredentials();
|
|
34531
34628
|
const region = await resolveRegionForCommand({
|
|
@@ -34536,10 +34633,10 @@ async function selfhostLogout(options) {
|
|
|
34536
34633
|
});
|
|
34537
34634
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34538
34635
|
if (!metadata?.services?.selfhost) {
|
|
34539
|
-
|
|
34636
|
+
clack48.log.error("No self-hosted deployment found.");
|
|
34540
34637
|
console.log(
|
|
34541
34638
|
`
|
|
34542
|
-
Run ${
|
|
34639
|
+
Run ${pc51.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane first.
|
|
34543
34640
|
`
|
|
34544
34641
|
);
|
|
34545
34642
|
process.exit(1);
|
|
@@ -34558,7 +34655,7 @@ Run ${pc50.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34558
34655
|
});
|
|
34559
34656
|
return;
|
|
34560
34657
|
}
|
|
34561
|
-
|
|
34658
|
+
clack48.log.info(`Not signed in to ${pc51.cyan(baseURL)}.`);
|
|
34562
34659
|
return;
|
|
34563
34660
|
}
|
|
34564
34661
|
await clearSelfhostAuth(baseURL);
|
|
@@ -34567,14 +34664,14 @@ Run ${pc50.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34567
34664
|
jsonSuccess("selfhost.logout", { loggedOut: true });
|
|
34568
34665
|
return;
|
|
34569
34666
|
}
|
|
34570
|
-
|
|
34667
|
+
clack48.log.success(`Signed out of ${pc51.cyan(baseURL)}.`);
|
|
34571
34668
|
}
|
|
34572
34669
|
|
|
34573
34670
|
// src/commands/selfhost/status.ts
|
|
34574
34671
|
init_esm_shims();
|
|
34575
34672
|
init_events();
|
|
34576
|
-
import * as
|
|
34577
|
-
import
|
|
34673
|
+
import * as clack49 from "@clack/prompts";
|
|
34674
|
+
import pc52 from "picocolors";
|
|
34578
34675
|
init_aws();
|
|
34579
34676
|
init_json_output();
|
|
34580
34677
|
init_metadata();
|
|
@@ -34582,26 +34679,26 @@ init_output();
|
|
|
34582
34679
|
init_region_resolver();
|
|
34583
34680
|
function displaySelfhostStatus(options) {
|
|
34584
34681
|
const lines = [];
|
|
34585
|
-
lines.push(
|
|
34682
|
+
lines.push(pc52.bold(pc52.green("Self-Hosted Control Plane Active")));
|
|
34586
34683
|
lines.push("");
|
|
34587
|
-
lines.push(
|
|
34588
|
-
lines.push(` URL: ${
|
|
34589
|
-
lines.push(` Region: ${
|
|
34590
|
-
lines.push(` Deployed: ${
|
|
34684
|
+
lines.push(pc52.bold("API"));
|
|
34685
|
+
lines.push(` URL: ${pc52.cyan(options.apiUrl)}`);
|
|
34686
|
+
lines.push(` Region: ${pc52.cyan(options.region)}`);
|
|
34687
|
+
lines.push(` Deployed: ${pc52.dim(options.deployedAt)}`);
|
|
34591
34688
|
lines.push("");
|
|
34592
|
-
lines.push(
|
|
34593
|
-
lines.push(` App URL: ${
|
|
34594
|
-
lines.push(` License Key: ${
|
|
34689
|
+
lines.push(pc52.bold("Configuration"));
|
|
34690
|
+
lines.push(` App URL: ${pc52.cyan(options.appUrl)}`);
|
|
34691
|
+
lines.push(` License Key: ${pc52.dim(`${options.licenseKeyPrefix}...`)}`);
|
|
34595
34692
|
if (options.neonProjectId) {
|
|
34596
|
-
lines.push(` Neon Project: ${
|
|
34693
|
+
lines.push(` Neon Project: ${pc52.dim(options.neonProjectId)}`);
|
|
34597
34694
|
}
|
|
34598
|
-
|
|
34695
|
+
clack49.note(lines.join("\n"), "Self-Hosted Status");
|
|
34599
34696
|
}
|
|
34600
34697
|
async function selfhostStatus(options) {
|
|
34601
34698
|
const startTime = Date.now();
|
|
34602
34699
|
const progress = new DeploymentProgress();
|
|
34603
34700
|
if (!isJsonMode()) {
|
|
34604
|
-
|
|
34701
|
+
clack49.intro(pc52.bold("Wraps Self-Hosted Status"));
|
|
34605
34702
|
}
|
|
34606
34703
|
const identity = await progress.execute(
|
|
34607
34704
|
"Loading self-hosted status",
|
|
@@ -34616,10 +34713,10 @@ async function selfhostStatus(options) {
|
|
|
34616
34713
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34617
34714
|
if (!metadata?.services?.selfhost) {
|
|
34618
34715
|
progress.stop();
|
|
34619
|
-
|
|
34716
|
+
clack49.log.error("No self-hosted deployment found");
|
|
34620
34717
|
console.log(
|
|
34621
34718
|
`
|
|
34622
|
-
Run ${
|
|
34719
|
+
Run ${pc52.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
34623
34720
|
`
|
|
34624
34721
|
);
|
|
34625
34722
|
process.exit(1);
|
|
@@ -34642,15 +34739,15 @@ Run ${pc51.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34642
34739
|
}
|
|
34643
34740
|
displaySelfhostStatus(statusData);
|
|
34644
34741
|
console.log("");
|
|
34645
|
-
|
|
34742
|
+
clack49.log.info(pc52.bold("Commands:"));
|
|
34646
34743
|
console.log(
|
|
34647
|
-
` ${
|
|
34744
|
+
` ${pc52.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
|
|
34648
34745
|
);
|
|
34649
34746
|
trackCommand("selfhost:status", {
|
|
34650
34747
|
success: true,
|
|
34651
34748
|
duration_ms: Date.now() - startTime
|
|
34652
34749
|
});
|
|
34653
|
-
|
|
34750
|
+
clack49.outro(pc52.dim("Self-hosted deployment is active"));
|
|
34654
34751
|
}
|
|
34655
34752
|
|
|
34656
34753
|
// src/commands/selfhost/upgrade.ts
|
|
@@ -34658,9 +34755,9 @@ init_esm_shims();
|
|
|
34658
34755
|
import { existsSync as existsSync19 } from "fs";
|
|
34659
34756
|
import { dirname as dirname6, join as join21 } from "path";
|
|
34660
34757
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
34661
|
-
import * as
|
|
34662
|
-
import * as
|
|
34663
|
-
import
|
|
34758
|
+
import * as clack50 from "@clack/prompts";
|
|
34759
|
+
import * as pulumi28 from "@pulumi/pulumi";
|
|
34760
|
+
import pc53 from "picocolors";
|
|
34664
34761
|
init_events();
|
|
34665
34762
|
init_aws();
|
|
34666
34763
|
init_errors();
|
|
@@ -34676,7 +34773,7 @@ var bundledLambdaZip2 = join21(cliDir2, "api-lambda.zip");
|
|
|
34676
34773
|
async function selfhostUpgrade(options) {
|
|
34677
34774
|
const startTime = Date.now();
|
|
34678
34775
|
if (!isJsonMode()) {
|
|
34679
|
-
|
|
34776
|
+
clack50.intro(pc53.bold("Wraps Self-Hosted Control Plane Upgrade"));
|
|
34680
34777
|
}
|
|
34681
34778
|
const progress = new DeploymentProgress();
|
|
34682
34779
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -34691,7 +34788,7 @@ async function selfhostUpgrade(options) {
|
|
|
34691
34788
|
async () => validateAWSCredentialsWithDetails()
|
|
34692
34789
|
);
|
|
34693
34790
|
const identity = credentialResult.identity;
|
|
34694
|
-
progress.info(`Connected to AWS account: ${
|
|
34791
|
+
progress.info(`Connected to AWS account: ${pc53.cyan(identity.accountId)}`);
|
|
34695
34792
|
const region = await resolveRegionForCommand({
|
|
34696
34793
|
accountId: identity.accountId,
|
|
34697
34794
|
optionRegion: options.region,
|
|
@@ -34700,20 +34797,20 @@ async function selfhostUpgrade(options) {
|
|
|
34700
34797
|
});
|
|
34701
34798
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34702
34799
|
if (!metadata?.services?.selfhost) {
|
|
34703
|
-
|
|
34704
|
-
|
|
34800
|
+
clack50.log.error("No self-hosted deployment found.");
|
|
34801
|
+
clack50.log.info(`Run ${pc53.cyan("wraps selfhost deploy")} first.`);
|
|
34705
34802
|
process.exit(1);
|
|
34706
34803
|
}
|
|
34707
34804
|
const selfhostService = metadata.services.selfhost;
|
|
34708
34805
|
progress.info(`Found deployment from: ${selfhostService.deployedAt}`);
|
|
34709
|
-
progress.info(`API URL: ${
|
|
34806
|
+
progress.info(`API URL: ${pc53.cyan(selfhostService.apiUrl)}`);
|
|
34710
34807
|
if (!(options.yes || options.preview)) {
|
|
34711
|
-
const confirmed = await
|
|
34712
|
-
message: `Upgrade self-hosted deployment in ${
|
|
34808
|
+
const confirmed = await clack50.confirm({
|
|
34809
|
+
message: `Upgrade self-hosted deployment in ${pc53.cyan(identity.accountId)} / ${pc53.cyan(region)}?`,
|
|
34713
34810
|
initialValue: true
|
|
34714
34811
|
});
|
|
34715
|
-
if (
|
|
34716
|
-
|
|
34812
|
+
if (clack50.isCancel(confirmed) || !confirmed) {
|
|
34813
|
+
clack50.cancel("Upgrade cancelled.");
|
|
34717
34814
|
process.exit(0);
|
|
34718
34815
|
}
|
|
34719
34816
|
}
|
|
@@ -34727,7 +34824,7 @@ async function selfhostUpgrade(options) {
|
|
|
34727
34824
|
const lambdaZipPath = bundledLambdaZip2;
|
|
34728
34825
|
const createStack = async () => {
|
|
34729
34826
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
34730
|
-
const stack = await
|
|
34827
|
+
const stack = await pulumi28.automation.LocalWorkspace.createOrSelectStack(
|
|
34731
34828
|
{
|
|
34732
34829
|
stackName,
|
|
34733
34830
|
projectName: "wraps-selfhost",
|
|
@@ -34787,8 +34884,8 @@ async function selfhostUpgrade(options) {
|
|
|
34787
34884
|
resourceChanges: previewResult.resourceChanges,
|
|
34788
34885
|
commandName: "wraps selfhost upgrade"
|
|
34789
34886
|
});
|
|
34790
|
-
|
|
34791
|
-
|
|
34887
|
+
clack50.outro(
|
|
34888
|
+
pc53.green("Preview complete. Run without --preview to upgrade.")
|
|
34792
34889
|
);
|
|
34793
34890
|
return;
|
|
34794
34891
|
} catch (error) {
|
|
@@ -34859,28 +34956,28 @@ async function selfhostUpgrade(options) {
|
|
|
34859
34956
|
}
|
|
34860
34957
|
progress.info("Deployment metadata updated");
|
|
34861
34958
|
console.log("\n");
|
|
34862
|
-
|
|
34959
|
+
clack50.log.success(pc53.green(pc53.bold("Self-hosted Wraps API upgraded!")));
|
|
34863
34960
|
console.log("\n");
|
|
34864
|
-
|
|
34961
|
+
clack50.note(
|
|
34865
34962
|
[
|
|
34866
|
-
`${
|
|
34867
|
-
`${
|
|
34868
|
-
`${
|
|
34963
|
+
`${pc53.bold("API URL:")} ${pc53.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
|
|
34964
|
+
`${pc53.bold("Region:")} ${pc53.cyan(region)}`,
|
|
34965
|
+
`${pc53.bold("Lambda ARN:")} ${pc53.dim(outputs.lambdaArn)}`
|
|
34869
34966
|
].join("\n"),
|
|
34870
34967
|
"Self-Hosted Deployment"
|
|
34871
34968
|
);
|
|
34872
|
-
|
|
34873
|
-
|
|
34969
|
+
clack50.outro(
|
|
34970
|
+
pc53.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
|
|
34874
34971
|
);
|
|
34875
34972
|
}
|
|
34876
34973
|
|
|
34877
34974
|
// src/commands/shared/dashboard.ts
|
|
34878
34975
|
init_esm_shims();
|
|
34879
|
-
import * as
|
|
34880
|
-
import * as
|
|
34976
|
+
import * as clack51 from "@clack/prompts";
|
|
34977
|
+
import * as pulumi29 from "@pulumi/pulumi";
|
|
34881
34978
|
import getPort from "get-port";
|
|
34882
34979
|
import open3 from "open";
|
|
34883
|
-
import
|
|
34980
|
+
import pc54 from "picocolors";
|
|
34884
34981
|
|
|
34885
34982
|
// src/console/server.ts
|
|
34886
34983
|
init_esm_shims();
|
|
@@ -36080,13 +36177,13 @@ function createMetricsRouter(config2) {
|
|
|
36080
36177
|
const router = createRouter5();
|
|
36081
36178
|
router.get("/stream", async (req, res) => {
|
|
36082
36179
|
const connectionId = randomUUID().slice(0, 8);
|
|
36083
|
-
const
|
|
36180
|
+
const log61 = (msg, data) => {
|
|
36084
36181
|
console.log(JSON.stringify({ connectionId, msg, ...data }));
|
|
36085
36182
|
};
|
|
36086
36183
|
res.setHeader("Content-Type", "text/event-stream");
|
|
36087
36184
|
res.setHeader("Cache-Control", "no-cache");
|
|
36088
36185
|
res.setHeader("Connection", "keep-alive");
|
|
36089
|
-
|
|
36186
|
+
log61("SSE connected");
|
|
36090
36187
|
res.write('data: {"type":"connected"}\n\n');
|
|
36091
36188
|
const { startTime, endTime } = req.query;
|
|
36092
36189
|
const getTimeRange = () => ({
|
|
@@ -36096,7 +36193,7 @@ function createMetricsRouter(config2) {
|
|
|
36096
36193
|
const sendMetrics = async () => {
|
|
36097
36194
|
try {
|
|
36098
36195
|
const timeRange = getTimeRange();
|
|
36099
|
-
|
|
36196
|
+
log61("Fetching metrics", {
|
|
36100
36197
|
start: timeRange.start.toISOString(),
|
|
36101
36198
|
end: timeRange.end.toISOString()
|
|
36102
36199
|
});
|
|
@@ -36109,7 +36206,7 @@ function createMetricsRouter(config2) {
|
|
|
36109
36206
|
),
|
|
36110
36207
|
fetchSendQuota(config2.roleArn, config2.region)
|
|
36111
36208
|
]);
|
|
36112
|
-
|
|
36209
|
+
log61("Metrics fetched successfully");
|
|
36113
36210
|
const data = {
|
|
36114
36211
|
type: "metrics",
|
|
36115
36212
|
timestamp: Date.now(),
|
|
@@ -36139,7 +36236,7 @@ function createMetricsRouter(config2) {
|
|
|
36139
36236
|
const interval = setInterval(sendMetrics, 6e4);
|
|
36140
36237
|
req.on("close", () => {
|
|
36141
36238
|
clearInterval(interval);
|
|
36142
|
-
|
|
36239
|
+
log61("SSE disconnected");
|
|
36143
36240
|
});
|
|
36144
36241
|
});
|
|
36145
36242
|
router.get("/snapshot", async (_req, res) => {
|
|
@@ -37534,7 +37631,7 @@ init_output();
|
|
|
37534
37631
|
init_pulumi();
|
|
37535
37632
|
async function dashboard(options) {
|
|
37536
37633
|
await ensurePulumiInstalled();
|
|
37537
|
-
|
|
37634
|
+
clack51.intro(pc54.bold("Wraps Dashboard"));
|
|
37538
37635
|
const progress = new DeploymentProgress();
|
|
37539
37636
|
const identity = await progress.execute(
|
|
37540
37637
|
"Validating AWS credentials",
|
|
@@ -37547,7 +37644,7 @@ async function dashboard(options) {
|
|
|
37547
37644
|
try {
|
|
37548
37645
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
37549
37646
|
try {
|
|
37550
|
-
const emailStack = await
|
|
37647
|
+
const emailStack = await pulumi29.automation.LocalWorkspace.selectStack({
|
|
37551
37648
|
stackName: `wraps-${identity.accountId}-${region}`,
|
|
37552
37649
|
workDir: getPulumiWorkDir()
|
|
37553
37650
|
});
|
|
@@ -37555,7 +37652,7 @@ async function dashboard(options) {
|
|
|
37555
37652
|
} catch (_emailError) {
|
|
37556
37653
|
}
|
|
37557
37654
|
try {
|
|
37558
|
-
const smsStack = await
|
|
37655
|
+
const smsStack = await pulumi29.automation.LocalWorkspace.selectStack({
|
|
37559
37656
|
stackName: `wraps-sms-${identity.accountId}-${region}`,
|
|
37560
37657
|
workDir: getPulumiWorkDir()
|
|
37561
37658
|
});
|
|
@@ -37563,7 +37660,7 @@ async function dashboard(options) {
|
|
|
37563
37660
|
} catch (_smsError) {
|
|
37564
37661
|
}
|
|
37565
37662
|
try {
|
|
37566
|
-
const cdnStack = await
|
|
37663
|
+
const cdnStack = await pulumi29.automation.LocalWorkspace.selectStack({
|
|
37567
37664
|
stackName: `wraps-cdn-${identity.accountId}-${region}`,
|
|
37568
37665
|
workDir: getPulumiWorkDir()
|
|
37569
37666
|
});
|
|
@@ -37575,9 +37672,9 @@ async function dashboard(options) {
|
|
|
37575
37672
|
}
|
|
37576
37673
|
} catch (_error) {
|
|
37577
37674
|
progress.stop();
|
|
37578
|
-
|
|
37675
|
+
clack51.log.error("No Wraps infrastructure found");
|
|
37579
37676
|
console.log(
|
|
37580
|
-
`\\nRun ${
|
|
37677
|
+
`\\nRun ${pc54.cyan("wraps email init")}, ${pc54.cyan("wraps sms init")}, or ${pc54.cyan("wraps storage init")} to deploy infrastructure first.\\n`
|
|
37581
37678
|
);
|
|
37582
37679
|
process.exit(1);
|
|
37583
37680
|
}
|
|
@@ -37619,9 +37716,9 @@ async function dashboard(options) {
|
|
|
37619
37716
|
}
|
|
37620
37717
|
const port = options.port || await getPort({ port: [5555, 5556, 5557, 5558, 5559] });
|
|
37621
37718
|
progress.stop();
|
|
37622
|
-
|
|
37719
|
+
clack51.log.success("Starting dashboard server...");
|
|
37623
37720
|
console.log(
|
|
37624
|
-
`${
|
|
37721
|
+
`${pc54.dim("Using current AWS credentials (no role assumption)")}\\n`
|
|
37625
37722
|
);
|
|
37626
37723
|
const { url } = await startConsoleServer({
|
|
37627
37724
|
port,
|
|
@@ -37654,8 +37751,8 @@ async function dashboard(options) {
|
|
|
37654
37751
|
cdnCustomDomain,
|
|
37655
37752
|
cdnCertificateArn
|
|
37656
37753
|
});
|
|
37657
|
-
console.log(`\\n${
|
|
37658
|
-
console.log(`${
|
|
37754
|
+
console.log(`\\n${pc54.bold("Dashboard:")} ${pc54.cyan(url)}`);
|
|
37755
|
+
console.log(`${pc54.dim("Press Ctrl+C to stop")}\\n`);
|
|
37659
37756
|
getTelemetryClient().showFooterOnce();
|
|
37660
37757
|
if (!options.noOpen) {
|
|
37661
37758
|
await open3(url);
|
|
@@ -37676,8 +37773,8 @@ init_aws();
|
|
|
37676
37773
|
init_errors();
|
|
37677
37774
|
init_json_output();
|
|
37678
37775
|
init_metadata();
|
|
37679
|
-
import * as
|
|
37680
|
-
import
|
|
37776
|
+
import * as clack52 from "@clack/prompts";
|
|
37777
|
+
import pc55 from "picocolors";
|
|
37681
37778
|
async function destroy(options) {
|
|
37682
37779
|
trackCommand("destroy", { success: true });
|
|
37683
37780
|
if (isJsonMode() && !options.force) {
|
|
@@ -37688,9 +37785,9 @@ async function destroy(options) {
|
|
|
37688
37785
|
);
|
|
37689
37786
|
}
|
|
37690
37787
|
if (!isJsonMode()) {
|
|
37691
|
-
|
|
37788
|
+
clack52.intro(pc55.bold("Wraps Infrastructure Teardown"));
|
|
37692
37789
|
}
|
|
37693
|
-
const spinner11 =
|
|
37790
|
+
const spinner11 = clack52.spinner();
|
|
37694
37791
|
spinner11.start("Validating AWS credentials");
|
|
37695
37792
|
let identity;
|
|
37696
37793
|
try {
|
|
@@ -37707,17 +37804,17 @@ async function destroy(options) {
|
|
|
37707
37804
|
deployedServices.push("email");
|
|
37708
37805
|
}
|
|
37709
37806
|
if (deployedServices.length === 0) {
|
|
37710
|
-
|
|
37807
|
+
clack52.log.warn("No Wraps services found in this region");
|
|
37711
37808
|
console.log(
|
|
37712
37809
|
`
|
|
37713
|
-
Run ${
|
|
37810
|
+
Run ${pc55.cyan("wraps email init")} to deploy infrastructure.
|
|
37714
37811
|
`
|
|
37715
37812
|
);
|
|
37716
37813
|
process.exit(0);
|
|
37717
37814
|
}
|
|
37718
37815
|
if (deployedServices.length === 1) {
|
|
37719
37816
|
const service = deployedServices[0];
|
|
37720
|
-
|
|
37817
|
+
clack52.log.info(`Found ${pc55.cyan(service)} service deployed`);
|
|
37721
37818
|
if (service === "email") {
|
|
37722
37819
|
await emailDestroy(options);
|
|
37723
37820
|
return;
|
|
@@ -37732,7 +37829,7 @@ Run ${pc54.cyan("wraps email init")} to deploy infrastructure.
|
|
|
37732
37829
|
jsonSuccess("destroy", { destroyed: true });
|
|
37733
37830
|
return;
|
|
37734
37831
|
}
|
|
37735
|
-
const serviceToDestroy = await
|
|
37832
|
+
const serviceToDestroy = await clack52.select({
|
|
37736
37833
|
message: "Which service would you like to destroy?",
|
|
37737
37834
|
options: [
|
|
37738
37835
|
...deployedServices.map((s) => ({
|
|
@@ -37747,15 +37844,15 @@ Run ${pc54.cyan("wraps email init")} to deploy infrastructure.
|
|
|
37747
37844
|
}
|
|
37748
37845
|
]
|
|
37749
37846
|
});
|
|
37750
|
-
if (
|
|
37751
|
-
|
|
37847
|
+
if (clack52.isCancel(serviceToDestroy)) {
|
|
37848
|
+
clack52.cancel("Operation cancelled.");
|
|
37752
37849
|
process.exit(0);
|
|
37753
37850
|
}
|
|
37754
37851
|
if ((serviceToDestroy === "email" || serviceToDestroy === "all") && deployedServices.includes("email")) {
|
|
37755
37852
|
await emailDestroy(options);
|
|
37756
37853
|
}
|
|
37757
37854
|
if (serviceToDestroy === "all") {
|
|
37758
|
-
|
|
37855
|
+
clack52.outro(pc55.green("All Wraps infrastructure has been removed"));
|
|
37759
37856
|
}
|
|
37760
37857
|
}
|
|
37761
37858
|
|
|
@@ -37767,31 +37864,31 @@ init_fs();
|
|
|
37767
37864
|
init_json_output();
|
|
37768
37865
|
init_output();
|
|
37769
37866
|
init_pulumi();
|
|
37770
|
-
import * as
|
|
37771
|
-
import * as
|
|
37772
|
-
import
|
|
37867
|
+
import * as clack53 from "@clack/prompts";
|
|
37868
|
+
import * as pulumi30 from "@pulumi/pulumi";
|
|
37869
|
+
import pc56 from "picocolors";
|
|
37773
37870
|
async function status(options) {
|
|
37774
37871
|
await ensurePulumiInstalled();
|
|
37775
37872
|
const startTime = Date.now();
|
|
37776
37873
|
const progress = new DeploymentProgress();
|
|
37777
37874
|
if (!isJsonMode()) {
|
|
37778
|
-
|
|
37875
|
+
clack53.intro(pc56.bold("Wraps Infrastructure Status"));
|
|
37779
37876
|
}
|
|
37780
37877
|
const identity = await progress.execute(
|
|
37781
37878
|
"Loading infrastructure status",
|
|
37782
37879
|
async () => validateAWSCredentials()
|
|
37783
37880
|
);
|
|
37784
37881
|
if (!isJsonMode()) {
|
|
37785
|
-
progress.info(`AWS Account: ${
|
|
37882
|
+
progress.info(`AWS Account: ${pc56.cyan(identity.accountId)}`);
|
|
37786
37883
|
}
|
|
37787
37884
|
const region = options.region || await getAWSRegion();
|
|
37788
37885
|
if (!isJsonMode()) {
|
|
37789
|
-
progress.info(`Region: ${
|
|
37886
|
+
progress.info(`Region: ${pc56.cyan(region)}`);
|
|
37790
37887
|
}
|
|
37791
37888
|
const services = [];
|
|
37792
37889
|
try {
|
|
37793
37890
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
37794
|
-
const emailStack = await
|
|
37891
|
+
const emailStack = await pulumi30.automation.LocalWorkspace.selectStack({
|
|
37795
37892
|
stackName: `wraps-${identity.accountId}-${region}`,
|
|
37796
37893
|
workDir: getPulumiWorkDir()
|
|
37797
37894
|
});
|
|
@@ -37810,7 +37907,7 @@ async function status(options) {
|
|
|
37810
37907
|
services.push({ name: "Email", status: "not_deployed" });
|
|
37811
37908
|
}
|
|
37812
37909
|
try {
|
|
37813
|
-
const smsStack = await
|
|
37910
|
+
const smsStack = await pulumi30.automation.LocalWorkspace.selectStack({
|
|
37814
37911
|
stackName: `wraps-sms-${identity.accountId}-${region}`,
|
|
37815
37912
|
workDir: getPulumiWorkDir()
|
|
37816
37913
|
});
|
|
@@ -37838,35 +37935,35 @@ async function status(options) {
|
|
|
37838
37935
|
return;
|
|
37839
37936
|
}
|
|
37840
37937
|
console.log();
|
|
37841
|
-
|
|
37938
|
+
clack53.note(
|
|
37842
37939
|
services.map((s) => {
|
|
37843
37940
|
if (s.status === "deployed") {
|
|
37844
|
-
const details = s.details ?
|
|
37845
|
-
return ` ${
|
|
37941
|
+
const details = s.details ? pc56.dim(` (${s.details})`) : "";
|
|
37942
|
+
return ` ${pc56.green("\u2713")} ${s.name}${details}`;
|
|
37846
37943
|
}
|
|
37847
|
-
return ` ${
|
|
37944
|
+
return ` ${pc56.dim("\u25CB")} ${s.name} ${pc56.dim("(not deployed)")}`;
|
|
37848
37945
|
}).join("\n"),
|
|
37849
37946
|
"Services"
|
|
37850
37947
|
);
|
|
37851
37948
|
const hasDeployedServices = services.some((s) => s.status === "deployed");
|
|
37852
37949
|
if (hasDeployedServices) {
|
|
37853
37950
|
console.log(`
|
|
37854
|
-
${
|
|
37951
|
+
${pc56.bold("Details:")}`);
|
|
37855
37952
|
if (services.find((s) => s.name === "Email")?.status === "deployed") {
|
|
37856
|
-
console.log(` ${
|
|
37953
|
+
console.log(` ${pc56.dim("Email:")} ${pc56.cyan("wraps email status")}`);
|
|
37857
37954
|
}
|
|
37858
37955
|
if (services.find((s) => s.name === "SMS")?.status === "deployed") {
|
|
37859
|
-
console.log(` ${
|
|
37956
|
+
console.log(` ${pc56.dim("SMS:")} ${pc56.cyan("wraps sms status")}`);
|
|
37860
37957
|
}
|
|
37861
37958
|
} else {
|
|
37862
37959
|
console.log(`
|
|
37863
|
-
${
|
|
37864
|
-
console.log(` ${
|
|
37865
|
-
console.log(` ${
|
|
37960
|
+
${pc56.bold("Get started:")}`);
|
|
37961
|
+
console.log(` ${pc56.dim("Deploy email:")} ${pc56.cyan("wraps email init")}`);
|
|
37962
|
+
console.log(` ${pc56.dim("Deploy SMS:")} ${pc56.cyan("wraps sms init")}`);
|
|
37866
37963
|
}
|
|
37867
37964
|
console.log(`
|
|
37868
|
-
${
|
|
37869
|
-
console.log(`${
|
|
37965
|
+
${pc56.bold("Dashboard:")} ${pc56.blue("https://app.wraps.dev")}`);
|
|
37966
|
+
console.log(`${pc56.bold("Docs:")} ${pc56.blue("https://wraps.dev/docs")}
|
|
37870
37967
|
`);
|
|
37871
37968
|
trackCommand("status", {
|
|
37872
37969
|
success: true,
|
|
@@ -37877,14 +37974,14 @@ ${pc55.bold("Dashboard:")} ${pc55.blue("https://app.wraps.dev")}`);
|
|
|
37877
37974
|
|
|
37878
37975
|
// src/commands/sms/destroy.ts
|
|
37879
37976
|
init_esm_shims();
|
|
37880
|
-
import * as
|
|
37881
|
-
import * as
|
|
37882
|
-
import
|
|
37977
|
+
import * as clack54 from "@clack/prompts";
|
|
37978
|
+
import * as pulumi32 from "@pulumi/pulumi";
|
|
37979
|
+
import pc57 from "picocolors";
|
|
37883
37980
|
|
|
37884
37981
|
// src/infrastructure/sms-stack.ts
|
|
37885
37982
|
init_esm_shims();
|
|
37886
37983
|
import * as aws21 from "@pulumi/aws";
|
|
37887
|
-
import * as
|
|
37984
|
+
import * as pulumi31 from "@pulumi/pulumi";
|
|
37888
37985
|
init_resource_checks();
|
|
37889
37986
|
async function createSMSIAMRole(config2) {
|
|
37890
37987
|
const statements = [];
|
|
@@ -38164,7 +38261,7 @@ async function createSMSSNSResources(config2) {
|
|
|
38164
38261
|
});
|
|
38165
38262
|
new aws21.sqs.QueuePolicy("wraps-sms-events-queue-policy", {
|
|
38166
38263
|
queueUrl: config2.queueUrl,
|
|
38167
|
-
policy:
|
|
38264
|
+
policy: pulumi31.all([config2.queueArn, topic.arn]).apply(
|
|
38168
38265
|
([queueArn, topicArn2]) => JSON.stringify({
|
|
38169
38266
|
Version: "2012-10-17",
|
|
38170
38267
|
Statement: [
|
|
@@ -38263,7 +38360,7 @@ async function deploySMSLambdaFunction(config2) {
|
|
|
38263
38360
|
});
|
|
38264
38361
|
new aws21.iam.RolePolicy("wraps-sms-lambda-policy", {
|
|
38265
38362
|
role: lambdaRole.name,
|
|
38266
|
-
policy:
|
|
38363
|
+
policy: pulumi31.all([config2.tableName, config2.queueArn]).apply(
|
|
38267
38364
|
([tableName, queueArn]) => JSON.stringify({
|
|
38268
38365
|
Version: "2012-10-17",
|
|
38269
38366
|
Statement: [
|
|
@@ -38297,10 +38394,10 @@ async function deploySMSLambdaFunction(config2) {
|
|
|
38297
38394
|
"wraps-sms-event-processor",
|
|
38298
38395
|
{
|
|
38299
38396
|
name: "wraps-sms-event-processor",
|
|
38300
|
-
runtime: "
|
|
38397
|
+
runtime: "nodejs24.x",
|
|
38301
38398
|
handler: "index.handler",
|
|
38302
38399
|
role: lambdaRole.arn,
|
|
38303
|
-
code: new
|
|
38400
|
+
code: new pulumi31.asset.FileArchive(codeDir),
|
|
38304
38401
|
timeout: 300,
|
|
38305
38402
|
// 5 minutes
|
|
38306
38403
|
memorySize: 512,
|
|
@@ -38570,18 +38667,18 @@ async function createSMSProtectConfigurationWithSDK(configurationSetName, region
|
|
|
38570
38667
|
const existing = await client.send(
|
|
38571
38668
|
new DescribeProtectConfigurationsCommand({})
|
|
38572
38669
|
);
|
|
38573
|
-
for (const
|
|
38574
|
-
if (!(
|
|
38670
|
+
for (const pc70 of existing.ProtectConfigurations || []) {
|
|
38671
|
+
if (!(pc70.ProtectConfigurationArn && pc70.ProtectConfigurationId)) {
|
|
38575
38672
|
continue;
|
|
38576
38673
|
}
|
|
38577
38674
|
const tagsResponse = await client.send(
|
|
38578
38675
|
new ListTagsForResourceCommand({
|
|
38579
|
-
ResourceArn:
|
|
38676
|
+
ResourceArn: pc70.ProtectConfigurationArn
|
|
38580
38677
|
})
|
|
38581
38678
|
);
|
|
38582
38679
|
const nameTag = tagsResponse.Tags?.find((t) => t.Key === "Name");
|
|
38583
38680
|
if (nameTag?.Value === protectConfigName) {
|
|
38584
|
-
existingProtectConfigId =
|
|
38681
|
+
existingProtectConfigId = pc70.ProtectConfigurationId;
|
|
38585
38682
|
break;
|
|
38586
38683
|
}
|
|
38587
38684
|
}
|
|
@@ -38677,13 +38774,13 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
38677
38774
|
new DescribeProtectConfigurationsCommand({})
|
|
38678
38775
|
);
|
|
38679
38776
|
if (existing.ProtectConfigurations) {
|
|
38680
|
-
for (const
|
|
38681
|
-
if (!(
|
|
38777
|
+
for (const pc70 of existing.ProtectConfigurations) {
|
|
38778
|
+
if (!(pc70.ProtectConfigurationArn && pc70.ProtectConfigurationId)) {
|
|
38682
38779
|
continue;
|
|
38683
38780
|
}
|
|
38684
38781
|
const tagsResponse = await client.send(
|
|
38685
38782
|
new ListTagsForResourceCommand({
|
|
38686
|
-
ResourceArn:
|
|
38783
|
+
ResourceArn: pc70.ProtectConfigurationArn
|
|
38687
38784
|
})
|
|
38688
38785
|
);
|
|
38689
38786
|
const isWrapsManaged = tagsResponse.Tags?.some(
|
|
@@ -38692,7 +38789,7 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
38692
38789
|
if (isWrapsManaged) {
|
|
38693
38790
|
await client.send(
|
|
38694
38791
|
new DeleteProtectConfigurationCommand({
|
|
38695
|
-
ProtectConfigurationId:
|
|
38792
|
+
ProtectConfigurationId: pc70.ProtectConfigurationId
|
|
38696
38793
|
})
|
|
38697
38794
|
);
|
|
38698
38795
|
}
|
|
@@ -38727,8 +38824,8 @@ async function smsDestroy(options) {
|
|
|
38727
38824
|
);
|
|
38728
38825
|
}
|
|
38729
38826
|
if (!isJsonMode()) {
|
|
38730
|
-
|
|
38731
|
-
|
|
38827
|
+
clack54.intro(
|
|
38828
|
+
pc57.bold(
|
|
38732
38829
|
options.preview ? "SMS Infrastructure Destruction Preview" : "SMS Infrastructure Teardown"
|
|
38733
38830
|
)
|
|
38734
38831
|
);
|
|
@@ -38754,15 +38851,15 @@ async function smsDestroy(options) {
|
|
|
38754
38851
|
`Available regions: ${smsConnections.map((c) => c.region).join(", ")}`
|
|
38755
38852
|
);
|
|
38756
38853
|
}
|
|
38757
|
-
const selectedRegion = await
|
|
38854
|
+
const selectedRegion = await clack54.select({
|
|
38758
38855
|
message: "Multiple SMS deployments found. Which region to destroy?",
|
|
38759
38856
|
options: smsConnections.map((conn) => ({
|
|
38760
38857
|
value: conn.region,
|
|
38761
38858
|
label: conn.region
|
|
38762
38859
|
}))
|
|
38763
38860
|
});
|
|
38764
|
-
if (
|
|
38765
|
-
|
|
38861
|
+
if (clack54.isCancel(selectedRegion)) {
|
|
38862
|
+
clack54.cancel("Operation cancelled");
|
|
38766
38863
|
process.exit(0);
|
|
38767
38864
|
}
|
|
38768
38865
|
region = selectedRegion;
|
|
@@ -38773,18 +38870,18 @@ async function smsDestroy(options) {
|
|
|
38773
38870
|
const storedStackName = smsService?.pulumiStackName;
|
|
38774
38871
|
if (!smsService) {
|
|
38775
38872
|
progress.stop();
|
|
38776
|
-
|
|
38873
|
+
clack54.log.warn("No SMS infrastructure found");
|
|
38777
38874
|
process.exit(0);
|
|
38778
38875
|
}
|
|
38779
38876
|
if (!(options.force || options.preview)) {
|
|
38780
|
-
const confirmed = await
|
|
38781
|
-
message:
|
|
38877
|
+
const confirmed = await clack54.confirm({
|
|
38878
|
+
message: pc57.red(
|
|
38782
38879
|
"Are you sure you want to destroy all SMS infrastructure?"
|
|
38783
38880
|
),
|
|
38784
38881
|
initialValue: false
|
|
38785
38882
|
});
|
|
38786
|
-
if (
|
|
38787
|
-
|
|
38883
|
+
if (clack54.isCancel(confirmed) || !confirmed) {
|
|
38884
|
+
clack54.cancel("Destruction cancelled.");
|
|
38788
38885
|
process.exit(0);
|
|
38789
38886
|
}
|
|
38790
38887
|
}
|
|
@@ -38797,7 +38894,7 @@ async function smsDestroy(options) {
|
|
|
38797
38894
|
const stackName = storedStackName || `wraps-sms-${identity.accountId}-${region}`;
|
|
38798
38895
|
let stack;
|
|
38799
38896
|
try {
|
|
38800
|
-
stack = await
|
|
38897
|
+
stack = await pulumi32.automation.LocalWorkspace.selectStack({
|
|
38801
38898
|
stackName,
|
|
38802
38899
|
workDir: getPulumiWorkDir()
|
|
38803
38900
|
});
|
|
@@ -38816,8 +38913,8 @@ async function smsDestroy(options) {
|
|
|
38816
38913
|
costEstimate: "Monthly cost after destruction: $0.00",
|
|
38817
38914
|
commandName: "wraps sms destroy"
|
|
38818
38915
|
});
|
|
38819
|
-
|
|
38820
|
-
|
|
38916
|
+
clack54.outro(
|
|
38917
|
+
pc57.green("Preview complete. Run without --preview to destroy.")
|
|
38821
38918
|
);
|
|
38822
38919
|
trackServiceRemoved("sms", {
|
|
38823
38920
|
preview: true,
|
|
@@ -38828,7 +38925,7 @@ async function smsDestroy(options) {
|
|
|
38828
38925
|
progress.stop();
|
|
38829
38926
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38830
38927
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38831
|
-
|
|
38928
|
+
clack54.log.warn("No SMS infrastructure found to preview");
|
|
38832
38929
|
process.exit(0);
|
|
38833
38930
|
}
|
|
38834
38931
|
trackError("PREVIEW_FAILED", "sms destroy", { step: "preview" });
|
|
@@ -38855,7 +38952,7 @@ async function smsDestroy(options) {
|
|
|
38855
38952
|
const stackName = storedStackName || `wraps-sms-${identity.accountId}-${region}`;
|
|
38856
38953
|
let stack;
|
|
38857
38954
|
try {
|
|
38858
|
-
stack = await
|
|
38955
|
+
stack = await pulumi32.automation.LocalWorkspace.selectStack({
|
|
38859
38956
|
stackName,
|
|
38860
38957
|
workDir: getPulumiWorkDir()
|
|
38861
38958
|
});
|
|
@@ -38877,7 +38974,7 @@ async function smsDestroy(options) {
|
|
|
38877
38974
|
progress.stop();
|
|
38878
38975
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38879
38976
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38880
|
-
|
|
38977
|
+
clack54.log.warn("No SMS infrastructure found");
|
|
38881
38978
|
if (metadata) {
|
|
38882
38979
|
removeServiceFromConnection(metadata, "sms");
|
|
38883
38980
|
await saveConnectionMetadata(metadata);
|
|
@@ -38890,7 +38987,7 @@ async function smsDestroy(options) {
|
|
|
38890
38987
|
}
|
|
38891
38988
|
trackError("DESTROY_FAILED", "sms destroy", { step: "destroy" });
|
|
38892
38989
|
destroyFailed = true;
|
|
38893
|
-
|
|
38990
|
+
clack54.log.warn(
|
|
38894
38991
|
"Some resources may not have been fully removed. You can re-run this command or clean up manually in the AWS console."
|
|
38895
38992
|
);
|
|
38896
38993
|
}
|
|
@@ -38913,21 +39010,21 @@ async function smsDestroy(options) {
|
|
|
38913
39010
|
return;
|
|
38914
39011
|
}
|
|
38915
39012
|
if (destroyFailed) {
|
|
38916
|
-
|
|
38917
|
-
|
|
39013
|
+
clack54.outro(
|
|
39014
|
+
pc57.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
|
|
38918
39015
|
);
|
|
38919
39016
|
} else {
|
|
38920
|
-
|
|
39017
|
+
clack54.outro(pc57.green("SMS infrastructure has been removed"));
|
|
38921
39018
|
console.log(`
|
|
38922
|
-
${
|
|
38923
|
-
console.log(` ${
|
|
38924
|
-
console.log(` ${
|
|
38925
|
-
console.log(` ${
|
|
38926
|
-
console.log(` ${
|
|
39019
|
+
${pc57.bold("Cleaned up:")}`);
|
|
39020
|
+
console.log(` ${pc57.green("\u2713")} Phone number released`);
|
|
39021
|
+
console.log(` ${pc57.green("\u2713")} Configuration set deleted`);
|
|
39022
|
+
console.log(` ${pc57.green("\u2713")} Event processing infrastructure removed`);
|
|
39023
|
+
console.log(` ${pc57.green("\u2713")} IAM role deleted`);
|
|
38927
39024
|
}
|
|
38928
39025
|
console.log(
|
|
38929
39026
|
`
|
|
38930
|
-
Run ${
|
|
39027
|
+
Run ${pc57.cyan("wraps sms init")} to deploy infrastructure again.
|
|
38931
39028
|
`
|
|
38932
39029
|
);
|
|
38933
39030
|
trackServiceRemoved("sms", {
|
|
@@ -38939,9 +39036,9 @@ Run ${pc56.cyan("wraps sms init")} to deploy infrastructure again.
|
|
|
38939
39036
|
|
|
38940
39037
|
// src/commands/sms/init.ts
|
|
38941
39038
|
init_esm_shims();
|
|
38942
|
-
import * as
|
|
38943
|
-
import * as
|
|
38944
|
-
import
|
|
39039
|
+
import * as clack55 from "@clack/prompts";
|
|
39040
|
+
import * as pulumi33 from "@pulumi/pulumi";
|
|
39041
|
+
import pc58 from "picocolors";
|
|
38945
39042
|
init_events();
|
|
38946
39043
|
init_aws();
|
|
38947
39044
|
init_fs();
|
|
@@ -39360,7 +39457,7 @@ function validateSMSConfig(config2) {
|
|
|
39360
39457
|
|
|
39361
39458
|
// src/commands/sms/init.ts
|
|
39362
39459
|
async function promptPhoneNumberType() {
|
|
39363
|
-
const result = await
|
|
39460
|
+
const result = await clack55.select({
|
|
39364
39461
|
message: "Select phone number type:",
|
|
39365
39462
|
options: [
|
|
39366
39463
|
{
|
|
@@ -39380,14 +39477,14 @@ async function promptPhoneNumberType() {
|
|
|
39380
39477
|
}
|
|
39381
39478
|
]
|
|
39382
39479
|
});
|
|
39383
|
-
if (
|
|
39384
|
-
|
|
39480
|
+
if (clack55.isCancel(result)) {
|
|
39481
|
+
clack55.cancel("Operation cancelled.");
|
|
39385
39482
|
process.exit(0);
|
|
39386
39483
|
}
|
|
39387
39484
|
return result;
|
|
39388
39485
|
}
|
|
39389
39486
|
async function promptSMSPreset() {
|
|
39390
|
-
const result = await
|
|
39487
|
+
const result = await clack55.select({
|
|
39391
39488
|
message: "Choose configuration preset:",
|
|
39392
39489
|
options: [
|
|
39393
39490
|
{
|
|
@@ -39412,8 +39509,8 @@ async function promptSMSPreset() {
|
|
|
39412
39509
|
}
|
|
39413
39510
|
]
|
|
39414
39511
|
});
|
|
39415
|
-
if (
|
|
39416
|
-
|
|
39512
|
+
if (clack55.isCancel(result)) {
|
|
39513
|
+
clack55.cancel("Operation cancelled.");
|
|
39417
39514
|
process.exit(0);
|
|
39418
39515
|
}
|
|
39419
39516
|
return result;
|
|
@@ -39433,7 +39530,7 @@ var COMMON_COUNTRIES = [
|
|
|
39433
39530
|
{ code: "IN", name: "India" }
|
|
39434
39531
|
];
|
|
39435
39532
|
async function promptAllowedCountries() {
|
|
39436
|
-
const result = await
|
|
39533
|
+
const result = await clack55.multiselect({
|
|
39437
39534
|
message: "Select countries to allow SMS delivery (blocks all others):",
|
|
39438
39535
|
options: COMMON_COUNTRIES.map((c) => ({
|
|
39439
39536
|
value: c.code,
|
|
@@ -39442,14 +39539,14 @@ async function promptAllowedCountries() {
|
|
|
39442
39539
|
initialValues: ["US"],
|
|
39443
39540
|
required: true
|
|
39444
39541
|
});
|
|
39445
|
-
if (
|
|
39446
|
-
|
|
39542
|
+
if (clack55.isCancel(result)) {
|
|
39543
|
+
clack55.cancel("Operation cancelled.");
|
|
39447
39544
|
process.exit(0);
|
|
39448
39545
|
}
|
|
39449
39546
|
return result;
|
|
39450
39547
|
}
|
|
39451
39548
|
async function promptEstimatedSMSVolume() {
|
|
39452
|
-
const result = await
|
|
39549
|
+
const result = await clack55.select({
|
|
39453
39550
|
message: "Estimated messages per month:",
|
|
39454
39551
|
options: [
|
|
39455
39552
|
{ value: 100, label: "< 100 (Testing)" },
|
|
@@ -39459,8 +39556,8 @@ async function promptEstimatedSMSVolume() {
|
|
|
39459
39556
|
{ value: 1e5, label: "50,000+" }
|
|
39460
39557
|
]
|
|
39461
39558
|
});
|
|
39462
|
-
if (
|
|
39463
|
-
|
|
39559
|
+
if (clack55.isCancel(result)) {
|
|
39560
|
+
clack55.cancel("Operation cancelled.");
|
|
39464
39561
|
process.exit(0);
|
|
39465
39562
|
}
|
|
39466
39563
|
return result;
|
|
@@ -39468,7 +39565,7 @@ async function promptEstimatedSMSVolume() {
|
|
|
39468
39565
|
async function init3(options) {
|
|
39469
39566
|
const startTime = Date.now();
|
|
39470
39567
|
if (!isJsonMode()) {
|
|
39471
|
-
|
|
39568
|
+
clack55.intro(pc58.bold("Wraps SMS Infrastructure Setup"));
|
|
39472
39569
|
}
|
|
39473
39570
|
const progress = new DeploymentProgress();
|
|
39474
39571
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -39482,7 +39579,7 @@ async function init3(options) {
|
|
|
39482
39579
|
"Validating AWS credentials",
|
|
39483
39580
|
async () => validateAWSCredentials()
|
|
39484
39581
|
);
|
|
39485
|
-
progress.info(`Connected to AWS account: ${
|
|
39582
|
+
progress.info(`Connected to AWS account: ${pc58.cyan(identity.accountId)}`);
|
|
39486
39583
|
const provider = options.provider || await promptProvider();
|
|
39487
39584
|
const region = options.region || await promptRegion(await getAWSRegion());
|
|
39488
39585
|
let vercelConfig;
|
|
@@ -39494,10 +39591,10 @@ async function init3(options) {
|
|
|
39494
39591
|
region
|
|
39495
39592
|
);
|
|
39496
39593
|
if (existingConnection?.services?.sms) {
|
|
39497
|
-
|
|
39498
|
-
`SMS already configured for account ${
|
|
39594
|
+
clack55.log.warn(
|
|
39595
|
+
`SMS already configured for account ${pc58.cyan(identity.accountId)} in region ${pc58.cyan(region)}`
|
|
39499
39596
|
);
|
|
39500
|
-
|
|
39597
|
+
clack55.log.info(`Use ${pc58.cyan("wraps sms status")} to view current setup`);
|
|
39501
39598
|
process.exit(0);
|
|
39502
39599
|
}
|
|
39503
39600
|
let preset = options.preset;
|
|
@@ -39514,12 +39611,12 @@ async function init3(options) {
|
|
|
39514
39611
|
optOutManagement: true,
|
|
39515
39612
|
sendingEnabled: true
|
|
39516
39613
|
};
|
|
39517
|
-
const enableEventTracking = await
|
|
39614
|
+
const enableEventTracking = await clack55.confirm({
|
|
39518
39615
|
message: "Enable event tracking (EventBridge + DynamoDB)?",
|
|
39519
39616
|
initialValue: false
|
|
39520
39617
|
});
|
|
39521
|
-
if (
|
|
39522
|
-
|
|
39618
|
+
if (clack55.isCancel(enableEventTracking)) {
|
|
39619
|
+
clack55.cancel("Operation cancelled.");
|
|
39523
39620
|
process.exit(0);
|
|
39524
39621
|
}
|
|
39525
39622
|
if (enableEventTracking) {
|
|
@@ -39539,17 +39636,17 @@ async function init3(options) {
|
|
|
39539
39636
|
}
|
|
39540
39637
|
progress.info(
|
|
39541
39638
|
`
|
|
39542
|
-
${
|
|
39639
|
+
${pc58.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
|
|
39543
39640
|
);
|
|
39544
39641
|
const allowedCountries = await promptAllowedCountries();
|
|
39545
39642
|
let aitFiltering = false;
|
|
39546
39643
|
if (smsConfig.phoneNumberType !== "simulator") {
|
|
39547
|
-
const enableAIT = await
|
|
39644
|
+
const enableAIT = await clack55.confirm({
|
|
39548
39645
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
39549
39646
|
initialValue: false
|
|
39550
39647
|
});
|
|
39551
|
-
if (
|
|
39552
|
-
|
|
39648
|
+
if (clack55.isCancel(enableAIT)) {
|
|
39649
|
+
clack55.cancel("Operation cancelled.");
|
|
39553
39650
|
process.exit(0);
|
|
39554
39651
|
}
|
|
39555
39652
|
aitFiltering = enableAIT;
|
|
@@ -39561,21 +39658,21 @@ ${pc57.bold("Fraud Protection")} - Block SMS to countries where you don't do bus
|
|
|
39561
39658
|
};
|
|
39562
39659
|
const estimatedVolume = await promptEstimatedSMSVolume();
|
|
39563
39660
|
progress.info(`
|
|
39564
|
-
${
|
|
39661
|
+
${pc58.bold("Cost Estimate:")}`);
|
|
39565
39662
|
const costSummary = getSMSCostSummary(smsConfig, estimatedVolume);
|
|
39566
|
-
|
|
39663
|
+
clack55.log.info(costSummary);
|
|
39567
39664
|
const warnings = validateSMSConfig(smsConfig);
|
|
39568
39665
|
if (warnings.length > 0) {
|
|
39569
39666
|
progress.info(`
|
|
39570
|
-
${
|
|
39667
|
+
${pc58.yellow(pc58.bold("Important Notes:"))}`);
|
|
39571
39668
|
for (const warning of warnings) {
|
|
39572
|
-
|
|
39669
|
+
clack55.log.warn(warning);
|
|
39573
39670
|
}
|
|
39574
39671
|
}
|
|
39575
39672
|
if (!(options.yes || options.preview)) {
|
|
39576
39673
|
const confirmed = await confirmDeploy();
|
|
39577
39674
|
if (!confirmed) {
|
|
39578
|
-
|
|
39675
|
+
clack55.cancel("Deployment cancelled.");
|
|
39579
39676
|
process.exit(0);
|
|
39580
39677
|
}
|
|
39581
39678
|
}
|
|
@@ -39587,7 +39684,7 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39587
39684
|
};
|
|
39588
39685
|
const createStack = async () => {
|
|
39589
39686
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
39590
|
-
const stack = await
|
|
39687
|
+
const stack = await pulumi33.automation.LocalWorkspace.createOrSelectStack(
|
|
39591
39688
|
{
|
|
39592
39689
|
stackName: `wraps-sms-${identity.accountId}-${region}`,
|
|
39593
39690
|
projectName: "wraps-sms",
|
|
@@ -39635,8 +39732,8 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39635
39732
|
costEstimate: getSMSCostSummary(smsConfig, 0),
|
|
39636
39733
|
commandName: "wraps sms init"
|
|
39637
39734
|
});
|
|
39638
|
-
|
|
39639
|
-
|
|
39735
|
+
clack55.outro(
|
|
39736
|
+
pc58.green("Preview complete. Run without --preview to deploy.")
|
|
39640
39737
|
);
|
|
39641
39738
|
trackServiceInit("sms", true, {
|
|
39642
39739
|
provider,
|
|
@@ -39685,9 +39782,9 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39685
39782
|
} catch (sdkError) {
|
|
39686
39783
|
sdkResourceWarning = true;
|
|
39687
39784
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39688
|
-
|
|
39689
|
-
|
|
39690
|
-
`Run ${
|
|
39785
|
+
clack55.log.warn(`Phone pool creation failed: ${msg}`);
|
|
39786
|
+
clack55.log.info(
|
|
39787
|
+
`Run ${pc58.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39691
39788
|
);
|
|
39692
39789
|
}
|
|
39693
39790
|
}
|
|
@@ -39703,9 +39800,9 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39703
39800
|
} catch (sdkError) {
|
|
39704
39801
|
sdkResourceWarning = true;
|
|
39705
39802
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39706
|
-
|
|
39707
|
-
|
|
39708
|
-
`Run ${
|
|
39803
|
+
clack55.log.warn(`Event destination creation failed: ${msg}`);
|
|
39804
|
+
clack55.log.info(
|
|
39805
|
+
`Run ${pc58.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39709
39806
|
);
|
|
39710
39807
|
}
|
|
39711
39808
|
}
|
|
@@ -39724,14 +39821,14 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39724
39821
|
} catch (sdkError) {
|
|
39725
39822
|
sdkResourceWarning = true;
|
|
39726
39823
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39727
|
-
|
|
39728
|
-
|
|
39729
|
-
`Run ${
|
|
39824
|
+
clack55.log.warn(`Protect configuration creation failed: ${msg}`);
|
|
39825
|
+
clack55.log.info(
|
|
39826
|
+
`Run ${pc58.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39730
39827
|
);
|
|
39731
39828
|
}
|
|
39732
39829
|
}
|
|
39733
39830
|
if (sdkResourceWarning) {
|
|
39734
|
-
|
|
39831
|
+
clack55.log.warn(
|
|
39735
39832
|
"Some SDK resources failed to create. Core infrastructure is deployed."
|
|
39736
39833
|
);
|
|
39737
39834
|
}
|
|
@@ -39776,47 +39873,47 @@ ${pc57.yellow(pc57.bold("Important Notes:"))}`);
|
|
|
39776
39873
|
return;
|
|
39777
39874
|
}
|
|
39778
39875
|
console.log("\n");
|
|
39779
|
-
|
|
39876
|
+
clack55.log.success(pc58.green(pc58.bold("SMS infrastructure deployed!")));
|
|
39780
39877
|
console.log("\n");
|
|
39781
|
-
|
|
39878
|
+
clack55.note(
|
|
39782
39879
|
[
|
|
39783
|
-
`${
|
|
39784
|
-
`${
|
|
39785
|
-
`${
|
|
39786
|
-
`${
|
|
39787
|
-
outputs.tableName ? `${
|
|
39880
|
+
`${pc58.bold("Phone Number:")} ${pc58.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
39881
|
+
`${pc58.bold("Phone Type:")} ${pc58.cyan(smsConfig.phoneNumberType || "simulator")}`,
|
|
39882
|
+
`${pc58.bold("Config Set:")} ${pc58.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
39883
|
+
`${pc58.bold("Region:")} ${pc58.cyan(outputs.region)}`,
|
|
39884
|
+
outputs.tableName ? `${pc58.bold("History Table:")} ${pc58.cyan(outputs.tableName)}` : "",
|
|
39788
39885
|
"",
|
|
39789
|
-
|
|
39790
|
-
|
|
39886
|
+
pc58.dim("IAM Role:"),
|
|
39887
|
+
pc58.dim(` ${outputs.roleArn}`)
|
|
39791
39888
|
].filter(Boolean).join("\n"),
|
|
39792
39889
|
"SMS Infrastructure"
|
|
39793
39890
|
);
|
|
39794
39891
|
const nextSteps = [];
|
|
39795
39892
|
if (smsConfig.phoneNumberType === "toll-free") {
|
|
39796
39893
|
nextSteps.push(
|
|
39797
|
-
`${
|
|
39894
|
+
`${pc58.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
|
|
39798
39895
|
);
|
|
39799
39896
|
}
|
|
39800
39897
|
nextSteps.push(
|
|
39801
|
-
`${
|
|
39898
|
+
`${pc58.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39802
39899
|
);
|
|
39803
|
-
nextSteps.push(`${
|
|
39900
|
+
nextSteps.push(`${pc58.cyan("wraps sms status")} - View SMS configuration`);
|
|
39804
39901
|
console.log("\n");
|
|
39805
|
-
|
|
39902
|
+
clack55.log.info(pc58.bold("Next steps:"));
|
|
39806
39903
|
for (const step of nextSteps) {
|
|
39807
39904
|
console.log(` ${step}`);
|
|
39808
39905
|
}
|
|
39809
39906
|
console.log("\n");
|
|
39810
|
-
|
|
39811
|
-
console.log(
|
|
39907
|
+
clack55.log.info(pc58.bold("SDK Usage:"));
|
|
39908
|
+
console.log(pc58.dim(" npm install @wraps.dev/sms"));
|
|
39812
39909
|
console.log("");
|
|
39813
|
-
console.log(
|
|
39814
|
-
console.log(
|
|
39815
|
-
console.log(
|
|
39816
|
-
console.log(
|
|
39817
|
-
console.log(
|
|
39818
|
-
console.log(
|
|
39819
|
-
|
|
39910
|
+
console.log(pc58.dim(" import { Wraps } from '@wraps.dev/sms';"));
|
|
39911
|
+
console.log(pc58.dim(" const wraps = new Wraps();"));
|
|
39912
|
+
console.log(pc58.dim(" await wraps.sms.send({"));
|
|
39913
|
+
console.log(pc58.dim(" to: '+14155551234',"));
|
|
39914
|
+
console.log(pc58.dim(" message: 'Your code is 123456',"));
|
|
39915
|
+
console.log(pc58.dim(" });"));
|
|
39916
|
+
clack55.outro(pc58.green("Setup complete!"));
|
|
39820
39917
|
const duration = Date.now() - startTime;
|
|
39821
39918
|
const enabledFeatures = [];
|
|
39822
39919
|
if (smsConfig.tracking?.enabled) {
|
|
@@ -39852,8 +39949,8 @@ init_aws();
|
|
|
39852
39949
|
init_json_output();
|
|
39853
39950
|
init_metadata();
|
|
39854
39951
|
init_output();
|
|
39855
|
-
import * as
|
|
39856
|
-
import
|
|
39952
|
+
import * as clack56 from "@clack/prompts";
|
|
39953
|
+
import pc59 from "picocolors";
|
|
39857
39954
|
async function getPhoneNumberDetails(region) {
|
|
39858
39955
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39859
39956
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
@@ -39873,7 +39970,7 @@ async function getPhoneNumberDetails(region) {
|
|
|
39873
39970
|
return null;
|
|
39874
39971
|
} catch (error) {
|
|
39875
39972
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
39876
|
-
|
|
39973
|
+
clack56.log.error(`Error fetching phone number: ${errorMessage}`);
|
|
39877
39974
|
return null;
|
|
39878
39975
|
}
|
|
39879
39976
|
}
|
|
@@ -39894,7 +39991,7 @@ async function getRegistrationStatus(region, registrationId) {
|
|
|
39894
39991
|
async function smsRegister(options) {
|
|
39895
39992
|
const startTime = Date.now();
|
|
39896
39993
|
if (!isJsonMode()) {
|
|
39897
|
-
|
|
39994
|
+
clack56.intro(pc59.bold("Wraps SMS - Toll-Free Registration"));
|
|
39898
39995
|
}
|
|
39899
39996
|
const progress = new DeploymentProgress();
|
|
39900
39997
|
const identity = await progress.execute(
|
|
@@ -39907,8 +40004,8 @@ async function smsRegister(options) {
|
|
|
39907
40004
|
}
|
|
39908
40005
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39909
40006
|
if (!metadata?.services?.sms) {
|
|
39910
|
-
|
|
39911
|
-
|
|
40007
|
+
clack56.log.error("No SMS infrastructure found.");
|
|
40008
|
+
clack56.log.info(`Run ${pc59.cyan("wraps sms init")} first.`);
|
|
39912
40009
|
process.exit(1);
|
|
39913
40010
|
}
|
|
39914
40011
|
const phoneDetails = await progress.execute(
|
|
@@ -39916,7 +40013,7 @@ async function smsRegister(options) {
|
|
|
39916
40013
|
async () => getPhoneNumberDetails(region)
|
|
39917
40014
|
);
|
|
39918
40015
|
if (!phoneDetails) {
|
|
39919
|
-
|
|
40016
|
+
clack56.log.error("No phone number found.");
|
|
39920
40017
|
process.exit(1);
|
|
39921
40018
|
}
|
|
39922
40019
|
let registrationStatus = null;
|
|
@@ -39942,53 +40039,53 @@ async function smsRegister(options) {
|
|
|
39942
40039
|
}
|
|
39943
40040
|
console.log("");
|
|
39944
40041
|
console.log(
|
|
39945
|
-
`${
|
|
40042
|
+
`${pc59.bold("Phone Number:")} ${pc59.cyan(phoneDetails.phoneNumber)}`
|
|
39946
40043
|
);
|
|
39947
|
-
console.log(`${
|
|
40044
|
+
console.log(`${pc59.bold("Type:")} ${pc59.cyan(phoneDetails.type)}`);
|
|
39948
40045
|
console.log(
|
|
39949
|
-
`${
|
|
40046
|
+
`${pc59.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc59.green(phoneDetails.status) : pc59.yellow(phoneDetails.status)}`
|
|
39950
40047
|
);
|
|
39951
40048
|
if (registrationStatus) {
|
|
39952
|
-
console.log(`${
|
|
40049
|
+
console.log(`${pc59.bold("Registration:")} ${pc59.cyan(registrationStatus)}`);
|
|
39953
40050
|
}
|
|
39954
40051
|
console.log("");
|
|
39955
40052
|
if (phoneDetails.status === "ACTIVE") {
|
|
39956
|
-
|
|
40053
|
+
clack56.log.success("Your phone number is already ACTIVE and ready to use!");
|
|
39957
40054
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePoolsCommand } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39958
40055
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
39959
40056
|
const pools = await client.send(new DescribePoolsCommand({}));
|
|
39960
40057
|
if (!pools.Pools?.length) {
|
|
39961
|
-
|
|
40058
|
+
clack56.log.info("Run `wraps sms sync` to create the phone pool.");
|
|
39962
40059
|
}
|
|
39963
40060
|
process.exit(0);
|
|
39964
40061
|
}
|
|
39965
40062
|
if (phoneDetails.type !== "TOLL_FREE") {
|
|
39966
|
-
|
|
39967
|
-
|
|
40063
|
+
clack56.log.info("Only toll-free numbers require registration.");
|
|
40064
|
+
clack56.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
|
|
39968
40065
|
process.exit(0);
|
|
39969
40066
|
}
|
|
39970
|
-
console.log(
|
|
40067
|
+
console.log(pc59.bold("Toll-Free Registration Required"));
|
|
39971
40068
|
console.log("");
|
|
39972
40069
|
console.log(
|
|
39973
|
-
|
|
40070
|
+
pc59.dim("To send SMS at scale, you must register your toll-free number.")
|
|
39974
40071
|
);
|
|
39975
|
-
console.log(
|
|
40072
|
+
console.log(pc59.dim("This process typically takes 1-15 business days."));
|
|
39976
40073
|
console.log("");
|
|
39977
|
-
console.log(
|
|
39978
|
-
console.log(` ${
|
|
40074
|
+
console.log(pc59.bold("You'll need to provide:"));
|
|
40075
|
+
console.log(` ${pc59.dim("\u2022")} Business name and address`);
|
|
39979
40076
|
console.log(
|
|
39980
|
-
` ${
|
|
40077
|
+
` ${pc59.dim("\u2022")} Use case description (what messages you're sending)`
|
|
39981
40078
|
);
|
|
39982
|
-
console.log(` ${
|
|
39983
|
-
console.log(` ${
|
|
39984
|
-
console.log(` ${
|
|
40079
|
+
console.log(` ${pc59.dim("\u2022")} Sample messages (2-3 examples)`);
|
|
40080
|
+
console.log(` ${pc59.dim("\u2022")} How users opt-in to receive messages`);
|
|
40081
|
+
console.log(` ${pc59.dim("\u2022")} Expected monthly message volume`);
|
|
39985
40082
|
console.log("");
|
|
39986
|
-
const openConsole = await
|
|
40083
|
+
const openConsole = await clack56.confirm({
|
|
39987
40084
|
message: "Open AWS Console to start registration?",
|
|
39988
40085
|
initialValue: true
|
|
39989
40086
|
});
|
|
39990
|
-
if (
|
|
39991
|
-
|
|
40087
|
+
if (clack56.isCancel(openConsole)) {
|
|
40088
|
+
clack56.cancel("Registration cancelled.");
|
|
39992
40089
|
process.exit(0);
|
|
39993
40090
|
}
|
|
39994
40091
|
if (openConsole) {
|
|
@@ -39998,41 +40095,41 @@ async function smsRegister(options) {
|
|
|
39998
40095
|
const execAsync2 = promisify2(exec2);
|
|
39999
40096
|
try {
|
|
40000
40097
|
await execAsync2(`open "${consoleUrl}"`);
|
|
40001
|
-
|
|
40098
|
+
clack56.log.success("Opened AWS Console in your browser.");
|
|
40002
40099
|
} catch {
|
|
40003
40100
|
try {
|
|
40004
40101
|
await execAsync2(`xdg-open "${consoleUrl}"`);
|
|
40005
|
-
|
|
40102
|
+
clack56.log.success("Opened AWS Console in your browser.");
|
|
40006
40103
|
} catch {
|
|
40007
|
-
|
|
40104
|
+
clack56.log.info("Open this URL in your browser:");
|
|
40008
40105
|
console.log(`
|
|
40009
|
-
${
|
|
40106
|
+
${pc59.cyan(consoleUrl)}
|
|
40010
40107
|
`);
|
|
40011
40108
|
}
|
|
40012
40109
|
}
|
|
40013
40110
|
console.log("");
|
|
40014
|
-
console.log(
|
|
40111
|
+
console.log(pc59.bold("Next Steps:"));
|
|
40015
40112
|
console.log(
|
|
40016
|
-
` 1. Click ${
|
|
40113
|
+
` 1. Click ${pc59.cyan("Create registration")} in the AWS Console`
|
|
40017
40114
|
);
|
|
40018
|
-
console.log(` 2. Select ${
|
|
40115
|
+
console.log(` 2. Select ${pc59.cyan("Toll-free number registration")}`);
|
|
40019
40116
|
console.log(" 3. Fill out the business information form");
|
|
40020
40117
|
console.log(" 4. Submit and wait for approval (1-15 business days)");
|
|
40021
40118
|
console.log("");
|
|
40022
40119
|
console.log(
|
|
40023
|
-
|
|
40120
|
+
pc59.dim("Once approved, run `wraps sms sync` to complete setup.")
|
|
40024
40121
|
);
|
|
40025
40122
|
} else {
|
|
40026
40123
|
const consoleUrl = `https://${region}.console.aws.amazon.com/sms-voice/home?region=${region}#/registrations`;
|
|
40027
40124
|
console.log("");
|
|
40028
40125
|
console.log("When you're ready, go to:");
|
|
40029
|
-
console.log(` ${
|
|
40126
|
+
console.log(` ${pc59.cyan(consoleUrl)}`);
|
|
40030
40127
|
}
|
|
40031
40128
|
trackCommand("sms:register", {
|
|
40032
40129
|
success: true,
|
|
40033
40130
|
duration_ms: Date.now() - startTime
|
|
40034
40131
|
});
|
|
40035
|
-
|
|
40132
|
+
clack56.outro(pc59.dim("Good luck with your registration!"));
|
|
40036
40133
|
}
|
|
40037
40134
|
|
|
40038
40135
|
// src/commands/sms/status.ts
|
|
@@ -40045,54 +40142,54 @@ init_metadata();
|
|
|
40045
40142
|
init_output();
|
|
40046
40143
|
init_pulumi();
|
|
40047
40144
|
init_region_resolver();
|
|
40048
|
-
import * as
|
|
40049
|
-
import * as
|
|
40050
|
-
import
|
|
40145
|
+
import * as clack57 from "@clack/prompts";
|
|
40146
|
+
import * as pulumi34 from "@pulumi/pulumi";
|
|
40147
|
+
import pc60 from "picocolors";
|
|
40051
40148
|
function displaySMSStatus(options) {
|
|
40052
40149
|
const lines = [];
|
|
40053
|
-
lines.push(
|
|
40150
|
+
lines.push(pc60.bold(pc60.green("SMS Infrastructure Active")));
|
|
40054
40151
|
lines.push("");
|
|
40055
|
-
lines.push(
|
|
40152
|
+
lines.push(pc60.bold("Phone Number"));
|
|
40056
40153
|
if (options.phoneNumber) {
|
|
40057
|
-
lines.push(` Number: ${
|
|
40154
|
+
lines.push(` Number: ${pc60.cyan(options.phoneNumber)}`);
|
|
40058
40155
|
} else {
|
|
40059
|
-
lines.push(` Number: ${
|
|
40156
|
+
lines.push(` Number: ${pc60.yellow("Provisioning...")}`);
|
|
40060
40157
|
}
|
|
40061
|
-
lines.push(` Type: ${
|
|
40158
|
+
lines.push(` Type: ${pc60.cyan(options.phoneNumberType || "simulator")}`);
|
|
40062
40159
|
lines.push("");
|
|
40063
|
-
lines.push(
|
|
40064
|
-
lines.push(` Region: ${
|
|
40160
|
+
lines.push(pc60.bold("Configuration"));
|
|
40161
|
+
lines.push(` Region: ${pc60.cyan(options.region)}`);
|
|
40065
40162
|
if (options.preset) {
|
|
40066
|
-
lines.push(` Preset: ${
|
|
40163
|
+
lines.push(` Preset: ${pc60.cyan(options.preset)}`);
|
|
40067
40164
|
}
|
|
40068
40165
|
if (options.configSetName) {
|
|
40069
|
-
lines.push(` Config Set: ${
|
|
40166
|
+
lines.push(` Config Set: ${pc60.cyan(options.configSetName)}`);
|
|
40070
40167
|
}
|
|
40071
40168
|
lines.push("");
|
|
40072
|
-
lines.push(
|
|
40169
|
+
lines.push(pc60.bold("Features"));
|
|
40073
40170
|
lines.push(
|
|
40074
|
-
` Event Tracking: ${options.eventTracking ?
|
|
40171
|
+
` Event Tracking: ${options.eventTracking ? pc60.green("Enabled") : pc60.dim("Disabled")}`
|
|
40075
40172
|
);
|
|
40076
40173
|
if (options.tableName) {
|
|
40077
|
-
lines.push(` Message History: ${
|
|
40078
|
-
lines.push(` Table: ${
|
|
40174
|
+
lines.push(` Message History: ${pc60.green("Enabled")}`);
|
|
40175
|
+
lines.push(` Table: ${pc60.dim(options.tableName)}`);
|
|
40079
40176
|
}
|
|
40080
40177
|
if (options.queueUrl) {
|
|
40081
|
-
lines.push(` Event Queue: ${
|
|
40178
|
+
lines.push(` Event Queue: ${pc60.green("Enabled")}`);
|
|
40082
40179
|
}
|
|
40083
40180
|
lines.push("");
|
|
40084
40181
|
if (options.roleArn) {
|
|
40085
|
-
lines.push(
|
|
40086
|
-
lines.push(` ${
|
|
40182
|
+
lines.push(pc60.bold("IAM Role"));
|
|
40183
|
+
lines.push(` ${pc60.dim(options.roleArn)}`);
|
|
40087
40184
|
}
|
|
40088
|
-
|
|
40185
|
+
clack57.note(lines.join("\n"), "SMS Status");
|
|
40089
40186
|
}
|
|
40090
40187
|
async function smsStatus(options) {
|
|
40091
40188
|
await ensurePulumiInstalled();
|
|
40092
40189
|
const startTime = Date.now();
|
|
40093
40190
|
const progress = new DeploymentProgress();
|
|
40094
40191
|
if (!isJsonMode()) {
|
|
40095
|
-
|
|
40192
|
+
clack57.intro(pc60.bold("Wraps SMS Status"));
|
|
40096
40193
|
}
|
|
40097
40194
|
const identity = await progress.execute(
|
|
40098
40195
|
"Loading SMS infrastructure status",
|
|
@@ -40107,10 +40204,10 @@ async function smsStatus(options) {
|
|
|
40107
40204
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40108
40205
|
if (!metadata?.services?.sms) {
|
|
40109
40206
|
progress.stop();
|
|
40110
|
-
|
|
40207
|
+
clack57.log.error("No SMS infrastructure found");
|
|
40111
40208
|
console.log(
|
|
40112
40209
|
`
|
|
40113
|
-
Run ${
|
|
40210
|
+
Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
40114
40211
|
`
|
|
40115
40212
|
);
|
|
40116
40213
|
process.exit(1);
|
|
@@ -40119,7 +40216,7 @@ Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40119
40216
|
try {
|
|
40120
40217
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
40121
40218
|
const stackName = metadata.services.sms.pulumiStackName || `wraps-sms-${identity.accountId}-${region}`;
|
|
40122
|
-
const stack = await
|
|
40219
|
+
const stack = await pulumi34.automation.LocalWorkspace.selectStack({
|
|
40123
40220
|
stackName,
|
|
40124
40221
|
workDir: getPulumiWorkDir()
|
|
40125
40222
|
});
|
|
@@ -40146,25 +40243,25 @@ Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40146
40243
|
}
|
|
40147
40244
|
displaySMSStatus(smsStatusData);
|
|
40148
40245
|
console.log("");
|
|
40149
|
-
|
|
40246
|
+
clack57.log.info(pc60.bold("Commands:"));
|
|
40150
40247
|
console.log(
|
|
40151
|
-
` ${
|
|
40248
|
+
` ${pc60.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
40152
40249
|
);
|
|
40153
|
-
console.log(` ${
|
|
40250
|
+
console.log(` ${pc60.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
|
|
40154
40251
|
trackCommand("sms:status", {
|
|
40155
40252
|
success: true,
|
|
40156
40253
|
phone_type: smsConfig?.phoneNumberType,
|
|
40157
40254
|
event_tracking: smsConfig?.eventTracking?.enabled,
|
|
40158
40255
|
duration_ms: Date.now() - startTime
|
|
40159
40256
|
});
|
|
40160
|
-
|
|
40257
|
+
clack57.outro(pc60.dim("SMS infrastructure is ready"));
|
|
40161
40258
|
}
|
|
40162
40259
|
|
|
40163
40260
|
// src/commands/sms/sync.ts
|
|
40164
40261
|
init_esm_shims();
|
|
40165
|
-
import * as
|
|
40166
|
-
import * as
|
|
40167
|
-
import
|
|
40262
|
+
import * as clack58 from "@clack/prompts";
|
|
40263
|
+
import * as pulumi35 from "@pulumi/pulumi";
|
|
40264
|
+
import pc61 from "picocolors";
|
|
40168
40265
|
init_events();
|
|
40169
40266
|
init_aws();
|
|
40170
40267
|
init_errors();
|
|
@@ -40177,7 +40274,7 @@ async function smsSync(options) {
|
|
|
40177
40274
|
await ensurePulumiInstalled();
|
|
40178
40275
|
const startTime = Date.now();
|
|
40179
40276
|
if (!isJsonMode()) {
|
|
40180
|
-
|
|
40277
|
+
clack58.intro(pc61.bold("Wraps SMS Infrastructure Sync"));
|
|
40181
40278
|
}
|
|
40182
40279
|
const progress = new DeploymentProgress();
|
|
40183
40280
|
const identity = await progress.execute(
|
|
@@ -40189,10 +40286,10 @@ async function smsSync(options) {
|
|
|
40189
40286
|
const smsService = metadata?.services?.sms;
|
|
40190
40287
|
if (!smsService?.config) {
|
|
40191
40288
|
progress.stop();
|
|
40192
|
-
|
|
40289
|
+
clack58.log.error("No SMS infrastructure found to sync");
|
|
40193
40290
|
console.log(
|
|
40194
40291
|
`
|
|
40195
|
-
Run ${
|
|
40292
|
+
Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
40196
40293
|
`
|
|
40197
40294
|
);
|
|
40198
40295
|
process.exit(1);
|
|
@@ -40201,18 +40298,18 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
40201
40298
|
const storedStackName = smsService.pulumiStackName;
|
|
40202
40299
|
progress.info("Found existing SMS configuration");
|
|
40203
40300
|
progress.info(
|
|
40204
|
-
`Phone type: ${
|
|
40301
|
+
`Phone type: ${pc61.cyan(smsConfig.phoneNumberType || "simulator")}`
|
|
40205
40302
|
);
|
|
40206
40303
|
progress.info(
|
|
40207
|
-
`Event tracking: ${
|
|
40304
|
+
`Event tracking: ${pc61.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
|
|
40208
40305
|
);
|
|
40209
40306
|
if (!options.yes) {
|
|
40210
|
-
const confirmed = await
|
|
40307
|
+
const confirmed = await clack58.confirm({
|
|
40211
40308
|
message: "Sync SMS infrastructure? This will update Lambda code and recreate any missing resources.",
|
|
40212
40309
|
initialValue: true
|
|
40213
40310
|
});
|
|
40214
|
-
if (
|
|
40215
|
-
|
|
40311
|
+
if (clack58.isCancel(confirmed) || !confirmed) {
|
|
40312
|
+
clack58.cancel("Sync cancelled.");
|
|
40216
40313
|
process.exit(0);
|
|
40217
40314
|
}
|
|
40218
40315
|
}
|
|
@@ -40227,7 +40324,7 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
40227
40324
|
outputs = await progress.execute("Syncing SMS infrastructure", async () => {
|
|
40228
40325
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
40229
40326
|
const stackName = storedStackName || `wraps-sms-${identity.accountId}-${region}`;
|
|
40230
|
-
const stack = await
|
|
40327
|
+
const stack = await pulumi35.automation.LocalWorkspace.createOrSelectStack(
|
|
40231
40328
|
{
|
|
40232
40329
|
stackName,
|
|
40233
40330
|
projectName: "wraps-sms",
|
|
@@ -40317,7 +40414,7 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
40317
40414
|
throw errors.stackLocked();
|
|
40318
40415
|
}
|
|
40319
40416
|
trackError("SYNC_FAILED", "sms:sync", { step: "sync" });
|
|
40320
|
-
|
|
40417
|
+
clack58.log.error(`SMS sync failed: ${errorMessage}`);
|
|
40321
40418
|
process.exit(1);
|
|
40322
40419
|
}
|
|
40323
40420
|
if (metadata && smsService) {
|
|
@@ -40337,7 +40434,7 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
40337
40434
|
return;
|
|
40338
40435
|
}
|
|
40339
40436
|
console.log("\n");
|
|
40340
|
-
|
|
40437
|
+
clack58.log.success(pc61.green("SMS infrastructure synced successfully!"));
|
|
40341
40438
|
const changes = [];
|
|
40342
40439
|
if (outputs.lambdaFunctions?.length) {
|
|
40343
40440
|
changes.push("Lambda functions updated");
|
|
@@ -40345,13 +40442,13 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
40345
40442
|
changes.push("SDK resources verified");
|
|
40346
40443
|
console.log("");
|
|
40347
40444
|
for (const change of changes) {
|
|
40348
|
-
console.log(` ${
|
|
40445
|
+
console.log(` ${pc61.green("\u2713")} ${change}`);
|
|
40349
40446
|
}
|
|
40350
40447
|
trackCommand("sms:sync", {
|
|
40351
40448
|
success: true,
|
|
40352
40449
|
duration_ms: Date.now() - startTime
|
|
40353
40450
|
});
|
|
40354
|
-
|
|
40451
|
+
clack58.outro(pc61.green("Sync complete!"));
|
|
40355
40452
|
}
|
|
40356
40453
|
|
|
40357
40454
|
// src/commands/sms/test.ts
|
|
@@ -40366,8 +40463,8 @@ import {
|
|
|
40366
40463
|
PinpointSMSVoiceV2Client as PinpointSMSVoiceV2Client3,
|
|
40367
40464
|
SendTextMessageCommand
|
|
40368
40465
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
40369
|
-
import * as
|
|
40370
|
-
import
|
|
40466
|
+
import * as clack59 from "@clack/prompts";
|
|
40467
|
+
import pc62 from "picocolors";
|
|
40371
40468
|
|
|
40372
40469
|
// src/utils/sms/validation.ts
|
|
40373
40470
|
init_esm_shims();
|
|
@@ -40390,7 +40487,7 @@ async function smsTest(options) {
|
|
|
40390
40487
|
const startTime = Date.now();
|
|
40391
40488
|
const progress = new DeploymentProgress();
|
|
40392
40489
|
if (!isJsonMode()) {
|
|
40393
|
-
|
|
40490
|
+
clack59.intro(pc62.bold("Wraps SMS Test"));
|
|
40394
40491
|
}
|
|
40395
40492
|
const identity = await progress.execute(
|
|
40396
40493
|
"Validating AWS credentials",
|
|
@@ -40400,10 +40497,10 @@ async function smsTest(options) {
|
|
|
40400
40497
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40401
40498
|
if (!metadata?.services?.sms) {
|
|
40402
40499
|
progress.stop();
|
|
40403
|
-
|
|
40500
|
+
clack59.log.error("No SMS infrastructure found");
|
|
40404
40501
|
console.log(
|
|
40405
40502
|
`
|
|
40406
|
-
Run ${
|
|
40503
|
+
Run ${pc62.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
40407
40504
|
`
|
|
40408
40505
|
);
|
|
40409
40506
|
process.exit(1);
|
|
@@ -40417,7 +40514,7 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40417
40514
|
);
|
|
40418
40515
|
}
|
|
40419
40516
|
if (!toNumber) {
|
|
40420
|
-
const destinationType = await
|
|
40517
|
+
const destinationType = await clack59.select({
|
|
40421
40518
|
message: "Choose destination number:",
|
|
40422
40519
|
options: [
|
|
40423
40520
|
{
|
|
@@ -40432,25 +40529,25 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40432
40529
|
}
|
|
40433
40530
|
]
|
|
40434
40531
|
});
|
|
40435
|
-
if (
|
|
40436
|
-
|
|
40532
|
+
if (clack59.isCancel(destinationType)) {
|
|
40533
|
+
clack59.cancel("Operation cancelled.");
|
|
40437
40534
|
process.exit(0);
|
|
40438
40535
|
}
|
|
40439
40536
|
if (destinationType === "simulator") {
|
|
40440
|
-
const simResult = await
|
|
40537
|
+
const simResult = await clack59.select({
|
|
40441
40538
|
message: "Select simulator destination:",
|
|
40442
40539
|
options: SIMULATOR_DESTINATIONS.map((sim) => ({
|
|
40443
40540
|
value: sim.number,
|
|
40444
40541
|
label: `${sim.number} | ${sim.country}`
|
|
40445
40542
|
}))
|
|
40446
40543
|
});
|
|
40447
|
-
if (
|
|
40448
|
-
|
|
40544
|
+
if (clack59.isCancel(simResult)) {
|
|
40545
|
+
clack59.cancel("Operation cancelled.");
|
|
40449
40546
|
process.exit(0);
|
|
40450
40547
|
}
|
|
40451
40548
|
toNumber = simResult;
|
|
40452
40549
|
} else {
|
|
40453
|
-
const result = await
|
|
40550
|
+
const result = await clack59.text({
|
|
40454
40551
|
message: "Enter destination phone number (E.164 format):",
|
|
40455
40552
|
placeholder: "+14155551234",
|
|
40456
40553
|
validate: (value) => {
|
|
@@ -40463,22 +40560,22 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40463
40560
|
return;
|
|
40464
40561
|
}
|
|
40465
40562
|
});
|
|
40466
|
-
if (
|
|
40467
|
-
|
|
40563
|
+
if (clack59.isCancel(result)) {
|
|
40564
|
+
clack59.cancel("Operation cancelled.");
|
|
40468
40565
|
process.exit(0);
|
|
40469
40566
|
}
|
|
40470
40567
|
toNumber = result;
|
|
40471
40568
|
}
|
|
40472
40569
|
} else if (!isValidPhoneNumber(toNumber)) {
|
|
40473
40570
|
progress.stop();
|
|
40474
|
-
|
|
40571
|
+
clack59.log.error(
|
|
40475
40572
|
`Invalid phone number format: ${toNumber}. Use E.164 format (e.g., +14155551234)`
|
|
40476
40573
|
);
|
|
40477
40574
|
process.exit(1);
|
|
40478
40575
|
}
|
|
40479
40576
|
let message = options.message;
|
|
40480
40577
|
if (!message) {
|
|
40481
|
-
const result = await
|
|
40578
|
+
const result = await clack59.text({
|
|
40482
40579
|
message: "Enter test message:",
|
|
40483
40580
|
placeholder: "Hello from Wraps SMS!",
|
|
40484
40581
|
defaultValue: "Hello from Wraps SMS! This is a test message.",
|
|
@@ -40492,8 +40589,8 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40492
40589
|
return;
|
|
40493
40590
|
}
|
|
40494
40591
|
});
|
|
40495
|
-
if (
|
|
40496
|
-
|
|
40592
|
+
if (clack59.isCancel(result)) {
|
|
40593
|
+
clack59.cancel("Operation cancelled.");
|
|
40497
40594
|
process.exit(0);
|
|
40498
40595
|
}
|
|
40499
40596
|
message = result;
|
|
@@ -40532,16 +40629,16 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40532
40629
|
return;
|
|
40533
40630
|
}
|
|
40534
40631
|
console.log("\n");
|
|
40535
|
-
|
|
40632
|
+
clack59.log.success(pc62.green("Test SMS sent successfully!"));
|
|
40536
40633
|
console.log("");
|
|
40537
|
-
|
|
40634
|
+
clack59.note(
|
|
40538
40635
|
[
|
|
40539
|
-
`${
|
|
40540
|
-
`${
|
|
40541
|
-
`${
|
|
40542
|
-
`${
|
|
40636
|
+
`${pc62.bold("Message ID:")} ${pc62.cyan(messageId || "unknown")}`,
|
|
40637
|
+
`${pc62.bold("To:")} ${pc62.cyan(toNumber)}`,
|
|
40638
|
+
`${pc62.bold("Message:")} ${message}`,
|
|
40639
|
+
`${pc62.bold("Type:")} ${pc62.cyan(smsConfig?.phoneNumberType || "simulator")}`,
|
|
40543
40640
|
"",
|
|
40544
|
-
|
|
40641
|
+
pc62.dim(
|
|
40545
40642
|
smsConfig?.phoneNumberType === "simulator" ? "Note: Simulator messages are not actually delivered" : "Check your phone for the message!"
|
|
40546
40643
|
)
|
|
40547
40644
|
].join("\n"),
|
|
@@ -40549,11 +40646,11 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40549
40646
|
);
|
|
40550
40647
|
if (smsConfig?.eventTracking?.enabled) {
|
|
40551
40648
|
console.log("");
|
|
40552
|
-
|
|
40553
|
-
|
|
40649
|
+
clack59.log.info(
|
|
40650
|
+
pc62.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
|
|
40554
40651
|
);
|
|
40555
40652
|
}
|
|
40556
|
-
|
|
40653
|
+
clack59.outro(pc62.green("Test complete!"));
|
|
40557
40654
|
} catch (error) {
|
|
40558
40655
|
progress.stop();
|
|
40559
40656
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -40565,33 +40662,33 @@ Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40565
40662
|
});
|
|
40566
40663
|
const errorName = error instanceof Error ? error.name : "";
|
|
40567
40664
|
if (errorName === "ConflictException" || errorMessage.includes("opt-out")) {
|
|
40568
|
-
|
|
40665
|
+
clack59.log.error("Destination number has opted out of messages");
|
|
40569
40666
|
console.log("\nThe recipient has opted out of receiving SMS messages.\n");
|
|
40570
40667
|
} else if (errorName === "ThrottlingException" || errorMessage.includes("spending limit")) {
|
|
40571
|
-
|
|
40668
|
+
clack59.log.error("SMS rate or spending limit reached");
|
|
40572
40669
|
console.log(
|
|
40573
40670
|
"\nCheck your AWS account SMS spending limits in the console.\n"
|
|
40574
40671
|
);
|
|
40575
40672
|
} else if (errorName === "ValidationException") {
|
|
40576
|
-
|
|
40673
|
+
clack59.log.error(`Invalid request: ${errorMessage}`);
|
|
40577
40674
|
} else if (errorMessage.includes("not verified") || errorMessage.includes("not registered")) {
|
|
40578
|
-
|
|
40675
|
+
clack59.log.error("Toll-free number registration is not complete");
|
|
40579
40676
|
console.log(
|
|
40580
40677
|
`
|
|
40581
|
-
Run ${
|
|
40678
|
+
Run ${pc62.cyan("wraps sms register")} to check registration status.
|
|
40582
40679
|
`
|
|
40583
40680
|
);
|
|
40584
40681
|
} else if (errorName === "AccessDeniedException") {
|
|
40585
|
-
|
|
40682
|
+
clack59.log.error(
|
|
40586
40683
|
"Permission denied \u2014 IAM role may be missing SMS send permissions"
|
|
40587
40684
|
);
|
|
40588
40685
|
console.log(
|
|
40589
40686
|
`
|
|
40590
|
-
Run ${
|
|
40687
|
+
Run ${pc62.cyan("wraps sms upgrade")} to update IAM policies.
|
|
40591
40688
|
`
|
|
40592
40689
|
);
|
|
40593
40690
|
} else {
|
|
40594
|
-
|
|
40691
|
+
clack59.log.error(`Failed to send SMS: ${errorMessage}`);
|
|
40595
40692
|
}
|
|
40596
40693
|
process.exit(1);
|
|
40597
40694
|
}
|
|
@@ -40599,9 +40696,9 @@ Run ${pc61.cyan("wraps sms upgrade")} to update IAM policies.
|
|
|
40599
40696
|
|
|
40600
40697
|
// src/commands/sms/upgrade.ts
|
|
40601
40698
|
init_esm_shims();
|
|
40602
|
-
import * as
|
|
40603
|
-
import * as
|
|
40604
|
-
import
|
|
40699
|
+
import * as clack60 from "@clack/prompts";
|
|
40700
|
+
import * as pulumi36 from "@pulumi/pulumi";
|
|
40701
|
+
import pc63 from "picocolors";
|
|
40605
40702
|
init_events();
|
|
40606
40703
|
init_aws();
|
|
40607
40704
|
init_errors();
|
|
@@ -40616,7 +40713,7 @@ async function smsUpgrade(options) {
|
|
|
40616
40713
|
const startTime = Date.now();
|
|
40617
40714
|
let upgradeAction = "";
|
|
40618
40715
|
if (!isJsonMode()) {
|
|
40619
|
-
|
|
40716
|
+
clack60.intro(pc63.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
|
|
40620
40717
|
}
|
|
40621
40718
|
const progress = new DeploymentProgress();
|
|
40622
40719
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -40630,7 +40727,7 @@ async function smsUpgrade(options) {
|
|
|
40630
40727
|
"Validating AWS credentials",
|
|
40631
40728
|
async () => validateAWSCredentials()
|
|
40632
40729
|
);
|
|
40633
|
-
progress.info(`Connected to AWS account: ${
|
|
40730
|
+
progress.info(`Connected to AWS account: ${pc63.cyan(identity.accountId)}`);
|
|
40634
40731
|
const region = await resolveRegionForCommand({
|
|
40635
40732
|
accountId: identity.accountId,
|
|
40636
40733
|
optionRegion: options.region,
|
|
@@ -40639,35 +40736,35 @@ async function smsUpgrade(options) {
|
|
|
40639
40736
|
});
|
|
40640
40737
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40641
40738
|
if (!metadata) {
|
|
40642
|
-
|
|
40643
|
-
`No Wraps connection found for account ${
|
|
40739
|
+
clack60.log.error(
|
|
40740
|
+
`No Wraps connection found for account ${pc63.cyan(identity.accountId)} in region ${pc63.cyan(region)}`
|
|
40644
40741
|
);
|
|
40645
|
-
|
|
40646
|
-
`Use ${
|
|
40742
|
+
clack60.log.info(
|
|
40743
|
+
`Use ${pc63.cyan("wraps sms init")} to create new infrastructure.`
|
|
40647
40744
|
);
|
|
40648
40745
|
process.exit(1);
|
|
40649
40746
|
}
|
|
40650
40747
|
if (!metadata.services.sms) {
|
|
40651
|
-
|
|
40652
|
-
|
|
40653
|
-
`Use ${
|
|
40748
|
+
clack60.log.error("No SMS infrastructure found");
|
|
40749
|
+
clack60.log.info(
|
|
40750
|
+
`Use ${pc63.cyan("wraps sms init")} to deploy SMS infrastructure.`
|
|
40654
40751
|
);
|
|
40655
40752
|
process.exit(1);
|
|
40656
40753
|
}
|
|
40657
40754
|
progress.info(`Found existing connection created: ${metadata.timestamp}`);
|
|
40658
40755
|
console.log(`
|
|
40659
|
-
${
|
|
40756
|
+
${pc63.bold("Current Configuration:")}
|
|
40660
40757
|
`);
|
|
40661
40758
|
if (metadata.services.sms.preset) {
|
|
40662
|
-
console.log(` Preset: ${
|
|
40759
|
+
console.log(` Preset: ${pc63.cyan(metadata.services.sms.preset)}`);
|
|
40663
40760
|
} else {
|
|
40664
|
-
console.log(` Preset: ${
|
|
40761
|
+
console.log(` Preset: ${pc63.cyan("custom")}`);
|
|
40665
40762
|
}
|
|
40666
40763
|
const config2 = metadata.services.sms.config;
|
|
40667
40764
|
if (!config2) {
|
|
40668
|
-
|
|
40669
|
-
|
|
40670
|
-
`Use ${
|
|
40765
|
+
clack60.log.error("No SMS configuration found in metadata");
|
|
40766
|
+
clack60.log.info(
|
|
40767
|
+
`Use ${pc63.cyan("wraps sms init")} to create new infrastructure.`
|
|
40671
40768
|
);
|
|
40672
40769
|
process.exit(1);
|
|
40673
40770
|
}
|
|
@@ -40679,45 +40776,45 @@ ${pc62.bold("Current Configuration:")}
|
|
|
40679
40776
|
"short-code": "Short code ($995+/mo, 100+ MPS)"
|
|
40680
40777
|
};
|
|
40681
40778
|
console.log(
|
|
40682
|
-
` Phone Type: ${
|
|
40779
|
+
` Phone Type: ${pc63.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
|
|
40683
40780
|
);
|
|
40684
40781
|
}
|
|
40685
40782
|
if (config2.tracking?.enabled) {
|
|
40686
|
-
console.log(` ${
|
|
40783
|
+
console.log(` ${pc63.green("\u2713")} Delivery Tracking`);
|
|
40687
40784
|
if (config2.tracking.linkTracking) {
|
|
40688
|
-
console.log(` ${
|
|
40785
|
+
console.log(` ${pc63.dim("\u2514\u2500")} Link click tracking enabled`);
|
|
40689
40786
|
}
|
|
40690
40787
|
}
|
|
40691
40788
|
if (config2.eventTracking?.enabled) {
|
|
40692
|
-
console.log(` ${
|
|
40789
|
+
console.log(` ${pc63.green("\u2713")} Event Tracking (SNS)`);
|
|
40693
40790
|
if (config2.eventTracking.dynamoDBHistory) {
|
|
40694
40791
|
console.log(
|
|
40695
|
-
` ${
|
|
40792
|
+
` ${pc63.dim("\u2514\u2500")} Message History: ${pc63.cyan(config2.eventTracking.archiveRetention || "90days")}`
|
|
40696
40793
|
);
|
|
40697
40794
|
}
|
|
40698
40795
|
}
|
|
40699
40796
|
if (config2.messageArchiving?.enabled) {
|
|
40700
40797
|
console.log(
|
|
40701
|
-
` ${
|
|
40798
|
+
` ${pc63.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
|
|
40702
40799
|
);
|
|
40703
40800
|
}
|
|
40704
40801
|
if (config2.optOutManagement) {
|
|
40705
|
-
console.log(` ${
|
|
40802
|
+
console.log(` ${pc63.green("\u2713")} Opt-out Management`);
|
|
40706
40803
|
}
|
|
40707
40804
|
if (config2.protectConfiguration?.enabled) {
|
|
40708
40805
|
const countries = config2.protectConfiguration.allowedCountries?.join(", ") || "US";
|
|
40709
|
-
console.log(` ${
|
|
40710
|
-
console.log(` ${
|
|
40806
|
+
console.log(` ${pc63.green("\u2713")} Fraud Protection`);
|
|
40807
|
+
console.log(` ${pc63.dim("\u2514\u2500")} Allowed countries: ${pc63.cyan(countries)}`);
|
|
40711
40808
|
if (config2.protectConfiguration.aitFiltering) {
|
|
40712
|
-
console.log(` ${
|
|
40809
|
+
console.log(` ${pc63.dim("\u2514\u2500")} AIT filtering: ${pc63.cyan("enabled")}`);
|
|
40713
40810
|
}
|
|
40714
40811
|
} else {
|
|
40715
|
-
console.log(` ${
|
|
40812
|
+
console.log(` ${pc63.dim("\u25CB")} Fraud Protection (not configured)`);
|
|
40716
40813
|
}
|
|
40717
40814
|
const currentCostData = calculateSMSCosts(config2, 1e4);
|
|
40718
40815
|
console.log(
|
|
40719
40816
|
`
|
|
40720
|
-
Estimated Cost: ${
|
|
40817
|
+
Estimated Cost: ${pc63.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
40721
40818
|
);
|
|
40722
40819
|
console.log("");
|
|
40723
40820
|
const phoneTypeLabels = {
|
|
@@ -40726,7 +40823,7 @@ ${pc62.bold("Current Configuration:")}
|
|
|
40726
40823
|
"10dlc": "10DLC",
|
|
40727
40824
|
"short-code": "Short code"
|
|
40728
40825
|
};
|
|
40729
|
-
upgradeAction = await
|
|
40826
|
+
upgradeAction = await clack60.select({
|
|
40730
40827
|
message: "What would you like to do?",
|
|
40731
40828
|
options: [
|
|
40732
40829
|
{
|
|
@@ -40766,8 +40863,8 @@ ${pc62.bold("Current Configuration:")}
|
|
|
40766
40863
|
}
|
|
40767
40864
|
]
|
|
40768
40865
|
});
|
|
40769
|
-
if (
|
|
40770
|
-
|
|
40866
|
+
if (clack60.isCancel(upgradeAction)) {
|
|
40867
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40771
40868
|
process.exit(0);
|
|
40772
40869
|
}
|
|
40773
40870
|
let updatedConfig = { ...config2 };
|
|
@@ -40808,65 +40905,65 @@ ${pc62.bold("Current Configuration:")}
|
|
|
40808
40905
|
hint: p.hint
|
|
40809
40906
|
}));
|
|
40810
40907
|
if (availableTypes.length === 0) {
|
|
40811
|
-
|
|
40908
|
+
clack60.log.warn(
|
|
40812
40909
|
"Already on highest phone number tier. Contact AWS for dedicated short codes."
|
|
40813
40910
|
);
|
|
40814
40911
|
process.exit(0);
|
|
40815
40912
|
}
|
|
40816
|
-
const selectedType = await
|
|
40913
|
+
const selectedType = await clack60.select({
|
|
40817
40914
|
message: "Select new phone number type:",
|
|
40818
40915
|
options: availableTypes
|
|
40819
40916
|
});
|
|
40820
|
-
if (
|
|
40821
|
-
|
|
40917
|
+
if (clack60.isCancel(selectedType)) {
|
|
40918
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40822
40919
|
process.exit(0);
|
|
40823
40920
|
}
|
|
40824
40921
|
if (selectedType === "toll-free") {
|
|
40825
40922
|
console.log(
|
|
40826
40923
|
`
|
|
40827
|
-
${
|
|
40924
|
+
${pc63.yellow("\u26A0")} ${pc63.bold("Toll-free Registration Required")}
|
|
40828
40925
|
`
|
|
40829
40926
|
);
|
|
40830
40927
|
console.log(
|
|
40831
|
-
|
|
40928
|
+
pc63.dim("Toll-free numbers require carrier registration before")
|
|
40832
40929
|
);
|
|
40833
40930
|
console.log(
|
|
40834
|
-
|
|
40931
|
+
pc63.dim("they can send messages at scale. After deployment:\n")
|
|
40835
40932
|
);
|
|
40836
40933
|
console.log(
|
|
40837
|
-
` 1. Run ${
|
|
40934
|
+
` 1. Run ${pc63.cyan("wraps sms register")} to start registration`
|
|
40838
40935
|
);
|
|
40839
40936
|
console.log(" 2. Submit your business use case information");
|
|
40840
40937
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40841
40938
|
console.log(
|
|
40842
|
-
|
|
40939
|
+
pc63.dim("\nUntil verified, sending is limited to low volume.\n")
|
|
40843
40940
|
);
|
|
40844
|
-
const confirmTollFree = await
|
|
40941
|
+
const confirmTollFree = await clack60.confirm({
|
|
40845
40942
|
message: "Continue with toll-free number request?",
|
|
40846
40943
|
initialValue: true
|
|
40847
40944
|
});
|
|
40848
|
-
if (
|
|
40849
|
-
|
|
40945
|
+
if (clack60.isCancel(confirmTollFree) || !confirmTollFree) {
|
|
40946
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40850
40947
|
process.exit(0);
|
|
40851
40948
|
}
|
|
40852
40949
|
}
|
|
40853
40950
|
if (selectedType === "10dlc") {
|
|
40854
40951
|
console.log(
|
|
40855
40952
|
`
|
|
40856
|
-
${
|
|
40953
|
+
${pc63.yellow("\u26A0")} ${pc63.bold("10DLC Campaign Registration Required")}
|
|
40857
40954
|
`
|
|
40858
40955
|
);
|
|
40859
|
-
console.log(
|
|
40956
|
+
console.log(pc63.dim("10DLC requires brand and campaign registration:"));
|
|
40860
40957
|
console.log(" \u2022 Brand registration: one-time $4 fee");
|
|
40861
40958
|
console.log(" \u2022 Campaign registration: $15/mo per campaign");
|
|
40862
40959
|
console.log(" \u2022 Verification takes 1-7 business days");
|
|
40863
40960
|
console.log("");
|
|
40864
|
-
const confirm10DLC = await
|
|
40961
|
+
const confirm10DLC = await clack60.confirm({
|
|
40865
40962
|
message: "Continue with 10DLC number request?",
|
|
40866
40963
|
initialValue: true
|
|
40867
40964
|
});
|
|
40868
|
-
if (
|
|
40869
|
-
|
|
40965
|
+
if (clack60.isCancel(confirm10DLC) || !confirm10DLC) {
|
|
40966
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40870
40967
|
process.exit(0);
|
|
40871
40968
|
}
|
|
40872
40969
|
}
|
|
@@ -40891,15 +40988,15 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40891
40988
|
disabled: currentPresetIdx >= 0 && idx <= currentPresetIdx ? "Current or lower tier" : void 0
|
|
40892
40989
|
})).filter((p) => !p.disabled && p.value !== "custom");
|
|
40893
40990
|
if (availablePresets.length === 0) {
|
|
40894
|
-
|
|
40991
|
+
clack60.log.warn("Already on highest preset (Enterprise)");
|
|
40895
40992
|
process.exit(0);
|
|
40896
40993
|
}
|
|
40897
|
-
const selectedPreset = await
|
|
40994
|
+
const selectedPreset = await clack60.select({
|
|
40898
40995
|
message: "Select new preset:",
|
|
40899
40996
|
options: availablePresets
|
|
40900
40997
|
});
|
|
40901
|
-
if (
|
|
40902
|
-
|
|
40998
|
+
if (clack60.isCancel(selectedPreset)) {
|
|
40999
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40903
41000
|
process.exit(0);
|
|
40904
41001
|
}
|
|
40905
41002
|
const presetConfig = getSMSPreset(selectedPreset);
|
|
@@ -40915,7 +41012,7 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40915
41012
|
}
|
|
40916
41013
|
case "event-tracking": {
|
|
40917
41014
|
if (config2.eventTracking?.enabled) {
|
|
40918
|
-
const eventAction = await
|
|
41015
|
+
const eventAction = await clack60.select({
|
|
40919
41016
|
message: "What would you like to do with event tracking?",
|
|
40920
41017
|
options: [
|
|
40921
41018
|
{
|
|
@@ -40930,17 +41027,17 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40930
41027
|
}
|
|
40931
41028
|
]
|
|
40932
41029
|
});
|
|
40933
|
-
if (
|
|
40934
|
-
|
|
41030
|
+
if (clack60.isCancel(eventAction)) {
|
|
41031
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40935
41032
|
process.exit(0);
|
|
40936
41033
|
}
|
|
40937
41034
|
if (eventAction === "disable") {
|
|
40938
|
-
const confirmDisable = await
|
|
41035
|
+
const confirmDisable = await clack60.confirm({
|
|
40939
41036
|
message: "Are you sure? Existing history will remain, but new events won't be tracked.",
|
|
40940
41037
|
initialValue: false
|
|
40941
41038
|
});
|
|
40942
|
-
if (
|
|
40943
|
-
|
|
41039
|
+
if (clack60.isCancel(confirmDisable) || !confirmDisable) {
|
|
41040
|
+
clack60.cancel("Event tracking not disabled.");
|
|
40944
41041
|
process.exit(0);
|
|
40945
41042
|
}
|
|
40946
41043
|
updatedConfig = {
|
|
@@ -40950,7 +41047,7 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40950
41047
|
}
|
|
40951
41048
|
};
|
|
40952
41049
|
} else {
|
|
40953
|
-
const retention = await
|
|
41050
|
+
const retention = await clack60.select({
|
|
40954
41051
|
message: "Message history retention period:",
|
|
40955
41052
|
options: [
|
|
40956
41053
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40977,8 +41074,8 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40977
41074
|
],
|
|
40978
41075
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40979
41076
|
});
|
|
40980
|
-
if (
|
|
40981
|
-
|
|
41077
|
+
if (clack60.isCancel(retention)) {
|
|
41078
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40982
41079
|
process.exit(0);
|
|
40983
41080
|
}
|
|
40984
41081
|
updatedConfig = {
|
|
@@ -40990,19 +41087,19 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
40990
41087
|
};
|
|
40991
41088
|
}
|
|
40992
41089
|
} else {
|
|
40993
|
-
const enableTracking = await
|
|
41090
|
+
const enableTracking = await clack60.confirm({
|
|
40994
41091
|
message: "Enable event tracking? (Track SMS events with history)",
|
|
40995
41092
|
initialValue: true
|
|
40996
41093
|
});
|
|
40997
|
-
if (
|
|
40998
|
-
|
|
41094
|
+
if (clack60.isCancel(enableTracking)) {
|
|
41095
|
+
clack60.cancel("Upgrade cancelled.");
|
|
40999
41096
|
process.exit(0);
|
|
41000
41097
|
}
|
|
41001
41098
|
if (!enableTracking) {
|
|
41002
|
-
|
|
41099
|
+
clack60.log.info("Event tracking not enabled.");
|
|
41003
41100
|
process.exit(0);
|
|
41004
41101
|
}
|
|
41005
|
-
const retention = await
|
|
41102
|
+
const retention = await clack60.select({
|
|
41006
41103
|
message: "Message history retention period:",
|
|
41007
41104
|
options: [
|
|
41008
41105
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -41025,8 +41122,8 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41025
41122
|
],
|
|
41026
41123
|
initialValue: "90days"
|
|
41027
41124
|
});
|
|
41028
|
-
if (
|
|
41029
|
-
|
|
41125
|
+
if (clack60.isCancel(retention)) {
|
|
41126
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41030
41127
|
process.exit(0);
|
|
41031
41128
|
}
|
|
41032
41129
|
updatedConfig = {
|
|
@@ -41045,12 +41142,12 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41045
41142
|
}
|
|
41046
41143
|
case "retention": {
|
|
41047
41144
|
if (!config2.eventTracking?.enabled) {
|
|
41048
|
-
|
|
41145
|
+
clack60.log.error(
|
|
41049
41146
|
"Event tracking is not enabled. Enable it first to change retention."
|
|
41050
41147
|
);
|
|
41051
41148
|
process.exit(1);
|
|
41052
41149
|
}
|
|
41053
|
-
const retention = await
|
|
41150
|
+
const retention = await clack60.select({
|
|
41054
41151
|
message: "Message history retention period (event data in DynamoDB):",
|
|
41055
41152
|
options: [
|
|
41056
41153
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -41069,8 +41166,8 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41069
41166
|
],
|
|
41070
41167
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
41071
41168
|
});
|
|
41072
|
-
if (
|
|
41073
|
-
|
|
41169
|
+
if (clack60.isCancel(retention)) {
|
|
41170
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41074
41171
|
process.exit(0);
|
|
41075
41172
|
}
|
|
41076
41173
|
updatedConfig = {
|
|
@@ -41088,21 +41185,21 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41088
41185
|
case "link-tracking": {
|
|
41089
41186
|
const enableLinkTracking = !config2.tracking?.linkTracking;
|
|
41090
41187
|
if (enableLinkTracking) {
|
|
41091
|
-
|
|
41092
|
-
|
|
41188
|
+
clack60.log.info(
|
|
41189
|
+
pc63.dim(
|
|
41093
41190
|
"Link tracking will track clicks on URLs in your SMS messages."
|
|
41094
41191
|
)
|
|
41095
41192
|
);
|
|
41096
|
-
|
|
41097
|
-
|
|
41193
|
+
clack60.log.info(
|
|
41194
|
+
pc63.dim("URLs will be rewritten to go through a tracking endpoint.")
|
|
41098
41195
|
);
|
|
41099
41196
|
}
|
|
41100
|
-
const confirmed = await
|
|
41197
|
+
const confirmed = await clack60.confirm({
|
|
41101
41198
|
message: enableLinkTracking ? "Enable link click tracking?" : "Disable link click tracking?",
|
|
41102
41199
|
initialValue: enableLinkTracking
|
|
41103
41200
|
});
|
|
41104
|
-
if (
|
|
41105
|
-
|
|
41201
|
+
if (clack60.isCancel(confirmed) || !confirmed) {
|
|
41202
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41106
41203
|
process.exit(0);
|
|
41107
41204
|
}
|
|
41108
41205
|
updatedConfig = {
|
|
@@ -41119,7 +41216,7 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41119
41216
|
}
|
|
41120
41217
|
case "archiving": {
|
|
41121
41218
|
if (config2.messageArchiving?.enabled) {
|
|
41122
|
-
const archivingAction = await
|
|
41219
|
+
const archivingAction = await clack60.select({
|
|
41123
41220
|
message: "What would you like to do with message archiving?",
|
|
41124
41221
|
options: [
|
|
41125
41222
|
{
|
|
@@ -41134,17 +41231,17 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41134
41231
|
}
|
|
41135
41232
|
]
|
|
41136
41233
|
});
|
|
41137
|
-
if (
|
|
41138
|
-
|
|
41234
|
+
if (clack60.isCancel(archivingAction)) {
|
|
41235
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41139
41236
|
process.exit(0);
|
|
41140
41237
|
}
|
|
41141
41238
|
if (archivingAction === "disable") {
|
|
41142
|
-
const confirmDisable = await
|
|
41239
|
+
const confirmDisable = await clack60.confirm({
|
|
41143
41240
|
message: "Are you sure? Existing archived messages will remain, but new messages won't be archived.",
|
|
41144
41241
|
initialValue: false
|
|
41145
41242
|
});
|
|
41146
|
-
if (
|
|
41147
|
-
|
|
41243
|
+
if (clack60.isCancel(confirmDisable) || !confirmDisable) {
|
|
41244
|
+
clack60.cancel("Archiving not disabled.");
|
|
41148
41245
|
process.exit(0);
|
|
41149
41246
|
}
|
|
41150
41247
|
updatedConfig = {
|
|
@@ -41155,7 +41252,7 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41155
41252
|
}
|
|
41156
41253
|
};
|
|
41157
41254
|
} else {
|
|
41158
|
-
const retention = await
|
|
41255
|
+
const retention = await clack60.select({
|
|
41159
41256
|
message: "Message archive retention period:",
|
|
41160
41257
|
options: [
|
|
41161
41258
|
{
|
|
@@ -41186,8 +41283,8 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41186
41283
|
],
|
|
41187
41284
|
initialValue: config2.messageArchiving.retention
|
|
41188
41285
|
});
|
|
41189
|
-
if (
|
|
41190
|
-
|
|
41286
|
+
if (clack60.isCancel(retention)) {
|
|
41287
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41191
41288
|
process.exit(0);
|
|
41192
41289
|
}
|
|
41193
41290
|
updatedConfig = {
|
|
@@ -41199,19 +41296,19 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41199
41296
|
};
|
|
41200
41297
|
}
|
|
41201
41298
|
} else {
|
|
41202
|
-
const enableArchiving = await
|
|
41299
|
+
const enableArchiving = await clack60.confirm({
|
|
41203
41300
|
message: "Enable message archiving? (Store full message content for viewing)",
|
|
41204
41301
|
initialValue: true
|
|
41205
41302
|
});
|
|
41206
|
-
if (
|
|
41207
|
-
|
|
41303
|
+
if (clack60.isCancel(enableArchiving)) {
|
|
41304
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41208
41305
|
process.exit(0);
|
|
41209
41306
|
}
|
|
41210
41307
|
if (!enableArchiving) {
|
|
41211
|
-
|
|
41308
|
+
clack60.log.info("Message archiving not enabled.");
|
|
41212
41309
|
process.exit(0);
|
|
41213
41310
|
}
|
|
41214
|
-
const retention = await
|
|
41311
|
+
const retention = await clack60.select({
|
|
41215
41312
|
message: "Message archive retention period:",
|
|
41216
41313
|
options: [
|
|
41217
41314
|
{ value: "7days", label: "7 days", hint: "~$1-2/mo for 10k msgs" },
|
|
@@ -41238,8 +41335,8 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41238
41335
|
],
|
|
41239
41336
|
initialValue: "90days"
|
|
41240
41337
|
});
|
|
41241
|
-
if (
|
|
41242
|
-
|
|
41338
|
+
if (clack60.isCancel(retention)) {
|
|
41339
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41243
41340
|
process.exit(0);
|
|
41244
41341
|
}
|
|
41245
41342
|
updatedConfig = {
|
|
@@ -41271,7 +41368,7 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41271
41368
|
const currentAllowed = config2.protectConfiguration?.allowedCountries || [
|
|
41272
41369
|
"US"
|
|
41273
41370
|
];
|
|
41274
|
-
const selectedCountries = await
|
|
41371
|
+
const selectedCountries = await clack60.multiselect({
|
|
41275
41372
|
message: "Select countries to allow SMS delivery (all others blocked):",
|
|
41276
41373
|
options: commonCountries.map((c) => ({
|
|
41277
41374
|
value: c.code,
|
|
@@ -41280,16 +41377,16 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41280
41377
|
initialValues: currentAllowed,
|
|
41281
41378
|
required: true
|
|
41282
41379
|
});
|
|
41283
|
-
if (
|
|
41284
|
-
|
|
41380
|
+
if (clack60.isCancel(selectedCountries)) {
|
|
41381
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41285
41382
|
process.exit(0);
|
|
41286
41383
|
}
|
|
41287
|
-
const enableAIT = await
|
|
41384
|
+
const enableAIT = await clack60.confirm({
|
|
41288
41385
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
41289
41386
|
initialValue: config2.protectConfiguration?.aitFiltering ?? false
|
|
41290
41387
|
});
|
|
41291
|
-
if (
|
|
41292
|
-
|
|
41388
|
+
if (clack60.isCancel(enableAIT)) {
|
|
41389
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41293
41390
|
process.exit(0);
|
|
41294
41391
|
}
|
|
41295
41392
|
updatedConfig = {
|
|
@@ -41307,28 +41404,28 @@ ${pc62.yellow("\u26A0")} ${pc62.bold("10DLC Campaign Registration Required")}
|
|
|
41307
41404
|
const newCostData = calculateSMSCosts(updatedConfig, 1e4);
|
|
41308
41405
|
const costDiff = newCostData.total.monthly - currentCostData.total.monthly;
|
|
41309
41406
|
console.log(`
|
|
41310
|
-
${
|
|
41407
|
+
${pc63.bold("Cost Impact:")}`);
|
|
41311
41408
|
console.log(
|
|
41312
|
-
` Current: ${
|
|
41409
|
+
` Current: ${pc63.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
41313
41410
|
);
|
|
41314
41411
|
console.log(
|
|
41315
|
-
` New: ${
|
|
41412
|
+
` New: ${pc63.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
|
|
41316
41413
|
);
|
|
41317
41414
|
if (costDiff > 0) {
|
|
41318
|
-
console.log(` Change: ${
|
|
41415
|
+
console.log(` Change: ${pc63.yellow(`+${formatCost3(costDiff)}/mo`)}`);
|
|
41319
41416
|
} else if (costDiff < 0) {
|
|
41320
41417
|
console.log(
|
|
41321
|
-
` Change: ${
|
|
41418
|
+
` Change: ${pc63.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
|
|
41322
41419
|
);
|
|
41323
41420
|
}
|
|
41324
41421
|
console.log("");
|
|
41325
41422
|
if (!(options.yes || options.preview)) {
|
|
41326
|
-
const confirmed = await
|
|
41423
|
+
const confirmed = await clack60.confirm({
|
|
41327
41424
|
message: "Proceed with upgrade?",
|
|
41328
41425
|
initialValue: true
|
|
41329
41426
|
});
|
|
41330
|
-
if (
|
|
41331
|
-
|
|
41427
|
+
if (clack60.isCancel(confirmed) || !confirmed) {
|
|
41428
|
+
clack60.cancel("Upgrade cancelled.");
|
|
41332
41429
|
process.exit(0);
|
|
41333
41430
|
}
|
|
41334
41431
|
}
|
|
@@ -41347,7 +41444,7 @@ ${pc62.bold("Cost Impact:")}`);
|
|
|
41347
41444
|
const stackName = metadata.services.sms?.pulumiStackName || `wraps-sms-${identity.accountId}-${region}`;
|
|
41348
41445
|
const createStack = async () => {
|
|
41349
41446
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
41350
|
-
const stack = await
|
|
41447
|
+
const stack = await pulumi36.automation.LocalWorkspace.createOrSelectStack(
|
|
41351
41448
|
{
|
|
41352
41449
|
stackName,
|
|
41353
41450
|
projectName: "wraps-sms",
|
|
@@ -41397,8 +41494,8 @@ ${pc62.bold("Cost Impact:")}`);
|
|
|
41397
41494
|
resourceChanges: previewResult.resourceChanges,
|
|
41398
41495
|
commandName: "wraps sms upgrade"
|
|
41399
41496
|
});
|
|
41400
|
-
|
|
41401
|
-
|
|
41497
|
+
clack60.outro(
|
|
41498
|
+
pc63.green("Preview complete. Run without --preview to upgrade.")
|
|
41402
41499
|
);
|
|
41403
41500
|
trackServiceUpgrade("sms", {
|
|
41404
41501
|
region,
|
|
@@ -41503,43 +41600,43 @@ ${pc62.bold("Cost Impact:")}`);
|
|
|
41503
41600
|
}
|
|
41504
41601
|
progress.info("Connection metadata updated");
|
|
41505
41602
|
console.log("\n");
|
|
41506
|
-
|
|
41603
|
+
clack60.log.success(pc63.green(pc63.bold("SMS infrastructure upgraded!")));
|
|
41507
41604
|
console.log("\n");
|
|
41508
|
-
|
|
41605
|
+
clack60.note(
|
|
41509
41606
|
[
|
|
41510
|
-
`${
|
|
41511
|
-
`${
|
|
41512
|
-
`${
|
|
41513
|
-
`${
|
|
41514
|
-
outputs.tableName ? `${
|
|
41607
|
+
`${pc63.bold("Phone Number:")} ${pc63.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
41608
|
+
`${pc63.bold("Phone Type:")} ${pc63.cyan(updatedConfig.phoneNumberType || "simulator")}`,
|
|
41609
|
+
`${pc63.bold("Config Set:")} ${pc63.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
41610
|
+
`${pc63.bold("Region:")} ${pc63.cyan(outputs.region)}`,
|
|
41611
|
+
outputs.tableName ? `${pc63.bold("History Table:")} ${pc63.cyan(outputs.tableName)}` : "",
|
|
41515
41612
|
"",
|
|
41516
|
-
|
|
41517
|
-
|
|
41613
|
+
pc63.dim("IAM Role:"),
|
|
41614
|
+
pc63.dim(` ${outputs.roleArn}`)
|
|
41518
41615
|
].filter(Boolean).join("\n"),
|
|
41519
41616
|
"SMS Infrastructure"
|
|
41520
41617
|
);
|
|
41521
41618
|
console.log(`
|
|
41522
|
-
${
|
|
41619
|
+
${pc63.green("\u2713")} ${pc63.bold("Upgrade complete!")}
|
|
41523
41620
|
`);
|
|
41524
41621
|
if (upgradeAction === "phone-number") {
|
|
41525
41622
|
console.log(
|
|
41526
|
-
`Upgraded to ${
|
|
41623
|
+
`Upgraded to ${pc63.cyan(updatedConfig.phoneNumberType)} number (${pc63.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
41527
41624
|
`
|
|
41528
41625
|
);
|
|
41529
41626
|
if (updatedConfig.phoneNumberType === "toll-free") {
|
|
41530
|
-
console.log(`${
|
|
41627
|
+
console.log(`${pc63.bold("Next Steps:")}`);
|
|
41531
41628
|
console.log(
|
|
41532
|
-
` 1. Run ${
|
|
41629
|
+
` 1. Run ${pc63.cyan("wraps sms register")} to start toll-free registration`
|
|
41533
41630
|
);
|
|
41534
41631
|
console.log(" 2. Submit your business information and use case");
|
|
41535
41632
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
41536
41633
|
console.log("");
|
|
41537
41634
|
console.log(
|
|
41538
|
-
|
|
41635
|
+
pc63.dim("Until verified, your number can only send limited messages.")
|
|
41539
41636
|
);
|
|
41540
41637
|
console.log("");
|
|
41541
41638
|
} else if (updatedConfig.phoneNumberType === "10dlc") {
|
|
41542
|
-
console.log(`${
|
|
41639
|
+
console.log(`${pc63.bold("Next Steps:")}`);
|
|
41543
41640
|
console.log(" 1. Register your brand in the AWS Console");
|
|
41544
41641
|
console.log(" 2. Create a 10DLC campaign for your use case");
|
|
41545
41642
|
console.log(" 3. Wait for campaign approval (1-7 business days)");
|
|
@@ -41547,16 +41644,16 @@ ${pc62.green("\u2713")} ${pc62.bold("Upgrade complete!")}
|
|
|
41547
41644
|
}
|
|
41548
41645
|
} else if (upgradeAction === "preset" && newPreset) {
|
|
41549
41646
|
console.log(
|
|
41550
|
-
`Upgraded to ${
|
|
41647
|
+
`Upgraded to ${pc63.cyan(newPreset)} preset (${pc63.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
41551
41648
|
`
|
|
41552
41649
|
);
|
|
41553
41650
|
} else {
|
|
41554
41651
|
console.log(
|
|
41555
|
-
`Updated configuration (${
|
|
41652
|
+
`Updated configuration (${pc63.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
41556
41653
|
`
|
|
41557
41654
|
);
|
|
41558
41655
|
}
|
|
41559
|
-
console.log(
|
|
41656
|
+
console.log(pc63.dim(getSMSCostSummary(updatedConfig, 1e4)));
|
|
41560
41657
|
const enabledFeatures = [];
|
|
41561
41658
|
if (updatedConfig.tracking?.enabled) {
|
|
41562
41659
|
enabledFeatures.push("tracking");
|
|
@@ -41580,7 +41677,7 @@ ${pc62.green("\u2713")} ${pc62.bold("Upgrade complete!")}
|
|
|
41580
41677
|
action: typeof upgradeAction === "string" ? upgradeAction : void 0,
|
|
41581
41678
|
duration_ms: Date.now() - startTime
|
|
41582
41679
|
});
|
|
41583
|
-
|
|
41680
|
+
clack60.outro(pc63.green("Upgrade complete!"));
|
|
41584
41681
|
}
|
|
41585
41682
|
|
|
41586
41683
|
// src/commands/sms/verify-number.ts
|
|
@@ -41599,13 +41696,13 @@ import {
|
|
|
41599
41696
|
SendDestinationNumberVerificationCodeCommand,
|
|
41600
41697
|
VerifyDestinationNumberCommand
|
|
41601
41698
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
41602
|
-
import * as
|
|
41603
|
-
import
|
|
41699
|
+
import * as clack61 from "@clack/prompts";
|
|
41700
|
+
import pc64 from "picocolors";
|
|
41604
41701
|
async function smsVerifyNumber(options) {
|
|
41605
41702
|
const startTime = Date.now();
|
|
41606
41703
|
const progress = new DeploymentProgress();
|
|
41607
41704
|
if (!isJsonMode()) {
|
|
41608
|
-
|
|
41705
|
+
clack61.intro(pc64.bold("Wraps SMS - Verify Destination Number"));
|
|
41609
41706
|
}
|
|
41610
41707
|
const identity = await progress.execute(
|
|
41611
41708
|
"Validating AWS credentials",
|
|
@@ -41615,10 +41712,10 @@ async function smsVerifyNumber(options) {
|
|
|
41615
41712
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
41616
41713
|
if (!metadata?.services?.sms) {
|
|
41617
41714
|
progress.stop();
|
|
41618
|
-
|
|
41715
|
+
clack61.log.error("No SMS infrastructure found");
|
|
41619
41716
|
console.log(
|
|
41620
41717
|
`
|
|
41621
|
-
Run ${
|
|
41718
|
+
Run ${pc64.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
41622
41719
|
`
|
|
41623
41720
|
);
|
|
41624
41721
|
process.exit(1);
|
|
@@ -41632,19 +41729,19 @@ Run ${pc63.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
41632
41729
|
);
|
|
41633
41730
|
progress.stop();
|
|
41634
41731
|
if (!response.VerifiedDestinationNumbers || response.VerifiedDestinationNumbers.length === 0) {
|
|
41635
|
-
|
|
41732
|
+
clack61.log.info("No verified destination numbers found");
|
|
41636
41733
|
console.log(
|
|
41637
41734
|
`
|
|
41638
|
-
Run ${
|
|
41735
|
+
Run ${pc64.cyan("wraps sms verify-number")} to verify a number.
|
|
41639
41736
|
`
|
|
41640
41737
|
);
|
|
41641
41738
|
} else {
|
|
41642
41739
|
console.log("\n");
|
|
41643
|
-
|
|
41740
|
+
clack61.log.info(pc64.bold("Verified Destination Numbers:"));
|
|
41644
41741
|
console.log("");
|
|
41645
41742
|
for (const num of response.VerifiedDestinationNumbers) {
|
|
41646
|
-
const status2 = num.Status === "VERIFIED" ?
|
|
41647
|
-
console.log(` ${
|
|
41743
|
+
const status2 = num.Status === "VERIFIED" ? pc64.green("\u2713 Verified") : pc64.yellow("\u29D6 Pending");
|
|
41744
|
+
console.log(` ${pc64.cyan(num.DestinationPhoneNumber)} - ${status2}`);
|
|
41648
41745
|
}
|
|
41649
41746
|
console.log("");
|
|
41650
41747
|
}
|
|
@@ -41662,7 +41759,7 @@ Run ${pc63.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41662
41759
|
});
|
|
41663
41760
|
return;
|
|
41664
41761
|
}
|
|
41665
|
-
|
|
41762
|
+
clack61.outro(pc64.green("Done!"));
|
|
41666
41763
|
return;
|
|
41667
41764
|
} catch (error) {
|
|
41668
41765
|
progress.stop();
|
|
@@ -41670,7 +41767,7 @@ Run ${pc63.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41670
41767
|
trackError("SMS_LIST_VERIFIED_FAILED", "sms:verify-number:list", {
|
|
41671
41768
|
error: errorMessage
|
|
41672
41769
|
});
|
|
41673
|
-
|
|
41770
|
+
clack61.log.error(`Failed to list verified numbers: ${errorMessage}`);
|
|
41674
41771
|
process.exit(1);
|
|
41675
41772
|
}
|
|
41676
41773
|
}
|
|
@@ -41678,10 +41775,10 @@ Run ${pc63.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41678
41775
|
const phoneNumber2 = options.phoneNumber;
|
|
41679
41776
|
if (!phoneNumber2) {
|
|
41680
41777
|
progress.stop();
|
|
41681
|
-
|
|
41778
|
+
clack61.log.error("Phone number is required for deletion");
|
|
41682
41779
|
console.log(
|
|
41683
41780
|
`
|
|
41684
|
-
Usage: ${
|
|
41781
|
+
Usage: ${pc64.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
|
|
41685
41782
|
`
|
|
41686
41783
|
);
|
|
41687
41784
|
process.exit(1);
|
|
@@ -41695,7 +41792,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41695
41792
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41696
41793
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41697
41794
|
progress.stop();
|
|
41698
|
-
|
|
41795
|
+
clack61.log.error(`Number ${phoneNumber2} is not in verified list`);
|
|
41699
41796
|
process.exit(1);
|
|
41700
41797
|
}
|
|
41701
41798
|
await progress.execute(`Removing ${phoneNumber2}`, async () => {
|
|
@@ -41706,7 +41803,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41706
41803
|
);
|
|
41707
41804
|
});
|
|
41708
41805
|
progress.stop();
|
|
41709
|
-
|
|
41806
|
+
clack61.log.success(`Removed ${pc64.cyan(phoneNumber2)} from verified list`);
|
|
41710
41807
|
trackCommand("sms:verify-number:delete", {
|
|
41711
41808
|
success: true,
|
|
41712
41809
|
duration_ms: Date.now() - startTime
|
|
@@ -41718,7 +41815,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41718
41815
|
});
|
|
41719
41816
|
return;
|
|
41720
41817
|
}
|
|
41721
|
-
|
|
41818
|
+
clack61.outro(pc64.green("Done!"));
|
|
41722
41819
|
return;
|
|
41723
41820
|
} catch (error) {
|
|
41724
41821
|
progress.stop();
|
|
@@ -41726,7 +41823,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41726
41823
|
trackError("SMS_DELETE_VERIFIED_FAILED", "sms:verify-number:delete", {
|
|
41727
41824
|
error: errorMessage
|
|
41728
41825
|
});
|
|
41729
|
-
|
|
41826
|
+
clack61.log.error(`Failed to delete verified number: ${errorMessage}`);
|
|
41730
41827
|
process.exit(1);
|
|
41731
41828
|
}
|
|
41732
41829
|
}
|
|
@@ -41739,7 +41836,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41739
41836
|
);
|
|
41740
41837
|
}
|
|
41741
41838
|
if (!phoneNumber) {
|
|
41742
|
-
const result = await
|
|
41839
|
+
const result = await clack61.text({
|
|
41743
41840
|
message: "Enter phone number to verify (E.164 format):",
|
|
41744
41841
|
placeholder: "+14155551234",
|
|
41745
41842
|
validate: (value) => {
|
|
@@ -41752,14 +41849,14 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41752
41849
|
return;
|
|
41753
41850
|
}
|
|
41754
41851
|
});
|
|
41755
|
-
if (
|
|
41756
|
-
|
|
41852
|
+
if (clack61.isCancel(result)) {
|
|
41853
|
+
clack61.cancel("Operation cancelled.");
|
|
41757
41854
|
process.exit(0);
|
|
41758
41855
|
}
|
|
41759
41856
|
phoneNumber = result;
|
|
41760
41857
|
} else if (!isValidPhoneNumber(phoneNumber)) {
|
|
41761
41858
|
progress.stop();
|
|
41762
|
-
|
|
41859
|
+
clack61.log.error(
|
|
41763
41860
|
`Invalid phone number format: ${phoneNumber}. Use E.164 format (e.g., +14155551234)`
|
|
41764
41861
|
);
|
|
41765
41862
|
process.exit(1);
|
|
@@ -41774,7 +41871,7 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41774
41871
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41775
41872
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41776
41873
|
progress.stop();
|
|
41777
|
-
|
|
41874
|
+
clack61.log.error(
|
|
41778
41875
|
`Number ${phoneNumber} not found. Run without --code first.`
|
|
41779
41876
|
);
|
|
41780
41877
|
process.exit(1);
|
|
@@ -41789,12 +41886,12 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41789
41886
|
});
|
|
41790
41887
|
progress.stop();
|
|
41791
41888
|
console.log("\n");
|
|
41792
|
-
|
|
41793
|
-
|
|
41889
|
+
clack61.log.success(
|
|
41890
|
+
pc64.green(`Phone number ${pc64.cyan(phoneNumber)} verified!`)
|
|
41794
41891
|
);
|
|
41795
41892
|
console.log("");
|
|
41796
41893
|
console.log(
|
|
41797
|
-
`You can now send test messages to this number with ${
|
|
41894
|
+
`You can now send test messages to this number with ${pc64.cyan("wraps sms test")}`
|
|
41798
41895
|
);
|
|
41799
41896
|
trackCommand("sms:verify-number:confirm", {
|
|
41800
41897
|
success: true,
|
|
@@ -41807,23 +41904,23 @@ Usage: ${pc63.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41807
41904
|
});
|
|
41808
41905
|
return;
|
|
41809
41906
|
}
|
|
41810
|
-
|
|
41907
|
+
clack61.outro(pc64.green("Verification complete!"));
|
|
41811
41908
|
return;
|
|
41812
41909
|
} catch (error) {
|
|
41813
41910
|
progress.stop();
|
|
41814
41911
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41815
41912
|
if (errorMessage.includes("Invalid verification code")) {
|
|
41816
|
-
|
|
41913
|
+
clack61.log.error("Invalid verification code. Please try again.");
|
|
41817
41914
|
console.log(
|
|
41818
41915
|
`
|
|
41819
|
-
Run ${
|
|
41916
|
+
Run ${pc64.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41820
41917
|
`
|
|
41821
41918
|
);
|
|
41822
41919
|
} else {
|
|
41823
41920
|
trackError("SMS_VERIFY_CODE_FAILED", "sms:verify-number:confirm", {
|
|
41824
41921
|
error: errorMessage
|
|
41825
41922
|
});
|
|
41826
|
-
|
|
41923
|
+
clack61.log.error(`Verification failed: ${errorMessage}`);
|
|
41827
41924
|
}
|
|
41828
41925
|
process.exit(1);
|
|
41829
41926
|
}
|
|
@@ -41838,7 +41935,7 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41838
41935
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41839
41936
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41840
41937
|
progress.stop();
|
|
41841
|
-
|
|
41938
|
+
clack61.log.error(
|
|
41842
41939
|
`Number ${phoneNumber} not found. Run without --resend first.`
|
|
41843
41940
|
);
|
|
41844
41941
|
process.exit(1);
|
|
@@ -41852,11 +41949,11 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41852
41949
|
);
|
|
41853
41950
|
});
|
|
41854
41951
|
progress.stop();
|
|
41855
|
-
|
|
41952
|
+
clack61.log.success(`Verification code resent to ${pc64.cyan(phoneNumber)}`);
|
|
41856
41953
|
console.log("");
|
|
41857
41954
|
console.log(
|
|
41858
41955
|
`Once you receive the code, run:
|
|
41859
|
-
${
|
|
41956
|
+
${pc64.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41860
41957
|
);
|
|
41861
41958
|
trackCommand("sms:verify-number:resend", {
|
|
41862
41959
|
success: true,
|
|
@@ -41869,7 +41966,7 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41869
41966
|
});
|
|
41870
41967
|
return;
|
|
41871
41968
|
}
|
|
41872
|
-
|
|
41969
|
+
clack61.outro(pc64.green("Code sent!"));
|
|
41873
41970
|
return;
|
|
41874
41971
|
} catch (error) {
|
|
41875
41972
|
progress.stop();
|
|
@@ -41877,7 +41974,7 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41877
41974
|
trackError("SMS_RESEND_CODE_FAILED", "sms:verify-number:resend", {
|
|
41878
41975
|
error: errorMessage
|
|
41879
41976
|
});
|
|
41880
|
-
|
|
41977
|
+
clack61.log.error(`Failed to resend code: ${errorMessage}`);
|
|
41881
41978
|
process.exit(1);
|
|
41882
41979
|
}
|
|
41883
41980
|
}
|
|
@@ -41897,10 +41994,10 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41897
41994
|
});
|
|
41898
41995
|
return;
|
|
41899
41996
|
}
|
|
41900
|
-
|
|
41901
|
-
`Number ${
|
|
41997
|
+
clack61.log.info(
|
|
41998
|
+
`Number ${pc64.cyan(phoneNumber)} is already verified and ready to use!`
|
|
41902
41999
|
);
|
|
41903
|
-
|
|
42000
|
+
clack61.outro(pc64.green("Done!"));
|
|
41904
42001
|
return;
|
|
41905
42002
|
}
|
|
41906
42003
|
if (existingNumber?.Status === "PENDING") {
|
|
@@ -41924,15 +42021,15 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41924
42021
|
});
|
|
41925
42022
|
return;
|
|
41926
42023
|
}
|
|
41927
|
-
|
|
41928
|
-
`Verification already in progress. New code sent to ${
|
|
42024
|
+
clack61.log.info(
|
|
42025
|
+
`Verification already in progress. New code sent to ${pc64.cyan(phoneNumber)}`
|
|
41929
42026
|
);
|
|
41930
42027
|
console.log("");
|
|
41931
42028
|
console.log(
|
|
41932
42029
|
`Once you receive the code, run:
|
|
41933
|
-
${
|
|
42030
|
+
${pc64.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41934
42031
|
);
|
|
41935
|
-
|
|
42032
|
+
clack61.outro(pc64.green("Code sent!"));
|
|
41936
42033
|
return;
|
|
41937
42034
|
}
|
|
41938
42035
|
const createResponse = await progress.execute(
|
|
@@ -41953,18 +42050,18 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41953
42050
|
});
|
|
41954
42051
|
progress.stop();
|
|
41955
42052
|
console.log("\n");
|
|
41956
|
-
|
|
41957
|
-
`Verification code sent to ${
|
|
42053
|
+
clack61.log.success(
|
|
42054
|
+
`Verification code sent to ${pc64.cyan(phoneNumber)} via SMS`
|
|
41958
42055
|
);
|
|
41959
42056
|
console.log("");
|
|
41960
|
-
|
|
42057
|
+
clack61.note(
|
|
41961
42058
|
[
|
|
41962
42059
|
"1. Check your phone for the verification code",
|
|
41963
42060
|
"",
|
|
41964
42061
|
"2. Complete verification with:",
|
|
41965
|
-
` ${
|
|
42062
|
+
` ${pc64.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
|
|
41966
42063
|
"",
|
|
41967
|
-
|
|
42064
|
+
pc64.dim("The code expires in 24 hours")
|
|
41968
42065
|
].join("\n"),
|
|
41969
42066
|
"Next Steps"
|
|
41970
42067
|
);
|
|
@@ -41980,22 +42077,22 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41980
42077
|
});
|
|
41981
42078
|
return;
|
|
41982
42079
|
}
|
|
41983
|
-
|
|
42080
|
+
clack61.outro(pc64.green("Verification started!"));
|
|
41984
42081
|
} catch (error) {
|
|
41985
42082
|
progress.stop();
|
|
41986
42083
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41987
42084
|
if (errorMessage.includes("already exists")) {
|
|
41988
|
-
|
|
42085
|
+
clack61.log.error("This number is already being verified");
|
|
41989
42086
|
console.log(
|
|
41990
42087
|
`
|
|
41991
|
-
Run ${
|
|
42088
|
+
Run ${pc64.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41992
42089
|
`
|
|
41993
42090
|
);
|
|
41994
42091
|
} else {
|
|
41995
42092
|
trackError("SMS_CREATE_VERIFIED_FAILED", "sms:verify-number:start", {
|
|
41996
42093
|
error: errorMessage
|
|
41997
42094
|
});
|
|
41998
|
-
|
|
42095
|
+
clack61.log.error(`Failed to start verification: ${errorMessage}`);
|
|
41999
42096
|
}
|
|
42000
42097
|
process.exit(1);
|
|
42001
42098
|
}
|
|
@@ -42004,88 +42101,88 @@ Run ${pc63.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
42004
42101
|
// src/commands/support.ts
|
|
42005
42102
|
init_esm_shims();
|
|
42006
42103
|
init_events();
|
|
42007
|
-
import * as
|
|
42008
|
-
import
|
|
42104
|
+
import * as clack62 from "@clack/prompts";
|
|
42105
|
+
import pc65 from "picocolors";
|
|
42009
42106
|
async function support() {
|
|
42010
42107
|
trackCommand("support", { success: true });
|
|
42011
|
-
|
|
42108
|
+
clack62.intro(pc65.bold("Get Help with Wraps"));
|
|
42012
42109
|
console.log();
|
|
42013
|
-
console.log(` ${
|
|
42110
|
+
console.log(` ${pc65.bold("Email:")} ${pc65.cyan("hey@wraps.sh")}`);
|
|
42014
42111
|
console.log(
|
|
42015
|
-
` ${
|
|
42112
|
+
` ${pc65.bold("GitHub:")} ${pc65.cyan("https://github.com/wraps-dev/wraps/issues")}`
|
|
42016
42113
|
);
|
|
42017
|
-
console.log(` ${
|
|
42114
|
+
console.log(` ${pc65.bold("Docs:")} ${pc65.cyan("https://wraps.dev/docs")}`);
|
|
42018
42115
|
console.log();
|
|
42019
|
-
console.log(
|
|
42116
|
+
console.log(pc65.dim(" Response time: Usually within 24 hours"));
|
|
42020
42117
|
console.log();
|
|
42021
42118
|
}
|
|
42022
42119
|
|
|
42023
42120
|
// src/commands/telemetry.ts
|
|
42024
42121
|
init_esm_shims();
|
|
42025
42122
|
init_client();
|
|
42026
|
-
import * as
|
|
42027
|
-
import
|
|
42123
|
+
import * as clack63 from "@clack/prompts";
|
|
42124
|
+
import pc66 from "picocolors";
|
|
42028
42125
|
async function telemetryEnable() {
|
|
42029
42126
|
const client = getTelemetryClient();
|
|
42030
42127
|
const override = client.enable();
|
|
42031
42128
|
if (override) {
|
|
42032
|
-
|
|
42129
|
+
clack63.log.warn(
|
|
42033
42130
|
"Telemetry enabled in config, but overridden by environment"
|
|
42034
42131
|
);
|
|
42035
|
-
console.log(` Reason: ${
|
|
42036
|
-
console.log(` Config: ${
|
|
42132
|
+
console.log(` Reason: ${pc66.yellow(override)}`);
|
|
42133
|
+
console.log(` Config: ${pc66.dim(client.getConfigPath())}`);
|
|
42037
42134
|
console.log();
|
|
42038
42135
|
} else {
|
|
42039
|
-
|
|
42040
|
-
console.log(` Config: ${
|
|
42136
|
+
clack63.log.success(pc66.green("Telemetry enabled"));
|
|
42137
|
+
console.log(` Config: ${pc66.dim(client.getConfigPath())}`);
|
|
42041
42138
|
console.log(`
|
|
42042
|
-
${
|
|
42139
|
+
${pc66.dim("Thank you for helping improve Wraps!")}
|
|
42043
42140
|
`);
|
|
42044
42141
|
}
|
|
42045
42142
|
}
|
|
42046
42143
|
async function telemetryDisable() {
|
|
42047
42144
|
const client = getTelemetryClient();
|
|
42048
42145
|
client.disable();
|
|
42049
|
-
|
|
42050
|
-
console.log(` Config: ${
|
|
42146
|
+
clack63.log.success(pc66.green("Telemetry disabled"));
|
|
42147
|
+
console.log(` Config: ${pc66.dim(client.getConfigPath())}`);
|
|
42051
42148
|
console.log(
|
|
42052
42149
|
`
|
|
42053
|
-
${
|
|
42150
|
+
${pc66.dim("You can re-enable with:")} wraps telemetry enable
|
|
42054
42151
|
`
|
|
42055
42152
|
);
|
|
42056
42153
|
}
|
|
42057
42154
|
async function telemetryStatus() {
|
|
42058
42155
|
const client = getTelemetryClient();
|
|
42059
|
-
|
|
42156
|
+
clack63.intro(pc66.bold("Telemetry Status"));
|
|
42060
42157
|
const override = client.getEnvOverride();
|
|
42061
|
-
const status2 = client.isEnabled() ?
|
|
42158
|
+
const status2 = client.isEnabled() ? pc66.green("Enabled") : pc66.red("Disabled");
|
|
42062
42159
|
console.log();
|
|
42063
|
-
console.log(` ${
|
|
42160
|
+
console.log(` ${pc66.bold("Status:")} ${status2}`);
|
|
42064
42161
|
if (!client.isEnabled() && override) {
|
|
42065
|
-
console.log(` ${
|
|
42162
|
+
console.log(` ${pc66.bold("Reason:")} ${pc66.yellow(override)}`);
|
|
42066
42163
|
}
|
|
42067
|
-
console.log(` ${
|
|
42164
|
+
console.log(` ${pc66.bold("Config file:")} ${pc66.dim(client.getConfigPath())}`);
|
|
42068
42165
|
if (client.isEnabled()) {
|
|
42069
42166
|
console.log();
|
|
42070
|
-
console.log(
|
|
42071
|
-
console.log(` ${
|
|
42167
|
+
console.log(pc66.bold(" How to opt-out:"));
|
|
42168
|
+
console.log(` ${pc66.cyan("wraps telemetry disable")}`);
|
|
42072
42169
|
console.log(
|
|
42073
|
-
` ${
|
|
42170
|
+
` ${pc66.dim("Or set:")} ${pc66.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
|
|
42074
42171
|
);
|
|
42075
|
-
console.log(` ${
|
|
42172
|
+
console.log(` ${pc66.dim("Or set:")} ${pc66.cyan("DO_NOT_TRACK=1")}`);
|
|
42076
42173
|
} else {
|
|
42077
42174
|
console.log();
|
|
42078
|
-
console.log(
|
|
42079
|
-
console.log(` ${
|
|
42175
|
+
console.log(pc66.bold(" How to opt-in:"));
|
|
42176
|
+
console.log(` ${pc66.cyan("wraps telemetry enable")}`);
|
|
42080
42177
|
}
|
|
42081
42178
|
console.log();
|
|
42082
|
-
console.log(
|
|
42179
|
+
console.log(pc66.bold(" Debug mode:"));
|
|
42083
42180
|
console.log(
|
|
42084
|
-
` ${
|
|
42181
|
+
` ${pc66.dim("See what would be sent:")} ${pc66.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
|
|
42085
42182
|
);
|
|
42086
42183
|
console.log();
|
|
42087
42184
|
console.log(
|
|
42088
|
-
` ${
|
|
42185
|
+
` ${pc66.dim("Learn more:")} ${pc66.cyan("https://wraps.dev/docs/telemetry")}`
|
|
42089
42186
|
);
|
|
42090
42187
|
console.log();
|
|
42091
42188
|
}
|
|
@@ -42094,8 +42191,8 @@ async function telemetryStatus() {
|
|
|
42094
42191
|
init_esm_shims();
|
|
42095
42192
|
import { existsSync as existsSync20, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
42096
42193
|
import { join as join22 } from "path";
|
|
42097
|
-
import * as
|
|
42098
|
-
import
|
|
42194
|
+
import * as clack64 from "@clack/prompts";
|
|
42195
|
+
import pc67 from "picocolors";
|
|
42099
42196
|
var EXAMPLE_CASCADE_WORKFLOW = `import {
|
|
42100
42197
|
defineWorkflow,
|
|
42101
42198
|
sendEmail,
|
|
@@ -42190,30 +42287,30 @@ export default defineConfig({
|
|
|
42190
42287
|
});
|
|
42191
42288
|
`;
|
|
42192
42289
|
async function workflowInit(options = {}) {
|
|
42193
|
-
|
|
42290
|
+
clack64.intro(pc67.bgCyan(pc67.black(" wraps workflow init ")));
|
|
42194
42291
|
const wrapsDir = join22(process.cwd(), "wraps");
|
|
42195
42292
|
const workflowsDir = join22(wrapsDir, "workflows");
|
|
42196
42293
|
const configPath = join22(wrapsDir, "wraps.config.ts");
|
|
42197
42294
|
if (existsSync20(workflowsDir)) {
|
|
42198
|
-
|
|
42199
|
-
`Workflows directory already exists at ${
|
|
42295
|
+
clack64.log.info(
|
|
42296
|
+
`Workflows directory already exists at ${pc67.cyan("wraps/workflows/")}`
|
|
42200
42297
|
);
|
|
42201
42298
|
const files = existsSync20(join22(workflowsDir, "cart-recovery.ts")) || existsSync20(join22(workflowsDir, "welcome-sequence.ts"));
|
|
42202
42299
|
if (files && !options.yes) {
|
|
42203
|
-
const shouldContinue = await
|
|
42300
|
+
const shouldContinue = await clack64.confirm({
|
|
42204
42301
|
message: "Example files may already exist. Overwrite them?",
|
|
42205
42302
|
initialValue: false
|
|
42206
42303
|
});
|
|
42207
|
-
if (
|
|
42208
|
-
|
|
42304
|
+
if (clack64.isCancel(shouldContinue) || !shouldContinue) {
|
|
42305
|
+
clack64.log.info("Skipping file creation.");
|
|
42209
42306
|
showNextSteps2();
|
|
42210
|
-
|
|
42307
|
+
clack64.outro("Done!");
|
|
42211
42308
|
return;
|
|
42212
42309
|
}
|
|
42213
42310
|
}
|
|
42214
42311
|
}
|
|
42215
42312
|
try {
|
|
42216
|
-
const s =
|
|
42313
|
+
const s = clack64.spinner();
|
|
42217
42314
|
s.start("Creating workflows directory...");
|
|
42218
42315
|
mkdirSync2(workflowsDir, { recursive: true });
|
|
42219
42316
|
s.stop("Created wraps/workflows/");
|
|
@@ -42231,34 +42328,34 @@ async function workflowInit(options = {}) {
|
|
|
42231
42328
|
s.stop("Created 2 example workflows");
|
|
42232
42329
|
if (!existsSync20(configPath)) {
|
|
42233
42330
|
writeFileSync(configPath, EXAMPLE_CONFIG, "utf-8");
|
|
42234
|
-
|
|
42331
|
+
clack64.log.info(`Created ${pc67.cyan("wraps/wraps.config.ts")}`);
|
|
42235
42332
|
}
|
|
42236
|
-
|
|
42237
|
-
`${
|
|
42238
|
-
${
|
|
42239
|
-
${
|
|
42240
|
-
${
|
|
42333
|
+
clack64.log.success(
|
|
42334
|
+
`${pc67.bold("Workflows scaffolded!")} Created:
|
|
42335
|
+
${pc67.cyan("wraps/wraps.config.ts")} \u2014 Project config
|
|
42336
|
+
${pc67.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
|
|
42337
|
+
${pc67.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
|
|
42241
42338
|
);
|
|
42242
42339
|
showNextSteps2();
|
|
42243
|
-
|
|
42340
|
+
clack64.outro(pc67.green("Happy orchestrating!"));
|
|
42244
42341
|
} catch (error) {
|
|
42245
|
-
|
|
42342
|
+
clack64.log.error(
|
|
42246
42343
|
`Failed to scaffold workflows: ${error instanceof Error ? error.message : String(error)}`
|
|
42247
42344
|
);
|
|
42248
|
-
|
|
42345
|
+
clack64.outro(pc67.red("Scaffolding failed."));
|
|
42249
42346
|
process.exitCode = 1;
|
|
42250
42347
|
}
|
|
42251
42348
|
}
|
|
42252
42349
|
function showNextSteps2() {
|
|
42253
|
-
|
|
42254
|
-
`${
|
|
42350
|
+
clack64.log.info(
|
|
42351
|
+
`${pc67.bold("Next steps:")}
|
|
42255
42352
|
|
|
42256
|
-
1. Edit ${
|
|
42257
|
-
2. Edit your workflows in ${
|
|
42258
|
-
3. Validate: ${
|
|
42259
|
-
4. Push: ${
|
|
42353
|
+
1. Edit ${pc67.cyan("wraps/wraps.config.ts")} with your org slug and domain
|
|
42354
|
+
2. Edit your workflows in ${pc67.cyan("wraps/workflows/")}
|
|
42355
|
+
3. Validate: ${pc67.cyan("wraps email workflows validate")}
|
|
42356
|
+
4. Push: ${pc67.cyan("wraps email workflows push")}
|
|
42260
42357
|
|
|
42261
|
-
${
|
|
42358
|
+
${pc67.dim("Docs:")} ${pc67.underline("https://wraps.dev/docs/guides/orchestration")}`
|
|
42262
42359
|
);
|
|
42263
42360
|
}
|
|
42264
42361
|
|
|
@@ -42456,217 +42553,217 @@ function showVersion() {
|
|
|
42456
42553
|
process.exit(0);
|
|
42457
42554
|
}
|
|
42458
42555
|
function showHelp() {
|
|
42459
|
-
|
|
42556
|
+
clack65.intro(pc69.bold(`WRAPS CLI v${VERSION}`));
|
|
42460
42557
|
console.log("Deploy AWS infrastructure to your account\n");
|
|
42461
42558
|
console.log("Usage: wraps [service] <command> [options]\n");
|
|
42462
42559
|
console.log("Services:");
|
|
42463
|
-
console.log(` ${
|
|
42560
|
+
console.log(` ${pc69.cyan("email")} Email infrastructure (AWS SES)`);
|
|
42464
42561
|
console.log(
|
|
42465
|
-
` ${
|
|
42562
|
+
` ${pc69.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
|
|
42466
42563
|
);
|
|
42467
42564
|
console.log(
|
|
42468
|
-
` ${
|
|
42565
|
+
` ${pc69.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
|
|
42469
42566
|
);
|
|
42470
42567
|
console.log(
|
|
42471
|
-
` ${
|
|
42568
|
+
` ${pc69.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
|
|
42472
42569
|
);
|
|
42473
42570
|
console.log(
|
|
42474
|
-
` ${
|
|
42571
|
+
` ${pc69.cyan("license")} License key management (Wraps team only)
|
|
42475
42572
|
`
|
|
42476
42573
|
);
|
|
42477
42574
|
console.log("Email Commands:");
|
|
42478
42575
|
console.log(
|
|
42479
|
-
` ${
|
|
42576
|
+
` ${pc69.cyan("email init")} Deploy new email infrastructure`
|
|
42480
42577
|
);
|
|
42481
42578
|
console.log(
|
|
42482
|
-
` ${
|
|
42579
|
+
` ${pc69.cyan("email check")} Check email deliverability for a domain`
|
|
42483
42580
|
);
|
|
42484
42581
|
console.log(
|
|
42485
|
-
` ${
|
|
42582
|
+
` ${pc69.cyan("email connect")} Connect to existing AWS SES`
|
|
42486
42583
|
);
|
|
42487
42584
|
console.log(
|
|
42488
|
-
` ${
|
|
42585
|
+
` ${pc69.cyan("email status")} Show email infrastructure details`
|
|
42489
42586
|
);
|
|
42490
|
-
console.log(` ${
|
|
42491
|
-
console.log(` ${
|
|
42587
|
+
console.log(` ${pc69.cyan("email test")} Send a test email`);
|
|
42588
|
+
console.log(` ${pc69.cyan("email verify")} Verify domain DNS records`);
|
|
42492
42589
|
console.log(
|
|
42493
|
-
` ${
|
|
42590
|
+
` ${pc69.cyan("email sync")} Apply CLI updates to infrastructure`
|
|
42494
42591
|
);
|
|
42495
|
-
console.log(` ${
|
|
42592
|
+
console.log(` ${pc69.cyan("email upgrade")} Add features`);
|
|
42496
42593
|
console.log(
|
|
42497
|
-
` ${
|
|
42594
|
+
` ${pc69.cyan("email restore")} Restore original configuration`
|
|
42498
42595
|
);
|
|
42499
42596
|
console.log(
|
|
42500
|
-
` ${
|
|
42597
|
+
` ${pc69.cyan("email destroy")} Remove email infrastructure`
|
|
42501
42598
|
);
|
|
42502
42599
|
console.log(
|
|
42503
|
-
` ${
|
|
42600
|
+
` ${pc69.cyan("email doctor")} Diagnose and clean up email infrastructure`
|
|
42504
42601
|
);
|
|
42505
|
-
console.log(` ${
|
|
42506
|
-
console.log(` ${
|
|
42507
|
-
console.log(` ${
|
|
42602
|
+
console.log(` ${pc69.cyan("email domains add")} Add a domain to SES`);
|
|
42603
|
+
console.log(` ${pc69.cyan("email domains list")} List all domains`);
|
|
42604
|
+
console.log(` ${pc69.cyan("email domains remove")} Remove a domain`);
|
|
42508
42605
|
console.log(
|
|
42509
|
-
` ${
|
|
42606
|
+
` ${pc69.cyan("email inbound init")} Enable inbound email receiving`
|
|
42510
42607
|
);
|
|
42511
|
-
console.log(` ${
|
|
42608
|
+
console.log(` ${pc69.cyan("email inbound status")} Show inbound email status`);
|
|
42512
42609
|
console.log(
|
|
42513
|
-
` ${
|
|
42610
|
+
` ${pc69.cyan("email inbound verify")} Verify inbound DNS records`
|
|
42514
42611
|
);
|
|
42515
42612
|
console.log(
|
|
42516
|
-
` ${
|
|
42613
|
+
` ${pc69.cyan("email inbound test")} Send test email and verify receipt`
|
|
42517
42614
|
);
|
|
42518
42615
|
console.log(
|
|
42519
|
-
` ${
|
|
42616
|
+
` ${pc69.cyan("email inbound destroy")} Remove inbound email infrastructure
|
|
42520
42617
|
`
|
|
42521
42618
|
);
|
|
42522
42619
|
console.log("Template Commands:");
|
|
42523
42620
|
console.log(
|
|
42524
|
-
` ${
|
|
42621
|
+
` ${pc69.cyan("email templates init")} Initialize templates-as-code`
|
|
42525
42622
|
);
|
|
42526
42623
|
console.log(
|
|
42527
|
-
` ${
|
|
42624
|
+
` ${pc69.cyan("email templates push")} Push templates to SES + dashboard`
|
|
42528
42625
|
);
|
|
42529
42626
|
console.log(
|
|
42530
|
-
` ${
|
|
42627
|
+
` ${pc69.cyan("email templates preview")} Preview templates in browser`
|
|
42531
42628
|
);
|
|
42532
42629
|
console.log(
|
|
42533
|
-
` ${
|
|
42630
|
+
` ${pc69.cyan("push")} ${pc69.dim("(alias for email templates push)")}
|
|
42534
42631
|
`
|
|
42535
42632
|
);
|
|
42536
42633
|
console.log("Workflow Commands:");
|
|
42537
42634
|
console.log(
|
|
42538
|
-
` ${
|
|
42635
|
+
` ${pc69.cyan("email workflows init")} Initialize workflows-as-code`
|
|
42539
42636
|
);
|
|
42540
42637
|
console.log(
|
|
42541
|
-
` ${
|
|
42638
|
+
` ${pc69.cyan("email workflows validate")} Validate workflow files`
|
|
42542
42639
|
);
|
|
42543
42640
|
console.log(
|
|
42544
|
-
` ${
|
|
42641
|
+
` ${pc69.cyan("email workflows push")} Push workflows to dashboard
|
|
42545
42642
|
`
|
|
42546
42643
|
);
|
|
42547
42644
|
console.log("SMS Commands:");
|
|
42548
|
-
console.log(` ${
|
|
42645
|
+
console.log(` ${pc69.cyan("sms init")} Deploy SMS infrastructure`);
|
|
42549
42646
|
console.log(
|
|
42550
|
-
` ${
|
|
42647
|
+
` ${pc69.cyan("sms status")} Show SMS infrastructure details`
|
|
42551
42648
|
);
|
|
42552
|
-
console.log(` ${
|
|
42649
|
+
console.log(` ${pc69.cyan("sms test")} Send a test SMS message`);
|
|
42553
42650
|
console.log(
|
|
42554
|
-
` ${
|
|
42651
|
+
` ${pc69.cyan("sms verify-number")} Verify a destination phone number`
|
|
42555
42652
|
);
|
|
42556
42653
|
console.log(
|
|
42557
|
-
` ${
|
|
42654
|
+
` ${pc69.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
|
|
42558
42655
|
);
|
|
42559
|
-
console.log(` ${
|
|
42560
|
-
console.log(` ${
|
|
42656
|
+
console.log(` ${pc69.cyan("sms upgrade")} Upgrade SMS features`);
|
|
42657
|
+
console.log(` ${pc69.cyan("sms register")} Register toll-free number`);
|
|
42561
42658
|
console.log(
|
|
42562
|
-
` ${
|
|
42659
|
+
` ${pc69.cyan("sms destroy")} Remove SMS infrastructure
|
|
42563
42660
|
`
|
|
42564
42661
|
);
|
|
42565
42662
|
console.log("CDN Commands:");
|
|
42566
42663
|
console.log(
|
|
42567
|
-
` ${
|
|
42664
|
+
` ${pc69.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
|
|
42568
42665
|
);
|
|
42569
42666
|
console.log(
|
|
42570
|
-
` ${
|
|
42667
|
+
` ${pc69.cyan("cdn status")} Show CDN infrastructure details`
|
|
42571
42668
|
);
|
|
42572
42669
|
console.log(
|
|
42573
|
-
` ${
|
|
42670
|
+
` ${pc69.cyan("cdn verify")} Check DNS and certificate status`
|
|
42574
42671
|
);
|
|
42575
42672
|
console.log(
|
|
42576
|
-
` ${
|
|
42673
|
+
` ${pc69.cyan("cdn upgrade")} Add custom domain after cert validation`
|
|
42577
42674
|
);
|
|
42578
42675
|
console.log(
|
|
42579
|
-
` ${
|
|
42676
|
+
` ${pc69.cyan("cdn sync")} Sync infrastructure with current config`
|
|
42580
42677
|
);
|
|
42581
42678
|
console.log(
|
|
42582
|
-
` ${
|
|
42679
|
+
` ${pc69.cyan("cdn destroy")} Remove CDN infrastructure
|
|
42583
42680
|
`
|
|
42584
42681
|
);
|
|
42585
42682
|
console.log("Self-Hosted Commands:");
|
|
42586
42683
|
console.log(
|
|
42587
|
-
` ${
|
|
42684
|
+
` ${pc69.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
|
|
42588
42685
|
);
|
|
42589
42686
|
console.log(
|
|
42590
|
-
` ${
|
|
42687
|
+
` ${pc69.cyan("selfhost login")} Sign in to your self-hosted Wraps instance`
|
|
42591
42688
|
);
|
|
42592
42689
|
console.log(
|
|
42593
|
-
` ${
|
|
42690
|
+
` ${pc69.cyan("selfhost logout")} Sign out of your self-hosted Wraps instance`
|
|
42594
42691
|
);
|
|
42595
42692
|
console.log(
|
|
42596
|
-
` ${
|
|
42693
|
+
` ${pc69.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
|
|
42597
42694
|
);
|
|
42598
42695
|
console.log(
|
|
42599
|
-
` ${
|
|
42696
|
+
` ${pc69.cyan("selfhost status")} Show self-hosted deployment details`
|
|
42600
42697
|
);
|
|
42601
42698
|
console.log(
|
|
42602
|
-
` ${
|
|
42699
|
+
` ${pc69.cyan("selfhost connect")} Connect your AWS account to your self-hosted instance
|
|
42603
42700
|
`
|
|
42604
42701
|
);
|
|
42605
42702
|
console.log("Local Development:");
|
|
42606
42703
|
console.log(
|
|
42607
|
-
` ${
|
|
42704
|
+
` ${pc69.cyan("console")} Start local web console
|
|
42608
42705
|
`
|
|
42609
42706
|
);
|
|
42610
42707
|
console.log("Platform:");
|
|
42611
42708
|
console.log(
|
|
42612
|
-
` ${
|
|
42709
|
+
` ${pc69.cyan("platform")} Show platform info and pricing`
|
|
42613
42710
|
);
|
|
42614
42711
|
console.log(
|
|
42615
|
-
` ${
|
|
42712
|
+
` ${pc69.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
|
|
42616
42713
|
);
|
|
42617
42714
|
console.log(
|
|
42618
|
-
` ${
|
|
42715
|
+
` ${pc69.cyan("platform update-role")} Update platform IAM permissions
|
|
42619
42716
|
`
|
|
42620
42717
|
);
|
|
42621
42718
|
console.log("Auth:");
|
|
42622
42719
|
console.log(
|
|
42623
|
-
` ${
|
|
42720
|
+
` ${pc69.cyan("auth login")} Sign in to wraps.dev (device flow)`
|
|
42624
42721
|
);
|
|
42625
|
-
console.log(` ${
|
|
42722
|
+
console.log(` ${pc69.cyan("auth status")} Show current auth state`);
|
|
42626
42723
|
console.log(
|
|
42627
|
-
` ${
|
|
42724
|
+
` ${pc69.cyan("auth logout")} Sign out and remove stored token
|
|
42628
42725
|
`
|
|
42629
42726
|
);
|
|
42630
42727
|
console.log("AWS Setup:");
|
|
42631
42728
|
console.log(
|
|
42632
|
-
` ${
|
|
42729
|
+
` ${pc69.cyan("aws setup")} Interactive AWS setup wizard`
|
|
42633
42730
|
);
|
|
42634
42731
|
console.log(
|
|
42635
|
-
` ${
|
|
42732
|
+
` ${pc69.cyan("aws doctor")} Diagnose AWS configuration issues
|
|
42636
42733
|
`
|
|
42637
42734
|
);
|
|
42638
42735
|
console.log("Global Commands:");
|
|
42639
|
-
console.log(` ${
|
|
42640
|
-
console.log(` ${
|
|
42641
|
-
console.log(` ${
|
|
42642
|
-
console.log(` ${
|
|
42736
|
+
console.log(` ${pc69.cyan("status")} Show overview of all services`);
|
|
42737
|
+
console.log(` ${pc69.cyan("destroy")} Remove deployed infrastructure`);
|
|
42738
|
+
console.log(` ${pc69.cyan("permissions")} Show required AWS IAM permissions`);
|
|
42739
|
+
console.log(` ${pc69.cyan("completion")} Generate shell completion script`);
|
|
42643
42740
|
console.log(
|
|
42644
|
-
` ${
|
|
42741
|
+
` ${pc69.cyan("telemetry")} Manage anonymous telemetry settings`
|
|
42645
42742
|
);
|
|
42646
|
-
console.log(` ${
|
|
42647
|
-
console.log(` ${
|
|
42743
|
+
console.log(` ${pc69.cyan("update")} Update CLI to latest version`);
|
|
42744
|
+
console.log(` ${pc69.cyan("news")} Show recent Wraps updates`);
|
|
42648
42745
|
console.log(
|
|
42649
|
-
` ${
|
|
42746
|
+
` ${pc69.cyan("support")} Get help and support contact info
|
|
42650
42747
|
`
|
|
42651
42748
|
);
|
|
42652
42749
|
console.log("Options:");
|
|
42653
42750
|
console.log(
|
|
42654
|
-
` ${
|
|
42655
|
-
);
|
|
42656
|
-
console.log(` ${
|
|
42657
|
-
console.log(` ${
|
|
42658
|
-
console.log(` ${
|
|
42659
|
-
console.log(` ${
|
|
42660
|
-
console.log(` ${
|
|
42661
|
-
console.log(` ${
|
|
42662
|
-
console.log(` ${
|
|
42751
|
+
` ${pc69.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
|
|
42752
|
+
);
|
|
42753
|
+
console.log(` ${pc69.dim("-r, --region")} AWS region`);
|
|
42754
|
+
console.log(` ${pc69.dim("-d, --domain")} Domain name`);
|
|
42755
|
+
console.log(` ${pc69.dim("--account")} AWS account ID or alias`);
|
|
42756
|
+
console.log(` ${pc69.dim("--preset")} Configuration preset`);
|
|
42757
|
+
console.log(` ${pc69.dim("--token")} API key or token for auth`);
|
|
42758
|
+
console.log(` ${pc69.dim("-y, --yes")} Skip confirmation prompts`);
|
|
42759
|
+
console.log(` ${pc69.dim("-f, --force")} Force destructive operations`);
|
|
42663
42760
|
console.log(
|
|
42664
|
-
` ${
|
|
42761
|
+
` ${pc69.dim("--preview")} Preview changes without deploying`
|
|
42665
42762
|
);
|
|
42666
|
-
console.log(` ${
|
|
42763
|
+
console.log(` ${pc69.dim("-v, --version")} Show version number
|
|
42667
42764
|
`);
|
|
42668
42765
|
console.log(
|
|
42669
|
-
`Run ${
|
|
42766
|
+
`Run ${pc69.cyan("wraps <service> <command> --help")} for more information.
|
|
42670
42767
|
`
|
|
42671
42768
|
);
|
|
42672
42769
|
}
|
|
@@ -42688,27 +42785,27 @@ if (!primaryCommand) {
|
|
|
42688
42785
|
const telemetry = getTelemetryClient();
|
|
42689
42786
|
if (telemetry.shouldShowNotification()) {
|
|
42690
42787
|
console.log();
|
|
42691
|
-
|
|
42788
|
+
clack65.log.info(pc69.bold("Anonymous Telemetry"));
|
|
42692
42789
|
console.log(
|
|
42693
|
-
` Wraps collects ${
|
|
42790
|
+
` Wraps collects ${pc69.cyan("anonymous usage data")} to improve the CLI.`
|
|
42694
42791
|
);
|
|
42695
42792
|
console.log(
|
|
42696
|
-
` We ${
|
|
42793
|
+
` We ${pc69.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42697
42794
|
);
|
|
42698
42795
|
console.log(
|
|
42699
|
-
` We ${
|
|
42796
|
+
` We ${pc69.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42700
42797
|
);
|
|
42701
42798
|
console.log();
|
|
42702
|
-
console.log(` Opt-out anytime: ${
|
|
42703
|
-
console.log(` Or set: ${
|
|
42704
|
-
console.log(` Learn more: ${
|
|
42799
|
+
console.log(` Opt-out anytime: ${pc69.cyan("wraps telemetry disable")}`);
|
|
42800
|
+
console.log(` Or set: ${pc69.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42801
|
+
console.log(` Learn more: ${pc69.cyan("https://wraps.dev/docs")}`);
|
|
42705
42802
|
console.log();
|
|
42706
42803
|
telemetry.markNotificationShown();
|
|
42707
42804
|
}
|
|
42708
42805
|
trackCommand("interactive:menu", { success: true, duration_ms: 0 });
|
|
42709
|
-
|
|
42806
|
+
clack65.intro(pc69.bold(`WRAPS CLI v${VERSION}`));
|
|
42710
42807
|
console.log(" Deploy AWS infrastructure to your account.\n");
|
|
42711
|
-
const action = await
|
|
42808
|
+
const action = await clack65.select({
|
|
42712
42809
|
message: "What would you like to do?",
|
|
42713
42810
|
options: [
|
|
42714
42811
|
{
|
|
@@ -42758,13 +42855,13 @@ if (!primaryCommand) {
|
|
|
42758
42855
|
}
|
|
42759
42856
|
]
|
|
42760
42857
|
});
|
|
42761
|
-
if (
|
|
42858
|
+
if (clack65.isCancel(action)) {
|
|
42762
42859
|
trackCommand("interactive:cancel", {
|
|
42763
42860
|
success: true,
|
|
42764
42861
|
duration_ms: Date.now() - startTime
|
|
42765
42862
|
});
|
|
42766
42863
|
await telemetry.shutdown();
|
|
42767
|
-
|
|
42864
|
+
clack65.cancel("Operation cancelled.");
|
|
42768
42865
|
process.exit(0);
|
|
42769
42866
|
}
|
|
42770
42867
|
trackCommand(`interactive:${action}`, {
|
|
@@ -42844,20 +42941,20 @@ async function run() {
|
|
|
42844
42941
|
const telemetry = getTelemetryClient();
|
|
42845
42942
|
if (telemetry.shouldShowNotification()) {
|
|
42846
42943
|
console.log();
|
|
42847
|
-
|
|
42944
|
+
clack65.log.info(pc69.bold("Anonymous Telemetry"));
|
|
42848
42945
|
console.log(
|
|
42849
|
-
` Wraps collects ${
|
|
42946
|
+
` Wraps collects ${pc69.cyan("anonymous usage data")} to improve the CLI.`
|
|
42850
42947
|
);
|
|
42851
42948
|
console.log(
|
|
42852
|
-
` We ${
|
|
42949
|
+
` We ${pc69.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42853
42950
|
);
|
|
42854
42951
|
console.log(
|
|
42855
|
-
` We ${
|
|
42952
|
+
` We ${pc69.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42856
42953
|
);
|
|
42857
42954
|
console.log();
|
|
42858
|
-
console.log(` Opt-out anytime: ${
|
|
42859
|
-
console.log(` Or set: ${
|
|
42860
|
-
console.log(` Learn more: ${
|
|
42955
|
+
console.log(` Opt-out anytime: ${pc69.cyan("wraps telemetry disable")}`);
|
|
42956
|
+
console.log(` Or set: ${pc69.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42957
|
+
console.log(` Learn more: ${pc69.cyan("https://wraps.dev/docs")}`);
|
|
42861
42958
|
console.log();
|
|
42862
42959
|
telemetry.markNotificationShown();
|
|
42863
42960
|
}
|
|
@@ -42941,10 +43038,10 @@ async function run() {
|
|
|
42941
43038
|
break;
|
|
42942
43039
|
case "verify": {
|
|
42943
43040
|
if (!flags.domain) {
|
|
42944
|
-
|
|
43041
|
+
clack65.log.error("--domain flag is required");
|
|
42945
43042
|
console.log(
|
|
42946
43043
|
`
|
|
42947
|
-
Usage: ${
|
|
43044
|
+
Usage: ${pc69.cyan("wraps email verify --domain yourapp.com")}
|
|
42948
43045
|
`
|
|
42949
43046
|
);
|
|
42950
43047
|
throw new Error("Missing required flag: --domain");
|
|
@@ -43016,12 +43113,12 @@ Usage: ${pc68.cyan("wraps email verify --domain yourapp.com")}
|
|
|
43016
43113
|
});
|
|
43017
43114
|
break;
|
|
43018
43115
|
default:
|
|
43019
|
-
|
|
43116
|
+
clack65.log.error(
|
|
43020
43117
|
`Unknown inbound command: ${inboundSubCommand || "(none)"}`
|
|
43021
43118
|
);
|
|
43022
43119
|
console.log(
|
|
43023
43120
|
`
|
|
43024
|
-
Available commands: ${
|
|
43121
|
+
Available commands: ${pc69.cyan("init")}, ${pc69.cyan("destroy")}, ${pc69.cyan("status")}, ${pc69.cyan("verify")}, ${pc69.cyan("test")}, ${pc69.cyan("add")}, ${pc69.cyan("remove")}
|
|
43025
43122
|
`
|
|
43026
43123
|
);
|
|
43027
43124
|
throw new Error(
|
|
@@ -43073,12 +43170,12 @@ Available commands: ${pc68.cyan("init")}, ${pc68.cyan("destroy")}, ${pc68.cyan("
|
|
|
43073
43170
|
break;
|
|
43074
43171
|
}
|
|
43075
43172
|
default:
|
|
43076
|
-
|
|
43173
|
+
clack65.log.error(
|
|
43077
43174
|
`Unknown reply command: ${replySubCommand || "(none)"}`
|
|
43078
43175
|
);
|
|
43079
43176
|
console.log(
|
|
43080
43177
|
`
|
|
43081
|
-
Available commands: ${
|
|
43178
|
+
Available commands: ${pc69.cyan("init")}, ${pc69.cyan("rotate")}, ${pc69.cyan("status")}, ${pc69.cyan("destroy")}, ${pc69.cyan("decode")}
|
|
43082
43179
|
`
|
|
43083
43180
|
);
|
|
43084
43181
|
throw new Error(
|
|
@@ -43103,10 +43200,10 @@ Available commands: ${pc68.cyan("init")}, ${pc68.cyan("rotate")}, ${pc68.cyan("s
|
|
|
43103
43200
|
break;
|
|
43104
43201
|
case "verify": {
|
|
43105
43202
|
if (!flags.domain) {
|
|
43106
|
-
|
|
43203
|
+
clack65.log.error("--domain flag is required");
|
|
43107
43204
|
console.log(
|
|
43108
43205
|
`
|
|
43109
|
-
Usage: ${
|
|
43206
|
+
Usage: ${pc69.cyan("wraps email domains verify --domain yourapp.com")}
|
|
43110
43207
|
`
|
|
43111
43208
|
);
|
|
43112
43209
|
throw new Error("Missing required flag: --domain");
|
|
@@ -43116,10 +43213,10 @@ Usage: ${pc68.cyan("wraps email domains verify --domain yourapp.com")}
|
|
|
43116
43213
|
}
|
|
43117
43214
|
case "get-dkim": {
|
|
43118
43215
|
if (!flags.domain) {
|
|
43119
|
-
|
|
43216
|
+
clack65.log.error("--domain flag is required");
|
|
43120
43217
|
console.log(
|
|
43121
43218
|
`
|
|
43122
|
-
Usage: ${
|
|
43219
|
+
Usage: ${pc69.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
43123
43220
|
`
|
|
43124
43221
|
);
|
|
43125
43222
|
throw new Error("Missing required flag: --domain");
|
|
@@ -43129,10 +43226,10 @@ Usage: ${pc68.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
|
43129
43226
|
}
|
|
43130
43227
|
case "remove": {
|
|
43131
43228
|
if (!flags.domain) {
|
|
43132
|
-
|
|
43229
|
+
clack65.log.error("--domain flag is required");
|
|
43133
43230
|
console.log(
|
|
43134
43231
|
`
|
|
43135
|
-
Usage: ${
|
|
43232
|
+
Usage: ${pc69.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
43136
43233
|
`
|
|
43137
43234
|
);
|
|
43138
43235
|
throw new Error("Missing required flag: --domain");
|
|
@@ -43162,12 +43259,12 @@ Usage: ${pc68.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
|
43162
43259
|
break;
|
|
43163
43260
|
}
|
|
43164
43261
|
default:
|
|
43165
|
-
|
|
43262
|
+
clack65.log.error(
|
|
43166
43263
|
`Unknown domains command: ${domainsSubCommand || "(none)"}`
|
|
43167
43264
|
);
|
|
43168
43265
|
console.log(
|
|
43169
43266
|
`
|
|
43170
|
-
Available commands: ${
|
|
43267
|
+
Available commands: ${pc69.cyan("add")}, ${pc69.cyan("list")}, ${pc69.cyan("verify")}, ${pc69.cyan("get-dkim")}, ${pc69.cyan("remove")}, ${pc69.cyan("config")}
|
|
43171
43268
|
`
|
|
43172
43269
|
);
|
|
43173
43270
|
throw new Error(
|
|
@@ -43209,12 +43306,12 @@ Available commands: ${pc68.cyan("add")}, ${pc68.cyan("list")}, ${pc68.cyan("veri
|
|
|
43209
43306
|
});
|
|
43210
43307
|
break;
|
|
43211
43308
|
default:
|
|
43212
|
-
|
|
43309
|
+
clack65.log.error(
|
|
43213
43310
|
`Unknown templates command: ${templatesSubCommand || "(none)"}`
|
|
43214
43311
|
);
|
|
43215
43312
|
console.log(
|
|
43216
43313
|
`
|
|
43217
|
-
Available commands: ${
|
|
43314
|
+
Available commands: ${pc69.cyan("init")}, ${pc69.cyan("push")}, ${pc69.cyan("preview")}
|
|
43218
43315
|
`
|
|
43219
43316
|
);
|
|
43220
43317
|
throw new Error(
|
|
@@ -43253,12 +43350,12 @@ Available commands: ${pc68.cyan("init")}, ${pc68.cyan("push")}, ${pc68.cyan("pre
|
|
|
43253
43350
|
});
|
|
43254
43351
|
break;
|
|
43255
43352
|
default:
|
|
43256
|
-
|
|
43353
|
+
clack65.log.error(
|
|
43257
43354
|
`Unknown workflows command: ${workflowsSubCommand || "(none)"}`
|
|
43258
43355
|
);
|
|
43259
43356
|
console.log(
|
|
43260
43357
|
`
|
|
43261
|
-
Available commands: ${
|
|
43358
|
+
Available commands: ${pc69.cyan("init")}, ${pc69.cyan("validate")}, ${pc69.cyan("push")}
|
|
43262
43359
|
`
|
|
43263
43360
|
);
|
|
43264
43361
|
throw new Error(
|
|
@@ -43283,7 +43380,7 @@ Available commands: ${pc68.cyan("init")}, ${pc68.cyan("validate")}, ${pc68.cyan(
|
|
|
43283
43380
|
case "get": {
|
|
43284
43381
|
const messageId = sub[3];
|
|
43285
43382
|
if (!messageId) {
|
|
43286
|
-
|
|
43383
|
+
clack65.log.error("Usage: wraps email logs get <message-id>");
|
|
43287
43384
|
throw new Error("Missing required argument: <message-id>");
|
|
43288
43385
|
}
|
|
43289
43386
|
await emailLogsGet({
|
|
@@ -43295,12 +43392,12 @@ Available commands: ${pc68.cyan("init")}, ${pc68.cyan("validate")}, ${pc68.cyan(
|
|
|
43295
43392
|
break;
|
|
43296
43393
|
}
|
|
43297
43394
|
default:
|
|
43298
|
-
|
|
43395
|
+
clack65.log.error(
|
|
43299
43396
|
`Unknown logs command: ${logsSubCommand || "(none)"}`
|
|
43300
43397
|
);
|
|
43301
43398
|
console.log(
|
|
43302
43399
|
`
|
|
43303
|
-
Available commands: ${
|
|
43400
|
+
Available commands: ${pc69.cyan("list")}, ${pc69.cyan("get <message-id>")}
|
|
43304
43401
|
`
|
|
43305
43402
|
);
|
|
43306
43403
|
throw new Error(
|
|
@@ -43325,10 +43422,10 @@ Available commands: ${pc68.cyan("list")}, ${pc68.cyan("get <message-id>")}
|
|
|
43325
43422
|
});
|
|
43326
43423
|
break;
|
|
43327
43424
|
default:
|
|
43328
|
-
|
|
43425
|
+
clack65.log.error(`Unknown email command: ${subCommand}`);
|
|
43329
43426
|
console.log(
|
|
43330
43427
|
`
|
|
43331
|
-
Run ${
|
|
43428
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43332
43429
|
`
|
|
43333
43430
|
);
|
|
43334
43431
|
throw new Error(`Unknown email command: ${subCommand}`);
|
|
@@ -43353,10 +43450,10 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43353
43450
|
});
|
|
43354
43451
|
break;
|
|
43355
43452
|
default:
|
|
43356
|
-
|
|
43453
|
+
clack65.log.error(`Unknown license command: ${subCommand}`);
|
|
43357
43454
|
console.log(
|
|
43358
43455
|
`
|
|
43359
|
-
Run ${
|
|
43456
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43360
43457
|
`
|
|
43361
43458
|
);
|
|
43362
43459
|
throw new Error(`Unknown license command: ${subCommand}`);
|
|
@@ -43415,6 +43512,13 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43415
43512
|
json: flags.json
|
|
43416
43513
|
});
|
|
43417
43514
|
break;
|
|
43515
|
+
case "destroy":
|
|
43516
|
+
await selfhostDestroy({
|
|
43517
|
+
region: flags.region,
|
|
43518
|
+
yes: flags.yes,
|
|
43519
|
+
force: flags.force
|
|
43520
|
+
});
|
|
43521
|
+
break;
|
|
43418
43522
|
case "connect":
|
|
43419
43523
|
await connect3({
|
|
43420
43524
|
region: flags.region,
|
|
@@ -43425,10 +43529,10 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43425
43529
|
});
|
|
43426
43530
|
break;
|
|
43427
43531
|
default:
|
|
43428
|
-
|
|
43532
|
+
clack65.log.error(`Unknown selfhost command: ${subCommand}`);
|
|
43429
43533
|
console.log(
|
|
43430
43534
|
`
|
|
43431
|
-
Run ${
|
|
43535
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43432
43536
|
`
|
|
43433
43537
|
);
|
|
43434
43538
|
throw new Error(`Unknown selfhost command: ${subCommand}`);
|
|
@@ -43508,10 +43612,10 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43508
43612
|
});
|
|
43509
43613
|
break;
|
|
43510
43614
|
default:
|
|
43511
|
-
|
|
43615
|
+
clack65.log.error(`Unknown sms command: ${subCommand}`);
|
|
43512
43616
|
console.log(
|
|
43513
43617
|
`
|
|
43514
|
-
Run ${
|
|
43618
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43515
43619
|
`
|
|
43516
43620
|
);
|
|
43517
43621
|
throw new Error(`Unknown sms command: ${subCommand}`);
|
|
@@ -43572,10 +43676,10 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43572
43676
|
});
|
|
43573
43677
|
break;
|
|
43574
43678
|
default:
|
|
43575
|
-
|
|
43679
|
+
clack65.log.error(`Unknown cdn command: ${subCommand}`);
|
|
43576
43680
|
console.log(
|
|
43577
43681
|
`
|
|
43578
|
-
Run ${
|
|
43682
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43579
43683
|
`
|
|
43580
43684
|
);
|
|
43581
43685
|
throw new Error(`Unknown cdn command: ${subCommand}`);
|
|
@@ -43597,13 +43701,13 @@ Run ${pc68.cyan("wraps --help")} for available commands.
|
|
|
43597
43701
|
});
|
|
43598
43702
|
break;
|
|
43599
43703
|
default:
|
|
43600
|
-
|
|
43704
|
+
clack65.log.error(
|
|
43601
43705
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
43602
43706
|
);
|
|
43603
43707
|
console.log(`
|
|
43604
|
-
Available commands: ${
|
|
43708
|
+
Available commands: ${pc69.cyan("init")}
|
|
43605
43709
|
`);
|
|
43606
|
-
console.log(`Run ${
|
|
43710
|
+
console.log(`Run ${pc69.cyan("wraps --help")} for more information.
|
|
43607
43711
|
`);
|
|
43608
43712
|
throw new Error(
|
|
43609
43713
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
@@ -43645,14 +43749,14 @@ Available commands: ${pc68.cyan("init")}
|
|
|
43645
43749
|
});
|
|
43646
43750
|
break;
|
|
43647
43751
|
default:
|
|
43648
|
-
|
|
43752
|
+
clack65.log.error(`Unknown platform command: ${subCommand}`);
|
|
43649
43753
|
console.log(
|
|
43650
43754
|
`
|
|
43651
|
-
Available commands: ${
|
|
43755
|
+
Available commands: ${pc69.cyan("connect")}, ${pc69.cyan("update-role")}
|
|
43652
43756
|
`
|
|
43653
43757
|
);
|
|
43654
43758
|
console.log(
|
|
43655
|
-
`Run ${
|
|
43759
|
+
`Run ${pc69.cyan("wraps platform")} for more information.
|
|
43656
43760
|
`
|
|
43657
43761
|
);
|
|
43658
43762
|
throw new Error(`Unknown platform command: ${subCommand}`);
|
|
@@ -43677,10 +43781,10 @@ Available commands: ${pc68.cyan("connect")}, ${pc68.cyan("update-role")}
|
|
|
43677
43781
|
await logout();
|
|
43678
43782
|
break;
|
|
43679
43783
|
default:
|
|
43680
|
-
|
|
43784
|
+
clack65.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
43681
43785
|
console.log(
|
|
43682
43786
|
`
|
|
43683
|
-
Available commands: ${
|
|
43787
|
+
Available commands: ${pc69.cyan("login")}, ${pc69.cyan("status")}, ${pc69.cyan("logout")}
|
|
43684
43788
|
`
|
|
43685
43789
|
);
|
|
43686
43790
|
throw new Error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
@@ -43698,13 +43802,13 @@ Available commands: ${pc68.cyan("login")}, ${pc68.cyan("status")}, ${pc68.cyan("
|
|
|
43698
43802
|
await doctor();
|
|
43699
43803
|
break;
|
|
43700
43804
|
default:
|
|
43701
|
-
|
|
43805
|
+
clack65.log.error(`Unknown aws command: ${subCommand}`);
|
|
43702
43806
|
console.log(
|
|
43703
43807
|
`
|
|
43704
|
-
Available commands: ${
|
|
43808
|
+
Available commands: ${pc69.cyan("setup")}, ${pc69.cyan("doctor")}
|
|
43705
43809
|
`
|
|
43706
43810
|
);
|
|
43707
|
-
console.log(`Run ${
|
|
43811
|
+
console.log(`Run ${pc69.cyan("wraps --help")} for more information.
|
|
43708
43812
|
`);
|
|
43709
43813
|
throw new Error(`Unknown aws command: ${subCommand}`);
|
|
43710
43814
|
}
|
|
@@ -43785,10 +43889,10 @@ Available commands: ${pc68.cyan("setup")}, ${pc68.cyan("doctor")}
|
|
|
43785
43889
|
await telemetryStatus();
|
|
43786
43890
|
break;
|
|
43787
43891
|
default:
|
|
43788
|
-
|
|
43892
|
+
clack65.log.error(`Unknown telemetry command: ${subCommand}`);
|
|
43789
43893
|
console.log(
|
|
43790
43894
|
`
|
|
43791
|
-
Available commands: ${
|
|
43895
|
+
Available commands: ${pc69.cyan("enable")}, ${pc69.cyan("disable")}, ${pc69.cyan("status")}
|
|
43792
43896
|
`
|
|
43793
43897
|
);
|
|
43794
43898
|
throw new Error(`Unknown telemetry command: ${subCommand}`);
|
|
@@ -43812,10 +43916,10 @@ Please specify a command for ${primaryCommand} service.
|
|
|
43812
43916
|
showHelp();
|
|
43813
43917
|
break;
|
|
43814
43918
|
default:
|
|
43815
|
-
|
|
43919
|
+
clack65.log.error(`Unknown command: ${primaryCommand}`);
|
|
43816
43920
|
console.log(
|
|
43817
43921
|
`
|
|
43818
|
-
Run ${
|
|
43922
|
+
Run ${pc69.cyan("wraps --help")} for available commands.
|
|
43819
43923
|
`
|
|
43820
43924
|
);
|
|
43821
43925
|
throw new Error(`Unknown command: ${primaryCommand}`);
|