reply-cli 0.2.0 → 0.4.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.
- package/README.md +157 -135
- package/dist/api/headers.d.ts +4 -0
- package/dist/api/headers.js +13 -0
- package/dist/api/headers.js.map +1 -0
- package/dist/auth/oauth-flow.d.ts +38 -0
- package/dist/auth/oauth-flow.js +193 -0
- package/dist/auth/oauth-flow.js.map +1 -0
- package/dist/auth/pkce.d.ts +9 -0
- package/dist/auth/pkce.js +19 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/request-identity.d.ts +16 -0
- package/dist/auth/request-identity.js +67 -0
- package/dist/auth/request-identity.js.map +1 -0
- package/dist/auth/resolve.d.ts +23 -0
- package/dist/auth/resolve.js +55 -0
- package/dist/auth/resolve.js.map +1 -0
- package/dist/auth/status.d.ts +19 -0
- package/dist/auth/status.js +27 -0
- package/dist/auth/status.js.map +1 -0
- package/dist/auth/token.d.ts +29 -0
- package/dist/auth/token.js +39 -0
- package/dist/auth/token.js.map +1 -0
- package/dist/commands/api.d.ts +19 -0
- package/dist/commands/api.js +137 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/auth.d.ts +19 -3
- package/dist/commands/auth.js +251 -16
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/authed.d.ts +13 -0
- package/dist/commands/authed.js +20 -0
- package/dist/commands/authed.js.map +1 -0
- package/dist/commands/profile.d.ts +31 -0
- package/dist/commands/profile.js +348 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/skills.d.ts +12 -0
- package/dist/commands/skills.js +138 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/team.d.ts +17 -0
- package/dist/commands/team.js +146 -0
- package/dist/commands/team.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.js +83 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +15 -0
- package/dist/context.js +17 -0
- package/dist/context.js.map +1 -0
- package/dist/credentials/file-store.d.ts +13 -0
- package/dist/credentials/file-store.js +88 -0
- package/dist/credentials/file-store.js.map +1 -0
- package/dist/credentials/types.d.ts +25 -0
- package/dist/credentials/types.js +3 -0
- package/dist/credentials/types.js.map +1 -0
- package/dist/index.js +101 -69
- package/dist/index.js.map +1 -1
- package/dist/profile.d.ts +51 -0
- package/dist/profile.js +295 -0
- package/dist/profile.js.map +1 -0
- package/dist/skills/adapter-flat.d.ts +32 -0
- package/dist/skills/adapter-flat.js +480 -0
- package/dist/skills/adapter-flat.js.map +1 -0
- package/dist/skills/adapter-native.d.ts +22 -0
- package/dist/skills/adapter-native.js +335 -0
- package/dist/skills/adapter-native.js.map +1 -0
- package/dist/skills/detect.d.ts +21 -0
- package/dist/skills/detect.js +102 -0
- package/dist/skills/detect.js.map +1 -0
- package/dist/skills/hosts.d.ts +5 -0
- package/dist/skills/hosts.js +118 -0
- package/dist/skills/hosts.js.map +1 -0
- package/dist/skills/journal.d.ts +23 -0
- package/dist/skills/journal.js +91 -0
- package/dist/skills/journal.js.map +1 -0
- package/dist/skills/orchestrate.d.ts +27 -0
- package/dist/skills/orchestrate.js +124 -0
- package/dist/skills/orchestrate.js.map +1 -0
- package/dist/skills/packs.d.ts +16 -0
- package/dist/skills/packs.js +153 -0
- package/dist/skills/packs.js.map +1 -0
- package/dist/skills/report.d.ts +7 -0
- package/dist/skills/report.js +105 -0
- package/dist/skills/report.js.map +1 -0
- package/dist/skills/types.d.ts +80 -0
- package/dist/skills/types.js +5 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/teams.d.ts +14 -0
- package/dist/teams.js +103 -0
- package/dist/teams.js.map +1 -0
- package/dist/utils/client.d.ts +19 -34
- package/dist/utils/client.js +123 -94
- package/dist/utils/client.js.map +1 -1
- package/dist/utils/errors.d.ts +47 -0
- package/dist/utils/errors.js +86 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/output.d.ts +7 -19
- package/dist/utils/output.js +39 -81
- package/dist/utils/output.js.map +1 -1
- package/package.json +11 -25
- package/dist/commands/contacts.d.ts +0 -35
- package/dist/commands/contacts.js +0 -412
- package/dist/commands/contacts.js.map +0 -1
- package/dist/commands/email-accounts.d.ts +0 -11
- package/dist/commands/email-accounts.js +0 -97
- package/dist/commands/email-accounts.js.map +0 -1
- package/dist/commands/inbox.d.ts +0 -30
- package/dist/commands/inbox.js +0 -225
- package/dist/commands/inbox.js.map +0 -1
- package/dist/commands/lists.d.ts +0 -20
- package/dist/commands/lists.js +0 -137
- package/dist/commands/lists.js.map +0 -1
- package/dist/commands/reports.d.ts +0 -10
- package/dist/commands/reports.js +0 -70
- package/dist/commands/reports.js.map +0 -1
- package/dist/commands/schedules.d.ts +0 -6
- package/dist/commands/schedules.js +0 -59
- package/dist/commands/schedules.js.map +0 -1
- package/dist/commands/sequence-contacts.d.ts +0 -19
- package/dist/commands/sequence-contacts.js +0 -129
- package/dist/commands/sequence-contacts.js.map +0 -1
- package/dist/commands/sequences-stats.d.ts +0 -42
- package/dist/commands/sequences-stats.js +0 -99
- package/dist/commands/sequences-stats.js.map +0 -1
- package/dist/commands/sequences.d.ts +0 -22
- package/dist/commands/sequences.js +0 -211
- package/dist/commands/sequences.js.map +0 -1
- package/dist/utils/auth.d.ts +0 -2
- package/dist/utils/auth.js +0 -33
- package/dist/utils/auth.js.map +0 -1
- package/dist/utils/command.d.ts +0 -18
- package/dist/utils/command.js +0 -51
- package/dist/utils/command.js.map +0 -1
- package/dist/utils/csv.d.ts +0 -19
- package/dist/utils/csv.js +0 -118
- package/dist/utils/csv.js.map +0 -1
- package/dist/utils/pagination.d.ts +0 -22
- package/dist/utils/pagination.js +0 -37
- package/dist/utils/pagination.js.map +0 -1
- package/dist/utils/resolve.d.ts +0 -4
- package/dist/utils/resolve.js +0 -34
- package/dist/utils/resolve.js.map +0 -1
package/dist/commands/inbox.js
DELETED
|
@@ -1,225 +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_categories_assign = exports.handle_categories_list = exports.handle_reply = exports.handle_thread_get = exports.handle_threads_list = exports.inbox_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 output_1 = require("../utils/output");
|
|
13
|
-
const threads_table = (threads) => {
|
|
14
|
-
(0, output_1.print_table)(threads.map(t => ({
|
|
15
|
-
ID: String(t.id),
|
|
16
|
-
Read: t.isRead ? '' : output_1.pc.bold('●'),
|
|
17
|
-
Contact: (0, output_1.truncate)(t.contact?.fullName || t.contact?.email || '—', 22),
|
|
18
|
-
Subject: (0, output_1.truncate)(t.subject || '(no subject)', 32),
|
|
19
|
-
Sequence: (0, output_1.truncate)(t.sequence?.name || '—', 18),
|
|
20
|
-
Category: t.category?.name || '—',
|
|
21
|
-
Activity: (0, output_1.format_date)(t.lastActivityDate),
|
|
22
|
-
})), ['ID', 'Read', 'Contact', 'Subject', 'Sequence', 'Category', 'Activity']);
|
|
23
|
-
};
|
|
24
|
-
const handle_threads_list = async (api_key, opts) => {
|
|
25
|
-
const top = parseInt(opts.limit || '25', 10);
|
|
26
|
-
const skip = parseInt(opts.skip || '0', 10);
|
|
27
|
-
const filter_body = {};
|
|
28
|
-
if (opts.search)
|
|
29
|
-
filter_body.search = opts.search;
|
|
30
|
-
if (opts.category)
|
|
31
|
-
filter_body.categoryIds = [parseInt(opts.category, 10)];
|
|
32
|
-
if (opts.sequence)
|
|
33
|
-
filter_body.sequenceIds = [parseInt(opts.sequence, 10)];
|
|
34
|
-
if (opts.unread)
|
|
35
|
-
filter_body.source = 'unread';
|
|
36
|
-
if (opts.source)
|
|
37
|
-
filter_body.source = opts.source;
|
|
38
|
-
if (opts.meetingIntent)
|
|
39
|
-
filter_body.onlyWithMeetingIntent = true;
|
|
40
|
-
const has_filters = Object.keys(filter_body).length > 0;
|
|
41
|
-
const result = has_filters
|
|
42
|
-
? await (0, client_1.post)(api_key, `/inbox/threads/filter?top=${top}&skip=${skip}`, filter_body)
|
|
43
|
-
: await (0, client_1.get)(api_key, `/inbox/threads?top=${top}&skip=${skip}`);
|
|
44
|
-
if (!result?.items?.length) {
|
|
45
|
-
(0, output_1.info)('No inbox threads found.');
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (opts.json || opts.pretty) {
|
|
49
|
-
(0, output_1.print)(result, opts);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
threads_table(result.items);
|
|
53
|
-
(0, output_1.info)(`\nShowing ${result.items.length} threads.`
|
|
54
|
-
+ (result.hasMore ? ' More available — use --skip.' : ''));
|
|
55
|
-
};
|
|
56
|
-
exports.handle_threads_list = handle_threads_list;
|
|
57
|
-
const strip_html = (html) => html.replace(/<style[\s\S]*?<\/style>/gi, '')
|
|
58
|
-
.replace(/<[^>]*>/g, ' ')
|
|
59
|
-
.replace(/ /g, ' ')
|
|
60
|
-
.replace(/\s+/g, ' ')
|
|
61
|
-
.trim();
|
|
62
|
-
const handle_thread_get = async (api_key, id, opts) => {
|
|
63
|
-
const thread = await (0, client_1.get)(api_key, `/inbox/threads/${id}`);
|
|
64
|
-
if (!thread) {
|
|
65
|
-
(0, output_1.info)('Thread not found.');
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (opts.json || opts.pretty) {
|
|
69
|
-
(0, output_1.print)(thread, opts);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
console.log(`\nThread ${output_1.pc.bold(String(thread.id))} — ${thread.subject || '(no subject)'}`);
|
|
73
|
-
console.log(` Channel: ${thread.channel}`);
|
|
74
|
-
console.log(` Contact: ${thread.contact?.fullName || '—'} <${thread.contact?.email || '—'}> ${thread.contact?.companyName ? `(${thread.contact.companyName})` : ''}`);
|
|
75
|
-
console.log(` Sequence: ${thread.sequence?.name || '—'}`);
|
|
76
|
-
console.log(` Category: ${thread.category?.name || '—'}`);
|
|
77
|
-
if (thread.hasMeetingIntent)
|
|
78
|
-
console.log(` ${output_1.pc.green('Meeting intent detected')}`);
|
|
79
|
-
const messages = thread.messages || [];
|
|
80
|
-
if (opts.messages && messages.length) {
|
|
81
|
-
console.log(output_1.pc.bold(`\n Messages (${messages.length}):`));
|
|
82
|
-
for (const m of messages) {
|
|
83
|
-
const direction = m.isOutbound ? output_1.pc.cyan('→ sent') : output_1.pc.green('← received');
|
|
84
|
-
console.log(`\n ${direction} ${output_1.pc.dim((0, output_1.format_date)(m.date))} ${m.fromName || m.fromAddress || ''}`);
|
|
85
|
-
if (m.subject)
|
|
86
|
-
console.log(` Subject: ${m.subject}`);
|
|
87
|
-
console.log(` ${(0, output_1.truncate)(strip_html(m.body || ''), 500)}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else if (messages.length)
|
|
91
|
-
(0, output_1.info)(`\n ${messages.length} messages — pass --messages to show them.`);
|
|
92
|
-
};
|
|
93
|
-
exports.handle_thread_get = handle_thread_get;
|
|
94
|
-
const handle_reply = async (api_key, thread_id, opts) => {
|
|
95
|
-
let message = opts.body;
|
|
96
|
-
if (!message && opts.bodyFile) {
|
|
97
|
-
if (!fs_1.default.existsSync(opts.bodyFile))
|
|
98
|
-
(0, output_1.fail)(`Body file not found: ${opts.bodyFile}`);
|
|
99
|
-
message = fs_1.default.readFileSync(opts.bodyFile, 'utf-8');
|
|
100
|
-
}
|
|
101
|
-
if (!message?.trim())
|
|
102
|
-
(0, output_1.fail)('Provide the reply text via --body or --body-file.');
|
|
103
|
-
// The send body must match the thread channel (email | linkedIn)
|
|
104
|
-
const thread = await (0, client_1.get)(api_key, `/inbox/threads/${thread_id}`);
|
|
105
|
-
if (!thread)
|
|
106
|
-
return (0, output_1.fail)(`Thread ${thread_id} not found.`);
|
|
107
|
-
const channel = thread.channel === 'linkedIn' ? 'linkedIn' : 'email';
|
|
108
|
-
const to = thread.contact?.email || thread.contact?.fullName || 'contact';
|
|
109
|
-
await (0, command_1.confirm_or_abort)(`Send this ${channel} reply to ${to} (thread ${thread_id})?\n`
|
|
110
|
-
+ `---\n${(0, output_1.truncate)(message.trim(), 500)}\n---`, opts);
|
|
111
|
-
const body = { channel, message };
|
|
112
|
-
if (channel === 'email') {
|
|
113
|
-
if (opts.cc)
|
|
114
|
-
body.cc = opts.cc.split(',').map(e => e.trim());
|
|
115
|
-
if (opts.bcc)
|
|
116
|
-
body.bcc = opts.bcc.split(',').map(e => e.trim());
|
|
117
|
-
if (opts.applySignature)
|
|
118
|
-
body.applySignature = true;
|
|
119
|
-
}
|
|
120
|
-
const result = await (0, client_1.post)(api_key, `/inbox/threads/${thread_id}/messages`, body);
|
|
121
|
-
(0, output_1.success)(`Reply sent on thread ${thread_id} (${channel}).`);
|
|
122
|
-
if (opts.json || opts.pretty)
|
|
123
|
-
(0, output_1.print)(result, opts);
|
|
124
|
-
};
|
|
125
|
-
exports.handle_reply = handle_reply;
|
|
126
|
-
const handle_categories_list = async (api_key, print_opts) => {
|
|
127
|
-
const categories = await (0, client_1.get)(api_key, '/inbox/threads/categories');
|
|
128
|
-
if (!categories?.length) {
|
|
129
|
-
(0, output_1.info)('No inbox categories found.');
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (print_opts.json || print_opts.pretty) {
|
|
133
|
-
(0, output_1.print)(categories, print_opts);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
(0, output_1.print_table)(categories.map(c => ({
|
|
137
|
-
ID: String(c.id),
|
|
138
|
-
Name: c.name,
|
|
139
|
-
Color: c.color,
|
|
140
|
-
Unread: String(c.unreadThreadsCount),
|
|
141
|
-
})), ['ID', 'Name', 'Color', 'Unread']);
|
|
142
|
-
};
|
|
143
|
-
exports.handle_categories_list = handle_categories_list;
|
|
144
|
-
const handle_categories_assign = async (api_key, thread_id, opts) => {
|
|
145
|
-
if (!opts.category && !opts.clear)
|
|
146
|
-
(0, output_1.fail)('Pass --category <id> or --clear.');
|
|
147
|
-
const category_id = opts.clear ? null : parseInt(opts.category, 10);
|
|
148
|
-
await (0, client_1.put)(api_key, `/inbox/threads/${thread_id}/category`, { categoryId: category_id });
|
|
149
|
-
(0, output_1.success)(opts.clear
|
|
150
|
-
? `Category cleared on thread ${thread_id}.`
|
|
151
|
-
: `Thread ${thread_id} categorized as ${opts.category}.`);
|
|
152
|
-
};
|
|
153
|
-
exports.handle_categories_assign = handle_categories_assign;
|
|
154
|
-
const inbox_command = new commander_1.Command('inbox')
|
|
155
|
-
.description('Read and answer inbox conversations');
|
|
156
|
-
exports.inbox_command = inbox_command;
|
|
157
|
-
const threads_command = new commander_1.Command('threads')
|
|
158
|
-
.description('Inbox threads');
|
|
159
|
-
(0, command_1.with_pagination_opts)(threads_command
|
|
160
|
-
.command('list')
|
|
161
|
-
.description('List inbox threads (newest activity first)')
|
|
162
|
-
.option('--search <text>', 'Search threads')
|
|
163
|
-
.option('--category <id>', 'Only threads in this category')
|
|
164
|
-
.option('--sequence <id>', 'Only threads from this sequence')
|
|
165
|
-
.option('--unread', 'Only unread threads')
|
|
166
|
-
.option('--source <source>', 'Source: inbox | sent | unread | aiDraft')
|
|
167
|
-
.option('--meeting-intent', 'Only threads with meeting intent'))
|
|
168
|
-
.addHelpText('after', '\nExamples:\n reply inbox threads list\n reply inbox threads list --unread --json\n reply inbox threads list --category 3 --limit 50')
|
|
169
|
-
.action(async function () {
|
|
170
|
-
const opts = this.optsWithGlobals();
|
|
171
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
172
|
-
await handle_threads_list(key, opts);
|
|
173
|
-
});
|
|
174
|
-
threads_command
|
|
175
|
-
.command('get')
|
|
176
|
-
.description('Get a thread with its context')
|
|
177
|
-
.argument('<id>', 'Thread ID')
|
|
178
|
-
.option('--messages', 'Include full message history')
|
|
179
|
-
.addHelpText('after', '\nExamples:\n reply inbox threads get 987 --messages\n reply inbox threads get 987 --json')
|
|
180
|
-
.action(async function (id) {
|
|
181
|
-
const opts = this.optsWithGlobals();
|
|
182
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
183
|
-
await handle_thread_get(key, id, opts);
|
|
184
|
-
});
|
|
185
|
-
inbox_command.addCommand(threads_command);
|
|
186
|
-
(0, command_1.with_confirm_opts)(inbox_command
|
|
187
|
-
.command('reply')
|
|
188
|
-
.description('Send a reply on a thread')
|
|
189
|
-
.argument('<thread-id>', 'Thread ID')
|
|
190
|
-
.option('--body <text>', 'Reply text (HTML allowed for email)')
|
|
191
|
-
.option('--body-file <path>', 'Read the reply text from a file')
|
|
192
|
-
.option('--cc <emails>', 'CC (comma-separated, email threads only)')
|
|
193
|
-
.option('--bcc <emails>', 'BCC (comma-separated, email threads only)')
|
|
194
|
-
.option('--apply-signature', 'Append the sending account\'s signature'))
|
|
195
|
-
.addHelpText('after', '\nExamples:\n reply inbox reply 987 --body "Thanks — how about Tuesday at 10?" --yes\n reply inbox reply 987 --body-file reply.html --apply-signature --yes')
|
|
196
|
-
.action(async function (thread_id) {
|
|
197
|
-
const opts = this.optsWithGlobals();
|
|
198
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
199
|
-
await handle_reply(key, thread_id, opts);
|
|
200
|
-
});
|
|
201
|
-
const categories_command = new commander_1.Command('categories')
|
|
202
|
-
.description('Inbox categories');
|
|
203
|
-
categories_command
|
|
204
|
-
.command('list')
|
|
205
|
-
.description('List inbox categories with unread counts')
|
|
206
|
-
.addHelpText('after', '\nExamples:\n reply inbox categories list --json')
|
|
207
|
-
.action(async function () {
|
|
208
|
-
const opts = this.optsWithGlobals();
|
|
209
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
210
|
-
await handle_categories_list(key, { json: opts.json, pretty: opts.pretty });
|
|
211
|
-
});
|
|
212
|
-
categories_command
|
|
213
|
-
.command('assign')
|
|
214
|
-
.description('Assign a category to a thread (or clear it)')
|
|
215
|
-
.argument('<thread-id>', 'Thread ID')
|
|
216
|
-
.option('--category <id>', 'Category ID')
|
|
217
|
-
.option('--clear', 'Clear the thread\'s category')
|
|
218
|
-
.addHelpText('after', '\nExamples:\n reply inbox categories assign 987 --category 3\n reply inbox categories assign 987 --clear')
|
|
219
|
-
.action(async function (thread_id) {
|
|
220
|
-
const opts = this.optsWithGlobals();
|
|
221
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
222
|
-
await handle_categories_assign(key, thread_id, opts);
|
|
223
|
-
});
|
|
224
|
-
inbox_command.addCommand(categories_command);
|
|
225
|
-
//# sourceMappingURL=inbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inbox.js","sourceRoot":"","sources":["../../src/commands/inbox.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAkC;AAClC,4CAAoB;AACpB,4CAA+C;AAC/C,wCAA8C;AAC9C,8CAA2F;AAC3F,4CAAmG;AA6CnG,MAAM,aAAa,GAAG,CAAC,OAAiB,EAAC,EAAE;IACvC,IAAA,oBAAW,EACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAChB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAE,CAAC,IAAI,CAAC,GAAG,CAAC;QAClC,OAAO,EAAE,IAAA,iBAAQ,EAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,GAAG,EAAE,EAAE,CAAC;QACrE,OAAO,EAAE,IAAA,iBAAQ,EAAC,CAAC,CAAC,OAAO,IAAI,cAAc,EAAE,EAAE,CAAC;QAClD,QAAQ,EAAE,IAAA,iBAAQ,E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AAC;AACzD,CAAC,CAAC,CAAC;AAEP,aAAa,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC"}
|
package/dist/commands/lists.d.ts
DELETED
|
@@ -1,20 +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
|
-
search?: string;
|
|
5
|
-
limit?: string;
|
|
6
|
-
skip?: string;
|
|
7
|
-
all?: boolean;
|
|
8
|
-
} & Print_opts) => Promise<void>;
|
|
9
|
-
declare const handle_get: (api_key: string, id: string, print_opts: Print_opts) => Promise<void>;
|
|
10
|
-
declare const handle_create: (api_key: string, opts: {
|
|
11
|
-
name: string;
|
|
12
|
-
shared?: boolean;
|
|
13
|
-
} & Print_opts) => Promise<void>;
|
|
14
|
-
declare const handle_add_contacts: (api_key: string, list_id: string, opts: {
|
|
15
|
-
contacts: string;
|
|
16
|
-
dryRun?: boolean;
|
|
17
|
-
yes?: boolean;
|
|
18
|
-
} & Print_opts) => Promise<void>;
|
|
19
|
-
declare const lists_command: Command;
|
|
20
|
-
export { lists_command, handle_list, handle_get, handle_create, handle_add_contacts };
|
package/dist/commands/lists.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handle_add_contacts = exports.handle_create = exports.handle_get = exports.handle_list = exports.lists_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 resolve_1 = require("../utils/resolve");
|
|
10
|
-
const output_1 = require("../utils/output");
|
|
11
|
-
const lists_table = (lists) => {
|
|
12
|
-
(0, output_1.print_table)(lists.map(l => ({
|
|
13
|
-
ID: String(l.id),
|
|
14
|
-
Name: l.name,
|
|
15
|
-
Shared: l.isShared ? 'yes' : '',
|
|
16
|
-
})), ['ID', 'Name', 'Shared']);
|
|
17
|
-
};
|
|
18
|
-
const handle_list = async (api_key, opts) => {
|
|
19
|
-
const base = `/contact-lists${opts.search ? `?search=${encodeURIComponent(opts.search)}` : ''}`;
|
|
20
|
-
if (opts.all) {
|
|
21
|
-
const result = await (0, pagination_1.fetch_all)(api_key, base);
|
|
22
|
-
if (opts.json || opts.pretty) {
|
|
23
|
-
(0, output_1.print)(result, opts);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
lists_table(result.items);
|
|
27
|
-
(0, output_1.info)(`\nTotal: ${result.count} lists`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const top = parseInt(opts.limit || '25', 10);
|
|
31
|
-
const skip = parseInt(opts.skip || '0', 10);
|
|
32
|
-
const sep = base.includes('?') ? '&' : '?';
|
|
33
|
-
const result = await (0, client_1.get)(api_key, `${base}${sep}top=${top}&skip=${skip}`);
|
|
34
|
-
if (!result?.items?.length) {
|
|
35
|
-
(0, output_1.info)('No contact lists found.');
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (opts.json || opts.pretty) {
|
|
39
|
-
(0, output_1.print)(result, opts);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
lists_table(result.items);
|
|
43
|
-
(0, output_1.info)(`\nShowing ${result.items.length} lists.`
|
|
44
|
-
+ (result.hasMore ? ' More available — use --skip or --all.' : ''));
|
|
45
|
-
};
|
|
46
|
-
exports.handle_list = handle_list;
|
|
47
|
-
const handle_get = async (api_key, id, print_opts) => {
|
|
48
|
-
const result = await (0, client_1.get)(api_key, `/contact-lists/${id}`);
|
|
49
|
-
if (!result) {
|
|
50
|
-
(0, output_1.info)('List not found.');
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
(0, output_1.print)(result, { ...print_opts, pretty: print_opts.pretty ?? true });
|
|
54
|
-
};
|
|
55
|
-
exports.handle_get = handle_get;
|
|
56
|
-
const handle_create = async (api_key, opts) => {
|
|
57
|
-
const body = { name: opts.name };
|
|
58
|
-
if (opts.shared)
|
|
59
|
-
body.isShared = true;
|
|
60
|
-
const result = await (0, client_1.post)(api_key, '/contact-lists', body);
|
|
61
|
-
(0, output_1.success)(`List created: "${result.name}" (ID: ${result.id})`);
|
|
62
|
-
if (opts.json || opts.pretty)
|
|
63
|
-
(0, output_1.print)(result, opts);
|
|
64
|
-
};
|
|
65
|
-
exports.handle_create = handle_create;
|
|
66
|
-
const handle_add_contacts = async (api_key, list_id, opts) => {
|
|
67
|
-
const contact_ids = await (0, resolve_1.resolve_contact_ids)(api_key, opts.contacts);
|
|
68
|
-
if (opts.dryRun) {
|
|
69
|
-
(0, output_1.print_dry_run)({
|
|
70
|
-
dryRun: true,
|
|
71
|
-
action: 'lists.add-contacts',
|
|
72
|
-
method: 'POST',
|
|
73
|
-
path: `/v3/contact-lists/${list_id}/add-contacts`,
|
|
74
|
-
payload: { contactIds: contact_ids },
|
|
75
|
-
affected: contact_ids.length,
|
|
76
|
-
}, opts);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
await (0, command_1.confirm_or_abort)(`Add ${contact_ids.length} contact(s) to list ${list_id}?`, opts);
|
|
80
|
-
const failures = await (0, client_1.post)(api_key, `/contact-lists/${list_id}/add-contacts`, { contactIds: contact_ids }) ?? {};
|
|
81
|
-
const failed = Object.keys(failures).length;
|
|
82
|
-
const added = contact_ids.length - failed;
|
|
83
|
-
(0, output_1.success)(`Added ${added} of ${contact_ids.length} contact(s) to list ${list_id}.`);
|
|
84
|
-
for (const [contact_id, err] of Object.entries(failures))
|
|
85
|
-
(0, output_1.warn)(` Contact ${contact_id}: ${err.error}${err.errorDetails ? ` — ${err.errorDetails}` : ''}`);
|
|
86
|
-
if (opts.json || opts.pretty)
|
|
87
|
-
(0, output_1.print)({ action: 'lists.add-contacts', added, failed, failures }, opts);
|
|
88
|
-
if (added === 0 && failed > 0)
|
|
89
|
-
process.exit(1);
|
|
90
|
-
};
|
|
91
|
-
exports.handle_add_contacts = handle_add_contacts;
|
|
92
|
-
const lists_command = new commander_1.Command('lists')
|
|
93
|
-
.description('Manage contact lists');
|
|
94
|
-
exports.lists_command = lists_command;
|
|
95
|
-
(0, command_1.with_pagination_opts)(lists_command
|
|
96
|
-
.command('list')
|
|
97
|
-
.description('List contact lists')
|
|
98
|
-
.option('--search <name>', 'Filter by name'))
|
|
99
|
-
.addHelpText('after', '\nExamples:\n reply lists list\n reply lists list --search "SaaS" --json')
|
|
100
|
-
.action(async function () {
|
|
101
|
-
const opts = this.optsWithGlobals();
|
|
102
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
103
|
-
await handle_list(key, opts);
|
|
104
|
-
});
|
|
105
|
-
lists_command
|
|
106
|
-
.command('get')
|
|
107
|
-
.description('Get a contact list by ID')
|
|
108
|
-
.argument('<id>', 'List ID')
|
|
109
|
-
.addHelpText('after', '\nExamples:\n reply lists get 42')
|
|
110
|
-
.action(async function (id) {
|
|
111
|
-
const opts = this.optsWithGlobals();
|
|
112
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
113
|
-
await handle_get(key, id, { json: opts.json, pretty: opts.pretty });
|
|
114
|
-
});
|
|
115
|
-
lists_command
|
|
116
|
-
.command('create')
|
|
117
|
-
.description('Create a contact list')
|
|
118
|
-
.requiredOption('--name <name>', 'List name')
|
|
119
|
-
.option('--shared', 'Share the list with the team')
|
|
120
|
-
.addHelpText('after', '\nExamples:\n reply lists create --name "SaaS Founders"')
|
|
121
|
-
.action(async function () {
|
|
122
|
-
const opts = this.optsWithGlobals();
|
|
123
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
124
|
-
await handle_create(key, opts);
|
|
125
|
-
});
|
|
126
|
-
(0, command_1.with_confirm_opts)(lists_command
|
|
127
|
-
.command('add-contacts')
|
|
128
|
-
.description('Add contacts to a list')
|
|
129
|
-
.argument('<id>', 'List ID')
|
|
130
|
-
.requiredOption('--contacts <ids-or-emails>', 'Comma-separated contact IDs or emails'), { dry_run: true })
|
|
131
|
-
.addHelpText('after', '\nExamples:\n reply lists add-contacts 42 --contacts john@co.com,222 --yes')
|
|
132
|
-
.action(async function (id) {
|
|
133
|
-
const opts = this.optsWithGlobals();
|
|
134
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
135
|
-
await handle_add_contacts(key, id, opts);
|
|
136
|
-
});
|
|
137
|
-
//# sourceMappingURL=lists.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/commands/lists.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,4CAA0C;AAC1C,wCAA8C;AAC9C,8CAA2F;AAC3F,oDAA8C;AAC9C,8CAAqD;AACrD,4CAAuF;AAiBvF,MAAM,WAAW,GAAG,CAAC,KAAqB,EAAC,EAAE;IACzC,IAAA,oBAAW,EACP,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC;QACV,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAChB,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;KAClC,CAAC,CAAC,EACH,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAC3B,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,KAAK,EACrB,OAAe,EACf,IAAkF,EACrF,EAAE;IACC,MAAM,IAAI,GAAG,iBAAiB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChG,IAAI,IAAI,CAAC,GAAG,EACZ,CAAC;QACG,MAAM,MAAM,G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,EAAE,WAAW,CAAC;KAC5C,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC;KAClD,WAAW,CAAC,OAAO,EAAE,0DAA0D,CAAC;KAChF,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,aAAa,CAAC,GAAG,EAAE,IAAqD,CAAC,CAAC;AACpF,CAAC,CAAC,CAAC;AAEP,IAAA,2BAAiB,EACb,aAAa;KACR,OAAO,CAAC,cAAc,CAAC;KACvB,WAAW,CAAC,wBAAwB,CAAC;KACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;KAC3B,cAAc,CAAC,4BAA4B,EAAE,uCAAuC,CAAC,EAC1F,EAAC,OAAO,EAAE,IAAI,EAAC,CAClB;KACI,WAAW,CAAC,OAAO,EAAE,6EAA6E,CAAC;KACnG,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,mBAAmB,CAAC,GAAG,EAAE,EAAE,EAAE,IAAuC,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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 };
|
package/dist/commands/reports.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;IAChE,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,KAAK,EACvB,OAAe,EACf,IAAqF,EACxF,EAAE;IACC,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,IAAA,aAAI,EAAkB,OAAO,EAAE,4B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AAC,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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import type { Print_opts } from '../utils/output';
|
|
3
|
-
declare const handle_list: (api_key: string, print_opts: Print_opts) => Promise<void>;
|
|
4
|
-
declare const handle_get: (api_key: string, id: string, print_opts: Print_opts) => Promise<void>;
|
|
5
|
-
declare const schedules_command: Command;
|
|
6
|
-
export { schedules_command, handle_list, handle_get };
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handle_get = exports.handle_list = exports.schedules_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 handle_list = async (api_key, print_opts) => {
|
|
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) {
|
|
12
|
-
(0, output_1.info)('No schedules found.');
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (print_opts.json || print_opts.pretty) {
|
|
16
|
-
(0, output_1.print)(schedules, print_opts);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
(0, output_1.print_table)(schedules.map(s => ({
|
|
20
|
-
ID: String(s.id),
|
|
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']);
|
|
26
|
-
};
|
|
27
|
-
exports.handle_list = handle_list;
|
|
28
|
-
const handle_get = async (api_key, id, print_opts) => {
|
|
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
|
-
}
|
|
34
|
-
(0, output_1.print)(schedule, { ...print_opts, pretty: print_opts.pretty ?? true });
|
|
35
|
-
};
|
|
36
|
-
exports.handle_get = handle_get;
|
|
37
|
-
const schedules_command = new commander_1.Command('schedules')
|
|
38
|
-
.description('View sending schedules');
|
|
39
|
-
exports.schedules_command = schedules_command;
|
|
40
|
-
schedules_command
|
|
41
|
-
.command('list')
|
|
42
|
-
.description('List sending schedules')
|
|
43
|
-
.addHelpText('after', '\nExamples:\n reply schedules list\n reply schedules list --json')
|
|
44
|
-
.action(async function () {
|
|
45
|
-
const opts = this.optsWithGlobals();
|
|
46
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
47
|
-
await handle_list(key, { json: opts.json, pretty: opts.pretty });
|
|
48
|
-
});
|
|
49
|
-
schedules_command
|
|
50
|
-
.command('get')
|
|
51
|
-
.description('Get a schedule with its timings')
|
|
52
|
-
.argument('<id>', 'Schedule ID')
|
|
53
|
-
.addHelpText('after', '\nExamples:\n reply schedules get 42 --json')
|
|
54
|
-
.action(async function (id) {
|
|
55
|
-
const opts = this.optsWithGlobals();
|
|
56
|
-
const key = (0, auth_1.resolve_api_key)(opts.apiKey);
|
|
57
|
-
await handle_get(key, id, { json: opts.json, pretty: opts.pretty });
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=schedules.js.map
|
|
@@ -1 +0,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EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
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>;
|
|
18
|
-
declare const sequence_contacts_command: Command;
|
|
19
|
-
export { sequence_contacts_command, handle_list, handle_add, handle_remove };
|