@mailmodo/cli 0.0.56-beta.pr58.97 → 0.0.56-beta.pr58.98

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,7 @@ import { confirm } 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 { MISSING_TEMPLATES } from '../../lib/messages.js';
6
+ import { MISSING_TEMPLATES, restoredFromServerHint, } from '../../lib/messages.js';
7
7
  import { buildDeployPayload } from '../../lib/commands/deploy/payload.js';
8
8
  import { logDeploySuccessInstructions, logPreDeploySummary, } from '../../lib/commands/deploy/output.js';
9
9
  import { pauseSequence, resumeSequence, } from '../../lib/commands/deploy/sequence-status.js';
@@ -44,8 +44,10 @@ export default class Deploy extends BaseCommand {
44
44
  const yamlConfig = await this.ensureYaml();
45
45
  const missingIds = getMissingTemplateIds(yamlConfig);
46
46
  if (missingIds.length > 0) {
47
- const regenerated = await handleMissingTemplates(ctx, yamlConfig, missingIds, baseFlags);
48
- if (regenerated)
47
+ const result = await handleMissingTemplates(ctx, yamlConfig, missingIds, baseFlags);
48
+ if (result === 'restored')
49
+ ctx.log(`\n ${chalk.green('✓')} ${restoredFromServerHint(missingIds)}\n`);
50
+ else if (result === 'regenerated')
49
51
  ctx.log(`\n ${chalk.green('✓')} ${MISSING_TEMPLATES.REVIEW_HINT}\n`);
50
52
  return;
51
53
  }
@@ -63,6 +63,7 @@ export declare const DEPLOY: {
63
63
  readonly SDK_ONBOARDING_HEADER: string;
64
64
  readonly SUCCESS: `${string} Emails are live.`;
65
65
  };
66
+ export declare function restoredFromServerHint(ids: string[]): string;
66
67
  export declare function pauseSuccess(sequenceId: string): string;
67
68
  export declare function pauseAlready(sequenceId: string): string;
68
69
  export declare function resumeSuccess(sequenceId: string): string;
@@ -63,6 +63,16 @@ export const DEPLOY = {
63
63
  SDK_ONBOARDING_HEADER: chalk.bold('ADD THIS TO YOUR APP (one-time only):'),
64
64
  SUCCESS: `${chalk.green('Deployed.')} Emails are live.`,
65
65
  };
66
+ export function restoredFromServerHint(ids) {
67
+ if (ids.length === 1) {
68
+ const [id] = ids;
69
+ return (`Template ${chalk.cyan(id)} was not found locally and has been refreshed from the server.\n` +
70
+ ` Review it with ${chalk.cyan(`mailmodo preview ${id}`)}, then run ${chalk.cyan('mailmodo deploy')} again.`);
71
+ }
72
+ const list = ids.map((id) => chalk.cyan(id)).join(', ');
73
+ return (`${ids.length} templates were not found locally and have been refreshed from the server: ${list}.\n` +
74
+ ` Review each with ${chalk.cyan('mailmodo preview <id>')}, then run ${chalk.cyan('mailmodo deploy')} again.`);
75
+ }
66
76
  export function pauseSuccess(sequenceId) {
67
77
  return `Sequence ${chalk.cyan(sequenceId)} paused. Run ${chalk.cyan(`mailmodo deploy --resume ${sequenceId}`)} to resume.`;
68
78
  }
@@ -16,4 +16,4 @@ export declare function getMissingTemplateIds(yamlConfig: MailmodoYaml): string[
16
16
  * Returns true if the situation was resolved (restored or regenerated), false
17
17
  * if the user chose to abort.
18
18
  */
19
- export declare function handleMissingTemplates(ctx: RegenCtx, yamlConfig: MailmodoYaml, missingIds: string[], flags: DeployFlags): Promise<boolean>;
19
+ export declare function handleMissingTemplates(ctx: RegenCtx, yamlConfig: MailmodoYaml, missingIds: string[], flags: DeployFlags): Promise<'regenerated' | 'restored' | false>;
@@ -39,7 +39,7 @@ export async function handleMissingTemplates(ctx, yamlConfig, missingIds, flags)
39
39
  // Try to silently recover from server before interrupting the user
40
40
  const stillMissing = await silentlyRestoreFromServer(ctx, missingIds);
41
41
  if (stillMissing.length === 0)
42
- return true;
42
+ return 'restored';
43
43
  if (flags.json) {
44
44
  ctx.log(JSON.stringify({
45
45
  error: 'missing_templates',
@@ -69,5 +69,5 @@ export async function handleMissingTemplates(ctx, yamlConfig, missingIds, flags)
69
69
  return false;
70
70
  }
71
71
  await regenerateMissingTemplates(ctx, yamlConfig, stillMissing, flags);
72
- return true;
72
+ return 'regenerated';
73
73
  }
@@ -237,19 +237,14 @@
237
237
  "index.js"
238
238
  ]
239
239
  },
240
- "edit": {
240
+ "domain": {
241
241
  "aliases": [],
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",
242
+ "args": {},
243
+ "description": "Set up and verify your sending domain",
250
244
  "examples": [
251
- "<%= config.bin %> edit welcome",
252
- "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
245
+ "<%= config.bin %> domain",
246
+ "<%= config.bin %> domain --verify",
247
+ "<%= config.bin %> domain --status"
253
248
  ],
254
249
  "flags": {
255
250
  "json": {
@@ -265,17 +260,22 @@
265
260
  "allowNo": false,
266
261
  "type": "boolean"
267
262
  },
268
- "change": {
269
- "description": "Natural language description of the change",
270
- "name": "change",
271
- "hasDynamicHelp": false,
272
- "multiple": false,
273
- "type": "option"
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
274
  }
275
275
  },
276
276
  "hasDynamicHelp": false,
277
277
  "hiddenAliases": [],
278
- "id": "edit",
278
+ "id": "domain",
279
279
  "pluginAlias": "@mailmodo/cli",
280
280
  "pluginName": "@mailmodo/cli",
281
281
  "pluginType": "core",
@@ -285,18 +285,23 @@
285
285
  "relativePath": [
286
286
  "dist",
287
287
  "commands",
288
- "edit",
288
+ "domain",
289
289
  "index.js"
290
290
  ]
291
291
  },
292
- "domain": {
292
+ "edit": {
293
293
  "aliases": [],
294
- "args": {},
295
- "description": "Set up and verify your sending domain",
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",
296
302
  "examples": [
297
- "<%= config.bin %> domain",
298
- "<%= config.bin %> domain --verify",
299
- "<%= config.bin %> domain --status"
303
+ "<%= config.bin %> edit welcome",
304
+ "<%= config.bin %> edit welcome --change \"make subject more urgent\" --yes"
300
305
  ],
301
306
  "flags": {
302
307
  "json": {
@@ -312,22 +317,17 @@
312
317
  "allowNo": false,
313
318
  "type": "boolean"
314
319
  },
315
- "status": {
316
- "description": "Show domain health status",
317
- "name": "status",
318
- "allowNo": false,
319
- "type": "boolean"
320
- },
321
- "verify": {
322
- "description": "Verify DNS records",
323
- "name": "verify",
324
- "allowNo": false,
325
- "type": "boolean"
320
+ "change": {
321
+ "description": "Natural language description of the change",
322
+ "name": "change",
323
+ "hasDynamicHelp": false,
324
+ "multiple": false,
325
+ "type": "option"
326
326
  }
327
327
  },
328
328
  "hasDynamicHelp": false,
329
329
  "hiddenAliases": [],
330
- "id": "domain",
330
+ "id": "edit",
331
331
  "pluginAlias": "@mailmodo/cli",
332
332
  "pluginName": "@mailmodo/cli",
333
333
  "pluginType": "core",
@@ -337,7 +337,7 @@
337
337
  "relativePath": [
338
338
  "dist",
339
339
  "commands",
340
- "domain",
340
+ "edit",
341
341
  "index.js"
342
342
  ]
343
343
  },
@@ -765,5 +765,5 @@
765
765
  ]
766
766
  }
767
767
  },
768
- "version": "0.0.56-beta.pr58.97"
768
+ "version": "0.0.56-beta.pr58.98"
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.97",
4
+ "version": "0.0.56-beta.pr58.98",
5
5
  "author": "provishalk",
6
6
  "bin": {
7
7
  "mailmodo": "bin/run.js"