@polar-sh/sdk 0.35.2 → 0.35.4
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 +25 -23
- package/bin/mcp-server.js +1078 -811
- package/bin/mcp-server.js.map +20 -14
- package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.d.ts +2 -2
- package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.d.ts.map +1 -1
- package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.js +2 -2
- package/dist/commonjs/funcs/customerPortalCustomersAddPaymentMethod.js.map +1 -1
- package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts +23 -0
- package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts.map +1 -0
- package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.js +126 -0
- package/dist/commonjs/funcs/customerPortalCustomersConfirmPaymentMethod.js.map +1 -0
- package/dist/commonjs/funcs/customersGetBalance.d.ts +22 -0
- package/dist/commonjs/funcs/customersGetBalance.d.ts.map +1 -0
- package/dist/commonjs/funcs/customersGetBalance.js +127 -0
- package/dist/commonjs/funcs/customersGetBalance.js.map +1 -0
- package/dist/commonjs/funcs/metersQuantities.js +1 -0
- package/dist/commonjs/funcs/metersQuantities.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/url.js +1 -1
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/customersGetBalance.d.ts +7 -0
- package/dist/commonjs/mcp-server/tools/customersGetBalance.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/customersGetBalance.js +34 -0
- package/dist/commonjs/mcp-server/tools/customersGetBalance.js.map +1 -0
- package/dist/commonjs/models/components/address.d.ts +669 -669
- package/dist/commonjs/models/components/address.js +223 -223
- package/dist/commonjs/models/components/addressinput.d.ts +652 -652
- package/dist/commonjs/models/components/addressinput.js +218 -218
- package/dist/commonjs/models/components/aggregationfunction.d.ts +40 -0
- package/dist/commonjs/models/components/aggregationfunction.d.ts.map +1 -0
- package/dist/commonjs/models/components/aggregationfunction.js +64 -0
- package/dist/commonjs/models/components/aggregationfunction.js.map +1 -0
- package/dist/commonjs/models/components/checkout.d.ts +5 -0
- package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkout.js +2 -0
- package/dist/commonjs/models/components/checkout.js.map +1 -1
- package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutconfirmstripe.js +2 -0
- package/dist/commonjs/models/components/checkoutconfirmstripe.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 +2 -0
- package/dist/commonjs/models/components/checkoutcreate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublic.js +2 -0
- package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutpublicconfirmed.js +2 -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 +2 -0
- package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
- package/dist/commonjs/models/components/checkoutupdatepublic.d.ts +5 -0
- package/dist/commonjs/models/components/checkoutupdatepublic.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutupdatepublic.js +2 -0
- package/dist/commonjs/models/components/checkoutupdatepublic.js.map +1 -1
- package/dist/commonjs/models/components/customerbalance.d.ts +40 -0
- package/dist/commonjs/models/components/customerbalance.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerbalance.js +71 -0
- package/dist/commonjs/models/components/customerbalance.js.map +1 -0
- package/dist/commonjs/models/components/customerorder.d.ts +5 -0
- package/dist/commonjs/models/components/customerorder.d.ts.map +1 -1
- package/dist/commonjs/models/components/customerorder.js +4 -0
- package/dist/commonjs/models/components/customerorder.js.map +1 -1
- package/dist/commonjs/models/components/customerpaymentmethodconfirm.d.ts +31 -0
- package/dist/commonjs/models/components/customerpaymentmethodconfirm.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodconfirm.js +82 -0
- package/dist/commonjs/models/components/customerpaymentmethodconfirm.js.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts +31 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.js +80 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreaterequiresactionresponse.js.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.d.ts +35 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.js +81 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreateresponse.js.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.d.ts +32 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.js +81 -0
- package/dist/commonjs/models/components/customerpaymentmethodcreatesucceededresponse.js.map +1 -0
- package/dist/commonjs/models/components/customersubscription.d.ts +5 -0
- package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
- package/dist/commonjs/models/components/customersubscription.js +4 -0
- package/dist/commonjs/models/components/customersubscription.js.map +1 -1
- package/dist/commonjs/models/components/order.d.ts +5 -0
- package/dist/commonjs/models/components/order.d.ts.map +1 -1
- package/dist/commonjs/models/components/order.js +4 -0
- package/dist/commonjs/models/components/order.js.map +1 -1
- package/dist/commonjs/models/components/organizationfeaturesettings.d.ts +5 -0
- package/dist/commonjs/models/components/organizationfeaturesettings.d.ts.map +1 -1
- package/dist/commonjs/models/components/organizationfeaturesettings.js +4 -0
- package/dist/commonjs/models/components/organizationfeaturesettings.js.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.d.ts +5 -4
- package/dist/commonjs/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreateonetime.js +5 -0
- package/dist/commonjs/models/components/productcreateonetime.js.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.d.ts +5 -4
- package/dist/commonjs/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/commonjs/models/components/productcreaterecurring.js +5 -0
- package/dist/commonjs/models/components/productcreaterecurring.js.map +1 -1
- package/dist/commonjs/models/components/productprice.d.ts +5 -0
- package/dist/commonjs/models/components/productprice.d.ts.map +1 -1
- package/dist/commonjs/models/components/productprice.js +7 -0
- package/dist/commonjs/models/components/productprice.js.map +1 -1
- package/dist/commonjs/models/components/productpriceseatbased.d.ts +76 -0
- package/dist/commonjs/models/components/productpriceseatbased.d.ts.map +1 -0
- package/dist/commonjs/models/components/productpriceseatbased.js +112 -0
- package/dist/commonjs/models/components/productpriceseatbased.js.map +1 -0
- package/dist/commonjs/models/components/productpriceseatbasedcreate.d.ts +42 -0
- package/dist/commonjs/models/components/productpriceseatbasedcreate.d.ts.map +1 -0
- package/dist/commonjs/models/components/productpriceseatbasedcreate.js +86 -0
- package/dist/commonjs/models/components/productpriceseatbasedcreate.js.map +1 -0
- package/dist/commonjs/models/components/productupdate.d.ts +5 -4
- package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/productupdate.js +5 -0
- package/dist/commonjs/models/components/productupdate.js.map +1 -1
- package/dist/commonjs/models/errors/customernotready.d.ts +39 -0
- package/dist/commonjs/models/errors/customernotready.d.ts.map +1 -0
- package/dist/commonjs/models/errors/customernotready.js +88 -0
- package/dist/commonjs/models/errors/customernotready.js.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts +29 -0
- package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.js +78 -0
- package/dist/commonjs/models/operations/customerportalcustomersconfirmpaymentmethod.js.map +1 -0
- package/dist/commonjs/models/operations/customersgetbalance.d.ts +32 -0
- package/dist/commonjs/models/operations/customersgetbalance.d.ts.map +1 -0
- package/dist/commonjs/models/operations/customersgetbalance.js +69 -0
- package/dist/commonjs/models/operations/customersgetbalance.js.map +1 -0
- package/dist/commonjs/models/operations/metersquantities.d.ts +6 -0
- package/dist/commonjs/models/operations/metersquantities.d.ts.map +1 -1
- package/dist/commonjs/models/operations/metersquantities.js +7 -0
- package/dist/commonjs/models/operations/metersquantities.js.map +1 -1
- package/dist/commonjs/sdk/customers.d.ts +11 -0
- package/dist/commonjs/sdk/customers.d.ts.map +1 -1
- package/dist/commonjs/sdk/customers.js +12 -0
- package/dist/commonjs/sdk/customers.js.map +1 -1
- package/dist/commonjs/sdk/polarcustomers.d.ts +13 -2
- package/dist/commonjs/sdk/polarcustomers.d.ts.map +1 -1
- package/dist/commonjs/sdk/polarcustomers.js +12 -0
- package/dist/commonjs/sdk/polarcustomers.js.map +1 -1
- package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.d.ts +2 -2
- package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.d.ts.map +1 -1
- package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.js +2 -2
- package/dist/esm/funcs/customerPortalCustomersAddPaymentMethod.js.map +1 -1
- package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts +23 -0
- package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.d.ts.map +1 -0
- package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.js +90 -0
- package/dist/esm/funcs/customerPortalCustomersConfirmPaymentMethod.js.map +1 -0
- package/dist/esm/funcs/customersGetBalance.d.ts +22 -0
- package/dist/esm/funcs/customersGetBalance.d.ts.map +1 -0
- package/dist/esm/funcs/customersGetBalance.js +91 -0
- package/dist/esm/funcs/customersGetBalance.js.map +1 -0
- package/dist/esm/funcs/metersQuantities.js +1 -0
- package/dist/esm/funcs/metersQuantities.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/url.js +1 -1
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/customersGetBalance.d.ts +7 -0
- package/dist/esm/mcp-server/tools/customersGetBalance.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/customersGetBalance.js +31 -0
- package/dist/esm/mcp-server/tools/customersGetBalance.js.map +1 -0
- package/dist/esm/models/components/address.d.ts +669 -669
- package/dist/esm/models/components/address.js +223 -223
- package/dist/esm/models/components/addressinput.d.ts +652 -652
- package/dist/esm/models/components/addressinput.js +218 -218
- package/dist/esm/models/components/aggregationfunction.d.ts +40 -0
- package/dist/esm/models/components/aggregationfunction.d.ts.map +1 -0
- package/dist/esm/models/components/aggregationfunction.js +28 -0
- package/dist/esm/models/components/aggregationfunction.js.map +1 -0
- package/dist/esm/models/components/checkout.d.ts +5 -0
- package/dist/esm/models/components/checkout.d.ts.map +1 -1
- package/dist/esm/models/components/checkout.js +2 -0
- package/dist/esm/models/components/checkout.js.map +1 -1
- package/dist/esm/models/components/checkoutconfirmstripe.d.ts +5 -0
- package/dist/esm/models/components/checkoutconfirmstripe.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutconfirmstripe.js +2 -0
- package/dist/esm/models/components/checkoutconfirmstripe.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 +2 -0
- package/dist/esm/models/components/checkoutcreate.js.map +1 -1
- package/dist/esm/models/components/checkoutpublic.d.ts +5 -0
- package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublic.js +2 -0
- package/dist/esm/models/components/checkoutpublic.js.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +5 -0
- package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutpublicconfirmed.js +2 -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 +2 -0
- package/dist/esm/models/components/checkoutupdate.js.map +1 -1
- package/dist/esm/models/components/checkoutupdatepublic.d.ts +5 -0
- package/dist/esm/models/components/checkoutupdatepublic.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutupdatepublic.js +2 -0
- package/dist/esm/models/components/checkoutupdatepublic.js.map +1 -1
- package/dist/esm/models/components/customerbalance.d.ts +40 -0
- package/dist/esm/models/components/customerbalance.d.ts.map +1 -0
- package/dist/esm/models/components/customerbalance.js +33 -0
- package/dist/esm/models/components/customerbalance.js.map +1 -0
- package/dist/esm/models/components/customerorder.d.ts +5 -0
- package/dist/esm/models/components/customerorder.d.ts.map +1 -1
- package/dist/esm/models/components/customerorder.js +4 -0
- package/dist/esm/models/components/customerorder.js.map +1 -1
- package/dist/esm/models/components/customerpaymentmethodconfirm.d.ts +31 -0
- package/dist/esm/models/components/customerpaymentmethodconfirm.d.ts.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodconfirm.js +44 -0
- package/dist/esm/models/components/customerpaymentmethodconfirm.js.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts +31 -0
- package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.d.ts.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.js +42 -0
- package/dist/esm/models/components/customerpaymentmethodcreaterequiresactionresponse.js.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreateresponse.d.ts +35 -0
- package/dist/esm/models/components/customerpaymentmethodcreateresponse.d.ts.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreateresponse.js +43 -0
- package/dist/esm/models/components/customerpaymentmethodcreateresponse.js.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.d.ts +32 -0
- package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.d.ts.map +1 -0
- package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.js +43 -0
- package/dist/esm/models/components/customerpaymentmethodcreatesucceededresponse.js.map +1 -0
- package/dist/esm/models/components/customersubscription.d.ts +5 -0
- package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
- package/dist/esm/models/components/customersubscription.js +4 -0
- package/dist/esm/models/components/customersubscription.js.map +1 -1
- package/dist/esm/models/components/order.d.ts +5 -0
- package/dist/esm/models/components/order.d.ts.map +1 -1
- package/dist/esm/models/components/order.js +4 -0
- package/dist/esm/models/components/order.js.map +1 -1
- package/dist/esm/models/components/organizationfeaturesettings.d.ts +5 -0
- package/dist/esm/models/components/organizationfeaturesettings.d.ts.map +1 -1
- package/dist/esm/models/components/organizationfeaturesettings.js +4 -0
- package/dist/esm/models/components/organizationfeaturesettings.js.map +1 -1
- package/dist/esm/models/components/productcreateonetime.d.ts +5 -4
- package/dist/esm/models/components/productcreateonetime.d.ts.map +1 -1
- package/dist/esm/models/components/productcreateonetime.js +5 -0
- package/dist/esm/models/components/productcreateonetime.js.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.d.ts +5 -4
- package/dist/esm/models/components/productcreaterecurring.d.ts.map +1 -1
- package/dist/esm/models/components/productcreaterecurring.js +5 -0
- package/dist/esm/models/components/productcreaterecurring.js.map +1 -1
- package/dist/esm/models/components/productprice.d.ts +5 -0
- package/dist/esm/models/components/productprice.d.ts.map +1 -1
- package/dist/esm/models/components/productprice.js +7 -0
- package/dist/esm/models/components/productprice.js.map +1 -1
- package/dist/esm/models/components/productpriceseatbased.d.ts +76 -0
- package/dist/esm/models/components/productpriceseatbased.d.ts.map +1 -0
- package/dist/esm/models/components/productpriceseatbased.js +74 -0
- package/dist/esm/models/components/productpriceseatbased.js.map +1 -0
- package/dist/esm/models/components/productpriceseatbasedcreate.d.ts +42 -0
- package/dist/esm/models/components/productpriceseatbasedcreate.d.ts.map +1 -0
- package/dist/esm/models/components/productpriceseatbasedcreate.js +48 -0
- package/dist/esm/models/components/productpriceseatbasedcreate.js.map +1 -0
- package/dist/esm/models/components/productupdate.d.ts +5 -4
- package/dist/esm/models/components/productupdate.d.ts.map +1 -1
- package/dist/esm/models/components/productupdate.js +5 -0
- package/dist/esm/models/components/productupdate.js.map +1 -1
- package/dist/esm/models/errors/customernotready.d.ts +39 -0
- package/dist/esm/models/errors/customernotready.d.ts.map +1 -0
- package/dist/esm/models/errors/customernotready.js +51 -0
- package/dist/esm/models/errors/customernotready.js.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts +29 -0
- package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.d.ts.map +1 -0
- package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.js +40 -0
- package/dist/esm/models/operations/customerportalcustomersconfirmpaymentmethod.js.map +1 -0
- package/dist/esm/models/operations/customersgetbalance.d.ts +32 -0
- package/dist/esm/models/operations/customersgetbalance.d.ts.map +1 -0
- package/dist/esm/models/operations/customersgetbalance.js +31 -0
- package/dist/esm/models/operations/customersgetbalance.js.map +1 -0
- package/dist/esm/models/operations/metersquantities.d.ts +6 -0
- package/dist/esm/models/operations/metersquantities.d.ts.map +1 -1
- package/dist/esm/models/operations/metersquantities.js +7 -0
- package/dist/esm/models/operations/metersquantities.js.map +1 -1
- package/dist/esm/sdk/customers.d.ts +11 -0
- package/dist/esm/sdk/customers.d.ts.map +1 -1
- package/dist/esm/sdk/customers.js +12 -0
- package/dist/esm/sdk/customers.js.map +1 -1
- package/dist/esm/sdk/polarcustomers.d.ts +13 -2
- package/dist/esm/sdk/polarcustomers.d.ts.map +1 -1
- package/dist/esm/sdk/polarcustomers.js +12 -0
- package/dist/esm/sdk/polarcustomers.js.map +1 -1
- package/docs/sdks/customers/README.md +78 -0
- package/docs/sdks/polarcustomers/README.md +82 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/customerPortalCustomersAddPaymentMethod.ts +8 -8
- package/src/funcs/customerPortalCustomersConfirmPaymentMethod.ts +201 -0
- package/src/funcs/customersGetBalance.ts +195 -0
- package/src/funcs/metersQuantities.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/url.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/customersGetBalance.ts +40 -0
- package/src/models/components/address.ts +223 -223
- package/src/models/components/addressinput.ts +218 -218
- package/src/models/components/aggregationfunction.ts +37 -0
- package/src/models/components/checkout.ts +7 -0
- package/src/models/components/checkoutconfirmstripe.ts +7 -0
- package/src/models/components/checkoutcreate.ts +7 -0
- package/src/models/components/checkoutpublic.ts +7 -0
- package/src/models/components/checkoutpublicconfirmed.ts +7 -0
- package/src/models/components/checkoutupdate.ts +7 -0
- package/src/models/components/checkoutupdatepublic.ts +7 -0
- package/src/models/components/customerbalance.ts +77 -0
- package/src/models/components/customerorder.ts +9 -0
- package/src/models/components/customerpaymentmethodconfirm.ts +83 -0
- package/src/models/components/customerpaymentmethodcreaterequiresactionresponse.ts +93 -0
- package/src/models/components/customerpaymentmethodcreateresponse.ts +107 -0
- package/src/models/components/customerpaymentmethodcreatesucceededresponse.ts +98 -0
- package/src/models/components/customersubscription.ts +9 -0
- package/src/models/components/order.ts +9 -0
- package/src/models/components/organizationfeaturesettings.ts +9 -0
- package/src/models/components/productcreateonetime.ts +14 -0
- package/src/models/components/productcreaterecurring.ts +14 -0
- package/src/models/components/productprice.ts +18 -0
- package/src/models/components/productpriceseatbased.ts +164 -0
- package/src/models/components/productpriceseatbasedcreate.ts +98 -0
- package/src/models/components/productupdate.ts +14 -0
- package/src/models/errors/customernotready.ts +85 -0
- package/src/models/operations/customerportalcustomersconfirmpaymentmethod.ts +89 -0
- package/src/models/operations/customersgetbalance.ts +69 -0
- package/src/models/operations/metersquantities.ts +16 -0
- package/src/sdk/customers.ts +22 -0
- package/src/sdk/polarcustomers.ts +26 -2
|
@@ -13,6 +13,10 @@ export type OrganizationFeatureSettings = {
|
|
|
13
13
|
* If this organization has issue funding enabled
|
|
14
14
|
*/
|
|
15
15
|
issueFundingEnabled?: boolean | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* If this organization has seat-based pricing enabled
|
|
18
|
+
*/
|
|
19
|
+
seatBasedPricingEnabled?: boolean | undefined;
|
|
16
20
|
};
|
|
17
21
|
|
|
18
22
|
/** @internal */
|
|
@@ -22,15 +26,18 @@ export const OrganizationFeatureSettings$inboundSchema: z.ZodType<
|
|
|
22
26
|
unknown
|
|
23
27
|
> = z.object({
|
|
24
28
|
issue_funding_enabled: z.boolean().default(false),
|
|
29
|
+
seat_based_pricing_enabled: z.boolean().default(false),
|
|
25
30
|
}).transform((v) => {
|
|
26
31
|
return remap$(v, {
|
|
27
32
|
"issue_funding_enabled": "issueFundingEnabled",
|
|
33
|
+
"seat_based_pricing_enabled": "seatBasedPricingEnabled",
|
|
28
34
|
});
|
|
29
35
|
});
|
|
30
36
|
|
|
31
37
|
/** @internal */
|
|
32
38
|
export type OrganizationFeatureSettings$Outbound = {
|
|
33
39
|
issue_funding_enabled: boolean;
|
|
40
|
+
seat_based_pricing_enabled: boolean;
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
/** @internal */
|
|
@@ -40,9 +47,11 @@ export const OrganizationFeatureSettings$outboundSchema: z.ZodType<
|
|
|
40
47
|
OrganizationFeatureSettings
|
|
41
48
|
> = z.object({
|
|
42
49
|
issueFundingEnabled: z.boolean().default(false),
|
|
50
|
+
seatBasedPricingEnabled: z.boolean().default(false),
|
|
43
51
|
}).transform((v) => {
|
|
44
52
|
return remap$(v, {
|
|
45
53
|
issueFundingEnabled: "issue_funding_enabled",
|
|
54
|
+
seatBasedPricingEnabled: "seat_based_pricing_enabled",
|
|
46
55
|
});
|
|
47
56
|
});
|
|
48
57
|
|
|
@@ -37,12 +37,19 @@ import {
|
|
|
37
37
|
ProductPriceMeteredUnitCreate$Outbound,
|
|
38
38
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
39
39
|
} from "./productpricemeteredunitcreate.js";
|
|
40
|
+
import {
|
|
41
|
+
ProductPriceSeatBasedCreate,
|
|
42
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
43
|
+
ProductPriceSeatBasedCreate$Outbound,
|
|
44
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
45
|
+
} from "./productpriceseatbasedcreate.js";
|
|
40
46
|
|
|
41
47
|
export type ProductCreateOneTimeMetadata = string | number | number | boolean;
|
|
42
48
|
|
|
43
49
|
export type ProductCreateOneTimePrices =
|
|
44
50
|
| ProductPriceMeteredUnitCreate
|
|
45
51
|
| ProductPriceFixedCreate
|
|
52
|
+
| ProductPriceSeatBasedCreate
|
|
46
53
|
| ProductPriceCustomCreate
|
|
47
54
|
| ProductPriceFreeCreate;
|
|
48
55
|
|
|
@@ -77,6 +84,7 @@ export type ProductCreateOneTime = {
|
|
|
77
84
|
prices: Array<
|
|
78
85
|
| ProductPriceMeteredUnitCreate
|
|
79
86
|
| ProductPriceFixedCreate
|
|
87
|
+
| ProductPriceSeatBasedCreate
|
|
80
88
|
| ProductPriceCustomCreate
|
|
81
89
|
| ProductPriceFreeCreate
|
|
82
90
|
>;
|
|
@@ -160,6 +168,7 @@ export const ProductCreateOneTimePrices$inboundSchema: z.ZodType<
|
|
|
160
168
|
> = z.union([
|
|
161
169
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
162
170
|
ProductPriceFixedCreate$inboundSchema,
|
|
171
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
163
172
|
ProductPriceCustomCreate$inboundSchema,
|
|
164
173
|
ProductPriceFreeCreate$inboundSchema,
|
|
165
174
|
]);
|
|
@@ -168,6 +177,7 @@ export const ProductCreateOneTimePrices$inboundSchema: z.ZodType<
|
|
|
168
177
|
export type ProductCreateOneTimePrices$Outbound =
|
|
169
178
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
170
179
|
| ProductPriceFixedCreate$Outbound
|
|
180
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
171
181
|
| ProductPriceCustomCreate$Outbound
|
|
172
182
|
| ProductPriceFreeCreate$Outbound;
|
|
173
183
|
|
|
@@ -179,6 +189,7 @@ export const ProductCreateOneTimePrices$outboundSchema: z.ZodType<
|
|
|
179
189
|
> = z.union([
|
|
180
190
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
181
191
|
ProductPriceFixedCreate$outboundSchema,
|
|
192
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
182
193
|
ProductPriceCustomCreate$outboundSchema,
|
|
183
194
|
ProductPriceFreeCreate$outboundSchema,
|
|
184
195
|
]);
|
|
@@ -229,6 +240,7 @@ export const ProductCreateOneTime$inboundSchema: z.ZodType<
|
|
|
229
240
|
z.union([
|
|
230
241
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
231
242
|
ProductPriceFixedCreate$inboundSchema,
|
|
243
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
232
244
|
ProductPriceCustomCreate$inboundSchema,
|
|
233
245
|
ProductPriceFreeCreate$inboundSchema,
|
|
234
246
|
]),
|
|
@@ -254,6 +266,7 @@ export type ProductCreateOneTime$Outbound = {
|
|
|
254
266
|
prices: Array<
|
|
255
267
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
256
268
|
| ProductPriceFixedCreate$Outbound
|
|
269
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
257
270
|
| ProductPriceCustomCreate$Outbound
|
|
258
271
|
| ProductPriceFreeCreate$Outbound
|
|
259
272
|
>;
|
|
@@ -280,6 +293,7 @@ export const ProductCreateOneTime$outboundSchema: z.ZodType<
|
|
|
280
293
|
z.union([
|
|
281
294
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
282
295
|
ProductPriceFixedCreate$outboundSchema,
|
|
296
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
283
297
|
ProductPriceCustomCreate$outboundSchema,
|
|
284
298
|
ProductPriceFreeCreate$outboundSchema,
|
|
285
299
|
]),
|
|
@@ -37,6 +37,12 @@ import {
|
|
|
37
37
|
ProductPriceMeteredUnitCreate$Outbound,
|
|
38
38
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
39
39
|
} from "./productpricemeteredunitcreate.js";
|
|
40
|
+
import {
|
|
41
|
+
ProductPriceSeatBasedCreate,
|
|
42
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
43
|
+
ProductPriceSeatBasedCreate$Outbound,
|
|
44
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
45
|
+
} from "./productpriceseatbasedcreate.js";
|
|
40
46
|
import {
|
|
41
47
|
SubscriptionRecurringInterval,
|
|
42
48
|
SubscriptionRecurringInterval$inboundSchema,
|
|
@@ -53,6 +59,7 @@ export type ProductCreateRecurringMetadata = string | number | number | boolean;
|
|
|
53
59
|
export type ProductCreateRecurringPrices =
|
|
54
60
|
| ProductPriceMeteredUnitCreate
|
|
55
61
|
| ProductPriceFixedCreate
|
|
62
|
+
| ProductPriceSeatBasedCreate
|
|
56
63
|
| ProductPriceCustomCreate
|
|
57
64
|
| ProductPriceFreeCreate;
|
|
58
65
|
|
|
@@ -87,6 +94,7 @@ export type ProductCreateRecurring = {
|
|
|
87
94
|
prices: Array<
|
|
88
95
|
| ProductPriceMeteredUnitCreate
|
|
89
96
|
| ProductPriceFixedCreate
|
|
97
|
+
| ProductPriceSeatBasedCreate
|
|
90
98
|
| ProductPriceCustomCreate
|
|
91
99
|
| ProductPriceFreeCreate
|
|
92
100
|
>;
|
|
@@ -175,6 +183,7 @@ export const ProductCreateRecurringPrices$inboundSchema: z.ZodType<
|
|
|
175
183
|
> = z.union([
|
|
176
184
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
177
185
|
ProductPriceFixedCreate$inboundSchema,
|
|
186
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
178
187
|
ProductPriceCustomCreate$inboundSchema,
|
|
179
188
|
ProductPriceFreeCreate$inboundSchema,
|
|
180
189
|
]);
|
|
@@ -183,6 +192,7 @@ export const ProductCreateRecurringPrices$inboundSchema: z.ZodType<
|
|
|
183
192
|
export type ProductCreateRecurringPrices$Outbound =
|
|
184
193
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
185
194
|
| ProductPriceFixedCreate$Outbound
|
|
195
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
186
196
|
| ProductPriceCustomCreate$Outbound
|
|
187
197
|
| ProductPriceFreeCreate$Outbound;
|
|
188
198
|
|
|
@@ -194,6 +204,7 @@ export const ProductCreateRecurringPrices$outboundSchema: z.ZodType<
|
|
|
194
204
|
> = z.union([
|
|
195
205
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
196
206
|
ProductPriceFixedCreate$outboundSchema,
|
|
207
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
197
208
|
ProductPriceCustomCreate$outboundSchema,
|
|
198
209
|
ProductPriceFreeCreate$outboundSchema,
|
|
199
210
|
]);
|
|
@@ -246,6 +257,7 @@ export const ProductCreateRecurring$inboundSchema: z.ZodType<
|
|
|
246
257
|
z.union([
|
|
247
258
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
248
259
|
ProductPriceFixedCreate$inboundSchema,
|
|
260
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
249
261
|
ProductPriceCustomCreate$inboundSchema,
|
|
250
262
|
ProductPriceFreeCreate$inboundSchema,
|
|
251
263
|
]),
|
|
@@ -275,6 +287,7 @@ export type ProductCreateRecurring$Outbound = {
|
|
|
275
287
|
prices: Array<
|
|
276
288
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
277
289
|
| ProductPriceFixedCreate$Outbound
|
|
290
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
278
291
|
| ProductPriceCustomCreate$Outbound
|
|
279
292
|
| ProductPriceFreeCreate$Outbound
|
|
280
293
|
>;
|
|
@@ -303,6 +316,7 @@ export const ProductCreateRecurring$outboundSchema: z.ZodType<
|
|
|
303
316
|
z.union([
|
|
304
317
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
305
318
|
ProductPriceFixedCreate$outboundSchema,
|
|
319
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
306
320
|
ProductPriceCustomCreate$outboundSchema,
|
|
307
321
|
ProductPriceFreeCreate$outboundSchema,
|
|
308
322
|
]),
|
|
@@ -30,11 +30,18 @@ import {
|
|
|
30
30
|
ProductPriceMeteredUnit$Outbound,
|
|
31
31
|
ProductPriceMeteredUnit$outboundSchema,
|
|
32
32
|
} from "./productpricemeteredunit.js";
|
|
33
|
+
import {
|
|
34
|
+
ProductPriceSeatBased,
|
|
35
|
+
ProductPriceSeatBased$inboundSchema,
|
|
36
|
+
ProductPriceSeatBased$Outbound,
|
|
37
|
+
ProductPriceSeatBased$outboundSchema,
|
|
38
|
+
} from "./productpriceseatbased.js";
|
|
33
39
|
|
|
34
40
|
export type ProductPrice =
|
|
35
41
|
| (ProductPriceMeteredUnit & { amountType: "metered_unit" })
|
|
36
42
|
| (ProductPriceCustom & { amountType: "custom" })
|
|
37
43
|
| (ProductPriceFixed & { amountType: "fixed" })
|
|
44
|
+
| (ProductPriceSeatBased & { amountType: "seat_based" })
|
|
38
45
|
| (ProductPriceFree & { amountType: "free" });
|
|
39
46
|
|
|
40
47
|
/** @internal */
|
|
@@ -58,6 +65,11 @@ export const ProductPrice$inboundSchema: z.ZodType<
|
|
|
58
65
|
amountType: v.amount_type,
|
|
59
66
|
})),
|
|
60
67
|
),
|
|
68
|
+
ProductPriceSeatBased$inboundSchema.and(
|
|
69
|
+
z.object({ amount_type: z.literal("seat_based") }).transform((v) => ({
|
|
70
|
+
amountType: v.amount_type,
|
|
71
|
+
})),
|
|
72
|
+
),
|
|
61
73
|
ProductPriceFree$inboundSchema.and(
|
|
62
74
|
z.object({ amount_type: z.literal("free") }).transform((v) => ({
|
|
63
75
|
amountType: v.amount_type,
|
|
@@ -70,6 +82,7 @@ export type ProductPrice$Outbound =
|
|
|
70
82
|
| (ProductPriceMeteredUnit$Outbound & { amount_type: "metered_unit" })
|
|
71
83
|
| (ProductPriceCustom$Outbound & { amount_type: "custom" })
|
|
72
84
|
| (ProductPriceFixed$Outbound & { amount_type: "fixed" })
|
|
85
|
+
| (ProductPriceSeatBased$Outbound & { amount_type: "seat_based" })
|
|
73
86
|
| (ProductPriceFree$Outbound & { amount_type: "free" });
|
|
74
87
|
|
|
75
88
|
/** @internal */
|
|
@@ -93,6 +106,11 @@ export const ProductPrice$outboundSchema: z.ZodType<
|
|
|
93
106
|
amount_type: v.amountType,
|
|
94
107
|
})),
|
|
95
108
|
),
|
|
109
|
+
ProductPriceSeatBased$outboundSchema.and(
|
|
110
|
+
z.object({ amountType: z.literal("seat_based") }).transform((v) => ({
|
|
111
|
+
amount_type: v.amountType,
|
|
112
|
+
})),
|
|
113
|
+
),
|
|
96
114
|
ProductPriceFree$outboundSchema.and(
|
|
97
115
|
z.object({ amountType: z.literal("free") }).transform((v) => ({
|
|
98
116
|
amount_type: v.amountType,
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
ProductPriceType,
|
|
12
|
+
ProductPriceType$inboundSchema,
|
|
13
|
+
ProductPriceType$outboundSchema,
|
|
14
|
+
} from "./productpricetype.js";
|
|
15
|
+
import {
|
|
16
|
+
SubscriptionRecurringInterval,
|
|
17
|
+
SubscriptionRecurringInterval$inboundSchema,
|
|
18
|
+
SubscriptionRecurringInterval$outboundSchema,
|
|
19
|
+
} from "./subscriptionrecurringinterval.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A seat-based price for a product.
|
|
23
|
+
*/
|
|
24
|
+
export type ProductPriceSeatBased = {
|
|
25
|
+
/**
|
|
26
|
+
* Creation timestamp of the object.
|
|
27
|
+
*/
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
/**
|
|
30
|
+
* Last modification timestamp of the object.
|
|
31
|
+
*/
|
|
32
|
+
modifiedAt: Date | null;
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the price.
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
amountType: "seat_based";
|
|
38
|
+
/**
|
|
39
|
+
* Whether the price is archived and no longer available.
|
|
40
|
+
*/
|
|
41
|
+
isArchived: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The ID of the product owning the price.
|
|
44
|
+
*/
|
|
45
|
+
productId: string;
|
|
46
|
+
type: ProductPriceType;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
49
|
+
*/
|
|
50
|
+
recurringInterval: SubscriptionRecurringInterval | null;
|
|
51
|
+
/**
|
|
52
|
+
* The currency.
|
|
53
|
+
*/
|
|
54
|
+
priceCurrency: string;
|
|
55
|
+
/**
|
|
56
|
+
* The price per seat in cents.
|
|
57
|
+
*/
|
|
58
|
+
pricePerSeat: number;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const ProductPriceSeatBased$inboundSchema: z.ZodType<
|
|
63
|
+
ProductPriceSeatBased,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
unknown
|
|
66
|
+
> = z.object({
|
|
67
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
68
|
+
modified_at: z.nullable(
|
|
69
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
70
|
+
),
|
|
71
|
+
id: z.string(),
|
|
72
|
+
amount_type: z.literal("seat_based"),
|
|
73
|
+
is_archived: z.boolean(),
|
|
74
|
+
product_id: z.string(),
|
|
75
|
+
type: ProductPriceType$inboundSchema,
|
|
76
|
+
recurring_interval: z.nullable(SubscriptionRecurringInterval$inboundSchema),
|
|
77
|
+
price_currency: z.string(),
|
|
78
|
+
price_per_seat: z.number().int(),
|
|
79
|
+
}).transform((v) => {
|
|
80
|
+
return remap$(v, {
|
|
81
|
+
"created_at": "createdAt",
|
|
82
|
+
"modified_at": "modifiedAt",
|
|
83
|
+
"amount_type": "amountType",
|
|
84
|
+
"is_archived": "isArchived",
|
|
85
|
+
"product_id": "productId",
|
|
86
|
+
"recurring_interval": "recurringInterval",
|
|
87
|
+
"price_currency": "priceCurrency",
|
|
88
|
+
"price_per_seat": "pricePerSeat",
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export type ProductPriceSeatBased$Outbound = {
|
|
94
|
+
created_at: string;
|
|
95
|
+
modified_at: string | null;
|
|
96
|
+
id: string;
|
|
97
|
+
amount_type: "seat_based";
|
|
98
|
+
is_archived: boolean;
|
|
99
|
+
product_id: string;
|
|
100
|
+
type: string;
|
|
101
|
+
recurring_interval: string | null;
|
|
102
|
+
price_currency: string;
|
|
103
|
+
price_per_seat: number;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** @internal */
|
|
107
|
+
export const ProductPriceSeatBased$outboundSchema: z.ZodType<
|
|
108
|
+
ProductPriceSeatBased$Outbound,
|
|
109
|
+
z.ZodTypeDef,
|
|
110
|
+
ProductPriceSeatBased
|
|
111
|
+
> = z.object({
|
|
112
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
113
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
114
|
+
id: z.string(),
|
|
115
|
+
amountType: z.literal("seat_based"),
|
|
116
|
+
isArchived: z.boolean(),
|
|
117
|
+
productId: z.string(),
|
|
118
|
+
type: ProductPriceType$outboundSchema,
|
|
119
|
+
recurringInterval: z.nullable(SubscriptionRecurringInterval$outboundSchema),
|
|
120
|
+
priceCurrency: z.string(),
|
|
121
|
+
pricePerSeat: z.number().int(),
|
|
122
|
+
}).transform((v) => {
|
|
123
|
+
return remap$(v, {
|
|
124
|
+
createdAt: "created_at",
|
|
125
|
+
modifiedAt: "modified_at",
|
|
126
|
+
amountType: "amount_type",
|
|
127
|
+
isArchived: "is_archived",
|
|
128
|
+
productId: "product_id",
|
|
129
|
+
recurringInterval: "recurring_interval",
|
|
130
|
+
priceCurrency: "price_currency",
|
|
131
|
+
pricePerSeat: "price_per_seat",
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
138
|
+
*/
|
|
139
|
+
export namespace ProductPriceSeatBased$ {
|
|
140
|
+
/** @deprecated use `ProductPriceSeatBased$inboundSchema` instead. */
|
|
141
|
+
export const inboundSchema = ProductPriceSeatBased$inboundSchema;
|
|
142
|
+
/** @deprecated use `ProductPriceSeatBased$outboundSchema` instead. */
|
|
143
|
+
export const outboundSchema = ProductPriceSeatBased$outboundSchema;
|
|
144
|
+
/** @deprecated use `ProductPriceSeatBased$Outbound` instead. */
|
|
145
|
+
export type Outbound = ProductPriceSeatBased$Outbound;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function productPriceSeatBasedToJSON(
|
|
149
|
+
productPriceSeatBased: ProductPriceSeatBased,
|
|
150
|
+
): string {
|
|
151
|
+
return JSON.stringify(
|
|
152
|
+
ProductPriceSeatBased$outboundSchema.parse(productPriceSeatBased),
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function productPriceSeatBasedFromJSON(
|
|
157
|
+
jsonString: string,
|
|
158
|
+
): SafeParseResult<ProductPriceSeatBased, SDKValidationError> {
|
|
159
|
+
return safeParse(
|
|
160
|
+
jsonString,
|
|
161
|
+
(x) => ProductPriceSeatBased$inboundSchema.parse(JSON.parse(x)),
|
|
162
|
+
`Failed to parse 'ProductPriceSeatBased' from JSON`,
|
|
163
|
+
);
|
|
164
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* Schema to create a seat-based price.
|
|
13
|
+
*/
|
|
14
|
+
export type ProductPriceSeatBasedCreate = {
|
|
15
|
+
amountType: "seat_based";
|
|
16
|
+
/**
|
|
17
|
+
* The currency. Currently, only `usd` is supported.
|
|
18
|
+
*/
|
|
19
|
+
priceCurrency?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The price per seat in cents.
|
|
22
|
+
*/
|
|
23
|
+
pricePerSeat: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const ProductPriceSeatBasedCreate$inboundSchema: z.ZodType<
|
|
28
|
+
ProductPriceSeatBasedCreate,
|
|
29
|
+
z.ZodTypeDef,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
amount_type: z.literal("seat_based"),
|
|
33
|
+
price_currency: z.string().default("usd"),
|
|
34
|
+
price_per_seat: z.number().int(),
|
|
35
|
+
}).transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
"amount_type": "amountType",
|
|
38
|
+
"price_currency": "priceCurrency",
|
|
39
|
+
"price_per_seat": "pricePerSeat",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type ProductPriceSeatBasedCreate$Outbound = {
|
|
45
|
+
amount_type: "seat_based";
|
|
46
|
+
price_currency: string;
|
|
47
|
+
price_per_seat: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const ProductPriceSeatBasedCreate$outboundSchema: z.ZodType<
|
|
52
|
+
ProductPriceSeatBasedCreate$Outbound,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
ProductPriceSeatBasedCreate
|
|
55
|
+
> = z.object({
|
|
56
|
+
amountType: z.literal("seat_based"),
|
|
57
|
+
priceCurrency: z.string().default("usd"),
|
|
58
|
+
pricePerSeat: z.number().int(),
|
|
59
|
+
}).transform((v) => {
|
|
60
|
+
return remap$(v, {
|
|
61
|
+
amountType: "amount_type",
|
|
62
|
+
priceCurrency: "price_currency",
|
|
63
|
+
pricePerSeat: "price_per_seat",
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
|
+
*/
|
|
71
|
+
export namespace ProductPriceSeatBasedCreate$ {
|
|
72
|
+
/** @deprecated use `ProductPriceSeatBasedCreate$inboundSchema` instead. */
|
|
73
|
+
export const inboundSchema = ProductPriceSeatBasedCreate$inboundSchema;
|
|
74
|
+
/** @deprecated use `ProductPriceSeatBasedCreate$outboundSchema` instead. */
|
|
75
|
+
export const outboundSchema = ProductPriceSeatBasedCreate$outboundSchema;
|
|
76
|
+
/** @deprecated use `ProductPriceSeatBasedCreate$Outbound` instead. */
|
|
77
|
+
export type Outbound = ProductPriceSeatBasedCreate$Outbound;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function productPriceSeatBasedCreateToJSON(
|
|
81
|
+
productPriceSeatBasedCreate: ProductPriceSeatBasedCreate,
|
|
82
|
+
): string {
|
|
83
|
+
return JSON.stringify(
|
|
84
|
+
ProductPriceSeatBasedCreate$outboundSchema.parse(
|
|
85
|
+
productPriceSeatBasedCreate,
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function productPriceSeatBasedCreateFromJSON(
|
|
91
|
+
jsonString: string,
|
|
92
|
+
): SafeParseResult<ProductPriceSeatBasedCreate, SDKValidationError> {
|
|
93
|
+
return safeParse(
|
|
94
|
+
jsonString,
|
|
95
|
+
(x) => ProductPriceSeatBasedCreate$inboundSchema.parse(JSON.parse(x)),
|
|
96
|
+
`Failed to parse 'ProductPriceSeatBasedCreate' from JSON`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
@@ -43,6 +43,12 @@ import {
|
|
|
43
43
|
ProductPriceMeteredUnitCreate$Outbound,
|
|
44
44
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
45
45
|
} from "./productpricemeteredunitcreate.js";
|
|
46
|
+
import {
|
|
47
|
+
ProductPriceSeatBasedCreate,
|
|
48
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
49
|
+
ProductPriceSeatBasedCreate$Outbound,
|
|
50
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
51
|
+
} from "./productpriceseatbasedcreate.js";
|
|
46
52
|
import {
|
|
47
53
|
SubscriptionRecurringInterval,
|
|
48
54
|
SubscriptionRecurringInterval$inboundSchema,
|
|
@@ -59,6 +65,7 @@ export type ProductUpdateMetadata = string | number | number | boolean;
|
|
|
59
65
|
export type ProductUpdatePrices =
|
|
60
66
|
| ProductPriceMeteredUnitCreate
|
|
61
67
|
| ProductPriceFixedCreate
|
|
68
|
+
| ProductPriceSeatBasedCreate
|
|
62
69
|
| ExistingProductPrice
|
|
63
70
|
| ProductPriceCustomCreate
|
|
64
71
|
| ProductPriceFreeCreate;
|
|
@@ -111,6 +118,7 @@ export type ProductUpdate = {
|
|
|
111
118
|
| Array<
|
|
112
119
|
| ProductPriceMeteredUnitCreate
|
|
113
120
|
| ProductPriceFixedCreate
|
|
121
|
+
| ProductPriceSeatBasedCreate
|
|
114
122
|
| ExistingProductPrice
|
|
115
123
|
| ProductPriceCustomCreate
|
|
116
124
|
| ProductPriceFreeCreate
|
|
@@ -180,6 +188,7 @@ export const ProductUpdatePrices$inboundSchema: z.ZodType<
|
|
|
180
188
|
> = z.union([
|
|
181
189
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
182
190
|
ProductPriceFixedCreate$inboundSchema,
|
|
191
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
183
192
|
ExistingProductPrice$inboundSchema,
|
|
184
193
|
ProductPriceCustomCreate$inboundSchema,
|
|
185
194
|
ProductPriceFreeCreate$inboundSchema,
|
|
@@ -189,6 +198,7 @@ export const ProductUpdatePrices$inboundSchema: z.ZodType<
|
|
|
189
198
|
export type ProductUpdatePrices$Outbound =
|
|
190
199
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
191
200
|
| ProductPriceFixedCreate$Outbound
|
|
201
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
192
202
|
| ExistingProductPrice$Outbound
|
|
193
203
|
| ProductPriceCustomCreate$Outbound
|
|
194
204
|
| ProductPriceFreeCreate$Outbound;
|
|
@@ -201,6 +211,7 @@ export const ProductUpdatePrices$outboundSchema: z.ZodType<
|
|
|
201
211
|
> = z.union([
|
|
202
212
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
203
213
|
ProductPriceFixedCreate$outboundSchema,
|
|
214
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
204
215
|
ExistingProductPrice$outboundSchema,
|
|
205
216
|
ProductPriceCustomCreate$outboundSchema,
|
|
206
217
|
ProductPriceFreeCreate$outboundSchema,
|
|
@@ -258,6 +269,7 @@ export const ProductUpdate$inboundSchema: z.ZodType<
|
|
|
258
269
|
z.union([
|
|
259
270
|
ProductPriceMeteredUnitCreate$inboundSchema,
|
|
260
271
|
ProductPriceFixedCreate$inboundSchema,
|
|
272
|
+
ProductPriceSeatBasedCreate$inboundSchema,
|
|
261
273
|
ExistingProductPrice$inboundSchema,
|
|
262
274
|
ProductPriceCustomCreate$inboundSchema,
|
|
263
275
|
ProductPriceFreeCreate$inboundSchema,
|
|
@@ -291,6 +303,7 @@ export type ProductUpdate$Outbound = {
|
|
|
291
303
|
| Array<
|
|
292
304
|
| ProductPriceMeteredUnitCreate$Outbound
|
|
293
305
|
| ProductPriceFixedCreate$Outbound
|
|
306
|
+
| ProductPriceSeatBasedCreate$Outbound
|
|
294
307
|
| ExistingProductPrice$Outbound
|
|
295
308
|
| ProductPriceCustomCreate$Outbound
|
|
296
309
|
| ProductPriceFreeCreate$Outbound
|
|
@@ -325,6 +338,7 @@ export const ProductUpdate$outboundSchema: z.ZodType<
|
|
|
325
338
|
z.union([
|
|
326
339
|
ProductPriceMeteredUnitCreate$outboundSchema,
|
|
327
340
|
ProductPriceFixedCreate$outboundSchema,
|
|
341
|
+
ProductPriceSeatBasedCreate$outboundSchema,
|
|
328
342
|
ExistingProductPrice$outboundSchema,
|
|
329
343
|
ProductPriceCustomCreate$outboundSchema,
|
|
330
344
|
ProductPriceFreeCreate$outboundSchema,
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { PolarError } from "./polarerror.js";
|
|
7
|
+
|
|
8
|
+
export type CustomerNotReadyData = {
|
|
9
|
+
error: "CustomerNotReady";
|
|
10
|
+
detail: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export class CustomerNotReady extends PolarError {
|
|
14
|
+
error: "CustomerNotReady";
|
|
15
|
+
detail: string;
|
|
16
|
+
|
|
17
|
+
/** The original data that was passed to this error instance. */
|
|
18
|
+
data$: CustomerNotReadyData;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
err: CustomerNotReadyData,
|
|
22
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
23
|
+
) {
|
|
24
|
+
const message = "message" in err && typeof err.message === "string"
|
|
25
|
+
? err.message
|
|
26
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
27
|
+
super(message, httpMeta);
|
|
28
|
+
this.data$ = err;
|
|
29
|
+
this.error = err.error;
|
|
30
|
+
this.detail = err.detail;
|
|
31
|
+
|
|
32
|
+
this.name = "CustomerNotReady";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const CustomerNotReady$inboundSchema: z.ZodType<
|
|
38
|
+
CustomerNotReady,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
unknown
|
|
41
|
+
> = z.object({
|
|
42
|
+
error: z.literal("CustomerNotReady"),
|
|
43
|
+
detail: z.string(),
|
|
44
|
+
request$: z.instanceof(Request),
|
|
45
|
+
response$: z.instanceof(Response),
|
|
46
|
+
body$: z.string(),
|
|
47
|
+
})
|
|
48
|
+
.transform((v) => {
|
|
49
|
+
return new CustomerNotReady(v, {
|
|
50
|
+
request: v.request$,
|
|
51
|
+
response: v.response$,
|
|
52
|
+
body: v.body$,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export type CustomerNotReady$Outbound = {
|
|
58
|
+
error: "CustomerNotReady";
|
|
59
|
+
detail: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const CustomerNotReady$outboundSchema: z.ZodType<
|
|
64
|
+
CustomerNotReady$Outbound,
|
|
65
|
+
z.ZodTypeDef,
|
|
66
|
+
CustomerNotReady
|
|
67
|
+
> = z.instanceof(CustomerNotReady)
|
|
68
|
+
.transform(v => v.data$)
|
|
69
|
+
.pipe(z.object({
|
|
70
|
+
error: z.literal("CustomerNotReady"),
|
|
71
|
+
detail: z.string(),
|
|
72
|
+
}));
|
|
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 CustomerNotReady$ {
|
|
79
|
+
/** @deprecated use `CustomerNotReady$inboundSchema` instead. */
|
|
80
|
+
export const inboundSchema = CustomerNotReady$inboundSchema;
|
|
81
|
+
/** @deprecated use `CustomerNotReady$outboundSchema` instead. */
|
|
82
|
+
export const outboundSchema = CustomerNotReady$outboundSchema;
|
|
83
|
+
/** @deprecated use `CustomerNotReady$Outbound` instead. */
|
|
84
|
+
export type Outbound = CustomerNotReady$Outbound;
|
|
85
|
+
}
|