@leaflow/sdk 0.0.0-dev.25.g6c5751f → 0.0.0-dev.252.gbe25f3b

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 (79) hide show
  1. package/README.md +22 -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 +33 -22
  5. package/dist/account/v1/index.js +4 -4
  6. package/dist/account/v1/schema.d.ts +307 -89
  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 +71 -40
  10. package/dist/assistant/v1/index.js +4 -4
  11. package/dist/assistant/v1/schema.d.ts +1204 -139
  12. package/dist/billing/account/v1/client.d.ts +4 -0
  13. package/dist/billing/account/v1/client.js +7 -0
  14. package/dist/billing/account/v1/index.d.ts +169 -0
  15. package/dist/billing/account/v1/index.js +5 -0
  16. package/dist/billing/account/v1/schema.d.ts +4385 -0
  17. package/dist/billing/account/v1/schema.js +5 -0
  18. package/dist/billing/catalog/v1/client.d.ts +4 -0
  19. package/dist/billing/catalog/v1/client.js +7 -0
  20. package/dist/billing/catalog/v1/index.d.ts +33 -0
  21. package/dist/billing/catalog/v1/index.js +5 -0
  22. package/dist/billing/catalog/v1/schema.d.ts +915 -0
  23. package/dist/billing/catalog/v1/schema.js +5 -0
  24. package/dist/billing/index.d.ts +3 -0
  25. package/dist/billing/index.js +6 -0
  26. package/dist/billing/project/v1/client.d.ts +4 -0
  27. package/dist/billing/project/v1/client.js +7 -0
  28. package/dist/billing/project/v1/index.d.ts +59 -0
  29. package/dist/billing/project/v1/index.js +5 -0
  30. package/dist/billing/project/v1/schema.d.ts +1892 -0
  31. package/dist/billing/project/v1/schema.js +5 -0
  32. package/dist/canopy/v1/client.d.ts +4 -0
  33. package/dist/canopy/v1/client.js +7 -0
  34. package/dist/canopy/v1/index.d.ts +24 -23
  35. package/dist/canopy/v1/index.js +4 -4
  36. package/dist/canopy/v1/schema.d.ts +113 -109
  37. package/dist/compute/v1/client.d.ts +4 -0
  38. package/dist/compute/v1/client.js +7 -0
  39. package/dist/compute/v1/index.d.ts +207 -134
  40. package/dist/compute/v1/index.js +4 -4
  41. package/dist/compute/v1/schema.d.ts +1944 -553
  42. package/dist/dns/v1/client.d.ts +4 -0
  43. package/dist/dns/v1/client.js +7 -0
  44. package/dist/dns/v1/index.d.ts +43 -0
  45. package/dist/dns/v1/index.js +5 -0
  46. package/dist/dns/v1/schema.d.ts +887 -0
  47. package/dist/dns/v1/schema.js +5 -0
  48. package/dist/iam/v1/client.d.ts +4 -0
  49. package/dist/iam/v1/client.js +7 -0
  50. package/dist/iam/v1/index.d.ts +55 -32
  51. package/dist/iam/v1/index.js +4 -4
  52. package/dist/iam/v1/schema.d.ts +521 -88
  53. package/dist/index.d.ts +11 -7
  54. package/dist/index.js +19 -5
  55. package/dist/monitoring/v1/client.d.ts +4 -0
  56. package/dist/monitoring/v1/client.js +7 -0
  57. package/dist/monitoring/v1/index.d.ts +130 -49
  58. package/dist/monitoring/v1/index.js +4 -4
  59. package/dist/monitoring/v1/schema.d.ts +2420 -527
  60. package/dist/notification/v1/client.d.ts +4 -0
  61. package/dist/notification/v1/client.js +7 -0
  62. package/dist/notification/v1/index.d.ts +81 -0
  63. package/dist/notification/v1/index.js +5 -0
  64. package/dist/notification/v1/schema.d.ts +2048 -0
  65. package/dist/notification/v1/schema.js +5 -0
  66. package/dist/routes.d.ts +3234 -0
  67. package/dist/routes.js +3639 -0
  68. package/dist/support/v1/client.d.ts +4 -0
  69. package/dist/support/v1/client.js +7 -0
  70. package/dist/support/v1/index.d.ts +51 -0
  71. package/dist/support/v1/index.js +5 -0
  72. package/dist/support/v1/schema.d.ts +1082 -0
  73. package/dist/support/v1/schema.js +5 -0
  74. package/dist/tunnel/v1/client.d.ts +4 -0
  75. package/dist/tunnel/v1/client.js +7 -0
  76. package/dist/tunnel/v1/index.d.ts +8 -7
  77. package/dist/tunnel/v1/index.js +4 -4
  78. package/dist/tunnel/v1/schema.d.ts +40 -34
  79. package/package.json +34 -10
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type ClientOptions } from "openapi-fetch";
2
+ import type { paths } from "./schema.js";
3
+ /** A client for the tunnel 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://tunnel.leaflow.cloud";
4
+ /** A client for the tunnel service. Pass baseUrl to override the address. */
5
+ export function client(options = {}) {
6
+ return createClient({ baseUrl: defaultBaseUrl, ...options });
7
+ }
@@ -1,16 +1,17 @@
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 /api/v1/tunnel/l4` 成功时的响应体。 */
4
+ /** The success response body of `GET /api/v1/tunnel/l4`. */
4
5
  export type GetL4TunnelResult = operations["get-l4-tunnel"]["responses"][200]["content"]["application/json"];
5
- /** `POST /api/v1/tunnel/l4` 成功时的响应体。 */
6
+ /** The success response body of `POST /api/v1/tunnel/l4`. */
6
7
  export type GenerateL4TunnelResult = operations["generate-l4-tunnel"]["responses"][200]["content"]["application/json"];
7
- /** `GET /api/v1/tunnel/l4/subscription` 成功时的响应体。 */
8
+ /** The success response body of `GET /api/v1/tunnel/l4/subscription`. */
8
9
  export type GetL4TunnelSubscriptionResult = operations["get-l4-tunnel-subscription"]["responses"][200]["content"]["application/json"];
9
- /** `POST /api/v1/tunnel/l4/subscription/rotate` 成功时的响应体。 */
10
+ /** The success response body of `POST /api/v1/tunnel/l4/subscription/rotate`. */
10
11
  export type RotateL4TunnelSubscriptionResult = operations["rotate-l4-tunnel-subscription"]["responses"][200]["content"]["application/json"];
11
- /** `GET /api/v1/tunnel/l4/usage` 成功时的响应体。 */
12
+ /** The success response body of `GET /api/v1/tunnel/l4/usage`. */
12
13
  export type GetL4TunnelUsageResult = operations["get-l4-tunnel-usage"]["responses"][200]["content"]["application/json"];
13
- /** `GET /api/v1/tunnel/l4/usage/series` 成功时的响应体。 */
14
+ /** The success response body of `GET /api/v1/tunnel/l4/usage/series`. */
14
15
  export type ListL4TunnelUsageSeriesResult = operations["list-l4-tunnel-usage-series"]["responses"][200]["content"]["application/json"];
15
- /** `GET /api/v1/tunnel/l4/usage/series` 的查询参数。 */
16
+ /** The query parameters of `GET /api/v1/tunnel/l4/usage/series`. */
16
17
  export type ListL4TunnelUsageSeriesQuery = operations["list-l4-tunnel-usage-series"]["parameters"]["query"];
@@ -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";
@@ -11,18 +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
- * 订阅地址、用量、配额各有自己的接口,这里不重复返回。
17
+ * 403 `TUNNEL_NOT_ENTITLED` states something else: the project has not been entitled to layer 4 at all.
18
+ *
19
+ * The subscription address, the usage and the quota each have their own endpoint and are not repeated here.
18
20
  */
19
21
  get: operations["get-l4-tunnel"];
20
22
  put?: never;
21
23
  /**
22
- * 生成四层隧道
23
- * @description **幂等**:已经有了再调一次返回同一条,不报错。按钮被点两次是安全的。
24
+ * Generate the layer 4 tunnel
25
+ * @description **Idempotent**: calling it again returns the existing tunnel rather than an error.
24
26
  *
25
- * 生成之后请调订阅接口取地址,本接口不返回它。
27
+ * Read the address from the subscription endpoint afterwards; it is not returned here.
26
28
  */
27
29
  post: operations["generate-l4-tunnel"];
28
30
  delete?: never;
@@ -39,12 +41,12 @@ export interface paths {
39
41
  cookie?: never;
40
42
  };
41
43
  /**
42
- * 获取订阅地址
43
- * @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.
44
46
  *
45
- * 客户端不应在用户主动请求之前调用它:这个接口的每一次调用都会被记进操作日志。
47
+ * Do not call this endpoint before the user asks for the address.
46
48
  *
47
- * `status` 为 `preparing` 时链接**照样有效**,内容会在拉取那一刻重新派生。它只该影响页面上说什么。
49
+ * A `status` of `preparing` leaves the link usable; its contents are derived at the moment it is fetched.
48
50
  */
49
51
  get: operations["get-l4-tunnel-subscription"];
50
52
  put?: never;
@@ -65,14 +67,14 @@ export interface paths {
65
67
  get?: never;
66
68
  put?: never;
67
69
  /**
68
- * 重置订阅地址与节点密码
69
- * @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.**
70
72
  *
71
- * 订阅 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.
72
74
  *
73
- * 隧道被平台停用时无法重置(`TUNNEL_DISABLED_FOR_ROTATE`),需要先处理停用的原因。
75
+ * A tunnel disabled by the platform cannot be rotated (`TUNNEL_DISABLED_FOR_ROTATE`); resolve the cause first.
74
76
  *
75
- * 重置后请调订阅接口取新地址,**本接口不返回它**。
77
+ * Read the new address from the subscription endpoint afterwards; **it is not returned here**.
76
78
  */
77
79
  post: operations["rotate-l4-tunnel-subscription"];
78
80
  delete?: never;
@@ -89,10 +91,10 @@ export interface paths {
89
91
  cookie?: never;
90
92
  };
91
93
  /**
92
- * 查看本期用量
93
- * @description 实时查询,不经过缓存。
94
+ * Get the usage of the current period
95
+ * @description Read live.
94
96
  *
95
- * 判断是否超额只看 `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.
96
98
  */
97
99
  get: operations["get-l4-tunnel-usage"];
98
100
  put?: never;
@@ -111,10 +113,10 @@ export interface paths {
111
113
  cookie?: never;
112
114
  };
113
115
  /**
114
- * 查看按天用量
115
- * @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.
116
118
  *
117
- * 把这里的天加起来**不等于**本期用量,这是有意的:本期按计费周期切,而且「重置本期用量」只作用于本期,日汇总一行都不删。
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.
118
120
  */
119
121
  get: operations["list-l4-tunnel-usage-series"];
120
122
  put?: never;
@@ -132,6 +134,10 @@ export interface components {
132
134
  Error: {
133
135
  code?: string;
134
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
+ */
135
141
  meta?: {
136
142
  [key: string]: unknown;
137
143
  };
@@ -140,22 +146,22 @@ export interface components {
140
146
  };
141
147
  SubscriptionResource: {
142
148
  /**
143
- * @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
144
150
  * @enum {string}
145
151
  */
146
152
  status: "preparing" | "ready";
147
153
  /** Format: date-time */
148
154
  updated_at: string;
149
- /** @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 */
150
156
  url: string;
151
157
  /** Format: int64 */
152
158
  version: number;
153
159
  };
154
- /** @description 当前项目那条四层隧道。它只回答一个问题:生成过没有。 */
160
+ /** @description The layer 4 tunnel of the current project. It answers a single question — whether the tunnel has been generated */
155
161
  TunnelResource: {
156
162
  /** Format: date-time */
157
163
  created_at: string;
158
- /** @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 */
159
165
  enabled: boolean;
160
166
  /** Format: uuid */
161
167
  id: string;
@@ -171,41 +177,41 @@ export interface components {
171
177
  UsageResource: {
172
178
  /**
173
179
  * Format: int64
174
- * @description 按线路倍率折算后的用量,配额比对以此为准
180
+ * @description Usage after the multiplier of each route has been applied. Quota is measured against this value
175
181
  */
176
182
  billed_bytes: number;
177
183
  over_quota: boolean;
178
- /** @description 本期计费周期的结束日(YYYY-MM-DD) */
184
+ /** @description Last day of the current billing period (YYYY-MM-DD) */
179
185
  period_end: string;
180
- /** @description 本期计费周期的起始日(YYYY-MM-DD) */
186
+ /** @description First day of the current billing period (YYYY-MM-DD) */
181
187
  period_start: string;
182
188
  /**
183
189
  * Format: int64
184
- * @description 上游给出的真实配额,0 表示不限量
190
+ * @description The quota in force; 0 means unlimited
185
191
  */
186
192
  quota_bytes: number;
187
193
  /**
188
194
  * Format: date-time
189
- * @description 上游判定超额的时刻;null 表示未超额
195
+ * @description When the quota was found to be exceeded; null while it has not been
190
196
  */
191
197
  quota_exceeded_at: string | null;
192
198
  /**
193
199
  * Format: int64
194
- * @description 实际传输的字节,不用于配额比对
200
+ * @description Bytes actually transferred. Quota is not measured against this value
195
201
  */
196
202
  raw_bytes: number;
197
203
  /** Format: int64 */
198
204
  upload_bytes: number;
199
205
  /**
200
206
  * Format: double
201
- * @description 上游给出的用量百分比
207
+ * @description Usage as a percentage of the quota
202
208
  */
203
209
  usage_percent: number;
204
210
  };
205
211
  UsageSeriesResource: {
206
212
  /**
207
213
  * Format: int64
208
- * @description 上游实际采用的天数,可能被它夹到 1–365
214
+ * @description The number of days actually covered, which may have been clamped to the range 1–365
209
215
  */
210
216
  days: number;
211
217
  points: components["schemas"]["UsageDayResource"][];
@@ -367,7 +373,7 @@ export interface operations {
367
373
  "list-l4-tunnel-usage-series": {
368
374
  parameters: {
369
375
  query?: {
370
- /** @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 */
371
377
  days?: number;
372
378
  };
373
379
  header?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.25.g6c5751f",
3
+ "version": "0.0.0-dev.252.gbe25f3b",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,6 +15,10 @@
15
15
  "types": "./dist/index.d.ts",
16
16
  "default": "./dist/index.js"
17
17
  },
18
+ "./routes": {
19
+ "types": "./dist/routes.d.ts",
20
+ "default": "./dist/routes.js"
21
+ },
18
22
  "./account/v1": {
19
23
  "types": "./dist/account/v1/index.d.ts",
20
24
  "default": "./dist/account/v1/index.js"
@@ -23,6 +27,18 @@
23
27
  "types": "./dist/assistant/v1/index.d.ts",
24
28
  "default": "./dist/assistant/v1/index.js"
25
29
  },
30
+ "./billing/account/v1": {
31
+ "types": "./dist/billing/account/v1/index.d.ts",
32
+ "default": "./dist/billing/account/v1/index.js"
33
+ },
34
+ "./billing/catalog/v1": {
35
+ "types": "./dist/billing/catalog/v1/index.d.ts",
36
+ "default": "./dist/billing/catalog/v1/index.js"
37
+ },
38
+ "./billing/project/v1": {
39
+ "types": "./dist/billing/project/v1/index.d.ts",
40
+ "default": "./dist/billing/project/v1/index.js"
41
+ },
26
42
  "./canopy/v1": {
27
43
  "types": "./dist/canopy/v1/index.d.ts",
28
44
  "default": "./dist/canopy/v1/index.js"
@@ -31,6 +47,10 @@
31
47
  "types": "./dist/compute/v1/index.d.ts",
32
48
  "default": "./dist/compute/v1/index.js"
33
49
  },
50
+ "./dns/v1": {
51
+ "types": "./dist/dns/v1/index.d.ts",
52
+ "default": "./dist/dns/v1/index.js"
53
+ },
34
54
  "./iam/v1": {
35
55
  "types": "./dist/iam/v1/index.d.ts",
36
56
  "default": "./dist/iam/v1/index.js"
@@ -39,6 +59,14 @@
39
59
  "types": "./dist/monitoring/v1/index.d.ts",
40
60
  "default": "./dist/monitoring/v1/index.js"
41
61
  },
62
+ "./notification/v1": {
63
+ "types": "./dist/notification/v1/index.d.ts",
64
+ "default": "./dist/notification/v1/index.js"
65
+ },
66
+ "./support/v1": {
67
+ "types": "./dist/support/v1/index.d.ts",
68
+ "default": "./dist/support/v1/index.js"
69
+ },
42
70
  "./tunnel/v1": {
43
71
  "types": "./dist/tunnel/v1/index.d.ts",
44
72
  "default": "./dist/tunnel/v1/index.js"
@@ -52,23 +80,19 @@
52
80
  "generate": "node scripts/generate.mjs",
53
81
  "build": "tsc -p tsconfig.build.json",
54
82
  "typecheck": "tsc -p tsconfig.json --noEmit",
55
- "prepublishOnly": "npm run build"
83
+ "prepublishOnly": "npm run build",
84
+ "format:check": "prettier --check gen scripts"
56
85
  },
57
86
  "devDependencies": {
58
87
  "openapi-typescript": "7.13.0",
88
+ "prettier": "^3.6.2",
59
89
  "typescript": "^5.9.3",
60
- "openapi-fetch": "^0.17.0",
61
90
  "yaml": "^2.8.1"
62
91
  },
63
92
  "publishConfig": {
64
93
  "access": "public"
65
94
  },
66
- "peerDependencies": {
67
- "openapi-fetch": ">=0.14"
68
- },
69
- "peerDependenciesMeta": {
70
- "openapi-fetch": {
71
- "optional": true
72
- }
95
+ "dependencies": {
96
+ "openapi-fetch": "^0.17.0"
73
97
  }
74
98
  }