@polar-sh/sdk 0.36.0 → 0.36.2
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 +24 -19
- package/bin/mcp-server.js +224 -66
- package/bin/mcp-server.js.map +8 -8
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.d.ts +20 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.d.ts.map +1 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.js +110 -0
- package/dist/commonjs/funcs/customerPortalCustomerSessionIntrospect.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/components/checkout.d.ts +10 -0
- package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkout.js +8 -0
- package/dist/commonjs/models/components/checkout.js.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.js +4 -0
- package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.d.ts +10 -0
- package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.js +8 -0
- package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +10 -0
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js +8 -0
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.js +4 -0
- package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
- package/dist/commonjs/models/components/customercustomersession.d.ts +31 -0
- package/dist/commonjs/models/components/customercustomersession.d.ts.map +1 -0
- package/dist/commonjs/models/components/customercustomersession.js +82 -0
- package/dist/commonjs/models/components/customercustomersession.js.map +1 -0
- package/dist/commonjs/models/components/customersession.d.ts +2 -0
- package/dist/commonjs/models/components/customersession.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersession.js +4 -0
- package/dist/commonjs/models/components/customersession.js.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts +5 -0
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js +4 -0
- package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomeridcreate.d.ts +5 -0
- package/dist/commonjs/models/components/customersessioncustomeridcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersessioncustomeridcreate.js +4 -0
- package/dist/commonjs/models/components/customersessioncustomeridcreate.js.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.d.ts +44 -4
- package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.js +60 -20
- package/dist/commonjs/models/components/productcreateonetime.js.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.d.ts +44 -4
- package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.js +60 -20
- package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -1
- package/dist/commonjs/models/components/productupdate.d.ts +85 -4
- package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productupdate.js +117 -21
- package/dist/commonjs/models/components/productupdate.js.map +1 -1
- package/dist/commonjs/models/components/webtokenrequest.d.ts +67 -0
- package/dist/commonjs/models/components/webtokenrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/webtokenrequest.js +117 -0
- package/dist/commonjs/models/components/webtokenrequest.js.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.d.ts +29 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.js +78 -0
- package/dist/commonjs/models/operations/customerportalcustomersessionintrospect.js.map +1 -0
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts +3 -2
- package/dist/commonjs/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/commonjs/models/operations/oauth2requesttoken.js +3 -0
- package/dist/commonjs/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/commonjs/sdk/customerportal.d.ts +3 -0
- package/dist/commonjs/sdk/customerportal.d.ts.map +1 -1
- package/dist/commonjs/sdk/customerportal.js +4 -0
- package/dist/commonjs/sdk/customerportal.js.map +1 -1
- package/dist/commonjs/sdk/customersession.d.ts +15 -0
- package/dist/commonjs/sdk/customersession.d.ts.map +1 -0
- package/dist/commonjs/sdk/customersession.js +24 -0
- package/dist/commonjs/sdk/customersession.js.map +1 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.d.ts +20 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.d.ts.map +1 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.js +74 -0
- package/dist/esm/funcs/customerPortalCustomerSessionIntrospect.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/components/checkout.d.ts +10 -0
- package/dist/esm/models/components/checkout.d.ts.map +1 -1
- package/dist/esm/models/components/checkout.js +8 -0
- package/dist/esm/models/components/checkout.js.map +1 -1
- package/dist/esm/models/components/checkoutcreate.d.ts +5 -0
- package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutcreate.js +4 -0
- package/dist/esm/models/components/checkoutcreate.js.map +1 -1
- package/dist/esm/models/components/checkoutpublic.d.ts +10 -0
- package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublic.js +8 -0
- package/dist/esm/models/components/checkoutpublic.js.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +10 -0
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.js +8 -0
- package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/esm/models/components/checkoutupdate.d.ts +5 -0
- package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutupdate.js +4 -0
- package/dist/esm/models/components/checkoutupdate.js.map +1 -1
- package/dist/esm/models/components/customercustomersession.d.ts +31 -0
- package/dist/esm/models/components/customercustomersession.d.ts.map +1 -0
- package/dist/esm/models/components/customercustomersession.js +44 -0
- package/dist/esm/models/components/customercustomersession.js.map +1 -0
- package/dist/esm/models/components/customersession.d.ts +2 -0
- package/dist/esm/models/components/customersession.d.ts.map +1 -1
- package/dist/esm/models/components/customersession.js +4 -0
- package/dist/esm/models/components/customersession.js.map +1 -1
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts +5 -0
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts.map +1 -1
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.js +4 -0
- package/dist/esm/models/components/customersessioncustomerexternalidcreate.js.map +1 -1
- package/dist/esm/models/components/customersessioncustomeridcreate.d.ts +5 -0
- package/dist/esm/models/components/customersessioncustomeridcreate.d.ts.map +1 -1
- package/dist/esm/models/components/customersessioncustomeridcreate.js +4 -0
- package/dist/esm/models/components/customersessioncustomeridcreate.js.map +1 -1
- package/dist/esm/models/components/productcreateonetime.d.ts +44 -4
- package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/esm/models/components/productcreateonetime.js +60 -20
- package/dist/esm/models/components/productcreateonetime.js.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.d.ts +44 -4
- package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.js +60 -20
- package/dist/esm/models/components/productcreaterecurring.js.map +1 -1
- package/dist/esm/models/components/productupdate.d.ts +85 -4
- package/dist/esm/models/components/productupdate.d.ts.map +1 -1
- package/dist/esm/models/components/productupdate.js +114 -20
- package/dist/esm/models/components/productupdate.js.map +1 -1
- package/dist/esm/models/components/webtokenrequest.d.ts +67 -0
- package/dist/esm/models/components/webtokenrequest.d.ts.map +1 -0
- package/dist/esm/models/components/webtokenrequest.js +79 -0
- package/dist/esm/models/components/webtokenrequest.js.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.d.ts +29 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.d.ts.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.js +40 -0
- package/dist/esm/models/operations/customerportalcustomersessionintrospect.js.map +1 -0
- package/dist/esm/models/operations/oauth2requesttoken.d.ts +3 -2
- package/dist/esm/models/operations/oauth2requesttoken.d.ts.map +1 -1
- package/dist/esm/models/operations/oauth2requesttoken.js +3 -0
- package/dist/esm/models/operations/oauth2requesttoken.js.map +1 -1
- package/dist/esm/sdk/customerportal.d.ts +3 -0
- package/dist/esm/sdk/customerportal.d.ts.map +1 -1
- package/dist/esm/sdk/customerportal.js +4 -0
- package/dist/esm/sdk/customerportal.js.map +1 -1
- package/dist/esm/sdk/customersession.d.ts +15 -0
- package/dist/esm/sdk/customersession.d.ts.map +1 -0
- package/dist/esm/sdk/customersession.js +20 -0
- package/dist/esm/sdk/customersession.js.map +1 -0
- package/docs/sdks/customersession/README.md +79 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/customerPortalCustomerSessionIntrospect.ts +157 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/checkout.ts +18 -0
- package/src/models/components/checkoutcreate.ts +9 -0
- package/src/models/components/checkoutpublic.ts +18 -0
- package/src/models/components/checkoutpublicconfirmed.ts +18 -0
- package/src/models/components/checkoutupdate.ts +9 -0
- package/src/models/components/customercustomersession.ts +81 -0
- package/src/models/components/customersession.ts +6 -0
- package/src/models/components/customersessioncustomerexternalidcreate.ts +9 -0
- package/src/models/components/customersessioncustomeridcreate.ts +9 -0
- package/src/models/components/productcreateonetime.ts +120 -40
- package/src/models/components/productcreaterecurring.ts +120 -40
- package/src/models/components/productupdate.ts +233 -40
- package/src/models/components/webtokenrequest.ts +133 -0
- package/src/models/operations/customerportalcustomersessionintrospect.ts +89 -0
- package/src/models/operations/oauth2requesttoken.ts +12 -2
- package/src/sdk/customerportal.ts +6 -0
- package/src/sdk/customersession.ts +30 -0
|
@@ -47,11 +47,11 @@ import {
|
|
|
47
47
|
export type ProductCreateOneTimeMetadata = string | number | number | boolean;
|
|
48
48
|
|
|
49
49
|
export type ProductCreateOneTimePrices =
|
|
50
|
-
| ProductPriceMeteredUnitCreate
|
|
51
|
-
| ProductPriceFixedCreate
|
|
52
|
-
| ProductPriceSeatBasedCreate
|
|
53
|
-
| ProductPriceCustomCreate
|
|
54
|
-
| ProductPriceFreeCreate;
|
|
50
|
+
| (ProductPriceMeteredUnitCreate & { amountType: "metered_unit" })
|
|
51
|
+
| (ProductPriceFixedCreate & { amountType: "fixed" })
|
|
52
|
+
| (ProductPriceSeatBasedCreate & { amountType: "seat_based" })
|
|
53
|
+
| (ProductPriceCustomCreate & { amountType: "custom" })
|
|
54
|
+
| (ProductPriceFreeCreate & { amountType: "free" });
|
|
55
55
|
|
|
56
56
|
export type ProductCreateOneTime = {
|
|
57
57
|
/**
|
|
@@ -82,11 +82,11 @@ export type ProductCreateOneTime = {
|
|
|
82
82
|
* List of available prices for this product. It should contain at most one static price (fixed, custom or free), and any number of metered prices. Metered prices are not supported on one-time purchase products.
|
|
83
83
|
*/
|
|
84
84
|
prices: Array<
|
|
85
|
-
| ProductPriceMeteredUnitCreate
|
|
86
|
-
| ProductPriceFixedCreate
|
|
87
|
-
| ProductPriceSeatBasedCreate
|
|
88
|
-
| ProductPriceCustomCreate
|
|
89
|
-
| ProductPriceFreeCreate
|
|
85
|
+
| (ProductPriceMeteredUnitCreate & { amountType: "metered_unit" })
|
|
86
|
+
| (ProductPriceFixedCreate & { amountType: "fixed" })
|
|
87
|
+
| (ProductPriceSeatBasedCreate & { amountType: "seat_based" })
|
|
88
|
+
| (ProductPriceCustomCreate & { amountType: "custom" })
|
|
89
|
+
| (ProductPriceFreeCreate & { amountType: "free" })
|
|
90
90
|
>;
|
|
91
91
|
/**
|
|
92
92
|
* List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded.
|
|
@@ -166,20 +166,40 @@ export const ProductCreateOneTimePrices$inboundSchema: z.ZodType<
|
|
|
166
166
|
z.ZodTypeDef,
|
|
167
167
|
unknown
|
|
168
168
|
> = z.union([
|
|
169
|
-
ProductPriceMeteredUnitCreate$inboundSchema
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
ProductPriceMeteredUnitCreate$inboundSchema.and(
|
|
170
|
+
z.object({ amount_type: z.literal("metered_unit") }).transform((v) => ({
|
|
171
|
+
amountType: v.amount_type,
|
|
172
|
+
})),
|
|
173
|
+
),
|
|
174
|
+
ProductPriceFixedCreate$inboundSchema.and(
|
|
175
|
+
z.object({ amount_type: z.literal("fixed") }).transform((v) => ({
|
|
176
|
+
amountType: v.amount_type,
|
|
177
|
+
})),
|
|
178
|
+
),
|
|
179
|
+
ProductPriceSeatBasedCreate$inboundSchema.and(
|
|
180
|
+
z.object({ amount_type: z.literal("seat_based") }).transform((v) => ({
|
|
181
|
+
amountType: v.amount_type,
|
|
182
|
+
})),
|
|
183
|
+
),
|
|
184
|
+
ProductPriceCustomCreate$inboundSchema.and(
|
|
185
|
+
z.object({ amount_type: z.literal("custom") }).transform((v) => ({
|
|
186
|
+
amountType: v.amount_type,
|
|
187
|
+
})),
|
|
188
|
+
),
|
|
189
|
+
ProductPriceFreeCreate$inboundSchema.and(
|
|
190
|
+
z.object({ amount_type: z.literal("free") }).transform((v) => ({
|
|
191
|
+
amountType: v.amount_type,
|
|
192
|
+
})),
|
|
193
|
+
),
|
|
174
194
|
]);
|
|
175
195
|
|
|
176
196
|
/** @internal */
|
|
177
197
|
export type ProductCreateOneTimePrices$Outbound =
|
|
178
|
-
| ProductPriceMeteredUnitCreate$Outbound
|
|
179
|
-
| ProductPriceFixedCreate$Outbound
|
|
180
|
-
| ProductPriceSeatBasedCreate$Outbound
|
|
181
|
-
| ProductPriceCustomCreate$Outbound
|
|
182
|
-
| ProductPriceFreeCreate$Outbound;
|
|
198
|
+
| (ProductPriceMeteredUnitCreate$Outbound & { amount_type: "metered_unit" })
|
|
199
|
+
| (ProductPriceFixedCreate$Outbound & { amount_type: "fixed" })
|
|
200
|
+
| (ProductPriceSeatBasedCreate$Outbound & { amount_type: "seat_based" })
|
|
201
|
+
| (ProductPriceCustomCreate$Outbound & { amount_type: "custom" })
|
|
202
|
+
| (ProductPriceFreeCreate$Outbound & { amount_type: "free" });
|
|
183
203
|
|
|
184
204
|
/** @internal */
|
|
185
205
|
export const ProductCreateOneTimePrices$outboundSchema: z.ZodType<
|
|
@@ -187,11 +207,31 @@ export const ProductCreateOneTimePrices$outboundSchema: z.ZodType<
|
|
|
187
207
|
z.ZodTypeDef,
|
|
188
208
|
ProductCreateOneTimePrices
|
|
189
209
|
> = z.union([
|
|
190
|
-
ProductPriceMeteredUnitCreate$outboundSchema
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
210
|
+
ProductPriceMeteredUnitCreate$outboundSchema.and(
|
|
211
|
+
z.object({ amountType: z.literal("metered_unit") }).transform((v) => ({
|
|
212
|
+
amount_type: v.amountType,
|
|
213
|
+
})),
|
|
214
|
+
),
|
|
215
|
+
ProductPriceFixedCreate$outboundSchema.and(
|
|
216
|
+
z.object({ amountType: z.literal("fixed") }).transform((v) => ({
|
|
217
|
+
amount_type: v.amountType,
|
|
218
|
+
})),
|
|
219
|
+
),
|
|
220
|
+
ProductPriceSeatBasedCreate$outboundSchema.and(
|
|
221
|
+
z.object({ amountType: z.literal("seat_based") }).transform((v) => ({
|
|
222
|
+
amount_type: v.amountType,
|
|
223
|
+
})),
|
|
224
|
+
),
|
|
225
|
+
ProductPriceCustomCreate$outboundSchema.and(
|
|
226
|
+
z.object({ amountType: z.literal("custom") }).transform((v) => ({
|
|
227
|
+
amount_type: v.amountType,
|
|
228
|
+
})),
|
|
229
|
+
),
|
|
230
|
+
ProductPriceFreeCreate$outboundSchema.and(
|
|
231
|
+
z.object({ amountType: z.literal("free") }).transform((v) => ({
|
|
232
|
+
amount_type: v.amountType,
|
|
233
|
+
})),
|
|
234
|
+
),
|
|
195
235
|
]);
|
|
196
236
|
|
|
197
237
|
/**
|
|
@@ -238,11 +278,31 @@ export const ProductCreateOneTime$inboundSchema: z.ZodType<
|
|
|
238
278
|
description: z.nullable(z.string()).optional(),
|
|
239
279
|
prices: z.array(
|
|
240
280
|
z.union([
|
|
241
|
-
ProductPriceMeteredUnitCreate$inboundSchema
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
281
|
+
ProductPriceMeteredUnitCreate$inboundSchema.and(
|
|
282
|
+
z.object({ amount_type: z.literal("metered_unit") }).transform((v) => ({
|
|
283
|
+
amountType: v.amount_type,
|
|
284
|
+
})),
|
|
285
|
+
),
|
|
286
|
+
ProductPriceFixedCreate$inboundSchema.and(
|
|
287
|
+
z.object({ amount_type: z.literal("fixed") }).transform((v) => ({
|
|
288
|
+
amountType: v.amount_type,
|
|
289
|
+
})),
|
|
290
|
+
),
|
|
291
|
+
ProductPriceSeatBasedCreate$inboundSchema.and(
|
|
292
|
+
z.object({ amount_type: z.literal("seat_based") }).transform((v) => ({
|
|
293
|
+
amountType: v.amount_type,
|
|
294
|
+
})),
|
|
295
|
+
),
|
|
296
|
+
ProductPriceCustomCreate$inboundSchema.and(
|
|
297
|
+
z.object({ amount_type: z.literal("custom") }).transform((v) => ({
|
|
298
|
+
amountType: v.amount_type,
|
|
299
|
+
})),
|
|
300
|
+
),
|
|
301
|
+
ProductPriceFreeCreate$inboundSchema.and(
|
|
302
|
+
z.object({ amount_type: z.literal("free") }).transform((v) => ({
|
|
303
|
+
amountType: v.amount_type,
|
|
304
|
+
})),
|
|
305
|
+
),
|
|
246
306
|
]),
|
|
247
307
|
),
|
|
248
308
|
medias: z.nullable(z.array(z.string())).optional(),
|
|
@@ -264,11 +324,11 @@ export type ProductCreateOneTime$Outbound = {
|
|
|
264
324
|
name: string;
|
|
265
325
|
description?: string | null | undefined;
|
|
266
326
|
prices: Array<
|
|
267
|
-
| ProductPriceMeteredUnitCreate$Outbound
|
|
268
|
-
| ProductPriceFixedCreate$Outbound
|
|
269
|
-
| ProductPriceSeatBasedCreate$Outbound
|
|
270
|
-
| ProductPriceCustomCreate$Outbound
|
|
271
|
-
| ProductPriceFreeCreate$Outbound
|
|
327
|
+
| (ProductPriceMeteredUnitCreate$Outbound & { amount_type: "metered_unit" })
|
|
328
|
+
| (ProductPriceFixedCreate$Outbound & { amount_type: "fixed" })
|
|
329
|
+
| (ProductPriceSeatBasedCreate$Outbound & { amount_type: "seat_based" })
|
|
330
|
+
| (ProductPriceCustomCreate$Outbound & { amount_type: "custom" })
|
|
331
|
+
| (ProductPriceFreeCreate$Outbound & { amount_type: "free" })
|
|
272
332
|
>;
|
|
273
333
|
medias?: Array<string> | null | undefined;
|
|
274
334
|
attached_custom_fields?:
|
|
@@ -291,11 +351,31 @@ export const ProductCreateOneTime$outboundSchema: z.ZodType<
|
|
|
291
351
|
description: z.nullable(z.string()).optional(),
|
|
292
352
|
prices: z.array(
|
|
293
353
|
z.union([
|
|
294
|
-
ProductPriceMeteredUnitCreate$outboundSchema
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
354
|
+
ProductPriceMeteredUnitCreate$outboundSchema.and(
|
|
355
|
+
z.object({ amountType: z.literal("metered_unit") }).transform((v) => ({
|
|
356
|
+
amount_type: v.amountType,
|
|
357
|
+
})),
|
|
358
|
+
),
|
|
359
|
+
ProductPriceFixedCreate$outboundSchema.and(
|
|
360
|
+
z.object({ amountType: z.literal("fixed") }).transform((v) => ({
|
|
361
|
+
amount_type: v.amountType,
|
|
362
|
+
})),
|
|
363
|
+
),
|
|
364
|
+
ProductPriceSeatBasedCreate$outboundSchema.and(
|
|
365
|
+
z.object({ amountType: z.literal("seat_based") }).transform((v) => ({
|
|
366
|
+
amount_type: v.amountType,
|
|
367
|
+
})),
|
|
368
|
+
),
|
|
369
|
+
ProductPriceCustomCreate$outboundSchema.and(
|
|
370
|
+
z.object({ amountType: z.literal("custom") }).transform((v) => ({
|
|
371
|
+
amount_type: v.amountType,
|
|
372
|
+
})),
|
|
373
|
+
),
|
|
374
|
+
ProductPriceFreeCreate$outboundSchema.and(
|
|
375
|
+
z.object({ amountType: z.literal("free") }).transform((v) => ({
|
|
376
|
+
amount_type: v.amountType,
|
|
377
|
+
})),
|
|
378
|
+
),
|
|
299
379
|
]),
|
|
300
380
|
),
|
|
301
381
|
medias: z.nullable(z.array(z.string())).optional(),
|
|
@@ -57,11 +57,11 @@ import {
|
|
|
57
57
|
export type ProductCreateRecurringMetadata = string | number | number | boolean;
|
|
58
58
|
|
|
59
59
|
export type ProductCreateRecurringPrices =
|
|
60
|
-
| ProductPriceMeteredUnitCreate
|
|
61
|
-
| ProductPriceFixedCreate
|
|
62
|
-
| ProductPriceSeatBasedCreate
|
|
63
|
-
| ProductPriceCustomCreate
|
|
64
|
-
| ProductPriceFreeCreate;
|
|
60
|
+
| (ProductPriceMeteredUnitCreate & { amountType: "metered_unit" })
|
|
61
|
+
| (ProductPriceFixedCreate & { amountType: "fixed" })
|
|
62
|
+
| (ProductPriceSeatBasedCreate & { amountType: "seat_based" })
|
|
63
|
+
| (ProductPriceCustomCreate & { amountType: "custom" })
|
|
64
|
+
| (ProductPriceFreeCreate & { amountType: "free" });
|
|
65
65
|
|
|
66
66
|
export type ProductCreateRecurring = {
|
|
67
67
|
/**
|
|
@@ -92,11 +92,11 @@ export type ProductCreateRecurring = {
|
|
|
92
92
|
* List of available prices for this product. It should contain at most one static price (fixed, custom or free), and any number of metered prices. Metered prices are not supported on one-time purchase products.
|
|
93
93
|
*/
|
|
94
94
|
prices: Array<
|
|
95
|
-
| ProductPriceMeteredUnitCreate
|
|
96
|
-
| ProductPriceFixedCreate
|
|
97
|
-
| ProductPriceSeatBasedCreate
|
|
98
|
-
| ProductPriceCustomCreate
|
|
99
|
-
| ProductPriceFreeCreate
|
|
95
|
+
| (ProductPriceMeteredUnitCreate & { amountType: "metered_unit" })
|
|
96
|
+
| (ProductPriceFixedCreate & { amountType: "fixed" })
|
|
97
|
+
| (ProductPriceSeatBasedCreate & { amountType: "seat_based" })
|
|
98
|
+
| (ProductPriceCustomCreate & { amountType: "custom" })
|
|
99
|
+
| (ProductPriceFreeCreate & { amountType: "free" })
|
|
100
100
|
>;
|
|
101
101
|
/**
|
|
102
102
|
* List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded.
|
|
@@ -181,20 +181,40 @@ export const ProductCreateRecurringPrices$inboundSchema: z.ZodType<
|
|
|
181
181
|
z.ZodTypeDef,
|
|
182
182
|
unknown
|
|
183
183
|
> = z.union([
|
|
184
|
-
ProductPriceMeteredUnitCreate$inboundSchema
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
ProductPriceMeteredUnitCreate$inboundSchema.and(
|
|
185
|
+
z.object({ amount_type: z.literal("metered_unit") }).transform((v) => ({
|
|
186
|
+
amountType: v.amount_type,
|
|
187
|
+
})),
|
|
188
|
+
),
|
|
189
|
+
ProductPriceFixedCreate$inboundSchema.and(
|
|
190
|
+
z.object({ amount_type: z.literal("fixed") }).transform((v) => ({
|
|
191
|
+
amountType: v.amount_type,
|
|
192
|
+
})),
|
|
193
|
+
),
|
|
194
|
+
ProductPriceSeatBasedCreate$inboundSchema.and(
|
|
195
|
+
z.object({ amount_type: z.literal("seat_based") }).transform((v) => ({
|
|
196
|
+
amountType: v.amount_type,
|
|
197
|
+
})),
|
|
198
|
+
),
|
|
199
|
+
ProductPriceCustomCreate$inboundSchema.and(
|
|
200
|
+
z.object({ amount_type: z.literal("custom") }).transform((v) => ({
|
|
201
|
+
amountType: v.amount_type,
|
|
202
|
+
})),
|
|
203
|
+
),
|
|
204
|
+
ProductPriceFreeCreate$inboundSchema.and(
|
|
205
|
+
z.object({ amount_type: z.literal("free") }).transform((v) => ({
|
|
206
|
+
amountType: v.amount_type,
|
|
207
|
+
})),
|
|
208
|
+
),
|
|
189
209
|
]);
|
|
190
210
|
|
|
191
211
|
/** @internal */
|
|
192
212
|
export type ProductCreateRecurringPrices$Outbound =
|
|
193
|
-
| ProductPriceMeteredUnitCreate$Outbound
|
|
194
|
-
| ProductPriceFixedCreate$Outbound
|
|
195
|
-
| ProductPriceSeatBasedCreate$Outbound
|
|
196
|
-
| ProductPriceCustomCreate$Outbound
|
|
197
|
-
| ProductPriceFreeCreate$Outbound;
|
|
213
|
+
| (ProductPriceMeteredUnitCreate$Outbound & { amount_type: "metered_unit" })
|
|
214
|
+
| (ProductPriceFixedCreate$Outbound & { amount_type: "fixed" })
|
|
215
|
+
| (ProductPriceSeatBasedCreate$Outbound & { amount_type: "seat_based" })
|
|
216
|
+
| (ProductPriceCustomCreate$Outbound & { amount_type: "custom" })
|
|
217
|
+
| (ProductPriceFreeCreate$Outbound & { amount_type: "free" });
|
|
198
218
|
|
|
199
219
|
/** @internal */
|
|
200
220
|
export const ProductCreateRecurringPrices$outboundSchema: z.ZodType<
|
|
@@ -202,11 +222,31 @@ export const ProductCreateRecurringPrices$outboundSchema: z.ZodType<
|
|
|
202
222
|
z.ZodTypeDef,
|
|
203
223
|
ProductCreateRecurringPrices
|
|
204
224
|
> = z.union([
|
|
205
|
-
ProductPriceMeteredUnitCreate$outboundSchema
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
225
|
+
ProductPriceMeteredUnitCreate$outboundSchema.and(
|
|
226
|
+
z.object({ amountType: z.literal("metered_unit") }).transform((v) => ({
|
|
227
|
+
amount_type: v.amountType,
|
|
228
|
+
})),
|
|
229
|
+
),
|
|
230
|
+
ProductPriceFixedCreate$outboundSchema.and(
|
|
231
|
+
z.object({ amountType: z.literal("fixed") }).transform((v) => ({
|
|
232
|
+
amount_type: v.amountType,
|
|
233
|
+
})),
|
|
234
|
+
),
|
|
235
|
+
ProductPriceSeatBasedCreate$outboundSchema.and(
|
|
236
|
+
z.object({ amountType: z.literal("seat_based") }).transform((v) => ({
|
|
237
|
+
amount_type: v.amountType,
|
|
238
|
+
})),
|
|
239
|
+
),
|
|
240
|
+
ProductPriceCustomCreate$outboundSchema.and(
|
|
241
|
+
z.object({ amountType: z.literal("custom") }).transform((v) => ({
|
|
242
|
+
amount_type: v.amountType,
|
|
243
|
+
})),
|
|
244
|
+
),
|
|
245
|
+
ProductPriceFreeCreate$outboundSchema.and(
|
|
246
|
+
z.object({ amountType: z.literal("free") }).transform((v) => ({
|
|
247
|
+
amount_type: v.amountType,
|
|
248
|
+
})),
|
|
249
|
+
),
|
|
210
250
|
]);
|
|
211
251
|
|
|
212
252
|
/**
|
|
@@ -255,11 +295,31 @@ export const ProductCreateRecurring$inboundSchema: z.ZodType<
|
|
|
255
295
|
description: z.nullable(z.string()).optional(),
|
|
256
296
|
prices: z.array(
|
|
257
297
|
z.union([
|
|
258
|
-
ProductPriceMeteredUnitCreate$inboundSchema
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
298
|
+
ProductPriceMeteredUnitCreate$inboundSchema.and(
|
|
299
|
+
z.object({ amount_type: z.literal("metered_unit") }).transform((v) => ({
|
|
300
|
+
amountType: v.amount_type,
|
|
301
|
+
})),
|
|
302
|
+
),
|
|
303
|
+
ProductPriceFixedCreate$inboundSchema.and(
|
|
304
|
+
z.object({ amount_type: z.literal("fixed") }).transform((v) => ({
|
|
305
|
+
amountType: v.amount_type,
|
|
306
|
+
})),
|
|
307
|
+
),
|
|
308
|
+
ProductPriceSeatBasedCreate$inboundSchema.and(
|
|
309
|
+
z.object({ amount_type: z.literal("seat_based") }).transform((v) => ({
|
|
310
|
+
amountType: v.amount_type,
|
|
311
|
+
})),
|
|
312
|
+
),
|
|
313
|
+
ProductPriceCustomCreate$inboundSchema.and(
|
|
314
|
+
z.object({ amount_type: z.literal("custom") }).transform((v) => ({
|
|
315
|
+
amountType: v.amount_type,
|
|
316
|
+
})),
|
|
317
|
+
),
|
|
318
|
+
ProductPriceFreeCreate$inboundSchema.and(
|
|
319
|
+
z.object({ amount_type: z.literal("free") }).transform((v) => ({
|
|
320
|
+
amountType: v.amount_type,
|
|
321
|
+
})),
|
|
322
|
+
),
|
|
263
323
|
]),
|
|
264
324
|
),
|
|
265
325
|
medias: z.nullable(z.array(z.string())).optional(),
|
|
@@ -285,11 +345,11 @@ export type ProductCreateRecurring$Outbound = {
|
|
|
285
345
|
name: string;
|
|
286
346
|
description?: string | null | undefined;
|
|
287
347
|
prices: Array<
|
|
288
|
-
| ProductPriceMeteredUnitCreate$Outbound
|
|
289
|
-
| ProductPriceFixedCreate$Outbound
|
|
290
|
-
| ProductPriceSeatBasedCreate$Outbound
|
|
291
|
-
| ProductPriceCustomCreate$Outbound
|
|
292
|
-
| ProductPriceFreeCreate$Outbound
|
|
348
|
+
| (ProductPriceMeteredUnitCreate$Outbound & { amount_type: "metered_unit" })
|
|
349
|
+
| (ProductPriceFixedCreate$Outbound & { amount_type: "fixed" })
|
|
350
|
+
| (ProductPriceSeatBasedCreate$Outbound & { amount_type: "seat_based" })
|
|
351
|
+
| (ProductPriceCustomCreate$Outbound & { amount_type: "custom" })
|
|
352
|
+
| (ProductPriceFreeCreate$Outbound & { amount_type: "free" })
|
|
293
353
|
>;
|
|
294
354
|
medias?: Array<string> | null | undefined;
|
|
295
355
|
attached_custom_fields?:
|
|
@@ -314,11 +374,31 @@ export const ProductCreateRecurring$outboundSchema: z.ZodType<
|
|
|
314
374
|
description: z.nullable(z.string()).optional(),
|
|
315
375
|
prices: z.array(
|
|
316
376
|
z.union([
|
|
317
|
-
ProductPriceMeteredUnitCreate$outboundSchema
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
377
|
+
ProductPriceMeteredUnitCreate$outboundSchema.and(
|
|
378
|
+
z.object({ amountType: z.literal("metered_unit") }).transform((v) => ({
|
|
379
|
+
amount_type: v.amountType,
|
|
380
|
+
})),
|
|
381
|
+
),
|
|
382
|
+
ProductPriceFixedCreate$outboundSchema.and(
|
|
383
|
+
z.object({ amountType: z.literal("fixed") }).transform((v) => ({
|
|
384
|
+
amount_type: v.amountType,
|
|
385
|
+
})),
|
|
386
|
+
),
|
|
387
|
+
ProductPriceSeatBasedCreate$outboundSchema.and(
|
|
388
|
+
z.object({ amountType: z.literal("seat_based") }).transform((v) => ({
|
|
389
|
+
amount_type: v.amountType,
|
|
390
|
+
})),
|
|
391
|
+
),
|
|
392
|
+
ProductPriceCustomCreate$outboundSchema.and(
|
|
393
|
+
z.object({ amountType: z.literal("custom") }).transform((v) => ({
|
|
394
|
+
amount_type: v.amountType,
|
|
395
|
+
})),
|
|
396
|
+
),
|
|
397
|
+
ProductPriceFreeCreate$outboundSchema.and(
|
|
398
|
+
z.object({ amountType: z.literal("free") }).transform((v) => ({
|
|
399
|
+
amount_type: v.amountType,
|
|
400
|
+
})),
|
|
401
|
+
),
|
|
322
402
|
]),
|
|
323
403
|
),
|
|
324
404
|
medias: z.nullable(z.array(z.string())).optional(),
|