@polar-sh/sdk 0.33.2 → 0.34.1

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 (302) hide show
  1. package/README.md +9 -8
  2. package/bin/mcp-server.js +104 -94
  3. package/bin/mcp-server.js.map +17 -17
  4. package/dist/commonjs/lib/config.d.ts +3 -3
  5. package/dist/commonjs/lib/config.js +3 -3
  6. package/dist/commonjs/lib/security.d.ts +2 -2
  7. package/dist/commonjs/lib/security.d.ts.map +1 -1
  8. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  9. package/dist/commonjs/mcp-server/server.js +1 -1
  10. package/dist/commonjs/models/components/benefitgrant.d.ts +4 -4
  11. package/dist/commonjs/models/components/benefitgrant.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/benefitgrant.js +12 -12
  13. package/dist/commonjs/models/components/benefitgrant.js.map +1 -1
  14. package/dist/commonjs/models/components/benefitgrantwebhook.d.ts +8 -8
  15. package/dist/commonjs/models/components/benefitgrantwebhook.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/benefitgrantwebhook.js +24 -24
  17. package/dist/commonjs/models/components/benefitgrantwebhook.js.map +1 -1
  18. package/dist/commonjs/models/components/checkout.d.ts +11 -6
  19. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/checkout.js +16 -12
  21. package/dist/commonjs/models/components/checkout.js.map +1 -1
  22. package/dist/commonjs/models/components/checkoutcreate.d.ts +2 -2
  23. package/dist/commonjs/models/components/checkoutcreate.js +4 -4
  24. package/dist/commonjs/models/components/checkoutlink.d.ts +4 -4
  25. package/dist/commonjs/models/components/checkoutlink.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/checkoutlink.js +8 -8
  27. package/dist/commonjs/models/components/checkoutlink.js.map +1 -1
  28. package/dist/commonjs/models/components/checkoutpublic.d.ts +6 -6
  29. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/checkoutpublic.js +12 -12
  31. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  32. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +6 -6
  33. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +12 -12
  35. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  36. package/dist/commonjs/models/components/customerbenefitgrantupdate.d.ts +10 -10
  37. package/dist/commonjs/models/components/customerbenefitgrantupdate.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/customerbenefitgrantupdate.js +8 -8
  39. package/dist/commonjs/models/components/customerbenefitgrantupdate.js.map +1 -1
  40. package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.d.ts +2 -2
  41. package/dist/commonjs/models/components/customersessioncustomerexternalidcreate.js +4 -4
  42. package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts +34 -4
  43. package/dist/commonjs/models/components/customerstatebenefitgrant.d.ts.map +1 -1
  44. package/dist/commonjs/models/components/customerstatebenefitgrant.js +40 -13
  45. package/dist/commonjs/models/components/customerstatebenefitgrant.js.map +1 -1
  46. package/dist/commonjs/models/components/discount.d.ts +2 -2
  47. package/dist/commonjs/models/components/discount.d.ts.map +1 -1
  48. package/dist/commonjs/models/components/discount.js +4 -4
  49. package/dist/commonjs/models/components/discount.js.map +1 -1
  50. package/dist/commonjs/models/components/discountcreate.d.ts +2 -2
  51. package/dist/commonjs/models/components/discountcreate.d.ts.map +1 -1
  52. package/dist/commonjs/models/components/discountcreate.js +6 -6
  53. package/dist/commonjs/models/components/discountcreate.js.map +1 -1
  54. package/dist/commonjs/models/components/filter.d.ts +4 -4
  55. package/dist/commonjs/models/components/filter.d.ts.map +1 -1
  56. package/dist/commonjs/models/components/filter.js +4 -4
  57. package/dist/commonjs/models/components/filter.js.map +1 -1
  58. package/dist/commonjs/models/components/legacyrecurringproductprice.d.ts +8 -8
  59. package/dist/commonjs/models/components/legacyrecurringproductprice.d.ts.map +1 -1
  60. package/dist/commonjs/models/components/legacyrecurringproductprice.js +4 -4
  61. package/dist/commonjs/models/components/legacyrecurringproductprice.js.map +1 -1
  62. package/dist/commonjs/models/components/listresourcefileread.d.ts +12 -12
  63. package/dist/commonjs/models/components/listresourcefileread.d.ts.map +1 -1
  64. package/dist/commonjs/models/components/listresourcefileread.js +12 -12
  65. package/dist/commonjs/models/components/listresourcefileread.js.map +1 -1
  66. package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts +4 -4
  67. package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts.map +1 -1
  68. package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js +4 -4
  69. package/dist/commonjs/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js.map +1 -1
  70. package/dist/commonjs/models/components/meter.d.ts +24 -24
  71. package/dist/commonjs/models/components/meter.d.ts.map +1 -1
  72. package/dist/commonjs/models/components/meter.js +16 -16
  73. package/dist/commonjs/models/components/meter.js.map +1 -1
  74. package/dist/commonjs/models/components/metercreate.d.ts +24 -24
  75. package/dist/commonjs/models/components/metercreate.d.ts.map +1 -1
  76. package/dist/commonjs/models/components/metercreate.js +16 -16
  77. package/dist/commonjs/models/components/metercreate.js.map +1 -1
  78. package/dist/commonjs/models/components/meterupdate.d.ts +24 -24
  79. package/dist/commonjs/models/components/meterupdate.d.ts.map +1 -1
  80. package/dist/commonjs/models/components/meterupdate.js +16 -16
  81. package/dist/commonjs/models/components/meterupdate.js.map +1 -1
  82. package/dist/commonjs/models/components/order.d.ts +4 -4
  83. package/dist/commonjs/models/components/order.d.ts.map +1 -1
  84. package/dist/commonjs/models/components/order.js +8 -8
  85. package/dist/commonjs/models/components/order.js.map +1 -1
  86. package/dist/commonjs/models/components/payment.d.ts +2 -2
  87. package/dist/commonjs/models/components/payment.d.ts.map +1 -1
  88. package/dist/commonjs/models/components/payment.js +2 -2
  89. package/dist/commonjs/models/components/payment.js.map +1 -1
  90. package/dist/commonjs/models/components/productcreate.d.ts +4 -4
  91. package/dist/commonjs/models/components/productcreate.d.ts.map +1 -1
  92. package/dist/commonjs/models/components/productcreate.js +8 -8
  93. package/dist/commonjs/models/components/productcreate.js.map +1 -1
  94. package/dist/commonjs/models/components/productprice.d.ts +12 -12
  95. package/dist/commonjs/models/components/productprice.d.ts.map +1 -1
  96. package/dist/commonjs/models/components/productprice.js +8 -8
  97. package/dist/commonjs/models/components/productprice.js.map +1 -1
  98. package/dist/commonjs/models/components/productupdate.d.ts +4 -4
  99. package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
  100. package/dist/commonjs/models/components/productupdate.js +12 -12
  101. package/dist/commonjs/models/components/productupdate.js.map +1 -1
  102. package/dist/commonjs/models/components/subscription.d.ts +4 -4
  103. package/dist/commonjs/models/components/subscription.d.ts.map +1 -1
  104. package/dist/commonjs/models/components/subscription.js +8 -8
  105. package/dist/commonjs/models/components/subscription.js.map +1 -1
  106. package/dist/commonjs/models/components/subscriptionupdate.d.ts +2 -2
  107. package/dist/commonjs/models/components/subscriptionupdate.d.ts.map +1 -1
  108. package/dist/commonjs/models/components/subscriptionupdate.js +2 -2
  109. package/dist/commonjs/models/components/subscriptionupdate.js.map +1 -1
  110. package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.d.ts +2 -2
  111. package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.d.ts.map +1 -1
  112. package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.js +2 -2
  113. package/dist/commonjs/models/operations/customerportalcustomersaddpaymentmethod.js.map +1 -1
  114. package/dist/commonjs/models/operations/filesupdate.d.ts +6 -6
  115. package/dist/commonjs/models/operations/filesupdate.d.ts.map +1 -1
  116. package/dist/commonjs/models/operations/filesupdate.js +6 -6
  117. package/dist/commonjs/models/operations/filesupdate.js.map +1 -1
  118. package/dist/commonjs/models/operations/filesuploaded.d.ts +6 -6
  119. package/dist/commonjs/models/operations/filesuploaded.d.ts.map +1 -1
  120. package/dist/commonjs/models/operations/filesuploaded.js +6 -6
  121. package/dist/commonjs/models/operations/filesuploaded.js.map +1 -1
  122. package/dist/commonjs/models/operations/oauth2authorize.d.ts +6 -6
  123. package/dist/commonjs/models/operations/oauth2authorize.d.ts.map +1 -1
  124. package/dist/commonjs/models/operations/oauth2authorize.js +4 -4
  125. package/dist/commonjs/models/operations/oauth2authorize.js.map +1 -1
  126. package/dist/commonjs/models/operations/oauth2requesttoken.d.ts +2 -2
  127. package/dist/commonjs/models/operations/oauth2requesttoken.d.ts.map +1 -1
  128. package/dist/commonjs/models/operations/oauth2requesttoken.js +2 -2
  129. package/dist/commonjs/models/operations/oauth2requesttoken.js.map +1 -1
  130. package/dist/commonjs/models/operations/oauth2userinfo.d.ts +2 -2
  131. package/dist/commonjs/models/operations/oauth2userinfo.d.ts.map +1 -1
  132. package/dist/commonjs/models/operations/oauth2userinfo.js +2 -2
  133. package/dist/commonjs/models/operations/oauth2userinfo.js.map +1 -1
  134. package/dist/esm/lib/config.d.ts +3 -3
  135. package/dist/esm/lib/config.js +3 -3
  136. package/dist/esm/lib/security.d.ts +2 -2
  137. package/dist/esm/lib/security.d.ts.map +1 -1
  138. package/dist/esm/mcp-server/mcp-server.js +1 -1
  139. package/dist/esm/mcp-server/server.js +1 -1
  140. package/dist/esm/models/components/benefitgrant.d.ts +4 -4
  141. package/dist/esm/models/components/benefitgrant.d.ts.map +1 -1
  142. package/dist/esm/models/components/benefitgrant.js +12 -12
  143. package/dist/esm/models/components/benefitgrant.js.map +1 -1
  144. package/dist/esm/models/components/benefitgrantwebhook.d.ts +8 -8
  145. package/dist/esm/models/components/benefitgrantwebhook.d.ts.map +1 -1
  146. package/dist/esm/models/components/benefitgrantwebhook.js +24 -24
  147. package/dist/esm/models/components/benefitgrantwebhook.js.map +1 -1
  148. package/dist/esm/models/components/checkout.d.ts +11 -6
  149. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  150. package/dist/esm/models/components/checkout.js +16 -12
  151. package/dist/esm/models/components/checkout.js.map +1 -1
  152. package/dist/esm/models/components/checkoutcreate.d.ts +2 -2
  153. package/dist/esm/models/components/checkoutcreate.js +4 -4
  154. package/dist/esm/models/components/checkoutlink.d.ts +4 -4
  155. package/dist/esm/models/components/checkoutlink.d.ts.map +1 -1
  156. package/dist/esm/models/components/checkoutlink.js +8 -8
  157. package/dist/esm/models/components/checkoutlink.js.map +1 -1
  158. package/dist/esm/models/components/checkoutpublic.d.ts +6 -6
  159. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  160. package/dist/esm/models/components/checkoutpublic.js +12 -12
  161. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  162. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +6 -6
  163. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  164. package/dist/esm/models/components/checkoutpublicconfirmed.js +12 -12
  165. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  166. package/dist/esm/models/components/customerbenefitgrantupdate.d.ts +10 -10
  167. package/dist/esm/models/components/customerbenefitgrantupdate.d.ts.map +1 -1
  168. package/dist/esm/models/components/customerbenefitgrantupdate.js +8 -8
  169. package/dist/esm/models/components/customerbenefitgrantupdate.js.map +1 -1
  170. package/dist/esm/models/components/customersessioncustomerexternalidcreate.d.ts +2 -2
  171. package/dist/esm/models/components/customersessioncustomerexternalidcreate.js +4 -4
  172. package/dist/esm/models/components/customerstatebenefitgrant.d.ts +34 -4
  173. package/dist/esm/models/components/customerstatebenefitgrant.d.ts.map +1 -1
  174. package/dist/esm/models/components/customerstatebenefitgrant.js +37 -12
  175. package/dist/esm/models/components/customerstatebenefitgrant.js.map +1 -1
  176. package/dist/esm/models/components/discount.d.ts +2 -2
  177. package/dist/esm/models/components/discount.d.ts.map +1 -1
  178. package/dist/esm/models/components/discount.js +4 -4
  179. package/dist/esm/models/components/discount.js.map +1 -1
  180. package/dist/esm/models/components/discountcreate.d.ts +2 -2
  181. package/dist/esm/models/components/discountcreate.d.ts.map +1 -1
  182. package/dist/esm/models/components/discountcreate.js +6 -6
  183. package/dist/esm/models/components/discountcreate.js.map +1 -1
  184. package/dist/esm/models/components/filter.d.ts +4 -4
  185. package/dist/esm/models/components/filter.d.ts.map +1 -1
  186. package/dist/esm/models/components/filter.js +4 -4
  187. package/dist/esm/models/components/filter.js.map +1 -1
  188. package/dist/esm/models/components/legacyrecurringproductprice.d.ts +8 -8
  189. package/dist/esm/models/components/legacyrecurringproductprice.d.ts.map +1 -1
  190. package/dist/esm/models/components/legacyrecurringproductprice.js +4 -4
  191. package/dist/esm/models/components/legacyrecurringproductprice.js.map +1 -1
  192. package/dist/esm/models/components/listresourcefileread.d.ts +12 -12
  193. package/dist/esm/models/components/listresourcefileread.d.ts.map +1 -1
  194. package/dist/esm/models/components/listresourcefileread.js +12 -12
  195. package/dist/esm/models/components/listresourcefileread.js.map +1 -1
  196. package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts +4 -4
  197. package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.d.ts.map +1 -1
  198. package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js +4 -4
  199. package/dist/esm/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.js.map +1 -1
  200. package/dist/esm/models/components/meter.d.ts +24 -24
  201. package/dist/esm/models/components/meter.d.ts.map +1 -1
  202. package/dist/esm/models/components/meter.js +16 -16
  203. package/dist/esm/models/components/meter.js.map +1 -1
  204. package/dist/esm/models/components/metercreate.d.ts +24 -24
  205. package/dist/esm/models/components/metercreate.d.ts.map +1 -1
  206. package/dist/esm/models/components/metercreate.js +16 -16
  207. package/dist/esm/models/components/metercreate.js.map +1 -1
  208. package/dist/esm/models/components/meterupdate.d.ts +24 -24
  209. package/dist/esm/models/components/meterupdate.d.ts.map +1 -1
  210. package/dist/esm/models/components/meterupdate.js +16 -16
  211. package/dist/esm/models/components/meterupdate.js.map +1 -1
  212. package/dist/esm/models/components/order.d.ts +4 -4
  213. package/dist/esm/models/components/order.d.ts.map +1 -1
  214. package/dist/esm/models/components/order.js +8 -8
  215. package/dist/esm/models/components/order.js.map +1 -1
  216. package/dist/esm/models/components/payment.d.ts +2 -2
  217. package/dist/esm/models/components/payment.d.ts.map +1 -1
  218. package/dist/esm/models/components/payment.js +2 -2
  219. package/dist/esm/models/components/payment.js.map +1 -1
  220. package/dist/esm/models/components/productcreate.d.ts +4 -4
  221. package/dist/esm/models/components/productcreate.d.ts.map +1 -1
  222. package/dist/esm/models/components/productcreate.js +8 -8
  223. package/dist/esm/models/components/productcreate.js.map +1 -1
  224. package/dist/esm/models/components/productprice.d.ts +12 -12
  225. package/dist/esm/models/components/productprice.d.ts.map +1 -1
  226. package/dist/esm/models/components/productprice.js +8 -8
  227. package/dist/esm/models/components/productprice.js.map +1 -1
  228. package/dist/esm/models/components/productupdate.d.ts +4 -4
  229. package/dist/esm/models/components/productupdate.d.ts.map +1 -1
  230. package/dist/esm/models/components/productupdate.js +12 -12
  231. package/dist/esm/models/components/productupdate.js.map +1 -1
  232. package/dist/esm/models/components/subscription.d.ts +4 -4
  233. package/dist/esm/models/components/subscription.d.ts.map +1 -1
  234. package/dist/esm/models/components/subscription.js +8 -8
  235. package/dist/esm/models/components/subscription.js.map +1 -1
  236. package/dist/esm/models/components/subscriptionupdate.d.ts +2 -2
  237. package/dist/esm/models/components/subscriptionupdate.d.ts.map +1 -1
  238. package/dist/esm/models/components/subscriptionupdate.js +2 -2
  239. package/dist/esm/models/components/subscriptionupdate.js.map +1 -1
  240. package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.d.ts +2 -2
  241. package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.d.ts.map +1 -1
  242. package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.js +2 -2
  243. package/dist/esm/models/operations/customerportalcustomersaddpaymentmethod.js.map +1 -1
  244. package/dist/esm/models/operations/filesupdate.d.ts +6 -6
  245. package/dist/esm/models/operations/filesupdate.d.ts.map +1 -1
  246. package/dist/esm/models/operations/filesupdate.js +6 -6
  247. package/dist/esm/models/operations/filesupdate.js.map +1 -1
  248. package/dist/esm/models/operations/filesuploaded.d.ts +6 -6
  249. package/dist/esm/models/operations/filesuploaded.d.ts.map +1 -1
  250. package/dist/esm/models/operations/filesuploaded.js +6 -6
  251. package/dist/esm/models/operations/filesuploaded.js.map +1 -1
  252. package/dist/esm/models/operations/oauth2authorize.d.ts +6 -6
  253. package/dist/esm/models/operations/oauth2authorize.d.ts.map +1 -1
  254. package/dist/esm/models/operations/oauth2authorize.js +4 -4
  255. package/dist/esm/models/operations/oauth2authorize.js.map +1 -1
  256. package/dist/esm/models/operations/oauth2requesttoken.d.ts +2 -2
  257. package/dist/esm/models/operations/oauth2requesttoken.d.ts.map +1 -1
  258. package/dist/esm/models/operations/oauth2requesttoken.js +2 -2
  259. package/dist/esm/models/operations/oauth2requesttoken.js.map +1 -1
  260. package/dist/esm/models/operations/oauth2userinfo.d.ts +2 -2
  261. package/dist/esm/models/operations/oauth2userinfo.d.ts.map +1 -1
  262. package/dist/esm/models/operations/oauth2userinfo.js +2 -2
  263. package/dist/esm/models/operations/oauth2userinfo.js.map +1 -1
  264. package/docs/sdks/customersessions/README.md +2 -2
  265. package/jsr.json +1 -1
  266. package/package.json +1 -1
  267. package/src/lib/config.ts +3 -3
  268. package/src/lib/security.ts +2 -2
  269. package/src/mcp-server/mcp-server.ts +1 -1
  270. package/src/mcp-server/server.ts +1 -1
  271. package/src/models/components/benefitgrant.ts +24 -24
  272. package/src/models/components/benefitgrantwebhook.ts +48 -48
  273. package/src/models/components/checkout.ts +34 -25
  274. package/src/models/components/checkoutcreate.ts +6 -6
  275. package/src/models/components/checkoutlink.ts +16 -16
  276. package/src/models/components/checkoutpublic.ts +25 -25
  277. package/src/models/components/checkoutpublicconfirmed.ts +25 -25
  278. package/src/models/components/customerbenefitgrantupdate.ts +29 -29
  279. package/src/models/components/customersessioncustomerexternalidcreate.ts +6 -6
  280. package/src/models/components/customerstatebenefitgrant.ts +85 -24
  281. package/src/models/components/discount.ts +8 -8
  282. package/src/models/components/discountcreate.ts +12 -12
  283. package/src/models/components/filter.ts +8 -8
  284. package/src/models/components/legacyrecurringproductprice.ts +12 -12
  285. package/src/models/components/listresourcefileread.ts +26 -26
  286. package/src/models/components/listresourceunionpaymentmethodcardpaymentmethodgeneric.ts +9 -9
  287. package/src/models/components/meter.ts +42 -42
  288. package/src/models/components/metercreate.ts +44 -44
  289. package/src/models/components/meterupdate.ts +40 -40
  290. package/src/models/components/order.ts +16 -16
  291. package/src/models/components/payment.ts +4 -4
  292. package/src/models/components/productcreate.ts +16 -16
  293. package/src/models/components/productprice.ts +22 -22
  294. package/src/models/components/productupdate.ts +24 -24
  295. package/src/models/components/subscription.ts +16 -16
  296. package/src/models/components/subscriptionupdate.ts +4 -4
  297. package/src/models/operations/customerportalcustomersaddpaymentmethod.ts +6 -6
  298. package/src/models/operations/filesupdate.ts +14 -14
  299. package/src/models/operations/filesuploaded.ts +14 -14
  300. package/src/models/operations/oauth2authorize.ts +12 -12
  301. package/src/models/operations/oauth2requesttoken.ts +6 -6
  302. package/src/models/operations/oauth2userinfo.ts +6 -6
@@ -32,11 +32,11 @@ export type MeterMetadata = string | number | number | boolean;
32
32
  * The aggregation to apply on the filtered events to calculate the meter.
33
33
  */
34
34
  export type MeterAggregation =
35
+ | (CountAggregation & { func: "count" })
35
36
  | (PropertyAggregation & { func: "avg" })
36
- | (PropertyAggregation & { func: "avg" })
37
- | (PropertyAggregation & { func: "avg" })
38
- | (PropertyAggregation & { func: "avg" })
39
- | (CountAggregation & { func: "count" });
37
+ | (PropertyAggregation & { func: "max" })
38
+ | (PropertyAggregation & { func: "min" })
39
+ | (PropertyAggregation & { func: "sum" });
40
40
 
41
41
  export type Meter = {
42
42
  metadata: { [k: string]: string | number | number | boolean };
@@ -61,11 +61,11 @@ export type Meter = {
61
61
  * The aggregation to apply on the filtered events to calculate the meter.
62
62
  */
63
63
  aggregation:
64
+ | (CountAggregation & { func: "count" })
64
65
  | (PropertyAggregation & { func: "avg" })
65
- | (PropertyAggregation & { func: "avg" })
66
- | (PropertyAggregation & { func: "avg" })
67
- | (PropertyAggregation & { func: "avg" })
68
- | (CountAggregation & { func: "count" });
66
+ | (PropertyAggregation & { func: "max" })
67
+ | (PropertyAggregation & { func: "min" })
68
+ | (PropertyAggregation & { func: "sum" });
69
69
  /**
70
70
  * The ID of the organization owning the meter.
71
71
  */
@@ -122,30 +122,30 @@ export const MeterAggregation$inboundSchema: z.ZodType<
122
122
  z.ZodTypeDef,
123
123
  unknown
124
124
  > = z.union([
125
- PropertyAggregation$inboundSchema.and(
126
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
125
+ CountAggregation$inboundSchema.and(
126
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
127
127
  ),
128
128
  PropertyAggregation$inboundSchema.and(
129
129
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
130
130
  ),
131
131
  PropertyAggregation$inboundSchema.and(
132
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
132
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
133
133
  ),
134
134
  PropertyAggregation$inboundSchema.and(
135
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
135
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
136
136
  ),
137
- CountAggregation$inboundSchema.and(
138
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
137
+ PropertyAggregation$inboundSchema.and(
138
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
139
139
  ),
140
140
  ]);
141
141
 
142
142
  /** @internal */
143
143
  export type MeterAggregation$Outbound =
144
+ | (CountAggregation$Outbound & { func: "count" })
144
145
  | (PropertyAggregation$Outbound & { func: "avg" })
145
- | (PropertyAggregation$Outbound & { func: "avg" })
146
- | (PropertyAggregation$Outbound & { func: "avg" })
147
- | (PropertyAggregation$Outbound & { func: "avg" })
148
- | (CountAggregation$Outbound & { func: "count" });
146
+ | (PropertyAggregation$Outbound & { func: "max" })
147
+ | (PropertyAggregation$Outbound & { func: "min" })
148
+ | (PropertyAggregation$Outbound & { func: "sum" });
149
149
 
150
150
  /** @internal */
151
151
  export const MeterAggregation$outboundSchema: z.ZodType<
@@ -153,20 +153,20 @@ export const MeterAggregation$outboundSchema: z.ZodType<
153
153
  z.ZodTypeDef,
154
154
  MeterAggregation
155
155
  > = z.union([
156
- PropertyAggregation$outboundSchema.and(
157
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
156
+ CountAggregation$outboundSchema.and(
157
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
158
158
  ),
159
159
  PropertyAggregation$outboundSchema.and(
160
160
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
161
161
  ),
162
162
  PropertyAggregation$outboundSchema.and(
163
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
163
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
164
164
  ),
165
165
  PropertyAggregation$outboundSchema.and(
166
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
166
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
167
167
  ),
168
- CountAggregation$outboundSchema.and(
169
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
168
+ PropertyAggregation$outboundSchema.and(
169
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
170
170
  ),
171
171
  ]);
172
172
 
@@ -217,8 +217,8 @@ export const Meter$inboundSchema: z.ZodType<Meter, z.ZodTypeDef, unknown> = z
217
217
  name: z.string(),
218
218
  filter: Filter$inboundSchema,
219
219
  aggregation: z.union([
220
- PropertyAggregation$inboundSchema.and(
221
- z.object({ func: z.literal("avg") }).transform((v) => ({
220
+ CountAggregation$inboundSchema.and(
221
+ z.object({ func: z.literal("count") }).transform((v) => ({
222
222
  func: v.func,
223
223
  })),
224
224
  ),
@@ -228,17 +228,17 @@ export const Meter$inboundSchema: z.ZodType<Meter, z.ZodTypeDef, unknown> = z
228
228
  })),
229
229
  ),
230
230
  PropertyAggregation$inboundSchema.and(
231
- z.object({ func: z.literal("avg") }).transform((v) => ({
231
+ z.object({ func: z.literal("max") }).transform((v) => ({
232
232
  func: v.func,
233
233
  })),
234
234
  ),
235
235
  PropertyAggregation$inboundSchema.and(
236
- z.object({ func: z.literal("avg") }).transform((v) => ({
236
+ z.object({ func: z.literal("min") }).transform((v) => ({
237
237
  func: v.func,
238
238
  })),
239
239
  ),
240
- CountAggregation$inboundSchema.and(
241
- z.object({ func: z.literal("count") }).transform((v) => ({
240
+ PropertyAggregation$inboundSchema.and(
241
+ z.object({ func: z.literal("sum") }).transform((v) => ({
242
242
  func: v.func,
243
243
  })),
244
244
  ),
@@ -261,11 +261,11 @@ export type Meter$Outbound = {
261
261
  name: string;
262
262
  filter: Filter$Outbound;
263
263
  aggregation:
264
+ | (CountAggregation$Outbound & { func: "count" })
264
265
  | (PropertyAggregation$Outbound & { func: "avg" })
265
- | (PropertyAggregation$Outbound & { func: "avg" })
266
- | (PropertyAggregation$Outbound & { func: "avg" })
267
- | (PropertyAggregation$Outbound & { func: "avg" })
268
- | (CountAggregation$Outbound & { func: "count" });
266
+ | (PropertyAggregation$Outbound & { func: "max" })
267
+ | (PropertyAggregation$Outbound & { func: "min" })
268
+ | (PropertyAggregation$Outbound & { func: "sum" });
269
269
  organization_id: string;
270
270
  };
271
271
 
@@ -284,22 +284,22 @@ export const Meter$outboundSchema: z.ZodType<
284
284
  name: z.string(),
285
285
  filter: Filter$outboundSchema,
286
286
  aggregation: z.union([
287
- PropertyAggregation$outboundSchema.and(
288
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
287
+ CountAggregation$outboundSchema.and(
288
+ z.object({ func: z.literal("count") }).transform((v) => ({
289
+ func: v.func,
290
+ })),
289
291
  ),
290
292
  PropertyAggregation$outboundSchema.and(
291
293
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
292
294
  ),
293
295
  PropertyAggregation$outboundSchema.and(
294
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
296
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
295
297
  ),
296
298
  PropertyAggregation$outboundSchema.and(
297
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
299
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
298
300
  ),
299
- CountAggregation$outboundSchema.and(
300
- z.object({ func: z.literal("count") }).transform((v) => ({
301
- func: v.func,
302
- })),
301
+ PropertyAggregation$outboundSchema.and(
302
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
303
303
  ),
304
304
  ]),
305
305
  organizationId: z.string(),
@@ -32,11 +32,11 @@ export type MeterCreateMetadata = string | number | number | boolean;
32
32
  * The aggregation to apply on the filtered events to calculate the meter.
33
33
  */
34
34
  export type MeterCreateAggregation =
35
+ | (CountAggregation & { func: "count" })
35
36
  | (PropertyAggregation & { func: "avg" })
36
- | (PropertyAggregation & { func: "avg" })
37
- | (PropertyAggregation & { func: "avg" })
38
- | (PropertyAggregation & { func: "avg" })
39
- | (CountAggregation & { func: "count" });
37
+ | (PropertyAggregation & { func: "max" })
38
+ | (PropertyAggregation & { func: "min" })
39
+ | (PropertyAggregation & { func: "sum" });
40
40
 
41
41
  export type MeterCreate = {
42
42
  /**
@@ -64,11 +64,11 @@ export type MeterCreate = {
64
64
  * The aggregation to apply on the filtered events to calculate the meter.
65
65
  */
66
66
  aggregation:
67
+ | (CountAggregation & { func: "count" })
67
68
  | (PropertyAggregation & { func: "avg" })
68
- | (PropertyAggregation & { func: "avg" })
69
- | (PropertyAggregation & { func: "avg" })
70
- | (PropertyAggregation & { func: "avg" })
71
- | (CountAggregation & { func: "count" });
69
+ | (PropertyAggregation & { func: "max" })
70
+ | (PropertyAggregation & { func: "min" })
71
+ | (PropertyAggregation & { func: "sum" });
72
72
  /**
73
73
  * The ID of the organization owning the meter. **Required unless you use an organization token.**
74
74
  */
@@ -129,30 +129,30 @@ export const MeterCreateAggregation$inboundSchema: z.ZodType<
129
129
  z.ZodTypeDef,
130
130
  unknown
131
131
  > = z.union([
132
- PropertyAggregation$inboundSchema.and(
133
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
132
+ CountAggregation$inboundSchema.and(
133
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
134
134
  ),
135
135
  PropertyAggregation$inboundSchema.and(
136
136
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
137
137
  ),
138
138
  PropertyAggregation$inboundSchema.and(
139
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
139
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
140
140
  ),
141
141
  PropertyAggregation$inboundSchema.and(
142
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
142
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
143
143
  ),
144
- CountAggregation$inboundSchema.and(
145
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
144
+ PropertyAggregation$inboundSchema.and(
145
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
146
146
  ),
147
147
  ]);
148
148
 
149
149
  /** @internal */
150
150
  export type MeterCreateAggregation$Outbound =
151
+ | (CountAggregation$Outbound & { func: "count" })
151
152
  | (PropertyAggregation$Outbound & { func: "avg" })
152
- | (PropertyAggregation$Outbound & { func: "avg" })
153
- | (PropertyAggregation$Outbound & { func: "avg" })
154
- | (PropertyAggregation$Outbound & { func: "avg" })
155
- | (CountAggregation$Outbound & { func: "count" });
153
+ | (PropertyAggregation$Outbound & { func: "max" })
154
+ | (PropertyAggregation$Outbound & { func: "min" })
155
+ | (PropertyAggregation$Outbound & { func: "sum" });
156
156
 
157
157
  /** @internal */
158
158
  export const MeterCreateAggregation$outboundSchema: z.ZodType<
@@ -160,20 +160,20 @@ export const MeterCreateAggregation$outboundSchema: z.ZodType<
160
160
  z.ZodTypeDef,
161
161
  MeterCreateAggregation
162
162
  > = z.union([
163
- PropertyAggregation$outboundSchema.and(
164
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
163
+ CountAggregation$outboundSchema.and(
164
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
165
165
  ),
166
166
  PropertyAggregation$outboundSchema.and(
167
167
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
168
168
  ),
169
169
  PropertyAggregation$outboundSchema.and(
170
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
170
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
171
171
  ),
172
172
  PropertyAggregation$outboundSchema.and(
173
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
173
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
174
174
  ),
175
- CountAggregation$outboundSchema.and(
176
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
175
+ PropertyAggregation$outboundSchema.and(
176
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
177
177
  ),
178
178
  ]);
179
179
 
@@ -220,22 +220,22 @@ export const MeterCreate$inboundSchema: z.ZodType<
220
220
  name: z.string(),
221
221
  filter: Filter$inboundSchema,
222
222
  aggregation: z.union([
223
- PropertyAggregation$inboundSchema.and(
224
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
223
+ CountAggregation$inboundSchema.and(
224
+ z.object({ func: z.literal("count") }).transform((v) => ({
225
+ func: v.func,
226
+ })),
225
227
  ),
226
228
  PropertyAggregation$inboundSchema.and(
227
229
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
228
230
  ),
229
231
  PropertyAggregation$inboundSchema.and(
230
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
232
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
231
233
  ),
232
234
  PropertyAggregation$inboundSchema.and(
233
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
235
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
234
236
  ),
235
- CountAggregation$inboundSchema.and(
236
- z.object({ func: z.literal("count") }).transform((v) => ({
237
- func: v.func,
238
- })),
237
+ PropertyAggregation$inboundSchema.and(
238
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
239
239
  ),
240
240
  ]),
241
241
  organization_id: z.nullable(z.string()).optional(),
@@ -251,11 +251,11 @@ export type MeterCreate$Outbound = {
251
251
  name: string;
252
252
  filter: Filter$Outbound;
253
253
  aggregation:
254
+ | (CountAggregation$Outbound & { func: "count" })
254
255
  | (PropertyAggregation$Outbound & { func: "avg" })
255
- | (PropertyAggregation$Outbound & { func: "avg" })
256
- | (PropertyAggregation$Outbound & { func: "avg" })
257
- | (PropertyAggregation$Outbound & { func: "avg" })
258
- | (CountAggregation$Outbound & { func: "count" });
256
+ | (PropertyAggregation$Outbound & { func: "max" })
257
+ | (PropertyAggregation$Outbound & { func: "min" })
258
+ | (PropertyAggregation$Outbound & { func: "sum" });
259
259
  organization_id?: string | null | undefined;
260
260
  };
261
261
 
@@ -271,22 +271,22 @@ export const MeterCreate$outboundSchema: z.ZodType<
271
271
  name: z.string(),
272
272
  filter: Filter$outboundSchema,
273
273
  aggregation: z.union([
274
- PropertyAggregation$outboundSchema.and(
275
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
274
+ CountAggregation$outboundSchema.and(
275
+ z.object({ func: z.literal("count") }).transform((v) => ({
276
+ func: v.func,
277
+ })),
276
278
  ),
277
279
  PropertyAggregation$outboundSchema.and(
278
280
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
279
281
  ),
280
282
  PropertyAggregation$outboundSchema.and(
281
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
283
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
282
284
  ),
283
285
  PropertyAggregation$outboundSchema.and(
284
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
286
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
285
287
  ),
286
- CountAggregation$outboundSchema.and(
287
- z.object({ func: z.literal("count") }).transform((v) => ({
288
- func: v.func,
289
- })),
288
+ PropertyAggregation$outboundSchema.and(
289
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
290
290
  ),
291
291
  ]),
292
292
  organizationId: z.nullable(z.string()).optional(),
@@ -28,11 +28,11 @@ import {
28
28
  export type MeterUpdateMetadata = string | number | number | boolean;
29
29
 
30
30
  export type Aggregation =
31
+ | (CountAggregation & { func: "count" })
31
32
  | (PropertyAggregation & { func: "avg" })
32
- | (PropertyAggregation & { func: "avg" })
33
- | (PropertyAggregation & { func: "avg" })
34
- | (PropertyAggregation & { func: "avg" })
35
- | (CountAggregation & { func: "count" });
33
+ | (PropertyAggregation & { func: "max" })
34
+ | (PropertyAggregation & { func: "min" })
35
+ | (PropertyAggregation & { func: "sum" });
36
36
 
37
37
  export type MeterUpdate = {
38
38
  /**
@@ -63,11 +63,11 @@ export type MeterUpdate = {
63
63
  * The aggregation to apply on the filtered events to calculate the meter.
64
64
  */
65
65
  aggregation?:
66
- | (PropertyAggregation & { func: "avg" })
67
- | (PropertyAggregation & { func: "avg" })
68
- | (PropertyAggregation & { func: "avg" })
69
- | (PropertyAggregation & { func: "avg" })
70
66
  | (CountAggregation & { func: "count" })
67
+ | (PropertyAggregation & { func: "avg" })
68
+ | (PropertyAggregation & { func: "max" })
69
+ | (PropertyAggregation & { func: "min" })
70
+ | (PropertyAggregation & { func: "sum" })
71
71
  | null
72
72
  | undefined;
73
73
  };
@@ -126,30 +126,30 @@ export const Aggregation$inboundSchema: z.ZodType<
126
126
  z.ZodTypeDef,
127
127
  unknown
128
128
  > = z.union([
129
- PropertyAggregation$inboundSchema.and(
130
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
129
+ CountAggregation$inboundSchema.and(
130
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
131
131
  ),
132
132
  PropertyAggregation$inboundSchema.and(
133
133
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
134
134
  ),
135
135
  PropertyAggregation$inboundSchema.and(
136
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
136
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
137
137
  ),
138
138
  PropertyAggregation$inboundSchema.and(
139
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
139
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
140
140
  ),
141
- CountAggregation$inboundSchema.and(
142
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
141
+ PropertyAggregation$inboundSchema.and(
142
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
143
143
  ),
144
144
  ]);
145
145
 
146
146
  /** @internal */
147
147
  export type Aggregation$Outbound =
148
+ | (CountAggregation$Outbound & { func: "count" })
148
149
  | (PropertyAggregation$Outbound & { func: "avg" })
149
- | (PropertyAggregation$Outbound & { func: "avg" })
150
- | (PropertyAggregation$Outbound & { func: "avg" })
151
- | (PropertyAggregation$Outbound & { func: "avg" })
152
- | (CountAggregation$Outbound & { func: "count" });
150
+ | (PropertyAggregation$Outbound & { func: "max" })
151
+ | (PropertyAggregation$Outbound & { func: "min" })
152
+ | (PropertyAggregation$Outbound & { func: "sum" });
153
153
 
154
154
  /** @internal */
155
155
  export const Aggregation$outboundSchema: z.ZodType<
@@ -157,20 +157,20 @@ export const Aggregation$outboundSchema: z.ZodType<
157
157
  z.ZodTypeDef,
158
158
  Aggregation
159
159
  > = z.union([
160
- PropertyAggregation$outboundSchema.and(
161
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
160
+ CountAggregation$outboundSchema.and(
161
+ z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
162
162
  ),
163
163
  PropertyAggregation$outboundSchema.and(
164
164
  z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
165
165
  ),
166
166
  PropertyAggregation$outboundSchema.and(
167
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
167
+ z.object({ func: z.literal("max") }).transform((v) => ({ func: v.func })),
168
168
  ),
169
169
  PropertyAggregation$outboundSchema.and(
170
- z.object({ func: z.literal("avg") }).transform((v) => ({ func: v.func })),
170
+ z.object({ func: z.literal("min") }).transform((v) => ({ func: v.func })),
171
171
  ),
172
- CountAggregation$outboundSchema.and(
173
- z.object({ func: z.literal("count") }).transform((v) => ({ func: v.func })),
172
+ PropertyAggregation$outboundSchema.and(
173
+ z.object({ func: z.literal("sum") }).transform((v) => ({ func: v.func })),
174
174
  ),
175
175
  ]);
176
176
 
@@ -214,8 +214,8 @@ export const MeterUpdate$inboundSchema: z.ZodType<
214
214
  filter: z.nullable(Filter$inboundSchema).optional(),
215
215
  aggregation: z.nullable(
216
216
  z.union([
217
- PropertyAggregation$inboundSchema.and(
218
- z.object({ func: z.literal("avg") }).transform((v) => ({
217
+ CountAggregation$inboundSchema.and(
218
+ z.object({ func: z.literal("count") }).transform((v) => ({
219
219
  func: v.func,
220
220
  })),
221
221
  ),
@@ -225,17 +225,17 @@ export const MeterUpdate$inboundSchema: z.ZodType<
225
225
  })),
226
226
  ),
227
227
  PropertyAggregation$inboundSchema.and(
228
- z.object({ func: z.literal("avg") }).transform((v) => ({
228
+ z.object({ func: z.literal("max") }).transform((v) => ({
229
229
  func: v.func,
230
230
  })),
231
231
  ),
232
232
  PropertyAggregation$inboundSchema.and(
233
- z.object({ func: z.literal("avg") }).transform((v) => ({
233
+ z.object({ func: z.literal("min") }).transform((v) => ({
234
234
  func: v.func,
235
235
  })),
236
236
  ),
237
- CountAggregation$inboundSchema.and(
238
- z.object({ func: z.literal("count") }).transform((v) => ({
237
+ PropertyAggregation$inboundSchema.and(
238
+ z.object({ func: z.literal("sum") }).transform((v) => ({
239
239
  func: v.func,
240
240
  })),
241
241
  ),
@@ -249,11 +249,11 @@ export type MeterUpdate$Outbound = {
249
249
  name?: string | null | undefined;
250
250
  filter?: Filter$Outbound | null | undefined;
251
251
  aggregation?:
252
- | (PropertyAggregation$Outbound & { func: "avg" })
253
- | (PropertyAggregation$Outbound & { func: "avg" })
254
- | (PropertyAggregation$Outbound & { func: "avg" })
255
- | (PropertyAggregation$Outbound & { func: "avg" })
256
252
  | (CountAggregation$Outbound & { func: "count" })
253
+ | (PropertyAggregation$Outbound & { func: "avg" })
254
+ | (PropertyAggregation$Outbound & { func: "max" })
255
+ | (PropertyAggregation$Outbound & { func: "min" })
256
+ | (PropertyAggregation$Outbound & { func: "sum" })
257
257
  | null
258
258
  | undefined;
259
259
  };
@@ -271,8 +271,8 @@ export const MeterUpdate$outboundSchema: z.ZodType<
271
271
  filter: z.nullable(Filter$outboundSchema).optional(),
272
272
  aggregation: z.nullable(
273
273
  z.union([
274
- PropertyAggregation$outboundSchema.and(
275
- z.object({ func: z.literal("avg") }).transform((v) => ({
274
+ CountAggregation$outboundSchema.and(
275
+ z.object({ func: z.literal("count") }).transform((v) => ({
276
276
  func: v.func,
277
277
  })),
278
278
  ),
@@ -282,17 +282,17 @@ export const MeterUpdate$outboundSchema: z.ZodType<
282
282
  })),
283
283
  ),
284
284
  PropertyAggregation$outboundSchema.and(
285
- z.object({ func: z.literal("avg") }).transform((v) => ({
285
+ z.object({ func: z.literal("max") }).transform((v) => ({
286
286
  func: v.func,
287
287
  })),
288
288
  ),
289
289
  PropertyAggregation$outboundSchema.and(
290
- z.object({ func: z.literal("avg") }).transform((v) => ({
290
+ z.object({ func: z.literal("min") }).transform((v) => ({
291
291
  func: v.func,
292
292
  })),
293
293
  ),
294
- CountAggregation$outboundSchema.and(
295
- z.object({ func: z.literal("count") }).transform((v) => ({
294
+ PropertyAggregation$outboundSchema.and(
295
+ z.object({ func: z.literal("sum") }).transform((v) => ({
296
296
  func: v.func,
297
297
  })),
298
298
  ),
@@ -77,10 +77,10 @@ export type OrderMetadata = string | number | number | boolean;
77
77
  export type OrderCustomFieldData = string | number | boolean | Date;
78
78
 
79
79
  export type OrderDiscount =
80
- | DiscountFixedRepeatDurationBase
80
+ | DiscountPercentageOnceForeverDurationBase
81
81
  | DiscountFixedOnceForeverDurationBase
82
82
  | DiscountPercentageRepeatDurationBase
83
- | DiscountPercentageOnceForeverDurationBase;
83
+ | DiscountFixedRepeatDurationBase;
84
84
 
85
85
  export type Order = {
86
86
  /**
@@ -164,10 +164,10 @@ export type Order = {
164
164
  userId: string;
165
165
  product: OrderProduct;
166
166
  discount:
167
- | DiscountFixedRepeatDurationBase
167
+ | DiscountPercentageOnceForeverDurationBase
168
168
  | DiscountFixedOnceForeverDurationBase
169
169
  | DiscountPercentageRepeatDurationBase
170
- | DiscountPercentageOnceForeverDurationBase
170
+ | DiscountFixedRepeatDurationBase
171
171
  | null;
172
172
  subscription: OrderSubscription | null;
173
173
  /**
@@ -284,18 +284,18 @@ export const OrderDiscount$inboundSchema: z.ZodType<
284
284
  z.ZodTypeDef,
285
285
  unknown
286
286
  > = z.union([
287
- DiscountFixedRepeatDurationBase$inboundSchema,
287
+ DiscountPercentageOnceForeverDurationBase$inboundSchema,
288
288
  DiscountFixedOnceForeverDurationBase$inboundSchema,
289
289
  DiscountPercentageRepeatDurationBase$inboundSchema,
290
- DiscountPercentageOnceForeverDurationBase$inboundSchema,
290
+ DiscountFixedRepeatDurationBase$inboundSchema,
291
291
  ]);
292
292
 
293
293
  /** @internal */
294
294
  export type OrderDiscount$Outbound =
295
- | DiscountFixedRepeatDurationBase$Outbound
295
+ | DiscountPercentageOnceForeverDurationBase$Outbound
296
296
  | DiscountFixedOnceForeverDurationBase$Outbound
297
297
  | DiscountPercentageRepeatDurationBase$Outbound
298
- | DiscountPercentageOnceForeverDurationBase$Outbound;
298
+ | DiscountFixedRepeatDurationBase$Outbound;
299
299
 
300
300
  /** @internal */
301
301
  export const OrderDiscount$outboundSchema: z.ZodType<
@@ -303,10 +303,10 @@ export const OrderDiscount$outboundSchema: z.ZodType<
303
303
  z.ZodTypeDef,
304
304
  OrderDiscount
305
305
  > = z.union([
306
- DiscountFixedRepeatDurationBase$outboundSchema,
306
+ DiscountPercentageOnceForeverDurationBase$outboundSchema,
307
307
  DiscountFixedOnceForeverDurationBase$outboundSchema,
308
308
  DiscountPercentageRepeatDurationBase$outboundSchema,
309
- DiscountPercentageOnceForeverDurationBase$outboundSchema,
309
+ DiscountFixedRepeatDurationBase$outboundSchema,
310
310
  ]);
311
311
 
312
312
  /**
@@ -384,10 +384,10 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
384
384
  product: OrderProduct$inboundSchema,
385
385
  discount: z.nullable(
386
386
  z.union([
387
- DiscountFixedRepeatDurationBase$inboundSchema,
387
+ DiscountPercentageOnceForeverDurationBase$inboundSchema,
388
388
  DiscountFixedOnceForeverDurationBase$inboundSchema,
389
389
  DiscountPercentageRepeatDurationBase$inboundSchema,
390
- DiscountPercentageOnceForeverDurationBase$inboundSchema,
390
+ DiscountFixedRepeatDurationBase$inboundSchema,
391
391
  ]),
392
392
  ),
393
393
  subscription: z.nullable(OrderSubscription$inboundSchema),
@@ -450,10 +450,10 @@ export type Order$Outbound = {
450
450
  user_id: string;
451
451
  product: OrderProduct$Outbound;
452
452
  discount:
453
- | DiscountFixedRepeatDurationBase$Outbound
453
+ | DiscountPercentageOnceForeverDurationBase$Outbound
454
454
  | DiscountFixedOnceForeverDurationBase$Outbound
455
455
  | DiscountPercentageRepeatDurationBase$Outbound
456
- | DiscountPercentageOnceForeverDurationBase$Outbound
456
+ | DiscountFixedRepeatDurationBase$Outbound
457
457
  | null;
458
458
  subscription: OrderSubscription$Outbound | null;
459
459
  items: Array<OrderItemSchema$Outbound>;
@@ -506,10 +506,10 @@ export const Order$outboundSchema: z.ZodType<
506
506
  product: OrderProduct$outboundSchema,
507
507
  discount: z.nullable(
508
508
  z.union([
509
- DiscountFixedRepeatDurationBase$outboundSchema,
509
+ DiscountPercentageOnceForeverDurationBase$outboundSchema,
510
510
  DiscountFixedOnceForeverDurationBase$outboundSchema,
511
511
  DiscountPercentageRepeatDurationBase$outboundSchema,
512
- DiscountPercentageOnceForeverDurationBase$outboundSchema,
512
+ DiscountFixedRepeatDurationBase$outboundSchema,
513
513
  ]),
514
514
  ),
515
515
  subscription: z.nullable(OrderSubscription$outboundSchema),
@@ -19,21 +19,21 @@ import {
19
19
  GenericPayment$outboundSchema,
20
20
  } from "./genericpayment.js";
21
21
 
22
- export type Payment = CardPayment | GenericPayment;
22
+ export type Payment = GenericPayment | CardPayment;
23
23
 
24
24
  /** @internal */
25
25
  export const Payment$inboundSchema: z.ZodType<Payment, z.ZodTypeDef, unknown> =
26
- z.union([CardPayment$inboundSchema, GenericPayment$inboundSchema]);
26
+ z.union([GenericPayment$inboundSchema, CardPayment$inboundSchema]);
27
27
 
28
28
  /** @internal */
29
- export type Payment$Outbound = CardPayment$Outbound | GenericPayment$Outbound;
29
+ export type Payment$Outbound = GenericPayment$Outbound | CardPayment$Outbound;
30
30
 
31
31
  /** @internal */
32
32
  export const Payment$outboundSchema: z.ZodType<
33
33
  Payment$Outbound,
34
34
  z.ZodTypeDef,
35
35
  Payment
36
- > = z.union([CardPayment$outboundSchema, GenericPayment$outboundSchema]);
36
+ > = z.union([GenericPayment$outboundSchema, CardPayment$outboundSchema]);
37
37
 
38
38
  /**
39
39
  * @internal