@mailmodo/cli 0.0.56-beta.pr58.96 → 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.
- package/dist/commands/deploy/index.js +5 -3
- package/dist/lib/constants.js +3 -3
- package/dist/lib/messages.d.ts +1 -0
- package/dist/lib/messages.js +10 -0
- package/dist/lib/templates/missing-templates.d.ts +1 -1
- package/dist/lib/templates/missing-templates.js +2 -2
- package/oclif.manifest.json +79 -79
- package/package.json +1 -1
|
@@ -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
|
|
48
|
-
if (
|
|
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
|
}
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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.dev';
|
|
3
4
|
/**
|
|
4
5
|
* True when the CLI is running in a dev/debug context. Verbose request
|
|
5
6
|
* diagnostics (URL, status, response body, error code) are only surfaced
|
|
6
7
|
* when this is true so end users never see internal request metadata.
|
|
7
8
|
*/
|
|
8
9
|
export const IS_DEV_MODE = Boolean(process.env.MAILMODO_DEV_TSX || process.env.MAILMODO_DEBUG);
|
|
9
|
-
const PRODUCTION_API_BASE_URL = 'https://api.mailmodo.dev';
|
|
10
10
|
export const API_BASE_URL = process.env.MAILMODO_DEV_TSX
|
|
11
11
|
? DEV_API_BASE_URL
|
|
12
12
|
: PRODUCTION_API_BASE_URL;
|
|
@@ -36,8 +36,8 @@ export const API_ENDPOINTS = Object.freeze({
|
|
|
36
36
|
SEQUENCES_SDK: '/sequences/sdk',
|
|
37
37
|
SEQUENCES_VALIDATE: '/sequences/validate',
|
|
38
38
|
});
|
|
39
|
-
const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup
|
|
40
|
-
const PRODUCTION_LOGIN_URL = 'https://app.mailmodo.dev';
|
|
39
|
+
const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup';
|
|
40
|
+
const PRODUCTION_LOGIN_URL = 'https://app.mailmodo.dev/signup';
|
|
41
41
|
export const LOGIN_URL = process.env.MAILMODO_DEV_TSX
|
|
42
42
|
? DEV_LOGIN_URL
|
|
43
43
|
: PRODUCTION_LOGIN_URL;
|
package/dist/lib/messages.d.ts
CHANGED
|
@@ -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;
|
package/dist/lib/messages.js
CHANGED
|
@@ -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<
|
|
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
|
|
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
|
|
72
|
+
return 'regenerated';
|
|
73
73
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -137,6 +137,67 @@
|
|
|
137
137
|
"index.js"
|
|
138
138
|
]
|
|
139
139
|
},
|
|
140
|
+
"deploy": {
|
|
141
|
+
"aliases": [],
|
|
142
|
+
"args": {},
|
|
143
|
+
"description": "Deploy, pause, or resume an email sequence",
|
|
144
|
+
"examples": [
|
|
145
|
+
"<%= config.bin %> deploy",
|
|
146
|
+
"<%= config.bin %> deploy --yes",
|
|
147
|
+
"<%= config.bin %> deploy --pause seq_abc123",
|
|
148
|
+
"<%= config.bin %> deploy --resume seq_abc123 --json"
|
|
149
|
+
],
|
|
150
|
+
"flags": {
|
|
151
|
+
"json": {
|
|
152
|
+
"description": "Output as JSON",
|
|
153
|
+
"name": "json",
|
|
154
|
+
"allowNo": false,
|
|
155
|
+
"type": "boolean"
|
|
156
|
+
},
|
|
157
|
+
"yes": {
|
|
158
|
+
"char": "y",
|
|
159
|
+
"description": "Skip confirmation prompts",
|
|
160
|
+
"name": "yes",
|
|
161
|
+
"allowNo": false,
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
},
|
|
164
|
+
"pause": {
|
|
165
|
+
"description": "Pause a deployed sequence by ID (stops scheduled + triggered sends)",
|
|
166
|
+
"exclusive": [
|
|
167
|
+
"resume"
|
|
168
|
+
],
|
|
169
|
+
"name": "pause",
|
|
170
|
+
"hasDynamicHelp": false,
|
|
171
|
+
"multiple": false,
|
|
172
|
+
"type": "option"
|
|
173
|
+
},
|
|
174
|
+
"resume": {
|
|
175
|
+
"description": "Resume a paused sequence by ID",
|
|
176
|
+
"exclusive": [
|
|
177
|
+
"pause"
|
|
178
|
+
],
|
|
179
|
+
"name": "resume",
|
|
180
|
+
"hasDynamicHelp": false,
|
|
181
|
+
"multiple": false,
|
|
182
|
+
"type": "option"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"hasDynamicHelp": false,
|
|
186
|
+
"hiddenAliases": [],
|
|
187
|
+
"id": "deploy",
|
|
188
|
+
"pluginAlias": "@mailmodo/cli",
|
|
189
|
+
"pluginName": "@mailmodo/cli",
|
|
190
|
+
"pluginType": "core",
|
|
191
|
+
"strict": true,
|
|
192
|
+
"enableJsonFlag": false,
|
|
193
|
+
"isESM": true,
|
|
194
|
+
"relativePath": [
|
|
195
|
+
"dist",
|
|
196
|
+
"commands",
|
|
197
|
+
"deploy",
|
|
198
|
+
"index.js"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
140
201
|
"deployments": {
|
|
141
202
|
"aliases": [],
|
|
142
203
|
"args": {},
|
|
@@ -176,15 +237,14 @@
|
|
|
176
237
|
"index.js"
|
|
177
238
|
]
|
|
178
239
|
},
|
|
179
|
-
"
|
|
240
|
+
"domain": {
|
|
180
241
|
"aliases": [],
|
|
181
242
|
"args": {},
|
|
182
|
-
"description": "
|
|
243
|
+
"description": "Set up and verify your sending domain",
|
|
183
244
|
"examples": [
|
|
184
|
-
"<%= config.bin %>
|
|
185
|
-
"<%= config.bin %>
|
|
186
|
-
"<%= config.bin %>
|
|
187
|
-
"<%= config.bin %> deploy --resume seq_abc123 --json"
|
|
245
|
+
"<%= config.bin %> domain",
|
|
246
|
+
"<%= config.bin %> domain --verify",
|
|
247
|
+
"<%= config.bin %> domain --status"
|
|
188
248
|
],
|
|
189
249
|
"flags": {
|
|
190
250
|
"json": {
|
|
@@ -200,30 +260,22 @@
|
|
|
200
260
|
"allowNo": false,
|
|
201
261
|
"type": "boolean"
|
|
202
262
|
},
|
|
203
|
-
"
|
|
204
|
-
"description": "
|
|
205
|
-
"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"name": "pause",
|
|
209
|
-
"hasDynamicHelp": false,
|
|
210
|
-
"multiple": false,
|
|
211
|
-
"type": "option"
|
|
263
|
+
"status": {
|
|
264
|
+
"description": "Show domain health status",
|
|
265
|
+
"name": "status",
|
|
266
|
+
"allowNo": false,
|
|
267
|
+
"type": "boolean"
|
|
212
268
|
},
|
|
213
|
-
"
|
|
214
|
-
"description": "
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"name": "resume",
|
|
219
|
-
"hasDynamicHelp": false,
|
|
220
|
-
"multiple": false,
|
|
221
|
-
"type": "option"
|
|
269
|
+
"verify": {
|
|
270
|
+
"description": "Verify DNS records",
|
|
271
|
+
"name": "verify",
|
|
272
|
+
"allowNo": false,
|
|
273
|
+
"type": "boolean"
|
|
222
274
|
}
|
|
223
275
|
},
|
|
224
276
|
"hasDynamicHelp": false,
|
|
225
277
|
"hiddenAliases": [],
|
|
226
|
-
"id": "
|
|
278
|
+
"id": "domain",
|
|
227
279
|
"pluginAlias": "@mailmodo/cli",
|
|
228
280
|
"pluginName": "@mailmodo/cli",
|
|
229
281
|
"pluginType": "core",
|
|
@@ -233,7 +285,7 @@
|
|
|
233
285
|
"relativePath": [
|
|
234
286
|
"dist",
|
|
235
287
|
"commands",
|
|
236
|
-
"
|
|
288
|
+
"domain",
|
|
237
289
|
"index.js"
|
|
238
290
|
]
|
|
239
291
|
},
|
|
@@ -328,58 +380,6 @@
|
|
|
328
380
|
"index.js"
|
|
329
381
|
]
|
|
330
382
|
},
|
|
331
|
-
"domain": {
|
|
332
|
-
"aliases": [],
|
|
333
|
-
"args": {},
|
|
334
|
-
"description": "Set up and verify your sending domain",
|
|
335
|
-
"examples": [
|
|
336
|
-
"<%= config.bin %> domain",
|
|
337
|
-
"<%= config.bin %> domain --verify",
|
|
338
|
-
"<%= config.bin %> domain --status"
|
|
339
|
-
],
|
|
340
|
-
"flags": {
|
|
341
|
-
"json": {
|
|
342
|
-
"description": "Output as JSON",
|
|
343
|
-
"name": "json",
|
|
344
|
-
"allowNo": false,
|
|
345
|
-
"type": "boolean"
|
|
346
|
-
},
|
|
347
|
-
"yes": {
|
|
348
|
-
"char": "y",
|
|
349
|
-
"description": "Skip confirmation prompts",
|
|
350
|
-
"name": "yes",
|
|
351
|
-
"allowNo": false,
|
|
352
|
-
"type": "boolean"
|
|
353
|
-
},
|
|
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"
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
"hasDynamicHelp": false,
|
|
368
|
-
"hiddenAliases": [],
|
|
369
|
-
"id": "domain",
|
|
370
|
-
"pluginAlias": "@mailmodo/cli",
|
|
371
|
-
"pluginName": "@mailmodo/cli",
|
|
372
|
-
"pluginType": "core",
|
|
373
|
-
"strict": true,
|
|
374
|
-
"enableJsonFlag": false,
|
|
375
|
-
"isESM": true,
|
|
376
|
-
"relativePath": [
|
|
377
|
-
"dist",
|
|
378
|
-
"commands",
|
|
379
|
-
"domain",
|
|
380
|
-
"index.js"
|
|
381
|
-
]
|
|
382
|
-
},
|
|
383
383
|
"init": {
|
|
384
384
|
"aliases": [],
|
|
385
385
|
"args": {},
|
|
@@ -765,5 +765,5 @@
|
|
|
765
765
|
]
|
|
766
766
|
}
|
|
767
767
|
},
|
|
768
|
-
"version": "0.0.56-beta.pr58.
|
|
768
|
+
"version": "0.0.56-beta.pr58.98"
|
|
769
769
|
}
|
package/package.json
CHANGED