@curviate/cli 0.54.0 → 0.56.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 (66) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +35 -17
  3. package/dist/{account-DW5N5MJ6.js → account-ZF5NEMID.js} +132 -125
  4. package/dist/{analytics-T2K3OWVQ.js → analytics-M7JWS67A.js} +5 -5
  5. package/dist/{beta-consent-O736ONE7.js → beta-consent-4Q2LZZQC.js} +4 -4
  6. package/dist/{billing-NTBL32EX.js → billing-LYPSX5SR.js} +78 -6
  7. package/dist/{chunk-N76WNJ5T.js → chunk-7PLTQHNO.js} +1 -1
  8. package/dist/{chunk-N4IYTFIY.js → chunk-AMTKGO37.js} +1 -1
  9. package/dist/{chunk-ACKKHLUH.js → chunk-CRO7PJ4I.js} +2 -2
  10. package/dist/chunk-DENWYJK2.js +94 -0
  11. package/dist/{chunk-FBLCSVIU.js → chunk-EI64VFBE.js} +47 -47
  12. package/dist/{chunk-ENBIMEKS.js → chunk-IB6ARI3R.js} +1 -1
  13. package/dist/{chunk-Q57PZJLX.js → chunk-J4SFOFMT.js} +90 -88
  14. package/dist/{chunk-FUX3BRYP.js → chunk-JXDEV33Z.js} +1 -1
  15. package/dist/{chunk-5B4T6BMN.js → chunk-L3RJU7C3.js} +44 -44
  16. package/dist/{chunk-KXJJFHSD.js → chunk-MIOEYSBQ.js} +1 -1
  17. package/dist/{chunk-R4HS2MWM.js → chunk-MWVTFTWV.js} +15 -13
  18. package/dist/{chunk-QW5K5DTC.js → chunk-RDKTHFQ6.js} +25 -6
  19. package/dist/{chunk-62YAYAUI.js → chunk-RKNW4UX4.js} +51 -9
  20. package/dist/{chunk-V3HHYTBY.js → chunk-UOWOKEB2.js} +1 -1
  21. package/dist/{chunk-HOMRAZ6S.js → chunk-UWRWZG4N.js} +2 -2
  22. package/dist/{chunk-A3UNS44U.js → chunk-VEMK4MJM.js} +10 -10
  23. package/dist/{chunk-UFHT2KZG.js → chunk-XP6S6E55.js} +2 -2
  24. package/dist/cli.js +33 -25
  25. package/dist/{comment-ATVJOTWV.js → comment-D6RSZTVK.js} +8 -8
  26. package/dist/{company-BRKFROPE.js → company-3Z6PXGTW.js} +11 -11
  27. package/dist/{config-E223SS5K.js → config-VY5MCJMN.js} +2 -2
  28. package/dist/{connect-XVDQ5FTT.js → connect-G2RTLV7G.js} +15 -15
  29. package/dist/{contact-4HOUOVD7.js → contact-QSLJCBDE.js} +8 -8
  30. package/dist/{contact-groups-ENA3VGGL.js → contact-groups-OITAD73K.js} +85 -85
  31. package/dist/{contact-import-4EKVDFPV.js → contact-import-LT7BKESC.js} +10 -10
  32. package/dist/core-RFTNNB6P.js +46 -0
  33. package/dist/{do-not-contact-S2WGHSQL.js → do-not-contact-ZA7KS5WD.js} +59 -33
  34. package/dist/{doctor-OFIUGRUG.js → doctor-JQT3DO6G.js} +4 -4
  35. package/dist/{document-MDE2WJYX.js → document-H65EXU4L.js} +1 -1
  36. package/dist/domain-7EX4E34B.js +70 -0
  37. package/dist/{draft-DD3DTXBM.js → draft-7U6H4BPF.js} +4 -4
  38. package/dist/{enrollment-ESCHKQ5X.js → enrollment-AZ6XGVVL.js} +40 -38
  39. package/dist/{examples-KAMXHRLE.js → examples-IGQJCSNL.js} +2 -2
  40. package/dist/{exit-codes-CYQHN4NE.js → exit-codes-ZSOLAXQO.js} +1 -1
  41. package/dist/{export-GUAGB7TF.js → export-OYMQXL62.js} +5 -5
  42. package/dist/{feed-ZC4FY4BA.js → feed-M5D4SJW7.js} +6 -6
  43. package/dist/{group-42ZE7K3K.js → group-UTC3YBKE.js} +6 -6
  44. package/dist/{inbox-2YS7CTXH.js → inbox-VSGNHSLG.js} +9 -9
  45. package/dist/{inboxes-5RB3BGCQ.js → inboxes-23C2MJK4.js} +6 -6
  46. package/dist/{incoming-ATZN6JJA.js → incoming-QVPP32K7.js} +13 -13
  47. package/dist/{job-WD3Z3P3Q.js → job-ZHVFFRWE.js} +10 -10
  48. package/dist/{login-JQ57YHEJ.js → login-6OTNXEJZ.js} +4 -4
  49. package/dist/mailbox-HD2UXZCA.js +405 -0
  50. package/dist/{message-WGS2IIDC.js → message-PIV77W47.js} +7 -7
  51. package/dist/{motion-BRVBJJJP.js → motion-AHYF34DP.js} +224 -149
  52. package/dist/{network-CODIWCJQ.js → network-RJHJFZEY.js} +5 -5
  53. package/dist/{notification-RLVF4NLJ.js → notification-XGR4NT3S.js} +6 -6
  54. package/dist/{notifications-HGEHM5KW.js → notifications-BHRWSHPR.js} +6 -6
  55. package/dist/{post-3GH2IPO6.js → post-Z7AVDDKA.js} +8 -8
  56. package/dist/{profile-6RFJQMIB.js → profile-YZNBX2RP.js} +15 -15
  57. package/dist/{recruiter-GK3UNS62.js → recruiter-EXM4P7X7.js} +17 -17
  58. package/dist/{sales-nav-SLS3ABF4.js → sales-nav-CKDSEXV2.js} +15 -15
  59. package/dist/{search-45WRT5T3.js → search-B7FB6674.js} +17 -17
  60. package/dist/{setup-5QZOM2Q2.js → setup-VZVPLJ4V.js} +5 -5
  61. package/dist/{team-WM3RKOQ2.js → team-PYABBUHO.js} +6 -6
  62. package/dist/{tier-5AMLO5KE.js → tier-PRK4WQKR.js} +4 -4
  63. package/dist/{unibox-TTCF7YVO.js → unibox-ZNKX2EKL.js} +34 -34
  64. package/dist/{webhook-UCCCSKDO.js → webhook-V74EV4E2.js} +18 -18
  65. package/package.json +2 -2
  66. package/dist/core-6VDDV2NM.js +0 -46
@@ -3,14 +3,18 @@ import {
3
3
  slimAccountGet,
4
4
  slimAccountList,
5
5
  slimAccountListItem
6
- } from "./chunk-FUX3BRYP.js";
6
+ } from "./chunk-JXDEV33Z.js";
7
+ import {
8
+ checkCredentialConflicts,
9
+ resolveSecret
10
+ } from "./chunk-DENWYJK2.js";
7
11
  import {
8
12
  GRAMMAR_ARGS,
9
13
  WINDOW_ARGS,
10
14
  grammarParams,
11
15
  renderOverview,
12
16
  windowParams
13
- } from "./chunk-FBLCSVIU.js";
17
+ } from "./chunk-EI64VFBE.js";
14
18
  import {
15
19
  print,
16
20
  table
@@ -22,7 +26,7 @@ import {
22
26
  outputOpts,
23
27
  rootClient,
24
28
  usage
25
- } from "./chunk-HOMRAZ6S.js";
29
+ } from "./chunk-UWRWZG4N.js";
26
30
  import {
27
31
  buildPreviewOutput
28
32
  } from "./chunk-TCUYH5GO.js";
@@ -37,7 +41,7 @@ import {
37
41
  readablePage,
38
42
  rejectPaginationModifiersWithoutAll,
39
43
  streamAll
40
- } from "./chunk-KXJJFHSD.js";
44
+ } from "./chunk-MIOEYSBQ.js";
41
45
  import {
42
46
  isJsonMode,
43
47
  renderError,
@@ -49,24 +53,25 @@ import {
49
53
  import {
50
54
  readHiddenToEof,
51
55
  readlineSync
52
- } from "./chunk-ENBIMEKS.js";
56
+ } from "./chunk-IB6ARI3R.js";
53
57
  import {
54
58
  createClient,
55
59
  resolveEffectiveConfig
56
- } from "./chunk-N76WNJ5T.js";
60
+ } from "./chunk-7PLTQHNO.js";
57
61
  import {
58
62
  GLOBAL_FLAGS,
59
63
  READ_SINGLE_FLAGS,
60
64
  WRITE_SINGLE_FLAGS,
61
- readOnly
65
+ readOnly,
66
+ setTeamFlag
62
67
  } from "./chunk-QLKGOIWS.js";
63
68
  import {
64
69
  DESCRIPTIONS
65
- } from "./chunk-R4HS2MWM.js";
70
+ } from "./chunk-MWVTFTWV.js";
66
71
  import {
67
72
  parseDocument,
68
73
  readFileFlag
69
- } from "./chunk-62YAYAUI.js";
74
+ } from "./chunk-RKNW4UX4.js";
70
75
  import "./chunk-FDJMAF7D.js";
71
76
  import {
72
77
  defaultReadStdin,
@@ -74,13 +79,13 @@ import {
74
79
  } from "./chunk-ZYURL5VK.js";
75
80
  import {
76
81
  AUTH_NEEDED
77
- } from "./chunk-QW5K5DTC.js";
82
+ } from "./chunk-RDKTHFQ6.js";
78
83
 
79
84
  // src/commands/account-insights.ts
80
85
  import { defineCommand } from "citty";
81
86
  async function runOverview(c, f) {
82
87
  const q = { ...windowParams(f), ...grammarParams(f) };
83
- if (f.motions !== void 0) q["motion_id"] = listFlag("motions", f.motions);
88
+ if (f.campaigns !== void 0) q["campaign_id"] = listFlag("campaigns", f.campaigns);
84
89
  if (f.origin !== void 0) q["origin"] = listFlag("origin", f.origin);
85
90
  try {
86
91
  const body = await c.accounts.overview(String(f.accountId ?? ""), q);
@@ -110,7 +115,7 @@ var ACCOUNT_ID = { type: "positional", description: "The Account (acc_...)." };
110
115
  var accountOverviewCommand = defineCommand({
111
116
  meta: {
112
117
  name: "overview",
113
- description: "One Account's overview over a window: profile and status, latest metrics, outcomes so far (acceptance, reply, InMail reply), budget rows used today, its Motions, and flags with the next command to run. Each Contact counts once per Account.",
118
+ description: "One Account's overview over a window: profile and status, latest metrics, outcomes so far (acceptance, reply, InMail reply), budget rows used today, its Campaigns, and flags with the next command to run. Each Lead counts once per Account.",
114
119
  risk: "read",
115
120
  output: ["A compact table by default; --json (or piped) prints the API body."],
116
121
  seeAlso: ["curviate account metrics", "curviate analytics get"],
@@ -120,8 +125,8 @@ var accountOverviewCommand = defineCommand({
120
125
  ...readOnly(READ_SINGLE_FLAGS),
121
126
  accountId: ACCOUNT_ID,
122
127
  ...WINDOW_ARGS,
123
- motions: { type: "string", description: "Only these Motions, comma list (mot_...)." },
124
- origin: { type: "string", description: "Who sent the actions: a comma list of motion, unibox, api; direct is an alias for unibox and api." },
128
+ campaigns: { type: "string", description: "Only these Campaigns, comma list (mot_...)." },
129
+ origin: { type: "string", description: "Who sent the actions: a comma list of campaign, unibox, api; direct is an alias for unibox and api." },
125
130
  ...GRAMMAR_ARGS
126
131
  },
127
132
  run: online(runOverview)
@@ -145,18 +150,31 @@ var accountMetricsCommand = defineCommand({
145
150
 
146
151
  // src/commands/account-warm-up.ts
147
152
  import { defineCommand as defineCommand2 } from "citty";
153
+ function ramp(f) {
154
+ const w = {};
155
+ if (f.preset !== void 0) {
156
+ if (f.preset !== "gradual" && f.preset !== "custom") usage("--preset takes gradual or custom.");
157
+ w["preset"] = f.preset;
158
+ }
159
+ if (f.start !== void 0) w["start"] = intFlag("start", f.start, 5, 90);
160
+ if (f.step !== void 0) w["step"] = intFlag("step", f.step, 1, 50);
161
+ if (f.every !== void 0) w["every"] = intFlag("every", f.every, 1, 7);
162
+ return w;
163
+ }
148
164
  async function run(f, enabled) {
149
165
  const accountId = String(f.accountId ?? "");
166
+ const warm_up = { enabled, ...enabled ? ramp(f) : {} };
150
167
  if (f.preview) {
151
- process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "accounts.updateSafetyPolicy", args: { accountId }, body: { warm_up: { enabled } } })) + "\n");
168
+ process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "accounts.updateSafetyPolicy", args: { accountId }, body: { warm_up } })) + "\n");
152
169
  return;
153
170
  }
154
171
  const c = await rootClient(f);
155
172
  try {
156
- const policy = await c.accounts.updateSafetyPolicy(accountId, { warm_up: { enabled } });
173
+ const policy = await c.accounts.updateSafetyPolicy(accountId, { warm_up });
157
174
  if (outputOpts(f).json) return renderSuccess(policy, outputOpts(f), process);
158
175
  const w = policy.warm_up ?? {};
159
- process.stdout.write(`Warm-up ${w.enabled ? "on" : "off"} for ${accountId}: state ${w.state ?? "unknown"}, factor ${w.factor ?? "unknown"}${w.dormant ? ", dormant" : ""}.
176
+ const at = w.preset ? `, ${w.preset}${w.day != null ? ` day ${w.day}` : ""}` : "";
177
+ process.stdout.write(`Warm-up ${w.enabled ? "on" : "off"} for ${accountId}: state ${w.state ?? "unknown"}, factor ${w.factor ?? "unknown"}${at}${w.dormant ? ", dormant" : ""}.
160
178
  `);
161
179
  } catch (err) {
162
180
  await fail(err, f);
@@ -165,7 +183,7 @@ async function run(f, enabled) {
165
183
  var switchCommand = (name) => defineCommand2({
166
184
  meta: {
167
185
  name,
168
- description: name === "on" ? "Turn the Account's warm-up on: its limits start at 15% from now and rise to full over 5 weeks. Prints the resulting warm-up." : "Turn the Account's warm-up off (the default): full limits at once; recovery after a LinkedIn restriction still applies. Prints the resulting warm-up.",
186
+ description: name === "on" ? "Turn the Account's warm-up on: its limits ramp from now in its sending days, Gradual (30% on day 1 to 100% on day 14) or Custom (--start percent on day 1, plus --step points every --every sending days). Prints the resulting warm-up." : "Turn the Account's warm-up off (the default): full limits at once; recovery after a LinkedIn restriction still applies. Prints the resulting warm-up.",
169
187
  risk: "write",
170
188
  rules: {
171
189
  changes: `The Account's warm-up switch is set ${name}; every budget row's effective ceiling follows.`,
@@ -176,9 +194,21 @@ var switchCommand = (name) => defineCommand2({
176
194
  blast_radius: "One Account's pace."
177
195
  },
178
196
  seeAlso: ["curviate account get"],
179
- examples: [`curviate account warm-up ${name} acc_YOUR_ACCOUNT_ID`]
197
+ examples: [
198
+ `curviate account warm-up ${name} acc_YOUR_ACCOUNT_ID`,
199
+ ...name === "on" ? ["curviate account warm-up on acc_YOUR_ACCOUNT_ID --preset custom --start 20 --step 10 --every 2"] : []
200
+ ]
201
+ },
202
+ args: {
203
+ ...WRITE_SINGLE_FLAGS,
204
+ accountId: { type: "positional", description: "The Account (acc_...)." },
205
+ ...name === "on" ? {
206
+ preset: { type: "string", description: "gradual (default: 30% on day 1 to 100% on day 14) or custom." },
207
+ start: { type: "string", description: "Custom: the percentage on day 1, 5 to 90." },
208
+ step: { type: "string", description: "Custom: percentage points added each time, 1 to 50." },
209
+ every: { type: "string", description: "Custom: sending days between steps, 1 to 7." }
210
+ } : {}
180
211
  },
181
- args: { ...WRITE_SINGLE_FLAGS, accountId: { type: "positional", description: "The Account (acc_...)." } },
182
212
  async run({ args }) {
183
213
  await run(args, name === "on");
184
214
  }
@@ -194,30 +224,79 @@ var accountWarmUpCommand = defineCommand2({
194
224
  // src/commands/account-safety.ts
195
225
  import { defineCommand as defineCommand3 } from "citty";
196
226
  var LEVELS = ["normal", "increased"];
197
- var ACCOUNT = { type: "positional", description: "The Account (acc_...)." };
227
+ var SCOPES = ["everything", "email_only"];
228
+ var ACCOUNT = { type: "positional", required: false, description: "The Account (acc_...). Not with --team." };
229
+ var ACCOUNT_REQUIRED = { type: "positional", description: "The Account (acc_...)." };
230
+ var TEAM = {
231
+ type: "string",
232
+ description: "The Team's safety policy instead of one Account's: pass --team alone for the Team your key or profile names, or --team tnt_... for another of your Teams. Not with an Account id."
233
+ };
234
+ var EMAIL_FLAGS = {
235
+ "email-default-cap": { type: "string", description: "With --team: the daily cap a Mailbox gets when it connects, at most 50 (default 30). Mailboxes already connected keep theirs. The API refuses a higher value." },
236
+ "email-opt-out-scope": { type: "string", description: `With --team: what an email opt-out covers, ${SCOPES.join(" | ")} (default everything).` },
237
+ "email-opt-out-text": { type: "string", description: 'With --team: the opt-out line in every email step, up to 200 characters, one plain line, no variables. "" restores the shipped default.' },
238
+ "email-opt-out-link-text": { type: "string", description: 'With --team: the text before the opt-out link, up to 100 characters, one plain line, no variables. "" restores the shipped default.' },
239
+ "email-opt-out-link-word": { type: "string", description: `With --team: the opt-out link's word, up to 30 characters, for example Abmelden. "" restores the shipped default.` }
240
+ };
241
+ function teamScope(f) {
242
+ const asked = f.team !== void 0;
243
+ const id = String(f.accountId ?? "");
244
+ if (asked && id !== "") usage("--team reads or changes the Team's policy: leave the Account id out.");
245
+ if (!asked && id === "") usage("name the Account (acc_...), or pass --team for the Team's policy.");
246
+ if (!asked) return false;
247
+ if (f.team === "") setTeamFlag(void 0);
248
+ else if (!/^tnt_/.test(f.team)) usage("--team takes a Team id (tnt_...), or no value for your current Team.");
249
+ return true;
250
+ }
198
251
  var getCmd = defineCommand3({
199
252
  meta: {
200
253
  name: "get",
201
- description: "One Account's safety policy: every budget row with its ceiling, effective_ceiling and (strict rows) target and effective_target, Active hours, warm-up, pacing, auto_withdraw and the Activity level (activity_level, and activity_level_effective with activity_level_reason when it runs lower). A read: no LinkedIn call.",
254
+ description: "With --team, the Team's own policy: its defaults per limit profile and budget row and `email` (default_daily_cap, opt_out_scope and the three opt-out texts in force, the shipped default when none is set). Otherwise one Account's safety policy: every budget row with its ceiling, effective_ceiling and (strict rows) target and effective_target, Active hours, warm-up, pacing, auto_withdraw and the Activity level (activity_level, and activity_level_effective with activity_level_reason when it runs lower). A read: no LinkedIn call.",
202
255
  risk: "read",
203
256
  seeAlso: ["curviate account safety update", "curviate account get"],
204
- examples: ["curviate account safety get acc_YOUR_ACCOUNT_ID", "curviate account safety get acc_YOUR_ACCOUNT_ID --fields active_hours,warm_up"]
257
+ examples: ["curviate account safety get acc_YOUR_ACCOUNT_ID", "curviate account safety get acc_YOUR_ACCOUNT_ID --fields active_hours,warm_up", "curviate account safety get --team"]
205
258
  },
206
- args: { ...readOnly(READ_SINGLE_FLAGS), accountId: ACCOUNT },
259
+ args: { ...readOnly(READ_SINGLE_FLAGS), team: TEAM, accountId: ACCOUNT },
207
260
  async run({ args }) {
208
261
  const f = args;
262
+ const team = teamScope(f);
209
263
  const c = await rootClient(f);
210
264
  try {
211
- renderSuccess(await c.accounts.getSafetyPolicy(String(f.accountId ?? "")), outputOpts(f), process);
265
+ renderSuccess(team ? await c.accounts.getTeamSafetyPolicy() : await c.accounts.getSafetyPolicy(String(f.accountId ?? "")), outputOpts(f), process);
212
266
  } catch (err) {
213
267
  await fail(err, f);
214
268
  }
215
269
  }
216
270
  });
271
+ async function updateTeam(f) {
272
+ const email = {};
273
+ if (f["email-default-cap"] !== void 0) email["default_daily_cap"] = intFlag("email-default-cap", f["email-default-cap"]);
274
+ const scope = f["email-opt-out-scope"];
275
+ if (scope !== void 0) {
276
+ if (!SCOPES.includes(scope)) usage(`--email-opt-out-scope is ${SCOPES.join(" or ")}, not "${scope}".`);
277
+ email["opt_out_scope"] = scope;
278
+ }
279
+ for (const [flag, key] of [["email-opt-out-text", "opt_out_text"], ["email-opt-out-link-text", "opt_out_link_text"], ["email-opt-out-link-word", "opt_out_link_word"]]) {
280
+ if (f[flag] !== void 0) email[key] = f[flag];
281
+ }
282
+ if (f.file !== void 0 || f["activity-level"] !== void 0) usage("--team takes the --email-* flags, not --file or --activity-level.");
283
+ if (Object.keys(email).length === 0) usage("pass at least one --email-* flag with --team.");
284
+ const body = { email };
285
+ if (f.preview) {
286
+ process.stdout.write(JSON.stringify(buildPreviewOutput({ method: "accounts.updateTeamSafetyPolicy", args: {}, body })) + "\n");
287
+ return;
288
+ }
289
+ const c = await rootClient(f);
290
+ try {
291
+ renderSuccess(await c.accounts.updateTeamSafetyPolicy(body), outputOpts(f), process);
292
+ } catch (err) {
293
+ await fail(err, f);
294
+ }
295
+ }
217
296
  var updateCmd = defineCommand3({
218
297
  meta: {
219
298
  name: "update",
220
- description: 'Change one Account\'s safety policy from a JSON document: `rows`, for example {"rows":[{"budget_row":"profile_views","ceiling":40}]}, `active_hours`, for example {"active_hours":{"days":["mon","tue"],"start":"09:00","end":"17:00"}}, `auto_withdraw` (true or false: Curviate withdraws its own invitations older than 14 days once more than 400 are pending) and `activity_level`. --activity-level normal|increased sets the Activity level alone, or beside --file: how close the Account\'s daily targets sit to its limits. normal (the default) aims about midway between the green figure and the limit; increased works close to the limit, never past it, and raises the chance LinkedIn notices the activity. It runs as normal, and the setting stays, while warm-up is on or the Account\'s health is not healthy; the printed policy\'s activity_level_effective and activity_level_reason say which level is in force. Active hours hold Motions and other live writes, never a direct message (send, new chat, edit, delete, reaction, read mark). A row\'s `green` is its target, what Motions aim at; the ceiling is the most it may do. Fields you leave out stay as they are; null clears an override. Prints the policy.',
299
+ description: 'With --team, change the Team\'s email defaults instead, with the --email-* flags: the daily cap a new Mailbox gets (--email-default-cap, at most 50), what an opt-out covers (--email-opt-out-scope everything|email_only) and the three opt-out texts every email step carries (--email-opt-out-text up to 200 characters, --email-opt-out-link-text up to 100, --email-opt-out-link-word up to 30; one plain line, no variables; "" restores the shipped default). Prints the Team policy. Otherwise change one Account\'s safety policy from a JSON document: `rows`, for example {"rows":[{"budget_row":"profile_views","ceiling":40}]}, `active_hours`, for example {"active_hours":{"days":["mon","tue"],"start":"09:00","end":"17:00"}}, `auto_withdraw` (true or false: Curviate withdraws its own invitations older than 14 days once more than 400 are pending) and `activity_level`. --activity-level normal|increased sets the Activity level alone, or beside --file: how close the Account\'s daily targets sit to its limits. normal (the default) aims about midway between the green figure and the limit; increased works close to the limit, never past it, and raises the chance LinkedIn notices the activity. It runs as normal, and the setting stays, while warm-up is on or the Account\'s health is not healthy; the printed policy\'s activity_level_effective and activity_level_reason say which level is in force. Active hours hold Campaigns and other live writes, never a direct message (send, new chat, edit, delete, reaction, read mark). A row\'s `green` is its target, what Campaigns aim at; the ceiling is the most it may do. Fields you leave out stay as they are; null clears an override. Prints the policy.',
221
300
  risk: "write",
222
301
  rules: {
223
302
  changes: "The Account's limits, Active hours or Activity level, from the next action on.",
@@ -225,24 +304,30 @@ var updateCmd = defineCommand3({
225
304
  budget_rows: [],
226
305
  retry: "Safe: the same document leaves the same policy.",
227
306
  undo: "Send the previous values, or null to fall back to the Team's default.",
228
- blast_radius: "One Account's pace, in every Motion and every direct action."
307
+ blast_radius: "One Account's pace, in every Campaign and every direct action."
229
308
  },
230
309
  errors: { INVALID_REQUEST: "a field is unknown or not settable; the message names it." },
231
310
  seeAlso: ["curviate account safety get", "curviate account warm-up"],
232
311
  examples: [
233
312
  "curviate account safety update acc_YOUR_ACCOUNT_ID --file policy.json",
234
- "curviate account safety update acc_YOUR_ACCOUNT_ID --activity-level increased"
313
+ "curviate account safety update acc_YOUR_ACCOUNT_ID --activity-level increased",
314
+ "curviate account safety update --team --email-default-cap 40 --email-opt-out-link-word Abmelden"
235
315
  ],
236
- requires: ["--file or --activity-level, or both (the flag wins over the document's activity_level)."]
316
+ requires: ["an Account id with --file or --activity-level, or both (the flag wins over the document's activity_level); or --team with at least one --email-* flag."]
237
317
  },
238
318
  args: {
239
319
  ...WRITE_SINGLE_FLAGS,
320
+ team: TEAM,
321
+ ...EMAIL_FLAGS,
240
322
  accountId: ACCOUNT,
241
323
  file: { type: "string", description: "The JSON document: a path, or - to read it from stdin." },
242
324
  "activity-level": { type: "string", description: "normal (default) or increased: how close the Account's daily targets sit to its limits. increased raises the chance LinkedIn notices the activity; it runs as normal while warm-up is on or health is not healthy." }
243
325
  },
244
326
  async run({ args }) {
245
327
  const f = args;
328
+ if (teamScope(f)) return updateTeam(f);
329
+ const emailFlag = Object.keys(EMAIL_FLAGS).find((k) => f[k] !== void 0);
330
+ if (emailFlag) usage(`--${emailFlag} changes the Team's policy: add --team and leave the Account id out.`);
246
331
  const accountId = String(f.accountId ?? "");
247
332
  const level = f["activity-level"];
248
333
  if (level !== void 0 && !LEVELS.includes(level)) {
@@ -269,29 +354,29 @@ var updateCmd = defineCommand3({
269
354
  }
270
355
  });
271
356
  var accountSafetyCommand = defineCommand3({
272
- meta: { name: "safety", description: "Read or change one Account's safety policy: limits per budget row, Active hours and the Activity level." },
357
+ meta: { name: "safety", description: "Read or change one Account's safety policy (limits per budget row, Active hours, the Activity level), or with --team your Team's email defaults." },
273
358
  subCommands: { get: getCmd, update: updateCmd },
274
359
  async run() {
275
- process.stderr.write("Usage: curviate account safety get|update <account>\n");
360
+ process.stderr.write("Usage: curviate account safety get|update <account> | --team\n");
276
361
  }
277
362
  });
278
363
  var accessCommand = (name) => defineCommand3({
279
364
  meta: {
280
365
  name,
281
- description: name === "on" ? "Share the Account with its Team again (it does not rejoin a Motion). Only the person who connected it can." : "Keep the Account to its person: it leaves every Motion that held it and its queued enrichment visits are dropped. Only the person who connected it can.",
366
+ description: name === "on" ? "Share the Account with its Team again (it does not rejoin a Campaign). Only the person who connected it can." : "Keep the Account to its person: it leaves every Campaign that held it and its queued enrichment visits are dropped. Only the person who connected it can.",
282
367
  risk: "write",
283
368
  rules: {
284
- changes: name === "on" ? "The Team may use the Account again." : "The Team loses the Account; it leaves every Motion that held it.",
369
+ changes: name === "on" ? "The Team may use the Account again." : "The Team loses the Account; it leaves every Campaign that held it.",
285
370
  visible_to: "Your Team.",
286
371
  budget_rows: [],
287
372
  retry: "Safe to repeat: the switch ends in the same state.",
288
- undo: name === "on" ? "Run `curviate account team-access off <account>`." : "Run `curviate account team-access on <account>`, then add it back to its Motions."
373
+ undo: name === "on" ? "Run `curviate account team-access off <account>`." : "Run `curviate account team-access on <account>`, then add it back to its Campaigns."
289
374
  },
290
375
  errors: { ACCOUNT_OWNER_ONLY: "only the person who connected the Account can change this." },
291
376
  seeAlso: ["curviate account get", "curviate team members"],
292
377
  examples: [`curviate account team-access ${name} acc_YOUR_ACCOUNT_ID`]
293
378
  },
294
- args: { ...WRITE_SINGLE_FLAGS, accountId: ACCOUNT },
379
+ args: { ...WRITE_SINGLE_FLAGS, accountId: ACCOUNT_REQUIRED },
295
380
  async run({ args }) {
296
381
  const f = args;
297
382
  const accountId = String(f.accountId ?? "");
@@ -398,84 +483,6 @@ function parseCookieExport(raw, nowMs) {
398
483
  // src/commands/account.ts
399
484
  import { statSync, readFileSync } from "fs";
400
485
 
401
- // src/lib/credential-resolve.ts
402
- var STDIN_TTY_CUE = "Reading secret from stdin (paste + Enter): ";
403
- function defaultReadSingleLine() {
404
- return readlineSync("", { mask: true });
405
- }
406
- async function resolveSecret(params) {
407
- if (params.flagValue !== void 0 && params.flagValue !== "") {
408
- return params.flagValue;
409
- }
410
- if (params.stdinRequested) {
411
- if (params.isTTY) {
412
- const stdinReadAllowed = params.allowInteractiveStdinRead ?? params.allowInteractive;
413
- if (stdinReadAllowed !== false) {
414
- params.out.stderr.write(STDIN_TTY_CUE);
415
- const reader = params.readSingleLine ?? defaultReadSingleLine;
416
- const raw = await reader(STDIN_TTY_CUE);
417
- const trimmed = raw.trim();
418
- if (trimmed !== "") {
419
- return trimmed;
420
- }
421
- }
422
- } else {
423
- const reader = params.readStdin ?? defaultReadStdin;
424
- const raw = await reader();
425
- const trimmed = raw.trim();
426
- if (trimmed !== "") {
427
- return trimmed;
428
- }
429
- }
430
- }
431
- const envValue = process.env[params.envVar];
432
- if (envValue !== void 0 && envValue !== "") {
433
- return envValue;
434
- }
435
- if (!params.required) {
436
- return void 0;
437
- }
438
- if (params.allowInteractive === false) {
439
- return void 0;
440
- }
441
- if (params.prompt && params.prompt.isTTY) {
442
- const value = await params.prompt.readline(params.prompt.promptText, { mask: true });
443
- if (value) {
444
- return value;
445
- }
446
- }
447
- params.out.stderr.write(`error: ${params.failMessage ?? "missing required credential"}
448
- `);
449
- process.exit(2);
450
- }
451
- function checkCredentialConflicts(flags, out) {
452
- const passwordStdin = flags["password-stdin"] ?? false;
453
- const liAtStdin = flags["li-at-stdin"] ?? false;
454
- if (flags.password !== void 0 && passwordStdin) {
455
- failConflict(out, "--password and --password-stdin cannot both be set. Choose one source.");
456
- }
457
- if (flags["li-at"] !== void 0 && liAtStdin) {
458
- failConflict(out, "--li-at and --li-at-stdin cannot both be set. Choose one source.");
459
- }
460
- if (passwordStdin && liAtStdin) {
461
- failConflict(
462
- out,
463
- "--password-stdin and --li-at-stdin cannot both be set. stdin can feed only one secret per invocation."
464
- );
465
- }
466
- if (liAtStdin && flags["auth-method"] === "credentials") {
467
- failConflict(out, "--li-at-stdin requires --auth-method cookie (it does not apply to the credentials method).");
468
- }
469
- if (passwordStdin && flags["auth-method"] === "cookie") {
470
- failConflict(out, "--password-stdin requires --auth-method credentials (it does not apply to the cookie method).");
471
- }
472
- }
473
- function failConflict(out, message) {
474
- out.stderr.write(`error: ${message}
475
- `);
476
- process.exit(2);
477
- }
478
-
479
486
  // src/lib/checkpoint-copy.ts
480
487
  var RESENDABLE_CHALLENGE_TYPES = /* @__PURE__ */ new Set([
481
488
  "otp",
@@ -616,7 +623,7 @@ async function runCancel(c, f) {
616
623
  await fail(err, f);
617
624
  }
618
625
  }
619
- var ID = { type: "positional", description: "Connect request id (creq_...)." };
626
+ var ID = { type: "positional", description: "Connect request id (creq_...), LinkedIn account or Mailbox." };
620
627
  var createCmd = defineCommand4({
621
628
  meta: {
622
629
  name: "create",
@@ -640,16 +647,16 @@ var createCmd = defineCommand4({
640
647
  args: {
641
648
  ...WRITE_SINGLE_FLAGS,
642
649
  reconnect: { type: "string", description: "Reconnect this account (acc_...) instead of connecting a new one." },
643
- "warm-up": { type: "boolean", description: "--warm-up: the new account starts with warm-up on once the person connects it (limits at 15%, rising to full over 5 weeks). Default off (full limits from the start); --no-warm-up is accepted and changes nothing. A new connect only." }
650
+ "warm-up": { type: "boolean", description: "--warm-up: the new account starts with warm-up on once the person connects it (limits at 30%, rising to full by day 14 of its sending days). Default off (full limits from the start); --no-warm-up is accepted and changes nothing. A new connect only." }
644
651
  },
645
652
  run: online2(runCreate)
646
653
  });
647
654
  var getCmd2 = defineCommand4({
648
655
  meta: {
649
656
  name: "get",
650
- description: "Read a connect request: pending, completed (with the connected account_id), expired, failed or cancelled. Poll it until it leaves pending.",
657
+ description: "Read a connect request: pending, completed (with the connected account_id, or mailbox_id for a Mailbox request), expired, failed or cancelled. Poll it until it leaves pending. A Mailbox request (kind mailbox_connect or mailbox_reconnect, from `curviate mailbox connect` or `reconnect`) also carries mailbox_id and, where the provider needs one, admin_consent_url.",
651
658
  risk: "read",
652
- output: ["The request: status, and account_id once completed. Never a credential, code or the step the person is on."],
659
+ output: ["The request: status, and account_id (or mailbox_id) once completed; error_code when the last attempt failed. Never a credential, code or the step the person is on."],
653
660
  examples: ["curviate account connect-request get creq_YOUR_REQUEST_ID"]
654
661
  },
655
662
  args: { ...readOnly(READ_SINGLE_FLAGS), id: ID },
@@ -658,7 +665,7 @@ var getCmd2 = defineCommand4({
658
665
  var cancelCmd = defineCommand4({
659
666
  meta: {
660
667
  name: "cancel",
661
- description: "Cancel a pending connect request; its link stops working. A request that is no longer pending is refused.",
668
+ description: "Cancel a pending connect request, a LinkedIn account's or a Mailbox's; its link stops working. A request that is no longer pending is refused.",
662
669
  risk: "write",
663
670
  rules: {
664
671
  changes: "The request becomes cancelled and its link stops working.",
@@ -681,7 +688,7 @@ var connectRequestCommand = defineCommand4({
681
688
  meta: { name: "connect-request", description: "Connect a LinkedIn account without any credential passing through you: create a request, give the person its link, read it until done." },
682
689
  subCommands: { create: createCmd, get: getCmd2, cancel: cancelCmd },
683
690
  async run() {
684
- const { showHelp } = await import("./examples-KAMXHRLE.js");
691
+ const { showHelp } = await import("./examples-IGQJCSNL.js");
685
692
  await showHelp(connectRequestCommand, ["curviate", "account", "connect-request"]);
686
693
  }
687
694
  });
@@ -712,7 +719,7 @@ function resolveOutputOpts(flags) {
712
719
  async function handleError(err, outOpts, out) {
713
720
  const { CurviateError } = await import("@curviate/sdk");
714
721
  if (err instanceof CurviateError) {
715
- const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
722
+ const { getExitCode } = await import("./exit-codes-ZSOLAXQO.js");
716
723
  renderError(err, outOpts, out);
717
724
  process.exit(getExitCode(err));
718
725
  }
@@ -1436,7 +1443,7 @@ async function runAccountUpdate(client, flags, out) {
1436
1443
  }
1437
1444
  assertLocationFlags(flags, out, { requireOne: false, fallbackAlone: true });
1438
1445
  Object.assign(body, managedLocationBody(flags));
1439
- if (flags["save-connections-as-contacts"] !== void 0) body["save_connections_as_contacts"] = flags["save-connections-as-contacts"];
1446
+ if (flags["save-connections-as-leads"] !== void 0) body["save_connections_as_leads"] = flags["save-connections-as-leads"];
1440
1447
  if (flags["proxy-host"]) {
1441
1448
  const proxyPassword = await resolveSecret({
1442
1449
  flagValue: flags["proxy-password"],
@@ -1790,7 +1797,7 @@ var accountLinkCommand = defineCommand5({
1790
1797
  products: { type: "string", description: "Comma-separated premium products to ask for: sales_navigator, recruiter. Omit to ask for both (--linkedin-premium still narrows). Classic LinkedIn and company pages are always included." },
1791
1798
  "external-id": { type: "string", description: "Your own id for this account's end user (1-255 chars, not unique). Returned on the account and every account webhook; filter with `curviate account list --external-id`. Use an opaque id, not an email." },
1792
1799
  timezone: { type: "string", description: "Ignored: the account's time zone follows its connection location. Accepted so existing scripts keep working; nothing is sent." },
1793
- "warm-up": { type: "boolean", description: "--warm-up connects the new account with warm-up on: its limits start at 15% and rise to full over 5 weeks. Default off (full limits from the start); --no-warm-up is accepted and changes nothing. A new connect only; for a connected account use `curviate account warm-up`." },
1800
+ "warm-up": { type: "boolean", description: "--warm-up connects the new account with warm-up on: its limits start at 30% and rise to full by day 14 of its sending days (the Gradual ramp). Default off (full limits from the start); --no-warm-up is accepted and changes nothing. A new connect only; for a connected account use `curviate account warm-up`." },
1794
1801
  "account-id": { type: "string", description: "Existing account id (acc_...) to re-authenticate IN PLACE. Passing it makes this an in-place reconnect of that account. Omit to connect a NEW account into --seat-id." },
1795
1802
  "no-interactive": {
1796
1803
  type: "boolean",
@@ -1882,10 +1889,10 @@ var accountConnectSessionCommand = defineCommand5({
1882
1889
  var accountUpdateCommand = defineCommand5({
1883
1890
  meta: {
1884
1891
  name: "update",
1885
- description: "Update an account's metadata, connection location, own proxy or whether its Connections are saved as Contacts. Prints the updated account, with connection_location re-read after a location change.",
1892
+ description: "Update an account's metadata, connection location, own proxy or whether its Connections are saved as Leads. Prints the updated account, with connection_location re-read after a location change.",
1886
1893
  risk: "write",
1887
1894
  rules: {
1888
- changes: "Changes the Account's metadata, connection location, own proxy or Save Connections as Contacts.",
1895
+ changes: "Changes the Account's metadata, connection location, own proxy or Save Connections as Leads.",
1889
1896
  visible_to: "Your Team; LinkedIn sees the new location and may ask the owner to verify.",
1890
1897
  budget_rows: [],
1891
1898
  retry: "Safe: the same values written again leave the Account the same.",
@@ -1910,7 +1917,7 @@ var accountUpdateCommand = defineCommand5({
1910
1917
  "proxy-port": { type: "string", description: "Proxy port." },
1911
1918
  "proxy-username": { type: "string", description: "Proxy auth username." },
1912
1919
  "proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` },
1913
- "save-connections-as-contacts": { type: "boolean", description: "Save this account's Connections as Contacts (Automate; on by default): each person becomes one Contact in your team, do-not-contact people skipped. Turning it on also saves the Connections already synced; --no-save-connections-as-contacts stops it and keeps the Contacts saved so far." }
1920
+ "save-connections-as-leads": { type: "boolean", description: "Save this account's Connections as Leads (Automate; on by default): each person becomes one Lead in your team, do-not-contact people skipped. Turning it on also saves the Connections already synced; --no-save-connections-as-leads stops it and keeps the Leads saved so far." }
1914
1921
  },
1915
1922
  async run({ args }) {
1916
1923
  const flags = args;
@@ -6,16 +6,16 @@ import {
6
6
  grammarParams,
7
7
  renderOverview,
8
8
  windowParams
9
- } from "./chunk-FBLCSVIU.js";
9
+ } from "./chunk-EI64VFBE.js";
10
10
  import "./chunk-5S3MJVI5.js";
11
11
  import "./chunk-PPGKQJKU.js";
12
- import "./chunk-HOMRAZ6S.js";
12
+ import "./chunk-UWRWZG4N.js";
13
13
  import "./chunk-NNV2OYEF.js";
14
- import "./chunk-KXJJFHSD.js";
14
+ import "./chunk-MIOEYSBQ.js";
15
15
  import "./chunk-QM57YDJE.js";
16
- import "./chunk-N76WNJ5T.js";
16
+ import "./chunk-7PLTQHNO.js";
17
17
  import "./chunk-QLKGOIWS.js";
18
- import "./chunk-R4HS2MWM.js";
18
+ import "./chunk-MWVTFTWV.js";
19
19
  import "./chunk-ZYURL5VK.js";
20
20
  export {
21
21
  GRAMMAR_ARGS,
@@ -4,14 +4,14 @@ import {
4
4
  outputOpts,
5
5
  rootClient,
6
6
  usage
7
- } from "./chunk-HOMRAZ6S.js";
7
+ } from "./chunk-UWRWZG4N.js";
8
8
  import {
9
9
  buildPreviewOutput
10
10
  } from "./chunk-TCUYH5GO.js";
11
11
  import {
12
12
  renderSuccess
13
13
  } from "./chunk-QM57YDJE.js";
14
- import "./chunk-N76WNJ5T.js";
14
+ import "./chunk-7PLTQHNO.js";
15
15
  import {
16
16
  READ_SINGLE_FLAGS,
17
17
  WRITE_SINGLE_FLAGS,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-QLKGOIWS.js";
20
20
  import {
21
21
  DESCRIPTIONS
22
- } from "./chunk-R4HS2MWM.js";
22
+ } from "./chunk-MWVTFTWV.js";
23
23
  import "./chunk-ZYURL5VK.js";
24
24
 
25
25
  // src/commands/beta-consent.ts
@@ -72,7 +72,7 @@ var betaCommand = defineCommand({
72
72
  meta: { name: "beta", description: DESCRIPTIONS.beta },
73
73
  subCommands: { status: statusCmd, update: updateCmd },
74
74
  async run() {
75
- const { showHelp } = await import("./examples-KAMXHRLE.js");
75
+ const { showHelp } = await import("./examples-IGQJCSNL.js");
76
76
  await showHelp(betaCommand, ["curviate", "beta"]);
77
77
  }
78
78
  });