@mailmodo/cli 0.0.31-beta.pr33.56 → 0.0.32-beta.pr34.57

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.
@@ -23,10 +23,9 @@ export default class Login extends BaseCommand {
23
23
  if (existing?.apiKey) {
24
24
  if (flags.json) {
25
25
  this.log(JSON.stringify({
26
- accountName: existing.accountName ?? null,
27
26
  email: existing.email ?? null,
28
- freeRemaining: existing.freeRemaining ?? null,
29
27
  status: 'already_logged_in',
28
+ totalFreeRemaining: existing.totalFreeRemaining ?? null,
30
29
  }, null, 2));
31
30
  return;
32
31
  }
@@ -68,19 +67,20 @@ export default class Login extends BaseCommand {
68
67
  if (!response.ok) {
69
68
  this.handleApiError(response);
70
69
  }
71
- const { accountName, email, freeRemaining } = response.data;
70
+ const { email, totalFreeRemaining } = response.data;
72
71
  await saveConfig({
73
- accountName,
74
72
  apiKey: trimmedKey,
75
73
  email,
76
- freeRemaining,
74
+ totalFreeRemaining,
77
75
  });
78
76
  if (flags.json) {
79
- this.log(JSON.stringify({ accountName, email, freeRemaining, status: 'authenticated' }, null, 2));
77
+ this.log(JSON.stringify({ email, status: 'authenticated', totalFreeRemaining }, null, 2));
80
78
  return;
81
79
  }
82
80
  this.log(`\n Logged in as ${chalk.green(email)}`);
83
- this.log(` Free tier: ${chalk.cyan(String(freeRemaining ?? 1000))} emails remaining`);
81
+ if (totalFreeRemaining !== null && totalFreeRemaining !== undefined) {
82
+ this.log(` Free tier: ${chalk.cyan(String(totalFreeRemaining))} emails remaining`);
83
+ }
84
84
  this.log(' No credit card required.\n');
85
85
  this.log(` Next: Run ${chalk.cyan("'mailmodo init'")} to generate your email sequences.\n`);
86
86
  }
@@ -38,13 +38,18 @@ export default class Status extends BaseCommand {
38
38
  this.log(` ${chalk.dim('No data yet. Deploy emails first.')}`);
39
39
  }
40
40
  this.log('');
41
- this.log(` Emails sent this month: ${chalk.bold(String(monthlySent ?? 0))}`);
41
+ if (monthlySent !== null && monthlySent !== undefined) {
42
+ this.log(` Emails sent this month: ${chalk.bold(String(monthlySent))}`);
43
+ }
42
44
  if (quota) {
43
45
  if (quota.freeRemaining > 0) {
44
46
  this.log(` Free tier remaining: ${chalk.cyan(String(quota.freeRemaining))}`);
45
47
  }
46
48
  else if (quota.blocksUsed !== undefined) {
47
- this.log(` Current paid block: ${chalk.cyan(`${quota.currentBlockRemaining ?? 0} / 10,000 used`)}`);
49
+ if (quota.currentBlockRemaining !== null &&
50
+ quota.currentBlockRemaining !== undefined) {
51
+ this.log(` Current paid block: ${chalk.cyan(`${quota.currentBlockRemaining} / 10,000 used`)}`);
52
+ }
48
53
  this.log(` Blocks purchased: ${quota.blocksUsed}`);
49
54
  }
50
55
  }
@@ -1,15 +1,14 @@
1
1
  export interface MailmodoConfig {
2
- accountName?: string;
3
2
  apiKey: string;
4
3
  email?: string;
5
- freeRemaining?: number;
4
+ totalFreeRemaining?: number;
6
5
  }
7
6
  /**
8
7
  * Loads the Mailmodo CLI configuration from ~/.mailmodo/config.
9
8
  * The config file stores the API key and account metadata as JSON.
10
9
  *
11
10
  * @returns {Promise<MailmodoConfig | null>} The parsed configuration object
12
- * containing apiKey, email, accountName, and freeRemaining quota,
11
+ * containing apiKey, email, and totalFreeRemaining quota,
13
12
  * or null if the config file does not exist or is corrupted.
14
13
  */
15
14
  export declare function loadConfig(): Promise<MailmodoConfig | null>;
@@ -19,7 +18,7 @@ export declare function loadConfig(): Promise<MailmodoConfig | null>;
19
18
  * Overwrites any existing config file.
20
19
  *
21
20
  * @param {MailmodoConfig} config - The configuration to persist, must include
22
- * at minimum an apiKey. Optional fields: email, accountName, freeRemaining.
21
+ * at minimum an apiKey. Optional fields: email, totalFreeRemaining.
23
22
  */
24
23
  export declare function saveConfig(config: MailmodoConfig): Promise<void>;
25
24
  /**
@@ -9,7 +9,7 @@ const CONFIG_FILE = join(CONFIG_DIR, 'config');
9
9
  * The config file stores the API key and account metadata as JSON.
10
10
  *
11
11
  * @returns {Promise<MailmodoConfig | null>} The parsed configuration object
12
- * containing apiKey, email, accountName, and freeRemaining quota,
12
+ * containing apiKey, email, and totalFreeRemaining quota,
13
13
  * or null if the config file does not exist or is corrupted.
14
14
  */
15
15
  export async function loadConfig() {
@@ -29,7 +29,7 @@ export async function loadConfig() {
29
29
  * Overwrites any existing config file.
30
30
  *
31
31
  * @param {MailmodoConfig} config - The configuration to persist, must include
32
- * at minimum an apiKey. Optional fields: email, accountName, freeRemaining.
32
+ * at minimum an apiKey. Optional fields: email, totalFreeRemaining.
33
33
  */
34
34
  export async function saveConfig(config) {
35
35
  if (!existsSync(CONFIG_DIR)) {
@@ -176,58 +176,6 @@
176
176
  "index.js"
177
177
  ]
178
178
  },
179
- "edit": {
180
- "aliases": [],
181
- "args": {
182
- "id": {
183
- "description": "Email template ID to edit",
184
- "name": "id",
185
- "required": true
186
- }
187
- },
188
- "description": "Edit an email using AI-assisted natural language changes",
189
- "examples": [
190
- "<%= config.bin %> edit welcome",
191
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
192
- ],
193
- "flags": {
194
- "json": {
195
- "description": "Output as JSON",
196
- "name": "json",
197
- "allowNo": false,
198
- "type": "boolean"
199
- },
200
- "yes": {
201
- "char": "y",
202
- "description": "Skip confirmation prompts",
203
- "name": "yes",
204
- "allowNo": false,
205
- "type": "boolean"
206
- },
207
- "change": {
208
- "description": "Natural language description of the change",
209
- "name": "change",
210
- "hasDynamicHelp": false,
211
- "multiple": false,
212
- "type": "option"
213
- }
214
- },
215
- "hasDynamicHelp": false,
216
- "hiddenAliases": [],
217
- "id": "edit",
218
- "pluginAlias": "@mailmodo/cli",
219
- "pluginName": "@mailmodo/cli",
220
- "pluginType": "core",
221
- "strict": true,
222
- "enableJsonFlag": false,
223
- "isESM": true,
224
- "relativePath": [
225
- "dist",
226
- "commands",
227
- "edit",
228
- "index.js"
229
- ]
230
- },
231
179
  "domain": {
232
180
  "aliases": [],
233
181
  "args": {},
@@ -280,13 +228,13 @@
280
228
  "index.js"
281
229
  ]
282
230
  },
283
- "init": {
231
+ "emails": {
284
232
  "aliases": [],
285
233
  "args": {},
286
- "description": "Analyze your product and generate email sequences",
234
+ "description": "List and view configured email sequences",
287
235
  "examples": [
288
- "<%= config.bin %> init",
289
- "<%= config.bin %> init --url https://myapp.com --yes"
236
+ "<%= config.bin %> emails",
237
+ "<%= config.bin %> emails --json"
290
238
  ],
291
239
  "flags": {
292
240
  "json": {
@@ -301,18 +249,11 @@
301
249
  "name": "yes",
302
250
  "allowNo": false,
303
251
  "type": "boolean"
304
- },
305
- "url": {
306
- "description": "Product URL to analyze",
307
- "name": "url",
308
- "hasDynamicHelp": false,
309
- "multiple": false,
310
- "type": "option"
311
252
  }
312
253
  },
313
254
  "hasDynamicHelp": false,
314
255
  "hiddenAliases": [],
315
- "id": "init",
256
+ "id": "emails",
316
257
  "pluginAlias": "@mailmodo/cli",
317
258
  "pluginName": "@mailmodo/cli",
318
259
  "pluginType": "core",
@@ -322,17 +263,17 @@
322
263
  "relativePath": [
323
264
  "dist",
324
265
  "commands",
325
- "init",
266
+ "emails",
326
267
  "index.js"
327
268
  ]
328
269
  },
329
- "emails": {
270
+ "init": {
330
271
  "aliases": [],
331
272
  "args": {},
332
- "description": "List and view configured email sequences",
273
+ "description": "Analyze your product and generate email sequences",
333
274
  "examples": [
334
- "<%= config.bin %> emails",
335
- "<%= config.bin %> emails --json"
275
+ "<%= config.bin %> init",
276
+ "<%= config.bin %> init --url https://myapp.com --yes"
336
277
  ],
337
278
  "flags": {
338
279
  "json": {
@@ -347,11 +288,18 @@
347
288
  "name": "yes",
348
289
  "allowNo": false,
349
290
  "type": "boolean"
291
+ },
292
+ "url": {
293
+ "description": "Product URL to analyze",
294
+ "name": "url",
295
+ "hasDynamicHelp": false,
296
+ "multiple": false,
297
+ "type": "option"
350
298
  }
351
299
  },
352
300
  "hasDynamicHelp": false,
353
301
  "hiddenAliases": [],
354
- "id": "emails",
302
+ "id": "init",
355
303
  "pluginAlias": "@mailmodo/cli",
356
304
  "pluginName": "@mailmodo/cli",
357
305
  "pluginType": "core",
@@ -361,7 +309,7 @@
361
309
  "relativePath": [
362
310
  "dist",
363
311
  "commands",
364
- "emails",
312
+ "init",
365
313
  "index.js"
366
314
  ]
367
315
  },
@@ -655,7 +603,59 @@
655
603
  "status",
656
604
  "index.js"
657
605
  ]
606
+ },
607
+ "edit": {
608
+ "aliases": [],
609
+ "args": {
610
+ "id": {
611
+ "description": "Email template ID to edit",
612
+ "name": "id",
613
+ "required": true
614
+ }
615
+ },
616
+ "description": "Edit an email using AI-assisted natural language changes",
617
+ "examples": [
618
+ "<%= config.bin %> edit welcome",
619
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
620
+ ],
621
+ "flags": {
622
+ "json": {
623
+ "description": "Output as JSON",
624
+ "name": "json",
625
+ "allowNo": false,
626
+ "type": "boolean"
627
+ },
628
+ "yes": {
629
+ "char": "y",
630
+ "description": "Skip confirmation prompts",
631
+ "name": "yes",
632
+ "allowNo": false,
633
+ "type": "boolean"
634
+ },
635
+ "change": {
636
+ "description": "Natural language description of the change",
637
+ "name": "change",
638
+ "hasDynamicHelp": false,
639
+ "multiple": false,
640
+ "type": "option"
641
+ }
642
+ },
643
+ "hasDynamicHelp": false,
644
+ "hiddenAliases": [],
645
+ "id": "edit",
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
+ "edit",
656
+ "index.js"
657
+ ]
658
658
  }
659
659
  },
660
- "version": "0.0.31-beta.pr33.56"
660
+ "version": "0.0.32-beta.pr34.57"
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.31-beta.pr33.56",
4
+ "version": "0.0.32-beta.pr34.57",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"