@leaflow/sdk 0.0.0-dev.25.g6c5751f → 0.0.0-dev.250.g6df166c
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 +22 -1
- package/dist/account/v1/client.d.ts +4 -0
- package/dist/account/v1/client.js +7 -0
- package/dist/account/v1/index.d.ts +33 -22
- package/dist/account/v1/index.js +4 -4
- package/dist/account/v1/schema.d.ts +307 -89
- package/dist/assistant/v1/client.d.ts +4 -0
- package/dist/assistant/v1/client.js +7 -0
- package/dist/assistant/v1/index.d.ts +71 -40
- package/dist/assistant/v1/index.js +4 -4
- package/dist/assistant/v1/schema.d.ts +1204 -139
- package/dist/billing/account/v1/client.d.ts +4 -0
- package/dist/billing/account/v1/client.js +7 -0
- package/dist/billing/account/v1/index.d.ts +169 -0
- package/dist/billing/account/v1/index.js +5 -0
- package/dist/billing/account/v1/schema.d.ts +4385 -0
- package/dist/billing/account/v1/schema.js +5 -0
- package/dist/billing/catalog/v1/client.d.ts +4 -0
- package/dist/billing/catalog/v1/client.js +7 -0
- package/dist/billing/catalog/v1/index.d.ts +33 -0
- package/dist/billing/catalog/v1/index.js +5 -0
- package/dist/billing/catalog/v1/schema.d.ts +915 -0
- package/dist/billing/catalog/v1/schema.js +5 -0
- package/dist/billing/index.d.ts +3 -0
- package/dist/billing/index.js +6 -0
- package/dist/billing/project/v1/client.d.ts +4 -0
- package/dist/billing/project/v1/client.js +7 -0
- package/dist/billing/project/v1/index.d.ts +59 -0
- package/dist/billing/project/v1/index.js +5 -0
- package/dist/billing/project/v1/schema.d.ts +1892 -0
- package/dist/billing/project/v1/schema.js +5 -0
- package/dist/canopy/v1/client.d.ts +4 -0
- package/dist/canopy/v1/client.js +7 -0
- package/dist/canopy/v1/index.d.ts +24 -23
- package/dist/canopy/v1/index.js +4 -4
- package/dist/canopy/v1/schema.d.ts +113 -109
- package/dist/compute/v1/client.d.ts +4 -0
- package/dist/compute/v1/client.js +7 -0
- package/dist/compute/v1/index.d.ts +207 -134
- package/dist/compute/v1/index.js +4 -4
- package/dist/compute/v1/schema.d.ts +1945 -553
- package/dist/dns/v1/client.d.ts +4 -0
- package/dist/dns/v1/client.js +7 -0
- package/dist/dns/v1/index.d.ts +43 -0
- package/dist/dns/v1/index.js +5 -0
- package/dist/dns/v1/schema.d.ts +887 -0
- package/dist/dns/v1/schema.js +5 -0
- package/dist/iam/v1/client.d.ts +4 -0
- package/dist/iam/v1/client.js +7 -0
- package/dist/iam/v1/index.d.ts +55 -32
- package/dist/iam/v1/index.js +4 -4
- package/dist/iam/v1/schema.d.ts +521 -88
- package/dist/index.d.ts +11 -7
- package/dist/index.js +19 -5
- package/dist/monitoring/v1/client.d.ts +4 -0
- package/dist/monitoring/v1/client.js +7 -0
- package/dist/monitoring/v1/index.d.ts +130 -49
- package/dist/monitoring/v1/index.js +4 -4
- package/dist/monitoring/v1/schema.d.ts +2420 -527
- package/dist/notification/v1/client.d.ts +4 -0
- package/dist/notification/v1/client.js +7 -0
- package/dist/notification/v1/index.d.ts +81 -0
- package/dist/notification/v1/index.js +5 -0
- package/dist/notification/v1/schema.d.ts +2048 -0
- package/dist/notification/v1/schema.js +5 -0
- package/dist/routes.d.ts +3234 -0
- package/dist/routes.js +3639 -0
- package/dist/support/v1/client.d.ts +4 -0
- package/dist/support/v1/client.js +7 -0
- package/dist/support/v1/index.d.ts +51 -0
- package/dist/support/v1/index.js +5 -0
- package/dist/support/v1/schema.d.ts +1082 -0
- package/dist/support/v1/schema.js +5 -0
- package/dist/tunnel/v1/client.d.ts +4 -0
- package/dist/tunnel/v1/client.js +7 -0
- package/dist/tunnel/v1/index.d.ts +8 -7
- package/dist/tunnel/v1/index.js +4 -4
- package/dist/tunnel/v1/schema.d.ts +40 -34
- package/package.json +34 -10
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Leaflow 平台的 TypeScript SDK(`@leaflow/sdk`),由
|
|
|
7
7
|
npm i @leaflow/sdk openapi-fetch
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
包含 Node.js 可用的 JavaScript 客户端和 TypeScript 类型。请求由 `openapi-fetch` 发出,路径与参数由契约约束。
|
|
11
11
|
|
|
12
12
|
```ts
|
|
13
13
|
import createClient from 'openapi-fetch';
|
|
@@ -32,3 +32,24 @@ npm run generate
|
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
契约版本记在 `CONTRACTS_REF`。
|
|
35
|
+
|
|
36
|
+
## Billing
|
|
37
|
+
|
|
38
|
+
Billing 按职能分为三个子包,三者地址相同,凭据各不相同:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { billing } from "@leaflow/sdk";
|
|
42
|
+
|
|
43
|
+
// 公开目录与估价,无需凭据
|
|
44
|
+
const catalog = billing.catalog.client();
|
|
45
|
+
// 计费账户、充值、账单,使用 access token
|
|
46
|
+
const account = billing.account.client({ headers });
|
|
47
|
+
// 项目的支出与订单,使用 scoped token
|
|
48
|
+
const project = billing.project.client({ headers });
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
也可按子路径单独导入,例如 `@leaflow/sdk/billing/catalog/v1`。
|
|
52
|
+
|
|
53
|
+
公共目录、账户和项目接口使用 `@leaflow/sdk`,运营管理接口使用 `@leaflow/sdk-admin`。服务间 Proto 使用独立的 `@leaflow/billing` 包。
|
|
54
|
+
|
|
55
|
+
本地契约可通过 `CONTRACTS_DIR=/absolute/path/to/contracts npm run generate` 生成。发布时将契约提交号写入 `CONTRACTS_REF`,再使用默认生成命令。
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ClientOptions } from "openapi-fetch";
|
|
2
|
+
import type { paths } from "./schema.js";
|
|
3
|
+
/** A client for the account service. Pass baseUrl to override the address. */
|
|
4
|
+
export declare function client(options?: ClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Code generated from the contract's servers[0]. DO NOT EDIT.
|
|
2
|
+
import createClient, {} from "openapi-fetch";
|
|
3
|
+
const defaultBaseUrl = "https://account.leaflow.cloud";
|
|
4
|
+
/** A client for the account service. Pass baseUrl to override the address. */
|
|
5
|
+
export function client(options = {}) {
|
|
6
|
+
return createClient({ baseUrl: defaultBaseUrl, ...options });
|
|
7
|
+
}
|
|
@@ -1,44 +1,55 @@
|
|
|
1
1
|
export type { paths, components, operations, webhooks } from "./schema.js";
|
|
2
|
+
export { client } from "./client.js";
|
|
2
3
|
import type { operations } from "./schema.js";
|
|
3
|
-
/** `GET /account/v1/settings
|
|
4
|
+
/** The success response body of `GET /account/v1/settings`. */
|
|
4
5
|
export type GetSettingsResult = operations["get-settings"]["responses"][200]["content"]["application/json"];
|
|
5
|
-
/** `GET /account/v1/
|
|
6
|
+
/** The success response body of `GET /account/v1/locales`. */
|
|
7
|
+
export type ListLocalesResult = operations["list-locales"]["responses"][200]["content"]["application/json"];
|
|
8
|
+
/** The success response body of `GET /account/v1/agreements`. */
|
|
6
9
|
export type ListAgreementsResult = operations["list-agreements"]["responses"][200]["content"]["application/json"];
|
|
7
|
-
/** `GET /account/v1/me/consents
|
|
10
|
+
/** The success response body of `GET /account/v1/me/consents`. */
|
|
8
11
|
export type ListConsentsResult = operations["list-consents"]["responses"][200]["content"]["application/json"];
|
|
9
|
-
/** `POST /account/v1/me/consents
|
|
12
|
+
/** The success response body of `POST /account/v1/me/consents`. */
|
|
10
13
|
export type AcceptAgreementsResult = operations["accept-agreements"]["responses"][200]["content"]["application/json"];
|
|
11
|
-
/** `POST /account/v1/me/consents
|
|
14
|
+
/** The request body of `POST /account/v1/me/consents`. */
|
|
12
15
|
export type AcceptAgreementsBody = NonNullable<operations["accept-agreements"]["requestBody"]>["content"]["application/json"];
|
|
13
|
-
/** `POST /account/v1/register
|
|
16
|
+
/** The success response body of `POST /account/v1/register`. */
|
|
14
17
|
export type RegisterResult = operations["register"]["responses"][201]["content"]["application/json"];
|
|
15
|
-
/** `POST /account/v1/register
|
|
18
|
+
/** The request body of `POST /account/v1/register`. */
|
|
16
19
|
export type RegisterBody = NonNullable<operations["register"]["requestBody"]>["content"]["application/json"];
|
|
17
|
-
/** `GET /account/v1/me
|
|
20
|
+
/** The success response body of `GET /account/v1/me`. */
|
|
18
21
|
export type GetAccountResult = operations["get-account"]["responses"][200]["content"]["application/json"];
|
|
19
|
-
/** `
|
|
22
|
+
/** The success response body of `PATCH /account/v1/me`. */
|
|
23
|
+
export type UpdateAccountResult = operations["update-account"]["responses"][200]["content"]["application/json"];
|
|
24
|
+
/** The request body of `PATCH /account/v1/me`. */
|
|
25
|
+
export type UpdateAccountBody = NonNullable<operations["update-account"]["requestBody"]>["content"]["application/json"];
|
|
26
|
+
/** The success response body of `GET /account/v1/me/identity-verification`. */
|
|
20
27
|
export type GetIdentityVerificationResult = operations["get-identity-verification"]["responses"][200]["content"]["application/json"];
|
|
21
|
-
/** `POST /account/v1/me/identity-verification
|
|
28
|
+
/** The success response body of `POST /account/v1/me/identity-verification`. */
|
|
22
29
|
export type SubmitIdentityVerificationResult = operations["submit-identity-verification"]["responses"][202]["content"]["application/json"];
|
|
23
|
-
/** `POST /account/v1/me/identity-verification
|
|
30
|
+
/** The request body of `POST /account/v1/me/identity-verification`. */
|
|
24
31
|
export type SubmitIdentityVerificationBody = NonNullable<operations["submit-identity-verification"]["requestBody"]>["content"]["application/json"];
|
|
25
|
-
/** `GET /account/v1/me/invitations
|
|
32
|
+
/** The success response body of `GET /account/v1/me/invitations`. */
|
|
26
33
|
export type ListMyInvitationsResult = operations["list-my-invitations"]["responses"][200]["content"]["application/json"];
|
|
27
|
-
/** `GET /account/v1/me/invitations
|
|
34
|
+
/** The query parameters of `GET /account/v1/me/invitations`. */
|
|
28
35
|
export type ListMyInvitationsQuery = operations["list-my-invitations"]["parameters"]["query"];
|
|
29
|
-
/** `
|
|
36
|
+
/** The success response body of `GET /account/v1/invitations/by-token`. */
|
|
37
|
+
export type PreviewInvitationByTokenResult = operations["preview-invitation-by-token"]["responses"][200]["content"]["application/json"];
|
|
38
|
+
/** The query parameters of `GET /account/v1/invitations/by-token`. */
|
|
39
|
+
export type PreviewInvitationByTokenQuery = operations["preview-invitation-by-token"]["parameters"]["query"];
|
|
40
|
+
/** The success response body of `POST /account/v1/me/invitations/accept`. */
|
|
30
41
|
export type AcceptInvitationByTokenResult = operations["accept-invitation-by-token"]["responses"][200]["content"]["application/json"];
|
|
31
|
-
/** `POST /account/v1/me/invitations/accept
|
|
42
|
+
/** The request body of `POST /account/v1/me/invitations/accept`. */
|
|
32
43
|
export type AcceptInvitationByTokenBody = NonNullable<operations["accept-invitation-by-token"]["requestBody"]>["content"]["application/json"];
|
|
33
|
-
/** `POST /account/v1/me/invitations/{invitationId}/accept
|
|
44
|
+
/** The success response body of `POST /account/v1/me/invitations/{invitationId}/accept`. */
|
|
34
45
|
export type AcceptInvitationResult = operations["accept-invitation"]["responses"][200]["content"]["application/json"];
|
|
35
|
-
/** `GET /account/v1/projects
|
|
46
|
+
/** The success response body of `GET /account/v1/projects`. */
|
|
36
47
|
export type ListProjectsResult = operations["list-projects"]["responses"][200]["content"]["application/json"];
|
|
37
|
-
/** `GET /account/v1/projects
|
|
48
|
+
/** The query parameters of `GET /account/v1/projects`. */
|
|
38
49
|
export type ListProjectsQuery = operations["list-projects"]["parameters"]["query"];
|
|
39
|
-
/** `POST /account/v1/projects
|
|
50
|
+
/** The success response body of `POST /account/v1/projects`. */
|
|
40
51
|
export type CreateProjectResult = operations["create-project"]["responses"][201]["content"]["application/json"];
|
|
41
|
-
/** `POST /account/v1/projects
|
|
52
|
+
/** The request body of `POST /account/v1/projects`. */
|
|
42
53
|
export type CreateProjectBody = NonNullable<operations["create-project"]["requestBody"]>["content"]["application/json"];
|
|
43
|
-
/** `POST /account/v1/projects/{projectId}/
|
|
44
|
-
export type
|
|
54
|
+
/** The success response body of `POST /account/v1/projects/{projectId}/scoped-tokens`. */
|
|
55
|
+
export type CreateScopedTokenResult = operations["create-scoped-token"]["responses"][201]["content"]["application/json"];
|
package/dist/account/v1/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Code generated by scripts/generate.mjs. DO NOT EDIT.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
export {};
|
|
3
|
+
// The aliases replace the operations[...] subscript chain with a name. The raw paths /
|
|
4
|
+
// components / operations are exported as well: paths is what createClient<paths>() takes.
|
|
5
|
+
export { client } from "./client.js";
|