@curviate/cli 0.48.0 → 0.49.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 (44) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +35 -1
  3. package/dist/{account-WKQHMM7P.js → account-2BH2Q6VG.js} +6 -6
  4. package/dist/{chunk-TSOIZBBU.js → chunk-3RCW7URJ.js} +1 -1
  5. package/dist/{chunk-OHXYFICP.js → chunk-5ZGTU4VD.js} +1 -1
  6. package/dist/{chunk-GQKC6E5K.js → chunk-D2S5OCYU.js} +2 -0
  7. package/dist/{chunk-Y7K4UBFC.js → chunk-JYKYD57J.js} +1 -1
  8. package/dist/chunk-MGB6FE4A.js +58 -0
  9. package/dist/{chunk-76SWLAZ6.js → chunk-RXWODUWA.js} +43 -1
  10. package/dist/{chunk-MKGVNDMJ.js → chunk-SA2QHAXG.js} +1 -1
  11. package/dist/{chunk-AYKKXGTR.js → chunk-TEAWYLPO.js} +353 -1
  12. package/dist/{chunk-Q63IIPL2.js → chunk-V7FJWTZW.js} +2 -2
  13. package/dist/{chunk-CVMSQ3OF.js → chunk-Y7MZZRYR.js} +3 -1
  14. package/dist/{chunk-YFXLXION.js → chunk-Z7OQSWBD.js} +6 -6
  15. package/dist/cli.js +16 -14
  16. package/dist/{comment-7IQ6ZOJF.js → comment-MRDPDA33.js} +8 -8
  17. package/dist/{company-RD7RDGSA.js → company-2AEHSGHA.js} +8 -8
  18. package/dist/{config-EYBNYRGK.js → config-NRBKHXES.js} +3 -3
  19. package/dist/{connect-HVXT67A6.js → connect-4XEBV5V3.js} +12 -12
  20. package/dist/core-RGU2SCBN.js +46 -0
  21. package/dist/{doctor-HUXQERLQ.js → doctor-BZ4DA7DV.js} +5 -5
  22. package/dist/{document-AUUCGST2.js → document-RKHRWXNT.js} +1 -1
  23. package/dist/{draft-DFO22K6Q.js → draft-C5N6EOO5.js} +5 -5
  24. package/dist/enrollment-BNQOUKI7.js +472 -0
  25. package/dist/{examples-64YT5V5K.js → examples-NIMSIXMV.js} +2 -2
  26. package/dist/{exit-codes-AW6KHDDN.js → exit-codes-TLMKTLRI.js} +1 -1
  27. package/dist/{feed-JWP6ANPI.js → feed-DFUU7SUJ.js} +7 -7
  28. package/dist/{group-SIQFJEZV.js → group-CSD2OWOZ.js} +7 -7
  29. package/dist/{inbox-MMIMCA5O.js → inbox-SNSPWI7J.js} +7 -7
  30. package/dist/{inboxes-RND3D4C7.js → inboxes-RIRHPS4H.js} +7 -7
  31. package/dist/{job-ACFKBLFK.js → job-6PNXXZNF.js} +7 -7
  32. package/dist/{login-ZOB5KVKQ.js → login-Y7JBAHCW.js} +3 -3
  33. package/dist/{message-OFK6UVXR.js → message-2IK4MBBG.js} +7 -7
  34. package/dist/motion-7ATUXO6R.js +946 -0
  35. package/dist/{notification-KKGAZU7M.js → notification-VYK5NDEB.js} +7 -7
  36. package/dist/{post-A5SBCFB2.js → post-AN6T2OJF.js} +8 -8
  37. package/dist/{profile-4SOOQZ4K.js → profile-UQY64642.js} +17 -17
  38. package/dist/{recruiter-YN73STDP.js → recruiter-OY4RN5HH.js} +13 -13
  39. package/dist/{sales-nav-JXF5RY2K.js → sales-nav-KLODLYMW.js} +13 -13
  40. package/dist/{search-JAL242A2.js → search-NWP5S6CF.js} +17 -17
  41. package/dist/{setup-WICWH4JG.js → setup-YPPFLH2N.js} +5 -5
  42. package/dist/{webhook-UGKVYWBC.js → webhook-OHKBL3YS.js} +22 -24
  43. package/package.json +2 -2
  44. package/dist/core-6XYGUNAY.js +0 -46
package/CHANGELOG.md CHANGED
@@ -6,6 +6,63 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
7
7
  a new command or flag is a minor; a breaking command/flag/exit-code change is a major (before 1.0.0, a minor); a fix is a patch.
8
8
 
9
+ ## [0.49.0] - 2026-10-22
10
+
11
+ A minor: Motions and Enrollments arrive as top-level groups. Requires
12
+ `@curviate/sdk` 0.44.0 (exact pin). The vendored OpenAPI fixture is re-copied
13
+ from the SDK's fixture.
14
+
15
+ ### Added
16
+
17
+ - `curviate motion`: `list`, `get` (with `--version` for one Sequence
18
+ version), `create --file`, `update --file [--if-revision <n>]`, `start`,
19
+ `pause`, `resume`, `archive`, `delete`, `preview [--sample | --contact]`,
20
+ `add` and `remove` (`--contact`, sent in requests of up to 1000 ids, in
21
+ order; a failed request stops the run and reports what was sent), and two
22
+ offline commands: `lint --file` and `init --template [--output]`.
23
+ - A Motion file is checked before anything is sent: its fields against the
24
+ published schema, its Sequence with the SDK's `validateSequence`. Sequence
25
+ findings print one per line, `<file>:<line>:<col> error R12 <path>: <message>.
26
+ <hint> -> <docs_url>`, the same as `curviate motion lint`.
27
+ - `curviate motion get` output is a Motion file: `motion create --file -` and
28
+ `motion update <id> --file -` accept it, dropping the keys Curviate sets with a
29
+ warning naming each.
30
+ - `curviate motion update --if-revision <n>`: refused with `SEQUENCE_CONFLICT`
31
+ (exit 2) when someone saved the Sequence since; the message names the newer
32
+ revision and who saved it.
33
+ - `curviate motion init --template` writes `connect-and-converse`,
34
+ `engage-then-connect` or `nurture-connections` (which follows up only when the
35
+ first message was seen) in this machine's timezone.
36
+ - `curviate enrollment`: `list` (filters `--motion`, `--contact`, `--status`,
37
+ `--step`, `--version`, `--done-step` with `--outcome`, `--reason`,
38
+ `--variant`, `--relationship`), `get`, `pause`, `resume [--at]`, `retry`,
39
+ `stop`, `event <id> <name>`, `reassign --account`, and `bulk --action` over
40
+ `--id` or `--motion` with the list filters.
41
+ - `curviate enrollment retry` retries only a failed Step (a repeat never sends a
42
+ delivered message again), then waits for the re-run (`--wait-timeout <ms>`, default
43
+ 600000) and prints its outcome, reason and message.
44
+ - In human output, each Enrollment reason reads `<code>: <message>` (skip,
45
+ finish and every history entry); `--json` keeps the API's code and message
46
+ keys.
47
+ - `curviate webhook create --source motion` and `--motion-ids`.
48
+
49
+ ### Changed
50
+
51
+ - `curviate webhook create`: `--account-ids` is optional for every source;
52
+ omitted, the webhook covers every account you can operate, now and later.
53
+ - `curviate enrollment resume --at` is a jump: it re-enters the named Step even
54
+ when that Step already sent. Use `curviate enrollment retry` for a failed Step.
55
+ - Exit codes for the new error codes: `SEQUENCE_INVALID`, `SEQUENCE_CONFLICT`,
56
+ `NOTHING_TO_RETRY`, `MOTION_STATUS_CONFLICT`, `ENROLLMENT_NOT_ACTIVE` and the
57
+ other Motion refusals exit 2; `STEP_IN_FLIGHT` exits 7 (read again in a
58
+ minute); `TIER_REQUIRED` and the team-role codes exit 5; a request timeout
59
+ exits 7.
60
+
61
+ ### Deprecated
62
+
63
+ - `curviate enrollment signal` is an alias of `curviate enrollment event`,
64
+ accepted until 2027-01-19.
65
+
9
66
  ## [0.48.0] - 2026-10-19
10
67
 
11
68
  A breaking minor (pre-1.0): the LinkedIn commands move under `curviate core`.
package/README.md CHANGED
@@ -309,6 +309,40 @@ curviate core draft list --account none --all --json
309
309
 
310
310
  A scheduled post that fails to publish becomes a `failed` Draft with a `failure` code; any `curviate core draft update` on it clears the failure. Failed `outcome_unknown` means the post may be live: check the account's posts before retrying.
311
311
 
312
+ ## Motions and Enrollments
313
+
314
+ A Motion runs one Sequence for the Contacts of your Contact lists, from its sending accounts, paced on a schedule. It is created as a draft and does nothing until you start it. An Enrollment is one Contact in one Motion on one account. Both belong to your team: `--account` is never read from your config for them.
315
+
316
+ ### 1. From a template to a running Motion
317
+
318
+ ```bash
319
+ curviate motion init --template connect-and-converse --output motion.json # offline; fill contact_list_ids and account_ids
320
+ curviate motion lint --file motion.json # offline: the rules the API applies
321
+ curviate motion create --file motion.json --json
322
+ curviate motion preview mot_1 --sample 3 --json # rendered messages and the budget projection; spends nothing
323
+ curviate motion start mot_1 --json
324
+ ```
325
+
326
+ `curviate motion lint` prints one line per finding, compiler style, and exits 2 on any error:
327
+
328
+ ```text
329
+ motion.json:7:32 error R12 pause.wait: must be a duration between 1m and 365d: a number then m, h or d, like 30d. Use a duration between 1m and 365d, for example 1d. -> https://docs.curviate.com/reference/sequence-rules#r12
330
+ ```
331
+
332
+ `curviate motion create` and `curviate motion update` check the same way before anything is sent. `curviate motion get mot_1 --json` prints a file `curviate motion update mot_1 --file -` accepts as is; add `--if-revision <n>` to refuse the save when someone changed the Sequence since you read it.
333
+
334
+ ### 2. Find and fix Enrollments
335
+
336
+ ```bash
337
+ curviate enrollment list --motion mot_1 --done-step opener --outcome failed --json
338
+ curviate enrollment retry enr_1 --json # only a failed Step; waits for the re-run and prints its outcome
339
+ curviate enrollment bulk --action retry --motion mot_1 --done-step opener --outcome failed --json
340
+ curviate enrollment pause enr_1 --json
341
+ curviate enrollment resume enr_1 --json # lifts your pause
342
+ ```
343
+
344
+ `curviate enrollment resume <id> --at <step>` is a jump, not a retry: it re-enters that Step even when it already sent. `curviate enrollment retry` never sends a delivered message again.
345
+
312
346
  ## Sales Navigator
313
347
 
314
348
  Sales Navigator commands (`curviate core sales-nav ...`) are **beta**: this surface has not been
@@ -620,7 +654,7 @@ curviate core inbox get 2-AbCdEf== --account acc_1 --mode cache_only --json
620
654
  | 2 | Usage / argument error |
621
655
  | 3 | Authentication or authorization failure |
622
656
  | 4 | Resource not found |
623
- | 5 | No active seat, the LinkedIn account lacks the subscription, or beta consent is missing |
657
+ | 5 | Someone must act first: no active seat, the LinkedIn account lacks the subscription, beta consent is missing, the plan is below the Tier the action needs, or a teammate with the right role (or the Account's own person) must do it |
624
658
  | 6 | Rate limited |
625
659
  | 7 | Transient platform error (retry likely to succeed) |
626
660
  | 8 | Account or connection state blocks the request |
@@ -25,25 +25,25 @@ import {
25
25
  resolveEffectiveConfig,
26
26
  streamAll,
27
27
  writeNdjsonItem
28
- } from "./chunk-MKGVNDMJ.js";
28
+ } from "./chunk-SA2QHAXG.js";
29
29
  import {
30
30
  AUTH_NEEDED
31
- } from "./chunk-76SWLAZ6.js";
31
+ } from "./chunk-RXWODUWA.js";
32
32
  import {
33
33
  readlineSync
34
34
  } from "./chunk-YLSJ4HKU.js";
35
35
  import {
36
36
  createClient
37
- } from "./chunk-OHXYFICP.js";
37
+ } from "./chunk-5ZGTU4VD.js";
38
38
  import {
39
39
  GLOBAL_FLAGS,
40
40
  READ_SINGLE_FLAGS,
41
41
  WRITE_SINGLE_FLAGS,
42
42
  readOnly
43
- } from "./chunk-CVMSQ3OF.js";
43
+ } from "./chunk-Y7MZZRYR.js";
44
44
  import {
45
45
  DESCRIPTIONS
46
- } from "./chunk-GQKC6E5K.js";
46
+ } from "./chunk-D2S5OCYU.js";
47
47
  import {
48
48
  defaultReadStdin
49
49
  } from "./chunk-ZYURL5VK.js";
@@ -207,7 +207,7 @@ function resolveOutputOpts(flags) {
207
207
  async function handleError(err, outOpts, out) {
208
208
  const { CurviateError } = await import("@curviate/sdk");
209
209
  if (err instanceof CurviateError) {
210
- const { getExitCode } = await import("./exit-codes-AW6KHDDN.js");
210
+ const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
211
211
  renderError(err, outOpts, out);
212
212
  process.exit(getExitCode(err));
213
213
  }
@@ -3,7 +3,7 @@ import {
3
3
  parseDocument,
4
4
  readFileFlag,
5
5
  readStdinCapped
6
- } from "./chunk-AYKKXGTR.js";
6
+ } from "./chunk-TEAWYLPO.js";
7
7
  import {
8
8
  isStdinToken
9
9
  } from "./chunk-ZYURL5VK.js";
@@ -4,7 +4,7 @@ import {
4
4
  getRecheck,
5
5
  getWriteKind,
6
6
  isPoll
7
- } from "./chunk-CVMSQ3OF.js";
7
+ } from "./chunk-Y7MZZRYR.js";
8
8
  import {
9
9
  assertNoStdinPlaceholder
10
10
  } from "./chunk-ZYURL5VK.js";
@@ -7,6 +7,8 @@ var DESCRIPTIONS = {
7
7
  login: "Save an API key to a local profile. Run `curviate core profile me` to verify.",
8
8
  config: "Manage CLI profiles and settings.",
9
9
  account: "LinkedIn account connection management.",
10
+ motion: "Motions: one Sequence run for the Contacts of your Team's Contact lists, from its sending Accounts, paced on a schedule. Create and edit drafts, preview, start, pause, resume, archive, add or remove Contacts; lint a Sequence and write a template offline. Your Team's data: every role reads; writes need motion-send on each sending Account, and Motions need the Automate plan.",
11
+ enrollment: "Enrollments: one Contact in one Motion on one Account. List and read them; pause, resume, retry a failed Step, stop, send a custom event, reassign, or act on many at once. Your Team's data: every role reads; writes need operate on the Enrollment's Account.",
10
12
  webhook: "Webhook management and signature verification.",
11
13
  core: "Curviate core: LinkedIn building blocks. Each command runs one action now, from one Account, and counts against that Account's budgets. Nothing is queued, paced or retried for you, except a Draft scheduled with `--schedule-at`, which Curviate publishes at that time (`curviate core draft create`).",
12
14
  profile: "LinkedIn profile operations.",
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UEAX6KUB.js";
5
5
  import {
6
6
  readableId
7
- } from "./chunk-MKGVNDMJ.js";
7
+ } from "./chunk-SA2QHAXG.js";
8
8
 
9
9
  // src/lib/member-id.ts
10
10
  var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ renderError,
4
+ renderUnexpectedError,
5
+ resolveEffectiveConfig
6
+ } from "./chunk-SA2QHAXG.js";
7
+ import {
8
+ createClient
9
+ } from "./chunk-5ZGTU4VD.js";
10
+
11
+ // src/lib/root-command.ts
12
+ var outputOpts = (f) => ({
13
+ json: (f.json ?? false) || !process.stdout.isTTY,
14
+ isTTY: process.stdout.isTTY ?? false,
15
+ fields: f.fields,
16
+ verbose: f.verbose
17
+ });
18
+ function usage(message) {
19
+ process.stderr.write(`error: ${message}
20
+ `);
21
+ process.exit(2);
22
+ }
23
+ async function rootClient(f) {
24
+ const cfg = await resolveEffectiveConfig({ apiKey: f["api-key"], baseUrl: f["base-url"], timeout: f.timeout, profile: f.profile });
25
+ if (!cfg.apiKey) {
26
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
27
+ process.exit(3);
28
+ }
29
+ try {
30
+ return createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
31
+ } catch (err) {
32
+ return fail(err, f);
33
+ }
34
+ }
35
+ async function fail(err, f) {
36
+ const { CurviateError } = await import("@curviate/sdk");
37
+ if (err instanceof CurviateError) {
38
+ const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
39
+ renderError(err, outputOpts(f), process);
40
+ process.exit(getExitCode(err));
41
+ }
42
+ renderUnexpectedError(err, process);
43
+ process.exit(1);
44
+ }
45
+ function listFlag(flag, raw) {
46
+ if (raw === void 0) return [];
47
+ const ids = [].concat(raw).flatMap((v) => v.split(",")).map((s) => s.trim());
48
+ if (ids.length === 0 || ids.some((s) => s === "")) usage(`--${flag} was given an empty value. Pass one or more ids, comma-separated or with --${flag} repeated.`);
49
+ return ids;
50
+ }
51
+
52
+ export {
53
+ outputOpts,
54
+ usage,
55
+ rootClient,
56
+ fail,
57
+ listFlag
58
+ };
@@ -156,7 +156,49 @@ var EXIT_CODE_MAP = {
156
156
  // takes the same bucket. Not 7, which tells the caller to retry with
157
157
  // backoff. Not 11, which tells the caller the tenant's billing is at fault,
158
158
  // and here it is not. The `--json` envelope still names the real code.
159
- STRIPE_DRIFT_DETECTED: 1
159
+ STRIPE_DRIFT_DETECTED: 1,
160
+ // Teams: the credential is valid, a person with the right
161
+ // role, or the Account's own person, must act first (5, never 3, which tells
162
+ // a script to rotate its key). The credential is another team's: 3. The
163
+ // rest never succeed as sent: 2. TIER_REQUIRED joins the entitlement bucket.
164
+ INSUFFICIENT_ROLE: 5,
165
+ ACCOUNT_NOT_SHARED: 5,
166
+ ACCOUNT_OWNER_ONLY: 5,
167
+ BILLING_OWNER_REQUIRED: 5,
168
+ LAST_OWNER: 5,
169
+ TIER_REQUIRED: 5,
170
+ TEAM_ACCESS_DENIED: 3,
171
+ DEFAULT_TEAM_PROTECTED: 2,
172
+ ALREADY_MEMBER: 2,
173
+ INVITE_ALREADY_PENDING: 2,
174
+ INVITE_NOT_PENDING: 2,
175
+ INVITE_LIMIT_REACHED: 2,
176
+ CONNECT_REQUEST_NOT_PENDING: 2,
177
+ CONNECT_REQUEST_IN_USE: 2,
178
+ LINKEDIN_ACCOUNT_MISMATCH: 8,
179
+ // Contacts: a cap or a name clash never succeeds as sent; a full import queue drains (6).
180
+ NAME_TAKEN: 2,
181
+ RESOURCE_IN_USE: 2,
182
+ CONTACT_LIMIT_REACHED: 2,
183
+ IMPORT_QUEUE_FULL: 6,
184
+ // Motions and Enrollments. Every refusal but one never succeeds as
185
+ // sent (2): fix the document, merge the newer Sequence, or pick another
186
+ // Enrollment or Account. STEP_IN_FLIGHT settles within a minute (7, the
187
+ // DRAFT_PUBLISHING precedent: read again, then retry).
188
+ SEQUENCE_INVALID: 2,
189
+ SEQUENCE_CONFLICT: 2,
190
+ MOTION_NOT_STARTABLE: 2,
191
+ MOTION_STATUS_CONFLICT: 2,
192
+ ENROLLMENT_NOT_ACTIVE: 2,
193
+ NOTHING_TO_RETRY: 2,
194
+ ACCOUNT_ALREADY_ENGAGED: 2,
195
+ ALREADY_ENROLLED_ON_ACCOUNT: 2,
196
+ KNOWN_CHAT: 2,
197
+ CONTACT_NOT_ENROLLABLE: 2,
198
+ CHAT_NOT_ONE_TO_ONE: 2,
199
+ STEP_IN_FLIGHT: 7,
200
+ // Client-side: no response within --timeout. Transient, as a refused connection is.
201
+ CLIENT_TIMEOUT: 7
160
202
  };
161
203
  function getExitCode(error) {
162
204
  if (typeof error === "string") return EXIT_CODE_MAP[error] ?? 1;
@@ -3,7 +3,7 @@ import {
3
3
  isPlainObject,
4
4
  profileValue,
5
5
  readConfigFile
6
- } from "./chunk-OHXYFICP.js";
6
+ } from "./chunk-5ZGTU4VD.js";
7
7
  import {
8
8
  isStdinToken
9
9
  } from "./chunk-ZYURL5VK.js";
@@ -894,11 +894,362 @@ var documents_default = {
894
894
  }
895
895
  },
896
896
  additionalProperties: false
897
+ },
898
+ "motion create": {
899
+ type: "object",
900
+ properties: {
901
+ name: {
902
+ type: "string",
903
+ minLength: 1,
904
+ maxLength: 100
905
+ },
906
+ contact_list_ids: {
907
+ type: "array",
908
+ items: {
909
+ type: "string",
910
+ minLength: 1,
911
+ maxLength: 64
912
+ }
913
+ },
914
+ exclusion_list_ids: {
915
+ type: "array",
916
+ items: {
917
+ type: "string",
918
+ minLength: 1,
919
+ maxLength: 64
920
+ }
921
+ },
922
+ account_ids: {
923
+ type: "array",
924
+ items: {
925
+ type: "string",
926
+ minLength: 1,
927
+ maxLength: 64
928
+ }
929
+ },
930
+ schedule: {
931
+ type: "object",
932
+ properties: {
933
+ timezone: {
934
+ type: "string",
935
+ maxLength: 64,
936
+ nullable: true
937
+ },
938
+ days: {
939
+ type: "array",
940
+ items: {
941
+ type: "string",
942
+ enum: [
943
+ "mon",
944
+ "tue",
945
+ "wed",
946
+ "thu",
947
+ "fri",
948
+ "sat",
949
+ "sun"
950
+ ]
951
+ }
952
+ },
953
+ hours: {
954
+ type: "object",
955
+ properties: {
956
+ start: {
957
+ type: "string"
958
+ },
959
+ end: {
960
+ type: "string"
961
+ }
962
+ },
963
+ required: [
964
+ "start",
965
+ "end"
966
+ ],
967
+ additionalProperties: false
968
+ },
969
+ start_at: {
970
+ type: "string",
971
+ nullable: true
972
+ },
973
+ end_at: {
974
+ type: "string",
975
+ nullable: true
976
+ }
977
+ },
978
+ additionalProperties: false
979
+ },
980
+ settings: {
981
+ type: "object",
982
+ properties: {
983
+ accounts_per_contact: {
984
+ type: "integer",
985
+ minimum: 1,
986
+ maximum: 10
987
+ },
988
+ assign: {
989
+ type: "string",
990
+ enum: [
991
+ "auto",
992
+ "even",
993
+ "already_connected"
994
+ ]
995
+ },
996
+ new_enrollments_per_account_per_day: {
997
+ type: "integer",
998
+ minimum: 1,
999
+ maximum: 1e3
1000
+ },
1001
+ exclude: {
1002
+ type: "object",
1003
+ properties: {
1004
+ other_motions: {
1005
+ type: "boolean"
1006
+ },
1007
+ known_chats: {
1008
+ type: "boolean"
1009
+ }
1010
+ },
1011
+ additionalProperties: false
1012
+ },
1013
+ acceptance_floor: {
1014
+ type: "object",
1015
+ properties: {
1016
+ percent: {
1017
+ type: "integer",
1018
+ minimum: 0,
1019
+ maximum: 100
1020
+ },
1021
+ min_invites: {
1022
+ type: "integer",
1023
+ minimum: 10,
1024
+ maximum: 1e3
1025
+ }
1026
+ },
1027
+ additionalProperties: false,
1028
+ nullable: true
1029
+ },
1030
+ variables: {
1031
+ type: "object",
1032
+ additionalProperties: {
1033
+ type: "string",
1034
+ minLength: 1,
1035
+ nullable: true
1036
+ }
1037
+ },
1038
+ stop_on_engagement: {
1039
+ type: "boolean"
1040
+ }
1041
+ },
1042
+ additionalProperties: false
1043
+ },
1044
+ where: {
1045
+ type: "array",
1046
+ items: {}
1047
+ },
1048
+ sequence: {}
1049
+ },
1050
+ required: [
1051
+ "name"
1052
+ ],
1053
+ additionalProperties: false,
1054
+ "x-curviate-response-only": [
1055
+ "object",
1056
+ "id",
1057
+ "status",
1058
+ "pause_reason",
1059
+ "sequence_version",
1060
+ "sequence_revision",
1061
+ "sequence_updated_by_user_id",
1062
+ "counts",
1063
+ "warnings",
1064
+ "created_by_user_id",
1065
+ "created_at",
1066
+ "updated_at",
1067
+ "started_at",
1068
+ "completed_at",
1069
+ "archived_at",
1070
+ "safety_warning"
1071
+ ]
1072
+ },
1073
+ "motion update": {
1074
+ type: "object",
1075
+ properties: {
1076
+ name: {
1077
+ type: "string",
1078
+ minLength: 1,
1079
+ maxLength: 100
1080
+ },
1081
+ contact_list_ids: {
1082
+ type: "array",
1083
+ items: {
1084
+ type: "string",
1085
+ minLength: 1,
1086
+ maxLength: 64
1087
+ }
1088
+ },
1089
+ exclusion_list_ids: {
1090
+ type: "array",
1091
+ items: {
1092
+ type: "string",
1093
+ minLength: 1,
1094
+ maxLength: 64
1095
+ }
1096
+ },
1097
+ account_ids: {
1098
+ type: "array",
1099
+ items: {
1100
+ type: "string",
1101
+ minLength: 1,
1102
+ maxLength: 64
1103
+ }
1104
+ },
1105
+ schedule: {
1106
+ type: "object",
1107
+ properties: {
1108
+ timezone: {
1109
+ type: "string",
1110
+ maxLength: 64,
1111
+ nullable: true
1112
+ },
1113
+ days: {
1114
+ type: "array",
1115
+ items: {
1116
+ type: "string",
1117
+ enum: [
1118
+ "mon",
1119
+ "tue",
1120
+ "wed",
1121
+ "thu",
1122
+ "fri",
1123
+ "sat",
1124
+ "sun"
1125
+ ]
1126
+ }
1127
+ },
1128
+ hours: {
1129
+ type: "object",
1130
+ properties: {
1131
+ start: {
1132
+ type: "string"
1133
+ },
1134
+ end: {
1135
+ type: "string"
1136
+ }
1137
+ },
1138
+ required: [
1139
+ "start",
1140
+ "end"
1141
+ ],
1142
+ additionalProperties: false
1143
+ },
1144
+ start_at: {
1145
+ type: "string",
1146
+ nullable: true
1147
+ },
1148
+ end_at: {
1149
+ type: "string",
1150
+ nullable: true
1151
+ }
1152
+ },
1153
+ additionalProperties: false
1154
+ },
1155
+ settings: {
1156
+ type: "object",
1157
+ properties: {
1158
+ accounts_per_contact: {
1159
+ type: "integer",
1160
+ minimum: 1,
1161
+ maximum: 10
1162
+ },
1163
+ assign: {
1164
+ type: "string",
1165
+ enum: [
1166
+ "auto",
1167
+ "even",
1168
+ "already_connected"
1169
+ ]
1170
+ },
1171
+ new_enrollments_per_account_per_day: {
1172
+ type: "integer",
1173
+ minimum: 1,
1174
+ maximum: 1e3
1175
+ },
1176
+ exclude: {
1177
+ type: "object",
1178
+ properties: {
1179
+ other_motions: {
1180
+ type: "boolean"
1181
+ },
1182
+ known_chats: {
1183
+ type: "boolean"
1184
+ }
1185
+ },
1186
+ additionalProperties: false
1187
+ },
1188
+ acceptance_floor: {
1189
+ type: "object",
1190
+ properties: {
1191
+ percent: {
1192
+ type: "integer",
1193
+ minimum: 0,
1194
+ maximum: 100
1195
+ },
1196
+ min_invites: {
1197
+ type: "integer",
1198
+ minimum: 10,
1199
+ maximum: 1e3
1200
+ }
1201
+ },
1202
+ additionalProperties: false,
1203
+ nullable: true
1204
+ },
1205
+ variables: {
1206
+ type: "object",
1207
+ additionalProperties: {
1208
+ type: "string",
1209
+ minLength: 1,
1210
+ nullable: true
1211
+ }
1212
+ },
1213
+ stop_on_engagement: {
1214
+ type: "boolean"
1215
+ }
1216
+ },
1217
+ additionalProperties: false
1218
+ },
1219
+ where: {
1220
+ type: "array",
1221
+ items: {}
1222
+ },
1223
+ sequence: {},
1224
+ if_sequence_revision: {
1225
+ type: "integer",
1226
+ minimum: 0
1227
+ }
1228
+ },
1229
+ additionalProperties: false,
1230
+ "x-curviate-response-only": [
1231
+ "object",
1232
+ "id",
1233
+ "status",
1234
+ "pause_reason",
1235
+ "sequence_version",
1236
+ "sequence_revision",
1237
+ "sequence_updated_by_user_id",
1238
+ "counts",
1239
+ "warnings",
1240
+ "created_by_user_id",
1241
+ "created_at",
1242
+ "updated_at",
1243
+ "started_at",
1244
+ "completed_at",
1245
+ "archived_at",
1246
+ "safety_warning"
1247
+ ]
897
1248
  }
898
1249
  };
899
1250
 
900
1251
  // src/lib/document.ts
901
- var ENFORCED = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties", "enum", "const", "minLength", "maxLength", "minimum", "maximum", "items", "minItems", "maxItems", "oneOf"]);
1252
+ var ENFORCED = /* @__PURE__ */ new Set(["type", "properties", "required", "additionalProperties", "enum", "const", "minLength", "maxLength", "minimum", "maximum", "items", "minItems", "maxItems", "oneOf", "nullable"]);
902
1253
  var ANNOTATIONS = /* @__PURE__ */ new Set(["description", "title", "default", "discriminator"]);
903
1254
  function documentSchema(key) {
904
1255
  const s = documents_default[key];
@@ -1031,6 +1382,7 @@ function validate(schema, value, path = "") {
1031
1382
  if (results.some((r) => r.length === 0)) return [];
1032
1383
  return [{ path: at, rule: `must match one of: ${branches.map(shape).join(" | ")}` }];
1033
1384
  }
1385
+ if (value === null && schema["nullable"] === true) return out;
1034
1386
  const t = schema["type"];
1035
1387
  if (t && !isType(value, t)) return [{ path: at, rule: `must be ${t === "array" || t === "object" || t === "integer" ? "an" : "a"} ${t}` }];
1036
1388
  if ("const" in schema && value !== schema["const"]) out.push({ path: at, rule: `must be ${JSON.stringify(schema["const"])}` });