@polar-sh/sdk 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. package/README.md +40 -7
  2. package/bin/mcp-server.js +304 -141
  3. package/bin/mcp-server.js.map +51 -48
  4. package/dist/commonjs/funcs/benefitsList.js +1 -0
  5. package/dist/commonjs/funcs/benefitsList.js.map +1 -1
  6. package/dist/commonjs/funcs/customersDelete.d.ts +11 -1
  7. package/dist/commonjs/funcs/customersDelete.d.ts.map +1 -1
  8. package/dist/commonjs/funcs/customersDelete.js +11 -1
  9. package/dist/commonjs/funcs/customersDelete.js.map +1 -1
  10. package/dist/commonjs/lib/config.d.ts +3 -3
  11. package/dist/commonjs/lib/config.js +3 -3
  12. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  13. package/dist/commonjs/lib/sdks.js +2 -8
  14. package/dist/commonjs/lib/sdks.js.map +1 -1
  15. package/dist/commonjs/lib/security.d.ts +4 -3
  16. package/dist/commonjs/lib/security.d.ts.map +1 -1
  17. package/dist/commonjs/lib/security.js +6 -1
  18. package/dist/commonjs/lib/security.js.map +1 -1
  19. package/dist/commonjs/mcp-server/extensions.d.ts +2 -0
  20. package/dist/commonjs/mcp-server/extensions.d.ts.map +1 -1
  21. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  22. package/dist/commonjs/mcp-server/prompts.d.ts +26 -0
  23. package/dist/commonjs/mcp-server/prompts.d.ts.map +1 -0
  24. package/dist/commonjs/mcp-server/prompts.js +47 -0
  25. package/dist/commonjs/mcp-server/prompts.js.map +1 -0
  26. package/dist/commonjs/mcp-server/resources.d.ts.map +1 -1
  27. package/dist/commonjs/mcp-server/resources.js +1 -0
  28. package/dist/commonjs/mcp-server/resources.js.map +1 -1
  29. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  30. package/dist/commonjs/mcp-server/server.js +4 -2
  31. package/dist/commonjs/mcp-server/server.js.map +1 -1
  32. package/dist/commonjs/mcp-server/tools/customersCreate.js +1 -1
  33. package/dist/commonjs/mcp-server/tools/customersDelete.d.ts.map +1 -1
  34. package/dist/commonjs/mcp-server/tools/customersDelete.js +12 -2
  35. package/dist/commonjs/mcp-server/tools/customersDelete.js.map +1 -1
  36. package/dist/commonjs/mcp-server/tools/customersDeleteExternal.js +1 -1
  37. package/dist/commonjs/mcp-server/tools/customersGet.js +1 -1
  38. package/dist/commonjs/mcp-server/tools/customersGetExternal.js +1 -1
  39. package/dist/commonjs/mcp-server/tools/customersGetState.js +1 -1
  40. package/dist/commonjs/mcp-server/tools/customersGetStateExternal.js +1 -1
  41. package/dist/commonjs/mcp-server/tools/customersList.js +1 -1
  42. package/dist/commonjs/mcp-server/tools/customersUpdate.js +1 -1
  43. package/dist/commonjs/mcp-server/tools/customersUpdateExternal.js +1 -1
  44. package/dist/commonjs/mcp-server/tools/metricsGet.js +1 -1
  45. package/dist/commonjs/mcp-server/tools/metricsLimits.js +1 -1
  46. package/dist/commonjs/mcp-server/tools/ordersGet.js +1 -1
  47. package/dist/commonjs/mcp-server/tools/ordersInvoice.js +1 -1
  48. package/dist/commonjs/mcp-server/tools/ordersList.js +1 -1
  49. package/dist/commonjs/mcp-server/tools/productsCreate.js +1 -1
  50. package/dist/commonjs/mcp-server/tools/productsGet.js +1 -1
  51. package/dist/commonjs/mcp-server/tools/productsList.js +1 -1
  52. package/dist/commonjs/mcp-server/tools/productsUpdate.js +1 -1
  53. package/dist/commonjs/mcp-server/tools/productsUpdateBenefits.js +1 -1
  54. package/dist/commonjs/mcp-server/tools/subscriptionsExport.js +1 -1
  55. package/dist/commonjs/mcp-server/tools/subscriptionsGet.js +1 -1
  56. package/dist/commonjs/mcp-server/tools/subscriptionsList.js +1 -1
  57. package/dist/commonjs/mcp-server/tools/subscriptionsRevoke.js +1 -1
  58. package/dist/commonjs/mcp-server/tools/subscriptionsUpdate.js +1 -1
  59. package/dist/commonjs/mcp-server/tools.d.ts.map +1 -1
  60. package/dist/commonjs/mcp-server/tools.js +4 -0
  61. package/dist/commonjs/mcp-server/tools.js.map +1 -1
  62. package/dist/commonjs/models/components/benefitgithubrepositorycreateproperties.d.ts +8 -8
  63. package/dist/commonjs/models/components/benefitgithubrepositorycreateproperties.d.ts.map +1 -1
  64. package/dist/commonjs/models/components/benefitgithubrepositorycreateproperties.js +14 -14
  65. package/dist/commonjs/models/components/benefitgithubrepositorycreateproperties.js.map +1 -1
  66. package/dist/commonjs/models/components/benefitgithubrepositoryproperties.d.ts +8 -8
  67. package/dist/commonjs/models/components/benefitgithubrepositoryproperties.d.ts.map +1 -1
  68. package/dist/commonjs/models/components/benefitgithubrepositoryproperties.js +14 -14
  69. package/dist/commonjs/models/components/benefitgithubrepositoryproperties.js.map +1 -1
  70. package/dist/commonjs/models/components/checkout.d.ts +13 -13
  71. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  72. package/dist/commonjs/models/components/checkout.js +16 -16
  73. package/dist/commonjs/models/components/checkout.js.map +1 -1
  74. package/dist/commonjs/models/components/checkoutproductscreate.d.ts +26 -26
  75. package/dist/commonjs/models/components/checkoutproductscreate.d.ts.map +1 -1
  76. package/dist/commonjs/models/components/checkoutproductscreate.js +31 -31
  77. package/dist/commonjs/models/components/checkoutproductscreate.js.map +1 -1
  78. package/dist/commonjs/models/components/customer.d.ts +5 -0
  79. package/dist/commonjs/models/components/customer.d.ts.map +1 -1
  80. package/dist/commonjs/models/components/customer.js +4 -0
  81. package/dist/commonjs/models/components/customer.js.map +1 -1
  82. package/dist/commonjs/models/components/customerorder.d.ts +61 -0
  83. package/dist/commonjs/models/components/customerorder.d.ts.map +1 -1
  84. package/dist/commonjs/models/components/customerorder.js +32 -0
  85. package/dist/commonjs/models/components/customerorder.js.map +1 -1
  86. package/dist/commonjs/models/components/customerordersortproperty.d.ts +6 -6
  87. package/dist/commonjs/models/components/customerordersortproperty.js +2 -2
  88. package/dist/commonjs/models/components/customerordersortproperty.js.map +1 -1
  89. package/dist/commonjs/models/components/customerordersubscription.d.ts +9 -9
  90. package/dist/commonjs/models/components/customerordersubscription.d.ts.map +1 -1
  91. package/dist/commonjs/models/components/customerordersubscription.js +8 -8
  92. package/dist/commonjs/models/components/customerordersubscription.js.map +1 -1
  93. package/dist/commonjs/models/components/customerstate.d.ts +5 -0
  94. package/dist/commonjs/models/components/customerstate.d.ts.map +1 -1
  95. package/dist/commonjs/models/components/customerstate.js +4 -0
  96. package/dist/commonjs/models/components/customerstate.js.map +1 -1
  97. package/dist/commonjs/models/components/customerstatesubscription.d.ts +9 -9
  98. package/dist/commonjs/models/components/customerstatesubscription.d.ts.map +1 -1
  99. package/dist/commonjs/models/components/customerstatesubscription.js +8 -8
  100. package/dist/commonjs/models/components/customerstatesubscription.js.map +1 -1
  101. package/dist/commonjs/models/components/customersubscription.d.ts +81 -19
  102. package/dist/commonjs/models/components/customersubscription.d.ts.map +1 -1
  103. package/dist/commonjs/models/components/customersubscription.js +61 -25
  104. package/dist/commonjs/models/components/customersubscription.js.map +1 -1
  105. package/dist/commonjs/models/components/licensekeycustomer.d.ts +16 -11
  106. package/dist/commonjs/models/components/licensekeycustomer.d.ts.map +1 -1
  107. package/dist/commonjs/models/components/licensekeycustomer.js +20 -17
  108. package/dist/commonjs/models/components/licensekeycustomer.js.map +1 -1
  109. package/dist/commonjs/models/components/order.d.ts +52 -3
  110. package/dist/commonjs/models/components/order.d.ts.map +1 -1
  111. package/dist/commonjs/models/components/order.js +24 -2
  112. package/dist/commonjs/models/components/order.js.map +1 -1
  113. package/dist/commonjs/models/components/ordercustomer.d.ts +5 -0
  114. package/dist/commonjs/models/components/ordercustomer.d.ts.map +1 -1
  115. package/dist/commonjs/models/components/ordercustomer.js +4 -0
  116. package/dist/commonjs/models/components/ordercustomer.js.map +1 -1
  117. package/dist/commonjs/models/components/orderitemschema.d.ts +70 -0
  118. package/dist/commonjs/models/components/orderitemschema.d.ts.map +1 -0
  119. package/dist/commonjs/models/components/orderitemschema.js +88 -0
  120. package/dist/commonjs/models/components/orderitemschema.js.map +1 -0
  121. package/dist/commonjs/models/components/ordersortproperty.d.ts +6 -0
  122. package/dist/commonjs/models/components/ordersortproperty.d.ts.map +1 -1
  123. package/dist/commonjs/models/components/ordersortproperty.js +2 -0
  124. package/dist/commonjs/models/components/ordersortproperty.js.map +1 -1
  125. package/dist/commonjs/models/components/orderstatus.d.ts +34 -0
  126. package/dist/commonjs/models/components/orderstatus.d.ts.map +1 -0
  127. package/dist/commonjs/models/components/orderstatus.js +53 -0
  128. package/dist/commonjs/models/components/orderstatus.js.map +1 -0
  129. package/dist/commonjs/models/components/ordersubscription.d.ts +9 -9
  130. package/dist/commonjs/models/components/ordersubscription.d.ts.map +1 -1
  131. package/dist/commonjs/models/components/ordersubscription.js +8 -8
  132. package/dist/commonjs/models/components/ordersubscription.js.map +1 -1
  133. package/dist/commonjs/models/components/organization.d.ts +63 -9
  134. package/dist/commonjs/models/components/organization.d.ts.map +1 -1
  135. package/dist/commonjs/models/components/organization.js +19 -10
  136. package/dist/commonjs/models/components/organization.js.map +1 -1
  137. package/dist/commonjs/models/components/organizationcreate.d.ts +22 -0
  138. package/dist/commonjs/models/components/organizationcreate.d.ts.map +1 -1
  139. package/dist/commonjs/models/components/organizationcreate.js +11 -0
  140. package/dist/commonjs/models/components/organizationcreate.js.map +1 -1
  141. package/dist/commonjs/models/components/organizationdetails.d.ts +102 -0
  142. package/dist/commonjs/models/components/organizationdetails.d.ts.map +1 -0
  143. package/dist/commonjs/models/components/organizationdetails.js +114 -0
  144. package/dist/commonjs/models/components/organizationdetails.js.map +1 -0
  145. package/dist/commonjs/models/components/organizationsociallink.d.ts +35 -0
  146. package/dist/commonjs/models/components/organizationsociallink.d.ts.map +1 -0
  147. package/dist/commonjs/models/components/organizationsociallink.js +62 -0
  148. package/dist/commonjs/models/components/organizationsociallink.js.map +1 -0
  149. package/dist/commonjs/models/components/organizationsocialplatforms.d.ts +46 -0
  150. package/dist/commonjs/models/components/organizationsocialplatforms.d.ts.map +1 -0
  151. package/dist/commonjs/models/components/organizationsocialplatforms.js +56 -0
  152. package/dist/commonjs/models/components/organizationsocialplatforms.js.map +1 -0
  153. package/dist/commonjs/models/components/organizationupdate.d.ts +50 -4
  154. package/dist/commonjs/models/components/organizationupdate.d.ts.map +1 -1
  155. package/dist/commonjs/models/components/organizationupdate.js +21 -10
  156. package/dist/commonjs/models/components/organizationupdate.js.map +1 -1
  157. package/dist/commonjs/models/components/product.d.ts +13 -13
  158. package/dist/commonjs/models/components/product.d.ts.map +1 -1
  159. package/dist/commonjs/models/components/product.js +17 -16
  160. package/dist/commonjs/models/components/product.js.map +1 -1
  161. package/dist/commonjs/models/components/productcreate.d.ts +26 -26
  162. package/dist/commonjs/models/components/productcreate.d.ts.map +1 -1
  163. package/dist/commonjs/models/components/productcreate.js +31 -32
  164. package/dist/commonjs/models/components/productcreate.js.map +1 -1
  165. package/dist/commonjs/models/components/refundcreate.d.ts +3 -0
  166. package/dist/commonjs/models/components/refundcreate.d.ts.map +1 -1
  167. package/dist/commonjs/models/components/refundcreate.js.map +1 -1
  168. package/dist/commonjs/models/components/subscription.d.ts +90 -58
  169. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  170. package/dist/commonjs/models/components/subscription.js +114 -76
  171. package/dist/commonjs/models/components/subscription.js.map +1 -1
  172. package/dist/commonjs/models/components/subscriptioncustomer.d.ts +16 -11
  173. package/dist/commonjs/models/components/subscriptioncustomer.d.ts.map +1 -1
  174. package/dist/commonjs/models/components/subscriptioncustomer.js +21 -16
  175. package/dist/commonjs/models/components/subscriptioncustomer.js.map +1 -1
  176. package/dist/commonjs/models/components/webhookordercreatedpayload.d.ts +3 -1
  177. package/dist/commonjs/models/components/webhookordercreatedpayload.d.ts.map +1 -1
  178. package/dist/commonjs/models/components/webhookordercreatedpayload.js.map +1 -1
  179. package/dist/commonjs/models/components/webhookorderpaidpayload.d.ts +41 -0
  180. package/dist/commonjs/models/components/webhookorderpaidpayload.d.ts.map +1 -0
  181. package/dist/commonjs/models/components/webhookorderpaidpayload.js +62 -0
  182. package/dist/commonjs/models/components/webhookorderpaidpayload.js.map +1 -0
  183. package/dist/commonjs/models/components/webhookorderupdatedpayload.d.ts +44 -0
  184. package/dist/commonjs/models/components/webhookorderupdatedpayload.d.ts.map +1 -0
  185. package/dist/commonjs/models/components/webhookorderupdatedpayload.js +62 -0
  186. package/dist/commonjs/models/components/webhookorderupdatedpayload.js.map +1 -0
  187. package/dist/commonjs/models/operations/benefitslist.d.ts +5 -0
  188. package/dist/commonjs/models/operations/benefitslist.d.ts.map +1 -1
  189. package/dist/commonjs/models/operations/benefitslist.js +2 -0
  190. package/dist/commonjs/models/operations/benefitslist.js.map +1 -1
  191. package/dist/commonjs/sdk/customers.d.ts +11 -1
  192. package/dist/commonjs/sdk/customers.d.ts.map +1 -1
  193. package/dist/commonjs/sdk/customers.js +11 -1
  194. package/dist/commonjs/sdk/customers.js.map +1 -1
  195. package/dist/commonjs/webhooks.d.ts +1 -1
  196. package/dist/commonjs/webhooks.d.ts.map +1 -1
  197. package/dist/commonjs/webhooks.js +6 -0
  198. package/dist/commonjs/webhooks.js.map +1 -1
  199. package/dist/esm/funcs/benefitsList.js +1 -0
  200. package/dist/esm/funcs/benefitsList.js.map +1 -1
  201. package/dist/esm/funcs/customersDelete.d.ts +11 -1
  202. package/dist/esm/funcs/customersDelete.d.ts.map +1 -1
  203. package/dist/esm/funcs/customersDelete.js +11 -1
  204. package/dist/esm/funcs/customersDelete.js.map +1 -1
  205. package/dist/esm/lib/config.d.ts +3 -3
  206. package/dist/esm/lib/config.js +3 -3
  207. package/dist/esm/lib/sdks.d.ts.map +1 -1
  208. package/dist/esm/lib/sdks.js +2 -8
  209. package/dist/esm/lib/sdks.js.map +1 -1
  210. package/dist/esm/lib/security.d.ts +4 -3
  211. package/dist/esm/lib/security.d.ts.map +1 -1
  212. package/dist/esm/lib/security.js +6 -1
  213. package/dist/esm/lib/security.js.map +1 -1
  214. package/dist/esm/mcp-server/extensions.d.ts +2 -0
  215. package/dist/esm/mcp-server/extensions.d.ts.map +1 -1
  216. package/dist/esm/mcp-server/mcp-server.js +1 -1
  217. package/dist/esm/mcp-server/prompts.d.ts +26 -0
  218. package/dist/esm/mcp-server/prompts.d.ts.map +1 -0
  219. package/dist/esm/mcp-server/prompts.js +43 -0
  220. package/dist/esm/mcp-server/prompts.js.map +1 -0
  221. package/dist/esm/mcp-server/resources.d.ts.map +1 -1
  222. package/dist/esm/mcp-server/resources.js +1 -0
  223. package/dist/esm/mcp-server/resources.js.map +1 -1
  224. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  225. package/dist/esm/mcp-server/server.js +4 -2
  226. package/dist/esm/mcp-server/server.js.map +1 -1
  227. package/dist/esm/mcp-server/tools/customersCreate.js +1 -1
  228. package/dist/esm/mcp-server/tools/customersDelete.d.ts.map +1 -1
  229. package/dist/esm/mcp-server/tools/customersDelete.js +12 -2
  230. package/dist/esm/mcp-server/tools/customersDelete.js.map +1 -1
  231. package/dist/esm/mcp-server/tools/customersDeleteExternal.js +1 -1
  232. package/dist/esm/mcp-server/tools/customersGet.js +1 -1
  233. package/dist/esm/mcp-server/tools/customersGetExternal.js +1 -1
  234. package/dist/esm/mcp-server/tools/customersGetState.js +1 -1
  235. package/dist/esm/mcp-server/tools/customersGetStateExternal.js +1 -1
  236. package/dist/esm/mcp-server/tools/customersList.js +1 -1
  237. package/dist/esm/mcp-server/tools/customersUpdate.js +1 -1
  238. package/dist/esm/mcp-server/tools/customersUpdateExternal.js +1 -1
  239. package/dist/esm/mcp-server/tools/metricsGet.js +1 -1
  240. package/dist/esm/mcp-server/tools/metricsLimits.js +1 -1
  241. package/dist/esm/mcp-server/tools/ordersGet.js +1 -1
  242. package/dist/esm/mcp-server/tools/ordersInvoice.js +1 -1
  243. package/dist/esm/mcp-server/tools/ordersList.js +1 -1
  244. package/dist/esm/mcp-server/tools/productsCreate.js +1 -1
  245. package/dist/esm/mcp-server/tools/productsGet.js +1 -1
  246. package/dist/esm/mcp-server/tools/productsList.js +1 -1
  247. package/dist/esm/mcp-server/tools/productsUpdate.js +1 -1
  248. package/dist/esm/mcp-server/tools/productsUpdateBenefits.js +1 -1
  249. package/dist/esm/mcp-server/tools/subscriptionsExport.js +1 -1
  250. package/dist/esm/mcp-server/tools/subscriptionsGet.js +1 -1
  251. package/dist/esm/mcp-server/tools/subscriptionsList.js +1 -1
  252. package/dist/esm/mcp-server/tools/subscriptionsRevoke.js +1 -1
  253. package/dist/esm/mcp-server/tools/subscriptionsUpdate.js +1 -1
  254. package/dist/esm/mcp-server/tools.d.ts.map +1 -1
  255. package/dist/esm/mcp-server/tools.js +4 -0
  256. package/dist/esm/mcp-server/tools.js.map +1 -1
  257. package/dist/esm/models/components/benefitgithubrepositorycreateproperties.d.ts +8 -8
  258. package/dist/esm/models/components/benefitgithubrepositorycreateproperties.d.ts.map +1 -1
  259. package/dist/esm/models/components/benefitgithubrepositorycreateproperties.js +13 -13
  260. package/dist/esm/models/components/benefitgithubrepositorycreateproperties.js.map +1 -1
  261. package/dist/esm/models/components/benefitgithubrepositoryproperties.d.ts +8 -8
  262. package/dist/esm/models/components/benefitgithubrepositoryproperties.d.ts.map +1 -1
  263. package/dist/esm/models/components/benefitgithubrepositoryproperties.js +13 -13
  264. package/dist/esm/models/components/benefitgithubrepositoryproperties.js.map +1 -1
  265. package/dist/esm/models/components/checkout.d.ts +13 -13
  266. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  267. package/dist/esm/models/components/checkout.js +13 -13
  268. package/dist/esm/models/components/checkout.js.map +1 -1
  269. package/dist/esm/models/components/checkoutproductscreate.d.ts +26 -26
  270. package/dist/esm/models/components/checkoutproductscreate.d.ts.map +1 -1
  271. package/dist/esm/models/components/checkoutproductscreate.js +26 -26
  272. package/dist/esm/models/components/checkoutproductscreate.js.map +1 -1
  273. package/dist/esm/models/components/customer.d.ts +5 -0
  274. package/dist/esm/models/components/customer.d.ts.map +1 -1
  275. package/dist/esm/models/components/customer.js +4 -0
  276. package/dist/esm/models/components/customer.js.map +1 -1
  277. package/dist/esm/models/components/customerorder.d.ts +61 -0
  278. package/dist/esm/models/components/customerorder.d.ts.map +1 -1
  279. package/dist/esm/models/components/customerorder.js +32 -0
  280. package/dist/esm/models/components/customerorder.js.map +1 -1
  281. package/dist/esm/models/components/customerordersortproperty.d.ts +6 -6
  282. package/dist/esm/models/components/customerordersortproperty.js +2 -2
  283. package/dist/esm/models/components/customerordersortproperty.js.map +1 -1
  284. package/dist/esm/models/components/customerordersubscription.d.ts +9 -9
  285. package/dist/esm/models/components/customerordersubscription.d.ts.map +1 -1
  286. package/dist/esm/models/components/customerordersubscription.js +8 -8
  287. package/dist/esm/models/components/customerordersubscription.js.map +1 -1
  288. package/dist/esm/models/components/customerstate.d.ts +5 -0
  289. package/dist/esm/models/components/customerstate.d.ts.map +1 -1
  290. package/dist/esm/models/components/customerstate.js +4 -0
  291. package/dist/esm/models/components/customerstate.js.map +1 -1
  292. package/dist/esm/models/components/customerstatesubscription.d.ts +9 -9
  293. package/dist/esm/models/components/customerstatesubscription.d.ts.map +1 -1
  294. package/dist/esm/models/components/customerstatesubscription.js +8 -8
  295. package/dist/esm/models/components/customerstatesubscription.js.map +1 -1
  296. package/dist/esm/models/components/customersubscription.d.ts +81 -19
  297. package/dist/esm/models/components/customersubscription.d.ts.map +1 -1
  298. package/dist/esm/models/components/customersubscription.js +56 -22
  299. package/dist/esm/models/components/customersubscription.js.map +1 -1
  300. package/dist/esm/models/components/licensekeycustomer.d.ts +16 -11
  301. package/dist/esm/models/components/licensekeycustomer.d.ts.map +1 -1
  302. package/dist/esm/models/components/licensekeycustomer.js +17 -14
  303. package/dist/esm/models/components/licensekeycustomer.js.map +1 -1
  304. package/dist/esm/models/components/order.d.ts +52 -3
  305. package/dist/esm/models/components/order.d.ts.map +1 -1
  306. package/dist/esm/models/components/order.js +24 -2
  307. package/dist/esm/models/components/order.js.map +1 -1
  308. package/dist/esm/models/components/ordercustomer.d.ts +5 -0
  309. package/dist/esm/models/components/ordercustomer.d.ts.map +1 -1
  310. package/dist/esm/models/components/ordercustomer.js +4 -0
  311. package/dist/esm/models/components/ordercustomer.js.map +1 -1
  312. package/dist/esm/models/components/orderitemschema.d.ts +70 -0
  313. package/dist/esm/models/components/orderitemschema.d.ts.map +1 -0
  314. package/dist/esm/models/components/orderitemschema.js +60 -0
  315. package/dist/esm/models/components/orderitemschema.js.map +1 -0
  316. package/dist/esm/models/components/ordersortproperty.d.ts +6 -0
  317. package/dist/esm/models/components/ordersortproperty.d.ts.map +1 -1
  318. package/dist/esm/models/components/ordersortproperty.js +2 -0
  319. package/dist/esm/models/components/ordersortproperty.js.map +1 -1
  320. package/dist/esm/models/components/orderstatus.d.ts +34 -0
  321. package/dist/esm/models/components/orderstatus.d.ts.map +1 -0
  322. package/dist/esm/models/components/orderstatus.js +27 -0
  323. package/dist/esm/models/components/orderstatus.js.map +1 -0
  324. package/dist/esm/models/components/ordersubscription.d.ts +9 -9
  325. package/dist/esm/models/components/ordersubscription.d.ts.map +1 -1
  326. package/dist/esm/models/components/ordersubscription.js +8 -8
  327. package/dist/esm/models/components/ordersubscription.js.map +1 -1
  328. package/dist/esm/models/components/organization.d.ts +63 -9
  329. package/dist/esm/models/components/organization.d.ts.map +1 -1
  330. package/dist/esm/models/components/organization.js +19 -10
  331. package/dist/esm/models/components/organization.js.map +1 -1
  332. package/dist/esm/models/components/organizationcreate.d.ts +22 -0
  333. package/dist/esm/models/components/organizationcreate.d.ts.map +1 -1
  334. package/dist/esm/models/components/organizationcreate.js +11 -0
  335. package/dist/esm/models/components/organizationcreate.js.map +1 -1
  336. package/dist/esm/models/components/organizationdetails.d.ts +102 -0
  337. package/dist/esm/models/components/organizationdetails.d.ts.map +1 -0
  338. package/dist/esm/models/components/organizationdetails.js +86 -0
  339. package/dist/esm/models/components/organizationdetails.js.map +1 -0
  340. package/dist/esm/models/components/organizationsociallink.d.ts +35 -0
  341. package/dist/esm/models/components/organizationsociallink.d.ts.map +1 -0
  342. package/dist/esm/models/components/organizationsociallink.js +34 -0
  343. package/dist/esm/models/components/organizationsociallink.js.map +1 -0
  344. package/dist/esm/models/components/organizationsocialplatforms.d.ts +46 -0
  345. package/dist/esm/models/components/organizationsocialplatforms.d.ts.map +1 -0
  346. package/dist/esm/models/components/organizationsocialplatforms.js +30 -0
  347. package/dist/esm/models/components/organizationsocialplatforms.js.map +1 -0
  348. package/dist/esm/models/components/organizationupdate.d.ts +50 -4
  349. package/dist/esm/models/components/organizationupdate.d.ts.map +1 -1
  350. package/dist/esm/models/components/organizationupdate.js +21 -10
  351. package/dist/esm/models/components/organizationupdate.js.map +1 -1
  352. package/dist/esm/models/components/product.d.ts +13 -13
  353. package/dist/esm/models/components/product.d.ts.map +1 -1
  354. package/dist/esm/models/components/product.js +14 -13
  355. package/dist/esm/models/components/product.js.map +1 -1
  356. package/dist/esm/models/components/productcreate.d.ts +26 -26
  357. package/dist/esm/models/components/productcreate.d.ts.map +1 -1
  358. package/dist/esm/models/components/productcreate.js +26 -27
  359. package/dist/esm/models/components/productcreate.js.map +1 -1
  360. package/dist/esm/models/components/refundcreate.d.ts +3 -0
  361. package/dist/esm/models/components/refundcreate.d.ts.map +1 -1
  362. package/dist/esm/models/components/refundcreate.js.map +1 -1
  363. package/dist/esm/models/components/subscription.d.ts +90 -58
  364. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  365. package/dist/esm/models/components/subscription.js +105 -69
  366. package/dist/esm/models/components/subscription.js.map +1 -1
  367. package/dist/esm/models/components/subscriptioncustomer.d.ts +16 -11
  368. package/dist/esm/models/components/subscriptioncustomer.d.ts.map +1 -1
  369. package/dist/esm/models/components/subscriptioncustomer.js +18 -13
  370. package/dist/esm/models/components/subscriptioncustomer.js.map +1 -1
  371. package/dist/esm/models/components/webhookordercreatedpayload.d.ts +3 -1
  372. package/dist/esm/models/components/webhookordercreatedpayload.d.ts.map +1 -1
  373. package/dist/esm/models/components/webhookordercreatedpayload.js.map +1 -1
  374. package/dist/esm/models/components/webhookorderpaidpayload.d.ts +41 -0
  375. package/dist/esm/models/components/webhookorderpaidpayload.d.ts.map +1 -0
  376. package/dist/esm/models/components/webhookorderpaidpayload.js +34 -0
  377. package/dist/esm/models/components/webhookorderpaidpayload.js.map +1 -0
  378. package/dist/esm/models/components/webhookorderupdatedpayload.d.ts +44 -0
  379. package/dist/esm/models/components/webhookorderupdatedpayload.d.ts.map +1 -0
  380. package/dist/esm/models/components/webhookorderupdatedpayload.js +34 -0
  381. package/dist/esm/models/components/webhookorderupdatedpayload.js.map +1 -0
  382. package/dist/esm/models/operations/benefitslist.d.ts +5 -0
  383. package/dist/esm/models/operations/benefitslist.d.ts.map +1 -1
  384. package/dist/esm/models/operations/benefitslist.js +2 -0
  385. package/dist/esm/models/operations/benefitslist.js.map +1 -1
  386. package/dist/esm/sdk/customers.d.ts +11 -1
  387. package/dist/esm/sdk/customers.d.ts.map +1 -1
  388. package/dist/esm/sdk/customers.js +11 -1
  389. package/dist/esm/sdk/customers.js.map +1 -1
  390. package/dist/esm/webhooks.d.ts +1 -1
  391. package/dist/esm/webhooks.d.ts.map +1 -1
  392. package/dist/esm/webhooks.js +6 -0
  393. package/dist/esm/webhooks.js.map +1 -1
  394. package/docs/sdks/customers/README.md +11 -1
  395. package/jsr.json +1 -1
  396. package/package.json +1 -1
  397. package/src/funcs/benefitsList.ts +1 -0
  398. package/src/funcs/customersDelete.ts +11 -1
  399. package/src/lib/config.ts +3 -3
  400. package/src/lib/sdks.ts +2 -7
  401. package/src/lib/security.ts +11 -3
  402. package/src/mcp-server/extensions.ts +4 -0
  403. package/src/mcp-server/mcp-server.ts +1 -1
  404. package/src/mcp-server/prompts.ts +110 -0
  405. package/src/mcp-server/resources.ts +1 -0
  406. package/src/mcp-server/server.ts +4 -2
  407. package/src/mcp-server/tools/customersCreate.ts +1 -1
  408. package/src/mcp-server/tools/customersDelete.ts +12 -2
  409. package/src/mcp-server/tools/customersDeleteExternal.ts +1 -1
  410. package/src/mcp-server/tools/customersGet.ts +1 -1
  411. package/src/mcp-server/tools/customersGetExternal.ts +1 -1
  412. package/src/mcp-server/tools/customersGetState.ts +1 -1
  413. package/src/mcp-server/tools/customersGetStateExternal.ts +1 -1
  414. package/src/mcp-server/tools/customersList.ts +1 -1
  415. package/src/mcp-server/tools/customersUpdate.ts +1 -1
  416. package/src/mcp-server/tools/customersUpdateExternal.ts +1 -1
  417. package/src/mcp-server/tools/metricsGet.ts +1 -1
  418. package/src/mcp-server/tools/metricsLimits.ts +1 -1
  419. package/src/mcp-server/tools/ordersGet.ts +1 -1
  420. package/src/mcp-server/tools/ordersInvoice.ts +1 -1
  421. package/src/mcp-server/tools/ordersList.ts +1 -1
  422. package/src/mcp-server/tools/productsCreate.ts +1 -1
  423. package/src/mcp-server/tools/productsGet.ts +1 -1
  424. package/src/mcp-server/tools/productsList.ts +1 -1
  425. package/src/mcp-server/tools/productsUpdate.ts +1 -1
  426. package/src/mcp-server/tools/productsUpdateBenefits.ts +1 -1
  427. package/src/mcp-server/tools/subscriptionsExport.ts +1 -1
  428. package/src/mcp-server/tools/subscriptionsGet.ts +1 -1
  429. package/src/mcp-server/tools/subscriptionsList.ts +1 -1
  430. package/src/mcp-server/tools/subscriptionsRevoke.ts +1 -1
  431. package/src/mcp-server/tools/subscriptionsUpdate.ts +1 -1
  432. package/src/mcp-server/tools.ts +5 -0
  433. package/src/models/components/benefitgithubrepositorycreateproperties.ts +20 -14
  434. package/src/models/components/benefitgithubrepositoryproperties.ts +14 -20
  435. package/src/models/components/checkout.ts +21 -21
  436. package/src/models/components/checkoutproductscreate.ts +66 -42
  437. package/src/models/components/customer.ts +11 -0
  438. package/src/models/components/customerorder.ts +100 -0
  439. package/src/models/components/customerordersortproperty.ts +2 -2
  440. package/src/models/components/customerordersubscription.ts +17 -17
  441. package/src/models/components/customerstate.ts +11 -0
  442. package/src/models/components/customerstatesubscription.ts +17 -17
  443. package/src/models/components/customersubscription.ts +159 -37
  444. package/src/models/components/licensekeycustomer.ts +38 -20
  445. package/src/models/components/order.ts +83 -5
  446. package/src/models/components/ordercustomer.ts +11 -0
  447. package/src/models/components/orderitemschema.ts +136 -0
  448. package/src/models/components/ordersortproperty.ts +2 -0
  449. package/src/models/components/orderstatus.ts +33 -0
  450. package/src/models/components/ordersubscription.ts +17 -17
  451. package/src/models/components/organization.ts +88 -19
  452. package/src/models/components/organizationcreate.ts +41 -0
  453. package/src/models/components/organizationdetails.ts +168 -0
  454. package/src/models/components/organizationsociallink.ts +78 -0
  455. package/src/models/components/organizationsocialplatforms.ts +41 -0
  456. package/src/models/components/organizationupdate.ts +86 -21
  457. package/src/models/components/product.ts +23 -26
  458. package/src/models/components/productcreate.ts +55 -44
  459. package/src/models/components/refundcreate.ts +3 -0
  460. package/src/models/components/subscription.ts +200 -138
  461. package/src/models/components/subscriptioncustomer.ts +31 -27
  462. package/src/models/components/webhookordercreatedpayload.ts +3 -1
  463. package/src/models/components/webhookorderpaidpayload.ts +85 -0
  464. package/src/models/components/webhookorderupdatedpayload.ts +88 -0
  465. package/src/models/operations/benefitslist.ts +7 -0
  466. package/src/sdk/customers.ts +11 -1
  467. package/src/webhooks.ts +6 -0
@@ -77,11 +77,9 @@ import {
77
77
  SubscriptionUser$outboundSchema,
78
78
  } from "./subscriptionuser.js";
79
79
 
80
- export type SubscriptionMetadata = string | number | boolean;
80
+ export type Metadata = string | number | boolean;
81
81
 
82
- export type SubscriptionCustomFieldData = string | number | boolean | Date;
83
-
84
- export type SubscriptionPrice = LegacyRecurringProductPrice | ProductPrice;
82
+ export type CustomFieldData = string | number | boolean | Date;
85
83
 
86
84
  export type SubscriptionDiscount =
87
85
  | DiscountPercentageOnceForeverDurationBase
@@ -89,6 +87,13 @@ export type SubscriptionDiscount =
89
87
  | DiscountPercentageRepeatDurationBase
90
88
  | DiscountFixedRepeatDurationBase;
91
89
 
90
+ /**
91
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
92
+ */
93
+ export type Price = LegacyRecurringProductPrice | ProductPrice;
94
+
95
+ export type SubscriptionPrices = LegacyRecurringProductPrice | ProductPrice;
96
+
92
97
  export type Subscription = {
93
98
  /**
94
99
  * Creation timestamp of the object.
@@ -105,11 +110,11 @@ export type Subscription = {
105
110
  /**
106
111
  * The amount of the subscription.
107
112
  */
108
- amount: number | null;
113
+ amount: number;
109
114
  /**
110
115
  * The currency of the subscription.
111
116
  */
112
- currency: string | null;
117
+ currency: string;
113
118
  recurringInterval: SubscriptionRecurringInterval;
114
119
  status: SubscriptionStatus;
115
120
  /**
@@ -148,10 +153,6 @@ export type Subscription = {
148
153
  * The ID of the subscribed product.
149
154
  */
150
155
  productId: string;
151
- /**
152
- * The ID of the subscribed price.
153
- */
154
- priceId: string;
155
156
  /**
156
157
  * The ID of the applied discount, if any.
157
158
  */
@@ -159,6 +160,10 @@ export type Subscription = {
159
160
  checkoutId: string | null;
160
161
  customerCancellationReason: CustomerCancellationReason | null;
161
162
  customerCancellationComment: string | null;
163
+ /**
164
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
165
+ */
166
+ priceId: string;
162
167
  metadata: { [k: string]: string | number | boolean };
163
168
  /**
164
169
  * Key-value object storing custom field values.
@@ -176,66 +181,69 @@ export type Subscription = {
176
181
  * A product.
177
182
  */
178
183
  product: Product;
179
- price: LegacyRecurringProductPrice | ProductPrice;
180
184
  discount:
181
185
  | DiscountPercentageOnceForeverDurationBase
182
186
  | DiscountFixedOnceForeverDurationBase
183
187
  | DiscountPercentageRepeatDurationBase
184
188
  | DiscountFixedRepeatDurationBase
185
189
  | null;
190
+ /**
191
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
192
+ */
193
+ price: LegacyRecurringProductPrice | ProductPrice;
194
+ /**
195
+ * List of enabled prices for the subscription.
196
+ */
197
+ prices: Array<LegacyRecurringProductPrice | ProductPrice>;
186
198
  };
187
199
 
188
200
  /** @internal */
189
- export const SubscriptionMetadata$inboundSchema: z.ZodType<
190
- SubscriptionMetadata,
201
+ export const Metadata$inboundSchema: z.ZodType<
202
+ Metadata,
191
203
  z.ZodTypeDef,
192
204
  unknown
193
205
  > = z.union([z.string(), z.number().int(), z.boolean()]);
194
206
 
195
207
  /** @internal */
196
- export type SubscriptionMetadata$Outbound = string | number | boolean;
208
+ export type Metadata$Outbound = string | number | boolean;
197
209
 
198
210
  /** @internal */
199
- export const SubscriptionMetadata$outboundSchema: z.ZodType<
200
- SubscriptionMetadata$Outbound,
211
+ export const Metadata$outboundSchema: z.ZodType<
212
+ Metadata$Outbound,
201
213
  z.ZodTypeDef,
202
- SubscriptionMetadata
214
+ Metadata
203
215
  > = z.union([z.string(), z.number().int(), z.boolean()]);
204
216
 
205
217
  /**
206
218
  * @internal
207
219
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
208
220
  */
209
- export namespace SubscriptionMetadata$ {
210
- /** @deprecated use `SubscriptionMetadata$inboundSchema` instead. */
211
- export const inboundSchema = SubscriptionMetadata$inboundSchema;
212
- /** @deprecated use `SubscriptionMetadata$outboundSchema` instead. */
213
- export const outboundSchema = SubscriptionMetadata$outboundSchema;
214
- /** @deprecated use `SubscriptionMetadata$Outbound` instead. */
215
- export type Outbound = SubscriptionMetadata$Outbound;
221
+ export namespace Metadata$ {
222
+ /** @deprecated use `Metadata$inboundSchema` instead. */
223
+ export const inboundSchema = Metadata$inboundSchema;
224
+ /** @deprecated use `Metadata$outboundSchema` instead. */
225
+ export const outboundSchema = Metadata$outboundSchema;
226
+ /** @deprecated use `Metadata$Outbound` instead. */
227
+ export type Outbound = Metadata$Outbound;
216
228
  }
217
229
 
218
- export function subscriptionMetadataToJSON(
219
- subscriptionMetadata: SubscriptionMetadata,
220
- ): string {
221
- return JSON.stringify(
222
- SubscriptionMetadata$outboundSchema.parse(subscriptionMetadata),
223
- );
230
+ export function metadataToJSON(metadata: Metadata): string {
231
+ return JSON.stringify(Metadata$outboundSchema.parse(metadata));
224
232
  }
225
233
 
226
- export function subscriptionMetadataFromJSON(
234
+ export function metadataFromJSON(
227
235
  jsonString: string,
228
- ): SafeParseResult<SubscriptionMetadata, SDKValidationError> {
236
+ ): SafeParseResult<Metadata, SDKValidationError> {
229
237
  return safeParse(
230
238
  jsonString,
231
- (x) => SubscriptionMetadata$inboundSchema.parse(JSON.parse(x)),
232
- `Failed to parse 'SubscriptionMetadata' from JSON`,
239
+ (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
240
+ `Failed to parse 'Metadata' from JSON`,
233
241
  );
234
242
  }
235
243
 
236
244
  /** @internal */
237
- export const SubscriptionCustomFieldData$inboundSchema: z.ZodType<
238
- SubscriptionCustomFieldData,
245
+ export const CustomFieldData$inboundSchema: z.ZodType<
246
+ CustomFieldData,
239
247
  z.ZodTypeDef,
240
248
  unknown
241
249
  > = z.union([
@@ -246,17 +254,13 @@ export const SubscriptionCustomFieldData$inboundSchema: z.ZodType<
246
254
  ]);
247
255
 
248
256
  /** @internal */
249
- export type SubscriptionCustomFieldData$Outbound =
250
- | string
251
- | number
252
- | boolean
253
- | string;
257
+ export type CustomFieldData$Outbound = string | number | boolean | string;
254
258
 
255
259
  /** @internal */
256
- export const SubscriptionCustomFieldData$outboundSchema: z.ZodType<
257
- SubscriptionCustomFieldData$Outbound,
260
+ export const CustomFieldData$outboundSchema: z.ZodType<
261
+ CustomFieldData$Outbound,
258
262
  z.ZodTypeDef,
259
- SubscriptionCustomFieldData
263
+ CustomFieldData
260
264
  > = z.union([
261
265
  z.string(),
262
266
  z.number().int(),
@@ -268,88 +272,28 @@ export const SubscriptionCustomFieldData$outboundSchema: z.ZodType<
268
272
  * @internal
269
273
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
270
274
  */
271
- export namespace SubscriptionCustomFieldData$ {
272
- /** @deprecated use `SubscriptionCustomFieldData$inboundSchema` instead. */
273
- export const inboundSchema = SubscriptionCustomFieldData$inboundSchema;
274
- /** @deprecated use `SubscriptionCustomFieldData$outboundSchema` instead. */
275
- export const outboundSchema = SubscriptionCustomFieldData$outboundSchema;
276
- /** @deprecated use `SubscriptionCustomFieldData$Outbound` instead. */
277
- export type Outbound = SubscriptionCustomFieldData$Outbound;
278
- }
279
-
280
- export function subscriptionCustomFieldDataToJSON(
281
- subscriptionCustomFieldData: SubscriptionCustomFieldData,
282
- ): string {
283
- return JSON.stringify(
284
- SubscriptionCustomFieldData$outboundSchema.parse(
285
- subscriptionCustomFieldData,
286
- ),
287
- );
288
- }
289
-
290
- export function subscriptionCustomFieldDataFromJSON(
291
- jsonString: string,
292
- ): SafeParseResult<SubscriptionCustomFieldData, SDKValidationError> {
293
- return safeParse(
294
- jsonString,
295
- (x) => SubscriptionCustomFieldData$inboundSchema.parse(JSON.parse(x)),
296
- `Failed to parse 'SubscriptionCustomFieldData' from JSON`,
297
- );
298
- }
299
-
300
- /** @internal */
301
- export const SubscriptionPrice$inboundSchema: z.ZodType<
302
- SubscriptionPrice,
303
- z.ZodTypeDef,
304
- unknown
305
- > = z.union([
306
- LegacyRecurringProductPrice$inboundSchema,
307
- ProductPrice$inboundSchema,
308
- ]);
309
-
310
- /** @internal */
311
- export type SubscriptionPrice$Outbound =
312
- | LegacyRecurringProductPrice$Outbound
313
- | ProductPrice$Outbound;
314
-
315
- /** @internal */
316
- export const SubscriptionPrice$outboundSchema: z.ZodType<
317
- SubscriptionPrice$Outbound,
318
- z.ZodTypeDef,
319
- SubscriptionPrice
320
- > = z.union([
321
- LegacyRecurringProductPrice$outboundSchema,
322
- ProductPrice$outboundSchema,
323
- ]);
324
-
325
- /**
326
- * @internal
327
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
328
- */
329
- export namespace SubscriptionPrice$ {
330
- /** @deprecated use `SubscriptionPrice$inboundSchema` instead. */
331
- export const inboundSchema = SubscriptionPrice$inboundSchema;
332
- /** @deprecated use `SubscriptionPrice$outboundSchema` instead. */
333
- export const outboundSchema = SubscriptionPrice$outboundSchema;
334
- /** @deprecated use `SubscriptionPrice$Outbound` instead. */
335
- export type Outbound = SubscriptionPrice$Outbound;
275
+ export namespace CustomFieldData$ {
276
+ /** @deprecated use `CustomFieldData$inboundSchema` instead. */
277
+ export const inboundSchema = CustomFieldData$inboundSchema;
278
+ /** @deprecated use `CustomFieldData$outboundSchema` instead. */
279
+ export const outboundSchema = CustomFieldData$outboundSchema;
280
+ /** @deprecated use `CustomFieldData$Outbound` instead. */
281
+ export type Outbound = CustomFieldData$Outbound;
336
282
  }
337
283
 
338
- export function subscriptionPriceToJSON(
339
- subscriptionPrice: SubscriptionPrice,
284
+ export function customFieldDataToJSON(
285
+ customFieldData: CustomFieldData,
340
286
  ): string {
341
- return JSON.stringify(
342
- SubscriptionPrice$outboundSchema.parse(subscriptionPrice),
343
- );
287
+ return JSON.stringify(CustomFieldData$outboundSchema.parse(customFieldData));
344
288
  }
345
289
 
346
- export function subscriptionPriceFromJSON(
290
+ export function customFieldDataFromJSON(
347
291
  jsonString: string,
348
- ): SafeParseResult<SubscriptionPrice, SDKValidationError> {
292
+ ): SafeParseResult<CustomFieldData, SDKValidationError> {
349
293
  return safeParse(
350
294
  jsonString,
351
- (x) => SubscriptionPrice$inboundSchema.parse(JSON.parse(x)),
352
- `Failed to parse 'SubscriptionPrice' from JSON`,
295
+ (x) => CustomFieldData$inboundSchema.parse(JSON.parse(x)),
296
+ `Failed to parse 'CustomFieldData' from JSON`,
353
297
  );
354
298
  }
355
299
 
@@ -415,6 +359,111 @@ export function subscriptionDiscountFromJSON(
415
359
  );
416
360
  }
417
361
 
362
+ /** @internal */
363
+ export const Price$inboundSchema: z.ZodType<Price, z.ZodTypeDef, unknown> = z
364
+ .union([
365
+ LegacyRecurringProductPrice$inboundSchema,
366
+ ProductPrice$inboundSchema,
367
+ ]);
368
+
369
+ /** @internal */
370
+ export type Price$Outbound =
371
+ | LegacyRecurringProductPrice$Outbound
372
+ | ProductPrice$Outbound;
373
+
374
+ /** @internal */
375
+ export const Price$outboundSchema: z.ZodType<
376
+ Price$Outbound,
377
+ z.ZodTypeDef,
378
+ Price
379
+ > = z.union([
380
+ LegacyRecurringProductPrice$outboundSchema,
381
+ ProductPrice$outboundSchema,
382
+ ]);
383
+
384
+ /**
385
+ * @internal
386
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
387
+ */
388
+ export namespace Price$ {
389
+ /** @deprecated use `Price$inboundSchema` instead. */
390
+ export const inboundSchema = Price$inboundSchema;
391
+ /** @deprecated use `Price$outboundSchema` instead. */
392
+ export const outboundSchema = Price$outboundSchema;
393
+ /** @deprecated use `Price$Outbound` instead. */
394
+ export type Outbound = Price$Outbound;
395
+ }
396
+
397
+ export function priceToJSON(price: Price): string {
398
+ return JSON.stringify(Price$outboundSchema.parse(price));
399
+ }
400
+
401
+ export function priceFromJSON(
402
+ jsonString: string,
403
+ ): SafeParseResult<Price, SDKValidationError> {
404
+ return safeParse(
405
+ jsonString,
406
+ (x) => Price$inboundSchema.parse(JSON.parse(x)),
407
+ `Failed to parse 'Price' from JSON`,
408
+ );
409
+ }
410
+
411
+ /** @internal */
412
+ export const SubscriptionPrices$inboundSchema: z.ZodType<
413
+ SubscriptionPrices,
414
+ z.ZodTypeDef,
415
+ unknown
416
+ > = z.union([
417
+ LegacyRecurringProductPrice$inboundSchema,
418
+ ProductPrice$inboundSchema,
419
+ ]);
420
+
421
+ /** @internal */
422
+ export type SubscriptionPrices$Outbound =
423
+ | LegacyRecurringProductPrice$Outbound
424
+ | ProductPrice$Outbound;
425
+
426
+ /** @internal */
427
+ export const SubscriptionPrices$outboundSchema: z.ZodType<
428
+ SubscriptionPrices$Outbound,
429
+ z.ZodTypeDef,
430
+ SubscriptionPrices
431
+ > = z.union([
432
+ LegacyRecurringProductPrice$outboundSchema,
433
+ ProductPrice$outboundSchema,
434
+ ]);
435
+
436
+ /**
437
+ * @internal
438
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
439
+ */
440
+ export namespace SubscriptionPrices$ {
441
+ /** @deprecated use `SubscriptionPrices$inboundSchema` instead. */
442
+ export const inboundSchema = SubscriptionPrices$inboundSchema;
443
+ /** @deprecated use `SubscriptionPrices$outboundSchema` instead. */
444
+ export const outboundSchema = SubscriptionPrices$outboundSchema;
445
+ /** @deprecated use `SubscriptionPrices$Outbound` instead. */
446
+ export type Outbound = SubscriptionPrices$Outbound;
447
+ }
448
+
449
+ export function subscriptionPricesToJSON(
450
+ subscriptionPrices: SubscriptionPrices,
451
+ ): string {
452
+ return JSON.stringify(
453
+ SubscriptionPrices$outboundSchema.parse(subscriptionPrices),
454
+ );
455
+ }
456
+
457
+ export function subscriptionPricesFromJSON(
458
+ jsonString: string,
459
+ ): SafeParseResult<SubscriptionPrices, SDKValidationError> {
460
+ return safeParse(
461
+ jsonString,
462
+ (x) => SubscriptionPrices$inboundSchema.parse(JSON.parse(x)),
463
+ `Failed to parse 'SubscriptionPrices' from JSON`,
464
+ );
465
+ }
466
+
418
467
  /** @internal */
419
468
  export const Subscription$inboundSchema: z.ZodType<
420
469
  Subscription,
@@ -426,8 +475,8 @@ export const Subscription$inboundSchema: z.ZodType<
426
475
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
427
476
  ),
428
477
  id: z.string(),
429
- amount: z.nullable(z.number().int()),
430
- currency: z.nullable(z.string()),
478
+ amount: z.number().int(),
479
+ currency: z.string(),
431
480
  recurring_interval: SubscriptionRecurringInterval$inboundSchema,
432
481
  status: SubscriptionStatus$inboundSchema,
433
482
  current_period_start: z.string().datetime({ offset: true }).transform(v =>
@@ -451,13 +500,13 @@ export const Subscription$inboundSchema: z.ZodType<
451
500
  ),
452
501
  customer_id: z.string(),
453
502
  product_id: z.string(),
454
- price_id: z.string(),
455
503
  discount_id: z.nullable(z.string()),
456
504
  checkout_id: z.nullable(z.string()),
457
505
  customer_cancellation_reason: z.nullable(
458
506
  CustomerCancellationReason$inboundSchema,
459
507
  ),
460
508
  customer_cancellation_comment: z.nullable(z.string()),
509
+ price_id: z.string(),
461
510
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
462
511
  custom_field_data: z.record(
463
512
  z.nullable(
@@ -473,10 +522,6 @@ export const Subscription$inboundSchema: z.ZodType<
473
522
  user_id: z.string(),
474
523
  user: SubscriptionUser$inboundSchema,
475
524
  product: Product$inboundSchema,
476
- price: z.union([
477
- LegacyRecurringProductPrice$inboundSchema,
478
- ProductPrice$inboundSchema,
479
- ]),
480
525
  discount: z.nullable(
481
526
  z.union([
482
527
  DiscountPercentageOnceForeverDurationBase$inboundSchema,
@@ -485,6 +530,16 @@ export const Subscription$inboundSchema: z.ZodType<
485
530
  DiscountFixedRepeatDurationBase$inboundSchema,
486
531
  ]),
487
532
  ),
533
+ price: z.union([
534
+ LegacyRecurringProductPrice$inboundSchema,
535
+ ProductPrice$inboundSchema,
536
+ ]),
537
+ prices: z.array(
538
+ z.union([
539
+ LegacyRecurringProductPrice$inboundSchema,
540
+ ProductPrice$inboundSchema,
541
+ ]),
542
+ ),
488
543
  }).transform((v) => {
489
544
  return remap$(v, {
490
545
  "created_at": "createdAt",
@@ -499,11 +554,11 @@ export const Subscription$inboundSchema: z.ZodType<
499
554
  "ended_at": "endedAt",
500
555
  "customer_id": "customerId",
501
556
  "product_id": "productId",
502
- "price_id": "priceId",
503
557
  "discount_id": "discountId",
504
558
  "checkout_id": "checkoutId",
505
559
  "customer_cancellation_reason": "customerCancellationReason",
506
560
  "customer_cancellation_comment": "customerCancellationComment",
561
+ "price_id": "priceId",
507
562
  "custom_field_data": "customFieldData",
508
563
  "user_id": "userId",
509
564
  });
@@ -514,8 +569,8 @@ export type Subscription$Outbound = {
514
569
  created_at: string;
515
570
  modified_at: string | null;
516
571
  id: string;
517
- amount: number | null;
518
- currency: string | null;
572
+ amount: number;
573
+ currency: string;
519
574
  recurring_interval: string;
520
575
  status: string;
521
576
  current_period_start: string;
@@ -527,11 +582,11 @@ export type Subscription$Outbound = {
527
582
  ended_at: string | null;
528
583
  customer_id: string;
529
584
  product_id: string;
530
- price_id: string;
531
585
  discount_id: string | null;
532
586
  checkout_id: string | null;
533
587
  customer_cancellation_reason: string | null;
534
588
  customer_cancellation_comment: string | null;
589
+ price_id: string;
535
590
  metadata: { [k: string]: string | number | boolean };
536
591
  custom_field_data?:
537
592
  | { [k: string]: string | number | boolean | string | null }
@@ -540,13 +595,14 @@ export type Subscription$Outbound = {
540
595
  user_id: string;
541
596
  user: SubscriptionUser$Outbound;
542
597
  product: Product$Outbound;
543
- price: LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound;
544
598
  discount:
545
599
  | DiscountPercentageOnceForeverDurationBase$Outbound
546
600
  | DiscountFixedOnceForeverDurationBase$Outbound
547
601
  | DiscountPercentageRepeatDurationBase$Outbound
548
602
  | DiscountFixedRepeatDurationBase$Outbound
549
603
  | null;
604
+ price: LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound;
605
+ prices: Array<LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound>;
550
606
  };
551
607
 
552
608
  /** @internal */
@@ -558,8 +614,8 @@ export const Subscription$outboundSchema: z.ZodType<
558
614
  createdAt: z.date().transform(v => v.toISOString()),
559
615
  modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
560
616
  id: z.string(),
561
- amount: z.nullable(z.number().int()),
562
- currency: z.nullable(z.string()),
617
+ amount: z.number().int(),
618
+ currency: z.string(),
563
619
  recurringInterval: SubscriptionRecurringInterval$outboundSchema,
564
620
  status: SubscriptionStatus$outboundSchema,
565
621
  currentPeriodStart: z.date().transform(v => v.toISOString()),
@@ -571,13 +627,13 @@ export const Subscription$outboundSchema: z.ZodType<
571
627
  endedAt: z.nullable(z.date().transform(v => v.toISOString())),
572
628
  customerId: z.string(),
573
629
  productId: z.string(),
574
- priceId: z.string(),
575
630
  discountId: z.nullable(z.string()),
576
631
  checkoutId: z.nullable(z.string()),
577
632
  customerCancellationReason: z.nullable(
578
633
  CustomerCancellationReason$outboundSchema,
579
634
  ),
580
635
  customerCancellationComment: z.nullable(z.string()),
636
+ priceId: z.string(),
581
637
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
582
638
  customFieldData: z.record(
583
639
  z.nullable(
@@ -593,10 +649,6 @@ export const Subscription$outboundSchema: z.ZodType<
593
649
  userId: z.string(),
594
650
  user: SubscriptionUser$outboundSchema,
595
651
  product: Product$outboundSchema,
596
- price: z.union([
597
- LegacyRecurringProductPrice$outboundSchema,
598
- ProductPrice$outboundSchema,
599
- ]),
600
652
  discount: z.nullable(
601
653
  z.union([
602
654
  DiscountPercentageOnceForeverDurationBase$outboundSchema,
@@ -605,6 +657,16 @@ export const Subscription$outboundSchema: z.ZodType<
605
657
  DiscountFixedRepeatDurationBase$outboundSchema,
606
658
  ]),
607
659
  ),
660
+ price: z.union([
661
+ LegacyRecurringProductPrice$outboundSchema,
662
+ ProductPrice$outboundSchema,
663
+ ]),
664
+ prices: z.array(
665
+ z.union([
666
+ LegacyRecurringProductPrice$outboundSchema,
667
+ ProductPrice$outboundSchema,
668
+ ]),
669
+ ),
608
670
  }).transform((v) => {
609
671
  return remap$(v, {
610
672
  createdAt: "created_at",
@@ -619,11 +681,11 @@ export const Subscription$outboundSchema: z.ZodType<
619
681
  endedAt: "ended_at",
620
682
  customerId: "customer_id",
621
683
  productId: "product_id",
622
- priceId: "price_id",
623
684
  discountId: "discount_id",
624
685
  checkoutId: "checkout_id",
625
686
  customerCancellationReason: "customer_cancellation_reason",
626
687
  customerCancellationComment: "customer_cancellation_comment",
688
+ priceId: "price_id",
627
689
  customFieldData: "custom_field_data",
628
690
  userId: "user_id",
629
691
  });
@@ -21,7 +21,7 @@ import {
21
21
 
22
22
  export type SubscriptionCustomerMetadata = string | number | boolean;
23
23
 
24
- export type SubscriptionCustomerTaxId = string | TaxIDFormat;
24
+ export type TaxId = string | TaxIDFormat;
25
25
 
26
26
  export type SubscriptionCustomer = {
27
27
  /**
@@ -59,6 +59,10 @@ export type SubscriptionCustomer = {
59
59
  * The ID of the organization owning the customer.
60
60
  */
61
61
  organizationId: string;
62
+ /**
63
+ * Timestamp for when the customer was soft deleted.
64
+ */
65
+ deletedAt: Date | null;
62
66
  avatarUrl: string;
63
67
  };
64
68
 
@@ -113,50 +117,43 @@ export function subscriptionCustomerMetadataFromJSON(
113
117
  }
114
118
 
115
119
  /** @internal */
116
- export const SubscriptionCustomerTaxId$inboundSchema: z.ZodType<
117
- SubscriptionCustomerTaxId,
118
- z.ZodTypeDef,
119
- unknown
120
- > = z.union([z.string(), TaxIDFormat$inboundSchema]);
120
+ export const TaxId$inboundSchema: z.ZodType<TaxId, z.ZodTypeDef, unknown> = z
121
+ .union([z.string(), TaxIDFormat$inboundSchema]);
121
122
 
122
123
  /** @internal */
123
- export type SubscriptionCustomerTaxId$Outbound = string | string;
124
+ export type TaxId$Outbound = string | string;
124
125
 
125
126
  /** @internal */
126
- export const SubscriptionCustomerTaxId$outboundSchema: z.ZodType<
127
- SubscriptionCustomerTaxId$Outbound,
127
+ export const TaxId$outboundSchema: z.ZodType<
128
+ TaxId$Outbound,
128
129
  z.ZodTypeDef,
129
- SubscriptionCustomerTaxId
130
+ TaxId
130
131
  > = z.union([z.string(), TaxIDFormat$outboundSchema]);
131
132
 
132
133
  /**
133
134
  * @internal
134
135
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
135
136
  */
136
- export namespace SubscriptionCustomerTaxId$ {
137
- /** @deprecated use `SubscriptionCustomerTaxId$inboundSchema` instead. */
138
- export const inboundSchema = SubscriptionCustomerTaxId$inboundSchema;
139
- /** @deprecated use `SubscriptionCustomerTaxId$outboundSchema` instead. */
140
- export const outboundSchema = SubscriptionCustomerTaxId$outboundSchema;
141
- /** @deprecated use `SubscriptionCustomerTaxId$Outbound` instead. */
142
- export type Outbound = SubscriptionCustomerTaxId$Outbound;
137
+ export namespace TaxId$ {
138
+ /** @deprecated use `TaxId$inboundSchema` instead. */
139
+ export const inboundSchema = TaxId$inboundSchema;
140
+ /** @deprecated use `TaxId$outboundSchema` instead. */
141
+ export const outboundSchema = TaxId$outboundSchema;
142
+ /** @deprecated use `TaxId$Outbound` instead. */
143
+ export type Outbound = TaxId$Outbound;
143
144
  }
144
145
 
145
- export function subscriptionCustomerTaxIdToJSON(
146
- subscriptionCustomerTaxId: SubscriptionCustomerTaxId,
147
- ): string {
148
- return JSON.stringify(
149
- SubscriptionCustomerTaxId$outboundSchema.parse(subscriptionCustomerTaxId),
150
- );
146
+ export function taxIdToJSON(taxId: TaxId): string {
147
+ return JSON.stringify(TaxId$outboundSchema.parse(taxId));
151
148
  }
152
149
 
153
- export function subscriptionCustomerTaxIdFromJSON(
150
+ export function taxIdFromJSON(
154
151
  jsonString: string,
155
- ): SafeParseResult<SubscriptionCustomerTaxId, SDKValidationError> {
152
+ ): SafeParseResult<TaxId, SDKValidationError> {
156
153
  return safeParse(
157
154
  jsonString,
158
- (x) => SubscriptionCustomerTaxId$inboundSchema.parse(JSON.parse(x)),
159
- `Failed to parse 'SubscriptionCustomerTaxId' from JSON`,
155
+ (x) => TaxId$inboundSchema.parse(JSON.parse(x)),
156
+ `Failed to parse 'TaxId' from JSON`,
160
157
  );
161
158
  }
162
159
 
@@ -181,6 +178,9 @@ export const SubscriptionCustomer$inboundSchema: z.ZodType<
181
178
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$inboundSchema]))),
182
179
  ),
183
180
  organization_id: z.string(),
181
+ deleted_at: z.nullable(
182
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
183
+ ),
184
184
  avatar_url: z.string(),
185
185
  }).transform((v) => {
186
186
  return remap$(v, {
@@ -191,6 +191,7 @@ export const SubscriptionCustomer$inboundSchema: z.ZodType<
191
191
  "billing_address": "billingAddress",
192
192
  "tax_id": "taxId",
193
193
  "organization_id": "organizationId",
194
+ "deleted_at": "deletedAt",
194
195
  "avatar_url": "avatarUrl",
195
196
  });
196
197
  });
@@ -208,6 +209,7 @@ export type SubscriptionCustomer$Outbound = {
208
209
  billing_address: Address$Outbound | null;
209
210
  tax_id: Array<string | string | null> | null;
210
211
  organization_id: string;
212
+ deleted_at: string | null;
211
213
  avatar_url: string;
212
214
  };
213
215
 
@@ -230,6 +232,7 @@ export const SubscriptionCustomer$outboundSchema: z.ZodType<
230
232
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$outboundSchema]))),
231
233
  ),
232
234
  organizationId: z.string(),
235
+ deletedAt: z.nullable(z.date().transform(v => v.toISOString())),
233
236
  avatarUrl: z.string(),
234
237
  }).transform((v) => {
235
238
  return remap$(v, {
@@ -240,6 +243,7 @@ export const SubscriptionCustomer$outboundSchema: z.ZodType<
240
243
  billingAddress: "billing_address",
241
244
  taxId: "tax_id",
242
245
  organizationId: "organization_id",
246
+ deletedAt: "deleted_at",
243
247
  avatarUrl: "avatar_url",
244
248
  });
245
249
  });