reply-cli 0.2.0 → 0.3.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 (109) hide show
  1. package/README.md +107 -144
  2. package/dist/api/headers.d.ts +4 -0
  3. package/dist/api/headers.js +13 -0
  4. package/dist/api/headers.js.map +1 -0
  5. package/dist/auth/oauth-flow.d.ts +38 -0
  6. package/dist/auth/oauth-flow.js +193 -0
  7. package/dist/auth/oauth-flow.js.map +1 -0
  8. package/dist/auth/pkce.d.ts +9 -0
  9. package/dist/auth/pkce.js +19 -0
  10. package/dist/auth/pkce.js.map +1 -0
  11. package/dist/auth/request-identity.d.ts +16 -0
  12. package/dist/auth/request-identity.js +67 -0
  13. package/dist/auth/request-identity.js.map +1 -0
  14. package/dist/auth/resolve.d.ts +23 -0
  15. package/dist/auth/resolve.js +55 -0
  16. package/dist/auth/resolve.js.map +1 -0
  17. package/dist/auth/status.d.ts +19 -0
  18. package/dist/auth/status.js +27 -0
  19. package/dist/auth/status.js.map +1 -0
  20. package/dist/auth/token.d.ts +29 -0
  21. package/dist/auth/token.js +39 -0
  22. package/dist/auth/token.js.map +1 -0
  23. package/dist/commands/api.d.ts +19 -0
  24. package/dist/commands/api.js +137 -0
  25. package/dist/commands/api.js.map +1 -0
  26. package/dist/commands/auth.d.ts +19 -3
  27. package/dist/commands/auth.js +251 -16
  28. package/dist/commands/auth.js.map +1 -1
  29. package/dist/commands/authed.d.ts +13 -0
  30. package/dist/commands/authed.js +20 -0
  31. package/dist/commands/authed.js.map +1 -0
  32. package/dist/commands/profile.d.ts +31 -0
  33. package/dist/commands/profile.js +348 -0
  34. package/dist/commands/profile.js.map +1 -0
  35. package/dist/commands/team.d.ts +17 -0
  36. package/dist/commands/team.js +146 -0
  37. package/dist/commands/team.js.map +1 -0
  38. package/dist/config.d.ts +14 -0
  39. package/dist/config.js +80 -0
  40. package/dist/config.js.map +1 -0
  41. package/dist/context.d.ts +15 -0
  42. package/dist/context.js +17 -0
  43. package/dist/context.js.map +1 -0
  44. package/dist/credentials/file-store.d.ts +13 -0
  45. package/dist/credentials/file-store.js +88 -0
  46. package/dist/credentials/file-store.js.map +1 -0
  47. package/dist/credentials/types.d.ts +25 -0
  48. package/dist/credentials/types.js +3 -0
  49. package/dist/credentials/types.js.map +1 -0
  50. package/dist/index.js +97 -69
  51. package/dist/index.js.map +1 -1
  52. package/dist/profile.d.ts +51 -0
  53. package/dist/profile.js +295 -0
  54. package/dist/profile.js.map +1 -0
  55. package/dist/teams.d.ts +14 -0
  56. package/dist/teams.js +103 -0
  57. package/dist/teams.js.map +1 -0
  58. package/dist/utils/client.d.ts +19 -34
  59. package/dist/utils/client.js +123 -94
  60. package/dist/utils/client.js.map +1 -1
  61. package/dist/utils/errors.d.ts +47 -0
  62. package/dist/utils/errors.js +86 -0
  63. package/dist/utils/errors.js.map +1 -0
  64. package/dist/utils/output.d.ts +7 -19
  65. package/dist/utils/output.js +39 -81
  66. package/dist/utils/output.js.map +1 -1
  67. package/package.json +10 -25
  68. package/dist/commands/contacts.d.ts +0 -35
  69. package/dist/commands/contacts.js +0 -412
  70. package/dist/commands/contacts.js.map +0 -1
  71. package/dist/commands/email-accounts.d.ts +0 -11
  72. package/dist/commands/email-accounts.js +0 -97
  73. package/dist/commands/email-accounts.js.map +0 -1
  74. package/dist/commands/inbox.d.ts +0 -30
  75. package/dist/commands/inbox.js +0 -225
  76. package/dist/commands/inbox.js.map +0 -1
  77. package/dist/commands/lists.d.ts +0 -20
  78. package/dist/commands/lists.js +0 -137
  79. package/dist/commands/lists.js.map +0 -1
  80. package/dist/commands/reports.d.ts +0 -10
  81. package/dist/commands/reports.js +0 -70
  82. package/dist/commands/reports.js.map +0 -1
  83. package/dist/commands/schedules.d.ts +0 -6
  84. package/dist/commands/schedules.js +0 -59
  85. package/dist/commands/schedules.js.map +0 -1
  86. package/dist/commands/sequence-contacts.d.ts +0 -19
  87. package/dist/commands/sequence-contacts.js +0 -129
  88. package/dist/commands/sequence-contacts.js.map +0 -1
  89. package/dist/commands/sequences-stats.d.ts +0 -42
  90. package/dist/commands/sequences-stats.js +0 -99
  91. package/dist/commands/sequences-stats.js.map +0 -1
  92. package/dist/commands/sequences.d.ts +0 -22
  93. package/dist/commands/sequences.js +0 -211
  94. package/dist/commands/sequences.js.map +0 -1
  95. package/dist/utils/auth.d.ts +0 -2
  96. package/dist/utils/auth.js +0 -33
  97. package/dist/utils/auth.js.map +0 -1
  98. package/dist/utils/command.d.ts +0 -18
  99. package/dist/utils/command.js +0 -51
  100. package/dist/utils/command.js.map +0 -1
  101. package/dist/utils/csv.d.ts +0 -19
  102. package/dist/utils/csv.js +0 -118
  103. package/dist/utils/csv.js.map +0 -1
  104. package/dist/utils/pagination.d.ts +0 -22
  105. package/dist/utils/pagination.js +0 -37
  106. package/dist/utils/pagination.js.map +0 -1
  107. package/dist/utils/resolve.d.ts +0 -4
  108. package/dist/utils/resolve.js +0 -34
  109. package/dist/utils/resolve.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reply-cli",
3
- "version": "0.2.0",
4
- "description": "Command-line interface for the Reply.io v3 API. Manage contacts, lists, sequences, inbox, and reports from your terminal.",
3
+ "version": "0.3.0",
4
+ "description": "Command-line interface for Reply.io. v1: authentication (OAuth + API key) and identity.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
7
7
  "reply": "dist/index.js"
@@ -13,34 +13,14 @@
13
13
  "clean": "rm -rf dist",
14
14
  "test": "vitest run",
15
15
  "test:watch": "vitest",
16
- "test:integration": "vitest run src/__tests__/integration"
16
+ "prepare": "husky"
17
17
  },
18
18
  "author": "Reply.io",
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "git+https://github.com/replyio/reply-cli.git"
22
+ "url": "git+https://github.com/reply-team/reply-cli.git"
23
23
  },
24
- "bugs": {
25
- "url": "https://github.com/replyio/reply-cli/issues"
26
- },
27
- "homepage": "https://github.com/replyio/reply-cli#readme",
28
- "keywords": [
29
- "reply",
30
- "reply-io",
31
- "replyio",
32
- "cli",
33
- "sales-engagement",
34
- "outreach",
35
- "email-automation",
36
- "sequences",
37
- "campaigns",
38
- "contacts",
39
- "cold-email",
40
- "sales-automation",
41
- "email-outreach",
42
- "crm"
43
- ],
44
24
  "engines": {
45
25
  "node": ">=20.0.0"
46
26
  },
@@ -49,8 +29,13 @@
49
29
  "README.md"
50
30
  ],
51
31
  "devDependencies": {
32
+ "@commitlint/cli": "^19.8.1",
33
+ "@commitlint/config-conventional": "^19.8.1",
34
+ "@semantic-release/exec": "^7.1.0",
52
35
  "@types/node": "^20.0.0",
53
- "typescript": "^5.0.0",
36
+ "husky": "^9.1.7",
37
+ "semantic-release": "^24.2.9",
38
+ "typescript": "^5.6.0",
54
39
  "vitest": "^4.0.0"
55
40
  },
56
41
  "dependencies": {
@@ -1,35 +0,0 @@
1
- import { Command } from 'commander';
2
- import type { Print_opts } from '../utils/output';
3
- declare const handle_list: (api_key: string, opts: {
4
- limit?: string;
5
- skip?: string;
6
- all?: boolean;
7
- } & Print_opts) => Promise<void>;
8
- declare const handle_get: (api_key: string, id_or_email: string, print_opts: Print_opts) => Promise<void>;
9
- declare const handle_create: (api_key: string, opts: Record<string, string>, print_opts: Print_opts) => Promise<void>;
10
- declare const handle_update: (api_key: string, id_or_email: string, opts: Record<string, string>, print_opts: Print_opts) => Promise<void>;
11
- declare const handle_delete: (api_key: string, id_or_email: string, opts: {
12
- yes?: boolean;
13
- }) => Promise<void>;
14
- declare const handle_search: (api_key: string, opts: {
15
- term?: string;
16
- list?: string;
17
- sequence?: string;
18
- rule?: string[];
19
- limit?: string;
20
- skip?: string;
21
- all?: boolean;
22
- } & Print_opts) => Promise<void>;
23
- declare const handle_statuses: (api_key: string, id_or_email: string, print_opts: Print_opts) => Promise<void>;
24
- declare const handle_import: (api_key: string, file_path: string, opts: {
25
- mapping?: string;
26
- list?: string;
27
- sequence?: string;
28
- skipExisting?: boolean;
29
- overwrite?: boolean;
30
- detectTimezone?: boolean;
31
- dryRun?: boolean;
32
- yes?: boolean;
33
- } & Print_opts) => Promise<undefined>;
34
- declare const contacts_command: Command;
35
- export { contacts_command, handle_list, handle_get, handle_create, handle_update, handle_delete, handle_search, handle_statuses, handle_import, };
@@ -1,412 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handle_import = exports.handle_statuses = exports.handle_search = exports.handle_delete = exports.handle_update = exports.handle_create = exports.handle_get = exports.handle_list = exports.contacts_command = void 0;
7
- const commander_1 = require("commander");
8
- const fs_1 = __importDefault(require("fs"));
9
- const client_1 = require("../utils/client");
10
- const auth_1 = require("../utils/auth");
11
- const command_1 = require("../utils/command");
12
- const pagination_1 = require("../utils/pagination");
13
- const resolve_1 = require("../utils/resolve");
14
- const csv_1 = require("../utils/csv");
15
- const output_1 = require("../utils/output");
16
- const IMPORT_BATCH_SIZE = 1000;
17
- const contact_table = (contacts) => {
18
- (0, output_1.print_table)(contacts.map(c => ({
19
- ID: String(c.id),
20
- Email: c.email || '—',
21
- Name: (0, output_1.truncate)(`${c.firstName || ''} ${c.lastName || ''}`.trim() || '—', 25),
22
- Company: (0, output_1.truncate)(c.company || '—', 20),
23
- Title: (0, output_1.truncate)(c.title || '—', 20),
24
- Added: (0, output_1.format_date)(c.addingDate || ''),
25
- })), ['ID', 'Email', 'Name', 'Company', 'Title', 'Added']);
26
- };
27
- const handle_list = async (api_key, opts) => {
28
- if (opts.all) {
29
- const result = await (0, pagination_1.fetch_all)(api_key, '/contacts');
30
- if (opts.json || opts.pretty) {
31
- (0, output_1.print)(result, opts);
32
- return;
33
- }
34
- contact_table(result.items);
35
- (0, output_1.info)(`\nTotal: ${result.count} contacts (${result.pagesFetched} pages)`);
36
- return;
37
- }
38
- const top = parseInt(opts.limit || '25', 10);
39
- const skip = parseInt(opts.skip || '0', 10);
40
- const result = await (0, client_1.get)(api_key, `/contacts?top=${top}&skip=${skip}`);
41
- if (!result?.items?.length) {
42
- (0, output_1.info)('No contacts found.');
43
- return;
44
- }
45
- if (opts.json || opts.pretty) {
46
- (0, output_1.print)(result, opts);
47
- return;
48
- }
49
- contact_table(result.items);
50
- (0, output_1.info)(`\nShowing ${result.items.length} contacts (skip: ${skip}).`
51
- + (result.hasMore ? ' More available — use --skip or --all.' : ''));
52
- };
53
- exports.handle_list = handle_list;
54
- const handle_get = async (api_key, id_or_email, print_opts) => {
55
- let contact;
56
- if ((0, resolve_1.is_email)(id_or_email)) {
57
- const res = await (0, client_1.get)(api_key, `/contacts?email=${encodeURIComponent(id_or_email)}`);
58
- contact = res?.items?.[0] ?? null;
59
- }
60
- else
61
- contact = await (0, client_1.get)(api_key, `/contacts/${id_or_email}`);
62
- if (!contact) {
63
- (0, output_1.info)('Contact not found.');
64
- return;
65
- }
66
- (0, output_1.print)(contact, { ...print_opts, pretty: print_opts.pretty ?? true });
67
- };
68
- exports.handle_get = handle_get;
69
- const contact_body_from_opts = (opts) => {
70
- const body = {};
71
- if (opts.email)
72
- body.email = opts.email;
73
- if (opts.firstName)
74
- body.firstName = opts.firstName;
75
- if (opts.lastName)
76
- body.lastName = opts.lastName;
77
- if (opts.company)
78
- body.company = opts.company;
79
- if (opts.title)
80
- body.title = opts.title;
81
- if (opts.phone)
82
- body.phone = opts.phone;
83
- if (opts.linkedin)
84
- body.linkedInUrl = opts.linkedin;
85
- if (opts.city)
86
- body.city = opts.city;
87
- if (opts.state)
88
- body.state = opts.state;
89
- if (opts.country)
90
- body.country = opts.country;
91
- if (opts.industry)
92
- body.industry = opts.industry;
93
- if (opts.notes)
94
- body.notes = opts.notes;
95
- return body;
96
- };
97
- const parse_custom_pairs = (custom) => custom.split(',').map(pair => {
98
- const [key, ...val_parts] = pair.split('=');
99
- return { key: key.trim(), value: val_parts.join('=').trim() };
100
- });
101
- const handle_create = async (api_key, opts, print_opts) => {
102
- if (!opts.email && !opts.linkedin)
103
- (0, output_1.fail)('Required: --email (or --linkedin)');
104
- const body = contact_body_from_opts(opts);
105
- if (opts.custom)
106
- body.customFields = parse_custom_pairs(opts.custom);
107
- const result = await (0, client_1.post)(api_key, '/contacts', body);
108
- (0, output_1.success)(`Contact created: ${result.firstName || ''} ${result.lastName || ''} <${result.email || '—'}> (ID: ${result.id})`);
109
- if (print_opts.json || print_opts.pretty)
110
- (0, output_1.print)(result, print_opts);
111
- };
112
- exports.handle_create = handle_create;
113
- const handle_update = async (api_key, id_or_email, opts, print_opts) => {
114
- const id = await (0, resolve_1.resolve_contact_id)(api_key, id_or_email);
115
- const body = contact_body_from_opts(opts);
116
- // PATCH custom fields are matched by name (or id), not key
117
- if (opts.custom)
118
- body.customFields = parse_custom_pairs(opts.custom).map(f => ({ name: f.key, value: f.value }));
119
- if (!Object.keys(body).length)
120
- (0, output_1.fail)('Nothing to update — pass at least one field flag.');
121
- const result = await (0, client_1.patch)(api_key, `/contacts/${id}`, body);
122
- (0, output_1.success)(`Contact updated: ${result.email || result.id} (ID: ${result.id})`);
123
- if (print_opts.json || print_opts.pretty)
124
- (0, output_1.print)(result, print_opts);
125
- };
126
- exports.handle_update = handle_update;
127
- const handle_delete = async (api_key, id_or_email, opts) => {
128
- const id = await (0, resolve_1.resolve_contact_id)(api_key, id_or_email);
129
- await (0, command_1.confirm_or_abort)(`Delete contact ${id_or_email} (ID: ${id})? This cannot be undone.`, opts);
130
- await (0, client_1.del)(api_key, `/contacts/${id}`);
131
- (0, output_1.success)(`Deleted contact: ${id_or_email} (ID: ${id})`);
132
- };
133
- exports.handle_delete = handle_delete;
134
- const parse_rules = (rules) => rules.map(rule => {
135
- const eq = rule.indexOf('=');
136
- const colon = rule.indexOf(':', eq + 1);
137
- if (eq < 1 || colon < 0)
138
- (0, output_1.fail)(`Invalid --rule format: ${rule}\n Expected: property=condition:value (e.g. country=equals:Germany)`);
139
- return {
140
- property: rule.slice(0, eq).trim(),
141
- condition: rule.slice(eq + 1, colon).trim(),
142
- value: rule.slice(colon + 1).trim() || null,
143
- };
144
- });
145
- const handle_search = async (api_key, opts) => {
146
- const body = {};
147
- if (opts.term)
148
- body.searchTerm = opts.term;
149
- if (opts.list)
150
- body.listId = parseInt(opts.list, 10);
151
- if (opts.sequence)
152
- body.sequenceId = parseInt(opts.sequence, 10);
153
- if (opts.rule?.length)
154
- body.rules = parse_rules(opts.rule);
155
- if (!Object.keys(body).length)
156
- (0, output_1.fail)('Provide at least one of --term, --list, --sequence, or --rule.');
157
- if (opts.all) {
158
- const result = await (0, pagination_1.fetch_all)(api_key, '/contacts/filter', { method: 'POST', body });
159
- if (opts.json || opts.pretty) {
160
- (0, output_1.print)(result, opts);
161
- return;
162
- }
163
- contact_table(result.items);
164
- (0, output_1.info)(`\nTotal: ${result.count} contacts (${result.pagesFetched} pages)`);
165
- return;
166
- }
167
- const top = parseInt(opts.limit || '25', 10);
168
- const skip = parseInt(opts.skip || '0', 10);
169
- const result = await (0, client_1.post)(api_key, (0, pagination_1.with_query)('/contacts/filter', top, skip), body);
170
- if (!result?.items?.length) {
171
- (0, output_1.info)('No contacts matched.');
172
- return;
173
- }
174
- if (opts.json || opts.pretty) {
175
- (0, output_1.print)(result, opts);
176
- return;
177
- }
178
- contact_table(result.items);
179
- (0, output_1.info)(`\nShowing ${result.items.length} contacts.`
180
- + (result.hasMore ? ' More available — use --skip or --all.' : ''));
181
- };
182
- exports.handle_search = handle_search;
183
- const handle_statuses = async (api_key, id_or_email, print_opts) => {
184
- const id = await (0, resolve_1.resolve_contact_id)(api_key, id_or_email);
185
- const result = await (0, client_1.get)(api_key, `/contacts/${id}/statuses`);
186
- if (print_opts.json || print_opts.pretty) {
187
- (0, output_1.print)(result, print_opts);
188
- return;
189
- }
190
- console.log(`\nContact ID: ${output_1.pc.bold(String(result.contactId))}`);
191
- console.log(` Opted out: ${result.isOptedOut ? output_1.pc.red('Yes') : output_1.pc.green('No')}`);
192
- console.log(` Call: ${result.callStatus}`);
193
- console.log(` Meeting: ${result.meetingStatus === 'meetingBooked' ? output_1.pc.green('Booked') : '—'}`);
194
- if (result.sequences?.length) {
195
- console.log();
196
- (0, output_1.print_table)(result.sequences.map(s => ({
197
- Sequence: (0, output_1.truncate)(s.sequenceName || String(s.sequenceId), 30),
198
- Status: s.statusInSequence,
199
- Replied: s.emailDisposition?.isReplied ? output_1.pc.green('Yes') : 'No',
200
- Bounced: s.emailDisposition?.isBounced ? output_1.pc.red('Yes') : 'No',
201
- })), ['Sequence', 'Status', 'Replied', 'Bounced']);
202
- }
203
- else
204
- (0, output_1.info)('\nNot in any sequences.');
205
- };
206
- exports.handle_statuses = handle_statuses;
207
- const handle_import = async (api_key, file_path, opts) => {
208
- if (!file_path || !fs_1.default.existsSync(file_path))
209
- (0, output_1.fail)(`CSV file not found: ${file_path}`);
210
- const { headers, rows } = (0, csv_1.parse_csv)(fs_1.default.readFileSync(file_path, 'utf-8'));
211
- if (!headers.length || !rows.length)
212
- (0, output_1.fail)('CSV file is empty or has no data rows.');
213
- let overrides = {};
214
- if (opts.mapping) {
215
- try {
216
- overrides = JSON.parse(opts.mapping);
217
- }
218
- catch {
219
- (0, output_1.fail)('--mapping must be valid JSON, e.g. \'{"email":"Email Address"}\'');
220
- }
221
- }
222
- let mapping;
223
- try {
224
- mapping = (0, csv_1.map_columns)(headers, overrides);
225
- }
226
- catch (e) {
227
- return (0, output_1.fail)(e.message);
228
- }
229
- if (!mapping.mapped.length)
230
- (0, output_1.fail)('No CSV columns could be mapped to Reply fields.\n'
231
- + ` Columns found: ${headers.join(', ')}\n`
232
- + ` Use --mapping '{"field":"CSV Header"}'. Valid fields: ${csv_1.STANDARD_FIELDS.join(', ')}`);
233
- const items = (0, csv_1.rows_to_items)(rows, mapping);
234
- const options = {};
235
- if (opts.list)
236
- options.listIds = [parseInt(opts.list, 10)];
237
- if (opts.sequence)
238
- options.sequenceId = parseInt(opts.sequence, 10);
239
- if (opts.skipExisting)
240
- options.skipExisting = true;
241
- if (opts.overwrite)
242
- options.overwriteExisting = true;
243
- if (opts.detectTimezone)
244
- options.detectTimeZone = true;
245
- if (mapping.unmapped.length)
246
- (0, output_1.warn)(`Unmapped CSV columns (ignored): ${mapping.unmapped.join(', ')}`);
247
- for (const { header, field } of mapping.mapped)
248
- (0, output_1.info)(` ${header} → ${field}`);
249
- if (opts.dryRun) {
250
- (0, output_1.print_dry_run)({
251
- dryRun: true,
252
- action: 'contacts.import',
253
- method: 'POST',
254
- path: '/v3/contacts/import',
255
- payload: {
256
- mapping: mapping.mapped.map(m => ({ column: m.header, field: m.field })),
257
- unmappedColumns: mapping.unmapped,
258
- options,
259
- sampleItems: items.slice(0, 5),
260
- },
261
- affected: items.length,
262
- }, opts);
263
- return;
264
- }
265
- await (0, command_1.confirm_or_abort)(`Import ${items.length} contacts from ${file_path}`
266
- + (opts.list ? ` into list ${opts.list}` : '')
267
- + (opts.sequence ? ` and add to sequence ${opts.sequence}` : '') + '?', opts);
268
- const totals = { added: 0, updated: 0, skipped: 0, failed: 0 };
269
- const failures = [];
270
- for (let offset = 0; offset < items.length; offset += IMPORT_BATCH_SIZE) {
271
- const batch = items.slice(offset, offset + IMPORT_BATCH_SIZE);
272
- const result = await (0, client_1.post)(api_key, '/contacts/import', { items: batch, options });
273
- totals.added += result.added;
274
- totals.updated += result.updated;
275
- totals.skipped += result.skipped;
276
- totals.failed += result.failed;
277
- result.items.forEach((item, i) => {
278
- if (item.status === 'failed')
279
- failures.push({ row: offset + i + 2, error: item.error });
280
- });
281
- if (items.length > IMPORT_BATCH_SIZE)
282
- (0, output_1.info)(`Batch ${Math.floor(offset / IMPORT_BATCH_SIZE) + 1}: ${batch.length} items sent.`);
283
- }
284
- (0, output_1.success)(`Import complete: ${totals.added} added, ${totals.updated} updated, `
285
- + `${totals.skipped} skipped, ${totals.failed} failed.`);
286
- for (const f of failures.slice(0, 20))
287
- (0, output_1.warn)(` Row ${f.row}: ${f.error || 'unknown error'}`);
288
- if (failures.length > 20)
289
- (0, output_1.warn)(` …and ${failures.length - 20} more failures.`);
290
- if (opts.json || opts.pretty)
291
- (0, output_1.print)({ action: 'contacts.import', ...totals, failures }, opts);
292
- if (totals.failed > 0)
293
- process.exit(1);
294
- };
295
- exports.handle_import = handle_import;
296
- const contacts_command = new commander_1.Command('contacts')
297
- .description('Manage contacts (prospects)');
298
- exports.contacts_command = contacts_command;
299
- (0, command_1.with_pagination_opts)(contacts_command
300
- .command('list')
301
- .description('List contacts'))
302
- .addHelpText('after', '\nExamples:\n reply contacts list\n reply contacts list --limit 100 --skip 100\n reply contacts list --all --json')
303
- .action(async function () {
304
- const opts = this.optsWithGlobals();
305
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
306
- await handle_list(key, opts);
307
- });
308
- contacts_command
309
- .command('get')
310
- .description('Get contact details by ID or email')
311
- .argument('<id-or-email>', 'Contact ID or email address')
312
- .addHelpText('after', '\nExamples:\n reply contacts get john@example.com\n reply contacts get 12345678')
313
- .action(async function (id_or_email) {
314
- const opts = this.optsWithGlobals();
315
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
316
- await handle_get(key, id_or_email, { json: opts.json, pretty: opts.pretty });
317
- });
318
- contacts_command
319
- .command('create')
320
- .description('Create a new contact')
321
- .option('--email <email>', 'Email address')
322
- .option('--first-name <name>', 'First name')
323
- .option('--last-name <name>', 'Last name')
324
- .option('--company <company>', 'Company name')
325
- .option('--title <title>', 'Job title')
326
- .option('--phone <phone>', 'Phone number')
327
- .option('--linkedin <url>', 'LinkedIn profile URL')
328
- .option('--city <city>', 'City')
329
- .option('--state <state>', 'State')
330
- .option('--country <country>', 'Country')
331
- .option('--industry <industry>', 'Industry')
332
- .option('--notes <notes>', 'Notes')
333
- .option('--custom <fields>', 'Custom fields: Key1=Val1,Key2=Val2')
334
- .addHelpText('after', '\nRequires --email or --linkedin.\n\nExamples:\n reply contacts create --email john@co.com --first-name John --company Acme')
335
- .action(async function () {
336
- const opts = this.optsWithGlobals();
337
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
338
- await handle_create(key, opts, { json: opts.json, pretty: opts.pretty });
339
- });
340
- contacts_command
341
- .command('update')
342
- .description('Update an existing contact by ID or email')
343
- .argument('<id-or-email>', 'Contact ID or email address')
344
- .option('--email <email>', 'New email address')
345
- .option('--first-name <name>', 'First name')
346
- .option('--last-name <name>', 'Last name')
347
- .option('--company <company>', 'Company name')
348
- .option('--title <title>', 'Job title')
349
- .option('--phone <phone>', 'Phone number')
350
- .option('--linkedin <url>', 'LinkedIn profile URL')
351
- .option('--city <city>', 'City')
352
- .option('--state <state>', 'State')
353
- .option('--country <country>', 'Country')
354
- .option('--industry <industry>', 'Industry')
355
- .option('--notes <notes>', 'Notes')
356
- .option('--custom <fields>', 'Custom fields by name: Name1=Val1,Name2=Val2')
357
- .addHelpText('after', '\nExamples:\n reply contacts update john@co.com --company "New Corp"\n reply contacts update 12345678 --title CTO')
358
- .action(async function (id_or_email) {
359
- const opts = this.optsWithGlobals();
360
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
361
- await handle_update(key, id_or_email, opts, { json: opts.json, pretty: opts.pretty });
362
- });
363
- (0, command_1.with_confirm_opts)(contacts_command
364
- .command('delete')
365
- .description('Delete a contact by ID or email')
366
- .argument('<id-or-email>', 'Contact ID or email address'))
367
- .addHelpText('after', '\nExamples:\n reply contacts delete john@example.com --yes')
368
- .action(async function (id_or_email) {
369
- const opts = this.optsWithGlobals();
370
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
371
- await handle_delete(key, id_or_email, { yes: opts.yes });
372
- });
373
- (0, command_1.with_pagination_opts)(contacts_command
374
- .command('search')
375
- .description('Search contacts with filters')
376
- .option('--term <text>', 'Free-text search term')
377
- .option('--list <id>', 'Only contacts in this list')
378
- .option('--sequence <id>', 'Only contacts in this sequence')
379
- .option('--rule <rule...>', 'Filter rule: property=condition:value (repeatable)'))
380
- .addHelpText('after', '\nExamples:\n reply contacts search --term "acme.com"\n reply contacts search --list 42 --all --json\n reply contacts search --rule country=equals:Germany')
381
- .action(async function () {
382
- const opts = this.optsWithGlobals();
383
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
384
- await handle_search(key, opts);
385
- });
386
- contacts_command
387
- .command('statuses')
388
- .description('Show a contact\'s opt-out, call, meeting, and per-sequence status')
389
- .argument('<id-or-email>', 'Contact ID or email address')
390
- .addHelpText('after', '\nExamples:\n reply contacts statuses john@co.com')
391
- .action(async function (id_or_email) {
392
- const opts = this.optsWithGlobals();
393
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
394
- await handle_statuses(key, id_or_email, { json: opts.json, pretty: opts.pretty });
395
- });
396
- (0, command_1.with_confirm_opts)(contacts_command
397
- .command('import')
398
- .description('Import contacts from a CSV file')
399
- .argument('<file>', 'Path to CSV file')
400
- .option('--mapping <json>', 'Override column mapping: {"field":"CSV Header"}')
401
- .option('--list <id>', 'Add imported contacts to a list')
402
- .option('--sequence <id>', 'Add imported contacts to a sequence')
403
- .option('--skip-existing', 'Skip contacts that already exist')
404
- .option('--overwrite', 'Overwrite fields of existing contacts')
405
- .option('--detect-timezone', 'Detect timezone from location'), { dry_run: true })
406
- .addHelpText('after', '\nColumns are auto-mapped by header name; use --mapping to override.\nAlways run with --dry-run first to check the mapping.\n\nExamples:\n reply contacts import prospects.csv --dry-run\n reply contacts import prospects.csv --list 42 --skip-existing --yes --json')
407
- .action(async function (file) {
408
- const opts = this.optsWithGlobals();
409
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
410
- await handle_import(key, file, opts);
411
- });
412
- //# sourceMappingURL=contacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/commands/contacts.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAkC;AAClC,4CAAoB;AACpB,4CAAsD;AACtD,wCAA8C;AAC9C,8CAA2F;AAC3F,oDAA0D;AAC1D,8CAA8D;AAC9D,sCAAoF;AACpF,4CAAwH;AA+CxH,MAAM,i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AyQ,CAAC;KAC/R,MAAM,CAAC,KAAK,WAAyB,IAAY;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAA,sBAAe,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { Command } from 'commander';
2
- import type { Print_opts } from '../utils/output';
3
- declare const handle_list: (api_key: string, opts: {
4
- my?: boolean;
5
- limit?: string;
6
- skip?: string;
7
- all?: boolean;
8
- } & Print_opts) => Promise<void>;
9
- declare const handle_check: (api_key: string) => Promise<void>;
10
- declare const email_accounts_command: Command;
11
- export { email_accounts_command, handle_list, handle_check };
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handle_check = exports.handle_list = exports.email_accounts_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 command_1 = require("../utils/command");
8
- const pagination_1 = require("../utils/pagination");
9
- const output_1 = require("../utils/output");
10
- const connection_label = (status) => {
11
- switch (status) {
12
- case 'connected': return output_1.pc.green('connected');
13
- case 'disconnected': return output_1.pc.red('disconnected');
14
- default: return output_1.pc.dim(status || 'unknown');
15
- }
16
- };
17
- const accounts_table = (accounts) => {
18
- (0, output_1.print_table)(accounts.map(a => ({
19
- ID: String(a.id),
20
- Email: a.email,
21
- 'Sender Name': a.senderName || '—',
22
- Type: a.emailAccountType,
23
- Status: connection_label(a.connectionStatus),
24
- Default: a.isDefault ? 'yes' : '',
25
- 'Daily Limit': String(a.dailyLimit ?? '—'),
26
- })), ['ID', 'Email', 'Sender Name', 'Type', 'Status', 'Default', 'Daily Limit']);
27
- };
28
- const handle_list = async (api_key, opts) => {
29
- const base = `/email-accounts${opts.my ? '?my=true' : ''}`;
30
- if (opts.all) {
31
- const result = await (0, pagination_1.fetch_all)(api_key, base);
32
- if (opts.json || opts.pretty) {
33
- (0, output_1.print)(result, opts);
34
- return;
35
- }
36
- accounts_table(result.items);
37
- (0, output_1.info)(`\nTotal: ${result.count} email accounts`);
38
- return;
39
- }
40
- const top = parseInt(opts.limit || '25', 10);
41
- const skip = parseInt(opts.skip || '0', 10);
42
- const sep = base.includes('?') ? '&' : '?';
43
- const result = await (0, client_1.get)(api_key, `${base}${sep}top=${top}&skip=${skip}`);
44
- if (!result?.items?.length) {
45
- (0, output_1.info)('No email accounts connected.');
46
- (0, output_1.info)('Connect one in Reply → Settings → Email Accounts.');
47
- return;
48
- }
49
- if (opts.json || opts.pretty) {
50
- (0, output_1.print)(result, opts);
51
- return;
52
- }
53
- accounts_table(result.items);
54
- };
55
- exports.handle_list = handle_list;
56
- // Machine-readable connectivity check (used by scripts and agent skills):
57
- // exit 0 with ACCOUNTS_FOUND:<n>, exit 1 with NO_ACCOUNTS.
58
- const handle_check = async (api_key) => {
59
- const result = await (0, client_1.get)(api_key, '/email-accounts?top=100');
60
- const connected = (result?.items ?? []).filter(a => a.connectionStatus !== 'disconnected');
61
- if (!connected.length) {
62
- console.log('NO_ACCOUNTS');
63
- process.exit(1);
64
- }
65
- console.log(`ACCOUNTS_FOUND:${connected.length}`);
66
- console.log(JSON.stringify(connected.map(a => ({
67
- id: a.id,
68
- email: a.email,
69
- senderName: a.senderName,
70
- connectionStatus: a.connectionStatus,
71
- isDefault: a.isDefault,
72
- }))));
73
- };
74
- exports.handle_check = handle_check;
75
- const email_accounts_command = new commander_1.Command('email-accounts')
76
- .description('View connected email sending accounts');
77
- exports.email_accounts_command = email_accounts_command;
78
- (0, command_1.with_pagination_opts)(email_accounts_command
79
- .command('list')
80
- .description('List connected email accounts')
81
- .option('--my', 'Only accounts owned by the authenticated user'))
82
- .addHelpText('after', '\nExamples:\n reply email-accounts list\n reply email-accounts list --json')
83
- .action(async function () {
84
- const opts = this.optsWithGlobals();
85
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
86
- await handle_list(key, opts);
87
- });
88
- email_accounts_command
89
- .command('check')
90
- .description('Check for usable sending accounts (machine-readable)')
91
- .addHelpText('after', '\nOutputs ACCOUNTS_FOUND:<count> or NO_ACCOUNTS (exit 1).\n\nExamples:\n reply email-accounts check')
92
- .action(async function () {
93
- const opts = this.optsWithGlobals();
94
- const key = (0, auth_1.resolve_api_key)(opts.apiKey);
95
- await handle_check(key);
96
- });
97
- //# sourceMappingURL=email-accounts.js.map