@curviate/sdk 0.39.0 → 0.40.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
@@ -9,6 +9,54 @@ Versioning: semantic. Minor for additive changes, patch for bug fixes; no stabil
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.40.0] - 2026-10-01
13
+
14
+ Fixture and types regenerated against the deployed production document
15
+ (`https://api.curviate.com`, 130 paths, server
16
+ `66421dcfa43949f2fd60b2872ef7fe3b16a79660`).
17
+
18
+ ### Changed
19
+
20
+ - **A blank search filter or keyword is now refused with a `400`.** The
21
+ served document marks every free-text search filter and keyword
22
+ `minLength: 1`, and the server enforces it. A caller that sends an empty
23
+ string (`""`) for a filter or `keywords` used to get a search that ignored
24
+ it, and now gets `INVALID_REQUEST`. Omit the field instead of sending it
25
+ empty. The SDK does not validate this client-side, so the refusal comes from
26
+ the server. This is the one behaviour change in the release: callers that
27
+ pass `""` through from user input need to drop the key first.
28
+ - **`POST /v1/auth/checkpoint/poll` and `POST /v1/auth/checkpoint/solve` now
29
+ return `409 ACCOUNT_ALREADY_LINKED` when the approved LinkedIn identity is
30
+ already connected.** On solve, the body carries `account_id` when the
31
+ existing account is yours, so you can reuse it. When the identity is held by
32
+ another workspace, poll and solve name no account and the error is not
33
+ retryable. The
34
+ `CHECKPOINT_EXPIRED`, `CHECKPOINT_ALREADY_RESOLVED` and
35
+ `CONNECTION_IN_PROGRESS` 409s are unchanged. The generated 409 descriptions
36
+ and the `ACCOUNT_ALREADY_LINKED` note in `errors.ts` say so.
37
+
38
+ ### Fixed
39
+
40
+ - **`TOOLSET_DISABLED` and `AMBIGUOUS_IDENTIFIER` are now in the error
41
+ taxonomy.** The served `Error` type documents an extra field for each
42
+ (`toolset`, `candidates`), but the SDK did not carry either code, so a
43
+ response with one decoded to `INTERNAL`, which is retryable and reads as a
44
+ server fault. They now decode to themselves and are not retried. A new guard
45
+ reads the codes named in the `Error` extras descriptions from the fixture and
46
+ fails if the taxonomy lacks one.
47
+
48
+ ### Added
49
+
50
+ - **The generated `Error` type documents the per-code extra fields**, each
51
+ optional and present only on its code: `portal_url` (`PAYMENT_REQUIRED`,
52
+ `ACCOUNT_DISPUTED`; `null` when no portal session could be opened),
53
+ `attempts_remaining` (`CHECKPOINT_INVALID_CODE`), `challenge_type`
54
+ (`CHECKPOINT_UNSUPPORTED`), `account_id` (`ACCOUNT_ALREADY_LINKED`), `quota`
55
+ (`RATE_LIMIT_ACCOUNT`), `toolset` (`TOOLSET_DISABLED`) and `candidates`
56
+ (`AMBIGUOUS_IDENTIFIER`, each `{ id, name }`). These are types only:
57
+ `CurviateError` does not surface them as properties yet, so read them from
58
+ the response body if you need them.
59
+
12
60
  ## [0.39.0] - 2026-09-28
13
61
 
14
62
  Fixture and types regenerated against the deployed production document
package/dist/index.d.ts CHANGED
@@ -2878,6 +2878,25 @@ interface components {
2878
2878
  name?: string;
2879
2879
  }[];
2880
2880
  }[];
2881
+ /** @description Present on PAYMENT_REQUIRED and ACCOUNT_DISPUTED: the self-service page where the tenant resolves the payment problem, so an agent can hand a human one link. Null when no portal session could be opened; fall back to the dashboard. */
2882
+ portal_url?: string | null;
2883
+ /** @description Present on CHECKPOINT_INVALID_CODE: how many more verification codes the checkpoint accepts before it locks. Stop and ask the account owner for a fresh code when it reaches zero, rather than guessing. */
2884
+ attempts_remaining?: number;
2885
+ /** @description Present on CHECKPOINT_UNSUPPORTED: the kind of verification challenge LinkedIn raised that cannot be solved through this API. A human has to complete it in LinkedIn, then the account reconnects. */
2886
+ challenge_type?: string;
2887
+ /** @description Present on ACCOUNT_ALREADY_LINKED: the id of your own existing account for this LinkedIn profile, so you can reuse it instead of linking again. Only ever an account of the calling tenant. */
2888
+ account_id?: string;
2889
+ /** @description Present on RATE_LIMIT_ACCOUNT: the per-account request ceiling that was breached, with its name, the units remaining and total, and the absolute reset_time. Wait until reset_time before retrying. */
2890
+ quota?: Record<string, never>;
2891
+ /** @description Present on TOOLSET_DISABLED: the name of the toolset that is switched off for this tenant, so you can enable it or use another tool. */
2892
+ toolset?: string;
2893
+ /** @description Present on AMBIGUOUS_IDENTIFIER: the entries the identifier matched. Pick one and re-send its id. */
2894
+ candidates?: {
2895
+ /** @description The id to send instead of the ambiguous identifier. */
2896
+ id?: string;
2897
+ /** @description Human-readable label for this entry. */
2898
+ name?: string;
2899
+ }[];
2881
2900
  /** @description Present on errors that can be recovered programmatically, a plain sentence describing the next call to make. */
2882
2901
  next_action?: string;
2883
2902
  /** @description Present when something about this response is true but not visible in it. On a search, an entry names a filter value we could not check before sending it, or reports that some of the people on the page were not disclosed to the connected account, so an unexpected result count is explicable rather than silent. Branch on each entry's code, never on its message. */
@@ -28960,7 +28979,7 @@ interface operations {
28960
28979
  "application/json": components["schemas"]["Error"];
28961
28980
  };
28962
28981
  };
28963
- /** @description The checkpoint has expired. */
28982
+ /** @description CHECKPOINT_EXPIRED or CHECKPOINT_ALREADY_RESOLVED: restart the connection. ACCOUNT_ALREADY_LINKED: the LinkedIn identity is already connected; it names your own account_id when you own it, otherwise it is not one you can manage here. CONNECTION_IN_PROGRESS: another connection attempt for this identity is open; wait for it to finish or expire. */
28964
28983
  409: {
28965
28984
  headers: {
28966
28985
  [name: string]: unknown;
@@ -29310,7 +29329,7 @@ interface operations {
29310
29329
  "application/json": components["schemas"]["Error"];
29311
29330
  };
29312
29331
  };
29313
- /** @description The approved LinkedIn identity is already linked to another account. Reconnect or disconnect the existing account instead of linking it again. */
29332
+ /** @description ACCOUNT_ALREADY_LINKED. The approved LinkedIn identity is already connected and is not one you can manage here; not retryable. CONNECTION_IN_PROGRESS. Another connection attempt for this identity is open; wait for it to finish or expire. */
29314
29333
  409: {
29315
29334
  headers: {
29316
29335
  [name: string]: unknown;
@@ -34481,7 +34500,7 @@ declare class Curviate {
34481
34500
  * A code the API NEVER emitted is a different case and goes immediately, since
34482
34501
  * no deployment can be sending it: `RATE_LIMITED` went that way in 0.30.0.
34483
34502
  */
34484
- declare const ERROR_CODES: readonly ["UNAUTHORIZED", "INVALID_REQUEST", "UNSUPPORTED_MEDIA_TYPE", "PAYLOAD_TOO_LARGE", "ACCOUNT_NOT_FOUND", "ACCOUNT_RESTRICTED", "ACCOUNT_ALREADY_LINKED", "RESOURCE_NOT_FOUND", "NOT_STORED", "RESOURCE_ACCESS_RESTRICTED", "FILTER_CANDIDATES_REQUIRED", "NO_ACTIVE_SEAT", "LINKEDIN_FEATURE_NOT_SUBSCRIBED", "BETA_NOT_ENABLED", "RATE_LIMIT_ACCOUNT", "RATE_LIMIT_TENANT", "PLATFORM_RATE_LIMIT", "BUDGET_EXHAUSTED", "PLATFORM_ERROR", "PLATFORM_NOT_IMPLEMENTED", "LINKEDIN_OPERATION_NOT_SUPPORTED", "CHECKPOINT_NOT_FOUND", "CHECKPOINT_EXPIRED", "CHECKPOINT_INVALID_CODE", "CHECKPOINT_MAX_ATTEMPTS", "CHECKPOINT_ALREADY_RESOLVED", "CHECKPOINT_UNSUPPORTED", "CONNECTION_IN_PROGRESS", "REAUTH_REQUIRED", "LINKEDIN_AUTH_FAILED", "LINKEDIN_SESSION_EVICTED", "LINKEDIN_RATE_LIMITED", "LINKEDIN_COOKIE_INVALID", "LINKEDIN_SERVICE_UNAVAILABLE", "MESSAGE_WINDOW_EXPIRED", "RECIPIENT_UNREACHABLE", "CONNECTION_REQUEST_CONFLICT", "PAYMENT_REQUIRED", "PAYMENT_FAILED", "SUBSCRIPTION_BUSY", "SUBSCRIPTION_NOT_FOUND", "SEAT_NOT_FOUND", "SEAT_CANCELLED", "NOT_FOUND", "REACTION_NOT_FOUND", "SUBSTRATE_LINK_FAILED", "SUBSTRATE_CAP_REACHED", "BILLING_CHECKOUT_FAILED", "BILLING_PORTAL_UNAVAILABLE", "ACCOUNT_DISPUTED", "ACCOUNT_LINKING_DISABLED", "PERIOD_LOCKED", "SEAT_NOT_EMPTY", "SEAT_PROVISIONAL", "SUBSCRIPTION_ALREADY_EXISTS", "ALREADY_CANCELLED", "CANCELLATION_ALREADY_EFFECTIVE", "INVALID_CANCELLATION_SOURCE", "TRIAL_EXPIRED", "TRIAL_SEAT_LIMIT", "TRIAL_ACTIVE_SEAT_LIMIT", "TRIAL_IDENTITY_ALREADY_USED", "TRIAL_IDENTITY_UNRESOLVED", "ADMIN_BYPASS", "STRIPE_DRIFT_DETECTED", "INTERNAL"];
34503
+ declare const ERROR_CODES: readonly ["UNAUTHORIZED", "INVALID_REQUEST", "UNSUPPORTED_MEDIA_TYPE", "PAYLOAD_TOO_LARGE", "ACCOUNT_NOT_FOUND", "ACCOUNT_RESTRICTED", "ACCOUNT_ALREADY_LINKED", "RESOURCE_NOT_FOUND", "NOT_STORED", "RESOURCE_ACCESS_RESTRICTED", "FILTER_CANDIDATES_REQUIRED", "NO_ACTIVE_SEAT", "LINKEDIN_FEATURE_NOT_SUBSCRIBED", "BETA_NOT_ENABLED", "RATE_LIMIT_ACCOUNT", "RATE_LIMIT_TENANT", "PLATFORM_RATE_LIMIT", "BUDGET_EXHAUSTED", "PLATFORM_ERROR", "PLATFORM_NOT_IMPLEMENTED", "LINKEDIN_OPERATION_NOT_SUPPORTED", "CHECKPOINT_NOT_FOUND", "CHECKPOINT_EXPIRED", "CHECKPOINT_INVALID_CODE", "CHECKPOINT_MAX_ATTEMPTS", "CHECKPOINT_ALREADY_RESOLVED", "CHECKPOINT_UNSUPPORTED", "CONNECTION_IN_PROGRESS", "REAUTH_REQUIRED", "LINKEDIN_AUTH_FAILED", "LINKEDIN_SESSION_EVICTED", "LINKEDIN_RATE_LIMITED", "LINKEDIN_COOKIE_INVALID", "LINKEDIN_SERVICE_UNAVAILABLE", "MESSAGE_WINDOW_EXPIRED", "RECIPIENT_UNREACHABLE", "CONNECTION_REQUEST_CONFLICT", "PAYMENT_REQUIRED", "PAYMENT_FAILED", "SUBSCRIPTION_BUSY", "SUBSCRIPTION_NOT_FOUND", "SEAT_NOT_FOUND", "SEAT_CANCELLED", "NOT_FOUND", "REACTION_NOT_FOUND", "SUBSTRATE_LINK_FAILED", "SUBSTRATE_CAP_REACHED", "BILLING_CHECKOUT_FAILED", "BILLING_PORTAL_UNAVAILABLE", "ACCOUNT_DISPUTED", "ACCOUNT_LINKING_DISABLED", "PERIOD_LOCKED", "SEAT_NOT_EMPTY", "SEAT_PROVISIONAL", "SUBSCRIPTION_ALREADY_EXISTS", "ALREADY_CANCELLED", "CANCELLATION_ALREADY_EFFECTIVE", "INVALID_CANCELLATION_SOURCE", "TRIAL_EXPIRED", "TRIAL_SEAT_LIMIT", "TRIAL_ACTIVE_SEAT_LIMIT", "TRIAL_IDENTITY_ALREADY_USED", "TRIAL_IDENTITY_UNRESOLVED", "ADMIN_BYPASS", "STRIPE_DRIFT_DETECTED", "TOOLSET_DISABLED", "AMBIGUOUS_IDENTIFIER", "INTERNAL"];
34485
34504
  /**
34486
34505
  * The complete set of error codes observable by API callers.
34487
34506
  *
package/dist/index.js CHANGED
@@ -8,8 +8,10 @@ var ERROR_CODES = [
8
8
  // Account state
9
9
  "ACCOUNT_NOT_FOUND",
10
10
  "ACCOUNT_RESTRICTED",
11
- // Duplicate connect: reconnect or adopt the existing account instead of
12
- // linking again. Not retryable.
11
+ // Duplicate connect (409): the LinkedIn identity is already connected. When
12
+ // your own tenant holds it the body carries `account_id`, so reuse that
13
+ // account instead of linking again; when another tenant holds it the body
14
+ // names no account and there is nothing you can manage here. Not retryable.
13
15
  "ACCOUNT_ALREADY_LINKED",
14
16
  "RESOURCE_NOT_FOUND",
15
17
  // A read found nothing in Curviate's store and its mode may not fetch, so it
@@ -165,6 +167,16 @@ var ERROR_CODES = [
165
167
  // was charged. Stop and surface it to a human (or support) rather than
166
168
  // backing off.
167
169
  "STRIPE_DRIFT_DETECTED",
170
+ // Agent-surface refusals the served Error component documents (their extras
171
+ // are `toolset` and `candidates`). Both are user_fixable and never
172
+ // retryable as sent.
173
+ //
174
+ // - `TOOLSET_DISABLED`: the toolset the call needs is switched off for this
175
+ // tenant. Enable it or use another tool.
176
+ // - `AMBIGUOUS_IDENTIFIER`: a name matched several entries. Pick one from
177
+ // `candidates` and re-send its id.
178
+ "TOOLSET_DISABLED",
179
+ "AMBIGUOUS_IDENTIFIER",
168
180
  // Generic
169
181
  "INTERNAL"
170
182
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/sdk",
3
- "version": "0.39.0",
3
+ "version": "0.40.0",
4
4
  "private": false,
5
5
  "description": "TypeScript SDK for the Curviate API.",
6
6
  "license": "MIT",
@@ -2781,6 +2781,25 @@ export interface components {
2781
2781
  name?: string;
2782
2782
  }[];
2783
2783
  }[];
2784
+ /** @description Present on PAYMENT_REQUIRED and ACCOUNT_DISPUTED: the self-service page where the tenant resolves the payment problem, so an agent can hand a human one link. Null when no portal session could be opened; fall back to the dashboard. */
2785
+ portal_url?: string | null;
2786
+ /** @description Present on CHECKPOINT_INVALID_CODE: how many more verification codes the checkpoint accepts before it locks. Stop and ask the account owner for a fresh code when it reaches zero, rather than guessing. */
2787
+ attempts_remaining?: number;
2788
+ /** @description Present on CHECKPOINT_UNSUPPORTED: the kind of verification challenge LinkedIn raised that cannot be solved through this API. A human has to complete it in LinkedIn, then the account reconnects. */
2789
+ challenge_type?: string;
2790
+ /** @description Present on ACCOUNT_ALREADY_LINKED: the id of your own existing account for this LinkedIn profile, so you can reuse it instead of linking again. Only ever an account of the calling tenant. */
2791
+ account_id?: string;
2792
+ /** @description Present on RATE_LIMIT_ACCOUNT: the per-account request ceiling that was breached, with its name, the units remaining and total, and the absolute reset_time. Wait until reset_time before retrying. */
2793
+ quota?: Record<string, never>;
2794
+ /** @description Present on TOOLSET_DISABLED: the name of the toolset that is switched off for this tenant, so you can enable it or use another tool. */
2795
+ toolset?: string;
2796
+ /** @description Present on AMBIGUOUS_IDENTIFIER: the entries the identifier matched. Pick one and re-send its id. */
2797
+ candidates?: {
2798
+ /** @description The id to send instead of the ambiguous identifier. */
2799
+ id?: string;
2800
+ /** @description Human-readable label for this entry. */
2801
+ name?: string;
2802
+ }[];
2784
2803
  /** @description Present on errors that can be recovered programmatically, a plain sentence describing the next call to make. */
2785
2804
  next_action?: string;
2786
2805
  /** @description Present when something about this response is true but not visible in it. On a search, an entry names a filter value we could not check before sending it, or reports that some of the people on the page were not disclosed to the connected account, so an unexpected result count is explicable rather than silent. Branch on each entry's code, never on its message. */
@@ -28864,7 +28883,7 @@ export interface operations {
28864
28883
  "application/json": components["schemas"]["Error"];
28865
28884
  };
28866
28885
  };
28867
- /** @description The checkpoint has expired. */
28886
+ /** @description CHECKPOINT_EXPIRED or CHECKPOINT_ALREADY_RESOLVED: restart the connection. ACCOUNT_ALREADY_LINKED: the LinkedIn identity is already connected; it names your own account_id when you own it, otherwise it is not one you can manage here. CONNECTION_IN_PROGRESS: another connection attempt for this identity is open; wait for it to finish or expire. */
28868
28887
  409: {
28869
28888
  headers: {
28870
28889
  [name: string]: unknown;
@@ -29214,7 +29233,7 @@ export interface operations {
29214
29233
  "application/json": components["schemas"]["Error"];
29215
29234
  };
29216
29235
  };
29217
- /** @description The approved LinkedIn identity is already linked to another account. Reconnect or disconnect the existing account instead of linking it again. */
29236
+ /** @description ACCOUNT_ALREADY_LINKED. The approved LinkedIn identity is already connected and is not one you can manage here; not retryable. CONNECTION_IN_PROGRESS. Another connection attempt for this identity is open; wait for it to finish or expire. */
29218
29237
  409: {
29219
29238
  headers: {
29220
29239
  [name: string]: unknown;