@mailmodo/cli 0.0.13-beta.pr14.22 → 0.0.13

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.
@@ -3,7 +3,6 @@ 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, DNS_GUIDE_URL } from '../../lib/constants.js';
6
- import { saveConfig } from '../../lib/config.js';
7
6
  import { saveYaml } from '../../lib/yaml-config.js';
8
7
  export default class Domain extends BaseCommand {
9
8
  static description = 'Set up and verify your sending domain';
@@ -25,22 +24,22 @@ export default class Domain extends BaseCommand {
25
24
  };
26
25
  async run() {
27
26
  const { flags } = await this.parse(Domain);
28
- const config = await this.ensureAuth();
27
+ await this.ensureAuth();
29
28
  if (flags.verify) {
30
- await this.verifyDomain(flags.json, config);
29
+ await this.verifyDomain(flags.json);
31
30
  return;
32
31
  }
33
32
  if (flags.status) {
34
- await this.showDomainStatus(flags.json, config);
33
+ await this.showDomainStatus(flags.json);
35
34
  return;
36
35
  }
37
- await this.setupDomain(flags, config);
36
+ await this.setupDomain(flags);
38
37
  }
39
38
  /**
40
39
  * Interactive domain setup: collects domain, sender email, and business address,
41
40
  * then calls the API to retrieve the required DNS records.
42
41
  */
43
- async setupDomain(flags, config) {
42
+ async setupDomain(flags) {
44
43
  const yamlConfig = await this.ensureYaml();
45
44
  this.log(`\n ${'─'.repeat(53)}`);
46
45
  this.log(` ${chalk.bold('DOMAIN SETUP')}`);
@@ -85,7 +84,6 @@ export default class Domain extends BaseCommand {
85
84
  yamlConfig.project.fromEmail = senderEmail;
86
85
  yamlConfig.project.address = address;
87
86
  await saveYaml(yamlConfig);
88
- await saveConfig({ ...config, domain });
89
87
  const records = response.data?.dnsRecords || [];
90
88
  if (flags.json) {
91
89
  this.log(JSON.stringify({ dnsRecords: records, domain }, null, 2));
@@ -106,21 +104,15 @@ export default class Domain extends BaseCommand {
106
104
  message: "Press Enter once you've added the records, or 'skip'.",
107
105
  });
108
106
  if (action.toLowerCase() !== 'skip') {
109
- await this.verifyDomain(false, { ...config, domain });
107
+ await this.verifyDomain(false);
110
108
  }
111
109
  }
112
110
  }
113
111
  /**
114
112
  * Calls the domain verification API and displays pass/fail for each DNS record.
115
113
  */
116
- async verifyDomain(jsonOutput, config) {
117
- if (!config.domain) {
118
- this.error(`No domain configured. Run ${chalk.cyan('mailmodo domain')} to set up your sending domain.`);
119
- }
120
- const domain = config.domain;
121
- const response = await this.withApiSpinner({ json: jsonOutput, text: ' Checking DNS...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_VERIFY, {
122
- domain,
123
- }));
114
+ async verifyDomain(jsonOutput) {
115
+ const response = await this.withApiSpinner({ json: jsonOutput, text: ' Checking DNS...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_VERIFY));
124
116
  if (!response.ok) {
125
117
  this.handleApiError(response);
126
118
  }
@@ -129,16 +121,16 @@ export default class Domain extends BaseCommand {
129
121
  this.log(JSON.stringify({ dkim, dmarc, spf }, null, 2));
130
122
  return;
131
123
  }
132
- this.log(` SPF ${spf ? chalk.green('✓') : chalk.red('✗ Not found')}`);
133
- this.log(` DKIM ${dkim ? chalk.green('✓') : chalk.red('✗ Not found')}`);
134
- this.log(` DMARC ${dmarc ? chalk.green('✓') : chalk.red('✗ Not found')}`);
135
- const allPassed = spf && dkim && dmarc;
124
+ this.log(` SPF ${spf === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
125
+ this.log(` DKIM ${dkim === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
126
+ this.log(` DMARC ${dmarc === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
127
+ const allPassed = spf === 'pass' && dkim === 'pass' && dmarc === 'pass';
136
128
  if (allPassed) {
137
129
  this.log(`\n ${chalk.green('✓')} Domain verified.\n`);
138
130
  }
139
131
  else {
140
132
  this.log(`\n ${chalk.yellow('Some records failed.')}`);
141
- if (!dkim) {
133
+ if (dkim !== 'pass') {
142
134
  this.log(`\n DKIM common mistakes:`);
143
135
  this.log(` - Using TXT instead of CNAME record type`);
144
136
  this.log(` - Including the full domain in the Host field`);
@@ -152,14 +144,8 @@ export default class Domain extends BaseCommand {
152
144
  * Displays domain health metrics including verification status,
153
145
  * bounce rate, and spam complaint rate.
154
146
  */
155
- async showDomainStatus(jsonOutput, config) {
156
- if (!config.domain) {
157
- this.error(`No domain configured. Run ${chalk.cyan('mailmodo domain')} to set up your sending domain.`);
158
- }
159
- const domain = config.domain;
160
- const response = await this.withApiSpinner({ json: jsonOutput, text: ' Loading domain status...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_STATUS, {
161
- domain,
162
- }));
147
+ async showDomainStatus(jsonOutput) {
148
+ const response = await this.withApiSpinner({ json: jsonOutput, text: ' Loading domain status...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_STATUS));
163
149
  if (!response.ok) {
164
150
  this.handleApiError(response);
165
151
  }
@@ -2,7 +2,7 @@ import { Flags } from '@oclif/core';
2
2
  import { editor, input, select } from '@inquirer/prompts';
3
3
  import chalk from 'chalk';
4
4
  import { BaseCommand } from '../../lib/base-command.js';
5
- import { API_ENDPOINTS, DEFAULT_BRAND_COLOR, DEFAULT_MONTHLY_CAP, } from '../../lib/constants.js';
5
+ import { API_ENDPOINTS, DEFAULT_BRAND_COLOR, DEFAULT_MONTHLY_CAP } from '../../lib/constants.js';
6
6
  import { saveTemplate, saveYaml, } from '../../lib/yaml-config.js';
7
7
  function isValidUrl(value) {
8
8
  try {
@@ -199,7 +199,7 @@ export default class Settings extends BaseCommand {
199
199
  const newFromEmail = await input({
200
200
  default: yamlConfig.project.fromEmail || '',
201
201
  message: 'Sender email (from address):',
202
- validate: (v) => (v?.includes('@') ? true : 'Please enter a valid email'),
202
+ validate: (v) => v?.includes('@') ? true : 'Please enter a valid email',
203
203
  });
204
204
  const newAddress = await input({
205
205
  default: yamlConfig.project.address || '',
@@ -1,7 +1,6 @@
1
1
  export interface MailmodoConfig {
2
2
  accountName?: string;
3
3
  apiKey: string;
4
- domain?: string;
5
4
  email?: string;
6
5
  freeRemaining?: number;
7
6
  }
@@ -1,4 +1,4 @@
1
- export declare const API_BASE_URL = "https://app-vertex-debug.azurewebsites.net";
1
+ export declare const API_BASE_URL: string;
2
2
  export declare const API_ENDPOINTS: Readonly<{
3
3
  ANALYTICS: "/analytics";
4
4
  ANALYZE: "/analyze";
@@ -1,7 +1,6 @@
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
- // const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.com';
4
- const PRODUCTION_API_BASE_URL = 'https://app-vertex-debug.azurewebsites.net';
3
+ const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.com';
5
4
  export const API_BASE_URL = process.env.MAILMODO_DEV_TSX
6
5
  ? DEV_API_BASE_URL
7
6
  : PRODUCTION_API_BASE_URL;
@@ -205,19 +205,13 @@
205
205
  "index.js"
206
206
  ]
207
207
  },
208
- "edit": {
208
+ "emails": {
209
209
  "aliases": [],
210
- "args": {
211
- "id": {
212
- "description": "Email ID to edit",
213
- "name": "id",
214
- "required": true
215
- }
216
- },
217
- "description": "Edit an email using AI-assisted natural language changes",
210
+ "args": {},
211
+ "description": "List and view configured email sequences",
218
212
  "examples": [
219
- "<%= config.bin %> edit welcome",
220
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
213
+ "<%= config.bin %> emails",
214
+ "<%= config.bin %> emails --json"
221
215
  ],
222
216
  "flags": {
223
217
  "json": {
@@ -232,18 +226,11 @@
232
226
  "name": "yes",
233
227
  "allowNo": false,
234
228
  "type": "boolean"
235
- },
236
- "change": {
237
- "description": "Natural language description of the change",
238
- "name": "change",
239
- "hasDynamicHelp": false,
240
- "multiple": false,
241
- "type": "option"
242
229
  }
243
230
  },
244
231
  "hasDynamicHelp": false,
245
232
  "hiddenAliases": [],
246
- "id": "edit",
233
+ "id": "emails",
247
234
  "pluginAlias": "@mailmodo/cli",
248
235
  "pluginName": "@mailmodo/cli",
249
236
  "pluginType": "core",
@@ -253,17 +240,23 @@
253
240
  "relativePath": [
254
241
  "dist",
255
242
  "commands",
256
- "edit",
243
+ "emails",
257
244
  "index.js"
258
245
  ]
259
246
  },
260
- "emails": {
247
+ "edit": {
261
248
  "aliases": [],
262
- "args": {},
263
- "description": "List and view configured email sequences",
249
+ "args": {
250
+ "id": {
251
+ "description": "Email ID to edit",
252
+ "name": "id",
253
+ "required": true
254
+ }
255
+ },
256
+ "description": "Edit an email using AI-assisted natural language changes",
264
257
  "examples": [
265
- "<%= config.bin %> emails",
266
- "<%= config.bin %> emails --json"
258
+ "<%= config.bin %> edit welcome",
259
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
267
260
  ],
268
261
  "flags": {
269
262
  "json": {
@@ -278,11 +271,18 @@
278
271
  "name": "yes",
279
272
  "allowNo": false,
280
273
  "type": "boolean"
274
+ },
275
+ "change": {
276
+ "description": "Natural language description of the change",
277
+ "name": "change",
278
+ "hasDynamicHelp": false,
279
+ "multiple": false,
280
+ "type": "option"
281
281
  }
282
282
  },
283
283
  "hasDynamicHelp": false,
284
284
  "hiddenAliases": [],
285
- "id": "emails",
285
+ "id": "edit",
286
286
  "pluginAlias": "@mailmodo/cli",
287
287
  "pluginName": "@mailmodo/cli",
288
288
  "pluginType": "core",
@@ -292,7 +292,7 @@
292
292
  "relativePath": [
293
293
  "dist",
294
294
  "commands",
295
- "emails",
295
+ "edit",
296
296
  "index.js"
297
297
  ]
298
298
  },
@@ -342,45 +342,6 @@
342
342
  "index.js"
343
343
  ]
344
344
  },
345
- "login": {
346
- "aliases": [],
347
- "args": {},
348
- "description": "Authenticate with Mailmodo using your API key",
349
- "examples": [
350
- "<%= config.bin %> login",
351
- "MAILMODO_API_KEY=mm_live_xxx <%= config.bin %> login"
352
- ],
353
- "flags": {
354
- "json": {
355
- "description": "Output as JSON",
356
- "name": "json",
357
- "allowNo": false,
358
- "type": "boolean"
359
- },
360
- "yes": {
361
- "char": "y",
362
- "description": "Skip confirmation prompts",
363
- "name": "yes",
364
- "allowNo": false,
365
- "type": "boolean"
366
- }
367
- },
368
- "hasDynamicHelp": false,
369
- "hiddenAliases": [],
370
- "id": "login",
371
- "pluginAlias": "@mailmodo/cli",
372
- "pluginName": "@mailmodo/cli",
373
- "pluginType": "core",
374
- "strict": true,
375
- "enableJsonFlag": false,
376
- "isESM": true,
377
- "relativePath": [
378
- "dist",
379
- "commands",
380
- "login",
381
- "index.js"
382
- ]
383
- },
384
345
  "logout": {
385
346
  "aliases": [],
386
347
  "args": {},
@@ -531,6 +492,45 @@
531
492
  "index.js"
532
493
  ]
533
494
  },
495
+ "login": {
496
+ "aliases": [],
497
+ "args": {},
498
+ "description": "Authenticate with Mailmodo using your API key",
499
+ "examples": [
500
+ "<%= config.bin %> login",
501
+ "MAILMODO_API_KEY=mm_live_xxx <%= config.bin %> login"
502
+ ],
503
+ "flags": {
504
+ "json": {
505
+ "description": "Output as JSON",
506
+ "name": "json",
507
+ "allowNo": false,
508
+ "type": "boolean"
509
+ },
510
+ "yes": {
511
+ "char": "y",
512
+ "description": "Skip confirmation prompts",
513
+ "name": "yes",
514
+ "allowNo": false,
515
+ "type": "boolean"
516
+ }
517
+ },
518
+ "hasDynamicHelp": false,
519
+ "hiddenAliases": [],
520
+ "id": "login",
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
+ "login",
531
+ "index.js"
532
+ ]
533
+ },
534
534
  "settings": {
535
535
  "aliases": [],
536
536
  "args": {},
@@ -618,5 +618,5 @@
618
618
  ]
619
619
  }
620
620
  },
621
- "version": "0.0.13-beta.pr14.22"
621
+ "version": "0.0.13"
622
622
  }
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.13-beta.pr14.22",
4
+ "version": "0.0.13",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"
@@ -24,17 +24,13 @@
24
24
  "@types/chai": "^4",
25
25
  "@types/js-yaml": "^4.0.9",
26
26
  "@types/mocha": "^10",
27
- "@types/node": "^18.19.130",
27
+ "@types/node": "^18",
28
28
  "chai": "^4",
29
29
  "eslint": "^9",
30
30
  "eslint-config-oclif": "^6",
31
31
  "eslint-config-prettier": "^10",
32
- "eslint-plugin-unused-imports": "^4.4.1",
33
- "husky": "^9.1.7",
34
- "lint-staged": "^16.4.0",
35
32
  "mocha": "^11",
36
33
  "oclif": "^4",
37
- "prettier": "^3.8.2",
38
34
  "shx": "^0.3.3",
39
35
  "ts-node": "^10",
40
36
  "tsx": "^4.21.0",
@@ -73,15 +69,7 @@
73
69
  "posttest": "npm run lint",
74
70
  "prepack": "oclif manifest && oclif readme",
75
71
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
76
- "version": "oclif readme && git add README.md",
77
- "prepare": "husky"
72
+ "version": "oclif readme && git add README.md"
78
73
  },
79
- "types": "dist/index.d.ts",
80
- "lint-staged": {
81
- "*.{ts,tsx,js,jsx,mjs,cjs}": [
82
- "prettier --write",
83
- "eslint --fix"
84
- ],
85
- "*.{json,md,yaml,yml}": "prettier --write"
86
- }
74
+ "types": "dist/index.d.ts"
87
75
  }