@cube-dev/platform-client 0.0.20 → 0.1.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
@@ -14,7 +14,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
 
15
15
  <!-- Curate public-facing entries here before the next release. -->
16
16
 
17
+ ## [0.1.0] - 2026-06-07
18
+ ### Added
19
+
20
+ - `GET /api/v1/deployments/{deploymentId}/folders` now supports cursor-based pagination via the `first` and `after` query parameters, and returns an `items` array alongside a `pageInfo` cursor block — matching the other list endpoints.
21
+
22
+ ### Changed
23
+
24
+ - **BREAKING:** The folders list response type `FoldersFindAllResult` is now `FoldersListResponse`.
25
+ - **BREAKING:** Notification recipient types renamed for consistency: `PublicRecipientDto` → `NotificationRecipient`, `PublicRecipientInput` → `NotificationRecipientInput`, `AddRecipientsInput` → `AddNotificationRecipientsInput`, `RemoveRecipientInput` → `RemoveNotificationRecipientInput`, `RemoveRecipientsInput` → `RemoveNotificationRecipientsInput`, `RecipientsListDto` → `NotificationRecipientsListResponse`, `RecipientsMutationResultDto` → `NotificationRecipientsMutationResponse`, `NotificationsListDto` → `NotificationsListResponse`.
26
+
27
+ ### Deprecated
28
+
29
+ - The `data` and `count` fields on the folders list response are deprecated in favor of `items` and `pageInfo`. They remain populated for backward compatibility.
30
+
17
31
  ## [0.0.20] - 2026-06-05
32
+
18
33
  ### Added
19
34
 
20
35
  - `createCubePlatformClient` — the new name for the client factory.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @cube-dev/platform-client
2
+
3
+ A typed client for the [Cube Cloud](https://cube.dev/) Platform control-plane REST API. It wraps the public OpenAPI spec with end-to-end types for every endpoint, request, and response, plus optional React Query bindings.
4
+
5
+ ## Documentation & changelog
6
+
7
+ - **API reference & guides:** https://docs.cube.dev/api-reference/introduction
8
+ - **Changelog:** https://docs.cube.dev/api-reference/changelog
9
+
10
+ A copy of the per-release changelog also ships in this package as [`CHANGELOG.md`](./CHANGELOG.md).
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @cube-dev/platform-client
16
+ # or
17
+ yarn add @cube-dev/platform-client
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import { createCubePlatformClient } from '@cube-dev/platform-client';
24
+
25
+ const client = createCubePlatformClient({
26
+ baseUrl: 'https://<your-tenant>.cubecloud.dev',
27
+ // Called on every request — return the auth headers for the Platform API.
28
+ getHeaders: () => ({ Authorization: process.env.CUBE_API_TOKEN! }),
29
+ });
30
+
31
+ // `fetchClient` is a fully-typed openapi-fetch client: paths, params,
32
+ // request bodies and responses are all checked against the OpenAPI spec.
33
+ const { data, error } = await client.fetchClient.GET('/api/v1/deployments/', {
34
+ params: { query: { first: 50 } },
35
+ });
36
+
37
+ for (const deployment of data?.items ?? []) {
38
+ console.log(deployment.id, deployment.name, deployment.deploymentUrl);
39
+ }
40
+ ```
41
+
42
+ ### React Query bindings
43
+
44
+ The `./react-query` entry point exposes a provider and typed hooks built on [`@tanstack/react-query`](https://tanstack.com/query) (a peer dependency, along with `react`):
45
+
46
+ ```tsx
47
+ import { createCubePlatformClient } from '@cube-dev/platform-client';
48
+ import {
49
+ CubePlatformApiProvider,
50
+ useCubePlatformApiQuery,
51
+ } from '@cube-dev/platform-client/react-query';
52
+
53
+ const client = createCubePlatformClient({ baseUrl, getHeaders });
54
+
55
+ function App() {
56
+ return (
57
+ <CubePlatformApiProvider client={client}>
58
+ <Deployments />
59
+ </CubePlatformApiProvider>
60
+ );
61
+ }
62
+
63
+ function Deployments() {
64
+ const { data } = useCubePlatformApiQuery('get', '/api/v1/deployments/');
65
+ return <ul>{data?.items.map((deployment) => <li key={deployment.id}>{deployment.name}</li>)}</ul>;
66
+ }
67
+ ```
68
+
69
+ ## Types
70
+
71
+ The full set of schema types is exported as `PlatformApiSchemas`, and the raw OpenAPI `paths` / `operations` types are available for advanced use:
72
+
73
+ ```ts
74
+ import type { PlatformApiSchemas, paths } from '@cube-dev/platform-client';
75
+
76
+ type Deployment = PlatformApiSchemas['Deployment'];
77
+ ```
78
+
79
+ ## License
80
+
81
+ MIT