@leaflow/sdk 0.54.3 → 0.55.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.
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export type * as billing from "./billing/v1/index.js";
4
4
  export type * as canopy from "./canopy/v1/index.js";
5
5
  export type * as compute from "./compute/v1/index.js";
6
6
  export type * as dns from "./dns/v1/index.js";
7
+ export type * as fleet from "./fleet/v1/index.js";
7
8
  export type * as iam from "./iam/v1/index.js";
8
9
  export type * as monitoring from "./monitoring/v1/index.js";
9
10
  export type * as notification from "./notification/v1/index.js";
@@ -66,14 +66,14 @@ export type ListServersResult = operations["list-servers"]["responses"][200]["co
66
66
  export type ListServersQuery = operations["list-servers"]["parameters"]["query"];
67
67
  /** `GET /api/v1/servers/{serverId}` 成功时的响应体。 */
68
68
  export type GetServerResult = operations["get-server"]["responses"][200]["content"]["application/json"];
69
- /** `PATCH /api/v1/servers/{serverId}` 成功时的响应体。 */
70
- export type UpdateServerResult = operations["update-server"]["responses"][200]["content"]["application/json"];
71
- /** `PATCH /api/v1/servers/{serverId}` 的请求体。 */
72
- export type UpdateServerBody = NonNullable<operations["update-server"]["requestBody"]>["content"]["application/json"];
73
69
  /** `PUT /api/v1/servers/{serverId}` 成功时的响应体。 */
74
70
  export type EnableServerMonitoringResult = operations["enable-server-monitoring"]["responses"][200]["content"]["application/json"];
75
71
  /** `PUT /api/v1/servers/{serverId}` 的请求体。 */
76
72
  export type EnableServerMonitoringBody = NonNullable<operations["enable-server-monitoring"]["requestBody"]>["content"]["application/json"];
73
+ /** `PATCH /api/v1/servers/{serverId}` 成功时的响应体。 */
74
+ export type UpdateServerResult = operations["update-server"]["responses"][200]["content"]["application/json"];
75
+ /** `PATCH /api/v1/servers/{serverId}` 的请求体。 */
76
+ export type UpdateServerBody = NonNullable<operations["update-server"]["requestBody"]>["content"]["application/json"];
77
77
  /** `POST /api/v1/servers/{serverId}/psk` 成功时的响应体。 */
78
78
  export type RotateAgentPskResult = operations["rotate-agent-psk"]["responses"][200]["content"]["application/json"];
79
79
  /** `GET /api/v1/servers/{serverId}/web-checks/{checkId}` 成功时的响应体。 */
@@ -958,6 +958,10 @@ export interface components {
958
958
  Error: {
959
959
  code?: string;
960
960
  message: string;
961
+ /**
962
+ * @description What a given `code` carries alongside the message. The keys depend on the code,
963
+ * and a client that does not recognise one ignores it.
964
+ */
961
965
  meta?: {
962
966
  [key: string]: unknown;
963
967
  };
@@ -624,6 +624,10 @@ export interface components {
624
624
  Error: {
625
625
  code?: string;
626
626
  message: string;
627
+ /**
628
+ * @description What a given `code` carries alongside the message. The keys depend on the code,
629
+ * and a client that does not recognise one ignores it.
630
+ */
627
631
  meta?: {
628
632
  [key: string]: unknown;
629
633
  };
@@ -298,6 +298,10 @@ export interface components {
298
298
  Error: {
299
299
  code?: string;
300
300
  message: string;
301
+ /**
302
+ * @description What a given `code` carries alongside the message. The keys depend on the code,
303
+ * and a client that does not recognise one ignores it.
304
+ */
301
305
  meta?: {
302
306
  [key: string]: unknown;
303
307
  };
@@ -11,20 +11,20 @@ export interface paths {
11
11
  cookie?: never;
12
12
  };
13
13
  /**
14
- * 查看本项目的四层隧道
15
- * @description 还没生成过时返回 `TUNNEL_NOT_FOUND`——首屏据此决定画「生成订阅链接」那个按钮还是画结果。
14
+ * Get the layer 4 tunnel of the current project
15
+ * @description `TUNNEL_NOT_FOUND` means no tunnel has been generated yet.
16
16
  *
17
- * 项目未获开放时返回 403 `TUNNEL_NOT_ENTITLED`,那是另一件事:控制台据此把四层隧道的入口整个收起来,而不是画那个按钮。
17
+ * 403 `TUNNEL_NOT_ENTITLED` states something else: the project has not been entitled to layer 4 at all.
18
18
  *
19
- * 订阅地址、用量、配额各有自己的接口,这里不重复返回。
19
+ * The subscription address, the usage and the quota each have their own endpoint and are not repeated here.
20
20
  */
21
21
  get: operations["get-l4-tunnel"];
22
22
  put?: never;
23
23
  /**
24
- * 生成四层隧道
25
- * @description **幂等**:已经有了再调一次返回同一条,不报错。按钮被点两次是安全的。
24
+ * Generate the layer 4 tunnel
25
+ * @description **Idempotent**: calling it again returns the existing tunnel rather than an error.
26
26
  *
27
- * 生成之后请调订阅接口取地址,本接口不返回它。
27
+ * Read the address from the subscription endpoint afterwards; it is not returned here.
28
28
  */
29
29
  post: operations["generate-l4-tunnel"];
30
30
  delete?: never;
@@ -41,12 +41,12 @@ export interface paths {
41
41
  cookie?: never;
42
42
  };
43
43
  /**
44
- * 获取订阅地址
45
- * @description **这条 URL 是凭据,等同于密码。** 拿着它就能取到这个项目的全部节点和密码,所以它只在这一个接口里出现,一次一条——不进任何列表,也不在隧道详情里。
44
+ * Get the subscription address
45
+ * @description **This URL is a credential, equivalent to a password.** It yields every node of the project along with their passwords. It is returned here alone, and appears neither in the tunnel itself nor in any list.
46
46
  *
47
- * 客户端不应在用户主动请求之前调用它:这个接口的每一次调用都会被记进操作日志。
47
+ * Do not call this endpoint before the user asks for the address.
48
48
  *
49
- * `status` `preparing` 时链接**照样有效**,内容会在拉取那一刻重新派生。它只该影响页面上说什么。
49
+ * A `status` of `preparing` leaves the link usable; its contents are derived at the moment it is fetched.
50
50
  */
51
51
  get: operations["get-l4-tunnel-subscription"];
52
52
  put?: never;
@@ -67,14 +67,14 @@ export interface paths {
67
67
  get?: never;
68
68
  put?: never;
69
69
  /**
70
- * 重置订阅地址与节点密码
71
- * @description **这是凭据泄露时的处置手段,会让已分发出去的每一份订阅立即失效。**
70
+ * Rotate the subscription address and the node passwords
71
+ * @description **This is the remedy for an exposed credential, and every subscription already distributed stops working at once.**
72
72
  *
73
- * 订阅 token 和节点密码同时更换,所有客户端都必须重新拉取一次订阅才能继续使用。调用前请确认这确实是想要的结果。
73
+ * The subscription token and the node passwords are replaced together, so every client has to fetch the subscription again before it can carry on. Confirm that this is the intended outcome before calling.
74
74
  *
75
- * 隧道被平台停用时无法重置(`TUNNEL_DISABLED_FOR_ROTATE`),需要先处理停用的原因。
75
+ * A tunnel disabled by the platform cannot be rotated (`TUNNEL_DISABLED_FOR_ROTATE`); resolve the cause first.
76
76
  *
77
- * 重置后请调订阅接口取新地址,**本接口不返回它**。
77
+ * Read the new address from the subscription endpoint afterwards; **it is not returned here**.
78
78
  */
79
79
  post: operations["rotate-l4-tunnel-subscription"];
80
80
  delete?: never;
@@ -91,10 +91,10 @@ export interface paths {
91
91
  cookie?: never;
92
92
  };
93
93
  /**
94
- * 查看本期用量
95
- * @description 实时查询,不经过缓存。
94
+ * Get the usage of the current period
95
+ * @description Read live.
96
96
  *
97
- * 判断是否超额只看 `billed_bytes`:线路可以设置倍率(如 1.5× 0×),`raw_bytes` 是实际传输量,两者不一定相等。`quota_bytes` 0 表示不限量。
97
+ * Only `billed_bytes` decides whether the quota is exceeded: a route may carry a multiplier such as 1.5× or 0×, so `raw_bytes`, the volume actually transferred, need not equal it. A `quota_bytes` of 0 means unlimited.
98
98
  */
99
99
  get: operations["get-l4-tunnel-usage"];
100
100
  put?: never;
@@ -113,10 +113,10 @@ export interface paths {
113
113
  cookie?: never;
114
114
  };
115
115
  /**
116
- * 查看按天用量
117
- * @description 按自然日切分。没有流量的日子不会出现在结果里(不补零),画图那一侧要自己补齐日期轴——否则一段没人用的日子会被画成一条直接连过去的线,看起来像那几天一直在匀速跑流量。
116
+ * Get daily usage
117
+ * @description Cut by calendar day. A day carrying no traffic is absent rather than zero, so a chart has to fill the date axis itself.
118
118
  *
119
- * 把这里的天加起来**不等于**本期用量,这是有意的:本期按计费周期切,而且「重置本期用量」只作用于本期,日汇总一行都不删。
119
+ * These days do not sum to the usage of the current period, which is cut by billing period. Resetting the usage of the current period leaves every daily total in place.
120
120
  */
121
121
  get: operations["list-l4-tunnel-usage-series"];
122
122
  put?: never;
@@ -134,6 +134,10 @@ export interface components {
134
134
  Error: {
135
135
  code?: string;
136
136
  message: string;
137
+ /**
138
+ * @description What a given `code` carries alongside the message. The keys depend on the code,
139
+ * and a client that does not recognise one ignores it.
140
+ */
137
141
  meta?: {
138
142
  [key: string]: unknown;
139
143
  };
@@ -142,22 +146,22 @@ export interface components {
142
146
  };
143
147
  SubscriptionResource: {
144
148
  /**
145
- * @description ready 表示节点已全部下发;preparing 表示仍在下发——此时链接照样可用
149
+ * @description ready means every node has been distributed; preparing means distribution is still under way, and the link works either way
146
150
  * @enum {string}
147
151
  */
148
152
  status: "preparing" | "ready";
149
153
  /** Format: date-time */
150
154
  updated_at: string;
151
- /** @description 订阅地址。这是一条长期有效的凭据,等同于密码,请勿转发或截图分享 */
155
+ /** @description The subscription address. It is a long-lived credential equivalent to a password; do not forward it or share a screenshot of it */
152
156
  url: string;
153
157
  /** Format: int64 */
154
158
  version: number;
155
159
  };
156
- /** @description 当前项目那条四层隧道。它只回答一个问题:生成过没有。 */
160
+ /** @description The layer 4 tunnel of the current project. It answers a single question — whether the tunnel has been generated */
157
161
  TunnelResource: {
158
162
  /** Format: date-time */
159
163
  created_at: string;
160
- /** @description 隧道当前是否可用。为 false 表示被平台停用(欠费、违规或项目停服),需要先处理停用的原因 */
164
+ /** @description Whether the tunnel is currently usable. false means the platform has disabled it — for an unpaid balance, a violation, or a suspended project — and the cause has to be resolved first */
161
165
  enabled: boolean;
162
166
  /** Format: uuid */
163
167
  id: string;
@@ -173,41 +177,41 @@ export interface components {
173
177
  UsageResource: {
174
178
  /**
175
179
  * Format: int64
176
- * @description 按线路倍率折算后的用量,配额比对以此为准
180
+ * @description Usage after the multiplier of each route has been applied. Quota is measured against this value
177
181
  */
178
182
  billed_bytes: number;
179
183
  over_quota: boolean;
180
- /** @description 本期计费周期的结束日(YYYY-MM-DD */
184
+ /** @description Last day of the current billing period (YYYY-MM-DD) */
181
185
  period_end: string;
182
- /** @description 本期计费周期的起始日(YYYY-MM-DD */
186
+ /** @description First day of the current billing period (YYYY-MM-DD) */
183
187
  period_start: string;
184
188
  /**
185
189
  * Format: int64
186
- * @description 上游给出的真实配额,0 表示不限量
190
+ * @description The quota in force; 0 means unlimited
187
191
  */
188
192
  quota_bytes: number;
189
193
  /**
190
194
  * Format: date-time
191
- * @description 上游判定超额的时刻;null 表示未超额
195
+ * @description When the quota was found to be exceeded; null while it has not been
192
196
  */
193
197
  quota_exceeded_at: string | null;
194
198
  /**
195
199
  * Format: int64
196
- * @description 实际传输的字节,不用于配额比对
200
+ * @description Bytes actually transferred. Quota is not measured against this value
197
201
  */
198
202
  raw_bytes: number;
199
203
  /** Format: int64 */
200
204
  upload_bytes: number;
201
205
  /**
202
206
  * Format: double
203
- * @description 上游给出的用量百分比
207
+ * @description Usage as a percentage of the quota
204
208
  */
205
209
  usage_percent: number;
206
210
  };
207
211
  UsageSeriesResource: {
208
212
  /**
209
213
  * Format: int64
210
- * @description 上游实际采用的天数,可能被它夹到 1–365
214
+ * @description The number of days actually covered, which may have been clamped to the range 1–365
211
215
  */
212
216
  days: number;
213
217
  points: components["schemas"]["UsageDayResource"][];
@@ -369,7 +373,7 @@ export interface operations {
369
373
  "list-l4-tunnel-usage-series": {
370
374
  parameters: {
371
375
  query?: {
372
- /** @description 取最近多少天。0 表示用上游的默认值(30)——上游只接受 1–365,超出会被它夹住 */
376
+ /** @description How many days to cover. 0 requests the default of 30; the range accepted is 1–365, and a larger value is clamped to it */
373
377
  days?: number;
374
378
  };
375
379
  header?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.54.3",
3
+ "version": "0.55.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {