@mailmodo/cli 0.0.28-beta.pr29.47 → 0.0.28
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 +4 -23
- package/oclif.manifest.json +44 -44
- package/package.json +1 -1
|
@@ -45,27 +45,18 @@ 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,
|
|
49
|
-
const
|
|
48
|
+
const { domain, senderEmail, address } = await this.collectDomainInputs(flags.yes, yamlConfig);
|
|
49
|
+
const response = await this.withApiSpinner({ json: flags.json, text: ' Configuring domain...' }, () => this.apiClient.post(API_ENDPOINTS.DOMAIN, {
|
|
50
50
|
address,
|
|
51
51
|
domain,
|
|
52
52
|
fromEmail: senderEmail,
|
|
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));
|
|
53
|
+
}));
|
|
59
54
|
if (!response.ok) {
|
|
60
55
|
this.handleApiError(response);
|
|
61
56
|
}
|
|
62
57
|
yamlConfig.project.domain = domain;
|
|
63
58
|
yamlConfig.project.fromEmail = senderEmail;
|
|
64
59
|
yamlConfig.project.address = address;
|
|
65
|
-
if (fromName)
|
|
66
|
-
yamlConfig.project.fromName = fromName;
|
|
67
|
-
if (replyTo)
|
|
68
|
-
yamlConfig.project.replyTo = replyTo;
|
|
69
60
|
await saveYaml(yamlConfig);
|
|
70
61
|
await saveConfig({ ...config, domain });
|
|
71
62
|
const records = response.data?.dnsRecords || [];
|
|
@@ -170,8 +161,6 @@ export default class Domain extends BaseCommand {
|
|
|
170
161
|
return {
|
|
171
162
|
address: yamlConfig.project?.address || '',
|
|
172
163
|
domain,
|
|
173
|
-
fromName: yamlConfig.project?.fromName || '',
|
|
174
|
-
replyTo: yamlConfig.project?.replyTo || '',
|
|
175
164
|
senderEmail: yamlConfig.project?.fromEmail || '',
|
|
176
165
|
};
|
|
177
166
|
}
|
|
@@ -185,20 +174,12 @@ export default class Domain extends BaseCommand {
|
|
|
185
174
|
message: 'Sender email address:',
|
|
186
175
|
validate: (v) => (v?.includes('@') ? true : 'Please enter a valid email'),
|
|
187
176
|
});
|
|
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
|
-
});
|
|
196
177
|
const address = await input({
|
|
197
178
|
default: yamlConfig.project?.address,
|
|
198
179
|
message: 'Business address (required by law):',
|
|
199
180
|
validate: (v) => (v?.trim() ? true : 'Address is required'),
|
|
200
181
|
});
|
|
201
|
-
return { address, domain,
|
|
182
|
+
return { address, domain, senderEmail };
|
|
202
183
|
}
|
|
203
184
|
recordLabel(index) {
|
|
204
185
|
const labels = ['DKIM', 'DMARC', 'Return Path'];
|
package/oclif.manifest.json
CHANGED
|
@@ -512,14 +512,19 @@
|
|
|
512
512
|
"index.js"
|
|
513
513
|
]
|
|
514
514
|
},
|
|
515
|
-
"
|
|
515
|
+
"preview": {
|
|
516
516
|
"aliases": [],
|
|
517
|
-
"args": {
|
|
518
|
-
|
|
517
|
+
"args": {
|
|
518
|
+
"id": {
|
|
519
|
+
"description": "Email template ID to preview",
|
|
520
|
+
"name": "id"
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"description": "Preview an email in browser, as text, or send a test",
|
|
519
524
|
"examples": [
|
|
520
|
-
"<%= config.bin %>
|
|
521
|
-
"<%= config.bin %>
|
|
522
|
-
"<%= config.bin %>
|
|
525
|
+
"<%= config.bin %> preview welcome",
|
|
526
|
+
"<%= config.bin %> preview welcome --text",
|
|
527
|
+
"<%= config.bin %> preview welcome --send me@example.com"
|
|
523
528
|
],
|
|
524
529
|
"flags": {
|
|
525
530
|
"json": {
|
|
@@ -535,17 +540,23 @@
|
|
|
535
540
|
"allowNo": false,
|
|
536
541
|
"type": "boolean"
|
|
537
542
|
},
|
|
538
|
-
"
|
|
539
|
-
"description": "
|
|
540
|
-
"name": "
|
|
543
|
+
"send": {
|
|
544
|
+
"description": "Send test email to this address",
|
|
545
|
+
"name": "send",
|
|
541
546
|
"hasDynamicHelp": false,
|
|
542
547
|
"multiple": false,
|
|
543
548
|
"type": "option"
|
|
549
|
+
},
|
|
550
|
+
"text": {
|
|
551
|
+
"description": "Output plain text version (for AI agents)",
|
|
552
|
+
"name": "text",
|
|
553
|
+
"allowNo": false,
|
|
554
|
+
"type": "boolean"
|
|
544
555
|
}
|
|
545
556
|
},
|
|
546
557
|
"hasDynamicHelp": false,
|
|
547
558
|
"hiddenAliases": [],
|
|
548
|
-
"id": "
|
|
559
|
+
"id": "preview",
|
|
549
560
|
"pluginAlias": "@mailmodo/cli",
|
|
550
561
|
"pluginName": "@mailmodo/cli",
|
|
551
562
|
"pluginType": "core",
|
|
@@ -555,17 +566,18 @@
|
|
|
555
566
|
"relativePath": [
|
|
556
567
|
"dist",
|
|
557
568
|
"commands",
|
|
558
|
-
"
|
|
569
|
+
"preview",
|
|
559
570
|
"index.js"
|
|
560
571
|
]
|
|
561
572
|
},
|
|
562
|
-
"
|
|
573
|
+
"settings": {
|
|
563
574
|
"aliases": [],
|
|
564
575
|
"args": {},
|
|
565
|
-
"description": "View
|
|
576
|
+
"description": "View and update project settings",
|
|
566
577
|
"examples": [
|
|
567
|
-
"<%= config.bin %>
|
|
568
|
-
"<%= config.bin %>
|
|
578
|
+
"<%= config.bin %> settings",
|
|
579
|
+
"<%= config.bin %> settings --set brand_color=#0F3460",
|
|
580
|
+
"<%= config.bin %> settings --json"
|
|
569
581
|
],
|
|
570
582
|
"flags": {
|
|
571
583
|
"json": {
|
|
@@ -580,11 +592,18 @@
|
|
|
580
592
|
"name": "yes",
|
|
581
593
|
"allowNo": false,
|
|
582
594
|
"type": "boolean"
|
|
595
|
+
},
|
|
596
|
+
"set": {
|
|
597
|
+
"description": "Set a setting (format: key=value)",
|
|
598
|
+
"name": "set",
|
|
599
|
+
"hasDynamicHelp": false,
|
|
600
|
+
"multiple": false,
|
|
601
|
+
"type": "option"
|
|
583
602
|
}
|
|
584
603
|
},
|
|
585
604
|
"hasDynamicHelp": false,
|
|
586
605
|
"hiddenAliases": [],
|
|
587
|
-
"id": "
|
|
606
|
+
"id": "settings",
|
|
588
607
|
"pluginAlias": "@mailmodo/cli",
|
|
589
608
|
"pluginName": "@mailmodo/cli",
|
|
590
609
|
"pluginType": "core",
|
|
@@ -594,23 +613,17 @@
|
|
|
594
613
|
"relativePath": [
|
|
595
614
|
"dist",
|
|
596
615
|
"commands",
|
|
597
|
-
"
|
|
616
|
+
"settings",
|
|
598
617
|
"index.js"
|
|
599
618
|
]
|
|
600
619
|
},
|
|
601
|
-
"
|
|
620
|
+
"status": {
|
|
602
621
|
"aliases": [],
|
|
603
|
-
"args": {
|
|
604
|
-
|
|
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",
|
|
622
|
+
"args": {},
|
|
623
|
+
"description": "View email performance metrics and quota usage",
|
|
610
624
|
"examples": [
|
|
611
|
-
"<%= config.bin %>
|
|
612
|
-
"<%= config.bin %>
|
|
613
|
-
"<%= config.bin %> preview welcome --send me@example.com"
|
|
625
|
+
"<%= config.bin %> status",
|
|
626
|
+
"<%= config.bin %> status --json"
|
|
614
627
|
],
|
|
615
628
|
"flags": {
|
|
616
629
|
"json": {
|
|
@@ -625,24 +638,11 @@
|
|
|
625
638
|
"name": "yes",
|
|
626
639
|
"allowNo": false,
|
|
627
640
|
"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": "status",
|
|
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
|
+
"status",
|
|
656
656
|
"index.js"
|
|
657
657
|
]
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
|
-
"version": "0.0.28
|
|
660
|
+
"version": "0.0.28"
|
|
661
661
|
}
|