reply-cli 0.20.0 → 0.22.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 CHANGED
@@ -226,6 +226,13 @@ prints JSON (indented; compact with `--json`) and says what happened in a stable
226
226
  | `reply inbox mark-read <thread-id>` · `reply inbox mark-unread <thread-id>` | → `read` / `unread` |
227
227
  | `reply account list [--channel email\|linkedin]` | the email and LinkedIn accounts a send can go from, whose each is, and the state of each |
228
228
  | `reply schedule list` | the sending schedules the account can use, each with its time zone and its windows by weekday |
229
+ | `reply account connect --channel email --provider gmail\|office365 [--name N]` · `--channel linkedin --name N` | a link that connects one new account, for the person who signs in to open → `link`, `expires_at`, `pending_id` |
230
+ | `reply account reconnect <id> --channel email\|linkedin` | a link that reconnects an account that lost its connection → `link` |
231
+ | `reply account pending [--channel email\|linkedin]` | the connection links made and not used yet, without the links |
232
+ | `reply account limits <id> --channel email\|linkedin [--daily N] [--set …]` | read an account's sending limits, or change some of them |
233
+ | `reply account pause <id> --channel linkedin` · `resume <id> --channel linkedin` | → `inactive` / `active`, toggled only when it is not already so |
234
+ | `reply account unblock <id>` | let a mailbox its provider stopped from sending pick its sequences back up → `unblocked` |
235
+ | `reply account delete <id> --channel email\|linkedin --yes [--force]` | → `deleted`; without `--yes` nothing is sent |
229
236
 
230
237
  `<contact>` is exactly one of `--contact <json>|@file|-`, `--email <address>` (with `--first-name`,
231
238
  `--last-name`, `--company`, `--title`), or `--contact-id <id>`. The JSON takes the same fields
@@ -332,6 +339,19 @@ Reply cannot fill is `contact.missing_variables`, with the names under the error
332
339
  # {"error":{"code":"contact.missing_variables",…,"details":{"missing_variables":["FirstName","Company"]}}}
333
340
  ```
334
341
 
342
+ Reply holds a direct email to the mailbox's limits. `email.limit_reached` (`429`) is one of them
343
+ reached, with `details.limit` saying which: `daily`, the mailbox's day, which Reply counts in UTC,
344
+ or `active_contacts`, the contacts the account may email in its billing period. A send for later is
345
+ also refused `daily` when the day it is due already holds as many sends as the mailbox's limit.
346
+ `retry_after` passes on Reply's `Retry-After`, the seconds until the limit clears, and the CLI never
347
+ repeats the send itself. `email.sending_disabled` (`403`) is a mailbox or team that cannot send
348
+ direct emails now: the mailbox's daily limit is 0, or the team's plan does not send; no wait clears
349
+ it. Neither sends anything, and `reply_code` keeps Reply's own code, as on every refusal:
350
+
351
+ ```sh
352
+ # {"error":{"status":429,"code":"email.limit_reached",…,"reply_code":"contact.dailyLimitReached","retry_after":43200,"details":{"limit":"daily"}}}
353
+ ```
354
+
335
355
  Every direct send also takes `--send-after <moment>`, `--schedule-id <id>` and
336
356
  `--idempotency-key <key>`. Reply holds the send until the moment, given with its offset
337
357
  (`2026-11-03T14:00:00Z`, `2026-11-03T16:00:00+02:00`) and sent to Reply in UTC; a moment without an
@@ -399,9 +419,14 @@ reply direct-send cancel linkedin-1042
399
419
  Both answer the send under the CLI's names, each null when Reply gives none: `reference`, `channel`,
400
420
  `contact_id`, `state`, `send_after`, `sent_at`, `message_id`, `failure_reason` and `cancelled_at`.
401
421
  `failure_code`, `missing_variables`, `rendered_subject` and `rendered_body` are added only when
402
- Reply gives them, and so is `estimated_send_at`, read the same way as on the send but as of the
403
- read: set in `waitingForSchedule` only and null in every other state, and null there too when the
404
- schedule does not open within 30 days counted from `--send-after`, or from now once that has passed.
422
+ Reply gives them, and so are `bounced`, `bounce_type` and `bounced_at`: whether a bounce came back
423
+ for the email after it went out (false until one does, and always false for LinkedIn), Reply's own
424
+ word for the kind of the latest bounce as given (`hard`, `soft`, `mailboxFull`, `unknown`, …), and
425
+ when it came. Reply leaves `bounce_type` and `bounced_at` null while `bounced` is false, and
426
+ `bounced_at` null when the bounce carried no date; the CLI passes on what Reply gives and checks
427
+ neither. So is `estimated_send_at`, read the same way as on the send but as of the read: set in
428
+ `waitingForSchedule` only and null in every other state, and null there too when the schedule does
429
+ not open within 30 days counted from `--send-after`, or from now once that has passed.
405
430
  `failure_reason` is a sentence for a person and never parsed; `failure_code` is Reply's code for the
406
431
  failure, the one to branch on. A failed send may carry no `failure_code`: it is then null, and
407
432
  `failure_reason` is all Reply says of it. `direct-send cancel` of a send already cancelled answers
@@ -512,6 +537,45 @@ For `inbox reply`, read the thread with `reply inbox get` before trying again. F
512
537
  `sequence list --name -` first. Every other work command can simply be run again; a `contact delete`
513
538
  repeated after its first one took effect answers `contact.not_found`.
514
539
 
540
+ **Connecting accounts.** `account connect` and `account reconnect` print a link for the person who
541
+ signs in to the account: they open it in a browser and sign in on Google's, Microsoft's or LinkedIn's
542
+ own page, so no password passes through the CLI. The link is a credential for whoever holds it. It is
543
+ printed once, in the stdout field `link`, and never on stderr, in a `--verbose` trace (where it reads
544
+ `<link redacted>`), in an error or in a log. A connection link connects one account, works once and
545
+ expires, and the attempt is listed by `account pending` until the person finishes; then the account
546
+ is in `account list`. An email link needs `--provider`; a reconnect takes the provider from the
547
+ mailbox, and the person must sign in with the same address. A LinkedIn connect needs `--name`, which
548
+ Reply lists the pending account under.
549
+
550
+ A Reply without one-mailbox email links answers that route with a 404 and no code. `account
551
+ connect`, `account reconnect` and `account pending` then refuse with `email_link.not_available`
552
+ (exit 1), print nothing and offer nothing else. `"link_kind"` is always `"connection_link"`, and
553
+ `account pending` always answers `"supported":true` with `"unsupported_channels":[]`; the fields are
554
+ kept for callers that read them. `--allow-shared-page`, which printed the account user's hosted
555
+ mailbox page on such a Reply, is deprecated: it is still accepted, does nothing and is hidden from
556
+ the help, and a later release removes it. So is `--provider` on `account reconnect`.
557
+
558
+ ```sh
559
+ reply account connect --channel email --provider gmail --name "Sales mailbox"
560
+ reply account connect --channel linkedin --name "Dana Example"
561
+ reply account reconnect 34 --channel linkedin
562
+ reply account pending
563
+ ```
564
+
565
+ `account limits` prints the limits in Reply's names: an email account's `safety` section, which
566
+ `--daily` and `--set '{"minSendingDelaySeconds":90}'` change, and a LinkedIn account's `limits`,
567
+ which `--set` changes as Reply's limits update does. `account pause` and `account resume` act on a
568
+ LinkedIn account; Reply's only call flips the state, so it is read first and left alone when it is
569
+ already the one asked for. The flip turns an enabled account off and any other on, so `pause` flips
570
+ only an enabled account and `resume` only a disabled one. An account at its daily limit is active:
571
+ `resume` leaves it alone, and `pause` refuses it with `account.pause_unavailable` before any write. A
572
+ state the CLI does not know is refused with `account.status_unknown`, also before any write. Reply
573
+ has no way to pause a mailbox through its API. `account delete`
574
+ needs `--yes`, and `--force` deletes a LinkedIn account sequences still use. Reply's refusals come
575
+ under the CLI's codes, as every work command's do (`linkedin.account_in_use`, `email_account.not_found`,
576
+ `linkedin.invalid_cookie`), with Reply's own code in `reply_code`. After exit 3 from `account connect` or `account reconnect`, read
577
+ `account pending` before running it again: a link may already have been made.
578
+
515
579
  **Errors.** With `--json`, a failure is one line on stderr:
516
580
  `{"error":{"code":"contact.opted_out","title":…,"status":…,"reply_code":…,"ids":{…}}}`. `ids` is
517
581
  whatever the command learned before failing, for example the id of a contact it created before
@@ -525,9 +589,10 @@ the others checks or relies on Reply's own state rather than repeating an effect
525
589
 
526
590
  **Retries.** Reads are retried on errors. A write is retried only when it can't have reached Reply:
527
591
  the connection was never made, or a `429` asked to wait 3 seconds or less. A longer `429` comes back
528
- as `rate_limited` with `retry_after`. A `429` that names a `reference` or says a daily or weekly limit
529
- was reached is never resent, whatever it asks to wait: Reply may have recorded the attempt, and a repeat
530
- would record another. Each comes back at once as the refusal it is.
592
+ as `rate_limited` with `retry_after`. A `429` that names a `reference` or says a daily, weekly or
593
+ active contacts limit was reached is never resent, whatever it asks to wait: Reply may have
594
+ recorded the attempt, and a repeat would record another. Each comes back at once as the refusal it
595
+ is.
531
596
 
532
597
  ## Raw API access
533
598
 
@@ -561,7 +626,7 @@ connection that broke after sending. That last case exits 3: the write may have
561
626
  goes by the method alone, so this includes a POST that only reads, such as the `…/filter` calls; run
562
627
  it again yourself if it failed. A `429` is waited out only when `Retry-After` asks for 3 seconds or
563
628
  less; a longer one is printed as the `429` it is, and so is one whose body names a `reference` or a
564
- daily or weekly limit.
629
+ daily, weekly or active contacts limit.
565
630
 
566
631
  ### Windows: Git Bash rewrites the path
567
632
 
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ const build_program = () => {
36
36
  .option('--user-email <email>', 'Act as this user email — organization API keys only (needs a team id)')
37
37
  .option('--json', 'Output compact JSON to stdout')
38
38
  .option('--pretty', 'Output indented JSON to stdout')
39
- .option('--verbose', 'Print the full request/response to stderr, credentials redacted (api)')
39
+ .option('--verbose', 'Print the full request/response to stderr, credentials and links redacted (api, account)')
40
40
  .option('-q, --quiet', 'Suppress progress messages on stderr (warnings and errors still shown)')
41
41
  .showHelpAfterError();
42
42
  // Apply --quiet before any command action runs, so progress output is
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AACA,yCAAkD;AAClD,qCAAmD;AACnD,0CAA6C;AAC7C,gDAAmD;AACnD,0CAA6C;AAC7C,wCAA2C;AAC3C,8CAAiD;AACjD,gDAAmD;AACnD,oDAG+B;AAC/B,gDAAkD;AAClD,2CAAqD;AACrD,2CAA+C;AAE/C,8EAA8E;AAC9E,sEAAsE;AACtE,MAAM,iBAAiB,GAAG,CAAC,GAAY,EAAO,EAAE;IAC5C,GAAG,CAAC,YAAY,EAAE,CAAC;IACnB,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,EAC9B,CAAC;QACG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,GAAW,EAAE;IAC/B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,qBAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO;SACF,IAAI,CAAC,qBAAY,CAAC;SAClB,WAAW,CAAC,sCAAsC,CAAC;SACnD,OAAO,CAAC,IAAA,oBAAW,GAAE,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,qBAAqB,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AK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Operation_error } from '../utils/errors';
2
+ import { type Answer, type Op_session } from './call';
3
+ import type { Call_kind } from '../utils/client';
4
+ import type { Op_globals } from './options';
5
+ declare const LINK_REDACTED = "<link redacted>";
6
+ declare const add_link: (link: string, found: Set<string>) => void;
7
+ declare const links_in: (data: unknown, found?: Set<string>) => Set<string>;
8
+ declare const redact_links: (text: string, secrets: Iterable<string>) => string;
9
+ declare const account_call: (s: Op_session, g: Op_globals, method: string, path: string, kind: Call_kind, body?: unknown) => Promise<Answer>;
10
+ declare const ACCOUNT_REFUSALS: Record<string, {
11
+ status: number;
12
+ code: string;
13
+ title: string;
14
+ }>;
15
+ declare const account_refusal: (a: Answer, kind: Call_kind) => Operation_error;
16
+ declare const route_missing: (a: Answer) => boolean;
17
+ export { LINK_REDACTED, ACCOUNT_REFUSALS, account_call, account_refusal, route_missing, links_in, redact_links, add_link };
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.add_link = exports.redact_links = exports.links_in = exports.route_missing = exports.account_refusal = exports.account_call = exports.ACCOUNT_REFUSALS = exports.LINK_REDACTED = void 0;
4
+ const output_1 = require("../utils/output");
5
+ const errors_1 = require("../utils/errors");
6
+ const call_1 = require("./call");
7
+ // The calls of the account commands, and what they write to stderr under --verbose. A connection link
8
+ // and any token in it are handed over once, in the stdout field `link`: in a trace each is replaced by
9
+ // LINK_REDACTED, wherever it appears.
10
+ const LINK_REDACTED = '<link redacted>';
11
+ exports.LINK_REDACTED = LINK_REDACTED;
12
+ // The field Reply hands a link in: v3's connectionLink.
13
+ const LINK_FIELDS = ['connectionlink'];
14
+ // Too short to be a token, and short enough to be an ordinary word of a URL.
15
+ const SHORTEST_TOKEN = 8;
16
+ const SHORTEST_INNER_TOKEN = 16;
17
+ const safe_decode = (part) => {
18
+ try {
19
+ return decodeURIComponent(part);
20
+ }
21
+ catch {
22
+ return part;
23
+ }
24
+ };
25
+ // A link, and every token it carries: its last path segment, every query value, and any inner path
26
+ // segment that looks generated (long, with a digit in it), each as written and decoded.
27
+ const add_link = (link, found) => {
28
+ found.add(link);
29
+ let url;
30
+ try {
31
+ url = new URL(link);
32
+ }
33
+ catch {
34
+ return;
35
+ }
36
+ const segments = url.pathname.split('/').filter(Boolean);
37
+ const parts = [
38
+ ...segments.slice(0, -1).filter(p => p.length >= SHORTEST_INNER_TOKEN && /[0-9]/.test(p)),
39
+ ...segments.slice(-1),
40
+ ...[...url.searchParams.values()],
41
+ ];
42
+ for (const part of parts) {
43
+ for (const form of [part, safe_decode(part), encodeURIComponent(safe_decode(part))]) {
44
+ if (form.length >= SHORTEST_TOKEN) {
45
+ found.add(form);
46
+ }
47
+ }
48
+ }
49
+ };
50
+ exports.add_link = add_link;
51
+ const is_address = (text) => /^https?:\/\//i.test(text.trim());
52
+ // Every link in an answer's body, with its tokens: in a link field at any depth, or the body itself when
53
+ // it is nothing but an address.
54
+ const links_in = (data, found = new Set()) => {
55
+ if (typeof data === 'string' && is_address(data)) {
56
+ add_link(data.trim(), found);
57
+ }
58
+ else if (Array.isArray(data)) {
59
+ data.forEach(d => links_in(d, found));
60
+ }
61
+ else if ((0, call_1.is_object)(data)) {
62
+ for (const [k, v] of Object.entries(data)) {
63
+ if (typeof v === 'string' && LINK_FIELDS.includes(k.toLowerCase())) {
64
+ add_link(v, found);
65
+ }
66
+ else {
67
+ links_in(v, found);
68
+ }
69
+ }
70
+ }
71
+ return found;
72
+ };
73
+ exports.links_in = links_in;
74
+ const redact_links = (text, secrets) => [...secrets].sort((a, b) => b.length - a.length).reduce((t, s) => t.split(s).join(LINK_REDACTED), text);
75
+ exports.redact_links = redact_links;
76
+ // curl -v style, as `reply api --verbose` writes it, with the answer's body after its headers.
77
+ const trace_lines = (a) => {
78
+ const lines = [];
79
+ if (a.request) {
80
+ lines.push(`> ${a.request.method} ${a.request.url}`);
81
+ for (const [k, v] of Object.entries(a.request.headers)) {
82
+ lines.push(`> ${k}: ${v}`);
83
+ }
84
+ if (a.request.body) {
85
+ lines.push('>', `> ${a.request.body}`);
86
+ }
87
+ }
88
+ lines.push(`< ${a.status}`);
89
+ for (const [k, v] of Object.entries(a.headers)) {
90
+ lines.push(`< ${k}: ${/cookie/i.test(k) ? output_1.REDACTED : v}`);
91
+ }
92
+ if (a.data !== null && a.data !== '') {
93
+ const shown = typeof a.data === 'string' ? a.data : JSON.stringify(a.data);
94
+ lines.push('<', `< ${shown}`);
95
+ }
96
+ return lines;
97
+ };
98
+ // One call of an account command. The links in its answer never reach the trace.
99
+ const account_call = async (s, g, method, path, kind, body) => {
100
+ const a = await (0, call_1.call_reply)(s, method, path, kind, body);
101
+ if (g.verbose) {
102
+ console.error(redact_links(trace_lines(a).join('\n'), links_in(a.data)));
103
+ }
104
+ return a;
105
+ };
106
+ exports.account_call = account_call;
107
+ // Reply's refusals of the account routes, each at the status Reply answers it with, under the CLI's
108
+ // code. Reply's own code always travels in reply_code; any other answer reads as every operation reads it.
109
+ const ACCOUNT_REFUSALS = {
110
+ 'emailAccount.notFound': {
111
+ status: 404, code: 'email_account.not_found', title: 'Reply has no email account by that id that this user can act on.',
112
+ },
113
+ 'emailAccount.limitReached': {
114
+ status: 409, code: 'email_account.limit_reached', title: 'The plan\'s email account limit is reached, so no link was made.',
115
+ },
116
+ 'emailAccount.noFreeMailboxSlots': {
117
+ status: 409, code: 'email_account.no_free_mailbox_slots', title: 'One more email account would need a paid seat, so no link was made.',
118
+ },
119
+ 'emailAccount.reconnectNotSupported': {
120
+ status: 400, code: 'email_account.reconnect_not_supported',
121
+ title: 'Only a Gmail or Office 365 single-click mailbox can be reconnected by link, so no link was made.',
122
+ },
123
+ 'linkedInAccount.notFound': {
124
+ status: 404, code: 'linkedin.account_not_found', title: 'Reply has no LinkedIn account by that id that this user can act on.',
125
+ },
126
+ 'linkedInAccount.limitReached': {
127
+ status: 409, code: 'linkedin.account_limit_reached', title: 'The plan has no room for another LinkedIn account, so no link was made.',
128
+ },
129
+ 'linkedInAccount.accountInUse': {
130
+ status: 409, code: 'linkedin.account_in_use', title: 'Sequences use the LinkedIn account, so it was not deleted; --force deletes it anyway.',
131
+ },
132
+ 'linkedInAccount.cookieInvalid': {
133
+ status: 400, code: 'linkedin.invalid_cookie', title: 'The LinkedIn account\'s session is no longer valid; reconnect the account.',
134
+ },
135
+ };
136
+ exports.ACCOUNT_REFUSALS = ACCOUNT_REFUSALS;
137
+ const account_refusal = (a, kind) => {
138
+ const reply_code = (0, call_1.reply_code_of)(a);
139
+ const known = reply_code === undefined ? undefined : ACCOUNT_REFUSALS[reply_code];
140
+ if (known === undefined || known.status !== a.status) {
141
+ return (0, call_1.refusal)(a, kind);
142
+ }
143
+ return new errors_1.Operation_error(known.code, known.title, { status: a.status, reply_code, detail: (0, call_1.detail_of)(a) });
144
+ };
145
+ exports.account_refusal = account_refusal;
146
+ // A route this Reply does not have answers 404 with no code of Reply's; one it has answers its own.
147
+ const route_missing = (a) => a.status === 404 && (0, call_1.reply_code_of)(a) === undefined;
148
+ exports.route_missing = route_missing;
149
+ //# sourceMappingURL=account-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-call.js","sourceRoot":"","sources":["../../src/operations/account-call.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,4CAAgD;AAChD,iCAA8G;AAI9G,sGAAsG;AACtG,uGAAuG;AACvG,sCAAsC;AAEtC,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAiKhC,sCAAa;AA/JrB,wDAAwD;AACxD,MAAM,WAAW,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAEvC,6EAA6E;AAC7E,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,oBAA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AHtE,oGAAoG;AACpG,MAAM,aAAa,GAAG,CAAC,CAAS,EAAU,EAAE,CAAA,CAAC,CAAC,MAAM,KAAK,GAAG,IAAI,IAAA,oBAAa,EAAC,CAAC,CAAC,KAAK,SAAS,CAAC;AAEvB,sCAAa"}
@@ -0,0 +1,14 @@
1
+ import { type Op_globals } from './options';
2
+ import type { Cli_context } from '../context';
3
+ type Link_opts = {
4
+ channel?: string;
5
+ provider?: string;
6
+ name?: string;
7
+ allowSharedPage?: boolean;
8
+ };
9
+ declare const handle_account_connect: (opts: Link_opts, ctx: Cli_context, g: Op_globals) => Promise<void>;
10
+ declare const handle_account_reconnect: (id_arg: string, opts: Link_opts, ctx: Cli_context, g: Op_globals) => Promise<void>;
11
+ declare const handle_account_pending: (opts: {
12
+ channel?: string;
13
+ }, ctx: Cli_context, g: Op_globals) => Promise<void>;
14
+ export { handle_account_connect, handle_account_reconnect, handle_account_pending };
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handle_account_pending = exports.handle_account_reconnect = exports.handle_account_connect = void 0;
4
+ const errors_1 = require("../utils/errors");
5
+ const call_1 = require("./call");
6
+ const account_call_1 = require("./account-call");
7
+ const accounts_1 = require("./accounts");
8
+ const options_1 = require("./options");
9
+ const result_1 = require("./result");
10
+ // connect, reconnect and pending. A link is a credential for whoever opens it: it is printed once, in the
11
+ // stdout field `link`, and nowhere else (see account-call.ts for the trace).
12
+ // The providers a one-mailbox email link is made for.
13
+ const EMAIL_PROVIDERS = ['gmail', 'office365'];
14
+ const EMAIL_NAME_MAX = 100; // Reply's limit on a connection link's label
15
+ // A Reply without one-mailbox email links: its route answers 404 with no code of Reply's own. Nothing else is offered.
16
+ const email_link_not_available = () => new errors_1.Operation_error('email_link.not_available', 'This Reply does not issue one-mailbox email connection links, so no link was made.', { status: 404 });
17
+ const text_or_null = (v) => (typeof v === 'string' && v.trim() !== '' ? v : null);
18
+ const positive_or_null = (v) => (typeof v === 'number' && Number.isSafeInteger(v) && v > 0 ? v : null);
19
+ // The link of a v3 answer, or an unreadable answer: the write was made, so a link Reply did not give back
20
+ // means one may exist that nobody holds.
21
+ const link_of = (a) => {
22
+ if (!(0, call_1.is_object)(a.data) || typeof a.data.connectionLink !== 'string' || a.data.connectionLink === '') {
23
+ throw (0, call_1.unreadable)(a, 'write');
24
+ }
25
+ return { link: a.data.connectionLink, body: a.data };
26
+ };
27
+ const connection_link = (channel, kind, a, id) => {
28
+ const { link, body } = link_of(a);
29
+ return {
30
+ channel, ...(id === undefined ? {} : { id }), link,
31
+ expires_at: text_or_null(body.expiresAtUtc), pending_id: positive_or_null(body.pendingAccountId),
32
+ kind, link_kind: 'connection_link',
33
+ };
34
+ };
35
+ const parse_provider = (raw) => (0, options_1.parse_choice)(raw, '--provider', EMAIL_PROVIDERS);
36
+ const email_only = (opts) => {
37
+ if (opts.provider !== undefined) {
38
+ throw new errors_1.UsageError('--provider applies to --channel email only.', { code: 'usage.channel' });
39
+ }
40
+ };
41
+ const connect_linkedin = async (s, g, name) => {
42
+ // connection-link, not connect: it makes a pending entry, so the attempt can be listed and revoked.
43
+ const a = await (0, account_call_1.account_call)(s, g, 'POST', '/v3/linkedin-accounts/connection-link', 'write', { name });
44
+ if (a.status !== 201 && a.status !== 200) {
45
+ throw (0, account_call_1.account_refusal)(a, 'write');
46
+ }
47
+ return connection_link('linkedin', 'connect', a);
48
+ };
49
+ const connect_email = async (s, g, provider, name) => {
50
+ const a = await (0, account_call_1.account_call)(s, g, 'POST', '/v3/email-accounts/connection-link', 'write', { provider, ...(name === undefined ? {} : { name }) });
51
+ if (a.status === 201 || a.status === 200) {
52
+ return connection_link('email', 'connect', a);
53
+ }
54
+ throw (0, account_call_1.route_missing)(a) ? email_link_not_available() : (0, account_call_1.account_refusal)(a, 'write');
55
+ };
56
+ const handle_account_connect = async (opts, ctx, g) => {
57
+ const channel = (0, accounts_1.require_channel)(opts.channel);
58
+ const name = opts.name?.trim() === '' ? undefined : opts.name?.trim();
59
+ if (channel === 'linkedin') {
60
+ email_only(opts);
61
+ if (name === undefined) {
62
+ throw new errors_1.UsageError('--name is required for a LinkedIn connection link: Reply lists the pending account under it.', {
63
+ code: 'usage.name',
64
+ });
65
+ }
66
+ const s = await (0, call_1.open_session)(ctx, g);
67
+ (0, result_1.print_result)(await connect_linkedin(s, g, name), g);
68
+ return;
69
+ }
70
+ const provider = parse_provider(opts.provider);
71
+ if (name !== undefined && name.length > EMAIL_NAME_MAX) {
72
+ throw new errors_1.UsageError(`--name must be at most ${EMAIL_NAME_MAX} characters.`, { code: 'usage.name' });
73
+ }
74
+ if (provider === undefined) {
75
+ throw new errors_1.UsageError('--provider is required for an email connection link: gmail or office365.', { code: 'usage.provider' });
76
+ }
77
+ const s = await (0, call_1.open_session)(ctx, g);
78
+ (0, result_1.print_result)(await connect_email(s, g, provider, name), g);
79
+ };
80
+ exports.handle_account_connect = handle_account_connect;
81
+ const handle_account_reconnect = async (id_arg, opts, ctx, g) => {
82
+ const channel = (0, accounts_1.require_channel)(opts.channel);
83
+ if (opts.name !== undefined) {
84
+ throw new errors_1.UsageError('--name applies to account connect only.', { code: 'usage.name' });
85
+ }
86
+ if (channel === 'linkedin') {
87
+ email_only(opts);
88
+ const id = (0, options_1.parse_id)(id_arg, 'LinkedIn account id');
89
+ const s = await (0, call_1.open_session)(ctx, g);
90
+ const a = await (0, account_call_1.account_call)(s, g, 'POST', `/v3/linkedin-accounts/${id}/reconnect`, 'write');
91
+ if (a.status !== 200) {
92
+ throw (0, account_call_1.account_refusal)(a, 'write');
93
+ }
94
+ (0, result_1.print_result)(connection_link('linkedin', 'reconnect', a, id), g);
95
+ return;
96
+ }
97
+ const id = (0, options_1.parse_id)(id_arg, 'Email account id', options_1.LARGEST_SAFE_ID);
98
+ const s = await (0, call_1.open_session)(ctx, g);
99
+ // Reply takes the provider from the mailbox itself.
100
+ const a = await (0, account_call_1.account_call)(s, g, 'POST', `/v3/email-accounts/${id}/reconnect`, 'write');
101
+ if (a.status === 200 || a.status === 201) {
102
+ (0, result_1.print_result)(connection_link('email', 'reconnect', a, id), g);
103
+ return;
104
+ }
105
+ throw (0, account_call_1.route_missing)(a) ? email_link_not_available() : (0, account_call_1.account_refusal)(a, 'write');
106
+ };
107
+ exports.handle_account_reconnect = handle_account_reconnect;
108
+ const pending_items = (a, channel) => {
109
+ if (!Array.isArray(a.data)) {
110
+ throw (0, call_1.unreadable)(a, 'read');
111
+ }
112
+ return a.data.map(entry => {
113
+ if (!(0, call_1.is_object)(entry) || positive_or_null(entry.id) === null) {
114
+ throw new errors_1.Operation_error('reply.unavailable', 'Reply listed a pending account without a usable id.', { status: a.status });
115
+ }
116
+ // A pending LinkedIn account is always a connect, and its link is not kept: it is a credential.
117
+ const kind = channel === 'linkedin' ? 'connect' : (entry.kind === 'connect' || entry.kind === 'reconnect' ? entry.kind : null);
118
+ return {
119
+ channel, id: entry.id, name: text_or_null(entry.name), kind,
120
+ account_id: channel === 'email' ? positive_or_null(entry.emailAccountId) : null,
121
+ expires_at: text_or_null(entry.expiresAtUtc), expired: typeof entry.isExpired === 'boolean' ? entry.isExpired : null,
122
+ };
123
+ });
124
+ };
125
+ const handle_account_pending = async (opts, ctx, g) => {
126
+ const only = (0, options_1.parse_choice)(opts.channel, '--channel', accounts_1.ACCOUNT_CHANNELS);
127
+ const s = await (0, call_1.open_session)(ctx, g);
128
+ const items = [];
129
+ if (only !== 'linkedin') {
130
+ const a = await (0, account_call_1.account_call)(s, g, 'GET', '/v3/email-accounts/pending', 'read');
131
+ if (a.status !== 200) {
132
+ throw (0, account_call_1.route_missing)(a) ? email_link_not_available() : (0, account_call_1.account_refusal)(a, 'read');
133
+ }
134
+ items.push(...pending_items(a, 'email'));
135
+ }
136
+ if (only !== 'email') {
137
+ const a = await (0, account_call_1.account_call)(s, g, 'GET', '/v3/linkedin-accounts/pending', 'read');
138
+ if (a.status !== 200) {
139
+ throw (0, account_call_1.account_refusal)(a, 'read');
140
+ }
141
+ items.push(...pending_items(a, 'linkedin'));
142
+ }
143
+ // supported and unsupported_channels are kept so a caller that reads them reads what it always read; a Reply
144
+ // without one-mailbox email links is refused above, so every channel listed is supported.
145
+ (0, result_1.print_result)({ items, supported: true, unsupported_channels: [] }, g);
146
+ };
147
+ exports.handle_account_pending = handle_account_pending;
148
+ //# sourceMappingURL=account-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-links.js","sourceRoot":"","sources":["../../src/operations/account-links.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAC5D,iCAAyF;AACzF,iDAA4E;AAC5E,yCAAmF;AACnF,uCAAmF;AACnF,qCAAsC;AAGtC,0GAA0G;AAC1G,6EAA6E;AAE7E,sDAAsD;AACtD,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,WAAW,CAAU,CAAC;AAaxD,MAAM,cAAc,GAAG,GAAG,CAAC,CAAK,6CAA6C;AAE7E,uHAAuH;AACvH,MAAM,wBAAwB,GAAG,GAAmB,EAAE,CAAA,IAAI,wBAAe,CAAC,0BAA0B,EAChG,oFAAoF,EAAE,EAAC,MAAM,EAAE,GAAG,EAAC,CAAC,CAAC;AAEzG,MAAM,YAAY,GAAG,CAAC,CAAU,EAAgB,EAAE,CAAA,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACxG,MAAM,gBAAgB,GAAG,CAAC,CAAU,EAAgB,EAAE,CAAA,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE7H,0GAA0G;AAC1G,yCAAyC;AACzC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAgD,EAAE;IACxE,IAAI,CAAC,IAAA,gBAAS,E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ACG,MAAM,CAAC,GAAG,MAAM,IAAA,2BAAY,EAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,+BAA+B,EAAE,MAAM,CAAC,CAAC;QACnF,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,EACpB,CAAC;YACG,MAAM,IAAA,8BAAe,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;IAChD,CAAC;IACD,6GAA6G;IAC7G,0FAA0F;IAC1F,IAAA,qBAAY,EAAC,EAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,EAAE,EAAC,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC;AAEwD,wDAAsB"}
@@ -0,0 +1,20 @@
1
+ import { type Op_globals } from './options';
2
+ import type { Cli_context } from '../context';
3
+ declare const handle_account_limits: (id_arg: string, opts: {
4
+ channel?: string;
5
+ daily?: string;
6
+ set?: string;
7
+ }, ctx: Cli_context, g: Op_globals) => Promise<void>;
8
+ declare const handle_account_pause: (id_arg: string, opts: {
9
+ channel?: string;
10
+ }, ctx: Cli_context, g: Op_globals) => Promise<void>;
11
+ declare const handle_account_resume: (id_arg: string, opts: {
12
+ channel?: string;
13
+ }, ctx: Cli_context, g: Op_globals) => Promise<void>;
14
+ declare const handle_account_unblock: (id_arg: string, ctx: Cli_context, g: Op_globals) => Promise<void>;
15
+ declare const handle_account_delete: (id_arg: string, opts: {
16
+ channel?: string;
17
+ yes?: boolean;
18
+ force?: boolean;
19
+ }, ctx: Cli_context, g: Op_globals) => Promise<void>;
20
+ export { handle_account_limits, handle_account_pause, handle_account_resume, handle_account_unblock, handle_account_delete };