@wraps.dev/cli 2.21.17 → 2.21.18
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 clack63 = await import("@clack/prompts");
|
|
1752
|
+
clack63.log.warn(
|
|
1753
1753
|
`S3 state backend unavailable (${error instanceof Error ? error.message : error}). Using local state.`
|
|
1754
1754
|
);
|
|
1755
1755
|
}
|
|
@@ -6855,23 +6855,23 @@ async function withLockRetry(fn, options) {
|
|
|
6855
6855
|
if (parsed.code !== "STACK_LOCKED") {
|
|
6856
6856
|
throw error;
|
|
6857
6857
|
}
|
|
6858
|
-
const
|
|
6859
|
-
const
|
|
6858
|
+
const clack63 = await import("@clack/prompts");
|
|
6859
|
+
const pc67 = (await import("picocolors")).default;
|
|
6860
6860
|
if (options.autoConfirm) {
|
|
6861
|
-
|
|
6861
|
+
clack63.log.warn(
|
|
6862
6862
|
"Stack is locked from a previous interrupted run. Auto-clearing..."
|
|
6863
6863
|
);
|
|
6864
6864
|
} else {
|
|
6865
|
-
const shouldClear = await
|
|
6866
|
-
message: `Stack is locked from a previous interrupted run. ${
|
|
6865
|
+
const shouldClear = await clack63.confirm({
|
|
6866
|
+
message: `Stack is locked from a previous interrupted run. ${pc67.yellow("Clear the stale lock and retry?")}`,
|
|
6867
6867
|
initialValue: true
|
|
6868
6868
|
});
|
|
6869
|
-
if (
|
|
6869
|
+
if (clack63.isCancel(shouldClear) || !shouldClear) {
|
|
6870
6870
|
throw errors.stackLocked();
|
|
6871
6871
|
}
|
|
6872
6872
|
}
|
|
6873
6873
|
const cleared = await clearStackLocks(options.accountId, options.region);
|
|
6874
|
-
|
|
6874
|
+
clack63.log.info(
|
|
6875
6875
|
`Cleared ${cleared} lock file${cleared === 1 ? "" : "s"}. Retrying...`
|
|
6876
6876
|
);
|
|
6877
6877
|
return fn();
|
|
@@ -9286,8 +9286,8 @@ async function pollDomainVerification(domain, region, options) {
|
|
|
9286
9286
|
const timeoutMs = options?.timeoutMs ?? DEFAULT_DOMAIN_POLL_TIMEOUT_MS;
|
|
9287
9287
|
const startTime = Date.now();
|
|
9288
9288
|
const sesv22 = new SESv2Client6({ region });
|
|
9289
|
-
const
|
|
9290
|
-
|
|
9289
|
+
const spinner11 = clack25.spinner();
|
|
9290
|
+
spinner11.start(
|
|
9291
9291
|
`Waiting for ${pc27.cyan(domain)} DNS verification (this can take a few minutes)...`
|
|
9292
9292
|
);
|
|
9293
9293
|
while (Date.now() - startTime < timeoutMs) {
|
|
@@ -9301,19 +9301,19 @@ async function pollDomainVerification(domain, region, options) {
|
|
|
9301
9301
|
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
9302
9302
|
const elapsedStr = elapsed >= 60 ? `${Math.floor(elapsed / 60)}m ${elapsed % 60}s` : `${elapsed}s`;
|
|
9303
9303
|
if (verified) {
|
|
9304
|
-
|
|
9304
|
+
spinner11.stop(
|
|
9305
9305
|
pc27.green(`\u2713 Domain ${domain} is verified! (${elapsedStr})`)
|
|
9306
9306
|
);
|
|
9307
9307
|
return true;
|
|
9308
9308
|
}
|
|
9309
|
-
|
|
9309
|
+
spinner11.message(
|
|
9310
9310
|
`DKIM: ${dkimStatus} \u2014 ${elapsedStr} elapsed, checking every ${intervalMs / 1e3}s...`
|
|
9311
9311
|
);
|
|
9312
9312
|
} catch {
|
|
9313
9313
|
}
|
|
9314
9314
|
}
|
|
9315
9315
|
const totalElapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
9316
|
-
|
|
9316
|
+
spinner11.stop(
|
|
9317
9317
|
pc27.yellow(
|
|
9318
9318
|
`\u23F1 Timed out after ${Math.round(totalElapsed / 60)}m waiting for DNS verification`
|
|
9319
9319
|
)
|
|
@@ -9330,8 +9330,8 @@ async function verifySandboxRecipient(email, region, options) {
|
|
|
9330
9330
|
const msg = error instanceof Error ? error.message : String(error);
|
|
9331
9331
|
return { verified: false, email, error: msg };
|
|
9332
9332
|
}
|
|
9333
|
-
const
|
|
9334
|
-
|
|
9333
|
+
const spinner11 = clack25.spinner();
|
|
9334
|
+
spinner11.start(
|
|
9335
9335
|
`Verification email sent to ${pc27.cyan(email)} \u2014 waiting for confirmation...`
|
|
9336
9336
|
);
|
|
9337
9337
|
const startTime = Date.now();
|
|
@@ -9347,16 +9347,16 @@ async function verifySandboxRecipient(email, region, options) {
|
|
|
9347
9347
|
const elapsed = Math.round((Date.now() - startTime) / 1e3);
|
|
9348
9348
|
const elapsedStr = elapsed >= 60 ? `${Math.floor(elapsed / 60)}m ${elapsed % 60}s` : `${elapsed}s`;
|
|
9349
9349
|
if (attrs?.VerificationStatus === "Success") {
|
|
9350
|
-
|
|
9350
|
+
spinner11.stop(pc27.green(`\u2713 ${email} verified! (${elapsedStr})`));
|
|
9351
9351
|
return { verified: true, email };
|
|
9352
9352
|
}
|
|
9353
|
-
|
|
9353
|
+
spinner11.message(
|
|
9354
9354
|
`Waiting for ${email} to click verification link (${elapsedStr} elapsed)...`
|
|
9355
9355
|
);
|
|
9356
9356
|
} catch {
|
|
9357
9357
|
}
|
|
9358
9358
|
}
|
|
9359
|
-
|
|
9359
|
+
spinner11.stop(pc27.yellow(`\u23F1 Timed out waiting for ${email} to verify`));
|
|
9360
9360
|
return { verified: false, email };
|
|
9361
9361
|
}
|
|
9362
9362
|
var DEFAULT_DOMAIN_POLL_INTERVAL_MS, DEFAULT_DOMAIN_POLL_TIMEOUT_MS, DEFAULT_RECIPIENT_POLL_INTERVAL_MS, DEFAULT_RECIPIENT_POLL_TIMEOUT_MS;
|
|
@@ -10205,8 +10205,8 @@ import { homedir as homedir4, tmpdir as tmpdir2 } from "os";
|
|
|
10205
10205
|
import { join as join23 } from "path";
|
|
10206
10206
|
import { Readable } from "stream";
|
|
10207
10207
|
import { pipeline } from "stream/promises";
|
|
10208
|
-
import { cancel as cancel35, confirm as confirm29, intro as
|
|
10209
|
-
import
|
|
10208
|
+
import { cancel as cancel35, confirm as confirm29, intro as intro58, isCancel as isCancel40, log as log56 } from "@clack/prompts";
|
|
10209
|
+
import pc65 from "picocolors";
|
|
10210
10210
|
function isStandaloneInstall() {
|
|
10211
10211
|
return process.execPath.includes(".wraps/runtime");
|
|
10212
10212
|
}
|
|
@@ -10235,7 +10235,7 @@ function detectPlatformArch() {
|
|
|
10235
10235
|
return { platform: platform2, arch };
|
|
10236
10236
|
}
|
|
10237
10237
|
async function update(currentVersion) {
|
|
10238
|
-
|
|
10238
|
+
intro58(pc65.bold("Wraps CLI Update"));
|
|
10239
10239
|
const progress = new DeploymentProgress();
|
|
10240
10240
|
const result = await progress.execute(
|
|
10241
10241
|
"Checking for updates...",
|
|
@@ -10247,20 +10247,20 @@ async function update(currentVersion) {
|
|
|
10247
10247
|
}
|
|
10248
10248
|
const { version: latestVersion, release } = result;
|
|
10249
10249
|
if (currentVersion === latestVersion) {
|
|
10250
|
-
progress.succeed(`Already up to date ${
|
|
10250
|
+
progress.succeed(`Already up to date ${pc65.dim(`(v${currentVersion})`)}`);
|
|
10251
10251
|
return;
|
|
10252
10252
|
}
|
|
10253
10253
|
console.log();
|
|
10254
|
-
|
|
10255
|
-
`Current version: ${
|
|
10256
|
-
Latest version: ${
|
|
10254
|
+
log56.info(
|
|
10255
|
+
`Current version: ${pc65.dim(`v${currentVersion}`)}
|
|
10256
|
+
Latest version: ${pc65.cyan(`v${latestVersion}`)}`
|
|
10257
10257
|
);
|
|
10258
10258
|
console.log();
|
|
10259
10259
|
if (!isStandaloneInstall()) {
|
|
10260
|
-
|
|
10260
|
+
log56.info(
|
|
10261
10261
|
`You installed Wraps via npm. Update with:
|
|
10262
10262
|
|
|
10263
|
-
${
|
|
10263
|
+
${pc65.cyan("npm update -g @wraps.dev/cli")}`
|
|
10264
10264
|
);
|
|
10265
10265
|
return;
|
|
10266
10266
|
}
|
|
@@ -10335,7 +10335,7 @@ async function update(currentVersion) {
|
|
|
10335
10335
|
});
|
|
10336
10336
|
console.log();
|
|
10337
10337
|
progress.succeed(
|
|
10338
|
-
`Updated to ${
|
|
10338
|
+
`Updated to ${pc65.cyan(`v${latestVersion}`)} successfully!`
|
|
10339
10339
|
);
|
|
10340
10340
|
} finally {
|
|
10341
10341
|
rmSync(tmp, { recursive: true, force: true });
|
|
@@ -10358,8 +10358,8 @@ init_esm_shims();
|
|
|
10358
10358
|
import { readFileSync as readFileSync3 } from "fs";
|
|
10359
10359
|
import { dirname as dirname7, join as join24 } from "path";
|
|
10360
10360
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
10361
|
-
import * as
|
|
10362
|
-
import
|
|
10361
|
+
import * as clack62 from "@clack/prompts";
|
|
10362
|
+
import pc66 from "picocolors";
|
|
10363
10363
|
|
|
10364
10364
|
// src/commands/auth/login.ts
|
|
10365
10365
|
init_esm_shims();
|
|
@@ -10424,7 +10424,7 @@ async function login(options) {
|
|
|
10424
10424
|
clack2.intro(pc3.bold("Wraps \u203A Sign In"));
|
|
10425
10425
|
const baseURL = getAppBaseUrl();
|
|
10426
10426
|
const authClient = createCliAuthClient(baseURL);
|
|
10427
|
-
const
|
|
10427
|
+
const spinner11 = clack2.spinner();
|
|
10428
10428
|
const { data: codeData, error: codeError } = await authClient.device.code({
|
|
10429
10429
|
client_id: "wraps-cli"
|
|
10430
10430
|
});
|
|
@@ -10453,7 +10453,7 @@ async function login(options) {
|
|
|
10453
10453
|
clack2.log.info("Opening browser...");
|
|
10454
10454
|
} catch {
|
|
10455
10455
|
}
|
|
10456
|
-
|
|
10456
|
+
spinner11.start("Waiting for approval...");
|
|
10457
10457
|
const pollInterval = (interval || 3) * 1e3;
|
|
10458
10458
|
const expiresAt = Date.now() + (expires_in || 900) * 1e3;
|
|
10459
10459
|
while (Date.now() < expiresAt) {
|
|
@@ -10464,7 +10464,7 @@ async function login(options) {
|
|
|
10464
10464
|
client_id: "wraps-cli"
|
|
10465
10465
|
});
|
|
10466
10466
|
if (tokenData?.access_token) {
|
|
10467
|
-
|
|
10467
|
+
spinner11.stop("Approved!");
|
|
10468
10468
|
const organizations = await fetchOrganizations(
|
|
10469
10469
|
baseURL,
|
|
10470
10470
|
tokenData.access_token
|
|
@@ -10517,7 +10517,7 @@ async function login(options) {
|
|
|
10517
10517
|
method: "device"
|
|
10518
10518
|
});
|
|
10519
10519
|
trackError("ACCESS_DENIED", "auth:login", { step: "poll_token" });
|
|
10520
|
-
|
|
10520
|
+
spinner11.stop("Denied.");
|
|
10521
10521
|
clack2.log.error("Authorization was denied.");
|
|
10522
10522
|
throw new Error("Authorization was denied.");
|
|
10523
10523
|
}
|
|
@@ -10532,7 +10532,7 @@ async function login(options) {
|
|
|
10532
10532
|
method: "device"
|
|
10533
10533
|
});
|
|
10534
10534
|
trackError("DEVICE_CODE_EXPIRED", "auth:login", { step: "poll_token" });
|
|
10535
|
-
|
|
10535
|
+
spinner11.stop("Expired.");
|
|
10536
10536
|
clack2.log.error("Device code expired. Run `wraps auth login` to try again.");
|
|
10537
10537
|
throw new Error("Device code expired.");
|
|
10538
10538
|
}
|
|
@@ -10907,11 +10907,11 @@ async function doctor() {
|
|
|
10907
10907
|
if (!isJsonMode()) {
|
|
10908
10908
|
clack5.intro(pc6.bold("AWS Setup Diagnostics"));
|
|
10909
10909
|
}
|
|
10910
|
-
const
|
|
10911
|
-
|
|
10910
|
+
const spinner11 = isJsonMode() ? null : clack5.spinner();
|
|
10911
|
+
spinner11?.start("Running diagnostics...");
|
|
10912
10912
|
const state = await detectAWSState();
|
|
10913
10913
|
const results = await runDiagnostics(state);
|
|
10914
|
-
|
|
10914
|
+
spinner11?.stop("Diagnostics complete");
|
|
10915
10915
|
const failCount = results.filter((r) => r.status === "fail").length;
|
|
10916
10916
|
const warnCount = results.filter((r) => r.status === "warn").length;
|
|
10917
10917
|
const passCount = results.filter((r) => r.status === "pass").length;
|
|
@@ -11515,10 +11515,10 @@ function showNextSteps(_state) {
|
|
|
11515
11515
|
async function setup(_options = {}) {
|
|
11516
11516
|
const startTime = Date.now();
|
|
11517
11517
|
clack7.intro(pc9.bold("AWS Setup Wizard"));
|
|
11518
|
-
const
|
|
11519
|
-
|
|
11518
|
+
const spinner11 = clack7.spinner();
|
|
11519
|
+
spinner11.start("Checking your AWS setup...");
|
|
11520
11520
|
const state = await detectAWSState();
|
|
11521
|
-
|
|
11521
|
+
spinner11.stop("AWS setup check complete");
|
|
11522
11522
|
displayCurrentState(state);
|
|
11523
11523
|
if (!state.cliInstalled) {
|
|
11524
11524
|
await runFullSetup();
|
|
@@ -17007,8 +17007,8 @@ async function check(options) {
|
|
|
17007
17007
|
clack15.intro(pc17.bold("Wraps Email Check"));
|
|
17008
17008
|
console.log();
|
|
17009
17009
|
}
|
|
17010
|
-
const
|
|
17011
|
-
|
|
17010
|
+
const spinner11 = isJsonMode() ? null : clack15.spinner();
|
|
17011
|
+
spinner11?.start(`Checking ${pc17.cyan(domain)}...`);
|
|
17012
17012
|
let dkimSelectors;
|
|
17013
17013
|
if (!options.dkimSelector) {
|
|
17014
17014
|
const sesTokens = await tryGetSesDkimTokens(domain);
|
|
@@ -17027,7 +17027,7 @@ async function check(options) {
|
|
|
17027
17027
|
skipTls: options.skipTls,
|
|
17028
17028
|
timeout: options.timeout
|
|
17029
17029
|
});
|
|
17030
|
-
|
|
17030
|
+
spinner11?.stop(`Check complete in ${result.duration}ms`);
|
|
17031
17031
|
if (isJsonMode()) {
|
|
17032
17032
|
jsonSuccess("email.check", result);
|
|
17033
17033
|
} else {
|
|
@@ -17041,7 +17041,7 @@ async function check(options) {
|
|
|
17041
17041
|
});
|
|
17042
17042
|
process.exit(getExitCode(result.score.grade));
|
|
17043
17043
|
} catch (error) {
|
|
17044
|
-
|
|
17044
|
+
spinner11?.stop("Check failed");
|
|
17045
17045
|
const msg = error instanceof Error ? error.message : String(error);
|
|
17046
17046
|
if (isJsonMode()) {
|
|
17047
17047
|
jsonError("email.check", { code: "CHECK_FAILED", message: msg });
|
|
@@ -22856,8 +22856,8 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
|
|
|
22856
22856
|
});
|
|
22857
22857
|
const { S3Client: S3Client2, ListObjectsV2Command: ListObjectsV2Command2, GetObjectCommand: GetObjectCommand2 } = await import("@aws-sdk/client-s3");
|
|
22858
22858
|
const s34 = new S3Client2({ region });
|
|
22859
|
-
const
|
|
22860
|
-
|
|
22859
|
+
const spinner11 = clack23.spinner();
|
|
22860
|
+
spinner11.start("Waiting for email to be processed...");
|
|
22861
22861
|
let found = false;
|
|
22862
22862
|
const startTime = Date.now();
|
|
22863
22863
|
const timeout = 3e4;
|
|
@@ -22891,7 +22891,7 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
|
|
|
22891
22891
|
const parsed = JSON.parse(body);
|
|
22892
22892
|
if (parsed.subject === testSubject) {
|
|
22893
22893
|
found = true;
|
|
22894
|
-
|
|
22894
|
+
spinner11.stop("Email received and processed!");
|
|
22895
22895
|
console.log();
|
|
22896
22896
|
console.log(` ${pc25.dim("Email ID:")} ${pc25.cyan(parsed.emailId)}`);
|
|
22897
22897
|
console.log(
|
|
@@ -22916,7 +22916,7 @@ Enable it: ${pc25.cyan("wraps email inbound init")}
|
|
|
22916
22916
|
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
22917
22917
|
}
|
|
22918
22918
|
if (!found) {
|
|
22919
|
-
|
|
22919
|
+
spinner11.stop("Timed out waiting for email.");
|
|
22920
22920
|
if (isJsonMode()) {
|
|
22921
22921
|
jsonSuccess("email.inbound.test", {
|
|
22922
22922
|
sent: true,
|
|
@@ -34009,6 +34009,167 @@ The deployment may have failed partway through. Re-run ${pc47.cyan("wraps selfho
|
|
|
34009
34009
|
});
|
|
34010
34010
|
}
|
|
34011
34011
|
|
|
34012
|
+
// src/commands/selfhost/login.ts
|
|
34013
|
+
init_esm_shims();
|
|
34014
|
+
init_events();
|
|
34015
|
+
init_config();
|
|
34016
|
+
init_json_output();
|
|
34017
|
+
init_metadata();
|
|
34018
|
+
init_region_resolver();
|
|
34019
|
+
init_aws();
|
|
34020
|
+
import * as clack45 from "@clack/prompts";
|
|
34021
|
+
import { createAuthClient as createAuthClient2 } from "better-auth/client";
|
|
34022
|
+
import {
|
|
34023
|
+
deviceAuthorizationClient as deviceAuthorizationClient2,
|
|
34024
|
+
organizationClient as organizationClient2
|
|
34025
|
+
} from "better-auth/client/plugins";
|
|
34026
|
+
import open2 from "open";
|
|
34027
|
+
import pc48 from "picocolors";
|
|
34028
|
+
function createCliAuthClient2(baseURL) {
|
|
34029
|
+
return createAuthClient2({
|
|
34030
|
+
baseURL,
|
|
34031
|
+
plugins: [deviceAuthorizationClient2(), organizationClient2()]
|
|
34032
|
+
});
|
|
34033
|
+
}
|
|
34034
|
+
async function fetchOrganizations2(baseURL, token) {
|
|
34035
|
+
try {
|
|
34036
|
+
const client = createCliAuthClient2(baseURL);
|
|
34037
|
+
const { data } = await client.organization.list({
|
|
34038
|
+
fetchOptions: {
|
|
34039
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
34040
|
+
}
|
|
34041
|
+
});
|
|
34042
|
+
if (!data) return [];
|
|
34043
|
+
return data.map((org) => ({
|
|
34044
|
+
id: org.id,
|
|
34045
|
+
name: org.name,
|
|
34046
|
+
slug: org.slug
|
|
34047
|
+
}));
|
|
34048
|
+
} catch {
|
|
34049
|
+
return [];
|
|
34050
|
+
}
|
|
34051
|
+
}
|
|
34052
|
+
async function selfhostLogin(options) {
|
|
34053
|
+
const startTime = Date.now();
|
|
34054
|
+
if (!isJsonMode()) {
|
|
34055
|
+
clack45.intro(pc48.bold("Wraps Self-Hosted \u203A Sign In"));
|
|
34056
|
+
}
|
|
34057
|
+
const identity = await validateAWSCredentials();
|
|
34058
|
+
const region = await resolveRegionForCommand({
|
|
34059
|
+
accountId: identity.accountId,
|
|
34060
|
+
optionRegion: options.region,
|
|
34061
|
+
service: "selfhost",
|
|
34062
|
+
label: "self-hosted deployment"
|
|
34063
|
+
});
|
|
34064
|
+
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34065
|
+
if (!metadata?.services?.selfhost) {
|
|
34066
|
+
clack45.log.error("No self-hosted deployment found.");
|
|
34067
|
+
console.log(
|
|
34068
|
+
`
|
|
34069
|
+
Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane first.
|
|
34070
|
+
`
|
|
34071
|
+
);
|
|
34072
|
+
process.exit(1);
|
|
34073
|
+
return;
|
|
34074
|
+
}
|
|
34075
|
+
const { appUrl } = metadata.services.selfhost.config;
|
|
34076
|
+
const baseURL = appUrl;
|
|
34077
|
+
clack45.log.info(`Connecting to: ${pc48.cyan(baseURL)}`);
|
|
34078
|
+
const authClient = createCliAuthClient2(baseURL);
|
|
34079
|
+
const spinner11 = clack45.spinner();
|
|
34080
|
+
const { data: codeData, error: codeError } = await authClient.device.code({
|
|
34081
|
+
client_id: "wraps-cli"
|
|
34082
|
+
});
|
|
34083
|
+
if (codeError || !codeData) {
|
|
34084
|
+
trackError("DEVICE_AUTH_FAILED", "selfhost:login", {
|
|
34085
|
+
step: "request_code"
|
|
34086
|
+
});
|
|
34087
|
+
clack45.log.error(
|
|
34088
|
+
`Failed to reach ${pc48.cyan(baseURL)}. Make sure the dashboard is deployed and reachable.`
|
|
34089
|
+
);
|
|
34090
|
+
throw new Error("Failed to start device authorization.");
|
|
34091
|
+
}
|
|
34092
|
+
const { device_code, user_code, interval, expires_in } = codeData;
|
|
34093
|
+
const formatted = `${user_code.slice(0, 4)}-${user_code.slice(4)}`;
|
|
34094
|
+
clack45.log.info(`Your code: ${pc48.bold(pc48.cyan(formatted))}`);
|
|
34095
|
+
clack45.log.info(`Visit: ${pc48.underline(`${baseURL}/device`)}`);
|
|
34096
|
+
try {
|
|
34097
|
+
await open2(`${baseURL}/device?user_code=${user_code}`);
|
|
34098
|
+
clack45.log.info("Opening browser...");
|
|
34099
|
+
} catch {
|
|
34100
|
+
}
|
|
34101
|
+
spinner11.start("Waiting for approval...");
|
|
34102
|
+
const pollInterval = (interval || 3) * 1e3;
|
|
34103
|
+
const expiresAt = Date.now() + (expires_in || 900) * 1e3;
|
|
34104
|
+
while (Date.now() < expiresAt) {
|
|
34105
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
34106
|
+
const { data: tokenData, error: tokenError } = await authClient.device.token({
|
|
34107
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
34108
|
+
device_code,
|
|
34109
|
+
client_id: "wraps-cli"
|
|
34110
|
+
});
|
|
34111
|
+
if (tokenData?.access_token) {
|
|
34112
|
+
spinner11.stop("Approved!");
|
|
34113
|
+
const organizations = await fetchOrganizations2(
|
|
34114
|
+
baseURL,
|
|
34115
|
+
tokenData.access_token
|
|
34116
|
+
);
|
|
34117
|
+
await saveAuthConfig({
|
|
34118
|
+
auth: {
|
|
34119
|
+
token: tokenData.access_token,
|
|
34120
|
+
tokenType: "session",
|
|
34121
|
+
expiresAt: tokenData.expires_in ? new Date(
|
|
34122
|
+
Date.now() + tokenData.expires_in * 1e3
|
|
34123
|
+
).toISOString() : void 0,
|
|
34124
|
+
organizations: organizations.length > 0 ? organizations : void 0
|
|
34125
|
+
}
|
|
34126
|
+
});
|
|
34127
|
+
trackCommand("selfhost:login", {
|
|
34128
|
+
success: true,
|
|
34129
|
+
duration_ms: Date.now() - startTime
|
|
34130
|
+
});
|
|
34131
|
+
clack45.log.success("Signed in to your self-hosted Wraps instance.");
|
|
34132
|
+
if (organizations.length === 1) {
|
|
34133
|
+
clack45.log.info(`Organization: ${pc48.cyan(organizations[0].name)}`);
|
|
34134
|
+
} else if (organizations.length > 1) {
|
|
34135
|
+
clack45.log.info(`${organizations.length} organizations available`);
|
|
34136
|
+
} else {
|
|
34137
|
+
clack45.log.info(
|
|
34138
|
+
`No organizations found. Create one at ${pc48.underline(`${baseURL}/onboarding`)} and run ${pc48.cyan("wraps selfhost login")} again.`
|
|
34139
|
+
);
|
|
34140
|
+
}
|
|
34141
|
+
if (isJsonMode()) {
|
|
34142
|
+
jsonSuccess("selfhost.login", { tokenType: "session", organizations });
|
|
34143
|
+
} else {
|
|
34144
|
+
clack45.outro(pc48.green("Done!"));
|
|
34145
|
+
}
|
|
34146
|
+
return;
|
|
34147
|
+
}
|
|
34148
|
+
if (tokenError) {
|
|
34149
|
+
const err = tokenError;
|
|
34150
|
+
const errorCode = err.error || err.code;
|
|
34151
|
+
if (errorCode === "authorization_pending") continue;
|
|
34152
|
+
if (errorCode === "slow_down") {
|
|
34153
|
+
await new Promise((r) => setTimeout(r, pollInterval));
|
|
34154
|
+
continue;
|
|
34155
|
+
}
|
|
34156
|
+
if (errorCode === "access_denied") {
|
|
34157
|
+
trackError("ACCESS_DENIED", "selfhost:login", { step: "poll_token" });
|
|
34158
|
+
spinner11.stop("Denied.");
|
|
34159
|
+
clack45.log.error("Authorization was denied.");
|
|
34160
|
+
throw new Error("Authorization was denied.");
|
|
34161
|
+
}
|
|
34162
|
+
if (errorCode === "expired_token") break;
|
|
34163
|
+
}
|
|
34164
|
+
}
|
|
34165
|
+
trackError("DEVICE_CODE_EXPIRED", "selfhost:login", { step: "poll_token" });
|
|
34166
|
+
spinner11.stop("Expired.");
|
|
34167
|
+
clack45.log.error(
|
|
34168
|
+
"Device code expired. Run `wraps selfhost login` to try again."
|
|
34169
|
+
);
|
|
34170
|
+
throw new Error("Device code expired.");
|
|
34171
|
+
}
|
|
34172
|
+
|
|
34012
34173
|
// src/commands/selfhost/status.ts
|
|
34013
34174
|
init_esm_shims();
|
|
34014
34175
|
init_events();
|
|
@@ -34017,30 +34178,30 @@ init_json_output();
|
|
|
34017
34178
|
init_metadata();
|
|
34018
34179
|
init_output();
|
|
34019
34180
|
init_region_resolver();
|
|
34020
|
-
import * as
|
|
34021
|
-
import
|
|
34181
|
+
import * as clack46 from "@clack/prompts";
|
|
34182
|
+
import pc49 from "picocolors";
|
|
34022
34183
|
function displaySelfhostStatus(options) {
|
|
34023
34184
|
const lines = [];
|
|
34024
|
-
lines.push(
|
|
34185
|
+
lines.push(pc49.bold(pc49.green("Self-Hosted Control Plane Active")));
|
|
34025
34186
|
lines.push("");
|
|
34026
|
-
lines.push(
|
|
34027
|
-
lines.push(` URL: ${
|
|
34028
|
-
lines.push(` Region: ${
|
|
34029
|
-
lines.push(` Deployed: ${
|
|
34187
|
+
lines.push(pc49.bold("API"));
|
|
34188
|
+
lines.push(` URL: ${pc49.cyan(options.apiUrl)}`);
|
|
34189
|
+
lines.push(` Region: ${pc49.cyan(options.region)}`);
|
|
34190
|
+
lines.push(` Deployed: ${pc49.dim(options.deployedAt)}`);
|
|
34030
34191
|
lines.push("");
|
|
34031
|
-
lines.push(
|
|
34032
|
-
lines.push(` App URL: ${
|
|
34033
|
-
lines.push(` License Key: ${
|
|
34192
|
+
lines.push(pc49.bold("Configuration"));
|
|
34193
|
+
lines.push(` App URL: ${pc49.cyan(options.appUrl)}`);
|
|
34194
|
+
lines.push(` License Key: ${pc49.dim(`${options.licenseKeyPrefix}...`)}`);
|
|
34034
34195
|
if (options.neonProjectId) {
|
|
34035
|
-
lines.push(` Neon Project: ${
|
|
34196
|
+
lines.push(` Neon Project: ${pc49.dim(options.neonProjectId)}`);
|
|
34036
34197
|
}
|
|
34037
|
-
|
|
34198
|
+
clack46.note(lines.join("\n"), "Self-Hosted Status");
|
|
34038
34199
|
}
|
|
34039
34200
|
async function selfhostStatus(options) {
|
|
34040
34201
|
const startTime = Date.now();
|
|
34041
34202
|
const progress = new DeploymentProgress();
|
|
34042
34203
|
if (!isJsonMode()) {
|
|
34043
|
-
|
|
34204
|
+
clack46.intro(pc49.bold("Wraps Self-Hosted Status"));
|
|
34044
34205
|
}
|
|
34045
34206
|
const identity = await progress.execute(
|
|
34046
34207
|
"Loading self-hosted status",
|
|
@@ -34055,10 +34216,10 @@ async function selfhostStatus(options) {
|
|
|
34055
34216
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34056
34217
|
if (!metadata?.services?.selfhost) {
|
|
34057
34218
|
progress.stop();
|
|
34058
|
-
|
|
34219
|
+
clack46.log.error("No self-hosted deployment found");
|
|
34059
34220
|
console.log(
|
|
34060
34221
|
`
|
|
34061
|
-
Run ${
|
|
34222
|
+
Run ${pc49.cyan("wraps selfhost deploy")} to deploy the self-hosted control plane.
|
|
34062
34223
|
`
|
|
34063
34224
|
);
|
|
34064
34225
|
process.exit(1);
|
|
@@ -34080,15 +34241,15 @@ Run ${pc48.cyan("wraps selfhost deploy")} to deploy the self-hosted control plan
|
|
|
34080
34241
|
}
|
|
34081
34242
|
displaySelfhostStatus(statusData);
|
|
34082
34243
|
console.log("");
|
|
34083
|
-
|
|
34244
|
+
clack46.log.info(pc49.bold("Commands:"));
|
|
34084
34245
|
console.log(
|
|
34085
|
-
` ${
|
|
34246
|
+
` ${pc49.cyan("wraps selfhost upgrade")} - Rebuild and redeploy the API Lambda`
|
|
34086
34247
|
);
|
|
34087
34248
|
trackCommand("selfhost:status", {
|
|
34088
34249
|
success: true,
|
|
34089
34250
|
duration_ms: Date.now() - startTime
|
|
34090
34251
|
});
|
|
34091
|
-
|
|
34252
|
+
clack46.outro(pc49.dim("Self-hosted deployment is active"));
|
|
34092
34253
|
}
|
|
34093
34254
|
|
|
34094
34255
|
// src/commands/selfhost/upgrade.ts
|
|
@@ -34096,9 +34257,9 @@ init_esm_shims();
|
|
|
34096
34257
|
import { existsSync as existsSync19 } from "fs";
|
|
34097
34258
|
import { dirname as dirname6, join as join21 } from "path";
|
|
34098
34259
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
34099
|
-
import * as
|
|
34260
|
+
import * as clack47 from "@clack/prompts";
|
|
34100
34261
|
import * as pulumi27 from "@pulumi/pulumi";
|
|
34101
|
-
import
|
|
34262
|
+
import pc50 from "picocolors";
|
|
34102
34263
|
init_events();
|
|
34103
34264
|
init_aws();
|
|
34104
34265
|
init_errors();
|
|
@@ -34114,7 +34275,7 @@ var bundledLambdaZip2 = join21(cliDir2, "api-lambda.zip");
|
|
|
34114
34275
|
async function selfhostUpgrade(options) {
|
|
34115
34276
|
const startTime = Date.now();
|
|
34116
34277
|
if (!isJsonMode()) {
|
|
34117
|
-
|
|
34278
|
+
clack47.intro(pc50.bold("Wraps Self-Hosted Control Plane Upgrade"));
|
|
34118
34279
|
}
|
|
34119
34280
|
const progress = new DeploymentProgress();
|
|
34120
34281
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -34129,7 +34290,7 @@ async function selfhostUpgrade(options) {
|
|
|
34129
34290
|
async () => validateAWSCredentialsWithDetails()
|
|
34130
34291
|
);
|
|
34131
34292
|
const identity = credentialResult.identity;
|
|
34132
|
-
progress.info(`Connected to AWS account: ${
|
|
34293
|
+
progress.info(`Connected to AWS account: ${pc50.cyan(identity.accountId)}`);
|
|
34133
34294
|
const region = await resolveRegionForCommand({
|
|
34134
34295
|
accountId: identity.accountId,
|
|
34135
34296
|
optionRegion: options.region,
|
|
@@ -34138,20 +34299,20 @@ async function selfhostUpgrade(options) {
|
|
|
34138
34299
|
});
|
|
34139
34300
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
34140
34301
|
if (!metadata?.services?.selfhost) {
|
|
34141
|
-
|
|
34142
|
-
|
|
34302
|
+
clack47.log.error("No self-hosted deployment found.");
|
|
34303
|
+
clack47.log.info(`Run ${pc50.cyan("wraps selfhost deploy")} first.`);
|
|
34143
34304
|
process.exit(1);
|
|
34144
34305
|
}
|
|
34145
34306
|
const selfhostService = metadata.services.selfhost;
|
|
34146
34307
|
progress.info(`Found deployment from: ${selfhostService.deployedAt}`);
|
|
34147
|
-
progress.info(`API URL: ${
|
|
34308
|
+
progress.info(`API URL: ${pc50.cyan(selfhostService.apiUrl)}`);
|
|
34148
34309
|
if (!(options.yes || options.preview)) {
|
|
34149
|
-
const confirmed = await
|
|
34150
|
-
message: `Upgrade self-hosted deployment in ${
|
|
34310
|
+
const confirmed = await clack47.confirm({
|
|
34311
|
+
message: `Upgrade self-hosted deployment in ${pc50.cyan(identity.accountId)} / ${pc50.cyan(region)}?`,
|
|
34151
34312
|
initialValue: true
|
|
34152
34313
|
});
|
|
34153
|
-
if (
|
|
34154
|
-
|
|
34314
|
+
if (clack47.isCancel(confirmed) || !confirmed) {
|
|
34315
|
+
clack47.cancel("Upgrade cancelled.");
|
|
34155
34316
|
process.exit(0);
|
|
34156
34317
|
}
|
|
34157
34318
|
}
|
|
@@ -34225,8 +34386,8 @@ async function selfhostUpgrade(options) {
|
|
|
34225
34386
|
resourceChanges: previewResult.resourceChanges,
|
|
34226
34387
|
commandName: "wraps selfhost upgrade"
|
|
34227
34388
|
});
|
|
34228
|
-
|
|
34229
|
-
|
|
34389
|
+
clack47.outro(
|
|
34390
|
+
pc50.green("Preview complete. Run without --preview to upgrade.")
|
|
34230
34391
|
);
|
|
34231
34392
|
return;
|
|
34232
34393
|
} catch (error) {
|
|
@@ -34297,28 +34458,28 @@ async function selfhostUpgrade(options) {
|
|
|
34297
34458
|
}
|
|
34298
34459
|
progress.info("Deployment metadata updated");
|
|
34299
34460
|
console.log("\n");
|
|
34300
|
-
|
|
34461
|
+
clack47.log.success(pc50.green(pc50.bold("Self-hosted Wraps API upgraded!")));
|
|
34301
34462
|
console.log("\n");
|
|
34302
|
-
|
|
34463
|
+
clack47.note(
|
|
34303
34464
|
[
|
|
34304
|
-
`${
|
|
34305
|
-
`${
|
|
34306
|
-
`${
|
|
34465
|
+
`${pc50.bold("API URL:")} ${pc50.cyan(outputs.apiUrl || selfhostService.apiUrl)}`,
|
|
34466
|
+
`${pc50.bold("Region:")} ${pc50.cyan(region)}`,
|
|
34467
|
+
`${pc50.bold("Lambda ARN:")} ${pc50.dim(outputs.lambdaArn)}`
|
|
34307
34468
|
].join("\n"),
|
|
34308
34469
|
"Self-Hosted Deployment"
|
|
34309
34470
|
);
|
|
34310
|
-
|
|
34311
|
-
|
|
34471
|
+
clack47.outro(
|
|
34472
|
+
pc50.green(`Upgraded in ${((Date.now() - startTime) / 1e3).toFixed(1)}s`)
|
|
34312
34473
|
);
|
|
34313
34474
|
}
|
|
34314
34475
|
|
|
34315
34476
|
// src/commands/shared/dashboard.ts
|
|
34316
34477
|
init_esm_shims();
|
|
34317
|
-
import * as
|
|
34478
|
+
import * as clack48 from "@clack/prompts";
|
|
34318
34479
|
import * as pulumi28 from "@pulumi/pulumi";
|
|
34319
34480
|
import getPort from "get-port";
|
|
34320
|
-
import
|
|
34321
|
-
import
|
|
34481
|
+
import open3 from "open";
|
|
34482
|
+
import pc51 from "picocolors";
|
|
34322
34483
|
|
|
34323
34484
|
// src/console/server.ts
|
|
34324
34485
|
init_esm_shims();
|
|
@@ -35518,13 +35679,13 @@ function createMetricsRouter(config2) {
|
|
|
35518
35679
|
const router = createRouter5();
|
|
35519
35680
|
router.get("/stream", async (req, res) => {
|
|
35520
35681
|
const connectionId = randomUUID().slice(0, 8);
|
|
35521
|
-
const
|
|
35682
|
+
const log58 = (msg, data) => {
|
|
35522
35683
|
console.log(JSON.stringify({ connectionId, msg, ...data }));
|
|
35523
35684
|
};
|
|
35524
35685
|
res.setHeader("Content-Type", "text/event-stream");
|
|
35525
35686
|
res.setHeader("Cache-Control", "no-cache");
|
|
35526
35687
|
res.setHeader("Connection", "keep-alive");
|
|
35527
|
-
|
|
35688
|
+
log58("SSE connected");
|
|
35528
35689
|
res.write('data: {"type":"connected"}\n\n');
|
|
35529
35690
|
const { startTime, endTime } = req.query;
|
|
35530
35691
|
const getTimeRange = () => ({
|
|
@@ -35534,7 +35695,7 @@ function createMetricsRouter(config2) {
|
|
|
35534
35695
|
const sendMetrics = async () => {
|
|
35535
35696
|
try {
|
|
35536
35697
|
const timeRange = getTimeRange();
|
|
35537
|
-
|
|
35698
|
+
log58("Fetching metrics", {
|
|
35538
35699
|
start: timeRange.start.toISOString(),
|
|
35539
35700
|
end: timeRange.end.toISOString()
|
|
35540
35701
|
});
|
|
@@ -35547,7 +35708,7 @@ function createMetricsRouter(config2) {
|
|
|
35547
35708
|
),
|
|
35548
35709
|
fetchSendQuota(config2.roleArn, config2.region)
|
|
35549
35710
|
]);
|
|
35550
|
-
|
|
35711
|
+
log58("Metrics fetched successfully");
|
|
35551
35712
|
const data = {
|
|
35552
35713
|
type: "metrics",
|
|
35553
35714
|
timestamp: Date.now(),
|
|
@@ -35577,7 +35738,7 @@ function createMetricsRouter(config2) {
|
|
|
35577
35738
|
const interval = setInterval(sendMetrics, 6e4);
|
|
35578
35739
|
req.on("close", () => {
|
|
35579
35740
|
clearInterval(interval);
|
|
35580
|
-
|
|
35741
|
+
log58("SSE disconnected");
|
|
35581
35742
|
});
|
|
35582
35743
|
});
|
|
35583
35744
|
router.get("/snapshot", async (_req, res) => {
|
|
@@ -36972,7 +37133,7 @@ init_output();
|
|
|
36972
37133
|
init_pulumi();
|
|
36973
37134
|
async function dashboard(options) {
|
|
36974
37135
|
await ensurePulumiInstalled();
|
|
36975
|
-
|
|
37136
|
+
clack48.intro(pc51.bold("Wraps Dashboard"));
|
|
36976
37137
|
const progress = new DeploymentProgress();
|
|
36977
37138
|
const identity = await progress.execute(
|
|
36978
37139
|
"Validating AWS credentials",
|
|
@@ -37013,9 +37174,9 @@ async function dashboard(options) {
|
|
|
37013
37174
|
}
|
|
37014
37175
|
} catch (_error) {
|
|
37015
37176
|
progress.stop();
|
|
37016
|
-
|
|
37177
|
+
clack48.log.error("No Wraps infrastructure found");
|
|
37017
37178
|
console.log(
|
|
37018
|
-
`\\nRun ${
|
|
37179
|
+
`\\nRun ${pc51.cyan("wraps email init")}, ${pc51.cyan("wraps sms init")}, or ${pc51.cyan("wraps storage init")} to deploy infrastructure first.\\n`
|
|
37019
37180
|
);
|
|
37020
37181
|
process.exit(1);
|
|
37021
37182
|
}
|
|
@@ -37057,9 +37218,9 @@ async function dashboard(options) {
|
|
|
37057
37218
|
}
|
|
37058
37219
|
const port = options.port || await getPort({ port: [5555, 5556, 5557, 5558, 5559] });
|
|
37059
37220
|
progress.stop();
|
|
37060
|
-
|
|
37221
|
+
clack48.log.success("Starting dashboard server...");
|
|
37061
37222
|
console.log(
|
|
37062
|
-
`${
|
|
37223
|
+
`${pc51.dim("Using current AWS credentials (no role assumption)")}\\n`
|
|
37063
37224
|
);
|
|
37064
37225
|
const { url } = await startConsoleServer({
|
|
37065
37226
|
port,
|
|
@@ -37092,11 +37253,11 @@ async function dashboard(options) {
|
|
|
37092
37253
|
cdnCustomDomain,
|
|
37093
37254
|
cdnCertificateArn
|
|
37094
37255
|
});
|
|
37095
|
-
console.log(`\\n${
|
|
37096
|
-
console.log(`${
|
|
37256
|
+
console.log(`\\n${pc51.bold("Dashboard:")} ${pc51.cyan(url)}`);
|
|
37257
|
+
console.log(`${pc51.dim("Press Ctrl+C to stop")}\\n`);
|
|
37097
37258
|
getTelemetryClient().showFooterOnce();
|
|
37098
37259
|
if (!options.noOpen) {
|
|
37099
|
-
await
|
|
37260
|
+
await open3(url);
|
|
37100
37261
|
}
|
|
37101
37262
|
trackCommand("console", {
|
|
37102
37263
|
success: true,
|
|
@@ -37114,8 +37275,8 @@ init_aws();
|
|
|
37114
37275
|
init_errors();
|
|
37115
37276
|
init_json_output();
|
|
37116
37277
|
init_metadata();
|
|
37117
|
-
import * as
|
|
37118
|
-
import
|
|
37278
|
+
import * as clack49 from "@clack/prompts";
|
|
37279
|
+
import pc52 from "picocolors";
|
|
37119
37280
|
async function destroy(options) {
|
|
37120
37281
|
trackCommand("destroy", { success: true });
|
|
37121
37282
|
if (isJsonMode() && !options.force) {
|
|
@@ -37126,16 +37287,16 @@ async function destroy(options) {
|
|
|
37126
37287
|
);
|
|
37127
37288
|
}
|
|
37128
37289
|
if (!isJsonMode()) {
|
|
37129
|
-
|
|
37290
|
+
clack49.intro(pc52.bold("Wraps Infrastructure Teardown"));
|
|
37130
37291
|
}
|
|
37131
|
-
const
|
|
37132
|
-
|
|
37292
|
+
const spinner11 = clack49.spinner();
|
|
37293
|
+
spinner11.start("Validating AWS credentials");
|
|
37133
37294
|
let identity;
|
|
37134
37295
|
try {
|
|
37135
37296
|
identity = await validateAWSCredentials();
|
|
37136
|
-
|
|
37297
|
+
spinner11.stop("AWS credentials validated");
|
|
37137
37298
|
} catch (error) {
|
|
37138
|
-
|
|
37299
|
+
spinner11.stop("AWS credentials validation failed");
|
|
37139
37300
|
throw error;
|
|
37140
37301
|
}
|
|
37141
37302
|
const region = options.region || await getAWSRegion();
|
|
@@ -37145,17 +37306,17 @@ async function destroy(options) {
|
|
|
37145
37306
|
deployedServices.push("email");
|
|
37146
37307
|
}
|
|
37147
37308
|
if (deployedServices.length === 0) {
|
|
37148
|
-
|
|
37309
|
+
clack49.log.warn("No Wraps services found in this region");
|
|
37149
37310
|
console.log(
|
|
37150
37311
|
`
|
|
37151
|
-
Run ${
|
|
37312
|
+
Run ${pc52.cyan("wraps email init")} to deploy infrastructure.
|
|
37152
37313
|
`
|
|
37153
37314
|
);
|
|
37154
37315
|
process.exit(0);
|
|
37155
37316
|
}
|
|
37156
37317
|
if (deployedServices.length === 1) {
|
|
37157
37318
|
const service = deployedServices[0];
|
|
37158
|
-
|
|
37319
|
+
clack49.log.info(`Found ${pc52.cyan(service)} service deployed`);
|
|
37159
37320
|
if (service === "email") {
|
|
37160
37321
|
await emailDestroy(options);
|
|
37161
37322
|
return;
|
|
@@ -37170,7 +37331,7 @@ Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
|
|
|
37170
37331
|
jsonSuccess("destroy", { destroyed: true });
|
|
37171
37332
|
return;
|
|
37172
37333
|
}
|
|
37173
|
-
const serviceToDestroy = await
|
|
37334
|
+
const serviceToDestroy = await clack49.select({
|
|
37174
37335
|
message: "Which service would you like to destroy?",
|
|
37175
37336
|
options: [
|
|
37176
37337
|
...deployedServices.map((s) => ({
|
|
@@ -37185,15 +37346,15 @@ Run ${pc51.cyan("wraps email init")} to deploy infrastructure.
|
|
|
37185
37346
|
}
|
|
37186
37347
|
]
|
|
37187
37348
|
});
|
|
37188
|
-
if (
|
|
37189
|
-
|
|
37349
|
+
if (clack49.isCancel(serviceToDestroy)) {
|
|
37350
|
+
clack49.cancel("Operation cancelled.");
|
|
37190
37351
|
process.exit(0);
|
|
37191
37352
|
}
|
|
37192
37353
|
if ((serviceToDestroy === "email" || serviceToDestroy === "all") && deployedServices.includes("email")) {
|
|
37193
37354
|
await emailDestroy(options);
|
|
37194
37355
|
}
|
|
37195
37356
|
if (serviceToDestroy === "all") {
|
|
37196
|
-
|
|
37357
|
+
clack49.outro(pc52.green("All Wraps infrastructure has been removed"));
|
|
37197
37358
|
}
|
|
37198
37359
|
}
|
|
37199
37360
|
|
|
@@ -37205,26 +37366,26 @@ init_fs();
|
|
|
37205
37366
|
init_json_output();
|
|
37206
37367
|
init_output();
|
|
37207
37368
|
init_pulumi();
|
|
37208
|
-
import * as
|
|
37369
|
+
import * as clack50 from "@clack/prompts";
|
|
37209
37370
|
import * as pulumi29 from "@pulumi/pulumi";
|
|
37210
|
-
import
|
|
37371
|
+
import pc53 from "picocolors";
|
|
37211
37372
|
async function status(options) {
|
|
37212
37373
|
await ensurePulumiInstalled();
|
|
37213
37374
|
const startTime = Date.now();
|
|
37214
37375
|
const progress = new DeploymentProgress();
|
|
37215
37376
|
if (!isJsonMode()) {
|
|
37216
|
-
|
|
37377
|
+
clack50.intro(pc53.bold("Wraps Infrastructure Status"));
|
|
37217
37378
|
}
|
|
37218
37379
|
const identity = await progress.execute(
|
|
37219
37380
|
"Loading infrastructure status",
|
|
37220
37381
|
async () => validateAWSCredentials()
|
|
37221
37382
|
);
|
|
37222
37383
|
if (!isJsonMode()) {
|
|
37223
|
-
progress.info(`AWS Account: ${
|
|
37384
|
+
progress.info(`AWS Account: ${pc53.cyan(identity.accountId)}`);
|
|
37224
37385
|
}
|
|
37225
37386
|
const region = options.region || await getAWSRegion();
|
|
37226
37387
|
if (!isJsonMode()) {
|
|
37227
|
-
progress.info(`Region: ${
|
|
37388
|
+
progress.info(`Region: ${pc53.cyan(region)}`);
|
|
37228
37389
|
}
|
|
37229
37390
|
const services = [];
|
|
37230
37391
|
try {
|
|
@@ -37276,35 +37437,35 @@ async function status(options) {
|
|
|
37276
37437
|
return;
|
|
37277
37438
|
}
|
|
37278
37439
|
console.log();
|
|
37279
|
-
|
|
37440
|
+
clack50.note(
|
|
37280
37441
|
services.map((s) => {
|
|
37281
37442
|
if (s.status === "deployed") {
|
|
37282
|
-
const details = s.details ?
|
|
37283
|
-
return ` ${
|
|
37443
|
+
const details = s.details ? pc53.dim(` (${s.details})`) : "";
|
|
37444
|
+
return ` ${pc53.green("\u2713")} ${s.name}${details}`;
|
|
37284
37445
|
}
|
|
37285
|
-
return ` ${
|
|
37446
|
+
return ` ${pc53.dim("\u25CB")} ${s.name} ${pc53.dim("(not deployed)")}`;
|
|
37286
37447
|
}).join("\n"),
|
|
37287
37448
|
"Services"
|
|
37288
37449
|
);
|
|
37289
37450
|
const hasDeployedServices = services.some((s) => s.status === "deployed");
|
|
37290
37451
|
if (hasDeployedServices) {
|
|
37291
37452
|
console.log(`
|
|
37292
|
-
${
|
|
37453
|
+
${pc53.bold("Details:")}`);
|
|
37293
37454
|
if (services.find((s) => s.name === "Email")?.status === "deployed") {
|
|
37294
|
-
console.log(` ${
|
|
37455
|
+
console.log(` ${pc53.dim("Email:")} ${pc53.cyan("wraps email status")}`);
|
|
37295
37456
|
}
|
|
37296
37457
|
if (services.find((s) => s.name === "SMS")?.status === "deployed") {
|
|
37297
|
-
console.log(` ${
|
|
37458
|
+
console.log(` ${pc53.dim("SMS:")} ${pc53.cyan("wraps sms status")}`);
|
|
37298
37459
|
}
|
|
37299
37460
|
} else {
|
|
37300
37461
|
console.log(`
|
|
37301
|
-
${
|
|
37302
|
-
console.log(` ${
|
|
37303
|
-
console.log(` ${
|
|
37462
|
+
${pc53.bold("Get started:")}`);
|
|
37463
|
+
console.log(` ${pc53.dim("Deploy email:")} ${pc53.cyan("wraps email init")}`);
|
|
37464
|
+
console.log(` ${pc53.dim("Deploy SMS:")} ${pc53.cyan("wraps sms init")}`);
|
|
37304
37465
|
}
|
|
37305
37466
|
console.log(`
|
|
37306
|
-
${
|
|
37307
|
-
console.log(`${
|
|
37467
|
+
${pc53.bold("Dashboard:")} ${pc53.blue("https://app.wraps.dev")}`);
|
|
37468
|
+
console.log(`${pc53.bold("Docs:")} ${pc53.blue("https://wraps.dev/docs")}
|
|
37308
37469
|
`);
|
|
37309
37470
|
trackCommand("status", {
|
|
37310
37471
|
success: true,
|
|
@@ -37315,9 +37476,9 @@ ${pc52.bold("Dashboard:")} ${pc52.blue("https://app.wraps.dev")}`);
|
|
|
37315
37476
|
|
|
37316
37477
|
// src/commands/sms/destroy.ts
|
|
37317
37478
|
init_esm_shims();
|
|
37318
|
-
import * as
|
|
37479
|
+
import * as clack51 from "@clack/prompts";
|
|
37319
37480
|
import * as pulumi31 from "@pulumi/pulumi";
|
|
37320
|
-
import
|
|
37481
|
+
import pc54 from "picocolors";
|
|
37321
37482
|
|
|
37322
37483
|
// src/infrastructure/sms-stack.ts
|
|
37323
37484
|
init_esm_shims();
|
|
@@ -38008,18 +38169,18 @@ async function createSMSProtectConfigurationWithSDK(configurationSetName, region
|
|
|
38008
38169
|
const existing = await client.send(
|
|
38009
38170
|
new DescribeProtectConfigurationsCommand({})
|
|
38010
38171
|
);
|
|
38011
|
-
for (const
|
|
38012
|
-
if (!(
|
|
38172
|
+
for (const pc67 of existing.ProtectConfigurations || []) {
|
|
38173
|
+
if (!(pc67.ProtectConfigurationArn && pc67.ProtectConfigurationId)) {
|
|
38013
38174
|
continue;
|
|
38014
38175
|
}
|
|
38015
38176
|
const tagsResponse = await client.send(
|
|
38016
38177
|
new ListTagsForResourceCommand({
|
|
38017
|
-
ResourceArn:
|
|
38178
|
+
ResourceArn: pc67.ProtectConfigurationArn
|
|
38018
38179
|
})
|
|
38019
38180
|
);
|
|
38020
38181
|
const nameTag = tagsResponse.Tags?.find((t) => t.Key === "Name");
|
|
38021
38182
|
if (nameTag?.Value === protectConfigName) {
|
|
38022
|
-
existingProtectConfigId =
|
|
38183
|
+
existingProtectConfigId = pc67.ProtectConfigurationId;
|
|
38023
38184
|
break;
|
|
38024
38185
|
}
|
|
38025
38186
|
}
|
|
@@ -38115,13 +38276,13 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
38115
38276
|
new DescribeProtectConfigurationsCommand({})
|
|
38116
38277
|
);
|
|
38117
38278
|
if (existing.ProtectConfigurations) {
|
|
38118
|
-
for (const
|
|
38119
|
-
if (!(
|
|
38279
|
+
for (const pc67 of existing.ProtectConfigurations) {
|
|
38280
|
+
if (!(pc67.ProtectConfigurationArn && pc67.ProtectConfigurationId)) {
|
|
38120
38281
|
continue;
|
|
38121
38282
|
}
|
|
38122
38283
|
const tagsResponse = await client.send(
|
|
38123
38284
|
new ListTagsForResourceCommand({
|
|
38124
|
-
ResourceArn:
|
|
38285
|
+
ResourceArn: pc67.ProtectConfigurationArn
|
|
38125
38286
|
})
|
|
38126
38287
|
);
|
|
38127
38288
|
const isWrapsManaged = tagsResponse.Tags?.some(
|
|
@@ -38130,7 +38291,7 @@ async function deleteSMSProtectConfigurationWithSDK(region) {
|
|
|
38130
38291
|
if (isWrapsManaged) {
|
|
38131
38292
|
await client.send(
|
|
38132
38293
|
new DeleteProtectConfigurationCommand({
|
|
38133
|
-
ProtectConfigurationId:
|
|
38294
|
+
ProtectConfigurationId: pc67.ProtectConfigurationId
|
|
38134
38295
|
})
|
|
38135
38296
|
);
|
|
38136
38297
|
}
|
|
@@ -38165,8 +38326,8 @@ async function smsDestroy(options) {
|
|
|
38165
38326
|
);
|
|
38166
38327
|
}
|
|
38167
38328
|
if (!isJsonMode()) {
|
|
38168
|
-
|
|
38169
|
-
|
|
38329
|
+
clack51.intro(
|
|
38330
|
+
pc54.bold(
|
|
38170
38331
|
options.preview ? "SMS Infrastructure Destruction Preview" : "SMS Infrastructure Teardown"
|
|
38171
38332
|
)
|
|
38172
38333
|
);
|
|
@@ -38192,15 +38353,15 @@ async function smsDestroy(options) {
|
|
|
38192
38353
|
`Available regions: ${smsConnections.map((c) => c.region).join(", ")}`
|
|
38193
38354
|
);
|
|
38194
38355
|
}
|
|
38195
|
-
const selectedRegion = await
|
|
38356
|
+
const selectedRegion = await clack51.select({
|
|
38196
38357
|
message: "Multiple SMS deployments found. Which region to destroy?",
|
|
38197
38358
|
options: smsConnections.map((conn) => ({
|
|
38198
38359
|
value: conn.region,
|
|
38199
38360
|
label: conn.region
|
|
38200
38361
|
}))
|
|
38201
38362
|
});
|
|
38202
|
-
if (
|
|
38203
|
-
|
|
38363
|
+
if (clack51.isCancel(selectedRegion)) {
|
|
38364
|
+
clack51.cancel("Operation cancelled");
|
|
38204
38365
|
process.exit(0);
|
|
38205
38366
|
}
|
|
38206
38367
|
region = selectedRegion;
|
|
@@ -38211,18 +38372,18 @@ async function smsDestroy(options) {
|
|
|
38211
38372
|
const storedStackName = smsService?.pulumiStackName;
|
|
38212
38373
|
if (!smsService) {
|
|
38213
38374
|
progress.stop();
|
|
38214
|
-
|
|
38375
|
+
clack51.log.warn("No SMS infrastructure found");
|
|
38215
38376
|
process.exit(0);
|
|
38216
38377
|
}
|
|
38217
38378
|
if (!(options.force || options.preview)) {
|
|
38218
|
-
const confirmed = await
|
|
38219
|
-
message:
|
|
38379
|
+
const confirmed = await clack51.confirm({
|
|
38380
|
+
message: pc54.red(
|
|
38220
38381
|
"Are you sure you want to destroy all SMS infrastructure?"
|
|
38221
38382
|
),
|
|
38222
38383
|
initialValue: false
|
|
38223
38384
|
});
|
|
38224
|
-
if (
|
|
38225
|
-
|
|
38385
|
+
if (clack51.isCancel(confirmed) || !confirmed) {
|
|
38386
|
+
clack51.cancel("Destruction cancelled.");
|
|
38226
38387
|
process.exit(0);
|
|
38227
38388
|
}
|
|
38228
38389
|
}
|
|
@@ -38254,8 +38415,8 @@ async function smsDestroy(options) {
|
|
|
38254
38415
|
costEstimate: "Monthly cost after destruction: $0.00",
|
|
38255
38416
|
commandName: "wraps sms destroy"
|
|
38256
38417
|
});
|
|
38257
|
-
|
|
38258
|
-
|
|
38418
|
+
clack51.outro(
|
|
38419
|
+
pc54.green("Preview complete. Run without --preview to destroy.")
|
|
38259
38420
|
);
|
|
38260
38421
|
trackServiceRemoved("sms", {
|
|
38261
38422
|
preview: true,
|
|
@@ -38266,7 +38427,7 @@ async function smsDestroy(options) {
|
|
|
38266
38427
|
progress.stop();
|
|
38267
38428
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38268
38429
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38269
|
-
|
|
38430
|
+
clack51.log.warn("No SMS infrastructure found to preview");
|
|
38270
38431
|
process.exit(0);
|
|
38271
38432
|
}
|
|
38272
38433
|
trackError("PREVIEW_FAILED", "sms destroy", { step: "preview" });
|
|
@@ -38315,7 +38476,7 @@ async function smsDestroy(options) {
|
|
|
38315
38476
|
progress.stop();
|
|
38316
38477
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38317
38478
|
if (errorMessage.includes("No SMS infrastructure found")) {
|
|
38318
|
-
|
|
38479
|
+
clack51.log.warn("No SMS infrastructure found");
|
|
38319
38480
|
if (metadata) {
|
|
38320
38481
|
removeServiceFromConnection(metadata, "sms");
|
|
38321
38482
|
await saveConnectionMetadata(metadata);
|
|
@@ -38328,7 +38489,7 @@ async function smsDestroy(options) {
|
|
|
38328
38489
|
}
|
|
38329
38490
|
trackError("DESTROY_FAILED", "sms destroy", { step: "destroy" });
|
|
38330
38491
|
destroyFailed = true;
|
|
38331
|
-
|
|
38492
|
+
clack51.log.warn(
|
|
38332
38493
|
"Some resources may not have been fully removed. You can re-run this command or clean up manually in the AWS console."
|
|
38333
38494
|
);
|
|
38334
38495
|
}
|
|
@@ -38351,21 +38512,21 @@ async function smsDestroy(options) {
|
|
|
38351
38512
|
return;
|
|
38352
38513
|
}
|
|
38353
38514
|
if (destroyFailed) {
|
|
38354
|
-
|
|
38355
|
-
|
|
38515
|
+
clack51.outro(
|
|
38516
|
+
pc54.yellow("SMS infrastructure partially removed. Metadata cleaned up.")
|
|
38356
38517
|
);
|
|
38357
38518
|
} else {
|
|
38358
|
-
|
|
38519
|
+
clack51.outro(pc54.green("SMS infrastructure has been removed"));
|
|
38359
38520
|
console.log(`
|
|
38360
|
-
${
|
|
38361
|
-
console.log(` ${
|
|
38362
|
-
console.log(` ${
|
|
38363
|
-
console.log(` ${
|
|
38364
|
-
console.log(` ${
|
|
38521
|
+
${pc54.bold("Cleaned up:")}`);
|
|
38522
|
+
console.log(` ${pc54.green("\u2713")} Phone number released`);
|
|
38523
|
+
console.log(` ${pc54.green("\u2713")} Configuration set deleted`);
|
|
38524
|
+
console.log(` ${pc54.green("\u2713")} Event processing infrastructure removed`);
|
|
38525
|
+
console.log(` ${pc54.green("\u2713")} IAM role deleted`);
|
|
38365
38526
|
}
|
|
38366
38527
|
console.log(
|
|
38367
38528
|
`
|
|
38368
|
-
Run ${
|
|
38529
|
+
Run ${pc54.cyan("wraps sms init")} to deploy infrastructure again.
|
|
38369
38530
|
`
|
|
38370
38531
|
);
|
|
38371
38532
|
trackServiceRemoved("sms", {
|
|
@@ -38377,9 +38538,9 @@ Run ${pc53.cyan("wraps sms init")} to deploy infrastructure again.
|
|
|
38377
38538
|
|
|
38378
38539
|
// src/commands/sms/init.ts
|
|
38379
38540
|
init_esm_shims();
|
|
38380
|
-
import * as
|
|
38541
|
+
import * as clack52 from "@clack/prompts";
|
|
38381
38542
|
import * as pulumi32 from "@pulumi/pulumi";
|
|
38382
|
-
import
|
|
38543
|
+
import pc55 from "picocolors";
|
|
38383
38544
|
init_events();
|
|
38384
38545
|
init_aws();
|
|
38385
38546
|
init_fs();
|
|
@@ -38798,7 +38959,7 @@ function validateSMSConfig(config2) {
|
|
|
38798
38959
|
|
|
38799
38960
|
// src/commands/sms/init.ts
|
|
38800
38961
|
async function promptPhoneNumberType() {
|
|
38801
|
-
const result = await
|
|
38962
|
+
const result = await clack52.select({
|
|
38802
38963
|
message: "Select phone number type:",
|
|
38803
38964
|
options: [
|
|
38804
38965
|
{
|
|
@@ -38818,14 +38979,14 @@ async function promptPhoneNumberType() {
|
|
|
38818
38979
|
}
|
|
38819
38980
|
]
|
|
38820
38981
|
});
|
|
38821
|
-
if (
|
|
38822
|
-
|
|
38982
|
+
if (clack52.isCancel(result)) {
|
|
38983
|
+
clack52.cancel("Operation cancelled.");
|
|
38823
38984
|
process.exit(0);
|
|
38824
38985
|
}
|
|
38825
38986
|
return result;
|
|
38826
38987
|
}
|
|
38827
38988
|
async function promptSMSPreset() {
|
|
38828
|
-
const result = await
|
|
38989
|
+
const result = await clack52.select({
|
|
38829
38990
|
message: "Choose configuration preset:",
|
|
38830
38991
|
options: [
|
|
38831
38992
|
{
|
|
@@ -38850,8 +39011,8 @@ async function promptSMSPreset() {
|
|
|
38850
39011
|
}
|
|
38851
39012
|
]
|
|
38852
39013
|
});
|
|
38853
|
-
if (
|
|
38854
|
-
|
|
39014
|
+
if (clack52.isCancel(result)) {
|
|
39015
|
+
clack52.cancel("Operation cancelled.");
|
|
38855
39016
|
process.exit(0);
|
|
38856
39017
|
}
|
|
38857
39018
|
return result;
|
|
@@ -38871,7 +39032,7 @@ var COMMON_COUNTRIES = [
|
|
|
38871
39032
|
{ code: "IN", name: "India" }
|
|
38872
39033
|
];
|
|
38873
39034
|
async function promptAllowedCountries() {
|
|
38874
|
-
const result = await
|
|
39035
|
+
const result = await clack52.multiselect({
|
|
38875
39036
|
message: "Select countries to allow SMS delivery (blocks all others):",
|
|
38876
39037
|
options: COMMON_COUNTRIES.map((c) => ({
|
|
38877
39038
|
value: c.code,
|
|
@@ -38880,14 +39041,14 @@ async function promptAllowedCountries() {
|
|
|
38880
39041
|
initialValues: ["US"],
|
|
38881
39042
|
required: true
|
|
38882
39043
|
});
|
|
38883
|
-
if (
|
|
38884
|
-
|
|
39044
|
+
if (clack52.isCancel(result)) {
|
|
39045
|
+
clack52.cancel("Operation cancelled.");
|
|
38885
39046
|
process.exit(0);
|
|
38886
39047
|
}
|
|
38887
39048
|
return result;
|
|
38888
39049
|
}
|
|
38889
39050
|
async function promptEstimatedSMSVolume() {
|
|
38890
|
-
const result = await
|
|
39051
|
+
const result = await clack52.select({
|
|
38891
39052
|
message: "Estimated messages per month:",
|
|
38892
39053
|
options: [
|
|
38893
39054
|
{ value: 100, label: "< 100 (Testing)" },
|
|
@@ -38897,8 +39058,8 @@ async function promptEstimatedSMSVolume() {
|
|
|
38897
39058
|
{ value: 1e5, label: "50,000+" }
|
|
38898
39059
|
]
|
|
38899
39060
|
});
|
|
38900
|
-
if (
|
|
38901
|
-
|
|
39061
|
+
if (clack52.isCancel(result)) {
|
|
39062
|
+
clack52.cancel("Operation cancelled.");
|
|
38902
39063
|
process.exit(0);
|
|
38903
39064
|
}
|
|
38904
39065
|
return result;
|
|
@@ -38906,7 +39067,7 @@ async function promptEstimatedSMSVolume() {
|
|
|
38906
39067
|
async function init3(options) {
|
|
38907
39068
|
const startTime = Date.now();
|
|
38908
39069
|
if (!isJsonMode()) {
|
|
38909
|
-
|
|
39070
|
+
clack52.intro(pc55.bold("Wraps SMS Infrastructure Setup"));
|
|
38910
39071
|
}
|
|
38911
39072
|
const progress = new DeploymentProgress();
|
|
38912
39073
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -38920,7 +39081,7 @@ async function init3(options) {
|
|
|
38920
39081
|
"Validating AWS credentials",
|
|
38921
39082
|
async () => validateAWSCredentials()
|
|
38922
39083
|
);
|
|
38923
|
-
progress.info(`Connected to AWS account: ${
|
|
39084
|
+
progress.info(`Connected to AWS account: ${pc55.cyan(identity.accountId)}`);
|
|
38924
39085
|
const provider = options.provider || await promptProvider();
|
|
38925
39086
|
const region = options.region || await promptRegion(await getAWSRegion());
|
|
38926
39087
|
let vercelConfig;
|
|
@@ -38932,10 +39093,10 @@ async function init3(options) {
|
|
|
38932
39093
|
region
|
|
38933
39094
|
);
|
|
38934
39095
|
if (existingConnection?.services?.sms) {
|
|
38935
|
-
|
|
38936
|
-
`SMS already configured for account ${
|
|
39096
|
+
clack52.log.warn(
|
|
39097
|
+
`SMS already configured for account ${pc55.cyan(identity.accountId)} in region ${pc55.cyan(region)}`
|
|
38937
39098
|
);
|
|
38938
|
-
|
|
39099
|
+
clack52.log.info(`Use ${pc55.cyan("wraps sms status")} to view current setup`);
|
|
38939
39100
|
process.exit(0);
|
|
38940
39101
|
}
|
|
38941
39102
|
let preset = options.preset;
|
|
@@ -38952,12 +39113,12 @@ async function init3(options) {
|
|
|
38952
39113
|
optOutManagement: true,
|
|
38953
39114
|
sendingEnabled: true
|
|
38954
39115
|
};
|
|
38955
|
-
const enableEventTracking = await
|
|
39116
|
+
const enableEventTracking = await clack52.confirm({
|
|
38956
39117
|
message: "Enable event tracking (EventBridge + DynamoDB)?",
|
|
38957
39118
|
initialValue: false
|
|
38958
39119
|
});
|
|
38959
|
-
if (
|
|
38960
|
-
|
|
39120
|
+
if (clack52.isCancel(enableEventTracking)) {
|
|
39121
|
+
clack52.cancel("Operation cancelled.");
|
|
38961
39122
|
process.exit(0);
|
|
38962
39123
|
}
|
|
38963
39124
|
if (enableEventTracking) {
|
|
@@ -38977,17 +39138,17 @@ async function init3(options) {
|
|
|
38977
39138
|
}
|
|
38978
39139
|
progress.info(
|
|
38979
39140
|
`
|
|
38980
|
-
${
|
|
39141
|
+
${pc55.bold("Fraud Protection")} - Block SMS to countries where you don't do business`
|
|
38981
39142
|
);
|
|
38982
39143
|
const allowedCountries = await promptAllowedCountries();
|
|
38983
39144
|
let aitFiltering = false;
|
|
38984
39145
|
if (smsConfig.phoneNumberType !== "simulator") {
|
|
38985
|
-
const enableAIT = await
|
|
39146
|
+
const enableAIT = await clack52.confirm({
|
|
38986
39147
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
38987
39148
|
initialValue: false
|
|
38988
39149
|
});
|
|
38989
|
-
if (
|
|
38990
|
-
|
|
39150
|
+
if (clack52.isCancel(enableAIT)) {
|
|
39151
|
+
clack52.cancel("Operation cancelled.");
|
|
38991
39152
|
process.exit(0);
|
|
38992
39153
|
}
|
|
38993
39154
|
aitFiltering = enableAIT;
|
|
@@ -38999,21 +39160,21 @@ ${pc54.bold("Fraud Protection")} - Block SMS to countries where you don't do bus
|
|
|
38999
39160
|
};
|
|
39000
39161
|
const estimatedVolume = await promptEstimatedSMSVolume();
|
|
39001
39162
|
progress.info(`
|
|
39002
|
-
${
|
|
39163
|
+
${pc55.bold("Cost Estimate:")}`);
|
|
39003
39164
|
const costSummary = getSMSCostSummary(smsConfig, estimatedVolume);
|
|
39004
|
-
|
|
39165
|
+
clack52.log.info(costSummary);
|
|
39005
39166
|
const warnings = validateSMSConfig(smsConfig);
|
|
39006
39167
|
if (warnings.length > 0) {
|
|
39007
39168
|
progress.info(`
|
|
39008
|
-
${
|
|
39169
|
+
${pc55.yellow(pc55.bold("Important Notes:"))}`);
|
|
39009
39170
|
for (const warning of warnings) {
|
|
39010
|
-
|
|
39171
|
+
clack52.log.warn(warning);
|
|
39011
39172
|
}
|
|
39012
39173
|
}
|
|
39013
39174
|
if (!(options.yes || options.preview)) {
|
|
39014
39175
|
const confirmed = await confirmDeploy();
|
|
39015
39176
|
if (!confirmed) {
|
|
39016
|
-
|
|
39177
|
+
clack52.cancel("Deployment cancelled.");
|
|
39017
39178
|
process.exit(0);
|
|
39018
39179
|
}
|
|
39019
39180
|
}
|
|
@@ -39073,8 +39234,8 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
|
39073
39234
|
costEstimate: getSMSCostSummary(smsConfig, 0),
|
|
39074
39235
|
commandName: "wraps sms init"
|
|
39075
39236
|
});
|
|
39076
|
-
|
|
39077
|
-
|
|
39237
|
+
clack52.outro(
|
|
39238
|
+
pc55.green("Preview complete. Run without --preview to deploy.")
|
|
39078
39239
|
);
|
|
39079
39240
|
trackServiceInit("sms", true, {
|
|
39080
39241
|
provider,
|
|
@@ -39123,9 +39284,9 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
|
39123
39284
|
} catch (sdkError) {
|
|
39124
39285
|
sdkResourceWarning = true;
|
|
39125
39286
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39126
|
-
|
|
39127
|
-
|
|
39128
|
-
`Run ${
|
|
39287
|
+
clack52.log.warn(`Phone pool creation failed: ${msg}`);
|
|
39288
|
+
clack52.log.info(
|
|
39289
|
+
`Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39129
39290
|
);
|
|
39130
39291
|
}
|
|
39131
39292
|
}
|
|
@@ -39141,9 +39302,9 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
|
39141
39302
|
} catch (sdkError) {
|
|
39142
39303
|
sdkResourceWarning = true;
|
|
39143
39304
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39144
|
-
|
|
39145
|
-
|
|
39146
|
-
`Run ${
|
|
39305
|
+
clack52.log.warn(`Event destination creation failed: ${msg}`);
|
|
39306
|
+
clack52.log.info(
|
|
39307
|
+
`Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39147
39308
|
);
|
|
39148
39309
|
}
|
|
39149
39310
|
}
|
|
@@ -39162,14 +39323,14 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
|
39162
39323
|
} catch (sdkError) {
|
|
39163
39324
|
sdkResourceWarning = true;
|
|
39164
39325
|
const msg = sdkError instanceof Error ? sdkError.message : String(sdkError);
|
|
39165
|
-
|
|
39166
|
-
|
|
39167
|
-
`Run ${
|
|
39326
|
+
clack52.log.warn(`Protect configuration creation failed: ${msg}`);
|
|
39327
|
+
clack52.log.info(
|
|
39328
|
+
`Run ${pc55.cyan("wraps sms sync")} to retry SDK resource creation.`
|
|
39168
39329
|
);
|
|
39169
39330
|
}
|
|
39170
39331
|
}
|
|
39171
39332
|
if (sdkResourceWarning) {
|
|
39172
|
-
|
|
39333
|
+
clack52.log.warn(
|
|
39173
39334
|
"Some SDK resources failed to create. Core infrastructure is deployed."
|
|
39174
39335
|
);
|
|
39175
39336
|
}
|
|
@@ -39214,47 +39375,47 @@ ${pc54.yellow(pc54.bold("Important Notes:"))}`);
|
|
|
39214
39375
|
return;
|
|
39215
39376
|
}
|
|
39216
39377
|
console.log("\n");
|
|
39217
|
-
|
|
39378
|
+
clack52.log.success(pc55.green(pc55.bold("SMS infrastructure deployed!")));
|
|
39218
39379
|
console.log("\n");
|
|
39219
|
-
|
|
39380
|
+
clack52.note(
|
|
39220
39381
|
[
|
|
39221
|
-
`${
|
|
39222
|
-
`${
|
|
39223
|
-
`${
|
|
39224
|
-
`${
|
|
39225
|
-
outputs.tableName ? `${
|
|
39382
|
+
`${pc55.bold("Phone Number:")} ${pc55.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
39383
|
+
`${pc55.bold("Phone Type:")} ${pc55.cyan(smsConfig.phoneNumberType || "simulator")}`,
|
|
39384
|
+
`${pc55.bold("Config Set:")} ${pc55.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
39385
|
+
`${pc55.bold("Region:")} ${pc55.cyan(outputs.region)}`,
|
|
39386
|
+
outputs.tableName ? `${pc55.bold("History Table:")} ${pc55.cyan(outputs.tableName)}` : "",
|
|
39226
39387
|
"",
|
|
39227
|
-
|
|
39228
|
-
|
|
39388
|
+
pc55.dim("IAM Role:"),
|
|
39389
|
+
pc55.dim(` ${outputs.roleArn}`)
|
|
39229
39390
|
].filter(Boolean).join("\n"),
|
|
39230
39391
|
"SMS Infrastructure"
|
|
39231
39392
|
);
|
|
39232
39393
|
const nextSteps = [];
|
|
39233
39394
|
if (smsConfig.phoneNumberType === "toll-free") {
|
|
39234
39395
|
nextSteps.push(
|
|
39235
|
-
`${
|
|
39396
|
+
`${pc55.cyan("wraps sms register")} - Submit toll-free registration (required before sending)`
|
|
39236
39397
|
);
|
|
39237
39398
|
}
|
|
39238
39399
|
nextSteps.push(
|
|
39239
|
-
`${
|
|
39400
|
+
`${pc55.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39240
39401
|
);
|
|
39241
|
-
nextSteps.push(`${
|
|
39402
|
+
nextSteps.push(`${pc55.cyan("wraps sms status")} - View SMS configuration`);
|
|
39242
39403
|
console.log("\n");
|
|
39243
|
-
|
|
39404
|
+
clack52.log.info(pc55.bold("Next steps:"));
|
|
39244
39405
|
for (const step of nextSteps) {
|
|
39245
39406
|
console.log(` ${step}`);
|
|
39246
39407
|
}
|
|
39247
39408
|
console.log("\n");
|
|
39248
|
-
|
|
39249
|
-
console.log(
|
|
39409
|
+
clack52.log.info(pc55.bold("SDK Usage:"));
|
|
39410
|
+
console.log(pc55.dim(" npm install @wraps.dev/sms"));
|
|
39250
39411
|
console.log("");
|
|
39251
|
-
console.log(
|
|
39252
|
-
console.log(
|
|
39253
|
-
console.log(
|
|
39254
|
-
console.log(
|
|
39255
|
-
console.log(
|
|
39256
|
-
console.log(
|
|
39257
|
-
|
|
39412
|
+
console.log(pc55.dim(" import { Wraps } from '@wraps.dev/sms';"));
|
|
39413
|
+
console.log(pc55.dim(" const wraps = new Wraps();"));
|
|
39414
|
+
console.log(pc55.dim(" await wraps.sms.send({"));
|
|
39415
|
+
console.log(pc55.dim(" to: '+14155551234',"));
|
|
39416
|
+
console.log(pc55.dim(" message: 'Your code is 123456',"));
|
|
39417
|
+
console.log(pc55.dim(" });"));
|
|
39418
|
+
clack52.outro(pc55.green("Setup complete!"));
|
|
39258
39419
|
const duration = Date.now() - startTime;
|
|
39259
39420
|
const enabledFeatures = [];
|
|
39260
39421
|
if (smsConfig.tracking?.enabled) {
|
|
@@ -39290,8 +39451,8 @@ init_aws();
|
|
|
39290
39451
|
init_json_output();
|
|
39291
39452
|
init_metadata();
|
|
39292
39453
|
init_output();
|
|
39293
|
-
import * as
|
|
39294
|
-
import
|
|
39454
|
+
import * as clack53 from "@clack/prompts";
|
|
39455
|
+
import pc56 from "picocolors";
|
|
39295
39456
|
async function getPhoneNumberDetails(region) {
|
|
39296
39457
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePhoneNumbersCommand: DescribePhoneNumbersCommand2 } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39297
39458
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
@@ -39311,7 +39472,7 @@ async function getPhoneNumberDetails(region) {
|
|
|
39311
39472
|
return null;
|
|
39312
39473
|
} catch (error) {
|
|
39313
39474
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
39314
|
-
|
|
39475
|
+
clack53.log.error(`Error fetching phone number: ${errorMessage}`);
|
|
39315
39476
|
return null;
|
|
39316
39477
|
}
|
|
39317
39478
|
}
|
|
@@ -39332,7 +39493,7 @@ async function getRegistrationStatus(region, registrationId) {
|
|
|
39332
39493
|
async function smsRegister(options) {
|
|
39333
39494
|
const startTime = Date.now();
|
|
39334
39495
|
if (!isJsonMode()) {
|
|
39335
|
-
|
|
39496
|
+
clack53.intro(pc56.bold("Wraps SMS - Toll-Free Registration"));
|
|
39336
39497
|
}
|
|
39337
39498
|
const progress = new DeploymentProgress();
|
|
39338
39499
|
const identity = await progress.execute(
|
|
@@ -39345,8 +39506,8 @@ async function smsRegister(options) {
|
|
|
39345
39506
|
}
|
|
39346
39507
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39347
39508
|
if (!metadata?.services?.sms) {
|
|
39348
|
-
|
|
39349
|
-
|
|
39509
|
+
clack53.log.error("No SMS infrastructure found.");
|
|
39510
|
+
clack53.log.info(`Run ${pc56.cyan("wraps sms init")} first.`);
|
|
39350
39511
|
process.exit(1);
|
|
39351
39512
|
}
|
|
39352
39513
|
const phoneDetails = await progress.execute(
|
|
@@ -39354,7 +39515,7 @@ async function smsRegister(options) {
|
|
|
39354
39515
|
async () => getPhoneNumberDetails(region)
|
|
39355
39516
|
);
|
|
39356
39517
|
if (!phoneDetails) {
|
|
39357
|
-
|
|
39518
|
+
clack53.log.error("No phone number found.");
|
|
39358
39519
|
process.exit(1);
|
|
39359
39520
|
}
|
|
39360
39521
|
let registrationStatus = null;
|
|
@@ -39380,53 +39541,53 @@ async function smsRegister(options) {
|
|
|
39380
39541
|
}
|
|
39381
39542
|
console.log("");
|
|
39382
39543
|
console.log(
|
|
39383
|
-
`${
|
|
39544
|
+
`${pc56.bold("Phone Number:")} ${pc56.cyan(phoneDetails.phoneNumber)}`
|
|
39384
39545
|
);
|
|
39385
|
-
console.log(`${
|
|
39546
|
+
console.log(`${pc56.bold("Type:")} ${pc56.cyan(phoneDetails.type)}`);
|
|
39386
39547
|
console.log(
|
|
39387
|
-
`${
|
|
39548
|
+
`${pc56.bold("Status:")} ${phoneDetails.status === "ACTIVE" ? pc56.green(phoneDetails.status) : pc56.yellow(phoneDetails.status)}`
|
|
39388
39549
|
);
|
|
39389
39550
|
if (registrationStatus) {
|
|
39390
|
-
console.log(`${
|
|
39551
|
+
console.log(`${pc56.bold("Registration:")} ${pc56.cyan(registrationStatus)}`);
|
|
39391
39552
|
}
|
|
39392
39553
|
console.log("");
|
|
39393
39554
|
if (phoneDetails.status === "ACTIVE") {
|
|
39394
|
-
|
|
39555
|
+
clack53.log.success("Your phone number is already ACTIVE and ready to use!");
|
|
39395
39556
|
const { PinpointSMSVoiceV2Client: PinpointSMSVoiceV2Client5, DescribePoolsCommand } = await import("@aws-sdk/client-pinpoint-sms-voice-v2");
|
|
39396
39557
|
const client = new PinpointSMSVoiceV2Client5({ region });
|
|
39397
39558
|
const pools = await client.send(new DescribePoolsCommand({}));
|
|
39398
39559
|
if (!pools.Pools?.length) {
|
|
39399
|
-
|
|
39560
|
+
clack53.log.info("Run `wraps sms sync` to create the phone pool.");
|
|
39400
39561
|
}
|
|
39401
39562
|
process.exit(0);
|
|
39402
39563
|
}
|
|
39403
39564
|
if (phoneDetails.type !== "TOLL_FREE") {
|
|
39404
|
-
|
|
39405
|
-
|
|
39565
|
+
clack53.log.info("Only toll-free numbers require registration.");
|
|
39566
|
+
clack53.log.info(`Your ${phoneDetails.type} number should be ready to use.`);
|
|
39406
39567
|
process.exit(0);
|
|
39407
39568
|
}
|
|
39408
|
-
console.log(
|
|
39569
|
+
console.log(pc56.bold("Toll-Free Registration Required"));
|
|
39409
39570
|
console.log("");
|
|
39410
39571
|
console.log(
|
|
39411
|
-
|
|
39572
|
+
pc56.dim("To send SMS at scale, you must register your toll-free number.")
|
|
39412
39573
|
);
|
|
39413
|
-
console.log(
|
|
39574
|
+
console.log(pc56.dim("This process typically takes 1-15 business days."));
|
|
39414
39575
|
console.log("");
|
|
39415
|
-
console.log(
|
|
39416
|
-
console.log(` ${
|
|
39576
|
+
console.log(pc56.bold("You'll need to provide:"));
|
|
39577
|
+
console.log(` ${pc56.dim("\u2022")} Business name and address`);
|
|
39417
39578
|
console.log(
|
|
39418
|
-
` ${
|
|
39579
|
+
` ${pc56.dim("\u2022")} Use case description (what messages you're sending)`
|
|
39419
39580
|
);
|
|
39420
|
-
console.log(` ${
|
|
39421
|
-
console.log(` ${
|
|
39422
|
-
console.log(` ${
|
|
39581
|
+
console.log(` ${pc56.dim("\u2022")} Sample messages (2-3 examples)`);
|
|
39582
|
+
console.log(` ${pc56.dim("\u2022")} How users opt-in to receive messages`);
|
|
39583
|
+
console.log(` ${pc56.dim("\u2022")} Expected monthly message volume`);
|
|
39423
39584
|
console.log("");
|
|
39424
|
-
const openConsole = await
|
|
39585
|
+
const openConsole = await clack53.confirm({
|
|
39425
39586
|
message: "Open AWS Console to start registration?",
|
|
39426
39587
|
initialValue: true
|
|
39427
39588
|
});
|
|
39428
|
-
if (
|
|
39429
|
-
|
|
39589
|
+
if (clack53.isCancel(openConsole)) {
|
|
39590
|
+
clack53.cancel("Registration cancelled.");
|
|
39430
39591
|
process.exit(0);
|
|
39431
39592
|
}
|
|
39432
39593
|
if (openConsole) {
|
|
@@ -39436,41 +39597,41 @@ async function smsRegister(options) {
|
|
|
39436
39597
|
const execAsync2 = promisify2(exec2);
|
|
39437
39598
|
try {
|
|
39438
39599
|
await execAsync2(`open "${consoleUrl}"`);
|
|
39439
|
-
|
|
39600
|
+
clack53.log.success("Opened AWS Console in your browser.");
|
|
39440
39601
|
} catch {
|
|
39441
39602
|
try {
|
|
39442
39603
|
await execAsync2(`xdg-open "${consoleUrl}"`);
|
|
39443
|
-
|
|
39604
|
+
clack53.log.success("Opened AWS Console in your browser.");
|
|
39444
39605
|
} catch {
|
|
39445
|
-
|
|
39606
|
+
clack53.log.info("Open this URL in your browser:");
|
|
39446
39607
|
console.log(`
|
|
39447
|
-
${
|
|
39608
|
+
${pc56.cyan(consoleUrl)}
|
|
39448
39609
|
`);
|
|
39449
39610
|
}
|
|
39450
39611
|
}
|
|
39451
39612
|
console.log("");
|
|
39452
|
-
console.log(
|
|
39613
|
+
console.log(pc56.bold("Next Steps:"));
|
|
39453
39614
|
console.log(
|
|
39454
|
-
` 1. Click ${
|
|
39615
|
+
` 1. Click ${pc56.cyan("Create registration")} in the AWS Console`
|
|
39455
39616
|
);
|
|
39456
|
-
console.log(` 2. Select ${
|
|
39617
|
+
console.log(` 2. Select ${pc56.cyan("Toll-free number registration")}`);
|
|
39457
39618
|
console.log(" 3. Fill out the business information form");
|
|
39458
39619
|
console.log(" 4. Submit and wait for approval (1-15 business days)");
|
|
39459
39620
|
console.log("");
|
|
39460
39621
|
console.log(
|
|
39461
|
-
|
|
39622
|
+
pc56.dim("Once approved, run `wraps sms sync` to complete setup.")
|
|
39462
39623
|
);
|
|
39463
39624
|
} else {
|
|
39464
39625
|
const consoleUrl = `https://${region}.console.aws.amazon.com/sms-voice/home?region=${region}#/registrations`;
|
|
39465
39626
|
console.log("");
|
|
39466
39627
|
console.log("When you're ready, go to:");
|
|
39467
|
-
console.log(` ${
|
|
39628
|
+
console.log(` ${pc56.cyan(consoleUrl)}`);
|
|
39468
39629
|
}
|
|
39469
39630
|
trackCommand("sms:register", {
|
|
39470
39631
|
success: true,
|
|
39471
39632
|
duration_ms: Date.now() - startTime
|
|
39472
39633
|
});
|
|
39473
|
-
|
|
39634
|
+
clack53.outro(pc56.dim("Good luck with your registration!"));
|
|
39474
39635
|
}
|
|
39475
39636
|
|
|
39476
39637
|
// src/commands/sms/status.ts
|
|
@@ -39483,54 +39644,54 @@ init_metadata();
|
|
|
39483
39644
|
init_output();
|
|
39484
39645
|
init_pulumi();
|
|
39485
39646
|
init_region_resolver();
|
|
39486
|
-
import * as
|
|
39647
|
+
import * as clack54 from "@clack/prompts";
|
|
39487
39648
|
import * as pulumi33 from "@pulumi/pulumi";
|
|
39488
|
-
import
|
|
39649
|
+
import pc57 from "picocolors";
|
|
39489
39650
|
function displaySMSStatus(options) {
|
|
39490
39651
|
const lines = [];
|
|
39491
|
-
lines.push(
|
|
39652
|
+
lines.push(pc57.bold(pc57.green("SMS Infrastructure Active")));
|
|
39492
39653
|
lines.push("");
|
|
39493
|
-
lines.push(
|
|
39654
|
+
lines.push(pc57.bold("Phone Number"));
|
|
39494
39655
|
if (options.phoneNumber) {
|
|
39495
|
-
lines.push(` Number: ${
|
|
39656
|
+
lines.push(` Number: ${pc57.cyan(options.phoneNumber)}`);
|
|
39496
39657
|
} else {
|
|
39497
|
-
lines.push(` Number: ${
|
|
39658
|
+
lines.push(` Number: ${pc57.yellow("Provisioning...")}`);
|
|
39498
39659
|
}
|
|
39499
|
-
lines.push(` Type: ${
|
|
39660
|
+
lines.push(` Type: ${pc57.cyan(options.phoneNumberType || "simulator")}`);
|
|
39500
39661
|
lines.push("");
|
|
39501
|
-
lines.push(
|
|
39502
|
-
lines.push(` Region: ${
|
|
39662
|
+
lines.push(pc57.bold("Configuration"));
|
|
39663
|
+
lines.push(` Region: ${pc57.cyan(options.region)}`);
|
|
39503
39664
|
if (options.preset) {
|
|
39504
|
-
lines.push(` Preset: ${
|
|
39665
|
+
lines.push(` Preset: ${pc57.cyan(options.preset)}`);
|
|
39505
39666
|
}
|
|
39506
39667
|
if (options.configSetName) {
|
|
39507
|
-
lines.push(` Config Set: ${
|
|
39668
|
+
lines.push(` Config Set: ${pc57.cyan(options.configSetName)}`);
|
|
39508
39669
|
}
|
|
39509
39670
|
lines.push("");
|
|
39510
|
-
lines.push(
|
|
39671
|
+
lines.push(pc57.bold("Features"));
|
|
39511
39672
|
lines.push(
|
|
39512
|
-
` Event Tracking: ${options.eventTracking ?
|
|
39673
|
+
` Event Tracking: ${options.eventTracking ? pc57.green("Enabled") : pc57.dim("Disabled")}`
|
|
39513
39674
|
);
|
|
39514
39675
|
if (options.tableName) {
|
|
39515
|
-
lines.push(` Message History: ${
|
|
39516
|
-
lines.push(` Table: ${
|
|
39676
|
+
lines.push(` Message History: ${pc57.green("Enabled")}`);
|
|
39677
|
+
lines.push(` Table: ${pc57.dim(options.tableName)}`);
|
|
39517
39678
|
}
|
|
39518
39679
|
if (options.queueUrl) {
|
|
39519
|
-
lines.push(` Event Queue: ${
|
|
39680
|
+
lines.push(` Event Queue: ${pc57.green("Enabled")}`);
|
|
39520
39681
|
}
|
|
39521
39682
|
lines.push("");
|
|
39522
39683
|
if (options.roleArn) {
|
|
39523
|
-
lines.push(
|
|
39524
|
-
lines.push(` ${
|
|
39684
|
+
lines.push(pc57.bold("IAM Role"));
|
|
39685
|
+
lines.push(` ${pc57.dim(options.roleArn)}`);
|
|
39525
39686
|
}
|
|
39526
|
-
|
|
39687
|
+
clack54.note(lines.join("\n"), "SMS Status");
|
|
39527
39688
|
}
|
|
39528
39689
|
async function smsStatus(options) {
|
|
39529
39690
|
await ensurePulumiInstalled();
|
|
39530
39691
|
const startTime = Date.now();
|
|
39531
39692
|
const progress = new DeploymentProgress();
|
|
39532
39693
|
if (!isJsonMode()) {
|
|
39533
|
-
|
|
39694
|
+
clack54.intro(pc57.bold("Wraps SMS Status"));
|
|
39534
39695
|
}
|
|
39535
39696
|
const identity = await progress.execute(
|
|
39536
39697
|
"Loading SMS infrastructure status",
|
|
@@ -39545,10 +39706,10 @@ async function smsStatus(options) {
|
|
|
39545
39706
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39546
39707
|
if (!metadata?.services?.sms) {
|
|
39547
39708
|
progress.stop();
|
|
39548
|
-
|
|
39709
|
+
clack54.log.error("No SMS infrastructure found");
|
|
39549
39710
|
console.log(
|
|
39550
39711
|
`
|
|
39551
|
-
Run ${
|
|
39712
|
+
Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39552
39713
|
`
|
|
39553
39714
|
);
|
|
39554
39715
|
process.exit(1);
|
|
@@ -39584,25 +39745,25 @@ Run ${pc56.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39584
39745
|
}
|
|
39585
39746
|
displaySMSStatus(smsStatusData);
|
|
39586
39747
|
console.log("");
|
|
39587
|
-
|
|
39748
|
+
clack54.log.info(pc57.bold("Commands:"));
|
|
39588
39749
|
console.log(
|
|
39589
|
-
` ${
|
|
39750
|
+
` ${pc57.cyan("wraps sms test --to +1234567890")} - Send a test message`
|
|
39590
39751
|
);
|
|
39591
|
-
console.log(` ${
|
|
39752
|
+
console.log(` ${pc57.cyan("wraps sms destroy")} - Remove SMS infrastructure`);
|
|
39592
39753
|
trackCommand("sms:status", {
|
|
39593
39754
|
success: true,
|
|
39594
39755
|
phone_type: smsConfig?.phoneNumberType,
|
|
39595
39756
|
event_tracking: smsConfig?.eventTracking?.enabled,
|
|
39596
39757
|
duration_ms: Date.now() - startTime
|
|
39597
39758
|
});
|
|
39598
|
-
|
|
39759
|
+
clack54.outro(pc57.dim("SMS infrastructure is ready"));
|
|
39599
39760
|
}
|
|
39600
39761
|
|
|
39601
39762
|
// src/commands/sms/sync.ts
|
|
39602
39763
|
init_esm_shims();
|
|
39603
|
-
import * as
|
|
39764
|
+
import * as clack55 from "@clack/prompts";
|
|
39604
39765
|
import * as pulumi34 from "@pulumi/pulumi";
|
|
39605
|
-
import
|
|
39766
|
+
import pc58 from "picocolors";
|
|
39606
39767
|
init_events();
|
|
39607
39768
|
init_aws();
|
|
39608
39769
|
init_errors();
|
|
@@ -39615,7 +39776,7 @@ async function smsSync(options) {
|
|
|
39615
39776
|
await ensurePulumiInstalled();
|
|
39616
39777
|
const startTime = Date.now();
|
|
39617
39778
|
if (!isJsonMode()) {
|
|
39618
|
-
|
|
39779
|
+
clack55.intro(pc58.bold("Wraps SMS Infrastructure Sync"));
|
|
39619
39780
|
}
|
|
39620
39781
|
const progress = new DeploymentProgress();
|
|
39621
39782
|
const identity = await progress.execute(
|
|
@@ -39627,10 +39788,10 @@ async function smsSync(options) {
|
|
|
39627
39788
|
const smsService = metadata?.services?.sms;
|
|
39628
39789
|
if (!smsService?.config) {
|
|
39629
39790
|
progress.stop();
|
|
39630
|
-
|
|
39791
|
+
clack55.log.error("No SMS infrastructure found to sync");
|
|
39631
39792
|
console.log(
|
|
39632
39793
|
`
|
|
39633
|
-
Run ${
|
|
39794
|
+
Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
39634
39795
|
`
|
|
39635
39796
|
);
|
|
39636
39797
|
process.exit(1);
|
|
@@ -39639,18 +39800,18 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39639
39800
|
const storedStackName = smsService.pulumiStackName;
|
|
39640
39801
|
progress.info("Found existing SMS configuration");
|
|
39641
39802
|
progress.info(
|
|
39642
|
-
`Phone type: ${
|
|
39803
|
+
`Phone type: ${pc58.cyan(smsConfig.phoneNumberType || "simulator")}`
|
|
39643
39804
|
);
|
|
39644
39805
|
progress.info(
|
|
39645
|
-
`Event tracking: ${
|
|
39806
|
+
`Event tracking: ${pc58.cyan(smsConfig.eventTracking?.enabled ? "enabled" : "disabled")}`
|
|
39646
39807
|
);
|
|
39647
39808
|
if (!options.yes) {
|
|
39648
|
-
const confirmed = await
|
|
39809
|
+
const confirmed = await clack55.confirm({
|
|
39649
39810
|
message: "Sync SMS infrastructure? This will update Lambda code and recreate any missing resources.",
|
|
39650
39811
|
initialValue: true
|
|
39651
39812
|
});
|
|
39652
|
-
if (
|
|
39653
|
-
|
|
39813
|
+
if (clack55.isCancel(confirmed) || !confirmed) {
|
|
39814
|
+
clack55.cancel("Sync cancelled.");
|
|
39654
39815
|
process.exit(0);
|
|
39655
39816
|
}
|
|
39656
39817
|
}
|
|
@@ -39755,7 +39916,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39755
39916
|
throw errors.stackLocked();
|
|
39756
39917
|
}
|
|
39757
39918
|
trackError("SYNC_FAILED", "sms:sync", { step: "sync" });
|
|
39758
|
-
|
|
39919
|
+
clack55.log.error(`SMS sync failed: ${errorMessage}`);
|
|
39759
39920
|
process.exit(1);
|
|
39760
39921
|
}
|
|
39761
39922
|
if (metadata && smsService) {
|
|
@@ -39775,7 +39936,7 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39775
39936
|
return;
|
|
39776
39937
|
}
|
|
39777
39938
|
console.log("\n");
|
|
39778
|
-
|
|
39939
|
+
clack55.log.success(pc58.green("SMS infrastructure synced successfully!"));
|
|
39779
39940
|
const changes = [];
|
|
39780
39941
|
if (outputs.lambdaFunctions?.length) {
|
|
39781
39942
|
changes.push("Lambda functions updated");
|
|
@@ -39783,13 +39944,13 @@ Run ${pc57.cyan("wraps sms init")} to deploy SMS infrastructure first.
|
|
|
39783
39944
|
changes.push("SDK resources verified");
|
|
39784
39945
|
console.log("");
|
|
39785
39946
|
for (const change of changes) {
|
|
39786
|
-
console.log(` ${
|
|
39947
|
+
console.log(` ${pc58.green("\u2713")} ${change}`);
|
|
39787
39948
|
}
|
|
39788
39949
|
trackCommand("sms:sync", {
|
|
39789
39950
|
success: true,
|
|
39790
39951
|
duration_ms: Date.now() - startTime
|
|
39791
39952
|
});
|
|
39792
|
-
|
|
39953
|
+
clack55.outro(pc58.green("Sync complete!"));
|
|
39793
39954
|
}
|
|
39794
39955
|
|
|
39795
39956
|
// src/commands/sms/test.ts
|
|
@@ -39804,8 +39965,8 @@ import {
|
|
|
39804
39965
|
PinpointSMSVoiceV2Client as PinpointSMSVoiceV2Client3,
|
|
39805
39966
|
SendTextMessageCommand
|
|
39806
39967
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
39807
|
-
import * as
|
|
39808
|
-
import
|
|
39968
|
+
import * as clack56 from "@clack/prompts";
|
|
39969
|
+
import pc59 from "picocolors";
|
|
39809
39970
|
|
|
39810
39971
|
// src/utils/sms/validation.ts
|
|
39811
39972
|
init_esm_shims();
|
|
@@ -39828,7 +39989,7 @@ async function smsTest(options) {
|
|
|
39828
39989
|
const startTime = Date.now();
|
|
39829
39990
|
const progress = new DeploymentProgress();
|
|
39830
39991
|
if (!isJsonMode()) {
|
|
39831
|
-
|
|
39992
|
+
clack56.intro(pc59.bold("Wraps SMS Test"));
|
|
39832
39993
|
}
|
|
39833
39994
|
const identity = await progress.execute(
|
|
39834
39995
|
"Validating AWS credentials",
|
|
@@ -39838,10 +39999,10 @@ async function smsTest(options) {
|
|
|
39838
39999
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
39839
40000
|
if (!metadata?.services?.sms) {
|
|
39840
40001
|
progress.stop();
|
|
39841
|
-
|
|
40002
|
+
clack56.log.error("No SMS infrastructure found");
|
|
39842
40003
|
console.log(
|
|
39843
40004
|
`
|
|
39844
|
-
Run ${
|
|
40005
|
+
Run ${pc59.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
39845
40006
|
`
|
|
39846
40007
|
);
|
|
39847
40008
|
process.exit(1);
|
|
@@ -39855,7 +40016,7 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39855
40016
|
);
|
|
39856
40017
|
}
|
|
39857
40018
|
if (!toNumber) {
|
|
39858
|
-
const destinationType = await
|
|
40019
|
+
const destinationType = await clack56.select({
|
|
39859
40020
|
message: "Choose destination number:",
|
|
39860
40021
|
options: [
|
|
39861
40022
|
{
|
|
@@ -39870,25 +40031,25 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39870
40031
|
}
|
|
39871
40032
|
]
|
|
39872
40033
|
});
|
|
39873
|
-
if (
|
|
39874
|
-
|
|
40034
|
+
if (clack56.isCancel(destinationType)) {
|
|
40035
|
+
clack56.cancel("Operation cancelled.");
|
|
39875
40036
|
process.exit(0);
|
|
39876
40037
|
}
|
|
39877
40038
|
if (destinationType === "simulator") {
|
|
39878
|
-
const simResult = await
|
|
40039
|
+
const simResult = await clack56.select({
|
|
39879
40040
|
message: "Select simulator destination:",
|
|
39880
40041
|
options: SIMULATOR_DESTINATIONS.map((sim) => ({
|
|
39881
40042
|
value: sim.number,
|
|
39882
40043
|
label: `${sim.number} | ${sim.country}`
|
|
39883
40044
|
}))
|
|
39884
40045
|
});
|
|
39885
|
-
if (
|
|
39886
|
-
|
|
40046
|
+
if (clack56.isCancel(simResult)) {
|
|
40047
|
+
clack56.cancel("Operation cancelled.");
|
|
39887
40048
|
process.exit(0);
|
|
39888
40049
|
}
|
|
39889
40050
|
toNumber = simResult;
|
|
39890
40051
|
} else {
|
|
39891
|
-
const result = await
|
|
40052
|
+
const result = await clack56.text({
|
|
39892
40053
|
message: "Enter destination phone number (E.164 format):",
|
|
39893
40054
|
placeholder: "+14155551234",
|
|
39894
40055
|
validate: (value) => {
|
|
@@ -39901,22 +40062,22 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39901
40062
|
return;
|
|
39902
40063
|
}
|
|
39903
40064
|
});
|
|
39904
|
-
if (
|
|
39905
|
-
|
|
40065
|
+
if (clack56.isCancel(result)) {
|
|
40066
|
+
clack56.cancel("Operation cancelled.");
|
|
39906
40067
|
process.exit(0);
|
|
39907
40068
|
}
|
|
39908
40069
|
toNumber = result;
|
|
39909
40070
|
}
|
|
39910
40071
|
} else if (!isValidPhoneNumber(toNumber)) {
|
|
39911
40072
|
progress.stop();
|
|
39912
|
-
|
|
40073
|
+
clack56.log.error(
|
|
39913
40074
|
`Invalid phone number format: ${toNumber}. Use E.164 format (e.g., +14155551234)`
|
|
39914
40075
|
);
|
|
39915
40076
|
process.exit(1);
|
|
39916
40077
|
}
|
|
39917
40078
|
let message = options.message;
|
|
39918
40079
|
if (!message) {
|
|
39919
|
-
const result = await
|
|
40080
|
+
const result = await clack56.text({
|
|
39920
40081
|
message: "Enter test message:",
|
|
39921
40082
|
placeholder: "Hello from Wraps SMS!",
|
|
39922
40083
|
defaultValue: "Hello from Wraps SMS! This is a test message.",
|
|
@@ -39930,8 +40091,8 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39930
40091
|
return;
|
|
39931
40092
|
}
|
|
39932
40093
|
});
|
|
39933
|
-
if (
|
|
39934
|
-
|
|
40094
|
+
if (clack56.isCancel(result)) {
|
|
40095
|
+
clack56.cancel("Operation cancelled.");
|
|
39935
40096
|
process.exit(0);
|
|
39936
40097
|
}
|
|
39937
40098
|
message = result;
|
|
@@ -39970,16 +40131,16 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39970
40131
|
return;
|
|
39971
40132
|
}
|
|
39972
40133
|
console.log("\n");
|
|
39973
|
-
|
|
40134
|
+
clack56.log.success(pc59.green("Test SMS sent successfully!"));
|
|
39974
40135
|
console.log("");
|
|
39975
|
-
|
|
40136
|
+
clack56.note(
|
|
39976
40137
|
[
|
|
39977
|
-
`${
|
|
39978
|
-
`${
|
|
39979
|
-
`${
|
|
39980
|
-
`${
|
|
40138
|
+
`${pc59.bold("Message ID:")} ${pc59.cyan(messageId || "unknown")}`,
|
|
40139
|
+
`${pc59.bold("To:")} ${pc59.cyan(toNumber)}`,
|
|
40140
|
+
`${pc59.bold("Message:")} ${message}`,
|
|
40141
|
+
`${pc59.bold("Type:")} ${pc59.cyan(smsConfig?.phoneNumberType || "simulator")}`,
|
|
39981
40142
|
"",
|
|
39982
|
-
|
|
40143
|
+
pc59.dim(
|
|
39983
40144
|
smsConfig?.phoneNumberType === "simulator" ? "Note: Simulator messages are not actually delivered" : "Check your phone for the message!"
|
|
39984
40145
|
)
|
|
39985
40146
|
].join("\n"),
|
|
@@ -39987,11 +40148,11 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
39987
40148
|
);
|
|
39988
40149
|
if (smsConfig?.eventTracking?.enabled) {
|
|
39989
40150
|
console.log("");
|
|
39990
|
-
|
|
39991
|
-
|
|
40151
|
+
clack56.log.info(
|
|
40152
|
+
pc59.dim("Event tracking is enabled. Check DynamoDB for delivery status.")
|
|
39992
40153
|
);
|
|
39993
40154
|
}
|
|
39994
|
-
|
|
40155
|
+
clack56.outro(pc59.green("Test complete!"));
|
|
39995
40156
|
} catch (error) {
|
|
39996
40157
|
progress.stop();
|
|
39997
40158
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -40003,33 +40164,33 @@ Run ${pc58.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
40003
40164
|
});
|
|
40004
40165
|
const errorName = error instanceof Error ? error.name : "";
|
|
40005
40166
|
if (errorName === "ConflictException" || errorMessage.includes("opt-out")) {
|
|
40006
|
-
|
|
40167
|
+
clack56.log.error("Destination number has opted out of messages");
|
|
40007
40168
|
console.log("\nThe recipient has opted out of receiving SMS messages.\n");
|
|
40008
40169
|
} else if (errorName === "ThrottlingException" || errorMessage.includes("spending limit")) {
|
|
40009
|
-
|
|
40170
|
+
clack56.log.error("SMS rate or spending limit reached");
|
|
40010
40171
|
console.log(
|
|
40011
40172
|
"\nCheck your AWS account SMS spending limits in the console.\n"
|
|
40012
40173
|
);
|
|
40013
40174
|
} else if (errorName === "ValidationException") {
|
|
40014
|
-
|
|
40175
|
+
clack56.log.error(`Invalid request: ${errorMessage}`);
|
|
40015
40176
|
} else if (errorMessage.includes("not verified") || errorMessage.includes("not registered")) {
|
|
40016
|
-
|
|
40177
|
+
clack56.log.error("Toll-free number registration is not complete");
|
|
40017
40178
|
console.log(
|
|
40018
40179
|
`
|
|
40019
|
-
Run ${
|
|
40180
|
+
Run ${pc59.cyan("wraps sms register")} to check registration status.
|
|
40020
40181
|
`
|
|
40021
40182
|
);
|
|
40022
40183
|
} else if (errorName === "AccessDeniedException") {
|
|
40023
|
-
|
|
40184
|
+
clack56.log.error(
|
|
40024
40185
|
"Permission denied \u2014 IAM role may be missing SMS send permissions"
|
|
40025
40186
|
);
|
|
40026
40187
|
console.log(
|
|
40027
40188
|
`
|
|
40028
|
-
Run ${
|
|
40189
|
+
Run ${pc59.cyan("wraps sms upgrade")} to update IAM policies.
|
|
40029
40190
|
`
|
|
40030
40191
|
);
|
|
40031
40192
|
} else {
|
|
40032
|
-
|
|
40193
|
+
clack56.log.error(`Failed to send SMS: ${errorMessage}`);
|
|
40033
40194
|
}
|
|
40034
40195
|
process.exit(1);
|
|
40035
40196
|
}
|
|
@@ -40037,9 +40198,9 @@ Run ${pc58.cyan("wraps sms upgrade")} to update IAM policies.
|
|
|
40037
40198
|
|
|
40038
40199
|
// src/commands/sms/upgrade.ts
|
|
40039
40200
|
init_esm_shims();
|
|
40040
|
-
import * as
|
|
40201
|
+
import * as clack57 from "@clack/prompts";
|
|
40041
40202
|
import * as pulumi35 from "@pulumi/pulumi";
|
|
40042
|
-
import
|
|
40203
|
+
import pc60 from "picocolors";
|
|
40043
40204
|
init_events();
|
|
40044
40205
|
init_aws();
|
|
40045
40206
|
init_errors();
|
|
@@ -40054,7 +40215,7 @@ async function smsUpgrade(options) {
|
|
|
40054
40215
|
const startTime = Date.now();
|
|
40055
40216
|
let upgradeAction = "";
|
|
40056
40217
|
if (!isJsonMode()) {
|
|
40057
|
-
|
|
40218
|
+
clack57.intro(pc60.bold("Wraps SMS Upgrade - Enhance Your SMS Infrastructure"));
|
|
40058
40219
|
}
|
|
40059
40220
|
const progress = new DeploymentProgress();
|
|
40060
40221
|
const wasAutoInstalled = await progress.execute(
|
|
@@ -40068,7 +40229,7 @@ async function smsUpgrade(options) {
|
|
|
40068
40229
|
"Validating AWS credentials",
|
|
40069
40230
|
async () => validateAWSCredentials()
|
|
40070
40231
|
);
|
|
40071
|
-
progress.info(`Connected to AWS account: ${
|
|
40232
|
+
progress.info(`Connected to AWS account: ${pc60.cyan(identity.accountId)}`);
|
|
40072
40233
|
const region = await resolveRegionForCommand({
|
|
40073
40234
|
accountId: identity.accountId,
|
|
40074
40235
|
optionRegion: options.region,
|
|
@@ -40077,35 +40238,35 @@ async function smsUpgrade(options) {
|
|
|
40077
40238
|
});
|
|
40078
40239
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
40079
40240
|
if (!metadata) {
|
|
40080
|
-
|
|
40081
|
-
`No Wraps connection found for account ${
|
|
40241
|
+
clack57.log.error(
|
|
40242
|
+
`No Wraps connection found for account ${pc60.cyan(identity.accountId)} in region ${pc60.cyan(region)}`
|
|
40082
40243
|
);
|
|
40083
|
-
|
|
40084
|
-
`Use ${
|
|
40244
|
+
clack57.log.info(
|
|
40245
|
+
`Use ${pc60.cyan("wraps sms init")} to create new infrastructure.`
|
|
40085
40246
|
);
|
|
40086
40247
|
process.exit(1);
|
|
40087
40248
|
}
|
|
40088
40249
|
if (!metadata.services.sms) {
|
|
40089
|
-
|
|
40090
|
-
|
|
40091
|
-
`Use ${
|
|
40250
|
+
clack57.log.error("No SMS infrastructure found");
|
|
40251
|
+
clack57.log.info(
|
|
40252
|
+
`Use ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.`
|
|
40092
40253
|
);
|
|
40093
40254
|
process.exit(1);
|
|
40094
40255
|
}
|
|
40095
40256
|
progress.info(`Found existing connection created: ${metadata.timestamp}`);
|
|
40096
40257
|
console.log(`
|
|
40097
|
-
${
|
|
40258
|
+
${pc60.bold("Current Configuration:")}
|
|
40098
40259
|
`);
|
|
40099
40260
|
if (metadata.services.sms.preset) {
|
|
40100
|
-
console.log(` Preset: ${
|
|
40261
|
+
console.log(` Preset: ${pc60.cyan(metadata.services.sms.preset)}`);
|
|
40101
40262
|
} else {
|
|
40102
|
-
console.log(` Preset: ${
|
|
40263
|
+
console.log(` Preset: ${pc60.cyan("custom")}`);
|
|
40103
40264
|
}
|
|
40104
40265
|
const config2 = metadata.services.sms.config;
|
|
40105
40266
|
if (!config2) {
|
|
40106
|
-
|
|
40107
|
-
|
|
40108
|
-
`Use ${
|
|
40267
|
+
clack57.log.error("No SMS configuration found in metadata");
|
|
40268
|
+
clack57.log.info(
|
|
40269
|
+
`Use ${pc60.cyan("wraps sms init")} to create new infrastructure.`
|
|
40109
40270
|
);
|
|
40110
40271
|
process.exit(1);
|
|
40111
40272
|
}
|
|
@@ -40117,45 +40278,45 @@ ${pc59.bold("Current Configuration:")}
|
|
|
40117
40278
|
"short-code": "Short code ($995+/mo, 100+ MPS)"
|
|
40118
40279
|
};
|
|
40119
40280
|
console.log(
|
|
40120
|
-
` Phone Type: ${
|
|
40281
|
+
` Phone Type: ${pc60.cyan(phoneTypeLabels2[config2.phoneNumberType] || config2.phoneNumberType)}`
|
|
40121
40282
|
);
|
|
40122
40283
|
}
|
|
40123
40284
|
if (config2.tracking?.enabled) {
|
|
40124
|
-
console.log(` ${
|
|
40285
|
+
console.log(` ${pc60.green("\u2713")} Delivery Tracking`);
|
|
40125
40286
|
if (config2.tracking.linkTracking) {
|
|
40126
|
-
console.log(` ${
|
|
40287
|
+
console.log(` ${pc60.dim("\u2514\u2500")} Link click tracking enabled`);
|
|
40127
40288
|
}
|
|
40128
40289
|
}
|
|
40129
40290
|
if (config2.eventTracking?.enabled) {
|
|
40130
|
-
console.log(` ${
|
|
40291
|
+
console.log(` ${pc60.green("\u2713")} Event Tracking (SNS)`);
|
|
40131
40292
|
if (config2.eventTracking.dynamoDBHistory) {
|
|
40132
40293
|
console.log(
|
|
40133
|
-
` ${
|
|
40294
|
+
` ${pc60.dim("\u2514\u2500")} Message History: ${pc60.cyan(config2.eventTracking.archiveRetention || "90days")}`
|
|
40134
40295
|
);
|
|
40135
40296
|
}
|
|
40136
40297
|
}
|
|
40137
40298
|
if (config2.messageArchiving?.enabled) {
|
|
40138
40299
|
console.log(
|
|
40139
|
-
` ${
|
|
40300
|
+
` ${pc60.green("\u2713")} Message Archiving (${config2.messageArchiving.retention})`
|
|
40140
40301
|
);
|
|
40141
40302
|
}
|
|
40142
40303
|
if (config2.optOutManagement) {
|
|
40143
|
-
console.log(` ${
|
|
40304
|
+
console.log(` ${pc60.green("\u2713")} Opt-out Management`);
|
|
40144
40305
|
}
|
|
40145
40306
|
if (config2.protectConfiguration?.enabled) {
|
|
40146
40307
|
const countries = config2.protectConfiguration.allowedCountries?.join(", ") || "US";
|
|
40147
|
-
console.log(` ${
|
|
40148
|
-
console.log(` ${
|
|
40308
|
+
console.log(` ${pc60.green("\u2713")} Fraud Protection`);
|
|
40309
|
+
console.log(` ${pc60.dim("\u2514\u2500")} Allowed countries: ${pc60.cyan(countries)}`);
|
|
40149
40310
|
if (config2.protectConfiguration.aitFiltering) {
|
|
40150
|
-
console.log(` ${
|
|
40311
|
+
console.log(` ${pc60.dim("\u2514\u2500")} AIT filtering: ${pc60.cyan("enabled")}`);
|
|
40151
40312
|
}
|
|
40152
40313
|
} else {
|
|
40153
|
-
console.log(` ${
|
|
40314
|
+
console.log(` ${pc60.dim("\u25CB")} Fraud Protection (not configured)`);
|
|
40154
40315
|
}
|
|
40155
40316
|
const currentCostData = calculateSMSCosts(config2, 1e4);
|
|
40156
40317
|
console.log(
|
|
40157
40318
|
`
|
|
40158
|
-
Estimated Cost: ${
|
|
40319
|
+
Estimated Cost: ${pc60.cyan(`~${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
40159
40320
|
);
|
|
40160
40321
|
console.log("");
|
|
40161
40322
|
const phoneTypeLabels = {
|
|
@@ -40164,7 +40325,7 @@ ${pc59.bold("Current Configuration:")}
|
|
|
40164
40325
|
"10dlc": "10DLC",
|
|
40165
40326
|
"short-code": "Short code"
|
|
40166
40327
|
};
|
|
40167
|
-
upgradeAction = await
|
|
40328
|
+
upgradeAction = await clack57.select({
|
|
40168
40329
|
message: "What would you like to do?",
|
|
40169
40330
|
options: [
|
|
40170
40331
|
{
|
|
@@ -40204,8 +40365,8 @@ ${pc59.bold("Current Configuration:")}
|
|
|
40204
40365
|
}
|
|
40205
40366
|
]
|
|
40206
40367
|
});
|
|
40207
|
-
if (
|
|
40208
|
-
|
|
40368
|
+
if (clack57.isCancel(upgradeAction)) {
|
|
40369
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40209
40370
|
process.exit(0);
|
|
40210
40371
|
}
|
|
40211
40372
|
let updatedConfig = { ...config2 };
|
|
@@ -40246,65 +40407,65 @@ ${pc59.bold("Current Configuration:")}
|
|
|
40246
40407
|
hint: p.hint
|
|
40247
40408
|
}));
|
|
40248
40409
|
if (availableTypes.length === 0) {
|
|
40249
|
-
|
|
40410
|
+
clack57.log.warn(
|
|
40250
40411
|
"Already on highest phone number tier. Contact AWS for dedicated short codes."
|
|
40251
40412
|
);
|
|
40252
40413
|
process.exit(0);
|
|
40253
40414
|
}
|
|
40254
|
-
const selectedType = await
|
|
40415
|
+
const selectedType = await clack57.select({
|
|
40255
40416
|
message: "Select new phone number type:",
|
|
40256
40417
|
options: availableTypes
|
|
40257
40418
|
});
|
|
40258
|
-
if (
|
|
40259
|
-
|
|
40419
|
+
if (clack57.isCancel(selectedType)) {
|
|
40420
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40260
40421
|
process.exit(0);
|
|
40261
40422
|
}
|
|
40262
40423
|
if (selectedType === "toll-free") {
|
|
40263
40424
|
console.log(
|
|
40264
40425
|
`
|
|
40265
|
-
${
|
|
40426
|
+
${pc60.yellow("\u26A0")} ${pc60.bold("Toll-free Registration Required")}
|
|
40266
40427
|
`
|
|
40267
40428
|
);
|
|
40268
40429
|
console.log(
|
|
40269
|
-
|
|
40430
|
+
pc60.dim("Toll-free numbers require carrier registration before")
|
|
40270
40431
|
);
|
|
40271
40432
|
console.log(
|
|
40272
|
-
|
|
40433
|
+
pc60.dim("they can send messages at scale. After deployment:\n")
|
|
40273
40434
|
);
|
|
40274
40435
|
console.log(
|
|
40275
|
-
` 1. Run ${
|
|
40436
|
+
` 1. Run ${pc60.cyan("wraps sms register")} to start registration`
|
|
40276
40437
|
);
|
|
40277
40438
|
console.log(" 2. Submit your business use case information");
|
|
40278
40439
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40279
40440
|
console.log(
|
|
40280
|
-
|
|
40441
|
+
pc60.dim("\nUntil verified, sending is limited to low volume.\n")
|
|
40281
40442
|
);
|
|
40282
|
-
const confirmTollFree = await
|
|
40443
|
+
const confirmTollFree = await clack57.confirm({
|
|
40283
40444
|
message: "Continue with toll-free number request?",
|
|
40284
40445
|
initialValue: true
|
|
40285
40446
|
});
|
|
40286
|
-
if (
|
|
40287
|
-
|
|
40447
|
+
if (clack57.isCancel(confirmTollFree) || !confirmTollFree) {
|
|
40448
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40288
40449
|
process.exit(0);
|
|
40289
40450
|
}
|
|
40290
40451
|
}
|
|
40291
40452
|
if (selectedType === "10dlc") {
|
|
40292
40453
|
console.log(
|
|
40293
40454
|
`
|
|
40294
|
-
${
|
|
40455
|
+
${pc60.yellow("\u26A0")} ${pc60.bold("10DLC Campaign Registration Required")}
|
|
40295
40456
|
`
|
|
40296
40457
|
);
|
|
40297
|
-
console.log(
|
|
40458
|
+
console.log(pc60.dim("10DLC requires brand and campaign registration:"));
|
|
40298
40459
|
console.log(" \u2022 Brand registration: one-time $4 fee");
|
|
40299
40460
|
console.log(" \u2022 Campaign registration: $15/mo per campaign");
|
|
40300
40461
|
console.log(" \u2022 Verification takes 1-7 business days");
|
|
40301
40462
|
console.log("");
|
|
40302
|
-
const confirm10DLC = await
|
|
40463
|
+
const confirm10DLC = await clack57.confirm({
|
|
40303
40464
|
message: "Continue with 10DLC number request?",
|
|
40304
40465
|
initialValue: true
|
|
40305
40466
|
});
|
|
40306
|
-
if (
|
|
40307
|
-
|
|
40467
|
+
if (clack57.isCancel(confirm10DLC) || !confirm10DLC) {
|
|
40468
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40308
40469
|
process.exit(0);
|
|
40309
40470
|
}
|
|
40310
40471
|
}
|
|
@@ -40329,15 +40490,15 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40329
40490
|
disabled: currentPresetIdx >= 0 && idx <= currentPresetIdx ? "Current or lower tier" : void 0
|
|
40330
40491
|
})).filter((p) => !p.disabled && p.value !== "custom");
|
|
40331
40492
|
if (availablePresets.length === 0) {
|
|
40332
|
-
|
|
40493
|
+
clack57.log.warn("Already on highest preset (Enterprise)");
|
|
40333
40494
|
process.exit(0);
|
|
40334
40495
|
}
|
|
40335
|
-
const selectedPreset = await
|
|
40496
|
+
const selectedPreset = await clack57.select({
|
|
40336
40497
|
message: "Select new preset:",
|
|
40337
40498
|
options: availablePresets
|
|
40338
40499
|
});
|
|
40339
|
-
if (
|
|
40340
|
-
|
|
40500
|
+
if (clack57.isCancel(selectedPreset)) {
|
|
40501
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40341
40502
|
process.exit(0);
|
|
40342
40503
|
}
|
|
40343
40504
|
const presetConfig = getSMSPreset(selectedPreset);
|
|
@@ -40353,7 +40514,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40353
40514
|
}
|
|
40354
40515
|
case "event-tracking": {
|
|
40355
40516
|
if (config2.eventTracking?.enabled) {
|
|
40356
|
-
const eventAction = await
|
|
40517
|
+
const eventAction = await clack57.select({
|
|
40357
40518
|
message: "What would you like to do with event tracking?",
|
|
40358
40519
|
options: [
|
|
40359
40520
|
{
|
|
@@ -40368,17 +40529,17 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40368
40529
|
}
|
|
40369
40530
|
]
|
|
40370
40531
|
});
|
|
40371
|
-
if (
|
|
40372
|
-
|
|
40532
|
+
if (clack57.isCancel(eventAction)) {
|
|
40533
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40373
40534
|
process.exit(0);
|
|
40374
40535
|
}
|
|
40375
40536
|
if (eventAction === "disable") {
|
|
40376
|
-
const confirmDisable = await
|
|
40537
|
+
const confirmDisable = await clack57.confirm({
|
|
40377
40538
|
message: "Are you sure? Existing history will remain, but new events won't be tracked.",
|
|
40378
40539
|
initialValue: false
|
|
40379
40540
|
});
|
|
40380
|
-
if (
|
|
40381
|
-
|
|
40541
|
+
if (clack57.isCancel(confirmDisable) || !confirmDisable) {
|
|
40542
|
+
clack57.cancel("Event tracking not disabled.");
|
|
40382
40543
|
process.exit(0);
|
|
40383
40544
|
}
|
|
40384
40545
|
updatedConfig = {
|
|
@@ -40388,7 +40549,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40388
40549
|
}
|
|
40389
40550
|
};
|
|
40390
40551
|
} else {
|
|
40391
|
-
const retention = await
|
|
40552
|
+
const retention = await clack57.select({
|
|
40392
40553
|
message: "Message history retention period:",
|
|
40393
40554
|
options: [
|
|
40394
40555
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40415,8 +40576,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40415
40576
|
],
|
|
40416
40577
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40417
40578
|
});
|
|
40418
|
-
if (
|
|
40419
|
-
|
|
40579
|
+
if (clack57.isCancel(retention)) {
|
|
40580
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40420
40581
|
process.exit(0);
|
|
40421
40582
|
}
|
|
40422
40583
|
updatedConfig = {
|
|
@@ -40428,19 +40589,19 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40428
40589
|
};
|
|
40429
40590
|
}
|
|
40430
40591
|
} else {
|
|
40431
|
-
const enableTracking = await
|
|
40592
|
+
const enableTracking = await clack57.confirm({
|
|
40432
40593
|
message: "Enable event tracking? (Track SMS events with history)",
|
|
40433
40594
|
initialValue: true
|
|
40434
40595
|
});
|
|
40435
|
-
if (
|
|
40436
|
-
|
|
40596
|
+
if (clack57.isCancel(enableTracking)) {
|
|
40597
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40437
40598
|
process.exit(0);
|
|
40438
40599
|
}
|
|
40439
40600
|
if (!enableTracking) {
|
|
40440
|
-
|
|
40601
|
+
clack57.log.info("Event tracking not enabled.");
|
|
40441
40602
|
process.exit(0);
|
|
40442
40603
|
}
|
|
40443
|
-
const retention = await
|
|
40604
|
+
const retention = await clack57.select({
|
|
40444
40605
|
message: "Message history retention period:",
|
|
40445
40606
|
options: [
|
|
40446
40607
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40463,8 +40624,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40463
40624
|
],
|
|
40464
40625
|
initialValue: "90days"
|
|
40465
40626
|
});
|
|
40466
|
-
if (
|
|
40467
|
-
|
|
40627
|
+
if (clack57.isCancel(retention)) {
|
|
40628
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40468
40629
|
process.exit(0);
|
|
40469
40630
|
}
|
|
40470
40631
|
updatedConfig = {
|
|
@@ -40483,12 +40644,12 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40483
40644
|
}
|
|
40484
40645
|
case "retention": {
|
|
40485
40646
|
if (!config2.eventTracking?.enabled) {
|
|
40486
|
-
|
|
40647
|
+
clack57.log.error(
|
|
40487
40648
|
"Event tracking is not enabled. Enable it first to change retention."
|
|
40488
40649
|
);
|
|
40489
40650
|
process.exit(1);
|
|
40490
40651
|
}
|
|
40491
|
-
const retention = await
|
|
40652
|
+
const retention = await clack57.select({
|
|
40492
40653
|
message: "Message history retention period (event data in DynamoDB):",
|
|
40493
40654
|
options: [
|
|
40494
40655
|
{ value: "7days", label: "7 days", hint: "Minimal storage cost" },
|
|
@@ -40507,8 +40668,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40507
40668
|
],
|
|
40508
40669
|
initialValue: config2.eventTracking.archiveRetention || "90days"
|
|
40509
40670
|
});
|
|
40510
|
-
if (
|
|
40511
|
-
|
|
40671
|
+
if (clack57.isCancel(retention)) {
|
|
40672
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40512
40673
|
process.exit(0);
|
|
40513
40674
|
}
|
|
40514
40675
|
updatedConfig = {
|
|
@@ -40526,21 +40687,21 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40526
40687
|
case "link-tracking": {
|
|
40527
40688
|
const enableLinkTracking = !config2.tracking?.linkTracking;
|
|
40528
40689
|
if (enableLinkTracking) {
|
|
40529
|
-
|
|
40530
|
-
|
|
40690
|
+
clack57.log.info(
|
|
40691
|
+
pc60.dim(
|
|
40531
40692
|
"Link tracking will track clicks on URLs in your SMS messages."
|
|
40532
40693
|
)
|
|
40533
40694
|
);
|
|
40534
|
-
|
|
40535
|
-
|
|
40695
|
+
clack57.log.info(
|
|
40696
|
+
pc60.dim("URLs will be rewritten to go through a tracking endpoint.")
|
|
40536
40697
|
);
|
|
40537
40698
|
}
|
|
40538
|
-
const confirmed = await
|
|
40699
|
+
const confirmed = await clack57.confirm({
|
|
40539
40700
|
message: enableLinkTracking ? "Enable link click tracking?" : "Disable link click tracking?",
|
|
40540
40701
|
initialValue: enableLinkTracking
|
|
40541
40702
|
});
|
|
40542
|
-
if (
|
|
40543
|
-
|
|
40703
|
+
if (clack57.isCancel(confirmed) || !confirmed) {
|
|
40704
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40544
40705
|
process.exit(0);
|
|
40545
40706
|
}
|
|
40546
40707
|
updatedConfig = {
|
|
@@ -40557,7 +40718,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40557
40718
|
}
|
|
40558
40719
|
case "archiving": {
|
|
40559
40720
|
if (config2.messageArchiving?.enabled) {
|
|
40560
|
-
const archivingAction = await
|
|
40721
|
+
const archivingAction = await clack57.select({
|
|
40561
40722
|
message: "What would you like to do with message archiving?",
|
|
40562
40723
|
options: [
|
|
40563
40724
|
{
|
|
@@ -40572,17 +40733,17 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40572
40733
|
}
|
|
40573
40734
|
]
|
|
40574
40735
|
});
|
|
40575
|
-
if (
|
|
40576
|
-
|
|
40736
|
+
if (clack57.isCancel(archivingAction)) {
|
|
40737
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40577
40738
|
process.exit(0);
|
|
40578
40739
|
}
|
|
40579
40740
|
if (archivingAction === "disable") {
|
|
40580
|
-
const confirmDisable = await
|
|
40741
|
+
const confirmDisable = await clack57.confirm({
|
|
40581
40742
|
message: "Are you sure? Existing archived messages will remain, but new messages won't be archived.",
|
|
40582
40743
|
initialValue: false
|
|
40583
40744
|
});
|
|
40584
|
-
if (
|
|
40585
|
-
|
|
40745
|
+
if (clack57.isCancel(confirmDisable) || !confirmDisable) {
|
|
40746
|
+
clack57.cancel("Archiving not disabled.");
|
|
40586
40747
|
process.exit(0);
|
|
40587
40748
|
}
|
|
40588
40749
|
updatedConfig = {
|
|
@@ -40593,7 +40754,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40593
40754
|
}
|
|
40594
40755
|
};
|
|
40595
40756
|
} else {
|
|
40596
|
-
const retention = await
|
|
40757
|
+
const retention = await clack57.select({
|
|
40597
40758
|
message: "Message archive retention period:",
|
|
40598
40759
|
options: [
|
|
40599
40760
|
{
|
|
@@ -40624,8 +40785,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40624
40785
|
],
|
|
40625
40786
|
initialValue: config2.messageArchiving.retention
|
|
40626
40787
|
});
|
|
40627
|
-
if (
|
|
40628
|
-
|
|
40788
|
+
if (clack57.isCancel(retention)) {
|
|
40789
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40629
40790
|
process.exit(0);
|
|
40630
40791
|
}
|
|
40631
40792
|
updatedConfig = {
|
|
@@ -40637,19 +40798,19 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40637
40798
|
};
|
|
40638
40799
|
}
|
|
40639
40800
|
} else {
|
|
40640
|
-
const enableArchiving = await
|
|
40801
|
+
const enableArchiving = await clack57.confirm({
|
|
40641
40802
|
message: "Enable message archiving? (Store full message content for viewing)",
|
|
40642
40803
|
initialValue: true
|
|
40643
40804
|
});
|
|
40644
|
-
if (
|
|
40645
|
-
|
|
40805
|
+
if (clack57.isCancel(enableArchiving)) {
|
|
40806
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40646
40807
|
process.exit(0);
|
|
40647
40808
|
}
|
|
40648
40809
|
if (!enableArchiving) {
|
|
40649
|
-
|
|
40810
|
+
clack57.log.info("Message archiving not enabled.");
|
|
40650
40811
|
process.exit(0);
|
|
40651
40812
|
}
|
|
40652
|
-
const retention = await
|
|
40813
|
+
const retention = await clack57.select({
|
|
40653
40814
|
message: "Message archive retention period:",
|
|
40654
40815
|
options: [
|
|
40655
40816
|
{ value: "7days", label: "7 days", hint: "~$1-2/mo for 10k msgs" },
|
|
@@ -40676,8 +40837,8 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40676
40837
|
],
|
|
40677
40838
|
initialValue: "90days"
|
|
40678
40839
|
});
|
|
40679
|
-
if (
|
|
40680
|
-
|
|
40840
|
+
if (clack57.isCancel(retention)) {
|
|
40841
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40681
40842
|
process.exit(0);
|
|
40682
40843
|
}
|
|
40683
40844
|
updatedConfig = {
|
|
@@ -40709,7 +40870,7 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40709
40870
|
const currentAllowed = config2.protectConfiguration?.allowedCountries || [
|
|
40710
40871
|
"US"
|
|
40711
40872
|
];
|
|
40712
|
-
const selectedCountries = await
|
|
40873
|
+
const selectedCountries = await clack57.multiselect({
|
|
40713
40874
|
message: "Select countries to allow SMS delivery (all others blocked):",
|
|
40714
40875
|
options: commonCountries.map((c) => ({
|
|
40715
40876
|
value: c.code,
|
|
@@ -40718,16 +40879,16 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40718
40879
|
initialValues: currentAllowed,
|
|
40719
40880
|
required: true
|
|
40720
40881
|
});
|
|
40721
|
-
if (
|
|
40722
|
-
|
|
40882
|
+
if (clack57.isCancel(selectedCountries)) {
|
|
40883
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40723
40884
|
process.exit(0);
|
|
40724
40885
|
}
|
|
40725
|
-
const enableAIT = await
|
|
40886
|
+
const enableAIT = await clack57.confirm({
|
|
40726
40887
|
message: "Enable AIT (Artificially Inflated Traffic) filtering? (adds per-message cost)",
|
|
40727
40888
|
initialValue: config2.protectConfiguration?.aitFiltering ?? false
|
|
40728
40889
|
});
|
|
40729
|
-
if (
|
|
40730
|
-
|
|
40890
|
+
if (clack57.isCancel(enableAIT)) {
|
|
40891
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40731
40892
|
process.exit(0);
|
|
40732
40893
|
}
|
|
40733
40894
|
updatedConfig = {
|
|
@@ -40745,28 +40906,28 @@ ${pc59.yellow("\u26A0")} ${pc59.bold("10DLC Campaign Registration Required")}
|
|
|
40745
40906
|
const newCostData = calculateSMSCosts(updatedConfig, 1e4);
|
|
40746
40907
|
const costDiff = newCostData.total.monthly - currentCostData.total.monthly;
|
|
40747
40908
|
console.log(`
|
|
40748
|
-
${
|
|
40909
|
+
${pc60.bold("Cost Impact:")}`);
|
|
40749
40910
|
console.log(
|
|
40750
|
-
` Current: ${
|
|
40911
|
+
` Current: ${pc60.cyan(`${formatCost3(currentCostData.total.monthly)}/mo`)}`
|
|
40751
40912
|
);
|
|
40752
40913
|
console.log(
|
|
40753
|
-
` New: ${
|
|
40914
|
+
` New: ${pc60.cyan(`${formatCost3(newCostData.total.monthly)}/mo`)}`
|
|
40754
40915
|
);
|
|
40755
40916
|
if (costDiff > 0) {
|
|
40756
|
-
console.log(` Change: ${
|
|
40917
|
+
console.log(` Change: ${pc60.yellow(`+${formatCost3(costDiff)}/mo`)}`);
|
|
40757
40918
|
} else if (costDiff < 0) {
|
|
40758
40919
|
console.log(
|
|
40759
|
-
` Change: ${
|
|
40920
|
+
` Change: ${pc60.green(`-${formatCost3(Math.abs(costDiff))}/mo`)}`
|
|
40760
40921
|
);
|
|
40761
40922
|
}
|
|
40762
40923
|
console.log("");
|
|
40763
40924
|
if (!(options.yes || options.preview)) {
|
|
40764
|
-
const confirmed = await
|
|
40925
|
+
const confirmed = await clack57.confirm({
|
|
40765
40926
|
message: "Proceed with upgrade?",
|
|
40766
40927
|
initialValue: true
|
|
40767
40928
|
});
|
|
40768
|
-
if (
|
|
40769
|
-
|
|
40929
|
+
if (clack57.isCancel(confirmed) || !confirmed) {
|
|
40930
|
+
clack57.cancel("Upgrade cancelled.");
|
|
40770
40931
|
process.exit(0);
|
|
40771
40932
|
}
|
|
40772
40933
|
}
|
|
@@ -40835,8 +40996,8 @@ ${pc59.bold("Cost Impact:")}`);
|
|
|
40835
40996
|
resourceChanges: previewResult.resourceChanges,
|
|
40836
40997
|
commandName: "wraps sms upgrade"
|
|
40837
40998
|
});
|
|
40838
|
-
|
|
40839
|
-
|
|
40999
|
+
clack57.outro(
|
|
41000
|
+
pc60.green("Preview complete. Run without --preview to upgrade.")
|
|
40840
41001
|
);
|
|
40841
41002
|
trackServiceUpgrade("sms", {
|
|
40842
41003
|
region,
|
|
@@ -40941,43 +41102,43 @@ ${pc59.bold("Cost Impact:")}`);
|
|
|
40941
41102
|
}
|
|
40942
41103
|
progress.info("Connection metadata updated");
|
|
40943
41104
|
console.log("\n");
|
|
40944
|
-
|
|
41105
|
+
clack57.log.success(pc60.green(pc60.bold("SMS infrastructure upgraded!")));
|
|
40945
41106
|
console.log("\n");
|
|
40946
|
-
|
|
41107
|
+
clack57.note(
|
|
40947
41108
|
[
|
|
40948
|
-
`${
|
|
40949
|
-
`${
|
|
40950
|
-
`${
|
|
40951
|
-
`${
|
|
40952
|
-
outputs.tableName ? `${
|
|
41109
|
+
`${pc60.bold("Phone Number:")} ${pc60.cyan(outputs.phoneNumber || "Provisioning...")}`,
|
|
41110
|
+
`${pc60.bold("Phone Type:")} ${pc60.cyan(updatedConfig.phoneNumberType || "simulator")}`,
|
|
41111
|
+
`${pc60.bold("Config Set:")} ${pc60.cyan(outputs.configSetName || "wraps-sms-config")}`,
|
|
41112
|
+
`${pc60.bold("Region:")} ${pc60.cyan(outputs.region)}`,
|
|
41113
|
+
outputs.tableName ? `${pc60.bold("History Table:")} ${pc60.cyan(outputs.tableName)}` : "",
|
|
40953
41114
|
"",
|
|
40954
|
-
|
|
40955
|
-
|
|
41115
|
+
pc60.dim("IAM Role:"),
|
|
41116
|
+
pc60.dim(` ${outputs.roleArn}`)
|
|
40956
41117
|
].filter(Boolean).join("\n"),
|
|
40957
41118
|
"SMS Infrastructure"
|
|
40958
41119
|
);
|
|
40959
41120
|
console.log(`
|
|
40960
|
-
${
|
|
41121
|
+
${pc60.green("\u2713")} ${pc60.bold("Upgrade complete!")}
|
|
40961
41122
|
`);
|
|
40962
41123
|
if (upgradeAction === "phone-number") {
|
|
40963
41124
|
console.log(
|
|
40964
|
-
`Upgraded to ${
|
|
41125
|
+
`Upgraded to ${pc60.cyan(updatedConfig.phoneNumberType)} number (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40965
41126
|
`
|
|
40966
41127
|
);
|
|
40967
41128
|
if (updatedConfig.phoneNumberType === "toll-free") {
|
|
40968
|
-
console.log(`${
|
|
41129
|
+
console.log(`${pc60.bold("Next Steps:")}`);
|
|
40969
41130
|
console.log(
|
|
40970
|
-
` 1. Run ${
|
|
41131
|
+
` 1. Run ${pc60.cyan("wraps sms register")} to start toll-free registration`
|
|
40971
41132
|
);
|
|
40972
41133
|
console.log(" 2. Submit your business information and use case");
|
|
40973
41134
|
console.log(" 3. Wait for carrier verification (1-5 business days)");
|
|
40974
41135
|
console.log("");
|
|
40975
41136
|
console.log(
|
|
40976
|
-
|
|
41137
|
+
pc60.dim("Until verified, your number can only send limited messages.")
|
|
40977
41138
|
);
|
|
40978
41139
|
console.log("");
|
|
40979
41140
|
} else if (updatedConfig.phoneNumberType === "10dlc") {
|
|
40980
|
-
console.log(`${
|
|
41141
|
+
console.log(`${pc60.bold("Next Steps:")}`);
|
|
40981
41142
|
console.log(" 1. Register your brand in the AWS Console");
|
|
40982
41143
|
console.log(" 2. Create a 10DLC campaign for your use case");
|
|
40983
41144
|
console.log(" 3. Wait for campaign approval (1-7 business days)");
|
|
@@ -40985,16 +41146,16 @@ ${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
|
|
|
40985
41146
|
}
|
|
40986
41147
|
} else if (upgradeAction === "preset" && newPreset) {
|
|
40987
41148
|
console.log(
|
|
40988
|
-
`Upgraded to ${
|
|
41149
|
+
`Upgraded to ${pc60.cyan(newPreset)} preset (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40989
41150
|
`
|
|
40990
41151
|
);
|
|
40991
41152
|
} else {
|
|
40992
41153
|
console.log(
|
|
40993
|
-
`Updated configuration (${
|
|
41154
|
+
`Updated configuration (${pc60.green(`${formatCost3(newCostData.total.monthly)}/mo`)})
|
|
40994
41155
|
`
|
|
40995
41156
|
);
|
|
40996
41157
|
}
|
|
40997
|
-
console.log(
|
|
41158
|
+
console.log(pc60.dim(getSMSCostSummary(updatedConfig, 1e4)));
|
|
40998
41159
|
const enabledFeatures = [];
|
|
40999
41160
|
if (updatedConfig.tracking?.enabled) {
|
|
41000
41161
|
enabledFeatures.push("tracking");
|
|
@@ -41018,7 +41179,7 @@ ${pc59.green("\u2713")} ${pc59.bold("Upgrade complete!")}
|
|
|
41018
41179
|
action: typeof upgradeAction === "string" ? upgradeAction : void 0,
|
|
41019
41180
|
duration_ms: Date.now() - startTime
|
|
41020
41181
|
});
|
|
41021
|
-
|
|
41182
|
+
clack57.outro(pc60.green("Upgrade complete!"));
|
|
41022
41183
|
}
|
|
41023
41184
|
|
|
41024
41185
|
// src/commands/sms/verify-number.ts
|
|
@@ -41037,13 +41198,13 @@ import {
|
|
|
41037
41198
|
SendDestinationNumberVerificationCodeCommand,
|
|
41038
41199
|
VerifyDestinationNumberCommand
|
|
41039
41200
|
} from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
41040
|
-
import * as
|
|
41041
|
-
import
|
|
41201
|
+
import * as clack58 from "@clack/prompts";
|
|
41202
|
+
import pc61 from "picocolors";
|
|
41042
41203
|
async function smsVerifyNumber(options) {
|
|
41043
41204
|
const startTime = Date.now();
|
|
41044
41205
|
const progress = new DeploymentProgress();
|
|
41045
41206
|
if (!isJsonMode()) {
|
|
41046
|
-
|
|
41207
|
+
clack58.intro(pc61.bold("Wraps SMS - Verify Destination Number"));
|
|
41047
41208
|
}
|
|
41048
41209
|
const identity = await progress.execute(
|
|
41049
41210
|
"Validating AWS credentials",
|
|
@@ -41053,10 +41214,10 @@ async function smsVerifyNumber(options) {
|
|
|
41053
41214
|
const metadata = await loadConnectionMetadata(identity.accountId, region);
|
|
41054
41215
|
if (!metadata?.services?.sms) {
|
|
41055
41216
|
progress.stop();
|
|
41056
|
-
|
|
41217
|
+
clack58.log.error("No SMS infrastructure found");
|
|
41057
41218
|
console.log(
|
|
41058
41219
|
`
|
|
41059
|
-
Run ${
|
|
41220
|
+
Run ${pc61.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
41060
41221
|
`
|
|
41061
41222
|
);
|
|
41062
41223
|
process.exit(1);
|
|
@@ -41070,19 +41231,19 @@ Run ${pc60.cyan("wraps sms init")} to deploy SMS infrastructure.
|
|
|
41070
41231
|
);
|
|
41071
41232
|
progress.stop();
|
|
41072
41233
|
if (!response.VerifiedDestinationNumbers || response.VerifiedDestinationNumbers.length === 0) {
|
|
41073
|
-
|
|
41234
|
+
clack58.log.info("No verified destination numbers found");
|
|
41074
41235
|
console.log(
|
|
41075
41236
|
`
|
|
41076
|
-
Run ${
|
|
41237
|
+
Run ${pc61.cyan("wraps sms verify-number")} to verify a number.
|
|
41077
41238
|
`
|
|
41078
41239
|
);
|
|
41079
41240
|
} else {
|
|
41080
41241
|
console.log("\n");
|
|
41081
|
-
|
|
41242
|
+
clack58.log.info(pc61.bold("Verified Destination Numbers:"));
|
|
41082
41243
|
console.log("");
|
|
41083
41244
|
for (const num of response.VerifiedDestinationNumbers) {
|
|
41084
|
-
const status2 = num.Status === "VERIFIED" ?
|
|
41085
|
-
console.log(` ${
|
|
41245
|
+
const status2 = num.Status === "VERIFIED" ? pc61.green("\u2713 Verified") : pc61.yellow("\u29D6 Pending");
|
|
41246
|
+
console.log(` ${pc61.cyan(num.DestinationPhoneNumber)} - ${status2}`);
|
|
41086
41247
|
}
|
|
41087
41248
|
console.log("");
|
|
41088
41249
|
}
|
|
@@ -41100,7 +41261,7 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41100
41261
|
});
|
|
41101
41262
|
return;
|
|
41102
41263
|
}
|
|
41103
|
-
|
|
41264
|
+
clack58.outro(pc61.green("Done!"));
|
|
41104
41265
|
return;
|
|
41105
41266
|
} catch (error) {
|
|
41106
41267
|
progress.stop();
|
|
@@ -41108,7 +41269,7 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41108
41269
|
trackError("SMS_LIST_VERIFIED_FAILED", "sms:verify-number:list", {
|
|
41109
41270
|
error: errorMessage
|
|
41110
41271
|
});
|
|
41111
|
-
|
|
41272
|
+
clack58.log.error(`Failed to list verified numbers: ${errorMessage}`);
|
|
41112
41273
|
process.exit(1);
|
|
41113
41274
|
}
|
|
41114
41275
|
}
|
|
@@ -41116,10 +41277,10 @@ Run ${pc60.cyan("wraps sms verify-number")} to verify a number.
|
|
|
41116
41277
|
const phoneNumber2 = options.phoneNumber;
|
|
41117
41278
|
if (!phoneNumber2) {
|
|
41118
41279
|
progress.stop();
|
|
41119
|
-
|
|
41280
|
+
clack58.log.error("Phone number is required for deletion");
|
|
41120
41281
|
console.log(
|
|
41121
41282
|
`
|
|
41122
|
-
Usage: ${
|
|
41283
|
+
Usage: ${pc61.cyan("wraps sms verify-number --delete --phone-number +14155551234")}
|
|
41123
41284
|
`
|
|
41124
41285
|
);
|
|
41125
41286
|
process.exit(1);
|
|
@@ -41133,7 +41294,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41133
41294
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41134
41295
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41135
41296
|
progress.stop();
|
|
41136
|
-
|
|
41297
|
+
clack58.log.error(`Number ${phoneNumber2} is not in verified list`);
|
|
41137
41298
|
process.exit(1);
|
|
41138
41299
|
}
|
|
41139
41300
|
await progress.execute(`Removing ${phoneNumber2}`, async () => {
|
|
@@ -41144,7 +41305,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41144
41305
|
);
|
|
41145
41306
|
});
|
|
41146
41307
|
progress.stop();
|
|
41147
|
-
|
|
41308
|
+
clack58.log.success(`Removed ${pc61.cyan(phoneNumber2)} from verified list`);
|
|
41148
41309
|
trackCommand("sms:verify-number:delete", {
|
|
41149
41310
|
success: true,
|
|
41150
41311
|
duration_ms: Date.now() - startTime
|
|
@@ -41156,7 +41317,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41156
41317
|
});
|
|
41157
41318
|
return;
|
|
41158
41319
|
}
|
|
41159
|
-
|
|
41320
|
+
clack58.outro(pc61.green("Done!"));
|
|
41160
41321
|
return;
|
|
41161
41322
|
} catch (error) {
|
|
41162
41323
|
progress.stop();
|
|
@@ -41164,7 +41325,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41164
41325
|
trackError("SMS_DELETE_VERIFIED_FAILED", "sms:verify-number:delete", {
|
|
41165
41326
|
error: errorMessage
|
|
41166
41327
|
});
|
|
41167
|
-
|
|
41328
|
+
clack58.log.error(`Failed to delete verified number: ${errorMessage}`);
|
|
41168
41329
|
process.exit(1);
|
|
41169
41330
|
}
|
|
41170
41331
|
}
|
|
@@ -41177,7 +41338,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41177
41338
|
);
|
|
41178
41339
|
}
|
|
41179
41340
|
if (!phoneNumber) {
|
|
41180
|
-
const result = await
|
|
41341
|
+
const result = await clack58.text({
|
|
41181
41342
|
message: "Enter phone number to verify (E.164 format):",
|
|
41182
41343
|
placeholder: "+14155551234",
|
|
41183
41344
|
validate: (value) => {
|
|
@@ -41190,14 +41351,14 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41190
41351
|
return;
|
|
41191
41352
|
}
|
|
41192
41353
|
});
|
|
41193
|
-
if (
|
|
41194
|
-
|
|
41354
|
+
if (clack58.isCancel(result)) {
|
|
41355
|
+
clack58.cancel("Operation cancelled.");
|
|
41195
41356
|
process.exit(0);
|
|
41196
41357
|
}
|
|
41197
41358
|
phoneNumber = result;
|
|
41198
41359
|
} else if (!isValidPhoneNumber(phoneNumber)) {
|
|
41199
41360
|
progress.stop();
|
|
41200
|
-
|
|
41361
|
+
clack58.log.error(
|
|
41201
41362
|
`Invalid phone number format: ${phoneNumber}. Use E.164 format (e.g., +14155551234)`
|
|
41202
41363
|
);
|
|
41203
41364
|
process.exit(1);
|
|
@@ -41212,7 +41373,7 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41212
41373
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41213
41374
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41214
41375
|
progress.stop();
|
|
41215
|
-
|
|
41376
|
+
clack58.log.error(
|
|
41216
41377
|
`Number ${phoneNumber} not found. Run without --code first.`
|
|
41217
41378
|
);
|
|
41218
41379
|
process.exit(1);
|
|
@@ -41227,12 +41388,12 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41227
41388
|
});
|
|
41228
41389
|
progress.stop();
|
|
41229
41390
|
console.log("\n");
|
|
41230
|
-
|
|
41231
|
-
|
|
41391
|
+
clack58.log.success(
|
|
41392
|
+
pc61.green(`Phone number ${pc61.cyan(phoneNumber)} verified!`)
|
|
41232
41393
|
);
|
|
41233
41394
|
console.log("");
|
|
41234
41395
|
console.log(
|
|
41235
|
-
`You can now send test messages to this number with ${
|
|
41396
|
+
`You can now send test messages to this number with ${pc61.cyan("wraps sms test")}`
|
|
41236
41397
|
);
|
|
41237
41398
|
trackCommand("sms:verify-number:confirm", {
|
|
41238
41399
|
success: true,
|
|
@@ -41245,23 +41406,23 @@ Usage: ${pc60.cyan("wraps sms verify-number --delete --phone-number +14155551234
|
|
|
41245
41406
|
});
|
|
41246
41407
|
return;
|
|
41247
41408
|
}
|
|
41248
|
-
|
|
41409
|
+
clack58.outro(pc61.green("Verification complete!"));
|
|
41249
41410
|
return;
|
|
41250
41411
|
} catch (error) {
|
|
41251
41412
|
progress.stop();
|
|
41252
41413
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41253
41414
|
if (errorMessage.includes("Invalid verification code")) {
|
|
41254
|
-
|
|
41415
|
+
clack58.log.error("Invalid verification code. Please try again.");
|
|
41255
41416
|
console.log(
|
|
41256
41417
|
`
|
|
41257
|
-
Run ${
|
|
41418
|
+
Run ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41258
41419
|
`
|
|
41259
41420
|
);
|
|
41260
41421
|
} else {
|
|
41261
41422
|
trackError("SMS_VERIFY_CODE_FAILED", "sms:verify-number:confirm", {
|
|
41262
41423
|
error: errorMessage
|
|
41263
41424
|
});
|
|
41264
|
-
|
|
41425
|
+
clack58.log.error(`Verification failed: ${errorMessage}`);
|
|
41265
41426
|
}
|
|
41266
41427
|
process.exit(1);
|
|
41267
41428
|
}
|
|
@@ -41276,7 +41437,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41276
41437
|
const verifiedNumber = listResponse.VerifiedDestinationNumbers?.[0];
|
|
41277
41438
|
if (!verifiedNumber?.VerifiedDestinationNumberId) {
|
|
41278
41439
|
progress.stop();
|
|
41279
|
-
|
|
41440
|
+
clack58.log.error(
|
|
41280
41441
|
`Number ${phoneNumber} not found. Run without --resend first.`
|
|
41281
41442
|
);
|
|
41282
41443
|
process.exit(1);
|
|
@@ -41290,11 +41451,11 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41290
41451
|
);
|
|
41291
41452
|
});
|
|
41292
41453
|
progress.stop();
|
|
41293
|
-
|
|
41454
|
+
clack58.log.success(`Verification code resent to ${pc61.cyan(phoneNumber)}`);
|
|
41294
41455
|
console.log("");
|
|
41295
41456
|
console.log(
|
|
41296
41457
|
`Once you receive the code, run:
|
|
41297
|
-
${
|
|
41458
|
+
${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41298
41459
|
);
|
|
41299
41460
|
trackCommand("sms:verify-number:resend", {
|
|
41300
41461
|
success: true,
|
|
@@ -41307,7 +41468,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41307
41468
|
});
|
|
41308
41469
|
return;
|
|
41309
41470
|
}
|
|
41310
|
-
|
|
41471
|
+
clack58.outro(pc61.green("Code sent!"));
|
|
41311
41472
|
return;
|
|
41312
41473
|
} catch (error) {
|
|
41313
41474
|
progress.stop();
|
|
@@ -41315,7 +41476,7 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41315
41476
|
trackError("SMS_RESEND_CODE_FAILED", "sms:verify-number:resend", {
|
|
41316
41477
|
error: errorMessage
|
|
41317
41478
|
});
|
|
41318
|
-
|
|
41479
|
+
clack58.log.error(`Failed to resend code: ${errorMessage}`);
|
|
41319
41480
|
process.exit(1);
|
|
41320
41481
|
}
|
|
41321
41482
|
}
|
|
@@ -41335,10 +41496,10 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41335
41496
|
});
|
|
41336
41497
|
return;
|
|
41337
41498
|
}
|
|
41338
|
-
|
|
41339
|
-
`Number ${
|
|
41499
|
+
clack58.log.info(
|
|
41500
|
+
`Number ${pc61.cyan(phoneNumber)} is already verified and ready to use!`
|
|
41340
41501
|
);
|
|
41341
|
-
|
|
41502
|
+
clack58.outro(pc61.green("Done!"));
|
|
41342
41503
|
return;
|
|
41343
41504
|
}
|
|
41344
41505
|
if (existingNumber?.Status === "PENDING") {
|
|
@@ -41362,15 +41523,15 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41362
41523
|
});
|
|
41363
41524
|
return;
|
|
41364
41525
|
}
|
|
41365
|
-
|
|
41366
|
-
`Verification already in progress. New code sent to ${
|
|
41526
|
+
clack58.log.info(
|
|
41527
|
+
`Verification already in progress. New code sent to ${pc61.cyan(phoneNumber)}`
|
|
41367
41528
|
);
|
|
41368
41529
|
console.log("");
|
|
41369
41530
|
console.log(
|
|
41370
41531
|
`Once you receive the code, run:
|
|
41371
|
-
${
|
|
41532
|
+
${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`
|
|
41372
41533
|
);
|
|
41373
|
-
|
|
41534
|
+
clack58.outro(pc61.green("Code sent!"));
|
|
41374
41535
|
return;
|
|
41375
41536
|
}
|
|
41376
41537
|
const createResponse = await progress.execute(
|
|
@@ -41391,18 +41552,18 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41391
41552
|
});
|
|
41392
41553
|
progress.stop();
|
|
41393
41554
|
console.log("\n");
|
|
41394
|
-
|
|
41395
|
-
`Verification code sent to ${
|
|
41555
|
+
clack58.log.success(
|
|
41556
|
+
`Verification code sent to ${pc61.cyan(phoneNumber)} via SMS`
|
|
41396
41557
|
);
|
|
41397
41558
|
console.log("");
|
|
41398
|
-
|
|
41559
|
+
clack58.note(
|
|
41399
41560
|
[
|
|
41400
41561
|
"1. Check your phone for the verification code",
|
|
41401
41562
|
"",
|
|
41402
41563
|
"2. Complete verification with:",
|
|
41403
|
-
` ${
|
|
41564
|
+
` ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --code YOUR_CODE`)}`,
|
|
41404
41565
|
"",
|
|
41405
|
-
|
|
41566
|
+
pc61.dim("The code expires in 24 hours")
|
|
41406
41567
|
].join("\n"),
|
|
41407
41568
|
"Next Steps"
|
|
41408
41569
|
);
|
|
@@ -41418,22 +41579,22 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41418
41579
|
});
|
|
41419
41580
|
return;
|
|
41420
41581
|
}
|
|
41421
|
-
|
|
41582
|
+
clack58.outro(pc61.green("Verification started!"));
|
|
41422
41583
|
} catch (error) {
|
|
41423
41584
|
progress.stop();
|
|
41424
41585
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41425
41586
|
if (errorMessage.includes("already exists")) {
|
|
41426
|
-
|
|
41587
|
+
clack58.log.error("This number is already being verified");
|
|
41427
41588
|
console.log(
|
|
41428
41589
|
`
|
|
41429
|
-
Run ${
|
|
41590
|
+
Run ${pc61.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`)} to get a new code.
|
|
41430
41591
|
`
|
|
41431
41592
|
);
|
|
41432
41593
|
} else {
|
|
41433
41594
|
trackError("SMS_CREATE_VERIFIED_FAILED", "sms:verify-number:start", {
|
|
41434
41595
|
error: errorMessage
|
|
41435
41596
|
});
|
|
41436
|
-
|
|
41597
|
+
clack58.log.error(`Failed to start verification: ${errorMessage}`);
|
|
41437
41598
|
}
|
|
41438
41599
|
process.exit(1);
|
|
41439
41600
|
}
|
|
@@ -41442,88 +41603,88 @@ Run ${pc60.cyan(`wraps sms verify-number --phone-number ${phoneNumber} --resend`
|
|
|
41442
41603
|
// src/commands/support.ts
|
|
41443
41604
|
init_esm_shims();
|
|
41444
41605
|
init_events();
|
|
41445
|
-
import * as
|
|
41446
|
-
import
|
|
41606
|
+
import * as clack59 from "@clack/prompts";
|
|
41607
|
+
import pc62 from "picocolors";
|
|
41447
41608
|
async function support() {
|
|
41448
41609
|
trackCommand("support", { success: true });
|
|
41449
|
-
|
|
41610
|
+
clack59.intro(pc62.bold("Get Help with Wraps"));
|
|
41450
41611
|
console.log();
|
|
41451
|
-
console.log(` ${
|
|
41612
|
+
console.log(` ${pc62.bold("Email:")} ${pc62.cyan("hey@wraps.sh")}`);
|
|
41452
41613
|
console.log(
|
|
41453
|
-
` ${
|
|
41614
|
+
` ${pc62.bold("GitHub:")} ${pc62.cyan("https://github.com/wraps-dev/wraps/issues")}`
|
|
41454
41615
|
);
|
|
41455
|
-
console.log(` ${
|
|
41616
|
+
console.log(` ${pc62.bold("Docs:")} ${pc62.cyan("https://wraps.dev/docs")}`);
|
|
41456
41617
|
console.log();
|
|
41457
|
-
console.log(
|
|
41618
|
+
console.log(pc62.dim(" Response time: Usually within 24 hours"));
|
|
41458
41619
|
console.log();
|
|
41459
41620
|
}
|
|
41460
41621
|
|
|
41461
41622
|
// src/commands/telemetry.ts
|
|
41462
41623
|
init_esm_shims();
|
|
41463
41624
|
init_client();
|
|
41464
|
-
import * as
|
|
41465
|
-
import
|
|
41625
|
+
import * as clack60 from "@clack/prompts";
|
|
41626
|
+
import pc63 from "picocolors";
|
|
41466
41627
|
async function telemetryEnable() {
|
|
41467
41628
|
const client = getTelemetryClient();
|
|
41468
41629
|
const override = client.enable();
|
|
41469
41630
|
if (override) {
|
|
41470
|
-
|
|
41631
|
+
clack60.log.warn(
|
|
41471
41632
|
"Telemetry enabled in config, but overridden by environment"
|
|
41472
41633
|
);
|
|
41473
|
-
console.log(` Reason: ${
|
|
41474
|
-
console.log(` Config: ${
|
|
41634
|
+
console.log(` Reason: ${pc63.yellow(override)}`);
|
|
41635
|
+
console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
|
|
41475
41636
|
console.log();
|
|
41476
41637
|
} else {
|
|
41477
|
-
|
|
41478
|
-
console.log(` Config: ${
|
|
41638
|
+
clack60.log.success(pc63.green("Telemetry enabled"));
|
|
41639
|
+
console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
|
|
41479
41640
|
console.log(`
|
|
41480
|
-
${
|
|
41641
|
+
${pc63.dim("Thank you for helping improve Wraps!")}
|
|
41481
41642
|
`);
|
|
41482
41643
|
}
|
|
41483
41644
|
}
|
|
41484
41645
|
async function telemetryDisable() {
|
|
41485
41646
|
const client = getTelemetryClient();
|
|
41486
41647
|
client.disable();
|
|
41487
|
-
|
|
41488
|
-
console.log(` Config: ${
|
|
41648
|
+
clack60.log.success(pc63.green("Telemetry disabled"));
|
|
41649
|
+
console.log(` Config: ${pc63.dim(client.getConfigPath())}`);
|
|
41489
41650
|
console.log(
|
|
41490
41651
|
`
|
|
41491
|
-
${
|
|
41652
|
+
${pc63.dim("You can re-enable with:")} wraps telemetry enable
|
|
41492
41653
|
`
|
|
41493
41654
|
);
|
|
41494
41655
|
}
|
|
41495
41656
|
async function telemetryStatus() {
|
|
41496
41657
|
const client = getTelemetryClient();
|
|
41497
|
-
|
|
41658
|
+
clack60.intro(pc63.bold("Telemetry Status"));
|
|
41498
41659
|
const override = client.getEnvOverride();
|
|
41499
|
-
const status2 = client.isEnabled() ?
|
|
41660
|
+
const status2 = client.isEnabled() ? pc63.green("Enabled") : pc63.red("Disabled");
|
|
41500
41661
|
console.log();
|
|
41501
|
-
console.log(` ${
|
|
41662
|
+
console.log(` ${pc63.bold("Status:")} ${status2}`);
|
|
41502
41663
|
if (!client.isEnabled() && override) {
|
|
41503
|
-
console.log(` ${
|
|
41664
|
+
console.log(` ${pc63.bold("Reason:")} ${pc63.yellow(override)}`);
|
|
41504
41665
|
}
|
|
41505
|
-
console.log(` ${
|
|
41666
|
+
console.log(` ${pc63.bold("Config file:")} ${pc63.dim(client.getConfigPath())}`);
|
|
41506
41667
|
if (client.isEnabled()) {
|
|
41507
41668
|
console.log();
|
|
41508
|
-
console.log(
|
|
41509
|
-
console.log(` ${
|
|
41669
|
+
console.log(pc63.bold(" How to opt-out:"));
|
|
41670
|
+
console.log(` ${pc63.cyan("wraps telemetry disable")}`);
|
|
41510
41671
|
console.log(
|
|
41511
|
-
` ${
|
|
41672
|
+
` ${pc63.dim("Or set:")} ${pc63.cyan("WRAPS_TELEMETRY_DISABLED=1")}`
|
|
41512
41673
|
);
|
|
41513
|
-
console.log(` ${
|
|
41674
|
+
console.log(` ${pc63.dim("Or set:")} ${pc63.cyan("DO_NOT_TRACK=1")}`);
|
|
41514
41675
|
} else {
|
|
41515
41676
|
console.log();
|
|
41516
|
-
console.log(
|
|
41517
|
-
console.log(` ${
|
|
41677
|
+
console.log(pc63.bold(" How to opt-in:"));
|
|
41678
|
+
console.log(` ${pc63.cyan("wraps telemetry enable")}`);
|
|
41518
41679
|
}
|
|
41519
41680
|
console.log();
|
|
41520
|
-
console.log(
|
|
41681
|
+
console.log(pc63.bold(" Debug mode:"));
|
|
41521
41682
|
console.log(
|
|
41522
|
-
` ${
|
|
41683
|
+
` ${pc63.dim("See what would be sent:")} ${pc63.cyan("WRAPS_TELEMETRY_DEBUG=1 wraps <command>")}`
|
|
41523
41684
|
);
|
|
41524
41685
|
console.log();
|
|
41525
41686
|
console.log(
|
|
41526
|
-
` ${
|
|
41687
|
+
` ${pc63.dim("Learn more:")} ${pc63.cyan("https://wraps.dev/docs/telemetry")}`
|
|
41527
41688
|
);
|
|
41528
41689
|
console.log();
|
|
41529
41690
|
}
|
|
@@ -41532,8 +41693,8 @@ async function telemetryStatus() {
|
|
|
41532
41693
|
init_esm_shims();
|
|
41533
41694
|
import { existsSync as existsSync20, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
41534
41695
|
import { join as join22 } from "path";
|
|
41535
|
-
import * as
|
|
41536
|
-
import
|
|
41696
|
+
import * as clack61 from "@clack/prompts";
|
|
41697
|
+
import pc64 from "picocolors";
|
|
41537
41698
|
var EXAMPLE_CASCADE_WORKFLOW = `import {
|
|
41538
41699
|
defineWorkflow,
|
|
41539
41700
|
sendEmail,
|
|
@@ -41628,30 +41789,30 @@ export default defineConfig({
|
|
|
41628
41789
|
});
|
|
41629
41790
|
`;
|
|
41630
41791
|
async function workflowInit(options = {}) {
|
|
41631
|
-
|
|
41792
|
+
clack61.intro(pc64.bgCyan(pc64.black(" wraps workflow init ")));
|
|
41632
41793
|
const wrapsDir = join22(process.cwd(), "wraps");
|
|
41633
41794
|
const workflowsDir = join22(wrapsDir, "workflows");
|
|
41634
41795
|
const configPath = join22(wrapsDir, "wraps.config.ts");
|
|
41635
41796
|
if (existsSync20(workflowsDir)) {
|
|
41636
|
-
|
|
41637
|
-
`Workflows directory already exists at ${
|
|
41797
|
+
clack61.log.info(
|
|
41798
|
+
`Workflows directory already exists at ${pc64.cyan("wraps/workflows/")}`
|
|
41638
41799
|
);
|
|
41639
41800
|
const files = existsSync20(join22(workflowsDir, "cart-recovery.ts")) || existsSync20(join22(workflowsDir, "welcome-sequence.ts"));
|
|
41640
41801
|
if (files && !options.yes) {
|
|
41641
|
-
const shouldContinue = await
|
|
41802
|
+
const shouldContinue = await clack61.confirm({
|
|
41642
41803
|
message: "Example files may already exist. Overwrite them?",
|
|
41643
41804
|
initialValue: false
|
|
41644
41805
|
});
|
|
41645
|
-
if (
|
|
41646
|
-
|
|
41806
|
+
if (clack61.isCancel(shouldContinue) || !shouldContinue) {
|
|
41807
|
+
clack61.log.info("Skipping file creation.");
|
|
41647
41808
|
showNextSteps2();
|
|
41648
|
-
|
|
41809
|
+
clack61.outro("Done!");
|
|
41649
41810
|
return;
|
|
41650
41811
|
}
|
|
41651
41812
|
}
|
|
41652
41813
|
}
|
|
41653
41814
|
try {
|
|
41654
|
-
const s =
|
|
41815
|
+
const s = clack61.spinner();
|
|
41655
41816
|
s.start("Creating workflows directory...");
|
|
41656
41817
|
mkdirSync2(workflowsDir, { recursive: true });
|
|
41657
41818
|
s.stop("Created wraps/workflows/");
|
|
@@ -41669,34 +41830,34 @@ async function workflowInit(options = {}) {
|
|
|
41669
41830
|
s.stop("Created 2 example workflows");
|
|
41670
41831
|
if (!existsSync20(configPath)) {
|
|
41671
41832
|
writeFileSync(configPath, EXAMPLE_CONFIG, "utf-8");
|
|
41672
|
-
|
|
41833
|
+
clack61.log.info(`Created ${pc64.cyan("wraps/wraps.config.ts")}`);
|
|
41673
41834
|
}
|
|
41674
|
-
|
|
41675
|
-
`${
|
|
41676
|
-
${
|
|
41677
|
-
${
|
|
41678
|
-
${
|
|
41835
|
+
clack61.log.success(
|
|
41836
|
+
`${pc64.bold("Workflows scaffolded!")} Created:
|
|
41837
|
+
${pc64.cyan("wraps/wraps.config.ts")} \u2014 Project config
|
|
41838
|
+
${pc64.cyan("wraps/workflows/cart-recovery.ts")} \u2014 Cross-channel cascade example
|
|
41839
|
+
${pc64.cyan("wraps/workflows/welcome-sequence.ts")} \u2014 Welcome series example`
|
|
41679
41840
|
);
|
|
41680
41841
|
showNextSteps2();
|
|
41681
|
-
|
|
41842
|
+
clack61.outro(pc64.green("Happy orchestrating!"));
|
|
41682
41843
|
} catch (error) {
|
|
41683
|
-
|
|
41844
|
+
clack61.log.error(
|
|
41684
41845
|
`Failed to scaffold workflows: ${error instanceof Error ? error.message : String(error)}`
|
|
41685
41846
|
);
|
|
41686
|
-
|
|
41847
|
+
clack61.outro(pc64.red("Scaffolding failed."));
|
|
41687
41848
|
process.exitCode = 1;
|
|
41688
41849
|
}
|
|
41689
41850
|
}
|
|
41690
41851
|
function showNextSteps2() {
|
|
41691
|
-
|
|
41692
|
-
`${
|
|
41852
|
+
clack61.log.info(
|
|
41853
|
+
`${pc64.bold("Next steps:")}
|
|
41693
41854
|
|
|
41694
|
-
1. Edit ${
|
|
41695
|
-
2. Edit your workflows in ${
|
|
41696
|
-
3. Validate: ${
|
|
41697
|
-
4. Push: ${
|
|
41855
|
+
1. Edit ${pc64.cyan("wraps/wraps.config.ts")} with your org slug and domain
|
|
41856
|
+
2. Edit your workflows in ${pc64.cyan("wraps/workflows/")}
|
|
41857
|
+
3. Validate: ${pc64.cyan("wraps email workflows validate")}
|
|
41858
|
+
4. Push: ${pc64.cyan("wraps email workflows push")}
|
|
41698
41859
|
|
|
41699
|
-
${
|
|
41860
|
+
${pc64.dim("Docs:")} ${pc64.underline("https://wraps.dev/docs/guides/orchestration")}`
|
|
41700
41861
|
);
|
|
41701
41862
|
}
|
|
41702
41863
|
|
|
@@ -41891,208 +42052,211 @@ function showVersion() {
|
|
|
41891
42052
|
process.exit(0);
|
|
41892
42053
|
}
|
|
41893
42054
|
function showHelp() {
|
|
41894
|
-
|
|
42055
|
+
clack62.intro(pc66.bold(`WRAPS CLI v${VERSION}`));
|
|
41895
42056
|
console.log("Deploy AWS infrastructure to your account\n");
|
|
41896
42057
|
console.log("Usage: wraps [service] <command> [options]\n");
|
|
41897
42058
|
console.log("Services:");
|
|
41898
|
-
console.log(` ${
|
|
42059
|
+
console.log(` ${pc66.cyan("email")} Email infrastructure (AWS SES)`);
|
|
41899
42060
|
console.log(
|
|
41900
|
-
` ${
|
|
42061
|
+
` ${pc66.cyan("sms")} SMS infrastructure (AWS End User Messaging)`
|
|
41901
42062
|
);
|
|
41902
42063
|
console.log(
|
|
41903
|
-
` ${
|
|
42064
|
+
` ${pc66.cyan("cdn")} CDN infrastructure (AWS S3 + CloudFront)`
|
|
41904
42065
|
);
|
|
41905
42066
|
console.log(
|
|
41906
|
-
` ${
|
|
42067
|
+
` ${pc66.cyan("selfhost")} Self-hosted Wraps control plane (enterprise)`
|
|
41907
42068
|
);
|
|
41908
42069
|
console.log(
|
|
41909
|
-
` ${
|
|
42070
|
+
` ${pc66.cyan("license")} License key management (Wraps team only)
|
|
41910
42071
|
`
|
|
41911
42072
|
);
|
|
41912
42073
|
console.log("Email Commands:");
|
|
41913
42074
|
console.log(
|
|
41914
|
-
` ${
|
|
42075
|
+
` ${pc66.cyan("email init")} Deploy new email infrastructure`
|
|
41915
42076
|
);
|
|
41916
42077
|
console.log(
|
|
41917
|
-
` ${
|
|
42078
|
+
` ${pc66.cyan("email check")} Check email deliverability for a domain`
|
|
41918
42079
|
);
|
|
41919
42080
|
console.log(
|
|
41920
|
-
` ${
|
|
42081
|
+
` ${pc66.cyan("email connect")} Connect to existing AWS SES`
|
|
41921
42082
|
);
|
|
41922
42083
|
console.log(
|
|
41923
|
-
` ${
|
|
42084
|
+
` ${pc66.cyan("email status")} Show email infrastructure details`
|
|
41924
42085
|
);
|
|
41925
|
-
console.log(` ${
|
|
41926
|
-
console.log(` ${
|
|
42086
|
+
console.log(` ${pc66.cyan("email test")} Send a test email`);
|
|
42087
|
+
console.log(` ${pc66.cyan("email verify")} Verify domain DNS records`);
|
|
41927
42088
|
console.log(
|
|
41928
|
-
` ${
|
|
42089
|
+
` ${pc66.cyan("email sync")} Apply CLI updates to infrastructure`
|
|
41929
42090
|
);
|
|
41930
|
-
console.log(` ${
|
|
42091
|
+
console.log(` ${pc66.cyan("email upgrade")} Add features`);
|
|
41931
42092
|
console.log(
|
|
41932
|
-
` ${
|
|
42093
|
+
` ${pc66.cyan("email restore")} Restore original configuration`
|
|
41933
42094
|
);
|
|
41934
42095
|
console.log(
|
|
41935
|
-
` ${
|
|
42096
|
+
` ${pc66.cyan("email destroy")} Remove email infrastructure`
|
|
41936
42097
|
);
|
|
41937
42098
|
console.log(
|
|
41938
|
-
` ${
|
|
42099
|
+
` ${pc66.cyan("email doctor")} Diagnose and clean up email infrastructure`
|
|
41939
42100
|
);
|
|
41940
|
-
console.log(` ${
|
|
41941
|
-
console.log(` ${
|
|
41942
|
-
console.log(` ${
|
|
42101
|
+
console.log(` ${pc66.cyan("email domains add")} Add a domain to SES`);
|
|
42102
|
+
console.log(` ${pc66.cyan("email domains list")} List all domains`);
|
|
42103
|
+
console.log(` ${pc66.cyan("email domains remove")} Remove a domain`);
|
|
41943
42104
|
console.log(
|
|
41944
|
-
` ${
|
|
42105
|
+
` ${pc66.cyan("email inbound init")} Enable inbound email receiving`
|
|
41945
42106
|
);
|
|
41946
|
-
console.log(` ${
|
|
42107
|
+
console.log(` ${pc66.cyan("email inbound status")} Show inbound email status`);
|
|
41947
42108
|
console.log(
|
|
41948
|
-
` ${
|
|
42109
|
+
` ${pc66.cyan("email inbound verify")} Verify inbound DNS records`
|
|
41949
42110
|
);
|
|
41950
42111
|
console.log(
|
|
41951
|
-
` ${
|
|
42112
|
+
` ${pc66.cyan("email inbound test")} Send test email and verify receipt`
|
|
41952
42113
|
);
|
|
41953
42114
|
console.log(
|
|
41954
|
-
` ${
|
|
42115
|
+
` ${pc66.cyan("email inbound destroy")} Remove inbound email infrastructure
|
|
41955
42116
|
`
|
|
41956
42117
|
);
|
|
41957
42118
|
console.log("Template Commands:");
|
|
41958
42119
|
console.log(
|
|
41959
|
-
` ${
|
|
42120
|
+
` ${pc66.cyan("email templates init")} Initialize templates-as-code`
|
|
41960
42121
|
);
|
|
41961
42122
|
console.log(
|
|
41962
|
-
` ${
|
|
42123
|
+
` ${pc66.cyan("email templates push")} Push templates to SES + dashboard`
|
|
41963
42124
|
);
|
|
41964
42125
|
console.log(
|
|
41965
|
-
` ${
|
|
42126
|
+
` ${pc66.cyan("email templates preview")} Preview templates in browser`
|
|
41966
42127
|
);
|
|
41967
42128
|
console.log(
|
|
41968
|
-
` ${
|
|
42129
|
+
` ${pc66.cyan("push")} ${pc66.dim("(alias for email templates push)")}
|
|
41969
42130
|
`
|
|
41970
42131
|
);
|
|
41971
42132
|
console.log("Workflow Commands:");
|
|
41972
42133
|
console.log(
|
|
41973
|
-
` ${
|
|
42134
|
+
` ${pc66.cyan("email workflows init")} Initialize workflows-as-code`
|
|
41974
42135
|
);
|
|
41975
42136
|
console.log(
|
|
41976
|
-
` ${
|
|
42137
|
+
` ${pc66.cyan("email workflows validate")} Validate workflow files`
|
|
41977
42138
|
);
|
|
41978
42139
|
console.log(
|
|
41979
|
-
` ${
|
|
42140
|
+
` ${pc66.cyan("email workflows push")} Push workflows to dashboard
|
|
41980
42141
|
`
|
|
41981
42142
|
);
|
|
41982
42143
|
console.log("SMS Commands:");
|
|
41983
|
-
console.log(` ${
|
|
42144
|
+
console.log(` ${pc66.cyan("sms init")} Deploy SMS infrastructure`);
|
|
41984
42145
|
console.log(
|
|
41985
|
-
` ${
|
|
42146
|
+
` ${pc66.cyan("sms status")} Show SMS infrastructure details`
|
|
41986
42147
|
);
|
|
41987
|
-
console.log(` ${
|
|
42148
|
+
console.log(` ${pc66.cyan("sms test")} Send a test SMS message`);
|
|
41988
42149
|
console.log(
|
|
41989
|
-
` ${
|
|
42150
|
+
` ${pc66.cyan("sms verify-number")} Verify a destination phone number`
|
|
41990
42151
|
);
|
|
41991
42152
|
console.log(
|
|
41992
|
-
` ${
|
|
42153
|
+
` ${pc66.cyan("sms sync")} Sync infrastructure (update Lambda, etc.)`
|
|
41993
42154
|
);
|
|
41994
|
-
console.log(` ${
|
|
41995
|
-
console.log(` ${
|
|
42155
|
+
console.log(` ${pc66.cyan("sms upgrade")} Upgrade SMS features`);
|
|
42156
|
+
console.log(` ${pc66.cyan("sms register")} Register toll-free number`);
|
|
41996
42157
|
console.log(
|
|
41997
|
-
` ${
|
|
42158
|
+
` ${pc66.cyan("sms destroy")} Remove SMS infrastructure
|
|
41998
42159
|
`
|
|
41999
42160
|
);
|
|
42000
42161
|
console.log("CDN Commands:");
|
|
42001
42162
|
console.log(
|
|
42002
|
-
` ${
|
|
42163
|
+
` ${pc66.cyan("cdn init")} Deploy CDN infrastructure (S3 + CloudFront)`
|
|
42003
42164
|
);
|
|
42004
42165
|
console.log(
|
|
42005
|
-
` ${
|
|
42166
|
+
` ${pc66.cyan("cdn status")} Show CDN infrastructure details`
|
|
42006
42167
|
);
|
|
42007
42168
|
console.log(
|
|
42008
|
-
` ${
|
|
42169
|
+
` ${pc66.cyan("cdn verify")} Check DNS and certificate status`
|
|
42009
42170
|
);
|
|
42010
42171
|
console.log(
|
|
42011
|
-
` ${
|
|
42172
|
+
` ${pc66.cyan("cdn upgrade")} Add custom domain after cert validation`
|
|
42012
42173
|
);
|
|
42013
42174
|
console.log(
|
|
42014
|
-
` ${
|
|
42175
|
+
` ${pc66.cyan("cdn sync")} Sync infrastructure with current config`
|
|
42015
42176
|
);
|
|
42016
42177
|
console.log(
|
|
42017
|
-
` ${
|
|
42178
|
+
` ${pc66.cyan("cdn destroy")} Remove CDN infrastructure
|
|
42018
42179
|
`
|
|
42019
42180
|
);
|
|
42020
42181
|
console.log("Self-Hosted Commands:");
|
|
42021
42182
|
console.log(
|
|
42022
|
-
` ${
|
|
42183
|
+
` ${pc66.cyan("selfhost deploy")} Deploy Wraps API to your AWS account`
|
|
42184
|
+
);
|
|
42185
|
+
console.log(
|
|
42186
|
+
` ${pc66.cyan("selfhost login")} Sign in to your self-hosted Wraps instance`
|
|
42023
42187
|
);
|
|
42024
42188
|
console.log(
|
|
42025
|
-
` ${
|
|
42189
|
+
` ${pc66.cyan("selfhost upgrade")} Rebuild and redeploy the self-hosted API`
|
|
42026
42190
|
);
|
|
42027
42191
|
console.log(
|
|
42028
|
-
` ${
|
|
42192
|
+
` ${pc66.cyan("selfhost status")} Show self-hosted deployment details
|
|
42029
42193
|
`
|
|
42030
42194
|
);
|
|
42031
42195
|
console.log("Local Development:");
|
|
42032
42196
|
console.log(
|
|
42033
|
-
` ${
|
|
42197
|
+
` ${pc66.cyan("console")} Start local web console
|
|
42034
42198
|
`
|
|
42035
42199
|
);
|
|
42036
42200
|
console.log("Platform:");
|
|
42037
42201
|
console.log(
|
|
42038
|
-
` ${
|
|
42202
|
+
` ${pc66.cyan("platform")} Show platform info and pricing`
|
|
42039
42203
|
);
|
|
42040
42204
|
console.log(
|
|
42041
|
-
` ${
|
|
42205
|
+
` ${pc66.cyan("platform connect")} Connect to Wraps Platform (events + IAM)`
|
|
42042
42206
|
);
|
|
42043
42207
|
console.log(
|
|
42044
|
-
` ${
|
|
42208
|
+
` ${pc66.cyan("platform update-role")} Update platform IAM permissions
|
|
42045
42209
|
`
|
|
42046
42210
|
);
|
|
42047
42211
|
console.log("Auth:");
|
|
42048
42212
|
console.log(
|
|
42049
|
-
` ${
|
|
42213
|
+
` ${pc66.cyan("auth login")} Sign in to wraps.dev (device flow)`
|
|
42050
42214
|
);
|
|
42051
|
-
console.log(` ${
|
|
42215
|
+
console.log(` ${pc66.cyan("auth status")} Show current auth state`);
|
|
42052
42216
|
console.log(
|
|
42053
|
-
` ${
|
|
42217
|
+
` ${pc66.cyan("auth logout")} Sign out and remove stored token
|
|
42054
42218
|
`
|
|
42055
42219
|
);
|
|
42056
42220
|
console.log("AWS Setup:");
|
|
42057
42221
|
console.log(
|
|
42058
|
-
` ${
|
|
42222
|
+
` ${pc66.cyan("aws setup")} Interactive AWS setup wizard`
|
|
42059
42223
|
);
|
|
42060
42224
|
console.log(
|
|
42061
|
-
` ${
|
|
42225
|
+
` ${pc66.cyan("aws doctor")} Diagnose AWS configuration issues
|
|
42062
42226
|
`
|
|
42063
42227
|
);
|
|
42064
42228
|
console.log("Global Commands:");
|
|
42065
|
-
console.log(` ${
|
|
42066
|
-
console.log(` ${
|
|
42067
|
-
console.log(` ${
|
|
42068
|
-
console.log(` ${
|
|
42229
|
+
console.log(` ${pc66.cyan("status")} Show overview of all services`);
|
|
42230
|
+
console.log(` ${pc66.cyan("destroy")} Remove deployed infrastructure`);
|
|
42231
|
+
console.log(` ${pc66.cyan("permissions")} Show required AWS IAM permissions`);
|
|
42232
|
+
console.log(` ${pc66.cyan("completion")} Generate shell completion script`);
|
|
42069
42233
|
console.log(
|
|
42070
|
-
` ${
|
|
42234
|
+
` ${pc66.cyan("telemetry")} Manage anonymous telemetry settings`
|
|
42071
42235
|
);
|
|
42072
|
-
console.log(` ${
|
|
42073
|
-
console.log(` ${
|
|
42236
|
+
console.log(` ${pc66.cyan("update")} Update CLI to latest version`);
|
|
42237
|
+
console.log(` ${pc66.cyan("news")} Show recent Wraps updates`);
|
|
42074
42238
|
console.log(
|
|
42075
|
-
` ${
|
|
42239
|
+
` ${pc66.cyan("support")} Get help and support contact info
|
|
42076
42240
|
`
|
|
42077
42241
|
);
|
|
42078
42242
|
console.log("Options:");
|
|
42079
42243
|
console.log(
|
|
42080
|
-
` ${
|
|
42081
|
-
);
|
|
42082
|
-
console.log(` ${
|
|
42083
|
-
console.log(` ${
|
|
42084
|
-
console.log(` ${
|
|
42085
|
-
console.log(` ${
|
|
42086
|
-
console.log(` ${
|
|
42087
|
-
console.log(` ${
|
|
42088
|
-
console.log(` ${
|
|
42244
|
+
` ${pc66.dim("-p, --provider")} Hosting provider (vercel, aws, railway, other)`
|
|
42245
|
+
);
|
|
42246
|
+
console.log(` ${pc66.dim("-r, --region")} AWS region`);
|
|
42247
|
+
console.log(` ${pc66.dim("-d, --domain")} Domain name`);
|
|
42248
|
+
console.log(` ${pc66.dim("--account")} AWS account ID or alias`);
|
|
42249
|
+
console.log(` ${pc66.dim("--preset")} Configuration preset`);
|
|
42250
|
+
console.log(` ${pc66.dim("--token")} API key or token for auth`);
|
|
42251
|
+
console.log(` ${pc66.dim("-y, --yes")} Skip confirmation prompts`);
|
|
42252
|
+
console.log(` ${pc66.dim("-f, --force")} Force destructive operations`);
|
|
42089
42253
|
console.log(
|
|
42090
|
-
` ${
|
|
42254
|
+
` ${pc66.dim("--preview")} Preview changes without deploying`
|
|
42091
42255
|
);
|
|
42092
|
-
console.log(` ${
|
|
42256
|
+
console.log(` ${pc66.dim("-v, --version")} Show version number
|
|
42093
42257
|
`);
|
|
42094
42258
|
console.log(
|
|
42095
|
-
`Run ${
|
|
42259
|
+
`Run ${pc66.cyan("wraps <service> <command> --help")} for more information.
|
|
42096
42260
|
`
|
|
42097
42261
|
);
|
|
42098
42262
|
}
|
|
@@ -42114,27 +42278,27 @@ if (!primaryCommand) {
|
|
|
42114
42278
|
const telemetry = getTelemetryClient();
|
|
42115
42279
|
if (telemetry.shouldShowNotification()) {
|
|
42116
42280
|
console.log();
|
|
42117
|
-
|
|
42281
|
+
clack62.log.info(pc66.bold("Anonymous Telemetry"));
|
|
42118
42282
|
console.log(
|
|
42119
|
-
` Wraps collects ${
|
|
42283
|
+
` Wraps collects ${pc66.cyan("anonymous usage data")} to improve the CLI.`
|
|
42120
42284
|
);
|
|
42121
42285
|
console.log(
|
|
42122
|
-
` We ${
|
|
42286
|
+
` We ${pc66.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42123
42287
|
);
|
|
42124
42288
|
console.log(
|
|
42125
|
-
` We ${
|
|
42289
|
+
` We ${pc66.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42126
42290
|
);
|
|
42127
42291
|
console.log();
|
|
42128
|
-
console.log(` Opt-out anytime: ${
|
|
42129
|
-
console.log(` Or set: ${
|
|
42130
|
-
console.log(` Learn more: ${
|
|
42292
|
+
console.log(` Opt-out anytime: ${pc66.cyan("wraps telemetry disable")}`);
|
|
42293
|
+
console.log(` Or set: ${pc66.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42294
|
+
console.log(` Learn more: ${pc66.cyan("https://wraps.dev/docs")}`);
|
|
42131
42295
|
console.log();
|
|
42132
42296
|
telemetry.markNotificationShown();
|
|
42133
42297
|
}
|
|
42134
42298
|
trackCommand("interactive:menu", { success: true, duration_ms: 0 });
|
|
42135
|
-
|
|
42299
|
+
clack62.intro(pc66.bold(`WRAPS CLI v${VERSION}`));
|
|
42136
42300
|
console.log(" Deploy AWS infrastructure to your account.\n");
|
|
42137
|
-
const action = await
|
|
42301
|
+
const action = await clack62.select({
|
|
42138
42302
|
message: "What would you like to do?",
|
|
42139
42303
|
options: [
|
|
42140
42304
|
{
|
|
@@ -42184,13 +42348,13 @@ if (!primaryCommand) {
|
|
|
42184
42348
|
}
|
|
42185
42349
|
]
|
|
42186
42350
|
});
|
|
42187
|
-
if (
|
|
42351
|
+
if (clack62.isCancel(action)) {
|
|
42188
42352
|
trackCommand("interactive:cancel", {
|
|
42189
42353
|
success: true,
|
|
42190
42354
|
duration_ms: Date.now() - startTime
|
|
42191
42355
|
});
|
|
42192
42356
|
await telemetry.shutdown();
|
|
42193
|
-
|
|
42357
|
+
clack62.cancel("Operation cancelled.");
|
|
42194
42358
|
process.exit(0);
|
|
42195
42359
|
}
|
|
42196
42360
|
trackCommand(`interactive:${action}`, {
|
|
@@ -42270,20 +42434,20 @@ async function run() {
|
|
|
42270
42434
|
const telemetry = getTelemetryClient();
|
|
42271
42435
|
if (telemetry.shouldShowNotification()) {
|
|
42272
42436
|
console.log();
|
|
42273
|
-
|
|
42437
|
+
clack62.log.info(pc66.bold("Anonymous Telemetry"));
|
|
42274
42438
|
console.log(
|
|
42275
|
-
` Wraps collects ${
|
|
42439
|
+
` Wraps collects ${pc66.cyan("anonymous usage data")} to improve the CLI.`
|
|
42276
42440
|
);
|
|
42277
42441
|
console.log(
|
|
42278
|
-
` We ${
|
|
42442
|
+
` We ${pc66.bold("never")} collect: domains, AWS credentials, email content, or PII.`
|
|
42279
42443
|
);
|
|
42280
42444
|
console.log(
|
|
42281
|
-
` We ${
|
|
42445
|
+
` We ${pc66.bold("only")} collect: command names, success/failure, CLI version, OS.`
|
|
42282
42446
|
);
|
|
42283
42447
|
console.log();
|
|
42284
|
-
console.log(` Opt-out anytime: ${
|
|
42285
|
-
console.log(` Or set: ${
|
|
42286
|
-
console.log(` Learn more: ${
|
|
42448
|
+
console.log(` Opt-out anytime: ${pc66.cyan("wraps telemetry disable")}`);
|
|
42449
|
+
console.log(` Or set: ${pc66.cyan("WRAPS_TELEMETRY_DISABLED=1")}`);
|
|
42450
|
+
console.log(` Learn more: ${pc66.cyan("https://wraps.dev/docs")}`);
|
|
42287
42451
|
console.log();
|
|
42288
42452
|
telemetry.markNotificationShown();
|
|
42289
42453
|
}
|
|
@@ -42367,10 +42531,10 @@ async function run() {
|
|
|
42367
42531
|
break;
|
|
42368
42532
|
case "verify": {
|
|
42369
42533
|
if (!flags.domain) {
|
|
42370
|
-
|
|
42534
|
+
clack62.log.error("--domain flag is required");
|
|
42371
42535
|
console.log(
|
|
42372
42536
|
`
|
|
42373
|
-
Usage: ${
|
|
42537
|
+
Usage: ${pc66.cyan("wraps email verify --domain yourapp.com")}
|
|
42374
42538
|
`
|
|
42375
42539
|
);
|
|
42376
42540
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42442,12 +42606,12 @@ Usage: ${pc65.cyan("wraps email verify --domain yourapp.com")}
|
|
|
42442
42606
|
});
|
|
42443
42607
|
break;
|
|
42444
42608
|
default:
|
|
42445
|
-
|
|
42609
|
+
clack62.log.error(
|
|
42446
42610
|
`Unknown inbound command: ${inboundSubCommand || "(none)"}`
|
|
42447
42611
|
);
|
|
42448
42612
|
console.log(
|
|
42449
42613
|
`
|
|
42450
|
-
Available commands: ${
|
|
42614
|
+
Available commands: ${pc66.cyan("init")}, ${pc66.cyan("destroy")}, ${pc66.cyan("status")}, ${pc66.cyan("verify")}, ${pc66.cyan("test")}, ${pc66.cyan("add")}, ${pc66.cyan("remove")}
|
|
42451
42615
|
`
|
|
42452
42616
|
);
|
|
42453
42617
|
throw new Error(
|
|
@@ -42499,12 +42663,12 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("destroy")}, ${pc65.cyan("
|
|
|
42499
42663
|
break;
|
|
42500
42664
|
}
|
|
42501
42665
|
default:
|
|
42502
|
-
|
|
42666
|
+
clack62.log.error(
|
|
42503
42667
|
`Unknown reply command: ${replySubCommand || "(none)"}`
|
|
42504
42668
|
);
|
|
42505
42669
|
console.log(
|
|
42506
42670
|
`
|
|
42507
|
-
Available commands: ${
|
|
42671
|
+
Available commands: ${pc66.cyan("init")}, ${pc66.cyan("rotate")}, ${pc66.cyan("status")}, ${pc66.cyan("destroy")}, ${pc66.cyan("decode")}
|
|
42508
42672
|
`
|
|
42509
42673
|
);
|
|
42510
42674
|
throw new Error(
|
|
@@ -42529,10 +42693,10 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("rotate")}, ${pc65.cyan("s
|
|
|
42529
42693
|
break;
|
|
42530
42694
|
case "verify": {
|
|
42531
42695
|
if (!flags.domain) {
|
|
42532
|
-
|
|
42696
|
+
clack62.log.error("--domain flag is required");
|
|
42533
42697
|
console.log(
|
|
42534
42698
|
`
|
|
42535
|
-
Usage: ${
|
|
42699
|
+
Usage: ${pc66.cyan("wraps email domains verify --domain yourapp.com")}
|
|
42536
42700
|
`
|
|
42537
42701
|
);
|
|
42538
42702
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42542,10 +42706,10 @@ Usage: ${pc65.cyan("wraps email domains verify --domain yourapp.com")}
|
|
|
42542
42706
|
}
|
|
42543
42707
|
case "get-dkim": {
|
|
42544
42708
|
if (!flags.domain) {
|
|
42545
|
-
|
|
42709
|
+
clack62.log.error("--domain flag is required");
|
|
42546
42710
|
console.log(
|
|
42547
42711
|
`
|
|
42548
|
-
Usage: ${
|
|
42712
|
+
Usage: ${pc66.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
42549
42713
|
`
|
|
42550
42714
|
);
|
|
42551
42715
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42555,10 +42719,10 @@ Usage: ${pc65.cyan("wraps email domains get-dkim --domain yourapp.com")}
|
|
|
42555
42719
|
}
|
|
42556
42720
|
case "remove": {
|
|
42557
42721
|
if (!flags.domain) {
|
|
42558
|
-
|
|
42722
|
+
clack62.log.error("--domain flag is required");
|
|
42559
42723
|
console.log(
|
|
42560
42724
|
`
|
|
42561
|
-
Usage: ${
|
|
42725
|
+
Usage: ${pc66.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
42562
42726
|
`
|
|
42563
42727
|
);
|
|
42564
42728
|
throw new Error("Missing required flag: --domain");
|
|
@@ -42588,12 +42752,12 @@ Usage: ${pc65.cyan("wraps email domains remove --domain yourapp.com --force")}
|
|
|
42588
42752
|
break;
|
|
42589
42753
|
}
|
|
42590
42754
|
default:
|
|
42591
|
-
|
|
42755
|
+
clack62.log.error(
|
|
42592
42756
|
`Unknown domains command: ${domainsSubCommand || "(none)"}`
|
|
42593
42757
|
);
|
|
42594
42758
|
console.log(
|
|
42595
42759
|
`
|
|
42596
|
-
Available commands: ${
|
|
42760
|
+
Available commands: ${pc66.cyan("add")}, ${pc66.cyan("list")}, ${pc66.cyan("verify")}, ${pc66.cyan("get-dkim")}, ${pc66.cyan("remove")}, ${pc66.cyan("config")}
|
|
42597
42761
|
`
|
|
42598
42762
|
);
|
|
42599
42763
|
throw new Error(
|
|
@@ -42635,12 +42799,12 @@ Available commands: ${pc65.cyan("add")}, ${pc65.cyan("list")}, ${pc65.cyan("veri
|
|
|
42635
42799
|
});
|
|
42636
42800
|
break;
|
|
42637
42801
|
default:
|
|
42638
|
-
|
|
42802
|
+
clack62.log.error(
|
|
42639
42803
|
`Unknown templates command: ${templatesSubCommand || "(none)"}`
|
|
42640
42804
|
);
|
|
42641
42805
|
console.log(
|
|
42642
42806
|
`
|
|
42643
|
-
Available commands: ${
|
|
42807
|
+
Available commands: ${pc66.cyan("init")}, ${pc66.cyan("push")}, ${pc66.cyan("preview")}
|
|
42644
42808
|
`
|
|
42645
42809
|
);
|
|
42646
42810
|
throw new Error(
|
|
@@ -42679,12 +42843,12 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("push")}, ${pc65.cyan("pre
|
|
|
42679
42843
|
});
|
|
42680
42844
|
break;
|
|
42681
42845
|
default:
|
|
42682
|
-
|
|
42846
|
+
clack62.log.error(
|
|
42683
42847
|
`Unknown workflows command: ${workflowsSubCommand || "(none)"}`
|
|
42684
42848
|
);
|
|
42685
42849
|
console.log(
|
|
42686
42850
|
`
|
|
42687
|
-
Available commands: ${
|
|
42851
|
+
Available commands: ${pc66.cyan("init")}, ${pc66.cyan("validate")}, ${pc66.cyan("push")}
|
|
42688
42852
|
`
|
|
42689
42853
|
);
|
|
42690
42854
|
throw new Error(
|
|
@@ -42709,10 +42873,10 @@ Available commands: ${pc65.cyan("init")}, ${pc65.cyan("validate")}, ${pc65.cyan(
|
|
|
42709
42873
|
});
|
|
42710
42874
|
break;
|
|
42711
42875
|
default:
|
|
42712
|
-
|
|
42876
|
+
clack62.log.error(`Unknown email command: ${subCommand}`);
|
|
42713
42877
|
console.log(
|
|
42714
42878
|
`
|
|
42715
|
-
Run ${
|
|
42879
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
42716
42880
|
`
|
|
42717
42881
|
);
|
|
42718
42882
|
throw new Error(`Unknown email command: ${subCommand}`);
|
|
@@ -42737,10 +42901,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
|
|
|
42737
42901
|
});
|
|
42738
42902
|
break;
|
|
42739
42903
|
default:
|
|
42740
|
-
|
|
42904
|
+
clack62.log.error(`Unknown license command: ${subCommand}`);
|
|
42741
42905
|
console.log(
|
|
42742
42906
|
`
|
|
42743
|
-
Run ${
|
|
42907
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
42744
42908
|
`
|
|
42745
42909
|
);
|
|
42746
42910
|
throw new Error(`Unknown license command: ${subCommand}`);
|
|
@@ -42787,11 +42951,17 @@ Run ${pc65.cyan("wraps --help")} for available commands.
|
|
|
42787
42951
|
json: flags.json
|
|
42788
42952
|
});
|
|
42789
42953
|
break;
|
|
42954
|
+
case "login":
|
|
42955
|
+
await selfhostLogin({
|
|
42956
|
+
region: flags.region,
|
|
42957
|
+
json: flags.json
|
|
42958
|
+
});
|
|
42959
|
+
break;
|
|
42790
42960
|
default:
|
|
42791
|
-
|
|
42961
|
+
clack62.log.error(`Unknown selfhost command: ${subCommand}`);
|
|
42792
42962
|
console.log(
|
|
42793
42963
|
`
|
|
42794
|
-
Run ${
|
|
42964
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
42795
42965
|
`
|
|
42796
42966
|
);
|
|
42797
42967
|
throw new Error(`Unknown selfhost command: ${subCommand}`);
|
|
@@ -42871,10 +43041,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
|
|
|
42871
43041
|
});
|
|
42872
43042
|
break;
|
|
42873
43043
|
default:
|
|
42874
|
-
|
|
43044
|
+
clack62.log.error(`Unknown sms command: ${subCommand}`);
|
|
42875
43045
|
console.log(
|
|
42876
43046
|
`
|
|
42877
|
-
Run ${
|
|
43047
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
42878
43048
|
`
|
|
42879
43049
|
);
|
|
42880
43050
|
throw new Error(`Unknown sms command: ${subCommand}`);
|
|
@@ -42935,10 +43105,10 @@ Run ${pc65.cyan("wraps --help")} for available commands.
|
|
|
42935
43105
|
});
|
|
42936
43106
|
break;
|
|
42937
43107
|
default:
|
|
42938
|
-
|
|
43108
|
+
clack62.log.error(`Unknown cdn command: ${subCommand}`);
|
|
42939
43109
|
console.log(
|
|
42940
43110
|
`
|
|
42941
|
-
Run ${
|
|
43111
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
42942
43112
|
`
|
|
42943
43113
|
);
|
|
42944
43114
|
throw new Error(`Unknown cdn command: ${subCommand}`);
|
|
@@ -42960,13 +43130,13 @@ Run ${pc65.cyan("wraps --help")} for available commands.
|
|
|
42960
43130
|
});
|
|
42961
43131
|
break;
|
|
42962
43132
|
default:
|
|
42963
|
-
|
|
43133
|
+
clack62.log.error(
|
|
42964
43134
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
42965
43135
|
);
|
|
42966
43136
|
console.log(`
|
|
42967
|
-
Available commands: ${
|
|
43137
|
+
Available commands: ${pc66.cyan("init")}
|
|
42968
43138
|
`);
|
|
42969
|
-
console.log(`Run ${
|
|
43139
|
+
console.log(`Run ${pc66.cyan("wraps --help")} for more information.
|
|
42970
43140
|
`);
|
|
42971
43141
|
throw new Error(
|
|
42972
43142
|
`Unknown workflow command: ${subCommand || "(none)"}`
|
|
@@ -43008,14 +43178,14 @@ Available commands: ${pc65.cyan("init")}
|
|
|
43008
43178
|
});
|
|
43009
43179
|
break;
|
|
43010
43180
|
default:
|
|
43011
|
-
|
|
43181
|
+
clack62.log.error(`Unknown platform command: ${subCommand}`);
|
|
43012
43182
|
console.log(
|
|
43013
43183
|
`
|
|
43014
|
-
Available commands: ${
|
|
43184
|
+
Available commands: ${pc66.cyan("connect")}, ${pc66.cyan("update-role")}
|
|
43015
43185
|
`
|
|
43016
43186
|
);
|
|
43017
43187
|
console.log(
|
|
43018
|
-
`Run ${
|
|
43188
|
+
`Run ${pc66.cyan("wraps platform")} for more information.
|
|
43019
43189
|
`
|
|
43020
43190
|
);
|
|
43021
43191
|
throw new Error(`Unknown platform command: ${subCommand}`);
|
|
@@ -43040,10 +43210,10 @@ Available commands: ${pc65.cyan("connect")}, ${pc65.cyan("update-role")}
|
|
|
43040
43210
|
await logout();
|
|
43041
43211
|
break;
|
|
43042
43212
|
default:
|
|
43043
|
-
|
|
43213
|
+
clack62.log.error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
43044
43214
|
console.log(
|
|
43045
43215
|
`
|
|
43046
|
-
Available commands: ${
|
|
43216
|
+
Available commands: ${pc66.cyan("login")}, ${pc66.cyan("status")}, ${pc66.cyan("logout")}
|
|
43047
43217
|
`
|
|
43048
43218
|
);
|
|
43049
43219
|
throw new Error(`Unknown auth command: ${subCommand || "(none)"}`);
|
|
@@ -43061,13 +43231,13 @@ Available commands: ${pc65.cyan("login")}, ${pc65.cyan("status")}, ${pc65.cyan("
|
|
|
43061
43231
|
await doctor();
|
|
43062
43232
|
break;
|
|
43063
43233
|
default:
|
|
43064
|
-
|
|
43234
|
+
clack62.log.error(`Unknown aws command: ${subCommand}`);
|
|
43065
43235
|
console.log(
|
|
43066
43236
|
`
|
|
43067
|
-
Available commands: ${
|
|
43237
|
+
Available commands: ${pc66.cyan("setup")}, ${pc66.cyan("doctor")}
|
|
43068
43238
|
`
|
|
43069
43239
|
);
|
|
43070
|
-
console.log(`Run ${
|
|
43240
|
+
console.log(`Run ${pc66.cyan("wraps --help")} for more information.
|
|
43071
43241
|
`);
|
|
43072
43242
|
throw new Error(`Unknown aws command: ${subCommand}`);
|
|
43073
43243
|
}
|
|
@@ -43148,10 +43318,10 @@ Available commands: ${pc65.cyan("setup")}, ${pc65.cyan("doctor")}
|
|
|
43148
43318
|
await telemetryStatus();
|
|
43149
43319
|
break;
|
|
43150
43320
|
default:
|
|
43151
|
-
|
|
43321
|
+
clack62.log.error(`Unknown telemetry command: ${subCommand}`);
|
|
43152
43322
|
console.log(
|
|
43153
43323
|
`
|
|
43154
|
-
Available commands: ${
|
|
43324
|
+
Available commands: ${pc66.cyan("enable")}, ${pc66.cyan("disable")}, ${pc66.cyan("status")}
|
|
43155
43325
|
`
|
|
43156
43326
|
);
|
|
43157
43327
|
throw new Error(`Unknown telemetry command: ${subCommand}`);
|
|
@@ -43175,10 +43345,10 @@ Please specify a command for ${primaryCommand} service.
|
|
|
43175
43345
|
showHelp();
|
|
43176
43346
|
break;
|
|
43177
43347
|
default:
|
|
43178
|
-
|
|
43348
|
+
clack62.log.error(`Unknown command: ${primaryCommand}`);
|
|
43179
43349
|
console.log(
|
|
43180
43350
|
`
|
|
43181
|
-
Run ${
|
|
43351
|
+
Run ${pc66.cyan("wraps --help")} for available commands.
|
|
43182
43352
|
`
|
|
43183
43353
|
);
|
|
43184
43354
|
throw new Error(`Unknown command: ${primaryCommand}`);
|