@mailmodo/cli 0.0.33 → 0.0.34-beta.pr36.59
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.
|
@@ -2,8 +2,8 @@ import { confirm, input } from '@inquirer/prompts';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
4
4
|
import { API_ENDPOINTS, DEFAULT_BRAND_COLOR, DEFAULT_MONTHLY_CAP, } from '../../lib/constants.js';
|
|
5
|
-
import { ERRORS, INFO, PROMPTS, SEPARATOR
|
|
6
|
-
import { loadTemplate,
|
|
5
|
+
import { ERRORS, INFO, PROMPTS, SEPARATOR } from '../../lib/messages.js';
|
|
6
|
+
import { loadTemplate, } from '../../lib/yaml-config.js';
|
|
7
7
|
export default class Deploy extends BaseCommand {
|
|
8
8
|
static description = 'Deploy email sequences and verify sending domain';
|
|
9
9
|
static examples = [
|
|
@@ -220,72 +220,22 @@ export default class Deploy extends BaseCommand {
|
|
|
220
220
|
this.log(` ${SEPARATOR}\n`);
|
|
221
221
|
}
|
|
222
222
|
async runDomainSetup(yamlConfig, flags) {
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
domain,
|
|
227
|
-
fromEmail: senderEmail,
|
|
228
|
-
}));
|
|
229
|
-
if (!domainResponse.ok) {
|
|
230
|
-
this.handleApiError(domainResponse);
|
|
231
|
-
}
|
|
232
|
-
yamlConfig.project.domain = domain;
|
|
233
|
-
yamlConfig.project.fromEmail = senderEmail;
|
|
234
|
-
yamlConfig.project.address = address;
|
|
235
|
-
await saveYaml(yamlConfig);
|
|
236
|
-
this.showDnsRecords(domainResponse.data?.dnsRecords || [], flags.json, domainResponse.data?.dnsGuideUrl);
|
|
223
|
+
const inputs = await this.collectDomainSetupInputs(yamlConfig, flags.yes);
|
|
224
|
+
const { dnsRecords, dnsGuideUrl } = await this.registerDomain(yamlConfig, inputs, flags.json);
|
|
225
|
+
this.logDnsRecords(dnsRecords, dnsGuideUrl, flags.json);
|
|
237
226
|
if (flags.yes) {
|
|
238
|
-
return this.verifyDomain(flags.json, domain);
|
|
227
|
+
return this.verifyDomain(flags.json, inputs.domain);
|
|
239
228
|
}
|
|
240
229
|
const action = await input({
|
|
241
230
|
default: '',
|
|
242
|
-
message:
|
|
231
|
+
message: PROMPTS.ENTER_AFTER_RECORDS,
|
|
243
232
|
});
|
|
244
233
|
if (action.toLowerCase() === 'skip') {
|
|
245
234
|
this.log(`\n ${INFO.SEQUENCES_NOT_DEPLOYED}`);
|
|
246
235
|
this.log(` ${INFO.DOMAIN_NOT_DEPLOYED_HINT}\n`);
|
|
247
236
|
return false;
|
|
248
237
|
}
|
|
249
|
-
return this.verifyDomain(flags.json, domain);
|
|
250
|
-
}
|
|
251
|
-
async collectDomainInputs(yamlConfig, flags) {
|
|
252
|
-
if (flags.yes) {
|
|
253
|
-
return {
|
|
254
|
-
address: yamlConfig.project?.address || '',
|
|
255
|
-
domain: yamlConfig.project?.domain || '',
|
|
256
|
-
senderEmail: yamlConfig.project?.fromEmail || '',
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
this.log(`\n ${SEPARATOR}`);
|
|
260
|
-
this.log(` ${chalk.bold('DOMAIN SETUP')}`);
|
|
261
|
-
this.log(` ${SEPARATOR}\n`);
|
|
262
|
-
const domain = await input({
|
|
263
|
-
message: PROMPTS.DOMAIN,
|
|
264
|
-
validate: (v) => (v?.trim() ? true : VALIDATION.DOMAIN_REQUIRED),
|
|
265
|
-
});
|
|
266
|
-
const senderEmail = await input({
|
|
267
|
-
message: PROMPTS.SENDER_EMAIL,
|
|
268
|
-
validate: (v) => (v?.includes('@') ? true : VALIDATION.EMAIL_INVALID),
|
|
269
|
-
});
|
|
270
|
-
const address = await input({
|
|
271
|
-
message: PROMPTS.BUSINESS_ADDRESS,
|
|
272
|
-
validate: (v) => (v?.trim() ? true : VALIDATION.ADDRESS_REQUIRED),
|
|
273
|
-
});
|
|
274
|
-
return { address, domain, senderEmail };
|
|
275
|
-
}
|
|
276
|
-
showDnsRecords(dnsRecords, jsonOutput, dnsGuideUrl) {
|
|
277
|
-
if (jsonOutput)
|
|
278
|
-
return;
|
|
279
|
-
this.log(`\n Add these ${dnsRecords.length} DNS records to your domain provider:\n`);
|
|
280
|
-
for (const [i, record] of dnsRecords.entries()) {
|
|
281
|
-
this.log(` ${chalk.bold(`RECORD ${i + 1}`)}`);
|
|
282
|
-
this.log(` Type: ${record.type}`);
|
|
283
|
-
this.log(` Host: ${record.host}`);
|
|
284
|
-
this.log(` Value: ${record.value}\n`);
|
|
285
|
-
}
|
|
286
|
-
this.log(` ${INFO.DNS_PROPAGATION}`);
|
|
287
|
-
if (dnsGuideUrl)
|
|
288
|
-
this.log(` Full guide: ${chalk.cyan(dnsGuideUrl)}\n`);
|
|
238
|
+
return this.verifyDomain(flags.json, inputs.domain);
|
|
289
239
|
}
|
|
290
240
|
async verifyDomain(jsonOutput, domain) {
|
|
291
241
|
const verify = await this.withApiSpinner({ json: jsonOutput, text: ' Checking DNS...' }, () => this.apiClient.get(API_ENDPOINTS.DOMAIN_VERIFY, {
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const API_ENDPOINTS: Readonly<{
|
|
|
22
22
|
SEQUENCES_DEPLOY: "/sequences/deploy";
|
|
23
23
|
SEQUENCES_VALIDATE: "/sequences/validate";
|
|
24
24
|
}>;
|
|
25
|
-
export declare const LOGIN_URL = "https://app-vertex-debug.azurewebsites.net/
|
|
25
|
+
export declare const LOGIN_URL = "https://app-vertex-debug.azurewebsites.net/signup.html";
|
|
26
26
|
export declare const DOCS_URL = "https://mailmodo.com/docs/cli";
|
|
27
27
|
export declare const DNS_GUIDE_URL = "https://mailmodo.com/docs/dns";
|
|
28
28
|
export declare const PREVIEW_PORT = 3421;
|
package/dist/lib/constants.js
CHANGED
|
@@ -28,9 +28,9 @@ export const API_ENDPOINTS = Object.freeze({
|
|
|
28
28
|
SEQUENCES_DEPLOY: '/sequences/deploy',
|
|
29
29
|
SEQUENCES_VALIDATE: '/sequences/validate',
|
|
30
30
|
});
|
|
31
|
-
const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/
|
|
31
|
+
const DEV_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
|
|
32
32
|
// const PRODUCTION_LOGIN_URL = 'https://mailmodo.com/cli';
|
|
33
|
-
const PRODUCTION_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/
|
|
33
|
+
const PRODUCTION_LOGIN_URL = 'https://app-vertex-debug.azurewebsites.net/signup.html';
|
|
34
34
|
export const LOGIN_URL = process.env.MAILMODO_DEV_TSX
|
|
35
35
|
? DEV_LOGIN_URL
|
|
36
36
|
: PRODUCTION_LOGIN_URL;
|
package/oclif.manifest.json
CHANGED
|
@@ -280,13 +280,13 @@
|
|
|
280
280
|
"index.js"
|
|
281
281
|
]
|
|
282
282
|
},
|
|
283
|
-
"
|
|
283
|
+
"emails": {
|
|
284
284
|
"aliases": [],
|
|
285
285
|
"args": {},
|
|
286
|
-
"description": "
|
|
286
|
+
"description": "List and view configured email sequences",
|
|
287
287
|
"examples": [
|
|
288
|
-
"<%= config.bin %>
|
|
289
|
-
"<%= config.bin %>
|
|
288
|
+
"<%= config.bin %> emails",
|
|
289
|
+
"<%= config.bin %> emails --json"
|
|
290
290
|
],
|
|
291
291
|
"flags": {
|
|
292
292
|
"json": {
|
|
@@ -301,18 +301,11 @@
|
|
|
301
301
|
"name": "yes",
|
|
302
302
|
"allowNo": false,
|
|
303
303
|
"type": "boolean"
|
|
304
|
-
},
|
|
305
|
-
"url": {
|
|
306
|
-
"description": "Product URL to analyze",
|
|
307
|
-
"name": "url",
|
|
308
|
-
"hasDynamicHelp": false,
|
|
309
|
-
"multiple": false,
|
|
310
|
-
"type": "option"
|
|
311
304
|
}
|
|
312
305
|
},
|
|
313
306
|
"hasDynamicHelp": false,
|
|
314
307
|
"hiddenAliases": [],
|
|
315
|
-
"id": "
|
|
308
|
+
"id": "emails",
|
|
316
309
|
"pluginAlias": "@mailmodo/cli",
|
|
317
310
|
"pluginName": "@mailmodo/cli",
|
|
318
311
|
"pluginType": "core",
|
|
@@ -322,17 +315,17 @@
|
|
|
322
315
|
"relativePath": [
|
|
323
316
|
"dist",
|
|
324
317
|
"commands",
|
|
325
|
-
"
|
|
318
|
+
"emails",
|
|
326
319
|
"index.js"
|
|
327
320
|
]
|
|
328
321
|
},
|
|
329
|
-
"
|
|
322
|
+
"init": {
|
|
330
323
|
"aliases": [],
|
|
331
324
|
"args": {},
|
|
332
|
-
"description": "
|
|
325
|
+
"description": "Analyze your product and generate email sequences",
|
|
333
326
|
"examples": [
|
|
334
|
-
"<%= config.bin %>
|
|
335
|
-
"<%= config.bin %>
|
|
327
|
+
"<%= config.bin %> init",
|
|
328
|
+
"<%= config.bin %> init --url https://myapp.com --yes"
|
|
336
329
|
],
|
|
337
330
|
"flags": {
|
|
338
331
|
"json": {
|
|
@@ -347,11 +340,18 @@
|
|
|
347
340
|
"name": "yes",
|
|
348
341
|
"allowNo": false,
|
|
349
342
|
"type": "boolean"
|
|
343
|
+
},
|
|
344
|
+
"url": {
|
|
345
|
+
"description": "Product URL to analyze",
|
|
346
|
+
"name": "url",
|
|
347
|
+
"hasDynamicHelp": false,
|
|
348
|
+
"multiple": false,
|
|
349
|
+
"type": "option"
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
"hasDynamicHelp": false,
|
|
353
353
|
"hiddenAliases": [],
|
|
354
|
-
"id": "
|
|
354
|
+
"id": "init",
|
|
355
355
|
"pluginAlias": "@mailmodo/cli",
|
|
356
356
|
"pluginName": "@mailmodo/cli",
|
|
357
357
|
"pluginType": "core",
|
|
@@ -361,7 +361,7 @@
|
|
|
361
361
|
"relativePath": [
|
|
362
362
|
"dist",
|
|
363
363
|
"commands",
|
|
364
|
-
"
|
|
364
|
+
"init",
|
|
365
365
|
"index.js"
|
|
366
366
|
]
|
|
367
367
|
},
|
|
@@ -657,5 +657,5 @@
|
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.
|
|
660
|
+
"version": "0.0.34-beta.pr36.59"
|
|
661
661
|
}
|