@curviate/sdk 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,98 @@ Versioning: semantic — minor for additive changes, patch for bug fixes; no sta
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.15.0] — 2026-07-11
11
+
12
+ Full v2 parity. The SDK is re-aligned 1:1 to the served API surface: every
13
+ operation is now exactly one method at the exact wire encoding, the entire
14
+ account-scoped surface moves to the account-first path grammar, and three
15
+ namespaces are reorganized. This is a **breaking** release touching nearly
16
+ every namespace. The five breaking categories below — removals, namespace
17
+ reorganization, method renames/relocations, request/response shape changes, and
18
+ the account-first path-grammar migration — are the complete set of breaks a
19
+ `0.14.1` → `0.15.0` upgrade must reconcile, gathered here so a consumer finds
20
+ every break in one place.
21
+
22
+ ### Removed (BREAKING)
23
+
24
+ - **14 methods that map to no served operation are removed, with no alias:**
25
+ - `accounts.createConnectLink()`, `accounts.createReconnectLink()`, `accounts.reconnect()` — hosted connect/reconnect link minting and in-place reconnect are no longer part of the API surface.
26
+ - `messaging.syncChat()`, `messaging.syncMessages()`, `recruiter.syncMessages()`, `salesNavigator.syncMessages()` — explicit sync operations are gone; accounts sync continuously and deliver via webhooks.
27
+ - `posts.list()` — the standalone feed list has no served operation (use `posts.listUserPosts(userId)` for a member's posts).
28
+ - `companies.followers()` — no served operation.
29
+ - `recruiter.addApplicant()`, `recruiter.rejectApplicant()`, `recruiter.solveJobCheckpoint()` — superseded by the project-centric pipeline surface.
30
+ - `webhooks.getStateDiff()` — no served operation.
31
+ - **`invites.respond()` is removed** — split into two dedicated bodyless methods, `invites.accept(invitationId)` and `invites.decline(invitationId)` (see below).
32
+ - **`profiles.getCompany()` stays removed** — dropped ahead of this release with no return; company reads live on the `companies` namespace.
33
+
34
+ ### Changed (BREAKING) — namespaces reorganized
35
+
36
+ - **`profiles` namespace renamed to `users`.** Every `curviate.account(id).profiles.*` call becomes `…users.*`; the served group is "Users" and every path is `/users/{user_id}`.
37
+ - **New root-scoped `auth` namespace, split out of `accounts`.** The connect/checkpoint operations move off `accounts`: `accounts.link` → `auth.intent`, `accounts.solveCheckpoint` → `auth.solveCheckpoint`, plus `auth.requestCheckpoint`, `auth.pollCheckpoint`, and `accounts.getConnectSession` → `auth.getSession(sessionId)`. `accounts` now carries only `list` / `get` / `update` / `disconnect`.
38
+ - **New account-scoped `comments` namespace.** The comment-thread surface (create / edit / delete / reply / list replies / reactions) plus the relocated `listUserComments` live here rather than on `posts`.
39
+ - **Root and account surfaces are now strictly disjoint.** The root client exposes only `accounts`, `auth`, `webhooks`. Every other namespace is reachable exclusively through `curviate.account(id)` — the account-scoped namespaces are no longer mounted on the root client (they cannot build a valid path without a bound `account_id`).
40
+
41
+ ### Changed (BREAKING) — methods renamed / relocated
42
+
43
+ - `profiles.endorse(userId, { skill_endorsement_id })` → **`users.endorseSkill(userId, { endorsement_id })`** — renamed, and the body key changed from `skill_endorsement_id` to `endorsement_id`.
44
+ - `profiles.listConnections()` → **`users.listRelations()`**.
45
+ - `messaging.getInMailBalance()` → **`users.getInMailCredits()`** (relocated onto `users`).
46
+ - `posts.comment(postId, …)` → **`comments.create(postId, …)`**.
47
+ - `profiles.listComments(userId)` → **`comments.listUserComments(userId)`**.
48
+ - `profiles.listPosts(userId)` → **`posts.listUserPosts(userId)`**.
49
+ - `profiles.listReactions(userId)` → **`posts.listUserReactions(userId)`**.
50
+ - `invites.respond(...)` → **`invites.accept(invitationId)` / `invites.decline(invitationId)`** (split; both bodyless).
51
+ - `recruiter.addCandidate(...)` → **`recruiter.saveCandidate(projectId, { stage_id, candidate_id })`**.
52
+ - `recruiter.getParameters(...)` (GET) → **`recruiter.searchParameters(body)` (POST)** — the HTTP verb changed GET→POST, with a `source`-discriminated body.
53
+ - `recruiter.listProjectJobs(projectId)` → **`recruiter.getProjectJob(projectId)`** — the operation returns the single attached job posting, not a list.
54
+
55
+ ### Changed (BREAKING) — request / response shapes
56
+
57
+ - **`users.update(userId, body)`** never sends `description`; accepted keys are `{ first_name, last_name, headline, bio, skills, picture, background_picture }`.
58
+ - **`users.endorseSkill`** body key is `endorsement_id` (was `skill_endorsement_id`).
59
+ - **`jobs.publish` / `recruiter.publishJob`** take a `mode`-discriminated body (`FREE` | `PROMOTED` | `PROMOTED_PLUS`; the `PROMOTED*` modes require a `budget { currency, amount, scope }`) and respond `{ object, job_state }`.
60
+ - **`jobs.close` / `recruiter.closeJob`** are bodyless POSTs responding `{ object }`.
61
+ - **`invites.cancel`** withdrawal now discriminates on `invitation_withdrawn`.
62
+ - **Message operations are re-homed under the chat.** `getMessage` / `editMessage` / `deleteMessage` / `addReaction` / `getAttachment` now path under `/chats/{chat_id}/messages/…` and take `chatId` as the leading argument.
63
+ - **`messaging.sendInMail`** body drops the `surface` field.
64
+ - **Media-bearing writes moved from multipart to JSON + base64** where the surface retired multipart (recruiter, sales-navigator, posts, messaging); read each operation's declared content-type — some remain multipart.
65
+ - **Sales Navigator `saveAccount` / `saveLead` bodies shrank** to the minimal saved-entity shape.
66
+ - **`recruiter.startChat`** now requires a `signature` (alongside `attendees_ids`, `text`, `subject`).
67
+ - **`recruiter.createJob`** now requires `project_name` and responds `{ job_id, object, project_id }` (was a full job object).
68
+ - **`recruiter.saveCandidate`** body is `{ stage_id, candidate_id }`.
69
+
70
+ ### Changed (BREAKING) — account-first path grammar
71
+
72
+ - **Every account-scoped method now carries `account_id` as the leading path segment** (`/v1/{account_id}/…`), never as a query parameter, body field, or omitted. Bind it once with `curviate.account(id)` and it is injected on every call. Companies and relations, which previously carried `account_id` as a query argument, drop it entirely.
73
+
74
+ ### Added
75
+
76
+ - **`comments` namespace (9 methods):** `listUserComments`, `create`, `edit`, `delete`, `reply`, `listReplies`, `listReactions`, `addReaction`, `removeReaction` — `removeReaction` is a DELETE that carries a `{ reaction }` body.
77
+ - **`jobs` write surface (9 new methods):** `list`, `create`, `update`, `getBudget`, `publish`, `close`, `listApplicants`, `getApplicant`, `downloadResume` (binary `ArrayBuffer`). `jobs.create` takes object-shaped `job_title` / `company` and a `method`-discriminated `apply_method`.
78
+ - **Project-centric `recruiter` surface (9 new methods):** `searchTalentPool`, `searchFromUrl`, `updateProject`, `listPipeline`, `getProjectJob`, `createProjectJob`, `getProjectJobBudget`, `updateProjectJob`, `closeJob`, with `getApplicant` / `downloadResume` re-homed under the project scope.
79
+ - **`users.follow` / `users.unfollow`** (bodyless POST / DELETE), **`users.listFollowing`**, **`users.update`**.
80
+ - **`messaging.markChatRead(chatId, { read })`**.
81
+ - **`search.fromUrl({ url })`** and **`salesNavigator.searchFromUrl({ url })`** — resolve a LinkedIn search-results URL into a search.
82
+ - **`posts.delete`** (bodyless, 204) and **`posts.unreact(postId, { reaction })`** (DELETE with body).
83
+ - **`users.get(userId)` accepts `'me'`** — `users.get('me')` reads the caller's own profile (folds in the old `getMe`).
84
+ - **New `ErrorCode` value: `LINKEDIN_OPERATION_NOT_SUPPORTED`.** The `422` a permanent LinkedIn platform limitation for the attempted operation returns (e.g. listing a non-self user's following list) — `user_fixable: true`, `retry_likely_to_succeed: false` (not a transient failure; retrying will not help). Added to the `ErrorCode` union and the transport's known-code set — previously this narrowed to `INTERNAL`, which is retryable.
85
+
86
+ ### Fixed
87
+
88
+ - **`CONNECTION_REQUEST_CONFLICT` was silently downgraded to `INTERNAL`.** The `409` the API returns when a connect-request to a member already exists (or you are already a first-degree connection) is a real, documented error code, but the transport's runtime known-code set omitted it — so callers received `code: "INTERNAL"` with the wrong semantics (`INTERNAL` is retryable, whereas this conflict is `user_fixable: true`, `retry_likely_to_succeed: false` and must never be re-sent). The transport now decodes `CONNECTION_REQUEST_CONFLICT` to itself. To eliminate the class of bug: the `ErrorCode` type and the transport's runtime known-code set are now both **derived from one source array**, so the code a caller narrows on and the code the transport recognizes can never drift apart again.
89
+ - **`RATE_LIMITED` was silently downgraded to `INTERNAL`.** The `429` the Recruiter and Sales Navigator read surface returns under LinkedIn-platform throttling (dedicated `RateLimit-Policy` / `RateLimit` / `Retry-After` response headers, `retry_likely_to_succeed: true`) is a real, documented error code, but the transport's runtime known-code set omitted it — so callers received `code: "INTERNAL"`, which happened to auto-retry on `GET`/`HEAD` by accident but with the wrong (generic backoff) delay instead of honoring `Retry-After`. The transport now decodes `RATE_LIMITED` to itself and retries it on `GET`/`HEAD` like the other rate-limit codes, honoring `Retry-After`.
90
+ - **`users.update` forwarded an unsupported `description` key if a caller smuggled one in.** The `UserUpdateBody` type never declared `description`, so a typed caller was already rejected at compile time — but an untyped/JS caller (or an `as`-cast) could still put it on the object, and `update()` forwarded the body verbatim with no runtime check. `update()` now strips `description` from the outgoing payload before the request is sent, regardless of caller strictness.
91
+
92
+ ---
93
+
94
+ ## [0.14.1] — 2026-07-07
95
+
96
+ ### Fixed
97
+
98
+ - **`constructEvent` examples referenced a wrong header name (`X-Curviate-Signature` → `Curviate-Signature`); corrected a stale default-count description.** The JSDoc and both code examples (Express/Node, Hono) for `constructEvent` named the header `X-Curviate-Signature`; the dispatcher actually sends `Curviate-Signature` (Node lowercases it to `curviate-signature` on `req.headers`), so integrators copying the examples verbatim got `undefined` for the signature header. Also corrected the generated `events` field description on the webhook-create schema from a stale "default: all 7" to "default: all 11 lifecycle events", matching the account_status catalogue.
99
+
100
+ ---
101
+
10
102
  ## [0.14.0] — 2026-07-07
11
103
 
12
104
  Webhooks surface re-based onto the v2 catalogue. Additive minor: one new method,
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The official TypeScript SDK for the [Curviate API](https://docs.curviate.com) — agent-native
4
4
  LinkedIn infrastructure for AI engineers and agent builders.
5
5
 
6
- > **Status:** `0.1.0` — pre-GA. The surface is public but not yet stability-promised.
6
+ > **Status:** `0.15.0` — pre-1.0. Full v2 API parity; the surface is public but not yet stability-promised.
7
7
 
8
8
  ---
9
9
 
@@ -37,10 +37,10 @@ const curviate = new Curviate({
37
37
 
38
38
  ## Account-scoped accessor
39
39
 
40
- Every LinkedIn operation (messages, profiles, invites, posts) is tied to a **managed account** — a LinkedIn session you have connected via `curviate.accounts.link()`. The `curviate.account(id)` accessor fixes the `account_id` on every call so you do not have to thread it manually:
40
+ Every LinkedIn operation (messages, member profiles, invites, posts) is tied to a **managed account** — a LinkedIn session you have connected via the connect flow (`curviate.auth.intent()`). The `curviate.account(id)` accessor fixes the `account_id` on every call so you do not have to thread it manually:
41
41
 
42
42
  ```ts
43
- // Root-level: tenant-wide operations
43
+ // Root-level: tenant-wide operations (accounts, auth, webhooks)
44
44
  const { items: accounts } = await curviate.accounts.list();
45
45
 
46
46
  // Account-scoped: all LinkedIn ops under a specific account
@@ -48,7 +48,8 @@ const acc = curviate.account(accounts?.[0]?.account_id ?? "");
48
48
 
49
49
  // Now every resource call is scoped to that account:
50
50
  const { items: chats } = await acc.messaging.listChats();
51
- const profile = await acc.profiles.get("some-profile-id");
51
+ const me = await acc.users.get("me"); // your own profile
52
+ const profile = await acc.users.get("some-user-id"); // someone else's
52
53
  ```
53
54
 
54
55
  ---
@@ -131,7 +132,7 @@ Resources that return lists support cursor pagination. `curviate.paginate()` is
131
132
  ```ts
132
133
  // Iterate over every chat across all pages
133
134
  for await (const chat of curviate.paginate(acc.messaging.listChats.bind(acc.messaging), {})) {
134
- console.log(chat.id, chat.unread_count);
135
+ console.log(chat.id);
135
136
  }
136
137
 
137
138
  // With initial params
@@ -154,7 +155,7 @@ import { constructEvent, WebhookSignatureError } from "@curviate/sdk";
154
155
 
155
156
  // Express (Node 18+)
156
157
  app.post("/webhook", express.raw({ type: "application/json" }), async (req, res) => {
157
- const sig = req.headers["x-curviate-signature"] as string;
158
+ const sig = req.headers["curviate-signature"] as string;
158
159
  const secret = process.env.CURVIATE_WEBHOOK_SECRET!;
159
160
 
160
161
  let event;
@@ -185,7 +186,7 @@ app.post("/webhook", express.raw({ type: "application/json" }), async (req, res)
185
186
  // Hono / Vercel Edge — always await (Web Crypto is async)
186
187
  app.post("/webhook", async (c) => {
187
188
  const rawBody = await c.req.text();
188
- const event = await constructEvent(rawBody, c.req.header("x-curviate-signature")!, secret);
189
+ const event = await constructEvent(rawBody, c.req.header("curviate-signature")!, secret);
189
190
  return c.text("ok");
190
191
  });
191
192
  ```