@wraps.dev/cli 2.21.5 → 2.21.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-lambda.zip +0 -0
- package/dist/cli.js +868 -770
- 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/0000_absent_rogue.sql +203 -0
- package/dist/selfhost-migrations/0001_polite_maverick.sql +17 -0
- package/dist/selfhost-migrations/0002_perpetual_scorpion.sql +1 -0
- package/dist/selfhost-migrations/0003_wealthy_absorbing_man.sql +1 -0
- package/dist/selfhost-migrations/0004_opposite_blur.sql +1 -0
- package/dist/selfhost-migrations/0005_clear_terror.sql +4 -0
- package/dist/selfhost-migrations/0006_soft_black_widow.sql +20 -0
- package/dist/selfhost-migrations/0007_dazzling_saracen.sql +124 -0
- package/dist/selfhost-migrations/0008_broad_hannibal_king.sql +33 -0
- package/dist/selfhost-migrations/0009_bouncy_mystique.sql +73 -0
- package/dist/selfhost-migrations/0010_cheerful_valeria_richards.sql +18 -0
- package/dist/selfhost-migrations/0011_absent_thunderbolts.sql +2 -0
- package/dist/selfhost-migrations/0012_demonic_donald_blake.sql +1 -0
- package/dist/selfhost-migrations/0013_nifty_preak.sql +143 -0
- package/dist/selfhost-migrations/0014_hesitant_beast.sql +2 -0
- package/dist/selfhost-migrations/0015_blue_giant_girl.sql +1 -0
- package/dist/selfhost-migrations/0016_cooing_overlord.sql +1 -0
- package/dist/selfhost-migrations/0017_tranquil_ender_wiggin.sql +11 -0
- package/dist/selfhost-migrations/0018_talented_groot.sql +8 -0
- package/dist/selfhost-migrations/0019_ambitious_devos.sql +3 -0
- package/dist/selfhost-migrations/0020_misty_master_mold.sql +95 -0
- package/dist/selfhost-migrations/0021_regular_harrier.sql +14 -0
- package/dist/selfhost-migrations/0022_sour_blizzard.sql +10 -0
- package/dist/selfhost-migrations/0023_flawless_psynapse.sql +1 -0
- package/dist/selfhost-migrations/0024_premium_blindfold.sql +1 -0
- package/dist/selfhost-migrations/0025_unusual_santa_claus.sql +1 -0
- package/dist/selfhost-migrations/0026_volatile_pandemic.sql +2 -0
- package/dist/selfhost-migrations/0027_workable_logan.sql +4 -0
- package/dist/selfhost-migrations/0028_familiar_prodigy.sql +1 -0
- package/dist/selfhost-migrations/0029_cute_maddog.sql +13 -0
- package/dist/selfhost-migrations/0030_adorable_scarecrow.sql +1 -0
- package/dist/selfhost-migrations/0031_material_slapstick.sql +10 -0
- package/dist/selfhost-migrations/0032_hot_dust.sql +11 -0
- package/dist/selfhost-migrations/0033_slow_deathbird.sql +1 -0
- package/dist/selfhost-migrations/0034_lush_rafael_vega.sql +12 -0
- package/dist/selfhost-migrations/0035_normal_red_hulk.sql +8 -0
- package/dist/selfhost-migrations/0036_marvelous_ezekiel.sql +1 -0
- package/dist/selfhost-migrations/0037_swift_talisman.sql +8 -0
- package/dist/selfhost-migrations/0038_first_mandroid.sql +1 -0
- package/dist/selfhost-migrations/0039_fixed_stryfe.sql +1 -0
- package/dist/selfhost-migrations/0040_add_channel_check_constraints.sql +2 -0
- package/dist/selfhost-migrations/0041_black_spencer_smythe.sql +1 -0
- package/dist/selfhost-migrations/0042_plain_marvel_zombies.sql +2 -0
- package/dist/selfhost-migrations/0043_curved_champions.sql +1 -0
- package/dist/selfhost-migrations/0044_clean_iceman.sql +1 -0
- package/dist/selfhost-migrations/0045_condemned_steel_serpent.sql +1 -0
- package/dist/selfhost-migrations/0046_steep_ultimo.sql +2 -0
- package/dist/selfhost-migrations/0047_empty_sleepwalker.sql +2 -0
- package/dist/selfhost-migrations/0048_cheerful_multiple_man.sql +1 -0
- package/dist/selfhost-migrations/0049_nostalgic_loki.sql +3 -0
- package/dist/selfhost-migrations/0050_add_engagement_metadata.sql +4 -0
- package/dist/selfhost-migrations/0051_odd_marrow.sql +2 -0
- package/dist/selfhost-migrations/0052_redundant_siren.sql +5 -0
- package/dist/selfhost-migrations/0053_soft_carnage.sql +31 -0
- package/dist/selfhost-migrations/0054_blushing_vin_gonzales.sql +1 -0
- package/dist/selfhost-migrations/0055_broadcast_resume_columns.sql +12 -0
- package/dist/selfhost-migrations/0056_broadcast_resume_dedup_cleanup.sql +31 -0
- package/dist/selfhost-migrations/0057_audit_log_actoremail_jsonb.sql +5 -0
- package/package.json +7 -4
package/dist/cli.js
CHANGED
|
@@ -1748,8 +1748,8 @@ async function ensurePulumiWorkDir(options) {
|
|
|
1748
1748
|
);
|
|
1749
1749
|
return;
|
|
1750
1750
|
} catch (error) {
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1751
|
+
const clack62 = await import("@clack/prompts");
|
|
1752
|
+
clack62.log.warn(
|
|
1753
1753
|
`S3 state backend unavailable (${error instanceof Error ? error.message : error}). Using local state.`
|
|
1754
1754
|
);
|
|
1755
1755
|
}
|
|
@@ -6730,7 +6730,7 @@ __export(pulumi_exports, {
|
|
|
6730
6730
|
import { exec } from "child_process";
|
|
6731
6731
|
import { existsSync as existsSync6, readdirSync as readdirSync2 } from "fs";
|
|
6732
6732
|
import { homedir as homedir3 } from "os";
|
|
6733
|
-
import { dirname as dirname2, join as join7 } from "path";
|
|
6733
|
+
import { delimiter, dirname as dirname2, join as join7 } from "path";
|
|
6734
6734
|
import { promisify } from "util";
|
|
6735
6735
|
import { PulumiCommand } from "@pulumi/pulumi/automation/index.js";
|
|
6736
6736
|
function findSdkInstalledPulumi() {
|
|
@@ -6739,8 +6739,9 @@ function findSdkInstalledPulumi() {
|
|
|
6739
6739
|
return;
|
|
6740
6740
|
}
|
|
6741
6741
|
const versions = readdirSync2(versionsDir, { withFileTypes: true }).filter((d) => d.isDirectory()).map((d) => d.name).sort().reverse();
|
|
6742
|
+
const binaryName = process.platform === "win32" ? "pulumi.exe" : "pulumi";
|
|
6742
6743
|
for (const version of versions) {
|
|
6743
|
-
const binPath = join7(versionsDir, version, "bin",
|
|
6744
|
+
const binPath = join7(versionsDir, version, "bin", binaryName);
|
|
6744
6745
|
if (existsSync6(binPath)) {
|
|
6745
6746
|
return dirname2(binPath);
|
|
6746
6747
|
}
|
|
@@ -6754,7 +6755,7 @@ async function checkPulumiInstalled() {
|
|
|
6754
6755
|
} catch {
|
|
6755
6756
|
const binDir = findSdkInstalledPulumi();
|
|
6756
6757
|
if (binDir) {
|
|
6757
|
-
process.env.PATH = `${binDir}
|
|
6758
|
+
process.env.PATH = `${binDir}${delimiter}${process.env.PATH}`;
|
|
6758
6759
|
return true;
|
|
6759
6760
|
}
|
|
6760
6761
|
return false;
|
|
@@ -6766,7 +6767,7 @@ async function ensurePulumiInstalled() {
|
|
|
6766
6767
|
try {
|
|
6767
6768
|
const cmd = await PulumiCommand.install();
|
|
6768
6769
|
const binDir = dirname2(cmd.command);
|
|
6769
|
-
process.env.PATH = `${binDir}
|
|
6770
|
+
process.env.PATH = `${binDir}${delimiter}${process.env.PATH}`;
|
|
6770
6771
|
return true;
|
|
6771
6772
|
} catch (_error) {
|
|
6772
6773
|
throw errors.pulumiNotInstalled();
|
|
@@ -6854,23 +6855,23 @@ async function withLockRetry(fn, options) {
|
|
|
6854
6855
|
if (parsed.code !== "STACK_LOCKED") {
|
|
6855
6856
|
throw error;
|
|
6856
6857
|
}
|
|
6857
|
-
const
|
|
6858
|
-
const
|
|
6858
|
+
const clack62 = await import("@clack/prompts");
|
|
6859
|
+
const pc66 = (await import("picocolors")).default;
|
|
6859
6860
|
if (options.autoConfirm) {
|
|
6860
|
-
|
|
6861
|
+
clack62.log.warn(
|
|
6861
6862
|
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
6862
6863
|
);
|
|
6863
6864
|
} else {
|
|
6864
|
-
const shouldClear = await
|
|
6865
|
-
message: `Stack is locked from a previous interrupted run. ${
|
|
6865
|
+
const shouldClear = await clack62.confirm({
|
|
6866
|
+
message: `Stack is locked from a previous interrupted run. ${pc66.yellow("Clear the stale lock and retry?")}`,
|
|
6866
6867
|
initialValue: true
|
|
6867
6868
|
});
|
|
6868
|
-
if (
|
|
6869
|
+
if (clack62.isCancel(shouldClear) || !shouldClear) {
|
|
6869
6870
|
throw errors.stackLocked();
|
|
6870
6871
|
}
|
|
6871
6872
|
}
|
|
6872
6873
|
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
6873
|
-
|
|
6874
|
+
clack62.log.info(
|
|
6874
6875
|
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
6875
6876
|
);
|
|
6876
6877
|
return fn();
|
|
@@ -10204,8 +10205,8 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
|
|
|
10204
10205
|
import { join as join23 } from "path";
|
|
10205
10206
|
import { Readable } from "stream";
|
|
10206
10207
|
import { pipeline } from "stream/promises";
|
|
10207
|
-
import { cancel as cancel35, confirm as confirm29, intro as
|
|
10208
|
-
import
|
|
10208
|
+
import { cancel as cancel35, confirm as confirm29, intro as intro57, isCancel as isCancel40, log as log55 } from "@clack/prompts";
|
|
10209
|
+
import pc64 from "picocolors";
|
|
10209
10210
|
function isStandaloneInstall() {
|
|
10210
10211
|
return process.execPath.includes(".wraps/runtime");
|
|
10211
10212
|
}
|
|
@@ -10234,7 +10235,7 @@ function detectPlatformArch() {
|
|
|
10234
10235
|
return { platform: platform2, arch };
|
|
10235
10236
|
}
|
|
10236
10237
|
async function update(currentVersion) {
|
|
10237
|
-
|
|
10238
|
+
intro57(pc64.bold("Wraps CLI Update"));
|
|
10238
10239
|
const progress = new DeploymentProgress();
|
|
10239
10240
|
const result = await progress.execute(
|
|
10240
10241
|
"Checking for updates...",
|
|
@@ -10246,20 +10247,20 @@ async function update(currentVersion) {
|
|
|
10246
10247
|
}
|
|
10247
10248
|
const { version: latestVersion, release } = result;
|
|
10248
10249
|
if (currentVersion === latestVersion) {
|
|
10249
|
-
progress.succeed(`Already up to date ${
|
|
10250
|
+
progress.succeed(`Already up to date ${pc64.dim(`(v${currentVersion})`)}`);
|
|
10250
10251
|
return;
|
|
10251
10252
|
}
|
|
10252
10253
|
console.log();
|
|
10253
|
-
|
|
10254
|
-
`Current version: ${
|
|
10255
|
-
Latest version: ${
|
|
10254
|
+
log55.info(
|
|
10255
|
+
`Current version: ${pc64.dim(`v${currentVersion}`)}
|
|
10256
|
+
Latest version: ${pc64.cyan(`v${latestVersion}`)}`
|
|
10256
10257
|
);
|
|
10257
10258
|
console.log();
|
|
10258
10259
|
if (!isStandaloneInstall()) {
|
|
10259
|
-
|
|
10260
|
+
log55.info(
|
|
10260
10261
|
`You installed Wraps via npm. Update with:
|
|
10261
10262
|
|
|
10262
|
-
${
|
|
10263
|
+
${pc64.cyan("npm update -g @wraps.dev/cli")}`
|
|
10263
10264
|
);
|
|
10264
10265
|
return;
|
|
10265
10266
|
}
|
|
@@ -10334,7 +10335,7 @@ async function update(currentVersion) {
|
|
|
10334
10335
|
});
|
|
10335
10336
|
console.log();
|
|
10336
10337
|
progress.succeed(
|
|
10337
|
-
`Updated to ${
|
|
10338
|
+
`Updated to ${pc64.cyan(`v${latestVersion}`)} successfully!`
|
|
10338
10339
|
);
|
|
10339
10340
|
} finally {
|
|
10340
10341
|
rmSync(tmp, { recursive: true, force: true });
|
|
@@ -10355,10 +10356,10 @@ var init_update = __esm({
|
|
|
10355
10356
|
// src/cli.ts
|
|
10356
10357
|
init_esm_shims();
|
|
10357
10358
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10358
|
-
import { dirname as
|
|
10359
|
+
import { dirname as dirname7, join as join24 } from "path";
|
|
10359
10360
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
10360
|
-
import * as
|
|
10361
|
-
import
|
|
10361
|
+
import * as clack61 from "@clack/prompts";
|
|
10362
|
+
import pc65 from "picocolors";
|
|
10362
10363
|
|
|
10363
10364
|
// src/commands/auth/login.ts
|
|
10364
10365
|
init_esm_shims();
|
|
@@ -12281,7 +12282,17 @@ async function createServiceIAMRole(config2) {
|
|
|
12281
12282
|
}]
|
|
12282
12283
|
}`);
|
|
12283
12284
|
} else {
|
|
12284
|
-
|
|
12285
|
+
const identity = await aws2.getCallerIdentity();
|
|
12286
|
+
assumeRolePolicy = pulumi3.output(`{
|
|
12287
|
+
"Version": "2012-10-17",
|
|
12288
|
+
"Statement": [{
|
|
12289
|
+
"Effect": "Allow",
|
|
12290
|
+
"Principal": {
|
|
12291
|
+
"AWS": "arn:aws:iam::${identity.accountId}:root"
|
|
12292
|
+
},
|
|
12293
|
+
"Action": "sts:AssumeRole"
|
|
12294
|
+
}]
|
|
12295
|
+
}`);
|
|
12285
12296
|
}
|
|
12286
12297
|
const roleName = `wraps-${config2.serviceName}-role`;
|
|
12287
12298
|
const exists = await roleExists(roleName);
|
|
@@ -26203,7 +26214,7 @@ async function findCliNodeModules() {
|
|
|
26203
26214
|
const paths = [];
|
|
26204
26215
|
try {
|
|
26205
26216
|
const { createRequire } = await import("module");
|
|
26206
|
-
const { dirname:
|
|
26217
|
+
const { dirname: dirname8 } = await import("path");
|
|
26207
26218
|
for (const base of [
|
|
26208
26219
|
// The current file's location (works when running from source)
|
|
26209
26220
|
import.meta.url,
|
|
@@ -26213,7 +26224,7 @@ async function findCliNodeModules() {
|
|
|
26213
26224
|
try {
|
|
26214
26225
|
const req = createRequire(base);
|
|
26215
26226
|
const reactPkg = req.resolve("react/package.json");
|
|
26216
|
-
const reactNodeModules = join12(
|
|
26227
|
+
const reactNodeModules = join12(dirname8(reactPkg), "..");
|
|
26217
26228
|
if (existsSync10(join12(reactNodeModules, "react"))) {
|
|
26218
26229
|
paths.push(reactNodeModules);
|
|
26219
26230
|
break;
|
|
@@ -33210,9 +33221,9 @@ function buildConsolePolicyDocument2(emailConfig, smsConfig) {
|
|
|
33210
33221
|
|
|
33211
33222
|
// src/commands/selfhost/deploy.ts
|
|
33212
33223
|
init_esm_shims();
|
|
33213
|
-
import { execSync as execSync2 } from "child_process";
|
|
33214
33224
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
33215
|
-
import {
|
|
33225
|
+
import { existsSync as existsSync18 } from "fs";
|
|
33226
|
+
import { dirname as dirname5, join as join20 } from "path";
|
|
33216
33227
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
33217
33228
|
import * as clack43 from "@clack/prompts";
|
|
33218
33229
|
import * as pulumi26 from "@pulumi/pulumi";
|
|
@@ -33481,7 +33492,9 @@ init_metadata();
|
|
|
33481
33492
|
init_output();
|
|
33482
33493
|
init_pulumi();
|
|
33483
33494
|
var __filename2 = fileURLToPath5(import.meta.url);
|
|
33484
|
-
var
|
|
33495
|
+
var cliDir = dirname5(__filename2);
|
|
33496
|
+
var bundledLambdaZip = join20(cliDir, "api-lambda.zip");
|
|
33497
|
+
var bundledMigrationsDir = join20(cliDir, "selfhost-migrations");
|
|
33485
33498
|
async function selfhostDeploy(options) {
|
|
33486
33499
|
const startTime = Date.now();
|
|
33487
33500
|
if (!isJsonMode()) {
|
|
@@ -33539,18 +33552,24 @@ async function selfhostDeploy(options) {
|
|
|
33539
33552
|
clack43.log.info(`To update: run ${pc46.cyan("wraps selfhost upgrade")}`);
|
|
33540
33553
|
process.exit(0);
|
|
33541
33554
|
}
|
|
33542
|
-
let
|
|
33543
|
-
|
|
33544
|
-
|
|
33545
|
-
|
|
33546
|
-
|
|
33547
|
-
|
|
33548
|
-
|
|
33549
|
-
|
|
33555
|
+
let resolvedDatabaseUrl = options.databaseUrl;
|
|
33556
|
+
let resolvedNeonProjectId;
|
|
33557
|
+
let neonApiKey;
|
|
33558
|
+
let neonOrgId;
|
|
33559
|
+
if (!resolvedDatabaseUrl) {
|
|
33560
|
+
neonApiKey = options.neonApiKey;
|
|
33561
|
+
if (!neonApiKey) {
|
|
33562
|
+
const neonApiKeyAnswer = await clack43.password({
|
|
33563
|
+
message: "Neon API key (create one at console.neon.tech/app/settings/api-keys):"
|
|
33564
|
+
});
|
|
33565
|
+
if (clack43.isCancel(neonApiKeyAnswer)) {
|
|
33566
|
+
clack43.cancel("Operation cancelled.");
|
|
33567
|
+
process.exit(0);
|
|
33568
|
+
}
|
|
33569
|
+
neonApiKey = neonApiKeyAnswer;
|
|
33550
33570
|
}
|
|
33551
|
-
|
|
33571
|
+
neonOrgId = options.neonOrgId;
|
|
33552
33572
|
}
|
|
33553
|
-
const neonOrgId = options.neonOrgId;
|
|
33554
33573
|
let licenseKey = options.licenseKey;
|
|
33555
33574
|
if (!licenseKey) {
|
|
33556
33575
|
const licenseKeyAnswer = await clack43.text({
|
|
@@ -33586,34 +33605,36 @@ async function selfhostDeploy(options) {
|
|
|
33586
33605
|
process.exit(0);
|
|
33587
33606
|
}
|
|
33588
33607
|
}
|
|
33589
|
-
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
|
|
33593
|
-
|
|
33594
|
-
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33599
|
-
|
|
33600
|
-
|
|
33601
|
-
|
|
33602
|
-
|
|
33603
|
-
|
|
33604
|
-
|
|
33605
|
-
|
|
33606
|
-
|
|
33607
|
-
|
|
33608
|
-
|
|
33609
|
-
|
|
33610
|
-
|
|
33611
|
-
|
|
33608
|
+
if (!existsSync18(bundledLambdaZip)) {
|
|
33609
|
+
throw new Error(
|
|
33610
|
+
`Bundled API lambda not found at ${bundledLambdaZip}. Run 'pnpm build' in the CLI package to generate it.`
|
|
33611
|
+
);
|
|
33612
|
+
}
|
|
33613
|
+
const lambdaZipPath = bundledLambdaZip;
|
|
33614
|
+
if (!resolvedDatabaseUrl) {
|
|
33615
|
+
const neonProject = await progress.execute(
|
|
33616
|
+
"Provisioning Neon PostgreSQL database",
|
|
33617
|
+
async () => provisionNeonProject(
|
|
33618
|
+
neonApiKey,
|
|
33619
|
+
buildNeonProjectName(identity.accountId, region),
|
|
33620
|
+
{ orgId: neonOrgId }
|
|
33621
|
+
)
|
|
33622
|
+
);
|
|
33623
|
+
progress.info(`Neon project created: ${pc46.cyan(neonProject.name)}`);
|
|
33624
|
+
resolvedDatabaseUrl = neonProject.connectionString;
|
|
33625
|
+
resolvedNeonProjectId = neonProject.id;
|
|
33626
|
+
}
|
|
33627
|
+
if (!resolvedDatabaseUrl) {
|
|
33628
|
+
throw new Error(
|
|
33629
|
+
"[bug] resolvedDatabaseUrl was not set after DB resolution"
|
|
33630
|
+
);
|
|
33631
|
+
}
|
|
33632
|
+
const databaseUrl = resolvedDatabaseUrl;
|
|
33612
33633
|
const unsubscribeSecret = randomBytes6(32).toString("hex");
|
|
33613
33634
|
const betterAuthSecret = randomBytes6(32).toString("hex");
|
|
33614
33635
|
const selfhostConfig = {
|
|
33615
|
-
neonProjectId:
|
|
33616
|
-
databaseUrl
|
|
33636
|
+
neonProjectId: resolvedNeonProjectId,
|
|
33637
|
+
databaseUrl,
|
|
33617
33638
|
licenseKey,
|
|
33618
33639
|
appUrl,
|
|
33619
33640
|
unsubscribeSecret,
|
|
@@ -33639,14 +33660,14 @@ async function selfhostDeploy(options) {
|
|
|
33639
33660
|
savedMetadata.timestamp = deployedAt;
|
|
33640
33661
|
await saveConnectionMetadata(savedMetadata);
|
|
33641
33662
|
await progress.execute("Running database migrations", async () => {
|
|
33642
|
-
|
|
33643
|
-
|
|
33644
|
-
|
|
33645
|
-
|
|
33646
|
-
|
|
33647
|
-
|
|
33648
|
-
|
|
33649
|
-
|
|
33663
|
+
const { neonConfig, Pool } = await import("@neondatabase/serverless");
|
|
33664
|
+
const { drizzle } = await import("drizzle-orm/neon-serverless");
|
|
33665
|
+
const { migrate } = await import("drizzle-orm/neon-serverless/migrator");
|
|
33666
|
+
neonConfig.poolQueryViaFetch = true;
|
|
33667
|
+
const pool = new Pool({ connectionString: databaseUrl });
|
|
33668
|
+
const db = drizzle(pool);
|
|
33669
|
+
await migrate(db, { migrationsFolder: bundledMigrationsDir });
|
|
33670
|
+
await pool.end();
|
|
33650
33671
|
});
|
|
33651
33672
|
const createStack = async () => {
|
|
33652
33673
|
await ensurePulumiWorkDir({
|
|
@@ -33662,7 +33683,7 @@ async function selfhostDeploy(options) {
|
|
|
33662
33683
|
accountId: identity.accountId,
|
|
33663
33684
|
region,
|
|
33664
33685
|
lambdaZipPath,
|
|
33665
|
-
databaseUrl
|
|
33686
|
+
databaseUrl,
|
|
33666
33687
|
licenseKey,
|
|
33667
33688
|
appUrl,
|
|
33668
33689
|
unsubscribeSecret,
|
|
@@ -33784,7 +33805,7 @@ async function selfhostDeploy(options) {
|
|
|
33784
33805
|
`${pc46.bold("API URL:")} ${pc46.cyan(outputs.apiUrl)}`,
|
|
33785
33806
|
`${pc46.bold("Region:")} ${pc46.cyan(region)}`,
|
|
33786
33807
|
`${pc46.bold("Lambda ARN:")} ${pc46.dim(outputs.lambdaArn)}`,
|
|
33787
|
-
`${pc46.bold("Neon Project:")} ${pc46.dim(
|
|
33808
|
+
...resolvedNeonProjectId ? [`${pc46.bold("Neon Project:")} ${pc46.dim(resolvedNeonProjectId)}`] : [],
|
|
33788
33809
|
"",
|
|
33789
33810
|
pc46.dim("Next steps:"),
|
|
33790
33811
|
pc46.dim(` Set WRAPS_API_URL=${outputs.apiUrl} in your app`),
|
|
@@ -33797,36 +33818,112 @@ async function selfhostDeploy(options) {
|
|
|
33797
33818
|
);
|
|
33798
33819
|
}
|
|
33799
33820
|
|
|
33800
|
-
// src/commands/selfhost/
|
|
33821
|
+
// src/commands/selfhost/env.ts
|
|
33801
33822
|
init_esm_shims();
|
|
33802
33823
|
init_events();
|
|
33803
33824
|
init_aws();
|
|
33804
33825
|
init_json_output();
|
|
33805
33826
|
init_metadata();
|
|
33806
|
-
init_output();
|
|
33807
33827
|
init_region_resolver();
|
|
33808
33828
|
import * as clack44 from "@clack/prompts";
|
|
33809
33829
|
import pc47 from "picocolors";
|
|
33830
|
+
async function selfhostEnv(options) {
|
|
33831
|
+
const startTime = Date.now();
|
|
33832
|
+
if (!isJsonMode()) {
|
|
33833
|
+
clack44.intro(pc47.bold("Wraps Self-Hosted \u2014 Vercel Environment Variables"));
|
|
33834
|
+
}
|
|
33835
|
+
const identity = await validateAWSCredentials();
|
|
33836
|
+
const region = await resolveRegionForCommand({
|
|
33837
|
+
accountId: identity.accountId,
|
|
33838
|
+
optionRegion: options.region,
|
|
33839
|
+
service: "selfhost",
|
|
33840
|
+
label: "self-hosted deployment"
|
|
33841
|
+
});
|
|
33842
|
+
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33843
|
+
if (!metadata?.services?.selfhost) {
|
|
33844
|
+
clack44.log.error("No self-hosted deployment found");
|
|
33845
|
+
console.log(
|
|
33846
|
+
`
|
|
33847
|
+
Run ${pc47.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
33848
|
+
`
|
|
33849
|
+
);
|
|
33850
|
+
process.exit(1);
|
|
33851
|
+
return;
|
|
33852
|
+
}
|
|
33853
|
+
const { config: config2 } = metadata.services.selfhost;
|
|
33854
|
+
const env = {
|
|
33855
|
+
DATABASE_URL: config2.databaseUrl,
|
|
33856
|
+
NEXT_PUBLIC_APP_URL: config2.appUrl,
|
|
33857
|
+
CORS_ORIGIN: config2.appUrl,
|
|
33858
|
+
BETTER_AUTH_SECRET: config2.betterAuthSecret,
|
|
33859
|
+
WRAPS_LICENSE_KEY: config2.licenseKey,
|
|
33860
|
+
AWS_BACKEND_ACCOUNT_ID: identity.accountId
|
|
33861
|
+
};
|
|
33862
|
+
if (isJsonMode()) {
|
|
33863
|
+
jsonSuccess("selfhost.env", { env });
|
|
33864
|
+
return;
|
|
33865
|
+
}
|
|
33866
|
+
console.log("# Wraps Self-Hosted \u2014 environment for apps/web on Vercel");
|
|
33867
|
+
console.log(
|
|
33868
|
+
`# Deployment: ${identity.accountId} / ${region} \u2014 ${config2.appUrl}`
|
|
33869
|
+
);
|
|
33870
|
+
console.log(`# Generated: ${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
33871
|
+
console.log("");
|
|
33872
|
+
for (const [key, value] of Object.entries(env)) {
|
|
33873
|
+
console.log(`${key}=${value}`);
|
|
33874
|
+
}
|
|
33875
|
+
console.log("");
|
|
33876
|
+
console.log(
|
|
33877
|
+
"# AWS credentials for role assumption \u2014 create an IAM user in your account"
|
|
33878
|
+
);
|
|
33879
|
+
console.log(
|
|
33880
|
+
`# with sts:AssumeRole permission on arn:aws:iam::${identity.accountId}:role/wraps-console-access-role`
|
|
33881
|
+
);
|
|
33882
|
+
console.log("# AWS_ACCESS_KEY_ID=<fill-in>");
|
|
33883
|
+
console.log("# AWS_SECRET_ACCESS_KEY=<fill-in>");
|
|
33884
|
+
clack44.outro(
|
|
33885
|
+
pc47.dim(
|
|
33886
|
+
"Paste into Vercel \u2192 Settings \u2192 Environment Variables \u2192 Add from .env"
|
|
33887
|
+
)
|
|
33888
|
+
);
|
|
33889
|
+
trackCommand("selfhost:env", {
|
|
33890
|
+
success: true,
|
|
33891
|
+
duration_ms: Date.now() - startTime
|
|
33892
|
+
});
|
|
33893
|
+
}
|
|
33894
|
+
|
|
33895
|
+
// src/commands/selfhost/status.ts
|
|
33896
|
+
init_esm_shims();
|
|
33897
|
+
init_events();
|
|
33898
|
+
init_aws();
|
|
33899
|
+
init_json_output();
|
|
33900
|
+
init_metadata();
|
|
33901
|
+
init_output();
|
|
33902
|
+
init_region_resolver();
|
|
33903
|
+
import * as clack45 from "@clack/prompts";
|
|
33904
|
+
import pc48 from "picocolors";
|
|
33810
33905
|
function displaySelfhostStatus(options) {
|
|
33811
33906
|
const lines = [];
|
|
33812
|
-
lines.push(
|
|
33907
|
+
lines.push(pc48.bold(pc48.green("Self-Hosted Control Plane Active")));
|
|
33813
33908
|
lines.push("");
|
|
33814
|
-
lines.push(
|
|
33815
|
-
lines.push(` URL: ${
|
|
33816
|
-
lines.push(` Region: ${
|
|
33817
|
-
lines.push(` Deployed: ${
|
|
33909
|
+
lines.push(pc48.bold("API"));
|
|
33910
|
+
lines.push(` URL: ${pc48.cyan(options.apiUrl)}`);
|
|
33911
|
+
lines.push(` Region: ${pc48.cyan(options.region)}`);
|
|
33912
|
+
lines.push(` Deployed: ${pc48.dim(options.deployedAt)}`);
|
|
33818
33913
|
lines.push("");
|
|
33819
|
-
lines.push(
|
|
33820
|
-
lines.push(` App URL: ${
|
|
33821
|
-
lines.push(` License Key: ${
|
|
33822
|
-
|
|
33823
|
-
|
|
33914
|
+
lines.push(pc48.bold("Configuration"));
|
|
33915
|
+
lines.push(` App URL: ${pc48.cyan(options.appUrl)}`);
|
|
33916
|
+
lines.push(` License Key: ${pc48.dim(`${options.licenseKeyPrefix}...`)}`);
|
|
33917
|
+
if (options.neonProjectId) {
|
|
33918
|
+
lines.push(` Neon Project: ${pc48.dim(options.neonProjectId)}`);
|
|
33919
|
+
}
|
|
33920
|
+
clack45.note(lines.join("\n"), "Self-Hosted Status");
|
|
33824
33921
|
}
|
|
33825
33922
|
async function selfhostStatus(options) {
|
|
33826
33923
|
const startTime = Date.now();
|
|
33827
33924
|
const progress = new DeploymentProgress();
|
|
33828
33925
|
if (!isJsonMode()) {
|
|
33829
|
-
|
|
33926
|
+
clack45.intro(pc48.bold("Wraps Self-Hosted Status"));
|
|
33830
33927
|
}
|
|
33831
33928
|
const identity = await progress.execute(
|
|
33832
33929
|
"Loading self-hosted status",
|
|
@@ -33841,10 +33938,10 @@ async function selfhostStatus(options) {
|
|
|
33841
33938
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33842
33939
|
if (!metadata?.services?.selfhost) {
|
|
33843
33940
|
progress.stop();
|
|
33844
|
-
|
|
33941
|
+
clack45.log.error("No self-hosted deployment found");
|
|
33845
33942
|
console.log(
|
|
33846
33943
|
`
|
|
33847
|
-
Run ${
|
|
33944
|
+
Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
33848
33945
|
`
|
|
33849
33946
|
);
|
|
33850
33947
|
process.exit(1);
|
|
@@ -33866,25 +33963,25 @@ Run ${pc47.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
33866
33963
|
}
|
|
33867
33964
|
displaySelfhostStatus(statusData);
|
|
33868
33965
|
console.log("");
|
|
33869
|
-
|
|
33966
|
+
clack45.log.info(pc48.bold("Commands:"));
|
|
33870
33967
|
console.log(
|
|
33871
|
-
` ${
|
|
33968
|
+
` ${pc48.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
|
|
33872
33969
|
);
|
|
33873
33970
|
trackCommand("selfhost:status", {
|
|
33874
33971
|
success: true,
|
|
33875
33972
|
duration_ms: Date.now() - startTime
|
|
33876
33973
|
});
|
|
33877
|
-
|
|
33974
|
+
clack45.outro(pc48.dim("Self-hosted deployment is active"));
|
|
33878
33975
|
}
|
|
33879
33976
|
|
|
33880
33977
|
// src/commands/selfhost/upgrade.ts
|
|
33881
33978
|
init_esm_shims();
|
|
33882
|
-
import {
|
|
33883
|
-
import { join as join21 } from "path";
|
|
33979
|
+
import { existsSync as existsSync19 } from "fs";
|
|
33980
|
+
import { dirname as dirname6, join as join21 } from "path";
|
|
33884
33981
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
33885
|
-
import * as
|
|
33982
|
+
import * as clack46 from "@clack/prompts";
|
|
33886
33983
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
33887
|
-
import
|
|
33984
|
+
import pc49 from "picocolors";
|
|
33888
33985
|
init_events();
|
|
33889
33986
|
init_aws();
|
|
33890
33987
|
init_errors();
|
|
@@ -33895,11 +33992,12 @@ init_output();
|
|
|
33895
33992
|
init_pulumi();
|
|
33896
33993
|
init_region_resolver();
|
|
33897
33994
|
var __filename3 = fileURLToPath6(import.meta.url);
|
|
33898
|
-
var
|
|
33995
|
+
var cliDir2 = dirname6(__filename3);
|
|
33996
|
+
var bundledLambdaZip2 = join21(cliDir2, "api-lambda.zip");
|
|
33899
33997
|
async function selfhostUpgrade(options) {
|
|
33900
33998
|
const startTime = Date.now();
|
|
33901
33999
|
if (!isJsonMode()) {
|
|
33902
|
-
|
|
34000
|
+
clack46.intro(pc49.bold("Wraps Self-Hosted Control Plane Upgrade"));
|
|
33903
34001
|
}
|
|
33904
34002
|
const progress = new DeploymentProgress();
|
|
33905
34003
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -33914,7 +34012,7 @@ async function selfhostUpgrade(options) {
|
|
|
33914
34012
|
async () => validateAWSCredentialsWithDetails()
|
|
33915
34013
|
);
|
|
33916
34014
|
const identity = credentialResult.identity;
|
|
33917
|
-
progress.info(`Connected to AWS account: ${
|
|
34015
|
+
progress.info(`Connected to AWS account: ${pc49.cyan(identity.accountId)}`);
|
|
33918
34016
|
const region = await resolveRegionForCommand({
|
|
33919
34017
|
accountId: identity.accountId,
|
|
33920
34018
|
optionRegion: options.region,
|
|
@@ -33923,39 +34021,31 @@ async function selfhostUpgrade(options) {
|
|
|
33923
34021
|
});
|
|
33924
34022
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33925
34023
|
if (!metadata?.services?.selfhost) {
|
|
33926
|
-
|
|
33927
|
-
|
|
34024
|
+
clack46.log.error("No self-hosted deployment found.");
|
|
34025
|
+
clack46.log.info(`Run ${pc49.cyan("wraps selfhost deploy")} first.`);
|
|
33928
34026
|
process.exit(1);
|
|
33929
34027
|
}
|
|
33930
34028
|
const selfhostService = metadata.services.selfhost;
|
|
33931
34029
|
progress.info(`Found deployment from: ${selfhostService.deployedAt}`);
|
|
33932
|
-
progress.info(`API URL: ${
|
|
34030
|
+
progress.info(`API URL: ${pc49.cyan(selfhostService.apiUrl)}`);
|
|
33933
34031
|
if (!(options.yes || options.preview)) {
|
|
33934
|
-
const confirmed = await
|
|
33935
|
-
message: `Upgrade self-hosted deployment in ${
|
|
34032
|
+
const confirmed = await clack46.confirm({
|
|
34033
|
+
message: `Upgrade self-hosted deployment in ${pc49.cyan(identity.accountId)} / ${pc49.cyan(region)}?`,
|
|
33936
34034
|
initialValue: true
|
|
33937
34035
|
});
|
|
33938
|
-
if (
|
|
33939
|
-
|
|
34036
|
+
if (clack46.isCancel(confirmed) || !confirmed) {
|
|
34037
|
+
clack46.cancel("Upgrade cancelled.");
|
|
33940
34038
|
process.exit(0);
|
|
33941
34039
|
}
|
|
33942
34040
|
}
|
|
33943
34041
|
const config2 = selfhostService.config;
|
|
33944
34042
|
const stackName = selfhostService.pulumiStackName || `wraps-selfhost-${identity.accountId}-${region}`;
|
|
33945
|
-
|
|
33946
|
-
|
|
33947
|
-
|
|
33948
|
-
|
|
33949
|
-
|
|
33950
|
-
|
|
33951
|
-
});
|
|
33952
|
-
const lambdaZipPath = join21(repoRoot2, "apps/api/lambda.zip");
|
|
33953
|
-
await progress.execute("Packaging Lambda", async () => {
|
|
33954
|
-
execSync3("/bin/sh -c 'zip -r ../lambda.zip .'", {
|
|
33955
|
-
cwd: join21(repoRoot2, "apps/api/dist"),
|
|
33956
|
-
stdio: childStdio
|
|
33957
|
-
});
|
|
33958
|
-
});
|
|
34043
|
+
if (!existsSync19(bundledLambdaZip2)) {
|
|
34044
|
+
throw new Error(
|
|
34045
|
+
`Bundled API lambda not found at ${bundledLambdaZip2}. Run 'pnpm build' in the CLI package to generate it.`
|
|
34046
|
+
);
|
|
34047
|
+
}
|
|
34048
|
+
const lambdaZipPath = bundledLambdaZip2;
|
|
33959
34049
|
const createStack = async () => {
|
|
33960
34050
|
await ensurePulumiWorkDir({ accountId: identity.accountId, region });
|
|
33961
34051
|
const stack = await pulumi27.automation.LocalWorkspace.createOrSelectStack(
|
|
@@ -34018,8 +34108,8 @@ async function selfhostUpgrade(options) {
|
|
|
34018
34108
|
resourceChanges: previewResult.resourceChanges,
|
|
34019
34109
|
commandName: "wraps selfhost upgrade"
|
|
34020
34110
|
});
|
|
34021
|
-
|
|
34022
|
-
|
|
34111
|
+
clack46.outro(
|
|
34112
|
+
pc49.green("Preview complete. Run without --preview to upgrade.")
|
|
34023
34113
|
);
|
|
34024
34114
|
return;
|
|
34025
34115
|
} catch (error) {
|
|
@@ -34090,28 +34180,28 @@ async function selfhostUpgrade(options) {
|
|
|
34090
34180
|
}
|
|
34091
34181
|
progress.info("Deployment metadata updated");
|
|
34092
34182
|
console.log("\n");
|
|
34093
|
-
|
|
34183
|
+
clack46.log.success(pc49.green(pc49.bold("Self-hosted Wraps API upgraded!")));
|
|
34094
34184
|
console.log("\n");
|
|
34095
|
-
|
|
34185
|
+
clack46.note(
|
|
34096
34186
|
[
|
|
34097
|
-
`${
|
|
34098
|
-
`${
|
|
34099
|
-
`${
|
|
34187
|
+
`${pc49.bold("API URL:")} ${pc49.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
|
|
34188
|
+
`${pc49.bold("Region:")} ${pc49.cyan(region)}`,
|
|
34189
|
+
`${pc49.bold("Lambda ARN:")} ${pc49.dim(outputs.lambdaArn)}`
|
|
34100
34190
|
].join("\n"),
|
|
34101
34191
|
"Self-Hosted Deployment"
|
|
34102
34192
|
);
|
|
34103
|
-
|
|
34104
|
-
|
|
34193
|
+
clack46.outro(
|
|
34194
|
+
pc49.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
|
|
34105
34195
|
);
|
|
34106
34196
|
}
|
|
34107
34197
|
|
|
34108
34198
|
// src/commands/shared/dashboard.ts
|
|
34109
34199
|
init_esm_shims();
|
|
34110
|
-
import * as
|
|
34200
|
+
import * as clack47 from "@clack/prompts";
|
|
34111
34201
|
import * as pulumi28 from "@pulumi/pulumi";
|
|
34112
34202
|
import getPort from "get-port";
|
|
34113
34203
|
import open2 from "open";
|
|
34114
|
-
import
|
|
34204
|
+
import pc50 from "picocolors";
|
|
34115
34205
|
|
|
34116
34206
|
// src/console/server.ts
|
|
34117
34207
|
init_esm_shims();
|
|
@@ -35311,13 +35401,13 @@ function createMetricsRouter(config2) {
|
|
|
35311
35401
|
const router = createRouter5();
|
|
35312
35402
|
router.get("/stream", async (req, res) => {
|
|
35313
35403
|
const connectionId = randomUUID().slice(0, 8);
|
|
35314
|
-
const
|
|
35404
|
+
const log57 = (msg, data) => {
|
|
35315
35405
|
console.log(JSON.stringify({ connectionId, msg, ...data }));
|
|
35316
35406
|
};
|
|
35317
35407
|
res.setHeader("Content-Type", "text/event-stream");
|
|
35318
35408
|
res.setHeader("Cache-Control", "no-cache");
|
|
35319
35409
|
res.setHeader("Connection", "keep-alive");
|
|
35320
|
-
|
|
35410
|
+
log57("SSE connected");
|
|
35321
35411
|
res.write('data: {"type":"connected"}\n\n');
|
|
35322
35412
|
const { startTime, endTime } = req.query;
|
|
35323
35413
|
const getTimeRange = () => ({
|
|
@@ -35327,7 +35417,7 @@ function createMetricsRouter(config2) {
|
|
|
35327
35417
|
const sendMetrics = async () => {
|
|
35328
35418
|
try {
|
|
35329
35419
|
const timeRange = getTimeRange();
|
|
35330
|
-
|
|
35420
|
+
log57("Fetching metrics", {
|
|
35331
35421
|
start: timeRange.start.toISOString(),
|
|
35332
35422
|
end: timeRange.end.toISOString()
|
|
35333
35423
|
});
|
|
@@ -35340,7 +35430,7 @@ function createMetricsRouter(config2) {
|
|
|
35340
35430
|
),
|
|
35341
35431
|
fetchSendQuota(config2.roleArn, config2.region)
|
|
35342
35432
|
]);
|
|
35343
|
-
|
|
35433
|
+
log57("Metrics fetched successfully");
|
|
35344
35434
|
const data = {
|
|
35345
35435
|
type: "metrics",
|
|
35346
35436
|
timestamp: Date.now(),
|
|
@@ -35370,7 +35460,7 @@ function createMetricsRouter(config2) {
|
|
|
35370
35460
|
const interval = setInterval(sendMetrics, 6e4);
|
|
35371
35461
|
req.on("close", () => {
|
|
35372
35462
|
clearInterval(interval);
|
|
35373
|
-
|
|
35463
|
+
log57("SSE disconnected");
|
|
35374
35464
|
});
|
|
35375
35465
|
});
|
|
35376
35466
|
router.get("/snapshot", async (_req, res) => {
|
|
@@ -36765,7 +36855,7 @@ init_output();
|
|
|
36765
36855
|
init_pulumi();
|
|
36766
36856
|
async function dashboard(options) {
|
|
36767
36857
|
await ensurePulumiInstalled();
|
|
36768
|
-
|
|
36858
|
+
clack47.intro(pc50.bold("Wraps Dashboard"));
|
|
36769
36859
|
const progress = new DeploymentProgress();
|
|
36770
36860
|
const identity = await progress.execute(
|
|
36771
36861
|
"Validating AWS credentials",
|
|
@@ -36806,9 +36896,9 @@ async function dashboard(options) {
|
|
|
36806
36896
|
}
|
|
36807
36897
|
} catch (_error) {
|
|
36808
36898
|
progress.stop();
|
|
36809
|
-
|
|
36899
|
+
clack47.log.error("No Wraps infrastructure found");
|
|
36810
36900
|
console.log(
|
|
36811
|
-
`\\nRun ${
|
|
36901
|
+
`\\nRun ${pc50.cyan("wraps email init")}, ${pc50.cyan("wraps sms init")}, or ${pc50.cyan("wraps storage init")} to deploy infrastructure first.\\n`
|
|
36812
36902
|
);
|
|
36813
36903
|
process.exit(1);
|
|
36814
36904
|
}
|
|
@@ -36850,9 +36940,9 @@ async function dashboard(options) {
|
|
|
36850
36940
|
}
|
|
36851
36941
|
const port = options.port || await getPort({ port: [5555, 5556, 5557, 5558, 5559] });
|
|
36852
36942
|
progress.stop();
|
|
36853
|
-
|
|
36943
|
+
clack47.log.success("Starting dashboard server...");
|
|
36854
36944
|
console.log(
|
|
36855
|
-
`${
|
|
36945
|
+
`${pc50.dim("Using current AWS credentials (no role assumption)")}\\n`
|
|
36856
36946
|
);
|
|
36857
36947
|
const { url } = await startConsoleServer({
|
|
36858
36948
|
port,
|
|
@@ -36885,8 +36975,8 @@ async function dashboard(options) {
|
|
|
36885
36975
|
cdnCustomDomain,
|
|
36886
36976
|
cdnCertificateArn
|
|
36887
36977
|
});
|
|
36888
|
-
console.log(`\\n${
|
|
36889
|
-
console.log(`${
|
|
36978
|
+
console.log(`\\n${pc50.bold("Dashboard:")} ${pc50.cyan(url)}`);
|
|
36979
|
+
console.log(`${pc50.dim("Press Ctrl+C to stop")}\\n`);
|
|
36890
36980
|
getTelemetryClient().showFooterOnce();
|
|
36891
36981
|
if (!options.noOpen) {
|
|
36892
36982
|
await open2(url);
|
|
@@ -36907,8 +36997,8 @@ init_aws();
|
|
|
36907
36997
|
init_errors();
|
|
36908
36998
|
init_json_output();
|
|
36909
36999
|
init_metadata();
|
|
36910
|
-
import * as
|
|
36911
|
-
import
|
|
37000
|
+
import * as clack48 from "@clack/prompts";
|
|
37001
|
+
import pc51 from "picocolors";
|
|
36912
37002
|
async function destroy(options) {
|
|
36913
37003
|
trackCommand("destroy", { success: true });
|
|
36914
37004
|
if (isJsonMode() && !options.force) {
|
|
@@ -36919,9 +37009,9 @@ async function destroy(options) {
|
|
|
36919
37009
|
);
|
|
36920
37010
|
}
|
|
36921
37011
|
if (!isJsonMode()) {
|
|
36922
|
-
|
|
37012
|
+
clack48.intro(pc51.bold("Wraps Infrastructure Teardown"));
|
|
36923
37013
|
}
|
|
36924
|
-
const spinner10 =
|
|
37014
|
+
const spinner10 = clack48.spinner();
|
|
36925
37015
|
spinner10.start("Validating AWS credentials");
|
|
36926
37016
|
let identity;
|
|
36927
37017
|
try {
|
|
@@ -36938,17 +37028,17 @@ async function destroy(options) {
|
|
|
36938
37028
|
deployedServices.push("email");
|
|
36939
37029
|
}
|
|
36940
37030
|
if (deployedServices.length === 0) {
|
|
36941
|
-
|
|
37031
|
+
clack48.log.warn("No Wraps services found in this region");
|
|
36942
37032
|
console.log(
|
|
36943
37033
|
`
|
|
36944
|
-
Run ${
|
|
37034
|
+
Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
|
|
36945
37035
|
`
|
|
36946
37036
|
);
|
|
36947
37037
|
process.exit(0);
|
|
36948
37038
|
}
|
|
36949
37039
|
if (deployedServices.length === 1) {
|
|
36950
37040
|
const service = deployedServices[0];
|
|
36951
|
-
|
|
37041
|
+
clack48.log.info(`Found ${pc51.cyan(service)} service deployed`);
|
|
36952
37042
|
if (service === "email") {
|
|
36953
37043
|
await emailDestroy(options);
|
|
36954
37044
|
return;
|
|
@@ -36963,7 +37053,7 @@ Run ${pc50.cyan("wraps email init")} to deploy infrastructure.
|
|
|
36963
37053
|
jsonSuccess("destroy", { destroyed: true });
|
|
36964
37054
|
return;
|
|
36965
37055
|
}
|
|
36966
|
-
const serviceToDestroy = await
|
|
37056
|
+
const serviceToDestroy = await clack48.select({
|
|
36967
37057
|
message: "Which service would you like to destroy?",
|
|
36968
37058
|
options: [
|
|
36969
37059
|
...deployedServices.map((s) => ({
|
|
@@ -36978,15 +37068,15 @@ Run ${pc50.cyan("wraps email init")} to deploy infrastructure.
|
|
|
36978
37068
|
}
|
|
36979
37069
|
]
|
|
36980
37070
|
});
|
|
36981
|
-
if (
|
|
36982
|
-
|
|
37071
|
+
if (clack48.isCancel(serviceToDestroy)) {
|
|
37072
|
+
clack48.cancel("Operation cancelled.");
|
|
36983
37073
|
process.exit(0);
|
|
36984
37074
|
}
|
|
36985
37075
|
if ((serviceToDestroy === "email" || serviceToDestroy === "all") && deployedServices.includes("email")) {
|
|
36986
37076
|
await emailDestroy(options);
|
|
36987
37077
|
}
|
|
36988
37078
|
if (serviceToDestroy === "all") {
|
|
36989
|
-
|
|
37079
|
+
clack48.outro(pc51.green("All Wraps infrastructure has been removed"));
|
|
36990
37080
|
}
|
|
36991
37081
|
}
|
|
36992
37082
|
|
|
@@ -36998,26 +37088,26 @@ init_fs();
|
|
|
36998
37088
|
init_json_output();
|
|
36999
37089
|
init_output();
|
|
37000
37090
|
init_pulumi();
|
|
37001
|
-
import * as
|
|
37091
|
+
import * as clack49 from "@clack/prompts";
|
|
37002
37092
|
import * as pulumi29 from "@pulumi/pulumi";
|
|
37003
|
-
import
|
|
37093
|
+
import pc52 from "picocolors";
|
|
37004
37094
|
async function status(options) {
|
|
37005
37095
|
await ensurePulumiInstalled();
|
|
37006
37096
|
const startTime = Date.now();
|
|
37007
37097
|
const progress = new DeploymentProgress();
|
|
37008
37098
|
if (!isJsonMode()) {
|
|
37009
|
-
|
|
37099
|
+
clack49.intro(pc52.bold("Wraps Infrastructure Status"));
|
|
37010
37100
|
}
|
|
37011
37101
|
const identity = await progress.execute(
|
|
37012
37102
|
"Loading infrastructure status",
|
|
37013
37103
|
async () => validateAWSCredentials()
|
|
37014
37104
|
);
|
|
37015
37105
|
if (!isJsonMode()) {
|
|
37016
|
-
progress.info(`AWS Account: ${
|
|
37106
|
+
progress.info(`AWS Account: ${pc52.cyan(identity.accountId)}`);
|
|
37017
37107
|
}
|
|
37018
37108
|
const region = options.region || await getAWSRegion();
|
|
37019
37109
|
if (!isJsonMode()) {
|
|
37020
|
-
progress.info(`Region: ${
|
|
37110
|
+
progress.info(`Region: ${pc52.cyan(region)}`);
|
|
37021
37111
|
}
|
|
37022
37112
|
const services = [];
|
|
37023
37113
|
try {
|
|
@@ -37069,35 +37159,35 @@ async function status(options) {
|
|
|
37069
37159
|
return;
|
|
37070
37160
|
}
|
|
37071
37161
|
console.log();
|
|
37072
|
-
|
|
37162
|
+
clack49.note(
|
|
37073
37163
|
services.map((s) => {
|
|
37074
37164
|
if (s.status === "deployed") {
|
|
37075
|
-
const details = s.details ?
|
|
37076
|
-
return ` ${
|
|
37165
|
+
const details = s.details ? pc52.dim(` (${s.details})`) : "";
|
|
37166
|
+
return ` ${pc52.green("\u2713")} ${s.name}${details}`;
|
|
37077
37167
|
}
|
|
37078
|
-
return ` ${
|
|
37168
|
+
return ` ${pc52.dim("\u25CB")} ${s.name} ${pc52.dim("(not deployed)")}`;
|
|
37079
37169
|
}).join("\n"),
|
|
37080
37170
|
"Services"
|
|
37081
37171
|
);
|
|
37082
37172
|
const hasDeployedServices = services.some((s) => s.status === "deployed");
|
|
37083
37173
|
if (hasDeployedServices) {
|
|
37084
37174
|
console.log(`
|
|
37085
|
-
${
|
|
37175
|
+
${pc52.bold("Details:")}`);
|
|
37086
37176
|
if (services.find((s) => s.name === "Email")?.status === "deployed") {
|
|
37087
|
-
console.log(` ${
|
|
37177
|
+
console.log(` ${pc52.dim("Email:")} ${pc52.cyan("wraps email status")}`);
|
|
37088
37178
|
}
|
|
37089
37179
|
if (services.find((s) => s.name === "SMS")?.status === "deployed") {
|
|
37090
|
-
console.log(` ${
|
|
37180
|
+
console.log(` ${pc52.dim("SMS:")} ${pc52.cyan("wraps sms status")}`);
|
|
37091
37181
|
}
|
|
37092
37182
|
} else {
|
|
37093
37183
|
console.log(`
|
|
37094
|
-
${
|
|
37095
|
-
console.log(` ${
|
|
37096
|
-
console.log(` ${
|
|
37184
|
+
${pc52.bold("Get started:")}`);
|
|
37185
|
+
console.log(` ${pc52.dim("Deploy email:")} ${pc52.cyan("wraps email init")}`);
|
|
37186
|
+
console.log(` ${pc52.dim("Deploy SMS:")} ${pc52.cyan("wraps sms init")}`);
|
|
37097
37187
|
}
|
|
37098
37188
|
console.log(`
|
|
37099
|
-
${
|
|
37100
|
-
console.log(`${
|
|
37189
|
+
${pc52.bold("Dashboard:")} ${pc52.blue("https://app.wraps.dev")}`);
|
|
37190
|
+
console.log(`${pc52.bold("Docs:")} ${pc52.blue("https://wraps.dev/docs")}
|
|
37101
37191
|
`);
|
|
37102
37192
|
trackCommand("status", {
|
|
37103
37193
|
success: true,
|
|
@@ -37108,9 +37198,9 @@ ${pc51.bold("Dashboard:")} ${pc51.blue("https://app.wraps.dev")}`);
|
|
|
37108
37198
|
|
|
37109
37199
|
// src/commands/sms/destroy.ts
|
|
37110
37200
|
init_esm_shims();
|
|
37111
|
-
import * as
|
|
37201
|
+
import * as clack50 from "@clack/prompts";
|
|
37112
37202
|
import * as pulumi31 from "@pulumi/pulumi";
|
|
37113
|
-
import
|
|
37203
|
+
import pc53 from "picocolors";
|
|
37114
37204
|
|
|
37115
37205
|
// src/infrastructure/sms-stack.ts
|
|
37116
37206
|
init_esm_shims();
|
|
@@ -37801,18 +37891,18 @@ async function createSMSProtectConfigurationWithSDK(configurationSetName, region
|
|
|
37801
37891
|
const existing = await client.send(
|
|
37802
37892
|
new DescribeProtectConfigurationsCommand({})
|
|
37803
37893
|
);
|
|
37804
|
-
for (const
|
|
37805
|
-
if (!(
|
|
37894
|
+
for (const pc66 of existing.ProtectConfigurations || []) {
|
|
37895
|
+
if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
|
|
37806
37896
|
continue;
|
|
37807
37897
|
}
|
|
37808
37898
|
const tagsResponse = await client.send(
|
|
37809
37899
|
new ListTagsForResourceCommand({
|
|
37810
|
-
ResourceArn:
|
|
37900
|
+
ResourceArn: pc66.ProtectConfigurationArn
|
|
37811
37901
|
})
|
|
37812
37902
|
);
|
|
37813
37903
|
const nameTag = tagsResponse.Tags?.find((t) => t.Key === "Name");
|
|
37814
37904
|
if (nameTag?.Value === protectConfigName) {
|
|
37815
|
-
existingProtectConfigId =
|
|
37905
|
+
existingProtectConfigId = pc66.ProtectConfigurationId;
|
|
37816
37906
|
break;
|
|
37817
37907
|
}
|
|
37818
37908
|
}
|
|
@@ -37908,13 +37998,13 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
37908
37998
|
new DescribeProtectConfigurationsCommand({})
|
|
37909
37999
|
);
|
|
37910
38000
|
if (existing.ProtectConfigurations) {
|
|
37911
|
-
for (const
|
|
37912
|
-
if (!(
|
|
38001
|
+
for (const pc66 of existing.ProtectConfigurations) {
|
|
38002
|
+
if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
|
|
37913
38003
|
continue;
|
|
37914
38004
|
}
|
|
37915
38005
|
const tagsResponse = await client.send(
|
|
37916
38006
|
new ListTagsForResourceCommand({
|
|
37917
|
-
ResourceArn:
|
|
38007
|
+
ResourceArn: pc66.ProtectConfigurationArn
|
|
37918
38008
|
})
|
|
37919
38009
|
);
|
|
37920
38010
|
const isWrapsManaged = tagsResponse.Tags?.some(
|
|
@@ -37923,7 +38013,7 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
37923
38013
|
if (isWrapsManaged) {
|
|
37924
38014
|
await client.send(
|
|
37925
38015
|
new DeleteProtectConfigurationCommand({
|
|
37926
|
-
ProtectConfigurationId:
|
|
38016
|
+
ProtectConfigurationId: pc66.ProtectConfigurationId
|
|
37927
38017
|
})
|
|
37928
38018
|
);
|
|
37929
38019
|
}
|
|
@@ -37958,8 +38048,8 @@ async function smsDestroy(options) {
|
|
|
37958
38048
|
);
|
|
37959
38049
|
}
|
|
37960
38050
|
if (!isJsonMode()) {
|
|
37961
|
-
|
|
37962
|
-
|
|
38051
|
+
clack50.intro(
|
|
38052
|
+
pc53.bold(
|
|
37963
38053
|
options.preview ? "SMS Infrastructure Destruction Preview" : "SMS Infrastructure Teardown"
|
|
37964
38054
|
)
|
|
37965
38055
|
);
|
|
@@ -37985,15 +38075,15 @@ async function smsDestroy(options) {
|
|
|
37985
38075
|
`Available regions: ${smsConnections.map((c) => c.region).join(", ")}`
|
|
37986
38076
|
);
|
|
37987
38077
|
}
|
|
37988
|
-
const selectedRegion = await
|
|
38078
|
+
const selectedRegion = await clack50.select({
|
|
37989
38079
|
message: "Multiple SMS deployments found. Which region to destroy?",
|
|
37990
38080
|
options: smsConnections.map((conn) => ({
|
|
37991
38081
|
value: conn.region,
|
|
37992
38082
|
label: conn.region
|
|
37993
38083
|
}))
|
|
37994
38084
|
});
|
|
37995
|
-
if (
|
|
37996
|
-
|
|
38085
|
+
if (clack50.isCancel(selectedRegion)) {
|
|
38086
|
+
clack50.cancel("Operation cancelled");
|
|
37997
38087
|
process.exit(0);
|
|
37998
38088
|
}
|
|
37999
38089
|
region = selectedRegion;
|
|
@@ -38004,18 +38094,18 @@ async function smsDestroy(options) {
|
|
|
38004
38094
|
const storedStackName = smsService?.pulumiStackName;
|
|
38005
38095
|
if (!smsService) {
|
|
38006
38096
|
progress.stop();
|
|
38007
|
-
|
|
38097
|
+
clack50.log.warn("No SMS infrastructure found");
|
|
38008
38098
|
process.exit(0);
|
|
38009
38099
|
}
|
|
38010
38100
|
if (!(options.force || options.preview)) {
|
|
38011
|
-
const confirmed = await
|
|
38012
|
-
message:
|
|
38101
|
+
const confirmed = await clack50.confirm({
|
|
38102
|
+
message: pc53.red(
|
|
38013
38103
|
"Are you sure you want to destroy all SMS infrastructure?"
|
|
38014
38104
|
),
|
|
38015
38105
|
initialValue: false
|
|
38016
38106
|
});
|
|
38017
|
-
if (
|
|
38018
|
-
|
|
38107
|
+
if (clack50.isCancel(confirmed) || !confirmed) {
|
|
38108
|
+
clack50.cancel("Destruction cancelled.");
|
|
38019
38109
|
process.exit(0);
|
|
38020
38110
|
}
|
|
38021
38111
|
}
|
|
@@ -38047,8 +38137,8 @@ async function smsDestroy(options) {
|
|
|
38047
38137
|
costEstimate: "Monthly cost after destruction: $0.00",
|
|
38048
38138
|
commandName: "wraps sms destroy"
|
|
38049
38139
|
});
|
|
38050
|
-
|
|
38051
|
-
|
|
38140
|
+
clack50.outro(
|
|
38141
|
+
pc53.green("Preview complete. Run without --preview to destroy.")
|
|
38052
38142
|
);
|
|
38053
38143
|
trackServiceRemoved("sms", {
|
|
38054
38144
|
preview: true,
|
|
@@ -38059,7 +38149,7 @@ async function smsDestroy(options) {
|
|
|
38059
38149
|
progress.stop();
|
|
38060
38150
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38061
38151
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38062
|
-
|
|
38152
|
+
clack50.log.warn("No SMS infrastructure found to preview");
|
|
38063
38153
|
process.exit(0);
|
|
38064
38154
|
}
|
|
38065
38155
|
trackError("PREVIEW_FAILED", "sms destroy", { step: "preview" });
|
|
@@ -38108,7 +38198,7 @@ async function smsDestroy(options) {
|
|
|
38108
38198
|
progress.stop();
|
|
38109
38199
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38110
38200
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38111
|
-
|
|
38201
|
+
clack50.log.warn("No SMS infrastructure found");
|
|
38112
38202
|
if (metadata) {
|
|
38113
38203
|
removeServiceFromConnection(metadata, "sms");
|
|
38114
38204
|
await saveConnectionMetadata(metadata);
|
|
@@ -38121,7 +38211,7 @@ async function smsDestroy(options) {
|
|
|
38121
38211
|
}
|
|
38122
38212
|
trackError("DESTROY_FAILED", "sms destroy", { step: "destroy" });
|
|
38123
38213
|
destroyFailed = true;
|
|
38124
|
-
|
|
38214
|
+
clack50.log.warn(
|
|
38125
38215
|
"Some resources may not have been fully removed. You can re-run this command or clean up manually in the AWS console."
|
|
38126
38216
|
);
|
|
38127
38217
|
}
|
|
@@ -38144,21 +38234,21 @@ async function smsDestroy(options) {
|
|
|
38144
38234
|
return;
|
|
38145
38235
|
}
|
|
38146
38236
|
if (destroyFailed) {
|
|
38147
|
-
|
|
38148
|
-
|
|
38237
|
+
clack50.outro(
|
|
38238
|
+
pc53.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
|
|
38149
38239
|
);
|
|
38150
38240
|
} else {
|
|
38151
|
-
|
|
38241
|
+
clack50.outro(pc53.green("SMS infrastructure has been removed"));
|
|
38152
38242
|
console.log(`
|
|
38153
|
-
${
|
|
38154
|
-
console.log(` ${
|
|
38155
|
-
console.log(` ${
|
|
38156
|
-
console.log(` ${
|
|
38157
|
-
console.log(` ${
|
|
38243
|
+
${pc53.bold("Cleaned up:")}`);
|
|
38244
|
+
console.log(` ${pc53.green("\u2713")} Phone number released`);
|
|
38245
|
+
console.log(` ${pc53.green("\u2713")} Configuration set deleted`);
|
|
38246
|
+
console.log(` ${pc53.green("\u2713")} Event processing infrastructure removed`);
|
|
38247
|
+
console.log(` ${pc53.green("\u2713")} IAM role deleted`);
|
|
38158
38248
|
}
|
|
38159
38249
|
console.log(
|
|
38160
38250
|
`
|
|
38161
|
-
Run ${
|
|
38251
|
+
Run ${pc53.cyan("wraps sms init")} to deploy infrastructure again.
|
|
38162
38252
|
`
|
|
38163
38253
|
);
|
|
38164
38254
|
trackServiceRemoved("sms", {
|
|
@@ -38170,9 +38260,9 @@ Run ${pc52.cyan("wraps sms init")} to deploy infrastructure again.
|
|
|
38170
38260
|
|
|
38171
38261
|
// src/commands/sms/init.ts
|
|
38172
38262
|
init_esm_shims();
|
|
38173
|
-
import * as
|
|
38263
|
+
import * as clack51 from "@clack/prompts";
|
|
38174
38264
|
import * as pulumi32 from "@pulumi/pulumi";
|
|
38175
|
-
import
|
|
38265
|
+
import pc54 from "picocolors";
|
|
38176
38266
|
init_events();
|
|
38177
38267
|
init_aws();
|
|
38178
38268
|
init_fs();
|
|
@@ -38591,7 +38681,7 @@ function validateSMSConfig(config2) {
|
|
|
38591
38681
|
|
|
38592
38682
|
// src/commands/sms/init.ts
|
|
38593
38683
|
async function promptPhoneNumberType() {
|
|
38594
|
-
const result = await
|
|
38684
|
+
const result = await clack51.select({
|
|
38595
38685
|
message: "Select phone number type:",
|
|
38596
38686
|
options: [
|
|
38597
38687
|
{
|
|
@@ -38611,14 +38701,14 @@ async function promptPhoneNumberType() {
|
|
|
38611
38701
|
}
|
|
38612
38702
|
]
|
|
38613
38703
|
});
|
|
38614
|
-
if (
|
|
38615
|
-
|
|
38704
|
+
if (clack51.isCancel(result)) {
|
|
38705
|
+
clack51.cancel("Operation cancelled.");
|
|
38616
38706
|
process.exit(0);
|
|
38617
38707
|
}
|
|
38618
38708
|
return result;
|
|
38619
38709
|
}
|
|
38620
38710
|
async function promptSMSPreset() {
|
|
38621
|
-
const result = await
|
|
38711
|
+
const result = await clack51.select({
|
|
38622
38712
|
message: "Choose configuration preset:",
|
|
38623
38713
|
options: [
|
|
38624
38714
|
{
|
|
@@ -38643,8 +38733,8 @@ async function promptSMSPreset() {
|
|
|
38643
38733
|
}
|
|
38644
38734
|
]
|
|
38645
38735
|
});
|
|
38646
|
-
if (
|
|
38647
|
-
|
|
38736
|
+
if (clack51.isCancel(result)) {
|
|
38737
|
+
clack51.cancel("Operation cancelled.");
|
|
38648
38738
|
process.exit(0);
|
|
38649
38739
|
}
|
|
38650
38740
|
return result;
|
|
@@ -38664,7 +38754,7 @@ var COMMON_COUNTRIES = [
|
|
|
38664
38754
|
{ code: "IN", name: "India" }
|
|
38665
38755
|
];
|
|
38666
38756
|
async function promptAllowedCountries() {
|
|
38667
|
-
const result = await
|
|
38757
|
+
const result = await clack51.multiselect({
|
|
38668
38758
|
message: "Select countries to allow SMS delivery (blocks all others):",
|
|
38669
38759
|
options: COMMON_COUNTRIES.map((c) => ({
|
|
38670
38760
|
value: c.code,
|
|
@@ -38673,14 +38763,14 @@ async function promptAllowedCountries() {
|
|
|
38673
38763
|
initialValues: ["US"],
|
|
38674
38764
|
required: true
|
|
38675
38765
|
});
|
|
38676
|
-
if (
|
|
38677
|
-
|
|
38766
|
+
if (clack51.isCancel(result)) {
|
|
38767
|
+
clack51.cancel("Operation cancelled.");
|
|
38678
38768
|
process.exit(0);
|
|
38679
38769
|
}
|
|
38680
38770
|
return result;
|
|
38681
38771
|
}
|
|
38682
38772
|
async function promptEstimatedSMSVolume() {
|
|
38683
|
-
const result = await
|
|
38773
|
+
const result = await clack51.select({
|
|
38684
38774
|
message: "Estimated messages per month:",
|
|
38685
38775
|
options: [
|
|
38686
38776
|
{ value: 100, label: "< 100 (Testing)" },
|
|
@@ -38690,8 +38780,8 @@ async function promptEstimatedSMSVolume() {
|
|
|
38690
38780
|
{ value: 1e5, label: "50,000+" }
|
|
38691
38781
|
]
|
|
38692
38782
|
});
|
|
38693
|
-
if (
|
|
38694
|
-
|
|
38783
|
+
if (clack51.isCancel(result)) {
|
|
38784
|
+
clack51.cancel("Operation cancelled.");
|
|
38695
38785
|
process.exit(0);
|
|
38696
38786
|
}
|
|
38697
38787
|
return result;
|
|
@@ -38699,7 +38789,7 @@ async function promptEstimatedSMSVolume() {
|
|
|
38699
38789
|
async function init3(options) {
|
|
38700
38790
|
const startTime = Date.now();
|
|
38701
38791
|
if (!isJsonMode()) {
|
|
38702
|
-
|
|
38792
|
+
clack51.intro(pc54.bold("Wraps SMS Infrastructure Setup"));
|
|
38703
38793
|
}
|
|
38704
38794
|
const progress = new DeploymentProgress();
|
|
38705
38795
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -38713,7 +38803,7 @@ async function init3(options) {
|
|
|
38713
38803
|
"Validating AWS credentials",
|
|
38714
38804
|
async () => validateAWSCredentials()
|
|
38715
38805
|
);
|
|
38716
|
-
progress.info(`Connected to AWS account: ${
|
|
38806
|
+
progress.info(`Connected to AWS account: ${pc54.cyan(identity.accountId)}`);
|
|
38717
38807
|
const provider = options.provider || await promptProvider();
|
|
38718
38808
|
const region = options.region || await promptRegion(await getAWSRegion());
|
|
38719
38809
|
let vercelConfig;
|
|
@@ -38725,10 +38815,10 @@ async function init3(options) {
|
|
|
38725
38815
|
region
|
|
38726
38816
|
);
|
|
38727
38817
|
if (existingConnection?.services?.sms) {
|
|
38728
|
-
|
|
38729
|
-
`SMS already configured for account ${
|
|
38818
|
+
clack51.log.warn(
|
|
38819
|
+
`SMS already configured for account ${pc54.cyan(identity.accountId)} in region ${pc54.cyan(region)}`
|
|
38730
38820
|
);
|
|
38731
|
-
|
|
38821
|
+
clack51.log.info(`Use ${pc54.cyan("wraps sms status")} to view current setup`);
|
|
38732
38822
|
process.exit(0);
|
|
38733
38823
|
}
|
|
38734
38824
|
let preset = options.preset;
|
|
@@ -38745,12 +38835,12 @@ async function init3(options) {
|
|
|
38745
38835
|
optOutManagement: true,
|
|
38746
38836
|
sendingEnabled: true
|
|
38747
38837
|
};
|
|
38748
|
-
const enableEventTracking = await
|
|
38838
|
+
const enableEventTracking = await clack51.confirm({
|
|
38749
38839
|
message: "Enable event tracking (EventBridge + DynamoDB)?",
|
|
38750
38840
|
initialValue: false
|
|
38751
38841
|
});
|
|
38752
|
-
if (
|
|
38753
|
-
|
|
38842
|
+
if (clack51.isCancel(enableEventTracking)) {
|
|
38843
|
+
clack51.cancel("Operation cancelled.");
|
|
38754
38844
|
process.exit(0);
|
|
38755
38845
|
}
|
|
38756
38846
|
if (enableEventTracking) {
|
|
@@ -38770,17 +38860,17 @@ async function init3(options) {
|
|
|
38770
38860
|
}
|
|
38771
38861
|
progress.info(
|
|
38772
38862
|
`
|
|
38773
|
-
${
|
|
38863
|
+
${pc54.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
|
|
38774
38864
|
);
|
|
38775
38865
|
const allowedCountries = await promptAllowedCountries();
|
|
38776
38866
|
let aitFiltering = false;
|
|
38777
38867
|
if (smsConfig.phoneNumberType !== "simulator") {
|
|
38778
|
-
const enableAIT = await
|
|
38868
|
+
const enableAIT = await clack51.confirm({
|
|
38779
38869
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
38780
38870
|
initialValue: false
|
|
38781
38871
|
});
|
|
38782
|
-
if (
|
|
38783
|
-
|
|
38872
|
+
if (clack51.isCancel(enableAIT)) {
|
|
38873
|
+
clack51.cancel("Operation cancelled.");
|
|
38784
38874
|
process.exit(0);
|
|
38785
38875
|
}
|
|
38786
38876
|
aitFiltering = enableAIT;
|
|
@@ -38792,21 +38882,21 @@ ${pc53.bold("Fraud Protection")} - Block SMS to countries where you don't do bus
|
|
|
38792
38882
|
};
|
|
38793
38883
|
const estimatedVolume = await promptEstimatedSMSVolume();
|
|
38794
38884
|
progress.info(`
|
|
38795
|
-
${
|
|
38885
|
+
${pc54.bold("Cost Estimate:")}`);
|
|
38796
38886
|
const costSummary = getSMSCostSummary(smsConfig, estimatedVolume);
|
|
38797
|
-
|
|
38887
|
+
clack51.log.info(costSummary);
|
|
38798
38888
|
const warnings = validateSMSConfig(smsConfig);
|
|
38799
38889
|
if (warnings.length > 0) {
|
|
38800
38890
|
progress.info(`
|
|
38801
|
-
${
|
|
38891
|
+
${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
38802
38892
|
for (const warning of warnings) {
|
|
38803
|
-
|
|
38893
|
+
clack51.log.warn(warning);
|
|
38804
38894
|
}
|
|
38805
38895
|
}
|
|
38806
38896
|
if (!(options.yes || options.preview)) {
|
|
38807
38897
|
const confirmed = await confirmDeploy();
|
|
38808
38898
|
if (!confirmed) {
|
|
38809
|
-
|
|
38899
|
+
clack51.cancel("Deployment cancelled.");
|
|
38810
38900
|
process.exit(0);
|
|
38811
38901
|
}
|
|
38812
38902
|
}
|
|
@@ -38866,8 +38956,8 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38866
38956
|
costEstimate: getSMSCostSummary(smsConfig, 0),
|
|
38867
38957
|
commandName: "wraps sms init"
|
|
38868
38958
|
});
|
|
38869
|
-
|
|
38870
|
-
|
|
38959
|
+
clack51.outro(
|
|
38960
|
+
pc54.green("Preview complete. Run without --preview to deploy.")
|
|
38871
38961
|
);
|
|
38872
38962
|
trackServiceInit("sms", true, {
|
|
38873
38963
|
provider,
|
|
@@ -38916,9 +39006,9 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38916
39006
|
} catch (sdkError) {
|
|
38917
39007
|
sdkResourceWarning = true;
|
|
38918
39008
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38919
|
-
|
|
38920
|
-
|
|
38921
|
-
`Run ${
|
|
39009
|
+
clack51.log.warn(`Phone pool creation failed: ${msg}`);
|
|
39010
|
+
clack51.log.info(
|
|
39011
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38922
39012
|
);
|
|
38923
39013
|
}
|
|
38924
39014
|
}
|
|
@@ -38934,9 +39024,9 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38934
39024
|
} catch (sdkError) {
|
|
38935
39025
|
sdkResourceWarning = true;
|
|
38936
39026
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38937
|
-
|
|
38938
|
-
|
|
38939
|
-
`Run ${
|
|
39027
|
+
clack51.log.warn(`Event destination creation failed: ${msg}`);
|
|
39028
|
+
clack51.log.info(
|
|
39029
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38940
39030
|
);
|
|
38941
39031
|
}
|
|
38942
39032
|
}
|
|
@@ -38955,14 +39045,14 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38955
39045
|
} catch (sdkError) {
|
|
38956
39046
|
sdkResourceWarning = true;
|
|
38957
39047
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38958
|
-
|
|
38959
|
-
|
|
38960
|
-
`Run ${
|
|
39048
|
+
clack51.log.warn(`Protect configuration creation failed: ${msg}`);
|
|
39049
|
+
clack51.log.info(
|
|
39050
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38961
39051
|
);
|
|
38962
39052
|
}
|
|
38963
39053
|
}
|
|
38964
39054
|
if (sdkResourceWarning) {
|
|
38965
|
-
|
|
39055
|
+
clack51.log.warn(
|
|
38966
39056
|
"Some SDK resources failed to create. Core infrastructure is deployed."
|
|
38967
39057
|
);
|
|
38968
39058
|
}
|
|
@@ -39007,47 +39097,47 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
39007
39097
|
return;
|
|
39008
39098
|
}
|
|
39009
39099
|
console.log("\n");
|
|
39010
|
-
|
|
39100
|
+
clack51.log.success(pc54.green(pc54.bold("SMS infrastructure deployed!")));
|
|
39011
39101
|
console.log("\n");
|
|
39012
|
-
|
|
39102
|
+
clack51.note(
|
|
39013
39103
|
[
|
|
39014
|
-
`${
|
|
39015
|
-
`${
|
|
39016
|
-
`${
|
|
39017
|
-
`${
|
|
39018
|
-
outputs.tableName ? `${
|
|
39104
|
+
`${pc54.bold("Phone Number:")} ${pc54.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
39105
|
+
`${pc54.bold("Phone Type:")} ${pc54.cyan(smsConfig.phoneNumberType || "simulator")}`,
|
|
39106
|
+
`${pc54.bold("Config Set:")} ${pc54.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
39107
|
+
`${pc54.bold("Region:")} ${pc54.cyan(outputs.region)}`,
|
|
39108
|
+
outputs.tableName ? `${pc54.bold("History Table:")} ${pc54.cyan(outputs.tableName)}` : "",
|
|
39019
39109
|
"",
|
|
39020
|
-
|
|
39021
|
-
|
|
39110
|
+
pc54.dim("IAM Role:"),
|
|
39111
|
+
pc54.dim(` ${outputs.roleArn}`)
|
|
39022
39112
|
].filter(Boolean).join("\n"),
|
|
39023
39113
|
"SMS Infrastructure"
|
|
39024
39114
|
);
|
|
39025
39115
|
const nextSteps = [];
|
|
39026
39116
|
if (smsConfig.phoneNumberType === "toll-free") {
|
|
39027
39117
|
nextSteps.push(
|
|
39028
|
-
`${
|
|
39118
|
+
`${pc54.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
|
|
39029
39119
|
);
|
|
39030
39120
|
}
|
|
39031
39121
|
nextSteps.push(
|
|
39032
|
-
`${
|
|
39122
|
+
`${pc54.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39033
39123
|
);
|
|
39034
|
-
nextSteps.push(`${
|
|
39124
|
+
nextSteps.push(`${pc54.cyan("wraps sms status")} - View SMS configuration`);
|
|
39035
39125
|
console.log("\n");
|
|
39036
|
-
|
|
39126
|
+
clack51.log.info(pc54.bold("Next steps:"));
|
|
39037
39127
|
for (const step of nextSteps) {
|
|
39038
39128
|
console.log(` ${step}`);
|
|
39039
39129
|
}
|
|
39040
39130
|
console.log("\n");
|
|
39041
|
-
|
|
39042
|
-
console.log(
|
|
39131
|
+
clack51.log.info(pc54.bold("SDK Usage:"));
|
|
39132
|
+
console.log(pc54.dim(" npm install @wraps.dev/sms"));
|
|
39043
39133
|
console.log("");
|
|
39044
|
-
console.log(
|
|
39045
|
-
console.log(
|
|
39046
|
-
console.log(
|
|
39047
|
-
console.log(
|
|
39048
|
-
console.log(
|
|
39049
|
-
console.log(
|
|
39050
|
-
|
|
39134
|
+
console.log(pc54.dim(" import { Wraps } from '@wraps.dev/sms';"));
|
|
39135
|
+
console.log(pc54.dim(" const wraps = new Wraps();"));
|
|
39136
|
+
console.log(pc54.dim(" await wraps.sms.send({"));
|
|
39137
|
+
console.log(pc54.dim(" to: '+14155551234',"));
|
|
39138
|
+
console.log(pc54.dim(" message: 'Your code is 123456',"));
|
|
39139
|
+
console.log(pc54.dim(" });"));
|
|
39140
|
+
clack51.outro(pc54.green("Setup complete!"));
|
|
39051
39141
|
const duration = Date.now() - startTime;
|
|
39052
39142
|
const enabledFeatures = [];
|
|
39053
39143
|
if (smsConfig.tracking?.enabled) {
|
|
@@ -39083,8 +39173,8 @@ init_aws();
|
|
|
39083
39173
|
init_json_output();
|
|
39084
39174
|
init_metadata();
|
|
39085
39175
|
init_output();
|
|
39086
|
-
import * as
|
|
39087
|
-
import
|
|
39176
|
+
import * as clack52 from "@clack/prompts";
|
|
39177
|
+
import pc55 from "picocolors";
|
|
39088
39178
|
async function getPhoneNumberDetails(region) {
|
|
39089
39179
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39090
39180
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
@@ -39104,7 +39194,7 @@ async function getPhoneNumberDetails(region) {
|
|
|
39104
39194
|
return null;
|
|
39105
39195
|
} catch (error) {
|
|
39106
39196
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
39107
|
-
|
|
39197
|
+
clack52.log.error(`Error fetching phone number: ${errorMessage}`);
|
|
39108
39198
|
return null;
|
|
39109
39199
|
}
|
|
39110
39200
|
}
|
|
@@ -39125,7 +39215,7 @@ async function getRegistrationStatus(region, registrationId) {
|
|
|
39125
39215
|
async function smsRegister(options) {
|
|
39126
39216
|
const startTime = Date.now();
|
|
39127
39217
|
if (!isJsonMode()) {
|
|
39128
|
-
|
|
39218
|
+
clack52.intro(pc55.bold("Wraps SMS - Toll-Free Registration"));
|
|
39129
39219
|
}
|
|
39130
39220
|
const progress = new DeploymentProgress();
|
|
39131
39221
|
const identity = await progress.execute(
|
|
@@ -39138,8 +39228,8 @@ async function smsRegister(options) {
|
|
|
39138
39228
|
}
|
|
39139
39229
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39140
39230
|
if (!metadata?.services?.sms) {
|
|
39141
|
-
|
|
39142
|
-
|
|
39231
|
+
clack52.log.error("No SMS infrastructure found.");
|
|
39232
|
+
clack52.log.info(`Run ${pc55.cyan("wraps sms init")} first.`);
|
|
39143
39233
|
process.exit(1);
|
|
39144
39234
|
}
|
|
39145
39235
|
const phoneDetails = await progress.execute(
|
|
@@ -39147,7 +39237,7 @@ async function smsRegister(options) {
|
|
|
39147
39237
|
async () => getPhoneNumberDetails(region)
|
|
39148
39238
|
);
|
|
39149
39239
|
if (!phoneDetails) {
|
|
39150
|
-
|
|
39240
|
+
clack52.log.error("No phone number found.");
|
|
39151
39241
|
process.exit(1);
|
|
39152
39242
|
}
|
|
39153
39243
|
let registrationStatus = null;
|
|
@@ -39173,53 +39263,53 @@ async function smsRegister(options) {
|
|
|
39173
39263
|
}
|
|
39174
39264
|
console.log("");
|
|
39175
39265
|
console.log(
|
|
39176
|
-
`${
|
|
39266
|
+
`${pc55.bold("Phone Number:")} ${pc55.cyan(phoneDetails.phoneNumber)}`
|
|
39177
39267
|
);
|
|
39178
|
-
console.log(`${
|
|
39268
|
+
console.log(`${pc55.bold("Type:")} ${pc55.cyan(phoneDetails.type)}`);
|
|
39179
39269
|
console.log(
|
|
39180
|
-
`${
|
|
39270
|
+
`${pc55.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc55.green(phoneDetails.status) : pc55.yellow(phoneDetails.status)}`
|
|
39181
39271
|
);
|
|
39182
39272
|
if (registrationStatus) {
|
|
39183
|
-
console.log(`${
|
|
39273
|
+
console.log(`${pc55.bold("Registration:")} ${pc55.cyan(registrationStatus)}`);
|
|
39184
39274
|
}
|
|
39185
39275
|
console.log("");
|
|
39186
39276
|
if (phoneDetails.status === "ACTIVE") {
|
|
39187
|
-
|
|
39277
|
+
clack52.log.success("Your phone number is already ACTIVE and ready to use!");
|
|
39188
39278
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePoolsCommand } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39189
39279
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
39190
39280
|
const pools = await client.send(new DescribePoolsCommand({}));
|
|
39191
39281
|
if (!pools.Pools?.length) {
|
|
39192
|
-
|
|
39282
|
+
clack52.log.info("Run `wraps sms sync` to create the phone pool.");
|
|
39193
39283
|
}
|
|
39194
39284
|
process.exit(0);
|
|
39195
39285
|
}
|
|
39196
39286
|
if (phoneDetails.type !== "TOLL_FREE") {
|
|
39197
|
-
|
|
39198
|
-
|
|
39287
|
+
clack52.log.info("Only toll-free numbers require registration.");
|
|
39288
|
+
clack52.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
|
|
39199
39289
|
process.exit(0);
|
|
39200
39290
|
}
|
|
39201
|
-
console.log(
|
|
39291
|
+
console.log(pc55.bold("Toll-Free Registration Required"));
|
|
39202
39292
|
console.log("");
|
|
39203
39293
|
console.log(
|
|
39204
|
-
|
|
39294
|
+
pc55.dim("To send SMS at scale, you must register your toll-free number.")
|
|
39205
39295
|
);
|
|
39206
|
-
console.log(
|
|
39296
|
+
console.log(pc55.dim("This process typically takes 1-15 business days."));
|
|
39207
39297
|
console.log("");
|
|
39208
|
-
console.log(
|
|
39209
|
-
console.log(` ${
|
|
39298
|
+
console.log(pc55.bold("You'll need to provide:"));
|
|
39299
|
+
console.log(` ${pc55.dim("\u2022")} Business name and address`);
|
|
39210
39300
|
console.log(
|
|
39211
|
-
` ${
|
|
39301
|
+
` ${pc55.dim("\u2022")} Use case description (what messages you're sending)`
|
|
39212
39302
|
);
|
|
39213
|
-
console.log(` ${
|
|
39214
|
-
console.log(` ${
|
|
39215
|
-
console.log(` ${
|
|
39303
|
+
console.log(` ${pc55.dim("\u2022")} Sample messages (2-3 examples)`);
|
|
39304
|
+
console.log(` ${pc55.dim("\u2022")} How users opt-in to receive messages`);
|
|
39305
|
+
console.log(` ${pc55.dim("\u2022")} Expected monthly message volume`);
|
|
39216
39306
|
console.log("");
|
|
39217
|
-
const openConsole = await
|
|
39307
|
+
const openConsole = await clack52.confirm({
|
|
39218
39308
|
message: "Open AWS Console to start registration?",
|
|
39219
39309
|
initialValue: true
|
|
39220
39310
|
});
|
|
39221
|
-
if (
|
|
39222
|
-
|
|
39311
|
+
if (clack52.isCancel(openConsole)) {
|
|
39312
|
+
clack52.cancel("Registration cancelled.");
|
|
39223
39313
|
process.exit(0);
|
|
39224
39314
|
}
|
|
39225
39315
|
if (openConsole) {
|
|
@@ -39229,41 +39319,41 @@ async function smsRegister(options) {
|
|
|
39229
39319
|
const execAsync2 = promisify2(exec2);
|
|
39230
39320
|
try {
|
|
39231
39321
|
await execAsync2(`open "${consoleUrl}"`);
|
|
39232
|
-
|
|
39322
|
+
clack52.log.success("Opened AWS Console in your browser.");
|
|
39233
39323
|
} catch {
|
|
39234
39324
|
try {
|
|
39235
39325
|
await execAsync2(`xdg-open "${consoleUrl}"`);
|
|
39236
|
-
|
|
39326
|
+
clack52.log.success("Opened AWS Console in your browser.");
|
|
39237
39327
|
} catch {
|
|
39238
|
-
|
|
39328
|
+
clack52.log.info("Open this URL in your browser:");
|
|
39239
39329
|
console.log(`
|
|
39240
|
-
${
|
|
39330
|
+
${pc55.cyan(consoleUrl)}
|
|
39241
39331
|
`);
|
|
39242
39332
|
}
|
|
39243
39333
|
}
|
|
39244
39334
|
console.log("");
|
|
39245
|
-
console.log(
|
|
39335
|
+
console.log(pc55.bold("Next Steps:"));
|
|
39246
39336
|
console.log(
|
|
39247
|
-
` 1. Click ${
|
|
39337
|
+
` 1. Click ${pc55.cyan("Create registration")} in the AWS Console`
|
|
39248
39338
|
);
|
|
39249
|
-
console.log(` 2. Select ${
|
|
39339
|
+
console.log(` 2. Select ${pc55.cyan("Toll-free number registration")}`);
|
|
39250
39340
|
console.log(" 3. Fill out the business information form");
|
|
39251
39341
|
console.log(" 4. Submit and wait for approval (1-15 business days)");
|
|
39252
39342
|
console.log("");
|
|
39253
39343
|
console.log(
|
|
39254
|
-
|
|
39344
|
+
pc55.dim("Once approved, run `wraps sms sync` to complete setup.")
|
|
39255
39345
|
);
|
|
39256
39346
|
} else {
|
|
39257
39347
|
const consoleUrl = `https://${region}.console.aws.amazon.com/sms-voice/home?region=${region}#/registrations`;
|
|
39258
39348
|
console.log("");
|
|
39259
39349
|
console.log("When you're ready, go to:");
|
|
39260
|
-
console.log(` ${
|
|
39350
|
+
console.log(` ${pc55.cyan(consoleUrl)}`);
|
|
39261
39351
|
}
|
|
39262
39352
|
trackCommand("sms:register", {
|
|
39263
39353
|
success: true,
|
|
39264
39354
|
duration_ms: Date.now() - startTime
|
|
39265
39355
|
});
|
|
39266
|
-
|
|
39356
|
+
clack52.outro(pc55.dim("Good luck with your registration!"));
|
|
39267
39357
|
}
|
|
39268
39358
|
|
|
39269
39359
|
// src/commands/sms/status.ts
|
|
@@ -39276,54 +39366,54 @@ init_metadata();
|
|
|
39276
39366
|
init_output();
|
|
39277
39367
|
init_pulumi();
|
|
39278
39368
|
init_region_resolver();
|
|
39279
|
-
import * as
|
|
39369
|
+
import * as clack53 from "@clack/prompts";
|
|
39280
39370
|
import * as pulumi33 from "@pulumi/pulumi";
|
|
39281
|
-
import
|
|
39371
|
+
import pc56 from "picocolors";
|
|
39282
39372
|
function displaySMSStatus(options) {
|
|
39283
39373
|
const lines = [];
|
|
39284
|
-
lines.push(
|
|
39374
|
+
lines.push(pc56.bold(pc56.green("SMS Infrastructure Active")));
|
|
39285
39375
|
lines.push("");
|
|
39286
|
-
lines.push(
|
|
39376
|
+
lines.push(pc56.bold("Phone Number"));
|
|
39287
39377
|
if (options.phoneNumber) {
|
|
39288
|
-
lines.push(` Number: ${
|
|
39378
|
+
lines.push(` Number: ${pc56.cyan(options.phoneNumber)}`);
|
|
39289
39379
|
} else {
|
|
39290
|
-
lines.push(` Number: ${
|
|
39380
|
+
lines.push(` Number: ${pc56.yellow("Provisioning...")}`);
|
|
39291
39381
|
}
|
|
39292
|
-
lines.push(` Type: ${
|
|
39382
|
+
lines.push(` Type: ${pc56.cyan(options.phoneNumberType || "simulator")}`);
|
|
39293
39383
|
lines.push("");
|
|
39294
|
-
lines.push(
|
|
39295
|
-
lines.push(` Region: ${
|
|
39384
|
+
lines.push(pc56.bold("Configuration"));
|
|
39385
|
+
lines.push(` Region: ${pc56.cyan(options.region)}`);
|
|
39296
39386
|
if (options.preset) {
|
|
39297
|
-
lines.push(` Preset: ${
|
|
39387
|
+
lines.push(` Preset: ${pc56.cyan(options.preset)}`);
|
|
39298
39388
|
}
|
|
39299
39389
|
if (options.configSetName) {
|
|
39300
|
-
lines.push(` Config Set: ${
|
|
39390
|
+
lines.push(` Config Set: ${pc56.cyan(options.configSetName)}`);
|
|
39301
39391
|
}
|
|
39302
39392
|
lines.push("");
|
|
39303
|
-
lines.push(
|
|
39393
|
+
lines.push(pc56.bold("Features"));
|
|
39304
39394
|
lines.push(
|
|
39305
|
-
` Event Tracking: ${options.eventTracking ?
|
|
39395
|
+
` Event Tracking: ${options.eventTracking ? pc56.green("Enabled") : pc56.dim("Disabled")}`
|
|
39306
39396
|
);
|
|
39307
39397
|
if (options.tableName) {
|
|
39308
|
-
lines.push(` Message History: ${
|
|
39309
|
-
lines.push(` Table: ${
|
|
39398
|
+
lines.push(` Message History: ${pc56.green("Enabled")}`);
|
|
39399
|
+
lines.push(` Table: ${pc56.dim(options.tableName)}`);
|
|
39310
39400
|
}
|
|
39311
39401
|
if (options.queueUrl) {
|
|
39312
|
-
lines.push(` Event Queue: ${
|
|
39402
|
+
lines.push(` Event Queue: ${pc56.green("Enabled")}`);
|
|
39313
39403
|
}
|
|
39314
39404
|
lines.push("");
|
|
39315
39405
|
if (options.roleArn) {
|
|
39316
|
-
lines.push(
|
|
39317
|
-
lines.push(` ${
|
|
39406
|
+
lines.push(pc56.bold("IAM Role"));
|
|
39407
|
+
lines.push(` ${pc56.dim(options.roleArn)}`);
|
|
39318
39408
|
}
|
|
39319
|
-
|
|
39409
|
+
clack53.note(lines.join("\n"), "SMS Status");
|
|
39320
39410
|
}
|
|
39321
39411
|
async function smsStatus(options) {
|
|
39322
39412
|
await ensurePulumiInstalled();
|
|
39323
39413
|
const startTime = Date.now();
|
|
39324
39414
|
const progress = new DeploymentProgress();
|
|
39325
39415
|
if (!isJsonMode()) {
|
|
39326
|
-
|
|
39416
|
+
clack53.intro(pc56.bold("Wraps SMS Status"));
|
|
39327
39417
|
}
|
|
39328
39418
|
const identity = await progress.execute(
|
|
39329
39419
|
"Loading SMS infrastructure status",
|
|
@@ -39338,10 +39428,10 @@ async function smsStatus(options) {
|
|
|
39338
39428
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39339
39429
|
if (!metadata?.services?.sms) {
|
|
39340
39430
|
progress.stop();
|
|
39341
|
-
|
|
39431
|
+
clack53.log.error("No SMS infrastructure found");
|
|
39342
39432
|
console.log(
|
|
39343
39433
|
`
|
|
39344
|
-
Run ${
|
|
39434
|
+
Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39345
39435
|
`
|
|
39346
39436
|
);
|
|
39347
39437
|
process.exit(1);
|
|
@@ -39377,25 +39467,25 @@ Run ${pc55.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39377
39467
|
}
|
|
39378
39468
|
displaySMSStatus(smsStatusData);
|
|
39379
39469
|
console.log("");
|
|
39380
|
-
|
|
39470
|
+
clack53.log.info(pc56.bold("Commands:"));
|
|
39381
39471
|
console.log(
|
|
39382
|
-
` ${
|
|
39472
|
+
` ${pc56.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39383
39473
|
);
|
|
39384
|
-
console.log(` ${
|
|
39474
|
+
console.log(` ${pc56.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
|
|
39385
39475
|
trackCommand("sms:status", {
|
|
39386
39476
|
success: true,
|
|
39387
39477
|
phone_type: smsConfig?.phoneNumberType,
|
|
39388
39478
|
event_tracking: smsConfig?.eventTracking?.enabled,
|
|
39389
39479
|
duration_ms: Date.now() - startTime
|
|
39390
39480
|
});
|
|
39391
|
-
|
|
39481
|
+
clack53.outro(pc56.dim("SMS infrastructure is ready"));
|
|
39392
39482
|
}
|
|
39393
39483
|
|
|
39394
39484
|
// src/commands/sms/sync.ts
|
|
39395
39485
|
init_esm_shims();
|
|
39396
|
-
import * as
|
|
39486
|
+
import * as clack54 from "@clack/prompts";
|
|
39397
39487
|
import * as pulumi34 from "@pulumi/pulumi";
|
|
39398
|
-
import
|
|
39488
|
+
import pc57 from "picocolors";
|
|
39399
39489
|
init_events();
|
|
39400
39490
|
init_aws();
|
|
39401
39491
|
init_errors();
|
|
@@ -39408,7 +39498,7 @@ async function smsSync(options) {
|
|
|
39408
39498
|
await ensurePulumiInstalled();
|
|
39409
39499
|
const startTime = Date.now();
|
|
39410
39500
|
if (!isJsonMode()) {
|
|
39411
|
-
|
|
39501
|
+
clack54.intro(pc57.bold("Wraps SMS Infrastructure Sync"));
|
|
39412
39502
|
}
|
|
39413
39503
|
const progress = new DeploymentProgress();
|
|
39414
39504
|
const identity = await progress.execute(
|
|
@@ -39420,10 +39510,10 @@ async function smsSync(options) {
|
|
|
39420
39510
|
const smsService = metadata?.services?.sms;
|
|
39421
39511
|
if (!smsService?.config) {
|
|
39422
39512
|
progress.stop();
|
|
39423
|
-
|
|
39513
|
+
clack54.log.error("No SMS infrastructure found to sync");
|
|
39424
39514
|
console.log(
|
|
39425
39515
|
`
|
|
39426
|
-
Run ${
|
|
39516
|
+
Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
39427
39517
|
`
|
|
39428
39518
|
);
|
|
39429
39519
|
process.exit(1);
|
|
@@ -39432,18 +39522,18 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39432
39522
|
const storedStackName = smsService.pulumiStackName;
|
|
39433
39523
|
progress.info("Found existing SMS configuration");
|
|
39434
39524
|
progress.info(
|
|
39435
|
-
`Phone type: ${
|
|
39525
|
+
`Phone type: ${pc57.cyan(smsConfig.phoneNumberType || "simulator")}`
|
|
39436
39526
|
);
|
|
39437
39527
|
progress.info(
|
|
39438
|
-
`Event tracking: ${
|
|
39528
|
+
`Event tracking: ${pc57.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
|
|
39439
39529
|
);
|
|
39440
39530
|
if (!options.yes) {
|
|
39441
|
-
const confirmed = await
|
|
39531
|
+
const confirmed = await clack54.confirm({
|
|
39442
39532
|
message: "Sync SMS infrastructure? This will update Lambda code and recreate any missing resources.",
|
|
39443
39533
|
initialValue: true
|
|
39444
39534
|
});
|
|
39445
|
-
if (
|
|
39446
|
-
|
|
39535
|
+
if (clack54.isCancel(confirmed) || !confirmed) {
|
|
39536
|
+
clack54.cancel("Sync cancelled.");
|
|
39447
39537
|
process.exit(0);
|
|
39448
39538
|
}
|
|
39449
39539
|
}
|
|
@@ -39548,7 +39638,7 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39548
39638
|
throw errors.stackLocked();
|
|
39549
39639
|
}
|
|
39550
39640
|
trackError("SYNC_FAILED", "sms:sync", { step: "sync" });
|
|
39551
|
-
|
|
39641
|
+
clack54.log.error(`SMS sync failed: ${errorMessage}`);
|
|
39552
39642
|
process.exit(1);
|
|
39553
39643
|
}
|
|
39554
39644
|
if (metadata && smsService) {
|
|
@@ -39568,7 +39658,7 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39568
39658
|
return;
|
|
39569
39659
|
}
|
|
39570
39660
|
console.log("\n");
|
|
39571
|
-
|
|
39661
|
+
clack54.log.success(pc57.green("SMS infrastructure synced successfully!"));
|
|
39572
39662
|
const changes = [];
|
|
39573
39663
|
if (outputs.lambdaFunctions?.length) {
|
|
39574
39664
|
changes.push("Lambda functions updated");
|
|
@@ -39576,13 +39666,13 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39576
39666
|
changes.push("SDK resources verified");
|
|
39577
39667
|
console.log("");
|
|
39578
39668
|
for (const change of changes) {
|
|
39579
|
-
console.log(` ${
|
|
39669
|
+
console.log(` ${pc57.green("\u2713")} ${change}`);
|
|
39580
39670
|
}
|
|
39581
39671
|
trackCommand("sms:sync", {
|
|
39582
39672
|
success: true,
|
|
39583
39673
|
duration_ms: Date.now() - startTime
|
|
39584
39674
|
});
|
|
39585
|
-
|
|
39675
|
+
clack54.outro(pc57.green("Sync complete!"));
|
|
39586
39676
|
}
|
|
39587
39677
|
|
|
39588
39678
|
// src/commands/sms/test.ts
|
|
@@ -39597,8 +39687,8 @@ import {
|
|
|
39597
39687
|
PinpointSMSVoiceV2Client as PinpointSMSVoiceV2Client3,
|
|
39598
39688
|
SendTextMessageCommand
|
|
39599
39689
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
39600
|
-
import * as
|
|
39601
|
-
import
|
|
39690
|
+
import * as clack55 from "@clack/prompts";
|
|
39691
|
+
import pc58 from "picocolors";
|
|
39602
39692
|
|
|
39603
39693
|
// src/utils/sms/validation.ts
|
|
39604
39694
|
init_esm_shims();
|
|
@@ -39621,7 +39711,7 @@ async function smsTest(options) {
|
|
|
39621
39711
|
const startTime = Date.now();
|
|
39622
39712
|
const progress = new DeploymentProgress();
|
|
39623
39713
|
if (!isJsonMode()) {
|
|
39624
|
-
|
|
39714
|
+
clack55.intro(pc58.bold("Wraps SMS Test"));
|
|
39625
39715
|
}
|
|
39626
39716
|
const identity = await progress.execute(
|
|
39627
39717
|
"Validating AWS credentials",
|
|
@@ -39631,10 +39721,10 @@ async function smsTest(options) {
|
|
|
39631
39721
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39632
39722
|
if (!metadata?.services?.sms) {
|
|
39633
39723
|
progress.stop();
|
|
39634
|
-
|
|
39724
|
+
clack55.log.error("No SMS infrastructure found");
|
|
39635
39725
|
console.log(
|
|
39636
39726
|
`
|
|
39637
|
-
Run ${
|
|
39727
|
+
Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39638
39728
|
`
|
|
39639
39729
|
);
|
|
39640
39730
|
process.exit(1);
|
|
@@ -39648,7 +39738,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39648
39738
|
);
|
|
39649
39739
|
}
|
|
39650
39740
|
if (!toNumber) {
|
|
39651
|
-
const destinationType = await
|
|
39741
|
+
const destinationType = await clack55.select({
|
|
39652
39742
|
message: "Choose destination number:",
|
|
39653
39743
|
options: [
|
|
39654
39744
|
{
|
|
@@ -39663,25 +39753,25 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39663
39753
|
}
|
|
39664
39754
|
]
|
|
39665
39755
|
});
|
|
39666
|
-
if (
|
|
39667
|
-
|
|
39756
|
+
if (clack55.isCancel(destinationType)) {
|
|
39757
|
+
clack55.cancel("Operation cancelled.");
|
|
39668
39758
|
process.exit(0);
|
|
39669
39759
|
}
|
|
39670
39760
|
if (destinationType === "simulator") {
|
|
39671
|
-
const simResult = await
|
|
39761
|
+
const simResult = await clack55.select({
|
|
39672
39762
|
message: "Select simulator destination:",
|
|
39673
39763
|
options: SIMULATOR_DESTINATIONS.map((sim) => ({
|
|
39674
39764
|
value: sim.number,
|
|
39675
39765
|
label: `${sim.number} | ${sim.country}`
|
|
39676
39766
|
}))
|
|
39677
39767
|
});
|
|
39678
|
-
if (
|
|
39679
|
-
|
|
39768
|
+
if (clack55.isCancel(simResult)) {
|
|
39769
|
+
clack55.cancel("Operation cancelled.");
|
|
39680
39770
|
process.exit(0);
|
|
39681
39771
|
}
|
|
39682
39772
|
toNumber = simResult;
|
|
39683
39773
|
} else {
|
|
39684
|
-
const result = await
|
|
39774
|
+
const result = await clack55.text({
|
|
39685
39775
|
message: "Enter destination phone number (E.164 format):",
|
|
39686
39776
|
placeholder: "+14155551234",
|
|
39687
39777
|
validate: (value) => {
|
|
@@ -39694,22 +39784,22 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39694
39784
|
return;
|
|
39695
39785
|
}
|
|
39696
39786
|
});
|
|
39697
|
-
if (
|
|
39698
|
-
|
|
39787
|
+
if (clack55.isCancel(result)) {
|
|
39788
|
+
clack55.cancel("Operation cancelled.");
|
|
39699
39789
|
process.exit(0);
|
|
39700
39790
|
}
|
|
39701
39791
|
toNumber = result;
|
|
39702
39792
|
}
|
|
39703
39793
|
} else if (!isValidPhoneNumber(toNumber)) {
|
|
39704
39794
|
progress.stop();
|
|
39705
|
-
|
|
39795
|
+
clack55.log.error(
|
|
39706
39796
|
`Invalid phone number format: ${toNumber}. Use E.164 format (e.g., +14155551234)`
|
|
39707
39797
|
);
|
|
39708
39798
|
process.exit(1);
|
|
39709
39799
|
}
|
|
39710
39800
|
let message = options.message;
|
|
39711
39801
|
if (!message) {
|
|
39712
|
-
const result = await
|
|
39802
|
+
const result = await clack55.text({
|
|
39713
39803
|
message: "Enter test message:",
|
|
39714
39804
|
placeholder: "Hello from Wraps SMS!",
|
|
39715
39805
|
defaultValue: "Hello from Wraps SMS! This is a test message.",
|
|
@@ -39723,8 +39813,8 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39723
39813
|
return;
|
|
39724
39814
|
}
|
|
39725
39815
|
});
|
|
39726
|
-
if (
|
|
39727
|
-
|
|
39816
|
+
if (clack55.isCancel(result)) {
|
|
39817
|
+
clack55.cancel("Operation cancelled.");
|
|
39728
39818
|
process.exit(0);
|
|
39729
39819
|
}
|
|
39730
39820
|
message = result;
|
|
@@ -39763,16 +39853,16 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39763
39853
|
return;
|
|
39764
39854
|
}
|
|
39765
39855
|
console.log("\n");
|
|
39766
|
-
|
|
39856
|
+
clack55.log.success(pc58.green("Test SMS sent successfully!"));
|
|
39767
39857
|
console.log("");
|
|
39768
|
-
|
|
39858
|
+
clack55.note(
|
|
39769
39859
|
[
|
|
39770
|
-
`${
|
|
39771
|
-
`${
|
|
39772
|
-
`${
|
|
39773
|
-
`${
|
|
39860
|
+
`${pc58.bold("Message ID:")} ${pc58.cyan(messageId || "unknown")}`,
|
|
39861
|
+
`${pc58.bold("To:")} ${pc58.cyan(toNumber)}`,
|
|
39862
|
+
`${pc58.bold("Message:")} ${message}`,
|
|
39863
|
+
`${pc58.bold("Type:")} ${pc58.cyan(smsConfig?.phoneNumberType || "simulator")}`,
|
|
39774
39864
|
"",
|
|
39775
|
-
|
|
39865
|
+
pc58.dim(
|
|
39776
39866
|
smsConfig?.phoneNumberType === "simulator" ? "Note: Simulator messages are not actually delivered" : "Check your phone for the message!"
|
|
39777
39867
|
)
|
|
39778
39868
|
].join("\n"),
|
|
@@ -39780,11 +39870,11 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39780
39870
|
);
|
|
39781
39871
|
if (smsConfig?.eventTracking?.enabled) {
|
|
39782
39872
|
console.log("");
|
|
39783
|
-
|
|
39784
|
-
|
|
39873
|
+
clack55.log.info(
|
|
39874
|
+
pc58.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
|
|
39785
39875
|
);
|
|
39786
39876
|
}
|
|
39787
|
-
|
|
39877
|
+
clack55.outro(pc58.green("Test complete!"));
|
|
39788
39878
|
} catch (error) {
|
|
39789
39879
|
progress.stop();
|
|
39790
39880
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -39796,33 +39886,33 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39796
39886
|
});
|
|
39797
39887
|
const errorName = error instanceof Error ? error.name : "";
|
|
39798
39888
|
if (errorName === "ConflictException" || errorMessage.includes("opt-out")) {
|
|
39799
|
-
|
|
39889
|
+
clack55.log.error("Destination number has opted out of messages");
|
|
39800
39890
|
console.log("\nThe recipient has opted out of receiving SMS messages.\n");
|
|
39801
39891
|
} else if (errorName === "ThrottlingException" || errorMessage.includes("spending limit")) {
|
|
39802
|
-
|
|
39892
|
+
clack55.log.error("SMS rate or spending limit reached");
|
|
39803
39893
|
console.log(
|
|
39804
39894
|
"\nCheck your AWS account SMS spending limits in the console.\n"
|
|
39805
39895
|
);
|
|
39806
39896
|
} else if (errorName === "ValidationException") {
|
|
39807
|
-
|
|
39897
|
+
clack55.log.error(`Invalid request: ${errorMessage}`);
|
|
39808
39898
|
} else if (errorMessage.includes("not verified") || errorMessage.includes("not registered")) {
|
|
39809
|
-
|
|
39899
|
+
clack55.log.error("Toll-free number registration is not complete");
|
|
39810
39900
|
console.log(
|
|
39811
39901
|
`
|
|
39812
|
-
Run ${
|
|
39902
|
+
Run ${pc58.cyan("wraps sms register")} to check registration status.
|
|
39813
39903
|
`
|
|
39814
39904
|
);
|
|
39815
39905
|
} else if (errorName === "AccessDeniedException") {
|
|
39816
|
-
|
|
39906
|
+
clack55.log.error(
|
|
39817
39907
|
"Permission denied \u2014 IAM role may be missing SMS send permissions"
|
|
39818
39908
|
);
|
|
39819
39909
|
console.log(
|
|
39820
39910
|
`
|
|
39821
|
-
Run ${
|
|
39911
|
+
Run ${pc58.cyan("wraps sms upgrade")} to update IAM policies.
|
|
39822
39912
|
`
|
|
39823
39913
|
);
|
|
39824
39914
|
} else {
|
|
39825
|
-
|
|
39915
|
+
clack55.log.error(`Failed to send SMS: ${errorMessage}`);
|
|
39826
39916
|
}
|
|
39827
39917
|
process.exit(1);
|
|
39828
39918
|
}
|
|
@@ -39830,9 +39920,9 @@ Run ${pc57.cyan("wraps sms upgrade")} to update IAM policies.
|
|
|
39830
39920
|
|
|
39831
39921
|
// src/commands/sms/upgrade.ts
|
|
39832
39922
|
init_esm_shims();
|
|
39833
|
-
import * as
|
|
39923
|
+
import * as clack56 from "@clack/prompts";
|
|
39834
39924
|
import * as pulumi35 from "@pulumi/pulumi";
|
|
39835
|
-
import
|
|
39925
|
+
import pc59 from "picocolors";
|
|
39836
39926
|
init_events();
|
|
39837
39927
|
init_aws();
|
|
39838
39928
|
init_errors();
|
|
@@ -39847,7 +39937,7 @@ async function smsUpgrade(options) {
|
|
|
39847
39937
|
const startTime = Date.now();
|
|
39848
39938
|
let upgradeAction = "";
|
|
39849
39939
|
if (!isJsonMode()) {
|
|
39850
|
-
|
|
39940
|
+
clack56.intro(pc59.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
|
|
39851
39941
|
}
|
|
39852
39942
|
const progress = new DeploymentProgress();
|
|
39853
39943
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -39861,7 +39951,7 @@ async function smsUpgrade(options) {
|
|
|
39861
39951
|
"Validating AWS credentials",
|
|
39862
39952
|
async () => validateAWSCredentials()
|
|
39863
39953
|
);
|
|
39864
|
-
progress.info(`Connected to AWS account: ${
|
|
39954
|
+
progress.info(`Connected to AWS account: ${pc59.cyan(identity.accountId)}`);
|
|
39865
39955
|
const region = await resolveRegionForCommand({
|
|
39866
39956
|
accountId: identity.accountId,
|
|
39867
39957
|
optionRegion: options.region,
|
|
@@ -39870,35 +39960,35 @@ async function smsUpgrade(options) {
|
|
|
39870
39960
|
});
|
|
39871
39961
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39872
39962
|
if (!metadata) {
|
|
39873
|
-
|
|
39874
|
-
`No Wraps connection found for account ${
|
|
39963
|
+
clack56.log.error(
|
|
39964
|
+
`No Wraps connection found for account ${pc59.cyan(identity.accountId)} in region ${pc59.cyan(region)}`
|
|
39875
39965
|
);
|
|
39876
|
-
|
|
39877
|
-
`Use ${
|
|
39966
|
+
clack56.log.info(
|
|
39967
|
+
`Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
|
|
39878
39968
|
);
|
|
39879
39969
|
process.exit(1);
|
|
39880
39970
|
}
|
|
39881
39971
|
if (!metadata.services.sms) {
|
|
39882
|
-
|
|
39883
|
-
|
|
39884
|
-
`Use ${
|
|
39972
|
+
clack56.log.error("No SMS infrastructure found");
|
|
39973
|
+
clack56.log.info(
|
|
39974
|
+
`Use ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.`
|
|
39885
39975
|
);
|
|
39886
39976
|
process.exit(1);
|
|
39887
39977
|
}
|
|
39888
39978
|
progress.info(`Found existing connection created: ${metadata.timestamp}`);
|
|
39889
39979
|
console.log(`
|
|
39890
|
-
${
|
|
39980
|
+
${pc59.bold("Current Configuration:")}
|
|
39891
39981
|
`);
|
|
39892
39982
|
if (metadata.services.sms.preset) {
|
|
39893
|
-
console.log(` Preset: ${
|
|
39983
|
+
console.log(` Preset: ${pc59.cyan(metadata.services.sms.preset)}`);
|
|
39894
39984
|
} else {
|
|
39895
|
-
console.log(` Preset: ${
|
|
39985
|
+
console.log(` Preset: ${pc59.cyan("custom")}`);
|
|
39896
39986
|
}
|
|
39897
39987
|
const config2 = metadata.services.sms.config;
|
|
39898
39988
|
if (!config2) {
|
|
39899
|
-
|
|
39900
|
-
|
|
39901
|
-
`Use ${
|
|
39989
|
+
clack56.log.error("No SMS configuration found in metadata");
|
|
39990
|
+
clack56.log.info(
|
|
39991
|
+
`Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
|
|
39902
39992
|
);
|
|
39903
39993
|
process.exit(1);
|
|
39904
39994
|
}
|
|
@@ -39910,45 +40000,45 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39910
40000
|
"short-code": "Short code ($995+/mo, 100+ MPS)"
|
|
39911
40001
|
};
|
|
39912
40002
|
console.log(
|
|
39913
|
-
` Phone Type: ${
|
|
40003
|
+
` Phone Type: ${pc59.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
|
|
39914
40004
|
);
|
|
39915
40005
|
}
|
|
39916
40006
|
if (config2.tracking?.enabled) {
|
|
39917
|
-
console.log(` ${
|
|
40007
|
+
console.log(` ${pc59.green("\u2713")} Delivery Tracking`);
|
|
39918
40008
|
if (config2.tracking.linkTracking) {
|
|
39919
|
-
console.log(` ${
|
|
40009
|
+
console.log(` ${pc59.dim("\u2514\u2500")} Link click tracking enabled`);
|
|
39920
40010
|
}
|
|
39921
40011
|
}
|
|
39922
40012
|
if (config2.eventTracking?.enabled) {
|
|
39923
|
-
console.log(` ${
|
|
40013
|
+
console.log(` ${pc59.green("\u2713")} Event Tracking (SNS)`);
|
|
39924
40014
|
if (config2.eventTracking.dynamoDBHistory) {
|
|
39925
40015
|
console.log(
|
|
39926
|
-
` ${
|
|
40016
|
+
` ${pc59.dim("\u2514\u2500")} Message History: ${pc59.cyan(config2.eventTracking.archiveRetention || "90days")}`
|
|
39927
40017
|
);
|
|
39928
40018
|
}
|
|
39929
40019
|
}
|
|
39930
40020
|
if (config2.messageArchiving?.enabled) {
|
|
39931
40021
|
console.log(
|
|
39932
|
-
` ${
|
|
40022
|
+
` ${pc59.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
|
|
39933
40023
|
);
|
|
39934
40024
|
}
|
|
39935
40025
|
if (config2.optOutManagement) {
|
|
39936
|
-
console.log(` ${
|
|
40026
|
+
console.log(` ${pc59.green("\u2713")} Opt-out Management`);
|
|
39937
40027
|
}
|
|
39938
40028
|
if (config2.protectConfiguration?.enabled) {
|
|
39939
40029
|
const countries = config2.protectConfiguration.allowedCountries?.join(", ") || "US";
|
|
39940
|
-
console.log(` ${
|
|
39941
|
-
console.log(` ${
|
|
40030
|
+
console.log(` ${pc59.green("\u2713")} Fraud Protection`);
|
|
40031
|
+
console.log(` ${pc59.dim("\u2514\u2500")} Allowed countries: ${pc59.cyan(countries)}`);
|
|
39942
40032
|
if (config2.protectConfiguration.aitFiltering) {
|
|
39943
|
-
console.log(` ${
|
|
40033
|
+
console.log(` ${pc59.dim("\u2514\u2500")} AIT filtering: ${pc59.cyan("enabled")}`);
|
|
39944
40034
|
}
|
|
39945
40035
|
} else {
|
|
39946
|
-
console.log(` ${
|
|
40036
|
+
console.log(` ${pc59.dim("\u25CB")} Fraud Protection (not configured)`);
|
|
39947
40037
|
}
|
|
39948
40038
|
const currentCostData = calculateSMSCosts(config2, 1e4);
|
|
39949
40039
|
console.log(
|
|
39950
40040
|
`
|
|
39951
|
-
Estimated Cost: ${
|
|
40041
|
+
Estimated Cost: ${pc59.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
39952
40042
|
);
|
|
39953
40043
|
console.log("");
|
|
39954
40044
|
const phoneTypeLabels = {
|
|
@@ -39957,7 +40047,7 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39957
40047
|
"10dlc": "10DLC",
|
|
39958
40048
|
"short-code": "Short code"
|
|
39959
40049
|
};
|
|
39960
|
-
upgradeAction = await
|
|
40050
|
+
upgradeAction = await clack56.select({
|
|
39961
40051
|
message: "What would you like to do?",
|
|
39962
40052
|
options: [
|
|
39963
40053
|
{
|
|
@@ -39997,8 +40087,8 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39997
40087
|
}
|
|
39998
40088
|
]
|
|
39999
40089
|
});
|
|
40000
|
-
if (
|
|
40001
|
-
|
|
40090
|
+
if (clack56.isCancel(upgradeAction)) {
|
|
40091
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40002
40092
|
process.exit(0);
|
|
40003
40093
|
}
|
|
40004
40094
|
let updatedConfig = { ...config2 };
|
|
@@ -40039,65 +40129,65 @@ ${pc58.bold("Current Configuration:")}
|
|
|
40039
40129
|
hint: p.hint
|
|
40040
40130
|
}));
|
|
40041
40131
|
if (availableTypes.length === 0) {
|
|
40042
|
-
|
|
40132
|
+
clack56.log.warn(
|
|
40043
40133
|
"Already on highest phone number tier. Contact AWS for dedicated short codes."
|
|
40044
40134
|
);
|
|
40045
40135
|
process.exit(0);
|
|
40046
40136
|
}
|
|
40047
|
-
const selectedType = await
|
|
40137
|
+
const selectedType = await clack56.select({
|
|
40048
40138
|
message: "Select new phone number type:",
|
|
40049
40139
|
options: availableTypes
|
|
40050
40140
|
});
|
|
40051
|
-
if (
|
|
40052
|
-
|
|
40141
|
+
if (clack56.isCancel(selectedType)) {
|
|
40142
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40053
40143
|
process.exit(0);
|
|
40054
40144
|
}
|
|
40055
40145
|
if (selectedType === "toll-free") {
|
|
40056
40146
|
console.log(
|
|
40057
40147
|
`
|
|
40058
|
-
${
|
|
40148
|
+
${pc59.yellow("\u26A0")} ${pc59.bold("Toll-free Registration Required")}
|
|
40059
40149
|
`
|
|
40060
40150
|
);
|
|
40061
40151
|
console.log(
|
|
40062
|
-
|
|
40152
|
+
pc59.dim("Toll-free numbers require carrier registration before")
|
|
40063
40153
|
);
|
|
40064
40154
|
console.log(
|
|
40065
|
-
|
|
40155
|
+
pc59.dim("they can send messages at scale. After deployment:\n")
|
|
40066
40156
|
);
|
|
40067
40157
|
console.log(
|
|
40068
|
-
` 1. Run ${
|
|
40158
|
+
` 1. Run ${pc59.cyan("wraps sms register")} to start registration`
|
|
40069
40159
|
);
|
|
40070
40160
|
console.log(" 2. Submit your business use case information");
|
|
40071
40161
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40072
40162
|
console.log(
|
|
40073
|
-
|
|
40163
|
+
pc59.dim("\nUntil verified, sending is limited to low volume.\n")
|
|
40074
40164
|
);
|
|
40075
|
-
const confirmTollFree = await
|
|
40165
|
+
const confirmTollFree = await clack56.confirm({
|
|
40076
40166
|
message: "Continue with toll-free number request?",
|
|
40077
40167
|
initialValue: true
|
|
40078
40168
|
});
|
|
40079
|
-
if (
|
|
40080
|
-
|
|
40169
|
+
if (clack56.isCancel(confirmTollFree) || !confirmTollFree) {
|
|
40170
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40081
40171
|
process.exit(0);
|
|
40082
40172
|
}
|
|
40083
40173
|
}
|
|
40084
40174
|
if (selectedType === "10dlc") {
|
|
40085
40175
|
console.log(
|
|
40086
40176
|
`
|
|
40087
|
-
${
|
|
40177
|
+
${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
40088
40178
|
`
|
|
40089
40179
|
);
|
|
40090
|
-
console.log(
|
|
40180
|
+
console.log(pc59.dim("10DLC requires brand and campaign registration:"));
|
|
40091
40181
|
console.log(" \u2022 Brand registration: one-time $4 fee");
|
|
40092
40182
|
console.log(" \u2022 Campaign registration: $15/mo per campaign");
|
|
40093
40183
|
console.log(" \u2022 Verification takes 1-7 business days");
|
|
40094
40184
|
console.log("");
|
|
40095
|
-
const confirm10DLC = await
|
|
40185
|
+
const confirm10DLC = await clack56.confirm({
|
|
40096
40186
|
message: "Continue with 10DLC number request?",
|
|
40097
40187
|
initialValue: true
|
|
40098
40188
|
});
|
|
40099
|
-
if (
|
|
40100
|
-
|
|
40189
|
+
if (clack56.isCancel(confirm10DLC) || !confirm10DLC) {
|
|
40190
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40101
40191
|
process.exit(0);
|
|
40102
40192
|
}
|
|
40103
40193
|
}
|
|
@@ -40122,15 +40212,15 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40122
40212
|
disabled: currentPresetIdx >= 0 && idx <= currentPresetIdx ? "Current or lower tier" : void 0
|
|
40123
40213
|
})).filter((p) => !p.disabled && p.value !== "custom");
|
|
40124
40214
|
if (availablePresets.length === 0) {
|
|
40125
|
-
|
|
40215
|
+
clack56.log.warn("Already on highest preset (Enterprise)");
|
|
40126
40216
|
process.exit(0);
|
|
40127
40217
|
}
|
|
40128
|
-
const selectedPreset = await
|
|
40218
|
+
const selectedPreset = await clack56.select({
|
|
40129
40219
|
message: "Select new preset:",
|
|
40130
40220
|
options: availablePresets
|
|
40131
40221
|
});
|
|
40132
|
-
if (
|
|
40133
|
-
|
|
40222
|
+
if (clack56.isCancel(selectedPreset)) {
|
|
40223
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40134
40224
|
process.exit(0);
|
|
40135
40225
|
}
|
|
40136
40226
|
const presetConfig = getSMSPreset(selectedPreset);
|
|
@@ -40146,7 +40236,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40146
40236
|
}
|
|
40147
40237
|
case "event-tracking": {
|
|
40148
40238
|
if (config2.eventTracking?.enabled) {
|
|
40149
|
-
const eventAction = await
|
|
40239
|
+
const eventAction = await clack56.select({
|
|
40150
40240
|
message: "What would you like to do with event tracking?",
|
|
40151
40241
|
options: [
|
|
40152
40242
|
{
|
|
@@ -40161,17 +40251,17 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40161
40251
|
}
|
|
40162
40252
|
]
|
|
40163
40253
|
});
|
|
40164
|
-
if (
|
|
40165
|
-
|
|
40254
|
+
if (clack56.isCancel(eventAction)) {
|
|
40255
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40166
40256
|
process.exit(0);
|
|
40167
40257
|
}
|
|
40168
40258
|
if (eventAction === "disable") {
|
|
40169
|
-
const confirmDisable = await
|
|
40259
|
+
const confirmDisable = await clack56.confirm({
|
|
40170
40260
|
message: "Are you sure? Existing history will remain, but new events won't be tracked.",
|
|
40171
40261
|
initialValue: false
|
|
40172
40262
|
});
|
|
40173
|
-
if (
|
|
40174
|
-
|
|
40263
|
+
if (clack56.isCancel(confirmDisable) || !confirmDisable) {
|
|
40264
|
+
clack56.cancel("Event tracking not disabled.");
|
|
40175
40265
|
process.exit(0);
|
|
40176
40266
|
}
|
|
40177
40267
|
updatedConfig = {
|
|
@@ -40181,7 +40271,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40181
40271
|
}
|
|
40182
40272
|
};
|
|
40183
40273
|
} else {
|
|
40184
|
-
const retention = await
|
|
40274
|
+
const retention = await clack56.select({
|
|
40185
40275
|
message: "Message history retention period:",
|
|
40186
40276
|
options: [
|
|
40187
40277
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40208,8 +40298,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40208
40298
|
],
|
|
40209
40299
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40210
40300
|
});
|
|
40211
|
-
if (
|
|
40212
|
-
|
|
40301
|
+
if (clack56.isCancel(retention)) {
|
|
40302
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40213
40303
|
process.exit(0);
|
|
40214
40304
|
}
|
|
40215
40305
|
updatedConfig = {
|
|
@@ -40221,19 +40311,19 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40221
40311
|
};
|
|
40222
40312
|
}
|
|
40223
40313
|
} else {
|
|
40224
|
-
const enableTracking = await
|
|
40314
|
+
const enableTracking = await clack56.confirm({
|
|
40225
40315
|
message: "Enable event tracking? (Track SMS events with history)",
|
|
40226
40316
|
initialValue: true
|
|
40227
40317
|
});
|
|
40228
|
-
if (
|
|
40229
|
-
|
|
40318
|
+
if (clack56.isCancel(enableTracking)) {
|
|
40319
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40230
40320
|
process.exit(0);
|
|
40231
40321
|
}
|
|
40232
40322
|
if (!enableTracking) {
|
|
40233
|
-
|
|
40323
|
+
clack56.log.info("Event tracking not enabled.");
|
|
40234
40324
|
process.exit(0);
|
|
40235
40325
|
}
|
|
40236
|
-
const retention = await
|
|
40326
|
+
const retention = await clack56.select({
|
|
40237
40327
|
message: "Message history retention period:",
|
|
40238
40328
|
options: [
|
|
40239
40329
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40256,8 +40346,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40256
40346
|
],
|
|
40257
40347
|
initialValue: "90days"
|
|
40258
40348
|
});
|
|
40259
|
-
if (
|
|
40260
|
-
|
|
40349
|
+
if (clack56.isCancel(retention)) {
|
|
40350
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40261
40351
|
process.exit(0);
|
|
40262
40352
|
}
|
|
40263
40353
|
updatedConfig = {
|
|
@@ -40276,12 +40366,12 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40276
40366
|
}
|
|
40277
40367
|
case "retention": {
|
|
40278
40368
|
if (!config2.eventTracking?.enabled) {
|
|
40279
|
-
|
|
40369
|
+
clack56.log.error(
|
|
40280
40370
|
"Event tracking is not enabled. Enable it first to change retention."
|
|
40281
40371
|
);
|
|
40282
40372
|
process.exit(1);
|
|
40283
40373
|
}
|
|
40284
|
-
const retention = await
|
|
40374
|
+
const retention = await clack56.select({
|
|
40285
40375
|
message: "Message history retention period (event data in DynamoDB):",
|
|
40286
40376
|
options: [
|
|
40287
40377
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40300,8 +40390,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40300
40390
|
],
|
|
40301
40391
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40302
40392
|
});
|
|
40303
|
-
if (
|
|
40304
|
-
|
|
40393
|
+
if (clack56.isCancel(retention)) {
|
|
40394
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40305
40395
|
process.exit(0);
|
|
40306
40396
|
}
|
|
40307
40397
|
updatedConfig = {
|
|
@@ -40319,21 +40409,21 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40319
40409
|
case "link-tracking": {
|
|
40320
40410
|
const enableLinkTracking = !config2.tracking?.linkTracking;
|
|
40321
40411
|
if (enableLinkTracking) {
|
|
40322
|
-
|
|
40323
|
-
|
|
40412
|
+
clack56.log.info(
|
|
40413
|
+
pc59.dim(
|
|
40324
40414
|
"Link tracking will track clicks on URLs in your SMS messages."
|
|
40325
40415
|
)
|
|
40326
40416
|
);
|
|
40327
|
-
|
|
40328
|
-
|
|
40417
|
+
clack56.log.info(
|
|
40418
|
+
pc59.dim("URLs will be rewritten to go through a tracking endpoint.")
|
|
40329
40419
|
);
|
|
40330
40420
|
}
|
|
40331
|
-
const confirmed = await
|
|
40421
|
+
const confirmed = await clack56.confirm({
|
|
40332
40422
|
message: enableLinkTracking ? "Enable link click tracking?" : "Disable link click tracking?",
|
|
40333
40423
|
initialValue: enableLinkTracking
|
|
40334
40424
|
});
|
|
40335
|
-
if (
|
|
40336
|
-
|
|
40425
|
+
if (clack56.isCancel(confirmed) || !confirmed) {
|
|
40426
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40337
40427
|
process.exit(0);
|
|
40338
40428
|
}
|
|
40339
40429
|
updatedConfig = {
|
|
@@ -40350,7 +40440,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40350
40440
|
}
|
|
40351
40441
|
case "archiving": {
|
|
40352
40442
|
if (config2.messageArchiving?.enabled) {
|
|
40353
|
-
const archivingAction = await
|
|
40443
|
+
const archivingAction = await clack56.select({
|
|
40354
40444
|
message: "What would you like to do with message archiving?",
|
|
40355
40445
|
options: [
|
|
40356
40446
|
{
|
|
@@ -40365,17 +40455,17 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40365
40455
|
}
|
|
40366
40456
|
]
|
|
40367
40457
|
});
|
|
40368
|
-
if (
|
|
40369
|
-
|
|
40458
|
+
if (clack56.isCancel(archivingAction)) {
|
|
40459
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40370
40460
|
process.exit(0);
|
|
40371
40461
|
}
|
|
40372
40462
|
if (archivingAction === "disable") {
|
|
40373
|
-
const confirmDisable = await
|
|
40463
|
+
const confirmDisable = await clack56.confirm({
|
|
40374
40464
|
message: "Are you sure? Existing archived messages will remain, but new messages won't be archived.",
|
|
40375
40465
|
initialValue: false
|
|
40376
40466
|
});
|
|
40377
|
-
if (
|
|
40378
|
-
|
|
40467
|
+
if (clack56.isCancel(confirmDisable) || !confirmDisable) {
|
|
40468
|
+
clack56.cancel("Archiving not disabled.");
|
|
40379
40469
|
process.exit(0);
|
|
40380
40470
|
}
|
|
40381
40471
|
updatedConfig = {
|
|
@@ -40386,7 +40476,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40386
40476
|
}
|
|
40387
40477
|
};
|
|
40388
40478
|
} else {
|
|
40389
|
-
const retention = await
|
|
40479
|
+
const retention = await clack56.select({
|
|
40390
40480
|
message: "Message archive retention period:",
|
|
40391
40481
|
options: [
|
|
40392
40482
|
{
|
|
@@ -40417,8 +40507,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40417
40507
|
],
|
|
40418
40508
|
initialValue: config2.messageArchiving.retention
|
|
40419
40509
|
});
|
|
40420
|
-
if (
|
|
40421
|
-
|
|
40510
|
+
if (clack56.isCancel(retention)) {
|
|
40511
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40422
40512
|
process.exit(0);
|
|
40423
40513
|
}
|
|
40424
40514
|
updatedConfig = {
|
|
@@ -40430,19 +40520,19 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40430
40520
|
};
|
|
40431
40521
|
}
|
|
40432
40522
|
} else {
|
|
40433
|
-
const enableArchiving = await
|
|
40523
|
+
const enableArchiving = await clack56.confirm({
|
|
40434
40524
|
message: "Enable message archiving? (Store full message content for viewing)",
|
|
40435
40525
|
initialValue: true
|
|
40436
40526
|
});
|
|
40437
|
-
if (
|
|
40438
|
-
|
|
40527
|
+
if (clack56.isCancel(enableArchiving)) {
|
|
40528
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40439
40529
|
process.exit(0);
|
|
40440
40530
|
}
|
|
40441
40531
|
if (!enableArchiving) {
|
|
40442
|
-
|
|
40532
|
+
clack56.log.info("Message archiving not enabled.");
|
|
40443
40533
|
process.exit(0);
|
|
40444
40534
|
}
|
|
40445
|
-
const retention = await
|
|
40535
|
+
const retention = await clack56.select({
|
|
40446
40536
|
message: "Message archive retention period:",
|
|
40447
40537
|
options: [
|
|
40448
40538
|
{ value: "7days", label: "7 days", hint: "~$1-2/mo for 10k msgs" },
|
|
@@ -40469,8 +40559,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40469
40559
|
],
|
|
40470
40560
|
initialValue: "90days"
|
|
40471
40561
|
});
|
|
40472
|
-
if (
|
|
40473
|
-
|
|
40562
|
+
if (clack56.isCancel(retention)) {
|
|
40563
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40474
40564
|
process.exit(0);
|
|
40475
40565
|
}
|
|
40476
40566
|
updatedConfig = {
|
|
@@ -40502,7 +40592,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40502
40592
|
const currentAllowed = config2.protectConfiguration?.allowedCountries || [
|
|
40503
40593
|
"US"
|
|
40504
40594
|
];
|
|
40505
|
-
const selectedCountries = await
|
|
40595
|
+
const selectedCountries = await clack56.multiselect({
|
|
40506
40596
|
message: "Select countries to allow SMS delivery (all others blocked):",
|
|
40507
40597
|
options: commonCountries.map((c) => ({
|
|
40508
40598
|
value: c.code,
|
|
@@ -40511,16 +40601,16 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40511
40601
|
initialValues: currentAllowed,
|
|
40512
40602
|
required: true
|
|
40513
40603
|
});
|
|
40514
|
-
if (
|
|
40515
|
-
|
|
40604
|
+
if (clack56.isCancel(selectedCountries)) {
|
|
40605
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40516
40606
|
process.exit(0);
|
|
40517
40607
|
}
|
|
40518
|
-
const enableAIT = await
|
|
40608
|
+
const enableAIT = await clack56.confirm({
|
|
40519
40609
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
40520
40610
|
initialValue: config2.protectConfiguration?.aitFiltering ?? false
|
|
40521
40611
|
});
|
|
40522
|
-
if (
|
|
40523
|
-
|
|
40612
|
+
if (clack56.isCancel(enableAIT)) {
|
|
40613
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40524
40614
|
process.exit(0);
|
|
40525
40615
|
}
|
|
40526
40616
|
updatedConfig = {
|
|
@@ -40538,28 +40628,28 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40538
40628
|
const newCostData = calculateSMSCosts(updatedConfig, 1e4);
|
|
40539
40629
|
const costDiff = newCostData.total.monthly - currentCostData.total.monthly;
|
|
40540
40630
|
console.log(`
|
|
40541
|
-
${
|
|
40631
|
+
${pc59.bold("Cost Impact:")}`);
|
|
40542
40632
|
console.log(
|
|
40543
|
-
` Current: ${
|
|
40633
|
+
` Current: ${pc59.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
40544
40634
|
);
|
|
40545
40635
|
console.log(
|
|
40546
|
-
` New: ${
|
|
40636
|
+
` New: ${pc59.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
|
|
40547
40637
|
);
|
|
40548
40638
|
if (costDiff > 0) {
|
|
40549
|
-
console.log(` Change: ${
|
|
40639
|
+
console.log(` Change: ${pc59.yellow(`+${formatCost3(costDiff)}/mo`)}`);
|
|
40550
40640
|
} else if (costDiff < 0) {
|
|
40551
40641
|
console.log(
|
|
40552
|
-
` Change: ${
|
|
40642
|
+
` Change: ${pc59.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
|
|
40553
40643
|
);
|
|
40554
40644
|
}
|
|
40555
40645
|
console.log("");
|
|
40556
40646
|
if (!(options.yes || options.preview)) {
|
|
40557
|
-
const confirmed = await
|
|
40647
|
+
const confirmed = await clack56.confirm({
|
|
40558
40648
|
message: "Proceed with upgrade?",
|
|
40559
40649
|
initialValue: true
|
|
40560
40650
|
});
|
|
40561
|
-
if (
|
|
40562
|
-
|
|
40651
|
+
if (clack56.isCancel(confirmed) || !confirmed) {
|
|
40652
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40563
40653
|
process.exit(0);
|
|
40564
40654
|
}
|
|
40565
40655
|
}
|
|
@@ -40628,8 +40718,8 @@ ${pc58.bold("Cost Impact:")}`);
|
|
|
40628
40718
|
resourceChanges: previewResult.resourceChanges,
|
|
40629
40719
|
commandName: "wraps sms upgrade"
|
|
40630
40720
|
});
|
|
40631
|
-
|
|
40632
|
-
|
|
40721
|
+
clack56.outro(
|
|
40722
|
+
pc59.green("Preview complete. Run without --preview to upgrade.")
|
|
40633
40723
|
);
|
|
40634
40724
|
trackServiceUpgrade("sms", {
|
|
40635
40725
|
region,
|
|
@@ -40734,43 +40824,43 @@ ${pc58.bold("Cost Impact:")}`);
|
|
|
40734
40824
|
}
|
|
40735
40825
|
progress.info("Connection metadata updated");
|
|
40736
40826
|
console.log("\n");
|
|
40737
|
-
|
|
40827
|
+
clack56.log.success(pc59.green(pc59.bold("SMS infrastructure upgraded!")));
|
|
40738
40828
|
console.log("\n");
|
|
40739
|
-
|
|
40829
|
+
clack56.note(
|
|
40740
40830
|
[
|
|
40741
|
-
`${
|
|
40742
|
-
`${
|
|
40743
|
-
`${
|
|
40744
|
-
`${
|
|
40745
|
-
outputs.tableName ? `${
|
|
40831
|
+
`${pc59.bold("Phone Number:")} ${pc59.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
40832
|
+
`${pc59.bold("Phone Type:")} ${pc59.cyan(updatedConfig.phoneNumberType || "simulator")}`,
|
|
40833
|
+
`${pc59.bold("Config Set:")} ${pc59.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
40834
|
+
`${pc59.bold("Region:")} ${pc59.cyan(outputs.region)}`,
|
|
40835
|
+
outputs.tableName ? `${pc59.bold("History Table:")} ${pc59.cyan(outputs.tableName)}` : "",
|
|
40746
40836
|
"",
|
|
40747
|
-
|
|
40748
|
-
|
|
40837
|
+
pc59.dim("IAM Role:"),
|
|
40838
|
+
pc59.dim(` ${outputs.roleArn}`)
|
|
40749
40839
|
].filter(Boolean).join("\n"),
|
|
40750
40840
|
"SMS Infrastructure"
|
|
40751
40841
|
);
|
|
40752
40842
|
console.log(`
|
|
40753
|
-
${
|
|
40843
|
+
${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
|
|
40754
40844
|
`);
|
|
40755
40845
|
if (upgradeAction === "phone-number") {
|
|
40756
40846
|
console.log(
|
|
40757
|
-
`Upgraded to ${
|
|
40847
|
+
`Upgraded to ${pc59.cyan(updatedConfig.phoneNumberType)} number (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40758
40848
|
`
|
|
40759
40849
|
);
|
|
40760
40850
|
if (updatedConfig.phoneNumberType === "toll-free") {
|
|
40761
|
-
console.log(`${
|
|
40851
|
+
console.log(`${pc59.bold("Next Steps:")}`);
|
|
40762
40852
|
console.log(
|
|
40763
|
-
` 1. Run ${
|
|
40853
|
+
` 1. Run ${pc59.cyan("wraps sms register")} to start toll-free registration`
|
|
40764
40854
|
);
|
|
40765
40855
|
console.log(" 2. Submit your business information and use case");
|
|
40766
40856
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40767
40857
|
console.log("");
|
|
40768
40858
|
console.log(
|
|
40769
|
-
|
|
40859
|
+
pc59.dim("Until verified, your number can only send limited messages.")
|
|
40770
40860
|
);
|
|
40771
40861
|
console.log("");
|
|
40772
40862
|
} else if (updatedConfig.phoneNumberType === "10dlc") {
|
|
40773
|
-
console.log(`${
|
|
40863
|
+
console.log(`${pc59.bold("Next Steps:")}`);
|
|
40774
40864
|
console.log(" 1. Register your brand in the AWS Console");
|
|
40775
40865
|
console.log(" 2. Create a 10DLC campaign for your use case");
|
|
40776
40866
|
console.log(" 3. Wait for campaign approval (1-7 business days)");
|
|
@@ -40778,16 +40868,16 @@ ${pc58.green("\u2713")} ${pc58.bold("Upgrade complete!")}
|
|
|
40778
40868
|
}
|
|
40779
40869
|
} else if (upgradeAction === "preset" && newPreset) {
|
|
40780
40870
|
console.log(
|
|
40781
|
-
`Upgraded to ${
|
|
40871
|
+
`Upgraded to ${pc59.cyan(newPreset)} preset (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40782
40872
|
`
|
|
40783
40873
|
);
|
|
40784
40874
|
} else {
|
|
40785
40875
|
console.log(
|
|
40786
|
-
`Updated configuration (${
|
|
40876
|
+
`Updated configuration (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40787
40877
|
`
|
|
40788
40878
|
);
|
|
40789
40879
|
}
|
|
40790
|
-
console.log(
|
|
40880
|
+
console.log(pc59.dim(getSMSCostSummary(updatedConfig, 1e4)));
|
|
40791
40881
|
const enabledFeatures = [];
|
|
40792
40882
|
if (updatedConfig.tracking?.enabled) {
|
|
40793
40883
|
enabledFeatures.push("tracking");
|
|
@@ -40811,7 +40901,7 @@ ${pc58.green("\u2713")} ${pc58.bold("Upgrade complete!")}
|
|
|
40811
40901
|
action: typeof upgradeAction === "string" ? upgradeAction : void 0,
|
|
40812
40902
|
duration_ms: Date.now() - startTime
|
|
40813
40903
|
});
|
|
40814
|
-
|
|
40904
|
+
clack56.outro(pc59.green("Upgrade complete!"));
|
|
40815
40905
|
}
|
|
40816
40906
|
|
|
40817
40907
|
// src/commands/sms/verify-number.ts
|
|
@@ -40830,13 +40920,13 @@ import {
|
|
|
40830
40920
|
SendDestinationNumberVerificationCodeCommand,
|
|
40831
40921
|
VerifyDestinationNumberCommand
|
|
40832
40922
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
40833
|
-
import * as
|
|
40834
|
-
import
|
|
40923
|
+
import * as clack57 from "@clack/prompts";
|
|
40924
|
+
import pc60 from "picocolors";
|
|
40835
40925
|
async function smsVerifyNumber(options) {
|
|
40836
40926
|
const startTime = Date.now();
|
|
40837
40927
|
const progress = new DeploymentProgress();
|
|
40838
40928
|
if (!isJsonMode()) {
|
|
40839
|
-
|
|
40929
|
+
clack57.intro(pc60.bold("Wraps SMS - Verify Destination Number"));
|
|
40840
40930
|
}
|
|
40841
40931
|
const identity = await progress.execute(
|
|
40842
40932
|
"Validating AWS credentials",
|
|
@@ -40846,10 +40936,10 @@ async function smsVerifyNumber(options) {
|
|
|
40846
40936
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40847
40937
|
if (!metadata?.services?.sms) {
|
|
40848
40938
|
progress.stop();
|
|
40849
|
-
|
|
40939
|
+
clack57.log.error("No SMS infrastructure found");
|
|
40850
40940
|
console.log(
|
|
40851
40941
|
`
|
|
40852
|
-
Run ${
|
|
40942
|
+
Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
40853
40943
|
`
|
|
40854
40944
|
);
|
|
40855
40945
|
process.exit(1);
|
|
@@ -40863,19 +40953,19 @@ Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40863
40953
|
);
|
|
40864
40954
|
progress.stop();
|
|
40865
40955
|
if (!response.VerifiedDestinationNumbers || response.VerifiedDestinationNumbers.length === 0) {
|
|
40866
|
-
|
|
40956
|
+
clack57.log.info("No verified destination numbers found");
|
|
40867
40957
|
console.log(
|
|
40868
40958
|
`
|
|
40869
|
-
Run ${
|
|
40959
|
+
Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
|
|
40870
40960
|
`
|
|
40871
40961
|
);
|
|
40872
40962
|
} else {
|
|
40873
40963
|
console.log("\n");
|
|
40874
|
-
|
|
40964
|
+
clack57.log.info(pc60.bold("Verified Destination Numbers:"));
|
|
40875
40965
|
console.log("");
|
|
40876
40966
|
for (const num of response.VerifiedDestinationNumbers) {
|
|
40877
|
-
const status2 = num.Status === "VERIFIED" ?
|
|
40878
|
-
console.log(` ${
|
|
40967
|
+
const status2 = num.Status === "VERIFIED" ? pc60.green("\u2713 Verified") : pc60.yellow("\u29D6 Pending");
|
|
40968
|
+
console.log(` ${pc60.cyan(num.DestinationPhoneNumber)} - ${status2}`);
|
|
40879
40969
|
}
|
|
40880
40970
|
console.log("");
|
|
40881
40971
|
}
|
|
@@ -40893,7 +40983,7 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40893
40983
|
});
|
|
40894
40984
|
return;
|
|
40895
40985
|
}
|
|
40896
|
-
|
|
40986
|
+
clack57.outro(pc60.green("Done!"));
|
|
40897
40987
|
return;
|
|
40898
40988
|
} catch (error) {
|
|
40899
40989
|
progress.stop();
|
|
@@ -40901,7 +40991,7 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40901
40991
|
trackError("SMS_LIST_VERIFIED_FAILED", "sms:verify-number:list", {
|
|
40902
40992
|
error: errorMessage
|
|
40903
40993
|
});
|
|
40904
|
-
|
|
40994
|
+
clack57.log.error(`Failed to list verified numbers: ${errorMessage}`);
|
|
40905
40995
|
process.exit(1);
|
|
40906
40996
|
}
|
|
40907
40997
|
}
|
|
@@ -40909,10 +40999,10 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40909
40999
|
const phoneNumber2 = options.phoneNumber;
|
|
40910
41000
|
if (!phoneNumber2) {
|
|
40911
41001
|
progress.stop();
|
|
40912
|
-
|
|
41002
|
+
clack57.log.error("Phone number is required for deletion");
|
|
40913
41003
|
console.log(
|
|
40914
41004
|
`
|
|
40915
|
-
Usage: ${
|
|
41005
|
+
Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
|
|
40916
41006
|
`
|
|
40917
41007
|
);
|
|
40918
41008
|
process.exit(1);
|
|
@@ -40926,7 +41016,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40926
41016
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
40927
41017
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
40928
41018
|
progress.stop();
|
|
40929
|
-
|
|
41019
|
+
clack57.log.error(`Number ${phoneNumber2} is not in verified list`);
|
|
40930
41020
|
process.exit(1);
|
|
40931
41021
|
}
|
|
40932
41022
|
await progress.execute(`Removing ${phoneNumber2}`, async () => {
|
|
@@ -40937,7 +41027,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40937
41027
|
);
|
|
40938
41028
|
});
|
|
40939
41029
|
progress.stop();
|
|
40940
|
-
|
|
41030
|
+
clack57.log.success(`Removed ${pc60.cyan(phoneNumber2)} from verified list`);
|
|
40941
41031
|
trackCommand("sms:verify-number:delete", {
|
|
40942
41032
|
success: true,
|
|
40943
41033
|
duration_ms: Date.now() - startTime
|
|
@@ -40949,7 +41039,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40949
41039
|
});
|
|
40950
41040
|
return;
|
|
40951
41041
|
}
|
|
40952
|
-
|
|
41042
|
+
clack57.outro(pc60.green("Done!"));
|
|
40953
41043
|
return;
|
|
40954
41044
|
} catch (error) {
|
|
40955
41045
|
progress.stop();
|
|
@@ -40957,7 +41047,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40957
41047
|
trackError("SMS_DELETE_VERIFIED_FAILED", "sms:verify-number:delete", {
|
|
40958
41048
|
error: errorMessage
|
|
40959
41049
|
});
|
|
40960
|
-
|
|
41050
|
+
clack57.log.error(`Failed to delete verified number: ${errorMessage}`);
|
|
40961
41051
|
process.exit(1);
|
|
40962
41052
|
}
|
|
40963
41053
|
}
|
|
@@ -40970,7 +41060,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40970
41060
|
);
|
|
40971
41061
|
}
|
|
40972
41062
|
if (!phoneNumber) {
|
|
40973
|
-
const result = await
|
|
41063
|
+
const result = await clack57.text({
|
|
40974
41064
|
message: "Enter phone number to verify (E.164 format):",
|
|
40975
41065
|
placeholder: "+14155551234",
|
|
40976
41066
|
validate: (value) => {
|
|
@@ -40983,14 +41073,14 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40983
41073
|
return;
|
|
40984
41074
|
}
|
|
40985
41075
|
});
|
|
40986
|
-
if (
|
|
40987
|
-
|
|
41076
|
+
if (clack57.isCancel(result)) {
|
|
41077
|
+
clack57.cancel("Operation cancelled.");
|
|
40988
41078
|
process.exit(0);
|
|
40989
41079
|
}
|
|
40990
41080
|
phoneNumber = result;
|
|
40991
41081
|
} else if (!isValidPhoneNumber(phoneNumber)) {
|
|
40992
41082
|
progress.stop();
|
|
40993
|
-
|
|
41083
|
+
clack57.log.error(
|
|
40994
41084
|
`Invalid phone number format: ${phoneNumber}. Use E.164 format (e.g., +14155551234)`
|
|
40995
41085
|
);
|
|
40996
41086
|
process.exit(1);
|
|
@@ -41005,7 +41095,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41005
41095
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41006
41096
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41007
41097
|
progress.stop();
|
|
41008
|
-
|
|
41098
|
+
clack57.log.error(
|
|
41009
41099
|
`Number ${phoneNumber} not found. Run without --code first.`
|
|
41010
41100
|
);
|
|
41011
41101
|
process.exit(1);
|
|
@@ -41020,12 +41110,12 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41020
41110
|
});
|
|
41021
41111
|
progress.stop();
|
|
41022
41112
|
console.log("\n");
|
|
41023
|
-
|
|
41024
|
-
|
|
41113
|
+
clack57.log.success(
|
|
41114
|
+
pc60.green(`Phone number ${pc60.cyan(phoneNumber)} verified!`)
|
|
41025
41115
|
);
|
|
41026
41116
|
console.log("");
|
|
41027
41117
|
console.log(
|
|
41028
|
-
`You can now send test messages to this number with ${
|
|
41118
|
+
`You can now send test messages to this number with ${pc60.cyan("wraps sms test")}`
|
|
41029
41119
|
);
|
|
41030
41120
|
trackCommand("sms:verify-number:confirm", {
|
|
41031
41121
|
success: true,
|
|
@@ -41038,23 +41128,23 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41038
41128
|
});
|
|
41039
41129
|
return;
|
|
41040
41130
|
}
|
|
41041
|
-
|
|
41131
|
+
clack57.outro(pc60.green("Verification complete!"));
|
|
41042
41132
|
return;
|
|
41043
41133
|
} catch (error) {
|
|
41044
41134
|
progress.stop();
|
|
41045
41135
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41046
41136
|
if (errorMessage.includes("Invalid verification code")) {
|
|
41047
|
-
|
|
41137
|
+
clack57.log.error("Invalid verification code. Please try again.");
|
|
41048
41138
|
console.log(
|
|
41049
41139
|
`
|
|
41050
|
-
Run ${
|
|
41140
|
+
Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41051
41141
|
`
|
|
41052
41142
|
);
|
|
41053
41143
|
} else {
|
|
41054
41144
|
trackError("SMS_VERIFY_CODE_FAILED", "sms:verify-number:confirm", {
|
|
41055
41145
|
error: errorMessage
|
|
41056
41146
|
});
|
|
41057
|
-
|
|
41147
|
+
clack57.log.error(`Verification failed: ${errorMessage}`);
|
|
41058
41148
|
}
|
|
41059
41149
|
process.exit(1);
|
|
41060
41150
|
}
|
|
@@ -41069,7 +41159,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41069
41159
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41070
41160
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41071
41161
|
progress.stop();
|
|
41072
|
-
|
|
41162
|
+
clack57.log.error(
|
|
41073
41163
|
`Number ${phoneNumber} not found. Run without --resend first.`
|
|
41074
41164
|
);
|
|
41075
41165
|
process.exit(1);
|
|
@@ -41083,11 +41173,11 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41083
41173
|
);
|
|
41084
41174
|
});
|
|
41085
41175
|
progress.stop();
|
|
41086
|
-
|
|
41176
|
+
clack57.log.success(`Verification code resent to ${pc60.cyan(phoneNumber)}`);
|
|
41087
41177
|
console.log("");
|
|
41088
41178
|
console.log(
|
|
41089
41179
|
`Once you receive the code, run:
|
|
41090
|
-
${
|
|
41180
|
+
${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41091
41181
|
);
|
|
41092
41182
|
trackCommand("sms:verify-number:resend", {
|
|
41093
41183
|
success: true,
|
|
@@ -41100,7 +41190,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41100
41190
|
});
|
|
41101
41191
|
return;
|
|
41102
41192
|
}
|
|
41103
|
-
|
|
41193
|
+
clack57.outro(pc60.green("Code sent!"));
|
|
41104
41194
|
return;
|
|
41105
41195
|
} catch (error) {
|
|
41106
41196
|
progress.stop();
|
|
@@ -41108,7 +41198,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41108
41198
|
trackError("SMS_RESEND_CODE_FAILED", "sms:verify-number:resend", {
|
|
41109
41199
|
error: errorMessage
|
|
41110
41200
|
});
|
|
41111
|
-
|
|
41201
|
+
clack57.log.error(`Failed to resend code: ${errorMessage}`);
|
|
41112
41202
|
process.exit(1);
|
|
41113
41203
|
}
|
|
41114
41204
|
}
|
|
@@ -41128,10 +41218,10 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41128
41218
|
});
|
|
41129
41219
|
return;
|
|
41130
41220
|
}
|
|
41131
|
-
|
|
41132
|
-
`Number ${
|
|
41221
|
+
clack57.log.info(
|
|
41222
|
+
`Number ${pc60.cyan(phoneNumber)} is already verified and ready to use!`
|
|
41133
41223
|
);
|
|
41134
|
-
|
|
41224
|
+
clack57.outro(pc60.green("Done!"));
|
|
41135
41225
|
return;
|
|
41136
41226
|
}
|
|
41137
41227
|
if (existingNumber?.Status === "PENDING") {
|
|
@@ -41155,15 +41245,15 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41155
41245
|
});
|
|
41156
41246
|
return;
|
|
41157
41247
|
}
|
|
41158
|
-
|
|
41159
|
-
`Verification already in progress. New code sent to ${
|
|
41248
|
+
clack57.log.info(
|
|
41249
|
+
`Verification already in progress. New code sent to ${pc60.cyan(phoneNumber)}`
|
|
41160
41250
|
);
|
|
41161
41251
|
console.log("");
|
|
41162
41252
|
console.log(
|
|
41163
41253
|
`Once you receive the code, run:
|
|
41164
|
-
${
|
|
41254
|
+
${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41165
41255
|
);
|
|
41166
|
-
|
|
41256
|
+
clack57.outro(pc60.green("Code sent!"));
|
|
41167
41257
|
return;
|
|
41168
41258
|
}
|
|
41169
41259
|
const createResponse = await progress.execute(
|
|
@@ -41184,18 +41274,18 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41184
41274
|
});
|
|
41185
41275
|
progress.stop();
|
|
41186
41276
|
console.log("\n");
|
|
41187
|
-
|
|
41188
|
-
`Verification code sent to ${
|
|
41277
|
+
clack57.log.success(
|
|
41278
|
+
`Verification code sent to ${pc60.cyan(phoneNumber)} via SMS`
|
|
41189
41279
|
);
|
|
41190
41280
|
console.log("");
|
|
41191
|
-
|
|
41281
|
+
clack57.note(
|
|
41192
41282
|
[
|
|
41193
41283
|
"1. Check your phone for the verification code",
|
|
41194
41284
|
"",
|
|
41195
41285
|
"2. Complete verification with:",
|
|
41196
|
-
` ${
|
|
41286
|
+
` ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
|
|
41197
41287
|
"",
|
|
41198
|
-
|
|
41288
|
+
pc60.dim("The code expires in 24 hours")
|
|
41199
41289
|
].join("\n"),
|
|
41200
41290
|
"Next Steps"
|
|
41201
41291
|
);
|
|
@@ -41211,22 +41301,22 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41211
41301
|
});
|
|
41212
41302
|
return;
|
|
41213
41303
|
}
|
|
41214
|
-
|
|
41304
|
+
clack57.outro(pc60.green("Verification started!"));
|
|
41215
41305
|
} catch (error) {
|
|
41216
41306
|
progress.stop();
|
|
41217
41307
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41218
41308
|
if (errorMessage.includes("already exists")) {
|
|
41219
|
-
|
|
41309
|
+
clack57.log.error("This number is already being verified");
|
|
41220
41310
|
console.log(
|
|
41221
41311
|
`
|
|
41222
|
-
Run ${
|
|
41312
|
+
Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41223
41313
|
`
|
|
41224
41314
|
);
|
|
41225
41315
|
} else {
|
|
41226
41316
|
trackError("SMS_CREATE_VERIFIED_FAILED", "sms:verify-number:start", {
|
|
41227
41317
|
error: errorMessage
|
|
41228
41318
|
});
|
|
41229
|
-
|
|
41319
|
+
clack57.log.error(`Failed to start verification: ${errorMessage}`);
|
|
41230
41320
|
}
|
|
41231
41321
|
process.exit(1);
|
|
41232
41322
|
}
|
|
@@ -41235,98 +41325,98 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41235
41325
|
// src/commands/support.ts
|
|
41236
41326
|
init_esm_shims();
|
|
41237
41327
|
init_events();
|
|
41238
|
-
import * as
|
|
41239
|
-
import
|
|
41328
|
+
import * as clack58 from "@clack/prompts";
|
|
41329
|
+
import pc61 from "picocolors";
|
|
41240
41330
|
async function support() {
|
|
41241
41331
|
trackCommand("support", { success: true });
|
|
41242
|
-
|
|
41332
|
+
clack58.intro(pc61.bold("Get Help with Wraps"));
|
|
41243
41333
|
console.log();
|
|
41244
|
-
console.log(` ${
|
|
41334
|
+
console.log(` ${pc61.bold("Email:")} ${pc61.cyan("hey@wraps.sh")}`);
|
|
41245
41335
|
console.log(
|
|
41246
|
-
` ${
|
|
41336
|
+
` ${pc61.bold("GitHub:")} ${pc61.cyan("https://github.com/wraps-dev/wraps/issues")}`
|
|
41247
41337
|
);
|
|
41248
|
-
console.log(` ${
|
|
41338
|
+
console.log(` ${pc61.bold("Docs:")} ${pc61.cyan("https://wraps.dev/docs")}`);
|
|
41249
41339
|
console.log();
|
|
41250
|
-
console.log(
|
|
41340
|
+
console.log(pc61.dim(" Response time: Usually within 24 hours"));
|
|
41251
41341
|
console.log();
|
|
41252
41342
|
}
|
|
41253
41343
|
|
|
41254
41344
|
// src/commands/telemetry.ts
|
|
41255
41345
|
init_esm_shims();
|
|
41256
41346
|
init_client();
|
|
41257
|
-
import * as
|
|
41258
|
-
import
|
|
41347
|
+
import * as clack59 from "@clack/prompts";
|
|
41348
|
+
import pc62 from "picocolors";
|
|
41259
41349
|
async function telemetryEnable() {
|
|
41260
41350
|
const client = getTelemetryClient();
|
|
41261
41351
|
const override = client.enable();
|
|
41262
41352
|
if (override) {
|
|
41263
|
-
|
|
41353
|
+
clack59.log.warn(
|
|
41264
41354
|
"Telemetry enabled in config, but overridden by environment"
|
|
41265
41355
|
);
|
|
41266
|
-
console.log(` Reason: ${
|
|
41267
|
-
console.log(` Config: ${
|
|
41356
|
+
console.log(` Reason: ${pc62.yellow(override)}`);
|
|
41357
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41268
41358
|
console.log();
|
|
41269
41359
|
} else {
|
|
41270
|
-
|
|
41271
|
-
console.log(` Config: ${
|
|
41360
|
+
clack59.log.success(pc62.green("Telemetry enabled"));
|
|
41361
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41272
41362
|
console.log(`
|
|
41273
|
-
${
|
|
41363
|
+
${pc62.dim("Thank you for helping improve Wraps!")}
|
|
41274
41364
|
`);
|
|
41275
41365
|
}
|
|
41276
41366
|
}
|
|
41277
41367
|
async function telemetryDisable() {
|
|
41278
41368
|
const client = getTelemetryClient();
|
|
41279
41369
|
client.disable();
|
|
41280
|
-
|
|
41281
|
-
console.log(` Config: ${
|
|
41370
|
+
clack59.log.success(pc62.green("Telemetry disabled"));
|
|
41371
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41282
41372
|
console.log(
|
|
41283
41373
|
`
|
|
41284
|
-
${
|
|
41374
|
+
${pc62.dim("You can re-enable with:")} wraps telemetry enable
|
|
41285
41375
|
`
|
|
41286
41376
|
);
|
|
41287
41377
|
}
|
|
41288
41378
|
async function telemetryStatus() {
|
|
41289
41379
|
const client = getTelemetryClient();
|
|
41290
|
-
|
|
41380
|
+
clack59.intro(pc62.bold("Telemetry Status"));
|
|
41291
41381
|
const override = client.getEnvOverride();
|
|
41292
|
-
const status2 = client.isEnabled() ?
|
|
41382
|
+
const status2 = client.isEnabled() ? pc62.green("Enabled") : pc62.red("Disabled");
|
|
41293
41383
|
console.log();
|
|
41294
|
-
console.log(` ${
|
|
41384
|
+
console.log(` ${pc62.bold("Status:")} ${status2}`);
|
|
41295
41385
|
if (!client.isEnabled() && override) {
|
|
41296
|
-
console.log(` ${
|
|
41386
|
+
console.log(` ${pc62.bold("Reason:")} ${pc62.yellow(override)}`);
|
|
41297
41387
|
}
|
|
41298
|
-
console.log(` ${
|
|
41388
|
+
console.log(` ${pc62.bold("Config file:")} ${pc62.dim(client.getConfigPath())}`);
|
|
41299
41389
|
if (client.isEnabled()) {
|
|
41300
41390
|
console.log();
|
|
41301
|
-
console.log(
|
|
41302
|
-
console.log(` ${
|
|
41391
|
+
console.log(pc62.bold(" How to opt-out:"));
|
|
41392
|
+
console.log(` ${pc62.cyan("wraps telemetry disable")}`);
|
|
41303
41393
|
console.log(
|
|
41304
|
-
` ${
|
|
41394
|
+
` ${pc62.dim("Or set:")} ${pc62.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
|
|
41305
41395
|
);
|
|
41306
|
-
console.log(` ${
|
|
41396
|
+
console.log(` ${pc62.dim("Or set:")} ${pc62.cyan("DO_NOT_TRACK=1")}`);
|
|
41307
41397
|
} else {
|
|
41308
41398
|
console.log();
|
|
41309
|
-
console.log(
|
|
41310
|
-
console.log(` ${
|
|
41399
|
+
console.log(pc62.bold(" How to opt-in:"));
|
|
41400
|
+
console.log(` ${pc62.cyan("wraps telemetry enable")}`);
|
|
41311
41401
|
}
|
|
41312
41402
|
console.log();
|
|
41313
|
-
console.log(
|
|
41403
|
+
console.log(pc62.bold(" Debug mode:"));
|
|
41314
41404
|
console.log(
|
|
41315
|
-
` ${
|
|
41405
|
+
` ${pc62.dim("See what would be sent:")} ${pc62.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
|
|
41316
41406
|
);
|
|
41317
41407
|
console.log();
|
|
41318
41408
|
console.log(
|
|
41319
|
-
` ${
|
|
41409
|
+
` ${pc62.dim("Learn more:")} ${pc62.cyan("https://wraps.dev/docs/telemetry")}`
|
|
41320
41410
|
);
|
|
41321
41411
|
console.log();
|
|
41322
41412
|
}
|
|
41323
41413
|
|
|
41324
41414
|
// src/commands/workflow/init.ts
|
|
41325
41415
|
init_esm_shims();
|
|
41326
|
-
import { existsSync as
|
|
41416
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
41327
41417
|
import { join as join22 } from "path";
|
|
41328
|
-
import * as
|
|
41329
|
-
import
|
|
41418
|
+
import * as clack60 from "@clack/prompts";
|
|
41419
|
+
import pc63 from "picocolors";
|
|
41330
41420
|
var EXAMPLE_CASCADE_WORKFLOW = `import {
|
|
41331
41421
|
defineWorkflow,
|
|
41332
41422
|
sendEmail,
|
|
@@ -41421,30 +41511,30 @@ export default defineConfig({
|
|
|
41421
41511
|
});
|
|
41422
41512
|
`;
|
|
41423
41513
|
async function workflowInit(options = {}) {
|
|
41424
|
-
|
|
41514
|
+
clack60.intro(pc63.bgCyan(pc63.black(" wraps workflow init ")));
|
|
41425
41515
|
const wrapsDir = join22(process.cwd(), "wraps");
|
|
41426
41516
|
const workflowsDir = join22(wrapsDir, "workflows");
|
|
41427
41517
|
const configPath = join22(wrapsDir, "wraps.config.ts");
|
|
41428
|
-
if (
|
|
41429
|
-
|
|
41430
|
-
`Workflows directory already exists at ${
|
|
41518
|
+
if (existsSync20(workflowsDir)) {
|
|
41519
|
+
clack60.log.info(
|
|
41520
|
+
`Workflows directory already exists at ${pc63.cyan("wraps/workflows/")}`
|
|
41431
41521
|
);
|
|
41432
|
-
const files =
|
|
41522
|
+
const files = existsSync20(join22(workflowsDir, "cart-recovery.ts")) || existsSync20(join22(workflowsDir, "welcome-sequence.ts"));
|
|
41433
41523
|
if (files && !options.yes) {
|
|
41434
|
-
const shouldContinue = await
|
|
41524
|
+
const shouldContinue = await clack60.confirm({
|
|
41435
41525
|
message: "Example files may already exist. Overwrite them?",
|
|
41436
41526
|
initialValue: false
|
|
41437
41527
|
});
|
|
41438
|
-
if (
|
|
41439
|
-
|
|
41528
|
+
if (clack60.isCancel(shouldContinue) || !shouldContinue) {
|
|
41529
|
+
clack60.log.info("Skipping file creation.");
|
|
41440
41530
|
showNextSteps2();
|
|
41441
|
-
|
|
41531
|
+
clack60.outro("Done!");
|
|
41442
41532
|
return;
|
|
41443
41533
|
}
|
|
41444
41534
|
}
|
|
41445
41535
|
}
|
|
41446
41536
|
try {
|
|
41447
|
-
const s =
|
|
41537
|
+
const s = clack60.spinner();
|
|
41448
41538
|
s.start("Creating workflows directory...");
|
|
41449
41539
|
mkdirSync2(workflowsDir, { recursive: true });
|
|
41450
41540
|
s.stop("Created wraps/workflows/");
|
|
@@ -41460,36 +41550,36 @@ async function workflowInit(options = {}) {
|
|
|
41460
41550
|
"utf-8"
|
|
41461
41551
|
);
|
|
41462
41552
|
s.stop("Created 2 example workflows");
|
|
41463
|
-
if (!
|
|
41553
|
+
if (!existsSync20(configPath)) {
|
|
41464
41554
|
writeFileSync(configPath, EXAMPLE_CONFIG, "utf-8");
|
|
41465
|
-
|
|
41555
|
+
clack60.log.info(`Created ${pc63.cyan("wraps/wraps.config.ts")}`);
|
|
41466
41556
|
}
|
|
41467
|
-
|
|
41468
|
-
`${
|
|
41469
|
-
${
|
|
41470
|
-
${
|
|
41471
|
-
${
|
|
41557
|
+
clack60.log.success(
|
|
41558
|
+
`${pc63.bold("Workflows scaffolded!")} Created:
|
|
41559
|
+
${pc63.cyan("wraps/wraps.config.ts")} \u2014 Project config
|
|
41560
|
+
${pc63.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
|
|
41561
|
+
${pc63.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
|
|
41472
41562
|
);
|
|
41473
41563
|
showNextSteps2();
|
|
41474
|
-
|
|
41564
|
+
clack60.outro(pc63.green("Happy orchestrating!"));
|
|
41475
41565
|
} catch (error) {
|
|
41476
|
-
|
|
41566
|
+
clack60.log.error(
|
|
41477
41567
|
`Failed to scaffold workflows: ${error instanceof Error ? error.message : String(error)}`
|
|
41478
41568
|
);
|
|
41479
|
-
|
|
41569
|
+
clack60.outro(pc63.red("Scaffolding failed."));
|
|
41480
41570
|
process.exitCode = 1;
|
|
41481
41571
|
}
|
|
41482
41572
|
}
|
|
41483
41573
|
function showNextSteps2() {
|
|
41484
|
-
|
|
41485
|
-
`${
|
|
41574
|
+
clack60.log.info(
|
|
41575
|
+
`${pc63.bold("Next steps:")}
|
|
41486
41576
|
|
|
41487
|
-
1. Edit ${
|
|
41488
|
-
2. Edit your workflows in ${
|
|
41489
|
-
3. Validate: ${
|
|
41490
|
-
4. Push: ${
|
|
41577
|
+
1. Edit ${pc63.cyan("wraps/wraps.config.ts")} with your org slug and domain
|
|
41578
|
+
2. Edit your workflows in ${pc63.cyan("wraps/workflows/")}
|
|
41579
|
+
3. Validate: ${pc63.cyan("wraps email workflows validate")}
|
|
41580
|
+
4. Push: ${pc63.cyan("wraps email workflows push")}
|
|
41491
41581
|
|
|
41492
|
-
${
|
|
41582
|
+
${pc63.dim("Docs:")} ${pc63.underline("https://wraps.dev/docs/guides/orchestration")}`
|
|
41493
41583
|
);
|
|
41494
41584
|
}
|
|
41495
41585
|
|
|
@@ -41524,6 +41614,7 @@ var STRING_FLAGS = [
|
|
|
41524
41614
|
"subdomain",
|
|
41525
41615
|
"tier",
|
|
41526
41616
|
"expires",
|
|
41617
|
+
"database-url",
|
|
41527
41618
|
"neon-api-key",
|
|
41528
41619
|
"neon-org-id",
|
|
41529
41620
|
"license-key",
|
|
@@ -41672,7 +41763,7 @@ if (nodeMajorVersion < 20) {
|
|
|
41672
41763
|
process.exit(1);
|
|
41673
41764
|
}
|
|
41674
41765
|
var __filename4 = fileURLToPath8(import.meta.url);
|
|
41675
|
-
var __dirname3 =
|
|
41766
|
+
var __dirname3 = dirname7(__filename4);
|
|
41676
41767
|
var packageJson = JSON.parse(
|
|
41677
41768
|
readFileSync3(join24(__dirname3, "../package.json"), "utf-8")
|
|
41678
41769
|
);
|
|
@@ -41683,208 +41774,208 @@ function showVersion() {
|
|
|
41683
41774
|
process.exit(0);
|
|
41684
41775
|
}
|
|
41685
41776
|
function showHelp() {
|
|
41686
|
-
|
|
41777
|
+
clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
|
|
41687
41778
|
console.log("Deploy AWS infrastructure to your account\n");
|
|
41688
41779
|
console.log("Usage: wraps [service] <command> [options]\n");
|
|
41689
41780
|
console.log("Services:");
|
|
41690
|
-
console.log(` ${
|
|
41781
|
+
console.log(` ${pc65.cyan("email")} Email infrastructure (AWS SES)`);
|
|
41691
41782
|
console.log(
|
|
41692
|
-
` ${
|
|
41783
|
+
` ${pc65.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
|
|
41693
41784
|
);
|
|
41694
41785
|
console.log(
|
|
41695
|
-
` ${
|
|
41786
|
+
` ${pc65.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
|
|
41696
41787
|
);
|
|
41697
41788
|
console.log(
|
|
41698
|
-
` ${
|
|
41789
|
+
` ${pc65.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
|
|
41699
41790
|
);
|
|
41700
41791
|
console.log(
|
|
41701
|
-
` ${
|
|
41792
|
+
` ${pc65.cyan("license")} License key management (Wraps team only)
|
|
41702
41793
|
`
|
|
41703
41794
|
);
|
|
41704
41795
|
console.log("Email Commands:");
|
|
41705
41796
|
console.log(
|
|
41706
|
-
` ${
|
|
41797
|
+
` ${pc65.cyan("email init")} Deploy new email infrastructure`
|
|
41707
41798
|
);
|
|
41708
41799
|
console.log(
|
|
41709
|
-
` ${
|
|
41800
|
+
` ${pc65.cyan("email check")} Check email deliverability for a domain`
|
|
41710
41801
|
);
|
|
41711
41802
|
console.log(
|
|
41712
|
-
` ${
|
|
41803
|
+
` ${pc65.cyan("email connect")} Connect to existing AWS SES`
|
|
41713
41804
|
);
|
|
41714
41805
|
console.log(
|
|
41715
|
-
` ${
|
|
41806
|
+
` ${pc65.cyan("email status")} Show email infrastructure details`
|
|
41716
41807
|
);
|
|
41717
|
-
console.log(` ${
|
|
41718
|
-
console.log(` ${
|
|
41808
|
+
console.log(` ${pc65.cyan("email test")} Send a test email`);
|
|
41809
|
+
console.log(` ${pc65.cyan("email verify")} Verify domain DNS records`);
|
|
41719
41810
|
console.log(
|
|
41720
|
-
` ${
|
|
41811
|
+
` ${pc65.cyan("email sync")} Apply CLI updates to infrastructure`
|
|
41721
41812
|
);
|
|
41722
|
-
console.log(` ${
|
|
41813
|
+
console.log(` ${pc65.cyan("email upgrade")} Add features`);
|
|
41723
41814
|
console.log(
|
|
41724
|
-
` ${
|
|
41815
|
+
` ${pc65.cyan("email restore")} Restore original configuration`
|
|
41725
41816
|
);
|
|
41726
41817
|
console.log(
|
|
41727
|
-
` ${
|
|
41818
|
+
` ${pc65.cyan("email destroy")} Remove email infrastructure`
|
|
41728
41819
|
);
|
|
41729
41820
|
console.log(
|
|
41730
|
-
` ${
|
|
41821
|
+
` ${pc65.cyan("email doctor")} Diagnose and clean up email infrastructure`
|
|
41731
41822
|
);
|
|
41732
|
-
console.log(` ${
|
|
41733
|
-
console.log(` ${
|
|
41734
|
-
console.log(` ${
|
|
41823
|
+
console.log(` ${pc65.cyan("email domains add")} Add a domain to SES`);
|
|
41824
|
+
console.log(` ${pc65.cyan("email domains list")} List all domains`);
|
|
41825
|
+
console.log(` ${pc65.cyan("email domains remove")} Remove a domain`);
|
|
41735
41826
|
console.log(
|
|
41736
|
-
` ${
|
|
41827
|
+
` ${pc65.cyan("email inbound init")} Enable inbound email receiving`
|
|
41737
41828
|
);
|
|
41738
|
-
console.log(` ${
|
|
41829
|
+
console.log(` ${pc65.cyan("email inbound status")} Show inbound email status`);
|
|
41739
41830
|
console.log(
|
|
41740
|
-
` ${
|
|
41831
|
+
` ${pc65.cyan("email inbound verify")} Verify inbound DNS records`
|
|
41741
41832
|
);
|
|
41742
41833
|
console.log(
|
|
41743
|
-
` ${
|
|
41834
|
+
` ${pc65.cyan("email inbound test")} Send test email and verify receipt`
|
|
41744
41835
|
);
|
|
41745
41836
|
console.log(
|
|
41746
|
-
` ${
|
|
41837
|
+
` ${pc65.cyan("email inbound destroy")} Remove inbound email infrastructure
|
|
41747
41838
|
`
|
|
41748
41839
|
);
|
|
41749
41840
|
console.log("Template Commands:");
|
|
41750
41841
|
console.log(
|
|
41751
|
-
` ${
|
|
41842
|
+
` ${pc65.cyan("email templates init")} Initialize templates-as-code`
|
|
41752
41843
|
);
|
|
41753
41844
|
console.log(
|
|
41754
|
-
` ${
|
|
41845
|
+
` ${pc65.cyan("email templates push")} Push templates to SES + dashboard`
|
|
41755
41846
|
);
|
|
41756
41847
|
console.log(
|
|
41757
|
-
` ${
|
|
41848
|
+
` ${pc65.cyan("email templates preview")} Preview templates in browser`
|
|
41758
41849
|
);
|
|
41759
41850
|
console.log(
|
|
41760
|
-
` ${
|
|
41851
|
+
` ${pc65.cyan("push")} ${pc65.dim("(alias for email templates push)")}
|
|
41761
41852
|
`
|
|
41762
41853
|
);
|
|
41763
41854
|
console.log("Workflow Commands:");
|
|
41764
41855
|
console.log(
|
|
41765
|
-
` ${
|
|
41856
|
+
` ${pc65.cyan("email workflows init")} Initialize workflows-as-code`
|
|
41766
41857
|
);
|
|
41767
41858
|
console.log(
|
|
41768
|
-
` ${
|
|
41859
|
+
` ${pc65.cyan("email workflows validate")} Validate workflow files`
|
|
41769
41860
|
);
|
|
41770
41861
|
console.log(
|
|
41771
|
-
` ${
|
|
41862
|
+
` ${pc65.cyan("email workflows push")} Push workflows to dashboard
|
|
41772
41863
|
`
|
|
41773
41864
|
);
|
|
41774
41865
|
console.log("SMS Commands:");
|
|
41775
|
-
console.log(` ${
|
|
41866
|
+
console.log(` ${pc65.cyan("sms init")} Deploy SMS infrastructure`);
|
|
41776
41867
|
console.log(
|
|
41777
|
-
` ${
|
|
41868
|
+
` ${pc65.cyan("sms status")} Show SMS infrastructure details`
|
|
41778
41869
|
);
|
|
41779
|
-
console.log(` ${
|
|
41870
|
+
console.log(` ${pc65.cyan("sms test")} Send a test SMS message`);
|
|
41780
41871
|
console.log(
|
|
41781
|
-
` ${
|
|
41872
|
+
` ${pc65.cyan("sms verify-number")} Verify a destination phone number`
|
|
41782
41873
|
);
|
|
41783
41874
|
console.log(
|
|
41784
|
-
` ${
|
|
41875
|
+
` ${pc65.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
|
|
41785
41876
|
);
|
|
41786
|
-
console.log(` ${
|
|
41787
|
-
console.log(` ${
|
|
41877
|
+
console.log(` ${pc65.cyan("sms upgrade")} Upgrade SMS features`);
|
|
41878
|
+
console.log(` ${pc65.cyan("sms register")} Register toll-free number`);
|
|
41788
41879
|
console.log(
|
|
41789
|
-
` ${
|
|
41880
|
+
` ${pc65.cyan("sms destroy")} Remove SMS infrastructure
|
|
41790
41881
|
`
|
|
41791
41882
|
);
|
|
41792
41883
|
console.log("CDN Commands:");
|
|
41793
41884
|
console.log(
|
|
41794
|
-
` ${
|
|
41885
|
+
` ${pc65.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
|
|
41795
41886
|
);
|
|
41796
41887
|
console.log(
|
|
41797
|
-
` ${
|
|
41888
|
+
` ${pc65.cyan("cdn status")} Show CDN infrastructure details`
|
|
41798
41889
|
);
|
|
41799
41890
|
console.log(
|
|
41800
|
-
` ${
|
|
41891
|
+
` ${pc65.cyan("cdn verify")} Check DNS and certificate status`
|
|
41801
41892
|
);
|
|
41802
41893
|
console.log(
|
|
41803
|
-
` ${
|
|
41894
|
+
` ${pc65.cyan("cdn upgrade")} Add custom domain after cert validation`
|
|
41804
41895
|
);
|
|
41805
41896
|
console.log(
|
|
41806
|
-
` ${
|
|
41897
|
+
` ${pc65.cyan("cdn sync")} Sync infrastructure with current config`
|
|
41807
41898
|
);
|
|
41808
41899
|
console.log(
|
|
41809
|
-
` ${
|
|
41900
|
+
` ${pc65.cyan("cdn destroy")} Remove CDN infrastructure
|
|
41810
41901
|
`
|
|
41811
41902
|
);
|
|
41812
41903
|
console.log("Self-Hosted Commands:");
|
|
41813
41904
|
console.log(
|
|
41814
|
-
` ${
|
|
41905
|
+
` ${pc65.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
|
|
41815
41906
|
);
|
|
41816
41907
|
console.log(
|
|
41817
|
-
` ${
|
|
41908
|
+
` ${pc65.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
|
|
41818
41909
|
);
|
|
41819
41910
|
console.log(
|
|
41820
|
-
` ${
|
|
41911
|
+
` ${pc65.cyan("selfhost status")} Show self-hosted deployment details
|
|
41821
41912
|
`
|
|
41822
41913
|
);
|
|
41823
41914
|
console.log("Local Development:");
|
|
41824
41915
|
console.log(
|
|
41825
|
-
` ${
|
|
41916
|
+
` ${pc65.cyan("console")} Start local web console
|
|
41826
41917
|
`
|
|
41827
41918
|
);
|
|
41828
41919
|
console.log("Platform:");
|
|
41829
41920
|
console.log(
|
|
41830
|
-
` ${
|
|
41921
|
+
` ${pc65.cyan("platform")} Show platform info and pricing`
|
|
41831
41922
|
);
|
|
41832
41923
|
console.log(
|
|
41833
|
-
` ${
|
|
41924
|
+
` ${pc65.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
|
|
41834
41925
|
);
|
|
41835
41926
|
console.log(
|
|
41836
|
-
` ${
|
|
41927
|
+
` ${pc65.cyan("platform update-role")} Update platform IAM permissions
|
|
41837
41928
|
`
|
|
41838
41929
|
);
|
|
41839
41930
|
console.log("Auth:");
|
|
41840
41931
|
console.log(
|
|
41841
|
-
` ${
|
|
41932
|
+
` ${pc65.cyan("auth login")} Sign in to wraps.dev (device flow)`
|
|
41842
41933
|
);
|
|
41843
|
-
console.log(` ${
|
|
41934
|
+
console.log(` ${pc65.cyan("auth status")} Show current auth state`);
|
|
41844
41935
|
console.log(
|
|
41845
|
-
` ${
|
|
41936
|
+
` ${pc65.cyan("auth logout")} Sign out and remove stored token
|
|
41846
41937
|
`
|
|
41847
41938
|
);
|
|
41848
41939
|
console.log("AWS Setup:");
|
|
41849
41940
|
console.log(
|
|
41850
|
-
` ${
|
|
41941
|
+
` ${pc65.cyan("aws setup")} Interactive AWS setup wizard`
|
|
41851
41942
|
);
|
|
41852
41943
|
console.log(
|
|
41853
|
-
` ${
|
|
41944
|
+
` ${pc65.cyan("aws doctor")} Diagnose AWS configuration issues
|
|
41854
41945
|
`
|
|
41855
41946
|
);
|
|
41856
41947
|
console.log("Global Commands:");
|
|
41857
|
-
console.log(` ${
|
|
41858
|
-
console.log(` ${
|
|
41859
|
-
console.log(` ${
|
|
41860
|
-
console.log(` ${
|
|
41948
|
+
console.log(` ${pc65.cyan("status")} Show overview of all services`);
|
|
41949
|
+
console.log(` ${pc65.cyan("destroy")} Remove deployed infrastructure`);
|
|
41950
|
+
console.log(` ${pc65.cyan("permissions")} Show required AWS IAM permissions`);
|
|
41951
|
+
console.log(` ${pc65.cyan("completion")} Generate shell completion script`);
|
|
41861
41952
|
console.log(
|
|
41862
|
-
` ${
|
|
41953
|
+
` ${pc65.cyan("telemetry")} Manage anonymous telemetry settings`
|
|
41863
41954
|
);
|
|
41864
|
-
console.log(` ${
|
|
41865
|
-
console.log(` ${
|
|
41955
|
+
console.log(` ${pc65.cyan("update")} Update CLI to latest version`);
|
|
41956
|
+
console.log(` ${pc65.cyan("news")} Show recent Wraps updates`);
|
|
41866
41957
|
console.log(
|
|
41867
|
-
` ${
|
|
41958
|
+
` ${pc65.cyan("support")} Get help and support contact info
|
|
41868
41959
|
`
|
|
41869
41960
|
);
|
|
41870
41961
|
console.log("Options:");
|
|
41871
41962
|
console.log(
|
|
41872
|
-
` ${
|
|
41873
|
-
);
|
|
41874
|
-
console.log(` ${
|
|
41875
|
-
console.log(` ${
|
|
41876
|
-
console.log(` ${
|
|
41877
|
-
console.log(` ${
|
|
41878
|
-
console.log(` ${
|
|
41879
|
-
console.log(` ${
|
|
41880
|
-
console.log(` ${
|
|
41963
|
+
` ${pc65.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
|
|
41964
|
+
);
|
|
41965
|
+
console.log(` ${pc65.dim("-r, --region")} AWS region`);
|
|
41966
|
+
console.log(` ${pc65.dim("-d, --domain")} Domain name`);
|
|
41967
|
+
console.log(` ${pc65.dim("--account")} AWS account ID or alias`);
|
|
41968
|
+
console.log(` ${pc65.dim("--preset")} Configuration preset`);
|
|
41969
|
+
console.log(` ${pc65.dim("--token")} API key or token for auth`);
|
|
41970
|
+
console.log(` ${pc65.dim("-y, --yes")} Skip confirmation prompts`);
|
|
41971
|
+
console.log(` ${pc65.dim("-f, --force")} Force destructive operations`);
|
|
41881
41972
|
console.log(
|
|
41882
|
-
` ${
|
|
41973
|
+
` ${pc65.dim("--preview")} Preview changes without deploying`
|
|
41883
41974
|
);
|
|
41884
|
-
console.log(` ${
|
|
41975
|
+
console.log(` ${pc65.dim("-v, --version")} Show version number
|
|
41885
41976
|
`);
|
|
41886
41977
|
console.log(
|
|
41887
|
-
`Run ${
|
|
41978
|
+
`Run ${pc65.cyan("wraps <service> <command> --help")} for more information.
|
|
41888
41979
|
`
|
|
41889
41980
|
);
|
|
41890
41981
|
}
|
|
@@ -41906,27 +41997,27 @@ if (!primaryCommand) {
|
|
|
41906
41997
|
const telemetry = getTelemetryClient();
|
|
41907
41998
|
if (telemetry.shouldShowNotification()) {
|
|
41908
41999
|
console.log();
|
|
41909
|
-
|
|
42000
|
+
clack61.log.info(pc65.bold("Anonymous Telemetry"));
|
|
41910
42001
|
console.log(
|
|
41911
|
-
` Wraps collects ${
|
|
42002
|
+
` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
|
|
41912
42003
|
);
|
|
41913
42004
|
console.log(
|
|
41914
|
-
` We ${
|
|
42005
|
+
` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
41915
42006
|
);
|
|
41916
42007
|
console.log(
|
|
41917
|
-
` We ${
|
|
42008
|
+
` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
41918
42009
|
);
|
|
41919
42010
|
console.log();
|
|
41920
|
-
console.log(` Opt-out anytime: ${
|
|
41921
|
-
console.log(` Or set: ${
|
|
41922
|
-
console.log(` Learn more: ${
|
|
42011
|
+
console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
|
|
42012
|
+
console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42013
|
+
console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
|
|
41923
42014
|
console.log();
|
|
41924
42015
|
telemetry.markNotificationShown();
|
|
41925
42016
|
}
|
|
41926
42017
|
trackCommand("interactive:menu", { success: true, duration_ms: 0 });
|
|
41927
|
-
|
|
42018
|
+
clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
|
|
41928
42019
|
console.log(" Deploy AWS infrastructure to your account.\n");
|
|
41929
|
-
const action = await
|
|
42020
|
+
const action = await clack61.select({
|
|
41930
42021
|
message: "What would you like to do?",
|
|
41931
42022
|
options: [
|
|
41932
42023
|
{
|
|
@@ -41976,13 +42067,13 @@ if (!primaryCommand) {
|
|
|
41976
42067
|
}
|
|
41977
42068
|
]
|
|
41978
42069
|
});
|
|
41979
|
-
if (
|
|
42070
|
+
if (clack61.isCancel(action)) {
|
|
41980
42071
|
trackCommand("interactive:cancel", {
|
|
41981
42072
|
success: true,
|
|
41982
42073
|
duration_ms: Date.now() - startTime
|
|
41983
42074
|
});
|
|
41984
42075
|
await telemetry.shutdown();
|
|
41985
|
-
|
|
42076
|
+
clack61.cancel("Operation cancelled.");
|
|
41986
42077
|
process.exit(0);
|
|
41987
42078
|
}
|
|
41988
42079
|
trackCommand(`interactive:${action}`, {
|
|
@@ -42062,20 +42153,20 @@ async function run() {
|
|
|
42062
42153
|
const telemetry = getTelemetryClient();
|
|
42063
42154
|
if (telemetry.shouldShowNotification()) {
|
|
42064
42155
|
console.log();
|
|
42065
|
-
|
|
42156
|
+
clack61.log.info(pc65.bold("Anonymous Telemetry"));
|
|
42066
42157
|
console.log(
|
|
42067
|
-
` Wraps collects ${
|
|
42158
|
+
` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
|
|
42068
42159
|
);
|
|
42069
42160
|
console.log(
|
|
42070
|
-
` We ${
|
|
42161
|
+
` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42071
42162
|
);
|
|
42072
42163
|
console.log(
|
|
42073
|
-
` We ${
|
|
42164
|
+
` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42074
42165
|
);
|
|
42075
42166
|
console.log();
|
|
42076
|
-
console.log(` Opt-out anytime: ${
|
|
42077
|
-
console.log(` Or set: ${
|
|
42078
|
-
console.log(` Learn more: ${
|
|
42167
|
+
console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
|
|
42168
|
+
console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42169
|
+
console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
|
|
42079
42170
|
console.log();
|
|
42080
42171
|
telemetry.markNotificationShown();
|
|
42081
42172
|
}
|
|
@@ -42159,10 +42250,10 @@ async function run() {
|
|
|
42159
42250
|
break;
|
|
42160
42251
|
case "verify": {
|
|
42161
42252
|
if (!flags.domain) {
|
|
42162
|
-
|
|
42253
|
+
clack61.log.error("--domain flag is required");
|
|
42163
42254
|
console.log(
|
|
42164
42255
|
`
|
|
42165
|
-
Usage: ${
|
|
42256
|
+
Usage: ${pc65.cyan("wraps email verify --domain yourapp.com")}
|
|
42166
42257
|
`
|
|
42167
42258
|
);
|
|
42168
42259
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42234,12 +42325,12 @@ Usage: ${pc64.cyan("wraps email verify --domain yourapp.com")}
|
|
|
42234
42325
|
});
|
|
42235
42326
|
break;
|
|
42236
42327
|
default:
|
|
42237
|
-
|
|
42328
|
+
clack61.log.error(
|
|
42238
42329
|
`Unknown inbound command: ${inboundSubCommand || "(none)"}`
|
|
42239
42330
|
);
|
|
42240
42331
|
console.log(
|
|
42241
42332
|
`
|
|
42242
|
-
Available commands: ${
|
|
42333
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("destroy")}, ${pc65.cyan("status")}, ${pc65.cyan("verify")}, ${pc65.cyan("test")}, ${pc65.cyan("add")}, ${pc65.cyan("remove")}
|
|
42243
42334
|
`
|
|
42244
42335
|
);
|
|
42245
42336
|
throw new Error(
|
|
@@ -42291,12 +42382,12 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("destroy")}, ${pc64.cyan("
|
|
|
42291
42382
|
break;
|
|
42292
42383
|
}
|
|
42293
42384
|
default:
|
|
42294
|
-
|
|
42385
|
+
clack61.log.error(
|
|
42295
42386
|
`Unknown reply command: ${replySubCommand || "(none)"}`
|
|
42296
42387
|
);
|
|
42297
42388
|
console.log(
|
|
42298
42389
|
`
|
|
42299
|
-
Available commands: ${
|
|
42390
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("rotate")}, ${pc65.cyan("status")}, ${pc65.cyan("destroy")}, ${pc65.cyan("decode")}
|
|
42300
42391
|
`
|
|
42301
42392
|
);
|
|
42302
42393
|
throw new Error(
|
|
@@ -42321,10 +42412,10 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("rotate")}, ${pc64.cyan("s
|
|
|
42321
42412
|
break;
|
|
42322
42413
|
case "verify": {
|
|
42323
42414
|
if (!flags.domain) {
|
|
42324
|
-
|
|
42415
|
+
clack61.log.error("--domain flag is required");
|
|
42325
42416
|
console.log(
|
|
42326
42417
|
`
|
|
42327
|
-
Usage: ${
|
|
42418
|
+
Usage: ${pc65.cyan("wraps email domains verify --domain yourapp.com")}
|
|
42328
42419
|
`
|
|
42329
42420
|
);
|
|
42330
42421
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42334,10 +42425,10 @@ Usage: ${pc64.cyan("wraps email domains verify --domain yourapp.com")}
|
|
|
42334
42425
|
}
|
|
42335
42426
|
case "get-dkim": {
|
|
42336
42427
|
if (!flags.domain) {
|
|
42337
|
-
|
|
42428
|
+
clack61.log.error("--domain flag is required");
|
|
42338
42429
|
console.log(
|
|
42339
42430
|
`
|
|
42340
|
-
Usage: ${
|
|
42431
|
+
Usage: ${pc65.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
42341
42432
|
`
|
|
42342
42433
|
);
|
|
42343
42434
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42347,10 +42438,10 @@ Usage: ${pc64.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
|
42347
42438
|
}
|
|
42348
42439
|
case "remove": {
|
|
42349
42440
|
if (!flags.domain) {
|
|
42350
|
-
|
|
42441
|
+
clack61.log.error("--domain flag is required");
|
|
42351
42442
|
console.log(
|
|
42352
42443
|
`
|
|
42353
|
-
Usage: ${
|
|
42444
|
+
Usage: ${pc65.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
42354
42445
|
`
|
|
42355
42446
|
);
|
|
42356
42447
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42380,12 +42471,12 @@ Usage: ${pc64.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
|
42380
42471
|
break;
|
|
42381
42472
|
}
|
|
42382
42473
|
default:
|
|
42383
|
-
|
|
42474
|
+
clack61.log.error(
|
|
42384
42475
|
`Unknown domains command: ${domainsSubCommand || "(none)"}`
|
|
42385
42476
|
);
|
|
42386
42477
|
console.log(
|
|
42387
42478
|
`
|
|
42388
|
-
Available commands: ${
|
|
42479
|
+
Available commands: ${pc65.cyan("add")}, ${pc65.cyan("list")}, ${pc65.cyan("verify")}, ${pc65.cyan("get-dkim")}, ${pc65.cyan("remove")}, ${pc65.cyan("config")}
|
|
42389
42480
|
`
|
|
42390
42481
|
);
|
|
42391
42482
|
throw new Error(
|
|
@@ -42427,12 +42518,12 @@ Available commands: ${pc64.cyan("add")}, ${pc64.cyan("list")}, ${pc64.cyan("veri
|
|
|
42427
42518
|
});
|
|
42428
42519
|
break;
|
|
42429
42520
|
default:
|
|
42430
|
-
|
|
42521
|
+
clack61.log.error(
|
|
42431
42522
|
`Unknown templates command: ${templatesSubCommand || "(none)"}`
|
|
42432
42523
|
);
|
|
42433
42524
|
console.log(
|
|
42434
42525
|
`
|
|
42435
|
-
Available commands: ${
|
|
42526
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("push")}, ${pc65.cyan("preview")}
|
|
42436
42527
|
`
|
|
42437
42528
|
);
|
|
42438
42529
|
throw new Error(
|
|
@@ -42471,12 +42562,12 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("push")}, ${pc64.cyan("pre
|
|
|
42471
42562
|
});
|
|
42472
42563
|
break;
|
|
42473
42564
|
default:
|
|
42474
|
-
|
|
42565
|
+
clack61.log.error(
|
|
42475
42566
|
`Unknown workflows command: ${workflowsSubCommand || "(none)"}`
|
|
42476
42567
|
);
|
|
42477
42568
|
console.log(
|
|
42478
42569
|
`
|
|
42479
|
-
Available commands: ${
|
|
42570
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("validate")}, ${pc65.cyan("push")}
|
|
42480
42571
|
`
|
|
42481
42572
|
);
|
|
42482
42573
|
throw new Error(
|
|
@@ -42501,10 +42592,10 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("validate")}, ${pc64.cyan(
|
|
|
42501
42592
|
});
|
|
42502
42593
|
break;
|
|
42503
42594
|
default:
|
|
42504
|
-
|
|
42595
|
+
clack61.log.error(`Unknown email command: ${subCommand}`);
|
|
42505
42596
|
console.log(
|
|
42506
42597
|
`
|
|
42507
|
-
Run ${
|
|
42598
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42508
42599
|
`
|
|
42509
42600
|
);
|
|
42510
42601
|
throw new Error(`Unknown email command: ${subCommand}`);
|
|
@@ -42529,10 +42620,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42529
42620
|
});
|
|
42530
42621
|
break;
|
|
42531
42622
|
default:
|
|
42532
|
-
|
|
42623
|
+
clack61.log.error(`Unknown license command: ${subCommand}`);
|
|
42533
42624
|
console.log(
|
|
42534
42625
|
`
|
|
42535
|
-
Run ${
|
|
42626
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42536
42627
|
`
|
|
42537
42628
|
);
|
|
42538
42629
|
throw new Error(`Unknown license command: ${subCommand}`);
|
|
@@ -42549,6 +42640,7 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42549
42640
|
case "deploy":
|
|
42550
42641
|
await selfhostDeploy({
|
|
42551
42642
|
region: flags.region,
|
|
42643
|
+
databaseUrl: flags.databaseUrl,
|
|
42552
42644
|
neonApiKey: flags.neonApiKey,
|
|
42553
42645
|
neonOrgId: flags.neonOrgId,
|
|
42554
42646
|
licenseKey: flags.licenseKey,
|
|
@@ -42572,11 +42664,17 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42572
42664
|
json: flags.json
|
|
42573
42665
|
});
|
|
42574
42666
|
break;
|
|
42667
|
+
case "env":
|
|
42668
|
+
await selfhostEnv({
|
|
42669
|
+
region: flags.region,
|
|
42670
|
+
json: flags.json
|
|
42671
|
+
});
|
|
42672
|
+
break;
|
|
42575
42673
|
default:
|
|
42576
|
-
|
|
42674
|
+
clack61.log.error(`Unknown selfhost command: ${subCommand}`);
|
|
42577
42675
|
console.log(
|
|
42578
42676
|
`
|
|
42579
|
-
Run ${
|
|
42677
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42580
42678
|
`
|
|
42581
42679
|
);
|
|
42582
42680
|
throw new Error(`Unknown selfhost command: ${subCommand}`);
|
|
@@ -42656,10 +42754,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42656
42754
|
});
|
|
42657
42755
|
break;
|
|
42658
42756
|
default:
|
|
42659
|
-
|
|
42757
|
+
clack61.log.error(`Unknown sms command: ${subCommand}`);
|
|
42660
42758
|
console.log(
|
|
42661
42759
|
`
|
|
42662
|
-
Run ${
|
|
42760
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42663
42761
|
`
|
|
42664
42762
|
);
|
|
42665
42763
|
throw new Error(`Unknown sms command: ${subCommand}`);
|
|
@@ -42720,10 +42818,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42720
42818
|
});
|
|
42721
42819
|
break;
|
|
42722
42820
|
default:
|
|
42723
|
-
|
|
42821
|
+
clack61.log.error(`Unknown cdn command: ${subCommand}`);
|
|
42724
42822
|
console.log(
|
|
42725
42823
|
`
|
|
42726
|
-
Run ${
|
|
42824
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42727
42825
|
`
|
|
42728
42826
|
);
|
|
42729
42827
|
throw new Error(`Unknown cdn command: ${subCommand}`);
|
|
@@ -42745,13 +42843,13 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42745
42843
|
});
|
|
42746
42844
|
break;
|
|
42747
42845
|
default:
|
|
42748
|
-
|
|
42846
|
+
clack61.log.error(
|
|
42749
42847
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
42750
42848
|
);
|
|
42751
42849
|
console.log(`
|
|
42752
|
-
Available commands: ${
|
|
42850
|
+
Available commands: ${pc65.cyan("init")}
|
|
42753
42851
|
`);
|
|
42754
|
-
console.log(`Run ${
|
|
42852
|
+
console.log(`Run ${pc65.cyan("wraps --help")} for more information.
|
|
42755
42853
|
`);
|
|
42756
42854
|
throw new Error(
|
|
42757
42855
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
@@ -42793,14 +42891,14 @@ Available commands: ${pc64.cyan("init")}
|
|
|
42793
42891
|
});
|
|
42794
42892
|
break;
|
|
42795
42893
|
default:
|
|
42796
|
-
|
|
42894
|
+
clack61.log.error(`Unknown platform command: ${subCommand}`);
|
|
42797
42895
|
console.log(
|
|
42798
42896
|
`
|
|
42799
|
-
Available commands: ${
|
|
42897
|
+
Available commands: ${pc65.cyan("connect")}, ${pc65.cyan("update-role")}
|
|
42800
42898
|
`
|
|
42801
42899
|
);
|
|
42802
42900
|
console.log(
|
|
42803
|
-
`Run ${
|
|
42901
|
+
`Run ${pc65.cyan("wraps platform")} for more information.
|
|
42804
42902
|
`
|
|
42805
42903
|
);
|
|
42806
42904
|
throw new Error(`Unknown platform command: ${subCommand}`);
|
|
@@ -42825,10 +42923,10 @@ Available commands: ${pc64.cyan("connect")}, ${pc64.cyan("update-role")}
|
|
|
42825
42923
|
await logout();
|
|
42826
42924
|
break;
|
|
42827
42925
|
default:
|
|
42828
|
-
|
|
42926
|
+
clack61.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
42829
42927
|
console.log(
|
|
42830
42928
|
`
|
|
42831
|
-
Available commands: ${
|
|
42929
|
+
Available commands: ${pc65.cyan("login")}, ${pc65.cyan("status")}, ${pc65.cyan("logout")}
|
|
42832
42930
|
`
|
|
42833
42931
|
);
|
|
42834
42932
|
throw new Error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
@@ -42846,13 +42944,13 @@ Available commands: ${pc64.cyan("login")}, ${pc64.cyan("status")}, ${pc64.cyan("
|
|
|
42846
42944
|
await doctor();
|
|
42847
42945
|
break;
|
|
42848
42946
|
default:
|
|
42849
|
-
|
|
42947
|
+
clack61.log.error(`Unknown aws command: ${subCommand}`);
|
|
42850
42948
|
console.log(
|
|
42851
42949
|
`
|
|
42852
|
-
Available commands: ${
|
|
42950
|
+
Available commands: ${pc65.cyan("setup")}, ${pc65.cyan("doctor")}
|
|
42853
42951
|
`
|
|
42854
42952
|
);
|
|
42855
|
-
console.log(`Run ${
|
|
42953
|
+
console.log(`Run ${pc65.cyan("wraps --help")} for more information.
|
|
42856
42954
|
`);
|
|
42857
42955
|
throw new Error(`Unknown aws command: ${subCommand}`);
|
|
42858
42956
|
}
|
|
@@ -42933,10 +43031,10 @@ Available commands: ${pc64.cyan("setup")}, ${pc64.cyan("doctor")}
|
|
|
42933
43031
|
await telemetryStatus();
|
|
42934
43032
|
break;
|
|
42935
43033
|
default:
|
|
42936
|
-
|
|
43034
|
+
clack61.log.error(`Unknown telemetry command: ${subCommand}`);
|
|
42937
43035
|
console.log(
|
|
42938
43036
|
`
|
|
42939
|
-
Available commands: ${
|
|
43037
|
+
Available commands: ${pc65.cyan("enable")}, ${pc65.cyan("disable")}, ${pc65.cyan("status")}
|
|
42940
43038
|
`
|
|
42941
43039
|
);
|
|
42942
43040
|
throw new Error(`Unknown telemetry command: ${subCommand}`);
|
|
@@ -42960,10 +43058,10 @@ Please specify a command for ${primaryCommand} service.
|
|
|
42960
43058
|
showHelp();
|
|
42961
43059
|
break;
|
|
42962
43060
|
default:
|
|
42963
|
-
|
|
43061
|
+
clack61.log.error(`Unknown command: ${primaryCommand}`);
|
|
42964
43062
|
console.log(
|
|
42965
43063
|
`
|
|
42966
|
-
Run ${
|
|
43064
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42967
43065
|
`
|
|
42968
43066
|
);
|
|
42969
43067
|
throw new Error(`Unknown command: ${primaryCommand}`);
|