@leaflow/sdk 0.137.0 → 0.139.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 (37) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +13 -1
  2. package/dist/billing/type/order/v1/generated/models.js +7 -0
  3. package/dist/billing/type/order/v1/generated/validators/subscription.zod.d.ts +7 -1
  4. package/dist/billing/type/order/v1/generated/validators/subscription.zod.js +5 -1
  5. package/dist/billing/type/order/v1/generated/validators/subscriptionList.zod.d.ts +7 -1
  6. package/dist/billing/type/order/v1/generated/validators/subscriptionRestriction.zod.d.ts +17 -0
  7. package/dist/billing/type/order/v1/generated/validators/subscriptionRestriction.zod.js +17 -0
  8. package/dist/billing/type/quote/v1/generated/models.d.ts +0 -8
  9. package/dist/billing/type/quote/v1/generated/validators/quote.zod.d.ts +0 -1
  10. package/dist/billing/type/quote/v1/generated/validators/quote.zod.js +0 -3
  11. package/dist/billing/v1/generated/models.d.ts +13 -1
  12. package/dist/billing/v1/generated/models.js +7 -0
  13. package/dist/billing/v1/generated/validators/subscription.zod.d.ts +7 -1
  14. package/dist/billing/v1/generated/validators/subscription.zod.js +5 -1
  15. package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +7 -1
  16. package/dist/billing/v1/generated/validators/subscriptionRestriction.zod.d.ts +17 -0
  17. package/dist/billing/v1/generated/validators/subscriptionRestriction.zod.js +17 -0
  18. package/dist/canopy/v1/generated/models.d.ts +13 -9
  19. package/dist/canopy/v1/generated/models.js +7 -0
  20. package/dist/canopy/v1/generated/validators/quote.zod.d.ts +0 -1
  21. package/dist/canopy/v1/generated/validators/quote.zod.js +0 -3
  22. package/dist/canopy/v1/generated/validators/subscription.zod.d.ts +7 -1
  23. package/dist/canopy/v1/generated/validators/subscription.zod.js +5 -1
  24. package/dist/canopy/v1/generated/validators/subscriptionList.zod.d.ts +7 -1
  25. package/dist/canopy/v1/generated/validators/subscriptionRestriction.zod.d.ts +40 -0
  26. package/dist/canopy/v1/generated/validators/subscriptionRestriction.zod.js +40 -0
  27. package/dist/compute/v1/generated/models.d.ts +0 -8
  28. package/dist/compute/v1/generated/validators/quote.zod.d.ts +0 -1
  29. package/dist/compute/v1/generated/validators/quote.zod.js +0 -3
  30. package/dist/membership/v1/generated/models.d.ts +13 -1
  31. package/dist/membership/v1/generated/models.js +7 -0
  32. package/dist/membership/v1/generated/validators/subscription.zod.d.ts +7 -1
  33. package/dist/membership/v1/generated/validators/subscription.zod.js +5 -1
  34. package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +7 -1
  35. package/dist/membership/v1/generated/validators/subscriptionRestriction.zod.d.ts +17 -0
  36. package/dist/membership/v1/generated/validators/subscriptionRestriction.zod.js +17 -0
  37. package/package.json +1 -1
@@ -1898,6 +1898,17 @@ export declare const SubscriptionInterval: {
1898
1898
  readonly month: "month";
1899
1899
  readonly year: "year";
1900
1900
  };
1901
+ /**
1902
+ * An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.
1903
+ */
1904
+ export type SubscriptionRestriction = (typeof SubscriptionRestriction)[keyof typeof SubscriptionRestriction];
1905
+ export declare const SubscriptionRestriction: {
1906
+ readonly billingsubscriptionsuse: "billing.subscriptions.use";
1907
+ readonly billingsubscriptionsrenew: "billing.subscriptions.renew";
1908
+ readonly billingsubscriptionsmodify: "billing.subscriptions.modify";
1909
+ readonly billingsubscriptionscancel: "billing.subscriptions.cancel";
1910
+ readonly billingsubscriptionsterminate: "billing.subscriptions.terminate";
1911
+ };
1901
1912
  /**
1902
1913
  * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
1903
1914
  * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
@@ -2000,7 +2011,8 @@ export interface Subscription {
2000
2011
  coupon?: ObjectIdentity;
2001
2012
  /** @minimum 0 */
2002
2013
  discounted_renewals_remaining?: number;
2003
- suspend_reason?: string;
2014
+ /** The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use. */
2015
+ restrictions?: SubscriptionRestriction[];
2004
2016
  billing_cycle_anchor?: string;
2005
2017
  cancellation?: SubscriptionCancellation;
2006
2018
  /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
@@ -220,6 +220,13 @@ export const SubscriptionInterval = {
220
220
  month: "month",
221
221
  year: "year",
222
222
  };
223
+ export const SubscriptionRestriction = {
224
+ billingsubscriptionsuse: "billing.subscriptions.use",
225
+ billingsubscriptionsrenew: "billing.subscriptions.renew",
226
+ billingsubscriptionsmodify: "billing.subscriptions.modify",
227
+ billingsubscriptionscancel: "billing.subscriptions.cancel",
228
+ billingsubscriptionsterminate: "billing.subscriptions.terminate",
229
+ };
223
230
  export const OrderStatus = {
224
231
  pending: "pending",
225
232
  accepted: "accepted",
@@ -38,7 +38,13 @@ export declare const Subscription: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -14,6 +14,7 @@ import { ProductID } from "./productID.zod.js";
14
14
  import { RefundPolicy } from "./refundPolicy.zod.js";
15
15
  import { ScheduledChange } from "./scheduledChange.zod.js";
16
16
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
17
+ import { SubscriptionRestriction } from "./subscriptionRestriction.zod.js";
17
18
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
18
19
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
19
20
  export const Subscription = zod
@@ -35,7 +36,10 @@ export const Subscription = zod
35
36
  .int()
36
37
  .min(subscriptionDiscountedRenewalsRemainingMin)
37
38
  .optional(),
38
- suspend_reason: zod.string().optional(),
39
+ restrictions: zod
40
+ .array(SubscriptionRestriction)
41
+ .optional()
42
+ .describe("The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use."),
39
43
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
40
44
  cancellation: SubscriptionCancellation.optional(),
41
45
  scheduled_change: zod
@@ -38,7 +38,13 @@ export declare const SubscriptionList: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Billing Order Types
5
+ * The Billing order a product purchase placed. Types only; this document declares no operations.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const SubscriptionRestriction: zod.ZodEnum<{
10
+ "billing.subscriptions.use": "billing.subscriptions.use";
11
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
12
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
13
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
14
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
15
+ }>;
16
+ export type SubscriptionRestriction = zod.input<typeof SubscriptionRestriction>;
17
+ export type SubscriptionRestrictionOutput = zod.output<typeof SubscriptionRestriction>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Billing Order Types
5
+ * The Billing order a product purchase placed. Types only; this document declares no operations.
6
+ * OpenAPI spec version: v1
7
+ */
8
+ import * as zod from "zod";
9
+ export const SubscriptionRestriction = zod
10
+ .enum([
11
+ "billing.subscriptions.use",
12
+ "billing.subscriptions.renew",
13
+ "billing.subscriptions.modify",
14
+ "billing.subscriptions.cancel",
15
+ "billing.subscriptions.terminate",
16
+ ])
17
+ .describe("An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.");
@@ -82,14 +82,6 @@ export interface QuoteItem {
82
82
  */
83
83
  export interface Quote {
84
84
  funds: Funds;
85
- /**
86
- * Whether the account's current balance and eligible credits cover immediate charges
87
- * and the currency's minimum top-up for every new postpaid item. False preserves this
88
- * complete price preview. Nothing is reserved; checkout rechecks funds. Prepaid
89
- * purchases may also use an online payment method.
90
- * @deprecated
91
- */
92
- funds_sufficient: boolean;
93
85
  /** One line for each item the purchase would order, in the order it would order them. */
94
86
  items: QuoteItem[];
95
87
  /**
@@ -15,7 +15,6 @@ export declare const Quote: zod.ZodObject<{
15
15
  balance_shortfall_amount: zod.ZodString;
16
16
  required_top_up_amount: zod.ZodString;
17
17
  }, zod.z.core.$strict>;
18
- funds_sufficient: zod.ZodBoolean;
19
18
  items: zod.ZodArray<zod.ZodObject<{
20
19
  plan_name: zod.ZodString;
21
20
  unit_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -12,9 +12,6 @@ import { QuoteItem } from "./quoteItem.zod.js";
12
12
  export const Quote = zod
13
13
  .strictObject({
14
14
  funds: Funds,
15
- funds_sufficient: zod
16
- .boolean()
17
- .describe("Whether the account's current balance and eligible credits cover immediate charges\nand the currency's minimum top-up for every new postpaid item. False preserves this\ncomplete price preview. Nothing is reserved; checkout rechecks funds. Prepaid\npurchases may also use an online payment method."),
18
15
  items: zod
19
16
  .array(QuoteItem)
20
17
  .describe("One line for each item the purchase would order, in the order it would order them."),
@@ -1684,6 +1684,17 @@ export declare const SubscriptionInterval: {
1684
1684
  readonly month: "month";
1685
1685
  readonly year: "year";
1686
1686
  };
1687
+ /**
1688
+ * An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.
1689
+ */
1690
+ export type SubscriptionRestriction = (typeof SubscriptionRestriction)[keyof typeof SubscriptionRestriction];
1691
+ export declare const SubscriptionRestriction: {
1692
+ readonly billingsubscriptionsuse: "billing.subscriptions.use";
1693
+ readonly billingsubscriptionsrenew: "billing.subscriptions.renew";
1694
+ readonly billingsubscriptionsmodify: "billing.subscriptions.modify";
1695
+ readonly billingsubscriptionscancel: "billing.subscriptions.cancel";
1696
+ readonly billingsubscriptionsterminate: "billing.subscriptions.terminate";
1697
+ };
1687
1698
  /**
1688
1699
  * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
1689
1700
  * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
@@ -1786,7 +1797,8 @@ export interface Subscription {
1786
1797
  coupon?: ObjectIdentity;
1787
1798
  /** @minimum 0 */
1788
1799
  discounted_renewals_remaining?: number;
1789
- suspend_reason?: string;
1800
+ /** The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use. */
1801
+ restrictions?: SubscriptionRestriction[];
1790
1802
  billing_cycle_anchor?: string;
1791
1803
  cancellation?: SubscriptionCancellation;
1792
1804
  /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
@@ -206,6 +206,13 @@ export const SubscriptionInterval = {
206
206
  month: "month",
207
207
  year: "year",
208
208
  };
209
+ export const SubscriptionRestriction = {
210
+ billingsubscriptionsuse: "billing.subscriptions.use",
211
+ billingsubscriptionsrenew: "billing.subscriptions.renew",
212
+ billingsubscriptionsmodify: "billing.subscriptions.modify",
213
+ billingsubscriptionscancel: "billing.subscriptions.cancel",
214
+ billingsubscriptionsterminate: "billing.subscriptions.terminate",
215
+ };
209
216
  export const OrderStatus = {
210
217
  pending: "pending",
211
218
  accepted: "accepted",
@@ -38,7 +38,13 @@ export declare const Subscription: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -14,6 +14,7 @@ import { ProductID } from "./productID.zod.js";
14
14
  import { RefundPolicy } from "./refundPolicy.zod.js";
15
15
  import { ScheduledChange } from "./scheduledChange.zod.js";
16
16
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
17
+ import { SubscriptionRestriction } from "./subscriptionRestriction.zod.js";
17
18
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
18
19
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
19
20
  export const Subscription = zod
@@ -35,7 +36,10 @@ export const Subscription = zod
35
36
  .int()
36
37
  .min(subscriptionDiscountedRenewalsRemainingMin)
37
38
  .optional(),
38
- suspend_reason: zod.string().optional(),
39
+ restrictions: zod
40
+ .array(SubscriptionRestriction)
41
+ .optional()
42
+ .describe("The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use."),
39
43
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
40
44
  cancellation: SubscriptionCancellation.optional(),
41
45
  scheduled_change: zod
@@ -38,7 +38,13 @@ export declare const SubscriptionList: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -0,0 +1,17 @@
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 SubscriptionRestriction: zod.ZodEnum<{
10
+ "billing.subscriptions.use": "billing.subscriptions.use";
11
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
12
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
13
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
14
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
15
+ }>;
16
+ export type SubscriptionRestriction = zod.input<typeof SubscriptionRestriction>;
17
+ export type SubscriptionRestrictionOutput = zod.output<typeof SubscriptionRestriction>;
@@ -0,0 +1,17 @@
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 SubscriptionRestriction = zod
10
+ .enum([
11
+ "billing.subscriptions.use",
12
+ "billing.subscriptions.renew",
13
+ "billing.subscriptions.modify",
14
+ "billing.subscriptions.cancel",
15
+ "billing.subscriptions.terminate",
16
+ ])
17
+ .describe("An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.");
@@ -556,14 +556,6 @@ export interface QuoteItemDc1fddb {
556
556
  */
557
557
  export interface Quote {
558
558
  funds: Funds;
559
- /**
560
- * Whether the account's current balance and eligible credits cover immediate charges
561
- * and the currency's minimum top-up for every new postpaid item. False preserves this
562
- * complete price preview. Nothing is reserved; checkout rechecks funds. Prepaid
563
- * purchases may also use an online payment method.
564
- * @deprecated
565
- */
566
- funds_sufficient: boolean;
567
559
  /** One line for each item the purchase would order, in the order it would order them. */
568
560
  items: QuoteItemDc1fddb[];
569
561
  /**
@@ -2379,6 +2371,17 @@ export declare const SubscriptionInterval: {
2379
2371
  readonly month: "month";
2380
2372
  readonly year: "year";
2381
2373
  };
2374
+ /**
2375
+ * An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.
2376
+ */
2377
+ export type SubscriptionRestriction = (typeof SubscriptionRestriction)[keyof typeof SubscriptionRestriction];
2378
+ export declare const SubscriptionRestriction: {
2379
+ readonly billingsubscriptionsuse: "billing.subscriptions.use";
2380
+ readonly billingsubscriptionsrenew: "billing.subscriptions.renew";
2381
+ readonly billingsubscriptionsmodify: "billing.subscriptions.modify";
2382
+ readonly billingsubscriptionscancel: "billing.subscriptions.cancel";
2383
+ readonly billingsubscriptionsterminate: "billing.subscriptions.terminate";
2384
+ };
2382
2385
  /**
2383
2386
  * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2384
2387
  * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
@@ -2481,7 +2484,8 @@ export interface Subscription {
2481
2484
  coupon?: ObjectIdentity;
2482
2485
  /** @minimum 0 */
2483
2486
  discounted_renewals_remaining?: number;
2484
- suspend_reason?: string;
2487
+ /** The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use. */
2488
+ restrictions?: SubscriptionRestriction[];
2485
2489
  billing_cycle_anchor?: string;
2486
2490
  cancellation?: SubscriptionCancellation;
2487
2491
  /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
@@ -269,6 +269,13 @@ export const SubscriptionInterval = {
269
269
  month: "month",
270
270
  year: "year",
271
271
  };
272
+ export const SubscriptionRestriction = {
273
+ billingsubscriptionsuse: "billing.subscriptions.use",
274
+ billingsubscriptionsrenew: "billing.subscriptions.renew",
275
+ billingsubscriptionsmodify: "billing.subscriptions.modify",
276
+ billingsubscriptionscancel: "billing.subscriptions.cancel",
277
+ billingsubscriptionsterminate: "billing.subscriptions.terminate",
278
+ };
272
279
  export const OrderStatus = {
273
280
  pending: "pending",
274
281
  accepted: "accepted",
@@ -38,7 +38,6 @@ export declare const Quote: zod.ZodObject<{
38
38
  balance_shortfall_amount: zod.ZodString;
39
39
  required_top_up_amount: zod.ZodString;
40
40
  }, zod.z.core.$strict>;
41
- funds_sufficient: zod.ZodBoolean;
42
41
  items: zod.ZodArray<zod.ZodObject<{
43
42
  plan_name: zod.ZodString;
44
43
  unit_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -35,9 +35,6 @@ import { QuoteItemDc1fddb } from "./quoteItemDc1fddb.zod.js";
35
35
  export const Quote = zod
36
36
  .strictObject({
37
37
  funds: Funds,
38
- funds_sufficient: zod
39
- .boolean()
40
- .describe("Whether the account's current balance and eligible credits cover immediate charges\nand the currency's minimum top-up for every new postpaid item. False preserves this\ncomplete price preview. Nothing is reserved; checkout rechecks funds. Prepaid\npurchases may also use an online payment method."),
41
38
  items: zod
42
39
  .array(QuoteItemDc1fddb)
43
40
  .describe("One line for each item the purchase would order, in the order it would order them."),
@@ -61,7 +61,13 @@ export declare const Subscription: zod.ZodObject<{
61
61
  name: zod.ZodString;
62
62
  }, zod.z.core.$strict>>;
63
63
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
64
- suspend_reason: zod.ZodOptional<zod.ZodString>;
64
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
65
+ "billing.subscriptions.use": "billing.subscriptions.use";
66
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
67
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
68
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
69
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
70
+ }>>>;
65
71
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
66
72
  cancellation: zod.ZodOptional<zod.ZodObject<{
67
73
  reason: zod.ZodOptional<zod.ZodString>;
@@ -37,6 +37,7 @@ import { ProductID } from "./productID.zod.js";
37
37
  import { RefundPolicy } from "./refundPolicy.zod.js";
38
38
  import { ScheduledChange } from "./scheduledChange.zod.js";
39
39
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
40
+ import { SubscriptionRestriction } from "./subscriptionRestriction.zod.js";
40
41
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
41
42
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
42
43
  export const Subscription = zod
@@ -58,7 +59,10 @@ export const Subscription = zod
58
59
  .int()
59
60
  .min(subscriptionDiscountedRenewalsRemainingMin)
60
61
  .optional(),
61
- suspend_reason: zod.string().optional(),
62
+ restrictions: zod
63
+ .array(SubscriptionRestriction)
64
+ .optional()
65
+ .describe("The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use."),
62
66
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
63
67
  cancellation: SubscriptionCancellation.optional(),
64
68
  scheduled_change: zod
@@ -61,7 +61,13 @@ export declare const SubscriptionList: zod.ZodObject<{
61
61
  name: zod.ZodString;
62
62
  }, zod.z.core.$strict>>;
63
63
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
64
- suspend_reason: zod.ZodOptional<zod.ZodString>;
64
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
65
+ "billing.subscriptions.use": "billing.subscriptions.use";
66
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
67
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
68
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
69
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
70
+ }>>>;
65
71
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
66
72
  cancellation: zod.ZodOptional<zod.ZodObject<{
67
73
  reason: zod.ZodOptional<zod.ZodString>;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These management endpoints do not accept a Canopy API key. On this userapi host, the OpenAI-compatible `/v1/chat/completions`, `/v1/embeddings`, `/v1/models` and `/v1/models/{model}` endpoints accept the same project token; see the project inference contract. The separate API-key gateway continues to accept Canopy API keys.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export declare const SubscriptionRestriction: zod.ZodEnum<{
33
+ "billing.subscriptions.use": "billing.subscriptions.use";
34
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
35
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
36
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
37
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
38
+ }>;
39
+ export type SubscriptionRestriction = zod.input<typeof SubscriptionRestriction>;
40
+ export type SubscriptionRestrictionOutput = zod.output<typeof SubscriptionRestriction>;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Canopy API
5
+ * Management of API keys, together with the models available and the usage recorded against them.
6
+ *
7
+ * **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
8
+ *
9
+ * ```
10
+ * POST /v1/chat/completions OpenAI
11
+ * POST /v1/messages Anthropic
12
+ * POST /v1beta/models/{model}:generateContent Gemini
13
+ * ```
14
+ *
15
+ * ## Authentication
16
+ *
17
+ * Every request carries a scoped token; see the `bearerAuth` security scheme.
18
+ *
19
+ * These management endpoints do not accept a Canopy API key. On this userapi host, the OpenAI-compatible `/v1/chat/completions`, `/v1/embeddings`, `/v1/models` and `/v1/models/{model}` endpoints accept the same project token; see the project inference contract. The separate API-key gateway continues to accept Canopy API keys.
20
+ *
21
+ * ## Conventions
22
+ *
23
+ * - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
24
+ * - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
25
+ * - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
26
+ * - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
27
+ * - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
28
+ * - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
29
+ * OpenAPI spec version: 1.0.0
30
+ */
31
+ import * as zod from "zod";
32
+ export const SubscriptionRestriction = zod
33
+ .enum([
34
+ "billing.subscriptions.use",
35
+ "billing.subscriptions.renew",
36
+ "billing.subscriptions.modify",
37
+ "billing.subscriptions.cancel",
38
+ "billing.subscriptions.terminate",
39
+ ])
40
+ .describe("An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.");
@@ -2367,14 +2367,6 @@ export interface QuoteItem {
2367
2367
  */
2368
2368
  export interface Quote {
2369
2369
  funds: Funds;
2370
- /**
2371
- * Whether the account's current balance and eligible credits cover immediate charges
2372
- * and the currency's minimum top-up for every new postpaid item. False preserves this
2373
- * complete price preview. Nothing is reserved; checkout rechecks funds. Prepaid
2374
- * purchases may also use an online payment method.
2375
- * @deprecated
2376
- */
2377
- funds_sufficient: boolean;
2378
2370
  /** One line for each item the purchase would order, in the order it would order them. */
2379
2371
  items: QuoteItem[];
2380
2372
  /**
@@ -31,7 +31,6 @@ export declare const Quote: zod.ZodObject<{
31
31
  balance_shortfall_amount: zod.ZodString;
32
32
  required_top_up_amount: zod.ZodString;
33
33
  }, zod.z.core.$strict>;
34
- funds_sufficient: zod.ZodBoolean;
35
34
  items: zod.ZodArray<zod.ZodObject<{
36
35
  plan_name: zod.ZodString;
37
36
  unit_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -28,9 +28,6 @@ import { QuoteItem } from "./quoteItem.zod.js";
28
28
  export const Quote = zod
29
29
  .strictObject({
30
30
  funds: Funds,
31
- funds_sufficient: zod
32
- .boolean()
33
- .describe("Whether the account's current balance and eligible credits cover immediate charges\nand the currency's minimum top-up for every new postpaid item. False preserves this\ncomplete price preview. Nothing is reserved; checkout rechecks funds. Prepaid\npurchases may also use an online payment method."),
34
31
  items: zod
35
32
  .array(QuoteItem)
36
33
  .describe("One line for each item the purchase would order, in the order it would order them."),
@@ -2193,6 +2193,17 @@ export declare const SubscriptionInterval: {
2193
2193
  readonly month: "month";
2194
2194
  readonly year: "year";
2195
2195
  };
2196
+ /**
2197
+ * An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.
2198
+ */
2199
+ export type SubscriptionRestriction = (typeof SubscriptionRestriction)[keyof typeof SubscriptionRestriction];
2200
+ export declare const SubscriptionRestriction: {
2201
+ readonly billingsubscriptionsuse: "billing.subscriptions.use";
2202
+ readonly billingsubscriptionsrenew: "billing.subscriptions.renew";
2203
+ readonly billingsubscriptionsmodify: "billing.subscriptions.modify";
2204
+ readonly billingsubscriptionscancel: "billing.subscriptions.cancel";
2205
+ readonly billingsubscriptionsterminate: "billing.subscriptions.terminate";
2206
+ };
2196
2207
  /**
2197
2208
  * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2198
2209
  * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
@@ -2295,7 +2306,8 @@ export interface Subscription {
2295
2306
  coupon?: ObjectIdentity;
2296
2307
  /** @minimum 0 */
2297
2308
  discounted_renewals_remaining?: number;
2298
- suspend_reason?: string;
2309
+ /** The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use. */
2310
+ restrictions?: SubscriptionRestriction[];
2299
2311
  billing_cycle_anchor?: string;
2300
2312
  cancellation?: SubscriptionCancellation;
2301
2313
  /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
@@ -261,6 +261,13 @@ export const SubscriptionInterval = {
261
261
  month: "month",
262
262
  year: "year",
263
263
  };
264
+ export const SubscriptionRestriction = {
265
+ billingsubscriptionsuse: "billing.subscriptions.use",
266
+ billingsubscriptionsrenew: "billing.subscriptions.renew",
267
+ billingsubscriptionsmodify: "billing.subscriptions.modify",
268
+ billingsubscriptionscancel: "billing.subscriptions.cancel",
269
+ billingsubscriptionsterminate: "billing.subscriptions.terminate",
270
+ };
264
271
  export const OrderStatus = {
265
272
  pending: "pending",
266
273
  accepted: "accepted",
@@ -38,7 +38,13 @@ export declare const Subscription: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -14,6 +14,7 @@ import { ProductID } from "./productID.zod.js";
14
14
  import { RefundPolicy } from "./refundPolicy.zod.js";
15
15
  import { ScheduledChange } from "./scheduledChange.zod.js";
16
16
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
17
+ import { SubscriptionRestriction } from "./subscriptionRestriction.zod.js";
17
18
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
18
19
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
19
20
  export const Subscription = zod
@@ -35,7 +36,10 @@ export const Subscription = zod
35
36
  .int()
36
37
  .min(subscriptionDiscountedRenewalsRemainingMin)
37
38
  .optional(),
38
- suspend_reason: zod.string().optional(),
39
+ restrictions: zod
40
+ .array(SubscriptionRestriction)
41
+ .optional()
42
+ .describe("The operations currently prevented on the subscription, sorted. The subscription is suspended while this contains billing.subscriptions.use."),
39
43
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
40
44
  cancellation: SubscriptionCancellation.optional(),
41
45
  scheduled_change: zod
@@ -38,7 +38,13 @@ export declare const SubscriptionList: zod.ZodObject<{
38
38
  name: zod.ZodString;
39
39
  }, zod.z.core.$strict>>;
40
40
  discounted_renewals_remaining: zod.ZodOptional<zod.ZodInt>;
41
- suspend_reason: zod.ZodOptional<zod.ZodString>;
41
+ restrictions: zod.ZodOptional<zod.ZodArray<zod.ZodEnum<{
42
+ "billing.subscriptions.use": "billing.subscriptions.use";
43
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
44
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
45
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
46
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
47
+ }>>>;
42
48
  billing_cycle_anchor: zod.ZodOptional<zod.z.ZodISODateTime>;
43
49
  cancellation: zod.ZodOptional<zod.ZodObject<{
44
50
  reason: zod.ZodOptional<zod.ZodString>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ export declare const SubscriptionRestriction: zod.ZodEnum<{
10
+ "billing.subscriptions.use": "billing.subscriptions.use";
11
+ "billing.subscriptions.renew": "billing.subscriptions.renew";
12
+ "billing.subscriptions.modify": "billing.subscriptions.modify";
13
+ "billing.subscriptions.cancel": "billing.subscriptions.cancel";
14
+ "billing.subscriptions.terminate": "billing.subscriptions.terminate";
15
+ }>;
16
+ export type SubscriptionRestriction = zod.input<typeof SubscriptionRestriction>;
17
+ export type SubscriptionRestrictionOutput = zod.output<typeof SubscriptionRestriction>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Membership API
5
+ * Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
6
+ * OpenAPI spec version: 1.0.0
7
+ */
8
+ import * as zod from "zod";
9
+ export const SubscriptionRestriction = zod
10
+ .enum([
11
+ "billing.subscriptions.use",
12
+ "billing.subscriptions.renew",
13
+ "billing.subscriptions.modify",
14
+ "billing.subscriptions.cancel",
15
+ "billing.subscriptions.terminate",
16
+ ])
17
+ .describe("An operation Leaflow prevents on a subscription. billing.subscriptions.use stops the service. renew prevents renewal and payment of a renewal order. modify prevents placing a change order. cancel prevents cancellation. terminate prevents immediate termination.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.137.0",
3
+ "version": "0.139.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {