@leaflow/sdk 0.14.2 → 0.16.0

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.
@@ -76,6 +76,8 @@ export type BindFloatingIpResult = operations["bind-floating-ip"]["responses"][2
76
76
  export type BindFloatingIpBody = NonNullable<operations["bind-floating-ip"]["requestBody"]>["content"]["application/json"];
77
77
  /** `GET /api/v1/instances` 成功时的响应体。 */
78
78
  export type ListInstancesResult = operations["list-instances"]["responses"][200]["content"]["application/json"];
79
+ /** `GET /api/v1/instances` 的查询参数。 */
80
+ export type ListInstancesQuery = operations["list-instances"]["parameters"]["query"];
79
81
  /** `POST /api/v1/instances` 成功时的响应体。 */
80
82
  export type LaunchInstanceResult = operations["launch-instance"]["responses"][201]["content"]["application/json"];
81
83
  /** `POST /api/v1/instances` 的请求体。 */
@@ -96,6 +98,14 @@ export type OpenInstanceConsoleResult = operations["open-instance-console"]["res
96
98
  export type GetInstanceConsoleOutputResult = operations["get-instance-console-output"]["responses"][200]["content"]["application/json"];
97
99
  /** `GET /api/v1/instances/{instanceId}/console-output` 的查询参数。 */
98
100
  export type GetInstanceConsoleOutputQuery = operations["get-instance-console-output"]["parameters"]["query"];
101
+ /** `PUT /api/v1/instances/{instanceId}/labels` 成功时的响应体。 */
102
+ export type SetInstanceLabelsResult = operations["set-instance-labels"]["responses"][200]["content"]["application/json"];
103
+ /** `PUT /api/v1/instances/{instanceId}/labels` 的请求体。 */
104
+ export type SetInstanceLabelsBody = NonNullable<operations["set-instance-labels"]["requestBody"]>["content"]["application/json"];
105
+ /** `PUT /api/v1/instances/{instanceId}/notes` 成功时的响应体。 */
106
+ export type SetInstanceNotesResult = operations["set-instance-notes"]["responses"][200]["content"]["application/json"];
107
+ /** `PUT /api/v1/instances/{instanceId}/notes` 的请求体。 */
108
+ export type SetInstanceNotesBody = NonNullable<operations["set-instance-notes"]["requestBody"]>["content"]["application/json"];
99
109
  /** `POST /api/v1/instances/{instanceId}/password` 成功时的响应体。 */
100
110
  export type ResetInstancePasswordResult = operations["reset-instance-password"]["responses"][200]["content"]["application/json"];
101
111
  /** `POST /api/v1/instances/{instanceId}/password` 的请求体。 */
@@ -354,7 +354,10 @@ export interface paths {
354
354
  path?: never;
355
355
  cookie?: never;
356
356
  };
357
- /** List instances */
357
+ /**
358
+ * List instances
359
+ * @description Every instance in the project, newest first. This endpoint does not query backend state; for the accurate state of one instance, use the retrieve endpoint.
360
+ */
358
361
  get: operations["list-instances"];
359
362
  put?: never;
360
363
  /**
@@ -488,6 +491,54 @@ export interface paths {
488
491
  patch?: never;
489
492
  trace?: never;
490
493
  };
494
+ "/api/v1/instances/{instanceId}/labels": {
495
+ parameters: {
496
+ query?: never;
497
+ header?: never;
498
+ path?: never;
499
+ cookie?: never;
500
+ };
501
+ get?: never;
502
+ /**
503
+ * Replace an instance's labels
504
+ * @description Records what this instance is for, as key-value pairs. Nothing on the platform reads them.
505
+ *
506
+ * **The whole set is replaced**: whatever is absent from the request is removed.
507
+ *
508
+ * Do not put credentials here. Labels are visible to platform operators.
509
+ */
510
+ put: operations["set-instance-labels"];
511
+ post?: never;
512
+ delete?: never;
513
+ options?: never;
514
+ head?: never;
515
+ patch?: never;
516
+ trace?: never;
517
+ };
518
+ "/api/v1/instances/{instanceId}/notes": {
519
+ parameters: {
520
+ query?: never;
521
+ header?: never;
522
+ path?: never;
523
+ cookie?: never;
524
+ };
525
+ get?: never;
526
+ /**
527
+ * Replace an instance's note
528
+ * @description A free-text note about this instance — what it runs, and what to be careful about before touching it.
529
+ *
530
+ * **The whole note is replaced**; send an empty string to clear it.
531
+ *
532
+ * Do not put credentials here. The note is visible to platform operators.
533
+ */
534
+ put: operations["set-instance-notes"];
535
+ post?: never;
536
+ delete?: never;
537
+ options?: never;
538
+ head?: never;
539
+ patch?: never;
540
+ trace?: never;
541
+ };
491
542
  "/api/v1/instances/{instanceId}/password": {
492
543
  parameters: {
493
544
  query?: never;
@@ -1312,6 +1363,8 @@ export interface components {
1312
1363
  architecture: string;
1313
1364
  /** Format: uuid */
1314
1365
  id: string;
1366
+ /** @description The account this image lets you log in as. The password set at creation belongs to this account */
1367
+ login_username: string;
1315
1368
  /** Format: int64 */
1316
1369
  min_disk_gb: number;
1317
1370
  /** Format: int64 */
@@ -1453,7 +1506,15 @@ export interface components {
1453
1506
  instance_type_id: string;
1454
1507
  /** @description IPv6 address of the primary network interface. Assigned automatically once IPv6 is enabled on the private network */
1455
1508
  ipv6_address: string | null;
1509
+ /** @description Your own classification of this instance, as key-value pairs. Empty when never set */
1510
+ labels: {
1511
+ [key: string]: string;
1512
+ };
1513
+ /** @description The account to log in as over SSH. The password set at creation belongs to this account */
1514
+ login_username: string;
1456
1515
  name: string;
1516
+ /** @description A free-text note about this instance. Empty when never set */
1517
+ notes: string;
1457
1518
  /**
1458
1519
  * Format: uuid
1459
1520
  * @description Non-empty while a resize awaits confirmation. Confirming puts this type into effect, reverting discards it
@@ -1542,6 +1603,16 @@ export interface components {
1542
1603
  /** @description Returned only in this response; store it immediately. All instances of a batch share it */
1543
1604
  password: string;
1544
1605
  };
1606
+ SetInstanceLabelsRequestBody: {
1607
+ /** @description The complete set of labels. Whatever is absent here is removed; send an empty object to clear them all. A key may not contain a colon, whitespace or control characters */
1608
+ labels: {
1609
+ [key: string]: string;
1610
+ };
1611
+ };
1612
+ SetInstanceNotesRequestBody: {
1613
+ /** @description The complete note. Send an empty string to clear it */
1614
+ notes: string;
1615
+ };
1545
1616
  RenameInstanceRequestBody: {
1546
1617
  name: string;
1547
1618
  };
@@ -1557,11 +1628,6 @@ export interface components {
1557
1628
  * @description Kill the command after this long. 60 when omitted
1558
1629
  */
1559
1630
  timeout_seconds?: number;
1560
- /**
1561
- * @description The SSH user to log in as. It is the account the platform sets a password for at creation
1562
- * @default root
1563
- */
1564
- username?: string;
1565
1631
  };
1566
1632
  CommandResultResponseBody: {
1567
1633
  /**
@@ -1697,6 +1763,8 @@ export interface components {
1697
1763
  failure: string | null;
1698
1764
  /** Format: uuid */
1699
1765
  id: string;
1766
+ /** @description The account this image lets you log in as. The password set at creation belongs to this account */
1767
+ login_username: string;
1700
1768
  /**
1701
1769
  * Format: int64
1702
1770
  * @description The system disk of an instance created from this image cannot be smaller than this
@@ -2736,7 +2804,10 @@ export interface operations {
2736
2804
  };
2737
2805
  "list-instances": {
2738
2806
  parameters: {
2739
- query?: never;
2807
+ query?: {
2808
+ /** @description Only instances carrying this label, written as `key:value` — for example `env:prod`. Both halves are matched exactly */
2809
+ label?: string;
2810
+ };
2740
2811
  header?: never;
2741
2812
  path?: never;
2742
2813
  cookie?: never;
@@ -2991,6 +3062,76 @@ export interface operations {
2991
3062
  };
2992
3063
  };
2993
3064
  };
3065
+ "set-instance-labels": {
3066
+ parameters: {
3067
+ query?: never;
3068
+ header?: never;
3069
+ path: {
3070
+ instanceId: string;
3071
+ };
3072
+ cookie?: never;
3073
+ };
3074
+ requestBody: {
3075
+ content: {
3076
+ "application/json": components["schemas"]["SetInstanceLabelsRequestBody"];
3077
+ };
3078
+ };
3079
+ responses: {
3080
+ /** @description OK */
3081
+ 200: {
3082
+ headers: {
3083
+ [name: string]: unknown;
3084
+ };
3085
+ content: {
3086
+ "application/json": components["schemas"]["InstanceResource"];
3087
+ };
3088
+ };
3089
+ /** @description Error */
3090
+ default: {
3091
+ headers: {
3092
+ [name: string]: unknown;
3093
+ };
3094
+ content: {
3095
+ "application/json": components["schemas"]["Error"];
3096
+ };
3097
+ };
3098
+ };
3099
+ };
3100
+ "set-instance-notes": {
3101
+ parameters: {
3102
+ query?: never;
3103
+ header?: never;
3104
+ path: {
3105
+ instanceId: string;
3106
+ };
3107
+ cookie?: never;
3108
+ };
3109
+ requestBody: {
3110
+ content: {
3111
+ "application/json": components["schemas"]["SetInstanceNotesRequestBody"];
3112
+ };
3113
+ };
3114
+ responses: {
3115
+ /** @description OK */
3116
+ 200: {
3117
+ headers: {
3118
+ [name: string]: unknown;
3119
+ };
3120
+ content: {
3121
+ "application/json": components["schemas"]["InstanceResource"];
3122
+ };
3123
+ };
3124
+ /** @description Error */
3125
+ default: {
3126
+ headers: {
3127
+ [name: string]: unknown;
3128
+ };
3129
+ content: {
3130
+ "application/json": components["schemas"]["Error"];
3131
+ };
3132
+ };
3133
+ };
3134
+ };
2994
3135
  "reset-instance-password": {
2995
3136
  parameters: {
2996
3137
  query?: never;
@@ -0,0 +1,42 @@
1
+ export type { paths, components, operations, webhooks } from "./schema.js";
2
+ import type { operations } from "./schema.js";
3
+ /** `GET /api/v1/credentials` 成功时的响应体。 */
4
+ export type ListCredentialsResult = operations["list-credentials"]["responses"][200]["content"]["application/json"];
5
+ /** `GET /api/v1/credentials` 的查询参数。 */
6
+ export type ListCredentialsQuery = operations["list-credentials"]["parameters"]["query"];
7
+ /** `POST /api/v1/credentials` 成功时的响应体。 */
8
+ export type CreateCredentialResult = operations["create-credential"]["responses"][201]["content"]["application/json"];
9
+ /** `POST /api/v1/credentials` 的请求体。 */
10
+ export type CreateCredentialBody = NonNullable<operations["create-credential"]["requestBody"]>["content"]["application/json"];
11
+ /** `GET /api/v1/credentials/{credentialId}` 成功时的响应体。 */
12
+ export type GetCredentialResult = operations["get-credential"]["responses"][200]["content"]["application/json"];
13
+ /** `PATCH /api/v1/credentials/{credentialId}` 成功时的响应体。 */
14
+ export type RenameCredentialResult = operations["rename-credential"]["responses"][200]["content"]["application/json"];
15
+ /** `PATCH /api/v1/credentials/{credentialId}` 的请求体。 */
16
+ export type RenameCredentialBody = NonNullable<operations["rename-credential"]["requestBody"]>["content"]["application/json"];
17
+ /** `POST /api/v1/credentials/{credentialId}/verification` 成功时的响应体。 */
18
+ export type VerifyCredentialResult = operations["verify-credential"]["responses"][200]["content"]["application/json"];
19
+ /** `GET /api/v1/zones` 成功时的响应体。 */
20
+ export type ListZonesResult = operations["list-zones"]["responses"][200]["content"]["application/json"];
21
+ /** `GET /api/v1/zones` 的查询参数。 */
22
+ export type ListZonesQuery = operations["list-zones"]["parameters"]["query"];
23
+ /** `GET /api/v1/zones/{zone}/records` 成功时的响应体。 */
24
+ export type ListRecordsResult = operations["list-records"]["responses"][200]["content"]["application/json"];
25
+ /** `GET /api/v1/zones/{zone}/records` 的查询参数。 */
26
+ export type ListRecordsQuery = operations["list-records"]["parameters"]["query"];
27
+ /** `GET /api/v1/zones/{zone}/records/{name}/{type}` 成功时的响应体。 */
28
+ export type GetRecordSetResult = operations["get-record-set"]["responses"][200]["content"]["application/json"];
29
+ /** `PATCH /api/v1/zones/{zone}/records/{name}/{type}` 成功时的响应体。 */
30
+ export type ModifyRecordSetResult = operations["modify-record-set"]["responses"][200]["content"]["application/json"];
31
+ /** `PATCH /api/v1/zones/{zone}/records/{name}/{type}` 的查询参数。 */
32
+ export type ModifyRecordSetQuery = operations["modify-record-set"]["parameters"]["query"];
33
+ /** `PATCH /api/v1/zones/{zone}/records/{name}/{type}` 的请求体。 */
34
+ export type ModifyRecordSetBody = NonNullable<operations["modify-record-set"]["requestBody"]>["content"]["application/json"];
35
+ /** `PUT /api/v1/zones/{zone}/records/{name}/{type}` 成功时的响应体。 */
36
+ export type SetRecordSetResult = operations["set-record-set"]["responses"][200]["content"]["application/json"];
37
+ /** `PUT /api/v1/zones/{zone}/records/{name}/{type}` 的查询参数。 */
38
+ export type SetRecordSetQuery = operations["set-record-set"]["parameters"]["query"];
39
+ /** `PUT /api/v1/zones/{zone}/records/{name}/{type}` 的请求体。 */
40
+ export type SetRecordSetBody = NonNullable<operations["set-record-set"]["requestBody"]>["content"]["application/json"];
41
+ /** `DELETE /api/v1/zones/{zone}/records/{name}/{type}` 的查询参数。 */
42
+ export type DeleteRecordSetQuery = operations["delete-record-set"]["parameters"]["query"];
@@ -0,0 +1,5 @@
1
+ // 由 scripts/generate-ts.mjs 生成,不要手改。
2
+ //
3
+ // 别名把 operations[...] 那串下标换成一个名字。原始的 paths / components / operations 也
4
+ // 一并导出:paths 是给 openapi-fetch 的 createClient<paths>() 用的。
5
+ export {};