@curviate/cli 0.51.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +2 -2
  3. package/dist/{account-74N7HFFI.js → account-24YCNFNY.js} +9 -9
  4. package/dist/{analytics-CZ372NIV.js → analytics-RMRTJPHK.js} +6 -6
  5. package/dist/{beta-consent-6EY7JWUB.js → beta-consent-KCJUJFAR.js} +5 -5
  6. package/dist/{billing-LJGAAL4W.js → billing-5GK6WIXR.js} +6 -6
  7. package/dist/{chunk-3OYS3NWV.js → chunk-4YGTPVEH.js} +1 -1
  8. package/dist/{chunk-PHKICMO7.js → chunk-62YAYAUI.js} +6 -0
  9. package/dist/{contact-import-PAMRJ6MU.js → chunk-AA2UTHCS.js} +84 -25
  10. package/dist/{chunk-FBBZVIFJ.js → chunk-AQVE6HO5.js} +1 -1
  11. package/dist/{chunk-7AR2OA67.js → chunk-FNENKSJ7.js} +12 -12
  12. package/dist/{chunk-XDG3TOKG.js → chunk-FUX3BRYP.js} +2 -1
  13. package/dist/{chunk-7OUGD5DH.js → chunk-IRKTIZUM.js} +2 -2
  14. package/dist/{chunk-6SBO4WXA.js → chunk-N4IYTFIY.js} +1 -1
  15. package/dist/{chunk-DAFE2MTF.js → chunk-PAXWRJNA.js} +1 -1
  16. package/dist/{chunk-RYWWSZUH.js → chunk-QLKGOIWS.js} +2 -2
  17. package/dist/{chunk-A6UJU6ZW.js → chunk-R5VJTBAJ.js} +19 -10
  18. package/dist/{chunk-ERHJZL7A.js → chunk-TIYRNMGW.js} +3 -3
  19. package/dist/{chunk-BKQZDNXH.js → chunk-WY73KWPF.js} +1 -1
  20. package/dist/{chunk-AUHGVZCD.js → chunk-WYFTBTDQ.js} +5 -5
  21. package/dist/{chunk-3RRINPLF.js → chunk-YHXIFKCU.js} +29 -3
  22. package/dist/cli.js +25 -25
  23. package/dist/{comment-OWNTXKTR.js → comment-UUA7B5YC.js} +6 -6
  24. package/dist/{company-F5Z5Q3YA.js → company-65ILSE2U.js} +7 -7
  25. package/dist/{config-GIU3SIIY.js → config-TMFMXS7T.js} +3 -3
  26. package/dist/{connect-BZY5AA3I.js → connect-URFFJVYY.js} +7 -7
  27. package/dist/{contact-EXEJDG7S.js → contact-A3S2HEBM.js} +8 -8
  28. package/dist/{contact-groups-RQZQCFHI.js → contact-groups-CEV2YITT.js} +13 -12
  29. package/dist/contact-import-HHVKVRJW.js +35 -0
  30. package/dist/core-IOGPY6HS.js +46 -0
  31. package/dist/do-not-contact-QYPADRLJ.js +360 -0
  32. package/dist/{doctor-BLUHL4YW.js → doctor-M7JVNQPQ.js} +4 -4
  33. package/dist/{document-RXBOZG6M.js → document-MDE2WJYX.js} +1 -1
  34. package/dist/{draft-5ULT2UFJ.js → draft-6KY4F5AE.js} +6 -6
  35. package/dist/{enrollment-WF5DDULC.js → enrollment-IXQD5IGZ.js} +6 -6
  36. package/dist/{examples-ICAGL2S5.js → examples-KAMXHRLE.js} +1 -1
  37. package/dist/{export-CF7IAMYC.js → export-7ILY53LY.js} +5 -5
  38. package/dist/{feed-PR43TIM3.js → feed-GESAX65K.js} +5 -5
  39. package/dist/{group-W5QAQJBZ.js → group-KKTBXE42.js} +5 -5
  40. package/dist/{inbox-NO3RDC4U.js → inbox-QQ6AQDVB.js} +5 -5
  41. package/dist/{inboxes-PN26B6SL.js → inboxes-352YK6UB.js} +5 -5
  42. package/dist/{incoming-DYYCNX46.js → incoming-5T2ELEDF.js} +6 -6
  43. package/dist/{job-V67373SG.js → job-KBILRJJO.js} +6 -6
  44. package/dist/{login-K3IGFVZY.js → login-DQPKKDVA.js} +3 -3
  45. package/dist/{message-AIVMYHV5.js → message-ZB2IGJIQ.js} +6 -6
  46. package/dist/{motion-UXH422PR.js → motion-NNCRSOT6.js} +17 -13
  47. package/dist/{network-376YFM33.js → network-FLPECF4C.js} +6 -6
  48. package/dist/{notification-BAKHCJTV.js → notification-B3MRXH3A.js} +5 -5
  49. package/dist/{notifications-7HJSOQEK.js → notifications-PMJDG45H.js} +6 -6
  50. package/dist/{post-RBHNLWAM.js → post-O5DYXSHK.js} +6 -6
  51. package/dist/{profile-RDNIILT7.js → profile-ZDP23SNN.js} +7 -7
  52. package/dist/{recruiter-HX45CHBT.js → recruiter-QENVOZFV.js} +8 -8
  53. package/dist/{sales-nav-SIMRRJV7.js → sales-nav-JFAYF6DM.js} +7 -7
  54. package/dist/{search-ARMOCEYV.js → search-5HPVIIUJ.js} +8 -8
  55. package/dist/{setup-DVFWTM6J.js → setup-QUD7TUCB.js} +4 -4
  56. package/dist/{team-X6EMJ3EH.js → team-ZTGY45Y7.js} +6 -6
  57. package/dist/{tier-4VDJ3OEO.js → tier-3ISVHJJ5.js} +5 -5
  58. package/dist/{unibox-XGOS5YIJ.js → unibox-JQBP7COE.js} +8 -7
  59. package/dist/{webhook-3QYAOV7E.js → webhook-GPGFPF5P.js} +6 -6
  60. package/package.json +2 -2
  61. package/dist/core-F3RQLZFP.js +0 -46
  62. package/dist/do-not-contact-UWJRNFHH.js +0 -200
@@ -3,7 +3,7 @@ import {
3
3
  DEFAULT_FILTER_READERS,
4
4
  assembleFilters,
5
5
  splitCsv
6
- } from "./chunk-6SBO4WXA.js";
6
+ } from "./chunk-N4IYTFIY.js";
7
7
  import {
8
8
  slimSearchCompanies,
9
9
  slimSearchCompaniesItem,
@@ -13,10 +13,10 @@ import {
13
13
  slimSearchPeopleItem,
14
14
  slimSearchPosts,
15
15
  slimSearchPostsItem
16
- } from "./chunk-XDG3TOKG.js";
16
+ } from "./chunk-FUX3BRYP.js";
17
17
  import {
18
18
  requireAccount
19
- } from "./chunk-7OUGD5DH.js";
19
+ } from "./chunk-IRKTIZUM.js";
20
20
  import {
21
21
  intFlag,
22
22
  intListFlag
@@ -28,7 +28,7 @@ import {
28
28
  readablePage,
29
29
  rejectPaginationModifiersWithoutAll,
30
30
  streamAll
31
- } from "./chunk-DAFE2MTF.js";
31
+ } from "./chunk-PAXWRJNA.js";
32
32
  import {
33
33
  renderError,
34
34
  renderSuccess,
@@ -38,15 +38,15 @@ import {
38
38
  import {
39
39
  createClient,
40
40
  resolveEffectiveConfig
41
- } from "./chunk-3RRINPLF.js";
41
+ } from "./chunk-YHXIFKCU.js";
42
42
  import {
43
43
  GLOBAL_FLAGS,
44
44
  readOnly
45
- } from "./chunk-RYWWSZUH.js";
45
+ } from "./chunk-QLKGOIWS.js";
46
46
  import {
47
47
  DESCRIPTIONS
48
- } from "./chunk-FBBZVIFJ.js";
49
- import "./chunk-PHKICMO7.js";
48
+ } from "./chunk-AQVE6HO5.js";
49
+ import "./chunk-62YAYAUI.js";
50
50
  import "./chunk-FDJMAF7D.js";
51
51
  import "./chunk-ZYURL5VK.js";
52
52
  import "./chunk-QW5K5DTC.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-DAFE2MTF.js";
4
+ } from "./chunk-PAXWRJNA.js";
5
5
  import "./chunk-QM57YDJE.js";
6
6
  import {
7
7
  readlineSync
@@ -12,14 +12,14 @@ import {
12
12
  isPlainObject,
13
13
  resolveEffectiveConfig,
14
14
  writeProfile
15
- } from "./chunk-3RRINPLF.js";
15
+ } from "./chunk-YHXIFKCU.js";
16
16
  import {
17
17
  GLOBAL_FLAGS,
18
18
  getTeamFlag
19
- } from "./chunk-RYWWSZUH.js";
19
+ } from "./chunk-QLKGOIWS.js";
20
20
  import {
21
21
  DESCRIPTIONS
22
- } from "./chunk-FBBZVIFJ.js";
22
+ } from "./chunk-AQVE6HO5.js";
23
23
  import {
24
24
  defaultReadStdin,
25
25
  isStdinToken,
@@ -5,7 +5,7 @@ import {
5
5
  outputOpts,
6
6
  rootClient,
7
7
  usage
8
- } from "./chunk-BKQZDNXH.js";
8
+ } from "./chunk-WY73KWPF.js";
9
9
  import {
10
10
  buildPreviewOutput
11
11
  } from "./chunk-TCUYH5GO.js";
@@ -20,7 +20,7 @@ import {
20
20
  readablePage,
21
21
  rejectPaginationModifiersWithoutAll,
22
22
  streamAll
23
- } from "./chunk-DAFE2MTF.js";
23
+ } from "./chunk-PAXWRJNA.js";
24
24
  import {
25
25
  renderSuccess,
26
26
  writeNdjsonItem
@@ -30,16 +30,16 @@ import {
30
30
  readConfig,
31
31
  resolveEffectiveConfig,
32
32
  writeProfile
33
- } from "./chunk-3RRINPLF.js";
33
+ } from "./chunk-YHXIFKCU.js";
34
34
  import {
35
35
  GLOBAL_FLAGS,
36
36
  READ_SINGLE_FLAGS,
37
37
  WRITE_SINGLE_FLAGS,
38
38
  readOnly
39
- } from "./chunk-RYWWSZUH.js";
39
+ } from "./chunk-QLKGOIWS.js";
40
40
  import {
41
41
  DESCRIPTIONS
42
- } from "./chunk-FBBZVIFJ.js";
42
+ } from "./chunk-AQVE6HO5.js";
43
43
  import "./chunk-ZYURL5VK.js";
44
44
 
45
45
  // src/commands/team.ts
@@ -441,7 +441,7 @@ var teamCommand = defineCommand({
441
441
  seats: seatsCmd
442
442
  },
443
443
  async run() {
444
- const { showHelp } = await import("./examples-ICAGL2S5.js");
444
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
445
445
  await showHelp(teamCommand, ["curviate", "team"]);
446
446
  }
447
447
  });
@@ -3,21 +3,21 @@ import {
3
3
  fail,
4
4
  outputOpts,
5
5
  rootClient
6
- } from "./chunk-BKQZDNXH.js";
6
+ } from "./chunk-WY73KWPF.js";
7
7
  import {
8
8
  readableObject
9
- } from "./chunk-DAFE2MTF.js";
9
+ } from "./chunk-PAXWRJNA.js";
10
10
  import {
11
11
  renderSuccess
12
12
  } from "./chunk-QM57YDJE.js";
13
- import "./chunk-3RRINPLF.js";
13
+ import "./chunk-YHXIFKCU.js";
14
14
  import {
15
15
  READ_SINGLE_FLAGS,
16
16
  readOnly
17
- } from "./chunk-RYWWSZUH.js";
17
+ } from "./chunk-QLKGOIWS.js";
18
18
  import {
19
19
  DESCRIPTIONS
20
- } from "./chunk-FBBZVIFJ.js";
20
+ } from "./chunk-AQVE6HO5.js";
21
21
  import "./chunk-ZYURL5VK.js";
22
22
 
23
23
  // src/commands/tier.ts
@@ -9,7 +9,7 @@ import {
9
9
  outputOpts,
10
10
  rootClient,
11
11
  usage
12
- } from "./chunk-BKQZDNXH.js";
12
+ } from "./chunk-WY73KWPF.js";
13
13
  import {
14
14
  buildPreviewOutput
15
15
  } from "./chunk-TCUYH5GO.js";
@@ -23,20 +23,20 @@ import {
23
23
  readablePage,
24
24
  rejectPaginationModifiersWithoutAll,
25
25
  streamAll
26
- } from "./chunk-DAFE2MTF.js";
26
+ } from "./chunk-PAXWRJNA.js";
27
27
  import {
28
28
  renderSuccess,
29
29
  writeNdjsonItem
30
30
  } from "./chunk-QM57YDJE.js";
31
- import "./chunk-3RRINPLF.js";
31
+ import "./chunk-YHXIFKCU.js";
32
32
  import {
33
33
  GLOBAL_FLAGS,
34
34
  WRITE_SINGLE_FLAGS,
35
35
  readOnly
36
- } from "./chunk-RYWWSZUH.js";
36
+ } from "./chunk-QLKGOIWS.js";
37
37
  import {
38
38
  DESCRIPTIONS
39
- } from "./chunk-FBBZVIFJ.js";
39
+ } from "./chunk-AQVE6HO5.js";
40
40
  import "./chunk-ZYURL5VK.js";
41
41
 
42
42
  // src/commands/unibox.ts
@@ -208,6 +208,7 @@ var listCmd = defineCommand({
208
208
  },
209
209
  args: {
210
210
  ...readOnly(GLOBAL_FLAGS),
211
+ limit: { ...GLOBAL_FLAGS.limit, description: "Chats per page (1 to 100)." },
211
212
  accounts: ACCOUNTS,
212
213
  motion: { type: "string", description: "Only chats linked to these Motions (mot_...), repeatable or a comma list; `none` for chats no Motion links." },
213
214
  person: { type: "string", description: "Only chats with this person: a Contact id (con_...) or a LinkedIn id (ACo...)." },
@@ -248,7 +249,7 @@ var messagesCmd = defineCommand({
248
249
  seeAlso: ["curviate core inbox messages"],
249
250
  examples: ["curviate unibox messages acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID", "curviate unibox messages acc_YOUR_ACCOUNT_ID YOUR_CHAT_ID --all"]
250
251
  },
251
- args: { ...readOnly(GLOBAL_FLAGS), accountId: ACCOUNT, chatId: CHAT },
252
+ args: { ...readOnly(GLOBAL_FLAGS), limit: { ...GLOBAL_FLAGS.limit, description: "Messages per page (1 to 25; more than 25 is refused with exit 2). --all pages on." }, accountId: ACCOUNT, chatId: CHAT },
252
253
  run: online(runMessages)
253
254
  });
254
255
  var replyCmd = defineCommand({
@@ -400,7 +401,7 @@ var uniboxCommand = defineCommand({
400
401
  consent: consentCmd
401
402
  },
402
403
  async run() {
403
- const { showHelp } = await import("./examples-ICAGL2S5.js");
404
+ const { showHelp } = await import("./examples-KAMXHRLE.js");
404
405
  await showHelp(uniboxCommand, ["curviate", "unibox"]);
405
406
  }
406
407
  });
@@ -5,7 +5,7 @@ import {
5
5
  outputOpts,
6
6
  rootClient,
7
7
  usage
8
- } from "./chunk-BKQZDNXH.js";
8
+ } from "./chunk-WY73KWPF.js";
9
9
  import {
10
10
  buildPreviewOutput
11
11
  } from "./chunk-TCUYH5GO.js";
@@ -20,7 +20,7 @@ import {
20
20
  readablePage,
21
21
  rejectPaginationModifiersWithoutAll,
22
22
  streamAll
23
- } from "./chunk-DAFE2MTF.js";
23
+ } from "./chunk-PAXWRJNA.js";
24
24
  import {
25
25
  renderError,
26
26
  renderSuccess,
@@ -30,19 +30,19 @@ import {
30
30
  import {
31
31
  createClient,
32
32
  resolveEffectiveConfig
33
- } from "./chunk-3RRINPLF.js";
33
+ } from "./chunk-YHXIFKCU.js";
34
34
  import {
35
35
  GLOBAL_FLAGS,
36
36
  READ_SINGLE_FLAGS,
37
37
  WRITE_SINGLE_FLAGS,
38
38
  readOnly
39
- } from "./chunk-RYWWSZUH.js";
39
+ } from "./chunk-QLKGOIWS.js";
40
40
  import {
41
41
  DESCRIPTIONS
42
- } from "./chunk-FBBZVIFJ.js";
42
+ } from "./chunk-AQVE6HO5.js";
43
43
  import {
44
44
  readFileFlag
45
- } from "./chunk-PHKICMO7.js";
45
+ } from "./chunk-62YAYAUI.js";
46
46
  import "./chunk-FDJMAF7D.js";
47
47
  import {
48
48
  isStdinToken
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.51.0",
3
+ "version": "0.53.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "clean": "rm -rf dist *.tsbuildinfo"
48
48
  },
49
49
  "dependencies": {
50
- "@curviate/sdk": "0.46.0",
50
+ "@curviate/sdk": "0.49.0",
51
51
  "citty": "^0.1.6",
52
52
  "open": "^10.1.0"
53
53
  },
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- DESCRIPTIONS,
4
- lazy
5
- } from "./chunk-FBBZVIFJ.js";
6
-
7
- // src/commands/core.ts
8
- import { defineCommand } from "citty";
9
- var coreCommand = defineCommand({
10
- meta: {
11
- name: "core",
12
- description: DESCRIPTIONS.core,
13
- rules: {
14
- notes: [
15
- "Writes reach LinkedIn immediately and are seen by the people they touch.",
16
- "A retry after a timeout can repeat a write: requests carry no idempotency key. Read the current state before retrying.",
17
- "Budget rows, ceilings and what is left: `curviate account get <account_id>`."
18
- ]
19
- }
20
- },
21
- subCommands: {
22
- profile: lazy("profile", () => import("./profile-RDNIILT7.js").then((m) => m.profileCommand)),
23
- company: lazy("company", () => import("./company-F5Z5Q3YA.js").then((m) => m.companyCommand)),
24
- job: lazy("job", () => import("./job-V67373SG.js").then((m) => m.jobCommand)),
25
- connect: lazy("connect", () => import("./connect-BZY5AA3I.js").then((m) => m.connectCommand)),
26
- search: lazy("search", () => import("./search-ARMOCEYV.js").then((m) => m.searchCommand)),
27
- inbox: lazy("inbox", () => import("./inbox-NO3RDC4U.js").then((m) => m.inboxCommand)),
28
- inboxes: lazy("inboxes", () => import("./inboxes-PN26B6SL.js").then((m) => m.inboxesCommand)),
29
- message: lazy("message", () => import("./message-AIVMYHV5.js").then((m) => m.messageCommand)),
30
- post: lazy("post", () => import("./post-RBHNLWAM.js").then((m) => m.postCommand)),
31
- comment: lazy("comment", () => import("./comment-OWNTXKTR.js").then((m) => m.commentCommand)),
32
- "sales-nav": lazy("sales-nav", () => import("./sales-nav-SIMRRJV7.js").then((m) => m.salesNavCommand)),
33
- recruiter: lazy("recruiter", () => import("./recruiter-HX45CHBT.js").then((m) => m.recruiterCommand)),
34
- group: lazy("group", () => import("./group-W5QAQJBZ.js").then((m) => m.groupCommand)),
35
- feed: lazy("feed", () => import("./feed-PR43TIM3.js").then((m) => m.feedCommand)),
36
- notification: lazy("coreNotification", () => import("./notification-BAKHCJTV.js").then((m) => m.notificationCommand)),
37
- draft: lazy("draft", () => import("./draft-5ULT2UFJ.js").then((m) => m.draftCommand))
38
- },
39
- async run() {
40
- const { showHelp } = await import("./examples-ICAGL2S5.js");
41
- await showHelp(coreCommand, ["curviate", "core"]);
42
- }
43
- });
44
- export {
45
- coreCommand
46
- };
@@ -1,200 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- fail,
4
- outputOpts,
5
- rootClient,
6
- usage
7
- } from "./chunk-BKQZDNXH.js";
8
- import {
9
- buildPreviewOutput
10
- } from "./chunk-TCUYH5GO.js";
11
- import {
12
- intFlag
13
- } from "./chunk-NNV2OYEF.js";
14
- import {
15
- pageDelayFromFlags,
16
- readCursorFlag,
17
- readMaxPagesFlag,
18
- readableObject,
19
- readablePage,
20
- rejectPaginationModifiersWithoutAll,
21
- streamAll
22
- } from "./chunk-DAFE2MTF.js";
23
- import {
24
- renderSuccess,
25
- writeNdjsonItem
26
- } from "./chunk-QM57YDJE.js";
27
- import "./chunk-3RRINPLF.js";
28
- import {
29
- GLOBAL_FLAGS,
30
- READ_SINGLE_FLAGS,
31
- WRITE_SINGLE_FLAGS,
32
- readOnly
33
- } from "./chunk-RYWWSZUH.js";
34
- import {
35
- DESCRIPTIONS
36
- } from "./chunk-FBBZVIFJ.js";
37
- import "./chunk-ZYURL5VK.js";
38
-
39
- // src/commands/do-not-contact.ts
40
- import { defineCommand } from "citty";
41
- var REASONS = ["asked_to_stop", "existing_customer", "competitor", "partner", "employee", "other"];
42
- var online = (fn) => async ({ args }) => {
43
- const f = args;
44
- await fn(await rootClient(f), f);
45
- };
46
- var preview = (method, args, body = {}) => void process.stdout.write(JSON.stringify(buildPreviewOutput({ method, args, body })) + "\n");
47
- var reason = (f, requiredFlag) => {
48
- if (f.reason === void 0) return requiredFlag ? usage(`--reason is required: one of ${REASONS.join(", ")}.`) : void 0;
49
- if (!REASONS.includes(f.reason)) usage(`--reason takes one of ${REASONS.join(", ")}.`);
50
- return f.reason;
51
- };
52
- async function runList(c, f) {
53
- rejectPaginationModifiersWithoutAll(f, process);
54
- const params = {};
55
- if (f.query !== void 0) {
56
- if (f.query.trim() === "") usage("--query was given an empty value.");
57
- params["q"] = f.query;
58
- }
59
- if (f.limit !== void 0) params["limit"] = intFlag("limit", f.limit, 1, 100);
60
- const cursor = readCursorFlag(f, process);
61
- if (cursor) params["cursor"] = cursor;
62
- try {
63
- if (f.all) {
64
- const page = (p) => c.doNotContact.list(p);
65
- for await (const item of streamAll(page, params, { maxPages: readMaxPagesFlag(f, process), out: process, pageDelayMs: pageDelayFromFlags(f) })) writeNdjsonItem(process, item, f.fields);
66
- } else {
67
- renderSuccess(readablePage(await c.doNotContact.list(params)), outputOpts(f), process);
68
- }
69
- } catch (err) {
70
- await fail(err, f);
71
- }
72
- }
73
- async function runGet(c, f) {
74
- try {
75
- renderSuccess(readableObject(await c.doNotContact.get(String(f.id ?? ""))), outputOpts(f), process);
76
- } catch (err) {
77
- await fail(err, f);
78
- }
79
- }
80
- async function runAdd(c, f) {
81
- if (f.contact === void 0 === (f["linkedin-url"] === void 0)) usage("name the person with exactly one of --contact (con_...) or --linkedin-url.");
82
- for (const [flag, v] of [["contact", f.contact], ["linkedin-url", f["linkedin-url"]]]) if (v !== void 0 && v.trim() === "") usage(`--${flag} was given an empty value.`);
83
- const body = f.contact !== void 0 ? { contact_id: f.contact } : { linkedin_url: f["linkedin-url"] };
84
- const why = reason(f, false);
85
- if (why) body["reason"] = why;
86
- if (f.preview) return preview("doNotContact.add", {}, body);
87
- try {
88
- renderSuccess(readableObject(await c.doNotContact.add(body)), outputOpts(f), process);
89
- } catch (err) {
90
- await fail(err, f);
91
- }
92
- }
93
- async function runUpdate(c, f) {
94
- const body = { reason: reason(f, true) };
95
- if (f.preview) return preview("doNotContact.update", { id: f.id }, body);
96
- try {
97
- renderSuccess(readableObject(await c.doNotContact.update(String(f.id ?? ""), body)), outputOpts(f), process);
98
- } catch (err) {
99
- await fail(err, f);
100
- }
101
- }
102
- async function runRemove(c, f) {
103
- if (f.preview) return preview("doNotContact.remove", { id: f.id });
104
- try {
105
- await c.doNotContact.remove(String(f.id ?? ""));
106
- renderSuccess({}, outputOpts(f), process);
107
- } catch (err) {
108
- await fail(err, f);
109
- }
110
- }
111
- var ID = { type: "positional", description: "Entry id (dnc_...), from `curviate do-not-contact list`." };
112
- var REASON_ARG = { type: "string", description: `Why: ${REASONS.join(" | ")}.` };
113
- var listCmd = defineCommand({
114
- meta: {
115
- name: "list",
116
- description: "List your Team's do-not-contact list, newest first. No Motion contacts a person on it and writes toward them are refused (exit 10); a reply in a conversation they wrote in stays allowed. An entry whose Contact was deleted still applies.",
117
- risk: "read",
118
- examples: ["curviate do-not-contact list", "curviate do-not-contact list --query jane"]
119
- },
120
- args: { ...readOnly(GLOBAL_FLAGS), query: { type: "string", description: "Only entries whose Contact name matches this text." } },
121
- run: online(runList)
122
- });
123
- var getCmd = defineCommand({
124
- meta: { name: "get", description: "One do-not-contact entry: the person, the reason, and who added it.", risk: "read", examples: ["curviate do-not-contact get dnc_YOUR_ENTRY_ID"] },
125
- args: { ...readOnly(READ_SINGLE_FLAGS), id: ID },
126
- run: online(runGet)
127
- });
128
- var addCmd = defineCommand({
129
- meta: {
130
- name: "add",
131
- description: "Put one person on the list, by Contact id or LinkedIn URL (a URL of someone who is not a Contact yet creates the Contact from stored data). No Motion contacts them afterwards and writes toward them are refused. One person per call; loop for many. Any member may add. Needs Automate.",
132
- risk: "write",
133
- rules: {
134
- changes: "The person joins the list; Motions skip them and writes toward them are refused.",
135
- visible_to: "Your Team.",
136
- budget_rows: [],
137
- retry: "Safe: a person already on the list answers with their existing entry.",
138
- undo: "`curviate do-not-contact remove <id>` (Owners and Managers)."
139
- },
140
- errors: { TIER_REQUIRED: "your plan does not include Do-not-contact writes (Automate).", RESOURCE_NOT_FOUND: "no Contact has this id." },
141
- seeAlso: ["curviate do-not-contact list"],
142
- examples: ["curviate do-not-contact add --contact con_YOUR_CONTACT_ID --reason asked_to_stop", "curviate do-not-contact add --linkedin-url https://www.linkedin.com/in/jane-doe"]
143
- },
144
- args: {
145
- ...WRITE_SINGLE_FLAGS,
146
- contact: { type: "string", description: "The Contact (con_...). Not with --linkedin-url." },
147
- "linkedin-url": { type: "string", description: "The person's LinkedIn profile URL, in any spelling. Not with --contact." },
148
- reason: REASON_ARG
149
- },
150
- run: online(runAdd)
151
- });
152
- var updateCmd = defineCommand({
153
- meta: {
154
- name: "update",
155
- description: "Change the reason on an entry. Needs Automate.",
156
- risk: "write",
157
- rules: {
158
- changes: "The entry's reason.",
159
- visible_to: "Your Team.",
160
- budget_rows: [],
161
- retry: "Safe: the same call leaves the same reason.",
162
- undo: "Update again with the old reason."
163
- },
164
- errors: { TIER_REQUIRED: "your plan does not include Do-not-contact writes (Automate).", RESOURCE_NOT_FOUND: "no such entry." },
165
- examples: ["curviate do-not-contact update dnc_YOUR_ENTRY_ID --reason existing_customer"]
166
- },
167
- args: { ...WRITE_SINGLE_FLAGS, id: ID, reason: { ...REASON_ARG, required: true } },
168
- run: online(runUpdate)
169
- });
170
- var removeCmd = defineCommand({
171
- meta: {
172
- name: "remove",
173
- description: "Take a person off the list: Motions and writes may reach them again. Owners and Managers only.",
174
- risk: "high",
175
- rules: {
176
- changes: "The entry is deleted; Motions may enroll the person and writes toward them are allowed again.",
177
- visible_to: "The person, if a Motion or write then reaches them on LinkedIn.",
178
- budget_rows: [],
179
- retry: "Safe: a second call answers RESOURCE_NOT_FOUND.",
180
- undo: "`curviate do-not-contact add` again.",
181
- blast_radius: "One person."
182
- },
183
- errors: { INSUFFICIENT_ROLE: "removing is for Owners and Managers.", RESOURCE_NOT_FOUND: "no such entry (already removed)." },
184
- seeAlso: ["curviate do-not-contact list", "curviate do-not-contact add"],
185
- examples: ["curviate do-not-contact remove dnc_YOUR_ENTRY_ID"]
186
- },
187
- args: { ...WRITE_SINGLE_FLAGS, id: ID },
188
- run: online(runRemove)
189
- });
190
- var doNotContactCommand = defineCommand({
191
- meta: { name: "do-not-contact", description: DESCRIPTIONS["do-not-contact"] },
192
- subCommands: { list: listCmd, get: getCmd, add: addCmd, update: updateCmd, remove: removeCmd },
193
- async run() {
194
- const { showHelp } = await import("./examples-ICAGL2S5.js");
195
- await showHelp(doNotContactCommand, ["curviate", "do-not-contact"]);
196
- }
197
- });
198
- export {
199
- doNotContactCommand
200
- };