@leaflow/sdk 0.128.0 → 0.129.2

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 (49) hide show
  1. package/dist/billing/type/order/v1/generated/models.d.ts +45 -18
  2. package/dist/billing/type/order/v1/generated/models.js +13 -8
  3. package/dist/billing/type/order/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
  4. package/dist/billing/type/order/v1/generated/validators/scheduledChange.zod.js +26 -0
  5. package/dist/billing/type/order/v1/generated/validators/subscription.zod.d.ts +24 -0
  6. package/dist/billing/type/order/v1/generated/validators/subscription.zod.js +5 -0
  7. package/dist/billing/type/order/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  8. package/dist/billing/v1/generated/functions.d.ts +5 -3
  9. package/dist/billing/v1/generated/functions.js +5 -3
  10. package/dist/billing/v1/generated/models.d.ts +49 -18
  11. package/dist/billing/v1/generated/models.js +13 -8
  12. package/dist/billing/v1/generated/schemas.zod.d.ts +6 -3
  13. package/dist/billing/v1/generated/schemas.zod.js +9 -3
  14. package/dist/billing/v1/generated/validators/listInvoicesParams.zod.d.ts +1 -0
  15. package/dist/billing/v1/generated/validators/listInvoicesParams.zod.js +1 -0
  16. package/dist/billing/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
  17. package/dist/billing/v1/generated/validators/scheduledChange.zod.js +26 -0
  18. package/dist/billing/v1/generated/validators/subscription.zod.d.ts +24 -0
  19. package/dist/billing/v1/generated/validators/subscription.zod.js +5 -0
  20. package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  21. package/dist/canopy/v1/generated/models.d.ts +45 -18
  22. package/dist/canopy/v1/generated/models.js +13 -8
  23. package/dist/canopy/v1/generated/validators/scheduledChange.zod.d.ts +57 -0
  24. package/dist/canopy/v1/generated/validators/scheduledChange.zod.js +49 -0
  25. package/dist/canopy/v1/generated/validators/subscription.zod.d.ts +24 -0
  26. package/dist/canopy/v1/generated/validators/subscription.zod.js +5 -0
  27. package/dist/canopy/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  28. package/dist/compute/v1/generated/models.d.ts +45 -18
  29. package/dist/compute/v1/generated/models.js +13 -8
  30. package/dist/compute/v1/generated/validators/scheduledChange.zod.d.ts +50 -0
  31. package/dist/compute/v1/generated/validators/scheduledChange.zod.js +42 -0
  32. package/dist/compute/v1/generated/validators/subscription.zod.d.ts +24 -0
  33. package/dist/compute/v1/generated/validators/subscription.zod.js +5 -0
  34. package/dist/compute/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  35. package/dist/membership/v1/generated/models.d.ts +51 -18
  36. package/dist/membership/v1/generated/models.js +13 -8
  37. package/dist/membership/v1/generated/validators/grant.zod.d.ts +2 -0
  38. package/dist/membership/v1/generated/validators/grant.zod.js +5 -0
  39. package/dist/membership/v1/generated/validators/membership.zod.d.ts +2 -0
  40. package/dist/membership/v1/generated/validators/membershipList.zod.d.ts +2 -0
  41. package/dist/membership/v1/generated/validators/membershipPurchase.zod.d.ts +2 -0
  42. package/dist/membership/v1/generated/validators/period.zod.d.ts +2 -0
  43. package/dist/membership/v1/generated/validators/periodList.zod.d.ts +2 -0
  44. package/dist/membership/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
  45. package/dist/membership/v1/generated/validators/scheduledChange.zod.js +26 -0
  46. package/dist/membership/v1/generated/validators/subscription.zod.d.ts +24 -0
  47. package/dist/membership/v1/generated/validators/subscription.zod.js +5 -0
  48. package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  49. package/package.json +1 -1
@@ -68,6 +68,30 @@ export declare const SubscriptionList: zod.ZodObject<{
68
68
  failure_code: zod.ZodOptional<zod.ZodString>;
69
69
  failure_reason: zod.ZodOptional<zod.ZodString>;
70
70
  }, zod.z.core.$strict>>;
71
+ scheduled_change: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
72
+ order_id: zod.ZodUUID;
73
+ status: zod.ZodEnum<{
74
+ pending: "pending";
75
+ completed: "completed";
76
+ failed: "failed";
77
+ canceled: "canceled";
78
+ accepted: "accepted";
79
+ partially_completed: "partially_completed";
80
+ }>;
81
+ effective_at: zod.z.ZodISODateTime;
82
+ plan_id: zod.ZodUUID;
83
+ plan_name: zod.ZodString;
84
+ price_id: zod.ZodUUID;
85
+ quantity: zod.ZodString;
86
+ recurring_amount: zod.ZodString;
87
+ currency: zod.ZodString;
88
+ interval: zod.ZodEnum<{
89
+ day: "day";
90
+ month: "month";
91
+ year: "year";
92
+ }>;
93
+ interval_count: zod.ZodInt;
94
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
71
95
  default_payment_method_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
72
96
  created_at: zod.ZodOptional<zod.z.ZodISODateTime>;
73
97
  id: zod.ZodUUID;
@@ -2271,6 +2271,49 @@ export declare const SubscriptionInterval: {
2271
2271
  readonly month: "month";
2272
2272
  readonly year: "year";
2273
2273
  };
2274
+ /**
2275
+ * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2276
+ * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
2277
+ * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
2278
+ * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
2279
+ * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
2280
+ * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
2281
+ * payment sources. No status establishes service delivery by itself.
2282
+ */
2283
+ export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
2284
+ export declare const OrderStatus: {
2285
+ readonly pending: "pending";
2286
+ readonly accepted: "accepted";
2287
+ readonly completed: "completed";
2288
+ readonly partially_completed: "partially_completed";
2289
+ readonly failed: "failed";
2290
+ readonly canceled: "canceled";
2291
+ };
2292
+ export type ScheduledChangeInterval = (typeof ScheduledChangeInterval)[keyof typeof ScheduledChangeInterval];
2293
+ export declare const ScheduledChangeInterval: {
2294
+ readonly day: "day";
2295
+ readonly month: "month";
2296
+ readonly year: "year";
2297
+ };
2298
+ /**
2299
+ * The next accepted period-end change for a subscription. It describes the target terms and does not change the current subscription until effective_at.
2300
+ */
2301
+ export interface ScheduledChange {
2302
+ order_id: string;
2303
+ status: OrderStatus;
2304
+ /** When the target terms take effect, normally the end of the current paid period. */
2305
+ effective_at: string;
2306
+ plan_id: string;
2307
+ plan_name: string;
2308
+ price_id: string;
2309
+ quantity: string;
2310
+ /** The target prepaid renewal amount before tax. */
2311
+ recurring_amount: string;
2312
+ currency: string;
2313
+ interval: ScheduledChangeInterval;
2314
+ /** @minimum 1 */
2315
+ interval_count: number;
2316
+ }
2274
2317
  /**
2275
2318
  * pending means the purchase relationship exists but its order has not been accepted.
2276
2319
  * provisioning means the service accepted the order and is delivering. For a service-owned
@@ -2335,6 +2378,8 @@ export interface Subscription {
2335
2378
  suspend_reason?: string;
2336
2379
  billing_cycle_anchor?: string;
2337
2380
  cancellation?: SubscriptionCancellation;
2381
+ /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
2382
+ scheduled_change?: ScheduledChange | null;
2338
2383
  /**
2339
2384
  * The saved payment method automatic renewal charges after the account's balance and credits,
2340
2385
  * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
@@ -2511,24 +2556,6 @@ export interface RenewalOrderRequest {
2511
2556
  export interface AutoRenewSet {
2512
2557
  auto_renew: boolean;
2513
2558
  }
2514
- /**
2515
- * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2516
- * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
2517
- * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
2518
- * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
2519
- * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
2520
- * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
2521
- * payment sources. No status establishes service delivery by itself.
2522
- */
2523
- export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
2524
- export declare const OrderStatus: {
2525
- readonly pending: "pending";
2526
- readonly accepted: "accepted";
2527
- readonly completed: "completed";
2528
- readonly partially_completed: "partially_completed";
2529
- readonly failed: "failed";
2530
- readonly canceled: "canceled";
2531
- };
2532
2559
  /**
2533
2560
  * `pending` is waiting to be set up. `completed` was confirmed by the service.
2534
2561
  * `failed` was not set up and its amount was refunded to the original payment sources.
@@ -259,6 +259,19 @@ export const SubscriptionInterval = {
259
259
  month: "month",
260
260
  year: "year",
261
261
  };
262
+ export const OrderStatus = {
263
+ pending: "pending",
264
+ accepted: "accepted",
265
+ completed: "completed",
266
+ partially_completed: "partially_completed",
267
+ failed: "failed",
268
+ canceled: "canceled",
269
+ };
270
+ export const ScheduledChangeInterval = {
271
+ day: "day",
272
+ month: "month",
273
+ year: "year",
274
+ };
262
275
  export const SubscriptionStatus = {
263
276
  pending: "pending",
264
277
  provisioning: "provisioning",
@@ -282,14 +295,6 @@ export const RenewalOrderRequestInterval = {
282
295
  month: "month",
283
296
  year: "year",
284
297
  };
285
- export const OrderStatus = {
286
- pending: "pending",
287
- accepted: "accepted",
288
- completed: "completed",
289
- partially_completed: "partially_completed",
290
- failed: "failed",
291
- canceled: "canceled",
292
- };
293
298
  export const OrderItemStatus = {
294
299
  pending: "pending",
295
300
  completed: "completed",
@@ -0,0 +1,57 @@
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 endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
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 ScheduledChange: zod.ZodObject<{
33
+ order_id: zod.ZodUUID;
34
+ status: zod.ZodEnum<{
35
+ pending: "pending";
36
+ completed: "completed";
37
+ failed: "failed";
38
+ canceled: "canceled";
39
+ accepted: "accepted";
40
+ partially_completed: "partially_completed";
41
+ }>;
42
+ effective_at: zod.z.ZodISODateTime;
43
+ plan_id: zod.ZodUUID;
44
+ plan_name: zod.ZodString;
45
+ price_id: zod.ZodUUID;
46
+ quantity: zod.ZodString;
47
+ recurring_amount: zod.ZodString;
48
+ currency: zod.ZodString;
49
+ interval: zod.ZodEnum<{
50
+ day: "day";
51
+ month: "month";
52
+ year: "year";
53
+ }>;
54
+ interval_count: zod.ZodInt;
55
+ }, zod.z.core.$strict>;
56
+ export type ScheduledChange = zod.input<typeof ScheduledChange>;
57
+ export type ScheduledChangeOutput = zod.output<typeof ScheduledChange>;
@@ -0,0 +1,49 @@
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 endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
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
+ import { OrderStatus } from "./orderStatus.zod.js";
33
+ export const ScheduledChange = zod
34
+ .strictObject({
35
+ order_id: zod.uuid(),
36
+ status: OrderStatus,
37
+ effective_at: zod.iso
38
+ .datetime({ offset: true })
39
+ .describe("When the target terms take effect, normally the end of the current paid period."),
40
+ plan_id: zod.uuid(),
41
+ plan_name: zod.string(),
42
+ price_id: zod.uuid(),
43
+ quantity: zod.string(),
44
+ recurring_amount: zod.string().describe("The target prepaid renewal amount before tax."),
45
+ currency: zod.string(),
46
+ interval: zod.enum(["day", "month", "year"]),
47
+ interval_count: zod.int().min(1),
48
+ })
49
+ .describe("The next accepted period-end change for a subscription. It describes the target terms and does not change the current subscription until effective_at.");
@@ -91,6 +91,30 @@ export declare const Subscription: zod.ZodObject<{
91
91
  failure_code: zod.ZodOptional<zod.ZodString>;
92
92
  failure_reason: zod.ZodOptional<zod.ZodString>;
93
93
  }, zod.z.core.$strict>>;
94
+ scheduled_change: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
95
+ order_id: zod.ZodUUID;
96
+ status: zod.ZodEnum<{
97
+ pending: "pending";
98
+ completed: "completed";
99
+ failed: "failed";
100
+ canceled: "canceled";
101
+ accepted: "accepted";
102
+ partially_completed: "partially_completed";
103
+ }>;
104
+ effective_at: zod.z.ZodISODateTime;
105
+ plan_id: zod.ZodUUID;
106
+ plan_name: zod.ZodString;
107
+ price_id: zod.ZodUUID;
108
+ quantity: zod.ZodString;
109
+ recurring_amount: zod.ZodString;
110
+ currency: zod.ZodString;
111
+ interval: zod.ZodEnum<{
112
+ day: "day";
113
+ month: "month";
114
+ year: "year";
115
+ }>;
116
+ interval_count: zod.ZodInt;
117
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
94
118
  default_payment_method_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
95
119
  created_at: zod.ZodOptional<zod.z.ZodISODateTime>;
96
120
  id: zod.ZodUUID;
@@ -35,6 +35,7 @@ import { ObjectIdentity } from "./objectIdentity.zod.js";
35
35
  import { Product } from "./product.zod.js";
36
36
  import { ProductID } from "./productID.zod.js";
37
37
  import { RefundPolicy } from "./refundPolicy.zod.js";
38
+ import { ScheduledChange } from "./scheduledChange.zod.js";
38
39
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
39
40
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
40
41
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
@@ -64,6 +65,10 @@ export const Subscription = zod
64
65
  suspend_reason: zod.string().optional(),
65
66
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
66
67
  cancellation: SubscriptionCancellation.optional(),
68
+ scheduled_change: zod
69
+ .union([ScheduledChange, zod.null()])
70
+ .optional()
71
+ .describe("The accepted period-end change currently scheduled for this subscription. Null when no such change exists."),
67
72
  default_payment_method_id: zod
68
73
  .uuid()
69
74
  .nullish()
@@ -91,6 +91,30 @@ export declare const SubscriptionList: zod.ZodObject<{
91
91
  failure_code: zod.ZodOptional<zod.ZodString>;
92
92
  failure_reason: zod.ZodOptional<zod.ZodString>;
93
93
  }, zod.z.core.$strict>>;
94
+ scheduled_change: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
95
+ order_id: zod.ZodUUID;
96
+ status: zod.ZodEnum<{
97
+ pending: "pending";
98
+ completed: "completed";
99
+ failed: "failed";
100
+ canceled: "canceled";
101
+ accepted: "accepted";
102
+ partially_completed: "partially_completed";
103
+ }>;
104
+ effective_at: zod.z.ZodISODateTime;
105
+ plan_id: zod.ZodUUID;
106
+ plan_name: zod.ZodString;
107
+ price_id: zod.ZodUUID;
108
+ quantity: zod.ZodString;
109
+ recurring_amount: zod.ZodString;
110
+ currency: zod.ZodString;
111
+ interval: zod.ZodEnum<{
112
+ day: "day";
113
+ month: "month";
114
+ year: "year";
115
+ }>;
116
+ interval_count: zod.ZodInt;
117
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
94
118
  default_payment_method_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
95
119
  created_at: zod.ZodOptional<zod.z.ZodISODateTime>;
96
120
  id: zod.ZodUUID;
@@ -4217,6 +4217,49 @@ export declare const SubscriptionInterval: {
4217
4217
  readonly month: "month";
4218
4218
  readonly year: "year";
4219
4219
  };
4220
+ /**
4221
+ * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
4222
+ * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
4223
+ * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
4224
+ * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
4225
+ * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
4226
+ * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
4227
+ * payment sources. No status establishes service delivery by itself.
4228
+ */
4229
+ export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
4230
+ export declare const OrderStatus: {
4231
+ readonly pending: "pending";
4232
+ readonly accepted: "accepted";
4233
+ readonly completed: "completed";
4234
+ readonly partially_completed: "partially_completed";
4235
+ readonly failed: "failed";
4236
+ readonly canceled: "canceled";
4237
+ };
4238
+ export type ScheduledChangeInterval = (typeof ScheduledChangeInterval)[keyof typeof ScheduledChangeInterval];
4239
+ export declare const ScheduledChangeInterval: {
4240
+ readonly day: "day";
4241
+ readonly month: "month";
4242
+ readonly year: "year";
4243
+ };
4244
+ /**
4245
+ * The next accepted period-end change for a subscription. It describes the target terms and does not change the current subscription until effective_at.
4246
+ */
4247
+ export interface ScheduledChange {
4248
+ order_id: string;
4249
+ status: OrderStatus;
4250
+ /** When the target terms take effect, normally the end of the current paid period. */
4251
+ effective_at: string;
4252
+ plan_id: string;
4253
+ plan_name: string;
4254
+ price_id: string;
4255
+ quantity: string;
4256
+ /** The target prepaid renewal amount before tax. */
4257
+ recurring_amount: string;
4258
+ currency: string;
4259
+ interval: ScheduledChangeInterval;
4260
+ /** @minimum 1 */
4261
+ interval_count: number;
4262
+ }
4220
4263
  /**
4221
4264
  * pending means the purchase relationship exists but its order has not been accepted.
4222
4265
  * provisioning means the service accepted the order and is delivering. For a service-owned
@@ -4281,6 +4324,8 @@ export interface Subscription {
4281
4324
  suspend_reason?: string;
4282
4325
  billing_cycle_anchor?: string;
4283
4326
  cancellation?: SubscriptionCancellation;
4327
+ /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
4328
+ scheduled_change?: ScheduledChange | null;
4284
4329
  /**
4285
4330
  * The saved payment method automatic renewal charges after the account's balance and credits,
4286
4331
  * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
@@ -4457,24 +4502,6 @@ export interface RenewalOrderRequest {
4457
4502
  export interface AutoRenewSet {
4458
4503
  auto_renew: boolean;
4459
4504
  }
4460
- /**
4461
- * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
4462
- * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
4463
- * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
4464
- * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
4465
- * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
4466
- * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
4467
- * payment sources. No status establishes service delivery by itself.
4468
- */
4469
- export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
4470
- export declare const OrderStatus: {
4471
- readonly pending: "pending";
4472
- readonly accepted: "accepted";
4473
- readonly completed: "completed";
4474
- readonly partially_completed: "partially_completed";
4475
- readonly failed: "failed";
4476
- readonly canceled: "canceled";
4477
- };
4478
4505
  /**
4479
4506
  * `pending` is waiting to be set up. `completed` was confirmed by the service.
4480
4507
  * `failed` was not set up and its amount was refunded to the original payment sources.
@@ -557,6 +557,19 @@ export const SubscriptionInterval = {
557
557
  month: "month",
558
558
  year: "year",
559
559
  };
560
+ export const OrderStatus = {
561
+ pending: "pending",
562
+ accepted: "accepted",
563
+ completed: "completed",
564
+ partially_completed: "partially_completed",
565
+ failed: "failed",
566
+ canceled: "canceled",
567
+ };
568
+ export const ScheduledChangeInterval = {
569
+ day: "day",
570
+ month: "month",
571
+ year: "year",
572
+ };
560
573
  export const SubscriptionStatus = {
561
574
  pending: "pending",
562
575
  provisioning: "provisioning",
@@ -580,14 +593,6 @@ export const RenewalOrderRequestInterval = {
580
593
  month: "month",
581
594
  year: "year",
582
595
  };
583
- export const OrderStatus = {
584
- pending: "pending",
585
- accepted: "accepted",
586
- completed: "completed",
587
- partially_completed: "partially_completed",
588
- failed: "failed",
589
- canceled: "canceled",
590
- };
591
596
  export const OrderItemStatus = {
592
597
  pending: "pending",
593
598
  completed: "completed",
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ export declare const ScheduledChange: zod.ZodObject<{
26
+ order_id: zod.ZodUUID;
27
+ status: zod.ZodEnum<{
28
+ pending: "pending";
29
+ completed: "completed";
30
+ failed: "failed";
31
+ canceled: "canceled";
32
+ accepted: "accepted";
33
+ partially_completed: "partially_completed";
34
+ }>;
35
+ effective_at: zod.z.ZodISODateTime;
36
+ plan_id: zod.ZodUUID;
37
+ plan_name: zod.ZodString;
38
+ price_id: zod.ZodUUID;
39
+ quantity: zod.ZodString;
40
+ recurring_amount: zod.ZodString;
41
+ currency: zod.ZodString;
42
+ interval: zod.ZodEnum<{
43
+ day: "day";
44
+ month: "month";
45
+ year: "year";
46
+ }>;
47
+ interval_count: zod.ZodInt;
48
+ }, zod.z.core.$strict>;
49
+ export type ScheduledChange = zod.input<typeof ScheduledChange>;
50
+ export type ScheduledChangeOutput = zod.output<typeof ScheduledChange>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow Compute API
5
+ * Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
6
+ *
7
+ * ## Authentication
8
+ *
9
+ * Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
10
+ *
11
+ * ## Conventions
12
+ *
13
+ * - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
14
+ * - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
15
+ * - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
16
+ * - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
17
+ * - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
18
+ * - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
19
+ * - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
20
+ * - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
21
+ * - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
22
+ * OpenAPI spec version: 1.0.0
23
+ */
24
+ import * as zod from "zod";
25
+ import { OrderStatus } from "./orderStatus.zod.js";
26
+ export const ScheduledChange = zod
27
+ .strictObject({
28
+ order_id: zod.uuid(),
29
+ status: OrderStatus,
30
+ effective_at: zod.iso
31
+ .datetime({ offset: true })
32
+ .describe("When the target terms take effect, normally the end of the current paid period."),
33
+ plan_id: zod.uuid(),
34
+ plan_name: zod.string(),
35
+ price_id: zod.uuid(),
36
+ quantity: zod.string(),
37
+ recurring_amount: zod.string().describe("The target prepaid renewal amount before tax."),
38
+ currency: zod.string(),
39
+ interval: zod.enum(["day", "month", "year"]),
40
+ interval_count: zod.int().min(1),
41
+ })
42
+ .describe("The next accepted period-end change for a subscription. It describes the target terms and does not change the current subscription until effective_at.");
@@ -84,6 +84,30 @@ export declare const Subscription: zod.ZodObject<{
84
84
  failure_code: zod.ZodOptional<zod.ZodString>;
85
85
  failure_reason: zod.ZodOptional<zod.ZodString>;
86
86
  }, zod.z.core.$strict>>;
87
+ scheduled_change: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
88
+ order_id: zod.ZodUUID;
89
+ status: zod.ZodEnum<{
90
+ pending: "pending";
91
+ completed: "completed";
92
+ failed: "failed";
93
+ canceled: "canceled";
94
+ accepted: "accepted";
95
+ partially_completed: "partially_completed";
96
+ }>;
97
+ effective_at: zod.z.ZodISODateTime;
98
+ plan_id: zod.ZodUUID;
99
+ plan_name: zod.ZodString;
100
+ price_id: zod.ZodUUID;
101
+ quantity: zod.ZodString;
102
+ recurring_amount: zod.ZodString;
103
+ currency: zod.ZodString;
104
+ interval: zod.ZodEnum<{
105
+ day: "day";
106
+ month: "month";
107
+ year: "year";
108
+ }>;
109
+ interval_count: zod.ZodInt;
110
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
87
111
  default_payment_method_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
88
112
  created_at: zod.ZodOptional<zod.z.ZodISODateTime>;
89
113
  id: zod.ZodUUID;
@@ -28,6 +28,7 @@ import { ObjectIdentity } from "./objectIdentity.zod.js";
28
28
  import { Product } from "./product.zod.js";
29
29
  import { ProductID } from "./productID.zod.js";
30
30
  import { RefundPolicy } from "./refundPolicy.zod.js";
31
+ import { ScheduledChange } from "./scheduledChange.zod.js";
31
32
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
32
33
  import { TerminationPolicyBfdab9f } from "./terminationPolicyBfdab9f.zod.js";
33
34
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
@@ -57,6 +58,10 @@ export const Subscription = zod
57
58
  suspend_reason: zod.string().optional(),
58
59
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
59
60
  cancellation: SubscriptionCancellation.optional(),
61
+ scheduled_change: zod
62
+ .union([ScheduledChange, zod.null()])
63
+ .optional()
64
+ .describe("The accepted period-end change currently scheduled for this subscription. Null when no such change exists."),
60
65
  default_payment_method_id: zod
61
66
  .uuid()
62
67
  .nullish()
@@ -84,6 +84,30 @@ export declare const SubscriptionList: zod.ZodObject<{
84
84
  failure_code: zod.ZodOptional<zod.ZodString>;
85
85
  failure_reason: zod.ZodOptional<zod.ZodString>;
86
86
  }, zod.z.core.$strict>>;
87
+ scheduled_change: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
88
+ order_id: zod.ZodUUID;
89
+ status: zod.ZodEnum<{
90
+ pending: "pending";
91
+ completed: "completed";
92
+ failed: "failed";
93
+ canceled: "canceled";
94
+ accepted: "accepted";
95
+ partially_completed: "partially_completed";
96
+ }>;
97
+ effective_at: zod.z.ZodISODateTime;
98
+ plan_id: zod.ZodUUID;
99
+ plan_name: zod.ZodString;
100
+ price_id: zod.ZodUUID;
101
+ quantity: zod.ZodString;
102
+ recurring_amount: zod.ZodString;
103
+ currency: zod.ZodString;
104
+ interval: zod.ZodEnum<{
105
+ day: "day";
106
+ month: "month";
107
+ year: "year";
108
+ }>;
109
+ interval_count: zod.ZodInt;
110
+ }, zod.z.core.$strict>, zod.ZodNull]>>;
87
111
  default_payment_method_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
88
112
  created_at: zod.ZodOptional<zod.z.ZodISODateTime>;
89
113
  id: zod.ZodUUID;