@leaflow/sdk 0.134.0 → 0.135.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.
- package/dist/billing/type/order/v1/generated/models.d.ts +23 -4
- package/dist/billing/type/order/v1/generated/validators/invoiceItem.zod.d.ts +8 -0
- package/dist/billing/type/order/v1/generated/validators/invoiceItem.zod.js +5 -0
- package/dist/billing/type/order/v1/generated/validators/invoiceItemList.zod.d.ts +8 -0
- package/dist/billing/type/order/v1/generated/validators/invoiceItemProration.zod.d.ts +18 -0
- package/dist/billing/type/order/v1/generated/validators/invoiceItemProration.zod.js +23 -0
- package/dist/billing/type/order/v1/generated/validators/orderItem.zod.js +1 -1
- package/dist/billing/type/order/v1/generated/validators/subscription.zod.d.ts +0 -1
- package/dist/billing/type/order/v1/generated/validators/subscription.zod.js +0 -4
- package/dist/billing/type/order/v1/generated/validators/subscriptionList.zod.d.ts +0 -1
- package/dist/billing/v1/generated/models.d.ts +23 -4
- package/dist/billing/v1/generated/validators/invoiceItem.zod.d.ts +8 -0
- package/dist/billing/v1/generated/validators/invoiceItem.zod.js +5 -0
- package/dist/billing/v1/generated/validators/invoiceItemList.zod.d.ts +8 -0
- package/dist/billing/v1/generated/validators/invoiceItemProration.zod.d.ts +18 -0
- package/dist/billing/v1/generated/validators/invoiceItemProration.zod.js +23 -0
- package/dist/billing/v1/generated/validators/orderItem.zod.js +1 -1
- package/dist/billing/v1/generated/validators/subscription.zod.d.ts +0 -1
- package/dist/billing/v1/generated/validators/subscription.zod.js +0 -4
- package/dist/billing/v1/generated/validators/subscriptionList.zod.d.ts +0 -1
- package/dist/canopy/v1/generated/models.d.ts +23 -4
- package/dist/canopy/v1/generated/validators/invoiceItem.zod.d.ts +8 -0
- package/dist/canopy/v1/generated/validators/invoiceItem.zod.js +5 -0
- package/dist/canopy/v1/generated/validators/invoiceItemList.zod.d.ts +8 -0
- package/dist/canopy/v1/generated/validators/invoiceItemProration.zod.d.ts +41 -0
- package/dist/canopy/v1/generated/validators/invoiceItemProration.zod.js +46 -0
- package/dist/canopy/v1/generated/validators/orderItem.zod.js +1 -1
- package/dist/canopy/v1/generated/validators/subscription.zod.d.ts +0 -1
- package/dist/canopy/v1/generated/validators/subscription.zod.js +0 -4
- package/dist/canopy/v1/generated/validators/subscriptionList.zod.d.ts +0 -1
- package/dist/membership/v1/generated/models.d.ts +23 -4
- package/dist/membership/v1/generated/validators/invoiceItem.zod.d.ts +8 -0
- package/dist/membership/v1/generated/validators/invoiceItem.zod.js +5 -0
- package/dist/membership/v1/generated/validators/invoiceItemList.zod.d.ts +8 -0
- package/dist/membership/v1/generated/validators/invoiceItemProration.zod.d.ts +18 -0
- package/dist/membership/v1/generated/validators/invoiceItemProration.zod.js +23 -0
- package/dist/membership/v1/generated/validators/orderItem.zod.js +1 -1
- package/dist/membership/v1/generated/validators/subscription.zod.d.ts +0 -1
- package/dist/membership/v1/generated/validators/subscription.zod.js +0 -4
- package/dist/membership/v1/generated/validators/subscriptionList.zod.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1528,6 +1528,22 @@ export declare const InvoiceItemType: {
|
|
|
1528
1528
|
readonly setup: "setup";
|
|
1529
1529
|
readonly adjustment: "adjustment";
|
|
1530
1530
|
};
|
|
1531
|
+
/**
|
|
1532
|
+
* The value of one paid period moved to the new configuration of a subscription.
|
|
1533
|
+
*/
|
|
1534
|
+
export interface InvoiceItemProration {
|
|
1535
|
+
/** The earlier invoice line that paid for the period. */
|
|
1536
|
+
credited_invoice_item_id: string;
|
|
1537
|
+
/** The wording of the earlier invoice line as recorded when this invoice was created. */
|
|
1538
|
+
description: string;
|
|
1539
|
+
period_start: string;
|
|
1540
|
+
/** Exclusive. */
|
|
1541
|
+
period_end: string;
|
|
1542
|
+
/** Before tax and discounts, the new configuration for the period. */
|
|
1543
|
+
remaining_amount: Money;
|
|
1544
|
+
/** Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`. */
|
|
1545
|
+
credited_amount: Money;
|
|
1546
|
+
}
|
|
1531
1547
|
export interface InvoiceItem {
|
|
1532
1548
|
taxable?: boolean;
|
|
1533
1549
|
/** Discount applied to this line before tax. */
|
|
@@ -1573,6 +1589,11 @@ export interface InvoiceItem {
|
|
|
1573
1589
|
period_start?: string | null;
|
|
1574
1590
|
/** @nullable */
|
|
1575
1591
|
period_end?: string | null;
|
|
1592
|
+
/**
|
|
1593
|
+
* Present on a line that changes a subscription immediately, one entry for each paid period it
|
|
1594
|
+
* covers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries.
|
|
1595
|
+
*/
|
|
1596
|
+
prorations?: InvoiceItemProration[];
|
|
1576
1597
|
}
|
|
1577
1598
|
export interface InvoiceItemList {
|
|
1578
1599
|
items: InvoiceItem[];
|
|
@@ -1953,8 +1974,6 @@ export interface Subscription {
|
|
|
1953
1974
|
termination_policy?: TerminationPolicy;
|
|
1954
1975
|
refund_policy?: RefundPolicy;
|
|
1955
1976
|
order_item_id?: string;
|
|
1956
|
-
/** Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID. */
|
|
1957
|
-
replaces_subscription_id?: string;
|
|
1958
1977
|
coupon_id?: string;
|
|
1959
1978
|
coupon?: ObjectIdentity;
|
|
1960
1979
|
/** @minimum 0 */
|
|
@@ -2277,8 +2296,8 @@ export interface OrderItem {
|
|
|
2277
2296
|
/**
|
|
2278
2297
|
* Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`
|
|
2279
2298
|
* times `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is
|
|
2280
|
-
* the new price
|
|
2281
|
-
*
|
|
2299
|
+
* the new price for the time left in the paid period, at the subscription's own period price, minus
|
|
2300
|
+
* the amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the
|
|
2282
2301
|
* difference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.
|
|
2283
2302
|
*
|
|
2284
2303
|
* Under an inclusive tax rate it includes tax, as the price does, and the included part is
|
|
@@ -36,6 +36,14 @@ export declare const InvoiceItem: zod.ZodObject<{
|
|
|
36
36
|
currency: zod.ZodString;
|
|
37
37
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
38
38
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
40
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
41
|
+
description: zod.ZodString;
|
|
42
|
+
period_start: zod.z.ZodISODateTime;
|
|
43
|
+
period_end: zod.z.ZodISODateTime;
|
|
44
|
+
remaining_amount: zod.ZodString;
|
|
45
|
+
credited_amount: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>>>;
|
|
39
47
|
}, zod.z.core.$strict>;
|
|
40
48
|
export type InvoiceItem = zod.input<typeof InvoiceItem>;
|
|
41
49
|
export type InvoiceItemOutput = zod.output<typeof InvoiceItem>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* OpenAPI spec version: v1
|
|
7
7
|
*/
|
|
8
8
|
import * as zod from "zod";
|
|
9
|
+
import { InvoiceItemProration } from "./invoiceItemProration.zod.js";
|
|
9
10
|
import { Money } from "./money.zod.js";
|
|
10
11
|
import { NamedIdentity } from "./namedIdentity.zod.js";
|
|
11
12
|
export const InvoiceItem = zod.strictObject({
|
|
@@ -43,4 +44,8 @@ export const InvoiceItem = zod.strictObject({
|
|
|
43
44
|
currency: zod.string(),
|
|
44
45
|
period_start: zod.iso.datetime({ offset: true }).nullish(),
|
|
45
46
|
period_end: zod.iso.datetime({ offset: true }).nullish(),
|
|
47
|
+
prorations: zod
|
|
48
|
+
.array(InvoiceItemProration)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Present on a line that changes a subscription immediately, one entry for each paid period it\ncovers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries."),
|
|
46
51
|
});
|
|
@@ -37,6 +37,14 @@ export declare const InvoiceItemList: zod.ZodObject<{
|
|
|
37
37
|
currency: zod.ZodString;
|
|
38
38
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
39
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
40
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
41
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
42
|
+
description: zod.ZodString;
|
|
43
|
+
period_start: zod.z.ZodISODateTime;
|
|
44
|
+
period_end: zod.z.ZodISODateTime;
|
|
45
|
+
remaining_amount: zod.ZodString;
|
|
46
|
+
credited_amount: zod.ZodString;
|
|
47
|
+
}, zod.z.core.$strict>>>;
|
|
40
48
|
}, zod.z.core.$strict>>;
|
|
41
49
|
pagination: zod.ZodObject<{
|
|
42
50
|
page: zod.ZodInt;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 InvoiceItemProration: zod.ZodObject<{
|
|
10
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
11
|
+
description: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
remaining_amount: zod.ZodString;
|
|
15
|
+
credited_amount: zod.ZodString;
|
|
16
|
+
}, zod.z.core.$strict>;
|
|
17
|
+
export type InvoiceItemProration = zod.input<typeof InvoiceItemProration>;
|
|
18
|
+
export type InvoiceItemProrationOutput = zod.output<typeof InvoiceItemProration>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import { Money } from "./money.zod.js";
|
|
10
|
+
export const InvoiceItemProration = zod
|
|
11
|
+
.strictObject({
|
|
12
|
+
credited_invoice_item_id: zod
|
|
13
|
+
.uuid()
|
|
14
|
+
.describe("The earlier invoice line that paid for the period."),
|
|
15
|
+
description: zod
|
|
16
|
+
.string()
|
|
17
|
+
.describe("The wording of the earlier invoice line as recorded when this invoice was created."),
|
|
18
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
19
|
+
period_end: zod.iso.datetime({ offset: true }).describe("Exclusive."),
|
|
20
|
+
remaining_amount: Money.describe("Before tax and discounts, the new configuration for the period."),
|
|
21
|
+
credited_amount: Money.describe("Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`."),
|
|
22
|
+
})
|
|
23
|
+
.describe("The value of one paid period moved to the new configuration of a subscription.");
|
|
@@ -61,7 +61,7 @@ export const OrderItem = zod
|
|
|
61
61
|
.describe("What it was called when bought. It does not follow later catalogue renames and is\nnot translated."),
|
|
62
62
|
quantity: zod.string(),
|
|
63
63
|
unit_amount: Money.optional().describe("The unit amount of the price this line is charged under. Absent for a tiered price, which has no\nsingle unit amount, and for a change that takes effect at once, which is charged as `gross_amount`\ndescribes."),
|
|
64
|
-
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price
|
|
64
|
+
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price for the time left in the paid period, at the subscription's own period price, minus\nthe amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the\ndifference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.\n\nUnder an inclusive tax rate it includes tax, as the price does, and the included part is\n`tax_included_amount`. A renewal at the agreed terms is the exception: the agreed amount excludes\ntax, and tax is added to it."),
|
|
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(),
|
|
@@ -31,7 +31,6 @@ export declare const Subscription: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -29,10 +29,6 @@ export const Subscription = zod
|
|
|
29
29
|
termination_policy: TerminationPolicy.optional(),
|
|
30
30
|
refund_policy: RefundPolicy.optional(),
|
|
31
31
|
order_item_id: zod.uuid().optional(),
|
|
32
|
-
replaces_subscription_id: zod
|
|
33
|
-
.uuid()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID."),
|
|
36
32
|
coupon_id: zod.uuid().optional(),
|
|
37
33
|
coupon: ObjectIdentity.optional(),
|
|
38
34
|
discounted_renewals_remaining: zod
|
|
@@ -31,7 +31,6 @@ export declare const SubscriptionList: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -1314,6 +1314,22 @@ export declare const InvoiceItemType: {
|
|
|
1314
1314
|
readonly setup: "setup";
|
|
1315
1315
|
readonly adjustment: "adjustment";
|
|
1316
1316
|
};
|
|
1317
|
+
/**
|
|
1318
|
+
* The value of one paid period moved to the new configuration of a subscription.
|
|
1319
|
+
*/
|
|
1320
|
+
export interface InvoiceItemProration {
|
|
1321
|
+
/** The earlier invoice line that paid for the period. */
|
|
1322
|
+
credited_invoice_item_id: string;
|
|
1323
|
+
/** The wording of the earlier invoice line as recorded when this invoice was created. */
|
|
1324
|
+
description: string;
|
|
1325
|
+
period_start: string;
|
|
1326
|
+
/** Exclusive. */
|
|
1327
|
+
period_end: string;
|
|
1328
|
+
/** Before tax and discounts, the new configuration for the period. */
|
|
1329
|
+
remaining_amount: Money;
|
|
1330
|
+
/** Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`. */
|
|
1331
|
+
credited_amount: Money;
|
|
1332
|
+
}
|
|
1317
1333
|
export interface InvoiceItem {
|
|
1318
1334
|
taxable?: boolean;
|
|
1319
1335
|
/** Discount applied to this line before tax. */
|
|
@@ -1359,6 +1375,11 @@ export interface InvoiceItem {
|
|
|
1359
1375
|
period_start?: string | null;
|
|
1360
1376
|
/** @nullable */
|
|
1361
1377
|
period_end?: string | null;
|
|
1378
|
+
/**
|
|
1379
|
+
* Present on a line that changes a subscription immediately, one entry for each paid period it
|
|
1380
|
+
* covers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries.
|
|
1381
|
+
*/
|
|
1382
|
+
prorations?: InvoiceItemProration[];
|
|
1362
1383
|
}
|
|
1363
1384
|
export interface InvoiceItemList {
|
|
1364
1385
|
items: InvoiceItem[];
|
|
@@ -1739,8 +1760,6 @@ export interface Subscription {
|
|
|
1739
1760
|
termination_policy?: TerminationPolicy;
|
|
1740
1761
|
refund_policy?: RefundPolicy;
|
|
1741
1762
|
order_item_id?: string;
|
|
1742
|
-
/** Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID. */
|
|
1743
|
-
replaces_subscription_id?: string;
|
|
1744
1763
|
coupon_id?: string;
|
|
1745
1764
|
coupon?: ObjectIdentity;
|
|
1746
1765
|
/** @minimum 0 */
|
|
@@ -2097,8 +2116,8 @@ export interface OrderItem {
|
|
|
2097
2116
|
/**
|
|
2098
2117
|
* Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`
|
|
2099
2118
|
* times `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is
|
|
2100
|
-
* the new price
|
|
2101
|
-
*
|
|
2119
|
+
* the new price for the time left in the paid period, at the subscription's own period price, minus
|
|
2120
|
+
* the amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the
|
|
2102
2121
|
* difference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.
|
|
2103
2122
|
*
|
|
2104
2123
|
* Under an inclusive tax rate it includes tax, as the price does, and the included part is
|
|
@@ -36,6 +36,14 @@ export declare const InvoiceItem: zod.ZodObject<{
|
|
|
36
36
|
currency: zod.ZodString;
|
|
37
37
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
38
38
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
40
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
41
|
+
description: zod.ZodString;
|
|
42
|
+
period_start: zod.z.ZodISODateTime;
|
|
43
|
+
period_end: zod.z.ZodISODateTime;
|
|
44
|
+
remaining_amount: zod.ZodString;
|
|
45
|
+
credited_amount: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>>>;
|
|
39
47
|
}, zod.z.core.$strict>;
|
|
40
48
|
export type InvoiceItem = zod.input<typeof InvoiceItem>;
|
|
41
49
|
export type InvoiceItemOutput = zod.output<typeof InvoiceItem>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* OpenAPI spec version: v1
|
|
7
7
|
*/
|
|
8
8
|
import * as zod from "zod";
|
|
9
|
+
import { InvoiceItemProration } from "./invoiceItemProration.zod.js";
|
|
9
10
|
import { Money } from "./money.zod.js";
|
|
10
11
|
import { NamedIdentity } from "./namedIdentity.zod.js";
|
|
11
12
|
export const InvoiceItem = zod.strictObject({
|
|
@@ -43,4 +44,8 @@ export const InvoiceItem = zod.strictObject({
|
|
|
43
44
|
currency: zod.string(),
|
|
44
45
|
period_start: zod.iso.datetime({ offset: true }).nullish(),
|
|
45
46
|
period_end: zod.iso.datetime({ offset: true }).nullish(),
|
|
47
|
+
prorations: zod
|
|
48
|
+
.array(InvoiceItemProration)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Present on a line that changes a subscription immediately, one entry for each paid period it\ncovers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries."),
|
|
46
51
|
});
|
|
@@ -37,6 +37,14 @@ export declare const InvoiceItemList: zod.ZodObject<{
|
|
|
37
37
|
currency: zod.ZodString;
|
|
38
38
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
39
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
40
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
41
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
42
|
+
description: zod.ZodString;
|
|
43
|
+
period_start: zod.z.ZodISODateTime;
|
|
44
|
+
period_end: zod.z.ZodISODateTime;
|
|
45
|
+
remaining_amount: zod.ZodString;
|
|
46
|
+
credited_amount: zod.ZodString;
|
|
47
|
+
}, zod.z.core.$strict>>>;
|
|
40
48
|
}, zod.z.core.$strict>>;
|
|
41
49
|
pagination: zod.ZodObject<{
|
|
42
50
|
page: zod.ZodInt;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 InvoiceItemProration: zod.ZodObject<{
|
|
10
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
11
|
+
description: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
remaining_amount: zod.ZodString;
|
|
15
|
+
credited_amount: zod.ZodString;
|
|
16
|
+
}, zod.z.core.$strict>;
|
|
17
|
+
export type InvoiceItemProration = zod.input<typeof InvoiceItemProration>;
|
|
18
|
+
export type InvoiceItemProrationOutput = zod.output<typeof InvoiceItemProration>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import { Money } from "./money.zod.js";
|
|
10
|
+
export const InvoiceItemProration = zod
|
|
11
|
+
.strictObject({
|
|
12
|
+
credited_invoice_item_id: zod
|
|
13
|
+
.uuid()
|
|
14
|
+
.describe("The earlier invoice line that paid for the period."),
|
|
15
|
+
description: zod
|
|
16
|
+
.string()
|
|
17
|
+
.describe("The wording of the earlier invoice line as recorded when this invoice was created."),
|
|
18
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
19
|
+
period_end: zod.iso.datetime({ offset: true }).describe("Exclusive."),
|
|
20
|
+
remaining_amount: Money.describe("Before tax and discounts, the new configuration for the period."),
|
|
21
|
+
credited_amount: Money.describe("Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`."),
|
|
22
|
+
})
|
|
23
|
+
.describe("The value of one paid period moved to the new configuration of a subscription.");
|
|
@@ -61,7 +61,7 @@ export const OrderItem = zod
|
|
|
61
61
|
.describe("What it was called when bought. It does not follow later catalogue renames and is\nnot translated."),
|
|
62
62
|
quantity: zod.string(),
|
|
63
63
|
unit_amount: Money.optional().describe("The unit amount of the price this line is charged under. Absent for a tiered price, which has no\nsingle unit amount, and for a change that takes effect at once, which is charged as `gross_amount`\ndescribes."),
|
|
64
|
-
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price
|
|
64
|
+
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price for the time left in the paid period, at the subscription's own period price, minus\nthe amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the\ndifference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.\n\nUnder an inclusive tax rate it includes tax, as the price does, and the included part is\n`tax_included_amount`. A renewal at the agreed terms is the exception: the agreed amount excludes\ntax, and tax is added to it."),
|
|
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(),
|
|
@@ -31,7 +31,6 @@ export declare const Subscription: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -29,10 +29,6 @@ export const Subscription = zod
|
|
|
29
29
|
termination_policy: TerminationPolicy.optional(),
|
|
30
30
|
refund_policy: RefundPolicy.optional(),
|
|
31
31
|
order_item_id: zod.uuid().optional(),
|
|
32
|
-
replaces_subscription_id: zod
|
|
33
|
-
.uuid()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID."),
|
|
36
32
|
coupon_id: zod.uuid().optional(),
|
|
37
33
|
coupon: ObjectIdentity.optional(),
|
|
38
34
|
discounted_renewals_remaining: zod
|
|
@@ -31,7 +31,6 @@ export declare const SubscriptionList: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -2000,6 +2000,22 @@ export declare const InvoiceItemType: {
|
|
|
2000
2000
|
readonly setup: "setup";
|
|
2001
2001
|
readonly adjustment: "adjustment";
|
|
2002
2002
|
};
|
|
2003
|
+
/**
|
|
2004
|
+
* The value of one paid period moved to the new configuration of a subscription.
|
|
2005
|
+
*/
|
|
2006
|
+
export interface InvoiceItemProration {
|
|
2007
|
+
/** The earlier invoice line that paid for the period. */
|
|
2008
|
+
credited_invoice_item_id: string;
|
|
2009
|
+
/** The wording of the earlier invoice line as recorded when this invoice was created. */
|
|
2010
|
+
description: string;
|
|
2011
|
+
period_start: string;
|
|
2012
|
+
/** Exclusive. */
|
|
2013
|
+
period_end: string;
|
|
2014
|
+
/** Before tax and discounts, the new configuration for the period. */
|
|
2015
|
+
remaining_amount: Money;
|
|
2016
|
+
/** Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`. */
|
|
2017
|
+
credited_amount: Money;
|
|
2018
|
+
}
|
|
2003
2019
|
export interface InvoiceItem {
|
|
2004
2020
|
taxable?: boolean;
|
|
2005
2021
|
/** Discount applied to this line before tax. */
|
|
@@ -2045,6 +2061,11 @@ export interface InvoiceItem {
|
|
|
2045
2061
|
period_start?: string | null;
|
|
2046
2062
|
/** @nullable */
|
|
2047
2063
|
period_end?: string | null;
|
|
2064
|
+
/**
|
|
2065
|
+
* Present on a line that changes a subscription immediately, one entry for each paid period it
|
|
2066
|
+
* covers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries.
|
|
2067
|
+
*/
|
|
2068
|
+
prorations?: InvoiceItemProration[];
|
|
2048
2069
|
}
|
|
2049
2070
|
export interface InvoiceItemList {
|
|
2050
2071
|
items: InvoiceItem[];
|
|
@@ -2425,8 +2446,6 @@ export interface Subscription {
|
|
|
2425
2446
|
termination_policy?: TerminationPolicy;
|
|
2426
2447
|
refund_policy?: RefundPolicy;
|
|
2427
2448
|
order_item_id?: string;
|
|
2428
|
-
/** Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID. */
|
|
2429
|
-
replaces_subscription_id?: string;
|
|
2430
2449
|
coupon_id?: string;
|
|
2431
2450
|
coupon?: ObjectIdentity;
|
|
2432
2451
|
/** @minimum 0 */
|
|
@@ -2749,8 +2768,8 @@ export interface OrderItem {
|
|
|
2749
2768
|
/**
|
|
2750
2769
|
* Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`
|
|
2751
2770
|
* times `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is
|
|
2752
|
-
* the new price
|
|
2753
|
-
*
|
|
2771
|
+
* the new price for the time left in the paid period, at the subscription's own period price, minus
|
|
2772
|
+
* the amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the
|
|
2754
2773
|
* difference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.
|
|
2755
2774
|
*
|
|
2756
2775
|
* Under an inclusive tax rate it includes tax, as the price does, and the included part is
|
|
@@ -59,6 +59,14 @@ export declare const InvoiceItem: zod.ZodObject<{
|
|
|
59
59
|
currency: zod.ZodString;
|
|
60
60
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
61
61
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
62
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
63
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
64
|
+
description: zod.ZodString;
|
|
65
|
+
period_start: zod.z.ZodISODateTime;
|
|
66
|
+
period_end: zod.z.ZodISODateTime;
|
|
67
|
+
remaining_amount: zod.ZodString;
|
|
68
|
+
credited_amount: zod.ZodString;
|
|
69
|
+
}, zod.z.core.$strict>>>;
|
|
62
70
|
}, zod.z.core.$strict>;
|
|
63
71
|
export type InvoiceItem = zod.input<typeof InvoiceItem>;
|
|
64
72
|
export type InvoiceItemOutput = zod.output<typeof InvoiceItem>;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* OpenAPI spec version: 1.0.0
|
|
30
30
|
*/
|
|
31
31
|
import * as zod from "zod";
|
|
32
|
+
import { InvoiceItemProration } from "./invoiceItemProration.zod.js";
|
|
32
33
|
import { Money } from "./money.zod.js";
|
|
33
34
|
import { NamedIdentity } from "./namedIdentity.zod.js";
|
|
34
35
|
export const InvoiceItem = zod.strictObject({
|
|
@@ -66,4 +67,8 @@ export const InvoiceItem = zod.strictObject({
|
|
|
66
67
|
currency: zod.string(),
|
|
67
68
|
period_start: zod.iso.datetime({ offset: true }).nullish(),
|
|
68
69
|
period_end: zod.iso.datetime({ offset: true }).nullish(),
|
|
70
|
+
prorations: zod
|
|
71
|
+
.array(InvoiceItemProration)
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Present on a line that changes a subscription immediately, one entry for each paid period it\ncovers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries."),
|
|
69
74
|
});
|
|
@@ -60,6 +60,14 @@ export declare const InvoiceItemList: zod.ZodObject<{
|
|
|
60
60
|
currency: zod.ZodString;
|
|
61
61
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
62
62
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
63
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
64
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
65
|
+
description: zod.ZodString;
|
|
66
|
+
period_start: zod.z.ZodISODateTime;
|
|
67
|
+
period_end: zod.z.ZodISODateTime;
|
|
68
|
+
remaining_amount: zod.ZodString;
|
|
69
|
+
credited_amount: zod.ZodString;
|
|
70
|
+
}, zod.z.core.$strict>>>;
|
|
63
71
|
}, zod.z.core.$strict>>;
|
|
64
72
|
pagination: zod.ZodObject<{
|
|
65
73
|
page: zod.ZodInt;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 InvoiceItemProration: zod.ZodObject<{
|
|
33
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
34
|
+
description: zod.ZodString;
|
|
35
|
+
period_start: zod.z.ZodISODateTime;
|
|
36
|
+
period_end: zod.z.ZodISODateTime;
|
|
37
|
+
remaining_amount: zod.ZodString;
|
|
38
|
+
credited_amount: zod.ZodString;
|
|
39
|
+
}, zod.z.core.$strict>;
|
|
40
|
+
export type InvoiceItemProration = zod.input<typeof InvoiceItemProration>;
|
|
41
|
+
export type InvoiceItemProrationOutput = zod.output<typeof InvoiceItemProration>;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
import { Money } from "./money.zod.js";
|
|
33
|
+
export const InvoiceItemProration = zod
|
|
34
|
+
.strictObject({
|
|
35
|
+
credited_invoice_item_id: zod
|
|
36
|
+
.uuid()
|
|
37
|
+
.describe("The earlier invoice line that paid for the period."),
|
|
38
|
+
description: zod
|
|
39
|
+
.string()
|
|
40
|
+
.describe("The wording of the earlier invoice line as recorded when this invoice was created."),
|
|
41
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
42
|
+
period_end: zod.iso.datetime({ offset: true }).describe("Exclusive."),
|
|
43
|
+
remaining_amount: Money.describe("Before tax and discounts, the new configuration for the period."),
|
|
44
|
+
credited_amount: Money.describe("Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`."),
|
|
45
|
+
})
|
|
46
|
+
.describe("The value of one paid period moved to the new configuration of a subscription.");
|
|
@@ -84,7 +84,7 @@ export const OrderItem = zod
|
|
|
84
84
|
.describe("What it was called when bought. It does not follow later catalogue renames and is\nnot translated."),
|
|
85
85
|
quantity: zod.string(),
|
|
86
86
|
unit_amount: Money.optional().describe("The unit amount of the price this line is charged under. Absent for a tiered price, which has no\nsingle unit amount, and for a change that takes effect at once, which is charged as `gross_amount`\ndescribes."),
|
|
87
|
-
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price
|
|
87
|
+
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price for the time left in the paid period, at the subscription's own period price, minus\nthe amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the\ndifference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.\n\nUnder an inclusive tax rate it includes tax, as the price does, and the included part is\n`tax_included_amount`. A renewal at the agreed terms is the exception: the agreed amount excludes\ntax, and tax is added to it."),
|
|
88
88
|
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."),
|
|
89
89
|
amount: Money.optional().describe("`gross_amount` less `discount_amount`."),
|
|
90
90
|
currency: zod.string(),
|
|
@@ -54,7 +54,6 @@ export declare const Subscription: zod.ZodObject<{
|
|
|
54
54
|
prorated: "prorated";
|
|
55
55
|
}>>;
|
|
56
56
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
57
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
58
57
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
59
58
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
60
59
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -52,10 +52,6 @@ export const Subscription = zod
|
|
|
52
52
|
termination_policy: TerminationPolicy.optional(),
|
|
53
53
|
refund_policy: RefundPolicy.optional(),
|
|
54
54
|
order_item_id: zod.uuid().optional(),
|
|
55
|
-
replaces_subscription_id: zod
|
|
56
|
-
.uuid()
|
|
57
|
-
.optional()
|
|
58
|
-
.describe("Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID."),
|
|
59
55
|
coupon_id: zod.uuid().optional(),
|
|
60
56
|
coupon: ObjectIdentity.optional(),
|
|
61
57
|
discounted_renewals_remaining: zod
|
|
@@ -54,7 +54,6 @@ export declare const SubscriptionList: zod.ZodObject<{
|
|
|
54
54
|
prorated: "prorated";
|
|
55
55
|
}>>;
|
|
56
56
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
57
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
58
57
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
59
58
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
60
59
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -1823,6 +1823,22 @@ export declare const InvoiceItemType: {
|
|
|
1823
1823
|
readonly setup: "setup";
|
|
1824
1824
|
readonly adjustment: "adjustment";
|
|
1825
1825
|
};
|
|
1826
|
+
/**
|
|
1827
|
+
* The value of one paid period moved to the new configuration of a subscription.
|
|
1828
|
+
*/
|
|
1829
|
+
export interface InvoiceItemProration {
|
|
1830
|
+
/** The earlier invoice line that paid for the period. */
|
|
1831
|
+
credited_invoice_item_id: string;
|
|
1832
|
+
/** The wording of the earlier invoice line as recorded when this invoice was created. */
|
|
1833
|
+
description: string;
|
|
1834
|
+
period_start: string;
|
|
1835
|
+
/** Exclusive. */
|
|
1836
|
+
period_end: string;
|
|
1837
|
+
/** Before tax and discounts, the new configuration for the period. */
|
|
1838
|
+
remaining_amount: Money;
|
|
1839
|
+
/** Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`. */
|
|
1840
|
+
credited_amount: Money;
|
|
1841
|
+
}
|
|
1826
1842
|
export interface InvoiceItem {
|
|
1827
1843
|
taxable?: boolean;
|
|
1828
1844
|
/** Discount applied to this line before tax. */
|
|
@@ -1868,6 +1884,11 @@ export interface InvoiceItem {
|
|
|
1868
1884
|
period_start?: string | null;
|
|
1869
1885
|
/** @nullable */
|
|
1870
1886
|
period_end?: string | null;
|
|
1887
|
+
/**
|
|
1888
|
+
* Present on a line that changes a subscription immediately, one entry for each paid period it
|
|
1889
|
+
* covers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries.
|
|
1890
|
+
*/
|
|
1891
|
+
prorations?: InvoiceItemProration[];
|
|
1871
1892
|
}
|
|
1872
1893
|
export interface InvoiceItemList {
|
|
1873
1894
|
items: InvoiceItem[];
|
|
@@ -2248,8 +2269,6 @@ export interface Subscription {
|
|
|
2248
2269
|
termination_policy?: TerminationPolicy;
|
|
2249
2270
|
refund_policy?: RefundPolicy;
|
|
2250
2271
|
order_item_id?: string;
|
|
2251
|
-
/** Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID. */
|
|
2252
|
-
replaces_subscription_id?: string;
|
|
2253
2272
|
coupon_id?: string;
|
|
2254
2273
|
coupon?: ObjectIdentity;
|
|
2255
2274
|
/** @minimum 0 */
|
|
@@ -2572,8 +2591,8 @@ export interface OrderItem {
|
|
|
2572
2591
|
/**
|
|
2573
2592
|
* Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`
|
|
2574
2593
|
* times `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is
|
|
2575
|
-
* the new price
|
|
2576
|
-
*
|
|
2594
|
+
* the new price for the time left in the paid period, at the subscription's own period price, minus
|
|
2595
|
+
* the amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the
|
|
2577
2596
|
* difference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.
|
|
2578
2597
|
*
|
|
2579
2598
|
* Under an inclusive tax rate it includes tax, as the price does, and the included part is
|
|
@@ -36,6 +36,14 @@ export declare const InvoiceItem: zod.ZodObject<{
|
|
|
36
36
|
currency: zod.ZodString;
|
|
37
37
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
38
38
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
40
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
41
|
+
description: zod.ZodString;
|
|
42
|
+
period_start: zod.z.ZodISODateTime;
|
|
43
|
+
period_end: zod.z.ZodISODateTime;
|
|
44
|
+
remaining_amount: zod.ZodString;
|
|
45
|
+
credited_amount: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>>>;
|
|
39
47
|
}, zod.z.core.$strict>;
|
|
40
48
|
export type InvoiceItem = zod.input<typeof InvoiceItem>;
|
|
41
49
|
export type InvoiceItemOutput = zod.output<typeof InvoiceItem>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* OpenAPI spec version: 1.0.0
|
|
7
7
|
*/
|
|
8
8
|
import * as zod from "zod";
|
|
9
|
+
import { InvoiceItemProration } from "./invoiceItemProration.zod.js";
|
|
9
10
|
import { Money } from "./money.zod.js";
|
|
10
11
|
import { NamedIdentity } from "./namedIdentity.zod.js";
|
|
11
12
|
export const InvoiceItem = zod.strictObject({
|
|
@@ -43,4 +44,8 @@ export const InvoiceItem = zod.strictObject({
|
|
|
43
44
|
currency: zod.string(),
|
|
44
45
|
period_start: zod.iso.datetime({ offset: true }).nullish(),
|
|
45
46
|
period_end: zod.iso.datetime({ offset: true }).nullish(),
|
|
47
|
+
prorations: zod
|
|
48
|
+
.array(InvoiceItemProration)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Present on a line that changes a subscription immediately, one entry for each paid period it\ncovers. `amount` is the sum of `remaining_amount` minus `credited_amount` over the entries."),
|
|
46
51
|
});
|
|
@@ -37,6 +37,14 @@ export declare const InvoiceItemList: zod.ZodObject<{
|
|
|
37
37
|
currency: zod.ZodString;
|
|
38
38
|
period_start: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
39
39
|
period_end: zod.ZodOptional<zod.ZodNullable<zod.z.ZodISODateTime>>;
|
|
40
|
+
prorations: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
41
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
42
|
+
description: zod.ZodString;
|
|
43
|
+
period_start: zod.z.ZodISODateTime;
|
|
44
|
+
period_end: zod.z.ZodISODateTime;
|
|
45
|
+
remaining_amount: zod.ZodString;
|
|
46
|
+
credited_amount: zod.ZodString;
|
|
47
|
+
}, zod.z.core.$strict>>>;
|
|
40
48
|
}, zod.z.core.$strict>>;
|
|
41
49
|
pagination: zod.ZodObject<{
|
|
42
50
|
page: zod.ZodInt;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 InvoiceItemProration: zod.ZodObject<{
|
|
10
|
+
credited_invoice_item_id: zod.ZodUUID;
|
|
11
|
+
description: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
remaining_amount: zod.ZodString;
|
|
15
|
+
credited_amount: zod.ZodString;
|
|
16
|
+
}, zod.z.core.$strict>;
|
|
17
|
+
export type InvoiceItemProration = zod.input<typeof InvoiceItemProration>;
|
|
18
|
+
export type InvoiceItemProrationOutput = zod.output<typeof InvoiceItemProration>;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { Money } from "./money.zod.js";
|
|
10
|
+
export const InvoiceItemProration = zod
|
|
11
|
+
.strictObject({
|
|
12
|
+
credited_invoice_item_id: zod
|
|
13
|
+
.uuid()
|
|
14
|
+
.describe("The earlier invoice line that paid for the period."),
|
|
15
|
+
description: zod
|
|
16
|
+
.string()
|
|
17
|
+
.describe("The wording of the earlier invoice line as recorded when this invoice was created."),
|
|
18
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
19
|
+
period_end: zod.iso.datetime({ offset: true }).describe("Exclusive."),
|
|
20
|
+
remaining_amount: Money.describe("Before tax and discounts, the new configuration for the period."),
|
|
21
|
+
credited_amount: Money.describe("Before tax, the unused value of the earlier line for the period, credited against `remaining_amount`."),
|
|
22
|
+
})
|
|
23
|
+
.describe("The value of one paid period moved to the new configuration of a subscription.");
|
|
@@ -61,7 +61,7 @@ export const OrderItem = zod
|
|
|
61
61
|
.describe("What it was called when bought. It does not follow later catalogue renames and is\nnot translated."),
|
|
62
62
|
quantity: zod.string(),
|
|
63
63
|
unit_amount: Money.optional().describe("The unit amount of the price this line is charged under. Absent for a tiered price, which has no\nsingle unit amount, and for a change that takes effect at once, which is charged as `gross_amount`\ndescribes."),
|
|
64
|
-
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price
|
|
64
|
+
gross_amount: Money.optional().describe("Before discounts: the price applied to the quantity, which for a per-unit price is `unit_amount`\ntimes `quantity`; a minimum charge can make it higher. For an upgrade that takes effect at once it is\nthe new price for the time left in the paid period, at the subscription's own period price, minus\nthe amount paid for that time, and the period end does not move; a downgrade charges nothing and may refund the\ndifference instead. A change between equal period prices charges and refunds nothing. The setup fee is not part of it; see `setup_amount`.\n\nUnder an inclusive tax rate it includes tax, as the price does, and the included part is\n`tax_included_amount`. A renewal at the agreed terms is the exception: the agreed amount excludes\ntax, and tax is added to it."),
|
|
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(),
|
|
@@ -31,7 +31,6 @@ export declare const Subscription: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|
|
@@ -29,10 +29,6 @@ export const Subscription = zod
|
|
|
29
29
|
termination_policy: TerminationPolicy.optional(),
|
|
30
30
|
refund_policy: RefundPolicy.optional(),
|
|
31
31
|
order_item_id: zod.uuid().optional(),
|
|
32
|
-
replaces_subscription_id: zod
|
|
33
|
-
.uuid()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Present only on subscriptions created by an earlier change that replaced the subscription. A change now keeps the subscription ID."),
|
|
36
32
|
coupon_id: zod.uuid().optional(),
|
|
37
33
|
coupon: ObjectIdentity.optional(),
|
|
38
34
|
discounted_renewals_remaining: zod
|
|
@@ -31,7 +31,6 @@ export declare const SubscriptionList: zod.ZodObject<{
|
|
|
31
31
|
prorated: "prorated";
|
|
32
32
|
}>>;
|
|
33
33
|
order_item_id: zod.ZodOptional<zod.ZodUUID>;
|
|
34
|
-
replaces_subscription_id: zod.ZodOptional<zod.ZodUUID>;
|
|
35
34
|
coupon_id: zod.ZodOptional<zod.ZodUUID>;
|
|
36
35
|
coupon: zod.ZodOptional<zod.ZodObject<{
|
|
37
36
|
lookup_key: zod.ZodOptional<zod.ZodString>;
|