@leaflow/sdk 0.128.0 → 0.129.1

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 (42) 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 +45 -18
  36. package/dist/membership/v1/generated/models.js +13 -8
  37. package/dist/membership/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
  38. package/dist/membership/v1/generated/validators/scheduledChange.zod.js +26 -0
  39. package/dist/membership/v1/generated/validators/subscription.zod.d.ts +24 -0
  40. package/dist/membership/v1/generated/validators/subscription.zod.js +5 -0
  41. package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
  42. package/package.json +1 -1
@@ -2092,6 +2092,49 @@ export declare const SubscriptionInterval: {
2092
2092
  readonly month: "month";
2093
2093
  readonly year: "year";
2094
2094
  };
2095
+ /**
2096
+ * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2097
+ * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
2098
+ * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
2099
+ * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
2100
+ * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
2101
+ * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
2102
+ * payment sources. No status establishes service delivery by itself.
2103
+ */
2104
+ export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
2105
+ export declare const OrderStatus: {
2106
+ readonly pending: "pending";
2107
+ readonly accepted: "accepted";
2108
+ readonly completed: "completed";
2109
+ readonly partially_completed: "partially_completed";
2110
+ readonly failed: "failed";
2111
+ readonly canceled: "canceled";
2112
+ };
2113
+ export type ScheduledChangeInterval = (typeof ScheduledChangeInterval)[keyof typeof ScheduledChangeInterval];
2114
+ export declare const ScheduledChangeInterval: {
2115
+ readonly day: "day";
2116
+ readonly month: "month";
2117
+ readonly year: "year";
2118
+ };
2119
+ /**
2120
+ * The next accepted period-end change for a subscription. It describes the target terms and does not change the current subscription until effective_at.
2121
+ */
2122
+ export interface ScheduledChange {
2123
+ order_id: string;
2124
+ status: OrderStatus;
2125
+ /** When the target terms take effect, normally the end of the current paid period. */
2126
+ effective_at: string;
2127
+ plan_id: string;
2128
+ plan_name: string;
2129
+ price_id: string;
2130
+ quantity: string;
2131
+ /** The target prepaid renewal amount before tax. */
2132
+ recurring_amount: string;
2133
+ currency: string;
2134
+ interval: ScheduledChangeInterval;
2135
+ /** @minimum 1 */
2136
+ interval_count: number;
2137
+ }
2095
2138
  /**
2096
2139
  * pending means the purchase relationship exists but its order has not been accepted.
2097
2140
  * provisioning means the service accepted the order and is delivering. For a service-owned
@@ -2156,6 +2199,8 @@ export interface Subscription {
2156
2199
  suspend_reason?: string;
2157
2200
  billing_cycle_anchor?: string;
2158
2201
  cancellation?: SubscriptionCancellation;
2202
+ /** The accepted period-end change currently scheduled for this subscription. Null when no such change exists. */
2203
+ scheduled_change?: ScheduledChange | null;
2159
2204
  /**
2160
2205
  * The saved payment method automatic renewal charges after the account's balance and credits,
2161
2206
  * before the account's default payment method. Set when the purchase, a renewal or a change is paid with a
@@ -2332,24 +2377,6 @@ export interface RenewalOrderRequest {
2332
2377
  export interface AutoRenewSet {
2333
2378
  auto_renew: boolean;
2334
2379
  }
2335
- /**
2336
- * Follows the items. `pending` is not yet accepted and may be unpaid or paid; its invoice shows
2337
- * whether payment is still needed, and it can expire or be canceled. `accepted` is accepted with items still
2338
- * being set up. `completed` means every item was set up. `partially_completed` means some items were set up
2339
- * and the others failed or were canceled and were refunded to their original payment sources. `failed` means
2340
- * no item was delivered and at least one failed; collected amounts for the undelivered items are refunded.
2341
- * `canceled` means every item was withdrawn without delivery; collected amounts are returned to their original
2342
- * payment sources. No status establishes service delivery by itself.
2343
- */
2344
- export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
2345
- export declare const OrderStatus: {
2346
- readonly pending: "pending";
2347
- readonly accepted: "accepted";
2348
- readonly completed: "completed";
2349
- readonly partially_completed: "partially_completed";
2350
- readonly failed: "failed";
2351
- readonly canceled: "canceled";
2352
- };
2353
2380
  /**
2354
2381
  * `pending` is waiting to be set up. `completed` was confirmed by the service.
2355
2382
  * `failed` was not set up and its amount was refunded to the original payment sources.
@@ -251,6 +251,19 @@ export const SubscriptionInterval = {
251
251
  month: "month",
252
252
  year: "year",
253
253
  };
254
+ export const OrderStatus = {
255
+ pending: "pending",
256
+ accepted: "accepted",
257
+ completed: "completed",
258
+ partially_completed: "partially_completed",
259
+ failed: "failed",
260
+ canceled: "canceled",
261
+ };
262
+ export const ScheduledChangeInterval = {
263
+ day: "day",
264
+ month: "month",
265
+ year: "year",
266
+ };
254
267
  export const SubscriptionStatus = {
255
268
  pending: "pending",
256
269
  provisioning: "provisioning",
@@ -274,14 +287,6 @@ export const RenewalOrderRequestInterval = {
274
287
  month: "month",
275
288
  year: "year",
276
289
  };
277
- export const OrderStatus = {
278
- pending: "pending",
279
- accepted: "accepted",
280
- completed: "completed",
281
- partially_completed: "partially_completed",
282
- failed: "failed",
283
- canceled: "canceled",
284
- };
285
290
  export const OrderItemStatus = {
286
291
  pending: "pending",
287
292
  completed: "completed",
@@ -0,0 +1,34 @@
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 ScheduledChange: zod.ZodObject<{
10
+ order_id: zod.ZodUUID;
11
+ status: zod.ZodEnum<{
12
+ pending: "pending";
13
+ completed: "completed";
14
+ failed: "failed";
15
+ canceled: "canceled";
16
+ accepted: "accepted";
17
+ partially_completed: "partially_completed";
18
+ }>;
19
+ effective_at: zod.z.ZodISODateTime;
20
+ plan_id: zod.ZodUUID;
21
+ plan_name: zod.ZodString;
22
+ price_id: zod.ZodUUID;
23
+ quantity: zod.ZodString;
24
+ recurring_amount: zod.ZodString;
25
+ currency: zod.ZodString;
26
+ interval: zod.ZodEnum<{
27
+ day: "day";
28
+ month: "month";
29
+ year: "year";
30
+ }>;
31
+ interval_count: zod.ZodInt;
32
+ }, zod.z.core.$strict>;
33
+ export type ScheduledChange = zod.input<typeof ScheduledChange>;
34
+ export type ScheduledChangeOutput = zod.output<typeof ScheduledChange>;
@@ -0,0 +1,26 @@
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
+ import { OrderStatus } from "./orderStatus.zod.js";
10
+ export const ScheduledChange = zod
11
+ .strictObject({
12
+ order_id: zod.uuid(),
13
+ status: OrderStatus,
14
+ effective_at: zod.iso
15
+ .datetime({ offset: true })
16
+ .describe("When the target terms take effect, normally the end of the current paid period."),
17
+ plan_id: zod.uuid(),
18
+ plan_name: zod.string(),
19
+ price_id: zod.uuid(),
20
+ quantity: zod.string(),
21
+ recurring_amount: zod.string().describe("The target prepaid renewal amount before tax."),
22
+ currency: zod.string(),
23
+ interval: zod.enum(["day", "month", "year"]),
24
+ interval_count: zod.int().min(1),
25
+ })
26
+ .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.");
@@ -68,6 +68,30 @@ export declare const Subscription: 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;
@@ -12,6 +12,7 @@ import { ObjectIdentity } from "./objectIdentity.zod.js";
12
12
  import { Product } from "./product.zod.js";
13
13
  import { ProductID } from "./productID.zod.js";
14
14
  import { RefundPolicy } from "./refundPolicy.zod.js";
15
+ import { ScheduledChange } from "./scheduledChange.zod.js";
15
16
  import { SubscriptionCancellation } from "./subscriptionCancellation.zod.js";
16
17
  import { TerminationPolicy } from "./terminationPolicy.zod.js";
17
18
  export const subscriptionDiscountedRenewalsRemainingMin = 0;
@@ -41,6 +42,10 @@ export const Subscription = zod
41
42
  suspend_reason: zod.string().optional(),
42
43
  billing_cycle_anchor: zod.iso.datetime({ offset: true }).optional(),
43
44
  cancellation: SubscriptionCancellation.optional(),
45
+ scheduled_change: zod
46
+ .union([ScheduledChange, zod.null()])
47
+ .optional()
48
+ .describe("The accepted period-end change currently scheduled for this subscription. Null when no such change exists."),
44
49
  default_payment_method_id: zod
45
50
  .uuid()
46
51
  .nullish()
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.128.0",
3
+ "version": "0.129.1",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {