@polar-sh/sdk 0.35.0 → 0.35.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/bin/mcp-server.js +691 -475
- package/bin/mcp-server.js.map +20 -16
- 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/address.d.ts +669 -669
- package/dist/commonjs/models/components/address.js +221 -221
- package/dist/commonjs/models/components/addressinput.d.ts +653 -653
- package/dist/commonjs/models/components/addressinput.js +217 -217
- package/dist/commonjs/models/components/checkout.d.ts +31 -5
- package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkout.js +23 -2
- package/dist/commonjs/models/components/checkout.js.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutcreate.js +9 -0
- package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlink.d.ts +14 -3
- package/dist/commonjs/models/components/checkoutlink.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlink.js +11 -2
- package/dist/commonjs/models/components/checkoutlink.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproduct.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproduct.js +9 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproduct.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproductprice.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproductprice.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproductprice.js +9 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproductprice.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproducts.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproducts.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkcreateproducts.js +9 -0
- package/dist/commonjs/models/components/checkoutlinkcreateproducts.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkproduct.d.ts +14 -3
- package/dist/commonjs/models/components/checkoutlinkproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkproduct.js +11 -2
- package/dist/commonjs/models/components/checkoutlinkproduct.js.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkupdate.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutlinkupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutlinkupdate.js +9 -0
- package/dist/commonjs/models/components/checkoutlinkupdate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutproduct.d.ts +14 -3
- package/dist/commonjs/models/components/checkoutproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutproduct.js +11 -2
- package/dist/commonjs/models/components/checkoutproduct.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.d.ts +21 -5
- package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.js +15 -2
- package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +21 -5
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js +15 -2
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.d.ts +11 -0
- package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutupdate.js +9 -0
- package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
- package/dist/commonjs/models/components/customerorderproduct.d.ts +14 -3
- package/dist/commonjs/models/components/customerorderproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerorderproduct.js +11 -2
- package/dist/commonjs/models/components/customerorderproduct.js.map +1 -1
- package/dist/commonjs/models/components/customerordersubscription.d.ts +10 -0
- package/dist/commonjs/models/components/customerordersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerordersubscription.js +8 -0
- package/dist/commonjs/models/components/customerordersubscription.js.map +1 -1
- package/dist/commonjs/models/components/customerproduct.d.ts +14 -3
- package/dist/commonjs/models/components/customerproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerproduct.js +11 -2
- package/dist/commonjs/models/components/customerproduct.js.map +1 -1
- package/dist/commonjs/models/components/customerstatesubscription.d.ts +38 -2
- package/dist/commonjs/models/components/customerstatesubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerstatesubscription.js +30 -3
- package/dist/commonjs/models/components/customerstatesubscription.js.map +1 -1
- package/dist/commonjs/models/components/customersubscription.d.ts +10 -0
- package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersubscription.js +8 -0
- package/dist/commonjs/models/components/customersubscription.js.map +1 -1
- package/dist/commonjs/models/components/customersubscriptionproduct.d.ts +14 -3
- package/dist/commonjs/models/components/customersubscriptionproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersubscriptionproduct.js +11 -2
- package/dist/commonjs/models/components/customersubscriptionproduct.js.map +1 -1
- package/dist/commonjs/models/components/discountproduct.d.ts +14 -3
- package/dist/commonjs/models/components/discountproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/discountproduct.js +11 -2
- package/dist/commonjs/models/components/discountproduct.js.map +1 -1
- package/dist/commonjs/models/components/orderproduct.d.ts +14 -3
- package/dist/commonjs/models/components/orderproduct.d.ts.map +1 -1
- package/dist/commonjs/models/components/orderproduct.js +11 -2
- package/dist/commonjs/models/components/orderproduct.js.map +1 -1
- package/dist/commonjs/models/components/ordersubscription.d.ts +10 -0
- package/dist/commonjs/models/components/ordersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/ordersubscription.js +8 -0
- package/dist/commonjs/models/components/ordersubscription.js.map +1 -1
- package/dist/commonjs/models/components/product.d.ts +14 -3
- package/dist/commonjs/models/components/product.d.ts.map +1 -1
- package/dist/commonjs/models/components/product.js +11 -2
- package/dist/commonjs/models/components/product.js.map +1 -1
- package/dist/commonjs/models/components/productcreate.d.ts +4 -111
- package/dist/commonjs/models/components/productcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreate.js +9 -106
- package/dist/commonjs/models/components/productcreate.js.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.d.ts +130 -0
- package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -0
- package/dist/commonjs/models/components/productcreateonetime.js +169 -0
- package/dist/commonjs/models/components/productcreateonetime.js.map +1 -0
- package/dist/commonjs/models/components/productcreaterecurring.d.ts +139 -0
- package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -0
- package/dist/commonjs/models/components/productcreaterecurring.js +179 -0
- package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -0
- package/dist/commonjs/models/components/productupdate.d.ts +11 -0
- package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productupdate.js +9 -0
- package/dist/commonjs/models/components/productupdate.js.map +1 -1
- package/dist/commonjs/models/components/subscription.d.ts +10 -0
- package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscription.js +8 -0
- package/dist/commonjs/models/components/subscription.js.map +1 -1
- package/dist/commonjs/models/components/subscriptionupdate.d.ts +3 -2
- package/dist/commonjs/models/components/subscriptionupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/subscriptionupdate.js +3 -0
- package/dist/commonjs/models/components/subscriptionupdate.js.map +1 -1
- package/dist/commonjs/models/components/subscriptionupdatetrial.d.ts +32 -0
- package/dist/commonjs/models/components/subscriptionupdatetrial.d.ts.map +1 -0
- package/dist/commonjs/models/components/subscriptionupdatetrial.js +78 -0
- package/dist/commonjs/models/components/subscriptionupdatetrial.js.map +1 -0
- package/dist/commonjs/models/components/trialinterval.d.ts +34 -0
- package/dist/commonjs/models/components/trialinterval.d.ts.map +1 -0
- package/dist/commonjs/models/components/trialinterval.js +62 -0
- package/dist/commonjs/models/components/trialinterval.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/address.d.ts +669 -669
- package/dist/esm/models/components/address.js +221 -221
- package/dist/esm/models/components/addressinput.d.ts +653 -653
- package/dist/esm/models/components/addressinput.js +217 -217
- package/dist/esm/models/components/checkout.d.ts +31 -5
- package/dist/esm/models/components/checkout.d.ts.map +1 -1
- package/dist/esm/models/components/checkout.js +23 -2
- package/dist/esm/models/components/checkout.js.map +1 -1
- package/dist/esm/models/components/checkoutcreate.d.ts +11 -0
- package/dist/esm/models/components/checkoutcreate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutcreate.js +9 -0
- package/dist/esm/models/components/checkoutcreate.js.map +1 -1
- package/dist/esm/models/components/checkoutlink.d.ts +14 -3
- package/dist/esm/models/components/checkoutlink.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlink.js +11 -2
- package/dist/esm/models/components/checkoutlink.js.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproduct.d.ts +11 -0
- package/dist/esm/models/components/checkoutlinkcreateproduct.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproduct.js +9 -0
- package/dist/esm/models/components/checkoutlinkcreateproduct.js.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproductprice.d.ts +11 -0
- package/dist/esm/models/components/checkoutlinkcreateproductprice.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproductprice.js +9 -0
- package/dist/esm/models/components/checkoutlinkcreateproductprice.js.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproducts.d.ts +11 -0
- package/dist/esm/models/components/checkoutlinkcreateproducts.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlinkcreateproducts.js +9 -0
- package/dist/esm/models/components/checkoutlinkcreateproducts.js.map +1 -1
- package/dist/esm/models/components/checkoutlinkproduct.d.ts +14 -3
- package/dist/esm/models/components/checkoutlinkproduct.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlinkproduct.js +11 -2
- package/dist/esm/models/components/checkoutlinkproduct.js.map +1 -1
- package/dist/esm/models/components/checkoutlinkupdate.d.ts +11 -0
- package/dist/esm/models/components/checkoutlinkupdate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutlinkupdate.js +9 -0
- package/dist/esm/models/components/checkoutlinkupdate.js.map +1 -1
- package/dist/esm/models/components/checkoutproduct.d.ts +14 -3
- package/dist/esm/models/components/checkoutproduct.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutproduct.js +11 -2
- package/dist/esm/models/components/checkoutproduct.js.map +1 -1
- package/dist/esm/models/components/checkoutpublic.d.ts +21 -5
- package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublic.js +15 -2
- package/dist/esm/models/components/checkoutpublic.js.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +21 -5
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.js +15 -2
- package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
- package/dist/esm/models/components/checkoutupdate.d.ts +11 -0
- package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutupdate.js +9 -0
- package/dist/esm/models/components/checkoutupdate.js.map +1 -1
- package/dist/esm/models/components/customerorderproduct.d.ts +14 -3
- package/dist/esm/models/components/customerorderproduct.d.ts.map +1 -1
- package/dist/esm/models/components/customerorderproduct.js +11 -2
- package/dist/esm/models/components/customerorderproduct.js.map +1 -1
- package/dist/esm/models/components/customerordersubscription.d.ts +10 -0
- package/dist/esm/models/components/customerordersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customerordersubscription.js +8 -0
- package/dist/esm/models/components/customerordersubscription.js.map +1 -1
- package/dist/esm/models/components/customerproduct.d.ts +14 -3
- package/dist/esm/models/components/customerproduct.d.ts.map +1 -1
- package/dist/esm/models/components/customerproduct.js +11 -2
- package/dist/esm/models/components/customerproduct.js.map +1 -1
- package/dist/esm/models/components/customerstatesubscription.d.ts +38 -2
- package/dist/esm/models/components/customerstatesubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customerstatesubscription.js +29 -2
- package/dist/esm/models/components/customerstatesubscription.js.map +1 -1
- package/dist/esm/models/components/customersubscription.d.ts +10 -0
- package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customersubscription.js +8 -0
- package/dist/esm/models/components/customersubscription.js.map +1 -1
- package/dist/esm/models/components/customersubscriptionproduct.d.ts +14 -3
- package/dist/esm/models/components/customersubscriptionproduct.d.ts.map +1 -1
- package/dist/esm/models/components/customersubscriptionproduct.js +11 -2
- package/dist/esm/models/components/customersubscriptionproduct.js.map +1 -1
- package/dist/esm/models/components/discountproduct.d.ts +14 -3
- package/dist/esm/models/components/discountproduct.d.ts.map +1 -1
- package/dist/esm/models/components/discountproduct.js +11 -2
- package/dist/esm/models/components/discountproduct.js.map +1 -1
- package/dist/esm/models/components/orderproduct.d.ts +14 -3
- package/dist/esm/models/components/orderproduct.d.ts.map +1 -1
- package/dist/esm/models/components/orderproduct.js +11 -2
- package/dist/esm/models/components/orderproduct.js.map +1 -1
- package/dist/esm/models/components/ordersubscription.d.ts +10 -0
- package/dist/esm/models/components/ordersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/ordersubscription.js +8 -0
- package/dist/esm/models/components/ordersubscription.js.map +1 -1
- package/dist/esm/models/components/product.d.ts +14 -3
- package/dist/esm/models/components/product.d.ts.map +1 -1
- package/dist/esm/models/components/product.js +11 -2
- package/dist/esm/models/components/product.js.map +1 -1
- package/dist/esm/models/components/productcreate.d.ts +4 -111
- package/dist/esm/models/components/productcreate.d.ts.map +1 -1
- package/dist/esm/models/components/productcreate.js +8 -101
- package/dist/esm/models/components/productcreate.js.map +1 -1
- package/dist/esm/models/components/productcreateonetime.d.ts +130 -0
- package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -0
- package/dist/esm/models/components/productcreateonetime.js +127 -0
- package/dist/esm/models/components/productcreateonetime.js.map +1 -0
- package/dist/esm/models/components/productcreaterecurring.d.ts +139 -0
- package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -0
- package/dist/esm/models/components/productcreaterecurring.js +137 -0
- package/dist/esm/models/components/productcreaterecurring.js.map +1 -0
- package/dist/esm/models/components/productupdate.d.ts +11 -0
- package/dist/esm/models/components/productupdate.d.ts.map +1 -1
- package/dist/esm/models/components/productupdate.js +9 -0
- package/dist/esm/models/components/productupdate.js.map +1 -1
- package/dist/esm/models/components/subscription.d.ts +10 -0
- package/dist/esm/models/components/subscription.d.ts.map +1 -1
- package/dist/esm/models/components/subscription.js +8 -0
- package/dist/esm/models/components/subscription.js.map +1 -1
- package/dist/esm/models/components/subscriptionupdate.d.ts +3 -2
- package/dist/esm/models/components/subscriptionupdate.d.ts.map +1 -1
- package/dist/esm/models/components/subscriptionupdate.js +3 -0
- package/dist/esm/models/components/subscriptionupdate.js.map +1 -1
- package/dist/esm/models/components/subscriptionupdatetrial.d.ts +32 -0
- package/dist/esm/models/components/subscriptionupdatetrial.d.ts.map +1 -0
- package/dist/esm/models/components/subscriptionupdatetrial.js +40 -0
- package/dist/esm/models/components/subscriptionupdatetrial.js.map +1 -0
- package/dist/esm/models/components/trialinterval.d.ts +34 -0
- package/dist/esm/models/components/trialinterval.d.ts.map +1 -0
- package/dist/esm/models/components/trialinterval.js +26 -0
- package/dist/esm/models/components/trialinterval.js.map +1 -0
- package/docs/sdks/products/README.md +2 -2
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- 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/address.ts +221 -221
- package/src/models/components/addressinput.ts +217 -217
- package/src/models/components/checkout.ts +59 -7
- package/src/models/components/checkoutcreate.ts +23 -0
- package/src/models/components/checkoutlink.ts +28 -5
- package/src/models/components/checkoutlinkcreateproduct.ts +23 -0
- package/src/models/components/checkoutlinkcreateproductprice.ts +23 -0
- package/src/models/components/checkoutlinkcreateproducts.ts +23 -0
- package/src/models/components/checkoutlinkproduct.ts +28 -5
- package/src/models/components/checkoutlinkupdate.ts +23 -0
- package/src/models/components/checkoutproduct.ts +28 -5
- package/src/models/components/checkoutpublic.ts +41 -7
- package/src/models/components/checkoutpublicconfirmed.ts +41 -7
- package/src/models/components/checkoutupdate.ts +23 -0
- package/src/models/components/customerorderproduct.ts +28 -5
- package/src/models/components/customerordersubscription.ts +22 -0
- package/src/models/components/customerproduct.ts +28 -5
- package/src/models/components/customerstatesubscription.ts +56 -4
- package/src/models/components/customersubscription.ts +22 -0
- package/src/models/components/customersubscriptionproduct.ts +28 -5
- package/src/models/components/discountproduct.ts +28 -5
- package/src/models/components/orderproduct.ts +28 -5
- package/src/models/components/ordersubscription.ts +22 -0
- package/src/models/components/product.ts +28 -5
- package/src/models/components/productcreate.ts +22 -275
- package/src/models/components/productcreateonetime.ts +329 -0
- package/src/models/components/productcreaterecurring.ts +356 -0
- package/src/models/components/productupdate.ts +23 -0
- package/src/models/components/subscription.ts +22 -0
- package/src/models/components/subscriptionupdate.ts +10 -0
- package/src/models/components/subscriptionupdatetrial.ts +78 -0
- package/src/models/components/trialinterval.ts +35 -0
|
@@ -0,0 +1,356 @@
|
|
|
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 { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
AttachedCustomFieldCreate,
|
|
12
|
+
AttachedCustomFieldCreate$inboundSchema,
|
|
13
|
+
AttachedCustomFieldCreate$Outbound,
|
|
14
|
+
AttachedCustomFieldCreate$outboundSchema,
|
|
15
|
+
} from "./attachedcustomfieldcreate.js";
|
|
16
|
+
import {
|
|
17
|
+
ProductPriceCustomCreate,
|
|
18
|
+
ProductPriceCustomCreate$inboundSchema,
|
|
19
|
+
ProductPriceCustomCreate$Outbound,
|
|
20
|
+
ProductPriceCustomCreate$outboundSchema,
|
|
21
|
+
} from "./productpricecustomcreate.js";
|
|
22
|
+
import {
|
|
23
|
+
ProductPriceFixedCreate,
|
|
24
|
+
ProductPriceFixedCreate$inboundSchema,
|
|
25
|
+
ProductPriceFixedCreate$Outbound,
|
|
26
|
+
ProductPriceFixedCreate$outboundSchema,
|
|
27
|
+
} from "./productpricefixedcreate.js";
|
|
28
|
+
import {
|
|
29
|
+
ProductPriceFreeCreate,
|
|
30
|
+
ProductPriceFreeCreate$inboundSchema,
|
|
31
|
+
ProductPriceFreeCreate$Outbound,
|
|
32
|
+
ProductPriceFreeCreate$outboundSchema,
|
|
33
|
+
} from "./productpricefreecreate.js";
|
|
34
|
+
import {
|
|
35
|
+
ProductPriceMeteredUnitCreate,
|
|
36
|
+
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
37
|
+
ProductPriceMeteredUnitCreate$Outbound,
|
|
38
|
+
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
39
|
+
} from "./productpricemeteredunitcreate.js";
|
|
40
|
+
import {
|
|
41
|
+
SubscriptionRecurringInterval,
|
|
42
|
+
SubscriptionRecurringInterval$inboundSchema,
|
|
43
|
+
SubscriptionRecurringInterval$outboundSchema,
|
|
44
|
+
} from "./subscriptionrecurringinterval.js";
|
|
45
|
+
import {
|
|
46
|
+
TrialInterval,
|
|
47
|
+
TrialInterval$inboundSchema,
|
|
48
|
+
TrialInterval$outboundSchema,
|
|
49
|
+
} from "./trialinterval.js";
|
|
50
|
+
|
|
51
|
+
export type ProductCreateRecurringMetadata = string | number | number | boolean;
|
|
52
|
+
|
|
53
|
+
export type ProductCreateRecurringPrices =
|
|
54
|
+
| ProductPriceMeteredUnitCreate
|
|
55
|
+
| ProductPriceFixedCreate
|
|
56
|
+
| ProductPriceCustomCreate
|
|
57
|
+
| ProductPriceFreeCreate;
|
|
58
|
+
|
|
59
|
+
export type ProductCreateRecurring = {
|
|
60
|
+
/**
|
|
61
|
+
* Key-value object allowing you to store additional information.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
*
|
|
65
|
+
* The key must be a string with a maximum length of **40 characters**.
|
|
66
|
+
* The value must be either:
|
|
67
|
+
*
|
|
68
|
+
* * A string with a maximum length of **500 characters**
|
|
69
|
+
* * An integer
|
|
70
|
+
* * A floating-point number
|
|
71
|
+
* * A boolean
|
|
72
|
+
*
|
|
73
|
+
* You can store up to **50 key-value pairs**.
|
|
74
|
+
*/
|
|
75
|
+
metadata?: { [k: string]: string | number | number | boolean } | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The name of the product.
|
|
78
|
+
*/
|
|
79
|
+
name: string;
|
|
80
|
+
/**
|
|
81
|
+
* The description of the product.
|
|
82
|
+
*/
|
|
83
|
+
description?: string | null | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* 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.
|
|
86
|
+
*/
|
|
87
|
+
prices: Array<
|
|
88
|
+
| ProductPriceMeteredUnitCreate
|
|
89
|
+
| ProductPriceFixedCreate
|
|
90
|
+
| ProductPriceCustomCreate
|
|
91
|
+
| ProductPriceFreeCreate
|
|
92
|
+
>;
|
|
93
|
+
/**
|
|
94
|
+
* List of file IDs. Each one must be on the same organization as the product, of type `product_media` and correctly uploaded.
|
|
95
|
+
*/
|
|
96
|
+
medias?: Array<string> | null | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* List of custom fields to attach.
|
|
99
|
+
*/
|
|
100
|
+
attachedCustomFields?: Array<AttachedCustomFieldCreate> | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* The ID of the organization owning the product. **Required unless you use an organization token.**
|
|
103
|
+
*/
|
|
104
|
+
organizationId?: string | null | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* The interval unit for the trial period.
|
|
107
|
+
*/
|
|
108
|
+
trialInterval?: TrialInterval | null | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* The number of interval units for the trial period.
|
|
111
|
+
*/
|
|
112
|
+
trialIntervalCount?: number | null | undefined;
|
|
113
|
+
recurringInterval: SubscriptionRecurringInterval;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const ProductCreateRecurringMetadata$inboundSchema: z.ZodType<
|
|
118
|
+
ProductCreateRecurringMetadata,
|
|
119
|
+
z.ZodTypeDef,
|
|
120
|
+
unknown
|
|
121
|
+
> = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
export type ProductCreateRecurringMetadata$Outbound =
|
|
125
|
+
| string
|
|
126
|
+
| number
|
|
127
|
+
| number
|
|
128
|
+
| boolean;
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export const ProductCreateRecurringMetadata$outboundSchema: z.ZodType<
|
|
132
|
+
ProductCreateRecurringMetadata$Outbound,
|
|
133
|
+
z.ZodTypeDef,
|
|
134
|
+
ProductCreateRecurringMetadata
|
|
135
|
+
> = z.union([z.string(), z.number().int(), z.number(), z.boolean()]);
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
140
|
+
*/
|
|
141
|
+
export namespace ProductCreateRecurringMetadata$ {
|
|
142
|
+
/** @deprecated use `ProductCreateRecurringMetadata$inboundSchema` instead. */
|
|
143
|
+
export const inboundSchema = ProductCreateRecurringMetadata$inboundSchema;
|
|
144
|
+
/** @deprecated use `ProductCreateRecurringMetadata$outboundSchema` instead. */
|
|
145
|
+
export const outboundSchema = ProductCreateRecurringMetadata$outboundSchema;
|
|
146
|
+
/** @deprecated use `ProductCreateRecurringMetadata$Outbound` instead. */
|
|
147
|
+
export type Outbound = ProductCreateRecurringMetadata$Outbound;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function productCreateRecurringMetadataToJSON(
|
|
151
|
+
productCreateRecurringMetadata: ProductCreateRecurringMetadata,
|
|
152
|
+
): string {
|
|
153
|
+
return JSON.stringify(
|
|
154
|
+
ProductCreateRecurringMetadata$outboundSchema.parse(
|
|
155
|
+
productCreateRecurringMetadata,
|
|
156
|
+
),
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function productCreateRecurringMetadataFromJSON(
|
|
161
|
+
jsonString: string,
|
|
162
|
+
): SafeParseResult<ProductCreateRecurringMetadata, SDKValidationError> {
|
|
163
|
+
return safeParse(
|
|
164
|
+
jsonString,
|
|
165
|
+
(x) => ProductCreateRecurringMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
166
|
+
`Failed to parse 'ProductCreateRecurringMetadata' from JSON`,
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const ProductCreateRecurringPrices$inboundSchema: z.ZodType<
|
|
172
|
+
ProductCreateRecurringPrices,
|
|
173
|
+
z.ZodTypeDef,
|
|
174
|
+
unknown
|
|
175
|
+
> = z.union([
|
|
176
|
+
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
177
|
+
ProductPriceFixedCreate$inboundSchema,
|
|
178
|
+
ProductPriceCustomCreate$inboundSchema,
|
|
179
|
+
ProductPriceFreeCreate$inboundSchema,
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
/** @internal */
|
|
183
|
+
export type ProductCreateRecurringPrices$Outbound =
|
|
184
|
+
| ProductPriceMeteredUnitCreate$Outbound
|
|
185
|
+
| ProductPriceFixedCreate$Outbound
|
|
186
|
+
| ProductPriceCustomCreate$Outbound
|
|
187
|
+
| ProductPriceFreeCreate$Outbound;
|
|
188
|
+
|
|
189
|
+
/** @internal */
|
|
190
|
+
export const ProductCreateRecurringPrices$outboundSchema: z.ZodType<
|
|
191
|
+
ProductCreateRecurringPrices$Outbound,
|
|
192
|
+
z.ZodTypeDef,
|
|
193
|
+
ProductCreateRecurringPrices
|
|
194
|
+
> = z.union([
|
|
195
|
+
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
196
|
+
ProductPriceFixedCreate$outboundSchema,
|
|
197
|
+
ProductPriceCustomCreate$outboundSchema,
|
|
198
|
+
ProductPriceFreeCreate$outboundSchema,
|
|
199
|
+
]);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @internal
|
|
203
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
204
|
+
*/
|
|
205
|
+
export namespace ProductCreateRecurringPrices$ {
|
|
206
|
+
/** @deprecated use `ProductCreateRecurringPrices$inboundSchema` instead. */
|
|
207
|
+
export const inboundSchema = ProductCreateRecurringPrices$inboundSchema;
|
|
208
|
+
/** @deprecated use `ProductCreateRecurringPrices$outboundSchema` instead. */
|
|
209
|
+
export const outboundSchema = ProductCreateRecurringPrices$outboundSchema;
|
|
210
|
+
/** @deprecated use `ProductCreateRecurringPrices$Outbound` instead. */
|
|
211
|
+
export type Outbound = ProductCreateRecurringPrices$Outbound;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function productCreateRecurringPricesToJSON(
|
|
215
|
+
productCreateRecurringPrices: ProductCreateRecurringPrices,
|
|
216
|
+
): string {
|
|
217
|
+
return JSON.stringify(
|
|
218
|
+
ProductCreateRecurringPrices$outboundSchema.parse(
|
|
219
|
+
productCreateRecurringPrices,
|
|
220
|
+
),
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function productCreateRecurringPricesFromJSON(
|
|
225
|
+
jsonString: string,
|
|
226
|
+
): SafeParseResult<ProductCreateRecurringPrices, SDKValidationError> {
|
|
227
|
+
return safeParse(
|
|
228
|
+
jsonString,
|
|
229
|
+
(x) => ProductCreateRecurringPrices$inboundSchema.parse(JSON.parse(x)),
|
|
230
|
+
`Failed to parse 'ProductCreateRecurringPrices' from JSON`,
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** @internal */
|
|
235
|
+
export const ProductCreateRecurring$inboundSchema: z.ZodType<
|
|
236
|
+
ProductCreateRecurring,
|
|
237
|
+
z.ZodTypeDef,
|
|
238
|
+
unknown
|
|
239
|
+
> = z.object({
|
|
240
|
+
metadata: z.record(
|
|
241
|
+
z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
|
|
242
|
+
).optional(),
|
|
243
|
+
name: z.string(),
|
|
244
|
+
description: z.nullable(z.string()).optional(),
|
|
245
|
+
prices: z.array(
|
|
246
|
+
z.union([
|
|
247
|
+
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
248
|
+
ProductPriceFixedCreate$inboundSchema,
|
|
249
|
+
ProductPriceCustomCreate$inboundSchema,
|
|
250
|
+
ProductPriceFreeCreate$inboundSchema,
|
|
251
|
+
]),
|
|
252
|
+
),
|
|
253
|
+
medias: z.nullable(z.array(z.string())).optional(),
|
|
254
|
+
attached_custom_fields: z.array(AttachedCustomFieldCreate$inboundSchema)
|
|
255
|
+
.optional(),
|
|
256
|
+
organization_id: z.nullable(z.string()).optional(),
|
|
257
|
+
trial_interval: z.nullable(TrialInterval$inboundSchema).optional(),
|
|
258
|
+
trial_interval_count: z.nullable(z.number().int()).optional(),
|
|
259
|
+
recurring_interval: SubscriptionRecurringInterval$inboundSchema,
|
|
260
|
+
}).transform((v) => {
|
|
261
|
+
return remap$(v, {
|
|
262
|
+
"attached_custom_fields": "attachedCustomFields",
|
|
263
|
+
"organization_id": "organizationId",
|
|
264
|
+
"trial_interval": "trialInterval",
|
|
265
|
+
"trial_interval_count": "trialIntervalCount",
|
|
266
|
+
"recurring_interval": "recurringInterval",
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
/** @internal */
|
|
271
|
+
export type ProductCreateRecurring$Outbound = {
|
|
272
|
+
metadata?: { [k: string]: string | number | number | boolean } | undefined;
|
|
273
|
+
name: string;
|
|
274
|
+
description?: string | null | undefined;
|
|
275
|
+
prices: Array<
|
|
276
|
+
| ProductPriceMeteredUnitCreate$Outbound
|
|
277
|
+
| ProductPriceFixedCreate$Outbound
|
|
278
|
+
| ProductPriceCustomCreate$Outbound
|
|
279
|
+
| ProductPriceFreeCreate$Outbound
|
|
280
|
+
>;
|
|
281
|
+
medias?: Array<string> | null | undefined;
|
|
282
|
+
attached_custom_fields?:
|
|
283
|
+
| Array<AttachedCustomFieldCreate$Outbound>
|
|
284
|
+
| undefined;
|
|
285
|
+
organization_id?: string | null | undefined;
|
|
286
|
+
trial_interval?: string | null | undefined;
|
|
287
|
+
trial_interval_count?: number | null | undefined;
|
|
288
|
+
recurring_interval: string;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/** @internal */
|
|
292
|
+
export const ProductCreateRecurring$outboundSchema: z.ZodType<
|
|
293
|
+
ProductCreateRecurring$Outbound,
|
|
294
|
+
z.ZodTypeDef,
|
|
295
|
+
ProductCreateRecurring
|
|
296
|
+
> = z.object({
|
|
297
|
+
metadata: z.record(
|
|
298
|
+
z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
|
|
299
|
+
).optional(),
|
|
300
|
+
name: z.string(),
|
|
301
|
+
description: z.nullable(z.string()).optional(),
|
|
302
|
+
prices: z.array(
|
|
303
|
+
z.union([
|
|
304
|
+
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
305
|
+
ProductPriceFixedCreate$outboundSchema,
|
|
306
|
+
ProductPriceCustomCreate$outboundSchema,
|
|
307
|
+
ProductPriceFreeCreate$outboundSchema,
|
|
308
|
+
]),
|
|
309
|
+
),
|
|
310
|
+
medias: z.nullable(z.array(z.string())).optional(),
|
|
311
|
+
attachedCustomFields: z.array(AttachedCustomFieldCreate$outboundSchema)
|
|
312
|
+
.optional(),
|
|
313
|
+
organizationId: z.nullable(z.string()).optional(),
|
|
314
|
+
trialInterval: z.nullable(TrialInterval$outboundSchema).optional(),
|
|
315
|
+
trialIntervalCount: z.nullable(z.number().int()).optional(),
|
|
316
|
+
recurringInterval: SubscriptionRecurringInterval$outboundSchema,
|
|
317
|
+
}).transform((v) => {
|
|
318
|
+
return remap$(v, {
|
|
319
|
+
attachedCustomFields: "attached_custom_fields",
|
|
320
|
+
organizationId: "organization_id",
|
|
321
|
+
trialInterval: "trial_interval",
|
|
322
|
+
trialIntervalCount: "trial_interval_count",
|
|
323
|
+
recurringInterval: "recurring_interval",
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @internal
|
|
329
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
330
|
+
*/
|
|
331
|
+
export namespace ProductCreateRecurring$ {
|
|
332
|
+
/** @deprecated use `ProductCreateRecurring$inboundSchema` instead. */
|
|
333
|
+
export const inboundSchema = ProductCreateRecurring$inboundSchema;
|
|
334
|
+
/** @deprecated use `ProductCreateRecurring$outboundSchema` instead. */
|
|
335
|
+
export const outboundSchema = ProductCreateRecurring$outboundSchema;
|
|
336
|
+
/** @deprecated use `ProductCreateRecurring$Outbound` instead. */
|
|
337
|
+
export type Outbound = ProductCreateRecurring$Outbound;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export function productCreateRecurringToJSON(
|
|
341
|
+
productCreateRecurring: ProductCreateRecurring,
|
|
342
|
+
): string {
|
|
343
|
+
return JSON.stringify(
|
|
344
|
+
ProductCreateRecurring$outboundSchema.parse(productCreateRecurring),
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function productCreateRecurringFromJSON(
|
|
349
|
+
jsonString: string,
|
|
350
|
+
): SafeParseResult<ProductCreateRecurring, SDKValidationError> {
|
|
351
|
+
return safeParse(
|
|
352
|
+
jsonString,
|
|
353
|
+
(x) => ProductCreateRecurring$inboundSchema.parse(JSON.parse(x)),
|
|
354
|
+
`Failed to parse 'ProductCreateRecurring' from JSON`,
|
|
355
|
+
);
|
|
356
|
+
}
|
|
@@ -48,6 +48,11 @@ import {
|
|
|
48
48
|
SubscriptionRecurringInterval$inboundSchema,
|
|
49
49
|
SubscriptionRecurringInterval$outboundSchema,
|
|
50
50
|
} from "./subscriptionrecurringinterval.js";
|
|
51
|
+
import {
|
|
52
|
+
TrialInterval,
|
|
53
|
+
TrialInterval$inboundSchema,
|
|
54
|
+
TrialInterval$outboundSchema,
|
|
55
|
+
} from "./trialinterval.js";
|
|
51
56
|
|
|
52
57
|
export type ProductUpdateMetadata = string | number | number | boolean;
|
|
53
58
|
|
|
@@ -78,6 +83,14 @@ export type ProductUpdate = {
|
|
|
78
83
|
* You can store up to **50 key-value pairs**.
|
|
79
84
|
*/
|
|
80
85
|
metadata?: { [k: string]: string | number | number | boolean } | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The interval unit for the trial period.
|
|
88
|
+
*/
|
|
89
|
+
trialInterval?: TrialInterval | null | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* The number of interval units for the trial period.
|
|
92
|
+
*/
|
|
93
|
+
trialIntervalCount?: number | null | undefined;
|
|
81
94
|
name?: string | null | undefined;
|
|
82
95
|
/**
|
|
83
96
|
* The description of the product.
|
|
@@ -233,6 +246,8 @@ export const ProductUpdate$inboundSchema: z.ZodType<
|
|
|
233
246
|
metadata: z.record(
|
|
234
247
|
z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
|
|
235
248
|
).optional(),
|
|
249
|
+
trial_interval: z.nullable(TrialInterval$inboundSchema).optional(),
|
|
250
|
+
trial_interval_count: z.nullable(z.number().int()).optional(),
|
|
236
251
|
name: z.nullable(z.string()).optional(),
|
|
237
252
|
description: z.nullable(z.string()).optional(),
|
|
238
253
|
recurring_interval: z.nullable(SubscriptionRecurringInterval$inboundSchema)
|
|
@@ -255,6 +270,8 @@ export const ProductUpdate$inboundSchema: z.ZodType<
|
|
|
255
270
|
).optional(),
|
|
256
271
|
}).transform((v) => {
|
|
257
272
|
return remap$(v, {
|
|
273
|
+
"trial_interval": "trialInterval",
|
|
274
|
+
"trial_interval_count": "trialIntervalCount",
|
|
258
275
|
"recurring_interval": "recurringInterval",
|
|
259
276
|
"is_archived": "isArchived",
|
|
260
277
|
"attached_custom_fields": "attachedCustomFields",
|
|
@@ -264,6 +281,8 @@ export const ProductUpdate$inboundSchema: z.ZodType<
|
|
|
264
281
|
/** @internal */
|
|
265
282
|
export type ProductUpdate$Outbound = {
|
|
266
283
|
metadata?: { [k: string]: string | number | number | boolean } | undefined;
|
|
284
|
+
trial_interval?: string | null | undefined;
|
|
285
|
+
trial_interval_count?: number | null | undefined;
|
|
267
286
|
name?: string | null | undefined;
|
|
268
287
|
description?: string | null | undefined;
|
|
269
288
|
recurring_interval?: string | null | undefined;
|
|
@@ -294,6 +313,8 @@ export const ProductUpdate$outboundSchema: z.ZodType<
|
|
|
294
313
|
metadata: z.record(
|
|
295
314
|
z.union([z.string(), z.number().int(), z.number(), z.boolean()]),
|
|
296
315
|
).optional(),
|
|
316
|
+
trialInterval: z.nullable(TrialInterval$outboundSchema).optional(),
|
|
317
|
+
trialIntervalCount: z.nullable(z.number().int()).optional(),
|
|
297
318
|
name: z.nullable(z.string()).optional(),
|
|
298
319
|
description: z.nullable(z.string()).optional(),
|
|
299
320
|
recurringInterval: z.nullable(SubscriptionRecurringInterval$outboundSchema)
|
|
@@ -316,6 +337,8 @@ export const ProductUpdate$outboundSchema: z.ZodType<
|
|
|
316
337
|
).optional(),
|
|
317
338
|
}).transform((v) => {
|
|
318
339
|
return remap$(v, {
|
|
340
|
+
trialInterval: "trial_interval",
|
|
341
|
+
trialIntervalCount: "trial_interval_count",
|
|
319
342
|
recurringInterval: "recurring_interval",
|
|
320
343
|
isArchived: "is_archived",
|
|
321
344
|
attachedCustomFields: "attached_custom_fields",
|
|
@@ -120,6 +120,14 @@ export type Subscription = {
|
|
|
120
120
|
* The end timestamp of the current billing period.
|
|
121
121
|
*/
|
|
122
122
|
currentPeriodEnd: Date | null;
|
|
123
|
+
/**
|
|
124
|
+
* The start timestamp of the trial period, if any.
|
|
125
|
+
*/
|
|
126
|
+
trialStart: Date | null;
|
|
127
|
+
/**
|
|
128
|
+
* The end timestamp of the trial period, if any.
|
|
129
|
+
*/
|
|
130
|
+
trialEnd: Date | null;
|
|
123
131
|
/**
|
|
124
132
|
* Whether the subscription will be canceled at the end of the current period.
|
|
125
133
|
*/
|
|
@@ -422,6 +430,12 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
422
430
|
current_period_end: z.nullable(
|
|
423
431
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
424
432
|
),
|
|
433
|
+
trial_start: z.nullable(
|
|
434
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
435
|
+
),
|
|
436
|
+
trial_end: z.nullable(
|
|
437
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
438
|
+
),
|
|
425
439
|
cancel_at_period_end: z.boolean(),
|
|
426
440
|
canceled_at: z.nullable(
|
|
427
441
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
@@ -480,6 +494,8 @@ export const Subscription$inboundSchema: z.ZodType<
|
|
|
480
494
|
"recurring_interval": "recurringInterval",
|
|
481
495
|
"current_period_start": "currentPeriodStart",
|
|
482
496
|
"current_period_end": "currentPeriodEnd",
|
|
497
|
+
"trial_start": "trialStart",
|
|
498
|
+
"trial_end": "trialEnd",
|
|
483
499
|
"cancel_at_period_end": "cancelAtPeriodEnd",
|
|
484
500
|
"canceled_at": "canceledAt",
|
|
485
501
|
"started_at": "startedAt",
|
|
@@ -506,6 +522,8 @@ export type Subscription$Outbound = {
|
|
|
506
522
|
status: string;
|
|
507
523
|
current_period_start: string;
|
|
508
524
|
current_period_end: string | null;
|
|
525
|
+
trial_start: string | null;
|
|
526
|
+
trial_end: string | null;
|
|
509
527
|
cancel_at_period_end: boolean;
|
|
510
528
|
canceled_at: string | null;
|
|
511
529
|
started_at: string | null;
|
|
@@ -548,6 +566,8 @@ export const Subscription$outboundSchema: z.ZodType<
|
|
|
548
566
|
status: SubscriptionStatus$outboundSchema,
|
|
549
567
|
currentPeriodStart: z.date().transform(v => v.toISOString()),
|
|
550
568
|
currentPeriodEnd: z.nullable(z.date().transform(v => v.toISOString())),
|
|
569
|
+
trialStart: z.nullable(z.date().transform(v => v.toISOString())),
|
|
570
|
+
trialEnd: z.nullable(z.date().transform(v => v.toISOString())),
|
|
551
571
|
cancelAtPeriodEnd: z.boolean(),
|
|
552
572
|
canceledAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
553
573
|
startedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
@@ -598,6 +618,8 @@ export const Subscription$outboundSchema: z.ZodType<
|
|
|
598
618
|
recurringInterval: "recurring_interval",
|
|
599
619
|
currentPeriodStart: "current_period_start",
|
|
600
620
|
currentPeriodEnd: "current_period_end",
|
|
621
|
+
trialStart: "trial_start",
|
|
622
|
+
trialEnd: "trial_end",
|
|
601
623
|
cancelAtPeriodEnd: "cancel_at_period_end",
|
|
602
624
|
canceledAt: "canceled_at",
|
|
603
625
|
startedAt: "started_at",
|
|
@@ -30,10 +30,17 @@ import {
|
|
|
30
30
|
SubscriptionUpdateProduct$Outbound,
|
|
31
31
|
SubscriptionUpdateProduct$outboundSchema,
|
|
32
32
|
} from "./subscriptionupdateproduct.js";
|
|
33
|
+
import {
|
|
34
|
+
SubscriptionUpdateTrial,
|
|
35
|
+
SubscriptionUpdateTrial$inboundSchema,
|
|
36
|
+
SubscriptionUpdateTrial$Outbound,
|
|
37
|
+
SubscriptionUpdateTrial$outboundSchema,
|
|
38
|
+
} from "./subscriptionupdatetrial.js";
|
|
33
39
|
|
|
34
40
|
export type SubscriptionUpdate =
|
|
35
41
|
| SubscriptionUpdateProduct
|
|
36
42
|
| SubscriptionUpdateDiscount
|
|
43
|
+
| SubscriptionUpdateTrial
|
|
37
44
|
| SubscriptionCancel
|
|
38
45
|
| SubscriptionRevoke;
|
|
39
46
|
|
|
@@ -45,6 +52,7 @@ export const SubscriptionUpdate$inboundSchema: z.ZodType<
|
|
|
45
52
|
> = z.union([
|
|
46
53
|
SubscriptionUpdateProduct$inboundSchema,
|
|
47
54
|
SubscriptionUpdateDiscount$inboundSchema,
|
|
55
|
+
SubscriptionUpdateTrial$inboundSchema,
|
|
48
56
|
SubscriptionCancel$inboundSchema,
|
|
49
57
|
SubscriptionRevoke$inboundSchema,
|
|
50
58
|
]);
|
|
@@ -53,6 +61,7 @@ export const SubscriptionUpdate$inboundSchema: z.ZodType<
|
|
|
53
61
|
export type SubscriptionUpdate$Outbound =
|
|
54
62
|
| SubscriptionUpdateProduct$Outbound
|
|
55
63
|
| SubscriptionUpdateDiscount$Outbound
|
|
64
|
+
| SubscriptionUpdateTrial$Outbound
|
|
56
65
|
| SubscriptionCancel$Outbound
|
|
57
66
|
| SubscriptionRevoke$Outbound;
|
|
58
67
|
|
|
@@ -64,6 +73,7 @@ export const SubscriptionUpdate$outboundSchema: z.ZodType<
|
|
|
64
73
|
> = z.union([
|
|
65
74
|
SubscriptionUpdateProduct$outboundSchema,
|
|
66
75
|
SubscriptionUpdateDiscount$outboundSchema,
|
|
76
|
+
SubscriptionUpdateTrial$outboundSchema,
|
|
67
77
|
SubscriptionCancel$outboundSchema,
|
|
68
78
|
SubscriptionRevoke$outboundSchema,
|
|
69
79
|
]);
|
|
@@ -0,0 +1,78 @@
|
|
|
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 { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type SubscriptionUpdateTrial = {
|
|
12
|
+
/**
|
|
13
|
+
* Set or extend the trial period of the subscription. If set to `now`, the trial will end immediately.
|
|
14
|
+
*/
|
|
15
|
+
trialEnd: Date;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const SubscriptionUpdateTrial$inboundSchema: z.ZodType<
|
|
20
|
+
SubscriptionUpdateTrial,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
trial_end: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"trial_end": "trialEnd",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type SubscriptionUpdateTrial$Outbound = {
|
|
33
|
+
trial_end: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const SubscriptionUpdateTrial$outboundSchema: z.ZodType<
|
|
38
|
+
SubscriptionUpdateTrial$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
SubscriptionUpdateTrial
|
|
41
|
+
> = z.object({
|
|
42
|
+
trialEnd: z.date().transform(v => v.toISOString()),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
trialEnd: "trial_end",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
52
|
+
*/
|
|
53
|
+
export namespace SubscriptionUpdateTrial$ {
|
|
54
|
+
/** @deprecated use `SubscriptionUpdateTrial$inboundSchema` instead. */
|
|
55
|
+
export const inboundSchema = SubscriptionUpdateTrial$inboundSchema;
|
|
56
|
+
/** @deprecated use `SubscriptionUpdateTrial$outboundSchema` instead. */
|
|
57
|
+
export const outboundSchema = SubscriptionUpdateTrial$outboundSchema;
|
|
58
|
+
/** @deprecated use `SubscriptionUpdateTrial$Outbound` instead. */
|
|
59
|
+
export type Outbound = SubscriptionUpdateTrial$Outbound;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function subscriptionUpdateTrialToJSON(
|
|
63
|
+
subscriptionUpdateTrial: SubscriptionUpdateTrial,
|
|
64
|
+
): string {
|
|
65
|
+
return JSON.stringify(
|
|
66
|
+
SubscriptionUpdateTrial$outboundSchema.parse(subscriptionUpdateTrial),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function subscriptionUpdateTrialFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<SubscriptionUpdateTrial, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => SubscriptionUpdateTrial$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'SubscriptionUpdateTrial' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const TrialInterval = {
|
|
9
|
+
Day: "day",
|
|
10
|
+
Week: "week",
|
|
11
|
+
Month: "month",
|
|
12
|
+
Year: "year",
|
|
13
|
+
} as const;
|
|
14
|
+
export type TrialInterval = ClosedEnum<typeof TrialInterval>;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const TrialInterval$inboundSchema: z.ZodNativeEnum<
|
|
18
|
+
typeof TrialInterval
|
|
19
|
+
> = z.nativeEnum(TrialInterval);
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const TrialInterval$outboundSchema: z.ZodNativeEnum<
|
|
23
|
+
typeof TrialInterval
|
|
24
|
+
> = TrialInterval$inboundSchema;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
29
|
+
*/
|
|
30
|
+
export namespace TrialInterval$ {
|
|
31
|
+
/** @deprecated use `TrialInterval$inboundSchema` instead. */
|
|
32
|
+
export const inboundSchema = TrialInterval$inboundSchema;
|
|
33
|
+
/** @deprecated use `TrialInterval$outboundSchema` instead. */
|
|
34
|
+
export const outboundSchema = TrialInterval$outboundSchema;
|
|
35
|
+
}
|