@natsuneko-laboratory/catalyst-sdk 2026.10.26-beta.2 → 2026.10.26-beta.4

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/README.md CHANGED
@@ -21,7 +21,7 @@ The package is ESM only; CommonJS `require()` is not supported.
21
21
  ## Usage
22
22
 
23
23
  ```ts
24
- import { Catalyst, getCatalystV11Random } from "@natsuneko-laboratory/catalyst-sdk";
24
+ import { Catalyst } from "@natsuneko-laboratory/catalyst-sdk";
25
25
 
26
26
  const catalyst = new Catalyst({
27
27
  clientId: "your-client-id",
@@ -33,10 +33,29 @@ const catalyst = new Catalyst({
33
33
  },
34
34
  });
35
35
 
36
- // Pass the configured client to any generated operation.
37
- const { data, error } = await getCatalystV11Random({ client: catalyst.client });
36
+ // GET /catalyst/v1.1/timeline/home
37
+ const { data, error } = await catalyst.catalyst.v11.timeline.home.get();
38
+
39
+ // Path parameters, query parameters and the body go in `path`, `query` and `body`.
40
+ const status = await catalyst.catalyst.v11.status.id.get({ path: { id: "status-id" } });
41
+ await catalyst.catalyst.v1.relationships.bulk.create({ body: { userIds: ["user-id"] } });
42
+
43
+ // With `throwOnError: true`, a non-2xx response throws an `ApiError` instead of being returned.
44
+ const { data: me } = await catalyst.egeria.v1.me.get({ throwOnError: true });
38
45
  ```
39
46
 
47
+ Every operation is reachable from `Catalyst` by its path, as in the old CatalystTS SDK. The first path segment is the service (`catalyst`, `egeria`, `epiclese`, `featureFlags`, `giftia`, `media`, `steambird`); every following segment is camelCased (`v1.1` → `v11`, `on-this-day` → `onThisDay`, `{id}` → `id`); the method is named after the HTTP method (`GET` → `get`, `POST` → `create`, `PUT` → `update`, `PATCH` → `patch`, `DELETE` → `delete`). Each call returns `{ data, error, response }`.
48
+
49
+ The nested methods call the generated operation functions, which are also exported. Pass `catalyst.client` to call one directly:
50
+
51
+ ```ts
52
+ import { getCatalystV11TimelineHome } from "@natsuneko-laboratory/catalyst-sdk";
53
+
54
+ const { data } = await getCatalystV11TimelineHome({ client: catalyst.client });
55
+ ```
56
+
57
+ `createFacade(client)` builds the same nested object for a client you created yourself with `createApiClient`.
58
+
40
59
  When a request returns `401` and a refresh token is set, the SDK refreshes the access token once (concurrent requests share a single refresh) and retries. If the refresh fails, the original `401` is returned as an `ApiError`. Calling an operation that needs a bearer token without an access token fails with `AuthError` before any request is sent.
41
60
 
42
61
  Other members: `catalyst.accessToken`, `catalyst.refreshToken`, `catalyst.setCredential(accessToken, refreshToken?)`, `catalyst.clearCredential()`, `catalyst.refresh()`.