@mailmodo/cli 0.0.49-beta.pr51.77 → 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.
- package/dist/commands/init/index.d.ts +1 -0
- package/dist/commands/init/index.js +9 -6
- package/dist/lib/base-command.d.ts +6 -3
- package/dist/lib/base-command.js +8 -5
- package/dist/lib/constants.d.ts +6 -0
- package/dist/lib/constants.js +6 -0
- package/oclif.manifest.json +98 -98
- package/package.json +1 -1
|
@@ -155,12 +155,7 @@ export default class Init extends BaseCommand {
|
|
|
155
155
|
},
|
|
156
156
|
};
|
|
157
157
|
await saveYaml(yamlConfig);
|
|
158
|
-
|
|
159
|
-
const monthlyCap = billingStatus?.cap?.inBlocks;
|
|
160
|
-
if (monthlyCap !== null && monthlyCap !== undefined) {
|
|
161
|
-
yamlConfig.project.monthlyCap = monthlyCap;
|
|
162
|
-
await saveYaml(yamlConfig);
|
|
163
|
-
}
|
|
158
|
+
await this.persistMonthlyCap(yamlConfig);
|
|
164
159
|
const templateSaves = analysisPayload.recommendedEmails.flatMap((rec, index) => {
|
|
165
160
|
const generated = generatedEmails[index];
|
|
166
161
|
const saves = [];
|
|
@@ -185,6 +180,14 @@ export default class Init extends BaseCommand {
|
|
|
185
180
|
this.log(` Created ${chalk.green('mailmodo.yaml')} + ${chalk.green(String(emailConfigs.length))} email templates in ${chalk.green('/mailmodo')}\n`);
|
|
186
181
|
this.log(` Run ${chalk.cyan("'mailmodo emails'")} to review.\n`);
|
|
187
182
|
}
|
|
183
|
+
async persistMonthlyCap(yamlConfig) {
|
|
184
|
+
const billingStatus = await this.fetchBillingStatus();
|
|
185
|
+
const monthlyCap = billingStatus?.cap?.inBlocks;
|
|
186
|
+
if (monthlyCap !== null && monthlyCap !== undefined) {
|
|
187
|
+
yamlConfig.project.monthlyCap = monthlyCap;
|
|
188
|
+
await saveYaml(yamlConfig);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
188
191
|
async confirmOverwriteIfNeeded(flags) {
|
|
189
192
|
const existing = await loadYaml();
|
|
190
193
|
if (!existing)
|
|
@@ -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
|
|
172
|
-
*
|
|
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
|
|
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
|
}
|
package/dist/lib/base-command.js
CHANGED
|
@@ -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
|
|
300
|
-
*
|
|
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
|
|
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 [
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -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";
|
package/dist/lib/constants.js
CHANGED
|
@@ -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
|
package/oclif.manifest.json
CHANGED
|
@@ -76,15 +76,14 @@
|
|
|
76
76
|
"index.js"
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"domain": {
|
|
80
80
|
"aliases": [],
|
|
81
81
|
"args": {},
|
|
82
|
-
"description": "
|
|
82
|
+
"description": "Set up and verify your sending domain",
|
|
83
83
|
"examples": [
|
|
84
|
-
"<%= config.bin %>
|
|
85
|
-
"<%= config.bin %>
|
|
86
|
-
"<%= config.bin %>
|
|
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
|
-
"
|
|
104
|
-
"description": "
|
|
105
|
-
"name": "
|
|
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
|
-
"
|
|
117
|
-
"description": "
|
|
118
|
-
"name": "
|
|
119
|
-
"
|
|
120
|
-
"
|
|
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": "
|
|
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
|
-
"
|
|
127
|
+
"domain",
|
|
137
128
|
"index.js"
|
|
138
129
|
]
|
|
139
130
|
},
|
|
@@ -176,14 +167,15 @@
|
|
|
176
167
|
"index.js"
|
|
177
168
|
]
|
|
178
169
|
},
|
|
179
|
-
"
|
|
170
|
+
"contacts": {
|
|
180
171
|
"aliases": [],
|
|
181
172
|
"args": {},
|
|
182
|
-
"description": "
|
|
173
|
+
"description": "Manage contacts — search, export, or delete",
|
|
183
174
|
"examples": [
|
|
184
|
-
"<%= config.bin %>
|
|
185
|
-
"<%= config.bin %>
|
|
186
|
-
"<%= config.bin %>
|
|
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
|
-
"
|
|
203
|
-
"description": "
|
|
204
|
-
"name": "
|
|
205
|
-
"
|
|
206
|
-
"
|
|
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
|
-
"
|
|
209
|
-
"description": "
|
|
210
|
-
"name": "
|
|
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": "
|
|
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
|
-
"
|
|
227
|
+
"contacts",
|
|
228
228
|
"index.js"
|
|
229
229
|
]
|
|
230
230
|
},
|
|
@@ -442,64 +442,6 @@
|
|
|
442
442
|
"index.js"
|
|
443
443
|
]
|
|
444
444
|
},
|
|
445
|
-
"preview": {
|
|
446
|
-
"aliases": [],
|
|
447
|
-
"args": {
|
|
448
|
-
"id": {
|
|
449
|
-
"description": "Email template ID to preview",
|
|
450
|
-
"name": "id"
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
"description": "Preview an email in browser, as text, or send a test",
|
|
454
|
-
"examples": [
|
|
455
|
-
"<%= config.bin %> preview welcome",
|
|
456
|
-
"<%= config.bin %> preview welcome --text",
|
|
457
|
-
"<%= config.bin %> preview welcome --send me@example.com"
|
|
458
|
-
],
|
|
459
|
-
"flags": {
|
|
460
|
-
"json": {
|
|
461
|
-
"description": "Output as JSON",
|
|
462
|
-
"name": "json",
|
|
463
|
-
"allowNo": false,
|
|
464
|
-
"type": "boolean"
|
|
465
|
-
},
|
|
466
|
-
"yes": {
|
|
467
|
-
"char": "y",
|
|
468
|
-
"description": "Skip confirmation prompts",
|
|
469
|
-
"name": "yes",
|
|
470
|
-
"allowNo": false,
|
|
471
|
-
"type": "boolean"
|
|
472
|
-
},
|
|
473
|
-
"send": {
|
|
474
|
-
"description": "Send test email to this address",
|
|
475
|
-
"name": "send",
|
|
476
|
-
"hasDynamicHelp": false,
|
|
477
|
-
"multiple": false,
|
|
478
|
-
"type": "option"
|
|
479
|
-
},
|
|
480
|
-
"text": {
|
|
481
|
-
"description": "Output plain text version (for AI agents)",
|
|
482
|
-
"name": "text",
|
|
483
|
-
"allowNo": false,
|
|
484
|
-
"type": "boolean"
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
"hasDynamicHelp": false,
|
|
488
|
-
"hiddenAliases": [],
|
|
489
|
-
"id": "preview",
|
|
490
|
-
"pluginAlias": "@mailmodo/cli",
|
|
491
|
-
"pluginName": "@mailmodo/cli",
|
|
492
|
-
"pluginType": "core",
|
|
493
|
-
"strict": true,
|
|
494
|
-
"enableJsonFlag": false,
|
|
495
|
-
"isESM": true,
|
|
496
|
-
"relativePath": [
|
|
497
|
-
"dist",
|
|
498
|
-
"commands",
|
|
499
|
-
"preview",
|
|
500
|
-
"index.js"
|
|
501
|
-
]
|
|
502
|
-
},
|
|
503
445
|
"logs": {
|
|
504
446
|
"aliases": [],
|
|
505
447
|
"args": {},
|
|
@@ -655,7 +597,65 @@
|
|
|
655
597
|
"status",
|
|
656
598
|
"index.js"
|
|
657
599
|
]
|
|
600
|
+
},
|
|
601
|
+
"preview": {
|
|
602
|
+
"aliases": [],
|
|
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",
|
|
610
|
+
"examples": [
|
|
611
|
+
"<%= config.bin %> preview welcome",
|
|
612
|
+
"<%= config.bin %> preview welcome --text",
|
|
613
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
614
|
+
],
|
|
615
|
+
"flags": {
|
|
616
|
+
"json": {
|
|
617
|
+
"description": "Output as JSON",
|
|
618
|
+
"name": "json",
|
|
619
|
+
"allowNo": false,
|
|
620
|
+
"type": "boolean"
|
|
621
|
+
},
|
|
622
|
+
"yes": {
|
|
623
|
+
"char": "y",
|
|
624
|
+
"description": "Skip confirmation prompts",
|
|
625
|
+
"name": "yes",
|
|
626
|
+
"allowNo": false,
|
|
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
|
+
}
|
|
642
|
+
},
|
|
643
|
+
"hasDynamicHelp": false,
|
|
644
|
+
"hiddenAliases": [],
|
|
645
|
+
"id": "preview",
|
|
646
|
+
"pluginAlias": "@mailmodo/cli",
|
|
647
|
+
"pluginName": "@mailmodo/cli",
|
|
648
|
+
"pluginType": "core",
|
|
649
|
+
"strict": true,
|
|
650
|
+
"enableJsonFlag": false,
|
|
651
|
+
"isESM": true,
|
|
652
|
+
"relativePath": [
|
|
653
|
+
"dist",
|
|
654
|
+
"commands",
|
|
655
|
+
"preview",
|
|
656
|
+
"index.js"
|
|
657
|
+
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.49-beta.pr51.
|
|
660
|
+
"version": "0.0.49-beta.pr51.79"
|
|
661
661
|
}
|
package/package.json
CHANGED