@wraps.dev/cli 2.21.4 → 2.21.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -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 });
|
|
@@ -10357,8 +10358,8 @@ init_esm_shims();
|
|
|
10357
10358
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10358
10359
|
import { dirname as dirname5, 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);
|
|
@@ -33212,6 +33223,7 @@ function buildConsolePolicyDocument2(emailConfig, smsConfig) {
|
|
|
33212
33223
|
init_esm_shims();
|
|
33213
33224
|
import { execSync as execSync2 } from "child_process";
|
|
33214
33225
|
import { randomBytes as randomBytes6 } from "crypto";
|
|
33226
|
+
import { writeFileSync } from "fs";
|
|
33215
33227
|
import { join as join20 } from "path";
|
|
33216
33228
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
33217
33229
|
import * as clack43 from "@clack/prompts";
|
|
@@ -33432,7 +33444,14 @@ init_events();
|
|
|
33432
33444
|
|
|
33433
33445
|
// src/utils/selfhost/neon.ts
|
|
33434
33446
|
init_esm_shims();
|
|
33435
|
-
async function provisionNeonProject(apiKey, projectName,
|
|
33447
|
+
async function provisionNeonProject(apiKey, projectName, options = {}) {
|
|
33448
|
+
const { region = "aws-us-east-2", orgId } = options;
|
|
33449
|
+
const projectPayload = {
|
|
33450
|
+
name: projectName,
|
|
33451
|
+
pg_version: 16,
|
|
33452
|
+
region_id: region
|
|
33453
|
+
};
|
|
33454
|
+
if (orgId) projectPayload.org_id = orgId;
|
|
33436
33455
|
const response = await fetch("https://console.neon.tech/api/v2/projects", {
|
|
33437
33456
|
method: "POST",
|
|
33438
33457
|
headers: {
|
|
@@ -33440,13 +33459,7 @@ async function provisionNeonProject(apiKey, projectName, region = "aws-us-east-2
|
|
|
33440
33459
|
"Content-Type": "application/json",
|
|
33441
33460
|
Accept: "application/json"
|
|
33442
33461
|
},
|
|
33443
|
-
body: JSON.stringify({
|
|
33444
|
-
project: {
|
|
33445
|
-
name: projectName,
|
|
33446
|
-
pg_version: 16,
|
|
33447
|
-
region_id: region
|
|
33448
|
-
}
|
|
33449
|
-
})
|
|
33462
|
+
body: JSON.stringify({ project: projectPayload })
|
|
33450
33463
|
});
|
|
33451
33464
|
if (!response.ok) {
|
|
33452
33465
|
const body = await response.json().catch(() => ({}));
|
|
@@ -33538,16 +33551,23 @@ async function selfhostDeploy(options) {
|
|
|
33538
33551
|
clack43.log.info(`To update: run ${pc46.cyan("wraps selfhost upgrade")}`);
|
|
33539
33552
|
process.exit(0);
|
|
33540
33553
|
}
|
|
33541
|
-
let
|
|
33542
|
-
|
|
33543
|
-
|
|
33544
|
-
|
|
33545
|
-
|
|
33546
|
-
|
|
33547
|
-
|
|
33548
|
-
|
|
33554
|
+
let resolvedDatabaseUrl = options.databaseUrl;
|
|
33555
|
+
let resolvedNeonProjectId;
|
|
33556
|
+
let neonApiKey;
|
|
33557
|
+
let neonOrgId;
|
|
33558
|
+
if (!resolvedDatabaseUrl) {
|
|
33559
|
+
neonApiKey = options.neonApiKey;
|
|
33560
|
+
if (!neonApiKey) {
|
|
33561
|
+
const neonApiKeyAnswer = await clack43.password({
|
|
33562
|
+
message: "Neon API key (create one at console.neon.tech/app/settings/api-keys):"
|
|
33563
|
+
});
|
|
33564
|
+
if (clack43.isCancel(neonApiKeyAnswer)) {
|
|
33565
|
+
clack43.cancel("Operation cancelled.");
|
|
33566
|
+
process.exit(0);
|
|
33567
|
+
}
|
|
33568
|
+
neonApiKey = neonApiKeyAnswer;
|
|
33549
33569
|
}
|
|
33550
|
-
|
|
33570
|
+
neonOrgId = options.neonOrgId;
|
|
33551
33571
|
}
|
|
33552
33572
|
let licenseKey = options.licenseKey;
|
|
33553
33573
|
if (!licenseKey) {
|
|
@@ -33584,32 +33604,46 @@ async function selfhostDeploy(options) {
|
|
|
33584
33604
|
process.exit(0);
|
|
33585
33605
|
}
|
|
33586
33606
|
}
|
|
33607
|
+
const childStdio = isJsonMode() ? "pipe" : "inherit";
|
|
33587
33608
|
await progress.execute("Building Wraps API", async () => {
|
|
33588
33609
|
execSync2("pnpm --filter @wraps/api build", {
|
|
33589
|
-
stdio:
|
|
33610
|
+
stdio: childStdio,
|
|
33590
33611
|
cwd: repoRoot
|
|
33591
33612
|
});
|
|
33592
33613
|
});
|
|
33593
33614
|
const lambdaZipPath = join20(repoRoot, "apps/api/lambda.zip");
|
|
33615
|
+
const distDir = join20(repoRoot, "apps/api/dist");
|
|
33594
33616
|
await progress.execute("Packaging Lambda", async () => {
|
|
33617
|
+
writeFileSync(join20(distDir, "package.json"), '{"type":"module"}\n');
|
|
33595
33618
|
execSync2("/bin/sh -c 'zip -r ../lambda.zip .'", {
|
|
33596
|
-
cwd:
|
|
33597
|
-
stdio:
|
|
33619
|
+
cwd: distDir,
|
|
33620
|
+
stdio: childStdio
|
|
33598
33621
|
});
|
|
33599
33622
|
});
|
|
33600
|
-
|
|
33601
|
-
|
|
33602
|
-
|
|
33603
|
-
|
|
33604
|
-
|
|
33605
|
-
|
|
33606
|
-
|
|
33607
|
-
|
|
33623
|
+
if (!resolvedDatabaseUrl) {
|
|
33624
|
+
const neonProject = await progress.execute(
|
|
33625
|
+
"Provisioning Neon PostgreSQL database",
|
|
33626
|
+
async () => provisionNeonProject(
|
|
33627
|
+
neonApiKey,
|
|
33628
|
+
buildNeonProjectName(identity.accountId, region),
|
|
33629
|
+
{ orgId: neonOrgId }
|
|
33630
|
+
)
|
|
33631
|
+
);
|
|
33632
|
+
progress.info(`Neon project created: ${pc46.cyan(neonProject.name)}`);
|
|
33633
|
+
resolvedDatabaseUrl = neonProject.connectionString;
|
|
33634
|
+
resolvedNeonProjectId = neonProject.id;
|
|
33635
|
+
}
|
|
33636
|
+
if (!resolvedDatabaseUrl) {
|
|
33637
|
+
throw new Error(
|
|
33638
|
+
"[bug] resolvedDatabaseUrl was not set after DB resolution"
|
|
33639
|
+
);
|
|
33640
|
+
}
|
|
33641
|
+
const databaseUrl = resolvedDatabaseUrl;
|
|
33608
33642
|
const unsubscribeSecret = randomBytes6(32).toString("hex");
|
|
33609
33643
|
const betterAuthSecret = randomBytes6(32).toString("hex");
|
|
33610
33644
|
const selfhostConfig = {
|
|
33611
|
-
neonProjectId:
|
|
33612
|
-
databaseUrl
|
|
33645
|
+
neonProjectId: resolvedNeonProjectId,
|
|
33646
|
+
databaseUrl,
|
|
33613
33647
|
licenseKey,
|
|
33614
33648
|
appUrl,
|
|
33615
33649
|
unsubscribeSecret,
|
|
@@ -33636,11 +33670,11 @@ async function selfhostDeploy(options) {
|
|
|
33636
33670
|
await saveConnectionMetadata(savedMetadata);
|
|
33637
33671
|
await progress.execute("Running database migrations", async () => {
|
|
33638
33672
|
execSync2("pnpm --filter @wraps/db db:migrate", {
|
|
33639
|
-
stdio:
|
|
33673
|
+
stdio: childStdio,
|
|
33640
33674
|
cwd: repoRoot,
|
|
33641
33675
|
env: {
|
|
33642
33676
|
...process.env,
|
|
33643
|
-
DATABASE_URL:
|
|
33677
|
+
DATABASE_URL: databaseUrl
|
|
33644
33678
|
}
|
|
33645
33679
|
});
|
|
33646
33680
|
});
|
|
@@ -33658,7 +33692,7 @@ async function selfhostDeploy(options) {
|
|
|
33658
33692
|
accountId: identity.accountId,
|
|
33659
33693
|
region,
|
|
33660
33694
|
lambdaZipPath,
|
|
33661
|
-
databaseUrl
|
|
33695
|
+
databaseUrl,
|
|
33662
33696
|
licenseKey,
|
|
33663
33697
|
appUrl,
|
|
33664
33698
|
unsubscribeSecret,
|
|
@@ -33780,7 +33814,7 @@ async function selfhostDeploy(options) {
|
|
|
33780
33814
|
`${pc46.bold("API URL:")} ${pc46.cyan(outputs.apiUrl)}`,
|
|
33781
33815
|
`${pc46.bold("Region:")} ${pc46.cyan(region)}`,
|
|
33782
33816
|
`${pc46.bold("Lambda ARN:")} ${pc46.dim(outputs.lambdaArn)}`,
|
|
33783
|
-
`${pc46.bold("Neon Project:")} ${pc46.dim(
|
|
33817
|
+
...resolvedNeonProjectId ? [`${pc46.bold("Neon Project:")} ${pc46.dim(resolvedNeonProjectId)}`] : [],
|
|
33784
33818
|
"",
|
|
33785
33819
|
pc46.dim("Next steps:"),
|
|
33786
33820
|
pc46.dim(` Set WRAPS_API_URL=${outputs.apiUrl} in your app`),
|
|
@@ -33793,36 +33827,112 @@ async function selfhostDeploy(options) {
|
|
|
33793
33827
|
);
|
|
33794
33828
|
}
|
|
33795
33829
|
|
|
33796
|
-
// src/commands/selfhost/
|
|
33830
|
+
// src/commands/selfhost/env.ts
|
|
33797
33831
|
init_esm_shims();
|
|
33798
33832
|
init_events();
|
|
33799
33833
|
init_aws();
|
|
33800
33834
|
init_json_output();
|
|
33801
33835
|
init_metadata();
|
|
33802
|
-
init_output();
|
|
33803
33836
|
init_region_resolver();
|
|
33804
33837
|
import * as clack44 from "@clack/prompts";
|
|
33805
33838
|
import pc47 from "picocolors";
|
|
33839
|
+
async function selfhostEnv(options) {
|
|
33840
|
+
const startTime = Date.now();
|
|
33841
|
+
if (!isJsonMode()) {
|
|
33842
|
+
clack44.intro(pc47.bold("Wraps Self-Hosted \u2014 Vercel Environment Variables"));
|
|
33843
|
+
}
|
|
33844
|
+
const identity = await validateAWSCredentials();
|
|
33845
|
+
const region = await resolveRegionForCommand({
|
|
33846
|
+
accountId: identity.accountId,
|
|
33847
|
+
optionRegion: options.region,
|
|
33848
|
+
service: "selfhost",
|
|
33849
|
+
label: "self-hosted deployment"
|
|
33850
|
+
});
|
|
33851
|
+
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33852
|
+
if (!metadata?.services?.selfhost) {
|
|
33853
|
+
clack44.log.error("No self-hosted deployment found");
|
|
33854
|
+
console.log(
|
|
33855
|
+
`
|
|
33856
|
+
Run ${pc47.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
33857
|
+
`
|
|
33858
|
+
);
|
|
33859
|
+
process.exit(1);
|
|
33860
|
+
return;
|
|
33861
|
+
}
|
|
33862
|
+
const { config: config2 } = metadata.services.selfhost;
|
|
33863
|
+
const env = {
|
|
33864
|
+
DATABASE_URL: config2.databaseUrl,
|
|
33865
|
+
NEXT_PUBLIC_APP_URL: config2.appUrl,
|
|
33866
|
+
CORS_ORIGIN: config2.appUrl,
|
|
33867
|
+
BETTER_AUTH_SECRET: config2.betterAuthSecret,
|
|
33868
|
+
WRAPS_LICENSE_KEY: config2.licenseKey,
|
|
33869
|
+
AWS_BACKEND_ACCOUNT_ID: identity.accountId
|
|
33870
|
+
};
|
|
33871
|
+
if (isJsonMode()) {
|
|
33872
|
+
jsonSuccess("selfhost.env", { env });
|
|
33873
|
+
return;
|
|
33874
|
+
}
|
|
33875
|
+
console.log("# Wraps Self-Hosted \u2014 environment for apps/web on Vercel");
|
|
33876
|
+
console.log(
|
|
33877
|
+
`# Deployment: ${identity.accountId} / ${region} \u2014 ${config2.appUrl}`
|
|
33878
|
+
);
|
|
33879
|
+
console.log(`# Generated: ${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
33880
|
+
console.log("");
|
|
33881
|
+
for (const [key, value] of Object.entries(env)) {
|
|
33882
|
+
console.log(`${key}=${value}`);
|
|
33883
|
+
}
|
|
33884
|
+
console.log("");
|
|
33885
|
+
console.log(
|
|
33886
|
+
"# AWS credentials for role assumption \u2014 create an IAM user in your account"
|
|
33887
|
+
);
|
|
33888
|
+
console.log(
|
|
33889
|
+
`# with sts:AssumeRole permission on arn:aws:iam::${identity.accountId}:role/wraps-console-access-role`
|
|
33890
|
+
);
|
|
33891
|
+
console.log("# AWS_ACCESS_KEY_ID=<fill-in>");
|
|
33892
|
+
console.log("# AWS_SECRET_ACCESS_KEY=<fill-in>");
|
|
33893
|
+
clack44.outro(
|
|
33894
|
+
pc47.dim(
|
|
33895
|
+
"Paste into Vercel \u2192 Settings \u2192 Environment Variables \u2192 Add from .env"
|
|
33896
|
+
)
|
|
33897
|
+
);
|
|
33898
|
+
trackCommand("selfhost:env", {
|
|
33899
|
+
success: true,
|
|
33900
|
+
duration_ms: Date.now() - startTime
|
|
33901
|
+
});
|
|
33902
|
+
}
|
|
33903
|
+
|
|
33904
|
+
// src/commands/selfhost/status.ts
|
|
33905
|
+
init_esm_shims();
|
|
33906
|
+
init_events();
|
|
33907
|
+
init_aws();
|
|
33908
|
+
init_json_output();
|
|
33909
|
+
init_metadata();
|
|
33910
|
+
init_output();
|
|
33911
|
+
init_region_resolver();
|
|
33912
|
+
import * as clack45 from "@clack/prompts";
|
|
33913
|
+
import pc48 from "picocolors";
|
|
33806
33914
|
function displaySelfhostStatus(options) {
|
|
33807
33915
|
const lines = [];
|
|
33808
|
-
lines.push(
|
|
33916
|
+
lines.push(pc48.bold(pc48.green("Self-Hosted Control Plane Active")));
|
|
33809
33917
|
lines.push("");
|
|
33810
|
-
lines.push(
|
|
33811
|
-
lines.push(` URL: ${
|
|
33812
|
-
lines.push(` Region: ${
|
|
33813
|
-
lines.push(` Deployed: ${
|
|
33918
|
+
lines.push(pc48.bold("API"));
|
|
33919
|
+
lines.push(` URL: ${pc48.cyan(options.apiUrl)}`);
|
|
33920
|
+
lines.push(` Region: ${pc48.cyan(options.region)}`);
|
|
33921
|
+
lines.push(` Deployed: ${pc48.dim(options.deployedAt)}`);
|
|
33814
33922
|
lines.push("");
|
|
33815
|
-
lines.push(
|
|
33816
|
-
lines.push(` App URL: ${
|
|
33817
|
-
lines.push(` License Key: ${
|
|
33818
|
-
|
|
33819
|
-
|
|
33923
|
+
lines.push(pc48.bold("Configuration"));
|
|
33924
|
+
lines.push(` App URL: ${pc48.cyan(options.appUrl)}`);
|
|
33925
|
+
lines.push(` License Key: ${pc48.dim(`${options.licenseKeyPrefix}...`)}`);
|
|
33926
|
+
if (options.neonProjectId) {
|
|
33927
|
+
lines.push(` Neon Project: ${pc48.dim(options.neonProjectId)}`);
|
|
33928
|
+
}
|
|
33929
|
+
clack45.note(lines.join("\n"), "Self-Hosted Status");
|
|
33820
33930
|
}
|
|
33821
33931
|
async function selfhostStatus(options) {
|
|
33822
33932
|
const startTime = Date.now();
|
|
33823
33933
|
const progress = new DeploymentProgress();
|
|
33824
33934
|
if (!isJsonMode()) {
|
|
33825
|
-
|
|
33935
|
+
clack45.intro(pc48.bold("Wraps Self-Hosted Status"));
|
|
33826
33936
|
}
|
|
33827
33937
|
const identity = await progress.execute(
|
|
33828
33938
|
"Loading self-hosted status",
|
|
@@ -33837,10 +33947,10 @@ async function selfhostStatus(options) {
|
|
|
33837
33947
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33838
33948
|
if (!metadata?.services?.selfhost) {
|
|
33839
33949
|
progress.stop();
|
|
33840
|
-
|
|
33950
|
+
clack45.log.error("No self-hosted deployment found");
|
|
33841
33951
|
console.log(
|
|
33842
33952
|
`
|
|
33843
|
-
Run ${
|
|
33953
|
+
Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
33844
33954
|
`
|
|
33845
33955
|
);
|
|
33846
33956
|
process.exit(1);
|
|
@@ -33862,25 +33972,26 @@ Run ${pc47.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
33862
33972
|
}
|
|
33863
33973
|
displaySelfhostStatus(statusData);
|
|
33864
33974
|
console.log("");
|
|
33865
|
-
|
|
33975
|
+
clack45.log.info(pc48.bold("Commands:"));
|
|
33866
33976
|
console.log(
|
|
33867
|
-
` ${
|
|
33977
|
+
` ${pc48.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
|
|
33868
33978
|
);
|
|
33869
33979
|
trackCommand("selfhost:status", {
|
|
33870
33980
|
success: true,
|
|
33871
33981
|
duration_ms: Date.now() - startTime
|
|
33872
33982
|
});
|
|
33873
|
-
|
|
33983
|
+
clack45.outro(pc48.dim("Self-hosted deployment is active"));
|
|
33874
33984
|
}
|
|
33875
33985
|
|
|
33876
33986
|
// src/commands/selfhost/upgrade.ts
|
|
33877
33987
|
init_esm_shims();
|
|
33878
33988
|
import { execSync as execSync3 } from "child_process";
|
|
33989
|
+
import { writeFileSync as writeFileSync2 } from "fs";
|
|
33879
33990
|
import { join as join21 } from "path";
|
|
33880
33991
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
33881
|
-
import * as
|
|
33992
|
+
import * as clack46 from "@clack/prompts";
|
|
33882
33993
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
33883
|
-
import
|
|
33994
|
+
import pc49 from "picocolors";
|
|
33884
33995
|
init_events();
|
|
33885
33996
|
init_aws();
|
|
33886
33997
|
init_errors();
|
|
@@ -33895,7 +34006,7 @@ var repoRoot2 = join21(__filename3, "../../../..");
|
|
|
33895
34006
|
async function selfhostUpgrade(options) {
|
|
33896
34007
|
const startTime = Date.now();
|
|
33897
34008
|
if (!isJsonMode()) {
|
|
33898
|
-
|
|
34009
|
+
clack46.intro(pc49.bold("Wraps Self-Hosted Control Plane Upgrade"));
|
|
33899
34010
|
}
|
|
33900
34011
|
const progress = new DeploymentProgress();
|
|
33901
34012
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -33910,7 +34021,7 @@ async function selfhostUpgrade(options) {
|
|
|
33910
34021
|
async () => validateAWSCredentialsWithDetails()
|
|
33911
34022
|
);
|
|
33912
34023
|
const identity = credentialResult.identity;
|
|
33913
|
-
progress.info(`Connected to AWS account: ${
|
|
34024
|
+
progress.info(`Connected to AWS account: ${pc49.cyan(identity.accountId)}`);
|
|
33914
34025
|
const region = await resolveRegionForCommand({
|
|
33915
34026
|
accountId: identity.accountId,
|
|
33916
34027
|
optionRegion: options.region,
|
|
@@ -33919,36 +34030,39 @@ async function selfhostUpgrade(options) {
|
|
|
33919
34030
|
});
|
|
33920
34031
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
33921
34032
|
if (!metadata?.services?.selfhost) {
|
|
33922
|
-
|
|
33923
|
-
|
|
34033
|
+
clack46.log.error("No self-hosted deployment found.");
|
|
34034
|
+
clack46.log.info(`Run ${pc49.cyan("wraps selfhost deploy")} first.`);
|
|
33924
34035
|
process.exit(1);
|
|
33925
34036
|
}
|
|
33926
34037
|
const selfhostService = metadata.services.selfhost;
|
|
33927
34038
|
progress.info(`Found deployment from: ${selfhostService.deployedAt}`);
|
|
33928
|
-
progress.info(`API URL: ${
|
|
34039
|
+
progress.info(`API URL: ${pc49.cyan(selfhostService.apiUrl)}`);
|
|
33929
34040
|
if (!(options.yes || options.preview)) {
|
|
33930
|
-
const confirmed = await
|
|
33931
|
-
message: `Upgrade self-hosted deployment in ${
|
|
34041
|
+
const confirmed = await clack46.confirm({
|
|
34042
|
+
message: `Upgrade self-hosted deployment in ${pc49.cyan(identity.accountId)} / ${pc49.cyan(region)}?`,
|
|
33932
34043
|
initialValue: true
|
|
33933
34044
|
});
|
|
33934
|
-
if (
|
|
33935
|
-
|
|
34045
|
+
if (clack46.isCancel(confirmed) || !confirmed) {
|
|
34046
|
+
clack46.cancel("Upgrade cancelled.");
|
|
33936
34047
|
process.exit(0);
|
|
33937
34048
|
}
|
|
33938
34049
|
}
|
|
33939
34050
|
const config2 = selfhostService.config;
|
|
33940
34051
|
const stackName = selfhostService.pulumiStackName || `wraps-selfhost-${identity.accountId}-${region}`;
|
|
34052
|
+
const childStdio = isJsonMode() ? "pipe" : "inherit";
|
|
33941
34053
|
await progress.execute("Building Wraps API", async () => {
|
|
33942
34054
|
execSync3("pnpm --filter @wraps/api build", {
|
|
33943
|
-
stdio:
|
|
34055
|
+
stdio: childStdio,
|
|
33944
34056
|
cwd: repoRoot2
|
|
33945
34057
|
});
|
|
33946
34058
|
});
|
|
33947
34059
|
const lambdaZipPath = join21(repoRoot2, "apps/api/lambda.zip");
|
|
34060
|
+
const distDir = join21(repoRoot2, "apps/api/dist");
|
|
33948
34061
|
await progress.execute("Packaging Lambda", async () => {
|
|
34062
|
+
writeFileSync2(join21(distDir, "package.json"), '{"type":"module"}\n');
|
|
33949
34063
|
execSync3("/bin/sh -c 'zip -r ../lambda.zip .'", {
|
|
33950
|
-
cwd:
|
|
33951
|
-
stdio:
|
|
34064
|
+
cwd: distDir,
|
|
34065
|
+
stdio: childStdio
|
|
33952
34066
|
});
|
|
33953
34067
|
});
|
|
33954
34068
|
const createStack = async () => {
|
|
@@ -34013,8 +34127,8 @@ async function selfhostUpgrade(options) {
|
|
|
34013
34127
|
resourceChanges: previewResult.resourceChanges,
|
|
34014
34128
|
commandName: "wraps selfhost upgrade"
|
|
34015
34129
|
});
|
|
34016
|
-
|
|
34017
|
-
|
|
34130
|
+
clack46.outro(
|
|
34131
|
+
pc49.green("Preview complete. Run without --preview to upgrade.")
|
|
34018
34132
|
);
|
|
34019
34133
|
return;
|
|
34020
34134
|
} catch (error) {
|
|
@@ -34085,28 +34199,28 @@ async function selfhostUpgrade(options) {
|
|
|
34085
34199
|
}
|
|
34086
34200
|
progress.info("Deployment metadata updated");
|
|
34087
34201
|
console.log("\n");
|
|
34088
|
-
|
|
34202
|
+
clack46.log.success(pc49.green(pc49.bold("Self-hosted Wraps API upgraded!")));
|
|
34089
34203
|
console.log("\n");
|
|
34090
|
-
|
|
34204
|
+
clack46.note(
|
|
34091
34205
|
[
|
|
34092
|
-
`${
|
|
34093
|
-
`${
|
|
34094
|
-
`${
|
|
34206
|
+
`${pc49.bold("API URL:")} ${pc49.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
|
|
34207
|
+
`${pc49.bold("Region:")} ${pc49.cyan(region)}`,
|
|
34208
|
+
`${pc49.bold("Lambda ARN:")} ${pc49.dim(outputs.lambdaArn)}`
|
|
34095
34209
|
].join("\n"),
|
|
34096
34210
|
"Self-Hosted Deployment"
|
|
34097
34211
|
);
|
|
34098
|
-
|
|
34099
|
-
|
|
34212
|
+
clack46.outro(
|
|
34213
|
+
pc49.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
|
|
34100
34214
|
);
|
|
34101
34215
|
}
|
|
34102
34216
|
|
|
34103
34217
|
// src/commands/shared/dashboard.ts
|
|
34104
34218
|
init_esm_shims();
|
|
34105
|
-
import * as
|
|
34219
|
+
import * as clack47 from "@clack/prompts";
|
|
34106
34220
|
import * as pulumi28 from "@pulumi/pulumi";
|
|
34107
34221
|
import getPort from "get-port";
|
|
34108
34222
|
import open2 from "open";
|
|
34109
|
-
import
|
|
34223
|
+
import pc50 from "picocolors";
|
|
34110
34224
|
|
|
34111
34225
|
// src/console/server.ts
|
|
34112
34226
|
init_esm_shims();
|
|
@@ -35306,13 +35420,13 @@ function createMetricsRouter(config2) {
|
|
|
35306
35420
|
const router = createRouter5();
|
|
35307
35421
|
router.get("/stream", async (req, res) => {
|
|
35308
35422
|
const connectionId = randomUUID().slice(0, 8);
|
|
35309
|
-
const
|
|
35423
|
+
const log57 = (msg, data) => {
|
|
35310
35424
|
console.log(JSON.stringify({ connectionId, msg, ...data }));
|
|
35311
35425
|
};
|
|
35312
35426
|
res.setHeader("Content-Type", "text/event-stream");
|
|
35313
35427
|
res.setHeader("Cache-Control", "no-cache");
|
|
35314
35428
|
res.setHeader("Connection", "keep-alive");
|
|
35315
|
-
|
|
35429
|
+
log57("SSE connected");
|
|
35316
35430
|
res.write('data: {"type":"connected"}\n\n');
|
|
35317
35431
|
const { startTime, endTime } = req.query;
|
|
35318
35432
|
const getTimeRange = () => ({
|
|
@@ -35322,7 +35436,7 @@ function createMetricsRouter(config2) {
|
|
|
35322
35436
|
const sendMetrics = async () => {
|
|
35323
35437
|
try {
|
|
35324
35438
|
const timeRange = getTimeRange();
|
|
35325
|
-
|
|
35439
|
+
log57("Fetching metrics", {
|
|
35326
35440
|
start: timeRange.start.toISOString(),
|
|
35327
35441
|
end: timeRange.end.toISOString()
|
|
35328
35442
|
});
|
|
@@ -35335,7 +35449,7 @@ function createMetricsRouter(config2) {
|
|
|
35335
35449
|
),
|
|
35336
35450
|
fetchSendQuota(config2.roleArn, config2.region)
|
|
35337
35451
|
]);
|
|
35338
|
-
|
|
35452
|
+
log57("Metrics fetched successfully");
|
|
35339
35453
|
const data = {
|
|
35340
35454
|
type: "metrics",
|
|
35341
35455
|
timestamp: Date.now(),
|
|
@@ -35365,7 +35479,7 @@ function createMetricsRouter(config2) {
|
|
|
35365
35479
|
const interval = setInterval(sendMetrics, 6e4);
|
|
35366
35480
|
req.on("close", () => {
|
|
35367
35481
|
clearInterval(interval);
|
|
35368
|
-
|
|
35482
|
+
log57("SSE disconnected");
|
|
35369
35483
|
});
|
|
35370
35484
|
});
|
|
35371
35485
|
router.get("/snapshot", async (_req, res) => {
|
|
@@ -36760,7 +36874,7 @@ init_output();
|
|
|
36760
36874
|
init_pulumi();
|
|
36761
36875
|
async function dashboard(options) {
|
|
36762
36876
|
await ensurePulumiInstalled();
|
|
36763
|
-
|
|
36877
|
+
clack47.intro(pc50.bold("Wraps Dashboard"));
|
|
36764
36878
|
const progress = new DeploymentProgress();
|
|
36765
36879
|
const identity = await progress.execute(
|
|
36766
36880
|
"Validating AWS credentials",
|
|
@@ -36801,9 +36915,9 @@ async function dashboard(options) {
|
|
|
36801
36915
|
}
|
|
36802
36916
|
} catch (_error) {
|
|
36803
36917
|
progress.stop();
|
|
36804
|
-
|
|
36918
|
+
clack47.log.error("No Wraps infrastructure found");
|
|
36805
36919
|
console.log(
|
|
36806
|
-
`\\nRun ${
|
|
36920
|
+
`\\nRun ${pc50.cyan("wraps email init")}, ${pc50.cyan("wraps sms init")}, or ${pc50.cyan("wraps storage init")} to deploy infrastructure first.\\n`
|
|
36807
36921
|
);
|
|
36808
36922
|
process.exit(1);
|
|
36809
36923
|
}
|
|
@@ -36845,9 +36959,9 @@ async function dashboard(options) {
|
|
|
36845
36959
|
}
|
|
36846
36960
|
const port = options.port || await getPort({ port: [5555, 5556, 5557, 5558, 5559] });
|
|
36847
36961
|
progress.stop();
|
|
36848
|
-
|
|
36962
|
+
clack47.log.success("Starting dashboard server...");
|
|
36849
36963
|
console.log(
|
|
36850
|
-
`${
|
|
36964
|
+
`${pc50.dim("Using current AWS credentials (no role assumption)")}\\n`
|
|
36851
36965
|
);
|
|
36852
36966
|
const { url } = await startConsoleServer({
|
|
36853
36967
|
port,
|
|
@@ -36880,8 +36994,8 @@ async function dashboard(options) {
|
|
|
36880
36994
|
cdnCustomDomain,
|
|
36881
36995
|
cdnCertificateArn
|
|
36882
36996
|
});
|
|
36883
|
-
console.log(`\\n${
|
|
36884
|
-
console.log(`${
|
|
36997
|
+
console.log(`\\n${pc50.bold("Dashboard:")} ${pc50.cyan(url)}`);
|
|
36998
|
+
console.log(`${pc50.dim("Press Ctrl+C to stop")}\\n`);
|
|
36885
36999
|
getTelemetryClient().showFooterOnce();
|
|
36886
37000
|
if (!options.noOpen) {
|
|
36887
37001
|
await open2(url);
|
|
@@ -36902,8 +37016,8 @@ init_aws();
|
|
|
36902
37016
|
init_errors();
|
|
36903
37017
|
init_json_output();
|
|
36904
37018
|
init_metadata();
|
|
36905
|
-
import * as
|
|
36906
|
-
import
|
|
37019
|
+
import * as clack48 from "@clack/prompts";
|
|
37020
|
+
import pc51 from "picocolors";
|
|
36907
37021
|
async function destroy(options) {
|
|
36908
37022
|
trackCommand("destroy", { success: true });
|
|
36909
37023
|
if (isJsonMode() && !options.force) {
|
|
@@ -36914,9 +37028,9 @@ async function destroy(options) {
|
|
|
36914
37028
|
);
|
|
36915
37029
|
}
|
|
36916
37030
|
if (!isJsonMode()) {
|
|
36917
|
-
|
|
37031
|
+
clack48.intro(pc51.bold("Wraps Infrastructure Teardown"));
|
|
36918
37032
|
}
|
|
36919
|
-
const spinner10 =
|
|
37033
|
+
const spinner10 = clack48.spinner();
|
|
36920
37034
|
spinner10.start("Validating AWS credentials");
|
|
36921
37035
|
let identity;
|
|
36922
37036
|
try {
|
|
@@ -36933,17 +37047,17 @@ async function destroy(options) {
|
|
|
36933
37047
|
deployedServices.push("email");
|
|
36934
37048
|
}
|
|
36935
37049
|
if (deployedServices.length === 0) {
|
|
36936
|
-
|
|
37050
|
+
clack48.log.warn("No Wraps services found in this region");
|
|
36937
37051
|
console.log(
|
|
36938
37052
|
`
|
|
36939
|
-
Run ${
|
|
37053
|
+
Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
|
|
36940
37054
|
`
|
|
36941
37055
|
);
|
|
36942
37056
|
process.exit(0);
|
|
36943
37057
|
}
|
|
36944
37058
|
if (deployedServices.length === 1) {
|
|
36945
37059
|
const service = deployedServices[0];
|
|
36946
|
-
|
|
37060
|
+
clack48.log.info(`Found ${pc51.cyan(service)} service deployed`);
|
|
36947
37061
|
if (service === "email") {
|
|
36948
37062
|
await emailDestroy(options);
|
|
36949
37063
|
return;
|
|
@@ -36958,7 +37072,7 @@ Run ${pc50.cyan("wraps email init")} to deploy infrastructure.
|
|
|
36958
37072
|
jsonSuccess("destroy", { destroyed: true });
|
|
36959
37073
|
return;
|
|
36960
37074
|
}
|
|
36961
|
-
const serviceToDestroy = await
|
|
37075
|
+
const serviceToDestroy = await clack48.select({
|
|
36962
37076
|
message: "Which service would you like to destroy?",
|
|
36963
37077
|
options: [
|
|
36964
37078
|
...deployedServices.map((s) => ({
|
|
@@ -36973,15 +37087,15 @@ Run ${pc50.cyan("wraps email init")} to deploy infrastructure.
|
|
|
36973
37087
|
}
|
|
36974
37088
|
]
|
|
36975
37089
|
});
|
|
36976
|
-
if (
|
|
36977
|
-
|
|
37090
|
+
if (clack48.isCancel(serviceToDestroy)) {
|
|
37091
|
+
clack48.cancel("Operation cancelled.");
|
|
36978
37092
|
process.exit(0);
|
|
36979
37093
|
}
|
|
36980
37094
|
if ((serviceToDestroy === "email" || serviceToDestroy === "all") && deployedServices.includes("email")) {
|
|
36981
37095
|
await emailDestroy(options);
|
|
36982
37096
|
}
|
|
36983
37097
|
if (serviceToDestroy === "all") {
|
|
36984
|
-
|
|
37098
|
+
clack48.outro(pc51.green("All Wraps infrastructure has been removed"));
|
|
36985
37099
|
}
|
|
36986
37100
|
}
|
|
36987
37101
|
|
|
@@ -36993,26 +37107,26 @@ init_fs();
|
|
|
36993
37107
|
init_json_output();
|
|
36994
37108
|
init_output();
|
|
36995
37109
|
init_pulumi();
|
|
36996
|
-
import * as
|
|
37110
|
+
import * as clack49 from "@clack/prompts";
|
|
36997
37111
|
import * as pulumi29 from "@pulumi/pulumi";
|
|
36998
|
-
import
|
|
37112
|
+
import pc52 from "picocolors";
|
|
36999
37113
|
async function status(options) {
|
|
37000
37114
|
await ensurePulumiInstalled();
|
|
37001
37115
|
const startTime = Date.now();
|
|
37002
37116
|
const progress = new DeploymentProgress();
|
|
37003
37117
|
if (!isJsonMode()) {
|
|
37004
|
-
|
|
37118
|
+
clack49.intro(pc52.bold("Wraps Infrastructure Status"));
|
|
37005
37119
|
}
|
|
37006
37120
|
const identity = await progress.execute(
|
|
37007
37121
|
"Loading infrastructure status",
|
|
37008
37122
|
async () => validateAWSCredentials()
|
|
37009
37123
|
);
|
|
37010
37124
|
if (!isJsonMode()) {
|
|
37011
|
-
progress.info(`AWS Account: ${
|
|
37125
|
+
progress.info(`AWS Account: ${pc52.cyan(identity.accountId)}`);
|
|
37012
37126
|
}
|
|
37013
37127
|
const region = options.region || await getAWSRegion();
|
|
37014
37128
|
if (!isJsonMode()) {
|
|
37015
|
-
progress.info(`Region: ${
|
|
37129
|
+
progress.info(`Region: ${pc52.cyan(region)}`);
|
|
37016
37130
|
}
|
|
37017
37131
|
const services = [];
|
|
37018
37132
|
try {
|
|
@@ -37064,35 +37178,35 @@ async function status(options) {
|
|
|
37064
37178
|
return;
|
|
37065
37179
|
}
|
|
37066
37180
|
console.log();
|
|
37067
|
-
|
|
37181
|
+
clack49.note(
|
|
37068
37182
|
services.map((s) => {
|
|
37069
37183
|
if (s.status === "deployed") {
|
|
37070
|
-
const details = s.details ?
|
|
37071
|
-
return ` ${
|
|
37184
|
+
const details = s.details ? pc52.dim(` (${s.details})`) : "";
|
|
37185
|
+
return ` ${pc52.green("\u2713")} ${s.name}${details}`;
|
|
37072
37186
|
}
|
|
37073
|
-
return ` ${
|
|
37187
|
+
return ` ${pc52.dim("\u25CB")} ${s.name} ${pc52.dim("(not deployed)")}`;
|
|
37074
37188
|
}).join("\n"),
|
|
37075
37189
|
"Services"
|
|
37076
37190
|
);
|
|
37077
37191
|
const hasDeployedServices = services.some((s) => s.status === "deployed");
|
|
37078
37192
|
if (hasDeployedServices) {
|
|
37079
37193
|
console.log(`
|
|
37080
|
-
${
|
|
37194
|
+
${pc52.bold("Details:")}`);
|
|
37081
37195
|
if (services.find((s) => s.name === "Email")?.status === "deployed") {
|
|
37082
|
-
console.log(` ${
|
|
37196
|
+
console.log(` ${pc52.dim("Email:")} ${pc52.cyan("wraps email status")}`);
|
|
37083
37197
|
}
|
|
37084
37198
|
if (services.find((s) => s.name === "SMS")?.status === "deployed") {
|
|
37085
|
-
console.log(` ${
|
|
37199
|
+
console.log(` ${pc52.dim("SMS:")} ${pc52.cyan("wraps sms status")}`);
|
|
37086
37200
|
}
|
|
37087
37201
|
} else {
|
|
37088
37202
|
console.log(`
|
|
37089
|
-
${
|
|
37090
|
-
console.log(` ${
|
|
37091
|
-
console.log(` ${
|
|
37203
|
+
${pc52.bold("Get started:")}`);
|
|
37204
|
+
console.log(` ${pc52.dim("Deploy email:")} ${pc52.cyan("wraps email init")}`);
|
|
37205
|
+
console.log(` ${pc52.dim("Deploy SMS:")} ${pc52.cyan("wraps sms init")}`);
|
|
37092
37206
|
}
|
|
37093
37207
|
console.log(`
|
|
37094
|
-
${
|
|
37095
|
-
console.log(`${
|
|
37208
|
+
${pc52.bold("Dashboard:")} ${pc52.blue("https://app.wraps.dev")}`);
|
|
37209
|
+
console.log(`${pc52.bold("Docs:")} ${pc52.blue("https://wraps.dev/docs")}
|
|
37096
37210
|
`);
|
|
37097
37211
|
trackCommand("status", {
|
|
37098
37212
|
success: true,
|
|
@@ -37103,9 +37217,9 @@ ${pc51.bold("Dashboard:")} ${pc51.blue("https://app.wraps.dev")}`);
|
|
|
37103
37217
|
|
|
37104
37218
|
// src/commands/sms/destroy.ts
|
|
37105
37219
|
init_esm_shims();
|
|
37106
|
-
import * as
|
|
37220
|
+
import * as clack50 from "@clack/prompts";
|
|
37107
37221
|
import * as pulumi31 from "@pulumi/pulumi";
|
|
37108
|
-
import
|
|
37222
|
+
import pc53 from "picocolors";
|
|
37109
37223
|
|
|
37110
37224
|
// src/infrastructure/sms-stack.ts
|
|
37111
37225
|
init_esm_shims();
|
|
@@ -37796,18 +37910,18 @@ async function createSMSProtectConfigurationWithSDK(configurationSetName, region
|
|
|
37796
37910
|
const existing = await client.send(
|
|
37797
37911
|
new DescribeProtectConfigurationsCommand({})
|
|
37798
37912
|
);
|
|
37799
|
-
for (const
|
|
37800
|
-
if (!(
|
|
37913
|
+
for (const pc66 of existing.ProtectConfigurations || []) {
|
|
37914
|
+
if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
|
|
37801
37915
|
continue;
|
|
37802
37916
|
}
|
|
37803
37917
|
const tagsResponse = await client.send(
|
|
37804
37918
|
new ListTagsForResourceCommand({
|
|
37805
|
-
ResourceArn:
|
|
37919
|
+
ResourceArn: pc66.ProtectConfigurationArn
|
|
37806
37920
|
})
|
|
37807
37921
|
);
|
|
37808
37922
|
const nameTag = tagsResponse.Tags?.find((t) => t.Key === "Name");
|
|
37809
37923
|
if (nameTag?.Value === protectConfigName) {
|
|
37810
|
-
existingProtectConfigId =
|
|
37924
|
+
existingProtectConfigId = pc66.ProtectConfigurationId;
|
|
37811
37925
|
break;
|
|
37812
37926
|
}
|
|
37813
37927
|
}
|
|
@@ -37903,13 +38017,13 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
37903
38017
|
new DescribeProtectConfigurationsCommand({})
|
|
37904
38018
|
);
|
|
37905
38019
|
if (existing.ProtectConfigurations) {
|
|
37906
|
-
for (const
|
|
37907
|
-
if (!(
|
|
38020
|
+
for (const pc66 of existing.ProtectConfigurations) {
|
|
38021
|
+
if (!(pc66.ProtectConfigurationArn && pc66.ProtectConfigurationId)) {
|
|
37908
38022
|
continue;
|
|
37909
38023
|
}
|
|
37910
38024
|
const tagsResponse = await client.send(
|
|
37911
38025
|
new ListTagsForResourceCommand({
|
|
37912
|
-
ResourceArn:
|
|
38026
|
+
ResourceArn: pc66.ProtectConfigurationArn
|
|
37913
38027
|
})
|
|
37914
38028
|
);
|
|
37915
38029
|
const isWrapsManaged = tagsResponse.Tags?.some(
|
|
@@ -37918,7 +38032,7 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
37918
38032
|
if (isWrapsManaged) {
|
|
37919
38033
|
await client.send(
|
|
37920
38034
|
new DeleteProtectConfigurationCommand({
|
|
37921
|
-
ProtectConfigurationId:
|
|
38035
|
+
ProtectConfigurationId: pc66.ProtectConfigurationId
|
|
37922
38036
|
})
|
|
37923
38037
|
);
|
|
37924
38038
|
}
|
|
@@ -37953,8 +38067,8 @@ async function smsDestroy(options) {
|
|
|
37953
38067
|
);
|
|
37954
38068
|
}
|
|
37955
38069
|
if (!isJsonMode()) {
|
|
37956
|
-
|
|
37957
|
-
|
|
38070
|
+
clack50.intro(
|
|
38071
|
+
pc53.bold(
|
|
37958
38072
|
options.preview ? "SMS Infrastructure Destruction Preview" : "SMS Infrastructure Teardown"
|
|
37959
38073
|
)
|
|
37960
38074
|
);
|
|
@@ -37980,15 +38094,15 @@ async function smsDestroy(options) {
|
|
|
37980
38094
|
`Available regions: ${smsConnections.map((c) => c.region).join(", ")}`
|
|
37981
38095
|
);
|
|
37982
38096
|
}
|
|
37983
|
-
const selectedRegion = await
|
|
38097
|
+
const selectedRegion = await clack50.select({
|
|
37984
38098
|
message: "Multiple SMS deployments found. Which region to destroy?",
|
|
37985
38099
|
options: smsConnections.map((conn) => ({
|
|
37986
38100
|
value: conn.region,
|
|
37987
38101
|
label: conn.region
|
|
37988
38102
|
}))
|
|
37989
38103
|
});
|
|
37990
|
-
if (
|
|
37991
|
-
|
|
38104
|
+
if (clack50.isCancel(selectedRegion)) {
|
|
38105
|
+
clack50.cancel("Operation cancelled");
|
|
37992
38106
|
process.exit(0);
|
|
37993
38107
|
}
|
|
37994
38108
|
region = selectedRegion;
|
|
@@ -37999,18 +38113,18 @@ async function smsDestroy(options) {
|
|
|
37999
38113
|
const storedStackName = smsService?.pulumiStackName;
|
|
38000
38114
|
if (!smsService) {
|
|
38001
38115
|
progress.stop();
|
|
38002
|
-
|
|
38116
|
+
clack50.log.warn("No SMS infrastructure found");
|
|
38003
38117
|
process.exit(0);
|
|
38004
38118
|
}
|
|
38005
38119
|
if (!(options.force || options.preview)) {
|
|
38006
|
-
const confirmed = await
|
|
38007
|
-
message:
|
|
38120
|
+
const confirmed = await clack50.confirm({
|
|
38121
|
+
message: pc53.red(
|
|
38008
38122
|
"Are you sure you want to destroy all SMS infrastructure?"
|
|
38009
38123
|
),
|
|
38010
38124
|
initialValue: false
|
|
38011
38125
|
});
|
|
38012
|
-
if (
|
|
38013
|
-
|
|
38126
|
+
if (clack50.isCancel(confirmed) || !confirmed) {
|
|
38127
|
+
clack50.cancel("Destruction cancelled.");
|
|
38014
38128
|
process.exit(0);
|
|
38015
38129
|
}
|
|
38016
38130
|
}
|
|
@@ -38042,8 +38156,8 @@ async function smsDestroy(options) {
|
|
|
38042
38156
|
costEstimate: "Monthly cost after destruction: $0.00",
|
|
38043
38157
|
commandName: "wraps sms destroy"
|
|
38044
38158
|
});
|
|
38045
|
-
|
|
38046
|
-
|
|
38159
|
+
clack50.outro(
|
|
38160
|
+
pc53.green("Preview complete. Run without --preview to destroy.")
|
|
38047
38161
|
);
|
|
38048
38162
|
trackServiceRemoved("sms", {
|
|
38049
38163
|
preview: true,
|
|
@@ -38054,7 +38168,7 @@ async function smsDestroy(options) {
|
|
|
38054
38168
|
progress.stop();
|
|
38055
38169
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38056
38170
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38057
|
-
|
|
38171
|
+
clack50.log.warn("No SMS infrastructure found to preview");
|
|
38058
38172
|
process.exit(0);
|
|
38059
38173
|
}
|
|
38060
38174
|
trackError("PREVIEW_FAILED", "sms destroy", { step: "preview" });
|
|
@@ -38103,7 +38217,7 @@ async function smsDestroy(options) {
|
|
|
38103
38217
|
progress.stop();
|
|
38104
38218
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38105
38219
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38106
|
-
|
|
38220
|
+
clack50.log.warn("No SMS infrastructure found");
|
|
38107
38221
|
if (metadata) {
|
|
38108
38222
|
removeServiceFromConnection(metadata, "sms");
|
|
38109
38223
|
await saveConnectionMetadata(metadata);
|
|
@@ -38116,7 +38230,7 @@ async function smsDestroy(options) {
|
|
|
38116
38230
|
}
|
|
38117
38231
|
trackError("DESTROY_FAILED", "sms destroy", { step: "destroy" });
|
|
38118
38232
|
destroyFailed = true;
|
|
38119
|
-
|
|
38233
|
+
clack50.log.warn(
|
|
38120
38234
|
"Some resources may not have been fully removed. You can re-run this command or clean up manually in the AWS console."
|
|
38121
38235
|
);
|
|
38122
38236
|
}
|
|
@@ -38139,21 +38253,21 @@ async function smsDestroy(options) {
|
|
|
38139
38253
|
return;
|
|
38140
38254
|
}
|
|
38141
38255
|
if (destroyFailed) {
|
|
38142
|
-
|
|
38143
|
-
|
|
38256
|
+
clack50.outro(
|
|
38257
|
+
pc53.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
|
|
38144
38258
|
);
|
|
38145
38259
|
} else {
|
|
38146
|
-
|
|
38260
|
+
clack50.outro(pc53.green("SMS infrastructure has been removed"));
|
|
38147
38261
|
console.log(`
|
|
38148
|
-
${
|
|
38149
|
-
console.log(` ${
|
|
38150
|
-
console.log(` ${
|
|
38151
|
-
console.log(` ${
|
|
38152
|
-
console.log(` ${
|
|
38262
|
+
${pc53.bold("Cleaned up:")}`);
|
|
38263
|
+
console.log(` ${pc53.green("\u2713")} Phone number released`);
|
|
38264
|
+
console.log(` ${pc53.green("\u2713")} Configuration set deleted`);
|
|
38265
|
+
console.log(` ${pc53.green("\u2713")} Event processing infrastructure removed`);
|
|
38266
|
+
console.log(` ${pc53.green("\u2713")} IAM role deleted`);
|
|
38153
38267
|
}
|
|
38154
38268
|
console.log(
|
|
38155
38269
|
`
|
|
38156
|
-
Run ${
|
|
38270
|
+
Run ${pc53.cyan("wraps sms init")} to deploy infrastructure again.
|
|
38157
38271
|
`
|
|
38158
38272
|
);
|
|
38159
38273
|
trackServiceRemoved("sms", {
|
|
@@ -38165,9 +38279,9 @@ Run ${pc52.cyan("wraps sms init")} to deploy infrastructure again.
|
|
|
38165
38279
|
|
|
38166
38280
|
// src/commands/sms/init.ts
|
|
38167
38281
|
init_esm_shims();
|
|
38168
|
-
import * as
|
|
38282
|
+
import * as clack51 from "@clack/prompts";
|
|
38169
38283
|
import * as pulumi32 from "@pulumi/pulumi";
|
|
38170
|
-
import
|
|
38284
|
+
import pc54 from "picocolors";
|
|
38171
38285
|
init_events();
|
|
38172
38286
|
init_aws();
|
|
38173
38287
|
init_fs();
|
|
@@ -38586,7 +38700,7 @@ function validateSMSConfig(config2) {
|
|
|
38586
38700
|
|
|
38587
38701
|
// src/commands/sms/init.ts
|
|
38588
38702
|
async function promptPhoneNumberType() {
|
|
38589
|
-
const result = await
|
|
38703
|
+
const result = await clack51.select({
|
|
38590
38704
|
message: "Select phone number type:",
|
|
38591
38705
|
options: [
|
|
38592
38706
|
{
|
|
@@ -38606,14 +38720,14 @@ async function promptPhoneNumberType() {
|
|
|
38606
38720
|
}
|
|
38607
38721
|
]
|
|
38608
38722
|
});
|
|
38609
|
-
if (
|
|
38610
|
-
|
|
38723
|
+
if (clack51.isCancel(result)) {
|
|
38724
|
+
clack51.cancel("Operation cancelled.");
|
|
38611
38725
|
process.exit(0);
|
|
38612
38726
|
}
|
|
38613
38727
|
return result;
|
|
38614
38728
|
}
|
|
38615
38729
|
async function promptSMSPreset() {
|
|
38616
|
-
const result = await
|
|
38730
|
+
const result = await clack51.select({
|
|
38617
38731
|
message: "Choose configuration preset:",
|
|
38618
38732
|
options: [
|
|
38619
38733
|
{
|
|
@@ -38638,8 +38752,8 @@ async function promptSMSPreset() {
|
|
|
38638
38752
|
}
|
|
38639
38753
|
]
|
|
38640
38754
|
});
|
|
38641
|
-
if (
|
|
38642
|
-
|
|
38755
|
+
if (clack51.isCancel(result)) {
|
|
38756
|
+
clack51.cancel("Operation cancelled.");
|
|
38643
38757
|
process.exit(0);
|
|
38644
38758
|
}
|
|
38645
38759
|
return result;
|
|
@@ -38659,7 +38773,7 @@ var COMMON_COUNTRIES = [
|
|
|
38659
38773
|
{ code: "IN", name: "India" }
|
|
38660
38774
|
];
|
|
38661
38775
|
async function promptAllowedCountries() {
|
|
38662
|
-
const result = await
|
|
38776
|
+
const result = await clack51.multiselect({
|
|
38663
38777
|
message: "Select countries to allow SMS delivery (blocks all others):",
|
|
38664
38778
|
options: COMMON_COUNTRIES.map((c) => ({
|
|
38665
38779
|
value: c.code,
|
|
@@ -38668,14 +38782,14 @@ async function promptAllowedCountries() {
|
|
|
38668
38782
|
initialValues: ["US"],
|
|
38669
38783
|
required: true
|
|
38670
38784
|
});
|
|
38671
|
-
if (
|
|
38672
|
-
|
|
38785
|
+
if (clack51.isCancel(result)) {
|
|
38786
|
+
clack51.cancel("Operation cancelled.");
|
|
38673
38787
|
process.exit(0);
|
|
38674
38788
|
}
|
|
38675
38789
|
return result;
|
|
38676
38790
|
}
|
|
38677
38791
|
async function promptEstimatedSMSVolume() {
|
|
38678
|
-
const result = await
|
|
38792
|
+
const result = await clack51.select({
|
|
38679
38793
|
message: "Estimated messages per month:",
|
|
38680
38794
|
options: [
|
|
38681
38795
|
{ value: 100, label: "< 100 (Testing)" },
|
|
@@ -38685,8 +38799,8 @@ async function promptEstimatedSMSVolume() {
|
|
|
38685
38799
|
{ value: 1e5, label: "50,000+" }
|
|
38686
38800
|
]
|
|
38687
38801
|
});
|
|
38688
|
-
if (
|
|
38689
|
-
|
|
38802
|
+
if (clack51.isCancel(result)) {
|
|
38803
|
+
clack51.cancel("Operation cancelled.");
|
|
38690
38804
|
process.exit(0);
|
|
38691
38805
|
}
|
|
38692
38806
|
return result;
|
|
@@ -38694,7 +38808,7 @@ async function promptEstimatedSMSVolume() {
|
|
|
38694
38808
|
async function init3(options) {
|
|
38695
38809
|
const startTime = Date.now();
|
|
38696
38810
|
if (!isJsonMode()) {
|
|
38697
|
-
|
|
38811
|
+
clack51.intro(pc54.bold("Wraps SMS Infrastructure Setup"));
|
|
38698
38812
|
}
|
|
38699
38813
|
const progress = new DeploymentProgress();
|
|
38700
38814
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -38708,7 +38822,7 @@ async function init3(options) {
|
|
|
38708
38822
|
"Validating AWS credentials",
|
|
38709
38823
|
async () => validateAWSCredentials()
|
|
38710
38824
|
);
|
|
38711
|
-
progress.info(`Connected to AWS account: ${
|
|
38825
|
+
progress.info(`Connected to AWS account: ${pc54.cyan(identity.accountId)}`);
|
|
38712
38826
|
const provider = options.provider || await promptProvider();
|
|
38713
38827
|
const region = options.region || await promptRegion(await getAWSRegion());
|
|
38714
38828
|
let vercelConfig;
|
|
@@ -38720,10 +38834,10 @@ async function init3(options) {
|
|
|
38720
38834
|
region
|
|
38721
38835
|
);
|
|
38722
38836
|
if (existingConnection?.services?.sms) {
|
|
38723
|
-
|
|
38724
|
-
`SMS already configured for account ${
|
|
38837
|
+
clack51.log.warn(
|
|
38838
|
+
`SMS already configured for account ${pc54.cyan(identity.accountId)} in region ${pc54.cyan(region)}`
|
|
38725
38839
|
);
|
|
38726
|
-
|
|
38840
|
+
clack51.log.info(`Use ${pc54.cyan("wraps sms status")} to view current setup`);
|
|
38727
38841
|
process.exit(0);
|
|
38728
38842
|
}
|
|
38729
38843
|
let preset = options.preset;
|
|
@@ -38740,12 +38854,12 @@ async function init3(options) {
|
|
|
38740
38854
|
optOutManagement: true,
|
|
38741
38855
|
sendingEnabled: true
|
|
38742
38856
|
};
|
|
38743
|
-
const enableEventTracking = await
|
|
38857
|
+
const enableEventTracking = await clack51.confirm({
|
|
38744
38858
|
message: "Enable event tracking (EventBridge + DynamoDB)?",
|
|
38745
38859
|
initialValue: false
|
|
38746
38860
|
});
|
|
38747
|
-
if (
|
|
38748
|
-
|
|
38861
|
+
if (clack51.isCancel(enableEventTracking)) {
|
|
38862
|
+
clack51.cancel("Operation cancelled.");
|
|
38749
38863
|
process.exit(0);
|
|
38750
38864
|
}
|
|
38751
38865
|
if (enableEventTracking) {
|
|
@@ -38765,17 +38879,17 @@ async function init3(options) {
|
|
|
38765
38879
|
}
|
|
38766
38880
|
progress.info(
|
|
38767
38881
|
`
|
|
38768
|
-
${
|
|
38882
|
+
${pc54.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
|
|
38769
38883
|
);
|
|
38770
38884
|
const allowedCountries = await promptAllowedCountries();
|
|
38771
38885
|
let aitFiltering = false;
|
|
38772
38886
|
if (smsConfig.phoneNumberType !== "simulator") {
|
|
38773
|
-
const enableAIT = await
|
|
38887
|
+
const enableAIT = await clack51.confirm({
|
|
38774
38888
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
38775
38889
|
initialValue: false
|
|
38776
38890
|
});
|
|
38777
|
-
if (
|
|
38778
|
-
|
|
38891
|
+
if (clack51.isCancel(enableAIT)) {
|
|
38892
|
+
clack51.cancel("Operation cancelled.");
|
|
38779
38893
|
process.exit(0);
|
|
38780
38894
|
}
|
|
38781
38895
|
aitFiltering = enableAIT;
|
|
@@ -38787,21 +38901,21 @@ ${pc53.bold("Fraud Protection")} - Block SMS to countries where you don't do bus
|
|
|
38787
38901
|
};
|
|
38788
38902
|
const estimatedVolume = await promptEstimatedSMSVolume();
|
|
38789
38903
|
progress.info(`
|
|
38790
|
-
${
|
|
38904
|
+
${pc54.bold("Cost Estimate:")}`);
|
|
38791
38905
|
const costSummary = getSMSCostSummary(smsConfig, estimatedVolume);
|
|
38792
|
-
|
|
38906
|
+
clack51.log.info(costSummary);
|
|
38793
38907
|
const warnings = validateSMSConfig(smsConfig);
|
|
38794
38908
|
if (warnings.length > 0) {
|
|
38795
38909
|
progress.info(`
|
|
38796
|
-
${
|
|
38910
|
+
${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
38797
38911
|
for (const warning of warnings) {
|
|
38798
|
-
|
|
38912
|
+
clack51.log.warn(warning);
|
|
38799
38913
|
}
|
|
38800
38914
|
}
|
|
38801
38915
|
if (!(options.yes || options.preview)) {
|
|
38802
38916
|
const confirmed = await confirmDeploy();
|
|
38803
38917
|
if (!confirmed) {
|
|
38804
|
-
|
|
38918
|
+
clack51.cancel("Deployment cancelled.");
|
|
38805
38919
|
process.exit(0);
|
|
38806
38920
|
}
|
|
38807
38921
|
}
|
|
@@ -38861,8 +38975,8 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38861
38975
|
costEstimate: getSMSCostSummary(smsConfig, 0),
|
|
38862
38976
|
commandName: "wraps sms init"
|
|
38863
38977
|
});
|
|
38864
|
-
|
|
38865
|
-
|
|
38978
|
+
clack51.outro(
|
|
38979
|
+
pc54.green("Preview complete. Run without --preview to deploy.")
|
|
38866
38980
|
);
|
|
38867
38981
|
trackServiceInit("sms", true, {
|
|
38868
38982
|
provider,
|
|
@@ -38911,9 +39025,9 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38911
39025
|
} catch (sdkError) {
|
|
38912
39026
|
sdkResourceWarning = true;
|
|
38913
39027
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38914
|
-
|
|
38915
|
-
|
|
38916
|
-
`Run ${
|
|
39028
|
+
clack51.log.warn(`Phone pool creation failed: ${msg}`);
|
|
39029
|
+
clack51.log.info(
|
|
39030
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38917
39031
|
);
|
|
38918
39032
|
}
|
|
38919
39033
|
}
|
|
@@ -38929,9 +39043,9 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38929
39043
|
} catch (sdkError) {
|
|
38930
39044
|
sdkResourceWarning = true;
|
|
38931
39045
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38932
|
-
|
|
38933
|
-
|
|
38934
|
-
`Run ${
|
|
39046
|
+
clack51.log.warn(`Event destination creation failed: ${msg}`);
|
|
39047
|
+
clack51.log.info(
|
|
39048
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38935
39049
|
);
|
|
38936
39050
|
}
|
|
38937
39051
|
}
|
|
@@ -38950,14 +39064,14 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
38950
39064
|
} catch (sdkError) {
|
|
38951
39065
|
sdkResourceWarning = true;
|
|
38952
39066
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
38953
|
-
|
|
38954
|
-
|
|
38955
|
-
`Run ${
|
|
39067
|
+
clack51.log.warn(`Protect configuration creation failed: ${msg}`);
|
|
39068
|
+
clack51.log.info(
|
|
39069
|
+
`Run ${pc54.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
38956
39070
|
);
|
|
38957
39071
|
}
|
|
38958
39072
|
}
|
|
38959
39073
|
if (sdkResourceWarning) {
|
|
38960
|
-
|
|
39074
|
+
clack51.log.warn(
|
|
38961
39075
|
"Some SDK resources failed to create. Core infrastructure is deployed."
|
|
38962
39076
|
);
|
|
38963
39077
|
}
|
|
@@ -39002,47 +39116,47 @@ ${pc53.yellow(pc53.bold("Important Notes:"))}`);
|
|
|
39002
39116
|
return;
|
|
39003
39117
|
}
|
|
39004
39118
|
console.log("\n");
|
|
39005
|
-
|
|
39119
|
+
clack51.log.success(pc54.green(pc54.bold("SMS infrastructure deployed!")));
|
|
39006
39120
|
console.log("\n");
|
|
39007
|
-
|
|
39121
|
+
clack51.note(
|
|
39008
39122
|
[
|
|
39009
|
-
`${
|
|
39010
|
-
`${
|
|
39011
|
-
`${
|
|
39012
|
-
`${
|
|
39013
|
-
outputs.tableName ? `${
|
|
39123
|
+
`${pc54.bold("Phone Number:")} ${pc54.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
39124
|
+
`${pc54.bold("Phone Type:")} ${pc54.cyan(smsConfig.phoneNumberType || "simulator")}`,
|
|
39125
|
+
`${pc54.bold("Config Set:")} ${pc54.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
39126
|
+
`${pc54.bold("Region:")} ${pc54.cyan(outputs.region)}`,
|
|
39127
|
+
outputs.tableName ? `${pc54.bold("History Table:")} ${pc54.cyan(outputs.tableName)}` : "",
|
|
39014
39128
|
"",
|
|
39015
|
-
|
|
39016
|
-
|
|
39129
|
+
pc54.dim("IAM Role:"),
|
|
39130
|
+
pc54.dim(` ${outputs.roleArn}`)
|
|
39017
39131
|
].filter(Boolean).join("\n"),
|
|
39018
39132
|
"SMS Infrastructure"
|
|
39019
39133
|
);
|
|
39020
39134
|
const nextSteps = [];
|
|
39021
39135
|
if (smsConfig.phoneNumberType === "toll-free") {
|
|
39022
39136
|
nextSteps.push(
|
|
39023
|
-
`${
|
|
39137
|
+
`${pc54.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
|
|
39024
39138
|
);
|
|
39025
39139
|
}
|
|
39026
39140
|
nextSteps.push(
|
|
39027
|
-
`${
|
|
39141
|
+
`${pc54.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39028
39142
|
);
|
|
39029
|
-
nextSteps.push(`${
|
|
39143
|
+
nextSteps.push(`${pc54.cyan("wraps sms status")} - View SMS configuration`);
|
|
39030
39144
|
console.log("\n");
|
|
39031
|
-
|
|
39145
|
+
clack51.log.info(pc54.bold("Next steps:"));
|
|
39032
39146
|
for (const step of nextSteps) {
|
|
39033
39147
|
console.log(` ${step}`);
|
|
39034
39148
|
}
|
|
39035
39149
|
console.log("\n");
|
|
39036
|
-
|
|
39037
|
-
console.log(
|
|
39150
|
+
clack51.log.info(pc54.bold("SDK Usage:"));
|
|
39151
|
+
console.log(pc54.dim(" npm install @wraps.dev/sms"));
|
|
39038
39152
|
console.log("");
|
|
39039
|
-
console.log(
|
|
39040
|
-
console.log(
|
|
39041
|
-
console.log(
|
|
39042
|
-
console.log(
|
|
39043
|
-
console.log(
|
|
39044
|
-
console.log(
|
|
39045
|
-
|
|
39153
|
+
console.log(pc54.dim(" import { Wraps } from '@wraps.dev/sms';"));
|
|
39154
|
+
console.log(pc54.dim(" const wraps = new Wraps();"));
|
|
39155
|
+
console.log(pc54.dim(" await wraps.sms.send({"));
|
|
39156
|
+
console.log(pc54.dim(" to: '+14155551234',"));
|
|
39157
|
+
console.log(pc54.dim(" message: 'Your code is 123456',"));
|
|
39158
|
+
console.log(pc54.dim(" });"));
|
|
39159
|
+
clack51.outro(pc54.green("Setup complete!"));
|
|
39046
39160
|
const duration = Date.now() - startTime;
|
|
39047
39161
|
const enabledFeatures = [];
|
|
39048
39162
|
if (smsConfig.tracking?.enabled) {
|
|
@@ -39078,8 +39192,8 @@ init_aws();
|
|
|
39078
39192
|
init_json_output();
|
|
39079
39193
|
init_metadata();
|
|
39080
39194
|
init_output();
|
|
39081
|
-
import * as
|
|
39082
|
-
import
|
|
39195
|
+
import * as clack52 from "@clack/prompts";
|
|
39196
|
+
import pc55 from "picocolors";
|
|
39083
39197
|
async function getPhoneNumberDetails(region) {
|
|
39084
39198
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39085
39199
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
@@ -39099,7 +39213,7 @@ async function getPhoneNumberDetails(region) {
|
|
|
39099
39213
|
return null;
|
|
39100
39214
|
} catch (error) {
|
|
39101
39215
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
39102
|
-
|
|
39216
|
+
clack52.log.error(`Error fetching phone number: ${errorMessage}`);
|
|
39103
39217
|
return null;
|
|
39104
39218
|
}
|
|
39105
39219
|
}
|
|
@@ -39120,7 +39234,7 @@ async function getRegistrationStatus(region, registrationId) {
|
|
|
39120
39234
|
async function smsRegister(options) {
|
|
39121
39235
|
const startTime = Date.now();
|
|
39122
39236
|
if (!isJsonMode()) {
|
|
39123
|
-
|
|
39237
|
+
clack52.intro(pc55.bold("Wraps SMS - Toll-Free Registration"));
|
|
39124
39238
|
}
|
|
39125
39239
|
const progress = new DeploymentProgress();
|
|
39126
39240
|
const identity = await progress.execute(
|
|
@@ -39133,8 +39247,8 @@ async function smsRegister(options) {
|
|
|
39133
39247
|
}
|
|
39134
39248
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39135
39249
|
if (!metadata?.services?.sms) {
|
|
39136
|
-
|
|
39137
|
-
|
|
39250
|
+
clack52.log.error("No SMS infrastructure found.");
|
|
39251
|
+
clack52.log.info(`Run ${pc55.cyan("wraps sms init")} first.`);
|
|
39138
39252
|
process.exit(1);
|
|
39139
39253
|
}
|
|
39140
39254
|
const phoneDetails = await progress.execute(
|
|
@@ -39142,7 +39256,7 @@ async function smsRegister(options) {
|
|
|
39142
39256
|
async () => getPhoneNumberDetails(region)
|
|
39143
39257
|
);
|
|
39144
39258
|
if (!phoneDetails) {
|
|
39145
|
-
|
|
39259
|
+
clack52.log.error("No phone number found.");
|
|
39146
39260
|
process.exit(1);
|
|
39147
39261
|
}
|
|
39148
39262
|
let registrationStatus = null;
|
|
@@ -39168,53 +39282,53 @@ async function smsRegister(options) {
|
|
|
39168
39282
|
}
|
|
39169
39283
|
console.log("");
|
|
39170
39284
|
console.log(
|
|
39171
|
-
`${
|
|
39285
|
+
`${pc55.bold("Phone Number:")} ${pc55.cyan(phoneDetails.phoneNumber)}`
|
|
39172
39286
|
);
|
|
39173
|
-
console.log(`${
|
|
39287
|
+
console.log(`${pc55.bold("Type:")} ${pc55.cyan(phoneDetails.type)}`);
|
|
39174
39288
|
console.log(
|
|
39175
|
-
`${
|
|
39289
|
+
`${pc55.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc55.green(phoneDetails.status) : pc55.yellow(phoneDetails.status)}`
|
|
39176
39290
|
);
|
|
39177
39291
|
if (registrationStatus) {
|
|
39178
|
-
console.log(`${
|
|
39292
|
+
console.log(`${pc55.bold("Registration:")} ${pc55.cyan(registrationStatus)}`);
|
|
39179
39293
|
}
|
|
39180
39294
|
console.log("");
|
|
39181
39295
|
if (phoneDetails.status === "ACTIVE") {
|
|
39182
|
-
|
|
39296
|
+
clack52.log.success("Your phone number is already ACTIVE and ready to use!");
|
|
39183
39297
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePoolsCommand } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39184
39298
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
39185
39299
|
const pools = await client.send(new DescribePoolsCommand({}));
|
|
39186
39300
|
if (!pools.Pools?.length) {
|
|
39187
|
-
|
|
39301
|
+
clack52.log.info("Run `wraps sms sync` to create the phone pool.");
|
|
39188
39302
|
}
|
|
39189
39303
|
process.exit(0);
|
|
39190
39304
|
}
|
|
39191
39305
|
if (phoneDetails.type !== "TOLL_FREE") {
|
|
39192
|
-
|
|
39193
|
-
|
|
39306
|
+
clack52.log.info("Only toll-free numbers require registration.");
|
|
39307
|
+
clack52.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
|
|
39194
39308
|
process.exit(0);
|
|
39195
39309
|
}
|
|
39196
|
-
console.log(
|
|
39310
|
+
console.log(pc55.bold("Toll-Free Registration Required"));
|
|
39197
39311
|
console.log("");
|
|
39198
39312
|
console.log(
|
|
39199
|
-
|
|
39313
|
+
pc55.dim("To send SMS at scale, you must register your toll-free number.")
|
|
39200
39314
|
);
|
|
39201
|
-
console.log(
|
|
39315
|
+
console.log(pc55.dim("This process typically takes 1-15 business days."));
|
|
39202
39316
|
console.log("");
|
|
39203
|
-
console.log(
|
|
39204
|
-
console.log(` ${
|
|
39317
|
+
console.log(pc55.bold("You'll need to provide:"));
|
|
39318
|
+
console.log(` ${pc55.dim("\u2022")} Business name and address`);
|
|
39205
39319
|
console.log(
|
|
39206
|
-
` ${
|
|
39320
|
+
` ${pc55.dim("\u2022")} Use case description (what messages you're sending)`
|
|
39207
39321
|
);
|
|
39208
|
-
console.log(` ${
|
|
39209
|
-
console.log(` ${
|
|
39210
|
-
console.log(` ${
|
|
39322
|
+
console.log(` ${pc55.dim("\u2022")} Sample messages (2-3 examples)`);
|
|
39323
|
+
console.log(` ${pc55.dim("\u2022")} How users opt-in to receive messages`);
|
|
39324
|
+
console.log(` ${pc55.dim("\u2022")} Expected monthly message volume`);
|
|
39211
39325
|
console.log("");
|
|
39212
|
-
const openConsole = await
|
|
39326
|
+
const openConsole = await clack52.confirm({
|
|
39213
39327
|
message: "Open AWS Console to start registration?",
|
|
39214
39328
|
initialValue: true
|
|
39215
39329
|
});
|
|
39216
|
-
if (
|
|
39217
|
-
|
|
39330
|
+
if (clack52.isCancel(openConsole)) {
|
|
39331
|
+
clack52.cancel("Registration cancelled.");
|
|
39218
39332
|
process.exit(0);
|
|
39219
39333
|
}
|
|
39220
39334
|
if (openConsole) {
|
|
@@ -39224,41 +39338,41 @@ async function smsRegister(options) {
|
|
|
39224
39338
|
const execAsync2 = promisify2(exec2);
|
|
39225
39339
|
try {
|
|
39226
39340
|
await execAsync2(`open "${consoleUrl}"`);
|
|
39227
|
-
|
|
39341
|
+
clack52.log.success("Opened AWS Console in your browser.");
|
|
39228
39342
|
} catch {
|
|
39229
39343
|
try {
|
|
39230
39344
|
await execAsync2(`xdg-open "${consoleUrl}"`);
|
|
39231
|
-
|
|
39345
|
+
clack52.log.success("Opened AWS Console in your browser.");
|
|
39232
39346
|
} catch {
|
|
39233
|
-
|
|
39347
|
+
clack52.log.info("Open this URL in your browser:");
|
|
39234
39348
|
console.log(`
|
|
39235
|
-
${
|
|
39349
|
+
${pc55.cyan(consoleUrl)}
|
|
39236
39350
|
`);
|
|
39237
39351
|
}
|
|
39238
39352
|
}
|
|
39239
39353
|
console.log("");
|
|
39240
|
-
console.log(
|
|
39354
|
+
console.log(pc55.bold("Next Steps:"));
|
|
39241
39355
|
console.log(
|
|
39242
|
-
` 1. Click ${
|
|
39356
|
+
` 1. Click ${pc55.cyan("Create registration")} in the AWS Console`
|
|
39243
39357
|
);
|
|
39244
|
-
console.log(` 2. Select ${
|
|
39358
|
+
console.log(` 2. Select ${pc55.cyan("Toll-free number registration")}`);
|
|
39245
39359
|
console.log(" 3. Fill out the business information form");
|
|
39246
39360
|
console.log(" 4. Submit and wait for approval (1-15 business days)");
|
|
39247
39361
|
console.log("");
|
|
39248
39362
|
console.log(
|
|
39249
|
-
|
|
39363
|
+
pc55.dim("Once approved, run `wraps sms sync` to complete setup.")
|
|
39250
39364
|
);
|
|
39251
39365
|
} else {
|
|
39252
39366
|
const consoleUrl = `https://${region}.console.aws.amazon.com/sms-voice/home?region=${region}#/registrations`;
|
|
39253
39367
|
console.log("");
|
|
39254
39368
|
console.log("When you're ready, go to:");
|
|
39255
|
-
console.log(` ${
|
|
39369
|
+
console.log(` ${pc55.cyan(consoleUrl)}`);
|
|
39256
39370
|
}
|
|
39257
39371
|
trackCommand("sms:register", {
|
|
39258
39372
|
success: true,
|
|
39259
39373
|
duration_ms: Date.now() - startTime
|
|
39260
39374
|
});
|
|
39261
|
-
|
|
39375
|
+
clack52.outro(pc55.dim("Good luck with your registration!"));
|
|
39262
39376
|
}
|
|
39263
39377
|
|
|
39264
39378
|
// src/commands/sms/status.ts
|
|
@@ -39271,54 +39385,54 @@ init_metadata();
|
|
|
39271
39385
|
init_output();
|
|
39272
39386
|
init_pulumi();
|
|
39273
39387
|
init_region_resolver();
|
|
39274
|
-
import * as
|
|
39388
|
+
import * as clack53 from "@clack/prompts";
|
|
39275
39389
|
import * as pulumi33 from "@pulumi/pulumi";
|
|
39276
|
-
import
|
|
39390
|
+
import pc56 from "picocolors";
|
|
39277
39391
|
function displaySMSStatus(options) {
|
|
39278
39392
|
const lines = [];
|
|
39279
|
-
lines.push(
|
|
39393
|
+
lines.push(pc56.bold(pc56.green("SMS Infrastructure Active")));
|
|
39280
39394
|
lines.push("");
|
|
39281
|
-
lines.push(
|
|
39395
|
+
lines.push(pc56.bold("Phone Number"));
|
|
39282
39396
|
if (options.phoneNumber) {
|
|
39283
|
-
lines.push(` Number: ${
|
|
39397
|
+
lines.push(` Number: ${pc56.cyan(options.phoneNumber)}`);
|
|
39284
39398
|
} else {
|
|
39285
|
-
lines.push(` Number: ${
|
|
39399
|
+
lines.push(` Number: ${pc56.yellow("Provisioning...")}`);
|
|
39286
39400
|
}
|
|
39287
|
-
lines.push(` Type: ${
|
|
39401
|
+
lines.push(` Type: ${pc56.cyan(options.phoneNumberType || "simulator")}`);
|
|
39288
39402
|
lines.push("");
|
|
39289
|
-
lines.push(
|
|
39290
|
-
lines.push(` Region: ${
|
|
39403
|
+
lines.push(pc56.bold("Configuration"));
|
|
39404
|
+
lines.push(` Region: ${pc56.cyan(options.region)}`);
|
|
39291
39405
|
if (options.preset) {
|
|
39292
|
-
lines.push(` Preset: ${
|
|
39406
|
+
lines.push(` Preset: ${pc56.cyan(options.preset)}`);
|
|
39293
39407
|
}
|
|
39294
39408
|
if (options.configSetName) {
|
|
39295
|
-
lines.push(` Config Set: ${
|
|
39409
|
+
lines.push(` Config Set: ${pc56.cyan(options.configSetName)}`);
|
|
39296
39410
|
}
|
|
39297
39411
|
lines.push("");
|
|
39298
|
-
lines.push(
|
|
39412
|
+
lines.push(pc56.bold("Features"));
|
|
39299
39413
|
lines.push(
|
|
39300
|
-
` Event Tracking: ${options.eventTracking ?
|
|
39414
|
+
` Event Tracking: ${options.eventTracking ? pc56.green("Enabled") : pc56.dim("Disabled")}`
|
|
39301
39415
|
);
|
|
39302
39416
|
if (options.tableName) {
|
|
39303
|
-
lines.push(` Message History: ${
|
|
39304
|
-
lines.push(` Table: ${
|
|
39417
|
+
lines.push(` Message History: ${pc56.green("Enabled")}`);
|
|
39418
|
+
lines.push(` Table: ${pc56.dim(options.tableName)}`);
|
|
39305
39419
|
}
|
|
39306
39420
|
if (options.queueUrl) {
|
|
39307
|
-
lines.push(` Event Queue: ${
|
|
39421
|
+
lines.push(` Event Queue: ${pc56.green("Enabled")}`);
|
|
39308
39422
|
}
|
|
39309
39423
|
lines.push("");
|
|
39310
39424
|
if (options.roleArn) {
|
|
39311
|
-
lines.push(
|
|
39312
|
-
lines.push(` ${
|
|
39425
|
+
lines.push(pc56.bold("IAM Role"));
|
|
39426
|
+
lines.push(` ${pc56.dim(options.roleArn)}`);
|
|
39313
39427
|
}
|
|
39314
|
-
|
|
39428
|
+
clack53.note(lines.join("\n"), "SMS Status");
|
|
39315
39429
|
}
|
|
39316
39430
|
async function smsStatus(options) {
|
|
39317
39431
|
await ensurePulumiInstalled();
|
|
39318
39432
|
const startTime = Date.now();
|
|
39319
39433
|
const progress = new DeploymentProgress();
|
|
39320
39434
|
if (!isJsonMode()) {
|
|
39321
|
-
|
|
39435
|
+
clack53.intro(pc56.bold("Wraps SMS Status"));
|
|
39322
39436
|
}
|
|
39323
39437
|
const identity = await progress.execute(
|
|
39324
39438
|
"Loading SMS infrastructure status",
|
|
@@ -39333,10 +39447,10 @@ async function smsStatus(options) {
|
|
|
39333
39447
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39334
39448
|
if (!metadata?.services?.sms) {
|
|
39335
39449
|
progress.stop();
|
|
39336
|
-
|
|
39450
|
+
clack53.log.error("No SMS infrastructure found");
|
|
39337
39451
|
console.log(
|
|
39338
39452
|
`
|
|
39339
|
-
Run ${
|
|
39453
|
+
Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39340
39454
|
`
|
|
39341
39455
|
);
|
|
39342
39456
|
process.exit(1);
|
|
@@ -39372,25 +39486,25 @@ Run ${pc55.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39372
39486
|
}
|
|
39373
39487
|
displaySMSStatus(smsStatusData);
|
|
39374
39488
|
console.log("");
|
|
39375
|
-
|
|
39489
|
+
clack53.log.info(pc56.bold("Commands:"));
|
|
39376
39490
|
console.log(
|
|
39377
|
-
` ${
|
|
39491
|
+
` ${pc56.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39378
39492
|
);
|
|
39379
|
-
console.log(` ${
|
|
39493
|
+
console.log(` ${pc56.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
|
|
39380
39494
|
trackCommand("sms:status", {
|
|
39381
39495
|
success: true,
|
|
39382
39496
|
phone_type: smsConfig?.phoneNumberType,
|
|
39383
39497
|
event_tracking: smsConfig?.eventTracking?.enabled,
|
|
39384
39498
|
duration_ms: Date.now() - startTime
|
|
39385
39499
|
});
|
|
39386
|
-
|
|
39500
|
+
clack53.outro(pc56.dim("SMS infrastructure is ready"));
|
|
39387
39501
|
}
|
|
39388
39502
|
|
|
39389
39503
|
// src/commands/sms/sync.ts
|
|
39390
39504
|
init_esm_shims();
|
|
39391
|
-
import * as
|
|
39505
|
+
import * as clack54 from "@clack/prompts";
|
|
39392
39506
|
import * as pulumi34 from "@pulumi/pulumi";
|
|
39393
|
-
import
|
|
39507
|
+
import pc57 from "picocolors";
|
|
39394
39508
|
init_events();
|
|
39395
39509
|
init_aws();
|
|
39396
39510
|
init_errors();
|
|
@@ -39403,7 +39517,7 @@ async function smsSync(options) {
|
|
|
39403
39517
|
await ensurePulumiInstalled();
|
|
39404
39518
|
const startTime = Date.now();
|
|
39405
39519
|
if (!isJsonMode()) {
|
|
39406
|
-
|
|
39520
|
+
clack54.intro(pc57.bold("Wraps SMS Infrastructure Sync"));
|
|
39407
39521
|
}
|
|
39408
39522
|
const progress = new DeploymentProgress();
|
|
39409
39523
|
const identity = await progress.execute(
|
|
@@ -39415,10 +39529,10 @@ async function smsSync(options) {
|
|
|
39415
39529
|
const smsService = metadata?.services?.sms;
|
|
39416
39530
|
if (!smsService?.config) {
|
|
39417
39531
|
progress.stop();
|
|
39418
|
-
|
|
39532
|
+
clack54.log.error("No SMS infrastructure found to sync");
|
|
39419
39533
|
console.log(
|
|
39420
39534
|
`
|
|
39421
|
-
Run ${
|
|
39535
|
+
Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
39422
39536
|
`
|
|
39423
39537
|
);
|
|
39424
39538
|
process.exit(1);
|
|
@@ -39427,18 +39541,18 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39427
39541
|
const storedStackName = smsService.pulumiStackName;
|
|
39428
39542
|
progress.info("Found existing SMS configuration");
|
|
39429
39543
|
progress.info(
|
|
39430
|
-
`Phone type: ${
|
|
39544
|
+
`Phone type: ${pc57.cyan(smsConfig.phoneNumberType || "simulator")}`
|
|
39431
39545
|
);
|
|
39432
39546
|
progress.info(
|
|
39433
|
-
`Event tracking: ${
|
|
39547
|
+
`Event tracking: ${pc57.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
|
|
39434
39548
|
);
|
|
39435
39549
|
if (!options.yes) {
|
|
39436
|
-
const confirmed = await
|
|
39550
|
+
const confirmed = await clack54.confirm({
|
|
39437
39551
|
message: "Sync SMS infrastructure? This will update Lambda code and recreate any missing resources.",
|
|
39438
39552
|
initialValue: true
|
|
39439
39553
|
});
|
|
39440
|
-
if (
|
|
39441
|
-
|
|
39554
|
+
if (clack54.isCancel(confirmed) || !confirmed) {
|
|
39555
|
+
clack54.cancel("Sync cancelled.");
|
|
39442
39556
|
process.exit(0);
|
|
39443
39557
|
}
|
|
39444
39558
|
}
|
|
@@ -39543,7 +39657,7 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39543
39657
|
throw errors.stackLocked();
|
|
39544
39658
|
}
|
|
39545
39659
|
trackError("SYNC_FAILED", "sms:sync", { step: "sync" });
|
|
39546
|
-
|
|
39660
|
+
clack54.log.error(`SMS sync failed: ${errorMessage}`);
|
|
39547
39661
|
process.exit(1);
|
|
39548
39662
|
}
|
|
39549
39663
|
if (metadata && smsService) {
|
|
@@ -39563,7 +39677,7 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39563
39677
|
return;
|
|
39564
39678
|
}
|
|
39565
39679
|
console.log("\n");
|
|
39566
|
-
|
|
39680
|
+
clack54.log.success(pc57.green("SMS infrastructure synced successfully!"));
|
|
39567
39681
|
const changes = [];
|
|
39568
39682
|
if (outputs.lambdaFunctions?.length) {
|
|
39569
39683
|
changes.push("Lambda functions updated");
|
|
@@ -39571,13 +39685,13 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39571
39685
|
changes.push("SDK resources verified");
|
|
39572
39686
|
console.log("");
|
|
39573
39687
|
for (const change of changes) {
|
|
39574
|
-
console.log(` ${
|
|
39688
|
+
console.log(` ${pc57.green("\u2713")} ${change}`);
|
|
39575
39689
|
}
|
|
39576
39690
|
trackCommand("sms:sync", {
|
|
39577
39691
|
success: true,
|
|
39578
39692
|
duration_ms: Date.now() - startTime
|
|
39579
39693
|
});
|
|
39580
|
-
|
|
39694
|
+
clack54.outro(pc57.green("Sync complete!"));
|
|
39581
39695
|
}
|
|
39582
39696
|
|
|
39583
39697
|
// src/commands/sms/test.ts
|
|
@@ -39592,8 +39706,8 @@ import {
|
|
|
39592
39706
|
PinpointSMSVoiceV2Client as PinpointSMSVoiceV2Client3,
|
|
39593
39707
|
SendTextMessageCommand
|
|
39594
39708
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
39595
|
-
import * as
|
|
39596
|
-
import
|
|
39709
|
+
import * as clack55 from "@clack/prompts";
|
|
39710
|
+
import pc58 from "picocolors";
|
|
39597
39711
|
|
|
39598
39712
|
// src/utils/sms/validation.ts
|
|
39599
39713
|
init_esm_shims();
|
|
@@ -39616,7 +39730,7 @@ async function smsTest(options) {
|
|
|
39616
39730
|
const startTime = Date.now();
|
|
39617
39731
|
const progress = new DeploymentProgress();
|
|
39618
39732
|
if (!isJsonMode()) {
|
|
39619
|
-
|
|
39733
|
+
clack55.intro(pc58.bold("Wraps SMS Test"));
|
|
39620
39734
|
}
|
|
39621
39735
|
const identity = await progress.execute(
|
|
39622
39736
|
"Validating AWS credentials",
|
|
@@ -39626,10 +39740,10 @@ async function smsTest(options) {
|
|
|
39626
39740
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39627
39741
|
if (!metadata?.services?.sms) {
|
|
39628
39742
|
progress.stop();
|
|
39629
|
-
|
|
39743
|
+
clack55.log.error("No SMS infrastructure found");
|
|
39630
39744
|
console.log(
|
|
39631
39745
|
`
|
|
39632
|
-
Run ${
|
|
39746
|
+
Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39633
39747
|
`
|
|
39634
39748
|
);
|
|
39635
39749
|
process.exit(1);
|
|
@@ -39643,7 +39757,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39643
39757
|
);
|
|
39644
39758
|
}
|
|
39645
39759
|
if (!toNumber) {
|
|
39646
|
-
const destinationType = await
|
|
39760
|
+
const destinationType = await clack55.select({
|
|
39647
39761
|
message: "Choose destination number:",
|
|
39648
39762
|
options: [
|
|
39649
39763
|
{
|
|
@@ -39658,25 +39772,25 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39658
39772
|
}
|
|
39659
39773
|
]
|
|
39660
39774
|
});
|
|
39661
|
-
if (
|
|
39662
|
-
|
|
39775
|
+
if (clack55.isCancel(destinationType)) {
|
|
39776
|
+
clack55.cancel("Operation cancelled.");
|
|
39663
39777
|
process.exit(0);
|
|
39664
39778
|
}
|
|
39665
39779
|
if (destinationType === "simulator") {
|
|
39666
|
-
const simResult = await
|
|
39780
|
+
const simResult = await clack55.select({
|
|
39667
39781
|
message: "Select simulator destination:",
|
|
39668
39782
|
options: SIMULATOR_DESTINATIONS.map((sim) => ({
|
|
39669
39783
|
value: sim.number,
|
|
39670
39784
|
label: `${sim.number} | ${sim.country}`
|
|
39671
39785
|
}))
|
|
39672
39786
|
});
|
|
39673
|
-
if (
|
|
39674
|
-
|
|
39787
|
+
if (clack55.isCancel(simResult)) {
|
|
39788
|
+
clack55.cancel("Operation cancelled.");
|
|
39675
39789
|
process.exit(0);
|
|
39676
39790
|
}
|
|
39677
39791
|
toNumber = simResult;
|
|
39678
39792
|
} else {
|
|
39679
|
-
const result = await
|
|
39793
|
+
const result = await clack55.text({
|
|
39680
39794
|
message: "Enter destination phone number (E.164 format):",
|
|
39681
39795
|
placeholder: "+14155551234",
|
|
39682
39796
|
validate: (value) => {
|
|
@@ -39689,22 +39803,22 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39689
39803
|
return;
|
|
39690
39804
|
}
|
|
39691
39805
|
});
|
|
39692
|
-
if (
|
|
39693
|
-
|
|
39806
|
+
if (clack55.isCancel(result)) {
|
|
39807
|
+
clack55.cancel("Operation cancelled.");
|
|
39694
39808
|
process.exit(0);
|
|
39695
39809
|
}
|
|
39696
39810
|
toNumber = result;
|
|
39697
39811
|
}
|
|
39698
39812
|
} else if (!isValidPhoneNumber(toNumber)) {
|
|
39699
39813
|
progress.stop();
|
|
39700
|
-
|
|
39814
|
+
clack55.log.error(
|
|
39701
39815
|
`Invalid phone number format: ${toNumber}. Use E.164 format (e.g., +14155551234)`
|
|
39702
39816
|
);
|
|
39703
39817
|
process.exit(1);
|
|
39704
39818
|
}
|
|
39705
39819
|
let message = options.message;
|
|
39706
39820
|
if (!message) {
|
|
39707
|
-
const result = await
|
|
39821
|
+
const result = await clack55.text({
|
|
39708
39822
|
message: "Enter test message:",
|
|
39709
39823
|
placeholder: "Hello from Wraps SMS!",
|
|
39710
39824
|
defaultValue: "Hello from Wraps SMS! This is a test message.",
|
|
@@ -39718,8 +39832,8 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39718
39832
|
return;
|
|
39719
39833
|
}
|
|
39720
39834
|
});
|
|
39721
|
-
if (
|
|
39722
|
-
|
|
39835
|
+
if (clack55.isCancel(result)) {
|
|
39836
|
+
clack55.cancel("Operation cancelled.");
|
|
39723
39837
|
process.exit(0);
|
|
39724
39838
|
}
|
|
39725
39839
|
message = result;
|
|
@@ -39758,16 +39872,16 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39758
39872
|
return;
|
|
39759
39873
|
}
|
|
39760
39874
|
console.log("\n");
|
|
39761
|
-
|
|
39875
|
+
clack55.log.success(pc58.green("Test SMS sent successfully!"));
|
|
39762
39876
|
console.log("");
|
|
39763
|
-
|
|
39877
|
+
clack55.note(
|
|
39764
39878
|
[
|
|
39765
|
-
`${
|
|
39766
|
-
`${
|
|
39767
|
-
`${
|
|
39768
|
-
`${
|
|
39879
|
+
`${pc58.bold("Message ID:")} ${pc58.cyan(messageId || "unknown")}`,
|
|
39880
|
+
`${pc58.bold("To:")} ${pc58.cyan(toNumber)}`,
|
|
39881
|
+
`${pc58.bold("Message:")} ${message}`,
|
|
39882
|
+
`${pc58.bold("Type:")} ${pc58.cyan(smsConfig?.phoneNumberType || "simulator")}`,
|
|
39769
39883
|
"",
|
|
39770
|
-
|
|
39884
|
+
pc58.dim(
|
|
39771
39885
|
smsConfig?.phoneNumberType === "simulator" ? "Note: Simulator messages are not actually delivered" : "Check your phone for the message!"
|
|
39772
39886
|
)
|
|
39773
39887
|
].join("\n"),
|
|
@@ -39775,11 +39889,11 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39775
39889
|
);
|
|
39776
39890
|
if (smsConfig?.eventTracking?.enabled) {
|
|
39777
39891
|
console.log("");
|
|
39778
|
-
|
|
39779
|
-
|
|
39892
|
+
clack55.log.info(
|
|
39893
|
+
pc58.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
|
|
39780
39894
|
);
|
|
39781
39895
|
}
|
|
39782
|
-
|
|
39896
|
+
clack55.outro(pc58.green("Test complete!"));
|
|
39783
39897
|
} catch (error) {
|
|
39784
39898
|
progress.stop();
|
|
39785
39899
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -39791,33 +39905,33 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39791
39905
|
});
|
|
39792
39906
|
const errorName = error instanceof Error ? error.name : "";
|
|
39793
39907
|
if (errorName === "ConflictException" || errorMessage.includes("opt-out")) {
|
|
39794
|
-
|
|
39908
|
+
clack55.log.error("Destination number has opted out of messages");
|
|
39795
39909
|
console.log("\nThe recipient has opted out of receiving SMS messages.\n");
|
|
39796
39910
|
} else if (errorName === "ThrottlingException" || errorMessage.includes("spending limit")) {
|
|
39797
|
-
|
|
39911
|
+
clack55.log.error("SMS rate or spending limit reached");
|
|
39798
39912
|
console.log(
|
|
39799
39913
|
"\nCheck your AWS account SMS spending limits in the console.\n"
|
|
39800
39914
|
);
|
|
39801
39915
|
} else if (errorName === "ValidationException") {
|
|
39802
|
-
|
|
39916
|
+
clack55.log.error(`Invalid request: ${errorMessage}`);
|
|
39803
39917
|
} else if (errorMessage.includes("not verified") || errorMessage.includes("not registered")) {
|
|
39804
|
-
|
|
39918
|
+
clack55.log.error("Toll-free number registration is not complete");
|
|
39805
39919
|
console.log(
|
|
39806
39920
|
`
|
|
39807
|
-
Run ${
|
|
39921
|
+
Run ${pc58.cyan("wraps sms register")} to check registration status.
|
|
39808
39922
|
`
|
|
39809
39923
|
);
|
|
39810
39924
|
} else if (errorName === "AccessDeniedException") {
|
|
39811
|
-
|
|
39925
|
+
clack55.log.error(
|
|
39812
39926
|
"Permission denied \u2014 IAM role may be missing SMS send permissions"
|
|
39813
39927
|
);
|
|
39814
39928
|
console.log(
|
|
39815
39929
|
`
|
|
39816
|
-
Run ${
|
|
39930
|
+
Run ${pc58.cyan("wraps sms upgrade")} to update IAM policies.
|
|
39817
39931
|
`
|
|
39818
39932
|
);
|
|
39819
39933
|
} else {
|
|
39820
|
-
|
|
39934
|
+
clack55.log.error(`Failed to send SMS: ${errorMessage}`);
|
|
39821
39935
|
}
|
|
39822
39936
|
process.exit(1);
|
|
39823
39937
|
}
|
|
@@ -39825,9 +39939,9 @@ Run ${pc57.cyan("wraps sms upgrade")} to update IAM policies.
|
|
|
39825
39939
|
|
|
39826
39940
|
// src/commands/sms/upgrade.ts
|
|
39827
39941
|
init_esm_shims();
|
|
39828
|
-
import * as
|
|
39942
|
+
import * as clack56 from "@clack/prompts";
|
|
39829
39943
|
import * as pulumi35 from "@pulumi/pulumi";
|
|
39830
|
-
import
|
|
39944
|
+
import pc59 from "picocolors";
|
|
39831
39945
|
init_events();
|
|
39832
39946
|
init_aws();
|
|
39833
39947
|
init_errors();
|
|
@@ -39842,7 +39956,7 @@ async function smsUpgrade(options) {
|
|
|
39842
39956
|
const startTime = Date.now();
|
|
39843
39957
|
let upgradeAction = "";
|
|
39844
39958
|
if (!isJsonMode()) {
|
|
39845
|
-
|
|
39959
|
+
clack56.intro(pc59.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
|
|
39846
39960
|
}
|
|
39847
39961
|
const progress = new DeploymentProgress();
|
|
39848
39962
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -39856,7 +39970,7 @@ async function smsUpgrade(options) {
|
|
|
39856
39970
|
"Validating AWS credentials",
|
|
39857
39971
|
async () => validateAWSCredentials()
|
|
39858
39972
|
);
|
|
39859
|
-
progress.info(`Connected to AWS account: ${
|
|
39973
|
+
progress.info(`Connected to AWS account: ${pc59.cyan(identity.accountId)}`);
|
|
39860
39974
|
const region = await resolveRegionForCommand({
|
|
39861
39975
|
accountId: identity.accountId,
|
|
39862
39976
|
optionRegion: options.region,
|
|
@@ -39865,35 +39979,35 @@ async function smsUpgrade(options) {
|
|
|
39865
39979
|
});
|
|
39866
39980
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39867
39981
|
if (!metadata) {
|
|
39868
|
-
|
|
39869
|
-
`No Wraps connection found for account ${
|
|
39982
|
+
clack56.log.error(
|
|
39983
|
+
`No Wraps connection found for account ${pc59.cyan(identity.accountId)} in region ${pc59.cyan(region)}`
|
|
39870
39984
|
);
|
|
39871
|
-
|
|
39872
|
-
`Use ${
|
|
39985
|
+
clack56.log.info(
|
|
39986
|
+
`Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
|
|
39873
39987
|
);
|
|
39874
39988
|
process.exit(1);
|
|
39875
39989
|
}
|
|
39876
39990
|
if (!metadata.services.sms) {
|
|
39877
|
-
|
|
39878
|
-
|
|
39879
|
-
`Use ${
|
|
39991
|
+
clack56.log.error("No SMS infrastructure found");
|
|
39992
|
+
clack56.log.info(
|
|
39993
|
+
`Use ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.`
|
|
39880
39994
|
);
|
|
39881
39995
|
process.exit(1);
|
|
39882
39996
|
}
|
|
39883
39997
|
progress.info(`Found existing connection created: ${metadata.timestamp}`);
|
|
39884
39998
|
console.log(`
|
|
39885
|
-
${
|
|
39999
|
+
${pc59.bold("Current Configuration:")}
|
|
39886
40000
|
`);
|
|
39887
40001
|
if (metadata.services.sms.preset) {
|
|
39888
|
-
console.log(` Preset: ${
|
|
40002
|
+
console.log(` Preset: ${pc59.cyan(metadata.services.sms.preset)}`);
|
|
39889
40003
|
} else {
|
|
39890
|
-
console.log(` Preset: ${
|
|
40004
|
+
console.log(` Preset: ${pc59.cyan("custom")}`);
|
|
39891
40005
|
}
|
|
39892
40006
|
const config2 = metadata.services.sms.config;
|
|
39893
40007
|
if (!config2) {
|
|
39894
|
-
|
|
39895
|
-
|
|
39896
|
-
`Use ${
|
|
40008
|
+
clack56.log.error("No SMS configuration found in metadata");
|
|
40009
|
+
clack56.log.info(
|
|
40010
|
+
`Use ${pc59.cyan("wraps sms init")} to create new infrastructure.`
|
|
39897
40011
|
);
|
|
39898
40012
|
process.exit(1);
|
|
39899
40013
|
}
|
|
@@ -39905,45 +40019,45 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39905
40019
|
"short-code": "Short code ($995+/mo, 100+ MPS)"
|
|
39906
40020
|
};
|
|
39907
40021
|
console.log(
|
|
39908
|
-
` Phone Type: ${
|
|
40022
|
+
` Phone Type: ${pc59.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
|
|
39909
40023
|
);
|
|
39910
40024
|
}
|
|
39911
40025
|
if (config2.tracking?.enabled) {
|
|
39912
|
-
console.log(` ${
|
|
40026
|
+
console.log(` ${pc59.green("\u2713")} Delivery Tracking`);
|
|
39913
40027
|
if (config2.tracking.linkTracking) {
|
|
39914
|
-
console.log(` ${
|
|
40028
|
+
console.log(` ${pc59.dim("\u2514\u2500")} Link click tracking enabled`);
|
|
39915
40029
|
}
|
|
39916
40030
|
}
|
|
39917
40031
|
if (config2.eventTracking?.enabled) {
|
|
39918
|
-
console.log(` ${
|
|
40032
|
+
console.log(` ${pc59.green("\u2713")} Event Tracking (SNS)`);
|
|
39919
40033
|
if (config2.eventTracking.dynamoDBHistory) {
|
|
39920
40034
|
console.log(
|
|
39921
|
-
` ${
|
|
40035
|
+
` ${pc59.dim("\u2514\u2500")} Message History: ${pc59.cyan(config2.eventTracking.archiveRetention || "90days")}`
|
|
39922
40036
|
);
|
|
39923
40037
|
}
|
|
39924
40038
|
}
|
|
39925
40039
|
if (config2.messageArchiving?.enabled) {
|
|
39926
40040
|
console.log(
|
|
39927
|
-
` ${
|
|
40041
|
+
` ${pc59.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
|
|
39928
40042
|
);
|
|
39929
40043
|
}
|
|
39930
40044
|
if (config2.optOutManagement) {
|
|
39931
|
-
console.log(` ${
|
|
40045
|
+
console.log(` ${pc59.green("\u2713")} Opt-out Management`);
|
|
39932
40046
|
}
|
|
39933
40047
|
if (config2.protectConfiguration?.enabled) {
|
|
39934
40048
|
const countries = config2.protectConfiguration.allowedCountries?.join(", ") || "US";
|
|
39935
|
-
console.log(` ${
|
|
39936
|
-
console.log(` ${
|
|
40049
|
+
console.log(` ${pc59.green("\u2713")} Fraud Protection`);
|
|
40050
|
+
console.log(` ${pc59.dim("\u2514\u2500")} Allowed countries: ${pc59.cyan(countries)}`);
|
|
39937
40051
|
if (config2.protectConfiguration.aitFiltering) {
|
|
39938
|
-
console.log(` ${
|
|
40052
|
+
console.log(` ${pc59.dim("\u2514\u2500")} AIT filtering: ${pc59.cyan("enabled")}`);
|
|
39939
40053
|
}
|
|
39940
40054
|
} else {
|
|
39941
|
-
console.log(` ${
|
|
40055
|
+
console.log(` ${pc59.dim("\u25CB")} Fraud Protection (not configured)`);
|
|
39942
40056
|
}
|
|
39943
40057
|
const currentCostData = calculateSMSCosts(config2, 1e4);
|
|
39944
40058
|
console.log(
|
|
39945
40059
|
`
|
|
39946
|
-
Estimated Cost: ${
|
|
40060
|
+
Estimated Cost: ${pc59.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
39947
40061
|
);
|
|
39948
40062
|
console.log("");
|
|
39949
40063
|
const phoneTypeLabels = {
|
|
@@ -39952,7 +40066,7 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39952
40066
|
"10dlc": "10DLC",
|
|
39953
40067
|
"short-code": "Short code"
|
|
39954
40068
|
};
|
|
39955
|
-
upgradeAction = await
|
|
40069
|
+
upgradeAction = await clack56.select({
|
|
39956
40070
|
message: "What would you like to do?",
|
|
39957
40071
|
options: [
|
|
39958
40072
|
{
|
|
@@ -39992,8 +40106,8 @@ ${pc58.bold("Current Configuration:")}
|
|
|
39992
40106
|
}
|
|
39993
40107
|
]
|
|
39994
40108
|
});
|
|
39995
|
-
if (
|
|
39996
|
-
|
|
40109
|
+
if (clack56.isCancel(upgradeAction)) {
|
|
40110
|
+
clack56.cancel("Upgrade cancelled.");
|
|
39997
40111
|
process.exit(0);
|
|
39998
40112
|
}
|
|
39999
40113
|
let updatedConfig = { ...config2 };
|
|
@@ -40034,65 +40148,65 @@ ${pc58.bold("Current Configuration:")}
|
|
|
40034
40148
|
hint: p.hint
|
|
40035
40149
|
}));
|
|
40036
40150
|
if (availableTypes.length === 0) {
|
|
40037
|
-
|
|
40151
|
+
clack56.log.warn(
|
|
40038
40152
|
"Already on highest phone number tier. Contact AWS for dedicated short codes."
|
|
40039
40153
|
);
|
|
40040
40154
|
process.exit(0);
|
|
40041
40155
|
}
|
|
40042
|
-
const selectedType = await
|
|
40156
|
+
const selectedType = await clack56.select({
|
|
40043
40157
|
message: "Select new phone number type:",
|
|
40044
40158
|
options: availableTypes
|
|
40045
40159
|
});
|
|
40046
|
-
if (
|
|
40047
|
-
|
|
40160
|
+
if (clack56.isCancel(selectedType)) {
|
|
40161
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40048
40162
|
process.exit(0);
|
|
40049
40163
|
}
|
|
40050
40164
|
if (selectedType === "toll-free") {
|
|
40051
40165
|
console.log(
|
|
40052
40166
|
`
|
|
40053
|
-
${
|
|
40167
|
+
${pc59.yellow("\u26A0")} ${pc59.bold("Toll-free Registration Required")}
|
|
40054
40168
|
`
|
|
40055
40169
|
);
|
|
40056
40170
|
console.log(
|
|
40057
|
-
|
|
40171
|
+
pc59.dim("Toll-free numbers require carrier registration before")
|
|
40058
40172
|
);
|
|
40059
40173
|
console.log(
|
|
40060
|
-
|
|
40174
|
+
pc59.dim("they can send messages at scale. After deployment:\n")
|
|
40061
40175
|
);
|
|
40062
40176
|
console.log(
|
|
40063
|
-
` 1. Run ${
|
|
40177
|
+
` 1. Run ${pc59.cyan("wraps sms register")} to start registration`
|
|
40064
40178
|
);
|
|
40065
40179
|
console.log(" 2. Submit your business use case information");
|
|
40066
40180
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40067
40181
|
console.log(
|
|
40068
|
-
|
|
40182
|
+
pc59.dim("\nUntil verified, sending is limited to low volume.\n")
|
|
40069
40183
|
);
|
|
40070
|
-
const confirmTollFree = await
|
|
40184
|
+
const confirmTollFree = await clack56.confirm({
|
|
40071
40185
|
message: "Continue with toll-free number request?",
|
|
40072
40186
|
initialValue: true
|
|
40073
40187
|
});
|
|
40074
|
-
if (
|
|
40075
|
-
|
|
40188
|
+
if (clack56.isCancel(confirmTollFree) || !confirmTollFree) {
|
|
40189
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40076
40190
|
process.exit(0);
|
|
40077
40191
|
}
|
|
40078
40192
|
}
|
|
40079
40193
|
if (selectedType === "10dlc") {
|
|
40080
40194
|
console.log(
|
|
40081
40195
|
`
|
|
40082
|
-
${
|
|
40196
|
+
${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
40083
40197
|
`
|
|
40084
40198
|
);
|
|
40085
|
-
console.log(
|
|
40199
|
+
console.log(pc59.dim("10DLC requires brand and campaign registration:"));
|
|
40086
40200
|
console.log(" \u2022 Brand registration: one-time $4 fee");
|
|
40087
40201
|
console.log(" \u2022 Campaign registration: $15/mo per campaign");
|
|
40088
40202
|
console.log(" \u2022 Verification takes 1-7 business days");
|
|
40089
40203
|
console.log("");
|
|
40090
|
-
const confirm10DLC = await
|
|
40204
|
+
const confirm10DLC = await clack56.confirm({
|
|
40091
40205
|
message: "Continue with 10DLC number request?",
|
|
40092
40206
|
initialValue: true
|
|
40093
40207
|
});
|
|
40094
|
-
if (
|
|
40095
|
-
|
|
40208
|
+
if (clack56.isCancel(confirm10DLC) || !confirm10DLC) {
|
|
40209
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40096
40210
|
process.exit(0);
|
|
40097
40211
|
}
|
|
40098
40212
|
}
|
|
@@ -40117,15 +40231,15 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40117
40231
|
disabled: currentPresetIdx >= 0 && idx <= currentPresetIdx ? "Current or lower tier" : void 0
|
|
40118
40232
|
})).filter((p) => !p.disabled && p.value !== "custom");
|
|
40119
40233
|
if (availablePresets.length === 0) {
|
|
40120
|
-
|
|
40234
|
+
clack56.log.warn("Already on highest preset (Enterprise)");
|
|
40121
40235
|
process.exit(0);
|
|
40122
40236
|
}
|
|
40123
|
-
const selectedPreset = await
|
|
40237
|
+
const selectedPreset = await clack56.select({
|
|
40124
40238
|
message: "Select new preset:",
|
|
40125
40239
|
options: availablePresets
|
|
40126
40240
|
});
|
|
40127
|
-
if (
|
|
40128
|
-
|
|
40241
|
+
if (clack56.isCancel(selectedPreset)) {
|
|
40242
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40129
40243
|
process.exit(0);
|
|
40130
40244
|
}
|
|
40131
40245
|
const presetConfig = getSMSPreset(selectedPreset);
|
|
@@ -40141,7 +40255,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40141
40255
|
}
|
|
40142
40256
|
case "event-tracking": {
|
|
40143
40257
|
if (config2.eventTracking?.enabled) {
|
|
40144
|
-
const eventAction = await
|
|
40258
|
+
const eventAction = await clack56.select({
|
|
40145
40259
|
message: "What would you like to do with event tracking?",
|
|
40146
40260
|
options: [
|
|
40147
40261
|
{
|
|
@@ -40156,17 +40270,17 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40156
40270
|
}
|
|
40157
40271
|
]
|
|
40158
40272
|
});
|
|
40159
|
-
if (
|
|
40160
|
-
|
|
40273
|
+
if (clack56.isCancel(eventAction)) {
|
|
40274
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40161
40275
|
process.exit(0);
|
|
40162
40276
|
}
|
|
40163
40277
|
if (eventAction === "disable") {
|
|
40164
|
-
const confirmDisable = await
|
|
40278
|
+
const confirmDisable = await clack56.confirm({
|
|
40165
40279
|
message: "Are you sure? Existing history will remain, but new events won't be tracked.",
|
|
40166
40280
|
initialValue: false
|
|
40167
40281
|
});
|
|
40168
|
-
if (
|
|
40169
|
-
|
|
40282
|
+
if (clack56.isCancel(confirmDisable) || !confirmDisable) {
|
|
40283
|
+
clack56.cancel("Event tracking not disabled.");
|
|
40170
40284
|
process.exit(0);
|
|
40171
40285
|
}
|
|
40172
40286
|
updatedConfig = {
|
|
@@ -40176,7 +40290,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40176
40290
|
}
|
|
40177
40291
|
};
|
|
40178
40292
|
} else {
|
|
40179
|
-
const retention = await
|
|
40293
|
+
const retention = await clack56.select({
|
|
40180
40294
|
message: "Message history retention period:",
|
|
40181
40295
|
options: [
|
|
40182
40296
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40203,8 +40317,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40203
40317
|
],
|
|
40204
40318
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40205
40319
|
});
|
|
40206
|
-
if (
|
|
40207
|
-
|
|
40320
|
+
if (clack56.isCancel(retention)) {
|
|
40321
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40208
40322
|
process.exit(0);
|
|
40209
40323
|
}
|
|
40210
40324
|
updatedConfig = {
|
|
@@ -40216,19 +40330,19 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40216
40330
|
};
|
|
40217
40331
|
}
|
|
40218
40332
|
} else {
|
|
40219
|
-
const enableTracking = await
|
|
40333
|
+
const enableTracking = await clack56.confirm({
|
|
40220
40334
|
message: "Enable event tracking? (Track SMS events with history)",
|
|
40221
40335
|
initialValue: true
|
|
40222
40336
|
});
|
|
40223
|
-
if (
|
|
40224
|
-
|
|
40337
|
+
if (clack56.isCancel(enableTracking)) {
|
|
40338
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40225
40339
|
process.exit(0);
|
|
40226
40340
|
}
|
|
40227
40341
|
if (!enableTracking) {
|
|
40228
|
-
|
|
40342
|
+
clack56.log.info("Event tracking not enabled.");
|
|
40229
40343
|
process.exit(0);
|
|
40230
40344
|
}
|
|
40231
|
-
const retention = await
|
|
40345
|
+
const retention = await clack56.select({
|
|
40232
40346
|
message: "Message history retention period:",
|
|
40233
40347
|
options: [
|
|
40234
40348
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40251,8 +40365,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40251
40365
|
],
|
|
40252
40366
|
initialValue: "90days"
|
|
40253
40367
|
});
|
|
40254
|
-
if (
|
|
40255
|
-
|
|
40368
|
+
if (clack56.isCancel(retention)) {
|
|
40369
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40256
40370
|
process.exit(0);
|
|
40257
40371
|
}
|
|
40258
40372
|
updatedConfig = {
|
|
@@ -40271,12 +40385,12 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40271
40385
|
}
|
|
40272
40386
|
case "retention": {
|
|
40273
40387
|
if (!config2.eventTracking?.enabled) {
|
|
40274
|
-
|
|
40388
|
+
clack56.log.error(
|
|
40275
40389
|
"Event tracking is not enabled. Enable it first to change retention."
|
|
40276
40390
|
);
|
|
40277
40391
|
process.exit(1);
|
|
40278
40392
|
}
|
|
40279
|
-
const retention = await
|
|
40393
|
+
const retention = await clack56.select({
|
|
40280
40394
|
message: "Message history retention period (event data in DynamoDB):",
|
|
40281
40395
|
options: [
|
|
40282
40396
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40295,8 +40409,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40295
40409
|
],
|
|
40296
40410
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40297
40411
|
});
|
|
40298
|
-
if (
|
|
40299
|
-
|
|
40412
|
+
if (clack56.isCancel(retention)) {
|
|
40413
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40300
40414
|
process.exit(0);
|
|
40301
40415
|
}
|
|
40302
40416
|
updatedConfig = {
|
|
@@ -40314,21 +40428,21 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40314
40428
|
case "link-tracking": {
|
|
40315
40429
|
const enableLinkTracking = !config2.tracking?.linkTracking;
|
|
40316
40430
|
if (enableLinkTracking) {
|
|
40317
|
-
|
|
40318
|
-
|
|
40431
|
+
clack56.log.info(
|
|
40432
|
+
pc59.dim(
|
|
40319
40433
|
"Link tracking will track clicks on URLs in your SMS messages."
|
|
40320
40434
|
)
|
|
40321
40435
|
);
|
|
40322
|
-
|
|
40323
|
-
|
|
40436
|
+
clack56.log.info(
|
|
40437
|
+
pc59.dim("URLs will be rewritten to go through a tracking endpoint.")
|
|
40324
40438
|
);
|
|
40325
40439
|
}
|
|
40326
|
-
const confirmed = await
|
|
40440
|
+
const confirmed = await clack56.confirm({
|
|
40327
40441
|
message: enableLinkTracking ? "Enable link click tracking?" : "Disable link click tracking?",
|
|
40328
40442
|
initialValue: enableLinkTracking
|
|
40329
40443
|
});
|
|
40330
|
-
if (
|
|
40331
|
-
|
|
40444
|
+
if (clack56.isCancel(confirmed) || !confirmed) {
|
|
40445
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40332
40446
|
process.exit(0);
|
|
40333
40447
|
}
|
|
40334
40448
|
updatedConfig = {
|
|
@@ -40345,7 +40459,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40345
40459
|
}
|
|
40346
40460
|
case "archiving": {
|
|
40347
40461
|
if (config2.messageArchiving?.enabled) {
|
|
40348
|
-
const archivingAction = await
|
|
40462
|
+
const archivingAction = await clack56.select({
|
|
40349
40463
|
message: "What would you like to do with message archiving?",
|
|
40350
40464
|
options: [
|
|
40351
40465
|
{
|
|
@@ -40360,17 +40474,17 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40360
40474
|
}
|
|
40361
40475
|
]
|
|
40362
40476
|
});
|
|
40363
|
-
if (
|
|
40364
|
-
|
|
40477
|
+
if (clack56.isCancel(archivingAction)) {
|
|
40478
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40365
40479
|
process.exit(0);
|
|
40366
40480
|
}
|
|
40367
40481
|
if (archivingAction === "disable") {
|
|
40368
|
-
const confirmDisable = await
|
|
40482
|
+
const confirmDisable = await clack56.confirm({
|
|
40369
40483
|
message: "Are you sure? Existing archived messages will remain, but new messages won't be archived.",
|
|
40370
40484
|
initialValue: false
|
|
40371
40485
|
});
|
|
40372
|
-
if (
|
|
40373
|
-
|
|
40486
|
+
if (clack56.isCancel(confirmDisable) || !confirmDisable) {
|
|
40487
|
+
clack56.cancel("Archiving not disabled.");
|
|
40374
40488
|
process.exit(0);
|
|
40375
40489
|
}
|
|
40376
40490
|
updatedConfig = {
|
|
@@ -40381,7 +40495,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40381
40495
|
}
|
|
40382
40496
|
};
|
|
40383
40497
|
} else {
|
|
40384
|
-
const retention = await
|
|
40498
|
+
const retention = await clack56.select({
|
|
40385
40499
|
message: "Message archive retention period:",
|
|
40386
40500
|
options: [
|
|
40387
40501
|
{
|
|
@@ -40412,8 +40526,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40412
40526
|
],
|
|
40413
40527
|
initialValue: config2.messageArchiving.retention
|
|
40414
40528
|
});
|
|
40415
|
-
if (
|
|
40416
|
-
|
|
40529
|
+
if (clack56.isCancel(retention)) {
|
|
40530
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40417
40531
|
process.exit(0);
|
|
40418
40532
|
}
|
|
40419
40533
|
updatedConfig = {
|
|
@@ -40425,19 +40539,19 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40425
40539
|
};
|
|
40426
40540
|
}
|
|
40427
40541
|
} else {
|
|
40428
|
-
const enableArchiving = await
|
|
40542
|
+
const enableArchiving = await clack56.confirm({
|
|
40429
40543
|
message: "Enable message archiving? (Store full message content for viewing)",
|
|
40430
40544
|
initialValue: true
|
|
40431
40545
|
});
|
|
40432
|
-
if (
|
|
40433
|
-
|
|
40546
|
+
if (clack56.isCancel(enableArchiving)) {
|
|
40547
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40434
40548
|
process.exit(0);
|
|
40435
40549
|
}
|
|
40436
40550
|
if (!enableArchiving) {
|
|
40437
|
-
|
|
40551
|
+
clack56.log.info("Message archiving not enabled.");
|
|
40438
40552
|
process.exit(0);
|
|
40439
40553
|
}
|
|
40440
|
-
const retention = await
|
|
40554
|
+
const retention = await clack56.select({
|
|
40441
40555
|
message: "Message archive retention period:",
|
|
40442
40556
|
options: [
|
|
40443
40557
|
{ value: "7days", label: "7 days", hint: "~$1-2/mo for 10k msgs" },
|
|
@@ -40464,8 +40578,8 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40464
40578
|
],
|
|
40465
40579
|
initialValue: "90days"
|
|
40466
40580
|
});
|
|
40467
|
-
if (
|
|
40468
|
-
|
|
40581
|
+
if (clack56.isCancel(retention)) {
|
|
40582
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40469
40583
|
process.exit(0);
|
|
40470
40584
|
}
|
|
40471
40585
|
updatedConfig = {
|
|
@@ -40497,7 +40611,7 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40497
40611
|
const currentAllowed = config2.protectConfiguration?.allowedCountries || [
|
|
40498
40612
|
"US"
|
|
40499
40613
|
];
|
|
40500
|
-
const selectedCountries = await
|
|
40614
|
+
const selectedCountries = await clack56.multiselect({
|
|
40501
40615
|
message: "Select countries to allow SMS delivery (all others blocked):",
|
|
40502
40616
|
options: commonCountries.map((c) => ({
|
|
40503
40617
|
value: c.code,
|
|
@@ -40506,16 +40620,16 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40506
40620
|
initialValues: currentAllowed,
|
|
40507
40621
|
required: true
|
|
40508
40622
|
});
|
|
40509
|
-
if (
|
|
40510
|
-
|
|
40623
|
+
if (clack56.isCancel(selectedCountries)) {
|
|
40624
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40511
40625
|
process.exit(0);
|
|
40512
40626
|
}
|
|
40513
|
-
const enableAIT = await
|
|
40627
|
+
const enableAIT = await clack56.confirm({
|
|
40514
40628
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
40515
40629
|
initialValue: config2.protectConfiguration?.aitFiltering ?? false
|
|
40516
40630
|
});
|
|
40517
|
-
if (
|
|
40518
|
-
|
|
40631
|
+
if (clack56.isCancel(enableAIT)) {
|
|
40632
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40519
40633
|
process.exit(0);
|
|
40520
40634
|
}
|
|
40521
40635
|
updatedConfig = {
|
|
@@ -40533,28 +40647,28 @@ ${pc58.yellow("\u26A0")} ${pc58.bold("10DLC Campaign Registration Required")}
|
|
|
40533
40647
|
const newCostData = calculateSMSCosts(updatedConfig, 1e4);
|
|
40534
40648
|
const costDiff = newCostData.total.monthly - currentCostData.total.monthly;
|
|
40535
40649
|
console.log(`
|
|
40536
|
-
${
|
|
40650
|
+
${pc59.bold("Cost Impact:")}`);
|
|
40537
40651
|
console.log(
|
|
40538
|
-
` Current: ${
|
|
40652
|
+
` Current: ${pc59.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
40539
40653
|
);
|
|
40540
40654
|
console.log(
|
|
40541
|
-
` New: ${
|
|
40655
|
+
` New: ${pc59.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
|
|
40542
40656
|
);
|
|
40543
40657
|
if (costDiff > 0) {
|
|
40544
|
-
console.log(` Change: ${
|
|
40658
|
+
console.log(` Change: ${pc59.yellow(`+${formatCost3(costDiff)}/mo`)}`);
|
|
40545
40659
|
} else if (costDiff < 0) {
|
|
40546
40660
|
console.log(
|
|
40547
|
-
` Change: ${
|
|
40661
|
+
` Change: ${pc59.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
|
|
40548
40662
|
);
|
|
40549
40663
|
}
|
|
40550
40664
|
console.log("");
|
|
40551
40665
|
if (!(options.yes || options.preview)) {
|
|
40552
|
-
const confirmed = await
|
|
40666
|
+
const confirmed = await clack56.confirm({
|
|
40553
40667
|
message: "Proceed with upgrade?",
|
|
40554
40668
|
initialValue: true
|
|
40555
40669
|
});
|
|
40556
|
-
if (
|
|
40557
|
-
|
|
40670
|
+
if (clack56.isCancel(confirmed) || !confirmed) {
|
|
40671
|
+
clack56.cancel("Upgrade cancelled.");
|
|
40558
40672
|
process.exit(0);
|
|
40559
40673
|
}
|
|
40560
40674
|
}
|
|
@@ -40623,8 +40737,8 @@ ${pc58.bold("Cost Impact:")}`);
|
|
|
40623
40737
|
resourceChanges: previewResult.resourceChanges,
|
|
40624
40738
|
commandName: "wraps sms upgrade"
|
|
40625
40739
|
});
|
|
40626
|
-
|
|
40627
|
-
|
|
40740
|
+
clack56.outro(
|
|
40741
|
+
pc59.green("Preview complete. Run without --preview to upgrade.")
|
|
40628
40742
|
);
|
|
40629
40743
|
trackServiceUpgrade("sms", {
|
|
40630
40744
|
region,
|
|
@@ -40729,43 +40843,43 @@ ${pc58.bold("Cost Impact:")}`);
|
|
|
40729
40843
|
}
|
|
40730
40844
|
progress.info("Connection metadata updated");
|
|
40731
40845
|
console.log("\n");
|
|
40732
|
-
|
|
40846
|
+
clack56.log.success(pc59.green(pc59.bold("SMS infrastructure upgraded!")));
|
|
40733
40847
|
console.log("\n");
|
|
40734
|
-
|
|
40848
|
+
clack56.note(
|
|
40735
40849
|
[
|
|
40736
|
-
`${
|
|
40737
|
-
`${
|
|
40738
|
-
`${
|
|
40739
|
-
`${
|
|
40740
|
-
outputs.tableName ? `${
|
|
40850
|
+
`${pc59.bold("Phone Number:")} ${pc59.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
40851
|
+
`${pc59.bold("Phone Type:")} ${pc59.cyan(updatedConfig.phoneNumberType || "simulator")}`,
|
|
40852
|
+
`${pc59.bold("Config Set:")} ${pc59.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
40853
|
+
`${pc59.bold("Region:")} ${pc59.cyan(outputs.region)}`,
|
|
40854
|
+
outputs.tableName ? `${pc59.bold("History Table:")} ${pc59.cyan(outputs.tableName)}` : "",
|
|
40741
40855
|
"",
|
|
40742
|
-
|
|
40743
|
-
|
|
40856
|
+
pc59.dim("IAM Role:"),
|
|
40857
|
+
pc59.dim(` ${outputs.roleArn}`)
|
|
40744
40858
|
].filter(Boolean).join("\n"),
|
|
40745
40859
|
"SMS Infrastructure"
|
|
40746
40860
|
);
|
|
40747
40861
|
console.log(`
|
|
40748
|
-
${
|
|
40862
|
+
${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
|
|
40749
40863
|
`);
|
|
40750
40864
|
if (upgradeAction === "phone-number") {
|
|
40751
40865
|
console.log(
|
|
40752
|
-
`Upgraded to ${
|
|
40866
|
+
`Upgraded to ${pc59.cyan(updatedConfig.phoneNumberType)} number (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40753
40867
|
`
|
|
40754
40868
|
);
|
|
40755
40869
|
if (updatedConfig.phoneNumberType === "toll-free") {
|
|
40756
|
-
console.log(`${
|
|
40870
|
+
console.log(`${pc59.bold("Next Steps:")}`);
|
|
40757
40871
|
console.log(
|
|
40758
|
-
` 1. Run ${
|
|
40872
|
+
` 1. Run ${pc59.cyan("wraps sms register")} to start toll-free registration`
|
|
40759
40873
|
);
|
|
40760
40874
|
console.log(" 2. Submit your business information and use case");
|
|
40761
40875
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40762
40876
|
console.log("");
|
|
40763
40877
|
console.log(
|
|
40764
|
-
|
|
40878
|
+
pc59.dim("Until verified, your number can only send limited messages.")
|
|
40765
40879
|
);
|
|
40766
40880
|
console.log("");
|
|
40767
40881
|
} else if (updatedConfig.phoneNumberType === "10dlc") {
|
|
40768
|
-
console.log(`${
|
|
40882
|
+
console.log(`${pc59.bold("Next Steps:")}`);
|
|
40769
40883
|
console.log(" 1. Register your brand in the AWS Console");
|
|
40770
40884
|
console.log(" 2. Create a 10DLC campaign for your use case");
|
|
40771
40885
|
console.log(" 3. Wait for campaign approval (1-7 business days)");
|
|
@@ -40773,16 +40887,16 @@ ${pc58.green("\u2713")} ${pc58.bold("Upgrade complete!")}
|
|
|
40773
40887
|
}
|
|
40774
40888
|
} else if (upgradeAction === "preset" && newPreset) {
|
|
40775
40889
|
console.log(
|
|
40776
|
-
`Upgraded to ${
|
|
40890
|
+
`Upgraded to ${pc59.cyan(newPreset)} preset (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40777
40891
|
`
|
|
40778
40892
|
);
|
|
40779
40893
|
} else {
|
|
40780
40894
|
console.log(
|
|
40781
|
-
`Updated configuration (${
|
|
40895
|
+
`Updated configuration (${pc59.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40782
40896
|
`
|
|
40783
40897
|
);
|
|
40784
40898
|
}
|
|
40785
|
-
console.log(
|
|
40899
|
+
console.log(pc59.dim(getSMSCostSummary(updatedConfig, 1e4)));
|
|
40786
40900
|
const enabledFeatures = [];
|
|
40787
40901
|
if (updatedConfig.tracking?.enabled) {
|
|
40788
40902
|
enabledFeatures.push("tracking");
|
|
@@ -40806,7 +40920,7 @@ ${pc58.green("\u2713")} ${pc58.bold("Upgrade complete!")}
|
|
|
40806
40920
|
action: typeof upgradeAction === "string" ? upgradeAction : void 0,
|
|
40807
40921
|
duration_ms: Date.now() - startTime
|
|
40808
40922
|
});
|
|
40809
|
-
|
|
40923
|
+
clack56.outro(pc59.green("Upgrade complete!"));
|
|
40810
40924
|
}
|
|
40811
40925
|
|
|
40812
40926
|
// src/commands/sms/verify-number.ts
|
|
@@ -40825,13 +40939,13 @@ import {
|
|
|
40825
40939
|
SendDestinationNumberVerificationCodeCommand,
|
|
40826
40940
|
VerifyDestinationNumberCommand
|
|
40827
40941
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
40828
|
-
import * as
|
|
40829
|
-
import
|
|
40942
|
+
import * as clack57 from "@clack/prompts";
|
|
40943
|
+
import pc60 from "picocolors";
|
|
40830
40944
|
async function smsVerifyNumber(options) {
|
|
40831
40945
|
const startTime = Date.now();
|
|
40832
40946
|
const progress = new DeploymentProgress();
|
|
40833
40947
|
if (!isJsonMode()) {
|
|
40834
|
-
|
|
40948
|
+
clack57.intro(pc60.bold("Wraps SMS - Verify Destination Number"));
|
|
40835
40949
|
}
|
|
40836
40950
|
const identity = await progress.execute(
|
|
40837
40951
|
"Validating AWS credentials",
|
|
@@ -40841,10 +40955,10 @@ async function smsVerifyNumber(options) {
|
|
|
40841
40955
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40842
40956
|
if (!metadata?.services?.sms) {
|
|
40843
40957
|
progress.stop();
|
|
40844
|
-
|
|
40958
|
+
clack57.log.error("No SMS infrastructure found");
|
|
40845
40959
|
console.log(
|
|
40846
40960
|
`
|
|
40847
|
-
Run ${
|
|
40961
|
+
Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
40848
40962
|
`
|
|
40849
40963
|
);
|
|
40850
40964
|
process.exit(1);
|
|
@@ -40858,19 +40972,19 @@ Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40858
40972
|
);
|
|
40859
40973
|
progress.stop();
|
|
40860
40974
|
if (!response.VerifiedDestinationNumbers || response.VerifiedDestinationNumbers.length === 0) {
|
|
40861
|
-
|
|
40975
|
+
clack57.log.info("No verified destination numbers found");
|
|
40862
40976
|
console.log(
|
|
40863
40977
|
`
|
|
40864
|
-
Run ${
|
|
40978
|
+
Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
|
|
40865
40979
|
`
|
|
40866
40980
|
);
|
|
40867
40981
|
} else {
|
|
40868
40982
|
console.log("\n");
|
|
40869
|
-
|
|
40983
|
+
clack57.log.info(pc60.bold("Verified Destination Numbers:"));
|
|
40870
40984
|
console.log("");
|
|
40871
40985
|
for (const num of response.VerifiedDestinationNumbers) {
|
|
40872
|
-
const status2 = num.Status === "VERIFIED" ?
|
|
40873
|
-
console.log(` ${
|
|
40986
|
+
const status2 = num.Status === "VERIFIED" ? pc60.green("\u2713 Verified") : pc60.yellow("\u29D6 Pending");
|
|
40987
|
+
console.log(` ${pc60.cyan(num.DestinationPhoneNumber)} - ${status2}`);
|
|
40874
40988
|
}
|
|
40875
40989
|
console.log("");
|
|
40876
40990
|
}
|
|
@@ -40888,7 +41002,7 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40888
41002
|
});
|
|
40889
41003
|
return;
|
|
40890
41004
|
}
|
|
40891
|
-
|
|
41005
|
+
clack57.outro(pc60.green("Done!"));
|
|
40892
41006
|
return;
|
|
40893
41007
|
} catch (error) {
|
|
40894
41008
|
progress.stop();
|
|
@@ -40896,7 +41010,7 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40896
41010
|
trackError("SMS_LIST_VERIFIED_FAILED", "sms:verify-number:list", {
|
|
40897
41011
|
error: errorMessage
|
|
40898
41012
|
});
|
|
40899
|
-
|
|
41013
|
+
clack57.log.error(`Failed to list verified numbers: ${errorMessage}`);
|
|
40900
41014
|
process.exit(1);
|
|
40901
41015
|
}
|
|
40902
41016
|
}
|
|
@@ -40904,10 +41018,10 @@ Run ${pc59.cyan("wraps sms verify-number")} to verify a number.
|
|
|
40904
41018
|
const phoneNumber2 = options.phoneNumber;
|
|
40905
41019
|
if (!phoneNumber2) {
|
|
40906
41020
|
progress.stop();
|
|
40907
|
-
|
|
41021
|
+
clack57.log.error("Phone number is required for deletion");
|
|
40908
41022
|
console.log(
|
|
40909
41023
|
`
|
|
40910
|
-
Usage: ${
|
|
41024
|
+
Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
|
|
40911
41025
|
`
|
|
40912
41026
|
);
|
|
40913
41027
|
process.exit(1);
|
|
@@ -40921,7 +41035,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40921
41035
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
40922
41036
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
40923
41037
|
progress.stop();
|
|
40924
|
-
|
|
41038
|
+
clack57.log.error(`Number ${phoneNumber2} is not in verified list`);
|
|
40925
41039
|
process.exit(1);
|
|
40926
41040
|
}
|
|
40927
41041
|
await progress.execute(`Removing ${phoneNumber2}`, async () => {
|
|
@@ -40932,7 +41046,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40932
41046
|
);
|
|
40933
41047
|
});
|
|
40934
41048
|
progress.stop();
|
|
40935
|
-
|
|
41049
|
+
clack57.log.success(`Removed ${pc60.cyan(phoneNumber2)} from verified list`);
|
|
40936
41050
|
trackCommand("sms:verify-number:delete", {
|
|
40937
41051
|
success: true,
|
|
40938
41052
|
duration_ms: Date.now() - startTime
|
|
@@ -40944,7 +41058,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40944
41058
|
});
|
|
40945
41059
|
return;
|
|
40946
41060
|
}
|
|
40947
|
-
|
|
41061
|
+
clack57.outro(pc60.green("Done!"));
|
|
40948
41062
|
return;
|
|
40949
41063
|
} catch (error) {
|
|
40950
41064
|
progress.stop();
|
|
@@ -40952,7 +41066,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40952
41066
|
trackError("SMS_DELETE_VERIFIED_FAILED", "sms:verify-number:delete", {
|
|
40953
41067
|
error: errorMessage
|
|
40954
41068
|
});
|
|
40955
|
-
|
|
41069
|
+
clack57.log.error(`Failed to delete verified number: ${errorMessage}`);
|
|
40956
41070
|
process.exit(1);
|
|
40957
41071
|
}
|
|
40958
41072
|
}
|
|
@@ -40965,7 +41079,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40965
41079
|
);
|
|
40966
41080
|
}
|
|
40967
41081
|
if (!phoneNumber) {
|
|
40968
|
-
const result = await
|
|
41082
|
+
const result = await clack57.text({
|
|
40969
41083
|
message: "Enter phone number to verify (E.164 format):",
|
|
40970
41084
|
placeholder: "+14155551234",
|
|
40971
41085
|
validate: (value) => {
|
|
@@ -40978,14 +41092,14 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
40978
41092
|
return;
|
|
40979
41093
|
}
|
|
40980
41094
|
});
|
|
40981
|
-
if (
|
|
40982
|
-
|
|
41095
|
+
if (clack57.isCancel(result)) {
|
|
41096
|
+
clack57.cancel("Operation cancelled.");
|
|
40983
41097
|
process.exit(0);
|
|
40984
41098
|
}
|
|
40985
41099
|
phoneNumber = result;
|
|
40986
41100
|
} else if (!isValidPhoneNumber(phoneNumber)) {
|
|
40987
41101
|
progress.stop();
|
|
40988
|
-
|
|
41102
|
+
clack57.log.error(
|
|
40989
41103
|
`Invalid phone number format: ${phoneNumber}. Use E.164 format (e.g., +14155551234)`
|
|
40990
41104
|
);
|
|
40991
41105
|
process.exit(1);
|
|
@@ -41000,7 +41114,7 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41000
41114
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41001
41115
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41002
41116
|
progress.stop();
|
|
41003
|
-
|
|
41117
|
+
clack57.log.error(
|
|
41004
41118
|
`Number ${phoneNumber} not found. Run without --code first.`
|
|
41005
41119
|
);
|
|
41006
41120
|
process.exit(1);
|
|
@@ -41015,12 +41129,12 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41015
41129
|
});
|
|
41016
41130
|
progress.stop();
|
|
41017
41131
|
console.log("\n");
|
|
41018
|
-
|
|
41019
|
-
|
|
41132
|
+
clack57.log.success(
|
|
41133
|
+
pc60.green(`Phone number ${pc60.cyan(phoneNumber)} verified!`)
|
|
41020
41134
|
);
|
|
41021
41135
|
console.log("");
|
|
41022
41136
|
console.log(
|
|
41023
|
-
`You can now send test messages to this number with ${
|
|
41137
|
+
`You can now send test messages to this number with ${pc60.cyan("wraps sms test")}`
|
|
41024
41138
|
);
|
|
41025
41139
|
trackCommand("sms:verify-number:confirm", {
|
|
41026
41140
|
success: true,
|
|
@@ -41033,23 +41147,23 @@ Usage: ${pc59.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41033
41147
|
});
|
|
41034
41148
|
return;
|
|
41035
41149
|
}
|
|
41036
|
-
|
|
41150
|
+
clack57.outro(pc60.green("Verification complete!"));
|
|
41037
41151
|
return;
|
|
41038
41152
|
} catch (error) {
|
|
41039
41153
|
progress.stop();
|
|
41040
41154
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41041
41155
|
if (errorMessage.includes("Invalid verification code")) {
|
|
41042
|
-
|
|
41156
|
+
clack57.log.error("Invalid verification code. Please try again.");
|
|
41043
41157
|
console.log(
|
|
41044
41158
|
`
|
|
41045
|
-
Run ${
|
|
41159
|
+
Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41046
41160
|
`
|
|
41047
41161
|
);
|
|
41048
41162
|
} else {
|
|
41049
41163
|
trackError("SMS_VERIFY_CODE_FAILED", "sms:verify-number:confirm", {
|
|
41050
41164
|
error: errorMessage
|
|
41051
41165
|
});
|
|
41052
|
-
|
|
41166
|
+
clack57.log.error(`Verification failed: ${errorMessage}`);
|
|
41053
41167
|
}
|
|
41054
41168
|
process.exit(1);
|
|
41055
41169
|
}
|
|
@@ -41064,7 +41178,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41064
41178
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41065
41179
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41066
41180
|
progress.stop();
|
|
41067
|
-
|
|
41181
|
+
clack57.log.error(
|
|
41068
41182
|
`Number ${phoneNumber} not found. Run without --resend first.`
|
|
41069
41183
|
);
|
|
41070
41184
|
process.exit(1);
|
|
@@ -41078,11 +41192,11 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41078
41192
|
);
|
|
41079
41193
|
});
|
|
41080
41194
|
progress.stop();
|
|
41081
|
-
|
|
41195
|
+
clack57.log.success(`Verification code resent to ${pc60.cyan(phoneNumber)}`);
|
|
41082
41196
|
console.log("");
|
|
41083
41197
|
console.log(
|
|
41084
41198
|
`Once you receive the code, run:
|
|
41085
|
-
${
|
|
41199
|
+
${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41086
41200
|
);
|
|
41087
41201
|
trackCommand("sms:verify-number:resend", {
|
|
41088
41202
|
success: true,
|
|
@@ -41095,7 +41209,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41095
41209
|
});
|
|
41096
41210
|
return;
|
|
41097
41211
|
}
|
|
41098
|
-
|
|
41212
|
+
clack57.outro(pc60.green("Code sent!"));
|
|
41099
41213
|
return;
|
|
41100
41214
|
} catch (error) {
|
|
41101
41215
|
progress.stop();
|
|
@@ -41103,7 +41217,7 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41103
41217
|
trackError("SMS_RESEND_CODE_FAILED", "sms:verify-number:resend", {
|
|
41104
41218
|
error: errorMessage
|
|
41105
41219
|
});
|
|
41106
|
-
|
|
41220
|
+
clack57.log.error(`Failed to resend code: ${errorMessage}`);
|
|
41107
41221
|
process.exit(1);
|
|
41108
41222
|
}
|
|
41109
41223
|
}
|
|
@@ -41123,10 +41237,10 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41123
41237
|
});
|
|
41124
41238
|
return;
|
|
41125
41239
|
}
|
|
41126
|
-
|
|
41127
|
-
`Number ${
|
|
41240
|
+
clack57.log.info(
|
|
41241
|
+
`Number ${pc60.cyan(phoneNumber)} is already verified and ready to use!`
|
|
41128
41242
|
);
|
|
41129
|
-
|
|
41243
|
+
clack57.outro(pc60.green("Done!"));
|
|
41130
41244
|
return;
|
|
41131
41245
|
}
|
|
41132
41246
|
if (existingNumber?.Status === "PENDING") {
|
|
@@ -41150,15 +41264,15 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41150
41264
|
});
|
|
41151
41265
|
return;
|
|
41152
41266
|
}
|
|
41153
|
-
|
|
41154
|
-
`Verification already in progress. New code sent to ${
|
|
41267
|
+
clack57.log.info(
|
|
41268
|
+
`Verification already in progress. New code sent to ${pc60.cyan(phoneNumber)}`
|
|
41155
41269
|
);
|
|
41156
41270
|
console.log("");
|
|
41157
41271
|
console.log(
|
|
41158
41272
|
`Once you receive the code, run:
|
|
41159
|
-
${
|
|
41273
|
+
${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41160
41274
|
);
|
|
41161
|
-
|
|
41275
|
+
clack57.outro(pc60.green("Code sent!"));
|
|
41162
41276
|
return;
|
|
41163
41277
|
}
|
|
41164
41278
|
const createResponse = await progress.execute(
|
|
@@ -41179,18 +41293,18 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41179
41293
|
});
|
|
41180
41294
|
progress.stop();
|
|
41181
41295
|
console.log("\n");
|
|
41182
|
-
|
|
41183
|
-
`Verification code sent to ${
|
|
41296
|
+
clack57.log.success(
|
|
41297
|
+
`Verification code sent to ${pc60.cyan(phoneNumber)} via SMS`
|
|
41184
41298
|
);
|
|
41185
41299
|
console.log("");
|
|
41186
|
-
|
|
41300
|
+
clack57.note(
|
|
41187
41301
|
[
|
|
41188
41302
|
"1. Check your phone for the verification code",
|
|
41189
41303
|
"",
|
|
41190
41304
|
"2. Complete verification with:",
|
|
41191
|
-
` ${
|
|
41305
|
+
` ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
|
|
41192
41306
|
"",
|
|
41193
|
-
|
|
41307
|
+
pc60.dim("The code expires in 24 hours")
|
|
41194
41308
|
].join("\n"),
|
|
41195
41309
|
"Next Steps"
|
|
41196
41310
|
);
|
|
@@ -41206,22 +41320,22 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41206
41320
|
});
|
|
41207
41321
|
return;
|
|
41208
41322
|
}
|
|
41209
|
-
|
|
41323
|
+
clack57.outro(pc60.green("Verification started!"));
|
|
41210
41324
|
} catch (error) {
|
|
41211
41325
|
progress.stop();
|
|
41212
41326
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41213
41327
|
if (errorMessage.includes("already exists")) {
|
|
41214
|
-
|
|
41328
|
+
clack57.log.error("This number is already being verified");
|
|
41215
41329
|
console.log(
|
|
41216
41330
|
`
|
|
41217
|
-
Run ${
|
|
41331
|
+
Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41218
41332
|
`
|
|
41219
41333
|
);
|
|
41220
41334
|
} else {
|
|
41221
41335
|
trackError("SMS_CREATE_VERIFIED_FAILED", "sms:verify-number:start", {
|
|
41222
41336
|
error: errorMessage
|
|
41223
41337
|
});
|
|
41224
|
-
|
|
41338
|
+
clack57.log.error(`Failed to start verification: ${errorMessage}`);
|
|
41225
41339
|
}
|
|
41226
41340
|
process.exit(1);
|
|
41227
41341
|
}
|
|
@@ -41230,98 +41344,98 @@ Run ${pc59.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41230
41344
|
// src/commands/support.ts
|
|
41231
41345
|
init_esm_shims();
|
|
41232
41346
|
init_events();
|
|
41233
|
-
import * as
|
|
41234
|
-
import
|
|
41347
|
+
import * as clack58 from "@clack/prompts";
|
|
41348
|
+
import pc61 from "picocolors";
|
|
41235
41349
|
async function support() {
|
|
41236
41350
|
trackCommand("support", { success: true });
|
|
41237
|
-
|
|
41351
|
+
clack58.intro(pc61.bold("Get Help with Wraps"));
|
|
41238
41352
|
console.log();
|
|
41239
|
-
console.log(` ${
|
|
41353
|
+
console.log(` ${pc61.bold("Email:")} ${pc61.cyan("hey@wraps.sh")}`);
|
|
41240
41354
|
console.log(
|
|
41241
|
-
` ${
|
|
41355
|
+
` ${pc61.bold("GitHub:")} ${pc61.cyan("https://github.com/wraps-dev/wraps/issues")}`
|
|
41242
41356
|
);
|
|
41243
|
-
console.log(` ${
|
|
41357
|
+
console.log(` ${pc61.bold("Docs:")} ${pc61.cyan("https://wraps.dev/docs")}`);
|
|
41244
41358
|
console.log();
|
|
41245
|
-
console.log(
|
|
41359
|
+
console.log(pc61.dim(" Response time: Usually within 24 hours"));
|
|
41246
41360
|
console.log();
|
|
41247
41361
|
}
|
|
41248
41362
|
|
|
41249
41363
|
// src/commands/telemetry.ts
|
|
41250
41364
|
init_esm_shims();
|
|
41251
41365
|
init_client();
|
|
41252
|
-
import * as
|
|
41253
|
-
import
|
|
41366
|
+
import * as clack59 from "@clack/prompts";
|
|
41367
|
+
import pc62 from "picocolors";
|
|
41254
41368
|
async function telemetryEnable() {
|
|
41255
41369
|
const client = getTelemetryClient();
|
|
41256
41370
|
const override = client.enable();
|
|
41257
41371
|
if (override) {
|
|
41258
|
-
|
|
41372
|
+
clack59.log.warn(
|
|
41259
41373
|
"Telemetry enabled in config, but overridden by environment"
|
|
41260
41374
|
);
|
|
41261
|
-
console.log(` Reason: ${
|
|
41262
|
-
console.log(` Config: ${
|
|
41375
|
+
console.log(` Reason: ${pc62.yellow(override)}`);
|
|
41376
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41263
41377
|
console.log();
|
|
41264
41378
|
} else {
|
|
41265
|
-
|
|
41266
|
-
console.log(` Config: ${
|
|
41379
|
+
clack59.log.success(pc62.green("Telemetry enabled"));
|
|
41380
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41267
41381
|
console.log(`
|
|
41268
|
-
${
|
|
41382
|
+
${pc62.dim("Thank you for helping improve Wraps!")}
|
|
41269
41383
|
`);
|
|
41270
41384
|
}
|
|
41271
41385
|
}
|
|
41272
41386
|
async function telemetryDisable() {
|
|
41273
41387
|
const client = getTelemetryClient();
|
|
41274
41388
|
client.disable();
|
|
41275
|
-
|
|
41276
|
-
console.log(` Config: ${
|
|
41389
|
+
clack59.log.success(pc62.green("Telemetry disabled"));
|
|
41390
|
+
console.log(` Config: ${pc62.dim(client.getConfigPath())}`);
|
|
41277
41391
|
console.log(
|
|
41278
41392
|
`
|
|
41279
|
-
${
|
|
41393
|
+
${pc62.dim("You can re-enable with:")} wraps telemetry enable
|
|
41280
41394
|
`
|
|
41281
41395
|
);
|
|
41282
41396
|
}
|
|
41283
41397
|
async function telemetryStatus() {
|
|
41284
41398
|
const client = getTelemetryClient();
|
|
41285
|
-
|
|
41399
|
+
clack59.intro(pc62.bold("Telemetry Status"));
|
|
41286
41400
|
const override = client.getEnvOverride();
|
|
41287
|
-
const status2 = client.isEnabled() ?
|
|
41401
|
+
const status2 = client.isEnabled() ? pc62.green("Enabled") : pc62.red("Disabled");
|
|
41288
41402
|
console.log();
|
|
41289
|
-
console.log(` ${
|
|
41403
|
+
console.log(` ${pc62.bold("Status:")} ${status2}`);
|
|
41290
41404
|
if (!client.isEnabled() && override) {
|
|
41291
|
-
console.log(` ${
|
|
41405
|
+
console.log(` ${pc62.bold("Reason:")} ${pc62.yellow(override)}`);
|
|
41292
41406
|
}
|
|
41293
|
-
console.log(` ${
|
|
41407
|
+
console.log(` ${pc62.bold("Config file:")} ${pc62.dim(client.getConfigPath())}`);
|
|
41294
41408
|
if (client.isEnabled()) {
|
|
41295
41409
|
console.log();
|
|
41296
|
-
console.log(
|
|
41297
|
-
console.log(` ${
|
|
41410
|
+
console.log(pc62.bold(" How to opt-out:"));
|
|
41411
|
+
console.log(` ${pc62.cyan("wraps telemetry disable")}`);
|
|
41298
41412
|
console.log(
|
|
41299
|
-
` ${
|
|
41413
|
+
` ${pc62.dim("Or set:")} ${pc62.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
|
|
41300
41414
|
);
|
|
41301
|
-
console.log(` ${
|
|
41415
|
+
console.log(` ${pc62.dim("Or set:")} ${pc62.cyan("DO_NOT_TRACK=1")}`);
|
|
41302
41416
|
} else {
|
|
41303
41417
|
console.log();
|
|
41304
|
-
console.log(
|
|
41305
|
-
console.log(` ${
|
|
41418
|
+
console.log(pc62.bold(" How to opt-in:"));
|
|
41419
|
+
console.log(` ${pc62.cyan("wraps telemetry enable")}`);
|
|
41306
41420
|
}
|
|
41307
41421
|
console.log();
|
|
41308
|
-
console.log(
|
|
41422
|
+
console.log(pc62.bold(" Debug mode:"));
|
|
41309
41423
|
console.log(
|
|
41310
|
-
` ${
|
|
41424
|
+
` ${pc62.dim("See what would be sent:")} ${pc62.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
|
|
41311
41425
|
);
|
|
41312
41426
|
console.log();
|
|
41313
41427
|
console.log(
|
|
41314
|
-
` ${
|
|
41428
|
+
` ${pc62.dim("Learn more:")} ${pc62.cyan("https://wraps.dev/docs/telemetry")}`
|
|
41315
41429
|
);
|
|
41316
41430
|
console.log();
|
|
41317
41431
|
}
|
|
41318
41432
|
|
|
41319
41433
|
// src/commands/workflow/init.ts
|
|
41320
41434
|
init_esm_shims();
|
|
41321
|
-
import { existsSync as existsSync18, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
41435
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
41322
41436
|
import { join as join22 } from "path";
|
|
41323
|
-
import * as
|
|
41324
|
-
import
|
|
41437
|
+
import * as clack60 from "@clack/prompts";
|
|
41438
|
+
import pc63 from "picocolors";
|
|
41325
41439
|
var EXAMPLE_CASCADE_WORKFLOW = `import {
|
|
41326
41440
|
defineWorkflow,
|
|
41327
41441
|
sendEmail,
|
|
@@ -41416,75 +41530,75 @@ export default defineConfig({
|
|
|
41416
41530
|
});
|
|
41417
41531
|
`;
|
|
41418
41532
|
async function workflowInit(options = {}) {
|
|
41419
|
-
|
|
41533
|
+
clack60.intro(pc63.bgCyan(pc63.black(" wraps workflow init ")));
|
|
41420
41534
|
const wrapsDir = join22(process.cwd(), "wraps");
|
|
41421
41535
|
const workflowsDir = join22(wrapsDir, "workflows");
|
|
41422
41536
|
const configPath = join22(wrapsDir, "wraps.config.ts");
|
|
41423
41537
|
if (existsSync18(workflowsDir)) {
|
|
41424
|
-
|
|
41425
|
-
`Workflows directory already exists at ${
|
|
41538
|
+
clack60.log.info(
|
|
41539
|
+
`Workflows directory already exists at ${pc63.cyan("wraps/workflows/")}`
|
|
41426
41540
|
);
|
|
41427
41541
|
const files = existsSync18(join22(workflowsDir, "cart-recovery.ts")) || existsSync18(join22(workflowsDir, "welcome-sequence.ts"));
|
|
41428
41542
|
if (files && !options.yes) {
|
|
41429
|
-
const shouldContinue = await
|
|
41543
|
+
const shouldContinue = await clack60.confirm({
|
|
41430
41544
|
message: "Example files may already exist. Overwrite them?",
|
|
41431
41545
|
initialValue: false
|
|
41432
41546
|
});
|
|
41433
|
-
if (
|
|
41434
|
-
|
|
41547
|
+
if (clack60.isCancel(shouldContinue) || !shouldContinue) {
|
|
41548
|
+
clack60.log.info("Skipping file creation.");
|
|
41435
41549
|
showNextSteps2();
|
|
41436
|
-
|
|
41550
|
+
clack60.outro("Done!");
|
|
41437
41551
|
return;
|
|
41438
41552
|
}
|
|
41439
41553
|
}
|
|
41440
41554
|
}
|
|
41441
41555
|
try {
|
|
41442
|
-
const s =
|
|
41556
|
+
const s = clack60.spinner();
|
|
41443
41557
|
s.start("Creating workflows directory...");
|
|
41444
41558
|
mkdirSync2(workflowsDir, { recursive: true });
|
|
41445
41559
|
s.stop("Created wraps/workflows/");
|
|
41446
41560
|
s.start("Scaffolding example workflows...");
|
|
41447
|
-
|
|
41561
|
+
writeFileSync3(
|
|
41448
41562
|
join22(workflowsDir, "cart-recovery.ts"),
|
|
41449
41563
|
EXAMPLE_CASCADE_WORKFLOW,
|
|
41450
41564
|
"utf-8"
|
|
41451
41565
|
);
|
|
41452
|
-
|
|
41566
|
+
writeFileSync3(
|
|
41453
41567
|
join22(workflowsDir, "welcome-sequence.ts"),
|
|
41454
41568
|
EXAMPLE_WELCOME_WORKFLOW,
|
|
41455
41569
|
"utf-8"
|
|
41456
41570
|
);
|
|
41457
41571
|
s.stop("Created 2 example workflows");
|
|
41458
41572
|
if (!existsSync18(configPath)) {
|
|
41459
|
-
|
|
41460
|
-
|
|
41573
|
+
writeFileSync3(configPath, EXAMPLE_CONFIG, "utf-8");
|
|
41574
|
+
clack60.log.info(`Created ${pc63.cyan("wraps/wraps.config.ts")}`);
|
|
41461
41575
|
}
|
|
41462
|
-
|
|
41463
|
-
`${
|
|
41464
|
-
${
|
|
41465
|
-
${
|
|
41466
|
-
${
|
|
41576
|
+
clack60.log.success(
|
|
41577
|
+
`${pc63.bold("Workflows scaffolded!")} Created:
|
|
41578
|
+
${pc63.cyan("wraps/wraps.config.ts")} \u2014 Project config
|
|
41579
|
+
${pc63.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
|
|
41580
|
+
${pc63.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
|
|
41467
41581
|
);
|
|
41468
41582
|
showNextSteps2();
|
|
41469
|
-
|
|
41583
|
+
clack60.outro(pc63.green("Happy orchestrating!"));
|
|
41470
41584
|
} catch (error) {
|
|
41471
|
-
|
|
41585
|
+
clack60.log.error(
|
|
41472
41586
|
`Failed to scaffold workflows: ${error instanceof Error ? error.message : String(error)}`
|
|
41473
41587
|
);
|
|
41474
|
-
|
|
41588
|
+
clack60.outro(pc63.red("Scaffolding failed."));
|
|
41475
41589
|
process.exitCode = 1;
|
|
41476
41590
|
}
|
|
41477
41591
|
}
|
|
41478
41592
|
function showNextSteps2() {
|
|
41479
|
-
|
|
41480
|
-
`${
|
|
41593
|
+
clack60.log.info(
|
|
41594
|
+
`${pc63.bold("Next steps:")}
|
|
41481
41595
|
|
|
41482
|
-
1. Edit ${
|
|
41483
|
-
2. Edit your workflows in ${
|
|
41484
|
-
3. Validate: ${
|
|
41485
|
-
4. Push: ${
|
|
41596
|
+
1. Edit ${pc63.cyan("wraps/wraps.config.ts")} with your org slug and domain
|
|
41597
|
+
2. Edit your workflows in ${pc63.cyan("wraps/workflows/")}
|
|
41598
|
+
3. Validate: ${pc63.cyan("wraps email workflows validate")}
|
|
41599
|
+
4. Push: ${pc63.cyan("wraps email workflows push")}
|
|
41486
41600
|
|
|
41487
|
-
${
|
|
41601
|
+
${pc63.dim("Docs:")} ${pc63.underline("https://wraps.dev/docs/guides/orchestration")}`
|
|
41488
41602
|
);
|
|
41489
41603
|
}
|
|
41490
41604
|
|
|
@@ -41518,7 +41632,12 @@ var STRING_FLAGS = [
|
|
|
41518
41632
|
"org",
|
|
41519
41633
|
"subdomain",
|
|
41520
41634
|
"tier",
|
|
41521
|
-
"expires"
|
|
41635
|
+
"expires",
|
|
41636
|
+
"database-url",
|
|
41637
|
+
"neon-api-key",
|
|
41638
|
+
"neon-org-id",
|
|
41639
|
+
"license-key",
|
|
41640
|
+
"app-url"
|
|
41522
41641
|
];
|
|
41523
41642
|
var BOOLEAN_FLAGS = [
|
|
41524
41643
|
"yes",
|
|
@@ -41674,208 +41793,208 @@ function showVersion() {
|
|
|
41674
41793
|
process.exit(0);
|
|
41675
41794
|
}
|
|
41676
41795
|
function showHelp() {
|
|
41677
|
-
|
|
41796
|
+
clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
|
|
41678
41797
|
console.log("Deploy AWS infrastructure to your account\n");
|
|
41679
41798
|
console.log("Usage: wraps [service] <command> [options]\n");
|
|
41680
41799
|
console.log("Services:");
|
|
41681
|
-
console.log(` ${
|
|
41800
|
+
console.log(` ${pc65.cyan("email")} Email infrastructure (AWS SES)`);
|
|
41682
41801
|
console.log(
|
|
41683
|
-
` ${
|
|
41802
|
+
` ${pc65.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
|
|
41684
41803
|
);
|
|
41685
41804
|
console.log(
|
|
41686
|
-
` ${
|
|
41805
|
+
` ${pc65.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
|
|
41687
41806
|
);
|
|
41688
41807
|
console.log(
|
|
41689
|
-
` ${
|
|
41808
|
+
` ${pc65.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
|
|
41690
41809
|
);
|
|
41691
41810
|
console.log(
|
|
41692
|
-
` ${
|
|
41811
|
+
` ${pc65.cyan("license")} License key management (Wraps team only)
|
|
41693
41812
|
`
|
|
41694
41813
|
);
|
|
41695
41814
|
console.log("Email Commands:");
|
|
41696
41815
|
console.log(
|
|
41697
|
-
` ${
|
|
41816
|
+
` ${pc65.cyan("email init")} Deploy new email infrastructure`
|
|
41698
41817
|
);
|
|
41699
41818
|
console.log(
|
|
41700
|
-
` ${
|
|
41819
|
+
` ${pc65.cyan("email check")} Check email deliverability for a domain`
|
|
41701
41820
|
);
|
|
41702
41821
|
console.log(
|
|
41703
|
-
` ${
|
|
41822
|
+
` ${pc65.cyan("email connect")} Connect to existing AWS SES`
|
|
41704
41823
|
);
|
|
41705
41824
|
console.log(
|
|
41706
|
-
` ${
|
|
41825
|
+
` ${pc65.cyan("email status")} Show email infrastructure details`
|
|
41707
41826
|
);
|
|
41708
|
-
console.log(` ${
|
|
41709
|
-
console.log(` ${
|
|
41827
|
+
console.log(` ${pc65.cyan("email test")} Send a test email`);
|
|
41828
|
+
console.log(` ${pc65.cyan("email verify")} Verify domain DNS records`);
|
|
41710
41829
|
console.log(
|
|
41711
|
-
` ${
|
|
41830
|
+
` ${pc65.cyan("email sync")} Apply CLI updates to infrastructure`
|
|
41712
41831
|
);
|
|
41713
|
-
console.log(` ${
|
|
41832
|
+
console.log(` ${pc65.cyan("email upgrade")} Add features`);
|
|
41714
41833
|
console.log(
|
|
41715
|
-
` ${
|
|
41834
|
+
` ${pc65.cyan("email restore")} Restore original configuration`
|
|
41716
41835
|
);
|
|
41717
41836
|
console.log(
|
|
41718
|
-
` ${
|
|
41837
|
+
` ${pc65.cyan("email destroy")} Remove email infrastructure`
|
|
41719
41838
|
);
|
|
41720
41839
|
console.log(
|
|
41721
|
-
` ${
|
|
41840
|
+
` ${pc65.cyan("email doctor")} Diagnose and clean up email infrastructure`
|
|
41722
41841
|
);
|
|
41723
|
-
console.log(` ${
|
|
41724
|
-
console.log(` ${
|
|
41725
|
-
console.log(` ${
|
|
41842
|
+
console.log(` ${pc65.cyan("email domains add")} Add a domain to SES`);
|
|
41843
|
+
console.log(` ${pc65.cyan("email domains list")} List all domains`);
|
|
41844
|
+
console.log(` ${pc65.cyan("email domains remove")} Remove a domain`);
|
|
41726
41845
|
console.log(
|
|
41727
|
-
` ${
|
|
41846
|
+
` ${pc65.cyan("email inbound init")} Enable inbound email receiving`
|
|
41728
41847
|
);
|
|
41729
|
-
console.log(` ${
|
|
41848
|
+
console.log(` ${pc65.cyan("email inbound status")} Show inbound email status`);
|
|
41730
41849
|
console.log(
|
|
41731
|
-
` ${
|
|
41850
|
+
` ${pc65.cyan("email inbound verify")} Verify inbound DNS records`
|
|
41732
41851
|
);
|
|
41733
41852
|
console.log(
|
|
41734
|
-
` ${
|
|
41853
|
+
` ${pc65.cyan("email inbound test")} Send test email and verify receipt`
|
|
41735
41854
|
);
|
|
41736
41855
|
console.log(
|
|
41737
|
-
` ${
|
|
41856
|
+
` ${pc65.cyan("email inbound destroy")} Remove inbound email infrastructure
|
|
41738
41857
|
`
|
|
41739
41858
|
);
|
|
41740
41859
|
console.log("Template Commands:");
|
|
41741
41860
|
console.log(
|
|
41742
|
-
` ${
|
|
41861
|
+
` ${pc65.cyan("email templates init")} Initialize templates-as-code`
|
|
41743
41862
|
);
|
|
41744
41863
|
console.log(
|
|
41745
|
-
` ${
|
|
41864
|
+
` ${pc65.cyan("email templates push")} Push templates to SES + dashboard`
|
|
41746
41865
|
);
|
|
41747
41866
|
console.log(
|
|
41748
|
-
` ${
|
|
41867
|
+
` ${pc65.cyan("email templates preview")} Preview templates in browser`
|
|
41749
41868
|
);
|
|
41750
41869
|
console.log(
|
|
41751
|
-
` ${
|
|
41870
|
+
` ${pc65.cyan("push")} ${pc65.dim("(alias for email templates push)")}
|
|
41752
41871
|
`
|
|
41753
41872
|
);
|
|
41754
41873
|
console.log("Workflow Commands:");
|
|
41755
41874
|
console.log(
|
|
41756
|
-
` ${
|
|
41875
|
+
` ${pc65.cyan("email workflows init")} Initialize workflows-as-code`
|
|
41757
41876
|
);
|
|
41758
41877
|
console.log(
|
|
41759
|
-
` ${
|
|
41878
|
+
` ${pc65.cyan("email workflows validate")} Validate workflow files`
|
|
41760
41879
|
);
|
|
41761
41880
|
console.log(
|
|
41762
|
-
` ${
|
|
41881
|
+
` ${pc65.cyan("email workflows push")} Push workflows to dashboard
|
|
41763
41882
|
`
|
|
41764
41883
|
);
|
|
41765
41884
|
console.log("SMS Commands:");
|
|
41766
|
-
console.log(` ${
|
|
41885
|
+
console.log(` ${pc65.cyan("sms init")} Deploy SMS infrastructure`);
|
|
41767
41886
|
console.log(
|
|
41768
|
-
` ${
|
|
41887
|
+
` ${pc65.cyan("sms status")} Show SMS infrastructure details`
|
|
41769
41888
|
);
|
|
41770
|
-
console.log(` ${
|
|
41889
|
+
console.log(` ${pc65.cyan("sms test")} Send a test SMS message`);
|
|
41771
41890
|
console.log(
|
|
41772
|
-
` ${
|
|
41891
|
+
` ${pc65.cyan("sms verify-number")} Verify a destination phone number`
|
|
41773
41892
|
);
|
|
41774
41893
|
console.log(
|
|
41775
|
-
` ${
|
|
41894
|
+
` ${pc65.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
|
|
41776
41895
|
);
|
|
41777
|
-
console.log(` ${
|
|
41778
|
-
console.log(` ${
|
|
41896
|
+
console.log(` ${pc65.cyan("sms upgrade")} Upgrade SMS features`);
|
|
41897
|
+
console.log(` ${pc65.cyan("sms register")} Register toll-free number`);
|
|
41779
41898
|
console.log(
|
|
41780
|
-
` ${
|
|
41899
|
+
` ${pc65.cyan("sms destroy")} Remove SMS infrastructure
|
|
41781
41900
|
`
|
|
41782
41901
|
);
|
|
41783
41902
|
console.log("CDN Commands:");
|
|
41784
41903
|
console.log(
|
|
41785
|
-
` ${
|
|
41904
|
+
` ${pc65.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
|
|
41786
41905
|
);
|
|
41787
41906
|
console.log(
|
|
41788
|
-
` ${
|
|
41907
|
+
` ${pc65.cyan("cdn status")} Show CDN infrastructure details`
|
|
41789
41908
|
);
|
|
41790
41909
|
console.log(
|
|
41791
|
-
` ${
|
|
41910
|
+
` ${pc65.cyan("cdn verify")} Check DNS and certificate status`
|
|
41792
41911
|
);
|
|
41793
41912
|
console.log(
|
|
41794
|
-
` ${
|
|
41913
|
+
` ${pc65.cyan("cdn upgrade")} Add custom domain after cert validation`
|
|
41795
41914
|
);
|
|
41796
41915
|
console.log(
|
|
41797
|
-
` ${
|
|
41916
|
+
` ${pc65.cyan("cdn sync")} Sync infrastructure with current config`
|
|
41798
41917
|
);
|
|
41799
41918
|
console.log(
|
|
41800
|
-
` ${
|
|
41919
|
+
` ${pc65.cyan("cdn destroy")} Remove CDN infrastructure
|
|
41801
41920
|
`
|
|
41802
41921
|
);
|
|
41803
41922
|
console.log("Self-Hosted Commands:");
|
|
41804
41923
|
console.log(
|
|
41805
|
-
` ${
|
|
41924
|
+
` ${pc65.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
|
|
41806
41925
|
);
|
|
41807
41926
|
console.log(
|
|
41808
|
-
` ${
|
|
41927
|
+
` ${pc65.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
|
|
41809
41928
|
);
|
|
41810
41929
|
console.log(
|
|
41811
|
-
` ${
|
|
41930
|
+
` ${pc65.cyan("selfhost status")} Show self-hosted deployment details
|
|
41812
41931
|
`
|
|
41813
41932
|
);
|
|
41814
41933
|
console.log("Local Development:");
|
|
41815
41934
|
console.log(
|
|
41816
|
-
` ${
|
|
41935
|
+
` ${pc65.cyan("console")} Start local web console
|
|
41817
41936
|
`
|
|
41818
41937
|
);
|
|
41819
41938
|
console.log("Platform:");
|
|
41820
41939
|
console.log(
|
|
41821
|
-
` ${
|
|
41940
|
+
` ${pc65.cyan("platform")} Show platform info and pricing`
|
|
41822
41941
|
);
|
|
41823
41942
|
console.log(
|
|
41824
|
-
` ${
|
|
41943
|
+
` ${pc65.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
|
|
41825
41944
|
);
|
|
41826
41945
|
console.log(
|
|
41827
|
-
` ${
|
|
41946
|
+
` ${pc65.cyan("platform update-role")} Update platform IAM permissions
|
|
41828
41947
|
`
|
|
41829
41948
|
);
|
|
41830
41949
|
console.log("Auth:");
|
|
41831
41950
|
console.log(
|
|
41832
|
-
` ${
|
|
41951
|
+
` ${pc65.cyan("auth login")} Sign in to wraps.dev (device flow)`
|
|
41833
41952
|
);
|
|
41834
|
-
console.log(` ${
|
|
41953
|
+
console.log(` ${pc65.cyan("auth status")} Show current auth state`);
|
|
41835
41954
|
console.log(
|
|
41836
|
-
` ${
|
|
41955
|
+
` ${pc65.cyan("auth logout")} Sign out and remove stored token
|
|
41837
41956
|
`
|
|
41838
41957
|
);
|
|
41839
41958
|
console.log("AWS Setup:");
|
|
41840
41959
|
console.log(
|
|
41841
|
-
` ${
|
|
41960
|
+
` ${pc65.cyan("aws setup")} Interactive AWS setup wizard`
|
|
41842
41961
|
);
|
|
41843
41962
|
console.log(
|
|
41844
|
-
` ${
|
|
41963
|
+
` ${pc65.cyan("aws doctor")} Diagnose AWS configuration issues
|
|
41845
41964
|
`
|
|
41846
41965
|
);
|
|
41847
41966
|
console.log("Global Commands:");
|
|
41848
|
-
console.log(` ${
|
|
41849
|
-
console.log(` ${
|
|
41850
|
-
console.log(` ${
|
|
41851
|
-
console.log(` ${
|
|
41967
|
+
console.log(` ${pc65.cyan("status")} Show overview of all services`);
|
|
41968
|
+
console.log(` ${pc65.cyan("destroy")} Remove deployed infrastructure`);
|
|
41969
|
+
console.log(` ${pc65.cyan("permissions")} Show required AWS IAM permissions`);
|
|
41970
|
+
console.log(` ${pc65.cyan("completion")} Generate shell completion script`);
|
|
41852
41971
|
console.log(
|
|
41853
|
-
` ${
|
|
41972
|
+
` ${pc65.cyan("telemetry")} Manage anonymous telemetry settings`
|
|
41854
41973
|
);
|
|
41855
|
-
console.log(` ${
|
|
41856
|
-
console.log(` ${
|
|
41974
|
+
console.log(` ${pc65.cyan("update")} Update CLI to latest version`);
|
|
41975
|
+
console.log(` ${pc65.cyan("news")} Show recent Wraps updates`);
|
|
41857
41976
|
console.log(
|
|
41858
|
-
` ${
|
|
41977
|
+
` ${pc65.cyan("support")} Get help and support contact info
|
|
41859
41978
|
`
|
|
41860
41979
|
);
|
|
41861
41980
|
console.log("Options:");
|
|
41862
41981
|
console.log(
|
|
41863
|
-
` ${
|
|
41864
|
-
);
|
|
41865
|
-
console.log(` ${
|
|
41866
|
-
console.log(` ${
|
|
41867
|
-
console.log(` ${
|
|
41868
|
-
console.log(` ${
|
|
41869
|
-
console.log(` ${
|
|
41870
|
-
console.log(` ${
|
|
41871
|
-
console.log(` ${
|
|
41982
|
+
` ${pc65.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
|
|
41983
|
+
);
|
|
41984
|
+
console.log(` ${pc65.dim("-r, --region")} AWS region`);
|
|
41985
|
+
console.log(` ${pc65.dim("-d, --domain")} Domain name`);
|
|
41986
|
+
console.log(` ${pc65.dim("--account")} AWS account ID or alias`);
|
|
41987
|
+
console.log(` ${pc65.dim("--preset")} Configuration preset`);
|
|
41988
|
+
console.log(` ${pc65.dim("--token")} API key or token for auth`);
|
|
41989
|
+
console.log(` ${pc65.dim("-y, --yes")} Skip confirmation prompts`);
|
|
41990
|
+
console.log(` ${pc65.dim("-f, --force")} Force destructive operations`);
|
|
41872
41991
|
console.log(
|
|
41873
|
-
` ${
|
|
41992
|
+
` ${pc65.dim("--preview")} Preview changes without deploying`
|
|
41874
41993
|
);
|
|
41875
|
-
console.log(` ${
|
|
41994
|
+
console.log(` ${pc65.dim("-v, --version")} Show version number
|
|
41876
41995
|
`);
|
|
41877
41996
|
console.log(
|
|
41878
|
-
`Run ${
|
|
41997
|
+
`Run ${pc65.cyan("wraps <service> <command> --help")} for more information.
|
|
41879
41998
|
`
|
|
41880
41999
|
);
|
|
41881
42000
|
}
|
|
@@ -41897,27 +42016,27 @@ if (!primaryCommand) {
|
|
|
41897
42016
|
const telemetry = getTelemetryClient();
|
|
41898
42017
|
if (telemetry.shouldShowNotification()) {
|
|
41899
42018
|
console.log();
|
|
41900
|
-
|
|
42019
|
+
clack61.log.info(pc65.bold("Anonymous Telemetry"));
|
|
41901
42020
|
console.log(
|
|
41902
|
-
` Wraps collects ${
|
|
42021
|
+
` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
|
|
41903
42022
|
);
|
|
41904
42023
|
console.log(
|
|
41905
|
-
` We ${
|
|
42024
|
+
` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
41906
42025
|
);
|
|
41907
42026
|
console.log(
|
|
41908
|
-
` We ${
|
|
42027
|
+
` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
41909
42028
|
);
|
|
41910
42029
|
console.log();
|
|
41911
|
-
console.log(` Opt-out anytime: ${
|
|
41912
|
-
console.log(` Or set: ${
|
|
41913
|
-
console.log(` Learn more: ${
|
|
42030
|
+
console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
|
|
42031
|
+
console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42032
|
+
console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
|
|
41914
42033
|
console.log();
|
|
41915
42034
|
telemetry.markNotificationShown();
|
|
41916
42035
|
}
|
|
41917
42036
|
trackCommand("interactive:menu", { success: true, duration_ms: 0 });
|
|
41918
|
-
|
|
42037
|
+
clack61.intro(pc65.bold(`WRAPS CLI v${VERSION}`));
|
|
41919
42038
|
console.log(" Deploy AWS infrastructure to your account.\n");
|
|
41920
|
-
const action = await
|
|
42039
|
+
const action = await clack61.select({
|
|
41921
42040
|
message: "What would you like to do?",
|
|
41922
42041
|
options: [
|
|
41923
42042
|
{
|
|
@@ -41967,13 +42086,13 @@ if (!primaryCommand) {
|
|
|
41967
42086
|
}
|
|
41968
42087
|
]
|
|
41969
42088
|
});
|
|
41970
|
-
if (
|
|
42089
|
+
if (clack61.isCancel(action)) {
|
|
41971
42090
|
trackCommand("interactive:cancel", {
|
|
41972
42091
|
success: true,
|
|
41973
42092
|
duration_ms: Date.now() - startTime
|
|
41974
42093
|
});
|
|
41975
42094
|
await telemetry.shutdown();
|
|
41976
|
-
|
|
42095
|
+
clack61.cancel("Operation cancelled.");
|
|
41977
42096
|
process.exit(0);
|
|
41978
42097
|
}
|
|
41979
42098
|
trackCommand(`interactive:${action}`, {
|
|
@@ -42053,20 +42172,20 @@ async function run() {
|
|
|
42053
42172
|
const telemetry = getTelemetryClient();
|
|
42054
42173
|
if (telemetry.shouldShowNotification()) {
|
|
42055
42174
|
console.log();
|
|
42056
|
-
|
|
42175
|
+
clack61.log.info(pc65.bold("Anonymous Telemetry"));
|
|
42057
42176
|
console.log(
|
|
42058
|
-
` Wraps collects ${
|
|
42177
|
+
` Wraps collects ${pc65.cyan("anonymous usage data")} to improve the CLI.`
|
|
42059
42178
|
);
|
|
42060
42179
|
console.log(
|
|
42061
|
-
` We ${
|
|
42180
|
+
` We ${pc65.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42062
42181
|
);
|
|
42063
42182
|
console.log(
|
|
42064
|
-
` We ${
|
|
42183
|
+
` We ${pc65.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42065
42184
|
);
|
|
42066
42185
|
console.log();
|
|
42067
|
-
console.log(` Opt-out anytime: ${
|
|
42068
|
-
console.log(` Or set: ${
|
|
42069
|
-
console.log(` Learn more: ${
|
|
42186
|
+
console.log(` Opt-out anytime: ${pc65.cyan("wraps telemetry disable")}`);
|
|
42187
|
+
console.log(` Or set: ${pc65.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42188
|
+
console.log(` Learn more: ${pc65.cyan("https://wraps.dev/docs")}`);
|
|
42070
42189
|
console.log();
|
|
42071
42190
|
telemetry.markNotificationShown();
|
|
42072
42191
|
}
|
|
@@ -42150,10 +42269,10 @@ async function run() {
|
|
|
42150
42269
|
break;
|
|
42151
42270
|
case "verify": {
|
|
42152
42271
|
if (!flags.domain) {
|
|
42153
|
-
|
|
42272
|
+
clack61.log.error("--domain flag is required");
|
|
42154
42273
|
console.log(
|
|
42155
42274
|
`
|
|
42156
|
-
Usage: ${
|
|
42275
|
+
Usage: ${pc65.cyan("wraps email verify --domain yourapp.com")}
|
|
42157
42276
|
`
|
|
42158
42277
|
);
|
|
42159
42278
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42225,12 +42344,12 @@ Usage: ${pc64.cyan("wraps email verify --domain yourapp.com")}
|
|
|
42225
42344
|
});
|
|
42226
42345
|
break;
|
|
42227
42346
|
default:
|
|
42228
|
-
|
|
42347
|
+
clack61.log.error(
|
|
42229
42348
|
`Unknown inbound command: ${inboundSubCommand || "(none)"}`
|
|
42230
42349
|
);
|
|
42231
42350
|
console.log(
|
|
42232
42351
|
`
|
|
42233
|
-
Available commands: ${
|
|
42352
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("destroy")}, ${pc65.cyan("status")}, ${pc65.cyan("verify")}, ${pc65.cyan("test")}, ${pc65.cyan("add")}, ${pc65.cyan("remove")}
|
|
42234
42353
|
`
|
|
42235
42354
|
);
|
|
42236
42355
|
throw new Error(
|
|
@@ -42282,12 +42401,12 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("destroy")}, ${pc64.cyan("
|
|
|
42282
42401
|
break;
|
|
42283
42402
|
}
|
|
42284
42403
|
default:
|
|
42285
|
-
|
|
42404
|
+
clack61.log.error(
|
|
42286
42405
|
`Unknown reply command: ${replySubCommand || "(none)"}`
|
|
42287
42406
|
);
|
|
42288
42407
|
console.log(
|
|
42289
42408
|
`
|
|
42290
|
-
Available commands: ${
|
|
42409
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("rotate")}, ${pc65.cyan("status")}, ${pc65.cyan("destroy")}, ${pc65.cyan("decode")}
|
|
42291
42410
|
`
|
|
42292
42411
|
);
|
|
42293
42412
|
throw new Error(
|
|
@@ -42312,10 +42431,10 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("rotate")}, ${pc64.cyan("s
|
|
|
42312
42431
|
break;
|
|
42313
42432
|
case "verify": {
|
|
42314
42433
|
if (!flags.domain) {
|
|
42315
|
-
|
|
42434
|
+
clack61.log.error("--domain flag is required");
|
|
42316
42435
|
console.log(
|
|
42317
42436
|
`
|
|
42318
|
-
Usage: ${
|
|
42437
|
+
Usage: ${pc65.cyan("wraps email domains verify --domain yourapp.com")}
|
|
42319
42438
|
`
|
|
42320
42439
|
);
|
|
42321
42440
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42325,10 +42444,10 @@ Usage: ${pc64.cyan("wraps email domains verify --domain yourapp.com")}
|
|
|
42325
42444
|
}
|
|
42326
42445
|
case "get-dkim": {
|
|
42327
42446
|
if (!flags.domain) {
|
|
42328
|
-
|
|
42447
|
+
clack61.log.error("--domain flag is required");
|
|
42329
42448
|
console.log(
|
|
42330
42449
|
`
|
|
42331
|
-
Usage: ${
|
|
42450
|
+
Usage: ${pc65.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
42332
42451
|
`
|
|
42333
42452
|
);
|
|
42334
42453
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42338,10 +42457,10 @@ Usage: ${pc64.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
|
42338
42457
|
}
|
|
42339
42458
|
case "remove": {
|
|
42340
42459
|
if (!flags.domain) {
|
|
42341
|
-
|
|
42460
|
+
clack61.log.error("--domain flag is required");
|
|
42342
42461
|
console.log(
|
|
42343
42462
|
`
|
|
42344
|
-
Usage: ${
|
|
42463
|
+
Usage: ${pc65.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
42345
42464
|
`
|
|
42346
42465
|
);
|
|
42347
42466
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42371,12 +42490,12 @@ Usage: ${pc64.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
|
42371
42490
|
break;
|
|
42372
42491
|
}
|
|
42373
42492
|
default:
|
|
42374
|
-
|
|
42493
|
+
clack61.log.error(
|
|
42375
42494
|
`Unknown domains command: ${domainsSubCommand || "(none)"}`
|
|
42376
42495
|
);
|
|
42377
42496
|
console.log(
|
|
42378
42497
|
`
|
|
42379
|
-
Available commands: ${
|
|
42498
|
+
Available commands: ${pc65.cyan("add")}, ${pc65.cyan("list")}, ${pc65.cyan("verify")}, ${pc65.cyan("get-dkim")}, ${pc65.cyan("remove")}, ${pc65.cyan("config")}
|
|
42380
42499
|
`
|
|
42381
42500
|
);
|
|
42382
42501
|
throw new Error(
|
|
@@ -42418,12 +42537,12 @@ Available commands: ${pc64.cyan("add")}, ${pc64.cyan("list")}, ${pc64.cyan("veri
|
|
|
42418
42537
|
});
|
|
42419
42538
|
break;
|
|
42420
42539
|
default:
|
|
42421
|
-
|
|
42540
|
+
clack61.log.error(
|
|
42422
42541
|
`Unknown templates command: ${templatesSubCommand || "(none)"}`
|
|
42423
42542
|
);
|
|
42424
42543
|
console.log(
|
|
42425
42544
|
`
|
|
42426
|
-
Available commands: ${
|
|
42545
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("push")}, ${pc65.cyan("preview")}
|
|
42427
42546
|
`
|
|
42428
42547
|
);
|
|
42429
42548
|
throw new Error(
|
|
@@ -42462,12 +42581,12 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("push")}, ${pc64.cyan("pre
|
|
|
42462
42581
|
});
|
|
42463
42582
|
break;
|
|
42464
42583
|
default:
|
|
42465
|
-
|
|
42584
|
+
clack61.log.error(
|
|
42466
42585
|
`Unknown workflows command: ${workflowsSubCommand || "(none)"}`
|
|
42467
42586
|
);
|
|
42468
42587
|
console.log(
|
|
42469
42588
|
`
|
|
42470
|
-
Available commands: ${
|
|
42589
|
+
Available commands: ${pc65.cyan("init")}, ${pc65.cyan("validate")}, ${pc65.cyan("push")}
|
|
42471
42590
|
`
|
|
42472
42591
|
);
|
|
42473
42592
|
throw new Error(
|
|
@@ -42492,10 +42611,10 @@ Available commands: ${pc64.cyan("init")}, ${pc64.cyan("validate")}, ${pc64.cyan(
|
|
|
42492
42611
|
});
|
|
42493
42612
|
break;
|
|
42494
42613
|
default:
|
|
42495
|
-
|
|
42614
|
+
clack61.log.error(`Unknown email command: ${subCommand}`);
|
|
42496
42615
|
console.log(
|
|
42497
42616
|
`
|
|
42498
|
-
Run ${
|
|
42617
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42499
42618
|
`
|
|
42500
42619
|
);
|
|
42501
42620
|
throw new Error(`Unknown email command: ${subCommand}`);
|
|
@@ -42520,10 +42639,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42520
42639
|
});
|
|
42521
42640
|
break;
|
|
42522
42641
|
default:
|
|
42523
|
-
|
|
42642
|
+
clack61.log.error(`Unknown license command: ${subCommand}`);
|
|
42524
42643
|
console.log(
|
|
42525
42644
|
`
|
|
42526
|
-
Run ${
|
|
42645
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42527
42646
|
`
|
|
42528
42647
|
);
|
|
42529
42648
|
throw new Error(`Unknown license command: ${subCommand}`);
|
|
@@ -42540,9 +42659,11 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42540
42659
|
case "deploy":
|
|
42541
42660
|
await selfhostDeploy({
|
|
42542
42661
|
region: flags.region,
|
|
42543
|
-
|
|
42544
|
-
|
|
42545
|
-
|
|
42662
|
+
databaseUrl: flags.databaseUrl,
|
|
42663
|
+
neonApiKey: flags.neonApiKey,
|
|
42664
|
+
neonOrgId: flags.neonOrgId,
|
|
42665
|
+
licenseKey: flags.licenseKey,
|
|
42666
|
+
appUrl: flags.appUrl,
|
|
42546
42667
|
yes: flags.yes,
|
|
42547
42668
|
preview: flags.preview,
|
|
42548
42669
|
json: flags.json
|
|
@@ -42562,11 +42683,17 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42562
42683
|
json: flags.json
|
|
42563
42684
|
});
|
|
42564
42685
|
break;
|
|
42686
|
+
case "env":
|
|
42687
|
+
await selfhostEnv({
|
|
42688
|
+
region: flags.region,
|
|
42689
|
+
json: flags.json
|
|
42690
|
+
});
|
|
42691
|
+
break;
|
|
42565
42692
|
default:
|
|
42566
|
-
|
|
42693
|
+
clack61.log.error(`Unknown selfhost command: ${subCommand}`);
|
|
42567
42694
|
console.log(
|
|
42568
42695
|
`
|
|
42569
|
-
Run ${
|
|
42696
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42570
42697
|
`
|
|
42571
42698
|
);
|
|
42572
42699
|
throw new Error(`Unknown selfhost command: ${subCommand}`);
|
|
@@ -42646,10 +42773,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42646
42773
|
});
|
|
42647
42774
|
break;
|
|
42648
42775
|
default:
|
|
42649
|
-
|
|
42776
|
+
clack61.log.error(`Unknown sms command: ${subCommand}`);
|
|
42650
42777
|
console.log(
|
|
42651
42778
|
`
|
|
42652
|
-
Run ${
|
|
42779
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42653
42780
|
`
|
|
42654
42781
|
);
|
|
42655
42782
|
throw new Error(`Unknown sms command: ${subCommand}`);
|
|
@@ -42710,10 +42837,10 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42710
42837
|
});
|
|
42711
42838
|
break;
|
|
42712
42839
|
default:
|
|
42713
|
-
|
|
42840
|
+
clack61.log.error(`Unknown cdn command: ${subCommand}`);
|
|
42714
42841
|
console.log(
|
|
42715
42842
|
`
|
|
42716
|
-
Run ${
|
|
42843
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42717
42844
|
`
|
|
42718
42845
|
);
|
|
42719
42846
|
throw new Error(`Unknown cdn command: ${subCommand}`);
|
|
@@ -42735,13 +42862,13 @@ Run ${pc64.cyan("wraps --help")} for available commands.
|
|
|
42735
42862
|
});
|
|
42736
42863
|
break;
|
|
42737
42864
|
default:
|
|
42738
|
-
|
|
42865
|
+
clack61.log.error(
|
|
42739
42866
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
42740
42867
|
);
|
|
42741
42868
|
console.log(`
|
|
42742
|
-
Available commands: ${
|
|
42869
|
+
Available commands: ${pc65.cyan("init")}
|
|
42743
42870
|
`);
|
|
42744
|
-
console.log(`Run ${
|
|
42871
|
+
console.log(`Run ${pc65.cyan("wraps --help")} for more information.
|
|
42745
42872
|
`);
|
|
42746
42873
|
throw new Error(
|
|
42747
42874
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
@@ -42783,14 +42910,14 @@ Available commands: ${pc64.cyan("init")}
|
|
|
42783
42910
|
});
|
|
42784
42911
|
break;
|
|
42785
42912
|
default:
|
|
42786
|
-
|
|
42913
|
+
clack61.log.error(`Unknown platform command: ${subCommand}`);
|
|
42787
42914
|
console.log(
|
|
42788
42915
|
`
|
|
42789
|
-
Available commands: ${
|
|
42916
|
+
Available commands: ${pc65.cyan("connect")}, ${pc65.cyan("update-role")}
|
|
42790
42917
|
`
|
|
42791
42918
|
);
|
|
42792
42919
|
console.log(
|
|
42793
|
-
`Run ${
|
|
42920
|
+
`Run ${pc65.cyan("wraps platform")} for more information.
|
|
42794
42921
|
`
|
|
42795
42922
|
);
|
|
42796
42923
|
throw new Error(`Unknown platform command: ${subCommand}`);
|
|
@@ -42815,10 +42942,10 @@ Available commands: ${pc64.cyan("connect")}, ${pc64.cyan("update-role")}
|
|
|
42815
42942
|
await logout();
|
|
42816
42943
|
break;
|
|
42817
42944
|
default:
|
|
42818
|
-
|
|
42945
|
+
clack61.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
42819
42946
|
console.log(
|
|
42820
42947
|
`
|
|
42821
|
-
Available commands: ${
|
|
42948
|
+
Available commands: ${pc65.cyan("login")}, ${pc65.cyan("status")}, ${pc65.cyan("logout")}
|
|
42822
42949
|
`
|
|
42823
42950
|
);
|
|
42824
42951
|
throw new Error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
@@ -42836,13 +42963,13 @@ Available commands: ${pc64.cyan("login")}, ${pc64.cyan("status")}, ${pc64.cyan("
|
|
|
42836
42963
|
await doctor();
|
|
42837
42964
|
break;
|
|
42838
42965
|
default:
|
|
42839
|
-
|
|
42966
|
+
clack61.log.error(`Unknown aws command: ${subCommand}`);
|
|
42840
42967
|
console.log(
|
|
42841
42968
|
`
|
|
42842
|
-
Available commands: ${
|
|
42969
|
+
Available commands: ${pc65.cyan("setup")}, ${pc65.cyan("doctor")}
|
|
42843
42970
|
`
|
|
42844
42971
|
);
|
|
42845
|
-
console.log(`Run ${
|
|
42972
|
+
console.log(`Run ${pc65.cyan("wraps --help")} for more information.
|
|
42846
42973
|
`);
|
|
42847
42974
|
throw new Error(`Unknown aws command: ${subCommand}`);
|
|
42848
42975
|
}
|
|
@@ -42923,10 +43050,10 @@ Available commands: ${pc64.cyan("setup")}, ${pc64.cyan("doctor")}
|
|
|
42923
43050
|
await telemetryStatus();
|
|
42924
43051
|
break;
|
|
42925
43052
|
default:
|
|
42926
|
-
|
|
43053
|
+
clack61.log.error(`Unknown telemetry command: ${subCommand}`);
|
|
42927
43054
|
console.log(
|
|
42928
43055
|
`
|
|
42929
|
-
Available commands: ${
|
|
43056
|
+
Available commands: ${pc65.cyan("enable")}, ${pc65.cyan("disable")}, ${pc65.cyan("status")}
|
|
42930
43057
|
`
|
|
42931
43058
|
);
|
|
42932
43059
|
throw new Error(`Unknown telemetry command: ${subCommand}`);
|
|
@@ -42950,10 +43077,10 @@ Please specify a command for ${primaryCommand} service.
|
|
|
42950
43077
|
showHelp();
|
|
42951
43078
|
break;
|
|
42952
43079
|
default:
|
|
42953
|
-
|
|
43080
|
+
clack61.log.error(`Unknown command: ${primaryCommand}`);
|
|
42954
43081
|
console.log(
|
|
42955
43082
|
`
|
|
42956
|
-
Run ${
|
|
43083
|
+
Run ${pc65.cyan("wraps --help")} for available commands.
|
|
42957
43084
|
`
|
|
42958
43085
|
);
|
|
42959
43086
|
throw new Error(`Unknown command: ${primaryCommand}`);
|