@velaro/cli 1.4.217 → 1.4.218
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 +2 -0
- package/lib/commands/apollo.js +56 -0
- package/package.json +1 -1
package/bin/velaro.js
CHANGED
|
@@ -74,6 +74,7 @@ import { actionsCommand } from '../lib/commands/actions.js';
|
|
|
74
74
|
import { mondayCommand } from '../lib/commands/monday.js';
|
|
75
75
|
import { makeCommand } from '../lib/commands/make.js';
|
|
76
76
|
import { notionCommand } from '../lib/commands/notion.js';
|
|
77
|
+
import { apolloCommand } from '../lib/commands/apollo.js';
|
|
77
78
|
import { callrailCommand } from '../lib/commands/callrail.js';
|
|
78
79
|
import { emailCampaignCommand } from '../lib/commands/email-campaign.js';
|
|
79
80
|
import { outboundActivityCommand } from '../lib/commands/outbound-activity.js';
|
|
@@ -249,6 +250,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
|
|
|
249
250
|
.command(mondayCommand)
|
|
250
251
|
.command(makeCommand)
|
|
251
252
|
.command(notionCommand)
|
|
253
|
+
.command(apolloCommand)
|
|
252
254
|
.command(callrailCommand)
|
|
253
255
|
.command(emailCampaignCommand)
|
|
254
256
|
.command(outboundActivityCommand)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* velaro apollo - Apollo.io prospecting connection status + ICP presets
|
|
3
|
+
*
|
|
4
|
+
* velaro apollo status Show the site's Apollo connection, monthly pull usage and last pull
|
|
5
|
+
* velaro apollo presets List the seed ICP search presets a customer can start from
|
|
6
|
+
*
|
|
7
|
+
* Read-only. Saving the API key, accepting terms and test-connection stay in the admin UI
|
|
8
|
+
* (Apollo terms acceptance must be a deliberate human action).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { request } from '../api.js';
|
|
12
|
+
|
|
13
|
+
const GRN = '\x1b[32m';
|
|
14
|
+
const RED = '\x1b[31m';
|
|
15
|
+
const DIM = '\x1b[2m';
|
|
16
|
+
const BOLD = '\x1b[1m';
|
|
17
|
+
const RST = '\x1b[0m';
|
|
18
|
+
|
|
19
|
+
async function statusHandler() {
|
|
20
|
+
const s = await request('GET', '/Apollo/Status');
|
|
21
|
+
if (!s || !s.connected) {
|
|
22
|
+
console.log(`\n${RED}Apollo is not connected.${RST} Terms accepted: ${s?.termsAccepted ? 'yes' : 'no'}.\n`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
console.log(`\n${BOLD}Apollo${RST} ${s.runnable ? `${GRN}connected and runnable${RST}` : `${RED}connected, not runnable${RST} (terms or target list missing)`}`);
|
|
26
|
+
console.log(` Account: ${s.accountName || DIM + '(unknown)' + RST}`);
|
|
27
|
+
console.log(` API key: ${s.apiKeyMasked || DIM + '(none)' + RST}`);
|
|
28
|
+
console.log(` Pulls this month: ${s.pullsUsedThisMonth} of ${s.monthlyPullCap} (${s.remainingThisMonth} remaining)`);
|
|
29
|
+
console.log(` Target list: ${s.targetListId ?? DIM + '(not set)' + RST}`);
|
|
30
|
+
console.log(` Terms accepted: ${s.termsAccepted ? `${s.termsAcceptedAt} by ${s.termsAcceptedBy}` : 'no'}`);
|
|
31
|
+
console.log(` Last pull: ${s.lastPullAt || DIM + '(never)' + RST} ${s.lastPullSummary || ''}`);
|
|
32
|
+
console.log(` Prospects added: ${s.totalProspectsAdded}\n`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function presetsHandler() {
|
|
36
|
+
const presets = await request('GET', '/Apollo/Presets');
|
|
37
|
+
if (!Array.isArray(presets) || presets.length === 0) {
|
|
38
|
+
console.log('\nNo presets returned.\n');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
console.log('');
|
|
42
|
+
for (const p of presets) {
|
|
43
|
+
console.log(` ${BOLD}${p.name || p.id || '(unnamed)'}${RST}${p.description ? ` ${DIM}${p.description}${RST}` : ''}`);
|
|
44
|
+
}
|
|
45
|
+
console.log('');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const apolloCommand = {
|
|
49
|
+
command: 'apollo <subcommand>',
|
|
50
|
+
describe: 'Apollo.io prospecting connection status + ICP presets (read-only)',
|
|
51
|
+
builder: y => y
|
|
52
|
+
.command({ command: 'status', describe: "Show the site's Apollo connection and monthly pull usage", handler: statusHandler })
|
|
53
|
+
.command({ command: 'presets', describe: 'List seed ICP search presets', handler: presetsHandler })
|
|
54
|
+
.demandCommand(1, 'Specify a subcommand. Try: velaro apollo --help'),
|
|
55
|
+
handler: () => {},
|
|
56
|
+
};
|
package/package.json
CHANGED