reply-cli 0.14.0 → 0.15.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 +40 -8
- package/dist/operations/commands.js +61 -23
- package/dist/operations/commands.js.map +1 -1
- package/dist/operations/contact-input.d.ts +3 -2
- package/dist/operations/contact-input.js +12 -8
- package/dist/operations/contact-input.js.map +1 -1
- package/dist/operations/contact-record.d.ts +5 -2
- package/dist/operations/contact-record.js +31 -8
- package/dist/operations/contact-record.js.map +1 -1
- package/dist/operations/contact.js +4 -14
- package/dist/operations/contact.js.map +1 -1
- package/dist/operations/contacts.d.ts +5 -3
- package/dist/operations/contacts.js +19 -8
- package/dist/operations/contacts.js.map +1 -1
- package/dist/operations/direct-send.d.ts +2 -2
- package/dist/operations/direct-send.js +75 -14
- package/dist/operations/direct-send.js.map +1 -1
- package/dist/operations/stdin-input.d.ts +5 -1
- package/dist/operations/stdin-input.js +37 -1
- package/dist/operations/stdin-input.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,11 +195,11 @@ prints JSON (indented; compact with `--json`) and says what happened in a stable
|
|
|
195
195
|
| `reply contact-list add-contact <list-id> <contact> [--refuse-opted-out]` | → `added` |
|
|
196
196
|
| `reply contact find --contact -` | the id of the contact under an email or a LinkedIn URL, or null; never creates one |
|
|
197
197
|
| `reply contact get <id>` | the contact as Reply holds it |
|
|
198
|
-
| `reply contact update <id> --fields -` | change some fields and custom fields; null clears one → `updated` |
|
|
198
|
+
| `reply contact update (<id> \| <contact>) --fields -` | change some fields and custom fields; null clears one → `updated` |
|
|
199
199
|
| `reply contact delete <id>` | → `deleted` |
|
|
200
200
|
| `reply contact opt-out <contact>` | → `opted_out` |
|
|
201
|
-
| `reply contact send-email
|
|
202
|
-
| `reply contact linkedin-connect
|
|
201
|
+
| `reply contact send-email <contact> --email-account-id N --message -` | one email now, outside any sequence → `sent` |
|
|
202
|
+
| `reply contact linkedin-connect <contact> --linkedin-account-id N [--message -]` | a LinkedIn invitation, with or without a note → `sent` / `already_connected` |
|
|
203
203
|
| `reply contact linkedin-message …` · `linkedin-inmail …` · `linkedin-voice …` | a LinkedIn message, an InMail, or an AI voice message spoken from a script → `sent` |
|
|
204
204
|
| `reply inbox list (--contact-id \| --sequence-id) [--source] [--channel] [--category-id] [--since]` | one page of threads |
|
|
205
205
|
| `reply inbox get <thread-id>` | a thread with its subject, and one page of its messages |
|
|
@@ -221,9 +221,27 @@ echo '{"linkedin_url":"https://www.linkedin.com/in/ann-example","first_name":"An
|
|
|
221
221
|
|
|
222
222
|
The two `add-contact` commands always import a contact given by email, and Reply refuses an import
|
|
223
223
|
without a first name, even for a contact it already holds; a contact given only by LinkedIn URL is
|
|
224
|
-
looked up first and imported only when Reply holds nobody under it. `contact opt-out`
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
looked up first and imported only when Reply holds nobody under it. `contact opt-out`, `contact
|
|
225
|
+
update` and the direct sends look first and import only someone Reply doesn't hold yet, so only then
|
|
226
|
+
is a first name needed, and a direct send sends only to a contact it created (below); `sequence
|
|
227
|
+
remove-contact` never imports. Each of these except `sequence remove-contact` answers the
|
|
228
|
+
`contact_id` it acted on and `contact_created`, so a caller can keep the id. A send looks the person
|
|
229
|
+
up by every address it was given, the one it reaches them at first (the email for `contact send-email`,
|
|
230
|
+
the LinkedIn URL for the LinkedIn sends), then the other when there is one. Otherwise a contact is
|
|
231
|
+
looked up by its email, and one with only a LinkedIn URL by that; an import is matched by the email
|
|
232
|
+
when there is one.
|
|
233
|
+
|
|
234
|
+
A direct send given a person's fields sends only to a contact it creates. When a lookup by any address
|
|
235
|
+
it was given finds a contact, or its import matches one Reply already holds (by the email, say, or a teammate's), nothing
|
|
236
|
+
is sent: the answer is `contact.already_held` (exit 1) with that contact's id in `ids.contact_id`.
|
|
237
|
+
Read that contact first with `reply contact get`, its opt-out included, and send to it with
|
|
238
|
+
`--contact-id` if it is the one to reach. Reply does not refuse a direct send to a contact it holds
|
|
239
|
+
as opted out, so a send never reaches a contact Reply already held without that read. A LinkedIn
|
|
240
|
+
send needs a `linkedin_url` in `--contact` (or `--contact-id`): `--email` alone is refused. On a send,
|
|
241
|
+
`contact_created` is kept for consistency with the add commands: given a person's fields it is always `true`,
|
|
242
|
+
and with `--contact-id` it is always `false`; in both cases a successful answer says the send was made.
|
|
243
|
+
|
|
244
|
+
The lookup is Reply's exact
|
|
227
245
|
one: an email matches ignoring case, and a LinkedIn URL is matched by its lowercased slug — on
|
|
228
246
|
linkedin.com the path's case does not count, nor the scheme's or host's, a default port, one trailing
|
|
229
247
|
slash or a fragment, while `www` and the query do. Reply is asked for a LinkedIn URL in that form
|
|
@@ -242,7 +260,18 @@ echo '{"name":"Q4 outreach"}' | reply sequence list --name -
|
|
|
242
260
|
```
|
|
243
261
|
|
|
244
262
|
`contact update` refuses a custom field the account has none of, `contact.field_not_found`, before
|
|
245
|
-
it changes anything.
|
|
263
|
+
it changes or imports anything. Given the contact by its flags rather than its id, it changes only
|
|
264
|
+
what `--fields` names: the contact's own fields find the contact, or import it, and never change one
|
|
265
|
+
Reply already holds.
|
|
266
|
+
|
|
267
|
+
When `--contact -` and the command's own input (`--message -` or `--fields -`) both read stdin, it
|
|
268
|
+
holds one object with each under its flag's name, so neither the person nor the text ever sits in
|
|
269
|
+
the argument list:
|
|
270
|
+
|
|
271
|
+
```sh
|
|
272
|
+
echo '{"contact":{"email":"ann@example.com","first_name":"Ann"},"fields":{"title":"CTO"}}' | reply contact update --contact - --fields -
|
|
273
|
+
echo '{"contact":{"linkedin_url":"https://www.linkedin.com/in/ann-example","first_name":"Ann"},"message":{"body":"Thanks for connecting, Ann."}}' | reply contact linkedin-message --contact - --linkedin-account-id 34 --message -
|
|
274
|
+
```
|
|
246
275
|
|
|
247
276
|
`inbox reply` takes its message, `{body, reply_to_message_id}`, from stdin only, and refuses it on
|
|
248
277
|
the argument list. The reply goes to the thread's contact from the account that owns the thread;
|
|
@@ -276,7 +305,10 @@ variables, and refuses one it cannot fill with `linkedin.missing_variables`.
|
|
|
276
305
|
|
|
277
306
|
`inbox reply`, `sequence create` and the five direct sends are the work commands that are not safe to
|
|
278
307
|
re-run. On exit 3 (outcome unknown) a reply or a send may already have gone, and running it again may
|
|
279
|
-
send it twice
|
|
308
|
+
send it twice, unless the hint says nothing was sent: a send whose contact's import lost its answer
|
|
309
|
+
was never made, and its hint says so; run again, it answers `contact.already_held` if that import did
|
|
310
|
+
create the contact.
|
|
311
|
+
For `inbox reply`, read the thread with `reply inbox get` before trying again. For
|
|
280
312
|
`sequence create`, Reply allows two sequences of one name, so after exit 3 look the name up with
|
|
281
313
|
`sequence list --name -` first. Every other work command can simply be run again; a `contact delete`
|
|
282
314
|
repeated after its first one took effect answers `contact.not_found`.
|
|
@@ -32,6 +32,10 @@ const ex = (command) => `${P} ${command}`;
|
|
|
32
32
|
const piped = (command, contact = '{"email":"ann@example.com","first_name":"Ann"}') => `echo '${contact}' | ${P} ${command} --contact -`;
|
|
33
33
|
const ALWAYS_IMPORTED = 'A contact given by email is always imported, so Reply needs a first name, even for one it already holds.\n'
|
|
34
34
|
+ 'One given only by LinkedIn URL is looked up first and imported only when Reply holds nobody under it.\n';
|
|
35
|
+
// The codes a command that finds or imports a contact shares with the add commands.
|
|
36
|
+
const IMPORT_CODES = ['contact.not_unique', 'contact.invalid_email', 'contact.invalid_linkedin_url', 'account.contact_limit_reached'];
|
|
37
|
+
// Both inputs on stdin, the person and the one the command acts with.
|
|
38
|
+
const STDIN_PAIR = (input) => `With --contact - and --${input} - both, stdin holds one object: {"contact": {…}, "${input}": {…}}.\n`;
|
|
35
39
|
const run = (fn) => async function () {
|
|
36
40
|
await fn(this);
|
|
37
41
|
};
|
|
@@ -169,16 +173,24 @@ contact_command.command('get')
|
|
|
169
173
|
const { g, ctx } = ctx_of(cmd);
|
|
170
174
|
await (0, contact_record_1.handle_contact_get)(cmd.args[0], ctx, g);
|
|
171
175
|
}));
|
|
172
|
-
contact_command.command('update')
|
|
173
|
-
.argument('
|
|
176
|
+
(0, contact_input_1.add_contact_options)(contact_command.command('update')
|
|
177
|
+
.argument('[contact-id]', 'Contact id (or give the contact by the flags below)'), true)
|
|
174
178
|
.option('--fields <stdin>', 'Only -: the fields to change as JSON on stdin')
|
|
175
179
|
.description('Change some of a contact\'s fields and custom fields; the rest stay as they are')
|
|
176
180
|
.addHelpText('after', help([`echo '{"title":"CTO","company":"Acme"}' | ${P} contact update 456 --fields -`,
|
|
177
|
-
`echo '{"last_name":null,"custom_fields":[{"name":"leadSource","value":"Event"}]}' | ${P} contact update 456 --fields
|
|
181
|
+
`echo '{"last_name":null,"custom_fields":[{"name":"leadSource","value":"Event"}]}' | ${P} contact update 456 --fields -`,
|
|
182
|
+
`echo '{"contact":{"email":"ann@example.com","first_name":"Ann"},"fields":{"title":"CTO"}}' | ${P} contact update --contact - --fields -`], ['contact.not_found', ...IMPORT_CODES, 'contact.field_not_found'], true, 'Result: {"status":"updated","contact_id","contact_created"}\n'
|
|
178
183
|
+ 'Fields: {first_name, last_name, company, title, linkedin_url, custom_fields: [{name, value}]}; a field left out stays as\n'
|
|
179
184
|
+ 'it is, and null clears one. They are read from stdin only, so no value ever sits in the argument list. The CLI stores\n'
|
|
180
185
|
+ 'a LinkedIn URL by its lowercased slug, the form contacts are looked up by. A custom field is named as the account\n'
|
|
181
|
-
+ 'names it (ignoring case); a name the account has none of is contact.field_not_found, and then nothing is changed.\n'
|
|
186
|
+
+ 'names it (ignoring case); a name the account has none of is contact.field_not_found, and then nothing is changed.\n'
|
|
187
|
+
+ contact_input_1.CONTACT_FORMS
|
|
188
|
+
+ 'contact update 456 is contact update --contact-id 456. A contact given by its fields is looked up as the add commands\n'
|
|
189
|
+
+ 'look one up, by its email, or one with only a LinkedIn URL by that, and imported only when Reply holds nobody under\n'
|
|
190
|
+
+ 'it, as they import one; only then does Reply need a first name. A LinkedIn URL is matched by its lowercased slug,\n'
|
|
191
|
+
+ 'and the CLI stores it by that slug when it imports the contact. Those fields only find or import the contact: on\n'
|
|
192
|
+
+ 'one Reply holds, only what --fields names is changed. contact_created says whether this command created it.\n'
|
|
193
|
+
+ STDIN_PAIR('fields')))
|
|
182
194
|
.action(run(async (cmd) => {
|
|
183
195
|
const { g, ctx } = ctx_of(cmd);
|
|
184
196
|
await (0, contact_record_1.handle_contact_update)(cmd.args[0], cmd.opts(), ctx, g);
|
|
@@ -192,7 +204,7 @@ contact_command.command('delete')
|
|
|
192
204
|
const { g, ctx } = ctx_of(cmd);
|
|
193
205
|
await (0, contact_record_1.handle_contact_delete)(cmd.args[0], ctx, g);
|
|
194
206
|
}));
|
|
195
|
-
(0, contact_input_1.add_contact_options)(contact_command.command('opt-out'))
|
|
207
|
+
(0, contact_input_1.add_contact_options)(contact_command.command('opt-out'), true)
|
|
196
208
|
.description('Mark the contact as opted out at Reply, creating them only if Reply has nobody under the address')
|
|
197
209
|
.addHelpText('after', help([piped('contact opt-out'), ex('contact opt-out --contact-id 456')], ['contact.not_found', 'contact.not_unique', 'contact.invalid_email', 'contact.invalid_linkedin_url', 'account.contact_limit_reached'], true, 'Result: {"status":"opted_out","contact_id","contact_created"}\n' + contact_input_1.CONTACT_HELP
|
|
198
210
|
+ 'A contact given by email or LinkedIn URL is imported only when Reply holds nobody under the address; only then does\n'
|
|
@@ -201,57 +213,83 @@ contact_command.command('delete')
|
|
|
201
213
|
const { g, ctx } = ctx_of(cmd);
|
|
202
214
|
await (0, contact_1.handle_contact_opt_out)(cmd.opts(), ctx, g);
|
|
203
215
|
}));
|
|
204
|
-
const SEND_TWICE = (what) => `the ${what} may have been sent; running the command again may send it twice`;
|
|
205
|
-
|
|
206
|
-
|
|
216
|
+
const SEND_TWICE = (what) => `the ${what} may have been sent; running the command again may send it twice, unless the hint says nothing was sent`;
|
|
217
|
+
const LINKEDIN_URL_NEEDED = 'A LinkedIn send needs the contact\'s linkedin_url in --contact (or --contact-id); --email alone is refused '
|
|
218
|
+
+ '(usage.contact).\n';
|
|
219
|
+
// How a send names its contact: looked up by every address it was given, else imported as an add imports one; and
|
|
220
|
+
// it sends only to a contact it created, naming one Reply already holds instead.
|
|
221
|
+
const SENT_TO = (by, what) => contact_input_1.CONTACT_FORMS
|
|
222
|
+
+ 'A send given a person\'s fields sends only to a contact it creates. The contact is looked up by\n'
|
|
223
|
+
+ `${by === 'email' ? 'its email' : 'its LinkedIn URL'}, where the ${what} goes, then by its ${by === 'email' ? 'LinkedIn URL' : 'email'} when it was given one, and imported only when\n`
|
|
224
|
+
+ 'Reply holds nobody under any address given, as the add commands import one (matched by its email when it has\n'
|
|
225
|
+
+ 'one), so Reply needs a first name. When a lookup finds a contact,\n'
|
|
226
|
+
+ 'or the import matches one Reply already holds, nothing is sent: the answer is contact.already_held (exit 1)\n'
|
|
227
|
+
+ 'with that contact\'s id in ids.contact_id. Read that contact first (contact get shows it, its opt-out included),\n'
|
|
228
|
+
+ 'and send to it with --contact-id if it is the one to reach. A LinkedIn URL is matched by its lowercased slug, and\n'
|
|
229
|
+
+ `the CLI stores it by that slug when it imports the contact. contact_id is the contact the ${what} went to, and\n`
|
|
230
|
+
+ 'contact_created is kept for consistency with the add commands: given a person\'s fields it is always true, and with\n'
|
|
231
|
+
+ '--contact-id it is always false; in both cases a successful answer says the send was made.\n'
|
|
232
|
+
+ (by === 'email' ? '' : LINKEDIN_URL_NEEDED) + STDIN_PAIR('message');
|
|
233
|
+
// One send's example with the person and the text both on stdin.
|
|
234
|
+
const piped_send = (command, contact, message, flags) => `echo '{"contact":${contact},"message":${message}}' | ${P} contact ${command} --contact - ${flags} --message -`;
|
|
235
|
+
const ANN_EMAIL = '{"email":"ann@example.com","first_name":"Ann"}';
|
|
236
|
+
const ANN_PROFILE = '{"linkedin_url":"https://www.linkedin.com/in/ann-example","first_name":"Ann"}';
|
|
237
|
+
(0, contact_input_1.add_contact_options)(contact_command.command('send-email'), true)
|
|
207
238
|
.option('--email-account-id <id>', 'The mailbox to send from (see `account list`)')
|
|
208
239
|
.option('--message <stdin>', 'Only -: the email {subject, body} as JSON on stdin')
|
|
209
240
|
.description('Send one email to a contact now, outside any sequence, from the mailbox you name')
|
|
210
|
-
.addHelpText('after', help([`echo '{"subject":"Quick question","body":"<p>Hi Ann, does Tuesday work?</p>"}' | ${P} contact send-email --contact-id 456 --email-account-id 12 --message
|
|
211
|
-
|
|
212
|
-
+ '
|
|
241
|
+
.addHelpText('after', help([`echo '{"subject":"Quick question","body":"<p>Hi Ann, does Tuesday work?</p>"}' | ${P} contact send-email --contact-id 456 --email-account-id 12 --message -`,
|
|
242
|
+
piped_send('send-email', ANN_EMAIL, '{"subject":"Quick question","body":"<p>Hi Ann</p>"}', '--email-account-id 12')], ['contact.not_found', ...IMPORT_CODES, 'contact.already_held', 'email_account.not_found', 'contact.blacklisted'], true, 'Result: {"status":"sent","contact_id","contact_created","message_id","sent_at","reply_status"}: sent means Reply\n'
|
|
243
|
+
+ 'accepted the email, and reply_status is Reply\'s own word for it (new or sent). message_id is Reply\'s messageId,\n'
|
|
244
|
+
+ 'null when it gives none. Reply\'s answer carries no time, so sent_at is always null; the CLI adds none of its own.\n'
|
|
213
245
|
+ 'The email is read from stdin only, so its text never sits in the argument list. The body is HTML. Reply sends a\n'
|
|
214
|
-
+ 'direct email at once, outside the mailbox\'s daily limit and sending delay.\n'
|
|
246
|
+
+ 'direct email at once, outside the mailbox\'s daily limit and sending delay.\n'
|
|
247
|
+
+ SENT_TO('email', 'email'), SEND_TWICE('email')))
|
|
215
248
|
.action(run(async (cmd) => {
|
|
216
249
|
const { g, ctx } = ctx_of(cmd);
|
|
217
250
|
await (0, direct_send_1.handle_direct_send)('send-email', cmd.opts(), ctx, g);
|
|
218
251
|
}));
|
|
219
252
|
// The four LinkedIn sends share their flags, their first codes and the shape of their result.
|
|
220
253
|
const LINKEDIN_SEND_CODES = [
|
|
221
|
-
'contact.not_found', 'contact.
|
|
222
|
-
'linkedin.account_inactive', 'linkedin.invalid_cookie',
|
|
254
|
+
'contact.not_found', ...IMPORT_CODES, 'contact.already_held', 'contact.no_linkedin_profile', 'linkedin.account_not_found',
|
|
255
|
+
'linkedin.feature_disabled', 'linkedin.account_inactive', 'linkedin.invalid_cookie',
|
|
223
256
|
];
|
|
224
|
-
const LINKEDIN_SENT = '"contact_id","activity_id","sent_at"}:\n'
|
|
257
|
+
const LINKEDIN_SENT = '"contact_id","contact_created","activity_id","sent_at"}:\n'
|
|
225
258
|
+ 'activity_id and sent_at are Reply\'s linkedInActivityId and sentAtUtc as Reply gives them, each null when it gives\n'
|
|
226
259
|
+ 'none; the CLI adds no time of its own.\n';
|
|
227
260
|
const VARIABLES = (where) => `Reply reads {{…}} in the ${where} as its template variables; one it cannot fill is linkedin.missing_variables.\n`;
|
|
228
261
|
const LINKEDIN_EXAMPLE = '--contact-id 456 --linkedin-account-id 34';
|
|
229
262
|
const linkedin_send = (name, description, message, examples, codes, extra, what) => {
|
|
230
|
-
contact_command.command(name)
|
|
231
|
-
.option('--contact-id <id>', 'The contact by its Reply id')
|
|
263
|
+
(0, contact_input_1.add_contact_options)(contact_command.command(name), true)
|
|
232
264
|
.option('--linkedin-account-id <id>', 'The LinkedIn account to send from (see `account list`)')
|
|
233
265
|
.option('--message <stdin>', `Only -: the ${message} as JSON on stdin`)
|
|
234
266
|
.description(description)
|
|
235
|
-
.addHelpText('after', help(examples, [...LINKEDIN_SEND_CODES, ...codes], true, extra, SEND_TWICE(what)))
|
|
267
|
+
.addHelpText('after', help(examples, [...LINKEDIN_SEND_CODES, ...codes], true, extra + SENT_TO('linkedin', what), SEND_TWICE(what)))
|
|
236
268
|
.action(run(async (cmd) => {
|
|
237
269
|
const { g, ctx } = ctx_of(cmd);
|
|
238
270
|
await (0, direct_send_1.handle_direct_send)(name, cmd.opts(), ctx, g);
|
|
239
271
|
}));
|
|
240
272
|
};
|
|
241
273
|
linkedin_send('linkedin-connect', 'Invite a contact to connect on LinkedIn, with or without a note', 'note {note}', [`echo '{"note":"Hi Ann, we met at the meetup."}' | ${P} contact linkedin-connect ${LINKEDIN_EXAMPLE} --message -`,
|
|
242
|
-
ex(`contact linkedin-connect ${LINKEDIN_EXAMPLE}`)
|
|
274
|
+
ex(`contact linkedin-connect ${LINKEDIN_EXAMPLE}`),
|
|
275
|
+
piped_send('linkedin-connect', ANN_PROFILE, '{"note":"Hi Ann, we met at the meetup."}', '--linkedin-account-id 34'),
|
|
276
|
+
`echo '${ANN_PROFILE}' | ${P} contact linkedin-connect --contact - --linkedin-account-id 34`], ['linkedin.not_connected', 'linkedin.limit_reached', 'linkedin.message_too_long', 'linkedin.missing_variables'], 'Result: {"status":"sent"|"already_connected",' + LINKEDIN_SENT
|
|
243
277
|
+ 'already_connected means the contact is already a connection: nothing is sent, and activity_id and sent_at are null.\n'
|
|
244
278
|
+ 'The note is read from stdin only, so its text never sits in the argument list; without --message the invitation\n'
|
|
245
|
-
+ 'carries no note. Reply publishes no limit for a note, and one it finds too long
|
|
279
|
+
+ 'carries no note, and stdin holds the contact alone. Reply publishes no limit for a note, and one it finds too long\n'
|
|
280
|
+
+ 'is linkedin.message_too_long.\n'
|
|
246
281
|
+ VARIABLES('note'), 'invitation');
|
|
247
|
-
linkedin_send('linkedin-message', 'Send a LinkedIn message to a contact the account is connected with', 'message {body}', [`echo '{"body":"Thanks for connecting, Ann."}' | ${P} contact linkedin-message ${LINKEDIN_EXAMPLE} --message
|
|
282
|
+
linkedin_send('linkedin-message', 'Send a LinkedIn message to a contact the account is connected with', 'message {body}', [`echo '{"body":"Thanks for connecting, Ann."}' | ${P} contact linkedin-message ${LINKEDIN_EXAMPLE} --message -`,
|
|
283
|
+
piped_send('linkedin-message', ANN_PROFILE, '{"body":"Thanks for connecting, Ann."}', '--linkedin-account-id 34')], ['linkedin.not_connected', 'linkedin.limit_reached', 'linkedin.message_too_long', 'linkedin.missing_variables'], 'Result: {"status":"sent",' + LINKEDIN_SENT
|
|
248
284
|
+ 'The message is read from stdin only, so its text never sits in the argument list. Reply takes a body of at most\n'
|
|
249
285
|
+ '8000 characters.\n' + VARIABLES('body'), 'message');
|
|
250
|
-
linkedin_send('linkedin-inmail', 'Send a LinkedIn InMail, which reaches a contact the account is not connected with (needs Sales Navigator and InMail credits)', 'InMail {subject, body}', [`echo '{"subject":"Quick question","body":"Hi Ann, does Tuesday work?"}' | ${P} contact linkedin-inmail ${LINKEDIN_EXAMPLE} --message
|
|
286
|
+
linkedin_send('linkedin-inmail', 'Send a LinkedIn InMail, which reaches a contact the account is not connected with (needs Sales Navigator and InMail credits)', 'InMail {subject, body}', [`echo '{"subject":"Quick question","body":"Hi Ann, does Tuesday work?"}' | ${P} contact linkedin-inmail ${LINKEDIN_EXAMPLE} --message -`,
|
|
287
|
+
piped_send('linkedin-inmail', ANN_PROFILE, '{"subject":"Quick question","body":"Hi Ann, does Tuesday work?"}', '--linkedin-account-id 34')], ['linkedin.limit_reached', 'linkedin.message_too_long', 'linkedin.missing_variables', 'linkedin.sales_navigator_required',
|
|
251
288
|
'linkedin.sales_navigator_disconnected', 'linkedin.no_inmail_credits'], 'Result: {"status":"sent",' + LINKEDIN_SENT
|
|
252
289
|
+ 'The InMail is read from stdin only, so its text never sits in the argument list. Reply takes a subject of at most\n'
|
|
253
290
|
+ '200 characters and a body of at most 1900.\n' + VARIABLES('text'), 'InMail');
|
|
254
|
-
linkedin_send('linkedin-voice', 'Send a LinkedIn voice message that Reply speaks from a script in the account\'s voice', 'script {script}', [`echo '{"script":"Hi Ann, a quick hello about Tuesday."}' | ${P} contact linkedin-voice ${LINKEDIN_EXAMPLE} --message
|
|
291
|
+
linkedin_send('linkedin-voice', 'Send a LinkedIn voice message that Reply speaks from a script in the account\'s voice', 'script {script}', [`echo '{"script":"Hi Ann, a quick hello about Tuesday."}' | ${P} contact linkedin-voice ${LINKEDIN_EXAMPLE} --message -`,
|
|
292
|
+
piped_send('linkedin-voice', ANN_PROFILE, '{"script":"Hi Ann, a quick hello about Tuesday."}', '--linkedin-account-id 34')], ['linkedin.not_connected', 'linkedin.limit_reached', 'linkedin.missing_variables', 'linkedin.voice_profile_missing',
|
|
255
293
|
'linkedin.voice_too_long'], 'Result: {"status":"sent",' + LINKEDIN_SENT
|
|
256
294
|
+ 'The script is read from stdin only, so its text never sits in the argument list. Reply takes at most 1000 characters\n'
|
|
257
295
|
+ 'and speaks them with the LinkedIn account\'s voice profile; a recorded message cannot be sent here.\n' + VARIABLES('script'), 'voice message');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/operations/commands.ts"],"names":[],"mappings":";;;AAAA,yCAAkC;AAClC,sCAAuC;AACvC,wCAAyC;AACzC,uCAA0C;AAC1C,mDAAkE;AAClE,mDAAqG;AACrG,yDAAgF;AAChF,+DAAkG;AAClG,qDAA8E;AAC9E,mCAEiB;AACjB,+CAAiD;AACjD,iDAA+D;AAC/D,uCAAiD;AACjD,qDAAuH;AACvH,+CAAwE;AACxE,yCAA+C;AAE/C,MAAM,CAAC,GAAG,qBAAY,CAAC;AACvB,MAAM,aAAa,GAAG;IAClB,eAAe,EAAE,4BAA4B,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,uBAAuB;CAC/H,CAAC;AAEF,MAAM,cAAc,GAAG,+CAA+C,CAAC;AAEvE,MAAM,WAAW,GAAG,CAAC,KAAe,EAAE,KAAc,EAAE,eAAuB,EAAS,EAAE,CACpF,6EAA6E;MAC3E,CAAC,GAAG,KAAK,EAAE,GAAG,aAAa,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;MAC/F,8GAA8G;MAC9G,yBAAyB,eAAe,GAAG,CAAC;AAElD,MAAM,IAAI,GAAG,CAAC,QAAkB,EAAE,KAAe,EAAE,KAAc,EAAE,KAAK,GAAG,EAAE,EAAE,eAAe,GAAG,cAAc,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AAe;AAjB/F,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC;KAC1B,MAAM,CAAC,qBAAqB,EAAE,qDAAqD,CAAC;KACpF,WAAW,CAAC,2EAA2E,CAAC;KACxF,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,iCAAiC,CAAC,CAAC,EAAE,CAAC,yBAAyB,CAAC,EAAE,KAAK,EACtH,qHAAqH;MAC/G,uHAAuH;MACvH,yHAAyH;MACzH,wHAAwH;MACxH,oHAAoH;MACpH,0HAA0H;MAC1H,uHAAuH;MACvH,mEAAmE,CAAC,CAAC;KAC9E,MAAM,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;IACpB,MAAM,EAAC,CAAC,EAAE,GAAG,EAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAA,8BAAmB,EAAC,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -23,11 +23,12 @@ type Contact_flags = {
|
|
|
23
23
|
title?: string;
|
|
24
24
|
contact?: string;
|
|
25
25
|
};
|
|
26
|
-
declare const add_contact_options: (cmd: Command) => Command;
|
|
26
|
+
declare const add_contact_options: (cmd: Command, found_first?: boolean) => Command;
|
|
27
|
+
declare const CONTACT_FORMS = "\nA contact is given exactly one way:\n --contact <json>|@file|- {email, linkedin_url, first_name, last_name, company, title},\n with an email, a LinkedIn URL or both; '-' reads stdin, which\n keeps personal data out of the argument list\n --email <address> [--first-name <name>] [--last-name <name>] [--company <name>] [--title <title>]\n --contact-id <id> a contact Reply already holds\n";
|
|
27
28
|
declare const CONTACT_HELP = "\nA contact is given exactly one way:\n --contact <json>|@file|- {email, linkedin_url, first_name, last_name, company, title},\n with an email, a LinkedIn URL or both; '-' reads stdin, which\n keeps personal data out of the argument list\n --email <address> [--first-name <name>] [--last-name <name>] [--company <name>] [--title <title>]\n --contact-id <id> a contact Reply already holds\nReply is asked about a contact by its email; one with only a LinkedIn URL, by that. A LinkedIn URL is\nmatched by its lowercased slug, and the CLI stores it by that slug when it imports the contact.\n\n";
|
|
28
29
|
declare const is_email: (text: string) => boolean;
|
|
29
30
|
declare const linkedin_key: (text: string) => string | null;
|
|
30
31
|
declare const person_of: (raw: Record<string, unknown>) => Person;
|
|
31
32
|
declare const read_contact_input: (f: Contact_flags, read_stdin?: () => string) => Contact_ref;
|
|
32
|
-
export { read_contact_input, add_contact_options, person_of, CONTACT_HELP, linkedin_key, is_email };
|
|
33
|
+
export { read_contact_input, add_contact_options, person_of, CONTACT_FORMS, CONTACT_HELP, linkedin_key, is_email };
|
|
33
34
|
export type { Person, Contact_ref, Contact_flags };
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.is_email = exports.linkedin_key = exports.CONTACT_HELP = exports.person_of = exports.add_contact_options = exports.read_contact_input = void 0;
|
|
3
|
+
exports.is_email = exports.linkedin_key = exports.CONTACT_HELP = exports.CONTACT_FORMS = exports.person_of = exports.add_contact_options = exports.read_contact_input = void 0;
|
|
4
4
|
const errors_1 = require("../utils/errors");
|
|
5
5
|
const json_arg_1 = require("../utils/json-arg");
|
|
6
6
|
const options_1 = require("./options");
|
|
7
7
|
const PERSON_FIELDS = ['email', 'linkedin_url', 'first_name', 'last_name', 'company', 'title'];
|
|
8
8
|
const CODE = 'usage.contact';
|
|
9
9
|
const ONE_WAY_HINT = 'Use exactly one of --contact-id, --email (with its name flags), or --contact (which also takes linkedin_url).';
|
|
10
|
-
|
|
10
|
+
// `found_first`: the command looks the contact up before it imports one, so the names only matter for a contact
|
|
11
|
+
// Reply doesn't hold yet and are otherwise unused.
|
|
12
|
+
const add_contact_options = (cmd, found_first = false) => cmd
|
|
11
13
|
.option('--contact-id <id>', 'The contact by its Reply id')
|
|
12
14
|
.option('--email <address>', 'The contact by email; with --first-name, --last-name, --company, --title')
|
|
13
|
-
.option('--first-name <name>',
|
|
14
|
-
.option('--last-name <name>',
|
|
15
|
-
.option('--company <name>',
|
|
16
|
-
.option('--title <title>',
|
|
15
|
+
.option('--first-name <name>', `First name (with --email; Reply refuses to import a contact without one)`)
|
|
16
|
+
.option('--last-name <name>', `Last name (with --email${found_first ? '; used only if the contact is imported' : ''})`)
|
|
17
|
+
.option('--company <name>', `Company (with --email${found_first ? '; used only if the contact is imported' : ''})`)
|
|
18
|
+
.option('--title <title>', `Job title (with --email${found_first ? '; used only if the contact is imported' : ''})`)
|
|
17
19
|
.option('--contact <json>', 'The contact as JSON {email, linkedin_url, first_name, last_name, company, title}: inline, @file, or - for stdin');
|
|
18
20
|
exports.add_contact_options = add_contact_options;
|
|
19
|
-
const
|
|
21
|
+
const CONTACT_FORMS = `
|
|
20
22
|
A contact is given exactly one way:
|
|
21
23
|
--contact <json>|@file|- {email, linkedin_url, first_name, last_name, company, title},
|
|
22
24
|
with an email, a LinkedIn URL or both; '-' reads stdin, which
|
|
23
25
|
keeps personal data out of the argument list
|
|
24
26
|
--email <address> [--first-name <name>] [--last-name <name>] [--company <name>] [--title <title>]
|
|
25
27
|
--contact-id <id> a contact Reply already holds
|
|
26
|
-
|
|
28
|
+
`;
|
|
29
|
+
exports.CONTACT_FORMS = CONTACT_FORMS;
|
|
30
|
+
const CONTACT_HELP = `${CONTACT_FORMS}Reply is asked about a contact by its email; one with only a LinkedIn URL, by that. A LinkedIn URL is
|
|
27
31
|
matched by its lowercased slug, and the CLI stores it by that slug when it imports the contact.
|
|
28
32
|
|
|
29
33
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-input.js","sourceRoot":"","sources":["../../src/operations/contact-input.ts"],"names":[],"mappings":";;;AACA,4CAA2C;AAC3C,gDAAgD;AAChD,uCAAmC;AAenC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,cAAc,EAA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AC;QACG,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,IAAA,wBAAa,EAAC,CAAC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC,EAAC,CAAC;IAC9I,CAAC;IACD,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC;YACtC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK;SACrG,CAAC,EAAC,CAAC;AACR,CAAC,CAAC;AAEM,gDAAkB"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { type Op_globals } from './options';
|
|
2
|
+
import { type Contact_flags } from './contact-input';
|
|
2
3
|
import type { Cli_context } from '../context';
|
|
3
4
|
declare const handle_contact_find: (opts: {
|
|
4
5
|
contact?: string;
|
|
5
6
|
}, ctx: Cli_context, g: Op_globals, read_stdin?: () => string) => Promise<void>;
|
|
6
7
|
declare const handle_contact_get: (id_arg: string, ctx: Cli_context, g: Op_globals) => Promise<void>;
|
|
7
|
-
|
|
8
|
+
type Update_opts = Contact_flags & {
|
|
8
9
|
fields?: string;
|
|
9
|
-
}
|
|
10
|
+
};
|
|
11
|
+
declare const handle_contact_update: (id_arg: string | undefined, opts: Update_opts, ctx: Cli_context, g: Op_globals, read_stdin?: () => string) => Promise<void>;
|
|
10
12
|
declare const handle_contact_delete: (id_arg: string, ctx: Cli_context, g: Op_globals) => Promise<void>;
|
|
11
13
|
export { handle_contact_find, handle_contact_get, handle_contact_update, handle_contact_delete };
|
|
14
|
+
export type { Update_opts };
|
|
@@ -130,24 +130,47 @@ const resolve_custom_fields = async (s, custom) => {
|
|
|
130
130
|
}
|
|
131
131
|
return custom.map(c => ({ name: title_of(c.name), value: c.value }));
|
|
132
132
|
};
|
|
133
|
+
// The contact id as the argument, as it always was, or the contact flags; never both.
|
|
134
|
+
const contact_to_update = (id_arg, opts, read_stdin) => {
|
|
135
|
+
if (id_arg === undefined) {
|
|
136
|
+
return (0, contact_input_1.read_contact_input)(opts, read_stdin);
|
|
137
|
+
}
|
|
138
|
+
if ([opts.contactId, opts.email, opts.firstName, opts.lastName, opts.company, opts.title, opts.contact].some(v => v !== undefined)) {
|
|
139
|
+
throw new errors_1.UsageError('The contact was given more than one way.', {
|
|
140
|
+
code: 'usage.contact', hint: 'Give the contact id as the argument, or the contact by its flags, not both.',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return { kind: 'id', id: (0, options_1.parse_id)(id_arg, 'Contact id') };
|
|
144
|
+
};
|
|
133
145
|
const handle_contact_update = async (id_arg, opts, ctx, g, read_stdin) => {
|
|
134
|
-
const
|
|
135
|
-
|
|
146
|
+
const stdin = (0, stdin_input_1.stdin_inputs)({ contact: opts.contact, fields: opts.fields }, {
|
|
147
|
+
code: 'usage.stdin', hint: `Pipe both in one object: echo '{"contact":{…},"fields":{…}}' | ${config_1.PROGRAM_NAME} contact update --contact - --fields -`,
|
|
148
|
+
}, read_stdin);
|
|
149
|
+
const contact = contact_to_update(id_arg, opts, stdin.contact);
|
|
150
|
+
const { patch, custom } = read_contact_update(opts.fields, stdin.fields);
|
|
136
151
|
const s = await (0, call_1.open_session)(ctx, g);
|
|
152
|
+
const ids = contact.kind === 'id' ? { contact_id: contact.id } : {};
|
|
137
153
|
try {
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
const
|
|
154
|
+
// Custom fields go by name, read before the contact is found or imported, so a name the account
|
|
155
|
+
// lacks changes nothing at all.
|
|
156
|
+
const custom_fields = custom === undefined ? undefined : await resolve_custom_fields(s, custom);
|
|
157
|
+
// The contact's fields only find the contact, or import it as an add would; the change is the
|
|
158
|
+
// --fields alone, so a contact Reply holds keeps the address it was found by.
|
|
159
|
+
const ensured = await (0, contacts_1.find_or_import)(s, contact);
|
|
160
|
+
ids.contact_id = ensured.id;
|
|
161
|
+
// Absent fields stay as they are; a null clears one.
|
|
162
|
+
const body = custom_fields === undefined ? patch : { ...patch, customFields: custom_fields };
|
|
163
|
+
const a = await (0, call_1.call_reply)(s, 'PATCH', `/v3/contacts/${ensured.id}`, 'write', body);
|
|
141
164
|
if (a.status === 404) {
|
|
142
|
-
throw (0, contacts_1.contact_not_found)(id, a);
|
|
165
|
+
throw (0, contacts_1.contact_not_found)(ensured.id, a);
|
|
143
166
|
}
|
|
144
167
|
if (a.status !== 200 && a.status !== 204) {
|
|
145
168
|
throw (0, call_1.refusal)(a, 'write');
|
|
146
169
|
}
|
|
147
|
-
(0, result_1.print_result)({ status: 'updated', contact_id: id }, g);
|
|
170
|
+
(0, result_1.print_result)({ status: 'updated', contact_id: ensured.id, contact_created: ensured.created }, g);
|
|
148
171
|
}
|
|
149
172
|
catch (e) {
|
|
150
|
-
throw (0, result_1.with_ids)(e,
|
|
173
|
+
throw (0, result_1.with_ids)(e, ids);
|
|
151
174
|
}
|
|
152
175
|
};
|
|
153
176
|
exports.handle_contact_update = handle_contact_update;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-record.js","sourceRoot":"","sources":["../../src/operations/contact-record.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"contact-record.js","sourceRoot":"","sources":["../../src/operations/contact-record.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,4CAA6F;AAC7F,iCAAgH;AAChH,uCAAoD;AACpD,mDAAkH;AAClH,yCAAsF;AACtF,+CAA8D;AAC9D,qCAAgD;AAGhD,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,cAAc,CAAU,CAAC;AAEvD,0EAA0E;AAC1E,MAAM,eAAe,GAAG,CAAC,MAA0B,EAAE,UAA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, g, read_stdin) => {
|
|
|
30
30
|
try {
|
|
31
31
|
// The person Reply already holds, so the opt-out lands on them. A contact is created only
|
|
32
32
|
// when Reply holds nobody under the address, by an import that asks nothing again.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const found = await (0, contacts_1.find_contact_by_address)(s, contact.person);
|
|
40
|
-
const ensured = found === null ? await (0, contacts_1.import_contact)(s, contact.person) : { id: found, created: false };
|
|
41
|
-
contact_id = ensured.id;
|
|
42
|
-
created = ensured.created;
|
|
43
|
-
}
|
|
44
|
-
ids.contact_id = contact_id;
|
|
45
|
-
await set_opted_out(s, contact_id);
|
|
46
|
-
(0, result_1.print_result)({ status: 'opted_out', contact_id, contact_created: created }, g);
|
|
33
|
+
const ensured = await (0, contacts_1.find_or_import)(s, contact);
|
|
34
|
+
ids.contact_id = ensured.id;
|
|
35
|
+
await set_opted_out(s, ensured.id);
|
|
36
|
+
(0, result_1.print_result)({ status: 'opted_out', contact_id: ensured.id, contact_created: ensured.created }, g);
|
|
47
37
|
}
|
|
48
38
|
catch (e) {
|
|
49
39
|
throw (0, result_1.with_ids)(e, ids);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/operations/contact.ts"],"names":[],"mappings":";;;AAAA,4CAA0D;AAC1D,iCAAuG;AAEvG,mDAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/operations/contact.ts"],"names":[],"mappings":";;;AAAA,4CAA0D;AAC1D,iCAAuG;AAEvG,mDAAuE;AACvE,yCAA0C;AAC1C,qCAAgD;AAKhD,kGAAkG;AAClG,6BAA6B;AAC7B,MAAM,aAAa,GAAG,KAAK,EAAC,CAAa,EAAE,UAAkB,EAAgB,EAAE;IAC3E,MAAM,CAAC,GAAG,MAAM,IAAA,iBAAU,EAAC,CAAC,EAAE,MAAM,EAAE,4BAA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,CAAC,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACnC,IAAA,qBAAY,EAAC,EAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,EAAC,EAAE,CAAC,CAAC,CAAC;IACrG,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,IAAA,iBAAQ,EAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEM,wDAAsB"}
|
|
@@ -6,10 +6,12 @@ type Ensured = {
|
|
|
6
6
|
created: boolean;
|
|
7
7
|
};
|
|
8
8
|
declare const import_contact: (s: Op_session, person: Person) => Promise<Ensured>;
|
|
9
|
-
|
|
9
|
+
type Channel = 'email' | 'linkedin';
|
|
10
|
+
declare const find_contact_by_address: (s: Op_session, person: Person, by?: Channel) => Promise<number | null>;
|
|
10
11
|
declare const ensure_contact: (s: Op_session, ref: Contact_ref) => Promise<Ensured>;
|
|
12
|
+
declare const find_or_import: (s: Op_session, ref: Contact_ref) => Promise<Ensured>;
|
|
11
13
|
declare const find_contact: (s: Op_session, ref: Contact_ref) => Promise<number | null>;
|
|
12
14
|
declare const contact_not_found: (contact_id: number, a: Answer) => Operation_error;
|
|
13
15
|
declare const read_opted_out: (s: Op_session, contact_id: number) => Promise<boolean>;
|
|
14
|
-
export { ensure_contact, import_contact, find_contact, find_contact_by_address, read_opted_out, contact_not_found };
|
|
15
|
-
export type { Ensured };
|
|
16
|
+
export { ensure_contact, find_or_import, import_contact, find_contact, find_contact_by_address, read_opted_out, contact_not_found };
|
|
17
|
+
export type { Ensured, Channel };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contact_not_found = exports.read_opted_out = exports.find_contact_by_address = exports.find_contact = exports.import_contact = exports.ensure_contact = void 0;
|
|
3
|
+
exports.contact_not_found = exports.read_opted_out = exports.find_contact_by_address = exports.find_contact = exports.import_contact = exports.find_or_import = exports.ensure_contact = void 0;
|
|
4
4
|
const errors_1 = require("../utils/errors");
|
|
5
5
|
const call_1 = require("./call");
|
|
6
6
|
const contact_input_1 = require("./contact-input");
|
|
@@ -78,16 +78,16 @@ const import_contact = async (s, person) => {
|
|
|
78
78
|
return { id: item.id, created: item.status === 'created' };
|
|
79
79
|
};
|
|
80
80
|
exports.import_contact = import_contact;
|
|
81
|
-
// What a person is looked up by: the
|
|
82
|
-
// counts only when it carries the same address: an email
|
|
83
|
-
// under linkedin_key.
|
|
81
|
+
// What a person is looked up by: the channel named, which the person carries, or else the email when
|
|
82
|
+
// there is one, else the LinkedIn URL. An entry counts only when it carries the same address: an email
|
|
83
|
+
// equal ignoring case, a LinkedIn URL equal under linkedin_key.
|
|
84
84
|
// INTERIM (API gap): the document does not say whether the exact lookup by LinkedIn URL ignores case.
|
|
85
85
|
// Needed: a lookup that matches a LinkedIn URL by its slug whatever its case, or a word that it does.
|
|
86
86
|
// Workaround: ask with the URL in the form it is written in (its lowercased slug) first, then as
|
|
87
87
|
// given, and count the matches of both together, so one slug held under two spellings is refused
|
|
88
88
|
// rather than half seen.
|
|
89
|
-
const lookup_of = (p) => {
|
|
90
|
-
if (p.email !== undefined) {
|
|
89
|
+
const lookup_of = (p, by) => {
|
|
90
|
+
if (p.email !== undefined && by !== 'linkedin') {
|
|
91
91
|
const wanted = p.email.toLowerCase();
|
|
92
92
|
return { param: 'email', values: [p.email], holds: entry => typeof entry.email === 'string' && entry.email.toLowerCase() === wanted };
|
|
93
93
|
}
|
|
@@ -129,8 +129,8 @@ const read_lookup = async (s, lookup, value, found_before) => {
|
|
|
129
129
|
}
|
|
130
130
|
throw new errors_1.Operation_error('reply.unavailable', 'Reply answered the exact lookup with more pages than one address can fill.', { status: 200 });
|
|
131
131
|
};
|
|
132
|
-
const find_contact_by_address = async (s, person) => {
|
|
133
|
-
const lookup = lookup_of(person);
|
|
132
|
+
const find_contact_by_address = async (s, person, by) => {
|
|
133
|
+
const lookup = lookup_of(person, by);
|
|
134
134
|
let found = null;
|
|
135
135
|
for (const value of lookup.values) {
|
|
136
136
|
found = await read_lookup(s, lookup, value, found);
|
|
@@ -158,6 +158,17 @@ const ensure_contact = async (s, ref) => {
|
|
|
158
158
|
return import_contact(s, ref.person);
|
|
159
159
|
};
|
|
160
160
|
exports.ensure_contact = ensure_contact;
|
|
161
|
+
// The contact a command acts on: the id given; else the one Reply holds under the address a lookup uses;
|
|
162
|
+
// else the person imported as an add imports them. Looking first means that a person Reply already holds needs
|
|
163
|
+
// no first name.
|
|
164
|
+
const find_or_import = async (s, ref) => {
|
|
165
|
+
if (ref.kind === 'id') {
|
|
166
|
+
return { id: ref.id, created: false };
|
|
167
|
+
}
|
|
168
|
+
const found = await find_contact_by_address(s, ref.person);
|
|
169
|
+
return found === null ? import_contact(s, ref.person) : { id: found, created: false };
|
|
170
|
+
};
|
|
171
|
+
exports.find_or_import = find_or_import;
|
|
161
172
|
const find_contact = async (s, ref) => ref.kind === 'id' ? ref.id : find_contact_by_address(s, ref.person);
|
|
162
173
|
exports.find_contact = find_contact;
|
|
163
174
|
const contact_not_found = (contact_id, a) => new errors_1.Operation_error('contact.not_found', `This account has no contact ${contact_id}.`, { status: a.status, reply_code: (0, call_1.reply_code_of)(a) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.js","sourceRoot":"","sources":["../../src/operations/contacts.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,iCAGgB;AAChB,mDAA4E;AAI5E,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAyB,EAAE;IACrD,MAAM,IAAI,GAA2B,EAAE,CAAC;IACxC,IAAI,CA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G,EACpB,CAAC;QACG,MAAM,IAAA,cAAO,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,MAAM,IAAI,GAAG,IAAA,oBAAa,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACtC,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,SAAS,EACxC,CAAC;QACG,MAAM,IAAA,iBAAU,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC,UAAU,CAAC;AAC3B,CAAC,CAAC;AAE6F,wCAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Op_globals } from './options';
|
|
2
|
+
import { type Contact_flags } from './contact-input';
|
|
2
3
|
import type { Cli_context } from '../context';
|
|
3
4
|
type Direct_send_name = 'send-email' | 'linkedin-connect' | 'linkedin-message' | 'linkedin-inmail' | 'linkedin-voice';
|
|
4
|
-
type Direct_send_opts = {
|
|
5
|
-
contactId?: string;
|
|
5
|
+
type Direct_send_opts = Contact_flags & {
|
|
6
6
|
emailAccountId?: string;
|
|
7
7
|
linkedinAccountId?: string;
|
|
8
8
|
message?: string;
|
|
@@ -6,6 +6,7 @@ const errors_1 = require("../utils/errors");
|
|
|
6
6
|
const client_1 = require("../utils/client");
|
|
7
7
|
const call_1 = require("./call");
|
|
8
8
|
const options_1 = require("./options");
|
|
9
|
+
const contact_input_1 = require("./contact-input");
|
|
9
10
|
const contacts_1 = require("./contacts");
|
|
10
11
|
const stdin_input_1 = require("./stdin-input");
|
|
11
12
|
const result_1 = require("./result");
|
|
@@ -136,47 +137,107 @@ const send_refusal = (a, contact_id) => {
|
|
|
136
137
|
return (0, call_1.refusal)(a, 'write');
|
|
137
138
|
};
|
|
138
139
|
const positive_integer = (v) => typeof v === 'number' && Number.isSafeInteger(v) && v > 0 ? v : null;
|
|
139
|
-
// What the CLI answers for a send Reply took
|
|
140
|
-
//
|
|
141
|
-
|
|
140
|
+
// What the CLI answers for a send Reply took: the contact it went to, as the add commands name it, so
|
|
141
|
+
// a caller can keep its id. Neither adds a time of its own: Reply's answer to a direct email carries
|
|
142
|
+
// none, and a LinkedIn send's sentAtUtc is given as Reply gives it.
|
|
143
|
+
const result_of = (name, contact, sent) => name === 'send-email'
|
|
142
144
|
? {
|
|
143
|
-
status: 'sent', contact_id,
|
|
145
|
+
status: 'sent', contact_id: contact.id, contact_created: contact.created,
|
|
144
146
|
message_id: typeof sent.messageId === 'string' ? sent.messageId : null,
|
|
145
147
|
sent_at: null,
|
|
146
148
|
reply_status: typeof sent.status === 'string' ? sent.status : null,
|
|
147
149
|
}
|
|
148
150
|
: {
|
|
149
|
-
status: 'sent', contact_id,
|
|
151
|
+
status: 'sent', contact_id: contact.id, contact_created: contact.created,
|
|
150
152
|
activity_id: positive_integer(sent.linkedInActivityId),
|
|
151
153
|
sent_at: typeof sent.sentAtUtc === 'string' ? sent.sentAtUtc : null,
|
|
152
154
|
};
|
|
155
|
+
// A person given by their fields is looked up by the address the send reaches them at, so one who
|
|
156
|
+
// lacks it is refused before anything is asked. The address is never repeated.
|
|
157
|
+
const require_address = (name, contact, by) => {
|
|
158
|
+
if (contact.kind === 'person' && (by === 'email' ? contact.person.email : contact.person.linkedin_url) === undefined) {
|
|
159
|
+
throw new errors_1.UsageError(by === 'email'
|
|
160
|
+
? `contact ${name} needs the contact's email: the email goes to it.`
|
|
161
|
+
: `contact ${name} needs the contact's linkedin_url: the send goes to that profile.`, {
|
|
162
|
+
code: 'usage.contact', hint: 'Give it in --contact, or name a contact Reply holds with --contact-id.',
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
// INTERIM (API gap): Reply does not refuse a direct send to a contact it holds as opted out, so the only guard on that
|
|
167
|
+
// opt-out is a caller that reads the contact before it sends.
|
|
168
|
+
// Needed: a direct send that refuses a contact Reply holds as opted out.
|
|
169
|
+
// Workaround: a send given a person's fields acts only on a contact it created. One Reply already holds, found by the
|
|
170
|
+
// lookup or matched by the import, is refused before anything is sent, and named, for the caller to read and then send
|
|
171
|
+
// to by its id.
|
|
172
|
+
const already_held = (contact_id) => new errors_1.Operation_error('contact.already_held', `Reply already holds contact ${contact_id} under what was given, so nothing was sent: a send given a person's fields goes only to a contact it creates.`, {
|
|
173
|
+
status: 200,
|
|
174
|
+
hint: `Read it first with ${config_1.PROGRAM_NAME} contact get ${contact_id}; if it is the one to reach, send to it with --contact-id ${contact_id}.`,
|
|
175
|
+
});
|
|
153
176
|
const handle_direct_send = async (name, opts, ctx, g, read_stdin) => {
|
|
154
177
|
const send = DIRECT_SENDS[name];
|
|
155
|
-
const
|
|
178
|
+
const stdin = (0, stdin_input_1.stdin_inputs)({ contact: opts.contact, message: opts.message }, {
|
|
179
|
+
code: 'usage.stdin', hint: `Pipe both in one object: echo '{"contact":{…},"message":{…}}' | ${config_1.PROGRAM_NAME} contact ${name} --contact - … --message -`,
|
|
180
|
+
}, read_stdin);
|
|
181
|
+
const contact = (0, contact_input_1.read_contact_input)(opts, stdin.contact);
|
|
156
182
|
// A send always names the account it goes from: Reply would send an email from the default mailbox.
|
|
157
183
|
const by_email = name === 'send-email';
|
|
184
|
+
const by = by_email ? 'email' : 'linkedin';
|
|
185
|
+
require_address(name, contact, by);
|
|
158
186
|
const account_id = by_email
|
|
159
187
|
? required_id(opts.emailAccountId, '--email-account-id', options_1.LARGEST_SAFE_ID)
|
|
160
188
|
: required_id(opts.linkedinAccountId, '--linkedin-account-id');
|
|
161
|
-
const ids = by_email ? {
|
|
162
|
-
const text = read_text(name, send, opts.message,
|
|
189
|
+
const ids = by_email ? { email_account_id: account_id } : { linkedin_account_id: account_id };
|
|
190
|
+
const text = read_text(name, send, opts.message, stdin.message);
|
|
163
191
|
const s = await (0, call_1.open_session)(ctx, g);
|
|
192
|
+
let sending = false;
|
|
164
193
|
try {
|
|
165
|
-
|
|
194
|
+
// The contact first, found or imported as an add would; a person given by their fields is sent to only when
|
|
195
|
+
// this import created them.
|
|
196
|
+
let ensured;
|
|
197
|
+
if (contact.kind === 'person') {
|
|
198
|
+
// A person is looked up by every address given, the one the send reaches them at first: a hit under any of
|
|
199
|
+
// them is a contact Reply holds, and the first one found is the one named.
|
|
200
|
+
const other = by === 'email' ? 'linkedin' : 'email';
|
|
201
|
+
for (const channel of [by, other]) {
|
|
202
|
+
if ((channel === 'email' ? contact.person.email : contact.person.linkedin_url) === undefined) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const held = await (0, contacts_1.find_contact_by_address)(s, contact.person, channel);
|
|
206
|
+
if (held !== null) {
|
|
207
|
+
ids.contact_id = held;
|
|
208
|
+
throw already_held(held);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
ensured = await (0, contacts_1.import_contact)(s, contact.person);
|
|
212
|
+
ids.contact_id = ensured.id;
|
|
213
|
+
if (!ensured.created) {
|
|
214
|
+
throw already_held(ensured.id);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
ensured = { id: contact.id, created: false };
|
|
219
|
+
ids.contact_id = ensured.id;
|
|
220
|
+
}
|
|
221
|
+
sending = true;
|
|
222
|
+
const a = await (0, call_1.call_reply)(s, 'POST', `/v3/contacts/${ensured.id}/${send.path}`, 'write', send.body(account_id, text));
|
|
166
223
|
if (name === 'linkedin-connect' && a.status === 409 && (0, call_1.reply_code_of)(a) === 'directLinkedIn.alreadyConnected') {
|
|
167
224
|
// Nothing was sent, and nothing needs to be: the contact is already a connection.
|
|
168
|
-
(0, result_1.print_result)({ status: 'already_connected', contact_id, activity_id: null, sent_at: null }, g);
|
|
225
|
+
(0, result_1.print_result)({ status: 'already_connected', contact_id: ensured.id, contact_created: ensured.created, activity_id: null, sent_at: null }, g);
|
|
169
226
|
return;
|
|
170
227
|
}
|
|
171
228
|
if (a.status !== 200) {
|
|
172
|
-
throw send_refusal(a,
|
|
229
|
+
throw send_refusal(a, ensured.id);
|
|
173
230
|
}
|
|
174
|
-
(0, result_1.print_result)(result_of(name,
|
|
231
|
+
(0, result_1.print_result)(result_of(name, ensured, (0, call_1.expect_object)(a, 'write')), g);
|
|
175
232
|
}
|
|
176
233
|
catch (e) {
|
|
177
|
-
// Unlike most work commands, a send is not safe to repeat: the same text would go twice.
|
|
234
|
+
// Unlike most work commands, a send is not safe to repeat: the same text would go twice. Before
|
|
235
|
+
// the send was made, only the contact's import can have been lost, and that is safe to repeat.
|
|
178
236
|
if (e instanceof errors_1.Unknown_outcome_error) {
|
|
179
|
-
e.hint =
|
|
237
|
+
e.hint = sending
|
|
238
|
+
? `The ${send.what} may have been sent; running the command again may send it twice.`
|
|
239
|
+
: `Nothing was sent: the outcome of the contact's import is unknown, so the ${send.what} was never made. `
|
|
240
|
+
+ 'Running the command again is safe: if the import did create the contact, it answers contact.already_held with its id.';
|
|
180
241
|
}
|
|
181
242
|
throw (0, result_1.with_ids)(e, ids);
|
|
182
243
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct-send.js","sourceRoot":"","sources":["../../src/operations/direct-send.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,4CAA6F;AAC7F,4CAAkD;AAClD,iCAA+G;AAC/G,uCAAqE;AACrE,yCAA6C;AAC7C,+CAAgD;AAChD,qCAAgD;AAgBhD,oGAAoG;AACpG,qGAAqG;AACrG,MAAM,YAAY,GAA0C;IACxD,YAAY,EAAE;QACV,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE;QAClF,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,EAAC,EAAE,CAAA,CAAC,EAAC,cAAc,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAC,CAAC;KAC5E;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,8BAA8B,EAAE,IAAI,EAAE,YAAY,EAA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,EAAE,IAAA,oBAAa,EAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,gGAAgG;QAChG,+FAA+F;QAC/F,IAAI,CAAC,YAAY,8BAAqB,EACtC,CAAC;YACG,CAAC,CAAC,IAAI,GAAG,OAAO;gBACZ,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,mEAAmE;gBACrF,CAAC,CAAC,4EAA4E,IAAI,CAAC,IAAI,mBAAmB;sBACpG,uHAAuH,CAAC;QACtI,CAAC;QACD,MAAM,IAAA,iBAAQ,EAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEM,gDAAkB"}
|
|
@@ -6,5 +6,9 @@ type Stdin_object_opts = {
|
|
|
6
6
|
hint: string;
|
|
7
7
|
};
|
|
8
8
|
declare const read_stdin_object: (source: string | undefined, o: Stdin_object_opts, read_stdin?: () => string) => Record<string, unknown>;
|
|
9
|
-
|
|
9
|
+
declare const stdin_inputs: <K extends string>(sources: Record<K, string | undefined>, o: {
|
|
10
|
+
code: string;
|
|
11
|
+
hint: string;
|
|
12
|
+
}, read_stdin?: () => string) => Record<K, () => string>;
|
|
13
|
+
export { read_stdin_object, stdin_inputs };
|
|
10
14
|
export type { Stdin_object_opts };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.read_stdin_object = void 0;
|
|
3
|
+
exports.stdin_inputs = exports.read_stdin_object = void 0;
|
|
4
4
|
const errors_1 = require("../utils/errors");
|
|
5
5
|
const json_arg_1 = require("../utils/json-arg");
|
|
6
6
|
const call_1 = require("./call");
|
|
@@ -31,4 +31,40 @@ const read_stdin_object = (source, o, read_stdin) => {
|
|
|
31
31
|
return value;
|
|
32
32
|
};
|
|
33
33
|
exports.read_stdin_object = read_stdin_object;
|
|
34
|
+
// The person and their text, each read from stdin by its own flag. When both flags take '-', stdin
|
|
35
|
+
// holds one object with each input under its flag's name, {"contact": {…}, "message": {…}}; it is
|
|
36
|
+
// read once, and each flag is handed its member as the text it would have read alone. When at most
|
|
37
|
+
// one does, that one reads stdin as ever. No message here repeats any of it: an unknown member is
|
|
38
|
+
// named, never its value.
|
|
39
|
+
const stdin_inputs = (sources, o, read_stdin) => {
|
|
40
|
+
const read = read_stdin ?? json_arg_1.read_all_stdin;
|
|
41
|
+
const names = Object.keys(sources);
|
|
42
|
+
const piped = names.filter(n => sources[n] === '-');
|
|
43
|
+
if (piped.length < 2) {
|
|
44
|
+
return Object.fromEntries(names.map(n => [n, read]));
|
|
45
|
+
}
|
|
46
|
+
const flags = piped.map(n => `--${n} -`).join(' and ');
|
|
47
|
+
const shape = `{${piped.map(n => `"${n}": {…}`).join(', ')}}`;
|
|
48
|
+
let value;
|
|
49
|
+
try {
|
|
50
|
+
value = JSON.parse(read());
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
throw new errors_1.UsageError(`With ${flags} both, stdin must be JSON: ${shape}.`, { code: o.code, hint: o.hint });
|
|
54
|
+
}
|
|
55
|
+
if (!(0, call_1.is_object)(value)) {
|
|
56
|
+
throw new errors_1.UsageError(`With ${flags} both, stdin must be one JSON object: ${shape}.`, { code: o.code, hint: o.hint });
|
|
57
|
+
}
|
|
58
|
+
const input = value;
|
|
59
|
+
const unknown_field = Object.keys(input).find(k => !piped.includes(k));
|
|
60
|
+
if (unknown_field !== undefined) {
|
|
61
|
+
throw new errors_1.UsageError(`Stdin has an unknown field '${unknown_field}'.`, { code: o.code, hint: `Fields: ${piped.join(', ')}.` });
|
|
62
|
+
}
|
|
63
|
+
const missing = piped.find(n => input[n] === undefined);
|
|
64
|
+
if (missing !== undefined) {
|
|
65
|
+
throw new errors_1.UsageError(`Stdin has no ${missing}: with ${flags} both, it holds ${shape}.`, { code: o.code, hint: o.hint });
|
|
66
|
+
}
|
|
67
|
+
return Object.fromEntries(names.map(n => [n, sources[n] === '-' ? () => JSON.stringify(input[n]) : read]));
|
|
68
|
+
};
|
|
69
|
+
exports.stdin_inputs = stdin_inputs;
|
|
34
70
|
//# sourceMappingURL=stdin-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdin-input.js","sourceRoot":"","sources":["../../src/operations/stdin-input.ts"],"names":[],"mappings":";;;AAAA,4CAA2C;AAC3C,gDAAiD;AACjD,iCAAiC;AAUjC,mGAAmG;AACnG,kGAAkG;AAClG,mCAAmC;AACnC,MAAM,iBAAiB,GAAG,CAAC,MAA0B,EAAE,CAAoB,EAAE,UAAyB,EAA0B,EAAE;IAC9H,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACzC,IAAI,MAAM,KAAK,GAAG,EAClB,CAAC;QACG,MAAM,IAAI,mBAAU,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,sBAAsB,CAAC,CAAC,IAAI,sBAAsB,EAAE;YAC7H,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI;SAC7B,CAAC,CAAC;IACP,CAAC;IACD,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,IAAI,yBAAc,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,IAAI,mBAAU,CAAC,OAAO,CAAC,CAAC,IAAI,2BAA2B,KAAK,GAAG,EAAE,EAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC;IAC3F,CAAC;IACD,IAAI,CAAC,IAAA,gBAAS,EAAC,KAAK,CAAC,EACrB,CAAC;QACG,MAAM,IAAI,mBAA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