@polar-sh/sdk 0.8.2 → 0.9.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/README.md +7 -6
- package/docs/sdks/products/README.md +2 -2
- package/funcs/advertisementsList.js +2 -2
- package/funcs/advertisementsList.js.map +1 -1
- package/funcs/articlesList.js +2 -2
- package/funcs/articlesList.js.map +1 -1
- package/funcs/benefitsGrants.js +2 -2
- package/funcs/benefitsGrants.js.map +1 -1
- package/funcs/benefitsList.js +2 -2
- package/funcs/benefitsList.js.map +1 -1
- package/funcs/externalOrganizationsList.js +2 -2
- package/funcs/externalOrganizationsList.js.map +1 -1
- package/funcs/filesList.js +2 -2
- package/funcs/filesList.js.map +1 -1
- package/funcs/licenseKeysList.js +2 -2
- package/funcs/licenseKeysList.js.map +1 -1
- package/funcs/oauth2ClientsList.js +2 -2
- package/funcs/oauth2ClientsList.js.map +1 -1
- package/funcs/ordersList.js +2 -2
- package/funcs/ordersList.js.map +1 -1
- package/funcs/organizationsList.js +2 -2
- package/funcs/organizationsList.js.map +1 -1
- package/funcs/productsList.js +2 -2
- package/funcs/productsList.js.map +1 -1
- package/funcs/repositoriesList.js +2 -2
- package/funcs/repositoriesList.js.map +1 -1
- package/funcs/subscriptionsList.js +2 -2
- package/funcs/subscriptionsList.js.map +1 -1
- package/funcs/usersAdvertisementsList.js +2 -2
- package/funcs/usersAdvertisementsList.js.map +1 -1
- package/funcs/usersBenefitsList.js +2 -2
- package/funcs/usersBenefitsList.js.map +1 -1
- package/funcs/usersDownloadablesList.js +2 -2
- package/funcs/usersDownloadablesList.js.map +1 -1
- package/funcs/usersLicenseKeysList.js +2 -2
- package/funcs/usersLicenseKeysList.js.map +1 -1
- package/funcs/usersOrdersList.js +2 -2
- package/funcs/usersOrdersList.js.map +1 -1
- package/funcs/usersSubscriptionsList.js +2 -2
- package/funcs/usersSubscriptionsList.js.map +1 -1
- package/lib/config.d.ts +16 -5
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +18 -12
- package/lib/config.js.map +1 -1
- package/models/components/bodysubscriptionsimport.d.ts +2 -2
- package/models/components/bodysubscriptionsimport.d.ts.map +1 -1
- package/models/components/bodysubscriptionsimport.js +2 -0
- package/models/components/bodysubscriptionsimport.js.map +1 -1
- package/models/components/index.d.ts +9 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +9 -3
- package/models/components/index.js.map +1 -1
- package/models/components/ordersubscription.d.ts +7 -0
- package/models/components/ordersubscription.d.ts.map +1 -1
- package/models/components/ordersubscription.js +9 -0
- package/models/components/ordersubscription.js.map +1 -1
- package/models/components/organizationfeaturesettings.d.ts +0 -5
- package/models/components/organizationfeaturesettings.d.ts.map +1 -1
- package/models/components/organizationfeaturesettings.js +0 -4
- package/models/components/organizationfeaturesettings.js.map +1 -1
- package/models/components/productonetimecreate.d.ts +23 -3
- package/models/components/productonetimecreate.d.ts.map +1 -1
- package/models/components/productonetimecreate.js +33 -4
- package/models/components/productonetimecreate.js.map +1 -1
- package/models/components/productpriceinput.d.ts +3 -11
- package/models/components/productpriceinput.d.ts.map +1 -1
- package/models/components/productpriceinput.js +5 -13
- package/models/components/productpriceinput.js.map +1 -1
- package/models/components/productpriceonetime.d.ts +4 -71
- package/models/components/productpriceonetime.d.ts.map +1 -1
- package/models/components/productpriceonetime.js +11 -57
- package/models/components/productpriceonetime.js.map +1 -1
- package/models/components/productpriceonetimecustom.d.ts +124 -0
- package/models/components/productpriceonetimecustom.d.ts.map +1 -0
- package/models/components/productpriceonetimecustom.js +130 -0
- package/models/components/productpriceonetimecustom.js.map +1 -0
- package/models/components/productpriceonetimecustomcreate.d.ts +71 -0
- package/models/components/productpriceonetimecustomcreate.d.ts.map +1 -0
- package/models/components/productpriceonetimecustomcreate.js +91 -0
- package/models/components/productpriceonetimecustomcreate.js.map +1 -0
- package/models/components/productpriceonetimefixed.d.ts +114 -0
- package/models/components/productpriceonetimefixed.d.ts.map +1 -0
- package/models/components/productpriceonetimefixed.js +122 -0
- package/models/components/productpriceonetimefixed.js.map +1 -0
- package/models/components/productpriceonetimefixedcreate.d.ts +61 -0
- package/models/components/productpriceonetimefixedcreate.d.ts.map +1 -0
- package/models/components/{productpriceonetimecreate.js → productpriceonetimefixedcreate.js} +25 -25
- package/models/components/productpriceonetimefixedcreate.js.map +1 -0
- package/models/components/productpriceoutput.d.ts +3 -11
- package/models/components/productpriceoutput.d.ts.map +1 -1
- package/models/components/productpriceoutput.js +5 -13
- package/models/components/productpriceoutput.js.map +1 -1
- package/models/components/productpricerecurringcreate.d.ts +7 -7
- package/models/components/productpricerecurringcreate.d.ts.map +1 -1
- package/models/components/productpricerecurringcreate.js +9 -9
- package/models/components/productpricerecurringcreate.js.map +1 -1
- package/models/components/productpricerecurringcustom.d.ts +130 -0
- package/models/components/productpricerecurringcustom.d.ts.map +1 -0
- package/models/components/productpricerecurringcustom.js +135 -0
- package/models/components/productpricerecurringcustom.js.map +1 -0
- package/models/components/productpricerecurringfixed.d.ts +120 -0
- package/models/components/productpricerecurringfixed.d.ts.map +1 -0
- package/models/components/productpricerecurringfixed.js +128 -0
- package/models/components/productpricerecurringfixed.js.map +1 -0
- package/models/components/productpricerecurringinput.d.ts +31 -0
- package/models/components/productpricerecurringinput.d.ts.map +1 -0
- package/models/components/productpricerecurringinput.js +62 -0
- package/models/components/productpricerecurringinput.js.map +1 -0
- package/models/components/productpricerecurringoutput.d.ts +31 -0
- package/models/components/productpricerecurringoutput.d.ts.map +1 -0
- package/models/components/productpricerecurringoutput.js +62 -0
- package/models/components/productpricerecurringoutput.js.map +1 -0
- package/models/components/productupdate.d.ts +15 -14
- package/models/components/productupdate.d.ts.map +1 -1
- package/models/components/productupdate.js +20 -16
- package/models/components/productupdate.js.map +1 -1
- package/models/components/subscriptioninput.d.ts +7 -0
- package/models/components/subscriptioninput.d.ts.map +1 -1
- package/models/components/subscriptioninput.js +9 -0
- package/models/components/subscriptioninput.js.map +1 -1
- package/models/components/subscriptionoutput.d.ts +7 -0
- package/models/components/subscriptionoutput.d.ts.map +1 -1
- package/models/components/subscriptionoutput.js +9 -0
- package/models/components/subscriptionoutput.js.map +1 -1
- package/models/components/subscriptionrecurringinterval.d.ts +28 -0
- package/models/components/{productpricerecurringinterval.d.ts.map → subscriptionrecurringinterval.d.ts.map} +1 -1
- package/models/components/{productpricerecurringinterval.js → subscriptionrecurringinterval.js} +12 -12
- package/models/components/{productpricerecurringinterval.js.map → subscriptionrecurringinterval.js.map} +1 -1
- package/models/components/subscriptionsortproperty.d.ts +6 -6
- package/models/components/subscriptionsortproperty.js +2 -2
- package/models/components/subscriptionsortproperty.js.map +1 -1
- package/models/components/userordersubscription.d.ts +7 -0
- package/models/components/userordersubscription.d.ts.map +1 -1
- package/models/components/userordersubscription.js +9 -0
- package/models/components/userordersubscription.js.map +1 -1
- package/models/components/usersubscription.d.ts +10 -0
- package/models/components/usersubscription.d.ts.map +1 -1
- package/models/components/usersubscription.js +9 -0
- package/models/components/usersubscription.js.map +1 -1
- package/models/components/usersubscriptionsortproperty.d.ts +6 -6
- package/models/components/usersubscriptionsortproperty.js +2 -2
- package/models/components/usersubscriptionsortproperty.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/advertisementsList.ts +2 -2
- package/src/funcs/articlesList.ts +2 -2
- package/src/funcs/benefitsGrants.ts +2 -2
- package/src/funcs/benefitsList.ts +2 -2
- package/src/funcs/externalOrganizationsList.ts +2 -2
- package/src/funcs/filesList.ts +2 -2
- package/src/funcs/licenseKeysList.ts +2 -2
- package/src/funcs/oauth2ClientsList.ts +2 -2
- package/src/funcs/ordersList.ts +2 -2
- package/src/funcs/organizationsList.ts +2 -2
- package/src/funcs/productsList.ts +2 -2
- package/src/funcs/repositoriesList.ts +2 -2
- package/src/funcs/subscriptionsList.ts +2 -2
- package/src/funcs/usersAdvertisementsList.ts +2 -2
- package/src/funcs/usersBenefitsList.ts +2 -2
- package/src/funcs/usersDownloadablesList.ts +2 -2
- package/src/funcs/usersLicenseKeysList.ts +2 -2
- package/src/funcs/usersOrdersList.ts +2 -2
- package/src/funcs/usersSubscriptionsList.ts +2 -2
- package/src/lib/config.ts +18 -12
- package/src/models/components/bodysubscriptionsimport.ts +4 -2
- package/src/models/components/index.ts +9 -3
- package/src/models/components/ordersubscription.ts +19 -0
- package/src/models/components/organizationfeaturesettings.ts +0 -9
- package/src/models/components/productonetimecreate.ts +69 -9
- package/src/models/components/productpriceinput.ts +13 -29
- package/src/models/components/productpriceonetime.ts +27 -115
- package/src/models/components/productpriceonetimecustom.ts +201 -0
- package/src/models/components/productpriceonetimecustomcreate.ts +122 -0
- package/src/models/components/productpriceonetimefixed.ts +182 -0
- package/src/models/components/productpriceonetimefixedcreate.ts +103 -0
- package/src/models/components/productpriceoutput.ts +13 -29
- package/src/models/components/productpricerecurringcreate.ts +18 -18
- package/src/models/components/productpricerecurringcustom.ts +216 -0
- package/src/models/components/productpricerecurringfixed.ts +191 -0
- package/src/models/components/productpricerecurringinput.ts +75 -0
- package/src/models/components/productpricerecurringoutput.ts +75 -0
- package/src/models/components/productupdate.ts +49 -32
- package/src/models/components/subscriptioninput.ts +19 -0
- package/src/models/components/subscriptionoutput.ts +19 -0
- package/src/models/components/subscriptionrecurringinterval.ts +35 -0
- package/src/models/components/subscriptionsortproperty.ts +2 -2
- package/src/models/components/userordersubscription.ts +19 -0
- package/src/models/components/usersubscription.ts +22 -0
- package/src/models/components/usersubscriptionsortproperty.ts +2 -2
- package/models/components/productpriceonetimecreate.d.ts +0 -61
- package/models/components/productpriceonetimecreate.d.ts.map +0 -1
- package/models/components/productpriceonetimecreate.js.map +0 -1
- package/models/components/productpricerecurring.d.ts +0 -96
- package/models/components/productpricerecurring.d.ts.map +0 -1
- package/models/components/productpricerecurring.js +0 -105
- package/models/components/productpricerecurring.js.map +0 -1
- package/models/components/productpricerecurringinterval.d.ts +0 -28
- package/src/models/components/productpriceonetimecreate.ts +0 -102
- package/src/models/components/productpricerecurring.ts +0 -161
- package/src/models/components/productpricerecurringinterval.ts +0 -35
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ProductPriceOneTimeFixedAmountType = {
|
|
10
|
+
Fixed: "fixed",
|
|
11
|
+
} as const;
|
|
12
|
+
export type ProductPriceOneTimeFixedAmountType = ClosedEnum<
|
|
13
|
+
typeof ProductPriceOneTimeFixedAmountType
|
|
14
|
+
>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The type of the price.
|
|
18
|
+
*/
|
|
19
|
+
export const ProductPriceOneTimeFixedType = {
|
|
20
|
+
OneTime: "one_time",
|
|
21
|
+
} as const;
|
|
22
|
+
/**
|
|
23
|
+
* The type of the price.
|
|
24
|
+
*/
|
|
25
|
+
export type ProductPriceOneTimeFixedType = ClosedEnum<
|
|
26
|
+
typeof ProductPriceOneTimeFixedType
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A one-time price for a product.
|
|
31
|
+
*/
|
|
32
|
+
export type ProductPriceOneTimeFixed = {
|
|
33
|
+
/**
|
|
34
|
+
* Creation timestamp of the object.
|
|
35
|
+
*/
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
/**
|
|
38
|
+
* Last modification timestamp of the object.
|
|
39
|
+
*/
|
|
40
|
+
modifiedAt: Date | null;
|
|
41
|
+
/**
|
|
42
|
+
* The ID of the price.
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
amountType?: "fixed" | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* The currency.
|
|
48
|
+
*/
|
|
49
|
+
priceCurrency: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the price is archived and no longer available.
|
|
52
|
+
*/
|
|
53
|
+
isArchived: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The price in cents.
|
|
56
|
+
*/
|
|
57
|
+
priceAmount: number;
|
|
58
|
+
/**
|
|
59
|
+
* The type of the price.
|
|
60
|
+
*/
|
|
61
|
+
type?: "one_time" | undefined;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const ProductPriceOneTimeFixedAmountType$inboundSchema: z.ZodNativeEnum<
|
|
66
|
+
typeof ProductPriceOneTimeFixedAmountType
|
|
67
|
+
> = z.nativeEnum(ProductPriceOneTimeFixedAmountType);
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const ProductPriceOneTimeFixedAmountType$outboundSchema: z.ZodNativeEnum<
|
|
71
|
+
typeof ProductPriceOneTimeFixedAmountType
|
|
72
|
+
> = ProductPriceOneTimeFixedAmountType$inboundSchema;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
77
|
+
*/
|
|
78
|
+
export namespace ProductPriceOneTimeFixedAmountType$ {
|
|
79
|
+
/** @deprecated use `ProductPriceOneTimeFixedAmountType$inboundSchema` instead. */
|
|
80
|
+
export const inboundSchema = ProductPriceOneTimeFixedAmountType$inboundSchema;
|
|
81
|
+
/** @deprecated use `ProductPriceOneTimeFixedAmountType$outboundSchema` instead. */
|
|
82
|
+
export const outboundSchema =
|
|
83
|
+
ProductPriceOneTimeFixedAmountType$outboundSchema;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const ProductPriceOneTimeFixedType$inboundSchema: z.ZodNativeEnum<
|
|
88
|
+
typeof ProductPriceOneTimeFixedType
|
|
89
|
+
> = z.nativeEnum(ProductPriceOneTimeFixedType);
|
|
90
|
+
|
|
91
|
+
/** @internal */
|
|
92
|
+
export const ProductPriceOneTimeFixedType$outboundSchema: z.ZodNativeEnum<
|
|
93
|
+
typeof ProductPriceOneTimeFixedType
|
|
94
|
+
> = ProductPriceOneTimeFixedType$inboundSchema;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
99
|
+
*/
|
|
100
|
+
export namespace ProductPriceOneTimeFixedType$ {
|
|
101
|
+
/** @deprecated use `ProductPriceOneTimeFixedType$inboundSchema` instead. */
|
|
102
|
+
export const inboundSchema = ProductPriceOneTimeFixedType$inboundSchema;
|
|
103
|
+
/** @deprecated use `ProductPriceOneTimeFixedType$outboundSchema` instead. */
|
|
104
|
+
export const outboundSchema = ProductPriceOneTimeFixedType$outboundSchema;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** @internal */
|
|
108
|
+
export const ProductPriceOneTimeFixed$inboundSchema: z.ZodType<
|
|
109
|
+
ProductPriceOneTimeFixed,
|
|
110
|
+
z.ZodTypeDef,
|
|
111
|
+
unknown
|
|
112
|
+
> = z.object({
|
|
113
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
114
|
+
modified_at: z.nullable(
|
|
115
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
116
|
+
),
|
|
117
|
+
id: z.string(),
|
|
118
|
+
amount_type: z.literal("fixed").optional(),
|
|
119
|
+
price_currency: z.string(),
|
|
120
|
+
is_archived: z.boolean(),
|
|
121
|
+
price_amount: z.number().int(),
|
|
122
|
+
type: z.literal("one_time").optional(),
|
|
123
|
+
}).transform((v) => {
|
|
124
|
+
return remap$(v, {
|
|
125
|
+
"created_at": "createdAt",
|
|
126
|
+
"modified_at": "modifiedAt",
|
|
127
|
+
"amount_type": "amountType",
|
|
128
|
+
"price_currency": "priceCurrency",
|
|
129
|
+
"is_archived": "isArchived",
|
|
130
|
+
"price_amount": "priceAmount",
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
/** @internal */
|
|
135
|
+
export type ProductPriceOneTimeFixed$Outbound = {
|
|
136
|
+
created_at: string;
|
|
137
|
+
modified_at: string | null;
|
|
138
|
+
id: string;
|
|
139
|
+
amount_type: "fixed";
|
|
140
|
+
price_currency: string;
|
|
141
|
+
is_archived: boolean;
|
|
142
|
+
price_amount: number;
|
|
143
|
+
type: "one_time";
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/** @internal */
|
|
147
|
+
export const ProductPriceOneTimeFixed$outboundSchema: z.ZodType<
|
|
148
|
+
ProductPriceOneTimeFixed$Outbound,
|
|
149
|
+
z.ZodTypeDef,
|
|
150
|
+
ProductPriceOneTimeFixed
|
|
151
|
+
> = z.object({
|
|
152
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
153
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
154
|
+
id: z.string(),
|
|
155
|
+
amountType: z.literal("fixed").default("fixed"),
|
|
156
|
+
priceCurrency: z.string(),
|
|
157
|
+
isArchived: z.boolean(),
|
|
158
|
+
priceAmount: z.number().int(),
|
|
159
|
+
type: z.literal("one_time").default("one_time"),
|
|
160
|
+
}).transform((v) => {
|
|
161
|
+
return remap$(v, {
|
|
162
|
+
createdAt: "created_at",
|
|
163
|
+
modifiedAt: "modified_at",
|
|
164
|
+
amountType: "amount_type",
|
|
165
|
+
priceCurrency: "price_currency",
|
|
166
|
+
isArchived: "is_archived",
|
|
167
|
+
priceAmount: "price_amount",
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* @internal
|
|
173
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
174
|
+
*/
|
|
175
|
+
export namespace ProductPriceOneTimeFixed$ {
|
|
176
|
+
/** @deprecated use `ProductPriceOneTimeFixed$inboundSchema` instead. */
|
|
177
|
+
export const inboundSchema = ProductPriceOneTimeFixed$inboundSchema;
|
|
178
|
+
/** @deprecated use `ProductPriceOneTimeFixed$outboundSchema` instead. */
|
|
179
|
+
export const outboundSchema = ProductPriceOneTimeFixed$outboundSchema;
|
|
180
|
+
/** @deprecated use `ProductPriceOneTimeFixed$Outbound` instead. */
|
|
181
|
+
export type Outbound = ProductPriceOneTimeFixed$Outbound;
|
|
182
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ProductPriceOneTimeFixedCreateType = {
|
|
10
|
+
OneTime: "one_time",
|
|
11
|
+
} as const;
|
|
12
|
+
export type ProductPriceOneTimeFixedCreateType = ClosedEnum<
|
|
13
|
+
typeof ProductPriceOneTimeFixedCreateType
|
|
14
|
+
>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Schema to create a one-time product price.
|
|
18
|
+
*/
|
|
19
|
+
export type ProductPriceOneTimeFixedCreate = {
|
|
20
|
+
type?: "one_time" | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The currency. Currently, only `usd` is supported.
|
|
23
|
+
*/
|
|
24
|
+
priceCurrency?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The price in cents.
|
|
27
|
+
*/
|
|
28
|
+
priceAmount: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const ProductPriceOneTimeFixedCreateType$inboundSchema: z.ZodNativeEnum<
|
|
33
|
+
typeof ProductPriceOneTimeFixedCreateType
|
|
34
|
+
> = z.nativeEnum(ProductPriceOneTimeFixedCreateType);
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ProductPriceOneTimeFixedCreateType$outboundSchema: z.ZodNativeEnum<
|
|
38
|
+
typeof ProductPriceOneTimeFixedCreateType
|
|
39
|
+
> = ProductPriceOneTimeFixedCreateType$inboundSchema;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace ProductPriceOneTimeFixedCreateType$ {
|
|
46
|
+
/** @deprecated use `ProductPriceOneTimeFixedCreateType$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = ProductPriceOneTimeFixedCreateType$inboundSchema;
|
|
48
|
+
/** @deprecated use `ProductPriceOneTimeFixedCreateType$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema =
|
|
50
|
+
ProductPriceOneTimeFixedCreateType$outboundSchema;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const ProductPriceOneTimeFixedCreate$inboundSchema: z.ZodType<
|
|
55
|
+
ProductPriceOneTimeFixedCreate,
|
|
56
|
+
z.ZodTypeDef,
|
|
57
|
+
unknown
|
|
58
|
+
> = z.object({
|
|
59
|
+
type: z.literal("one_time").optional(),
|
|
60
|
+
price_currency: z.string().default("usd"),
|
|
61
|
+
price_amount: z.number().int(),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return remap$(v, {
|
|
64
|
+
"price_currency": "priceCurrency",
|
|
65
|
+
"price_amount": "priceAmount",
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export type ProductPriceOneTimeFixedCreate$Outbound = {
|
|
71
|
+
type: "one_time";
|
|
72
|
+
price_currency: string;
|
|
73
|
+
price_amount: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const ProductPriceOneTimeFixedCreate$outboundSchema: z.ZodType<
|
|
78
|
+
ProductPriceOneTimeFixedCreate$Outbound,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
ProductPriceOneTimeFixedCreate
|
|
81
|
+
> = z.object({
|
|
82
|
+
type: z.literal("one_time").default("one_time"),
|
|
83
|
+
priceCurrency: z.string().default("usd"),
|
|
84
|
+
priceAmount: z.number().int(),
|
|
85
|
+
}).transform((v) => {
|
|
86
|
+
return remap$(v, {
|
|
87
|
+
priceCurrency: "price_currency",
|
|
88
|
+
priceAmount: "price_amount",
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
95
|
+
*/
|
|
96
|
+
export namespace ProductPriceOneTimeFixedCreate$ {
|
|
97
|
+
/** @deprecated use `ProductPriceOneTimeFixedCreate$inboundSchema` instead. */
|
|
98
|
+
export const inboundSchema = ProductPriceOneTimeFixedCreate$inboundSchema;
|
|
99
|
+
/** @deprecated use `ProductPriceOneTimeFixedCreate$outboundSchema` instead. */
|
|
100
|
+
export const outboundSchema = ProductPriceOneTimeFixedCreate$outboundSchema;
|
|
101
|
+
/** @deprecated use `ProductPriceOneTimeFixedCreate$Outbound` instead. */
|
|
102
|
+
export type Outbound = ProductPriceOneTimeFixedCreate$Outbound;
|
|
103
|
+
}
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
ProductPriceOneTime$outboundSchema,
|
|
11
11
|
} from "./productpriceonetime.js";
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./
|
|
13
|
+
ProductPriceRecurringOutput,
|
|
14
|
+
ProductPriceRecurringOutput$inboundSchema,
|
|
15
|
+
ProductPriceRecurringOutput$Outbound,
|
|
16
|
+
ProductPriceRecurringOutput$outboundSchema,
|
|
17
|
+
} from "./productpricerecurringoutput.js";
|
|
18
18
|
|
|
19
19
|
export type ProductPriceOutput =
|
|
20
|
-
|
|
|
21
|
-
|
|
|
20
|
+
| ProductPriceRecurringOutput
|
|
21
|
+
| ProductPriceOneTime;
|
|
22
22
|
|
|
23
23
|
/** @internal */
|
|
24
24
|
export const ProductPriceOutput$inboundSchema: z.ZodType<
|
|
@@ -26,22 +26,14 @@ export const ProductPriceOutput$inboundSchema: z.ZodType<
|
|
|
26
26
|
z.ZodTypeDef,
|
|
27
27
|
unknown
|
|
28
28
|
> = z.union([
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: v.type,
|
|
32
|
-
})),
|
|
33
|
-
),
|
|
34
|
-
ProductPriceRecurring$inboundSchema.and(
|
|
35
|
-
z.object({ type: z.literal("recurring") }).transform((v) => ({
|
|
36
|
-
type: v.type,
|
|
37
|
-
})),
|
|
38
|
-
),
|
|
29
|
+
ProductPriceRecurringOutput$inboundSchema,
|
|
30
|
+
ProductPriceOneTime$inboundSchema,
|
|
39
31
|
]);
|
|
40
32
|
|
|
41
33
|
/** @internal */
|
|
42
34
|
export type ProductPriceOutput$Outbound =
|
|
43
|
-
|
|
|
44
|
-
|
|
|
35
|
+
| ProductPriceRecurringOutput$Outbound
|
|
36
|
+
| ProductPriceOneTime$Outbound;
|
|
45
37
|
|
|
46
38
|
/** @internal */
|
|
47
39
|
export const ProductPriceOutput$outboundSchema: z.ZodType<
|
|
@@ -49,16 +41,8 @@ export const ProductPriceOutput$outboundSchema: z.ZodType<
|
|
|
49
41
|
z.ZodTypeDef,
|
|
50
42
|
ProductPriceOutput
|
|
51
43
|
> = z.union([
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
type: v.type,
|
|
55
|
-
})),
|
|
56
|
-
),
|
|
57
|
-
ProductPriceRecurring$outboundSchema.and(
|
|
58
|
-
z.object({ type: z.literal("recurring") }).transform((v) => ({
|
|
59
|
-
type: v.type,
|
|
60
|
-
})),
|
|
61
|
-
),
|
|
44
|
+
ProductPriceRecurringOutput$outboundSchema,
|
|
45
|
+
ProductPriceOneTime$outboundSchema,
|
|
62
46
|
]);
|
|
63
47
|
|
|
64
48
|
/**
|
|
@@ -6,10 +6,10 @@ import * as z from "zod";
|
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { ClosedEnum } from "../../types/enums.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./
|
|
9
|
+
SubscriptionRecurringInterval,
|
|
10
|
+
SubscriptionRecurringInterval$inboundSchema,
|
|
11
|
+
SubscriptionRecurringInterval$outboundSchema,
|
|
12
|
+
} from "./subscriptionrecurringinterval.js";
|
|
13
13
|
|
|
14
14
|
export const ProductPriceRecurringCreateType = {
|
|
15
15
|
Recurring: "recurring",
|
|
@@ -24,17 +24,17 @@ export type ProductPriceRecurringCreateType = ClosedEnum<
|
|
|
24
24
|
export type ProductPriceRecurringCreate = {
|
|
25
25
|
type?: "recurring" | undefined;
|
|
26
26
|
/**
|
|
27
|
-
* The
|
|
27
|
+
* The currency. Currently, only `usd` is supported.
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
priceCurrency?: string | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* The price in cents.
|
|
32
32
|
*/
|
|
33
33
|
priceAmount: number;
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
35
|
+
* The recurring interval of the price.
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
recurringInterval: SubscriptionRecurringInterval;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
@@ -65,23 +65,23 @@ export const ProductPriceRecurringCreate$inboundSchema: z.ZodType<
|
|
|
65
65
|
unknown
|
|
66
66
|
> = z.object({
|
|
67
67
|
type: z.literal("recurring").optional(),
|
|
68
|
-
recurring_interval: ProductPriceRecurringInterval$inboundSchema,
|
|
69
|
-
price_amount: z.number().int(),
|
|
70
68
|
price_currency: z.string().default("usd"),
|
|
69
|
+
price_amount: z.number().int(),
|
|
70
|
+
recurring_interval: SubscriptionRecurringInterval$inboundSchema,
|
|
71
71
|
}).transform((v) => {
|
|
72
72
|
return remap$(v, {
|
|
73
|
-
"recurring_interval": "recurringInterval",
|
|
74
|
-
"price_amount": "priceAmount",
|
|
75
73
|
"price_currency": "priceCurrency",
|
|
74
|
+
"price_amount": "priceAmount",
|
|
75
|
+
"recurring_interval": "recurringInterval",
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
/** @internal */
|
|
80
80
|
export type ProductPriceRecurringCreate$Outbound = {
|
|
81
81
|
type: "recurring";
|
|
82
|
-
recurring_interval: string;
|
|
83
|
-
price_amount: number;
|
|
84
82
|
price_currency: string;
|
|
83
|
+
price_amount: number;
|
|
84
|
+
recurring_interval: string;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
87
|
/** @internal */
|
|
@@ -91,14 +91,14 @@ export const ProductPriceRecurringCreate$outboundSchema: z.ZodType<
|
|
|
91
91
|
ProductPriceRecurringCreate
|
|
92
92
|
> = z.object({
|
|
93
93
|
type: z.literal("recurring").default("recurring"),
|
|
94
|
-
recurringInterval: ProductPriceRecurringInterval$outboundSchema,
|
|
95
|
-
priceAmount: z.number().int(),
|
|
96
94
|
priceCurrency: z.string().default("usd"),
|
|
95
|
+
priceAmount: z.number().int(),
|
|
96
|
+
recurringInterval: SubscriptionRecurringInterval$outboundSchema,
|
|
97
97
|
}).transform((v) => {
|
|
98
98
|
return remap$(v, {
|
|
99
|
-
recurringInterval: "recurring_interval",
|
|
100
|
-
priceAmount: "price_amount",
|
|
101
99
|
priceCurrency: "price_currency",
|
|
100
|
+
priceAmount: "price_amount",
|
|
101
|
+
recurringInterval: "recurring_interval",
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
104
|
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import {
|
|
9
|
+
SubscriptionRecurringInterval,
|
|
10
|
+
SubscriptionRecurringInterval$inboundSchema,
|
|
11
|
+
SubscriptionRecurringInterval$outboundSchema,
|
|
12
|
+
} from "./subscriptionrecurringinterval.js";
|
|
13
|
+
|
|
14
|
+
export const ProductPriceRecurringCustomAmountType = {
|
|
15
|
+
Custom: "custom",
|
|
16
|
+
} as const;
|
|
17
|
+
export type ProductPriceRecurringCustomAmountType = ClosedEnum<
|
|
18
|
+
typeof ProductPriceRecurringCustomAmountType
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The type of the price.
|
|
23
|
+
*/
|
|
24
|
+
export const ProductPriceRecurringCustomType = {
|
|
25
|
+
Recurring: "recurring",
|
|
26
|
+
} as const;
|
|
27
|
+
/**
|
|
28
|
+
* The type of the price.
|
|
29
|
+
*/
|
|
30
|
+
export type ProductPriceRecurringCustomType = ClosedEnum<
|
|
31
|
+
typeof ProductPriceRecurringCustomType
|
|
32
|
+
>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A pay-what-you-want recurring price for a product, i.e. a subscription.
|
|
36
|
+
*/
|
|
37
|
+
export type ProductPriceRecurringCustom = {
|
|
38
|
+
/**
|
|
39
|
+
* Creation timestamp of the object.
|
|
40
|
+
*/
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
/**
|
|
43
|
+
* Last modification timestamp of the object.
|
|
44
|
+
*/
|
|
45
|
+
modifiedAt: Date | null;
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the price.
|
|
48
|
+
*/
|
|
49
|
+
id: string;
|
|
50
|
+
amountType?: "custom" | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The currency.
|
|
53
|
+
*/
|
|
54
|
+
priceCurrency: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the price is archived and no longer available.
|
|
57
|
+
*/
|
|
58
|
+
isArchived: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The minimum amount the customer can pay.
|
|
61
|
+
*/
|
|
62
|
+
minimumAmount: number | null;
|
|
63
|
+
/**
|
|
64
|
+
* The maximum amount the customer can pay.
|
|
65
|
+
*/
|
|
66
|
+
maximumAmount: number | null;
|
|
67
|
+
/**
|
|
68
|
+
* The initial amount shown to the customer.
|
|
69
|
+
*/
|
|
70
|
+
presetAmount: number | null;
|
|
71
|
+
/**
|
|
72
|
+
* The type of the price.
|
|
73
|
+
*/
|
|
74
|
+
type?: "recurring" | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The recurring interval of the price.
|
|
77
|
+
*/
|
|
78
|
+
recurringInterval: SubscriptionRecurringInterval;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const ProductPriceRecurringCustomAmountType$inboundSchema:
|
|
83
|
+
z.ZodNativeEnum<typeof ProductPriceRecurringCustomAmountType> = z.nativeEnum(
|
|
84
|
+
ProductPriceRecurringCustomAmountType,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const ProductPriceRecurringCustomAmountType$outboundSchema:
|
|
89
|
+
z.ZodNativeEnum<typeof ProductPriceRecurringCustomAmountType> =
|
|
90
|
+
ProductPriceRecurringCustomAmountType$inboundSchema;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @internal
|
|
94
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
95
|
+
*/
|
|
96
|
+
export namespace ProductPriceRecurringCustomAmountType$ {
|
|
97
|
+
/** @deprecated use `ProductPriceRecurringCustomAmountType$inboundSchema` instead. */
|
|
98
|
+
export const inboundSchema =
|
|
99
|
+
ProductPriceRecurringCustomAmountType$inboundSchema;
|
|
100
|
+
/** @deprecated use `ProductPriceRecurringCustomAmountType$outboundSchema` instead. */
|
|
101
|
+
export const outboundSchema =
|
|
102
|
+
ProductPriceRecurringCustomAmountType$outboundSchema;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const ProductPriceRecurringCustomType$inboundSchema: z.ZodNativeEnum<
|
|
107
|
+
typeof ProductPriceRecurringCustomType
|
|
108
|
+
> = z.nativeEnum(ProductPriceRecurringCustomType);
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const ProductPriceRecurringCustomType$outboundSchema: z.ZodNativeEnum<
|
|
112
|
+
typeof ProductPriceRecurringCustomType
|
|
113
|
+
> = ProductPriceRecurringCustomType$inboundSchema;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
118
|
+
*/
|
|
119
|
+
export namespace ProductPriceRecurringCustomType$ {
|
|
120
|
+
/** @deprecated use `ProductPriceRecurringCustomType$inboundSchema` instead. */
|
|
121
|
+
export const inboundSchema = ProductPriceRecurringCustomType$inboundSchema;
|
|
122
|
+
/** @deprecated use `ProductPriceRecurringCustomType$outboundSchema` instead. */
|
|
123
|
+
export const outboundSchema = ProductPriceRecurringCustomType$outboundSchema;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** @internal */
|
|
127
|
+
export const ProductPriceRecurringCustom$inboundSchema: z.ZodType<
|
|
128
|
+
ProductPriceRecurringCustom,
|
|
129
|
+
z.ZodTypeDef,
|
|
130
|
+
unknown
|
|
131
|
+
> = z.object({
|
|
132
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
133
|
+
modified_at: z.nullable(
|
|
134
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
135
|
+
),
|
|
136
|
+
id: z.string(),
|
|
137
|
+
amount_type: z.literal("custom").optional(),
|
|
138
|
+
price_currency: z.string(),
|
|
139
|
+
is_archived: z.boolean(),
|
|
140
|
+
minimum_amount: z.nullable(z.number().int()),
|
|
141
|
+
maximum_amount: z.nullable(z.number().int()),
|
|
142
|
+
preset_amount: z.nullable(z.number().int()),
|
|
143
|
+
type: z.literal("recurring").optional(),
|
|
144
|
+
recurring_interval: SubscriptionRecurringInterval$inboundSchema,
|
|
145
|
+
}).transform((v) => {
|
|
146
|
+
return remap$(v, {
|
|
147
|
+
"created_at": "createdAt",
|
|
148
|
+
"modified_at": "modifiedAt",
|
|
149
|
+
"amount_type": "amountType",
|
|
150
|
+
"price_currency": "priceCurrency",
|
|
151
|
+
"is_archived": "isArchived",
|
|
152
|
+
"minimum_amount": "minimumAmount",
|
|
153
|
+
"maximum_amount": "maximumAmount",
|
|
154
|
+
"preset_amount": "presetAmount",
|
|
155
|
+
"recurring_interval": "recurringInterval",
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
/** @internal */
|
|
160
|
+
export type ProductPriceRecurringCustom$Outbound = {
|
|
161
|
+
created_at: string;
|
|
162
|
+
modified_at: string | null;
|
|
163
|
+
id: string;
|
|
164
|
+
amount_type: "custom";
|
|
165
|
+
price_currency: string;
|
|
166
|
+
is_archived: boolean;
|
|
167
|
+
minimum_amount: number | null;
|
|
168
|
+
maximum_amount: number | null;
|
|
169
|
+
preset_amount: number | null;
|
|
170
|
+
type: "recurring";
|
|
171
|
+
recurring_interval: string;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/** @internal */
|
|
175
|
+
export const ProductPriceRecurringCustom$outboundSchema: z.ZodType<
|
|
176
|
+
ProductPriceRecurringCustom$Outbound,
|
|
177
|
+
z.ZodTypeDef,
|
|
178
|
+
ProductPriceRecurringCustom
|
|
179
|
+
> = z.object({
|
|
180
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
181
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
182
|
+
id: z.string(),
|
|
183
|
+
amountType: z.literal("custom").default("custom"),
|
|
184
|
+
priceCurrency: z.string(),
|
|
185
|
+
isArchived: z.boolean(),
|
|
186
|
+
minimumAmount: z.nullable(z.number().int()),
|
|
187
|
+
maximumAmount: z.nullable(z.number().int()),
|
|
188
|
+
presetAmount: z.nullable(z.number().int()),
|
|
189
|
+
type: z.literal("recurring").default("recurring"),
|
|
190
|
+
recurringInterval: SubscriptionRecurringInterval$outboundSchema,
|
|
191
|
+
}).transform((v) => {
|
|
192
|
+
return remap$(v, {
|
|
193
|
+
createdAt: "created_at",
|
|
194
|
+
modifiedAt: "modified_at",
|
|
195
|
+
amountType: "amount_type",
|
|
196
|
+
priceCurrency: "price_currency",
|
|
197
|
+
isArchived: "is_archived",
|
|
198
|
+
minimumAmount: "minimum_amount",
|
|
199
|
+
maximumAmount: "maximum_amount",
|
|
200
|
+
presetAmount: "preset_amount",
|
|
201
|
+
recurringInterval: "recurring_interval",
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* @internal
|
|
207
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
208
|
+
*/
|
|
209
|
+
export namespace ProductPriceRecurringCustom$ {
|
|
210
|
+
/** @deprecated use `ProductPriceRecurringCustom$inboundSchema` instead. */
|
|
211
|
+
export const inboundSchema = ProductPriceRecurringCustom$inboundSchema;
|
|
212
|
+
/** @deprecated use `ProductPriceRecurringCustom$outboundSchema` instead. */
|
|
213
|
+
export const outboundSchema = ProductPriceRecurringCustom$outboundSchema;
|
|
214
|
+
/** @deprecated use `ProductPriceRecurringCustom$Outbound` instead. */
|
|
215
|
+
export type Outbound = ProductPriceRecurringCustom$Outbound;
|
|
216
|
+
}
|