@leaflow/sdk 0.0.0-dev.538.g0285c19 → 0.0.0-dev.541.g49c432c

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.
@@ -1131,7 +1131,7 @@ export interface InvoiceItem {
1131
1131
  */
1132
1132
  discount_id?: string | null;
1133
1133
  /**
1134
- * The coupon applied to this line.
1134
+ * The coupon whose discount this line gets, including one continuing on a renewal from the purchase that first used it.
1135
1135
  * @nullable
1136
1136
  */
1137
1137
  coupon_id?: string | null;
@@ -2074,6 +2074,12 @@ export interface CheckoutSessionItem {
2074
2074
  amount: Money | null;
2075
2075
  /** Total reduction on this item, including any continuing renewal discount. */
2076
2076
  discount_amount: Money | null;
2077
+ /**
2078
+ * The coupon behind `discount_amount`, so the discount can be named: the one this checkout applies, or on
2079
+ * a renewal the one continuing from the purchase that first used it. Null when the item has no coupon
2080
+ * discount.
2081
+ */
2082
+ coupon: ObjectIdentity | null;
2077
2083
  /** Tax on the discounted amount, including any tax already contained in that amount. */
2078
2084
  tax_amount: Money | null;
2079
2085
  /** The part of tax_amount already contained in amount minus discount_amount. */
@@ -303,6 +303,11 @@ export declare const CheckoutSession: zod.ZodObject<{
303
303
  recurring_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
304
304
  amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
305
305
  discount_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
306
+ coupon: zod.ZodUnion<readonly [zod.ZodObject<{
307
+ lookup_key: zod.ZodOptional<zod.ZodString>;
308
+ id: zod.ZodUUID;
309
+ name: zod.ZodString;
310
+ }, zod.z.core.$strict>, zod.ZodNull]>;
306
311
  tax_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
307
312
  tax_included_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
308
313
  total: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -37,6 +37,11 @@ export declare const CheckoutSessionItem: zod.ZodObject<{
37
37
  recurring_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
38
38
  amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
39
39
  discount_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
40
+ coupon: zod.ZodUnion<readonly [zod.ZodObject<{
41
+ lookup_key: zod.ZodOptional<zod.ZodString>;
42
+ id: zod.ZodUUID;
43
+ name: zod.ZodString;
44
+ }, zod.z.core.$strict>, zod.ZodNull]>;
40
45
  tax_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
41
46
  tax_included_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
42
47
  total: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -8,6 +8,7 @@
8
8
  import * as zod from "zod";
9
9
  import { CheckoutSessionItemDowngradeRefund } from "./checkoutSessionItemDowngradeRefund.zod.js";
10
10
  import { Money } from "./money.zod.js";
11
+ import { ObjectIdentity } from "./objectIdentity.zod.js";
11
12
  import { PriceType } from "./priceType.zod.js";
12
13
  import { ProductId } from "./productId.zod.js";
13
14
  import { UsageType } from "./usageType.zod.js";
@@ -65,6 +66,9 @@ export const CheckoutSessionItem = zod
65
66
  discount_amount: zod
66
67
  .union([Money, zod.null()])
67
68
  .describe("Total reduction on this item, including any continuing renewal discount."),
69
+ coupon: zod
70
+ .union([ObjectIdentity, zod.null()])
71
+ .describe("The coupon behind `discount_amount`, so the discount can be named: the one this checkout applies, or on\na renewal the one continuing from the purchase that first used it. Null when the item has no coupon\ndiscount."),
68
72
  tax_amount: zod
69
73
  .union([Money, zod.null()])
70
74
  .describe("Tax on the discounted amount, including any tax already contained in that amount."),
@@ -304,6 +304,11 @@ export declare const CheckoutSessionList: zod.ZodObject<{
304
304
  recurring_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
305
305
  amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
306
306
  discount_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
307
+ coupon: zod.ZodUnion<readonly [zod.ZodObject<{
308
+ lookup_key: zod.ZodOptional<zod.ZodString>;
309
+ id: zod.ZodUUID;
310
+ name: zod.ZodString;
311
+ }, zod.z.core.$strict>, zod.ZodNull]>;
307
312
  tax_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
308
313
  tax_included_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
309
314
  total: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -304,6 +304,11 @@ export declare const CheckoutSessionResult: zod.ZodObject<{
304
304
  recurring_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
305
305
  amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
306
306
  discount_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
307
+ coupon: zod.ZodUnion<readonly [zod.ZodObject<{
308
+ lookup_key: zod.ZodOptional<zod.ZodString>;
309
+ id: zod.ZodUUID;
310
+ name: zod.ZodString;
311
+ }, zod.z.core.$strict>, zod.ZodNull]>;
307
312
  tax_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
308
313
  tax_included_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
309
314
  total: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -80,6 +80,11 @@ export declare const CheckoutSessionSubscription: zod.ZodObject<{
80
80
  recurring_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
81
81
  amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
82
82
  discount_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
83
+ coupon: zod.ZodUnion<readonly [zod.ZodObject<{
84
+ lookup_key: zod.ZodOptional<zod.ZodString>;
85
+ id: zod.ZodUUID;
86
+ name: zod.ZodString;
87
+ }, zod.z.core.$strict>, zod.ZodNull]>;
83
88
  tax_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
84
89
  tax_included_amount: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
85
90
  total: zod.ZodUnion<readonly [zod.ZodString, zod.ZodNull]>;
@@ -13,7 +13,10 @@ export const InvoiceItem = zod.strictObject({
13
13
  taxable: zod.boolean().optional(),
14
14
  discount_amount: zod.string().optional().describe("Discount applied to this line before tax."),
15
15
  discount_id: zod.uuid().nullish().describe("The account discount applied to this line."),
16
- coupon_id: zod.uuid().nullish().describe("The coupon applied to this line."),
16
+ coupon_id: zod
17
+ .uuid()
18
+ .nullish()
19
+ .describe("The coupon whose discount this line gets, including one continuing on a renewal from the purchase that first used it."),
17
20
  tax_amount: zod
18
21
  .string()
19
22
  .optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.0.0-dev.538.g0285c19",
3
+ "version": "0.0.0-dev.541.g49c432c",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {