@mailmodo/cli 0.0.27-beta.pr30.46 → 0.0.28-beta.pr29.47
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/domain/index.js +23 -4
- package/oclif.manifest.json +64 -64
- package/package.json +1 -1
|
@@ -45,18 +45,27 @@ export default class Domain extends BaseCommand {
|
|
|
45
45
|
this.log(`\n ${'─'.repeat(53)}`);
|
|
46
46
|
this.log(` ${chalk.bold('DOMAIN SETUP')}`);
|
|
47
47
|
this.log(` ${'─'.repeat(53)}\n`);
|
|
48
|
-
const { domain, senderEmail, address } = await this.collectDomainInputs(flags.yes, yamlConfig);
|
|
49
|
-
const
|
|
48
|
+
const { domain, senderEmail, fromName, replyTo, address } = await this.collectDomainInputs(flags.yes, yamlConfig);
|
|
49
|
+
const apiPayload = {
|
|
50
50
|
address,
|
|
51
51
|
domain,
|
|
52
52
|
fromEmail: senderEmail,
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
|
+
if (fromName)
|
|
55
|
+
apiPayload.fromName = fromName;
|
|
56
|
+
if (replyTo)
|
|
57
|
+
apiPayload.replyTo = replyTo;
|
|
58
|
+
const response = await this.withApiSpinner({ json: flags.json, text: ' Configuring domain...' }, () => this.apiClient.post(API_ENDPOINTS.DOMAIN, apiPayload));
|
|
54
59
|
if (!response.ok) {
|
|
55
60
|
this.handleApiError(response);
|
|
56
61
|
}
|
|
57
62
|
yamlConfig.project.domain = domain;
|
|
58
63
|
yamlConfig.project.fromEmail = senderEmail;
|
|
59
64
|
yamlConfig.project.address = address;
|
|
65
|
+
if (fromName)
|
|
66
|
+
yamlConfig.project.fromName = fromName;
|
|
67
|
+
if (replyTo)
|
|
68
|
+
yamlConfig.project.replyTo = replyTo;
|
|
60
69
|
await saveYaml(yamlConfig);
|
|
61
70
|
await saveConfig({ ...config, domain });
|
|
62
71
|
const records = response.data?.dnsRecords || [];
|
|
@@ -161,6 +170,8 @@ export default class Domain extends BaseCommand {
|
|
|
161
170
|
return {
|
|
162
171
|
address: yamlConfig.project?.address || '',
|
|
163
172
|
domain,
|
|
173
|
+
fromName: yamlConfig.project?.fromName || '',
|
|
174
|
+
replyTo: yamlConfig.project?.replyTo || '',
|
|
164
175
|
senderEmail: yamlConfig.project?.fromEmail || '',
|
|
165
176
|
};
|
|
166
177
|
}
|
|
@@ -174,12 +185,20 @@ export default class Domain extends BaseCommand {
|
|
|
174
185
|
message: 'Sender email address:',
|
|
175
186
|
validate: (v) => (v?.includes('@') ? true : 'Please enter a valid email'),
|
|
176
187
|
});
|
|
188
|
+
const fromName = await input({
|
|
189
|
+
default: yamlConfig.project?.fromName || '',
|
|
190
|
+
message: 'Display name (optional, shown as sender name):',
|
|
191
|
+
});
|
|
192
|
+
const replyTo = await input({
|
|
193
|
+
default: yamlConfig.project?.replyTo || '',
|
|
194
|
+
message: 'Reply-to address (optional, press Enter to use sender email):',
|
|
195
|
+
});
|
|
177
196
|
const address = await input({
|
|
178
197
|
default: yamlConfig.project?.address,
|
|
179
198
|
message: 'Business address (required by law):',
|
|
180
199
|
validate: (v) => (v?.trim() ? true : 'Address is required'),
|
|
181
200
|
});
|
|
182
|
-
return { address, domain, senderEmail };
|
|
201
|
+
return { address, domain, fromName, replyTo, senderEmail };
|
|
183
202
|
}
|
|
184
203
|
recordLabel(index) {
|
|
185
204
|
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
package/oclif.manifest.json
CHANGED
|
@@ -442,19 +442,15 @@
|
|
|
442
442
|
"index.js"
|
|
443
443
|
]
|
|
444
444
|
},
|
|
445
|
-
"
|
|
445
|
+
"logs": {
|
|
446
446
|
"aliases": [],
|
|
447
|
-
"args": {
|
|
448
|
-
|
|
449
|
-
"description": "Email template ID to preview",
|
|
450
|
-
"name": "id"
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
"description": "Preview an email in browser, as text, or send a test",
|
|
447
|
+
"args": {},
|
|
448
|
+
"description": "View email send logs and delivery events",
|
|
454
449
|
"examples": [
|
|
455
|
-
"<%= config.bin %>
|
|
456
|
-
"<%= config.bin %>
|
|
457
|
-
"<%= config.bin %>
|
|
450
|
+
"<%= config.bin %> logs",
|
|
451
|
+
"<%= config.bin %> logs --email sarah@example.com",
|
|
452
|
+
"<%= config.bin %> logs --failed",
|
|
453
|
+
"<%= config.bin %> logs --json"
|
|
458
454
|
],
|
|
459
455
|
"flags": {
|
|
460
456
|
"json": {
|
|
@@ -470,23 +466,39 @@
|
|
|
470
466
|
"allowNo": false,
|
|
471
467
|
"type": "boolean"
|
|
472
468
|
},
|
|
473
|
-
"
|
|
474
|
-
"description": "
|
|
475
|
-
"name": "
|
|
469
|
+
"email": {
|
|
470
|
+
"description": "Filter logs by contact email",
|
|
471
|
+
"name": "email",
|
|
476
472
|
"hasDynamicHelp": false,
|
|
477
473
|
"multiple": false,
|
|
478
474
|
"type": "option"
|
|
479
475
|
},
|
|
480
|
-
"
|
|
481
|
-
"description": "
|
|
482
|
-
"name": "
|
|
476
|
+
"failed": {
|
|
477
|
+
"description": "Show only failed/bounced events",
|
|
478
|
+
"name": "failed",
|
|
483
479
|
"allowNo": false,
|
|
484
480
|
"type": "boolean"
|
|
481
|
+
},
|
|
482
|
+
"limit": {
|
|
483
|
+
"description": "Entries per page (max 200)",
|
|
484
|
+
"name": "limit",
|
|
485
|
+
"default": 50,
|
|
486
|
+
"hasDynamicHelp": false,
|
|
487
|
+
"multiple": false,
|
|
488
|
+
"type": "option"
|
|
489
|
+
},
|
|
490
|
+
"page": {
|
|
491
|
+
"description": "Page number",
|
|
492
|
+
"name": "page",
|
|
493
|
+
"default": 1,
|
|
494
|
+
"hasDynamicHelp": false,
|
|
495
|
+
"multiple": false,
|
|
496
|
+
"type": "option"
|
|
485
497
|
}
|
|
486
498
|
},
|
|
487
499
|
"hasDynamicHelp": false,
|
|
488
500
|
"hiddenAliases": [],
|
|
489
|
-
"id": "
|
|
501
|
+
"id": "logs",
|
|
490
502
|
"pluginAlias": "@mailmodo/cli",
|
|
491
503
|
"pluginName": "@mailmodo/cli",
|
|
492
504
|
"pluginType": "core",
|
|
@@ -496,7 +508,7 @@
|
|
|
496
508
|
"relativePath": [
|
|
497
509
|
"dist",
|
|
498
510
|
"commands",
|
|
499
|
-
"
|
|
511
|
+
"logs",
|
|
500
512
|
"index.js"
|
|
501
513
|
]
|
|
502
514
|
},
|
|
@@ -547,15 +559,13 @@
|
|
|
547
559
|
"index.js"
|
|
548
560
|
]
|
|
549
561
|
},
|
|
550
|
-
"
|
|
562
|
+
"status": {
|
|
551
563
|
"aliases": [],
|
|
552
564
|
"args": {},
|
|
553
|
-
"description": "View email
|
|
565
|
+
"description": "View email performance metrics and quota usage",
|
|
554
566
|
"examples": [
|
|
555
|
-
"<%= config.bin %>
|
|
556
|
-
"<%= config.bin %>
|
|
557
|
-
"<%= config.bin %> logs --failed",
|
|
558
|
-
"<%= config.bin %> logs --json"
|
|
567
|
+
"<%= config.bin %> status",
|
|
568
|
+
"<%= config.bin %> status --json"
|
|
559
569
|
],
|
|
560
570
|
"flags": {
|
|
561
571
|
"json": {
|
|
@@ -570,40 +580,11 @@
|
|
|
570
580
|
"name": "yes",
|
|
571
581
|
"allowNo": false,
|
|
572
582
|
"type": "boolean"
|
|
573
|
-
},
|
|
574
|
-
"email": {
|
|
575
|
-
"description": "Filter logs by contact email",
|
|
576
|
-
"name": "email",
|
|
577
|
-
"hasDynamicHelp": false,
|
|
578
|
-
"multiple": false,
|
|
579
|
-
"type": "option"
|
|
580
|
-
},
|
|
581
|
-
"failed": {
|
|
582
|
-
"description": "Show only failed/bounced events",
|
|
583
|
-
"name": "failed",
|
|
584
|
-
"allowNo": false,
|
|
585
|
-
"type": "boolean"
|
|
586
|
-
},
|
|
587
|
-
"limit": {
|
|
588
|
-
"description": "Entries per page (max 200)",
|
|
589
|
-
"name": "limit",
|
|
590
|
-
"default": 50,
|
|
591
|
-
"hasDynamicHelp": false,
|
|
592
|
-
"multiple": false,
|
|
593
|
-
"type": "option"
|
|
594
|
-
},
|
|
595
|
-
"page": {
|
|
596
|
-
"description": "Page number",
|
|
597
|
-
"name": "page",
|
|
598
|
-
"default": 1,
|
|
599
|
-
"hasDynamicHelp": false,
|
|
600
|
-
"multiple": false,
|
|
601
|
-
"type": "option"
|
|
602
583
|
}
|
|
603
584
|
},
|
|
604
585
|
"hasDynamicHelp": false,
|
|
605
586
|
"hiddenAliases": [],
|
|
606
|
-
"id": "
|
|
587
|
+
"id": "status",
|
|
607
588
|
"pluginAlias": "@mailmodo/cli",
|
|
608
589
|
"pluginName": "@mailmodo/cli",
|
|
609
590
|
"pluginType": "core",
|
|
@@ -613,17 +594,23 @@
|
|
|
613
594
|
"relativePath": [
|
|
614
595
|
"dist",
|
|
615
596
|
"commands",
|
|
616
|
-
"
|
|
597
|
+
"status",
|
|
617
598
|
"index.js"
|
|
618
599
|
]
|
|
619
600
|
},
|
|
620
|
-
"
|
|
601
|
+
"preview": {
|
|
621
602
|
"aliases": [],
|
|
622
|
-
"args": {
|
|
623
|
-
|
|
603
|
+
"args": {
|
|
604
|
+
"id": {
|
|
605
|
+
"description": "Email template ID to preview",
|
|
606
|
+
"name": "id"
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
"description": "Preview an email in browser, as text, or send a test",
|
|
624
610
|
"examples": [
|
|
625
|
-
"<%= config.bin %>
|
|
626
|
-
"<%= config.bin %>
|
|
611
|
+
"<%= config.bin %> preview welcome",
|
|
612
|
+
"<%= config.bin %> preview welcome --text",
|
|
613
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
627
614
|
],
|
|
628
615
|
"flags": {
|
|
629
616
|
"json": {
|
|
@@ -638,11 +625,24 @@
|
|
|
638
625
|
"name": "yes",
|
|
639
626
|
"allowNo": false,
|
|
640
627
|
"type": "boolean"
|
|
628
|
+
},
|
|
629
|
+
"send": {
|
|
630
|
+
"description": "Send test email to this address",
|
|
631
|
+
"name": "send",
|
|
632
|
+
"hasDynamicHelp": false,
|
|
633
|
+
"multiple": false,
|
|
634
|
+
"type": "option"
|
|
635
|
+
},
|
|
636
|
+
"text": {
|
|
637
|
+
"description": "Output plain text version (for AI agents)",
|
|
638
|
+
"name": "text",
|
|
639
|
+
"allowNo": false,
|
|
640
|
+
"type": "boolean"
|
|
641
641
|
}
|
|
642
642
|
},
|
|
643
643
|
"hasDynamicHelp": false,
|
|
644
644
|
"hiddenAliases": [],
|
|
645
|
-
"id": "
|
|
645
|
+
"id": "preview",
|
|
646
646
|
"pluginAlias": "@mailmodo/cli",
|
|
647
647
|
"pluginName": "@mailmodo/cli",
|
|
648
648
|
"pluginType": "core",
|
|
@@ -652,10 +652,10 @@
|
|
|
652
652
|
"relativePath": [
|
|
653
653
|
"dist",
|
|
654
654
|
"commands",
|
|
655
|
-
"
|
|
655
|
+
"preview",
|
|
656
656
|
"index.js"
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.
|
|
660
|
+
"version": "0.0.28-beta.pr29.47"
|
|
661
661
|
}
|
package/package.json
CHANGED