@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
@@ -79,6 +79,10 @@ export type CustomerState = {
79
79
  * The ID of the organization owning the customer.
80
80
  */
81
81
  organizationId: string;
82
+ /**
83
+ * Timestamp for when the customer was soft deleted.
84
+ */
85
+ deletedAt: Date | null;
82
86
  /**
83
87
  * The customer's active subscriptions.
84
88
  */
@@ -207,6 +211,9 @@ export const CustomerState$inboundSchema: z.ZodType<
207
211
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$inboundSchema]))),
208
212
  ),
209
213
  organization_id: z.string(),
214
+ deleted_at: z.nullable(
215
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
216
+ ),
210
217
  active_subscriptions: z.array(CustomerStateSubscription$inboundSchema),
211
218
  granted_benefits: z.array(CustomerStateBenefitGrant$inboundSchema),
212
219
  avatar_url: z.string(),
@@ -219,6 +226,7 @@ export const CustomerState$inboundSchema: z.ZodType<
219
226
  "billing_address": "billingAddress",
220
227
  "tax_id": "taxId",
221
228
  "organization_id": "organizationId",
229
+ "deleted_at": "deletedAt",
222
230
  "active_subscriptions": "activeSubscriptions",
223
231
  "granted_benefits": "grantedBenefits",
224
232
  "avatar_url": "avatarUrl",
@@ -238,6 +246,7 @@ export type CustomerState$Outbound = {
238
246
  billing_address: Address$Outbound | null;
239
247
  tax_id: Array<string | string | null> | null;
240
248
  organization_id: string;
249
+ deleted_at: string | null;
241
250
  active_subscriptions: Array<CustomerStateSubscription$Outbound>;
242
251
  granted_benefits: Array<CustomerStateBenefitGrant$Outbound>;
243
252
  avatar_url: string;
@@ -262,6 +271,7 @@ export const CustomerState$outboundSchema: z.ZodType<
262
271
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$outboundSchema]))),
263
272
  ),
264
273
  organizationId: z.string(),
274
+ deletedAt: z.nullable(z.date().transform(v => v.toISOString())),
265
275
  activeSubscriptions: z.array(CustomerStateSubscription$outboundSchema),
266
276
  grantedBenefits: z.array(CustomerStateBenefitGrant$outboundSchema),
267
277
  avatarUrl: z.string(),
@@ -274,6 +284,7 @@ export const CustomerState$outboundSchema: z.ZodType<
274
284
  billingAddress: "billing_address",
275
285
  taxId: "tax_id",
276
286
  organizationId: "organization_id",
287
+ deletedAt: "deleted_at",
277
288
  activeSubscriptions: "active_subscriptions",
278
289
  grantedBenefits: "granted_benefits",
279
290
  avatarUrl: "avatar_url",
@@ -48,11 +48,11 @@ export type CustomerStateSubscription = {
48
48
  /**
49
49
  * The amount of the subscription.
50
50
  */
51
- amount: number | null;
51
+ amount: number;
52
52
  /**
53
53
  * The currency of the subscription.
54
54
  */
55
- currency: string | null;
55
+ currency: string;
56
56
  recurringInterval: SubscriptionRecurringInterval;
57
57
  /**
58
58
  * The start timestamp of the current billing period.
@@ -82,14 +82,14 @@ export type CustomerStateSubscription = {
82
82
  * The ID of the subscribed product.
83
83
  */
84
84
  productId: string;
85
- /**
86
- * The ID of the subscribed price.
87
- */
88
- priceId: string;
89
85
  /**
90
86
  * The ID of the applied discount, if any.
91
87
  */
92
88
  discountId: string | null;
89
+ /**
90
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
91
+ */
92
+ priceId: string;
93
93
  };
94
94
 
95
95
  /** @internal */
@@ -242,8 +242,8 @@ export const CustomerStateSubscription$inboundSchema: z.ZodType<
242
242
  ).optional(),
243
243
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
244
244
  status: z.literal("active").optional(),
245
- amount: z.nullable(z.number().int()),
246
- currency: z.nullable(z.string()),
245
+ amount: z.number().int(),
246
+ currency: z.string(),
247
247
  recurring_interval: SubscriptionRecurringInterval$inboundSchema,
248
248
  current_period_start: z.string().datetime({ offset: true }).transform(v =>
249
249
  new Date(v)
@@ -262,8 +262,8 @@ export const CustomerStateSubscription$inboundSchema: z.ZodType<
262
262
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
263
263
  ),
264
264
  product_id: z.string(),
265
- price_id: z.string(),
266
265
  discount_id: z.nullable(z.string()),
266
+ price_id: z.string(),
267
267
  }).transform((v) => {
268
268
  return remap$(v, {
269
269
  "created_at": "createdAt",
@@ -277,8 +277,8 @@ export const CustomerStateSubscription$inboundSchema: z.ZodType<
277
277
  "started_at": "startedAt",
278
278
  "ends_at": "endsAt",
279
279
  "product_id": "productId",
280
- "price_id": "priceId",
281
280
  "discount_id": "discountId",
281
+ "price_id": "priceId",
282
282
  });
283
283
  });
284
284
 
@@ -292,8 +292,8 @@ export type CustomerStateSubscription$Outbound = {
292
292
  | undefined;
293
293
  metadata: { [k: string]: string | number | boolean };
294
294
  status: "active";
295
- amount: number | null;
296
- currency: string | null;
295
+ amount: number;
296
+ currency: string;
297
297
  recurring_interval: string;
298
298
  current_period_start: string;
299
299
  current_period_end: string | null;
@@ -302,8 +302,8 @@ export type CustomerStateSubscription$Outbound = {
302
302
  started_at: string | null;
303
303
  ends_at: string | null;
304
304
  product_id: string;
305
- price_id: string;
306
305
  discount_id: string | null;
306
+ price_id: string;
307
307
  };
308
308
 
309
309
  /** @internal */
@@ -327,8 +327,8 @@ export const CustomerStateSubscription$outboundSchema: z.ZodType<
327
327
  ).optional(),
328
328
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
329
329
  status: z.literal("active").default("active" as const),
330
- amount: z.nullable(z.number().int()),
331
- currency: z.nullable(z.string()),
330
+ amount: z.number().int(),
331
+ currency: z.string(),
332
332
  recurringInterval: SubscriptionRecurringInterval$outboundSchema,
333
333
  currentPeriodStart: z.date().transform(v => v.toISOString()),
334
334
  currentPeriodEnd: z.nullable(z.date().transform(v => v.toISOString())),
@@ -337,8 +337,8 @@ export const CustomerStateSubscription$outboundSchema: z.ZodType<
337
337
  startedAt: z.nullable(z.date().transform(v => v.toISOString())),
338
338
  endsAt: z.nullable(z.date().transform(v => v.toISOString())),
339
339
  productId: z.string(),
340
- priceId: z.string(),
341
340
  discountId: z.nullable(z.string()),
341
+ priceId: z.string(),
342
342
  }).transform((v) => {
343
343
  return remap$(v, {
344
344
  createdAt: "created_at",
@@ -352,8 +352,8 @@ export const CustomerStateSubscription$outboundSchema: z.ZodType<
352
352
  startedAt: "started_at",
353
353
  endsAt: "ends_at",
354
354
  productId: "product_id",
355
- priceId: "price_id",
356
355
  discountId: "discount_id",
356
+ priceId: "price_id",
357
357
  });
358
358
  });
359
359
 
@@ -41,7 +41,16 @@ import {
41
41
  SubscriptionStatus$outboundSchema,
42
42
  } from "./subscriptionstatus.js";
43
43
 
44
- export type Price = LegacyRecurringProductPrice | ProductPrice;
44
+ /**
45
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
46
+ */
47
+ export type CustomerSubscriptionPrice =
48
+ | LegacyRecurringProductPrice
49
+ | ProductPrice;
50
+
51
+ export type CustomerSubscriptionPrices =
52
+ | LegacyRecurringProductPrice
53
+ | ProductPrice;
45
54
 
46
55
  export type CustomerSubscription = {
47
56
  /**
@@ -59,23 +68,49 @@ export type CustomerSubscription = {
59
68
  /**
60
69
  * The amount of the subscription.
61
70
  */
62
- amount: number | null;
71
+ amount: number;
63
72
  /**
64
73
  * The currency of the subscription.
65
74
  */
66
- currency: string | null;
75
+ currency: string;
67
76
  recurringInterval: SubscriptionRecurringInterval;
68
77
  status: SubscriptionStatus;
78
+ /**
79
+ * The start timestamp of the current billing period.
80
+ */
69
81
  currentPeriodStart: Date;
82
+ /**
83
+ * The end timestamp of the current billing period.
84
+ */
70
85
  currentPeriodEnd: Date | null;
86
+ /**
87
+ * Whether the subscription will be canceled at the end of the current period.
88
+ */
71
89
  cancelAtPeriodEnd: boolean;
90
+ /**
91
+ * The timestamp when the subscription was canceled. The subscription might still be active if `cancel_at_period_end` is `true`.
92
+ */
72
93
  canceledAt: Date | null;
94
+ /**
95
+ * The timestamp when the subscription started.
96
+ */
73
97
  startedAt: Date | null;
98
+ /**
99
+ * The timestamp when the subscription will end.
100
+ */
74
101
  endsAt: Date | null;
102
+ /**
103
+ * The timestamp when the subscription ended.
104
+ */
75
105
  endedAt: Date | null;
106
+ /**
107
+ * The ID of the subscribed customer.
108
+ */
76
109
  customerId: string;
110
+ /**
111
+ * The ID of the subscribed product.
112
+ */
77
113
  productId: string;
78
- priceId: string;
79
114
  /**
80
115
  * The ID of the applied discount, if any.
81
116
  */
@@ -83,31 +118,101 @@ export type CustomerSubscription = {
83
118
  checkoutId: string | null;
84
119
  customerCancellationReason: CustomerCancellationReason | null;
85
120
  customerCancellationComment: string | null;
121
+ /**
122
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
123
+ */
124
+ priceId: string;
86
125
  /**
87
126
  * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
88
127
  */
89
128
  userId: string;
90
129
  product: CustomerSubscriptionProduct;
130
+ /**
131
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
132
+ */
91
133
  price: LegacyRecurringProductPrice | ProductPrice;
134
+ /**
135
+ * List of enabled prices for the subscription.
136
+ */
137
+ prices: Array<LegacyRecurringProductPrice | ProductPrice>;
92
138
  };
93
139
 
94
140
  /** @internal */
95
- export const Price$inboundSchema: z.ZodType<Price, z.ZodTypeDef, unknown> = z
96
- .union([
97
- LegacyRecurringProductPrice$inboundSchema,
98
- ProductPrice$inboundSchema,
99
- ]);
141
+ export const CustomerSubscriptionPrice$inboundSchema: z.ZodType<
142
+ CustomerSubscriptionPrice,
143
+ z.ZodTypeDef,
144
+ unknown
145
+ > = z.union([
146
+ LegacyRecurringProductPrice$inboundSchema,
147
+ ProductPrice$inboundSchema,
148
+ ]);
149
+
150
+ /** @internal */
151
+ export type CustomerSubscriptionPrice$Outbound =
152
+ | LegacyRecurringProductPrice$Outbound
153
+ | ProductPrice$Outbound;
154
+
155
+ /** @internal */
156
+ export const CustomerSubscriptionPrice$outboundSchema: z.ZodType<
157
+ CustomerSubscriptionPrice$Outbound,
158
+ z.ZodTypeDef,
159
+ CustomerSubscriptionPrice
160
+ > = z.union([
161
+ LegacyRecurringProductPrice$outboundSchema,
162
+ ProductPrice$outboundSchema,
163
+ ]);
164
+
165
+ /**
166
+ * @internal
167
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
168
+ */
169
+ export namespace CustomerSubscriptionPrice$ {
170
+ /** @deprecated use `CustomerSubscriptionPrice$inboundSchema` instead. */
171
+ export const inboundSchema = CustomerSubscriptionPrice$inboundSchema;
172
+ /** @deprecated use `CustomerSubscriptionPrice$outboundSchema` instead. */
173
+ export const outboundSchema = CustomerSubscriptionPrice$outboundSchema;
174
+ /** @deprecated use `CustomerSubscriptionPrice$Outbound` instead. */
175
+ export type Outbound = CustomerSubscriptionPrice$Outbound;
176
+ }
177
+
178
+ export function customerSubscriptionPriceToJSON(
179
+ customerSubscriptionPrice: CustomerSubscriptionPrice,
180
+ ): string {
181
+ return JSON.stringify(
182
+ CustomerSubscriptionPrice$outboundSchema.parse(customerSubscriptionPrice),
183
+ );
184
+ }
185
+
186
+ export function customerSubscriptionPriceFromJSON(
187
+ jsonString: string,
188
+ ): SafeParseResult<CustomerSubscriptionPrice, SDKValidationError> {
189
+ return safeParse(
190
+ jsonString,
191
+ (x) => CustomerSubscriptionPrice$inboundSchema.parse(JSON.parse(x)),
192
+ `Failed to parse 'CustomerSubscriptionPrice' from JSON`,
193
+ );
194
+ }
100
195
 
101
196
  /** @internal */
102
- export type Price$Outbound =
197
+ export const CustomerSubscriptionPrices$inboundSchema: z.ZodType<
198
+ CustomerSubscriptionPrices,
199
+ z.ZodTypeDef,
200
+ unknown
201
+ > = z.union([
202
+ LegacyRecurringProductPrice$inboundSchema,
203
+ ProductPrice$inboundSchema,
204
+ ]);
205
+
206
+ /** @internal */
207
+ export type CustomerSubscriptionPrices$Outbound =
103
208
  | LegacyRecurringProductPrice$Outbound
104
209
  | ProductPrice$Outbound;
105
210
 
106
211
  /** @internal */
107
- export const Price$outboundSchema: z.ZodType<
108
- Price$Outbound,
212
+ export const CustomerSubscriptionPrices$outboundSchema: z.ZodType<
213
+ CustomerSubscriptionPrices$Outbound,
109
214
  z.ZodTypeDef,
110
- Price
215
+ CustomerSubscriptionPrices
111
216
  > = z.union([
112
217
  LegacyRecurringProductPrice$outboundSchema,
113
218
  ProductPrice$outboundSchema,
@@ -117,26 +222,30 @@ export const Price$outboundSchema: z.ZodType<
117
222
  * @internal
118
223
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
119
224
  */
120
- export namespace Price$ {
121
- /** @deprecated use `Price$inboundSchema` instead. */
122
- export const inboundSchema = Price$inboundSchema;
123
- /** @deprecated use `Price$outboundSchema` instead. */
124
- export const outboundSchema = Price$outboundSchema;
125
- /** @deprecated use `Price$Outbound` instead. */
126
- export type Outbound = Price$Outbound;
225
+ export namespace CustomerSubscriptionPrices$ {
226
+ /** @deprecated use `CustomerSubscriptionPrices$inboundSchema` instead. */
227
+ export const inboundSchema = CustomerSubscriptionPrices$inboundSchema;
228
+ /** @deprecated use `CustomerSubscriptionPrices$outboundSchema` instead. */
229
+ export const outboundSchema = CustomerSubscriptionPrices$outboundSchema;
230
+ /** @deprecated use `CustomerSubscriptionPrices$Outbound` instead. */
231
+ export type Outbound = CustomerSubscriptionPrices$Outbound;
127
232
  }
128
233
 
129
- export function priceToJSON(price: Price): string {
130
- return JSON.stringify(Price$outboundSchema.parse(price));
234
+ export function customerSubscriptionPricesToJSON(
235
+ customerSubscriptionPrices: CustomerSubscriptionPrices,
236
+ ): string {
237
+ return JSON.stringify(
238
+ CustomerSubscriptionPrices$outboundSchema.parse(customerSubscriptionPrices),
239
+ );
131
240
  }
132
241
 
133
- export function priceFromJSON(
242
+ export function customerSubscriptionPricesFromJSON(
134
243
  jsonString: string,
135
- ): SafeParseResult<Price, SDKValidationError> {
244
+ ): SafeParseResult<CustomerSubscriptionPrices, SDKValidationError> {
136
245
  return safeParse(
137
246
  jsonString,
138
- (x) => Price$inboundSchema.parse(JSON.parse(x)),
139
- `Failed to parse 'Price' from JSON`,
247
+ (x) => CustomerSubscriptionPrices$inboundSchema.parse(JSON.parse(x)),
248
+ `Failed to parse 'CustomerSubscriptionPrices' from JSON`,
140
249
  );
141
250
  }
142
251
 
@@ -151,8 +260,8 @@ export const CustomerSubscription$inboundSchema: z.ZodType<
151
260
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
152
261
  ),
153
262
  id: z.string(),
154
- amount: z.nullable(z.number().int()),
155
- currency: z.nullable(z.string()),
263
+ amount: z.number().int(),
264
+ currency: z.string(),
156
265
  recurring_interval: SubscriptionRecurringInterval$inboundSchema,
157
266
  status: SubscriptionStatus$inboundSchema,
158
267
  current_period_start: z.string().datetime({ offset: true }).transform(v =>
@@ -176,19 +285,25 @@ export const CustomerSubscription$inboundSchema: z.ZodType<
176
285
  ),
177
286
  customer_id: z.string(),
178
287
  product_id: z.string(),
179
- price_id: z.string(),
180
288
  discount_id: z.nullable(z.string()),
181
289
  checkout_id: z.nullable(z.string()),
182
290
  customer_cancellation_reason: z.nullable(
183
291
  CustomerCancellationReason$inboundSchema,
184
292
  ),
185
293
  customer_cancellation_comment: z.nullable(z.string()),
294
+ price_id: z.string(),
186
295
  user_id: z.string(),
187
296
  product: CustomerSubscriptionProduct$inboundSchema,
188
297
  price: z.union([
189
298
  LegacyRecurringProductPrice$inboundSchema,
190
299
  ProductPrice$inboundSchema,
191
300
  ]),
301
+ prices: z.array(
302
+ z.union([
303
+ LegacyRecurringProductPrice$inboundSchema,
304
+ ProductPrice$inboundSchema,
305
+ ]),
306
+ ),
192
307
  }).transform((v) => {
193
308
  return remap$(v, {
194
309
  "created_at": "createdAt",
@@ -203,11 +318,11 @@ export const CustomerSubscription$inboundSchema: z.ZodType<
203
318
  "ended_at": "endedAt",
204
319
  "customer_id": "customerId",
205
320
  "product_id": "productId",
206
- "price_id": "priceId",
207
321
  "discount_id": "discountId",
208
322
  "checkout_id": "checkoutId",
209
323
  "customer_cancellation_reason": "customerCancellationReason",
210
324
  "customer_cancellation_comment": "customerCancellationComment",
325
+ "price_id": "priceId",
211
326
  "user_id": "userId",
212
327
  });
213
328
  });
@@ -217,8 +332,8 @@ export type CustomerSubscription$Outbound = {
217
332
  created_at: string;
218
333
  modified_at: string | null;
219
334
  id: string;
220
- amount: number | null;
221
- currency: string | null;
335
+ amount: number;
336
+ currency: string;
222
337
  recurring_interval: string;
223
338
  status: string;
224
339
  current_period_start: string;
@@ -230,14 +345,15 @@ export type CustomerSubscription$Outbound = {
230
345
  ended_at: string | null;
231
346
  customer_id: string;
232
347
  product_id: string;
233
- price_id: string;
234
348
  discount_id: string | null;
235
349
  checkout_id: string | null;
236
350
  customer_cancellation_reason: string | null;
237
351
  customer_cancellation_comment: string | null;
352
+ price_id: string;
238
353
  user_id: string;
239
354
  product: CustomerSubscriptionProduct$Outbound;
240
355
  price: LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound;
356
+ prices: Array<LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound>;
241
357
  };
242
358
 
243
359
  /** @internal */
@@ -249,8 +365,8 @@ export const CustomerSubscription$outboundSchema: z.ZodType<
249
365
  createdAt: z.date().transform(v => v.toISOString()),
250
366
  modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
251
367
  id: z.string(),
252
- amount: z.nullable(z.number().int()),
253
- currency: z.nullable(z.string()),
368
+ amount: z.number().int(),
369
+ currency: z.string(),
254
370
  recurringInterval: SubscriptionRecurringInterval$outboundSchema,
255
371
  status: SubscriptionStatus$outboundSchema,
256
372
  currentPeriodStart: z.date().transform(v => v.toISOString()),
@@ -262,19 +378,25 @@ export const CustomerSubscription$outboundSchema: z.ZodType<
262
378
  endedAt: z.nullable(z.date().transform(v => v.toISOString())),
263
379
  customerId: z.string(),
264
380
  productId: z.string(),
265
- priceId: z.string(),
266
381
  discountId: z.nullable(z.string()),
267
382
  checkoutId: z.nullable(z.string()),
268
383
  customerCancellationReason: z.nullable(
269
384
  CustomerCancellationReason$outboundSchema,
270
385
  ),
271
386
  customerCancellationComment: z.nullable(z.string()),
387
+ priceId: z.string(),
272
388
  userId: z.string(),
273
389
  product: CustomerSubscriptionProduct$outboundSchema,
274
390
  price: z.union([
275
391
  LegacyRecurringProductPrice$outboundSchema,
276
392
  ProductPrice$outboundSchema,
277
393
  ]),
394
+ prices: z.array(
395
+ z.union([
396
+ LegacyRecurringProductPrice$outboundSchema,
397
+ ProductPrice$outboundSchema,
398
+ ]),
399
+ ),
278
400
  }).transform((v) => {
279
401
  return remap$(v, {
280
402
  createdAt: "created_at",
@@ -289,11 +411,11 @@ export const CustomerSubscription$outboundSchema: z.ZodType<
289
411
  endedAt: "ended_at",
290
412
  customerId: "customer_id",
291
413
  productId: "product_id",
292
- priceId: "price_id",
293
414
  discountId: "discount_id",
294
415
  checkoutId: "checkout_id",
295
416
  customerCancellationReason: "customer_cancellation_reason",
296
417
  customerCancellationComment: "customer_cancellation_comment",
418
+ priceId: "price_id",
297
419
  userId: "user_id",
298
420
  });
299
421
  });
@@ -21,7 +21,7 @@ import {
21
21
 
22
22
  export type LicenseKeyCustomerMetadata = string | number | boolean;
23
23
 
24
- export type TaxId = string | TaxIDFormat;
24
+ export type LicenseKeyCustomerTaxId = string | TaxIDFormat;
25
25
 
26
26
  export type LicenseKeyCustomer = {
27
27
  /**
@@ -59,6 +59,10 @@ export type LicenseKeyCustomer = {
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
 
@@ -111,43 +115,50 @@ export function licenseKeyCustomerMetadataFromJSON(
111
115
  }
112
116
 
113
117
  /** @internal */
114
- export const TaxId$inboundSchema: z.ZodType<TaxId, z.ZodTypeDef, unknown> = z
115
- .union([z.string(), TaxIDFormat$inboundSchema]);
118
+ export const LicenseKeyCustomerTaxId$inboundSchema: z.ZodType<
119
+ LicenseKeyCustomerTaxId,
120
+ z.ZodTypeDef,
121
+ unknown
122
+ > = z.union([z.string(), TaxIDFormat$inboundSchema]);
116
123
 
117
124
  /** @internal */
118
- export type TaxId$Outbound = string | string;
125
+ export type LicenseKeyCustomerTaxId$Outbound = string | string;
119
126
 
120
127
  /** @internal */
121
- export const TaxId$outboundSchema: z.ZodType<
122
- TaxId$Outbound,
128
+ export const LicenseKeyCustomerTaxId$outboundSchema: z.ZodType<
129
+ LicenseKeyCustomerTaxId$Outbound,
123
130
  z.ZodTypeDef,
124
- TaxId
131
+ LicenseKeyCustomerTaxId
125
132
  > = z.union([z.string(), TaxIDFormat$outboundSchema]);
126
133
 
127
134
  /**
128
135
  * @internal
129
136
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
130
137
  */
131
- export namespace TaxId$ {
132
- /** @deprecated use `TaxId$inboundSchema` instead. */
133
- export const inboundSchema = TaxId$inboundSchema;
134
- /** @deprecated use `TaxId$outboundSchema` instead. */
135
- export const outboundSchema = TaxId$outboundSchema;
136
- /** @deprecated use `TaxId$Outbound` instead. */
137
- export type Outbound = TaxId$Outbound;
138
+ export namespace LicenseKeyCustomerTaxId$ {
139
+ /** @deprecated use `LicenseKeyCustomerTaxId$inboundSchema` instead. */
140
+ export const inboundSchema = LicenseKeyCustomerTaxId$inboundSchema;
141
+ /** @deprecated use `LicenseKeyCustomerTaxId$outboundSchema` instead. */
142
+ export const outboundSchema = LicenseKeyCustomerTaxId$outboundSchema;
143
+ /** @deprecated use `LicenseKeyCustomerTaxId$Outbound` instead. */
144
+ export type Outbound = LicenseKeyCustomerTaxId$Outbound;
138
145
  }
139
146
 
140
- export function taxIdToJSON(taxId: TaxId): string {
141
- return JSON.stringify(TaxId$outboundSchema.parse(taxId));
147
+ export function licenseKeyCustomerTaxIdToJSON(
148
+ licenseKeyCustomerTaxId: LicenseKeyCustomerTaxId,
149
+ ): string {
150
+ return JSON.stringify(
151
+ LicenseKeyCustomerTaxId$outboundSchema.parse(licenseKeyCustomerTaxId),
152
+ );
142
153
  }
143
154
 
144
- export function taxIdFromJSON(
155
+ export function licenseKeyCustomerTaxIdFromJSON(
145
156
  jsonString: string,
146
- ): SafeParseResult<TaxId, SDKValidationError> {
157
+ ): SafeParseResult<LicenseKeyCustomerTaxId, SDKValidationError> {
147
158
  return safeParse(
148
159
  jsonString,
149
- (x) => TaxId$inboundSchema.parse(JSON.parse(x)),
150
- `Failed to parse 'TaxId' from JSON`,
160
+ (x) => LicenseKeyCustomerTaxId$inboundSchema.parse(JSON.parse(x)),
161
+ `Failed to parse 'LicenseKeyCustomerTaxId' from JSON`,
151
162
  );
152
163
  }
153
164
 
@@ -172,6 +183,9 @@ export const LicenseKeyCustomer$inboundSchema: z.ZodType<
172
183
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$inboundSchema]))),
173
184
  ),
174
185
  organization_id: z.string(),
186
+ deleted_at: z.nullable(
187
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
188
+ ),
175
189
  avatar_url: z.string(),
176
190
  }).transform((v) => {
177
191
  return remap$(v, {
@@ -182,6 +196,7 @@ export const LicenseKeyCustomer$inboundSchema: z.ZodType<
182
196
  "billing_address": "billingAddress",
183
197
  "tax_id": "taxId",
184
198
  "organization_id": "organizationId",
199
+ "deleted_at": "deletedAt",
185
200
  "avatar_url": "avatarUrl",
186
201
  });
187
202
  });
@@ -199,6 +214,7 @@ export type LicenseKeyCustomer$Outbound = {
199
214
  billing_address: Address$Outbound | null;
200
215
  tax_id: Array<string | string | null> | null;
201
216
  organization_id: string;
217
+ deleted_at: string | null;
202
218
  avatar_url: string;
203
219
  };
204
220
 
@@ -221,6 +237,7 @@ export const LicenseKeyCustomer$outboundSchema: z.ZodType<
221
237
  z.array(z.nullable(z.union([z.string(), TaxIDFormat$outboundSchema]))),
222
238
  ),
223
239
  organizationId: z.string(),
240
+ deletedAt: z.nullable(z.date().transform(v => v.toISOString())),
224
241
  avatarUrl: z.string(),
225
242
  }).transform((v) => {
226
243
  return remap$(v, {
@@ -231,6 +248,7 @@ export const LicenseKeyCustomer$outboundSchema: z.ZodType<
231
248
  billingAddress: "billing_address",
232
249
  taxId: "tax_id",
233
250
  organizationId: "organization_id",
251
+ deletedAt: "deleted_at",
234
252
  avatarUrl: "avatar_url",
235
253
  });
236
254
  });