@wraps.dev/cli 2.18.10 → 2.18.12
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
|
@@ -5429,8 +5429,8 @@ async function promptMailFromSubdomain(domain) {
|
|
|
5429
5429
|
clack6.cancel("Operation cancelled.");
|
|
5430
5430
|
process.exit(0);
|
|
5431
5431
|
}
|
|
5432
|
-
const
|
|
5433
|
-
return `${
|
|
5432
|
+
const sub2 = subdomain || "mail";
|
|
5433
|
+
return `${sub2}.${domain}`;
|
|
5434
5434
|
}
|
|
5435
5435
|
var DNS_CATEGORY_LABELS, DNS_STATUS_SYMBOLS;
|
|
5436
5436
|
var init_prompts = __esm({
|
|
@@ -10019,7 +10019,6 @@ import { readFileSync as readFileSync3 } from "fs";
|
|
|
10019
10019
|
import { dirname as dirname5, join as join22 } from "path";
|
|
10020
10020
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
10021
10021
|
import * as clack53 from "@clack/prompts";
|
|
10022
|
-
import args from "args";
|
|
10023
10022
|
import pc58 from "picocolors";
|
|
10024
10023
|
|
|
10025
10024
|
// src/commands/auth/login.ts
|
|
@@ -24198,15 +24197,15 @@ function normalizePlainTextMustaches(text10, canonicalVars) {
|
|
|
24198
24197
|
}
|
|
24199
24198
|
return text10.replace(
|
|
24200
24199
|
/\{\{([#/]?)([A-Z][A-Z0-9_]*(?:\.[A-Z0-9_]+)*)((?:\s+[A-Z0-9_.]+)*)\s*\}\}/g,
|
|
24201
|
-
(match, sigil, name,
|
|
24200
|
+
(match, sigil, name, args) => {
|
|
24202
24201
|
const lower = name.toLowerCase();
|
|
24203
24202
|
const isHelper = lower === "else" || HANDLEBARS_BLOCK_HELPERS.has(lower);
|
|
24204
|
-
const restoredArgs =
|
|
24203
|
+
const restoredArgs = args.split(/\s+/).filter(Boolean).map(restoreIdentifier).join(" ");
|
|
24205
24204
|
if (isHelper) {
|
|
24206
24205
|
const suffix = restoredArgs ? ` ${restoredArgs}` : "";
|
|
24207
24206
|
return `{{${sigil}${lower}${suffix}}}`;
|
|
24208
24207
|
}
|
|
24209
|
-
if (!
|
|
24208
|
+
if (!args && canonicalByLower.has(lower)) {
|
|
24210
24209
|
return `{{${sigil}${canonicalByLower.get(lower)}}}`;
|
|
24211
24210
|
}
|
|
24212
24211
|
return match;
|
|
@@ -37801,6 +37800,100 @@ function showNextSteps2() {
|
|
|
37801
37800
|
init_client();
|
|
37802
37801
|
init_events();
|
|
37803
37802
|
|
|
37803
|
+
// src/utils/shared/arg-parser.ts
|
|
37804
|
+
init_esm_shims();
|
|
37805
|
+
import mri from "mri";
|
|
37806
|
+
var STRING_FLAGS = [
|
|
37807
|
+
"provider",
|
|
37808
|
+
"region",
|
|
37809
|
+
"domain",
|
|
37810
|
+
"account",
|
|
37811
|
+
"preset",
|
|
37812
|
+
"port",
|
|
37813
|
+
"to",
|
|
37814
|
+
"message",
|
|
37815
|
+
"phone-number",
|
|
37816
|
+
"code",
|
|
37817
|
+
"action",
|
|
37818
|
+
"scenario",
|
|
37819
|
+
"interval",
|
|
37820
|
+
"token",
|
|
37821
|
+
"dkim-selector",
|
|
37822
|
+
"timeout",
|
|
37823
|
+
"service",
|
|
37824
|
+
"template",
|
|
37825
|
+
"workflow",
|
|
37826
|
+
"org",
|
|
37827
|
+
"subdomain"
|
|
37828
|
+
];
|
|
37829
|
+
var BOOLEAN_FLAGS = [
|
|
37830
|
+
"yes",
|
|
37831
|
+
"force",
|
|
37832
|
+
"preview",
|
|
37833
|
+
"list",
|
|
37834
|
+
"delete",
|
|
37835
|
+
"resend",
|
|
37836
|
+
"wait",
|
|
37837
|
+
"quick",
|
|
37838
|
+
"json",
|
|
37839
|
+
"verbose",
|
|
37840
|
+
"skip-blacklists",
|
|
37841
|
+
"skip-tls",
|
|
37842
|
+
"dry-run",
|
|
37843
|
+
"draft",
|
|
37844
|
+
"root",
|
|
37845
|
+
"cleanup",
|
|
37846
|
+
"help",
|
|
37847
|
+
"version"
|
|
37848
|
+
];
|
|
37849
|
+
var NEGATED_BOOLEANS = [
|
|
37850
|
+
{ positive: "open", camelKey: "noOpen" },
|
|
37851
|
+
{ positive: "example", camelKey: "noExample" },
|
|
37852
|
+
{ positive: "claude", camelKey: "noClaude" }
|
|
37853
|
+
];
|
|
37854
|
+
var ALIAS = {
|
|
37855
|
+
p: "provider",
|
|
37856
|
+
r: "region",
|
|
37857
|
+
d: "domain",
|
|
37858
|
+
y: "yes",
|
|
37859
|
+
f: "force",
|
|
37860
|
+
w: "wait",
|
|
37861
|
+
q: "quick",
|
|
37862
|
+
j: "json",
|
|
37863
|
+
h: "help",
|
|
37864
|
+
v: "version"
|
|
37865
|
+
};
|
|
37866
|
+
var toCamel = (name) => name.replace(/-([a-z])/g, (_, ch) => ch.toUpperCase());
|
|
37867
|
+
function parseCliArgs(argv) {
|
|
37868
|
+
const userArgs = argv.slice(2);
|
|
37869
|
+
const parsed = mri(userArgs, {
|
|
37870
|
+
boolean: [...BOOLEAN_FLAGS, ...NEGATED_BOOLEANS.map((n) => n.positive)],
|
|
37871
|
+
string: [...STRING_FLAGS],
|
|
37872
|
+
alias: ALIAS
|
|
37873
|
+
});
|
|
37874
|
+
const flags2 = {};
|
|
37875
|
+
for (const key of STRING_FLAGS) {
|
|
37876
|
+
const value = parsed[key];
|
|
37877
|
+
if (typeof value === "string" && value.length > 0) {
|
|
37878
|
+
flags2[toCamel(key)] = value;
|
|
37879
|
+
}
|
|
37880
|
+
}
|
|
37881
|
+
for (const key of BOOLEAN_FLAGS) {
|
|
37882
|
+
if (parsed[key] === true) {
|
|
37883
|
+
flags2[toCamel(key)] = true;
|
|
37884
|
+
}
|
|
37885
|
+
}
|
|
37886
|
+
for (const { positive, camelKey } of NEGATED_BOOLEANS) {
|
|
37887
|
+
if (parsed[positive] === false) {
|
|
37888
|
+
flags2[camelKey] = true;
|
|
37889
|
+
}
|
|
37890
|
+
}
|
|
37891
|
+
return {
|
|
37892
|
+
flags: flags2,
|
|
37893
|
+
sub: parsed._
|
|
37894
|
+
};
|
|
37895
|
+
}
|
|
37896
|
+
|
|
37804
37897
|
// src/utils/shared/completion.ts
|
|
37805
37898
|
init_esm_shims();
|
|
37806
37899
|
function setupTabCompletion() {
|
|
@@ -38071,220 +38164,11 @@ if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
|
38071
38164
|
showHelp();
|
|
38072
38165
|
process.exit(0);
|
|
38073
38166
|
}
|
|
38074
|
-
|
|
38075
|
-
|
|
38076
|
-
|
|
38077
|
-
|
|
38078
|
-
|
|
38079
|
-
},
|
|
38080
|
-
{
|
|
38081
|
-
name: ["r", "region"],
|
|
38082
|
-
description: "AWS region",
|
|
38083
|
-
defaultValue: void 0
|
|
38084
|
-
},
|
|
38085
|
-
{
|
|
38086
|
-
name: ["d", "domain"],
|
|
38087
|
-
description: "Domain name",
|
|
38088
|
-
defaultValue: void 0
|
|
38089
|
-
},
|
|
38090
|
-
{
|
|
38091
|
-
name: "account",
|
|
38092
|
-
description: "AWS account ID or alias",
|
|
38093
|
-
defaultValue: void 0
|
|
38094
|
-
},
|
|
38095
|
-
{
|
|
38096
|
-
name: "preset",
|
|
38097
|
-
description: "Configuration preset (starter, production, enterprise, custom)",
|
|
38098
|
-
defaultValue: void 0
|
|
38099
|
-
},
|
|
38100
|
-
{
|
|
38101
|
-
name: ["y", "yes"],
|
|
38102
|
-
description: "Skip confirmation prompts (non-destructive operations)",
|
|
38103
|
-
defaultValue: false
|
|
38104
|
-
},
|
|
38105
|
-
{
|
|
38106
|
-
name: ["f", "force"],
|
|
38107
|
-
description: "Force operation without confirmation (destructive operations)",
|
|
38108
|
-
defaultValue: false
|
|
38109
|
-
},
|
|
38110
|
-
{
|
|
38111
|
-
name: "port",
|
|
38112
|
-
description: "Port for dashboard server",
|
|
38113
|
-
defaultValue: void 0
|
|
38114
|
-
},
|
|
38115
|
-
{
|
|
38116
|
-
name: "noOpen",
|
|
38117
|
-
description: "Don't open browser automatically",
|
|
38118
|
-
defaultValue: false
|
|
38119
|
-
},
|
|
38120
|
-
{
|
|
38121
|
-
name: "preview",
|
|
38122
|
-
description: "Preview changes without deploying",
|
|
38123
|
-
defaultValue: false
|
|
38124
|
-
},
|
|
38125
|
-
// SMS-specific options
|
|
38126
|
-
{
|
|
38127
|
-
name: "to",
|
|
38128
|
-
description: "Destination phone number (E.164 format)",
|
|
38129
|
-
defaultValue: void 0
|
|
38130
|
-
},
|
|
38131
|
-
{
|
|
38132
|
-
name: "message",
|
|
38133
|
-
description: "SMS message content",
|
|
38134
|
-
defaultValue: void 0
|
|
38135
|
-
},
|
|
38136
|
-
// SMS verify-number options
|
|
38137
|
-
{
|
|
38138
|
-
name: "phoneNumber",
|
|
38139
|
-
description: "Phone number to verify (E.164 format)",
|
|
38140
|
-
defaultValue: void 0
|
|
38141
|
-
},
|
|
38142
|
-
{
|
|
38143
|
-
name: "code",
|
|
38144
|
-
description: "Verification code received via SMS",
|
|
38145
|
-
defaultValue: void 0
|
|
38146
|
-
},
|
|
38147
|
-
{
|
|
38148
|
-
name: "list",
|
|
38149
|
-
description: "List all verified destination numbers",
|
|
38150
|
-
defaultValue: false
|
|
38151
|
-
},
|
|
38152
|
-
{
|
|
38153
|
-
name: "delete",
|
|
38154
|
-
description: "Delete a verified destination number",
|
|
38155
|
-
defaultValue: false
|
|
38156
|
-
},
|
|
38157
|
-
{
|
|
38158
|
-
name: "resend",
|
|
38159
|
-
description: "Resend verification code",
|
|
38160
|
-
defaultValue: false
|
|
38161
|
-
},
|
|
38162
|
-
// Email upgrade options
|
|
38163
|
-
{
|
|
38164
|
-
name: "action",
|
|
38165
|
-
description: "Upgrade action (preset, smtp-credentials, events, archiving, etc.)",
|
|
38166
|
-
defaultValue: void 0
|
|
38167
|
-
},
|
|
38168
|
-
// Email test options
|
|
38169
|
-
{
|
|
38170
|
-
name: "scenario",
|
|
38171
|
-
description: "Test scenario (success, bounce, complaint, ooto, suppression_list)",
|
|
38172
|
-
defaultValue: void 0
|
|
38173
|
-
},
|
|
38174
|
-
// Email verify options
|
|
38175
|
-
{
|
|
38176
|
-
name: ["w", "wait"],
|
|
38177
|
-
description: "Poll until DNS records are verified",
|
|
38178
|
-
defaultValue: false
|
|
38179
|
-
},
|
|
38180
|
-
{
|
|
38181
|
-
name: "interval",
|
|
38182
|
-
description: "Polling interval in seconds (default: 30)",
|
|
38183
|
-
defaultValue: void 0
|
|
38184
|
-
},
|
|
38185
|
-
// Email check options
|
|
38186
|
-
{
|
|
38187
|
-
name: ["q", "quick"],
|
|
38188
|
-
description: "Quick mode: fewer DKIM selectors, top blacklists only",
|
|
38189
|
-
defaultValue: false
|
|
38190
|
-
},
|
|
38191
|
-
{
|
|
38192
|
-
name: ["j", "json"],
|
|
38193
|
-
description: "Output results as JSON",
|
|
38194
|
-
defaultValue: false
|
|
38195
|
-
},
|
|
38196
|
-
{
|
|
38197
|
-
name: "token",
|
|
38198
|
-
description: "API key or token for authentication",
|
|
38199
|
-
defaultValue: void 0
|
|
38200
|
-
},
|
|
38201
|
-
{
|
|
38202
|
-
name: "verbose",
|
|
38203
|
-
description: "Show all checks including passing",
|
|
38204
|
-
defaultValue: false
|
|
38205
|
-
},
|
|
38206
|
-
{
|
|
38207
|
-
name: "dkimSelector",
|
|
38208
|
-
description: "Specific DKIM selector to check",
|
|
38209
|
-
defaultValue: void 0
|
|
38210
|
-
},
|
|
38211
|
-
{
|
|
38212
|
-
name: "skipBlacklists",
|
|
38213
|
-
description: "Skip blacklist checks",
|
|
38214
|
-
defaultValue: false
|
|
38215
|
-
},
|
|
38216
|
-
{
|
|
38217
|
-
name: "skipTls",
|
|
38218
|
-
description: "Skip MX TLS checks",
|
|
38219
|
-
defaultValue: false
|
|
38220
|
-
},
|
|
38221
|
-
{
|
|
38222
|
-
name: "timeout",
|
|
38223
|
-
description: "DNS timeout in milliseconds",
|
|
38224
|
-
defaultValue: void 0
|
|
38225
|
-
},
|
|
38226
|
-
// Permissions command options
|
|
38227
|
-
{
|
|
38228
|
-
name: "service",
|
|
38229
|
-
description: "Service type for permissions (email, sms, cdn)",
|
|
38230
|
-
defaultValue: void 0
|
|
38231
|
-
},
|
|
38232
|
-
// Template-specific options
|
|
38233
|
-
{
|
|
38234
|
-
name: "template",
|
|
38235
|
-
description: "Specific template to push (by name)",
|
|
38236
|
-
defaultValue: void 0
|
|
38237
|
-
},
|
|
38238
|
-
// Workflow-specific options
|
|
38239
|
-
{
|
|
38240
|
-
name: "workflow",
|
|
38241
|
-
description: "Specific workflow to push (by name)",
|
|
38242
|
-
defaultValue: void 0
|
|
38243
|
-
},
|
|
38244
|
-
{
|
|
38245
|
-
name: "dryRun",
|
|
38246
|
-
description: "Preview changes without pushing",
|
|
38247
|
-
defaultValue: false
|
|
38248
|
-
},
|
|
38249
|
-
{
|
|
38250
|
-
name: "draft",
|
|
38251
|
-
description: "Push workflow as draft without enabling it",
|
|
38252
|
-
defaultValue: false
|
|
38253
|
-
},
|
|
38254
|
-
{
|
|
38255
|
-
name: "noExample",
|
|
38256
|
-
description: "Skip creating example template",
|
|
38257
|
-
defaultValue: false
|
|
38258
|
-
},
|
|
38259
|
-
{
|
|
38260
|
-
name: "noClaude",
|
|
38261
|
-
description: "Skip scaffolding .claude/ context files",
|
|
38262
|
-
defaultValue: false
|
|
38263
|
-
},
|
|
38264
|
-
{
|
|
38265
|
-
name: "org",
|
|
38266
|
-
description: "Organization slug",
|
|
38267
|
-
defaultValue: void 0
|
|
38268
|
-
},
|
|
38269
|
-
{
|
|
38270
|
-
name: "subdomain",
|
|
38271
|
-
description: "Subdomain for inbound email (e.g., inbound, support)",
|
|
38272
|
-
defaultValue: void 0
|
|
38273
|
-
},
|
|
38274
|
-
{
|
|
38275
|
-
name: "root",
|
|
38276
|
-
description: "Use root domain for inbound email (no subdomain)",
|
|
38277
|
-
defaultValue: false
|
|
38278
|
-
},
|
|
38279
|
-
{
|
|
38280
|
-
name: "cleanup",
|
|
38281
|
-
description: "Delete orphaned resources (used with email doctor)",
|
|
38282
|
-
defaultValue: false
|
|
38283
|
-
}
|
|
38284
|
-
]);
|
|
38285
|
-
var flags = args.parse(process.argv);
|
|
38286
|
-
var [primaryCommand, subCommand] = args.sub;
|
|
38287
|
-
setJsonMode(flags.json);
|
|
38167
|
+
var parsedCli = parseCliArgs(process.argv);
|
|
38168
|
+
var flags = parsedCli.flags;
|
|
38169
|
+
var { sub } = parsedCli;
|
|
38170
|
+
var [primaryCommand, subCommand] = sub;
|
|
38171
|
+
setJsonMode(flags.json === true);
|
|
38288
38172
|
if (!primaryCommand) {
|
|
38289
38173
|
async function interactiveMenu() {
|
|
38290
38174
|
const startTime = Date.now();
|
|
@@ -38488,7 +38372,7 @@ async function run() {
|
|
|
38488
38372
|
break;
|
|
38489
38373
|
case "check":
|
|
38490
38374
|
await check({
|
|
38491
|
-
domain:
|
|
38375
|
+
domain: sub[2] || flags.domain,
|
|
38492
38376
|
quick: flags.quick,
|
|
38493
38377
|
json: flags.json,
|
|
38494
38378
|
verbose: flags.verbose,
|
|
@@ -38559,7 +38443,7 @@ Usage: ${pc58.cyan("wraps email verify --domain yourapp.com")}
|
|
|
38559
38443
|
break;
|
|
38560
38444
|
}
|
|
38561
38445
|
case "inbound": {
|
|
38562
|
-
const inboundSubCommand =
|
|
38446
|
+
const inboundSubCommand = sub[2];
|
|
38563
38447
|
switch (inboundSubCommand) {
|
|
38564
38448
|
case "init":
|
|
38565
38449
|
await inboundInit({
|
|
@@ -38631,7 +38515,7 @@ Available commands: ${pc58.cyan("init")}, ${pc58.cyan("destroy")}, ${pc58.cyan("
|
|
|
38631
38515
|
break;
|
|
38632
38516
|
}
|
|
38633
38517
|
case "domains": {
|
|
38634
|
-
const domainsSubCommand =
|
|
38518
|
+
const domainsSubCommand = sub[2];
|
|
38635
38519
|
switch (domainsSubCommand) {
|
|
38636
38520
|
case "add": {
|
|
38637
38521
|
await addDomain({
|
|
@@ -38702,7 +38586,7 @@ Available commands: ${pc58.cyan("add")}, ${pc58.cyan("list")}, ${pc58.cyan("veri
|
|
|
38702
38586
|
break;
|
|
38703
38587
|
}
|
|
38704
38588
|
case "templates": {
|
|
38705
|
-
const templatesSubCommand =
|
|
38589
|
+
const templatesSubCommand = sub[2];
|
|
38706
38590
|
switch (templatesSubCommand) {
|
|
38707
38591
|
case "init":
|
|
38708
38592
|
await templatesInit({
|
|
@@ -38716,7 +38600,9 @@ Available commands: ${pc58.cyan("add")}, ${pc58.cyan("list")}, ${pc58.cyan("veri
|
|
|
38716
38600
|
break;
|
|
38717
38601
|
case "push":
|
|
38718
38602
|
await templatesPush({
|
|
38719
|
-
|
|
38603
|
+
// Positional slug (e.g. `wraps email templates push my-slug`)
|
|
38604
|
+
// falls back to --template for a nicer UX.
|
|
38605
|
+
template: sub[3] || flags.template,
|
|
38720
38606
|
dryRun: flags.dryRun,
|
|
38721
38607
|
force: flags.force,
|
|
38722
38608
|
yes: flags.yes,
|
|
@@ -38747,7 +38633,7 @@ Available commands: ${pc58.cyan("init")}, ${pc58.cyan("push")}, ${pc58.cyan("pre
|
|
|
38747
38633
|
break;
|
|
38748
38634
|
}
|
|
38749
38635
|
case "workflows": {
|
|
38750
|
-
const workflowsSubCommand =
|
|
38636
|
+
const workflowsSubCommand = sub[2];
|
|
38751
38637
|
switch (workflowsSubCommand) {
|
|
38752
38638
|
case "init":
|
|
38753
38639
|
await workflowsInit({
|
|
@@ -39096,7 +38982,8 @@ Available commands: ${pc58.cyan("setup")}, ${pc58.cyan("doctor")}
|
|
|
39096
38982
|
// Convenience alias: wraps push → wraps email templates push
|
|
39097
38983
|
case "push":
|
|
39098
38984
|
await templatesPush({
|
|
39099
|
-
|
|
38985
|
+
// `wraps push my-slug` is the same shortcut as above.
|
|
38986
|
+
template: sub[1] || flags.template,
|
|
39100
38987
|
dryRun: flags.dryRun,
|
|
39101
38988
|
force: flags.force,
|
|
39102
38989
|
yes: flags.yes,
|