@mailmodo/cli 0.0.56-beta.pr58.94 → 0.0.56-beta.pr58.96

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.
@@ -42,12 +42,12 @@ export function buildDiffPreview(email, updated, templateHtml) {
42
42
  diff.subject = subjectChanged
43
43
  ? { new: updated.subject, old: email.subject }
44
44
  : { unchanged: true, value: email.subject };
45
- if (email.previewText ?? updated.previewText) {
45
+ if (email.previewText || updated.previewText) {
46
46
  diff.previewText = previewChanged
47
47
  ? { new: updated.previewText, old: email.previewText }
48
48
  : { unchanged: true, value: email.previewText };
49
49
  }
50
- if (templateHtml ?? updated.html) {
50
+ if (templateHtml || updated.html) {
51
51
  const oldText = templateHtml
52
52
  ? truncate(stripHtml(templateHtml), 500)
53
53
  : null;
@@ -22,11 +22,11 @@ async function persistChanges(ctx, editCtx, updated) {
22
22
  await ctx.syncYaml();
23
23
  await ctx.syncTemplate(editCtx.email.id);
24
24
  }
25
- function logJsonResult(ctx, email, updated, oldSubject) {
25
+ function logJsonResult(ctx, email, updated, oldSubject, oldPreviewText) {
26
26
  ctx.log(JSON.stringify({
27
27
  diff: {
28
- previewText: updated.previewText && updated.previewText !== email.previewText
29
- ? { new: updated.previewText, old: email.previewText }
28
+ previewText: updated.previewText && updated.previewText !== oldPreviewText
29
+ ? { new: updated.previewText, old: oldPreviewText }
30
30
  : undefined,
31
31
  subject: oldSubject === email.subject
32
32
  ? undefined
@@ -52,10 +52,11 @@ async function handleAcceptOutput(ctx, email) {
52
52
  export async function finalizeEdit(ctx, editCtx, opts) {
53
53
  const { flags, updated } = opts;
54
54
  const oldSubject = editCtx.email.subject;
55
+ const oldPreviewText = editCtx.email.previewText;
55
56
  applyEmailChanges(editCtx.email, updated);
56
57
  await persistChanges(ctx, editCtx, updated);
57
58
  if (flags.json) {
58
- logJsonResult(ctx, editCtx.email, updated, oldSubject);
59
+ logJsonResult(ctx, editCtx.email, updated, oldSubject, oldPreviewText);
59
60
  }
60
61
  else if (flags.yes) {
61
62
  ctx.log(`\n Updated ${chalk.green('mailmodo.yaml')}\n`);
@@ -27,7 +27,7 @@ export async function openTemplateInEditor(ctx, template) {
27
27
  stdio: 'inherit',
28
28
  });
29
29
  child.on('error', () => resolve(false));
30
- child.on('close', () => resolve(true));
30
+ child.on('close', (code) => resolve(code === 0));
31
31
  });
32
32
  if (launched)
33
33
  return;
@@ -4,8 +4,12 @@ import { API_ENDPOINTS } from '../../constants.js';
4
4
  import { isValidUrl } from '../../utils.js';
5
5
  import { logAnalysisSummary } from './output.js';
6
6
  export async function promptProductUrl(flagUrl) {
7
- if (flagUrl)
7
+ if (flagUrl) {
8
+ if (!isValidUrl(flagUrl)) {
9
+ throw new Error(`Invalid URL: "${flagUrl}". Please enter a valid URL (e.g., https://myapp.com)`);
10
+ }
8
11
  return flagUrl;
12
+ }
9
13
  return input({
10
14
  message: 'What is your product URL?',
11
15
  validate(value) {
@@ -4,7 +4,7 @@
4
4
  * when this is true so end users never see internal request metadata.
5
5
  */
6
6
  export declare const IS_DEV_MODE: boolean;
7
- export declare const API_BASE_URL = "https://app-vertex-debug.azurewebsites.net";
7
+ export declare const API_BASE_URL: string;
8
8
  export declare const API_ENDPOINTS: Readonly<{
9
9
  ANALYTICS: "/analytics";
10
10
  ANALYZE: "/analyze";
@@ -31,7 +31,7 @@ export declare const API_ENDPOINTS: Readonly<{
31
31
  SEQUENCES_SDK: "/sequences/sdk";
32
32
  SEQUENCES_VALIDATE: "/sequences/validate";
33
33
  }>;
34
- export declare const LOGIN_URL = "https://app-vertex-debug.azurewebsites.net/signup.html";
34
+ export declare const LOGIN_URL: string;
35
35
  export declare const PREVIEW_PORT = 3421;
36
36
  export declare const DEFAULT_BRAND_COLOR = "#1A56DB";
37
37
  export declare const TEMPLATES_DIR = "mailmodo";
@@ -6,8 +6,7 @@ const DEV_API_BASE_URL = 'https://app-vertex-debug.azurewebsites.net';
6
6
  * when this is true so end users never see internal request metadata.
7
7
  */
8
8
  export const IS_DEV_MODE = Boolean(process.env.MAILMODO_DEV_TSX || process.env.MAILMODO_DEBUG);
9
- // const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.com';
10
- const PRODUCTION_API_BASE_URL = 'https://app-vertex-debug.azurewebsites.net';
9
+ const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.dev';
11
10
  export const API_BASE_URL = process.env.MAILMODO_DEV_TSX
12
11
  ? DEV_API_BASE_URL
13
12
  : PRODUCTION_API_BASE_URL;
@@ -38,8 +37,7 @@ export const API_ENDPOINTS = Object.freeze({
38
37
  SEQUENCES_VALIDATE: '/sequences/validate',
39
38
  });
40
39
  const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
41
- // const PRODUCTION_LOGIN_URL = 'https://mailmodo.com/cli';
42
- const PRODUCTION_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
40
+ const PRODUCTION_LOGIN_URL = 'https://app.mailmodo.dev';
43
41
  export const LOGIN_URL = process.env.MAILMODO_DEV_TSX
44
42
  ? DEV_LOGIN_URL
45
43
  : PRODUCTION_LOGIN_URL;
@@ -137,6 +137,45 @@
137
137
  "index.js"
138
138
  ]
139
139
  },
140
+ "deployments": {
141
+ "aliases": [],
142
+ "args": {},
143
+ "description": "List every deployed sequence on this account, with the IDs needed for deploy --pause / --resume",
144
+ "examples": [
145
+ "<%= config.bin %> deployments",
146
+ "<%= config.bin %> deployments --json"
147
+ ],
148
+ "flags": {
149
+ "json": {
150
+ "description": "Output as JSON",
151
+ "name": "json",
152
+ "allowNo": false,
153
+ "type": "boolean"
154
+ },
155
+ "yes": {
156
+ "char": "y",
157
+ "description": "Skip confirmation prompts",
158
+ "name": "yes",
159
+ "allowNo": false,
160
+ "type": "boolean"
161
+ }
162
+ },
163
+ "hasDynamicHelp": false,
164
+ "hiddenAliases": [],
165
+ "id": "deployments",
166
+ "pluginAlias": "@mailmodo/cli",
167
+ "pluginName": "@mailmodo/cli",
168
+ "pluginType": "core",
169
+ "strict": true,
170
+ "enableJsonFlag": false,
171
+ "isESM": true,
172
+ "relativePath": [
173
+ "dist",
174
+ "commands",
175
+ "deployments",
176
+ "index.js"
177
+ ]
178
+ },
140
179
  "deploy": {
141
180
  "aliases": [],
142
181
  "args": {},
@@ -198,13 +237,19 @@
198
237
  "index.js"
199
238
  ]
200
239
  },
201
- "deployments": {
240
+ "edit": {
202
241
  "aliases": [],
203
- "args": {},
204
- "description": "List every deployed sequence on this account, with the IDs needed for deploy --pause / --resume",
242
+ "args": {
243
+ "id": {
244
+ "description": "Email template ID to edit",
245
+ "name": "id",
246
+ "required": true
247
+ }
248
+ },
249
+ "description": "Edit an email using AI-assisted natural language changes",
205
250
  "examples": [
206
- "<%= config.bin %> deployments",
207
- "<%= config.bin %> deployments --json"
251
+ "<%= config.bin %> edit welcome",
252
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
208
253
  ],
209
254
  "flags": {
210
255
  "json": {
@@ -219,11 +264,18 @@
219
264
  "name": "yes",
220
265
  "allowNo": false,
221
266
  "type": "boolean"
267
+ },
268
+ "change": {
269
+ "description": "Natural language description of the change",
270
+ "name": "change",
271
+ "hasDynamicHelp": false,
272
+ "multiple": false,
273
+ "type": "option"
222
274
  }
223
275
  },
224
276
  "hasDynamicHelp": false,
225
277
  "hiddenAliases": [],
226
- "id": "deployments",
278
+ "id": "edit",
227
279
  "pluginAlias": "@mailmodo/cli",
228
280
  "pluginName": "@mailmodo/cli",
229
281
  "pluginType": "core",
@@ -233,18 +285,17 @@
233
285
  "relativePath": [
234
286
  "dist",
235
287
  "commands",
236
- "deployments",
288
+ "edit",
237
289
  "index.js"
238
290
  ]
239
291
  },
240
- "domain": {
292
+ "emails": {
241
293
  "aliases": [],
242
294
  "args": {},
243
- "description": "Set up and verify your sending domain",
295
+ "description": "List and view configured email sequences",
244
296
  "examples": [
245
- "<%= config.bin %> domain",
246
- "<%= config.bin %> domain --verify",
247
- "<%= config.bin %> domain --status"
297
+ "<%= config.bin %> emails",
298
+ "<%= config.bin %> emails --json"
248
299
  ],
249
300
  "flags": {
250
301
  "json": {
@@ -259,23 +310,11 @@
259
310
  "name": "yes",
260
311
  "allowNo": false,
261
312
  "type": "boolean"
262
- },
263
- "status": {
264
- "description": "Show domain health status",
265
- "name": "status",
266
- "allowNo": false,
267
- "type": "boolean"
268
- },
269
- "verify": {
270
- "description": "Verify DNS records",
271
- "name": "verify",
272
- "allowNo": false,
273
- "type": "boolean"
274
313
  }
275
314
  },
276
315
  "hasDynamicHelp": false,
277
316
  "hiddenAliases": [],
278
- "id": "domain",
317
+ "id": "emails",
279
318
  "pluginAlias": "@mailmodo/cli",
280
319
  "pluginName": "@mailmodo/cli",
281
320
  "pluginType": "core",
@@ -285,23 +324,18 @@
285
324
  "relativePath": [
286
325
  "dist",
287
326
  "commands",
288
- "domain",
327
+ "emails",
289
328
  "index.js"
290
329
  ]
291
330
  },
292
- "edit": {
331
+ "domain": {
293
332
  "aliases": [],
294
- "args": {
295
- "id": {
296
- "description": "Email template ID to edit",
297
- "name": "id",
298
- "required": true
299
- }
300
- },
301
- "description": "Edit an email using AI-assisted natural language changes",
333
+ "args": {},
334
+ "description": "Set up and verify your sending domain",
302
335
  "examples": [
303
- "<%= config.bin %> edit welcome",
304
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
336
+ "<%= config.bin %> domain",
337
+ "<%= config.bin %> domain --verify",
338
+ "<%= config.bin %> domain --status"
305
339
  ],
306
340
  "flags": {
307
341
  "json": {
@@ -317,17 +351,22 @@
317
351
  "allowNo": false,
318
352
  "type": "boolean"
319
353
  },
320
- "change": {
321
- "description": "Natural language description of the change",
322
- "name": "change",
323
- "hasDynamicHelp": false,
324
- "multiple": false,
325
- "type": "option"
354
+ "status": {
355
+ "description": "Show domain health status",
356
+ "name": "status",
357
+ "allowNo": false,
358
+ "type": "boolean"
359
+ },
360
+ "verify": {
361
+ "description": "Verify DNS records",
362
+ "name": "verify",
363
+ "allowNo": false,
364
+ "type": "boolean"
326
365
  }
327
366
  },
328
367
  "hasDynamicHelp": false,
329
368
  "hiddenAliases": [],
330
- "id": "edit",
369
+ "id": "domain",
331
370
  "pluginAlias": "@mailmodo/cli",
332
371
  "pluginName": "@mailmodo/cli",
333
372
  "pluginType": "core",
@@ -337,17 +376,17 @@
337
376
  "relativePath": [
338
377
  "dist",
339
378
  "commands",
340
- "edit",
379
+ "domain",
341
380
  "index.js"
342
381
  ]
343
382
  },
344
- "emails": {
383
+ "init": {
345
384
  "aliases": [],
346
385
  "args": {},
347
- "description": "List and view configured email sequences",
386
+ "description": "Analyze your product and generate email sequences",
348
387
  "examples": [
349
- "<%= config.bin %> emails",
350
- "<%= config.bin %> emails --json"
388
+ "<%= config.bin %> init",
389
+ "<%= config.bin %> init --url https://myapp.com --yes"
351
390
  ],
352
391
  "flags": {
353
392
  "json": {
@@ -362,11 +401,18 @@
362
401
  "name": "yes",
363
402
  "allowNo": false,
364
403
  "type": "boolean"
404
+ },
405
+ "url": {
406
+ "description": "Product URL to analyze",
407
+ "name": "url",
408
+ "hasDynamicHelp": false,
409
+ "multiple": false,
410
+ "type": "option"
365
411
  }
366
412
  },
367
413
  "hasDynamicHelp": false,
368
414
  "hiddenAliases": [],
369
- "id": "emails",
415
+ "id": "init",
370
416
  "pluginAlias": "@mailmodo/cli",
371
417
  "pluginName": "@mailmodo/cli",
372
418
  "pluginType": "core",
@@ -376,17 +422,17 @@
376
422
  "relativePath": [
377
423
  "dist",
378
424
  "commands",
379
- "emails",
425
+ "init",
380
426
  "index.js"
381
427
  ]
382
428
  },
383
- "init": {
429
+ "login": {
384
430
  "aliases": [],
385
431
  "args": {},
386
- "description": "Analyze your product and generate email sequences",
432
+ "description": "Authenticate with Mailmodo using your API key",
387
433
  "examples": [
388
- "<%= config.bin %> init",
389
- "<%= config.bin %> init --url https://myapp.com --yes"
434
+ "<%= config.bin %> login",
435
+ "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
390
436
  ],
391
437
  "flags": {
392
438
  "json": {
@@ -401,18 +447,11 @@
401
447
  "name": "yes",
402
448
  "allowNo": false,
403
449
  "type": "boolean"
404
- },
405
- "url": {
406
- "description": "Product URL to analyze",
407
- "name": "url",
408
- "hasDynamicHelp": false,
409
- "multiple": false,
410
- "type": "option"
411
450
  }
412
451
  },
413
452
  "hasDynamicHelp": false,
414
453
  "hiddenAliases": [],
415
- "id": "init",
454
+ "id": "login",
416
455
  "pluginAlias": "@mailmodo/cli",
417
456
  "pluginName": "@mailmodo/cli",
418
457
  "pluginType": "core",
@@ -422,17 +461,16 @@
422
461
  "relativePath": [
423
462
  "dist",
424
463
  "commands",
425
- "init",
464
+ "login",
426
465
  "index.js"
427
466
  ]
428
467
  },
429
- "login": {
468
+ "logout": {
430
469
  "aliases": [],
431
470
  "args": {},
432
- "description": "Authenticate with Mailmodo using your API key",
471
+ "description": "Sign out by removing saved credentials from this machine",
433
472
  "examples": [
434
- "<%= config.bin %> login",
435
- "MAILMODO_API_KEY=YOUR_API_KEY <%= config.bin %> login"
473
+ "<%= config.bin %> logout"
436
474
  ],
437
475
  "flags": {
438
476
  "json": {
@@ -451,7 +489,7 @@
451
489
  },
452
490
  "hasDynamicHelp": false,
453
491
  "hiddenAliases": [],
454
- "id": "login",
492
+ "id": "logout",
455
493
  "pluginAlias": "@mailmodo/cli",
456
494
  "pluginName": "@mailmodo/cli",
457
495
  "pluginType": "core",
@@ -461,7 +499,7 @@
461
499
  "relativePath": [
462
500
  "dist",
463
501
  "commands",
464
- "login",
502
+ "logout",
465
503
  "index.js"
466
504
  ]
467
505
  },
@@ -725,45 +763,7 @@
725
763
  "status",
726
764
  "index.js"
727
765
  ]
728
- },
729
- "logout": {
730
- "aliases": [],
731
- "args": {},
732
- "description": "Sign out by removing saved credentials from this machine",
733
- "examples": [
734
- "<%= config.bin %> logout"
735
- ],
736
- "flags": {
737
- "json": {
738
- "description": "Output as JSON",
739
- "name": "json",
740
- "allowNo": false,
741
- "type": "boolean"
742
- },
743
- "yes": {
744
- "char": "y",
745
- "description": "Skip confirmation prompts",
746
- "name": "yes",
747
- "allowNo": false,
748
- "type": "boolean"
749
- }
750
- },
751
- "hasDynamicHelp": false,
752
- "hiddenAliases": [],
753
- "id": "logout",
754
- "pluginAlias": "@mailmodo/cli",
755
- "pluginName": "@mailmodo/cli",
756
- "pluginType": "core",
757
- "strict": true,
758
- "enableJsonFlag": false,
759
- "isESM": true,
760
- "relativePath": [
761
- "dist",
762
- "commands",
763
- "logout",
764
- "index.js"
765
- ]
766
766
  }
767
767
  },
768
- "version": "0.0.56-beta.pr58.94"
768
+ "version": "0.0.56-beta.pr58.96"
769
769
  }
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.56-beta.pr58.94",
4
+ "version": "0.0.56-beta.pr58.96",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"