@curviate/sdk 0.12.0 → 0.13.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 +40 -0
- package/dist/index.d.ts +345 -234
- package/dist/index.js +102 -37
- package/package.json +1 -1
- package/src/generated/types.ts +236 -190
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,46 @@ Versioning: semantic — minor for additive changes, patch for bug fixes; no sta
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## [0.13.0] — 2026-07-05
|
|
11
|
+
|
|
12
|
+
Accounts/Auth surface migration. This is a **breaking** minor (pre-1.0): the account
|
|
13
|
+
connection and checkpoint surface was reshaped end-to-end. All changes are on the
|
|
14
|
+
`accounts` namespace; no other namespace is affected.
|
|
15
|
+
|
|
16
|
+
### Removed (BREAKING)
|
|
17
|
+
|
|
18
|
+
- **`accounts.refresh(accountId)` removed** — the underlying endpoint (`POST /v1/accounts/{account_id}/refresh`) no longer exists and has no alias. Accounts now restart and re-sync automatically; status freshness is served by the real-time account-status webhook, the nightly reconcile, and `accounts.get()`'s stale-while-revalidate background refresh. Remove any `accounts.refresh()` call sites. Type `AccountRefreshResult` is removed.
|
|
19
|
+
- **`accounts.submitCheckpoint(body)` removed** — renamed to `accounts.solveCheckpoint(accountId, { code })` (see below). No alias.
|
|
20
|
+
- **`accounts.resendCheckpoint(body)` removed** — renamed to `accounts.requestCheckpoint(accountId)` (see below). No alias.
|
|
21
|
+
|
|
22
|
+
### Changed (BREAKING)
|
|
23
|
+
|
|
24
|
+
- **Checkpoint operations are now account-in-path.** The three checkpoint methods take the account id as a **path argument** instead of an `account_id` body field:
|
|
25
|
+
- `submitCheckpoint({ account_id, code })` → **`solveCheckpoint(account_id, { code })`** (`POST /v1/accounts/{account_id}/checkpoint/solve`). Returns the connected account (201) or a chained checkpoint (202).
|
|
26
|
+
- `resendCheckpoint({ account_id })` → **`requestCheckpoint(account_id)`** (`POST /v1/accounts/{account_id}/checkpoint/request`). Returns `{ object, account_id, resent }` — `resent` is still honest (`false` when there is nothing to re-send).
|
|
27
|
+
- `pollCheckpoint({ account_id })` → **`pollCheckpoint(account_id)`** (`POST /v1/accounts/{account_id}/checkpoint/poll`) — same name, now a single string arg (no body).
|
|
28
|
+
- Migration: `submitCheckpoint({ account_id, code })` → `solveCheckpoint(account_id, { code })`; `resendCheckpoint({ account_id })` → `requestCheckpoint(account_id)`; `pollCheckpoint({ account_id })` → `pollCheckpoint(account_id)`.
|
|
29
|
+
- Types: `AccountSubmitCheckpointBody`/`AccountSubmitCheckpointResult` → `AccountSolveCheckpointBody`/`AccountSolveCheckpointResult`; `AccountResendCheckpointBody`/`AccountResendCheckpointResult` → `AccountRequestCheckpointResult` (no body type); `AccountPollCheckpointBody` removed (no body).
|
|
30
|
+
- **`accounts.createConnectLink()` is create-only.** The `purpose` and `account_id` body fields are removed — it now only mints a link to connect a **new** account (`{ seat_id, expires_in_seconds?, redirect_url? }`). To re-authorize an existing account via a hosted link, use the new `accounts.createReconnectLink()` (below). Type `AccountConnectLinkBody` no longer carries `purpose`/`account_id`.
|
|
31
|
+
- **`accounts.update()` body reshaped.** The managed `country` / `ip` knobs are removed from `PATCH /v1/accounts/{account_id}`; the body is now `{ metadata?, proxy? }`. `metadata` is a flat string map that **replaces** the account's custom-data store wholesale; `proxy` sets a custom egress proxy (the managed location is now chosen at connect time, not here). Passing `country`/`ip` is rejected with `INVALID_REQUEST`. Type `AccountUpdateBody` changed. *(Known limitation: the generated body type does not yet express `proxy: null` to clear a custom proxy — the server accepts it, but a strict TypeScript caller must cast until the schema surfaces the nullability. The CLI's `account update --clear-proxy` sends it directly.)*
|
|
32
|
+
- **Cookie auth requires `user_agent`.** `accounts.link()` and `accounts.reconnect()` now require a `user_agent` when `auth_method: "cookie"`; without one the request is rejected with `INVALID_REQUEST`. It stays optional for `auth_method: "credentials"`. (Enforced server-side; the flat request-body type cannot make it conditionally required, so pass it whenever you connect by cookie.)
|
|
33
|
+
- **`accounts.reconnect()` result is now a `200 | 202` union.** A reconnect can itself surface a checkpoint challenge — resolve it with `solveCheckpoint` / `pollCheckpoint`, exactly like `accounts.link()`. Discriminate on `result.object`. Type `AccountReconnectResult` is now a union.
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- **`accounts.createReconnectLink(accountId, body?)`.** Mint a one-time hosted **re-authorization** link for an existing disconnected account (`POST /v1/accounts/{account_id}/reconnect-link`) — the hosted counterpart of `accounts.reconnect()`. Body is optional (`{ expires_in_seconds?, redirect_url? }`). Returns `{ object: "hosted_auth_url", url, session_id, expires_at, account_id }`; poll completion with `accounts.getConnectSession(session_id)`. Types: `AccountReconnectLinkBody`, `AccountReconnectLinkResult`. The `accounts` namespace stays at 12 methods (`refresh` out, `createReconnectLink` in).
|
|
38
|
+
- **New `ErrorCode` value: `ACCOUNT_ALREADY_LINKED`.** The `409` a duplicate connect now returns from `accounts.link()`, `accounts.reconnect()`, and `accounts.solveCheckpoint()` — the substrate refused linking a LinkedIn identity that's already linked. `user_fixable: true`, `retry_likely_to_succeed: false` (reconnect or disconnect the existing account instead of retrying). When the caller's own tenant already owns the existing account, the error body's `account_id` names it; otherwise it stands alone. Added to the `ErrorCode` union and the transport's known-code set — previously this narrowed to `INTERNAL`, which is retryable, so a client would have retried a request that can never succeed.
|
|
39
|
+
- **Wider checkpoint challenge vocabulary.** The 202 `challenge_type` enum now covers `otp | two_factor_sms | two_factor_app | two_factor_whatsapp | mobile_app_approval | otp_or_mobile_app_approval | contract_selection`, and a `contract_selection` challenge additionally carries `contracts: [{ id, name }]` (choose one and pass its id to `solveCheckpoint`).
|
|
40
|
+
- **422 dead-end challenge error documents a `challenge_type`, but it isn't typed yet.** When a checkpoint challenge can't be resolved automatically (e.g. a CAPTCHA or a phone-number registration), the `422` response carries a machine-readable `challenge_type: "captcha" | "phone_register"` in prose (`fixtures/openapi.json`) — but the response schema is still the generic `Error` type, so a caller can't type-branch on it programmatically yet.
|
|
41
|
+
- **Connect-recovery + honest terminal signals on the connection responses (additive, non-breaking).**
|
|
42
|
+
- `accounts.link()` and `accounts.solveCheckpoint()` 201 responses now carry an optional `recovered` boolean — `true` only when the connect reclaimed a LinkedIn identity already present on the workspace (claiming it into your account) rather than connecting a brand-new one; absent on a normal connect.
|
|
43
|
+
- The `status` on those same 201 responses is widened from `"active"` to `"active" | "reconnect_needed" | "restricted" | "disconnected"` — it now reflects the account's real observed state, which a recovered identity often reports as needing a reconnect.
|
|
44
|
+
- `accounts.pollCheckpoint()` now carries `challenge_type` (`"mobile_app_approval"`) and a human-readable `recovery_hint` on a `status: "expired"` mobile-approval timeout, so a client can render the right recovery guidance without parsing prose.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- Regenerated types from the current API surface. `accounts.get()` / `accounts.list()` still return the six cached enrichment fields, but `username`, `premium_id`, `public_identifier`, `signatures`, and `groups` are no longer refreshed by background enrichment — they read `null`/`[]` for newly connected accounts (any previously cached value is retained). `full_name` and `substrate_created_at` continue to populate; `substrate_created_at` remains ISO-8601 UTC.
|
|
49
|
+
|
|
10
50
|
## [0.12.0] — 2026-07-05
|
|
11
51
|
|
|
12
52
|
### Added
|