@leaflow/sdk 0.111.0 → 0.112.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.
@@ -5,7 +5,7 @@
5
5
  * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
6
  * OpenAPI spec version: v1
7
7
  */
8
- import type { AccountBalance, ActiveResourceList, AllowanceList, AutoRenewSet, BillingAccount, BillingAccountCreate, BillingAccountList, BillingAccountUpdate, CancelSubscriptionRequest, Cancellation, CancellationCreate, CancellationList, CheckoutOrderRequest, CreditGrantList, CreditNote, CreditNoteItemList, CreditNoteList, CurrencyList, DiscountList, EntitlementList, Error, ErrorResponse, GetPlanHeaders, GetPriceHeaders, GetProductHeaders, Invoice, InvoiceItemList, InvoiceList, ListAccountDiscountsParams, ListActiveResourcesParams, ListAllowancesParams, ListBillingAccountsParams, ListCancellationsParams, ListCreditGrantsParams, ListCreditNoteItemsParams, ListCreditNotesParams, ListCurrenciesParams, ListEntitlementsParams, ListInvoiceItemsParams, ListInvoicesParams, ListOrderItemsParams, ListOrdersParams, ListPaymentMethodsParams, ListPaymentOptionsParams, ListPlansHeaders, ListPlansParams, ListPricesByPlanHeaders, ListPricesByPlanParams, ListPricesHeaders, ListPricesParams, ListProductsHeaders, ListProductsParams, ListProjectAssignmentsParams, ListRatesHeaders, ListRatesParams, ListRefundsParams, ListRenewalPricesParams, ListSpendParams, ListSubscriptionsParams, ListTopUpsParams, ListTransactionsParams, ListUsageChargesParams, MeteredUsage, NotModifiedResponse, Order, OrderCancel, OrderItemList, OrderList, PayInvoiceRequest, PayTogetherRequest, PaymentMethod, PaymentMethodList, PaymentMethodSetup, PaymentMethodSetupResult, PaymentOptionList, PaymentPreview, PaymentResult, Plan, PlanList, PreviewInvoicePaymentParams, Price, PriceList, Product, ProductID, ProductList, ProjectAssignment, ProjectAssignmentList, Quote, QuoteRequest, RateList, RefundList, RenewRequest, RenewalOrderRequest, RenewalPriceList, SetProjectAssignmentRequest, SpendRowList, Subscription, SubscriptionList, TerminateSubscriptionRequest, TopUp, TopUpCreate, TopUpList, TransactionList, UsageChargeList } from "./models.js";
8
+ import type { AccountBalance, ActiveResourceList, AllowanceList, AutoRenewSet, BillingAccount, BillingAccountCreate, BillingAccountList, BillingAccountUpdate, CancelSubscriptionRequest, Cancellation, CancellationCreate, CancellationList, CheckoutOrderRequest, CreditGrantList, CreditNote, CreditNoteItemList, CreditNoteList, CurrencyList, DiscountList, EntitlementList, Error, ErrorResponse, GetPlanHeaders, GetPriceHeaders, GetProductHeaders, Invoice, InvoiceItemList, InvoiceList, ListAccountDiscountsParams, ListActiveResourcesParams, ListAllowancesParams, ListBillingAccountsParams, ListCancellationsParams, ListCreditGrantsParams, ListCreditNoteItemsParams, ListCreditNotesParams, ListCurrenciesParams, ListEntitlementsParams, ListInvoiceItemsParams, ListInvoicesParams, ListOrderItemsParams, ListOrdersParams, ListPaymentMethodsParams, ListPaymentOptionsParams, ListPlansHeaders, ListPlansParams, ListPricesByPlanHeaders, ListPricesByPlanParams, ListPricesHeaders, ListPricesParams, ListProductsHeaders, ListProductsParams, ListProjectAssignmentsParams, ListRatesHeaders, ListRatesParams, ListRefundsParams, ListRenewalPricesParams, ListSpendParams, ListSubscriptionsParams, ListTopUpsParams, ListTransactionsParams, ListUsageChargesParams, MeteredUsage, NotModifiedResponse, Order, OrderCancel, OrderItemList, OrderList, PayInvoiceRequest, PayTogetherRequest, PaymentMethod, PaymentMethodList, PaymentMethodSetup, PaymentMethodSetupResult, PaymentOptionList, PaymentPreview, PaymentResult, Plan, PlanList, PreviewInvoicePaymentParams, Price, PriceList, Product, ProductID, ProductList, ProjectAssignment, ProjectAssignmentList, Quote, QuoteRequest, RateList, RefundList, RenewRequest, RenewalOrderRequest, RenewalPriceList, SetProjectAssignmentRequest, SpendRowList, Subscription, SubscriptionList, TopUp, TopUpCreate, TopUpList, TransactionList, UsageChargeList } from "./models.js";
9
9
  export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
10
10
  export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
11
11
  export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
@@ -855,6 +855,7 @@ export type listSubscriptionsResponseError = listSubscriptionsResponseDefault &
855
855
  export type listSubscriptionsResponse = listSubscriptionsResponseSuccess | listSubscriptionsResponseError;
856
856
  export declare const getListSubscriptionsUrl: (params?: ListSubscriptionsParams) => string;
857
857
  /**
858
+ * Lists subscriptions visible to the authorized billing account. Soft-deleted subscriptions are excluded.
858
859
  * @summary List subscriptions
859
860
  */
860
861
  export declare const listSubscriptions: (params?: ListSubscriptionsParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listSubscriptionsResponse>;
@@ -875,6 +876,7 @@ export type getSubscriptionResponseError = getSubscriptionResponseDefault & {
875
876
  export type getSubscriptionResponse = getSubscriptionResponseSuccess | getSubscriptionResponseError;
876
877
  export declare const getGetSubscriptionUrl: (subscriptionId: string) => string;
877
878
  /**
879
+ * Returns a subscription visible to the authorized billing account. Soft-deleted subscriptions are reported as not found.
878
880
  * @summary Get subscription
879
881
  */
880
882
  export declare const getSubscription: (subscriptionId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getSubscriptionResponse>;
@@ -895,12 +897,15 @@ export type deleteSubscriptionResponseError = deleteSubscriptionResponseDefault
895
897
  export type deleteSubscriptionResponse = deleteSubscriptionResponseSuccess | deleteSubscriptionResponseError;
896
898
  export declare const getDeleteSubscriptionUrl: (subscriptionId: string) => string;
897
899
  /**
898
- * Hides an already terminated subscription from your subscription list and detail. Your account
899
- * access token must authorize the subscription's current billing account. Billing and financial
900
- * history remain available. This operation cannot force termination, skip cleanup, or delete a
901
- * pending, provisioning, active or suspended subscription. Other states, including canceled, are
902
- * refused with 409 BILLING_SUBSCRIPTION_NOT_TERMINATED and status in error params. A canceled
903
- * subscription must first be converted to terminated. Sends no cleanup command and creates no refund.
900
+ * Sets deleted_at on a canceled or terminated subscription, hiding it from your subscription
901
+ * list and detail. Your account access token must authorize the subscription's current billing
902
+ * account. Preserves commercial status, ended_at and billing and financial history. Completed
903
+ * cancellations and canceled unfulfilled purchases can be deleted directly, without termination.
904
+ * Pending, provisioning, active and suspended subscriptions are refused with 409
905
+ * BILLING_SUBSCRIPTION_NOT_ENDED and status in error params. A scheduled or releasing cancellation
906
+ * does not make a subscription canceled.
907
+ * There is no force, skip-cleanup or override option. Repeating deletion preserves the original
908
+ * deleted_at. Sends no cleanup command and creates no refund; outstanding cleanup continues.
904
909
  * @summary Delete subscription
905
910
  */
906
911
  export declare const deleteSubscription: (subscriptionId: string, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<deleteSubscriptionResponse>;
@@ -937,37 +942,6 @@ export declare const getCancelSubscriptionUrl: (subscriptionId: string) => strin
937
942
  * @summary Cancel subscription
938
943
  */
939
944
  export declare const cancelSubscription: (subscriptionId: string, cancelSubscriptionRequest: CancelSubscriptionRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<cancelSubscriptionResponse>;
940
- export type terminateSubscriptionResponse200 = {
941
- data: Subscription;
942
- status: 200;
943
- };
944
- export type terminateSubscriptionResponseDefault = {
945
- data: ErrorResponse;
946
- status: Exclude<HTTPStatusCodes, 200>;
947
- };
948
- export type terminateSubscriptionResponseSuccess = terminateSubscriptionResponse200 & {
949
- headers: Headers;
950
- };
951
- export type terminateSubscriptionResponseError = terminateSubscriptionResponseDefault & {
952
- headers: Headers;
953
- };
954
- export type terminateSubscriptionResponse = terminateSubscriptionResponseSuccess | terminateSubscriptionResponseError;
955
- export declare const getTerminateSubscriptionUrl: (subscriptionId: string) => string;
956
- /**
957
- * Converts an already canceled subscription to terminated so it can subsequently be hidden.
958
- * Your account access token must authorize the subscription's current billing account. Preserves
959
- * the original billing end and financial history, sends no new cleanup command, and creates no
960
- * credit note or refund. A terminated subscription is returned unchanged on repeat; a deleted
961
- * subscription remains hidden from tenant reads.
962
- *
963
- * Account holders cannot force termination of pending, provisioning, active or suspended
964
- * subscriptions. These states are refused with 400 BILLING_SUBSCRIPTION_INVALID and status in
965
- * error params. Use cancellation under the agreed terms to end service. Immediate commercial
966
- * termination is reserved for administrators and the owning service. The audited reason does
967
- * not grant permission to terminate. No force, skip-cleanup or refund options are accepted.
968
- * @summary Terminate subscription
969
- */
970
- export declare const terminateSubscription: (subscriptionId: string, terminateSubscriptionRequest: TerminateSubscriptionRequest, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<terminateSubscriptionResponse>;
971
945
  export type createQuoteResponse200 = {
972
946
  data: Quote;
973
947
  status: 200;
@@ -938,6 +938,7 @@ export const getListSubscriptionsUrl = (params) => {
938
938
  : `https://billing.leaflow.cloud/api/v1/subscriptions`;
939
939
  };
940
940
  /**
941
+ * Lists subscriptions visible to the authorized billing account. Soft-deleted subscriptions are excluded.
941
942
  * @summary List subscriptions
942
943
  */
943
944
  export const listSubscriptions = async (params, options, fetchFn) => {
@@ -953,6 +954,7 @@ export const getGetSubscriptionUrl = (subscriptionId) => {
953
954
  return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}`;
954
955
  };
955
956
  /**
957
+ * Returns a subscription visible to the authorized billing account. Soft-deleted subscriptions are reported as not found.
956
958
  * @summary Get subscription
957
959
  */
958
960
  export const getSubscription = async (subscriptionId, options, fetchFn) => {
@@ -968,12 +970,15 @@ export const getDeleteSubscriptionUrl = (subscriptionId) => {
968
970
  return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}`;
969
971
  };
970
972
  /**
971
- * Hides an already terminated subscription from your subscription list and detail. Your account
972
- * access token must authorize the subscription's current billing account. Billing and financial
973
- * history remain available. This operation cannot force termination, skip cleanup, or delete a
974
- * pending, provisioning, active or suspended subscription. Other states, including canceled, are
975
- * refused with 409 BILLING_SUBSCRIPTION_NOT_TERMINATED and status in error params. A canceled
976
- * subscription must first be converted to terminated. Sends no cleanup command and creates no refund.
973
+ * Sets deleted_at on a canceled or terminated subscription, hiding it from your subscription
974
+ * list and detail. Your account access token must authorize the subscription's current billing
975
+ * account. Preserves commercial status, ended_at and billing and financial history. Completed
976
+ * cancellations and canceled unfulfilled purchases can be deleted directly, without termination.
977
+ * Pending, provisioning, active and suspended subscriptions are refused with 409
978
+ * BILLING_SUBSCRIPTION_NOT_ENDED and status in error params. A scheduled or releasing cancellation
979
+ * does not make a subscription canceled.
980
+ * There is no force, skip-cleanup or override option. Repeating deletion preserves the original
981
+ * deleted_at. Sends no cleanup command and creates no refund; outstanding cleanup continues.
977
982
  * @summary Delete subscription
978
983
  */
979
984
  export const deleteSubscription = async (subscriptionId, options, fetchFn) => {
@@ -1030,49 +1035,6 @@ export const cancelSubscription = async (subscriptionId, cancelSubscriptionReque
1030
1035
  const data = body ? JSON.parse(body) : {};
1031
1036
  return { data, status: res.status, headers: res.headers };
1032
1037
  };
1033
- export const getTerminateSubscriptionUrl = (subscriptionId) => {
1034
- return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}/terminate`;
1035
- };
1036
- /**
1037
- * Converts an already canceled subscription to terminated so it can subsequently be hidden.
1038
- * Your account access token must authorize the subscription's current billing account. Preserves
1039
- * the original billing end and financial history, sends no new cleanup command, and creates no
1040
- * credit note or refund. A terminated subscription is returned unchanged on repeat; a deleted
1041
- * subscription remains hidden from tenant reads.
1042
- *
1043
- * Account holders cannot force termination of pending, provisioning, active or suspended
1044
- * subscriptions. These states are refused with 400 BILLING_SUBSCRIPTION_INVALID and status in
1045
- * error params. Use cancellation under the agreed terms to end service. Immediate commercial
1046
- * termination is reserved for administrators and the owning service. The audited reason does
1047
- * not grant permission to terminate. No force, skip-cleanup or refund options are accepted.
1048
- * @summary Terminate subscription
1049
- */
1050
- export const terminateSubscription = async (subscriptionId, terminateSubscriptionRequest, options, fetchFn) => {
1051
- const getHeaders = (h) => {
1052
- if (!h)
1053
- return {};
1054
- if (h instanceof Headers)
1055
- return Object.fromEntries(h.entries());
1056
- if (Symbol.iterator in h) {
1057
- return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
1058
- }
1059
- const headers = {};
1060
- for (const [name, value] of Object.entries(h)) {
1061
- if (value !== undefined)
1062
- headers[name] = value;
1063
- }
1064
- return headers;
1065
- };
1066
- const res = await (fetchFn ?? fetch)(getTerminateSubscriptionUrl(subscriptionId), {
1067
- ...options,
1068
- method: "POST",
1069
- headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
1070
- body: JSON.stringify(terminateSubscriptionRequest),
1071
- });
1072
- const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1073
- const data = body ? JSON.parse(body) : {};
1074
- return { data, status: res.status, headers: res.headers };
1075
- };
1076
1038
  export const getCreateQuoteUrl = () => {
1077
1039
  return `https://billing.leaflow.cloud/api/v1/quotes`;
1078
1040
  };
@@ -1670,6 +1670,8 @@ export interface PaidWith {
1670
1670
  * pending means the purchase relationship exists but its order has not been accepted.
1671
1671
  * provisioning means the service accepted the order and is delivering. For a service-owned
1672
1672
  * purchase, only confirmed delivery moves it to active; paying alone does not.
1673
+ * canceled means cancellation completed, or an unfulfilled purchase was canceled or failed without delivery.
1674
+ * terminated means an administrator or the owning service immediately ended the commercial relationship.
1673
1675
  */
1674
1676
  export type SubscriptionStatus = (typeof SubscriptionStatus)[keyof typeof SubscriptionStatus];
1675
1677
  export declare const SubscriptionStatus: {
@@ -1679,7 +1681,6 @@ export declare const SubscriptionStatus: {
1679
1681
  readonly suspended: "suspended";
1680
1682
  readonly canceled: "canceled";
1681
1683
  readonly terminated: "terminated";
1682
- readonly deleted: "deleted";
1683
1684
  };
1684
1685
  /**
1685
1686
  * An independently billed purchase relationship, separate from the owning service's resource.
@@ -1695,8 +1696,8 @@ export declare const SubscriptionStatus: {
1695
1696
  *
1696
1697
  * One-time delivery may omit a subscription. Renewals reference and extend existing subscriptions
1697
1698
  * rather than creating another; a change keeps the subscription ID and switches its terms when it
1698
- * takes effect. Canceling or failing an
1699
- * unfulfilled purchase closes its pending or provisioning subscriptions without starting a service period.
1699
+ * takes effect. Canceling or failing an unfulfilled purchase sets its pending or provisioning
1700
+ * subscriptions to canceled without starting a service period.
1700
1701
  * Fixed renewals use the agreed recurring_amount and interval; already paid periods retain their
1701
1702
  * original value. Technical state belongs to the owning service.
1702
1703
  *
@@ -1769,6 +1770,8 @@ export interface Subscription {
1769
1770
  * pending means the purchase relationship exists but its order has not been accepted.
1770
1771
  * provisioning means the service accepted the order and is delivering. For a service-owned
1771
1772
  * purchase, only confirmed delivery moves it to active; paying alone does not.
1773
+ * canceled means cancellation completed, or an unfulfilled purchase was canceled or failed without delivery.
1774
+ * terminated means an administrator or the owning service immediately ended the commercial relationship.
1772
1775
  */
1773
1776
  status: SubscriptionStatus;
1774
1777
  /**
@@ -2647,13 +2650,6 @@ export interface CursorPagination {
2647
2650
  /** @nullable */
2648
2651
  next_cursor?: string | null;
2649
2652
  }
2650
- export interface TerminateSubscriptionRequest {
2651
- /**
2652
- * @minLength 8
2653
- * @maxLength 1024
2654
- */
2655
- reason: string;
2656
- }
2657
2653
  export interface CancelSubscriptionRequest {
2658
2654
  mode: TerminationPolicy;
2659
2655
  /** For immediate cancellation, the quoted whole-second refund basis. Now when omitted. */
@@ -205,7 +205,6 @@ export const SubscriptionStatus = {
205
205
  suspended: "suspended",
206
206
  canceled: "canceled",
207
207
  terminated: "terminated",
208
- deleted: "deleted",
209
208
  };
210
209
  export const RenewalPriceInterval = {
211
210
  day: "day",
@@ -507,6 +507,7 @@ export declare const ListUsageChargesQueryParams: zod.ZodObject<{
507
507
  meter_id: zod.ZodOptional<zod.ZodUUID>;
508
508
  }, zod.z.core.$strict>;
509
509
  /**
510
+ * Lists subscriptions visible to the authorized billing account. Soft-deleted subscriptions are excluded.
510
511
  * @summary List subscriptions
511
512
  */
512
513
  export declare const listSubscriptionsQueryPageDefault = 1;
@@ -522,18 +523,22 @@ export declare const ListSubscriptionsQueryParams: zod.ZodObject<{
522
523
  project_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
523
524
  }, zod.z.core.$strict>;
524
525
  /**
526
+ * Returns a subscription visible to the authorized billing account. Soft-deleted subscriptions are reported as not found.
525
527
  * @summary Get subscription
526
528
  */
527
529
  export declare const GetSubscriptionParams: zod.ZodObject<{
528
530
  subscriptionId: zod.ZodUUID;
529
531
  }, zod.z.core.$strict>;
530
532
  /**
531
- * Hides an already terminated subscription from your subscription list and detail. Your account
532
- * access token must authorize the subscription's current billing account. Billing and financial
533
- * history remain available. This operation cannot force termination, skip cleanup, or delete a
534
- * pending, provisioning, active or suspended subscription. Other states, including canceled, are
535
- * refused with 409 BILLING_SUBSCRIPTION_NOT_TERMINATED and status in error params. A canceled
536
- * subscription must first be converted to terminated. Sends no cleanup command and creates no refund.
533
+ * Sets deleted_at on a canceled or terminated subscription, hiding it from your subscription
534
+ * list and detail. Your account access token must authorize the subscription's current billing
535
+ * account. Preserves commercial status, ended_at and billing and financial history. Completed
536
+ * cancellations and canceled unfulfilled purchases can be deleted directly, without termination.
537
+ * Pending, provisioning, active and suspended subscriptions are refused with 409
538
+ * BILLING_SUBSCRIPTION_NOT_ENDED and status in error params. A scheduled or releasing cancellation
539
+ * does not make a subscription canceled.
540
+ * There is no force, skip-cleanup or override option. Repeating deletion preserves the original
541
+ * deleted_at. Sends no cleanup command and creates no refund; outstanding cleanup continues.
537
542
  * @summary Delete subscription
538
543
  */
539
544
  export declare const DeleteSubscriptionParams: zod.ZodObject<{
@@ -567,26 +572,6 @@ export declare const CancelSubscriptionBody: zod.ZodObject<{
567
572
  expected_refundable_amount: zod.ZodIntersection<zod.ZodString, zod.ZodString>;
568
573
  reason: zod.ZodOptional<zod.ZodString>;
569
574
  }, zod.z.core.$strict>;
570
- /**
571
- * Converts an already canceled subscription to terminated so it can subsequently be hidden.
572
- * Your account access token must authorize the subscription's current billing account. Preserves
573
- * the original billing end and financial history, sends no new cleanup command, and creates no
574
- * credit note or refund. A terminated subscription is returned unchanged on repeat; a deleted
575
- * subscription remains hidden from tenant reads.
576
- *
577
- * Account holders cannot force termination of pending, provisioning, active or suspended
578
- * subscriptions. These states are refused with 400 BILLING_SUBSCRIPTION_INVALID and status in
579
- * error params. Use cancellation under the agreed terms to end service. Immediate commercial
580
- * termination is reserved for administrators and the owning service. The audited reason does
581
- * not grant permission to terminate. No force, skip-cleanup or refund options are accepted.
582
- * @summary Terminate subscription
583
- */
584
- export declare const TerminateSubscriptionParams: zod.ZodObject<{
585
- subscriptionId: zod.ZodUUID;
586
- }, zod.z.core.$strict>;
587
- export declare const TerminateSubscriptionBody: zod.ZodObject<{
588
- reason: zod.ZodString;
589
- }, zod.z.core.$strict>;
590
575
  /**
591
576
  * Calculates exactly one target for a billing account you own: proposed items, existing order checkout, renewals, cancellation or order refund. Returns all requested calculations or a structured error. No quote is saved and no resource, payment, reservation or redemption is created.
592
577
  *
@@ -20,7 +20,6 @@ import { QuoteRequest } from "./validators/quoteRequest.zod.js";
20
20
  import { RenewRequest } from "./validators/renewRequest.zod.js";
21
21
  import { RenewalOrderRequest } from "./validators/renewalOrderRequest.zod.js";
22
22
  import { SetProjectAssignmentRequest } from "./validators/setProjectAssignmentRequest.zod.js";
23
- import { TerminateSubscriptionRequest } from "./validators/terminateSubscriptionRequest.zod.js";
24
23
  import { TopUpCreate } from "./validators/topUpCreate.zod.js";
25
24
  /**
26
25
  * The currencies a new billing account can be opened in. A retired currency is not listed,
@@ -677,6 +676,7 @@ export const ListUsageChargesQueryParams = zod.strictObject({
677
676
  meter_id: zod.uuid().optional(),
678
677
  });
679
678
  /**
679
+ * Lists subscriptions visible to the authorized billing account. Soft-deleted subscriptions are excluded.
680
680
  * @summary List subscriptions
681
681
  */
682
682
  export const listSubscriptionsQueryPageDefault = 1;
@@ -710,18 +710,22 @@ export const ListSubscriptionsQueryParams = zod.strictObject({
710
710
  .describe("Restrict the account-authorized results to these projects. Omit for all projects and account-level records. This filter does not grant access to another billing account."),
711
711
  });
712
712
  /**
713
+ * Returns a subscription visible to the authorized billing account. Soft-deleted subscriptions are reported as not found.
713
714
  * @summary Get subscription
714
715
  */
715
716
  export const GetSubscriptionParams = zod.strictObject({
716
717
  subscriptionId: zod.uuid(),
717
718
  });
718
719
  /**
719
- * Hides an already terminated subscription from your subscription list and detail. Your account
720
- * access token must authorize the subscription's current billing account. Billing and financial
721
- * history remain available. This operation cannot force termination, skip cleanup, or delete a
722
- * pending, provisioning, active or suspended subscription. Other states, including canceled, are
723
- * refused with 409 BILLING_SUBSCRIPTION_NOT_TERMINATED and status in error params. A canceled
724
- * subscription must first be converted to terminated. Sends no cleanup command and creates no refund.
720
+ * Sets deleted_at on a canceled or terminated subscription, hiding it from your subscription
721
+ * list and detail. Your account access token must authorize the subscription's current billing
722
+ * account. Preserves commercial status, ended_at and billing and financial history. Completed
723
+ * cancellations and canceled unfulfilled purchases can be deleted directly, without termination.
724
+ * Pending, provisioning, active and suspended subscriptions are refused with 409
725
+ * BILLING_SUBSCRIPTION_NOT_ENDED and status in error params. A scheduled or releasing cancellation
726
+ * does not make a subscription canceled.
727
+ * There is no force, skip-cleanup or override option. Repeating deletion preserves the original
728
+ * deleted_at. Sends no cleanup command and creates no refund; outstanding cleanup continues.
725
729
  * @summary Delete subscription
726
730
  */
727
731
  export const DeleteSubscriptionParams = zod.strictObject({
@@ -747,24 +751,6 @@ export const CancelSubscriptionParams = zod.strictObject({
747
751
  subscriptionId: zod.uuid(),
748
752
  });
749
753
  export const CancelSubscriptionBody = CancelSubscriptionRequest;
750
- /**
751
- * Converts an already canceled subscription to terminated so it can subsequently be hidden.
752
- * Your account access token must authorize the subscription's current billing account. Preserves
753
- * the original billing end and financial history, sends no new cleanup command, and creates no
754
- * credit note or refund. A terminated subscription is returned unchanged on repeat; a deleted
755
- * subscription remains hidden from tenant reads.
756
- *
757
- * Account holders cannot force termination of pending, provisioning, active or suspended
758
- * subscriptions. These states are refused with 400 BILLING_SUBSCRIPTION_INVALID and status in
759
- * error params. Use cancellation under the agreed terms to end service. Immediate commercial
760
- * termination is reserved for administrators and the owning service. The audited reason does
761
- * not grant permission to terminate. No force, skip-cleanup or refund options are accepted.
762
- * @summary Terminate subscription
763
- */
764
- export const TerminateSubscriptionParams = zod.strictObject({
765
- subscriptionId: zod.uuid(),
766
- });
767
- export const TerminateSubscriptionBody = TerminateSubscriptionRequest;
768
754
  /**
769
755
  * Calculates exactly one target for a billing account you own: proposed items, existing order checkout, renewals, cancellation or order refund. Returns all requested calculations or a structured error. No quote is saved and no resource, payment, reservation or redemption is created.
770
756
  *
@@ -104,7 +104,6 @@ export declare const Subscription: zod.ZodObject<{
104
104
  pending: "pending";
105
105
  active: "active";
106
106
  suspended: "suspended";
107
- deleted: "deleted";
108
107
  canceled: "canceled";
109
108
  provisioning: "provisioning";
110
109
  terminated: "terminated";
@@ -69,12 +69,12 @@ export const Subscription = zod
69
69
  .describe("End of the prepaid service already activated. Null until a new subscription becomes active,\neven when its purchase has been paid, and for postpaid subscriptions with no prepaid end date."),
70
70
  auto_renew: zod.boolean(),
71
71
  status: zod
72
- .enum(["pending", "provisioning", "active", "suspended", "canceled", "terminated", "deleted"])
73
- .describe("pending means the purchase relationship exists but its order has not been accepted.\nprovisioning means the service accepted the order and is delivering. For a service-owned\npurchase, only confirmed delivery moves it to active; paying alone does not."),
72
+ .enum(["pending", "provisioning", "active", "suspended", "canceled", "terminated"])
73
+ .describe("pending means the purchase relationship exists but its order has not been accepted.\nprovisioning means the service accepted the order and is delivering. For a service-owned\npurchase, only confirmed delivery moves it to active; paying alone does not.\ncanceled means cancellation completed, or an unfulfilled purchase was canceled or failed without delivery.\nterminated means an administrator or the owning service immediately ended the commercial relationship."),
74
74
  started_at: zod.iso
75
75
  .datetime({ offset: true })
76
76
  .nullish()
77
77
  .describe("Confirmed start of service. Null until a new subscription becomes active, including after payment."),
78
78
  ended_at: zod.iso.datetime({ offset: true }).nullish(),
79
79
  })
80
- .describe("An independently billed purchase relationship, separate from the owning service's resource.\nPlacing a new prepaid or postpaid service order creates a pending subscription for each line\nin the same purchase transaction. Its ID is returned on the order item and remains stable\nthrough checkout and delivery. One order may create several subscriptions, such as an instance,\nits system disk and its address; it has no single subscription ID.\n\nPending and provisioning do not grant service or accrue usage. A service-owned subscription\nbecomes provisioning when the owning service accepts the order, and active when the service\nconfirms delivery, with started_at set to the confirmed effective time; payment changes neither. Prepaid service periods start\nthen; postpaid usage starts only when the service reports actual delivery and metering.\n\nOne-time delivery may omit a subscription. Renewals reference and extend existing subscriptions\nrather than creating another; a change keeps the subscription ID and switches its terms when it\ntakes effect. Canceling or failing an\nunfulfilled purchase closes its pending or provisioning subscriptions without starting a service period.\nFixed renewals use the agreed recurring_amount and interval; already paid periods retain their\noriginal value. Technical state belongs to the owning service.\n\nA purchased shared capacity limit, such as a regional snapshot count quota, can have its own\nsubscription. Activating that capacity confirms delivery of the quota, not individual snapshots.\nCreating or deleting snapshots within it does not create, activate or terminate more subscriptions;\nthe owning service enforces current holdings against the purchased count.");
80
+ .describe("An independently billed purchase relationship, separate from the owning service's resource.\nPlacing a new prepaid or postpaid service order creates a pending subscription for each line\nin the same purchase transaction. Its ID is returned on the order item and remains stable\nthrough checkout and delivery. One order may create several subscriptions, such as an instance,\nits system disk and its address; it has no single subscription ID.\n\nPending and provisioning do not grant service or accrue usage. A service-owned subscription\nbecomes provisioning when the owning service accepts the order, and active when the service\nconfirms delivery, with started_at set to the confirmed effective time; payment changes neither. Prepaid service periods start\nthen; postpaid usage starts only when the service reports actual delivery and metering.\n\nOne-time delivery may omit a subscription. Renewals reference and extend existing subscriptions\nrather than creating another; a change keeps the subscription ID and switches its terms when it\ntakes effect. Canceling or failing an unfulfilled purchase sets its pending or provisioning\nsubscriptions to canceled without starting a service period.\nFixed renewals use the agreed recurring_amount and interval; already paid periods retain their\noriginal value. Technical state belongs to the owning service.\n\nA purchased shared capacity limit, such as a regional snapshot count quota, can have its own\nsubscription. Activating that capacity confirms delivery of the quota, not individual snapshots.\nCreating or deleting snapshots within it does not create, activate or terminate more subscriptions;\nthe owning service enforces current holdings against the purchased count.");
@@ -104,7 +104,6 @@ export declare const SubscriptionList: zod.ZodObject<{
104
104
  pending: "pending";
105
105
  active: "active";
106
106
  suspended: "suspended";
107
- deleted: "deleted";
108
107
  canceled: "canceled";
109
108
  provisioning: "provisioning";
110
109
  terminated: "terminated";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.111.0",
3
+ "version": "0.112.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,15 +0,0 @@
1
- /**
2
- * Generated by orval 🍺
3
- * Do not edit manually.
4
- * Leaflow Billing API
5
- * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
- * OpenAPI spec version: v1
7
- */
8
- import * as zod from "zod";
9
- export declare const terminateSubscriptionRequestReasonMin = 8;
10
- export declare const terminateSubscriptionRequestReasonMax = 1024;
11
- export declare const TerminateSubscriptionRequest: zod.ZodObject<{
12
- reason: zod.ZodString;
13
- }, zod.z.core.$strict>;
14
- export type TerminateSubscriptionRequest = zod.input<typeof TerminateSubscriptionRequest>;
15
- export type TerminateSubscriptionRequestOutput = zod.output<typeof TerminateSubscriptionRequest>;
@@ -1,16 +0,0 @@
1
- /**
2
- * Generated by orval 🍺
3
- * Do not edit manually.
4
- * Leaflow Billing API
5
- * Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
6
- * OpenAPI spec version: v1
7
- */
8
- import * as zod from "zod";
9
- export const terminateSubscriptionRequestReasonMin = 8;
10
- export const terminateSubscriptionRequestReasonMax = 1024;
11
- export const TerminateSubscriptionRequest = zod.strictObject({
12
- reason: zod
13
- .string()
14
- .min(terminateSubscriptionRequestReasonMin)
15
- .max(terminateSubscriptionRequestReasonMax),
16
- });