@leaflow/sdk 0.0.0-dev.101.g01ce843
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 +34 -0
- package/dist/account/v1/index.d.ts +54 -0
- package/dist/account/v1/index.js +5 -0
- package/dist/account/v1/schema.d.ts +1157 -0
- package/dist/account/v1/schema.js +5 -0
- package/dist/assistant/v1/index.d.ts +108 -0
- package/dist/assistant/v1/index.js +5 -0
- package/dist/assistant/v1/schema.d.ts +2840 -0
- package/dist/assistant/v1/schema.js +5 -0
- package/dist/billing/v1/index.d.ts +74 -0
- package/dist/billing/v1/index.js +5 -0
- package/dist/billing/v1/schema.d.ts +2445 -0
- package/dist/billing/v1/schema.js +5 -0
- package/dist/canopy/v1/index.d.ts +48 -0
- package/dist/canopy/v1/index.js +5 -0
- package/dist/canopy/v1/schema.d.ts +1100 -0
- package/dist/canopy/v1/schema.js +5 -0
- package/dist/compute/v1/index.d.ts +246 -0
- package/dist/compute/v1/index.js +5 -0
- package/dist/compute/v1/schema.d.ts +4924 -0
- package/dist/compute/v1/schema.js +5 -0
- package/dist/dns/v1/index.d.ts +42 -0
- package/dist/dns/v1/index.js +5 -0
- package/dist/dns/v1/schema.d.ts +883 -0
- package/dist/dns/v1/schema.js +5 -0
- package/dist/iam/v1/index.d.ts +84 -0
- package/dist/iam/v1/index.js +5 -0
- package/dist/iam/v1/schema.d.ts +1658 -0
- package/dist/iam/v1/schema.js +5 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +6 -0
- package/dist/monitoring/v1/index.d.ts +176 -0
- package/dist/monitoring/v1/index.js +5 -0
- package/dist/monitoring/v1/schema.d.ts +4181 -0
- package/dist/monitoring/v1/schema.js +5 -0
- package/dist/notification/v1/index.d.ts +76 -0
- package/dist/notification/v1/index.js +5 -0
- package/dist/notification/v1/schema.d.ts +2038 -0
- package/dist/notification/v1/schema.js +5 -0
- package/dist/support/v1/index.d.ts +50 -0
- package/dist/support/v1/index.js +5 -0
- package/dist/support/v1/schema.d.ts +1078 -0
- package/dist/support/v1/schema.js +5 -0
- package/dist/tunnel/v1/index.d.ts +16 -0
- package/dist/tunnel/v1/index.js +5 -0
- package/dist/tunnel/v1/schema.d.ts +401 -0
- package/dist/tunnel/v1/schema.js +5 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# leaflow-ts
|
|
2
|
+
|
|
3
|
+
Leaflow 平台的 TypeScript SDK(`@leaflow/sdk`),由
|
|
4
|
+
[leaflowapis](https://github.com/leaflowapis/leaflowapis) 生成。
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
npm i @leaflow/sdk openapi-fetch
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
当前只含类型。请求由 `openapi-fetch` 发出,路径与参数由契约约束。
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import createClient from 'openapi-fetch';
|
|
14
|
+
import type { compute } from '@leaflow/sdk';
|
|
15
|
+
|
|
16
|
+
const api = createClient<compute.paths>({
|
|
17
|
+
baseUrl: 'https://compute.leaflow.cloud',
|
|
18
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const { data, error } = await api.GET('/api/v1/instances', {
|
|
22
|
+
params: { query: { limit: 20 } },
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
每个操作另有 `<操作>Result` / `<操作>Body` / `<操作>Query` 三个类型别名。
|
|
27
|
+
|
|
28
|
+
## 重新生成
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
npm run generate
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
契约版本记在 `CONTRACTS_REF`。
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type { paths, components, operations, webhooks } from "./schema.js";
|
|
2
|
+
import type { operations } from "./schema.js";
|
|
3
|
+
/** `GET /account/v1/settings` 成功时的响应体。 */
|
|
4
|
+
export type GetSettingsResult = operations["get-settings"]["responses"][200]["content"]["application/json"];
|
|
5
|
+
/** `GET /account/v1/locales` 成功时的响应体。 */
|
|
6
|
+
export type ListLocalesResult = operations["list-locales"]["responses"][200]["content"]["application/json"];
|
|
7
|
+
/** `GET /account/v1/agreements` 成功时的响应体。 */
|
|
8
|
+
export type ListAgreementsResult = operations["list-agreements"]["responses"][200]["content"]["application/json"];
|
|
9
|
+
/** `GET /account/v1/me/consents` 成功时的响应体。 */
|
|
10
|
+
export type ListConsentsResult = operations["list-consents"]["responses"][200]["content"]["application/json"];
|
|
11
|
+
/** `POST /account/v1/me/consents` 成功时的响应体。 */
|
|
12
|
+
export type AcceptAgreementsResult = operations["accept-agreements"]["responses"][200]["content"]["application/json"];
|
|
13
|
+
/** `POST /account/v1/me/consents` 的请求体。 */
|
|
14
|
+
export type AcceptAgreementsBody = NonNullable<operations["accept-agreements"]["requestBody"]>["content"]["application/json"];
|
|
15
|
+
/** `POST /account/v1/register` 成功时的响应体。 */
|
|
16
|
+
export type RegisterResult = operations["register"]["responses"][201]["content"]["application/json"];
|
|
17
|
+
/** `POST /account/v1/register` 的请求体。 */
|
|
18
|
+
export type RegisterBody = NonNullable<operations["register"]["requestBody"]>["content"]["application/json"];
|
|
19
|
+
/** `GET /account/v1/me` 成功时的响应体。 */
|
|
20
|
+
export type GetAccountResult = operations["get-account"]["responses"][200]["content"]["application/json"];
|
|
21
|
+
/** `PATCH /account/v1/me` 成功时的响应体。 */
|
|
22
|
+
export type UpdateAccountResult = operations["update-account"]["responses"][200]["content"]["application/json"];
|
|
23
|
+
/** `PATCH /account/v1/me` 的请求体。 */
|
|
24
|
+
export type UpdateAccountBody = NonNullable<operations["update-account"]["requestBody"]>["content"]["application/json"];
|
|
25
|
+
/** `GET /account/v1/me/identity-verification` 成功时的响应体。 */
|
|
26
|
+
export type GetIdentityVerificationResult = operations["get-identity-verification"]["responses"][200]["content"]["application/json"];
|
|
27
|
+
/** `POST /account/v1/me/identity-verification` 成功时的响应体。 */
|
|
28
|
+
export type SubmitIdentityVerificationResult = operations["submit-identity-verification"]["responses"][202]["content"]["application/json"];
|
|
29
|
+
/** `POST /account/v1/me/identity-verification` 的请求体。 */
|
|
30
|
+
export type SubmitIdentityVerificationBody = NonNullable<operations["submit-identity-verification"]["requestBody"]>["content"]["application/json"];
|
|
31
|
+
/** `GET /account/v1/me/invitations` 成功时的响应体。 */
|
|
32
|
+
export type ListMyInvitationsResult = operations["list-my-invitations"]["responses"][200]["content"]["application/json"];
|
|
33
|
+
/** `GET /account/v1/me/invitations` 的查询参数。 */
|
|
34
|
+
export type ListMyInvitationsQuery = operations["list-my-invitations"]["parameters"]["query"];
|
|
35
|
+
/** `GET /account/v1/invitations/by-token` 成功时的响应体。 */
|
|
36
|
+
export type PreviewInvitationByTokenResult = operations["preview-invitation-by-token"]["responses"][200]["content"]["application/json"];
|
|
37
|
+
/** `GET /account/v1/invitations/by-token` 的查询参数。 */
|
|
38
|
+
export type PreviewInvitationByTokenQuery = operations["preview-invitation-by-token"]["parameters"]["query"];
|
|
39
|
+
/** `POST /account/v1/me/invitations/accept` 成功时的响应体。 */
|
|
40
|
+
export type AcceptInvitationByTokenResult = operations["accept-invitation-by-token"]["responses"][200]["content"]["application/json"];
|
|
41
|
+
/** `POST /account/v1/me/invitations/accept` 的请求体。 */
|
|
42
|
+
export type AcceptInvitationByTokenBody = NonNullable<operations["accept-invitation-by-token"]["requestBody"]>["content"]["application/json"];
|
|
43
|
+
/** `POST /account/v1/me/invitations/{invitationId}/accept` 成功时的响应体。 */
|
|
44
|
+
export type AcceptInvitationResult = operations["accept-invitation"]["responses"][200]["content"]["application/json"];
|
|
45
|
+
/** `GET /account/v1/projects` 成功时的响应体。 */
|
|
46
|
+
export type ListProjectsResult = operations["list-projects"]["responses"][200]["content"]["application/json"];
|
|
47
|
+
/** `GET /account/v1/projects` 的查询参数。 */
|
|
48
|
+
export type ListProjectsQuery = operations["list-projects"]["parameters"]["query"];
|
|
49
|
+
/** `POST /account/v1/projects` 成功时的响应体。 */
|
|
50
|
+
export type CreateProjectResult = operations["create-project"]["responses"][201]["content"]["application/json"];
|
|
51
|
+
/** `POST /account/v1/projects` 的请求体。 */
|
|
52
|
+
export type CreateProjectBody = NonNullable<operations["create-project"]["requestBody"]>["content"]["application/json"];
|
|
53
|
+
/** `POST /account/v1/projects/{projectId}/token` 成功时的响应体。 */
|
|
54
|
+
export type ExchangeProjectTokenResult = operations["exchange-project-token"]["responses"][201]["content"]["application/json"];
|