@leaflow/sdk 0.50.0 → 0.51.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.
@@ -56,12 +56,10 @@ export type CancelSubscriptionResult = operations["cancel-subscription"]["respon
56
56
  export type CancelSubscriptionQuery = operations["cancel-subscription"]["parameters"]["query"];
57
57
  /** `GET /account/v1/billing-accounts/{accountKey}/top-ups/{paymentId}` 成功时的响应体。 */
58
58
  export type ReadTopUpResult = operations["read-top-up"]["responses"][200]["content"]["application/json"];
59
- /** `GET /account/v1/billing-accounts/{accountKey}/payment-method` 成功时的响应体。 */
60
- export type ReadPaymentMethodResult = operations["read-payment-method"]["responses"][200]["content"]["application/json"];
61
- /** `POST /account/v1/billing-accounts/{accountKey}/payment-method` 成功时的响应体。 */
59
+ /** `GET /account/v1/billing-accounts/{accountKey}/payment-methods` 成功时的响应体。 */
60
+ export type ListPaymentMethodsResult = operations["list-payment-methods"]["responses"][200]["content"]["application/json"];
61
+ /** `POST /account/v1/billing-accounts/{accountKey}/payment-methods` 成功时的响应体。 */
62
62
  export type StartPaymentMethodSetupResult = operations["start-payment-method-setup"]["responses"][200]["content"]["application/json"];
63
- /** `POST /account/v1/billing-accounts/{accountKey}/billing-portal` 成功时的响应体。 */
64
- export type StartBillingPortalResult = operations["start-billing-portal"]["responses"][200]["content"]["application/json"];
65
63
  /** `GET /account/v1/billing-accounts/{accountKey}/offers` 成功时的响应体。 */
66
64
  export type ListOffersResult = operations["list-offers"]["responses"][200]["content"]["application/json"];
67
65
  /** `POST /account/v1/billing-accounts/{accountKey}/offers/{offerKey}/purchase` 成功时的响应体。 */
@@ -70,15 +68,3 @@ export type PurchaseOfferResult = operations["purchase-offer"]["responses"][200]
70
68
  export type PurchaseOfferQuery = operations["purchase-offer"]["parameters"]["query"];
71
69
  /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets` 成功时的响应体。 */
72
70
  export type ListPrepaidAssetsResult = operations["list-prepaid-assets"]["responses"][200]["content"]["application/json"];
73
- /** `PUT /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal` 成功时的响应体。 */
74
- export type SetRenewalStatusResult = operations["set-renewal-status"]["responses"][200]["content"]["application/json"];
75
- /** `PUT /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal` 的请求体。 */
76
- export type SetRenewalStatusBody = NonNullable<operations["set-renewal-status"]["requestBody"]>["content"]["application/json"];
77
- /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 成功时的响应体。 */
78
- export type QuoteRenewalResult = operations["quote-renewal"]["responses"][200]["content"]["application/json"];
79
- /** `GET /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote` 的查询参数。 */
80
- export type QuoteRenewalQuery = operations["quote-renewal"]["parameters"]["query"];
81
- /** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 成功时的响应体。 */
82
- export type RenewPrepaidAssetResult = operations["renew-prepaid-asset"]["responses"][200]["content"]["application/json"];
83
- /** `POST /account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew` 的请求体。 */
84
- export type RenewPrepaidAssetBody = NonNullable<operations["renew-prepaid-asset"]["requestBody"]>["content"]["application/json"];
@@ -598,7 +598,7 @@ export interface paths {
598
598
  patch?: never;
599
599
  trace?: never;
600
600
  };
601
- "/account/v1/billing-accounts/{accountKey}/payment-method": {
601
+ "/account/v1/billing-accounts/{accountKey}/payment-methods": {
602
602
  parameters: {
603
603
  query?: never;
604
604
  header?: never;
@@ -606,57 +606,50 @@ export interface paths {
606
606
  cookie?: never;
607
607
  };
608
608
  /**
609
- * Whether this account can be charged
610
- * @description Answers whether a payment method is on file, and nothing else.
609
+ * The payment methods on file
610
+ * @description Every method saved against this account, and which one an invoice will be charged to.
611
611
  *
612
- * ## It is a payment method, not a card
612
+ * ## Why the brand, last four and expiry are here
613
613
  *
614
- * A card is one kind. Direct debit and the recurring-payment mandates offered by regional
615
- * wallets are others, and they occupy the same slot: something the provider can charge later
616
- * without the account holder present. Naming the slot after cards would put an assumption
617
- * into the contract that stops being true the day a second kind is accepted.
614
+ * They were deliberately absent while the billing engine held the card, because the answer
615
+ * that mattered can money be collected came from the engine, and a page built on the
616
+ * provider's answer could show a method the engine had not recorded. Collection now runs from
617
+ * this service against the provider directly, so there is one answer, and it is the one shown.
618
618
  *
619
- * ## Why there is no brand, no last four digits, no expiry
619
+ * Expiry is the reason this is worth showing at all: a card expires, the invoice then fails,
620
+ * dunning runs out, and the project stops — with the account holder watching it happen and no
621
+ * indication that a card was the cause.
620
622
  *
621
- * Those would have to be read from the payment provider, and the two answers can disagree: a
622
- * method present at the provider that the billing engine has not recorded as the default is
623
- * exactly the state in which money cannot be collected — while a page built on the provider's
624
- * answer would be showing one. What matters here is whether the party that will run the
625
- * charge believes it can, so the answer comes from that party alone.
623
+ * No other card data exists here. The number, the expiry entered by the holder and the CVC go
624
+ * from the browser to the provider and never reach this platform.
626
625
  *
627
- * To see it, replace it, or remove it, open the billing portal.
628
- *
629
- * ## Read this before offering a paid plan, not after
630
- *
631
- * `ready` being false is why the engine refuses to start a paid subscription. Discovering it
632
- * at purchase time turns a missing payment method into a rejection whose wording is about
633
- * something else entirely.
634
- *
635
- * An account that has never had one returns `ready: false`. That is the normal state of a
636
- * new account, not an error.
626
+ * An account that has never added one returns an empty list. That is the normal state of a new
627
+ * account, not an error.
637
628
  */
638
- get: operations["read-payment-method"];
629
+ get: operations["list-payment-methods"];
639
630
  put?: never;
640
631
  /**
641
- * Add or replace the payment method on file
642
- * @description Begins adding a payment method. Returns a URL to send the browser to; the details are
643
- * entered there, on the payment provider's own page, and **no card data ever reaches this
644
- * platform**.
632
+ * Begin adding a payment method
633
+ * @description Starts a session for adding a method, and returns the secret the browser needs to mount the
634
+ * provider's own form.
635
+ *
636
+ * ## The form is embedded, not a redirect
645
637
  *
646
- * Which kinds are offered is the provider's decision, not this API's — a card today, a
647
- * wallet mandate or a direct debit wherever the provider supports charging one later without
648
- * the account holder present.
638
+ * The returned `client_secret` initialises the provider's JavaScript, which renders its form
639
+ * inside an iframe on this platform's own page. **No card data reaches this platform** — the
640
+ * number goes from the browser straight to the provider, exactly as it would on a redirect —
641
+ * but the account holder never leaves the console.
642
+ *
643
+ * A redirect would take them to a page with someone else's branding in the middle of adding a
644
+ * payment method, which is the moment they are most likely to abandon it.
649
645
  *
650
646
  * ## This is a prerequisite for buying a plan, not a convenience
651
647
  *
652
- * A plan is charged by invoice, and the invoice is collected from the method on file. A
653
- * subscription cannot start for an account that has none so "add a payment method, then
654
- * buy" is the order the system requires, not a flow that was chosen.
648
+ * A plan is charged by invoice, and the invoice is collected from a method on file. Discovering
649
+ * that none exists at purchase time turns a missing payment method into a rejection whose
650
+ * wording is about something else entirely.
655
651
  *
656
652
  * It is *not* a prerequisite for topping up: a top-up collects the money there and then.
657
- *
658
- * Replacing uses the same operation. The new method becomes the default and the old one stops
659
- * being used; nothing else about the account changes.
660
653
  */
661
654
  post: operations["start-payment-method-setup"];
662
655
  delete?: never;
@@ -665,7 +658,7 @@ export interface paths {
665
658
  patch?: never;
666
659
  trace?: never;
667
660
  };
668
- "/account/v1/billing-accounts/{accountKey}/billing-portal": {
661
+ "/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}": {
669
662
  parameters: {
670
663
  query?: never;
671
664
  header?: never;
@@ -674,26 +667,43 @@ export interface paths {
674
667
  };
675
668
  get?: never;
676
669
  put?: never;
670
+ post?: never;
677
671
  /**
678
- * Open the hosted billing portal
679
- * @description Returns a URL to the payment provider's own portal, where the card can be replaced or
680
- * removed, the billing address changed, and past invoices downloaded.
681
- *
682
- * ## Why replacing a card is not a form on this platform
672
+ * Remove a payment method
673
+ * @description Detaches it from this account. Removing the last one is allowed.
683
674
  *
684
- * A form would mean a card number field, and no card data ever reaches this platform. The
685
- * portal moves the whole interaction to the provider; only a session URL comes back.
675
+ * ## Why removing the last one is not blocked
686
676
  *
687
- * ## Something has to be able to replace an expiring card
677
+ * Blocking it leaves an account holder who wants to stop paying with no way out. The cost of
678
+ * allowing it is that later invoices cannot be collected — and that path has notice, a grace
679
+ * period and a way back. A card that cannot be removed is a dead end.
680
+ */
681
+ delete: operations["remove-payment-method"];
682
+ options?: never;
683
+ head?: never;
684
+ patch?: never;
685
+ trace?: never;
686
+ };
687
+ "/account/v1/billing-accounts/{accountKey}/payment-methods/{paymentMethodId}/default": {
688
+ parameters: {
689
+ query?: never;
690
+ header?: never;
691
+ path?: never;
692
+ cookie?: never;
693
+ };
694
+ get?: never;
695
+ /**
696
+ * Charge invoices to this one
697
+ * @description Makes this the method an invoice is collected from.
688
698
  *
689
- * Cards expire. Once one does, the invoices for a plan stop being collectable, dunning runs
690
- * out, and the projects paid for by this account are suspended for non-payment. Without this
691
- * operation the account holder watches that happen with nowhere to fix it — adding a card
692
- * does not help, since that operation only makes sense when there is none.
699
+ * ## It is stored at the provider, not here
693
700
  *
694
- * The URL is single-use and expires. Do not store it.
701
+ * The charge itself reads that setting from the provider, so keeping a second copy here would
702
+ * create two answers to the same question. When they disagree the visible symptom is that the
703
+ * account holder changed the default and the charge still went to the old one.
695
704
  */
696
- post: operations["start-billing-portal"];
705
+ put: operations["set-default-payment-method"];
706
+ post?: never;
697
707
  delete?: never;
698
708
  options?: never;
699
709
  head?: never;
@@ -783,26 +793,30 @@ export interface paths {
783
793
  cookie?: never;
784
794
  };
785
795
  /**
786
- * What I bought outright, and when it runs out
787
- * @description Everything this account paid a term for, across every product, soonest to expire first.
796
+ * What I bought outright
797
+ * @description Everything this account holds on a term, across every product.
788
798
  *
789
- * ## Why this is one list rather than a page inside each product
799
+ * ## Nothing here expires on its own
790
800
  *
791
- * Renewal is the one thing a customer forgets, and forgetting it stops the machine. Splitting
792
- * the list per product means the instance about to lapse tomorrow is only visible to someone
793
- * who thought to go and look at instances. Sorting by expiry rather than by purchase date is
794
- * the same reason: the row that matters is the one at the top.
801
+ * A term renews for as long as the seat is held: the engine charges the next period, prorates
802
+ * any change to the second, and stops the moment the seat is given up. So there is no renewal
803
+ * to remember and no expiry to warn about giving it up means deleting the resource, in the
804
+ * console that owns it.
805
+ *
806
+ * What the next period costs and when it falls due is on the charges route. That is read
807
+ * straight from the engine rather than copied here, because a copy is a second answer that
808
+ * drifts without saying so.
795
809
  *
796
810
  * ## Metered resources are not here
797
811
  *
798
- * There is no term to run out. Listing them with an empty expiry would invite renewing
799
- * something that is already billed by the hour until it is deleted.
812
+ * They have no term. Listing them would invite renewing something that is already billed by
813
+ * the hour until it is deleted.
800
814
  *
801
815
  * ## `state` and `desired_state` are both reported
802
816
  *
803
- * A machine stopped because its term lapsed reads `suspended` for both. One that has just been
804
- * renewed reads `suspended` and `active` — it is on its way back. Without the second field
805
- * those look identical, and a customer who just paid concludes it did not work and pays again.
817
+ * A machine stopped for arrears reads `suspended` for both. One being brought back reads
818
+ * `suspended` and `active` — it is on its way. Without the second field those look identical,
819
+ * and a customer who just paid concludes it did not work and pays again.
806
820
  */
807
821
  get: operations["list-prepaid-assets"];
808
822
  put?: never;
@@ -813,127 +827,6 @@ export interface paths {
813
827
  patch?: never;
814
828
  trace?: never;
815
829
  };
816
- "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal": {
817
- parameters: {
818
- query?: never;
819
- header?: never;
820
- path?: never;
821
- cookie?: never;
822
- };
823
- get?: never;
824
- /**
825
- * Choose what happens when it expires
826
- * @description Three choices, not two.
827
- *
828
- * ## Why automatic renewal has to be opted into
829
- *
830
- * Charging someone automatically has to be something they chose. Defaulting to it means a
831
- * person who wanted to try one month is charged for a second they never agreed to — and that
832
- * is where chargebacks come from. So a resource bought outright starts on `manual`.
833
- *
834
- * ## And why "let it expire" is its own choice, not just "not automatic"
835
- *
836
- * `manual` keeps reminding: the notice before expiry is mandatory, because expiry stops the
837
- * resource. Someone who has decided to let it go does not want those, and the cost of sending
838
- * them anyway is not annoyance — it is that the reminders get filtered away, taking the ones
839
- * that mattered with them.
840
- *
841
- * ## Turning it on needs a known cycle
842
- *
843
- * Renewing automatically has to know for how long, which comes from the last purchase or
844
- * renewal. A resource adopted into billing, or bought before this was recorded, has no cycle
845
- * yet: renew it manually once and the cycle is written down.
846
- */
847
- put: operations["set-renewal-status"];
848
- post?: never;
849
- delete?: never;
850
- options?: never;
851
- head?: never;
852
- patch?: never;
853
- trace?: never;
854
- };
855
- "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renewal-quote": {
856
- parameters: {
857
- query?: never;
858
- header?: never;
859
- path?: never;
860
- cookie?: never;
861
- };
862
- /**
863
- * What renewing this would cost
864
- * @description Priced the same way the charge is, from the same table, so the number shown is the number
865
- * taken. Quoting separately from charging is what lets a customer see the price before
866
- * committing; computing it twice in two places is what makes the two disagree, and a bill that
867
- * disagrees with the page that sold it is a complaint rather than a bug report.
868
- *
869
- * ## Both the current and the resulting expiry are returned
870
- *
871
- * Renewing early adds the term to what is left, not to today — otherwise renewing a month
872
- * ahead throws that month away, and everyone learns to wait until the last moment. Something
873
- * that lapsed long ago is counted from now instead, because adding to a date in the past
874
- * produces an expiry that is still in the past.
875
- *
876
- * Reporting only the new date leaves the customer unable to tell which of those happened.
877
- *
878
- * ## A withdrawn price still quotes
879
- *
880
- * Taking a product off sale means stop selling new ones. Refusing renewals as well would stop
881
- * a batch of existing machines on their expiry date, which is not what the operator pressed
882
- * that button for.
883
- */
884
- get: operations["quote-renewal"];
885
- put?: never;
886
- post?: never;
887
- delete?: never;
888
- options?: never;
889
- head?: never;
890
- patch?: never;
891
- trace?: never;
892
- };
893
- "/account/v1/billing-accounts/{accountKey}/prepaid-assets/{provisionId}/renew": {
894
- parameters: {
895
- query?: never;
896
- header?: never;
897
- path?: never;
898
- cookie?: never;
899
- };
900
- get?: never;
901
- put?: never;
902
- /**
903
- * Renew it
904
- * @description Takes the money from the balance and pushes the expiry out. The resource itself is not
905
- * touched — nothing is rebuilt, nothing restarts, the id stays the same.
906
- *
907
- * ## An idempotency key is required, not optional
908
- *
909
- * Renewal is a pure charge. Unlike creating something, there is no resource whose uniqueness
910
- * catches a repeat, so a double click is two charges and twice the term — and both calls
911
- * return success. Letting the field be omitted would mean losing that protection silently, in
912
- * the one case that looks completely normal until the books are reconciled.
913
- *
914
- * Sending the same key again returns the order that was already placed. It does not charge
915
- * again, and it is not an error: reporting a repeat as a failure makes the caller retry
916
- * forever, and makes the customer press the button a second time with a fresh key.
917
- *
918
- * ## What happens if the balance is short
919
- *
920
- * The order is recorded as failed and nothing else changes: no money moves, the expiry stays
921
- * where it was, and the resource keeps running until its existing term ends. Retrying with the
922
- * same key after topping up goes through.
923
- *
924
- * ## Renewing something that already lapsed brings it back
925
- *
926
- * Its term is counted from now, and it is asked to start again. Coming back is the
927
- * reconciliation loop's job, so it is not instant — which is what `desired_state` on the asset
928
- * list is for.
929
- */
930
- post: operations["renew-prepaid-asset"];
931
- delete?: never;
932
- options?: never;
933
- head?: never;
934
- patch?: never;
935
- trace?: never;
936
- };
937
830
  }
938
831
  export type webhooks = Record<string, never>;
939
832
  export interface components {
@@ -1162,7 +1055,6 @@ export interface components {
1162
1055
  quantity: number;
1163
1056
  };
1164
1057
  PrepaidAsset: {
1165
- /** @description Use this to quote and to renew. */
1166
1058
  id: string;
1167
1059
  project_id: string;
1168
1060
  /** @description Which service holds it. Also which console it is managed from. */
@@ -1180,60 +1072,26 @@ export interface components {
1180
1072
  */
1181
1073
  quantity: number;
1182
1074
  /**
1183
- * Format: date-time
1184
- * @description Paid up to this instant. It stops being served after it, not before.
1075
+ * @description How long one period buys, as an ISO 8601 duration (P1M, P1Y).
1076
+ *
1077
+ * There is no expiry to report. The engine keeps renewing this for as long as the seat is
1078
+ * held, so what runs out is not the term but the customer's decision to keep it. What the
1079
+ * next period costs, and when it is charged, is on the charges route — that is the engine's
1080
+ * own answer rather than a copy of it.
1185
1081
  */
1186
- term_end: string;
1082
+ term: string;
1187
1083
  /** @enum {string} */
1188
1084
  state: "pending" | "active" | "suspended" | "terminated";
1189
1085
  /**
1190
- * @description What it is being moved to. Differs from `state` while a change is still being applied
1191
- * in particular right after a renewal, which is the moment a customer is most likely to
1192
- * conclude that nothing happened.
1086
+ * @description What it is being moved to. Differs from `state` while a change is still being applied,
1087
+ * which is the moment a customer is most likely to conclude that nothing happened.
1193
1088
  * @enum {string}
1194
1089
  */
1195
1090
  desired_state: "active" | "suspended" | "terminated";
1196
- /**
1197
- * @description How long one renewal buys, as an ISO 8601 duration (P1M, P1Y). Empty on something adopted
1198
- * into billing rather than bought through it — automatic renewal cannot be turned on until
1199
- * one manual renewal records it.
1200
- */
1201
- billing_cycle?: string;
1202
- /**
1203
- * @description What happens at expiry. `manual` is where everything starts: charging automatically has
1204
- * to be chosen. `none` also stops the reminders, which is a different thing from `manual`
1205
- * — see the route that sets it.
1206
- * @enum {string}
1207
- */
1208
- renewal_status: "manual" | "auto" | "none";
1209
1091
  };
1210
1092
  PrepaidAssetList: {
1211
1093
  assets: components["schemas"]["PrepaidAsset"][];
1212
1094
  };
1213
- RenewalQuote: {
1214
- provision_id: string;
1215
- term: string;
1216
- /**
1217
- * @description A decimal string, not a float. Money that survives a round trip through binary floating
1218
- * point is money that stops adding up.
1219
- */
1220
- amount: string;
1221
- currency: string;
1222
- /**
1223
- * Format: date-time
1224
- * @description What it is paid up to now.
1225
- */
1226
- current_term_end: string;
1227
- /**
1228
- * Format: date-time
1229
- * @description What it would be paid up to after renewing.
1230
- */
1231
- term_end: string;
1232
- };
1233
- SetRenewalStatusRequestBody: {
1234
- /** @enum {string} */
1235
- status: "manual" | "auto" | "none";
1236
- };
1237
1095
  RenewRequestBody: {
1238
1096
  /**
1239
1097
  * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). It does not have to match the
@@ -1428,40 +1286,60 @@ export interface components {
1428
1286
  };
1429
1287
  PaymentMethodSetupSession: {
1430
1288
  /**
1431
- * Format: uri
1432
- * @description Send the browser here. It expires, so do not store it
1289
+ * @description Initialises the provider's JavaScript, which mounts its form in an iframe on this page.
1290
+ *
1291
+ * Not a URL: the form is embedded rather than redirected to, so the account holder stays
1292
+ * on the console. It expires, so fetch it when the form is about to be shown rather than
1293
+ * when the page loads.
1433
1294
  */
1434
- url: string;
1435
- };
1436
- BillingPortalSession: {
1295
+ client_secret: string;
1437
1296
  /**
1438
- * Format: uri
1439
- * @description Send the browser here. It expires, so do not store it
1297
+ * @description The provider's id for this attempt.
1298
+ *
1299
+ * The browser does not need it — the callback carries the same id and is what actually
1300
+ * records the method. It is here so that a support conversation about one failed attempt
1301
+ * has something to look it up by.
1440
1302
  */
1441
- url: string;
1303
+ session_id?: string;
1442
1304
  };
1443
1305
  /**
1444
- * @description Whether money can be collected from this account later, without the account holder present.
1306
+ * @description One saved way of collecting money later, without the account holder present.
1445
1307
  *
1446
- * Deliberately not called a card: a card is one kind of payment method, and direct debit and
1447
- * the recurring mandates offered by regional wallets occupy the same slot.
1308
+ * Deliberately not called a card: a card is one kind, and direct debit and the recurring
1309
+ * mandates offered by regional wallets occupy the same slot.
1448
1310
  */
1449
1311
  PaymentMethod: {
1312
+ /** @description The provider's id for it. Used to remove it or make it the default */
1313
+ id: string;
1314
+ /** @description Visa, Mastercard, and so on. Empty for kinds that have no brand */
1315
+ brand?: string;
1450
1316
  /**
1451
- * @description True when the billing engine holds a default payment method for this account and can
1452
- * therefore collect an invoice.
1317
+ * @description The last four digits, for telling two saved methods apart.
1453
1318
  *
1454
- * This is the precondition for a paid plan. While it is false, starting a paid
1455
- * subscription is refused, and the refusal is about billing setup rather than about the
1456
- * plan — so check this first and say what is actually missing.
1319
+ * This and the expiry are the only parts of the instrument that exist here. The number,
1320
+ * the expiry the holder typed and the CVC never reach this platform.
1321
+ */
1322
+ last4?: string;
1323
+ /** Format: int32 */
1324
+ exp_month?: number;
1325
+ /**
1326
+ * Format: int32
1327
+ * @description Together with `exp_month`, when this stops working.
1457
1328
  *
1458
- * It says nothing about which kind is on file. To show or change that, send the account
1459
- * holder to the billing portal.
1329
+ * Worth showing because the failure is otherwise invisible: the card expires, the invoice
1330
+ * fails, dunning runs out, and the project stops — with nothing pointing at the card.
1331
+ */
1332
+ exp_year?: number;
1333
+ /**
1334
+ * @description True for the one an invoice is collected from.
1460
1335
  *
1461
- * A free plan does not require it, which is what allows a new account to be placed on the
1462
- * default tier before anyone has entered a card.
1336
+ * Exactly one is the default while any exist. An account whose only method was removed
1337
+ * has none, and its next invoice cannot be collected.
1463
1338
  */
1464
- ready: boolean;
1339
+ default: boolean;
1340
+ };
1341
+ PaymentMethodList: {
1342
+ payment_methods: components["schemas"]["PaymentMethod"][];
1465
1343
  };
1466
1344
  TopUpSession: {
1467
1345
  /**
@@ -2519,7 +2397,7 @@ export interface operations {
2519
2397
  };
2520
2398
  };
2521
2399
  };
2522
- "read-payment-method": {
2400
+ "list-payment-methods": {
2523
2401
  parameters: {
2524
2402
  query?: never;
2525
2403
  header?: never;
@@ -2540,7 +2418,7 @@ export interface operations {
2540
2418
  [name: string]: unknown;
2541
2419
  };
2542
2420
  content: {
2543
- "application/json": components["schemas"]["PaymentMethod"];
2421
+ "application/json": components["schemas"]["PaymentMethodList"];
2544
2422
  };
2545
2423
  };
2546
2424
  /** @description Error */
@@ -2589,7 +2467,7 @@ export interface operations {
2589
2467
  };
2590
2468
  };
2591
2469
  };
2592
- "start-billing-portal": {
2470
+ "remove-payment-method": {
2593
2471
  parameters: {
2594
2472
  query?: never;
2595
2473
  header?: never;
@@ -2599,19 +2477,18 @@ export interface operations {
2599
2477
  * which is why the key is what addresses the account.
2600
2478
  */
2601
2479
  accountKey: components["parameters"]["AccountKey"];
2480
+ paymentMethodId: string;
2602
2481
  };
2603
2482
  cookie?: never;
2604
2483
  };
2605
2484
  requestBody?: never;
2606
2485
  responses: {
2607
- /** @description OK */
2608
- 200: {
2486
+ /** @description Removed */
2487
+ 204: {
2609
2488
  headers: {
2610
2489
  [name: string]: unknown;
2611
2490
  };
2612
- content: {
2613
- "application/json": components["schemas"]["BillingPortalSession"];
2614
- };
2491
+ content?: never;
2615
2492
  };
2616
2493
  /** @description Error */
2617
2494
  default: {
@@ -2624,7 +2501,7 @@ export interface operations {
2624
2501
  };
2625
2502
  };
2626
2503
  };
2627
- "list-offers": {
2504
+ "set-default-payment-method": {
2628
2505
  parameters: {
2629
2506
  query?: never;
2630
2507
  header?: never;
@@ -2634,59 +2511,18 @@ export interface operations {
2634
2511
  * which is why the key is what addresses the account.
2635
2512
  */
2636
2513
  accountKey: components["parameters"]["AccountKey"];
2514
+ paymentMethodId: string;
2637
2515
  };
2638
2516
  cookie?: never;
2639
2517
  };
2640
2518
  requestBody?: never;
2641
2519
  responses: {
2642
- /** @description OK */
2643
- 200: {
2644
- headers: {
2645
- [name: string]: unknown;
2646
- };
2647
- content: {
2648
- "application/json": components["schemas"]["OfferList"];
2649
- };
2650
- };
2651
- /** @description Error */
2652
- default: {
2653
- headers: {
2654
- [name: string]: unknown;
2655
- };
2656
- content: {
2657
- "application/json": components["schemas"]["Error"];
2658
- };
2659
- };
2660
- };
2661
- };
2662
- "purchase-offer": {
2663
- parameters: {
2664
- query?: {
2665
- /** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
2666
- timing?: components["schemas"]["PlanChangeTiming"];
2667
- };
2668
- header?: never;
2669
- path: {
2670
- /**
2671
- * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2672
- * which is why the key is what addresses the account.
2673
- */
2674
- accountKey: components["parameters"]["AccountKey"];
2675
- /** @description Which offer */
2676
- offerKey: string;
2677
- };
2678
- cookie?: never;
2679
- };
2680
- requestBody?: never;
2681
- responses: {
2682
- /** @description OK */
2683
- 200: {
2520
+ /** @description Updated */
2521
+ 204: {
2684
2522
  headers: {
2685
2523
  [name: string]: unknown;
2686
2524
  };
2687
- content: {
2688
- "application/json": components["schemas"]["Purchase"];
2689
- };
2525
+ content?: never;
2690
2526
  };
2691
2527
  /** @description Error */
2692
2528
  default: {
@@ -2699,7 +2535,7 @@ export interface operations {
2699
2535
  };
2700
2536
  };
2701
2537
  };
2702
- "list-prepaid-assets": {
2538
+ "list-offers": {
2703
2539
  parameters: {
2704
2540
  query?: never;
2705
2541
  header?: never;
@@ -2720,48 +2556,7 @@ export interface operations {
2720
2556
  [name: string]: unknown;
2721
2557
  };
2722
2558
  content: {
2723
- "application/json": components["schemas"]["PrepaidAssetList"];
2724
- };
2725
- };
2726
- /** @description Error */
2727
- default: {
2728
- headers: {
2729
- [name: string]: unknown;
2730
- };
2731
- content: {
2732
- "application/json": components["schemas"]["Error"];
2733
- };
2734
- };
2735
- };
2736
- };
2737
- "set-renewal-status": {
2738
- parameters: {
2739
- query?: never;
2740
- header?: never;
2741
- path: {
2742
- /**
2743
- * @description The account's key, of the form `u_<user_id>_<seq>`. Ownership is stated by the key itself,
2744
- * which is why the key is what addresses the account.
2745
- */
2746
- accountKey: components["parameters"]["AccountKey"];
2747
- /** @description Which asset, from the prepaid list */
2748
- provisionId: components["parameters"]["ProvisionId"];
2749
- };
2750
- cookie?: never;
2751
- };
2752
- requestBody: {
2753
- content: {
2754
- "application/json": components["schemas"]["SetRenewalStatusRequestBody"];
2755
- };
2756
- };
2757
- responses: {
2758
- /** @description OK */
2759
- 200: {
2760
- headers: {
2761
- [name: string]: unknown;
2762
- };
2763
- content: {
2764
- "application/json": components["schemas"]["PrepaidAsset"];
2559
+ "application/json": components["schemas"]["OfferList"];
2765
2560
  };
2766
2561
  };
2767
2562
  /** @description Error */
@@ -2775,14 +2570,11 @@ export interface operations {
2775
2570
  };
2776
2571
  };
2777
2572
  };
2778
- "quote-renewal": {
2573
+ "purchase-offer": {
2779
2574
  parameters: {
2780
- query: {
2781
- /**
2782
- * @description How long to renew for, as an ISO 8601 duration (P1M, P1Y). A duration rather than a
2783
- * number of months: months are not the same length.
2784
- */
2785
- term: string;
2575
+ query?: {
2576
+ /** @description When the switch takes effect. Required if the account already has a plan, ignored otherwise */
2577
+ timing?: components["schemas"]["PlanChangeTiming"];
2786
2578
  };
2787
2579
  header?: never;
2788
2580
  path: {
@@ -2791,8 +2583,8 @@ export interface operations {
2791
2583
  * which is why the key is what addresses the account.
2792
2584
  */
2793
2585
  accountKey: components["parameters"]["AccountKey"];
2794
- /** @description Which asset, from the prepaid list */
2795
- provisionId: components["parameters"]["ProvisionId"];
2586
+ /** @description Which offer */
2587
+ offerKey: string;
2796
2588
  };
2797
2589
  cookie?: never;
2798
2590
  };
@@ -2804,7 +2596,7 @@ export interface operations {
2804
2596
  [name: string]: unknown;
2805
2597
  };
2806
2598
  content: {
2807
- "application/json": components["schemas"]["RenewalQuote"];
2599
+ "application/json": components["schemas"]["Purchase"];
2808
2600
  };
2809
2601
  };
2810
2602
  /** @description Error */
@@ -2818,7 +2610,7 @@ export interface operations {
2818
2610
  };
2819
2611
  };
2820
2612
  };
2821
- "renew-prepaid-asset": {
2613
+ "list-prepaid-assets": {
2822
2614
  parameters: {
2823
2615
  query?: never;
2824
2616
  header?: never;
@@ -2828,16 +2620,10 @@ export interface operations {
2828
2620
  * which is why the key is what addresses the account.
2829
2621
  */
2830
2622
  accountKey: components["parameters"]["AccountKey"];
2831
- /** @description Which asset, from the prepaid list */
2832
- provisionId: components["parameters"]["ProvisionId"];
2833
2623
  };
2834
2624
  cookie?: never;
2835
2625
  };
2836
- requestBody: {
2837
- content: {
2838
- "application/json": components["schemas"]["RenewRequestBody"];
2839
- };
2840
- };
2626
+ requestBody?: never;
2841
2627
  responses: {
2842
2628
  /** @description OK */
2843
2629
  200: {
@@ -2845,7 +2631,7 @@ export interface operations {
2845
2631
  [name: string]: unknown;
2846
2632
  };
2847
2633
  content: {
2848
- "application/json": components["schemas"]["Order"];
2634
+ "application/json": components["schemas"]["PrepaidAssetList"];
2849
2635
  };
2850
2636
  };
2851
2637
  /** @description Error */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {