@mailmodo/cli 0.0.49-beta.pr51.78 → 0.0.49-beta.pr51.79

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.
@@ -168,12 +168,15 @@ export declare abstract class BaseCommand extends Command {
168
168
  value: string;
169
169
  }>, guideUrl: string | undefined, json: boolean): void;
170
170
  /**
171
- * Builds the terminal error string for a failed API call, appending request
172
- * metadata when {@link ApiRequestDebugInfo} is available.
171
+ * Builds the terminal error string for a failed API call. In production only
172
+ * the user-facing message is returned; verbose request diagnostics (URL,
173
+ * status, response body, error code) are appended only when [[IS_DEV_MODE]]
174
+ * is true so end users never see internal request metadata.
173
175
  *
174
176
  * @param {string} message - Primary error text (HTTP message or generic).
175
177
  * @param {{ status: number; debug?: ApiRequestDebugInfo }} response - Failed API response.
176
- * @returns {string} Message plus indented Request details for troubleshooting.
178
+ * @returns {string} Message alone in production, or message plus indented
179
+ * Request details when running in dev/debug mode.
177
180
  */
178
181
  private formatApiFailure;
179
182
  }
@@ -4,7 +4,7 @@ import chalk from 'chalk';
4
4
  import ora from 'ora';
5
5
  import { ApiClient } from './api-client.js';
6
6
  import { loadConfig } from './config.js';
7
- import { API_ENDPOINTS } from './constants.js';
7
+ import { API_ENDPOINTS, IS_DEV_MODE } from './constants.js';
8
8
  import { ERRORS, INFO, PROMPTS, quotaExhaustedMessage, recordLabel, VALIDATION, } from './messages.js';
9
9
  import { loadYaml, saveYaml } from './yaml-config.js';
10
10
  export const FREE_TIER = 'free';
@@ -296,16 +296,19 @@ export class BaseCommand extends Command {
296
296
  this.log(` Full guide: ${chalk.cyan(guideUrl)}\n`);
297
297
  }
298
298
  /**
299
- * Builds the terminal error string for a failed API call, appending request
300
- * metadata when {@link ApiRequestDebugInfo} is available.
299
+ * Builds the terminal error string for a failed API call. In production only
300
+ * the user-facing message is returned; verbose request diagnostics (URL,
301
+ * status, response body, error code) are appended only when [[IS_DEV_MODE]]
302
+ * is true so end users never see internal request metadata.
301
303
  *
302
304
  * @param {string} message - Primary error text (HTTP message or generic).
303
305
  * @param {{ status: number; debug?: ApiRequestDebugInfo }} response - Failed API response.
304
- * @returns {string} Message plus indented Request details for troubleshooting.
306
+ * @returns {string} Message alone in production, or message plus indented
307
+ * Request details when running in dev/debug mode.
305
308
  */
306
309
  formatApiFailure(message, response) {
307
310
  const { debug, status } = response;
308
- if (!debug) {
311
+ if (!IS_DEV_MODE || !debug) {
309
312
  return message;
310
313
  }
311
314
  return [
@@ -1,3 +1,9 @@
1
+ /**
2
+ * True when the CLI is running in a dev/debug context. Verbose request
3
+ * diagnostics (URL, status, response body, error code) are only surfaced
4
+ * when this is true so end users never see internal request metadata.
5
+ */
6
+ export declare const IS_DEV_MODE: boolean;
1
7
  export declare const API_BASE_URL = "https://app-vertex-debug.azurewebsites.net";
2
8
  export declare const API_ENDPOINTS: Readonly<{
3
9
  ANALYTICS: "/analytics";
@@ -1,5 +1,11 @@
1
1
  /** Set by `bin/dev.js` when running the CLI locally (tsx bootstrap). */
2
2
  const DEV_API_BASE_URL = 'https://app-vertex-debug.azurewebsites.net';
3
+ /**
4
+ * True when the CLI is running in a dev/debug context. Verbose request
5
+ * diagnostics (URL, status, response body, error code) are only surfaced
6
+ * when this is true so end users never see internal request metadata.
7
+ */
8
+ export const IS_DEV_MODE = Boolean(process.env.MAILMODO_DEV_TSX || process.env.MAILMODO_DEBUG);
3
9
  // const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.com';
4
10
  const PRODUCTION_API_BASE_URL = 'https://app-vertex-debug.azurewebsites.net';
5
11
  export const API_BASE_URL = process.env.MAILMODO_DEV_TSX
@@ -76,15 +76,14 @@
76
76
  "index.js"
77
77
  ]
78
78
  },
79
- "contacts": {
79
+ "domain": {
80
80
  "aliases": [],
81
81
  "args": {},
82
- "description": "Manage contacts search, export, or delete",
82
+ "description": "Set up and verify your sending domain",
83
83
  "examples": [
84
- "<%= config.bin %> contacts",
85
- "<%= config.bin %> contacts --search sarah@example.com",
86
- "<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
87
- "<%= config.bin %> contacts --delete sarah@example.com"
84
+ "<%= config.bin %> domain",
85
+ "<%= config.bin %> domain --verify",
86
+ "<%= config.bin %> domain --status"
88
87
  ],
89
88
  "flags": {
90
89
  "json": {
@@ -100,30 +99,22 @@
100
99
  "allowNo": false,
101
100
  "type": "boolean"
102
101
  },
103
- "delete": {
104
- "description": "GDPR hard delete a contact by email",
105
- "name": "delete",
106
- "hasDynamicHelp": false,
107
- "multiple": false,
108
- "type": "option"
109
- },
110
- "export": {
111
- "description": "Export all contacts as GDPR-compliant CSV (writes contacts.csv in the current directory)",
112
- "name": "export",
102
+ "status": {
103
+ "description": "Show domain health status",
104
+ "name": "status",
113
105
  "allowNo": false,
114
106
  "type": "boolean"
115
107
  },
116
- "search": {
117
- "description": "Search for a contact by email",
118
- "name": "search",
119
- "hasDynamicHelp": false,
120
- "multiple": false,
121
- "type": "option"
108
+ "verify": {
109
+ "description": "Verify DNS records",
110
+ "name": "verify",
111
+ "allowNo": false,
112
+ "type": "boolean"
122
113
  }
123
114
  },
124
115
  "hasDynamicHelp": false,
125
116
  "hiddenAliases": [],
126
- "id": "contacts",
117
+ "id": "domain",
127
118
  "pluginAlias": "@mailmodo/cli",
128
119
  "pluginName": "@mailmodo/cli",
129
120
  "pluginType": "core",
@@ -133,7 +124,7 @@
133
124
  "relativePath": [
134
125
  "dist",
135
126
  "commands",
136
- "contacts",
127
+ "domain",
137
128
  "index.js"
138
129
  ]
139
130
  },
@@ -176,14 +167,15 @@
176
167
  "index.js"
177
168
  ]
178
169
  },
179
- "domain": {
170
+ "contacts": {
180
171
  "aliases": [],
181
172
  "args": {},
182
- "description": "Set up and verify your sending domain",
173
+ "description": "Manage contacts search, export, or delete",
183
174
  "examples": [
184
- "<%= config.bin %> domain",
185
- "<%= config.bin %> domain --verify",
186
- "<%= config.bin %> domain --status"
175
+ "<%= config.bin %> contacts",
176
+ "<%= config.bin %> contacts --search sarah@example.com",
177
+ "<%= config.bin %> contacts --export # GDPR CSV → contacts.csv",
178
+ "<%= config.bin %> contacts --delete sarah@example.com"
187
179
  ],
188
180
  "flags": {
189
181
  "json": {
@@ -199,22 +191,30 @@
199
191
  "allowNo": false,
200
192
  "type": "boolean"
201
193
  },
202
- "status": {
203
- "description": "Show domain health status",
204
- "name": "status",
205
- "allowNo": false,
206
- "type": "boolean"
194
+ "delete": {
195
+ "description": "GDPR hard delete a contact by email",
196
+ "name": "delete",
197
+ "hasDynamicHelp": false,
198
+ "multiple": false,
199
+ "type": "option"
207
200
  },
208
- "verify": {
209
- "description": "Verify DNS records",
210
- "name": "verify",
201
+ "export": {
202
+ "description": "Export all contacts as GDPR-compliant CSV (writes contacts.csv in the current directory)",
203
+ "name": "export",
211
204
  "allowNo": false,
212
205
  "type": "boolean"
206
+ },
207
+ "search": {
208
+ "description": "Search for a contact by email",
209
+ "name": "search",
210
+ "hasDynamicHelp": false,
211
+ "multiple": false,
212
+ "type": "option"
213
213
  }
214
214
  },
215
215
  "hasDynamicHelp": false,
216
216
  "hiddenAliases": [],
217
- "id": "domain",
217
+ "id": "contacts",
218
218
  "pluginAlias": "@mailmodo/cli",
219
219
  "pluginName": "@mailmodo/cli",
220
220
  "pluginType": "core",
@@ -224,7 +224,7 @@
224
224
  "relativePath": [
225
225
  "dist",
226
226
  "commands",
227
- "domain",
227
+ "contacts",
228
228
  "index.js"
229
229
  ]
230
230
  },
@@ -365,6 +365,45 @@
365
365
  "index.js"
366
366
  ]
367
367
  },
368
+ "login": {
369
+ "aliases": [],
370
+ "args": {},
371
+ "description": "Authenticate with Mailmodo using your API key",
372
+ "examples": [
373
+ "<%= config.bin %> login",
374
+ "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
375
+ ],
376
+ "flags": {
377
+ "json": {
378
+ "description": "Output as JSON",
379
+ "name": "json",
380
+ "allowNo": false,
381
+ "type": "boolean"
382
+ },
383
+ "yes": {
384
+ "char": "y",
385
+ "description": "Skip confirmation prompts",
386
+ "name": "yes",
387
+ "allowNo": false,
388
+ "type": "boolean"
389
+ }
390
+ },
391
+ "hasDynamicHelp": false,
392
+ "hiddenAliases": [],
393
+ "id": "login",
394
+ "pluginAlias": "@mailmodo/cli",
395
+ "pluginName": "@mailmodo/cli",
396
+ "pluginType": "core",
397
+ "strict": true,
398
+ "enableJsonFlag": false,
399
+ "isESM": true,
400
+ "relativePath": [
401
+ "dist",
402
+ "commands",
403
+ "login",
404
+ "index.js"
405
+ ]
406
+ },
368
407
  "logout": {
369
408
  "aliases": [],
370
409
  "args": {},
@@ -473,64 +512,6 @@
473
512
  "index.js"
474
513
  ]
475
514
  },
476
- "preview": {
477
- "aliases": [],
478
- "args": {
479
- "id": {
480
- "description": "Email template ID to preview",
481
- "name": "id"
482
- }
483
- },
484
- "description": "Preview an email in browser, as text, or send a test",
485
- "examples": [
486
- "<%= config.bin %> preview welcome",
487
- "<%= config.bin %> preview welcome --text",
488
- "<%= config.bin %> preview welcome --send me@example.com"
489
- ],
490
- "flags": {
491
- "json": {
492
- "description": "Output as JSON",
493
- "name": "json",
494
- "allowNo": false,
495
- "type": "boolean"
496
- },
497
- "yes": {
498
- "char": "y",
499
- "description": "Skip confirmation prompts",
500
- "name": "yes",
501
- "allowNo": false,
502
- "type": "boolean"
503
- },
504
- "send": {
505
- "description": "Send test email to this address",
506
- "name": "send",
507
- "hasDynamicHelp": false,
508
- "multiple": false,
509
- "type": "option"
510
- },
511
- "text": {
512
- "description": "Output plain text version (for AI agents)",
513
- "name": "text",
514
- "allowNo": false,
515
- "type": "boolean"
516
- }
517
- },
518
- "hasDynamicHelp": false,
519
- "hiddenAliases": [],
520
- "id": "preview",
521
- "pluginAlias": "@mailmodo/cli",
522
- "pluginName": "@mailmodo/cli",
523
- "pluginType": "core",
524
- "strict": true,
525
- "enableJsonFlag": false,
526
- "isESM": true,
527
- "relativePath": [
528
- "dist",
529
- "commands",
530
- "preview",
531
- "index.js"
532
- ]
533
- },
534
515
  "settings": {
535
516
  "aliases": [],
536
517
  "args": {},
@@ -617,13 +598,19 @@
617
598
  "index.js"
618
599
  ]
619
600
  },
620
- "login": {
601
+ "preview": {
621
602
  "aliases": [],
622
- "args": {},
623
- "description": "Authenticate with Mailmodo using your API key",
603
+ "args": {
604
+ "id": {
605
+ "description": "Email template ID to preview",
606
+ "name": "id"
607
+ }
608
+ },
609
+ "description": "Preview an email in browser, as text, or send a test",
624
610
  "examples": [
625
- "<%= config.bin %> login",
626
- "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
611
+ "<%= config.bin %> preview welcome",
612
+ "<%= config.bin %> preview welcome --text",
613
+ "<%= config.bin %> preview welcome --send me@example.com"
627
614
  ],
628
615
  "flags": {
629
616
  "json": {
@@ -638,11 +625,24 @@
638
625
  "name": "yes",
639
626
  "allowNo": false,
640
627
  "type": "boolean"
628
+ },
629
+ "send": {
630
+ "description": "Send test email to this address",
631
+ "name": "send",
632
+ "hasDynamicHelp": false,
633
+ "multiple": false,
634
+ "type": "option"
635
+ },
636
+ "text": {
637
+ "description": "Output plain text version (for AI agents)",
638
+ "name": "text",
639
+ "allowNo": false,
640
+ "type": "boolean"
641
641
  }
642
642
  },
643
643
  "hasDynamicHelp": false,
644
644
  "hiddenAliases": [],
645
- "id": "login",
645
+ "id": "preview",
646
646
  "pluginAlias": "@mailmodo/cli",
647
647
  "pluginName": "@mailmodo/cli",
648
648
  "pluginType": "core",
@@ -652,10 +652,10 @@
652
652
  "relativePath": [
653
653
  "dist",
654
654
  "commands",
655
- "login",
655
+ "preview",
656
656
  "index.js"
657
657
  ]
658
658
  }
659
659
  },
660
- "version": "0.0.49-beta.pr51.78"
660
+ "version": "0.0.49-beta.pr51.79"
661
661
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mailmodo/cli",
3
3
  "description": "Email lifecycle automation for the AI-native builder generation.",
4
- "version": "0.0.49-beta.pr51.78",
4
+ "version": "0.0.49-beta.pr51.79",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"