@leaflow/sdk 0.122.0 → 0.123.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.
Files changed (35) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +12 -2
  2. package/dist/billing/type/order/v1/generated/validators/payInvoiceRequest.zod.js +1 -1
  3. package/dist/billing/type/order/v1/generated/validators/quoteCancellation.zod.js +1 -1
  4. package/dist/billing/type/order/v1/generated/validators/renewalOrderRequest.zod.d.ts +4 -0
  5. package/dist/billing/type/order/v1/generated/validators/renewalOrderRequest.zod.js +2 -0
  6. package/dist/billing/type/order/v1/generated/validators/subscription.zod.js +1 -1
  7. package/dist/billing/v1/generated/functions.d.ts +10 -3
  8. package/dist/billing/v1/generated/functions.js +10 -3
  9. package/dist/billing/v1/generated/models.d.ts +12 -2
  10. package/dist/billing/v1/generated/schemas.zod.d.ts +14 -3
  11. package/dist/billing/v1/generated/schemas.zod.js +10 -3
  12. package/dist/billing/v1/generated/validators/payInvoiceRequest.zod.js +1 -1
  13. package/dist/billing/v1/generated/validators/quoteCancellation.zod.js +1 -1
  14. package/dist/billing/v1/generated/validators/renewalOrderRequest.zod.d.ts +4 -0
  15. package/dist/billing/v1/generated/validators/renewalOrderRequest.zod.js +2 -0
  16. package/dist/billing/v1/generated/validators/subscription.zod.js +1 -1
  17. package/dist/canopy/v1/generated/models.d.ts +12 -2
  18. package/dist/canopy/v1/generated/validators/payInvoiceRequest.zod.js +1 -1
  19. package/dist/canopy/v1/generated/validators/quoteCancellation.zod.js +1 -1
  20. package/dist/canopy/v1/generated/validators/renewalOrderRequest.zod.d.ts +4 -0
  21. package/dist/canopy/v1/generated/validators/renewalOrderRequest.zod.js +2 -0
  22. package/dist/canopy/v1/generated/validators/subscription.zod.js +1 -1
  23. package/dist/compute/v1/generated/models.d.ts +12 -2
  24. package/dist/compute/v1/generated/validators/payInvoiceRequest.zod.js +1 -1
  25. package/dist/compute/v1/generated/validators/quoteCancellation.zod.js +1 -1
  26. package/dist/compute/v1/generated/validators/renewalOrderRequest.zod.d.ts +4 -0
  27. package/dist/compute/v1/generated/validators/renewalOrderRequest.zod.js +2 -0
  28. package/dist/compute/v1/generated/validators/subscription.zod.js +1 -1
  29. package/dist/membership/v1/generated/models.d.ts +12 -2
  30. package/dist/membership/v1/generated/validators/payInvoiceRequest.zod.js +1 -1
  31. package/dist/membership/v1/generated/validators/quoteCancellation.zod.js +1 -1
  32. package/dist/membership/v1/generated/validators/renewalOrderRequest.zod.d.ts +4 -0
  33. package/dist/membership/v1/generated/validators/renewalOrderRequest.zod.js +2 -0
  34. package/dist/membership/v1/generated/validators/subscription.zod.js +1 -1
  35. package/package.json +1 -1
@@ -471,6 +471,10 @@ export interface Quote {
471
471
  /**
472
472
  * A cancellation to quote: what ending these subscriptions together would return. One mode per
473
473
  * request; to compare, quote `immediate` and `period_end` separately.
474
+ *
475
+ * Refused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being
476
+ * canceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a
477
+ * paid change still waiting to switch (`meta.order_id`).
474
478
  */
475
479
  export interface QuoteCancellation {
476
480
  /**
@@ -1135,6 +1139,9 @@ export interface PaymentMethodSetupResult {
1135
1139
  * through the selected gateway. Grants restricted to other purchases are not counted as available funds.
1136
1140
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
1137
1141
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
1142
+ *
1143
+ * `payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;
1144
+ * otherwise the request is refused with `BILLING_PURCHASE_INVALID`.
1138
1145
  */
1139
1146
  export interface PayInvoiceRequest {
1140
1147
  /**
@@ -1860,8 +1867,9 @@ export interface Subscription {
1860
1867
  cancellation?: SubscriptionCancellation;
1861
1868
  /**
1862
1869
  * The saved payment method automatic renewal charges after the account's balance and credits,
1863
- * before the account's default payment method. Set when the purchase, or a renewal, is paid with a saved
1864
- * payment method. It is used only while it belongs to the account that pays the renewal.
1870
+ * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
1871
+ * saved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the
1872
+ * account that pays the renewal.
1865
1873
  * @nullable
1866
1874
  */
1867
1875
  default_payment_method_id?: string | null;
@@ -2027,6 +2035,8 @@ export interface RenewalOrderRequest {
2027
2035
  interval_count?: number;
2028
2036
  /** As in renewing. */
2029
2037
  interval?: RenewalOrderRequestInterval;
2038
+ /** As in renewing. */
2039
+ termination_policy?: TerminationPolicy;
2030
2040
  }
2031
2041
  export interface AutoRenewSet {
2032
2042
  auto_renew: boolean;
@@ -50,4 +50,4 @@ export const PayInvoiceRequest = zod
50
50
  .optional()
51
51
  .describe("The invoice total to expect, after discounts and tax and before credit grants or balance, as the\npayment preview or an order quote gave it. A different total fails with BILLING_AMOUNT_CHANGED\nand nothing is charged. Omit to skip the comparison; an explicit zero is compared."),
52
52
  })
53
- .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.");
53
+ .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.\n\n`payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;\notherwise the request is refused with `BILLING_PURCHASE_INVALID`.");
@@ -17,4 +17,4 @@ export const QuoteCancellation = zod
17
17
  .describe("The subscriptions to end together, all of one service. Every subscription released with a resource must be included."),
18
18
  mode: TerminationPolicy,
19
19
  })
20
- .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.");
20
+ .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.\n\nRefused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being\ncanceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a\npaid change still waiting to switch (`meta.order_id`).");
@@ -16,6 +16,10 @@ export declare const RenewalOrderRequest: zod.ZodObject<{
16
16
  month: "month";
17
17
  year: "year";
18
18
  }>>;
19
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
20
+ immediate: "immediate";
21
+ period_end: "period_end";
22
+ }>>;
19
23
  }, zod.z.core.$strict>;
20
24
  export type RenewalOrderRequest = zod.input<typeof RenewalOrderRequest>;
21
25
  export type RenewalOrderRequestOutput = zod.output<typeof RenewalOrderRequest>;
@@ -6,6 +6,7 @@
6
6
  * OpenAPI spec version: v1
7
7
  */
8
8
  import * as zod from "zod";
9
+ import { TerminationPolicy } from "./terminationPolicy.zod.js";
9
10
  export const renewalOrderRequestPeriodsDefault = 1;
10
11
  export const RenewalOrderRequest = zod
11
12
  .strictObject({
@@ -19,5 +20,6 @@ export const RenewalOrderRequest = zod
19
20
  .describe("As in renewing."),
20
21
  interval_count: zod.int().min(1).optional().describe("As in renewing."),
21
22
  interval: zod.enum(["day", "month", "year"]).optional().describe("As in renewing."),
23
+ termination_policy: TerminationPolicy.optional().describe("As in renewing."),
22
24
  })
23
25
  .describe("The periods and price of the renewal, chosen as in renewing.");
@@ -44,7 +44,7 @@ export const Subscription = zod
44
44
  default_payment_method_id: zod
45
45
  .uuid()
46
46
  .nullish()
47
- .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, or a renewal, is paid with a saved\npayment method. It is used only while it belongs to the account that pays the renewal."),
47
+ .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, a renewal or a change is paid with a\nsaved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the\naccount that pays the renewal."),
48
48
  created_at: zod.iso.datetime({ offset: true }).optional(),
49
49
  id: zod.uuid(),
50
50
  billing_account_id: zod
@@ -614,7 +614,10 @@ export declare const getPayInvoiceUrl: (invoiceId: string) => string;
614
614
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
615
615
  * order that has failed or was
616
616
  * canceled, with `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`; and that of an order whose
617
- * payment deadline has passed, with `BILLING_ORDER_EXPIRED`.
617
+ * payment deadline has passed, with `BILLING_ORDER_EXPIRED`. A renewal invoice is also refused with
618
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
619
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
620
+ * `subscription_ended` respectively.
618
621
  * @summary Pay an invoice
619
622
  */
620
623
  export declare const payInvoice: (invoiceId: string, payInvoiceRequest?: PayInvoiceRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<payInvoiceResponse>;
@@ -678,7 +681,10 @@ export declare const getPayTogetherUrl: () => string;
678
681
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
679
682
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
680
683
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
681
- * passed with `BILLING_ORDER_EXPIRED`.
684
+ * passed with `BILLING_ORDER_EXPIRED`. A renewal invoice is refused with
685
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
686
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
687
+ * `subscription_ended` respectively.
682
688
  * @summary Pay together
683
689
  */
684
690
  export declare const payTogether: (payTogetherRequest: PayTogetherRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<payTogetherResponse>;
@@ -1142,7 +1148,8 @@ export declare const getCreateCancellationUrl: () => string;
1142
1148
  * - 409 `BILLING_CANCELLATION_SCHEDULES_DIFFER` when, for `period_end`, the paid terms end at
1143
1149
  * different times;
1144
1150
  * - 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being canceled
1145
- * (`meta.cancellation_id`) or reclaimed (`meta.action_id`);
1151
+ * (`meta.cancellation_id`) or reclaimed (`meta.reason` `reclaim_requested`), or has a paid
1152
+ * change still waiting to switch (`meta.order_id`);
1146
1153
  * - 409 `BILLING_ORDER_PAYMENT_IN_FLIGHT` while an online payment for a renewal of one of them
1147
1154
  * is in progress;
1148
1155
  * - 409 `BILLING_CANCELLATION_REFUND_CHANGED` when the refund is no longer
@@ -645,7 +645,10 @@ export const getPayInvoiceUrl = (invoiceId) => {
645
645
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
646
646
  * order that has failed or was
647
647
  * canceled, with `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`; and that of an order whose
648
- * payment deadline has passed, with `BILLING_ORDER_EXPIRED`.
648
+ * payment deadline has passed, with `BILLING_ORDER_EXPIRED`. A renewal invoice is also refused with
649
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
650
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
651
+ * `subscription_ended` respectively.
649
652
  * @summary Pay an invoice
650
653
  */
651
654
  export const payInvoice = async (invoiceId, payInvoiceRequest, options, fetchFn) => {
@@ -725,7 +728,10 @@ export const getPayTogetherUrl = () => {
725
728
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
726
729
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
727
730
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
728
- * passed with `BILLING_ORDER_EXPIRED`.
731
+ * passed with `BILLING_ORDER_EXPIRED`. A renewal invoice is refused with
732
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
733
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
734
+ * `subscription_ended` respectively.
729
735
  * @summary Pay together
730
736
  */
731
737
  export const payTogether = async (payTogetherRequest, options, fetchFn) => {
@@ -1257,7 +1263,8 @@ export const getCreateCancellationUrl = () => {
1257
1263
  * - 409 `BILLING_CANCELLATION_SCHEDULES_DIFFER` when, for `period_end`, the paid terms end at
1258
1264
  * different times;
1259
1265
  * - 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being canceled
1260
- * (`meta.cancellation_id`) or reclaimed (`meta.action_id`);
1266
+ * (`meta.cancellation_id`) or reclaimed (`meta.reason` `reclaim_requested`), or has a paid
1267
+ * change still waiting to switch (`meta.order_id`);
1261
1268
  * - 409 `BILLING_ORDER_PAYMENT_IN_FLIGHT` while an online payment for a renewal of one of them
1262
1269
  * is in progress;
1263
1270
  * - 409 `BILLING_CANCELLATION_REFUND_CHANGED` when the refund is no longer
@@ -281,6 +281,10 @@ export interface Quote {
281
281
  /**
282
282
  * A cancellation to quote: what ending these subscriptions together would return. One mode per
283
283
  * request; to compare, quote `immediate` and `period_end` separately.
284
+ *
285
+ * Refused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being
286
+ * canceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a
287
+ * paid change still waiting to switch (`meta.order_id`).
284
288
  */
285
289
  export interface QuoteCancellation {
286
290
  /**
@@ -956,6 +960,9 @@ export interface PaymentMethodSetupResult {
956
960
  * through the selected gateway. Grants restricted to other purchases are not counted as available funds.
957
961
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
958
962
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
963
+ *
964
+ * `payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;
965
+ * otherwise the request is refused with `BILLING_PURCHASE_INVALID`.
959
966
  */
960
967
  export interface PayInvoiceRequest {
961
968
  /**
@@ -1697,8 +1704,9 @@ export interface Subscription {
1697
1704
  cancellation?: SubscriptionCancellation;
1698
1705
  /**
1699
1706
  * The saved payment method automatic renewal charges after the account's balance and credits,
1700
- * before the account's default payment method. Set when the purchase, or a renewal, is paid with a saved
1701
- * payment method. It is used only while it belongs to the account that pays the renewal.
1707
+ * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
1708
+ * saved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the
1709
+ * account that pays the renewal.
1702
1710
  * @nullable
1703
1711
  */
1704
1712
  default_payment_method_id?: string | null;
@@ -1864,6 +1872,8 @@ export interface RenewalOrderRequest {
1864
1872
  interval_count?: number;
1865
1873
  /** As in renewing. */
1866
1874
  interval?: RenewalOrderRequestInterval;
1875
+ /** As in renewing. */
1876
+ termination_policy?: TerminationPolicy;
1867
1877
  }
1868
1878
  export interface AutoRenewSet {
1869
1879
  auto_renew: boolean;
@@ -341,7 +341,10 @@ export declare const DeletePaymentMethodParams: zod.ZodObject<{
341
341
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
342
342
  * order that has failed or was
343
343
  * canceled, with `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`; and that of an order whose
344
- * payment deadline has passed, with `BILLING_ORDER_EXPIRED`.
344
+ * payment deadline has passed, with `BILLING_ORDER_EXPIRED`. A renewal invoice is also refused with
345
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
346
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
347
+ * `subscription_ended` respectively.
345
348
  * @summary Pay an invoice
346
349
  */
347
350
  export declare const PayInvoiceParams: zod.ZodObject<{
@@ -395,7 +398,10 @@ export declare const PreviewInvoicePaymentQueryParams: zod.ZodObject<{
395
398
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
396
399
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
397
400
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
398
- * passed with `BILLING_ORDER_EXPIRED`.
401
+ * passed with `BILLING_ORDER_EXPIRED`. A renewal invoice is refused with
402
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
403
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
404
+ * `subscription_ended` respectively.
399
405
  * @summary Pay together
400
406
  */
401
407
  export declare const PayTogetherBody: zod.ZodObject<{
@@ -774,7 +780,8 @@ export declare const ListCancellationsQueryParams: zod.ZodObject<{
774
780
  * - 409 `BILLING_CANCELLATION_SCHEDULES_DIFFER` when, for `period_end`, the paid terms end at
775
781
  * different times;
776
782
  * - 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being canceled
777
- * (`meta.cancellation_id`) or reclaimed (`meta.action_id`);
783
+ * (`meta.cancellation_id`) or reclaimed (`meta.reason` `reclaim_requested`), or has a paid
784
+ * change still waiting to switch (`meta.order_id`);
778
785
  * - 409 `BILLING_ORDER_PAYMENT_IN_FLIGHT` while an online payment for a renewal of one of them
779
786
  * is in progress;
780
787
  * - 409 `BILLING_CANCELLATION_REFUND_CHANGED` when the refund is no longer
@@ -889,6 +896,10 @@ export declare const CreateRenewalOrderBody: zod.ZodObject<{
889
896
  month: "month";
890
897
  year: "year";
891
898
  }>>;
899
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
900
+ immediate: "immediate";
901
+ period_end: "period_end";
902
+ }>>;
892
903
  }, zod.z.core.$strict>;
893
904
  /**
894
905
  * Controls automatic prepaid renewal. Disabling it does not shorten current_term_end and still permits
@@ -396,7 +396,10 @@ export const DeletePaymentMethodParams = zod.strictObject({
396
396
  * another charge. A void invoice is refused with `BILLING_INVOICE_NOT_PAYABLE`; the invoice of an
397
397
  * order that has failed or was
398
398
  * canceled, with `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`; and that of an order whose
399
- * payment deadline has passed, with `BILLING_ORDER_EXPIRED`.
399
+ * payment deadline has passed, with `BILLING_ORDER_EXPIRED`. A renewal invoice is also refused with
400
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
401
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
402
+ * `subscription_ended` respectively.
400
403
  * @summary Pay an invoice
401
404
  */
402
405
  export const PayInvoiceParams = zod.strictObject({
@@ -452,7 +455,10 @@ export const PreviewInvoicePaymentQueryParams = zod.strictObject({
452
455
  * `BILLING_INVOICE_NOT_PAYABLE`, a deferred period-end change not yet due to be invoiced with
453
456
  * `BILLING_CHANGE_NOT_INVOICED`, an order that has failed or was canceled with
454
457
  * `BILLING_ORDER_FAILED` or `BILLING_ORDER_CANCELED`, and an order whose payment deadline has
455
- * passed with `BILLING_ORDER_EXPIRED`.
458
+ * passed with `BILLING_ORDER_EXPIRED`. A renewal invoice is refused with
459
+ * `BILLING_INVOICE_NOT_PAYABLE` while its subscription is being canceled, is being reclaimed or has
460
+ * ended, with `meta.reason` `subscription_canceling`, `subscription_reclaiming` or
461
+ * `subscription_ended` respectively.
456
462
  * @summary Pay together
457
463
  */
458
464
  export const PayTogetherBody = PayTogetherRequest;
@@ -911,7 +917,8 @@ export const ListCancellationsQueryParams = zod.strictObject({
911
917
  * - 409 `BILLING_CANCELLATION_SCHEDULES_DIFFER` when, for `period_end`, the paid terms end at
912
918
  * different times;
913
919
  * - 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being canceled
914
- * (`meta.cancellation_id`) or reclaimed (`meta.action_id`);
920
+ * (`meta.cancellation_id`) or reclaimed (`meta.reason` `reclaim_requested`), or has a paid
921
+ * change still waiting to switch (`meta.order_id`);
915
922
  * - 409 `BILLING_ORDER_PAYMENT_IN_FLIGHT` while an online payment for a renewal of one of them
916
923
  * is in progress;
917
924
  * - 409 `BILLING_CANCELLATION_REFUND_CHANGED` when the refund is no longer
@@ -50,4 +50,4 @@ export const PayInvoiceRequest = zod
50
50
  .optional()
51
51
  .describe("The invoice total to expect, after discounts and tax and before credit grants or balance, as the\npayment preview or an order quote gave it. A different total fails with BILLING_AMOUNT_CHANGED\nand nothing is charged. Omit to skip the comparison; an explicit zero is compared."),
52
52
  })
53
- .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.");
53
+ .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.\n\n`payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;\notherwise the request is refused with `BILLING_PURCHASE_INVALID`.");
@@ -17,4 +17,4 @@ export const QuoteCancellation = zod
17
17
  .describe("The subscriptions to end together, all of one service. Every subscription released with a resource must be included."),
18
18
  mode: TerminationPolicy,
19
19
  })
20
- .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.");
20
+ .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.\n\nRefused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being\ncanceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a\npaid change still waiting to switch (`meta.order_id`).");
@@ -16,6 +16,10 @@ export declare const RenewalOrderRequest: zod.ZodObject<{
16
16
  month: "month";
17
17
  year: "year";
18
18
  }>>;
19
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
20
+ immediate: "immediate";
21
+ period_end: "period_end";
22
+ }>>;
19
23
  }, zod.z.core.$strict>;
20
24
  export type RenewalOrderRequest = zod.input<typeof RenewalOrderRequest>;
21
25
  export type RenewalOrderRequestOutput = zod.output<typeof RenewalOrderRequest>;
@@ -6,6 +6,7 @@
6
6
  * OpenAPI spec version: v1
7
7
  */
8
8
  import * as zod from "zod";
9
+ import { TerminationPolicy } from "./terminationPolicy.zod.js";
9
10
  export const renewalOrderRequestPeriodsDefault = 1;
10
11
  export const RenewalOrderRequest = zod
11
12
  .strictObject({
@@ -19,5 +20,6 @@ export const RenewalOrderRequest = zod
19
20
  .describe("As in renewing."),
20
21
  interval_count: zod.int().min(1).optional().describe("As in renewing."),
21
22
  interval: zod.enum(["day", "month", "year"]).optional().describe("As in renewing."),
23
+ termination_policy: TerminationPolicy.optional().describe("As in renewing."),
22
24
  })
23
25
  .describe("The periods and price of the renewal, chosen as in renewing.");
@@ -44,7 +44,7 @@ export const Subscription = zod
44
44
  default_payment_method_id: zod
45
45
  .uuid()
46
46
  .nullish()
47
- .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, or a renewal, is paid with a saved\npayment method. It is used only while it belongs to the account that pays the renewal."),
47
+ .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, a renewal or a change is paid with a\nsaved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the\naccount that pays the renewal."),
48
48
  created_at: zod.iso.datetime({ offset: true }).optional(),
49
49
  id: zod.uuid(),
50
50
  billing_account_id: zod
@@ -955,6 +955,10 @@ export type QuoteA200529 = Quote5f60d00;
955
955
  /**
956
956
  * A cancellation to quote: what ending these subscriptions together would return. One mode per
957
957
  * request; to compare, quote `immediate` and `period_end` separately.
958
+ *
959
+ * Refused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being
960
+ * canceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a
961
+ * paid change still waiting to switch (`meta.order_id`).
958
962
  */
959
963
  export interface QuoteCancellation {
960
964
  /**
@@ -1603,6 +1607,9 @@ export interface PaymentMethodSetupResult {
1603
1607
  * through the selected gateway. Grants restricted to other purchases are not counted as available funds.
1604
1608
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
1605
1609
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
1610
+ *
1611
+ * `payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;
1612
+ * otherwise the request is refused with `BILLING_PURCHASE_INVALID`.
1606
1613
  */
1607
1614
  export interface PayInvoiceRequest {
1608
1615
  /**
@@ -2328,8 +2335,9 @@ export interface Subscription {
2328
2335
  cancellation?: SubscriptionCancellation;
2329
2336
  /**
2330
2337
  * The saved payment method automatic renewal charges after the account's balance and credits,
2331
- * before the account's default payment method. Set when the purchase, or a renewal, is paid with a saved
2332
- * payment method. It is used only while it belongs to the account that pays the renewal.
2338
+ * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
2339
+ * saved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the
2340
+ * account that pays the renewal.
2333
2341
  * @nullable
2334
2342
  */
2335
2343
  default_payment_method_id?: string | null;
@@ -2495,6 +2503,8 @@ export interface RenewalOrderRequest {
2495
2503
  interval_count?: number;
2496
2504
  /** As in renewing. */
2497
2505
  interval?: RenewalOrderRequestInterval;
2506
+ /** As in renewing. */
2507
+ termination_policy?: TerminationPolicy;
2498
2508
  }
2499
2509
  export interface AutoRenewSet {
2500
2510
  auto_renew: boolean;
@@ -73,4 +73,4 @@ export const PayInvoiceRequest = zod
73
73
  .optional()
74
74
  .describe("The invoice total to expect, after discounts and tax and before credit grants or balance, as the\npayment preview or an order quote gave it. A different total fails with BILLING_AMOUNT_CHANGED\nand nothing is charged. Omit to skip the comparison; an explicit zero is compared."),
75
75
  })
76
- .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.");
76
+ .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.\n\n`payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;\notherwise the request is refused with `BILLING_PURCHASE_INVALID`.");
@@ -40,4 +40,4 @@ export const QuoteCancellation = zod
40
40
  .describe("The subscriptions to end together, all of one service. Every subscription released with a resource must be included."),
41
41
  mode: TerminationPolicy,
42
42
  })
43
- .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.");
43
+ .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.\n\nRefused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being\ncanceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a\npaid change still waiting to switch (`meta.order_id`).");
@@ -39,6 +39,10 @@ export declare const RenewalOrderRequest: zod.ZodObject<{
39
39
  month: "month";
40
40
  year: "year";
41
41
  }>>;
42
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
43
+ immediate: "immediate";
44
+ period_end: "period_end";
45
+ }>>;
42
46
  }, zod.z.core.$strict>;
43
47
  export type RenewalOrderRequest = zod.input<typeof RenewalOrderRequest>;
44
48
  export type RenewalOrderRequestOutput = zod.output<typeof RenewalOrderRequest>;
@@ -29,6 +29,7 @@
29
29
  * OpenAPI spec version: 1.0.0
30
30
  */
31
31
  import * as zod from "zod";
32
+ import { TerminationPolicy } from "./terminationPolicy.zod.js";
32
33
  export const renewalOrderRequestPeriodsDefault = 1;
33
34
  export const RenewalOrderRequest = zod
34
35
  .strictObject({
@@ -42,5 +43,6 @@ export const RenewalOrderRequest = zod
42
43
  .describe("As in renewing."),
43
44
  interval_count: zod.int().min(1).optional().describe("As in renewing."),
44
45
  interval: zod.enum(["day", "month", "year"]).optional().describe("As in renewing."),
46
+ termination_policy: TerminationPolicy.optional().describe("As in renewing."),
45
47
  })
46
48
  .describe("The periods and price of the renewal, chosen as in renewing.");
@@ -67,7 +67,7 @@ export const Subscription = zod
67
67
  default_payment_method_id: zod
68
68
  .uuid()
69
69
  .nullish()
70
- .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, or a renewal, is paid with a saved\npayment method. It is used only while it belongs to the account that pays the renewal."),
70
+ .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, a renewal or a change is paid with a\nsaved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the\naccount that pays the renewal."),
71
71
  created_at: zod.iso.datetime({ offset: true }).optional(),
72
72
  id: zod.uuid(),
73
73
  billing_account_id: zod
@@ -2901,6 +2901,10 @@ export type QuoteA200529 = Quote5f60d00;
2901
2901
  /**
2902
2902
  * A cancellation to quote: what ending these subscriptions together would return. One mode per
2903
2903
  * request; to compare, quote `immediate` and `period_end` separately.
2904
+ *
2905
+ * Refused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being
2906
+ * canceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a
2907
+ * paid change still waiting to switch (`meta.order_id`).
2904
2908
  */
2905
2909
  export interface QuoteCancellation {
2906
2910
  /**
@@ -3549,6 +3553,9 @@ export interface PaymentMethodSetupResult {
3549
3553
  * through the selected gateway. Grants restricted to other purchases are not counted as available funds.
3550
3554
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
3551
3555
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
3556
+ *
3557
+ * `payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;
3558
+ * otherwise the request is refused with `BILLING_PURCHASE_INVALID`.
3552
3559
  */
3553
3560
  export interface PayInvoiceRequest {
3554
3561
  /**
@@ -4274,8 +4281,9 @@ export interface Subscription {
4274
4281
  cancellation?: SubscriptionCancellation;
4275
4282
  /**
4276
4283
  * The saved payment method automatic renewal charges after the account's balance and credits,
4277
- * before the account's default payment method. Set when the purchase, or a renewal, is paid with a saved
4278
- * payment method. It is used only while it belongs to the account that pays the renewal.
4284
+ * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
4285
+ * saved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the
4286
+ * account that pays the renewal.
4279
4287
  * @nullable
4280
4288
  */
4281
4289
  default_payment_method_id?: string | null;
@@ -4441,6 +4449,8 @@ export interface RenewalOrderRequest {
4441
4449
  interval_count?: number;
4442
4450
  /** As in renewing. */
4443
4451
  interval?: RenewalOrderRequestInterval;
4452
+ /** As in renewing. */
4453
+ termination_policy?: TerminationPolicyBfdab9f;
4444
4454
  }
4445
4455
  export interface AutoRenewSet {
4446
4456
  auto_renew: boolean;
@@ -66,4 +66,4 @@ export const PayInvoiceRequest = zod
66
66
  .optional()
67
67
  .describe("The invoice total to expect, after discounts and tax and before credit grants or balance, as the\npayment preview or an order quote gave it. A different total fails with BILLING_AMOUNT_CHANGED\nand nothing is charged. Omit to skip the comparison; an explicit zero is compared."),
68
68
  })
69
- .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.");
69
+ .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.\n\n`payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;\notherwise the request is refused with `BILLING_PURCHASE_INVALID`.");
@@ -33,4 +33,4 @@ export const QuoteCancellation = zod
33
33
  .describe("The subscriptions to end together, all of one service. Every subscription released with a resource must be included."),
34
34
  mode: TerminationPolicyBfdab9f,
35
35
  })
36
- .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.");
36
+ .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.\n\nRefused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being\ncanceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a\npaid change still waiting to switch (`meta.order_id`).");
@@ -32,6 +32,10 @@ export declare const RenewalOrderRequest: zod.ZodObject<{
32
32
  month: "month";
33
33
  year: "year";
34
34
  }>>;
35
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
36
+ immediate: "immediate";
37
+ period_end: "period_end";
38
+ }>>;
35
39
  }, zod.z.core.$strict>;
36
40
  export type RenewalOrderRequest = zod.input<typeof RenewalOrderRequest>;
37
41
  export type RenewalOrderRequestOutput = zod.output<typeof RenewalOrderRequest>;
@@ -22,6 +22,7 @@
22
22
  * OpenAPI spec version: 1.0.0
23
23
  */
24
24
  import * as zod from "zod";
25
+ import { TerminationPolicyBfdab9f } from "./terminationPolicyBfdab9f.zod.js";
25
26
  export const renewalOrderRequestPeriodsDefault = 1;
26
27
  export const RenewalOrderRequest = zod
27
28
  .strictObject({
@@ -35,5 +36,6 @@ export const RenewalOrderRequest = zod
35
36
  .describe("As in renewing."),
36
37
  interval_count: zod.int().min(1).optional().describe("As in renewing."),
37
38
  interval: zod.enum(["day", "month", "year"]).optional().describe("As in renewing."),
39
+ termination_policy: TerminationPolicyBfdab9f.optional().describe("As in renewing."),
38
40
  })
39
41
  .describe("The periods and price of the renewal, chosen as in renewing.");
@@ -60,7 +60,7 @@ export const Subscription = zod
60
60
  default_payment_method_id: zod
61
61
  .uuid()
62
62
  .nullish()
63
- .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, or a renewal, is paid with a saved\npayment method. It is used only while it belongs to the account that pays the renewal."),
63
+ .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, a renewal or a change is paid with a\nsaved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the\naccount that pays the renewal."),
64
64
  created_at: zod.iso.datetime({ offset: true }).optional(),
65
65
  id: zod.uuid(),
66
66
  billing_account_id: zod
@@ -796,6 +796,10 @@ export interface Quote {
796
796
  /**
797
797
  * A cancellation to quote: what ending these subscriptions together would return. One mode per
798
798
  * request; to compare, quote `immediate` and `period_end` separately.
799
+ *
800
+ * Refused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being
801
+ * canceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a
802
+ * paid change still waiting to switch (`meta.order_id`).
799
803
  */
800
804
  export interface QuoteCancellation {
801
805
  /**
@@ -1445,6 +1449,9 @@ export interface PaymentMethodSetupResult {
1445
1449
  * through the selected gateway. Grants restricted to other purchases are not counted as available funds.
1446
1450
  * An unresolved channel payment is reused; retries do not apply the grant or balance portions twice.
1447
1451
  * Without a gateway selection, insufficient account funds fail without starting an online payment.
1452
+ *
1453
+ * `payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;
1454
+ * otherwise the request is refused with `BILLING_PURCHASE_INVALID`.
1448
1455
  */
1449
1456
  export interface PayInvoiceRequest {
1450
1457
  /**
@@ -2170,8 +2177,9 @@ export interface Subscription {
2170
2177
  cancellation?: SubscriptionCancellation;
2171
2178
  /**
2172
2179
  * The saved payment method automatic renewal charges after the account's balance and credits,
2173
- * before the account's default payment method. Set when the purchase, or a renewal, is paid with a saved
2174
- * payment method. It is used only while it belongs to the account that pays the renewal.
2180
+ * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
2181
+ * saved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the
2182
+ * account that pays the renewal.
2175
2183
  * @nullable
2176
2184
  */
2177
2185
  default_payment_method_id?: string | null;
@@ -2337,6 +2345,8 @@ export interface RenewalOrderRequest {
2337
2345
  interval_count?: number;
2338
2346
  /** As in renewing. */
2339
2347
  interval?: RenewalOrderRequestInterval;
2348
+ /** As in renewing. */
2349
+ termination_policy?: TerminationPolicy;
2340
2350
  }
2341
2351
  export interface AutoRenewSet {
2342
2352
  auto_renew: boolean;
@@ -65,4 +65,4 @@ export const PayInvoiceRequest = zod
65
65
  .optional()
66
66
  .describe("The invoice total to expect, after discounts and tax and before credit grants or balance, as the\npayment preview or an order quote gave it. A different total fails with BILLING_AMOUNT_CHANGED\nand nothing is charged. Omit to skip the comparison; an explicit zero is compared."),
67
67
  })
68
- .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.");
68
+ .describe("Applies eligible credit grants and the available balance as requested, then collects only the remainder\nthrough the selected gateway. Grants restricted to other purchases are not counted as available funds.\nAn unresolved channel payment is reused; retries do not apply the grant or balance portions twice.\nWithout a gateway selection, insufficient account funds fail without starting an online payment.\n\n`payment_gateway` and `method_type` are given together, and `payment_method_id` only with both;\notherwise the request is refused with `BILLING_PURCHASE_INVALID`.");
@@ -32,4 +32,4 @@ export const QuoteCancellation = zod
32
32
  .describe("The subscriptions to end together, all of one service. Every subscription released with a resource must be included."),
33
33
  mode: TerminationPolicy,
34
34
  })
35
- .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.");
35
+ .describe("A cancellation to quote: what ending these subscriptions together would return. One mode per\nrequest; to compare, quote `immediate` and `period_end` separately.\n\nRefused with 409 `BILLING_SUBSCRIPTION_OPERATION_PENDING` when a subscription is already being\ncanceled (`meta.cancellation_id`), is being reclaimed (`meta.reason` `reclaim_requested`) or has a\npaid change still waiting to switch (`meta.order_id`).");
@@ -31,6 +31,10 @@ export declare const RenewalOrderRequest: zod.ZodObject<{
31
31
  month: "month";
32
32
  year: "year";
33
33
  }>>;
34
+ termination_policy: zod.ZodOptional<zod.ZodEnum<{
35
+ immediate: "immediate";
36
+ period_end: "period_end";
37
+ }>>;
34
38
  }, zod.z.core.$strict>;
35
39
  export type RenewalOrderRequest = zod.input<typeof RenewalOrderRequest>;
36
40
  export type RenewalOrderRequestOutput = zod.output<typeof RenewalOrderRequest>;
@@ -21,6 +21,7 @@
21
21
  * OpenAPI spec version: 1.0.0
22
22
  */
23
23
  import * as zod from "zod";
24
+ import { TerminationPolicy } from "./terminationPolicy.zod.js";
24
25
  export const renewalOrderRequestPeriodsDefault = 1;
25
26
  export const RenewalOrderRequest = zod
26
27
  .strictObject({
@@ -34,5 +35,6 @@ export const RenewalOrderRequest = zod
34
35
  .describe("As in renewing."),
35
36
  interval_count: zod.int().min(1).optional().describe("As in renewing."),
36
37
  interval: zod.enum(["day", "month", "year"]).optional().describe("As in renewing."),
38
+ termination_policy: TerminationPolicy.optional().describe("As in renewing."),
37
39
  })
38
40
  .describe("The periods and price of the renewal, chosen as in renewing.");
@@ -59,7 +59,7 @@ export const Subscription = zod
59
59
  default_payment_method_id: zod
60
60
  .uuid()
61
61
  .nullish()
62
- .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, or a renewal, is paid with a saved\npayment method. It is used only while it belongs to the account that pays the renewal."),
62
+ .describe("The saved payment method automatic renewal charges after the account's balance and credits,\nbefore the account's default payment method. Set when the purchase, a renewal or a change is paid with a\nsaved payment method; paying any other way leaves it unchanged. It is used only while it belongs to the\naccount that pays the renewal."),
63
63
  created_at: zod.iso.datetime({ offset: true }).optional(),
64
64
  id: zod.uuid(),
65
65
  billing_account_id: zod
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.122.0",
3
+ "version": "0.123.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {