@leaflow/sdk 0.0.0-dev.212.gea1bf06 → 0.0.0-dev.216.gab0f521
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 +12 -3
- package/dist/billing/{v1 → account/v1}/client.d.ts +1 -1
- package/dist/{billingaccount → billing/account}/v1/client.js +1 -1
- package/dist/{billingaccount → billing/account}/v1/index.d.ts +0 -26
- package/dist/{billingaccount → billing/account}/v1/schema.d.ts +9 -776
- package/dist/{billingaccount → billing/catalog}/v1/client.d.ts +1 -1
- package/dist/billing/{v1 → catalog/v1}/client.js +1 -1
- package/dist/billing/catalog/v1/index.d.ts +29 -0
- package/dist/billing/catalog/v1/schema.d.ts +910 -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.js +5 -0
- package/dist/billing/project/v1/schema.js +5 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/package.json +11 -7
- /package/dist/billing/{v1 → account/v1}/index.js +0 -0
- /package/dist/billing/{v1 → account/v1}/schema.js +0 -0
- /package/dist/{billingaccount → billing/catalog}/v1/index.js +0 -0
- /package/dist/{billingaccount → billing/catalog}/v1/schema.js +0 -0
- /package/dist/billing/{v1 → project/v1}/index.d.ts +0 -0
- /package/dist/billing/{v1 → project/v1}/schema.d.ts +0 -0
package/README.md
CHANGED
|
@@ -35,12 +35,21 @@ npm run generate
|
|
|
35
35
|
|
|
36
36
|
## Billing
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
import { client } from "@leaflow/sdk/billing/v1";
|
|
38
|
+
Billing 按职能分为三个子包,三者地址相同,凭据各不相同:
|
|
40
39
|
|
|
41
|
-
|
|
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 });
|
|
42
49
|
```
|
|
43
50
|
|
|
51
|
+
也可按子路径单独导入,例如 `@leaflow/sdk/billing/catalog/v1`。
|
|
52
|
+
|
|
44
53
|
公共目录、账户和项目接口使用 `@leaflow/sdk`,运营管理接口使用 `@leaflow/sdk-admin`。服务间 Proto 使用独立的 `@leaflow/billing` 包。
|
|
45
54
|
|
|
46
55
|
本地契约可通过 `CONTRACTS_DIR=/absolute/path/to/contracts npm run generate` 生成。发布时将契约提交号写入 `CONTRACTS_REF`,再使用默认生成命令。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ClientOptions } from "openapi-fetch";
|
|
2
2
|
import type { paths } from "./schema.js";
|
|
3
|
-
/** A client for the billing service. Pass baseUrl to override the address. */
|
|
3
|
+
/** A client for the billing account service. Pass baseUrl to override the address. */
|
|
4
4
|
export declare function client(options?: ClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated from the contract's servers[0]. DO NOT EDIT.
|
|
2
2
|
import createClient, {} from "openapi-fetch";
|
|
3
3
|
const defaultBaseUrl = "https://billing.leaflow.cloud";
|
|
4
|
-
/** A client for the
|
|
4
|
+
/** A client for the billing account service. Pass baseUrl to override the address. */
|
|
5
5
|
export function client(options = {}) {
|
|
6
6
|
return createClient({ baseUrl: defaultBaseUrl, ...options });
|
|
7
7
|
}
|
|
@@ -1,32 +1,6 @@
|
|
|
1
1
|
export type { paths, components, operations, webhooks } from "./schema.js";
|
|
2
2
|
export { client } from "./client.js";
|
|
3
3
|
import type { operations } from "./schema.js";
|
|
4
|
-
/** The success response body of `GET /api/v1/prices`. */
|
|
5
|
-
export type ListPricesResult = operations["list-prices"]["responses"][200]["content"]["application/json"];
|
|
6
|
-
/** The query parameters of `GET /api/v1/prices`. */
|
|
7
|
-
export type ListPricesQuery = operations["list-prices"]["parameters"]["query"];
|
|
8
|
-
/** The success response body of `GET /api/v1/products`. */
|
|
9
|
-
export type ListProductsResult = operations["list-products"]["responses"][200]["content"]["application/json"];
|
|
10
|
-
/** The success response body of `GET /api/v1/products/{productId}`. */
|
|
11
|
-
export type GetProductResult = operations["get-product"]["responses"][200]["content"]["application/json"];
|
|
12
|
-
/** The success response body of `GET /api/v1/plans/{planId}`. */
|
|
13
|
-
export type GetPlanResult = operations["get-plan"]["responses"][200]["content"]["application/json"];
|
|
14
|
-
/** The success response body of `GET /api/v1/prices/{priceId}`. */
|
|
15
|
-
export type GetPriceResult = operations["get-price"]["responses"][200]["content"]["application/json"];
|
|
16
|
-
/** The success response body of `GET /api/v1/plans`. */
|
|
17
|
-
export type ListPlansResult = operations["list-plans"]["responses"][200]["content"]["application/json"];
|
|
18
|
-
/** The success response body of `GET /api/v1/plans/{planId}/prices`. */
|
|
19
|
-
export type ListPricesByPlanResult = operations["list-prices-by-plan"]["responses"][200]["content"]["application/json"];
|
|
20
|
-
/** The query parameters of `GET /api/v1/plans/{planId}/prices`. */
|
|
21
|
-
export type ListPricesByPlanQuery = operations["list-prices-by-plan"]["parameters"]["query"];
|
|
22
|
-
/** The success response body of `GET /api/v1/rate-cards/{rateCardId}/rules`. */
|
|
23
|
-
export type ListRatesResult = operations["list-rates"]["responses"][200]["content"]["application/json"];
|
|
24
|
-
/** The query parameters of `GET /api/v1/rate-cards/{rateCardId}/rules`. */
|
|
25
|
-
export type ListRatesQuery = operations["list-rates"]["parameters"]["query"];
|
|
26
|
-
/** The success response body of `POST /api/v1/estimates`. */
|
|
27
|
-
export type CreateEstimateResult = operations["create-estimate"]["responses"][200]["content"]["application/json"];
|
|
28
|
-
/** The request body of `POST /api/v1/estimates`. */
|
|
29
|
-
export type CreateEstimateBody = NonNullable<operations["create-estimate"]["requestBody"]>["content"]["application/json"];
|
|
30
4
|
/** The success response body of `GET /account/v1/currencies`. */
|
|
31
5
|
export type ListCurrenciesResult = operations["list-currencies"]["responses"][200]["content"]["application/json"];
|
|
32
6
|
/** The success response body of `GET /account/v1/billing-accounts`. */
|