@mailmodo/cli 0.0.31 → 0.0.32
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/billing/index.js +3 -2
- package/dist/commands/deploy/index.js +21 -21
- package/dist/commands/domain/index.d.ts +0 -2
- package/dist/commands/domain/index.js +28 -102
- package/dist/commands/login/index.js +3 -2
- package/dist/commands/preview/index.js +3 -2
- package/dist/commands/settings/index.d.ts +0 -7
- package/dist/commands/settings/index.js +8 -51
- package/dist/lib/base-command.d.ts +26 -0
- package/dist/lib/base-command.js +89 -6
- package/dist/lib/config.d.ts +0 -1
- package/dist/lib/messages.d.ts +36 -0
- package/dist/lib/messages.js +39 -0
- package/oclif.manifest.json +72 -72
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import open from 'open';
|
|
4
4
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
5
5
|
import { API_ENDPOINTS } from '../../lib/constants.js';
|
|
6
|
+
import { INFO } from '../../lib/messages.js';
|
|
6
7
|
export default class Billing extends BaseCommand {
|
|
7
8
|
static description = 'View billing status, purchase blocks, set cap, or add a payment method';
|
|
8
9
|
static examples = [
|
|
@@ -68,10 +69,10 @@ export default class Billing extends BaseCommand {
|
|
|
68
69
|
this.log(` ${chalk.dim(checkoutUrl)}\n`);
|
|
69
70
|
try {
|
|
70
71
|
await open(checkoutUrl);
|
|
71
|
-
this.log(`
|
|
72
|
+
this.log(` ${INFO.BROWSER_OPENING}\n`);
|
|
72
73
|
}
|
|
73
74
|
catch {
|
|
74
|
-
this.log(` ${
|
|
75
|
+
this.log(` ${INFO.BROWSER_OPEN_FAILED}\n`);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
async showStatus(jsonOutput) {
|
|
@@ -2,6 +2,7 @@ import { confirm, input } from '@inquirer/prompts';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
4
4
|
import { API_ENDPOINTS, DEFAULT_BRAND_COLOR, DEFAULT_MONTHLY_CAP, } from '../../lib/constants.js';
|
|
5
|
+
import { ERRORS, INFO, PROMPTS, SEPARATOR, VALIDATION, } from '../../lib/messages.js';
|
|
5
6
|
import { loadTemplate, saveYaml, } from '../../lib/yaml-config.js';
|
|
6
7
|
export default class Deploy extends BaseCommand {
|
|
7
8
|
static description = 'Deploy email sequences and verify sending domain';
|
|
@@ -50,10 +51,10 @@ export default class Deploy extends BaseCommand {
|
|
|
50
51
|
const response = await this.withApiSpinner({ json: flags.json, text: ' Validating sequence...' }, () => this.apiClient.post(API_ENDPOINTS.SEQUENCES_VALIDATE, payload));
|
|
51
52
|
if (!response.ok) {
|
|
52
53
|
if (response.data.error === 'senderDomainNotFound') {
|
|
53
|
-
this.error(
|
|
54
|
+
this.error(ERRORS.DOMAIN_NOT_REGISTERED);
|
|
54
55
|
}
|
|
55
56
|
if (response.data.error === 'senderDomainNotVerified') {
|
|
56
|
-
this.error(
|
|
57
|
+
this.error(ERRORS.DOMAIN_NOT_VERIFIED);
|
|
57
58
|
}
|
|
58
59
|
this.handleApiError(response);
|
|
59
60
|
}
|
|
@@ -148,10 +149,9 @@ export default class Deploy extends BaseCommand {
|
|
|
148
149
|
message: 'Set up your sending domain now?',
|
|
149
150
|
});
|
|
150
151
|
if (!setupNow) {
|
|
151
|
-
this.log(`\n
|
|
152
|
+
this.log(`\n ${INFO.SEQUENCES_NOT_DEPLOYED}`);
|
|
152
153
|
this.log(` Emails will not send until your domain is verified.`);
|
|
153
|
-
this.log(`
|
|
154
|
-
this.log(` Then: ${chalk.cyan('mailmodo deploy')}\n`);
|
|
154
|
+
this.log(` ${INFO.DOMAIN_NOT_DEPLOYED_HINT}\n`);
|
|
155
155
|
return false;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -194,9 +194,9 @@ export default class Deploy extends BaseCommand {
|
|
|
194
194
|
}
|
|
195
195
|
logDeploySuccessInstructions(sdkSnippet) {
|
|
196
196
|
this.log(` ${chalk.green('Deployed.')} Emails are live.\n`);
|
|
197
|
-
this.log(` ${
|
|
197
|
+
this.log(` ${SEPARATOR}`);
|
|
198
198
|
this.log(` ${chalk.bold('ADD THIS TO YOUR APP (one-time only):')}`);
|
|
199
|
-
this.log(` ${
|
|
199
|
+
this.log(` ${SEPARATOR}\n`);
|
|
200
200
|
this.log(` ${chalk.cyan(sdkSnippet.install ?? 'npm install @mailmodo/sdk')}\n`);
|
|
201
201
|
this.log(` ${chalk.dim("import { track, identify } from '@mailmodo/sdk'")}\n`);
|
|
202
202
|
if (sdkSnippet.examples) {
|
|
@@ -217,7 +217,7 @@ export default class Deploy extends BaseCommand {
|
|
|
217
217
|
if (identifyCalls.length > 0)
|
|
218
218
|
this.log('');
|
|
219
219
|
this.log(` Full SDK docs: ${chalk.cyan('mailmodo.com/docs/sdk')}\n`);
|
|
220
|
-
this.log(` ${
|
|
220
|
+
this.log(` ${SEPARATOR}\n`);
|
|
221
221
|
}
|
|
222
222
|
async runDomainSetup(yamlConfig, flags) {
|
|
223
223
|
const { address, domain, senderEmail } = await this.collectDomainInputs(yamlConfig, flags);
|
|
@@ -242,9 +242,8 @@ export default class Deploy extends BaseCommand {
|
|
|
242
242
|
message: "Press Enter once you've added the records, or 'skip' to do this later.",
|
|
243
243
|
});
|
|
244
244
|
if (action.toLowerCase() === 'skip') {
|
|
245
|
-
this.log(`\n
|
|
246
|
-
this.log(`
|
|
247
|
-
this.log(` Then: ${chalk.cyan('mailmodo deploy')}\n`);
|
|
245
|
+
this.log(`\n ${INFO.SEQUENCES_NOT_DEPLOYED}`);
|
|
246
|
+
this.log(` ${INFO.DOMAIN_NOT_DEPLOYED_HINT}\n`);
|
|
248
247
|
return false;
|
|
249
248
|
}
|
|
250
249
|
return this.verifyDomain(flags.json, domain);
|
|
@@ -257,20 +256,20 @@ export default class Deploy extends BaseCommand {
|
|
|
257
256
|
senderEmail: yamlConfig.project?.fromEmail || '',
|
|
258
257
|
};
|
|
259
258
|
}
|
|
260
|
-
this.log(`\n ${
|
|
259
|
+
this.log(`\n ${SEPARATOR}`);
|
|
261
260
|
this.log(` ${chalk.bold('DOMAIN SETUP')}`);
|
|
262
|
-
this.log(` ${
|
|
261
|
+
this.log(` ${SEPARATOR}\n`);
|
|
263
262
|
const domain = await input({
|
|
264
|
-
message:
|
|
265
|
-
validate: (v) => (v?.trim() ? true :
|
|
263
|
+
message: PROMPTS.DOMAIN,
|
|
264
|
+
validate: (v) => (v?.trim() ? true : VALIDATION.DOMAIN_REQUIRED),
|
|
266
265
|
});
|
|
267
266
|
const senderEmail = await input({
|
|
268
|
-
message:
|
|
269
|
-
validate: (v) => (v?.includes('@') ? true :
|
|
267
|
+
message: PROMPTS.SENDER_EMAIL,
|
|
268
|
+
validate: (v) => (v?.includes('@') ? true : VALIDATION.EMAIL_INVALID),
|
|
270
269
|
});
|
|
271
270
|
const address = await input({
|
|
272
|
-
message:
|
|
273
|
-
validate: (v) => (v?.trim() ? true :
|
|
271
|
+
message: PROMPTS.BUSINESS_ADDRESS,
|
|
272
|
+
validate: (v) => (v?.trim() ? true : VALIDATION.ADDRESS_REQUIRED),
|
|
274
273
|
});
|
|
275
274
|
return { address, domain, senderEmail };
|
|
276
275
|
}
|
|
@@ -284,7 +283,7 @@ export default class Deploy extends BaseCommand {
|
|
|
284
283
|
this.log(` Host: ${record.host}`);
|
|
285
284
|
this.log(` Value: ${record.value}\n`);
|
|
286
285
|
}
|
|
287
|
-
this.log(`
|
|
286
|
+
this.log(` ${INFO.DNS_PROPAGATION}`);
|
|
288
287
|
if (dnsGuideUrl)
|
|
289
288
|
this.log(` Full guide: ${chalk.cyan(dnsGuideUrl)}\n`);
|
|
290
289
|
}
|
|
@@ -305,7 +304,8 @@ export default class Deploy extends BaseCommand {
|
|
|
305
304
|
this.log(`\n ${chalk.green('Domain verified.')} Continuing deploy...\n`);
|
|
306
305
|
}
|
|
307
306
|
else {
|
|
308
|
-
this.log(`\n ${
|
|
307
|
+
this.log(`\n ${INFO.DNS_RECORDS_FAILED}`);
|
|
308
|
+
this.log(`\n ${INFO.DNS_FIX_AND_VERIFY}`);
|
|
309
309
|
if (dnsGuideUrl)
|
|
310
310
|
this.log(` Help: ${chalk.cyan(dnsGuideUrl)}\n`);
|
|
311
311
|
}
|
|
@@ -3,8 +3,7 @@ import { input } from '@inquirer/prompts';
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
5
5
|
import { API_ENDPOINTS } from '../../lib/constants.js';
|
|
6
|
-
import {
|
|
7
|
-
import { saveYaml } from '../../lib/yaml-config.js';
|
|
6
|
+
import { ERRORS, INFO, PROMPTS, SEPARATOR } from '../../lib/messages.js';
|
|
8
7
|
export default class Domain extends BaseCommand {
|
|
9
8
|
static description = 'Set up and verify your sending domain';
|
|
10
9
|
static examples = [
|
|
@@ -25,83 +24,57 @@ export default class Domain extends BaseCommand {
|
|
|
25
24
|
};
|
|
26
25
|
async run() {
|
|
27
26
|
const { flags } = await this.parse(Domain);
|
|
28
|
-
|
|
27
|
+
await this.ensureAuth();
|
|
29
28
|
if (flags.verify) {
|
|
30
|
-
await this.
|
|
29
|
+
const yamlConfig = await this.ensureYaml();
|
|
30
|
+
const domain = yamlConfig.project?.domain;
|
|
31
|
+
if (!domain) {
|
|
32
|
+
this.error(ERRORS.DOMAIN_NOT_CONFIGURED);
|
|
33
|
+
}
|
|
34
|
+
await this.verifyDomain(flags.json, domain);
|
|
31
35
|
return;
|
|
32
36
|
}
|
|
33
37
|
if (flags.status) {
|
|
34
|
-
await this.
|
|
38
|
+
const yamlConfig = await this.ensureYaml();
|
|
39
|
+
const domain = yamlConfig.project?.domain;
|
|
40
|
+
if (!domain) {
|
|
41
|
+
this.error(ERRORS.DOMAIN_NOT_CONFIGURED);
|
|
42
|
+
}
|
|
43
|
+
await this.showDomainStatus(flags.json, domain);
|
|
35
44
|
return;
|
|
36
45
|
}
|
|
37
|
-
await this.setupDomain(flags
|
|
46
|
+
await this.setupDomain(flags);
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* Interactive domain setup: collects domain, sender email, and business address,
|
|
41
50
|
* then calls the API to retrieve the required DNS records.
|
|
42
51
|
*/
|
|
43
|
-
async setupDomain(flags
|
|
52
|
+
async setupDomain(flags) {
|
|
44
53
|
const yamlConfig = await this.ensureYaml();
|
|
45
|
-
this.log(`\n ${
|
|
54
|
+
this.log(`\n ${SEPARATOR}`);
|
|
46
55
|
this.log(` ${chalk.bold('DOMAIN SETUP')}`);
|
|
47
|
-
this.log(` ${
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
address,
|
|
51
|
-
domain,
|
|
52
|
-
fromEmail: senderEmail,
|
|
53
|
-
};
|
|
54
|
-
if (fromName)
|
|
55
|
-
apiPayload.fromName = fromName;
|
|
56
|
-
if (replyTo)
|
|
57
|
-
apiPayload.replyTo = replyTo;
|
|
58
|
-
const response = await this.withApiSpinner({ json: flags.json, text: ' Configuring domain...' }, () => this.apiClient.post(API_ENDPOINTS.DOMAIN, apiPayload));
|
|
59
|
-
if (!response.ok) {
|
|
60
|
-
this.handleApiError(response);
|
|
61
|
-
}
|
|
62
|
-
yamlConfig.project.domain = domain;
|
|
63
|
-
yamlConfig.project.fromEmail = senderEmail;
|
|
64
|
-
yamlConfig.project.address = address;
|
|
65
|
-
if (fromName)
|
|
66
|
-
yamlConfig.project.fromName = fromName;
|
|
67
|
-
if (replyTo)
|
|
68
|
-
yamlConfig.project.replyTo = replyTo;
|
|
69
|
-
await saveYaml(yamlConfig);
|
|
70
|
-
await saveConfig({ ...config, domain });
|
|
71
|
-
const records = response.data?.dnsRecords || [];
|
|
72
|
-
const guideUrl = response.data?.dnsGuideUrl;
|
|
56
|
+
this.log(` ${SEPARATOR}\n`);
|
|
57
|
+
const inputs = await this.collectDomainSetupInputs(yamlConfig, flags.yes);
|
|
58
|
+
const { dnsRecords, dnsGuideUrl } = await this.registerDomain(yamlConfig, inputs, flags.json);
|
|
73
59
|
if (flags.json) {
|
|
74
|
-
this.log(JSON.stringify({ dnsRecords
|
|
60
|
+
this.log(JSON.stringify({ dnsRecords, domain: inputs.domain }, null, 2));
|
|
75
61
|
return;
|
|
76
62
|
}
|
|
77
|
-
this.
|
|
78
|
-
for (const [i, record] of records.entries()) {
|
|
79
|
-
this.log(` ${chalk.bold(`RECORD ${i + 1} — ${this.recordLabel(i)}`)}`);
|
|
80
|
-
this.log(` Type: ${record.type}`);
|
|
81
|
-
this.log(` Host: ${record.host}`);
|
|
82
|
-
this.log(` Value: ${record.value}\n`);
|
|
83
|
-
}
|
|
84
|
-
this.log(` DNS changes take 5–30 minutes to propagate.`);
|
|
85
|
-
if (guideUrl)
|
|
86
|
-
this.log(` Full guide: ${chalk.cyan(guideUrl)}\n`);
|
|
63
|
+
this.logDnsRecords(dnsRecords, dnsGuideUrl, flags.json);
|
|
87
64
|
if (!flags.yes) {
|
|
88
65
|
const action = await input({
|
|
89
66
|
default: '',
|
|
90
|
-
message:
|
|
67
|
+
message: PROMPTS.ENTER_AFTER_RECORDS,
|
|
91
68
|
});
|
|
92
69
|
if (action.toLowerCase() !== 'skip') {
|
|
93
|
-
await this.verifyDomain(false,
|
|
70
|
+
await this.verifyDomain(false, inputs.domain);
|
|
94
71
|
}
|
|
95
72
|
}
|
|
96
73
|
}
|
|
97
74
|
/**
|
|
98
75
|
* Calls the domain verification API and displays pass/fail for each DNS record.
|
|
99
76
|
*/
|
|
100
|
-
async verifyDomain(jsonOutput,
|
|
101
|
-
if (!config.domain) {
|
|
102
|
-
this.error(`No domain configured. Run ${chalk.cyan('mailmodo domain')} to set up your sending domain.`);
|
|
103
|
-
}
|
|
104
|
-
const domain = config.domain;
|
|
77
|
+
async verifyDomain(jsonOutput, domain) {
|
|
105
78
|
const response = await this.withApiSpinner({ json: jsonOutput, text: ' Checking DNS...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_VERIFY, {
|
|
106
79
|
domain,
|
|
107
80
|
}));
|
|
@@ -121,7 +94,7 @@ export default class Domain extends BaseCommand {
|
|
|
121
94
|
this.log(`\n ${chalk.green('✓')} Domain verified.\n`);
|
|
122
95
|
}
|
|
123
96
|
else {
|
|
124
|
-
this.log(`\n ${
|
|
97
|
+
this.log(`\n ${INFO.DNS_RECORDS_FAILED}`);
|
|
125
98
|
if (!dkim) {
|
|
126
99
|
this.log(`\n DKIM common mistakes:`);
|
|
127
100
|
this.log(` - Using TXT instead of CNAME record type`);
|
|
@@ -133,7 +106,7 @@ export default class Domain extends BaseCommand {
|
|
|
133
106
|
this.log(` - Missing or incorrect CNAME for mm-bounce subdomain`);
|
|
134
107
|
this.log(` - Cloudflare: proxy must be OFF (grey cloud, not orange)`);
|
|
135
108
|
}
|
|
136
|
-
this.log(`\n
|
|
109
|
+
this.log(`\n ${INFO.DNS_FIX_AND_VERIFY}`);
|
|
137
110
|
if (dnsGuideUrl)
|
|
138
111
|
this.log(` Help: ${chalk.cyan(dnsGuideUrl)}\n`);
|
|
139
112
|
}
|
|
@@ -142,11 +115,7 @@ export default class Domain extends BaseCommand {
|
|
|
142
115
|
* Displays domain health metrics including verification status,
|
|
143
116
|
* bounce rate, and spam complaint rate.
|
|
144
117
|
*/
|
|
145
|
-
async showDomainStatus(jsonOutput,
|
|
146
|
-
if (!config.domain) {
|
|
147
|
-
this.error(`No domain configured. Run ${chalk.cyan('mailmodo domain')} to set up your sending domain.`);
|
|
148
|
-
}
|
|
149
|
-
const domain = config.domain;
|
|
118
|
+
async showDomainStatus(jsonOutput, domain) {
|
|
150
119
|
const response = await this.withApiSpinner({ json: jsonOutput, text: ' Loading domain status...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_STATUS, {
|
|
151
120
|
domain,
|
|
152
121
|
}));
|
|
@@ -163,47 +132,4 @@ export default class Domain extends BaseCommand {
|
|
|
163
132
|
this.log(` Bounce rate: ${data.bounceRate ?? 'N/A'}%`);
|
|
164
133
|
this.log(` Spam rate: ${data.spamRate ?? 'N/A'}%\n`);
|
|
165
134
|
}
|
|
166
|
-
async collectDomainInputs(skipPrompts, yamlConfig) {
|
|
167
|
-
if (skipPrompts) {
|
|
168
|
-
const domain = yamlConfig.project?.domain || '';
|
|
169
|
-
if (!domain) {
|
|
170
|
-
this.error('Domain is required. Set it in mailmodo.yaml or use interactive mode.');
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
address: yamlConfig.project?.address || '',
|
|
174
|
-
domain,
|
|
175
|
-
fromName: yamlConfig.project?.fromName || '',
|
|
176
|
-
replyTo: yamlConfig.project?.replyTo || '',
|
|
177
|
-
senderEmail: yamlConfig.project?.fromEmail || '',
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
const domain = await input({
|
|
181
|
-
default: yamlConfig.project?.domain,
|
|
182
|
-
message: 'What domain will you send from?',
|
|
183
|
-
validate: (v) => (v?.trim() ? true : 'Domain is required'),
|
|
184
|
-
});
|
|
185
|
-
const senderEmail = await input({
|
|
186
|
-
default: yamlConfig.project?.fromEmail,
|
|
187
|
-
message: 'Sender email address:',
|
|
188
|
-
validate: (v) => (v?.includes('@') ? true : 'Please enter a valid email'),
|
|
189
|
-
});
|
|
190
|
-
const fromName = await input({
|
|
191
|
-
default: yamlConfig.project?.fromName || '',
|
|
192
|
-
message: 'Display name (optional, shown as sender name):',
|
|
193
|
-
});
|
|
194
|
-
const replyTo = await input({
|
|
195
|
-
default: yamlConfig.project?.replyTo || '',
|
|
196
|
-
message: 'Reply-to address (optional, press Enter to use sender email):',
|
|
197
|
-
});
|
|
198
|
-
const address = await input({
|
|
199
|
-
default: yamlConfig.project?.address,
|
|
200
|
-
message: 'Business address (required by law):',
|
|
201
|
-
validate: (v) => (v?.trim() ? true : 'Address is required'),
|
|
202
|
-
});
|
|
203
|
-
return { address, domain, fromName, replyTo, senderEmail };
|
|
204
|
-
}
|
|
205
|
-
recordLabel(index) {
|
|
206
|
-
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
|
207
|
-
return labels[index] || `Record ${index + 1}`;
|
|
208
|
-
}
|
|
209
135
|
}
|
|
@@ -5,6 +5,7 @@ import { BaseCommand } from '../../lib/base-command.js';
|
|
|
5
5
|
import { ApiClient } from '../../lib/api-client.js';
|
|
6
6
|
import { loadConfig, saveConfig } from '../../lib/config.js';
|
|
7
7
|
import { API_ENDPOINTS, LOGIN_URL } from '../../lib/constants.js';
|
|
8
|
+
import { INFO } from '../../lib/messages.js';
|
|
8
9
|
export default class Login extends BaseCommand {
|
|
9
10
|
static description = 'Authenticate with Mailmodo using your API key';
|
|
10
11
|
static examples = [
|
|
@@ -47,10 +48,10 @@ export default class Login extends BaseCommand {
|
|
|
47
48
|
this.log(`\n Get your free API key at: ${chalk.cyan(LOGIN_URL)}\n`);
|
|
48
49
|
try {
|
|
49
50
|
await open(LOGIN_URL);
|
|
50
|
-
this.log(
|
|
51
|
+
this.log(` ${INFO.BROWSER_OPENING}\n`);
|
|
51
52
|
}
|
|
52
53
|
catch {
|
|
53
|
-
this.log(` ${
|
|
54
|
+
this.log(` ${INFO.BROWSER_OPEN_FAILED}\n`);
|
|
54
55
|
}
|
|
55
56
|
apiKey = await input({
|
|
56
57
|
message: 'Paste your API key:',
|
|
@@ -4,6 +4,7 @@ import chalk from 'chalk';
|
|
|
4
4
|
import open from 'open';
|
|
5
5
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
6
6
|
import { API_ENDPOINTS, PREVIEW_PORT } from '../../lib/constants.js';
|
|
7
|
+
import { INFO } from '../../lib/messages.js';
|
|
7
8
|
import { loadTemplate, getEmailStyle, getTemplateFilename, } from '../../lib/yaml-config.js';
|
|
8
9
|
/* eslint-disable camelcase */
|
|
9
10
|
const SAMPLE_DATA = Object.freeze({
|
|
@@ -238,7 +239,7 @@ export default class Preview extends BaseCommand {
|
|
|
238
239
|
if (!jsonOutput) {
|
|
239
240
|
this.log(`\n Style: ${chalk.cyan(effectiveStyle)}`);
|
|
240
241
|
this.log(` Preview server at ${chalk.cyan(url)}`);
|
|
241
|
-
this.log(`
|
|
242
|
+
this.log(` ${INFO.BROWSER_OPENING}\n`);
|
|
242
243
|
this.log(` ${chalk.dim('Press Ctrl+C to stop the preview server.')}\n`);
|
|
243
244
|
}
|
|
244
245
|
try {
|
|
@@ -246,7 +247,7 @@ export default class Preview extends BaseCommand {
|
|
|
246
247
|
}
|
|
247
248
|
catch {
|
|
248
249
|
if (!jsonOutput) {
|
|
249
|
-
this.log(` ${
|
|
250
|
+
this.log(` ${INFO.BROWSER_OPEN_FAILED}`);
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
253
|
await new Promise((resolve) => {
|
|
@@ -20,14 +20,7 @@ export default class Settings extends BaseCommand {
|
|
|
20
20
|
* Returns true/false for verified/unverified, or null if unavailable.
|
|
21
21
|
*/
|
|
22
22
|
private fetchDomainVerified;
|
|
23
|
-
/**
|
|
24
|
-
* Handles domain change: collects the new domain, sender email, and
|
|
25
|
-
* business address, calls the API to register them, displays the required
|
|
26
|
-
* DNS records, and saves the updated config. Emails won't send until the
|
|
27
|
-
* domain is re-verified.
|
|
28
|
-
*/
|
|
29
23
|
private handleDomainChange;
|
|
30
|
-
private recordLabel;
|
|
31
24
|
/**
|
|
32
25
|
* Handles the logo file upload flow: validates the local file exists,
|
|
33
26
|
* reads it, uploads to Mailmodo CDN via API, and updates both logoFile
|
|
@@ -6,6 +6,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
6
6
|
import { resolve } from 'node:path';
|
|
7
7
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
8
8
|
import { API_ENDPOINTS } from '../../lib/constants.js';
|
|
9
|
+
import { INFO } from '../../lib/messages.js';
|
|
9
10
|
import { saveYaml } from '../../lib/yaml-config.js';
|
|
10
11
|
const SETTINGS_GROUPS = Object.freeze({
|
|
11
12
|
billing: ['monthly_cap'],
|
|
@@ -80,7 +81,7 @@ export default class Settings extends BaseCommand {
|
|
|
80
81
|
return;
|
|
81
82
|
}
|
|
82
83
|
this.log(`\n ${chalk.green('✓')} ${key} updated to ${chalk.cyan(value)}`);
|
|
83
|
-
this.log(`
|
|
84
|
+
this.log(` ${INFO.DEPLOY_TO_APPLY}\n`);
|
|
84
85
|
}
|
|
85
86
|
displaySettingsGroup(group, keys, project, domainVerified) {
|
|
86
87
|
const availableKeys = keys.filter((key) => {
|
|
@@ -169,7 +170,7 @@ export default class Settings extends BaseCommand {
|
|
|
169
170
|
project.emailStyle = style;
|
|
170
171
|
await saveYaml(yamlConfig);
|
|
171
172
|
this.log(`\n ${chalk.green('✓')} email_style updated to ${chalk.cyan(style)}`);
|
|
172
|
-
this.log(`
|
|
173
|
+
this.log(` ${INFO.DEPLOY_TO_APPLY}\n`);
|
|
173
174
|
return;
|
|
174
175
|
}
|
|
175
176
|
const newValue = await input({
|
|
@@ -178,7 +179,7 @@ export default class Settings extends BaseCommand {
|
|
|
178
179
|
project[editPropKey] =
|
|
179
180
|
editPropKey === 'monthlyCap' ? Number(newValue) : newValue;
|
|
180
181
|
await saveYaml(yamlConfig);
|
|
181
|
-
this.log(`\n ${chalk.green('✓')} Updated.
|
|
182
|
+
this.log(`\n ${chalk.green('✓')} Updated. ${INFO.DEPLOY_TO_APPLY}\n`);
|
|
182
183
|
}
|
|
183
184
|
/**
|
|
184
185
|
* Fetches the domain verification status from the API.
|
|
@@ -201,58 +202,14 @@ export default class Settings extends BaseCommand {
|
|
|
201
202
|
return null;
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
|
-
/**
|
|
205
|
-
* Handles domain change: collects the new domain, sender email, and
|
|
206
|
-
* business address, calls the API to register them, displays the required
|
|
207
|
-
* DNS records, and saves the updated config. Emails won't send until the
|
|
208
|
-
* domain is re-verified.
|
|
209
|
-
*/
|
|
210
205
|
async handleDomainChange(yamlConfig) {
|
|
211
|
-
const newDomain = await input({
|
|
212
|
-
message: 'New domain:',
|
|
213
|
-
validate: (v) => (v?.trim() ? true : 'Domain is required'),
|
|
214
|
-
});
|
|
215
|
-
const newFromEmail = await input({
|
|
216
|
-
default: yamlConfig.project.fromEmail || '',
|
|
217
|
-
message: 'Sender email (from address):',
|
|
218
|
-
validate: (v) => (v?.includes('@') ? true : 'Please enter a valid email'),
|
|
219
|
-
});
|
|
220
|
-
const newAddress = await input({
|
|
221
|
-
default: yamlConfig.project.address || '',
|
|
222
|
-
message: 'Business address (required by law):',
|
|
223
|
-
validate: (v) => (v?.trim() ? true : 'Address is required'),
|
|
224
|
-
});
|
|
225
206
|
await this.ensureAuth();
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
});
|
|
231
|
-
if (!response.ok) {
|
|
232
|
-
this.handleApiError(response);
|
|
233
|
-
}
|
|
234
|
-
const records = response.data?.dnsRecords || [];
|
|
235
|
-
const dnsGuideUrl = response.data?.dnsGuideUrl;
|
|
236
|
-
yamlConfig.project.domain = newDomain;
|
|
237
|
-
yamlConfig.project.fromEmail = newFromEmail;
|
|
238
|
-
yamlConfig.project.address = newAddress;
|
|
239
|
-
await saveYaml(yamlConfig);
|
|
240
|
-
this.log(`\n Domain, sender email, and business address updated. You will need to re-verify.`);
|
|
241
|
-
this.log(` New DNS records:\n`);
|
|
242
|
-
for (const [i, record] of records.entries()) {
|
|
243
|
-
this.log(` ${chalk.bold(`RECORD ${i + 1} — ${this.recordLabel(i)}`)}`);
|
|
244
|
-
this.log(` Type: ${record.type}`);
|
|
245
|
-
this.log(` Host: ${record.host}`);
|
|
246
|
-
this.log(` Value: ${record.value}\n`);
|
|
247
|
-
}
|
|
207
|
+
const inputs = await this.collectDomainSetupInputs(yamlConfig, false);
|
|
208
|
+
const { dnsRecords, dnsGuideUrl } = await this.registerDomain(yamlConfig, inputs, false);
|
|
209
|
+
this.log(`\n Domain and sender details updated. You will need to re-verify.`);
|
|
210
|
+
this.logDnsRecords(dnsRecords, dnsGuideUrl, false);
|
|
248
211
|
this.log(` Run ${chalk.cyan("'mailmodo domain --verify'")} once records are added.`);
|
|
249
212
|
this.log(` Emails will not send until the new domain is verified.`);
|
|
250
|
-
if (dnsGuideUrl)
|
|
251
|
-
this.log(` Help: ${chalk.cyan(dnsGuideUrl)}\n`);
|
|
252
|
-
}
|
|
253
|
-
recordLabel(index) {
|
|
254
|
-
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
|
255
|
-
return labels[index] || `Record ${index + 1}`;
|
|
256
213
|
}
|
|
257
214
|
/**
|
|
258
215
|
* Handles the logo file upload flow: validates the local file exists,
|
|
@@ -61,6 +61,32 @@ export declare abstract class BaseCommand extends Command {
|
|
|
61
61
|
error?: string;
|
|
62
62
|
status: number;
|
|
63
63
|
}): never;
|
|
64
|
+
protected collectDomainSetupInputs(yamlConfig: MailmodoYaml, skipPrompts: boolean): Promise<{
|
|
65
|
+
address: string;
|
|
66
|
+
domain: string;
|
|
67
|
+
fromEmail: string;
|
|
68
|
+
fromName: string;
|
|
69
|
+
replyTo: string;
|
|
70
|
+
}>;
|
|
71
|
+
protected registerDomain(yamlConfig: MailmodoYaml, inputs: {
|
|
72
|
+
address: string;
|
|
73
|
+
domain: string;
|
|
74
|
+
fromEmail: string;
|
|
75
|
+
fromName?: string;
|
|
76
|
+
replyTo?: string;
|
|
77
|
+
}, json: boolean): Promise<{
|
|
78
|
+
dnsGuideUrl?: string;
|
|
79
|
+
dnsRecords: Array<{
|
|
80
|
+
host: string;
|
|
81
|
+
type: string;
|
|
82
|
+
value: string;
|
|
83
|
+
}>;
|
|
84
|
+
}>;
|
|
85
|
+
protected logDnsRecords(records: Array<{
|
|
86
|
+
host: string;
|
|
87
|
+
type: string;
|
|
88
|
+
value: string;
|
|
89
|
+
}>, guideUrl: string | undefined, json: boolean): void;
|
|
64
90
|
/**
|
|
65
91
|
* Builds the terminal error string for a failed API call, appending request
|
|
66
92
|
* metadata when {@link ApiRequestDebugInfo} is available.
|
package/dist/lib/base-command.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { input } from '@inquirer/prompts';
|
|
1
2
|
import { Command, Flags } from '@oclif/core';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import ora from 'ora';
|
|
4
5
|
import { ApiClient } from './api-client.js';
|
|
5
6
|
import { loadConfig } from './config.js';
|
|
6
|
-
import {
|
|
7
|
+
import { API_ENDPOINTS } from './constants.js';
|
|
8
|
+
import { ERRORS, INFO, PROMPTS, recordLabel, VALIDATION } from './messages.js';
|
|
9
|
+
import { loadYaml, saveYaml } from './yaml-config.js';
|
|
7
10
|
/**
|
|
8
11
|
* Abstract base command providing shared functionality for all Mailmodo CLI commands.
|
|
9
12
|
* Subclasses inherit --json and --yes base flags, authentication enforcement,
|
|
@@ -35,7 +38,7 @@ export class BaseCommand extends Command {
|
|
|
35
38
|
}
|
|
36
39
|
const config = await loadConfig();
|
|
37
40
|
if (!config?.apiKey) {
|
|
38
|
-
this.error(
|
|
41
|
+
this.error(ERRORS.NOT_LOGGED_IN);
|
|
39
42
|
}
|
|
40
43
|
this.apiClient = new ApiClient(config.apiKey);
|
|
41
44
|
return config;
|
|
@@ -80,7 +83,7 @@ export class BaseCommand extends Command {
|
|
|
80
83
|
async ensureYaml() {
|
|
81
84
|
const config = await loadYaml();
|
|
82
85
|
if (!config) {
|
|
83
|
-
this.error(
|
|
86
|
+
this.error(ERRORS.NO_YAML);
|
|
84
87
|
}
|
|
85
88
|
return config;
|
|
86
89
|
}
|
|
@@ -96,12 +99,92 @@ export class BaseCommand extends Command {
|
|
|
96
99
|
*/
|
|
97
100
|
handleApiError(response) {
|
|
98
101
|
if (response.status === 401) {
|
|
99
|
-
this.error(this.formatApiFailure(
|
|
102
|
+
this.error(this.formatApiFailure(ERRORS.INVALID_API_KEY, response));
|
|
100
103
|
}
|
|
101
104
|
if (response.status === 429) {
|
|
102
|
-
this.error(this.formatApiFailure(
|
|
105
|
+
this.error(this.formatApiFailure(ERRORS.RATE_LIMIT, response));
|
|
103
106
|
}
|
|
104
|
-
this.error(this.formatApiFailure(response.error ||
|
|
107
|
+
this.error(this.formatApiFailure(response.error || ERRORS.UNEXPECTED_API, response));
|
|
108
|
+
}
|
|
109
|
+
async collectDomainSetupInputs(yamlConfig, skipPrompts) {
|
|
110
|
+
if (skipPrompts) {
|
|
111
|
+
const domain = yamlConfig.project?.domain || '';
|
|
112
|
+
if (!domain) {
|
|
113
|
+
this.error('Domain is required. Set it in mailmodo.yaml or use interactive mode.');
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
address: yamlConfig.project?.address || '',
|
|
117
|
+
domain,
|
|
118
|
+
fromEmail: yamlConfig.project?.fromEmail || '',
|
|
119
|
+
fromName: yamlConfig.project?.fromName || '',
|
|
120
|
+
replyTo: yamlConfig.project?.replyTo || '',
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const domain = await input({
|
|
124
|
+
default: yamlConfig.project?.domain,
|
|
125
|
+
message: PROMPTS.DOMAIN,
|
|
126
|
+
validate: (v) => (v?.trim() ? true : VALIDATION.DOMAIN_REQUIRED),
|
|
127
|
+
});
|
|
128
|
+
const fromEmail = await input({
|
|
129
|
+
default: yamlConfig.project?.fromEmail,
|
|
130
|
+
message: PROMPTS.SENDER_EMAIL,
|
|
131
|
+
validate: (v) => (v?.includes('@') ? true : VALIDATION.EMAIL_INVALID),
|
|
132
|
+
});
|
|
133
|
+
const fromName = await input({
|
|
134
|
+
default: yamlConfig.project?.fromName || '',
|
|
135
|
+
message: PROMPTS.FROM_NAME,
|
|
136
|
+
});
|
|
137
|
+
const replyTo = await input({
|
|
138
|
+
default: yamlConfig.project?.replyTo || '',
|
|
139
|
+
message: PROMPTS.REPLY_TO,
|
|
140
|
+
});
|
|
141
|
+
const address = await input({
|
|
142
|
+
default: yamlConfig.project?.address,
|
|
143
|
+
message: PROMPTS.BUSINESS_ADDRESS,
|
|
144
|
+
validate: (v) => (v?.trim() ? true : VALIDATION.ADDRESS_REQUIRED),
|
|
145
|
+
});
|
|
146
|
+
return { address, domain, fromEmail, fromName, replyTo };
|
|
147
|
+
}
|
|
148
|
+
async registerDomain(yamlConfig, inputs, json) {
|
|
149
|
+
const apiPayload = {
|
|
150
|
+
address: inputs.address,
|
|
151
|
+
domain: inputs.domain,
|
|
152
|
+
fromEmail: inputs.fromEmail,
|
|
153
|
+
};
|
|
154
|
+
if (inputs.fromName)
|
|
155
|
+
apiPayload.fromName = inputs.fromName;
|
|
156
|
+
if (inputs.replyTo)
|
|
157
|
+
apiPayload.replyTo = inputs.replyTo;
|
|
158
|
+
const response = await this.withApiSpinner({ json, text: ' Configuring domain...' }, () => this.apiClient.post(API_ENDPOINTS.DOMAIN, apiPayload));
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
this.handleApiError(response);
|
|
161
|
+
}
|
|
162
|
+
yamlConfig.project.domain = inputs.domain;
|
|
163
|
+
yamlConfig.project.fromEmail = inputs.fromEmail;
|
|
164
|
+
yamlConfig.project.address = inputs.address;
|
|
165
|
+
if (inputs.fromName)
|
|
166
|
+
yamlConfig.project.fromName = inputs.fromName;
|
|
167
|
+
if (inputs.replyTo)
|
|
168
|
+
yamlConfig.project.replyTo = inputs.replyTo;
|
|
169
|
+
await saveYaml(yamlConfig);
|
|
170
|
+
return {
|
|
171
|
+
dnsGuideUrl: response.data?.dnsGuideUrl,
|
|
172
|
+
dnsRecords: response.data?.dnsRecords || [],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
logDnsRecords(records, guideUrl, json) {
|
|
176
|
+
if (json)
|
|
177
|
+
return;
|
|
178
|
+
this.log(`\n Add these ${records.length} DNS records to your domain provider:\n`);
|
|
179
|
+
for (const [i, record] of records.entries()) {
|
|
180
|
+
this.log(` ${chalk.bold(`RECORD ${i + 1} — ${recordLabel(i)}`)}`);
|
|
181
|
+
this.log(` Type: ${record.type}`);
|
|
182
|
+
this.log(` Host: ${record.host}`);
|
|
183
|
+
this.log(` Value: ${record.value}\n`);
|
|
184
|
+
}
|
|
185
|
+
this.log(` ${INFO.DNS_PROPAGATION}`);
|
|
186
|
+
if (guideUrl)
|
|
187
|
+
this.log(` Full guide: ${chalk.cyan(guideUrl)}\n`);
|
|
105
188
|
}
|
|
106
189
|
/**
|
|
107
190
|
* Builds the terminal error string for a failed API call, appending request
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const SEPARATOR: string;
|
|
2
|
+
export declare const VALIDATION: {
|
|
3
|
+
readonly ADDRESS_REQUIRED: "Address is required";
|
|
4
|
+
readonly DOMAIN_REQUIRED: "Domain is required";
|
|
5
|
+
readonly EMAIL_INVALID: "Please enter a valid email";
|
|
6
|
+
};
|
|
7
|
+
export declare const PROMPTS: {
|
|
8
|
+
readonly BUSINESS_ADDRESS: "Business address (required by law):";
|
|
9
|
+
readonly DOMAIN: "What domain will you send from?";
|
|
10
|
+
readonly ENTER_AFTER_RECORDS: "Press Enter once you've added the records, or 'skip'.";
|
|
11
|
+
readonly FROM_NAME: "Display name (optional, shown as sender name):";
|
|
12
|
+
readonly REPLY_TO: "Reply-to address (optional, press Enter to use sender email):";
|
|
13
|
+
readonly SENDER_EMAIL: "Sender email address:";
|
|
14
|
+
};
|
|
15
|
+
export declare const ERRORS: {
|
|
16
|
+
readonly DOMAIN_NOT_CONFIGURED: `No domain configured. Run ${string} to set up your sending domain.`;
|
|
17
|
+
readonly DOMAIN_NOT_REGISTERED: `Sending domain not registered. Run: ${string}`;
|
|
18
|
+
readonly DOMAIN_NOT_VERIFIED: `Sending domain not verified. Run: ${string}`;
|
|
19
|
+
readonly INVALID_API_KEY: `Invalid API key. Run ${string} to re-authenticate.`;
|
|
20
|
+
readonly NOT_LOGGED_IN: `Not logged in. Run ${string} to authenticate.`;
|
|
21
|
+
readonly NO_YAML: `No mailmodo.yaml found. Run ${string} first.`;
|
|
22
|
+
readonly RATE_LIMIT: "Rate limit exceeded. Please try again later.";
|
|
23
|
+
readonly UNEXPECTED_API: "An unexpected API error occurred.";
|
|
24
|
+
};
|
|
25
|
+
export declare const INFO: {
|
|
26
|
+
readonly BROWSER_OPEN_FAILED: string;
|
|
27
|
+
readonly BROWSER_OPENING: "Opening in browser...";
|
|
28
|
+
readonly DEPLOY_TO_APPLY: `Run ${string} to apply.`;
|
|
29
|
+
readonly DNS_FIX_AND_VERIFY: `Fix the records and run ${string} again.`;
|
|
30
|
+
readonly DNS_PROPAGATION: "DNS changes take 5–30 minutes to propagate.";
|
|
31
|
+
readonly DNS_RECORDS_FAILED: string;
|
|
32
|
+
readonly DOMAIN_NOT_DEPLOYED_HINT: `When ready, run: ${string}
|
|
33
|
+
Then: ${string}`;
|
|
34
|
+
readonly SEQUENCES_NOT_DEPLOYED: `Sequences saved but ${string}.`;
|
|
35
|
+
};
|
|
36
|
+
export declare function recordLabel(index: number): string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export const SEPARATOR = '─'.repeat(53);
|
|
3
|
+
export const VALIDATION = {
|
|
4
|
+
ADDRESS_REQUIRED: 'Address is required',
|
|
5
|
+
DOMAIN_REQUIRED: 'Domain is required',
|
|
6
|
+
EMAIL_INVALID: 'Please enter a valid email',
|
|
7
|
+
};
|
|
8
|
+
export const PROMPTS = {
|
|
9
|
+
BUSINESS_ADDRESS: 'Business address (required by law):',
|
|
10
|
+
DOMAIN: 'What domain will you send from?',
|
|
11
|
+
ENTER_AFTER_RECORDS: "Press Enter once you've added the records, or 'skip'.",
|
|
12
|
+
FROM_NAME: 'Display name (optional, shown as sender name):',
|
|
13
|
+
REPLY_TO: 'Reply-to address (optional, press Enter to use sender email):',
|
|
14
|
+
SENDER_EMAIL: 'Sender email address:',
|
|
15
|
+
};
|
|
16
|
+
export const ERRORS = {
|
|
17
|
+
DOMAIN_NOT_CONFIGURED: `No domain configured. Run ${chalk.cyan('mailmodo domain')} to set up your sending domain.`,
|
|
18
|
+
DOMAIN_NOT_REGISTERED: `Sending domain not registered. Run: ${chalk.cyan('mailmodo domain')}`,
|
|
19
|
+
DOMAIN_NOT_VERIFIED: `Sending domain not verified. Run: ${chalk.cyan('mailmodo domain --verify')}`,
|
|
20
|
+
INVALID_API_KEY: `Invalid API key. Run ${chalk.cyan('mailmodo login')} to re-authenticate.`,
|
|
21
|
+
NOT_LOGGED_IN: `Not logged in. Run ${chalk.cyan('mailmodo login')} to authenticate.`,
|
|
22
|
+
NO_YAML: `No mailmodo.yaml found. Run ${chalk.cyan('mailmodo init')} first.`,
|
|
23
|
+
RATE_LIMIT: 'Rate limit exceeded. Please try again later.',
|
|
24
|
+
UNEXPECTED_API: 'An unexpected API error occurred.',
|
|
25
|
+
};
|
|
26
|
+
export const INFO = {
|
|
27
|
+
BROWSER_OPEN_FAILED: chalk.dim('Could not open browser. Visit the URL above manually.'),
|
|
28
|
+
BROWSER_OPENING: 'Opening in browser...',
|
|
29
|
+
DEPLOY_TO_APPLY: `Run ${chalk.cyan("'mailmodo deploy'")} to apply.`,
|
|
30
|
+
DNS_FIX_AND_VERIFY: `Fix the records and run ${chalk.cyan('mailmodo domain --verify')} again.`,
|
|
31
|
+
DNS_PROPAGATION: 'DNS changes take 5–30 minutes to propagate.',
|
|
32
|
+
DNS_RECORDS_FAILED: chalk.yellow('Some records failed.'),
|
|
33
|
+
DOMAIN_NOT_DEPLOYED_HINT: `When ready, run: ${chalk.cyan('mailmodo domain')}\n Then: ${chalk.cyan('mailmodo deploy')}`,
|
|
34
|
+
SEQUENCES_NOT_DEPLOYED: `Sequences saved but ${chalk.yellow('NOT deployed')}.`,
|
|
35
|
+
};
|
|
36
|
+
export function recordLabel(index) {
|
|
37
|
+
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
|
38
|
+
return labels[index] || `Record ${index + 1}`;
|
|
39
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -280,6 +280,45 @@
|
|
|
280
280
|
"index.js"
|
|
281
281
|
]
|
|
282
282
|
},
|
|
283
|
+
"emails": {
|
|
284
|
+
"aliases": [],
|
|
285
|
+
"args": {},
|
|
286
|
+
"description": "List and view configured email sequences",
|
|
287
|
+
"examples": [
|
|
288
|
+
"<%= config.bin %> emails",
|
|
289
|
+
"<%= config.bin %> emails --json"
|
|
290
|
+
],
|
|
291
|
+
"flags": {
|
|
292
|
+
"json": {
|
|
293
|
+
"description": "Output as JSON",
|
|
294
|
+
"name": "json",
|
|
295
|
+
"allowNo": false,
|
|
296
|
+
"type": "boolean"
|
|
297
|
+
},
|
|
298
|
+
"yes": {
|
|
299
|
+
"char": "y",
|
|
300
|
+
"description": "Skip confirmation prompts",
|
|
301
|
+
"name": "yes",
|
|
302
|
+
"allowNo": false,
|
|
303
|
+
"type": "boolean"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"hasDynamicHelp": false,
|
|
307
|
+
"hiddenAliases": [],
|
|
308
|
+
"id": "emails",
|
|
309
|
+
"pluginAlias": "@mailmodo/cli",
|
|
310
|
+
"pluginName": "@mailmodo/cli",
|
|
311
|
+
"pluginType": "core",
|
|
312
|
+
"strict": true,
|
|
313
|
+
"enableJsonFlag": false,
|
|
314
|
+
"isESM": true,
|
|
315
|
+
"relativePath": [
|
|
316
|
+
"dist",
|
|
317
|
+
"commands",
|
|
318
|
+
"emails",
|
|
319
|
+
"index.js"
|
|
320
|
+
]
|
|
321
|
+
},
|
|
283
322
|
"init": {
|
|
284
323
|
"aliases": [],
|
|
285
324
|
"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": {},
|
|
@@ -578,13 +559,19 @@
|
|
|
578
559
|
"index.js"
|
|
579
560
|
]
|
|
580
561
|
},
|
|
581
|
-
"
|
|
562
|
+
"preview": {
|
|
582
563
|
"aliases": [],
|
|
583
|
-
"args": {
|
|
584
|
-
|
|
564
|
+
"args": {
|
|
565
|
+
"id": {
|
|
566
|
+
"description": "Email template ID to preview",
|
|
567
|
+
"name": "id"
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
"description": "Preview an email in browser, as text, or send a test",
|
|
585
571
|
"examples": [
|
|
586
|
-
"<%= config.bin %>
|
|
587
|
-
"<%= config.bin %>
|
|
572
|
+
"<%= config.bin %> preview welcome",
|
|
573
|
+
"<%= config.bin %> preview welcome --text",
|
|
574
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
588
575
|
],
|
|
589
576
|
"flags": {
|
|
590
577
|
"json": {
|
|
@@ -599,11 +586,24 @@
|
|
|
599
586
|
"name": "yes",
|
|
600
587
|
"allowNo": false,
|
|
601
588
|
"type": "boolean"
|
|
589
|
+
},
|
|
590
|
+
"send": {
|
|
591
|
+
"description": "Send test email to this address",
|
|
592
|
+
"name": "send",
|
|
593
|
+
"hasDynamicHelp": false,
|
|
594
|
+
"multiple": false,
|
|
595
|
+
"type": "option"
|
|
596
|
+
},
|
|
597
|
+
"text": {
|
|
598
|
+
"description": "Output plain text version (for AI agents)",
|
|
599
|
+
"name": "text",
|
|
600
|
+
"allowNo": false,
|
|
601
|
+
"type": "boolean"
|
|
602
602
|
}
|
|
603
603
|
},
|
|
604
604
|
"hasDynamicHelp": false,
|
|
605
605
|
"hiddenAliases": [],
|
|
606
|
-
"id": "
|
|
606
|
+
"id": "preview",
|
|
607
607
|
"pluginAlias": "@mailmodo/cli",
|
|
608
608
|
"pluginName": "@mailmodo/cli",
|
|
609
609
|
"pluginType": "core",
|
|
@@ -613,17 +613,17 @@
|
|
|
613
613
|
"relativePath": [
|
|
614
614
|
"dist",
|
|
615
615
|
"commands",
|
|
616
|
-
"
|
|
616
|
+
"preview",
|
|
617
617
|
"index.js"
|
|
618
618
|
]
|
|
619
619
|
},
|
|
620
|
-
"
|
|
620
|
+
"status": {
|
|
621
621
|
"aliases": [],
|
|
622
622
|
"args": {},
|
|
623
|
-
"description": "
|
|
623
|
+
"description": "View email performance metrics and quota usage",
|
|
624
624
|
"examples": [
|
|
625
|
-
"<%= config.bin %>
|
|
626
|
-
"<%= config.bin %>
|
|
625
|
+
"<%= config.bin %> status",
|
|
626
|
+
"<%= config.bin %> status --json"
|
|
627
627
|
],
|
|
628
628
|
"flags": {
|
|
629
629
|
"json": {
|
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
},
|
|
643
643
|
"hasDynamicHelp": false,
|
|
644
644
|
"hiddenAliases": [],
|
|
645
|
-
"id": "
|
|
645
|
+
"id": "status",
|
|
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
|
-
"
|
|
655
|
+
"status",
|
|
656
656
|
"index.js"
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.
|
|
660
|
+
"version": "0.0.32"
|
|
661
661
|
}
|