@velaro/cli 1.4.216 → 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 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';
@@ -134,6 +135,7 @@ import { usageCommand } from '../lib/commands/usage.js';
134
135
  import { campaignsCommand } from '../lib/commands/campaigns.js';
135
136
  import { senderDomainHealthCommand } from '../lib/commands/sender-domain-health.js';
136
137
  import { contactsCommand } from '../lib/commands/contacts.js';
138
+ import { contactsApiCommand } from '../lib/commands/contacts-rest-extras.js';
137
139
  import { contactListCommand } from '../lib/commands/contact-list.js';
138
140
  import { contactSegmentCommand } from '../lib/commands/contact-segment.js';
139
141
  import { recycleBinCommand, aiUsageCommand, siteInfoCommand, billingReceiptsCommand } from '../lib/commands/endpoint-parity.js';
@@ -248,6 +250,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
248
250
  .command(mondayCommand)
249
251
  .command(makeCommand)
250
252
  .command(notionCommand)
253
+ .command(apolloCommand)
251
254
  .command(callrailCommand)
252
255
  .command(emailCampaignCommand)
253
256
  .command(outboundActivityCommand)
@@ -313,6 +316,7 @@ await (registerStaffCommands ? registerStaffCommands(baseYargs) : baseYargs)
313
316
  .command(campaignsCommand)
314
317
  .command(senderDomainHealthCommand)
315
318
  .command(contactsCommand)
319
+ .command(contactsApiCommand)
316
320
  .command(contactListCommand)
317
321
  .command(contactSegmentCommand)
318
322
  .command(recycleBinCommand)
@@ -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
+ };
@@ -0,0 +1,63 @@
1
+ import { request } from '../api.js';
2
+ import { runCommand } from '../run.js';
3
+
4
+ // -- velaro contacts-api ------------------------------------------------------
5
+ // CLI surface for the public REST v1 contact extras and sends
6
+ // (server/Velaro.Admin/Controllers/PublicApiContactsExtrasController.cs).
7
+ // DELETE api/v1/contacts/{id} POST api/v1/contacts/upsert
8
+ // GET api/v1/custom-fields
9
+ // POST api/v1/sms POST api/v1/whatsapp
10
+ // siteId is always taken from the API key / session server-side, never a CLI arg.
11
+
12
+ function show(r) { console.log(JSON.stringify(r, null, 2)); }
13
+
14
+ const contactsApiCommand = {
15
+ command: 'contacts-api <subcommand>',
16
+ describe: 'Public REST v1: delete/upsert contacts, add notes, list custom fields, send SMS/WhatsApp',
17
+ builder: (y) => y
18
+ .command({
19
+ command: 'delete <id>',
20
+ describe: 'Soft-delete a contact (restorable for 30 days)',
21
+ builder: (y2) => y2.positional('id', { type: 'number' }),
22
+ handler: runCommand(async (a) => show(await request('DELETE', `api/v1/contacts/${a.id}`))),
23
+ })
24
+ .command({
25
+ command: 'upsert',
26
+ describe: 'Create or update a contact matched by --unique-id, --email or --phone',
27
+ builder: (y2) => y2
28
+ .option('unique-id', { type: 'string' }).option('email', { type: 'string' }).option('phone', { type: 'string' })
29
+ .option('first-name', { type: 'string' }).option('last-name', { type: 'string' })
30
+ .option('company', { type: 'string' }).option('job-title', { type: 'string' }),
31
+ handler: runCommand(async (a) => show(await request('POST', 'api/v1/contacts/upsert', {
32
+ uniqueId: a.uniqueId, email: a.email, phone: a.phone, firstName: a.firstName,
33
+ lastName: a.lastName, company: a.company, jobTitle: a.jobTitle,
34
+ }))),
35
+ })
36
+ .command({
37
+ command: 'custom-fields',
38
+ describe: 'List custom contact field definitions',
39
+ handler: runCommand(async () => show(await request('GET', 'api/v1/custom-fields'))),
40
+ })
41
+ .command({
42
+ command: 'sms <contactId> <body>',
43
+ describe: 'Send an SMS to a contact (opt-outs enforced)',
44
+ builder: (y2) => y2.positional('contactId', { type: 'number' }).positional('body', { type: 'string' }),
45
+ handler: runCommand(async (a) => show(await request('POST', 'api/v1/sms', { contactId: a.contactId, body: a.body }))),
46
+ })
47
+ .command({
48
+ command: 'whatsapp <contactId> <template>',
49
+ describe: 'Send a WhatsApp template message to a contact',
50
+ builder: (y2) => y2.positional('contactId', { type: 'number' }).positional('template', { type: 'string' })
51
+ .option('language', { type: 'string', default: 'en_US' })
52
+ .option('var', { type: 'array', describe: 'Template variable (repeatable)' })
53
+ .option('idempotency-key', { type: 'string', demandOption: true }),
54
+ handler: runCommand(async (a) => show(await request('POST', 'api/v1/whatsapp', {
55
+ contactId: a.contactId, templateName: a.template, language: a.language,
56
+ variables: (a.var || []).map(String), idempotencyKey: a.idempotencyKey,
57
+ }))),
58
+ })
59
+ .demandCommand(1, 'Specify: delete | upsert | custom-fields | sms | whatsapp'),
60
+ handler: () => {},
61
+ };
62
+
63
+ export { contactsApiCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velaro/cli",
3
- "version": "1.4.216",
3
+ "version": "1.4.218",
4
4
  "description": "Velaro Workspace v20 — command-line interface for managing bots, knowledge base ingestion, MCP API keys, search indexes, and ops health.",
5
5
  "type": "module",
6
6
  "bin": {