@leaflow/sdk 0.45.0 → 0.47.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.
@@ -32,6 +32,10 @@ export type SubmitIdentityVerificationBody = NonNullable<operations["submit-iden
32
32
  export type ListMyInvitationsResult = operations["list-my-invitations"]["responses"][200]["content"]["application/json"];
33
33
  /** `GET /account/v1/me/invitations` 的查询参数。 */
34
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"];
35
39
  /** `POST /account/v1/me/invitations/accept` 成功时的响应体。 */
36
40
  export type AcceptInvitationByTokenResult = operations["accept-invitation-by-token"]["responses"][200]["content"]["application/json"];
37
41
  /** `POST /account/v1/me/invitations/accept` 的请求体。 */
@@ -187,6 +187,30 @@ export interface paths {
187
187
  patch?: never;
188
188
  trace?: never;
189
189
  };
190
+ "/account/v1/invitations/by-token": {
191
+ parameters: {
192
+ query?: never;
193
+ header?: never;
194
+ path?: never;
195
+ cookie?: never;
196
+ };
197
+ /**
198
+ * 看一眼这封邀请是谁发的、加入哪儿、什么角色
199
+ * @description 免认证,而且是有意的:点邮件里那条链接的人多半还没登录,甚至还没有账号。要他先注册再 告诉他这是谁发来的、加入哪个项目,等于让他在不知道要加入什么的情况下决定要不要注册。
200
+ * 它不多泄露任何东西。 这三样——项目名、邀请人、角色——邮件正文里已经写着了,而读得到 这个令牌的人就是收得到那封邮件的人。同一个令牌本来就能把持有者加进项目(见 `accept-invitation-by-token`),读一个项目名比那件事轻得多。
201
+ * 收件地址打了码(`t***@example.com`)。 不打码的话,这个接口就成了「拿一个令牌反查它 当初寄给了哪个地址」——而那是邮件正文里没有、持有者也未必知道的一件事。
202
+ * 令牌不存在、已经用过、被撤回、过期,四种情况同一个 404 和同一句话。分开报会把它变成 一个可以拿来试令牌的探针,而这个接口免认证,任何人都试得起。
203
+ * 它不在 `/me` 下面,隔壁那两条接受要约的在。 `/me` 的意思是「按这次请求的身份认出来 的、属于我的那些」,而这条路上没有身份——持有令牌的人未必是收件人本人。挂在 `/me` 下面会让读的人以为它认过身份,而那正是这条路唯一不做的事。
204
+ */
205
+ get: operations["preview-invitation-by-token"];
206
+ put?: never;
207
+ post?: never;
208
+ delete?: never;
209
+ options?: never;
210
+ head?: never;
211
+ patch?: never;
212
+ trace?: never;
213
+ };
190
214
  "/account/v1/me/invitations/accept": {
191
215
  parameters: {
192
216
  query?: never;
@@ -424,6 +448,21 @@ export interface components {
424
448
  /** @description 真实姓名。敏感个人信息,加密入库,任何接口都不会再把它读出来 */
425
449
  real_name: string;
426
450
  };
451
+ /**
452
+ * @description 一封邀请在被接受之前能给出的全部信息。
453
+ * 它比 InvitationResource 少两样:要约 id 和完整的收件地址。id 不给是因为持有令牌不等于 这封要约列在你名下——真正列在你名下的那些走 list-my-invitations,那条是认过身份的。
454
+ */
455
+ InvitationPreviewResource: {
456
+ /** @description 打过码的收件地址,只够收件人认出「这是发给我的」 */
457
+ email_masked: string;
458
+ /** Format: date-time */
459
+ expires_at: string;
460
+ /** @description 邀请人的显示名,姓名都空时是他的邮箱 */
461
+ invited_by_name: string;
462
+ project_name: string;
463
+ /** @description 接受之后会拿到的角色,显示名 */
464
+ role_names: string[] | null;
465
+ };
427
466
  InvitationResource: {
428
467
  /** Format: date-time */
429
468
  created_at: string;
@@ -432,11 +471,21 @@ export interface components {
432
471
  expires_at: string;
433
472
  /** Format: uuid */
434
473
  id: string;
474
+ /** @description 发出这份要约的账号 id */
435
475
  invited_by: string;
476
+ /** @description 发出这份要约的人的显示名,姓名都空时是他的邮箱。它是读取那一刻的事实,不是发信时的快照 */
477
+ invited_by_name: string;
436
478
  /** Format: uuid */
437
479
  project_id: string;
480
+ /**
481
+ * @description 目标项目的名字。
482
+ * 它在这里,而这一度是刻意不给的——理由是「没接受就不是成员,而名字只有成员能读」。 那条克制在这个场景下站不住:邀请邮件正文里就写着项目名,收件人早就知道了,而一个 只显示 uuid 的邀请列表让人没法判断该不该接受。
483
+ */
484
+ project_name: string;
438
485
  /** @description 兑现时会授予的角色编码 */
439
486
  roles: string[] | null;
487
+ /** @description 上面那些编码的显示名,按同样的顺序。读者看的是「管理员」,不是 ADMIN */
488
+ role_names: string[] | null;
440
489
  };
441
490
  LengthAwarePageInvitationResource: {
442
491
  /** @description 这一页的内容 */
@@ -907,6 +956,38 @@ export interface operations {
907
956
  };
908
957
  };
909
958
  };
959
+ "preview-invitation-by-token": {
960
+ parameters: {
961
+ query: {
962
+ /** @description 邀请链接里那串令牌 */
963
+ token: string;
964
+ };
965
+ header?: never;
966
+ path?: never;
967
+ cookie?: never;
968
+ };
969
+ requestBody?: never;
970
+ responses: {
971
+ /** @description OK */
972
+ 200: {
973
+ headers: {
974
+ [name: string]: unknown;
975
+ };
976
+ content: {
977
+ "application/json": components["schemas"]["InvitationPreviewResource"];
978
+ };
979
+ };
980
+ /** @description Error */
981
+ default: {
982
+ headers: {
983
+ [name: string]: unknown;
984
+ };
985
+ content: {
986
+ "application/json": components["schemas"]["Error"];
987
+ };
988
+ };
989
+ };
990
+ };
910
991
  "accept-invitation-by-token": {
911
992
  parameters: {
912
993
  query?: never;
@@ -34,6 +34,8 @@ export type ListChargesResult = operations["list-charges"]["responses"][200]["co
34
34
  export type ListInvoicesResult = operations["list-invoices"]["responses"][200]["content"]["application/json"];
35
35
  /** `GET /account/v1/billing-accounts/{accountKey}/invoices/{invoiceId}` 成功时的响应体。 */
36
36
  export type GetInvoiceResult = operations["get-invoice"]["responses"][200]["content"]["application/json"];
37
+ /** `GET /account/v1/projects/{projectId}/billing-account` 成功时的响应体。 */
38
+ export type ReadProjectBillingAccountResult = operations["read-project-billing-account"]["responses"][200]["content"]["application/json"];
37
39
  /** `POST /account/v1/projects/{projectId}/quote` 成功时的响应体。 */
38
40
  export type QuoteProjectUsageResult = operations["quote-project-usage"]["responses"][200]["content"]["application/json"];
39
41
  /** `POST /account/v1/projects/{projectId}/quote` 的请求体。 */
@@ -62,3 +64,13 @@ export type ListOffersResult = operations["list-offers"]["responses"][200]["cont
62
64
  export type PurchaseOfferResult = operations["purchase-offer"]["responses"][200]["content"]["application/json"];
63
65
  /** `POST /account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase` 的查询参数。 */
64
66
  export type PurchaseOfferQuery = operations["purchase-offer"]["parameters"]["query"];
67
+ /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets` 成功时的响应体。 */
68
+ export type ListPrepaidAssetsResult = operations["list-prepaid-assets"]["responses"][200]["content"]["application/json"];
69
+ /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 成功时的响应体。 */
70
+ export type QuoteRenewalResult = operations["quote-renewal"]["responses"][200]["content"]["application/json"];
71
+ /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 的查询参数。 */
72
+ export type QuoteRenewalQuery = operations["quote-renewal"]["parameters"]["query"];
73
+ /** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 成功时的响应体。 */
74
+ export type RenewPrepaidAssetResult = operations["renew-prepaid-asset"]["responses"][200]["content"]["application/json"];
75
+ /** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 的请求体。 */
76
+ export type RenewPrepaidAssetBody = NonNullable<operations["renew-prepaid-asset"]["requestBody"]>["content"]["application/json"];
@@ -326,6 +326,49 @@ export interface paths {
326
326
  patch?: never;
327
327
  trace?: never;
328
328
  };
329
+ "/account/v1/projects/{projectId}/billing-account": {
330
+ parameters: {
331
+ query?: never;
332
+ header?: never;
333
+ path?: never;
334
+ cookie?: never;
335
+ };
336
+ /**
337
+ * Which account pays for this project
338
+ * @description The account a project's resources are charged to, resolved from the project rather than
339
+ * guessed.
340
+ *
341
+ * ## Why a console needs this
342
+ *
343
+ * Everything in a console happens inside a project, while billing accounts belong to a person —
344
+ * and a person can have many. Showing "the first one" next to a sentence like *you are
345
+ * overdrawn, new resources will be refused* pairs one account's balance with another account's
346
+ * rule. Both directions are wrong and one of them is silent: the figures look healthy while
347
+ * creating anything is refused, and the refusal names a reason the page just contradicted.
348
+ *
349
+ * ## Being a member is enough to ask, but not to see the money
350
+ *
351
+ * The answer is the account's identity, not its balance. A project's members are not
352
+ * necessarily the people paying for it — a company account can pay for a project someone else
353
+ * works in — and their balance is not those members' business. Whoever owns the account reads
354
+ * the figures from the balance route as before; `owned_by_me` says which case this is, so a
355
+ * page can tell "you are overdrawn" apart from "ask whoever pays for this project".
356
+ *
357
+ * ## A project with no account is a normal state, and it answers 404
358
+ *
359
+ * A project nobody has bound yet cannot create resources at all — admission refuses it. That is
360
+ * worth saying plainly ("this project has no billing account, bind one") rather than falling
361
+ * back to some other account of theirs, which is how the wrong-account problem started.
362
+ */
363
+ get: operations["read-project-billing-account"];
364
+ put?: never;
365
+ post?: never;
366
+ delete?: never;
367
+ options?: never;
368
+ head?: never;
369
+ patch?: never;
370
+ trace?: never;
371
+ };
329
372
  "/account/v1/projects/{projectId}/quote": {
330
373
  parameters: {
331
374
  query?: never;
@@ -675,6 +718,126 @@ export interface paths {
675
718
  patch?: never;
676
719
  trace?: never;
677
720
  };
721
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets": {
722
+ parameters: {
723
+ query?: never;
724
+ header?: never;
725
+ path?: never;
726
+ cookie?: never;
727
+ };
728
+ /**
729
+ * What I bought outright, and when it runs out
730
+ * @description Everything this account paid a term for, across every product, soonest to expire first.
731
+ *
732
+ * ## Why this is one list rather than a page inside each product
733
+ *
734
+ * Renewal is the one thing a customer forgets, and forgetting it stops the machine. Splitting
735
+ * the list per product means the instance about to lapse tomorrow is only visible to someone
736
+ * who thought to go and look at instances. Sorting by expiry rather than by purchase date is
737
+ * the same reason: the row that matters is the one at the top.
738
+ *
739
+ * ## Metered resources are not here
740
+ *
741
+ * There is no term to run out. Listing them with an empty expiry would invite renewing
742
+ * something that is already billed by the hour until it is deleted.
743
+ *
744
+ * ## `state` and `desired_state` are both reported
745
+ *
746
+ * A machine stopped because its term lapsed reads `suspended` for both. One that has just been
747
+ * renewed reads `suspended` and `active` — it is on its way back. Without the second field
748
+ * those look identical, and a customer who just paid concludes it did not work and pays again.
749
+ */
750
+ get: operations["list-prepaid-assets"];
751
+ put?: never;
752
+ post?: never;
753
+ delete?: never;
754
+ options?: never;
755
+ head?: never;
756
+ patch?: never;
757
+ trace?: never;
758
+ };
759
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote": {
760
+ parameters: {
761
+ query?: never;
762
+ header?: never;
763
+ path?: never;
764
+ cookie?: never;
765
+ };
766
+ /**
767
+ * What renewing this would cost
768
+ * @description Priced the same way the charge is, from the same table, so the number shown is the number
769
+ * taken. Quoting separately from charging is what lets a customer see the price before
770
+ * committing; computing it twice in two places is what makes the two disagree, and a bill that
771
+ * disagrees with the page that sold it is a complaint rather than a bug report.
772
+ *
773
+ * ## Both the current and the resulting expiry are returned
774
+ *
775
+ * Renewing early adds the term to what is left, not to today — otherwise renewing a month
776
+ * ahead throws that month away, and everyone learns to wait until the last moment. Something
777
+ * that lapsed long ago is counted from now instead, because adding to a date in the past
778
+ * produces an expiry that is still in the past.
779
+ *
780
+ * Reporting only the new date leaves the customer unable to tell which of those happened.
781
+ *
782
+ * ## A withdrawn price still quotes
783
+ *
784
+ * Taking a product off sale means stop selling new ones. Refusing renewals as well would stop
785
+ * a batch of existing machines on their expiry date, which is not what the operator pressed
786
+ * that button for.
787
+ */
788
+ get: operations["quote-renewal"];
789
+ put?: never;
790
+ post?: never;
791
+ delete?: never;
792
+ options?: never;
793
+ head?: never;
794
+ patch?: never;
795
+ trace?: never;
796
+ };
797
+ "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew": {
798
+ parameters: {
799
+ query?: never;
800
+ header?: never;
801
+ path?: never;
802
+ cookie?: never;
803
+ };
804
+ get?: never;
805
+ put?: never;
806
+ /**
807
+ * Renew it
808
+ * @description Takes the money from the balance and pushes the expiry out. The resource itself is not
809
+ * touched — nothing is rebuilt, nothing restarts, the id stays the same.
810
+ *
811
+ * ## An idempotency key is required, not optional
812
+ *
813
+ * Renewal is a pure charge. Unlike creating something, there is no resource whose uniqueness
814
+ * catches a repeat, so a double click is two charges and twice the term — and both calls
815
+ * return success. Letting the field be omitted would mean losing that protection silently, in
816
+ * the one case that looks completely normal until the books are reconciled.
817
+ *
818
+ * Sending the same key again returns the order that was already placed. It does not charge
819
+ * again, and it is not an error: reporting a repeat as a failure makes the caller retry
820
+ * forever, and makes the customer press the button a second time with a fresh key.
821
+ *
822
+ * ## What happens if the balance is short
823
+ *
824
+ * The order is recorded as failed and nothing else changes: no money moves, the expiry stays
825
+ * where it was, and the resource keeps running until its existing term ends. Retrying with the
826
+ * same key after topping up goes through.
827
+ *
828
+ * ## Renewing something that already lapsed brings it back
829
+ *
830
+ * Its term is counted from now, and it is asked to start again. Coming back is the
831
+ * reconciliation loop's job, so it is not instant — which is what `desired_state` on the asset
832
+ * list is for.
833
+ */
834
+ post: operations["renew-prepaid-asset"];
835
+ delete?: never;
836
+ options?: never;
837
+ head?: never;
838
+ patch?: never;
839
+ trace?: never;
840
+ };
678
841
  }
679
842
  export type webhooks = Record<string, never>;
680
843
  export interface components {
@@ -873,6 +1036,19 @@ export interface components {
873
1036
  */
874
1037
  state: "pending" | "fulfilled" | "failed";
875
1038
  failure_reason?: string;
1039
+ /**
1040
+ * @description What was taken, as a decimal string. Absent on a metered order, where the amount is not
1041
+ * known when the order is placed: it comes from usage afterwards. Absent must be read as
1042
+ * "billed by usage" — writing zero would make a metered order and a genuinely free one
1043
+ * look the same.
1044
+ */
1045
+ amount?: string;
1046
+ currency?: string;
1047
+ /**
1048
+ * @description Always `none` on a metered order.
1049
+ * @enum {string}
1050
+ */
1051
+ payment_state?: "none" | "paid" | "refunded";
876
1052
  /** Format: date-time */
877
1053
  created_at: string;
878
1054
  /** @description Only present on the single-order route. */
@@ -889,6 +1065,74 @@ export interface components {
889
1065
  /** Format: int64 */
890
1066
  quantity: number;
891
1067
  };
1068
+ PrepaidAsset: {
1069
+ /** @description Use this to quote and to renew. */
1070
+ id: string;
1071
+ project_id: string;
1072
+ /** @description Which service holds it. Also which console it is managed from. */
1073
+ service: string;
1074
+ /**
1075
+ * @description That service's own catalogue id, not a billing sku. The price of a machine is made of
1076
+ * finer parts than the machine type — the type does not appear in the rate card at all.
1077
+ */
1078
+ product_id: string;
1079
+ /** @description The id that service knows it by, so the two consoles can be lined up. */
1080
+ resource_id?: string;
1081
+ /**
1082
+ * Format: int64
1083
+ * @description GiB for a disk, 1 for a machine or an address.
1084
+ */
1085
+ quantity: number;
1086
+ /**
1087
+ * Format: date-time
1088
+ * @description Paid up to this instant. It stops being served after it, not before.
1089
+ */
1090
+ term_end: string;
1091
+ /** @enum {string} */
1092
+ state: "pending" | "active" | "suspended" | "terminated";
1093
+ /**
1094
+ * @description What it is being moved to. Differs from `state` while a change is still being applied —
1095
+ * in particular right after a renewal, which is the moment a customer is most likely to
1096
+ * conclude that nothing happened.
1097
+ * @enum {string}
1098
+ */
1099
+ desired_state: "active" | "suspended" | "terminated";
1100
+ };
1101
+ PrepaidAssetList: {
1102
+ assets: components["schemas"]["PrepaidAsset"][];
1103
+ };
1104
+ RenewalQuote: {
1105
+ provision_id: string;
1106
+ term: string;
1107
+ /**
1108
+ * @description A decimal string, not a float. Money that survives a round trip through binary floating
1109
+ * point is money that stops adding up.
1110
+ */
1111
+ amount: string;
1112
+ currency: string;
1113
+ /**
1114
+ * Format: date-time
1115
+ * @description What it is paid up to now.
1116
+ */
1117
+ current_term_end: string;
1118
+ /**
1119
+ * Format: date-time
1120
+ * @description What it would be paid up to after renewing.
1121
+ */
1122
+ term_end: string;
1123
+ };
1124
+ RenewRequestBody: {
1125
+ /**
1126
+ * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). It does not have to match the
1127
+ * term originally bought.
1128
+ */
1129
+ term: string;
1130
+ /**
1131
+ * @description Generate one per renewal the customer starts — when the dialog opens, not when it is
1132
+ * submitted — and send the same one on every retry of that renewal.
1133
+ */
1134
+ idempotency_key: string;
1135
+ };
892
1136
  OrderList: {
893
1137
  orders: components["schemas"]["Order"][];
894
1138
  };
@@ -1030,6 +1274,19 @@ export interface components {
1030
1274
  */
1031
1275
  available: string;
1032
1276
  };
1277
+ /** @description The account a project's resources are charged to */
1278
+ ProjectBillingAccount: {
1279
+ account_key: string;
1280
+ project_id: string;
1281
+ display_name: string;
1282
+ currency: components["schemas"]["Currency"];
1283
+ /**
1284
+ * @description Whether the caller owns this account, and therefore whether the balance routes will
1285
+ * answer for it. False means someone else pays for this project: the figures are theirs,
1286
+ * not the caller's, and a page should say so rather than showing nothing.
1287
+ */
1288
+ owned_by_me: boolean;
1289
+ };
1033
1290
  /** @description Which account pays for which project, as it stands once the request has been applied */
1034
1291
  ProjectBinding: {
1035
1292
  account_key: string;
@@ -1114,6 +1371,48 @@ export interface components {
1114
1371
  * just started as zero
1115
1372
  */
1116
1373
  total: string;
1374
+ /**
1375
+ * @description Which meter it is for, when the charge came from usage. A hash, not something to show —
1376
+ * it is here so two rows can be told apart programmatically and so support can line a row
1377
+ * up with the catalogue.
1378
+ */
1379
+ feature_key?: string;
1380
+ /**
1381
+ * @description Whether this figure moves. A usage charge climbs through the period; a flat fee does not.
1382
+ * Without it, the same number on two refreshes could mean "nobody used it" or "it never
1383
+ * moves", and those need different next steps.
1384
+ * @enum {string}
1385
+ */
1386
+ type: "usage_based" | "flat_fee";
1387
+ /**
1388
+ * Format: date-time
1389
+ * @description Start of the service period this charge covers.
1390
+ *
1391
+ * This is what tells two same-named rows apart. Something billed by the hour produces
1392
+ * hundreds of identically named charges in a month, and a list carrying only a name and an
1393
+ * amount shows them as a wall of duplicates — which is what it looks like today.
1394
+ */
1395
+ period_from: string;
1396
+ /**
1397
+ * Format: date-time
1398
+ * @description End of the service period this charge covers.
1399
+ */
1400
+ period_to: string;
1401
+ /**
1402
+ * @description How much of this charge was covered by credit, as a decimal string.
1403
+ *
1404
+ * It is the answer to "I have a balance, why am I still being charged". Without it the
1405
+ * customer sees a number that disagrees with what they expected and the only thing that
1406
+ * explains it is on our side.
1407
+ */
1408
+ credits?: string;
1409
+ /**
1410
+ * @description How much was taken off by a discount, as a decimal string. A usage allowance (the first N
1411
+ * units free) lands here too.
1412
+ */
1413
+ discounts?: string;
1414
+ /** @description Free text from the charge, usually empty. Set on charges raised by hand. */
1415
+ description?: string;
1117
1416
  };
1118
1417
  ChargeList: {
1119
1418
  currency: components["schemas"]["Currency"];
@@ -1215,6 +1514,8 @@ export interface components {
1215
1514
  };
1216
1515
  responses: never;
1217
1516
  parameters: {
1517
+ /** @description Which asset, from the prepaid list */
1518
+ ProvisionId: string;
1218
1519
  /**
1219
1520
  * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
1220
1521
  * which is why the key is what addresses the account.
@@ -1756,6 +2057,38 @@ export interface operations {
1756
2057
  };
1757
2058
  };
1758
2059
  };
2060
+ "read-project-billing-account": {
2061
+ parameters: {
2062
+ query?: never;
2063
+ header?: never;
2064
+ path: {
2065
+ /** @description The project being worked in */
2066
+ projectId: string;
2067
+ };
2068
+ cookie?: never;
2069
+ };
2070
+ requestBody?: never;
2071
+ responses: {
2072
+ /** @description OK */
2073
+ 200: {
2074
+ headers: {
2075
+ [name: string]: unknown;
2076
+ };
2077
+ content: {
2078
+ "application/json": components["schemas"]["ProjectBillingAccount"];
2079
+ };
2080
+ };
2081
+ /** @description Error */
2082
+ default: {
2083
+ headers: {
2084
+ [name: string]: unknown;
2085
+ };
2086
+ content: {
2087
+ "application/json": components["schemas"]["Error"];
2088
+ };
2089
+ };
2090
+ };
2091
+ };
1759
2092
  "quote-project-usage": {
1760
2093
  parameters: {
1761
2094
  query?: never;
@@ -2120,4 +2453,123 @@ export interface operations {
2120
2453
  };
2121
2454
  };
2122
2455
  };
2456
+ "list-prepaid-assets": {
2457
+ parameters: {
2458
+ query?: never;
2459
+ header?: never;
2460
+ path: {
2461
+ /**
2462
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2463
+ * which is why the key is what addresses the account.
2464
+ */
2465
+ accountKey: components["parameters"]["AccountKey"];
2466
+ };
2467
+ cookie?: never;
2468
+ };
2469
+ requestBody?: never;
2470
+ responses: {
2471
+ /** @description OK */
2472
+ 200: {
2473
+ headers: {
2474
+ [name: string]: unknown;
2475
+ };
2476
+ content: {
2477
+ "application/json": components["schemas"]["PrepaidAssetList"];
2478
+ };
2479
+ };
2480
+ /** @description Error */
2481
+ default: {
2482
+ headers: {
2483
+ [name: string]: unknown;
2484
+ };
2485
+ content: {
2486
+ "application/json": components["schemas"]["Error"];
2487
+ };
2488
+ };
2489
+ };
2490
+ };
2491
+ "quote-renewal": {
2492
+ parameters: {
2493
+ query: {
2494
+ /**
2495
+ * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). A duration rather than a
2496
+ * number of months: months are not the same length.
2497
+ */
2498
+ term: string;
2499
+ };
2500
+ header?: never;
2501
+ path: {
2502
+ /**
2503
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2504
+ * which is why the key is what addresses the account.
2505
+ */
2506
+ accountKey: components["parameters"]["AccountKey"];
2507
+ /** @description Which asset, from the prepaid list */
2508
+ provisionId: components["parameters"]["ProvisionId"];
2509
+ };
2510
+ cookie?: never;
2511
+ };
2512
+ requestBody?: never;
2513
+ responses: {
2514
+ /** @description OK */
2515
+ 200: {
2516
+ headers: {
2517
+ [name: string]: unknown;
2518
+ };
2519
+ content: {
2520
+ "application/json": components["schemas"]["RenewalQuote"];
2521
+ };
2522
+ };
2523
+ /** @description Error */
2524
+ default: {
2525
+ headers: {
2526
+ [name: string]: unknown;
2527
+ };
2528
+ content: {
2529
+ "application/json": components["schemas"]["Error"];
2530
+ };
2531
+ };
2532
+ };
2533
+ };
2534
+ "renew-prepaid-asset": {
2535
+ parameters: {
2536
+ query?: never;
2537
+ header?: never;
2538
+ path: {
2539
+ /**
2540
+ * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2541
+ * which is why the key is what addresses the account.
2542
+ */
2543
+ accountKey: components["parameters"]["AccountKey"];
2544
+ /** @description Which asset, from the prepaid list */
2545
+ provisionId: components["parameters"]["ProvisionId"];
2546
+ };
2547
+ cookie?: never;
2548
+ };
2549
+ requestBody: {
2550
+ content: {
2551
+ "application/json": components["schemas"]["RenewRequestBody"];
2552
+ };
2553
+ };
2554
+ responses: {
2555
+ /** @description OK */
2556
+ 200: {
2557
+ headers: {
2558
+ [name: string]: unknown;
2559
+ };
2560
+ content: {
2561
+ "application/json": components["schemas"]["Order"];
2562
+ };
2563
+ };
2564
+ /** @description Error */
2565
+ default: {
2566
+ headers: {
2567
+ [name: string]: unknown;
2568
+ };
2569
+ content: {
2570
+ "application/json": components["schemas"]["Error"];
2571
+ };
2572
+ };
2573
+ };
2574
+ };
2123
2575
  }
@@ -1381,6 +1381,19 @@ export interface components {
1381
1381
  ImageListResponseBody: {
1382
1382
  items: components["schemas"]["ImageResource"][] | null;
1383
1383
  };
1384
+ PrepaidPrice: {
1385
+ /**
1386
+ * @description An ISO 8601 duration (P1M, P1Y). A duration rather than a number of months: months are not
1387
+ * the same length, and storing a number leaves whoever reads it to decide what it means.
1388
+ */
1389
+ term: string;
1390
+ /**
1391
+ * @description A decimal string, not a float. Money that survives a round trip through binary floating
1392
+ * point is money that stops adding up.
1393
+ */
1394
+ amount: string;
1395
+ currency: string;
1396
+ };
1384
1397
  InstanceTypeResource: {
1385
1398
  /** @description Availability zone of this instance type. A disk must be in the same zone to be attached */
1386
1399
  availability_zone_code: string;
@@ -1398,6 +1411,39 @@ export interface components {
1398
1411
  region_code: string;
1399
1412
  /** Format: int64 */
1400
1413
  vcpus: number;
1414
+ /**
1415
+ * @description Whether this type can be ordered right now.
1416
+ *
1417
+ * It reflects a limit set by operations, not what the cloud can physically schedule — raising
1418
+ * the limit does not create capacity that is not there, and a type that is not sold out can
1419
+ * still fail to start if the zone is full.
1420
+ *
1421
+ * It is advisory: it is read when the list is built, and the last one can be taken between
1422
+ * that read and the order. The order is what actually refuses.
1423
+ */
1424
+ sold_out: boolean;
1425
+ /**
1426
+ * Format: int64
1427
+ * @description How many more may be created. Absent when this type is not limited at all.
1428
+ *
1429
+ * Absent is not zero and not "unknown": a type with no limit simply has no number to show.
1430
+ * Reporting it as a number would need a sentinel, and any sentinel eventually gets compared
1431
+ * against a real count.
1432
+ */
1433
+ remaining?: number;
1434
+ /**
1435
+ * @description What buying this type outright costs, per term. Empty means this type is only sold by the
1436
+ * hour.
1437
+ *
1438
+ * The hourly price is not here and is not missing: it is made of finer parts than the type
1439
+ * (cores and memory are priced separately, and the type itself does not appear in the rate
1440
+ * card at all), so there is no single number to show. A term price is one number because a
1441
+ * term is one purchase.
1442
+ *
1443
+ * Advisory, like `sold_out`: it is read when the list is built. The order is what fixes the
1444
+ * price, and it refuses rather than falling back to hourly if the term is not sold.
1445
+ */
1446
+ prepaid_prices?: components["schemas"]["PrepaidPrice"][];
1401
1447
  };
1402
1448
  InstanceTypeListResponseBody: {
1403
1449
  items: components["schemas"]["InstanceTypeResource"][] | null;
@@ -1596,6 +1642,24 @@ export interface components {
1596
1642
  * @description A private image. Exactly one of this, `image_id` and `boot_disk_id`
1597
1643
  */
1598
1644
  private_image_id?: string;
1645
+ /**
1646
+ * @description Buy the instance outright for this long, as an ISO 8601 duration (P1M, P1Y). Billed by the
1647
+ * hour when omitted.
1648
+ *
1649
+ * The money is taken from the balance when the order is placed, at the price the catalogue
1650
+ * reported for this type and term. If that term is not on sale for this type the request is
1651
+ * refused — it is never quietly sold by the hour instead, because the customer who asked for
1652
+ * a year would find out only from the bill.
1653
+ *
1654
+ * The system disk is bought for the same term: it is the same purchase, and one order cannot
1655
+ * be half outright and half hourly. A term is therefore refused together with `boot_disk_id`,
1656
+ * where the disk already exists and is already billed its own way.
1657
+ *
1658
+ * When the term runs out the instance is stopped, not deleted, and starts again once it is
1659
+ * renewed. Renewal lives in the billing console, across every product, because what a
1660
+ * customer needs to see is everything expiring this month rather than one product at a time.
1661
+ */
1662
+ term?: string;
1599
1663
  /**
1600
1664
  * Format: int64
1601
1665
  * @description System disk capacity in GB. Chosen automatically from the requirement of the image and the platform minimum when omitted. Ignored with `boot_disk_id`, since that disk already has its capacity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {