@mailmodo/cli 0.0.12-beta.pr14.18 → 0.0.12-beta.pr14.21

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.
@@ -129,16 +129,16 @@ export default class Domain extends BaseCommand {
129
129
  this.log(JSON.stringify({ dkim, dmarc, spf }, null, 2));
130
130
  return;
131
131
  }
132
- this.log(` SPF ${spf === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
133
- this.log(` DKIM ${dkim === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
134
- this.log(` DMARC ${dmarc === 'pass' ? chalk.green('✓') : chalk.red('✗ Not found')}`);
135
- const allPassed = spf === 'pass' && dkim === 'pass' && dmarc === 'pass';
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;
136
136
  if (allPassed) {
137
137
  this.log(`\n ${chalk.green('✓')} Domain verified.\n`);
138
138
  }
139
139
  else {
140
140
  this.log(`\n ${chalk.yellow('Some records failed.')}`);
141
- if (dkim !== 'pass') {
141
+ if (!dkim) {
142
142
  this.log(`\n DKIM common mistakes:`);
143
143
  this.log(` - Using TXT instead of CNAME record type`);
144
144
  this.log(` - Including the full domain in the Host field`);
@@ -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 {
@@ -106,13 +106,31 @@ export default class Init extends BaseCommand {
106
106
  analysisPayload = JSON.parse(editedAnalysis);
107
107
  }
108
108
  }
109
- const generateResponse = await this.withApiSpinner({
110
- json: flags.json,
111
- text: ' Generating email templates...',
112
- }, () => this.apiClient.post(API_ENDPOINTS.GENERATE, {
113
- analysis: analysisPayload,
114
- productUrl,
115
- }));
109
+ // TODO: Remove dummy data once the Generate API is ready.
110
+ const GENERATE_API_READY = false;
111
+ const generateResponse = GENERATE_API_READY
112
+ ? await this.withApiSpinner({
113
+ json: flags.json,
114
+ text: ' Generating email templates...',
115
+ }, () => this.apiClient.post(API_ENDPOINTS.GENERATE, {
116
+ analysis: analysisPayload,
117
+ productUrl,
118
+ }))
119
+ : {
120
+ ok: true,
121
+ status: 200,
122
+ data: {
123
+ emails: analysisPayload.recommendedEmails.map((rec) => ({
124
+ ctaText: 'Get Started',
125
+ html: `<html><body><h1>${analysisPayload.productName}</h1><p>This is a placeholder email for <strong>${rec.id}</strong>.</p><a href="{{cta_url}}">Get Started</a></body></html>`,
126
+ id: rec.id,
127
+ plainHtml: `<html><body><p>This is a placeholder email for ${rec.id}.</p><a href="{{cta_url}}">Get Started</a></body></html>`,
128
+ previewText: `Welcome — ${rec.goal}`,
129
+ subject: `${analysisPayload.productName}: ${rec.goal}`,
130
+ suggestedCtaPath: '/dashboard',
131
+ })),
132
+ },
133
+ };
116
134
  if (!generateResponse.ok) {
117
135
  this.handleApiError(generateResponse);
118
136
  }
@@ -1,66 +1,5 @@
1
1
  {
2
2
  "commands": {
3
- "contacts": {
4
- "aliases": [],
5
- "args": {},
6
- "description": "Manage contacts — search, export, or delete",
7
- "examples": [
8
- "<%= config.bin %> contacts",
9
- "<%= config.bin %> contacts --search sarah@example.com",
10
- "<%= config.bin %> contacts --export",
11
- "<%= config.bin %> contacts --delete sarah@example.com"
12
- ],
13
- "flags": {
14
- "json": {
15
- "description": "Output as JSON",
16
- "name": "json",
17
- "allowNo": false,
18
- "type": "boolean"
19
- },
20
- "yes": {
21
- "char": "y",
22
- "description": "Skip confirmation prompts",
23
- "name": "yes",
24
- "allowNo": false,
25
- "type": "boolean"
26
- },
27
- "delete": {
28
- "description": "GDPR hard delete a contact by email",
29
- "name": "delete",
30
- "hasDynamicHelp": false,
31
- "multiple": false,
32
- "type": "option"
33
- },
34
- "export": {
35
- "description": "Export all contacts as CSV",
36
- "name": "export",
37
- "allowNo": false,
38
- "type": "boolean"
39
- },
40
- "search": {
41
- "description": "Search for a contact by email",
42
- "name": "search",
43
- "hasDynamicHelp": false,
44
- "multiple": false,
45
- "type": "option"
46
- }
47
- },
48
- "hasDynamicHelp": false,
49
- "hiddenAliases": [],
50
- "id": "contacts",
51
- "pluginAlias": "@mailmodo/cli",
52
- "pluginName": "@mailmodo/cli",
53
- "pluginType": "core",
54
- "strict": true,
55
- "enableJsonFlag": false,
56
- "isESM": true,
57
- "relativePath": [
58
- "dist",
59
- "commands",
60
- "contacts",
61
- "index.js"
62
- ]
63
- },
64
3
  "billing": {
65
4
  "aliases": [],
66
5
  "args": {},
@@ -205,6 +144,67 @@
205
144
  "index.js"
206
145
  ]
207
146
  },
147
+ "contacts": {
148
+ "aliases": [],
149
+ "args": {},
150
+ "description": "Manage contacts — search, export, or delete",
151
+ "examples": [
152
+ "<%= config.bin %> contacts",
153
+ "<%= config.bin %> contacts --search sarah@example.com",
154
+ "<%= config.bin %> contacts --export",
155
+ "<%= config.bin %> contacts --delete sarah@example.com"
156
+ ],
157
+ "flags": {
158
+ "json": {
159
+ "description": "Output as JSON",
160
+ "name": "json",
161
+ "allowNo": false,
162
+ "type": "boolean"
163
+ },
164
+ "yes": {
165
+ "char": "y",
166
+ "description": "Skip confirmation prompts",
167
+ "name": "yes",
168
+ "allowNo": false,
169
+ "type": "boolean"
170
+ },
171
+ "delete": {
172
+ "description": "GDPR hard delete a contact by email",
173
+ "name": "delete",
174
+ "hasDynamicHelp": false,
175
+ "multiple": false,
176
+ "type": "option"
177
+ },
178
+ "export": {
179
+ "description": "Export all contacts as CSV",
180
+ "name": "export",
181
+ "allowNo": false,
182
+ "type": "boolean"
183
+ },
184
+ "search": {
185
+ "description": "Search for a contact by email",
186
+ "name": "search",
187
+ "hasDynamicHelp": false,
188
+ "multiple": false,
189
+ "type": "option"
190
+ }
191
+ },
192
+ "hasDynamicHelp": false,
193
+ "hiddenAliases": [],
194
+ "id": "contacts",
195
+ "pluginAlias": "@mailmodo/cli",
196
+ "pluginName": "@mailmodo/cli",
197
+ "pluginType": "core",
198
+ "strict": true,
199
+ "enableJsonFlag": false,
200
+ "isESM": true,
201
+ "relativePath": [
202
+ "dist",
203
+ "commands",
204
+ "contacts",
205
+ "index.js"
206
+ ]
207
+ },
208
208
  "edit": {
209
209
  "aliases": [],
210
210
  "args": {
@@ -419,19 +419,15 @@
419
419
  "index.js"
420
420
  ]
421
421
  },
422
- "preview": {
422
+ "logs": {
423
423
  "aliases": [],
424
- "args": {
425
- "id": {
426
- "description": "Email ID to preview",
427
- "name": "id"
428
- }
429
- },
430
- "description": "Preview an email in browser, as text, or send a test",
424
+ "args": {},
425
+ "description": "View email send logs and delivery events",
431
426
  "examples": [
432
- "<%= config.bin %> preview welcome",
433
- "<%= config.bin %> preview welcome --text",
434
- "<%= config.bin %> preview welcome --send me@example.com"
427
+ "<%= config.bin %> logs",
428
+ "<%= config.bin %> logs --email sarah@example.com",
429
+ "<%= config.bin %> logs --failed",
430
+ "<%= config.bin %> logs --json"
435
431
  ],
436
432
  "flags": {
437
433
  "json": {
@@ -447,23 +443,23 @@
447
443
  "allowNo": false,
448
444
  "type": "boolean"
449
445
  },
450
- "send": {
451
- "description": "Send test email to this address",
452
- "name": "send",
446
+ "email": {
447
+ "description": "Filter logs by contact email",
448
+ "name": "email",
453
449
  "hasDynamicHelp": false,
454
450
  "multiple": false,
455
451
  "type": "option"
456
452
  },
457
- "text": {
458
- "description": "Output plain text version (for AI agents)",
459
- "name": "text",
453
+ "failed": {
454
+ "description": "Show only failed/bounced events",
455
+ "name": "failed",
460
456
  "allowNo": false,
461
457
  "type": "boolean"
462
458
  }
463
459
  },
464
460
  "hasDynamicHelp": false,
465
461
  "hiddenAliases": [],
466
- "id": "preview",
462
+ "id": "logs",
467
463
  "pluginAlias": "@mailmodo/cli",
468
464
  "pluginName": "@mailmodo/cli",
469
465
  "pluginType": "core",
@@ -473,19 +469,23 @@
473
469
  "relativePath": [
474
470
  "dist",
475
471
  "commands",
476
- "preview",
472
+ "logs",
477
473
  "index.js"
478
474
  ]
479
475
  },
480
- "logs": {
476
+ "preview": {
481
477
  "aliases": [],
482
- "args": {},
483
- "description": "View email send logs and delivery events",
478
+ "args": {
479
+ "id": {
480
+ "description": "Email ID to preview",
481
+ "name": "id"
482
+ }
483
+ },
484
+ "description": "Preview an email in browser, as text, or send a test",
484
485
  "examples": [
485
- "<%= config.bin %> logs",
486
- "<%= config.bin %> logs --email sarah@example.com",
487
- "<%= config.bin %> logs --failed",
488
- "<%= config.bin %> logs --json"
486
+ "<%= config.bin %> preview welcome",
487
+ "<%= config.bin %> preview welcome --text",
488
+ "<%= config.bin %> preview welcome --send me@example.com"
489
489
  ],
490
490
  "flags": {
491
491
  "json": {
@@ -501,23 +501,23 @@
501
501
  "allowNo": false,
502
502
  "type": "boolean"
503
503
  },
504
- "email": {
505
- "description": "Filter logs by contact email",
506
- "name": "email",
504
+ "send": {
505
+ "description": "Send test email to this address",
506
+ "name": "send",
507
507
  "hasDynamicHelp": false,
508
508
  "multiple": false,
509
509
  "type": "option"
510
510
  },
511
- "failed": {
512
- "description": "Show only failed/bounced events",
513
- "name": "failed",
511
+ "text": {
512
+ "description": "Output plain text version (for AI agents)",
513
+ "name": "text",
514
514
  "allowNo": false,
515
515
  "type": "boolean"
516
516
  }
517
517
  },
518
518
  "hasDynamicHelp": false,
519
519
  "hiddenAliases": [],
520
- "id": "logs",
520
+ "id": "preview",
521
521
  "pluginAlias": "@mailmodo/cli",
522
522
  "pluginName": "@mailmodo/cli",
523
523
  "pluginType": "core",
@@ -527,7 +527,7 @@
527
527
  "relativePath": [
528
528
  "dist",
529
529
  "commands",
530
- "logs",
530
+ "preview",
531
531
  "index.js"
532
532
  ]
533
533
  },
@@ -618,5 +618,5 @@
618
618
  ]
619
619
  }
620
620
  },
621
- "version": "0.0.12-beta.pr14.18"
621
+ "version": "0.0.12-beta.pr14.21"
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.12-beta.pr14.18",
4
+ "version": "0.0.12-beta.pr14.21",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"
@@ -29,8 +29,12 @@
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",
32
35
  "mocha": "^11",
33
36
  "oclif": "^4",
37
+ "prettier": "^3.8.2",
34
38
  "shx": "^0.3.3",
35
39
  "ts-node": "^10",
36
40
  "tsx": "^4.21.0",
@@ -69,7 +73,15 @@
69
73
  "posttest": "npm run lint",
70
74
  "prepack": "oclif manifest && oclif readme",
71
75
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
72
- "version": "oclif readme && git add README.md"
76
+ "version": "oclif readme && git add README.md",
77
+ "prepare": "husky"
73
78
  },
74
- "types": "dist/index.d.ts"
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
+ }
75
87
  }