@velaro/cli 1.4.81 → 1.4.82
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/bin/velaro.js
CHANGED
|
@@ -105,6 +105,7 @@ import { featureDiscoveryCommand } from '../lib/commands/feature-discovery.js';
|
|
|
105
105
|
import { tourPolicyCommand } from '../lib/commands/tour-policy.js';
|
|
106
106
|
import { scraperCommand } from '../lib/commands/scraper.js';
|
|
107
107
|
import { campaignsCommand } from '../lib/commands/campaigns.js';
|
|
108
|
+
import { senderDomainHealthCommand } from '../lib/commands/sender-domain-health.js';
|
|
108
109
|
import { contactsCommand } from '../lib/commands/contacts.js';
|
|
109
110
|
import { contactListCommand } from '../lib/commands/contact-list.js';
|
|
110
111
|
import { startUpdateCheck } from '../lib/update-check.js';
|
|
@@ -223,6 +224,7 @@ await yargs(hideBin(process.argv))
|
|
|
223
224
|
.command({ command: 'scraper', desc: 'Velaro staff: scraper / upload / chunk usage for any site', builder: scraperCommand, handler: () => {} })
|
|
224
225
|
.command({ command: 'tour-policy', desc: 'Velaro staff: guided-tour auto-open policy (versioned, rollback-able)', builder: tourPolicyCommand, handler: () => {} })
|
|
225
226
|
.command(campaignsCommand)
|
|
227
|
+
.command(senderDomainHealthCommand)
|
|
226
228
|
.command(contactsCommand)
|
|
227
229
|
.command(contactListCommand)
|
|
228
230
|
.demandCommand(1, 'Specify a command. Run "velaro --help" for options.')
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* velaro sender-domain-health - registration expiry, DNS and email-provider state for your sending domains
|
|
3
|
+
*
|
|
4
|
+
* velaro sender-domain-health show Health + plain-language history
|
|
5
|
+
* velaro sender-domain-health settings View or change warning days / grace days
|
|
6
|
+
*/
|
|
7
|
+
import { request } from '../api.js';
|
|
8
|
+
import { runCommand } from '../run.js';
|
|
9
|
+
|
|
10
|
+
async function showHandler() {
|
|
11
|
+
const r = await request('GET', '/SenderDomains/Health');
|
|
12
|
+
const domains = r.domains ?? [];
|
|
13
|
+
if (domains.length === 0) { console.log('No sender domains.'); return; }
|
|
14
|
+
for (const d of domains) {
|
|
15
|
+
const exp = d.registrationExpiresOn ? `${d.registrationExpiresOn.slice(0, 10)} (${d.daysToExpiry} days)` : 'unknown';
|
|
16
|
+
console.log(`${d.domainName} [${d.healthStatus}] status=${d.status} registration expires: ${exp}`);
|
|
17
|
+
if (d.healthDetail) console.log(` ${d.healthDetail}`);
|
|
18
|
+
}
|
|
19
|
+
const open = r.notices ?? [];
|
|
20
|
+
if (open.length) {
|
|
21
|
+
console.log('\nAction needed:');
|
|
22
|
+
for (const n of open) console.log(` - ${n.domainName}: ${n.message}\n What to do: ${n.remedy}`);
|
|
23
|
+
}
|
|
24
|
+
console.log(`\nWarnings start at ${r.settings.thresholds.join('/')} days; sending pauses ${r.settings.graceDays} days after expiry${r.settings.usingAccountDefault ? ' (account default)' : ''}.`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function settingsHandler(argv) {
|
|
28
|
+
if (argv.reset) { console.log(JSON.stringify(await request('PUT', '/SenderDomains/Health/Settings', { reset: true }))); return; }
|
|
29
|
+
if (argv.thresholds === undefined && argv.graceDays === undefined) {
|
|
30
|
+
const r = await request('GET', '/SenderDomains/Health');
|
|
31
|
+
console.log(JSON.stringify(r.settings, null, 2));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
console.log(JSON.stringify(await request('PUT', '/SenderDomains/Health/Settings', { thresholds: argv.thresholds, graceDays: argv.graceDays })));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function dismissHandler(argv) {
|
|
38
|
+
console.log(JSON.stringify(await request('POST', `/SenderDomains/Health/Events/${argv.id}/Dismiss`, {})));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const senderDomainHealthCommand = {
|
|
42
|
+
command: 'sender-domain-health <subcommand>',
|
|
43
|
+
describe: 'Sender domain health: registration expiry, DNS, email-provider state',
|
|
44
|
+
builder: y => y
|
|
45
|
+
.command({ command: 'show', describe: 'Health and history for your sender domains', handler: runCommand(showHandler) })
|
|
46
|
+
.command({
|
|
47
|
+
command: 'settings', describe: 'View or change warning days and grace days',
|
|
48
|
+
builder: yy => yy
|
|
49
|
+
.option('thresholds', { type: 'string', describe: 'Comma-separated days before expiry, e.g. 60,30,14,7,3,1' })
|
|
50
|
+
.option('grace-days', { type: 'number', describe: 'Days after expiry before sending pauses (0-90)' })
|
|
51
|
+
.option('reset', { type: 'boolean', describe: 'Go back to the account default' }),
|
|
52
|
+
handler: runCommand(settingsHandler),
|
|
53
|
+
})
|
|
54
|
+
.command({ command: 'dismiss <id>', describe: 'Dismiss a notice (do not remind me)', handler: runCommand(dismissHandler) })
|
|
55
|
+
.demandCommand(1, 'Specify a subcommand: show | settings | dismiss')
|
|
56
|
+
.strict(),
|
|
57
|
+
handler: () => {},
|
|
58
|
+
};
|
package/package.json
CHANGED