kb-cloud-client-typescript 0.0.0-main.20260527.1703 → 0.0.1

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
@@ -1,19 +1,17 @@
1
- # KubeBlocks Cloud TypeScript SDK
1
+ # kb-cloud-client-typescript
2
2
 
3
3
  Auto-generated TypeScript SDK for KubeBlocks Cloud API.
4
4
 
5
- ## Install
5
+ ## SDKs
6
6
 
7
- ```bash
8
- npm install kb-cloud-client-typescript
9
- # or
10
- yarn add kb-cloud-client-typescript
11
- ```
7
+ | SDK | Source | Description |
8
+ |-----|--------|-------------|
9
+ | `openapi` | `openapi.yaml` | User Portal API |
10
+ | `adminapi` | `adminapi.yaml` | Admin Portal API |
11
+ | `internalapi` | `internalapi.yaml` | Internal API |
12
12
 
13
13
  ## Usage
14
14
 
15
- ### User Portal API (`openapi`)
16
-
17
15
  ```ts
18
16
  import { Configuration, OpenApi } from 'kb-cloud-client-typescript';
19
17
 
@@ -23,34 +21,53 @@ const api = new OpenApi.OrganizationApi(
23
21
  const orgs = await api.listOrg();
24
22
  ```
25
23
 
26
- ### Admin Portal API (`adminapi`)
24
+ ## Development
27
25
 
28
- ```ts
29
- import { Configuration, AdminApi } from 'kb-cloud-client-typescript/adminapi';
26
+ ### Setup
30
27
 
31
- const api = new AdminApi.OrganizationApi(
32
- new Configuration({ basePath: 'https://api.example.com' })
33
- );
28
+ ```bash
29
+ git clone https://github.com/apecloud/kb-cloud-client-typescript.git
30
+ cd kb-cloud-client-typescript
31
+ yarn install
32
+
33
+ # Clone the OpenAPI spec source (required for SDK generation)
34
+ git clone --depth 1 https://github.com/apecloud/apecloud.git apecloud
34
35
  ```
35
36
 
36
- ### Internal API (`internalapi`)
37
+ To target a specific branch or tag:
37
38
 
38
- ```ts
39
- import { Configuration, InternalApi } from 'kb-cloud-client-typescript/internalapi';
39
+ ```bash
40
+ # Specific branch
41
+ git clone --depth 1 --branch release-2.2 https://github.com/apecloud/apecloud.git apecloud
40
42
 
41
- const api = new InternalApi.SomeApi(
42
- new Configuration({ basePath: 'https://api.example.com' })
43
- );
43
+ # Specific tag
44
+ git clone --depth 1 --branch v2.2.6 https://github.com/apecloud/apecloud.git apecloud
44
45
  ```
45
46
 
46
- ## Available SDKs
47
+ If already cloned, switch with:
48
+
49
+ ```bash
50
+ cd apecloud
51
+ git fetch --tags
52
+ git checkout v2.2.6
53
+ ```
54
+
55
+ ### Generate SDK
56
+
57
+ ```bash
58
+ yarn api:build # Bundle specs + generate all three SDKs + tsc
59
+ ```
60
+
61
+ ### Publish
62
+
63
+ ```bash
64
+ yarn publish # Publish to npm
65
+ ```
47
66
 
48
- | Import Path | Description |
49
- |---|---|
50
- | `kb-cloud-client-typescript` | User Portal API |
51
- | `kb-cloud-client-typescript/adminapi` | Admin Portal API |
52
- | `kb-cloud-client-typescript/internalapi` | Internal API |
67
+ ## CI
53
68
 
54
- ## API Documentation
69
+ GitHub Actions workflow (`.github/workflows/generate-and-publish.yml`) auto-generates on push to main:
55
70
 
56
- Refer to the [KubeBlocks API documentation](https://docs.kubeblocks.io) for endpoint details.
71
+ 1. Clone `apecloud/apecloud` (default branch, overridable via `workflow_dispatch`)
72
+ 2. `redocly bundle` → `openapi-generator-cli` → `tsc`
73
+ 3. Publish to npm (requires `NPM_TOKEN` secret)
package/package.json CHANGED
@@ -1,33 +1,19 @@
1
1
  {
2
2
  "name": "kb-cloud-client-typescript",
3
- "version": "0.0.0-main.20260527.1703",
3
+ "version": "0.0.1",
4
4
  "description": "Auto-generated TypeScript SDK for KubeBlocks Cloud API",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/openapi/index.js",
8
8
  "types": "dist/openapi/index.d.ts",
9
- "exports": {
10
- "./adminapi": {
11
- "types": "./dist/adminapi/index.d.ts",
12
- "default": "./dist/adminapi/index.js"
13
- },
14
- "./internalapi": {
15
- "types": "./dist/internalapi/index.d.ts",
16
- "default": "./dist/internalapi/index.js"
17
- },
18
- "./openapi": {
19
- "types": "./dist/openapi/index.d.ts",
20
- "default": "./dist/openapi/index.js"
21
- }
22
- },
23
9
  "files": [
24
10
  "dist",
25
11
  "src/sdk"
26
12
  ],
27
13
  "scripts": {
28
- "openapi:bundle": "redocly bundle apecloud/apiserver/api/openapi.yaml > ./src/sdk/openapi.yaml",
29
- "adminapi:bundle": "redocly bundle apecloud/apiserver/api/adminapi.yaml > ./src/sdk/adminapi.yaml",
30
- "internalapi:bundle": "redocly bundle apecloud/apiserver/api/internalapi.yaml > ./src/sdk/internalapi.yaml",
14
+ "openapi:bundle": "rm -rf ./src/sdk/openapi.yaml && redocly bundle apecloud/apiserver/api/openapi.yaml > ./src/sdk/openapi.yaml",
15
+ "adminapi:bundle": "rm -rf ./src/sdk/adminapi.yaml && redocly bundle apecloud/apiserver/api/adminapi.yaml > ./src/sdk/adminapi.yaml",
16
+ "internalapi:bundle": "rm -rf ./src/sdk/internalapi.yaml && redocly bundle apecloud/apiserver/api/internalapi.yaml > ./src/sdk/internalapi.yaml",
31
17
  "openapi:build": "yarn openapi:bundle && cp ./src/sdk/openapitools.json ./openapitools.json && rm -rf ./src/sdk/openapi && mkdir -p ./src/sdk/openapi && openapi-generator-cli generate",
32
18
  "adminapi:build": "yarn adminapi:bundle && cp ./src/sdk/adminapitools.json ./openapitools.json && rm -rf ./src/sdk/adminapi && mkdir -p ./src/sdk/adminapi && openapi-generator-cli generate",
33
19
  "internalapi:build": "yarn internalapi:bundle && cp ./src/sdk/internalapitools.json ./openapitools.json && rm -rf ./src/sdk/internalapi && mkdir -p ./src/sdk/internalapi && openapi-generator-cli generate",
@@ -3,7 +3,7 @@
3
3
  "spaces": 2,
4
4
  "generator-cli": {
5
5
  "version": "7.12.0",
6
- "useDocker": false,
6
+ "useDocker": true,
7
7
  "generators": {
8
8
  "v3.0": {
9
9
  "generatorName": "typescript-axios",
@@ -25,4 +25,4 @@
25
25
  }
26
26
  }
27
27
  }
28
- }
28
+ }
@@ -3,7 +3,7 @@
3
3
  "spaces": 2,
4
4
  "generator-cli": {
5
5
  "version": "7.12.0",
6
- "useDocker": false,
6
+ "useDocker": true,
7
7
  "generators": {
8
8
  "v3.0": {
9
9
  "generatorName": "typescript-axios",
@@ -25,4 +25,4 @@
25
25
  }
26
26
  }
27
27
  }
28
- }
28
+ }
@@ -3,7 +3,7 @@
3
3
  "spaces": 2,
4
4
  "generator-cli": {
5
5
  "version": "7.12.0",
6
- "useDocker": false,
6
+ "useDocker": true,
7
7
  "generators": {
8
8
  "v3.0": {
9
9
  "generatorName": "typescript-axios",
@@ -25,4 +25,4 @@
25
25
  }
26
26
  }
27
27
  }
28
- }
28
+ }