reply-cli 0.1.2 → 0.2.0

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.
Files changed (58) hide show
  1. package/README.md +104 -361
  2. package/dist/commands/auth.d.ts +5 -0
  3. package/dist/commands/auth.js +31 -0
  4. package/dist/commands/auth.js.map +1 -0
  5. package/dist/commands/contacts.d.ts +26 -11
  6. package/dist/commands/contacts.js +284 -193
  7. package/dist/commands/contacts.js.map +1 -1
  8. package/dist/commands/email-accounts.d.ts +11 -0
  9. package/dist/commands/email-accounts.js +97 -0
  10. package/dist/commands/email-accounts.js.map +1 -0
  11. package/dist/commands/inbox.d.ts +30 -0
  12. package/dist/commands/inbox.js +225 -0
  13. package/dist/commands/inbox.js.map +1 -0
  14. package/dist/commands/lists.d.ts +20 -0
  15. package/dist/commands/lists.js +137 -0
  16. package/dist/commands/lists.js.map +1 -0
  17. package/dist/commands/reports.d.ts +10 -0
  18. package/dist/commands/reports.js +70 -0
  19. package/dist/commands/reports.js.map +1 -0
  20. package/dist/commands/schedules.d.ts +1 -4
  21. package/dist/commands/schedules.js +19 -79
  22. package/dist/commands/schedules.js.map +1 -1
  23. package/dist/commands/sequence-contacts.d.ts +17 -6
  24. package/dist/commands/sequence-contacts.js +105 -117
  25. package/dist/commands/sequence-contacts.js.map +1 -1
  26. package/dist/commands/sequences-stats.d.ts +39 -4
  27. package/dist/commands/sequences-stats.js +75 -159
  28. package/dist/commands/sequences-stats.js.map +1 -1
  29. package/dist/commands/sequences.d.ts +16 -6
  30. package/dist/commands/sequences.js +118 -132
  31. package/dist/commands/sequences.js.map +1 -1
  32. package/dist/index.js +61 -26
  33. package/dist/index.js.map +1 -1
  34. package/dist/utils/client.d.ts +29 -2
  35. package/dist/utils/client.js +73 -54
  36. package/dist/utils/client.js.map +1 -1
  37. package/dist/utils/command.d.ts +8 -1
  38. package/dist/utils/command.js +32 -1
  39. package/dist/utils/command.js.map +1 -1
  40. package/dist/utils/csv.d.ts +19 -0
  41. package/dist/utils/csv.js +118 -0
  42. package/dist/utils/csv.js.map +1 -0
  43. package/dist/utils/output.d.ts +12 -3
  44. package/dist/utils/output.js +17 -7
  45. package/dist/utils/output.js.map +1 -1
  46. package/dist/utils/pagination.d.ts +22 -0
  47. package/dist/utils/pagination.js +37 -0
  48. package/dist/utils/pagination.js.map +1 -0
  49. package/dist/utils/resolve.d.ts +4 -0
  50. package/dist/utils/resolve.js +34 -0
  51. package/dist/utils/resolve.js.map +1 -0
  52. package/package.json +3 -3
  53. package/dist/commands/accounts.d.ts +0 -6
  54. package/dist/commands/accounts.js +0 -62
  55. package/dist/commands/accounts.js.map +0 -1
  56. package/dist/commands/import.d.ts +0 -6
  57. package/dist/commands/import.js +0 -137
  58. package/dist/commands/import.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ import { Command } from 'commander';
2
+ import type { Print_opts } from '../utils/output';
3
+ declare const handle_emails: (api_key: string, opts: {
4
+ from?: string;
5
+ to?: string;
6
+ preset?: string;
7
+ sequence?: string[];
8
+ } & Print_opts) => Promise<void>;
9
+ declare const reports_command: Command;
10
+ export { reports_command, handle_emails };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handle_emails = exports.reports_command = void 0;
4
+ const commander_1 = require("commander");
5
+ const client_1 = require("../utils/client");
6
+ const auth_1 = require("../utils/auth");
7
+ const output_1 = require("../utils/output");
8
+ const sequences_stats_1 = require("./sequences-stats");
9
+ const build_filters = (opts) => {
10
+ const filters = {};
11
+ if (opts.from || opts.to) {
12
+ if (!opts.from || !opts.to)
13
+ (0, output_1.fail)('Pass both --from and --to (ISO dates), or use --preset.');
14
+ filters.from = opts.from;
15
+ filters.to = opts.to;
16
+ }
17
+ else
18
+ filters.dateRangePreset = opts.preset || 'lastWeek';
19
+ if (opts.sequence?.length)
20
+ filters.sequenceIds = opts.sequence.map(s => parseInt(s, 10));
21
+ return filters;
22
+ };
23
+ const handle_emails = async (api_key, opts) => {
24
+ const filters = build_filters(opts);
25
+ const result = await (0, client_1.post)(api_key, '/reporting/emails/overview', { filters });
26
+ if (opts.json || opts.pretty) {
27
+ (0, output_1.print)(result, opts);
28
+ return;
29
+ }
30
+ console.log(`\nEmail performance — ${filters.dateRangePreset || `${filters.from} → ${filters.to}`}`);
31
+ console.log(` Contacted: ${result.contacted}`);
32
+ console.log(` Delivered: ${output_1.pc.bold(String(result.delivered))} ${output_1.pc.dim(`(${result.deliveredPercentage?.toFixed(1)}%)`)}`);
33
+ console.log(` Opened: ${result.opened} ${output_1.pc.dim(`(${result.openedPercentage?.toFixed(1)}%)`)}`);
34
+ console.log(` Replied: ${output_1.pc.green(String(result.replied))} ${output_1.pc.dim(`(${result.repliedPercentage?.toFixed(1)}%)`)}`);
35
+ console.log(` Interested: ${output_1.pc.green(String(result.interested))} ${output_1.pc.dim(`(${result.interestedPercentage?.toFixed(1)}%)`)}`);
36
+ console.log(` Meetings: ${result.meetingsBooked}`);
37
+ console.log(` Bounced: ${result.bounced} ${output_1.pc.dim(`(${result.bouncedPercentage?.toFixed(1)}%)`)}`);
38
+ console.log(` Opted out: ${result.optedOut}`);
39
+ };
40
+ exports.handle_emails = handle_emails;
41
+ const reports_command = new commander_1.Command('reports')
42
+ .description('Account-level performance reports');
43
+ exports.reports_command = reports_command;
44
+ reports_command
45
+ .command('emails')
46
+ .description('Email performance overview')
47
+ .option('--preset <preset>', 'Date range: lastWeek | lastMonth | lastYear | allTime (default: lastWeek)')
48
+ .option('--from <date>', 'Period start (ISO date)')
49
+ .option('--to <date>', 'Period end (ISO date)')
50
+ .option('--sequence <id...>', 'Limit to specific sequence IDs')
51
+ .addHelpText('after', '\nExamples:\n reply reports emails\n reply reports emails --preset lastMonth --json\n reply reports emails --from 2026-06-01 --to 2026-06-30')
52
+ .action(async function () {
53
+ const opts = this.optsWithGlobals();
54
+ const key = (0, auth_1.resolve_api_key)(opts.apiKey);
55
+ await handle_emails(key, opts);
56
+ });
57
+ reports_command
58
+ .command('sequences')
59
+ .description('Per-sequence performance (alias of `sequences stats`)')
60
+ .option('--preset <preset>', 'Date range: lastWeek | lastMonth (default: lastWeek)')
61
+ .option('--from <date>', 'Period start (ISO date)')
62
+ .option('--to <date>', 'Period end (ISO date; span ≤ 31 days)')
63
+ .option('--top', 'Only the top 5 sequences by reply rate')
64
+ .addHelpText('after', '\nExamples:\n reply reports sequences --top\n reply reports sequences --preset lastMonth --json')
65
+ .action(async function () {
66
+ const opts = this.optsWithGlobals();
67
+ const key = (0, auth_1.resolve_api_key)(opts.apiKey);
68
+ await (0, sequences_stats_1.handle_stats_all)(key, opts);
69
+ });
70
+ //# sourceMappingURL=reports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../src/commands/reports.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,4CAAqC;AACrC,wCAA8C;AAC9C,4CAAgD;AAChD,uDAAmD;AAmBnD,MAAM,aAAa,GAAG,CAAC,IAAwE,EAAC,EAAE;IAC9F,MAAM,OAAO,GAA4B,EAAE,CAAC;IAC5C,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EACxB,CAAC;QACG,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,IAAA,aAAI,EAAC,yDAAyD,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACzB,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB,CAAC;;QAEG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC;IACxD,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM;QACrB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;I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AAEP,eAAe;KACV,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,uDAAuD,CAAC;KACpE,MAAM,CAAC,mBAAmB,EAAE,sDAAsD,CAAC;KACnF,MAAM,CAAC,eAAe,EAAE,yBAAyB,CAAC;KAClD,MAAM,CAAC,aAAa,EAAE,uCAAuC,CAAC;KAC9D,MAAM,CAAC,OAAO,EAAE,wCAAwC,CAAC;KACzD,WAAW,CAAC,OAAO,EAAE,mGAAmG,CAAC;KACzH,MAAM,CAAC,KAAK;IACT,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAA,sBAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,IAAA,kCAAgB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC"}
@@ -2,8 +2,5 @@ import { Command } from 'commander';
2
2
  import type { Print_opts } from '../utils/output';
3
3
  declare const handle_list: (api_key: string, print_opts: Print_opts) => Promise<void>;
4
4
  declare const handle_get: (api_key: string, id: string, print_opts: Print_opts) => Promise<void>;
5
- declare const handle_create: (api_key: string, print_opts: Print_opts) => Promise<void>;
6
- declare const handle_delete: (api_key: string, id: string) => Promise<void>;
7
- declare const handle_set_default: (api_key: string, id: string) => Promise<void>;
8
5
  declare const schedules_command: Command;
9
- export { schedules_command, handle_list, handle_get, handle_create, handle_delete, handle_set_default };
6
+ export { schedules_command, handle_list, handle_get };
@@ -1,27 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handle_set_default = exports.handle_delete = exports.handle_create = exports.handle_get = exports.handle_list = exports.schedules_command = void 0;
3
+ exports.handle_get = exports.handle_list = exports.schedules_command = void 0;
4
4
  const commander_1 = require("commander");
5
5
  const client_1 = require("../utils/client");
6
6
  const auth_1 = require("../utils/auth");
7
7
  const output_1 = require("../utils/output");
8
- const pad = (n) => String(n).padStart(2, '0');
9
- const format_timings = (timings) => {
10
- if (!timings?.length)
11
- return '—';
12
- return timings
13
- .filter(t => t.isActive)
14
- .map(t => {
15
- const ranges = (t.timeRanges || [])
16
- .map(r => `${pad(r.fromTime.hour)}:${pad(r.fromTime.minute)}-${pad(r.toTime.hour)}:${pad(r.toTime.minute)}`)
17
- .join(', ');
18
- return `${t.weekDay.slice(0, 3)}: ${ranges}`;
19
- })
20
- .join(' | ');
21
- };
22
8
  const handle_list = async (api_key, print_opts) => {
23
- const schedules = await (0, client_1.get)(api_key, '/v2/schedules');
24
- if (!schedules || schedules.length === 0) {
9
+ // Schedules is one of the few v3 endpoints returning a bare array
10
+ const schedules = await (0, client_1.get)(api_key, '/schedules');
11
+ if (!schedules?.length) {
25
12
  (0, output_1.info)('No schedules found.');
26
13
  return;
27
14
  }
@@ -31,47 +18,29 @@ const handle_list = async (api_key, print_opts) => {
31
18
  }
32
19
  (0, output_1.print_table)(schedules.map(s => ({
33
20
  ID: String(s.id),
34
- Name: s.name || '—',
35
- Timezone: s.timezoneId || '—',
36
- Default: s.isDefault ? 'Yes' : '',
37
- 'Active Days': format_timings(s.mainTimings),
38
- })), ['ID', 'Name', 'Timezone', 'Default', 'Active Days']);
21
+ Name: s.name,
22
+ Timezone: s.timezoneId,
23
+ Default: s.isDefault ? 'yes' : '',
24
+ 'Prospect TZ': s.useProspectTimezone ? 'yes' : '',
25
+ })), ['ID', 'Name', 'Timezone', 'Default', 'Prospect TZ']);
39
26
  };
40
27
  exports.handle_list = handle_list;
41
28
  const handle_get = async (api_key, id, print_opts) => {
42
- const schedule = await (0, client_1.get)(api_key, `/v2/schedules/${id}`);
29
+ const schedule = await (0, client_1.get)(api_key, `/schedules/${id}`);
30
+ if (!schedule) {
31
+ (0, output_1.info)('Schedule not found.');
32
+ return;
33
+ }
43
34
  (0, output_1.print)(schedule, { ...print_opts, pretty: print_opts.pretty ?? true });
44
35
  };
45
36
  exports.handle_get = handle_get;
46
- const handle_create = async (api_key, print_opts) => {
47
- const chunks = [];
48
- for await (const chunk of process.stdin)
49
- chunks.push(chunk);
50
- const config = JSON.parse(Buffer.concat(chunks).toString('utf-8'));
51
- if (!config.name)
52
- (0, output_1.fail)('Schedule config must include "name".');
53
- const result = await (0, client_1.post)(api_key, '/v2/schedules', config);
54
- (0, output_1.success)(`Schedule created. ID: ${result.id}`);
55
- (0, output_1.print)(result, print_opts);
56
- };
57
- exports.handle_create = handle_create;
58
- const handle_delete = async (api_key, id) => {
59
- await (0, client_1.del)(api_key, `/v2/schedules/${id}`);
60
- (0, output_1.success)(`Schedule ${id} deleted.`);
61
- };
62
- exports.handle_delete = handle_delete;
63
- const handle_set_default = async (api_key, id) => {
64
- await (0, client_1.post)(api_key, `/v2/schedules/${id}/set-default`);
65
- (0, output_1.success)(`Schedule ${id} set as default.`);
66
- };
67
- exports.handle_set_default = handle_set_default;
68
37
  const schedules_command = new commander_1.Command('schedules')
69
- .description('Manage sending schedules');
38
+ .description('View sending schedules');
70
39
  exports.schedules_command = schedules_command;
71
40
  schedules_command
72
41
  .command('list')
73
- .description('List all sending schedules')
74
- .addHelpText('after', '\nShows schedule names, timezones, and active sending windows.\n\nExamples:\n reply schedules list\n reply schedules list --json')
42
+ .description('List sending schedules')
43
+ .addHelpText('after', '\nExamples:\n reply schedules list\n reply schedules list --json')
75
44
  .action(async function () {
76
45
  const opts = this.optsWithGlobals();
77
46
  const key = (0, auth_1.resolve_api_key)(opts.apiKey);
@@ -79,41 +48,12 @@ schedules_command
79
48
  });
80
49
  schedules_command
81
50
  .command('get')
82
- .description('Get schedule details by ID')
51
+ .description('Get a schedule with its timings')
83
52
  .argument('<id>', 'Schedule ID')
84
- .addHelpText('after', '\nExamples:\n reply schedules get 12345')
53
+ .addHelpText('after', '\nExamples:\n reply schedules get 42 --json')
85
54
  .action(async function (id) {
86
55
  const opts = this.optsWithGlobals();
87
56
  const key = (0, auth_1.resolve_api_key)(opts.apiKey);
88
57
  await handle_get(key, id, { json: opts.json, pretty: opts.pretty });
89
58
  });
90
- schedules_command
91
- .command('create')
92
- .description('Create a new sending schedule from stdin JSON')
93
- .addHelpText('after', '\nReads JSON config from stdin.\n\nExamples:\n echo \'{"name":"Business Hours","timezoneId":"Eastern Standard Time",...}\' | reply schedules create')
94
- .action(async function () {
95
- const opts = this.optsWithGlobals();
96
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
97
- await handle_create(key, { json: opts.json, pretty: opts.pretty });
98
- });
99
- schedules_command
100
- .command('delete')
101
- .description('Delete a schedule by ID')
102
- .argument('<id>', 'Schedule ID')
103
- .addHelpText('after', '\nExamples:\n reply schedules delete 12345')
104
- .action(async function (id) {
105
- const opts = this.optsWithGlobals();
106
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
107
- await handle_delete(key, id);
108
- });
109
- schedules_command
110
- .command('set-default')
111
- .description('Set a schedule as the default')
112
- .argument('<id>', 'Schedule ID')
113
- .addHelpText('after', '\nExamples:\n reply schedules set-default 12345')
114
- .action(async function (id) {
115
- const opts = this.optsWithGlobals();
116
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
117
- await handle_set_default(key, id);
118
- });
119
59
  //# sourceMappingURL=schedules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../src/commands/schedules.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,4CAA+C;AAC/C,wCAA8C;AAC9C,4CAAwE;AAcxE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAS,EAAE,CAAA,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAE5D,MAAM,cAAc,GAAG,CAAC,OAAiB,EAAS,EAAE;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM;QAAE,OAAO,GAAG,CAAC;IACjC,OAAO,OAAO;SACT,MAAM,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,QAAQ,CAAC;SACrB,GAAG,CAAC,CAAC,CAAA,EAAE;QACJ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AAC;KAC/B,WAAW,CAAC,OAAO,EAAE,8CAA8C,CAAC;KACpE,MAAM,CAAC,KAAK,WAAyB,EAAU;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAA,sBAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,UAAU,CAAC,GAAG,EAAE,EAAE,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}
@@ -1,8 +1,19 @@
1
1
  import { Command } from 'commander';
2
- declare const handle_add: (api_key: string, contact: string, sequence_id: string, force?: boolean) => Promise<void>;
3
- declare const handle_add_new: (api_key: string, opts: Record<string, string>) => Promise<void>;
4
- declare const handle_add_bulk: (api_key: string, contacts: string, sequence_id: string, overwrite?: boolean) => Promise<void>;
5
- declare const handle_remove: (api_key: string, contact: string, sequence_id: string) => Promise<void>;
6
- declare const handle_remove_all: (api_key: string, contact: string) => Promise<void>;
2
+ import type { Print_opts } from '../utils/output';
3
+ declare const handle_list: (api_key: string, sequence_id: string, opts: {
4
+ limit?: string;
5
+ skip?: string;
6
+ all?: boolean;
7
+ } & Print_opts) => Promise<void>;
8
+ declare const handle_add: (api_key: string, sequence_id: string, opts: {
9
+ contacts: string;
10
+ removeFromExisting?: boolean;
11
+ dryRun?: boolean;
12
+ yes?: boolean;
13
+ } & Print_opts) => Promise<void>;
14
+ declare const handle_remove: (api_key: string, sequence_id: string, opts: {
15
+ contacts: string;
16
+ yes?: boolean;
17
+ } & Print_opts) => Promise<void>;
7
18
  declare const sequence_contacts_command: Command;
8
- export { sequence_contacts_command, handle_add, handle_add_new, handle_add_bulk, handle_remove, handle_remove_all, };
19
+ export { sequence_contacts_command, handle_list, handle_add, handle_remove };
@@ -1,141 +1,129 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handle_remove_all = exports.handle_remove = exports.handle_add_bulk = exports.handle_add_new = exports.handle_add = exports.sequence_contacts_command = void 0;
3
+ exports.handle_remove = exports.handle_add = exports.handle_list = exports.sequence_contacts_command = void 0;
4
4
  const commander_1 = require("commander");
5
5
  const client_1 = require("../utils/client");
6
6
  const auth_1 = require("../utils/auth");
7
+ const command_1 = require("../utils/command");
8
+ const pagination_1 = require("../utils/pagination");
9
+ const resolve_1 = require("../utils/resolve");
7
10
  const output_1 = require("../utils/output");
8
- const handle_add = async (api_key, contact, sequence_id, force) => {
9
- const body = {
10
- campaignId: parseInt(sequence_id),
11
- email: contact,
12
- };
13
- if (force)
14
- body.forcePush = true;
15
- await (0, client_1.post)(api_key, '/v1/actions/pushtocampaign', body);
16
- (0, output_1.success)(`Pushed ${contact} to sequence ${sequence_id}${force ? ' (force)' : ''}`);
11
+ const contact_table = (items) => {
12
+ (0, output_1.print_table)(items.map(c => ({
13
+ ID: String(c.contactId),
14
+ Email: c.email || '—',
15
+ Name: (0, output_1.truncate)(`${c.firstName || ''} ${c.lastName || ''}`.trim() || '—', 25),
16
+ Company: (0, output_1.truncate)(c.company || '—', 20),
17
+ Status: c.statusInSequence,
18
+ Step: c.currentStep?.displayName || '—',
19
+ Added: (0, output_1.format_date)(c.addingDate),
20
+ })), ['ID', 'Email', 'Name', 'Company', 'Status', 'Step', 'Added']);
17
21
  };
18
- exports.handle_add = handle_add;
19
- const handle_add_new = async (api_key, opts) => {
20
- if (!opts.contact || !opts.sequence || !opts.firstName)
21
- (0, output_1.fail)('Required: --contact, --first-name, and --sequence');
22
- const body = {
23
- campaignId: parseInt(opts.sequence),
24
- email: opts.contact,
25
- firstName: opts.firstName,
26
- };
27
- if (opts.lastName)
28
- body.lastName = opts.lastName;
29
- if (opts.company)
30
- body.company = opts.company;
31
- if (opts.title)
32
- body.title = opts.title;
33
- if (opts.custom) {
34
- body.customFields = opts.custom.split(',').map(pair => {
35
- const [key, ...val_parts] = pair.split('=');
36
- return { key: key.trim(), value: val_parts.join('=').trim() };
37
- });
22
+ const handle_list = async (api_key, sequence_id, opts) => {
23
+ const base = `/sequences/${sequence_id}/contacts`;
24
+ if (opts.all) {
25
+ const result = await (0, pagination_1.fetch_all)(api_key, base);
26
+ if (opts.json || opts.pretty) {
27
+ (0, output_1.print)(result, opts);
28
+ return;
29
+ }
30
+ contact_table(result.items);
31
+ (0, output_1.info)(`\nTotal: ${result.count} contacts in sequence ${sequence_id}`);
32
+ return;
33
+ }
34
+ const top = parseInt(opts.limit || '25', 10);
35
+ const skip = parseInt(opts.skip || '0', 10);
36
+ const result = await (0, client_1.get)(api_key, `${base}?top=${top}&skip=${skip}`);
37
+ if (!result?.items?.length) {
38
+ (0, output_1.info)('No contacts in this sequence.');
39
+ return;
38
40
  }
39
- await (0, client_1.post)(api_key, '/v1/actions/addandpushtocampaign', body);
40
- (0, output_1.success)(`Created and pushed ${opts.contact} to sequence ${opts.sequence}`);
41
+ if (opts.json || opts.pretty) {
42
+ (0, output_1.print)(result, opts);
43
+ return;
44
+ }
45
+ contact_table(result.items);
46
+ (0, output_1.info)(`\nShowing ${result.items.length} contacts.`
47
+ + (result.hasMore ? ' More available — use --skip or --all.' : ''));
41
48
  };
42
- exports.handle_add_new = handle_add_new;
43
- const handle_add_bulk = async (api_key, contacts, sequence_id, overwrite) => {
44
- const contact_ids = contacts.split(',').map(id => parseInt(id.trim()));
45
- const body = {
46
- ContactIds: contact_ids,
47
- SequenceId: parseInt(sequence_id),
48
- OverwriteExisting: overwrite || false,
49
- };
50
- const result = await (0, client_1.post)(api_key, '/v1/Actions/pushContactsToSequence', body);
51
- (0, output_1.success)('Bulk push complete.');
52
- if (result?.affectedIdList)
53
- (0, output_1.info)(`Pushed: ${result.affectedIdList.length} contacts`);
54
- if (result?.skippedByOwner)
55
- (0, output_1.info)(`Skipped (owner): ${result.skippedByOwner}`);
56
- if (result?.skippedByInvalidEmail)
57
- (0, output_1.info)(`Skipped (invalid email): ${result.skippedByInvalidEmail}`);
58
- if (result?.skippedByOptedOutStatus)
59
- (0, output_1.info)(`Skipped (opted out): ${result.skippedByOptedOutStatus}`);
60
- if (result?.skipped)
61
- (0, output_1.info)(`Skipped (other): ${result.skipped}`);
49
+ exports.handle_list = handle_list;
50
+ const handle_add = async (api_key, sequence_id, opts) => {
51
+ const contact_ids = await (0, resolve_1.resolve_contact_ids)(api_key, opts.contacts);
52
+ const body = { contactIds: contact_ids };
53
+ if (opts.removeFromExisting)
54
+ body.removeFromExisting = true;
55
+ if (opts.dryRun) {
56
+ (0, output_1.print_dry_run)({
57
+ dryRun: true,
58
+ action: 'sequences.contacts.add',
59
+ method: 'POST',
60
+ path: `/v3/sequences/${sequence_id}/contact-links/bulk`,
61
+ payload: body,
62
+ affected: contact_ids.length,
63
+ }, opts);
64
+ return;
65
+ }
66
+ await (0, command_1.confirm_or_abort)(`Add ${contact_ids.length} contact(s) to sequence ${sequence_id}?`
67
+ + ' If the sequence is active, outreach to them begins on schedule.', opts);
68
+ const result = await (0, client_1.post)(api_key, `/sequences/${sequence_id}/contact-links/bulk`, body);
69
+ const added = result?.added?.length ?? 0;
70
+ const not_processed = Object.entries(result?.notProcessed ?? {});
71
+ (0, output_1.success)(`Added ${added} contact(s) to sequence ${sequence_id}.`);
72
+ for (const [contact_id, err] of not_processed)
73
+ (0, output_1.warn)(` Contact ${contact_id}: ${err.error}${err.errorDetails ? ` — ${err.errorDetails}` : ''}`);
74
+ if (opts.json || opts.pretty)
75
+ (0, output_1.print)({ action: 'sequences.contacts.add', added: result?.added ?? [], notProcessed: result?.notProcessed ?? {} }, opts);
76
+ if (added === 0 && not_processed.length > 0)
77
+ process.exit(1);
62
78
  };
63
- exports.handle_add_bulk = handle_add_bulk;
64
- const handle_remove = async (api_key, contact, sequence_id) => {
65
- await (0, client_1.post)(api_key, '/v1/actions/removepersonfromcampaignbyid', {
66
- campaignId: parseInt(sequence_id),
67
- email: contact,
68
- });
69
- (0, output_1.success)(`Removed ${contact} from sequence ${sequence_id}`);
79
+ exports.handle_add = handle_add;
80
+ const handle_remove = async (api_key, sequence_id, opts) => {
81
+ const contact_ids = await (0, resolve_1.resolve_contact_ids)(api_key, opts.contacts);
82
+ await (0, command_1.confirm_or_abort)(`Remove ${contact_ids.length} contact(s) from sequence ${sequence_id}?`, opts);
83
+ const result = await (0, client_1.post)(api_key, `/sequences/${sequence_id}/contact-links/bulk-delete`, { contactIds: contact_ids });
84
+ (0, output_1.success)(`Removed ${result?.removed ?? 0} of ${result?.requested ?? contact_ids.length} contact(s).`);
85
+ if (result?.notInSequence)
86
+ (0, output_1.info)(` Not in sequence: ${result.notInSequence}`);
87
+ if (result?.notFound)
88
+ (0, output_1.info)(` Not found: ${result.notFound}`);
89
+ if (opts.json || opts.pretty)
90
+ (0, output_1.print)({ action: 'sequences.contacts.remove', ...result }, opts);
70
91
  };
71
92
  exports.handle_remove = handle_remove;
72
- const handle_remove_all = async (api_key, contact) => {
73
- await (0, client_1.post)(api_key, '/v1/actions/removepersonfromallcampaigns', { email: contact });
74
- (0, output_1.success)(`Removed ${contact} from all sequences`);
75
- };
76
- exports.handle_remove_all = handle_remove_all;
77
- const sequence_contacts_command = new commander_1.Command('sequence-contacts')
78
- .description('Add or remove contacts from sequences');
93
+ const sequence_contacts_command = new commander_1.Command('contacts')
94
+ .description('Manage contacts within a sequence');
79
95
  exports.sequence_contacts_command = sequence_contacts_command;
80
- sequence_contacts_command
81
- .command('add')
82
- .description('Add an existing contact to a sequence')
83
- .requiredOption('--contact <email>', 'Contact email address')
84
- .requiredOption('--sequence <id>', 'Sequence ID')
85
- .option('--force', 'Force push even if contact is in another sequence')
86
- .addHelpText('after', '\nPushes an existing contact into a sequence. Use --force to move from another active sequence.\n\nExamples:\n reply sequence-contacts add --contact john@co.com --sequence 12345\n reply sequence-contacts add --contact john@co.com --sequence 12345 --force')
87
- .action(async function () {
96
+ (0, command_1.with_pagination_opts)(sequence_contacts_command
97
+ .command('list')
98
+ .description('List contacts in a sequence')
99
+ .argument('<sequence-id>', 'Sequence ID'))
100
+ .addHelpText('after', '\nExamples:\n reply sequences contacts list 12345\n reply sequences contacts list 12345 --all --json')
101
+ .action(async function (sequence_id) {
88
102
  const opts = this.optsWithGlobals();
89
103
  const key = (0, auth_1.resolve_api_key)(opts.apiKey);
90
- await handle_add(key, opts.contact, opts.sequence, opts.force);
104
+ await handle_list(key, sequence_id, opts);
91
105
  });
92
- sequence_contacts_command
93
- .command('add-new')
94
- .description('Create a new contact and add to a sequence in one step')
95
- .requiredOption('--contact <email>', 'Contact email address')
96
- .requiredOption('--first-name <name>', 'First name')
97
- .requiredOption('--sequence <id>', 'Sequence ID')
98
- .option('--last-name <name>', 'Last name')
99
- .option('--company <company>', 'Company name')
100
- .option('--title <title>', 'Job title')
101
- .option('--custom <fields>', 'Custom fields: Key1=Val1,Key2=Val2')
102
- .addHelpText('after', '\nCreates a contact and enrolls them in a sequence in one API call.\n\nExamples:\n reply sequence-contacts add-new --contact john@co.com --first-name John --sequence 12345')
103
- .action(async function () {
104
- const opts = this.optsWithGlobals();
105
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
106
- await handle_add_new(key, opts);
107
- });
108
- sequence_contacts_command
109
- .command('add-bulk')
110
- .description('Add multiple contacts to a sequence by contact IDs')
111
- .requiredOption('--contacts <ids>', 'Comma-separated contact IDs')
112
- .requiredOption('--sequence <id>', 'Sequence ID')
113
- .option('--overwrite', 'Force push contacts already in other sequences')
114
- .addHelpText('after', '\nBulk enrolls contacts by their Reply.io IDs.\n\nExamples:\n reply sequence-contacts add-bulk --contacts 111,222,333 --sequence 12345')
115
- .action(async function () {
106
+ (0, command_1.with_confirm_opts)(sequence_contacts_command
107
+ .command('add')
108
+ .description('Add contacts to a sequence')
109
+ .argument('<sequence-id>', 'Sequence ID')
110
+ .requiredOption('--contacts <ids-or-emails>', 'Comma-separated contact IDs or emails')
111
+ .option('--remove-from-existing', 'Move contacts out of their current sequences'), { dry_run: true })
112
+ .addHelpText('after', '\nExamples:\n reply sequences contacts add 12345 --contacts john@co.com,jane@co.com --dry-run\n reply sequences contacts add 12345 --contacts 111,222 --yes --json')
113
+ .action(async function (sequence_id) {
116
114
  const opts = this.optsWithGlobals();
117
115
  const key = (0, auth_1.resolve_api_key)(opts.apiKey);
118
- await handle_add_bulk(key, opts.contacts, opts.sequence, opts.overwrite);
116
+ await handle_add(key, sequence_id, opts);
119
117
  });
120
- sequence_contacts_command
118
+ (0, command_1.with_confirm_opts)(sequence_contacts_command
121
119
  .command('remove')
122
- .description('Remove a contact from a specific sequence')
123
- .requiredOption('--contact <email>', 'Contact email address')
124
- .requiredOption('--sequence <id>', 'Sequence ID')
125
- .addHelpText('after', '\nExamples:\n reply sequence-contacts remove --contact john@co.com --sequence 12345')
126
- .action(async function () {
127
- const opts = this.optsWithGlobals();
128
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
129
- await handle_remove(key, opts.contact, opts.sequence);
130
- });
131
- sequence_contacts_command
132
- .command('remove-all')
133
- .description('Remove a contact from all sequences')
134
- .requiredOption('--contact <email>', 'Contact email address')
135
- .addHelpText('after', '\nExamples:\n reply sequence-contacts remove-all --contact john@co.com')
136
- .action(async function () {
120
+ .description('Remove contacts from a sequence')
121
+ .argument('<sequence-id>', 'Sequence ID')
122
+ .requiredOption('--contacts <ids-or-emails>', 'Comma-separated contact IDs or emails'))
123
+ .addHelpText('after', '\nExamples:\n reply sequences contacts remove 12345 --contacts john@co.com --yes')
124
+ .action(async function (sequence_id) {
137
125
  const opts = this.optsWithGlobals();
138
126
  const key = (0, auth_1.resolve_api_key)(opts.apiKey);
139
- await handle_remove_all(key, opts.contact);
127
+ await handle_remove(key, sequence_id, opts);
140
128
  });
141
129
  //# sourceMappingURL=sequence-contacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequence-contacts.js","sourceRoot":"","sources":["../../src/commands/sequence-contacts.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,4CAAqC;AACrC,wCAA8C;AAC9C,4CAAoD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