@curviate/cli 0.51.0 → 0.52.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 (54) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{account-74N7HFFI.js → account-2IHGWLU7.js} +5 -5
  3. package/dist/{analytics-CZ372NIV.js → analytics-SBHNCE24.js} +5 -5
  4. package/dist/{beta-consent-6EY7JWUB.js → beta-consent-QJBRBON3.js} +3 -3
  5. package/dist/{billing-LJGAAL4W.js → billing-KL6GL5PF.js} +4 -4
  6. package/dist/{contact-import-PAMRJ6MU.js → chunk-44COK554.js} +75 -20
  7. package/dist/{chunk-AUHGVZCD.js → chunk-6BDA6B32.js} +4 -4
  8. package/dist/{chunk-FBBZVIFJ.js → chunk-AQVE6HO5.js} +1 -1
  9. package/dist/{chunk-3OYS3NWV.js → chunk-GXEHHSM7.js} +1 -1
  10. package/dist/{chunk-7AR2OA67.js → chunk-JGPR6AGO.js} +10 -10
  11. package/dist/{chunk-A6UJU6ZW.js → chunk-OQKN3U74.js} +4 -4
  12. package/dist/{chunk-BKQZDNXH.js → chunk-OUY3GVWJ.js} +1 -1
  13. package/dist/{chunk-DAFE2MTF.js → chunk-QA777QEJ.js} +1 -1
  14. package/dist/{chunk-ERHJZL7A.js → chunk-SIOEKNCN.js} +3 -3
  15. package/dist/{chunk-3RRINPLF.js → chunk-UA4DEQ3K.js} +28 -2
  16. package/dist/{chunk-7OUGD5DH.js → chunk-UXFLLYFY.js} +1 -1
  17. package/dist/cli.js +22 -22
  18. package/dist/{comment-OWNTXKTR.js → comment-ABRBF7J4.js} +5 -5
  19. package/dist/{company-F5Z5Q3YA.js → company-WQPWHAZJ.js} +5 -5
  20. package/dist/{config-GIU3SIIY.js → config-RFXNYRRC.js} +2 -2
  21. package/dist/{connect-BZY5AA3I.js → connect-R7A6RJJJ.js} +4 -4
  22. package/dist/{contact-EXEJDG7S.js → contact-FHR4RAXL.js} +7 -7
  23. package/dist/{contact-groups-RQZQCFHI.js → contact-groups-AAJT4TZ6.js} +7 -7
  24. package/dist/contact-import-3KASFYC5.js +35 -0
  25. package/dist/{core-F3RQLZFP.js → core-GANWZKQZ.js} +17 -17
  26. package/dist/do-not-contact-QMFIJOAA.js +360 -0
  27. package/dist/{doctor-BLUHL4YW.js → doctor-4TNHUBYZ.js} +3 -3
  28. package/dist/{draft-5ULT2UFJ.js → draft-F56TKIQ3.js} +5 -5
  29. package/dist/{enrollment-WF5DDULC.js → enrollment-WCG5MX65.js} +4 -4
  30. package/dist/{export-CF7IAMYC.js → export-UVUY3IMF.js} +3 -3
  31. package/dist/{feed-PR43TIM3.js → feed-6NN2YWOQ.js} +4 -4
  32. package/dist/{group-W5QAQJBZ.js → group-BXL4QDZL.js} +4 -4
  33. package/dist/{inbox-NO3RDC4U.js → inbox-GOO5UA3J.js} +4 -4
  34. package/dist/{inboxes-PN26B6SL.js → inboxes-GGN7SULO.js} +4 -4
  35. package/dist/{incoming-DYYCNX46.js → incoming-AZPAGR3L.js} +4 -4
  36. package/dist/{job-V67373SG.js → job-R5TGUKTB.js} +4 -4
  37. package/dist/{login-K3IGFVZY.js → login-LZH3HY2J.js} +2 -2
  38. package/dist/{message-AIVMYHV5.js → message-YY2BB47Z.js} +5 -5
  39. package/dist/{motion-UXH422PR.js → motion-2RCKZSK5.js} +5 -5
  40. package/dist/{network-376YFM33.js → network-5VDLBVU7.js} +4 -4
  41. package/dist/{notification-BAKHCJTV.js → notification-DVHDC2IA.js} +4 -4
  42. package/dist/{notifications-7HJSOQEK.js → notifications-GZKDD7SV.js} +4 -4
  43. package/dist/{post-RBHNLWAM.js → post-JKXMJZXS.js} +5 -5
  44. package/dist/{profile-RDNIILT7.js → profile-CYFEDUEC.js} +5 -5
  45. package/dist/{recruiter-HX45CHBT.js → recruiter-MRJDGK6O.js} +4 -4
  46. package/dist/{sales-nav-SIMRRJV7.js → sales-nav-5ABDKON4.js} +4 -4
  47. package/dist/{search-ARMOCEYV.js → search-JDNUGHRX.js} +4 -4
  48. package/dist/{setup-DVFWTM6J.js → setup-EXPWIHTM.js} +3 -3
  49. package/dist/{team-X6EMJ3EH.js → team-5XD2O5UO.js} +4 -4
  50. package/dist/{tier-4VDJ3OEO.js → tier-CNDUZKXE.js} +4 -4
  51. package/dist/{unibox-XGOS5YIJ.js → unibox-MAAEROM5.js} +4 -4
  52. package/dist/{webhook-3QYAOV7E.js → webhook-XVTE3ZVM.js} +4 -4
  53. package/package.json +2 -2
  54. package/dist/do-not-contact-UWJRNFHH.js +0 -200
@@ -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
- };