@leaflow/sdk 0.0.0-dev.17.geb299fb → 0.0.0-dev.171.g5d23fa1

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.
Files changed (81) hide show
  1. package/README.md +13 -1
  2. package/dist/account/v1/client.d.ts +4 -0
  3. package/dist/account/v1/client.js +7 -0
  4. package/dist/account/v1/index.d.ts +34 -21
  5. package/dist/account/v1/index.js +4 -4
  6. package/dist/account/v1/schema.d.ts +374 -81
  7. package/dist/assistant/v1/client.d.ts +4 -0
  8. package/dist/assistant/v1/client.js +7 -0
  9. package/dist/assistant/v1/index.d.ts +69 -40
  10. package/dist/assistant/v1/index.js +4 -4
  11. package/dist/assistant/v1/schema.d.ts +1089 -133
  12. package/dist/billing/v1/client.d.ts +6 -0
  13. package/dist/billing/v1/client.js +6 -0
  14. package/dist/billing/v1/index.d.ts +205 -0
  15. package/dist/billing/v1/index.js +5 -0
  16. package/dist/billing/v1/schema.d.ts +4976 -0
  17. package/dist/billing/v1/schema.js +5 -0
  18. package/dist/canopy/v1/client.d.ts +4 -0
  19. package/dist/canopy/v1/client.js +7 -0
  20. package/dist/canopy/v1/index.d.ts +24 -23
  21. package/dist/canopy/v1/index.js +4 -4
  22. package/dist/canopy/v1/schema.d.ts +113 -109
  23. package/dist/compute/v1/client.d.ts +4 -0
  24. package/dist/compute/v1/client.js +7 -0
  25. package/dist/compute/v1/index.d.ts +174 -127
  26. package/dist/compute/v1/index.js +4 -4
  27. package/dist/compute/v1/schema.d.ts +1688 -499
  28. package/dist/dns/v1/client.d.ts +4 -0
  29. package/dist/dns/v1/client.js +7 -0
  30. package/dist/dns/v1/index.d.ts +43 -0
  31. package/dist/dns/v1/index.js +5 -0
  32. package/dist/dns/v1/schema.d.ts +887 -0
  33. package/dist/dns/v1/schema.js +5 -0
  34. package/dist/fabric/v1/client.d.ts +4 -0
  35. package/dist/fabric/v1/client.js +7 -0
  36. package/dist/fabric/v1/index.d.ts +115 -0
  37. package/dist/fabric/v1/index.js +5 -0
  38. package/dist/fabric/v1/schema.d.ts +2311 -0
  39. package/dist/fabric/v1/schema.js +5 -0
  40. package/dist/fleet/v1/client.d.ts +4 -0
  41. package/dist/fleet/v1/client.js +7 -0
  42. package/dist/fleet/v1/index.d.ts +15 -0
  43. package/dist/fleet/v1/index.js +5 -0
  44. package/dist/fleet/v1/schema.d.ts +291 -0
  45. package/dist/fleet/v1/schema.js +5 -0
  46. package/dist/iam/v1/client.d.ts +4 -0
  47. package/dist/iam/v1/client.js +7 -0
  48. package/dist/iam/v1/index.d.ts +55 -32
  49. package/dist/iam/v1/index.js +4 -4
  50. package/dist/iam/v1/schema.d.ts +521 -88
  51. package/dist/index.d.ts +14 -7
  52. package/dist/index.js +22 -5
  53. package/dist/monitoring/v1/client.d.ts +4 -0
  54. package/dist/monitoring/v1/client.js +7 -0
  55. package/dist/monitoring/v1/index.d.ts +130 -49
  56. package/dist/monitoring/v1/index.js +4 -4
  57. package/dist/monitoring/v1/schema.d.ts +2420 -527
  58. package/dist/notification/v1/client.d.ts +4 -0
  59. package/dist/notification/v1/client.js +7 -0
  60. package/dist/notification/v1/index.d.ts +77 -0
  61. package/dist/notification/v1/index.js +5 -0
  62. package/dist/notification/v1/schema.d.ts +2048 -0
  63. package/dist/notification/v1/schema.js +5 -0
  64. package/dist/storage/v1/client.d.ts +4 -0
  65. package/dist/storage/v1/client.js +7 -0
  66. package/dist/storage/v1/index.d.ts +35 -0
  67. package/dist/storage/v1/index.js +5 -0
  68. package/dist/storage/v1/schema.d.ts +751 -0
  69. package/dist/storage/v1/schema.js +5 -0
  70. package/dist/support/v1/client.d.ts +4 -0
  71. package/dist/support/v1/client.js +7 -0
  72. package/dist/support/v1/index.d.ts +51 -0
  73. package/dist/support/v1/index.js +5 -0
  74. package/dist/support/v1/schema.d.ts +1082 -0
  75. package/dist/support/v1/schema.js +5 -0
  76. package/dist/tunnel/v1/client.d.ts +4 -0
  77. package/dist/tunnel/v1/client.js +7 -0
  78. package/dist/tunnel/v1/index.d.ts +8 -7
  79. package/dist/tunnel/v1/index.js +4 -4
  80. package/dist/tunnel/v1/schema.d.ts +40 -34
  81. 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
- 当前只含类型。请求由 `openapi-fetch` 发出,路径与参数由契约约束。
10
+ 包含 Node.js 可用的 JavaScript 客户端和 TypeScript 类型。请求由 `openapi-fetch` 发出,路径与参数由契约约束。
11
11
 
12
12
  ```ts
13
13
  import createClient from 'openapi-fetch';
@@ -32,3 +32,15 @@ npm run generate
32
32
  ```
33
33
 
34
34
  契约版本记在 `CONTRACTS_REF`。
35
+
36
+ ## Billing
37
+
38
+ ```ts
39
+ import { client } from "@leaflow/sdk/billing/v1";
40
+
41
+ const billing = client({ baseUrl: billingBaseUrl, headers });
42
+ ```
43
+
44
+ 公共目录、账户和项目接口使用 `@leaflow/sdk`,运营管理接口使用 `@leaflow/sdk-admin`。服务间 Proto 使用独立的 `@leaflow/billing` 包。
45
+
46
+ 本地契约可通过 `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,42 +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/agreements` 成功时的响应体。 */
4
+ /** The success response body of `GET /account/v1/settings`. */
5
+ export type GetSettingsResult = operations["get-settings"]["responses"][200]["content"]["application/json"];
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`. */
4
9
  export type ListAgreementsResult = operations["list-agreements"]["responses"][200]["content"]["application/json"];
5
- /** `GET /account/v1/me/consents` 成功时的响应体。 */
10
+ /** The success response body of `GET /account/v1/me/consents`. */
6
11
  export type ListConsentsResult = operations["list-consents"]["responses"][200]["content"]["application/json"];
7
- /** `POST /account/v1/me/consents` 成功时的响应体。 */
12
+ /** The success response body of `POST /account/v1/me/consents`. */
8
13
  export type AcceptAgreementsResult = operations["accept-agreements"]["responses"][200]["content"]["application/json"];
9
- /** `POST /account/v1/me/consents` 的请求体。 */
14
+ /** The request body of `POST /account/v1/me/consents`. */
10
15
  export type AcceptAgreementsBody = NonNullable<operations["accept-agreements"]["requestBody"]>["content"]["application/json"];
11
- /** `POST /account/v1/register` 成功时的响应体。 */
16
+ /** The success response body of `POST /account/v1/register`. */
12
17
  export type RegisterResult = operations["register"]["responses"][201]["content"]["application/json"];
13
- /** `POST /account/v1/register` 的请求体。 */
18
+ /** The request body of `POST /account/v1/register`. */
14
19
  export type RegisterBody = NonNullable<operations["register"]["requestBody"]>["content"]["application/json"];
15
- /** `GET /account/v1/me` 成功时的响应体。 */
20
+ /** The success response body of `GET /account/v1/me`. */
16
21
  export type GetAccountResult = operations["get-account"]["responses"][200]["content"]["application/json"];
17
- /** `GET /account/v1/me/identity-verification` 成功时的响应体。 */
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`. */
18
27
  export type GetIdentityVerificationResult = operations["get-identity-verification"]["responses"][200]["content"]["application/json"];
19
- /** `POST /account/v1/me/identity-verification` 成功时的响应体。 */
28
+ /** The success response body of `POST /account/v1/me/identity-verification`. */
20
29
  export type SubmitIdentityVerificationResult = operations["submit-identity-verification"]["responses"][202]["content"]["application/json"];
21
- /** `POST /account/v1/me/identity-verification` 的请求体。 */
30
+ /** The request body of `POST /account/v1/me/identity-verification`. */
22
31
  export type SubmitIdentityVerificationBody = NonNullable<operations["submit-identity-verification"]["requestBody"]>["content"]["application/json"];
23
- /** `GET /account/v1/me/invitations` 成功时的响应体。 */
32
+ /** The success response body of `GET /account/v1/me/invitations`. */
24
33
  export type ListMyInvitationsResult = operations["list-my-invitations"]["responses"][200]["content"]["application/json"];
25
- /** `GET /account/v1/me/invitations` 的查询参数。 */
34
+ /** The query parameters of `GET /account/v1/me/invitations`. */
26
35
  export type ListMyInvitationsQuery = operations["list-my-invitations"]["parameters"]["query"];
27
- /** `POST /account/v1/me/invitations/accept` 成功时的响应体。 */
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`. */
28
41
  export type AcceptInvitationByTokenResult = operations["accept-invitation-by-token"]["responses"][200]["content"]["application/json"];
29
- /** `POST /account/v1/me/invitations/accept` 的请求体。 */
42
+ /** The request body of `POST /account/v1/me/invitations/accept`. */
30
43
  export type AcceptInvitationByTokenBody = NonNullable<operations["accept-invitation-by-token"]["requestBody"]>["content"]["application/json"];
31
- /** `POST /account/v1/me/invitations/{invitationId}/accept` 成功时的响应体。 */
44
+ /** The success response body of `POST /account/v1/me/invitations/{invitationId}/accept`. */
32
45
  export type AcceptInvitationResult = operations["accept-invitation"]["responses"][200]["content"]["application/json"];
33
- /** `GET /account/v1/projects` 成功时的响应体。 */
46
+ /** The success response body of `GET /account/v1/projects`. */
34
47
  export type ListProjectsResult = operations["list-projects"]["responses"][200]["content"]["application/json"];
35
- /** `GET /account/v1/projects` 的查询参数。 */
48
+ /** The query parameters of `GET /account/v1/projects`. */
36
49
  export type ListProjectsQuery = operations["list-projects"]["parameters"]["query"];
37
- /** `POST /account/v1/projects` 成功时的响应体。 */
50
+ /** The success response body of `POST /account/v1/projects`. */
38
51
  export type CreateProjectResult = operations["create-project"]["responses"][201]["content"]["application/json"];
39
- /** `POST /account/v1/projects` 的请求体。 */
52
+ /** The request body of `POST /account/v1/projects`. */
40
53
  export type CreateProjectBody = NonNullable<operations["create-project"]["requestBody"]>["content"]["application/json"];
41
- /** `POST /account/v1/projects/{projectId}/token` 成功时的响应体。 */
42
- export type ExchangeProjectTokenResult = operations["exchange-project-token"]["responses"][201]["content"]["application/json"];
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"];
@@ -1,5 +1,5 @@
1
- // 由 scripts/generate-ts.mjs 生成,不要手改。
1
+ // Code generated by scripts/generate.mjs. DO NOT EDIT.
2
2
  //
3
- // 别名把 operations[...] 那串下标换成一个名字。原始的 paths / components / operations 也
4
- // 一并导出:paths 是给 openapi-fetch 的 createClient<paths>() 用的。
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";