@leaflow/sdk 0.127.1 → 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.
- package/dist/billing/type/order/v1/generated/models.d.ts +53 -20
- package/dist/billing/type/order/v1/generated/models.js +13 -8
- package/dist/billing/type/order/v1/generated/validators/orderItem.zod.js +8 -2
- package/dist/billing/type/order/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
- package/dist/billing/type/order/v1/generated/validators/scheduledChange.zod.js +26 -0
- package/dist/billing/type/order/v1/generated/validators/subscription.zod.d.ts +24 -0
- package/dist/billing/type/order/v1/generated/validators/subscription.zod.js +5 -0
- package/dist/billing/type/order/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
- package/dist/billing/v1/generated/functions.d.ts +5 -3
- package/dist/billing/v1/generated/functions.js +5 -3
- package/dist/billing/v1/generated/models.d.ts +57 -20
- package/dist/billing/v1/generated/models.js +13 -8
- package/dist/billing/v1/generated/schemas.zod.d.ts +6 -3
- package/dist/billing/v1/generated/schemas.zod.js +9 -3
- package/dist/billing/v1/generated/validators/listInvoicesParams.zod.d.ts +1 -0
- package/dist/billing/v1/generated/validators/listInvoicesParams.zod.js +1 -0
- package/dist/billing/v1/generated/validators/orderItem.zod.js +8 -2
- package/dist/billing/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
- package/dist/billing/v1/generated/validators/scheduledChange.zod.js +26 -0
- package/dist/billing/v1/generated/validators/subscription.zod.d.ts +24 -0
- package/dist/billing/v1/generated/validators/subscription.zod.js +5 -0
- package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
- package/dist/canopy/v1/generated/models.d.ts +53 -20
- package/dist/canopy/v1/generated/models.js +13 -8
- package/dist/canopy/v1/generated/validators/orderItem.zod.js +8 -2
- package/dist/canopy/v1/generated/validators/scheduledChange.zod.d.ts +57 -0
- package/dist/canopy/v1/generated/validators/scheduledChange.zod.js +49 -0
- package/dist/canopy/v1/generated/validators/subscription.zod.d.ts +24 -0
- package/dist/canopy/v1/generated/validators/subscription.zod.js +5 -0
- package/dist/canopy/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
- package/dist/compute/v1/generated/models.d.ts +53 -20
- package/dist/compute/v1/generated/models.js +13 -8
- package/dist/compute/v1/generated/validators/orderItem.zod.js +8 -2
- package/dist/compute/v1/generated/validators/scheduledChange.zod.d.ts +50 -0
- package/dist/compute/v1/generated/validators/scheduledChange.zod.js +42 -0
- package/dist/compute/v1/generated/validators/subscription.zod.d.ts +24 -0
- package/dist/compute/v1/generated/validators/subscription.zod.js +5 -0
- package/dist/compute/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
- package/dist/membership/v1/generated/models.d.ts +53 -20
- package/dist/membership/v1/generated/models.js +13 -8
- package/dist/membership/v1/generated/validators/orderItem.zod.js +8 -2
- package/dist/membership/v1/generated/validators/scheduledChange.zod.d.ts +34 -0
- package/dist/membership/v1/generated/validators/scheduledChange.zod.js +26 -0
- package/dist/membership/v1/generated/validators/subscription.zod.d.ts +24 -0
- package/dist/membership/v1/generated/validators/subscription.zod.js +5 -0
- package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +24 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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.
|
|
@@ -2509,9 +2536,15 @@ export interface OrderItem {
|
|
|
2509
2536
|
/** `gross_amount` less `discount_amount`. */
|
|
2510
2537
|
amount?: Money;
|
|
2511
2538
|
currency: string;
|
|
2512
|
-
/**
|
|
2539
|
+
/**
|
|
2540
|
+
* The start of the service period this line paid for. Frozen at placement for renewals and period-end changes; for a prepaid line of a new purchase, fixed from the second its invoice is paid and kept when delivery is confirmed. Absent for postpaid and one-time lines.
|
|
2541
|
+
* @nullable
|
|
2542
|
+
*/
|
|
2513
2543
|
period_start?: string | null;
|
|
2514
|
-
/**
|
|
2544
|
+
/**
|
|
2545
|
+
* The end of that service period, exclusive.
|
|
2546
|
+
* @nullable
|
|
2547
|
+
*/
|
|
2515
2548
|
period_end?: string | null;
|
|
2516
2549
|
status: OrderItemStatus;
|
|
2517
2550
|
}
|
|
@@ -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",
|
|
@@ -65,8 +65,14 @@ export const OrderItem = zod
|
|
|
65
65
|
discount_amount: Money.optional().describe("The reduction on this line: from the coupon the order uses and, for a renewal at the agreed terms,\nfrom the discount the subscription carries.\n\nA carried discount is part of the agreed amount. It is listed here, and `gross_amount` is then\n`unit_amount` times `quantity`, except in two cases where `gross_amount` is the agreed amount and\nthe carried discount is already reflected in it: the renewal order also uses a coupon the account\nholds, or the account's tax rate is inclusive."),
|
|
66
66
|
amount: Money.optional().describe("`gross_amount` less `discount_amount`."),
|
|
67
67
|
currency: zod.string(),
|
|
68
|
-
period_start: zod.iso
|
|
69
|
-
|
|
68
|
+
period_start: zod.iso
|
|
69
|
+
.datetime({ offset: true })
|
|
70
|
+
.nullish()
|
|
71
|
+
.describe("The start of the service period this line paid for. Frozen at placement for renewals and period-end changes; for a prepaid line of a new purchase, fixed from the second its invoice is paid and kept when delivery is confirmed. Absent for postpaid and one-time lines."),
|
|
72
|
+
period_end: zod.iso
|
|
73
|
+
.datetime({ offset: true })
|
|
74
|
+
.nullish()
|
|
75
|
+
.describe("The end of that service period, exclusive."),
|
|
70
76
|
status: OrderItemStatus,
|
|
71
77
|
})
|
|
72
78
|
.describe("Frozen purchase terms. Monetary fields come from related invoice-line snapshots and are zero\nfor a line with no immediate charge, such as postpaid admission. Later catalog changes do not reprice this line. A new service\npurchase creates its pending subscription when this item is recorded, not when payment succeeds.");
|
|
@@ -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;
|