@polar-sh/sdk 0.46.7 → 0.47.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 (482) hide show
  1. package/README.md +29 -19
  2. package/dist/commonjs/funcs/metricsCreateDashboard.d.ts +21 -0
  3. package/dist/commonjs/funcs/metricsCreateDashboard.d.ts.map +1 -0
  4. package/dist/commonjs/funcs/metricsCreateDashboard.js +122 -0
  5. package/dist/commonjs/funcs/metricsCreateDashboard.js.map +1 -0
  6. package/dist/commonjs/funcs/metricsDeleteDashboard.d.ts +20 -0
  7. package/dist/commonjs/funcs/metricsDeleteDashboard.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/metricsDeleteDashboard.js +126 -0
  9. package/dist/commonjs/funcs/metricsDeleteDashboard.js.map +1 -0
  10. package/dist/commonjs/funcs/metricsGetDashboard.d.ts +21 -0
  11. package/dist/commonjs/funcs/metricsGetDashboard.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/metricsGetDashboard.js +127 -0
  13. package/dist/commonjs/funcs/metricsGetDashboard.js.map +1 -0
  14. package/dist/commonjs/funcs/metricsListDashboards.d.ts +21 -0
  15. package/dist/commonjs/funcs/metricsListDashboards.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/metricsListDashboards.js +125 -0
  17. package/dist/commonjs/funcs/metricsListDashboards.js.map +1 -0
  18. package/dist/commonjs/funcs/metricsUpdateDashboard.d.ts +21 -0
  19. package/dist/commonjs/funcs/metricsUpdateDashboard.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/metricsUpdateDashboard.js +130 -0
  21. package/dist/commonjs/funcs/metricsUpdateDashboard.js.map +1 -0
  22. package/dist/commonjs/funcs/subscriptionsList.js +3 -0
  23. package/dist/commonjs/funcs/subscriptionsList.js.map +1 -1
  24. package/dist/commonjs/lib/config.d.ts +3 -3
  25. package/dist/commonjs/lib/config.js +3 -3
  26. package/dist/commonjs/lib/config.js.map +1 -1
  27. package/dist/commonjs/lib/security.d.ts +1 -1
  28. package/dist/commonjs/lib/security.d.ts.map +1 -1
  29. package/dist/commonjs/lib/security.js +19 -8
  30. package/dist/commonjs/lib/security.js.map +1 -1
  31. package/dist/commonjs/models/components/availablescope.d.ts +1 -0
  32. package/dist/commonjs/models/components/availablescope.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/availablescope.js +1 -0
  34. package/dist/commonjs/models/components/availablescope.js.map +1 -1
  35. package/dist/commonjs/models/components/benefitgrant.d.ts +0 -3
  36. package/dist/commonjs/models/components/benefitgrant.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/benefitgrant.js.map +1 -1
  38. package/dist/commonjs/models/components/benefitgrantcustomwebhook.d.ts +0 -3
  39. package/dist/commonjs/models/components/benefitgrantcustomwebhook.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/benefitgrantcustomwebhook.js.map +1 -1
  41. package/dist/commonjs/models/components/benefitgrantdiscordwebhook.d.ts +0 -3
  42. package/dist/commonjs/models/components/benefitgrantdiscordwebhook.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/benefitgrantdiscordwebhook.js.map +1 -1
  44. package/dist/commonjs/models/components/benefitgrantdownloadableswebhook.d.ts +0 -3
  45. package/dist/commonjs/models/components/benefitgrantdownloadableswebhook.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/benefitgrantdownloadableswebhook.js.map +1 -1
  47. package/dist/commonjs/models/components/benefitgrantfeatureflagwebhook.d.ts +0 -3
  48. package/dist/commonjs/models/components/benefitgrantfeatureflagwebhook.d.ts.map +1 -1
  49. package/dist/commonjs/models/components/benefitgrantfeatureflagwebhook.js.map +1 -1
  50. package/dist/commonjs/models/components/benefitgrantgithubrepositorywebhook.d.ts +0 -3
  51. package/dist/commonjs/models/components/benefitgrantgithubrepositorywebhook.d.ts.map +1 -1
  52. package/dist/commonjs/models/components/benefitgrantgithubrepositorywebhook.js.map +1 -1
  53. package/dist/commonjs/models/components/benefitgrantlicensekeyswebhook.d.ts +0 -3
  54. package/dist/commonjs/models/components/benefitgrantlicensekeyswebhook.d.ts.map +1 -1
  55. package/dist/commonjs/models/components/benefitgrantlicensekeyswebhook.js.map +1 -1
  56. package/dist/commonjs/models/components/benefitgrantmetercreditwebhook.d.ts +0 -3
  57. package/dist/commonjs/models/components/benefitgrantmetercreditwebhook.d.ts.map +1 -1
  58. package/dist/commonjs/models/components/benefitgrantmetercreditwebhook.js.map +1 -1
  59. package/dist/commonjs/models/components/customer.d.ts +4 -84
  60. package/dist/commonjs/models/components/customer.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/customer.js +5 -77
  62. package/dist/commonjs/models/components/customer.js.map +1 -1
  63. package/dist/commonjs/models/components/customercreate.d.ts +4 -67
  64. package/dist/commonjs/models/components/customercreate.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/customercreate.js +7 -64
  66. package/dist/commonjs/models/components/customercreate.js.map +1 -1
  67. package/dist/commonjs/models/components/customercreatedmetadata.d.ts +1 -1
  68. package/dist/commonjs/models/components/customercreatedmetadata.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/customercreatedmetadata.js +1 -1
  70. package/dist/commonjs/models/components/customercreatedmetadata.js.map +1 -1
  71. package/dist/commonjs/models/components/customerdeletedmetadata.d.ts +1 -1
  72. package/dist/commonjs/models/components/customerdeletedmetadata.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/customerdeletedmetadata.js +1 -1
  74. package/dist/commonjs/models/components/customerdeletedmetadata.js.map +1 -1
  75. package/dist/commonjs/models/components/customerindividual.d.ts +94 -0
  76. package/dist/commonjs/models/components/customerindividual.d.ts.map +1 -0
  77. package/dist/commonjs/models/components/customerindividual.js +127 -0
  78. package/dist/commonjs/models/components/customerindividual.js.map +1 -0
  79. package/dist/commonjs/models/components/customerindividualcreate.d.ts +69 -0
  80. package/dist/commonjs/models/components/customerindividualcreate.d.ts.map +1 -0
  81. package/dist/commonjs/models/components/customerindividualcreate.js +75 -0
  82. package/dist/commonjs/models/components/customerindividualcreate.js.map +1 -0
  83. package/dist/commonjs/models/components/customermeter.d.ts +0 -3
  84. package/dist/commonjs/models/components/customermeter.d.ts.map +1 -1
  85. package/dist/commonjs/models/components/customermeter.js.map +1 -1
  86. package/dist/commonjs/models/components/customerportalcustomer.d.ts +1 -1
  87. package/dist/commonjs/models/components/customerportalcustomer.d.ts.map +1 -1
  88. package/dist/commonjs/models/components/customerportalcustomer.js +1 -1
  89. package/dist/commonjs/models/components/customerportalcustomer.js.map +1 -1
  90. package/dist/commonjs/models/components/customersession.d.ts +0 -3
  91. package/dist/commonjs/models/components/customersession.d.ts.map +1 -1
  92. package/dist/commonjs/models/components/customersession.js.map +1 -1
  93. package/dist/commonjs/models/components/customerstate.d.ts +4 -108
  94. package/dist/commonjs/models/components/customerstate.d.ts.map +1 -1
  95. package/dist/commonjs/models/components/customerstate.js +11 -92
  96. package/dist/commonjs/models/components/customerstate.js.map +1 -1
  97. package/dist/commonjs/models/components/customerstateindividual.d.ts +118 -0
  98. package/dist/commonjs/models/components/customerstateindividual.d.ts.map +1 -0
  99. package/dist/commonjs/models/components/customerstateindividual.js +142 -0
  100. package/dist/commonjs/models/components/customerstateindividual.js.map +1 -0
  101. package/dist/commonjs/models/components/customerstateteam.d.ts +118 -0
  102. package/dist/commonjs/models/components/customerstateteam.d.ts.map +1 -0
  103. package/dist/commonjs/models/components/customerstateteam.js +142 -0
  104. package/dist/commonjs/models/components/customerstateteam.js.map +1 -0
  105. package/dist/commonjs/models/components/customerteam.d.ts +94 -0
  106. package/dist/commonjs/models/components/customerteam.d.ts.map +1 -0
  107. package/dist/commonjs/models/components/customerteam.js +127 -0
  108. package/dist/commonjs/models/components/customerteam.js.map +1 -0
  109. package/dist/commonjs/models/components/customerteamcreate.d.ts +69 -0
  110. package/dist/commonjs/models/components/customerteamcreate.d.ts.map +1 -0
  111. package/dist/commonjs/models/components/customerteamcreate.js +75 -0
  112. package/dist/commonjs/models/components/customerteamcreate.js.map +1 -0
  113. package/dist/commonjs/models/components/customerupdatedmetadata.d.ts +1 -1
  114. package/dist/commonjs/models/components/customerupdatedmetadata.d.ts.map +1 -1
  115. package/dist/commonjs/models/components/customerupdatedmetadata.js +1 -1
  116. package/dist/commonjs/models/components/customerupdatedmetadata.js.map +1 -1
  117. package/dist/commonjs/models/components/licensekeycustomer.d.ts +2 -5
  118. package/dist/commonjs/models/components/licensekeycustomer.d.ts.map +1 -1
  119. package/dist/commonjs/models/components/licensekeycustomer.js +2 -2
  120. package/dist/commonjs/models/components/licensekeycustomer.js.map +1 -1
  121. package/dist/commonjs/models/components/{listresource.d.ts → listresourcepayment.d.ts} +4 -4
  122. package/dist/commonjs/models/components/listresourcepayment.d.ts.map +1 -0
  123. package/dist/commonjs/models/components/{listresource.js → listresourcepayment.js} +6 -6
  124. package/dist/commonjs/models/components/listresourcepayment.js.map +1 -0
  125. package/dist/{esm/models/components/ownercreate.d.ts → commonjs/models/components/memberownercreate.d.ts} +7 -7
  126. package/dist/commonjs/models/components/memberownercreate.d.ts.map +1 -0
  127. package/dist/commonjs/models/components/{ownercreate.js → memberownercreate.js} +7 -7
  128. package/dist/commonjs/models/components/memberownercreate.js.map +1 -0
  129. package/dist/commonjs/models/components/metricdashboardcreate.d.ts +28 -0
  130. package/dist/commonjs/models/components/metricdashboardcreate.d.ts.map +1 -0
  131. package/dist/commonjs/models/components/metricdashboardcreate.js +56 -0
  132. package/dist/commonjs/models/components/metricdashboardcreate.js.map +1 -0
  133. package/dist/commonjs/models/components/metricdashboardschema.d.ts +36 -0
  134. package/dist/commonjs/models/components/metricdashboardschema.d.ts.map +1 -0
  135. package/dist/commonjs/models/components/metricdashboardschema.js +62 -0
  136. package/dist/commonjs/models/components/metricdashboardschema.js.map +1 -0
  137. package/dist/commonjs/models/components/metricdashboardupdate.d.ts +23 -0
  138. package/dist/commonjs/models/components/metricdashboardupdate.d.ts.map +1 -0
  139. package/dist/commonjs/models/components/metricdashboardupdate.js +50 -0
  140. package/dist/commonjs/models/components/metricdashboardupdate.js.map +1 -0
  141. package/dist/commonjs/models/components/oauth2clientconfiguration.js +1 -1
  142. package/dist/commonjs/models/components/oauth2clientconfiguration.js.map +1 -1
  143. package/dist/commonjs/models/components/oauth2clientconfigurationupdate.js +1 -1
  144. package/dist/commonjs/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  145. package/dist/commonjs/models/components/ordercustomer.d.ts +4 -7
  146. package/dist/commonjs/models/components/ordercustomer.d.ts.map +1 -1
  147. package/dist/commonjs/models/components/ordercustomer.js +4 -4
  148. package/dist/commonjs/models/components/ordercustomer.js.map +1 -1
  149. package/dist/commonjs/models/components/ordervoidedevent.d.ts +67 -0
  150. package/dist/commonjs/models/components/ordervoidedevent.d.ts.map +1 -0
  151. package/dist/commonjs/models/components/ordervoidedevent.js +76 -0
  152. package/dist/commonjs/models/components/ordervoidedevent.js.map +1 -0
  153. package/dist/commonjs/models/components/ordervoidedmetadata.d.ts +12 -0
  154. package/dist/commonjs/models/components/ordervoidedmetadata.d.ts.map +1 -0
  155. package/dist/commonjs/models/components/ordervoidedmetadata.js +57 -0
  156. package/dist/commonjs/models/components/ordervoidedmetadata.js.map +1 -0
  157. package/dist/commonjs/models/components/scope.d.ts +1 -0
  158. package/dist/commonjs/models/components/scope.d.ts.map +1 -1
  159. package/dist/commonjs/models/components/scope.js +1 -0
  160. package/dist/commonjs/models/components/scope.js.map +1 -1
  161. package/dist/commonjs/models/components/subscriptioncustomer.d.ts +4 -7
  162. package/dist/commonjs/models/components/subscriptioncustomer.d.ts.map +1 -1
  163. package/dist/commonjs/models/components/subscriptioncustomer.js +4 -4
  164. package/dist/commonjs/models/components/subscriptioncustomer.js.map +1 -1
  165. package/dist/commonjs/models/components/systemevent.d.ts +2 -1
  166. package/dist/commonjs/models/components/systemevent.d.ts.map +1 -1
  167. package/dist/commonjs/models/components/systemevent.js +2 -0
  168. package/dist/commonjs/models/components/systemevent.js.map +1 -1
  169. package/dist/commonjs/models/components/webhookcustomercreatedpayload.d.ts +0 -3
  170. package/dist/commonjs/models/components/webhookcustomercreatedpayload.d.ts.map +1 -1
  171. package/dist/commonjs/models/components/webhookcustomercreatedpayload.js.map +1 -1
  172. package/dist/commonjs/models/components/webhookcustomerdeletedpayload.d.ts +0 -3
  173. package/dist/commonjs/models/components/webhookcustomerdeletedpayload.d.ts.map +1 -1
  174. package/dist/commonjs/models/components/webhookcustomerdeletedpayload.js.map +1 -1
  175. package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.d.ts +0 -9
  176. package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.d.ts.map +1 -1
  177. package/dist/commonjs/models/components/webhookcustomerstatechangedpayload.js.map +1 -1
  178. package/dist/commonjs/models/components/webhookcustomerupdatedpayload.d.ts +0 -3
  179. package/dist/commonjs/models/components/webhookcustomerupdatedpayload.d.ts.map +1 -1
  180. package/dist/commonjs/models/components/webhookcustomerupdatedpayload.js.map +1 -1
  181. package/dist/commonjs/models/operations/metricsdeletedashboard.d.ts +15 -0
  182. package/dist/commonjs/models/operations/metricsdeletedashboard.d.ts.map +1 -0
  183. package/dist/commonjs/models/operations/metricsdeletedashboard.js +49 -0
  184. package/dist/commonjs/models/operations/metricsdeletedashboard.js.map +1 -0
  185. package/dist/commonjs/models/operations/metricsgetdashboard.d.ts +15 -0
  186. package/dist/commonjs/models/operations/metricsgetdashboard.d.ts.map +1 -0
  187. package/dist/commonjs/models/operations/metricsgetdashboard.js +49 -0
  188. package/dist/commonjs/models/operations/metricsgetdashboard.js.map +1 -0
  189. package/dist/commonjs/models/operations/metricslistdashboards.d.ts +24 -0
  190. package/dist/commonjs/models/operations/metricslistdashboards.d.ts.map +1 -0
  191. package/dist/commonjs/models/operations/metricslistdashboards.js +61 -0
  192. package/dist/commonjs/models/operations/metricslistdashboards.js.map +1 -0
  193. package/dist/commonjs/models/operations/metricsupdatedashboard.d.ts +18 -0
  194. package/dist/commonjs/models/operations/metricsupdatedashboard.d.ts.map +1 -0
  195. package/dist/commonjs/models/operations/metricsupdatedashboard.js +56 -0
  196. package/dist/commonjs/models/operations/metricsupdatedashboard.js.map +1 -0
  197. package/dist/commonjs/models/operations/paymentslist.d.ts +2 -2
  198. package/dist/commonjs/models/operations/paymentslist.d.ts.map +1 -1
  199. package/dist/commonjs/models/operations/paymentslist.js +2 -2
  200. package/dist/commonjs/models/operations/paymentslist.js.map +1 -1
  201. package/dist/commonjs/models/operations/subscriptionslist.d.ts +25 -0
  202. package/dist/commonjs/models/operations/subscriptionslist.d.ts.map +1 -1
  203. package/dist/commonjs/models/operations/subscriptionslist.js +20 -1
  204. package/dist/commonjs/models/operations/subscriptionslist.js.map +1 -1
  205. package/dist/commonjs/sdk/metrics.d.ts +51 -0
  206. package/dist/commonjs/sdk/metrics.d.ts.map +1 -1
  207. package/dist/commonjs/sdk/metrics.js +60 -0
  208. package/dist/commonjs/sdk/metrics.js.map +1 -1
  209. package/dist/esm/funcs/metricsCreateDashboard.d.ts +21 -0
  210. package/dist/esm/funcs/metricsCreateDashboard.d.ts.map +1 -0
  211. package/dist/esm/funcs/metricsCreateDashboard.js +86 -0
  212. package/dist/esm/funcs/metricsCreateDashboard.js.map +1 -0
  213. package/dist/esm/funcs/metricsDeleteDashboard.d.ts +20 -0
  214. package/dist/esm/funcs/metricsDeleteDashboard.d.ts.map +1 -0
  215. package/dist/esm/funcs/metricsDeleteDashboard.js +90 -0
  216. package/dist/esm/funcs/metricsDeleteDashboard.js.map +1 -0
  217. package/dist/esm/funcs/metricsGetDashboard.d.ts +21 -0
  218. package/dist/esm/funcs/metricsGetDashboard.d.ts.map +1 -0
  219. package/dist/esm/funcs/metricsGetDashboard.js +91 -0
  220. package/dist/esm/funcs/metricsGetDashboard.js.map +1 -0
  221. package/dist/esm/funcs/metricsListDashboards.d.ts +21 -0
  222. package/dist/esm/funcs/metricsListDashboards.d.ts.map +1 -0
  223. package/dist/esm/funcs/metricsListDashboards.js +89 -0
  224. package/dist/esm/funcs/metricsListDashboards.js.map +1 -0
  225. package/dist/esm/funcs/metricsUpdateDashboard.d.ts +21 -0
  226. package/dist/esm/funcs/metricsUpdateDashboard.d.ts.map +1 -0
  227. package/dist/esm/funcs/metricsUpdateDashboard.js +94 -0
  228. package/dist/esm/funcs/metricsUpdateDashboard.js.map +1 -0
  229. package/dist/esm/funcs/subscriptionsList.js +3 -0
  230. package/dist/esm/funcs/subscriptionsList.js.map +1 -1
  231. package/dist/esm/lib/config.d.ts +3 -3
  232. package/dist/esm/lib/config.js +3 -3
  233. package/dist/esm/lib/config.js.map +1 -1
  234. package/dist/esm/lib/security.d.ts +1 -1
  235. package/dist/esm/lib/security.d.ts.map +1 -1
  236. package/dist/esm/lib/security.js +19 -8
  237. package/dist/esm/lib/security.js.map +1 -1
  238. package/dist/esm/models/components/availablescope.d.ts +1 -0
  239. package/dist/esm/models/components/availablescope.d.ts.map +1 -1
  240. package/dist/esm/models/components/availablescope.js +1 -0
  241. package/dist/esm/models/components/availablescope.js.map +1 -1
  242. package/dist/esm/models/components/benefitgrant.d.ts +0 -3
  243. package/dist/esm/models/components/benefitgrant.d.ts.map +1 -1
  244. package/dist/esm/models/components/benefitgrant.js.map +1 -1
  245. package/dist/esm/models/components/benefitgrantcustomwebhook.d.ts +0 -3
  246. package/dist/esm/models/components/benefitgrantcustomwebhook.d.ts.map +1 -1
  247. package/dist/esm/models/components/benefitgrantcustomwebhook.js.map +1 -1
  248. package/dist/esm/models/components/benefitgrantdiscordwebhook.d.ts +0 -3
  249. package/dist/esm/models/components/benefitgrantdiscordwebhook.d.ts.map +1 -1
  250. package/dist/esm/models/components/benefitgrantdiscordwebhook.js.map +1 -1
  251. package/dist/esm/models/components/benefitgrantdownloadableswebhook.d.ts +0 -3
  252. package/dist/esm/models/components/benefitgrantdownloadableswebhook.d.ts.map +1 -1
  253. package/dist/esm/models/components/benefitgrantdownloadableswebhook.js.map +1 -1
  254. package/dist/esm/models/components/benefitgrantfeatureflagwebhook.d.ts +0 -3
  255. package/dist/esm/models/components/benefitgrantfeatureflagwebhook.d.ts.map +1 -1
  256. package/dist/esm/models/components/benefitgrantfeatureflagwebhook.js.map +1 -1
  257. package/dist/esm/models/components/benefitgrantgithubrepositorywebhook.d.ts +0 -3
  258. package/dist/esm/models/components/benefitgrantgithubrepositorywebhook.d.ts.map +1 -1
  259. package/dist/esm/models/components/benefitgrantgithubrepositorywebhook.js.map +1 -1
  260. package/dist/esm/models/components/benefitgrantlicensekeyswebhook.d.ts +0 -3
  261. package/dist/esm/models/components/benefitgrantlicensekeyswebhook.d.ts.map +1 -1
  262. package/dist/esm/models/components/benefitgrantlicensekeyswebhook.js.map +1 -1
  263. package/dist/esm/models/components/benefitgrantmetercreditwebhook.d.ts +0 -3
  264. package/dist/esm/models/components/benefitgrantmetercreditwebhook.d.ts.map +1 -1
  265. package/dist/esm/models/components/benefitgrantmetercreditwebhook.js.map +1 -1
  266. package/dist/esm/models/components/customer.d.ts +4 -84
  267. package/dist/esm/models/components/customer.d.ts.map +1 -1
  268. package/dist/esm/models/components/customer.js +4 -74
  269. package/dist/esm/models/components/customer.js.map +1 -1
  270. package/dist/esm/models/components/customercreate.d.ts +4 -67
  271. package/dist/esm/models/components/customercreate.d.ts.map +1 -1
  272. package/dist/esm/models/components/customercreate.js +6 -29
  273. package/dist/esm/models/components/customercreate.js.map +1 -1
  274. package/dist/esm/models/components/customercreatedmetadata.d.ts +1 -1
  275. package/dist/esm/models/components/customercreatedmetadata.d.ts.map +1 -1
  276. package/dist/esm/models/components/customercreatedmetadata.js +1 -1
  277. package/dist/esm/models/components/customercreatedmetadata.js.map +1 -1
  278. package/dist/esm/models/components/customerdeletedmetadata.d.ts +1 -1
  279. package/dist/esm/models/components/customerdeletedmetadata.d.ts.map +1 -1
  280. package/dist/esm/models/components/customerdeletedmetadata.js +1 -1
  281. package/dist/esm/models/components/customerdeletedmetadata.js.map +1 -1
  282. package/dist/esm/models/components/customerindividual.d.ts +94 -0
  283. package/dist/esm/models/components/customerindividual.d.ts.map +1 -0
  284. package/dist/esm/models/components/customerindividual.js +87 -0
  285. package/dist/esm/models/components/customerindividual.js.map +1 -0
  286. package/dist/esm/models/components/customerindividualcreate.d.ts +69 -0
  287. package/dist/esm/models/components/customerindividualcreate.d.ts.map +1 -0
  288. package/dist/esm/models/components/customerindividualcreate.js +37 -0
  289. package/dist/esm/models/components/customerindividualcreate.js.map +1 -0
  290. package/dist/esm/models/components/customermeter.d.ts +0 -3
  291. package/dist/esm/models/components/customermeter.d.ts.map +1 -1
  292. package/dist/esm/models/components/customermeter.js.map +1 -1
  293. package/dist/esm/models/components/customerportalcustomer.d.ts +1 -1
  294. package/dist/esm/models/components/customerportalcustomer.d.ts.map +1 -1
  295. package/dist/esm/models/components/customerportalcustomer.js +1 -1
  296. package/dist/esm/models/components/customerportalcustomer.js.map +1 -1
  297. package/dist/esm/models/components/customersession.d.ts +0 -3
  298. package/dist/esm/models/components/customersession.d.ts.map +1 -1
  299. package/dist/esm/models/components/customersession.js.map +1 -1
  300. package/dist/esm/models/components/customerstate.d.ts +4 -108
  301. package/dist/esm/models/components/customerstate.d.ts.map +1 -1
  302. package/dist/esm/models/components/customerstate.js +10 -89
  303. package/dist/esm/models/components/customerstate.js.map +1 -1
  304. package/dist/esm/models/components/customerstateindividual.d.ts +118 -0
  305. package/dist/esm/models/components/customerstateindividual.d.ts.map +1 -0
  306. package/dist/esm/models/components/customerstateindividual.js +102 -0
  307. package/dist/esm/models/components/customerstateindividual.js.map +1 -0
  308. package/dist/esm/models/components/customerstateteam.d.ts +118 -0
  309. package/dist/esm/models/components/customerstateteam.d.ts.map +1 -0
  310. package/dist/esm/models/components/customerstateteam.js +102 -0
  311. package/dist/esm/models/components/customerstateteam.js.map +1 -0
  312. package/dist/esm/models/components/customerteam.d.ts +94 -0
  313. package/dist/esm/models/components/customerteam.d.ts.map +1 -0
  314. package/dist/esm/models/components/customerteam.js +87 -0
  315. package/dist/esm/models/components/customerteam.js.map +1 -0
  316. package/dist/esm/models/components/customerteamcreate.d.ts +69 -0
  317. package/dist/esm/models/components/customerteamcreate.d.ts.map +1 -0
  318. package/dist/esm/models/components/customerteamcreate.js +37 -0
  319. package/dist/esm/models/components/customerteamcreate.js.map +1 -0
  320. package/dist/esm/models/components/customerupdatedmetadata.d.ts +1 -1
  321. package/dist/esm/models/components/customerupdatedmetadata.d.ts.map +1 -1
  322. package/dist/esm/models/components/customerupdatedmetadata.js +1 -1
  323. package/dist/esm/models/components/customerupdatedmetadata.js.map +1 -1
  324. package/dist/esm/models/components/licensekeycustomer.d.ts +2 -5
  325. package/dist/esm/models/components/licensekeycustomer.d.ts.map +1 -1
  326. package/dist/esm/models/components/licensekeycustomer.js +2 -2
  327. package/dist/esm/models/components/licensekeycustomer.js.map +1 -1
  328. package/dist/esm/models/components/{listresource.d.ts → listresourcepayment.d.ts} +4 -4
  329. package/dist/esm/models/components/listresourcepayment.d.ts.map +1 -0
  330. package/dist/esm/models/components/{listresource.js → listresourcepayment.js} +4 -4
  331. package/dist/esm/models/components/listresourcepayment.js.map +1 -0
  332. package/dist/{commonjs/models/components/ownercreate.d.ts → esm/models/components/memberownercreate.d.ts} +7 -7
  333. package/dist/esm/models/components/memberownercreate.d.ts.map +1 -0
  334. package/dist/esm/models/components/{ownercreate.js → memberownercreate.js} +5 -5
  335. package/dist/esm/models/components/memberownercreate.js.map +1 -0
  336. package/dist/esm/models/components/metricdashboardcreate.d.ts +28 -0
  337. package/dist/esm/models/components/metricdashboardcreate.d.ts.map +1 -0
  338. package/dist/esm/models/components/metricdashboardcreate.js +19 -0
  339. package/dist/esm/models/components/metricdashboardcreate.js.map +1 -0
  340. package/dist/esm/models/components/metricdashboardschema.d.ts +36 -0
  341. package/dist/esm/models/components/metricdashboardschema.d.ts.map +1 -0
  342. package/dist/esm/models/components/metricdashboardschema.js +25 -0
  343. package/dist/esm/models/components/metricdashboardschema.js.map +1 -0
  344. package/dist/esm/models/components/metricdashboardupdate.d.ts +23 -0
  345. package/dist/esm/models/components/metricdashboardupdate.d.ts.map +1 -0
  346. package/dist/esm/models/components/metricdashboardupdate.js +13 -0
  347. package/dist/esm/models/components/metricdashboardupdate.js.map +1 -0
  348. package/dist/esm/models/components/oauth2clientconfiguration.js +1 -1
  349. package/dist/esm/models/components/oauth2clientconfiguration.js.map +1 -1
  350. package/dist/esm/models/components/oauth2clientconfigurationupdate.js +1 -1
  351. package/dist/esm/models/components/oauth2clientconfigurationupdate.js.map +1 -1
  352. package/dist/esm/models/components/ordercustomer.d.ts +4 -7
  353. package/dist/esm/models/components/ordercustomer.d.ts.map +1 -1
  354. package/dist/esm/models/components/ordercustomer.js +4 -4
  355. package/dist/esm/models/components/ordercustomer.js.map +1 -1
  356. package/dist/esm/models/components/ordervoidedevent.d.ts +67 -0
  357. package/dist/esm/models/components/ordervoidedevent.d.ts.map +1 -0
  358. package/dist/esm/models/components/ordervoidedevent.js +39 -0
  359. package/dist/esm/models/components/ordervoidedevent.js.map +1 -0
  360. package/dist/esm/models/components/ordervoidedmetadata.d.ts +12 -0
  361. package/dist/esm/models/components/ordervoidedmetadata.d.ts.map +1 -0
  362. package/dist/esm/models/components/ordervoidedmetadata.js +20 -0
  363. package/dist/esm/models/components/ordervoidedmetadata.js.map +1 -0
  364. package/dist/esm/models/components/scope.d.ts +1 -0
  365. package/dist/esm/models/components/scope.d.ts.map +1 -1
  366. package/dist/esm/models/components/scope.js +1 -0
  367. package/dist/esm/models/components/scope.js.map +1 -1
  368. package/dist/esm/models/components/subscriptioncustomer.d.ts +4 -7
  369. package/dist/esm/models/components/subscriptioncustomer.d.ts.map +1 -1
  370. package/dist/esm/models/components/subscriptioncustomer.js +4 -4
  371. package/dist/esm/models/components/subscriptioncustomer.js.map +1 -1
  372. package/dist/esm/models/components/systemevent.d.ts +2 -1
  373. package/dist/esm/models/components/systemevent.d.ts.map +1 -1
  374. package/dist/esm/models/components/systemevent.js +2 -0
  375. package/dist/esm/models/components/systemevent.js.map +1 -1
  376. package/dist/esm/models/components/webhookcustomercreatedpayload.d.ts +0 -3
  377. package/dist/esm/models/components/webhookcustomercreatedpayload.d.ts.map +1 -1
  378. package/dist/esm/models/components/webhookcustomercreatedpayload.js.map +1 -1
  379. package/dist/esm/models/components/webhookcustomerdeletedpayload.d.ts +0 -3
  380. package/dist/esm/models/components/webhookcustomerdeletedpayload.d.ts.map +1 -1
  381. package/dist/esm/models/components/webhookcustomerdeletedpayload.js.map +1 -1
  382. package/dist/esm/models/components/webhookcustomerstatechangedpayload.d.ts +0 -9
  383. package/dist/esm/models/components/webhookcustomerstatechangedpayload.d.ts.map +1 -1
  384. package/dist/esm/models/components/webhookcustomerstatechangedpayload.js.map +1 -1
  385. package/dist/esm/models/components/webhookcustomerupdatedpayload.d.ts +0 -3
  386. package/dist/esm/models/components/webhookcustomerupdatedpayload.d.ts.map +1 -1
  387. package/dist/esm/models/components/webhookcustomerupdatedpayload.js.map +1 -1
  388. package/dist/esm/models/operations/metricsdeletedashboard.d.ts +15 -0
  389. package/dist/esm/models/operations/metricsdeletedashboard.d.ts.map +1 -0
  390. package/dist/esm/models/operations/metricsdeletedashboard.js +12 -0
  391. package/dist/esm/models/operations/metricsdeletedashboard.js.map +1 -0
  392. package/dist/esm/models/operations/metricsgetdashboard.d.ts +15 -0
  393. package/dist/esm/models/operations/metricsgetdashboard.d.ts.map +1 -0
  394. package/dist/esm/models/operations/metricsgetdashboard.js +12 -0
  395. package/dist/esm/models/operations/metricsgetdashboard.js.map +1 -0
  396. package/dist/esm/models/operations/metricslistdashboards.d.ts +24 -0
  397. package/dist/esm/models/operations/metricslistdashboards.d.ts.map +1 -0
  398. package/dist/esm/models/operations/metricslistdashboards.js +23 -0
  399. package/dist/esm/models/operations/metricslistdashboards.js.map +1 -0
  400. package/dist/esm/models/operations/metricsupdatedashboard.d.ts +18 -0
  401. package/dist/esm/models/operations/metricsupdatedashboard.d.ts.map +1 -0
  402. package/dist/esm/models/operations/metricsupdatedashboard.js +19 -0
  403. package/dist/esm/models/operations/metricsupdatedashboard.js.map +1 -0
  404. package/dist/esm/models/operations/paymentslist.d.ts +2 -2
  405. package/dist/esm/models/operations/paymentslist.d.ts.map +1 -1
  406. package/dist/esm/models/operations/paymentslist.js +2 -2
  407. package/dist/esm/models/operations/paymentslist.js.map +1 -1
  408. package/dist/esm/models/operations/subscriptionslist.d.ts +25 -0
  409. package/dist/esm/models/operations/subscriptionslist.d.ts.map +1 -1
  410. package/dist/esm/models/operations/subscriptionslist.js +18 -0
  411. package/dist/esm/models/operations/subscriptionslist.js.map +1 -1
  412. package/dist/esm/sdk/metrics.d.ts +51 -0
  413. package/dist/esm/sdk/metrics.d.ts.map +1 -1
  414. package/dist/esm/sdk/metrics.js +60 -0
  415. package/dist/esm/sdk/metrics.js.map +1 -1
  416. package/jsr.json +1 -1
  417. package/package.json +1 -1
  418. package/src/funcs/metricsCreateDashboard.ts +182 -0
  419. package/src/funcs/metricsDeleteDashboard.ts +183 -0
  420. package/src/funcs/metricsGetDashboard.ts +187 -0
  421. package/src/funcs/metricsListDashboards.ts +186 -0
  422. package/src/funcs/metricsUpdateDashboard.ts +190 -0
  423. package/src/funcs/subscriptionsList.ts +3 -0
  424. package/src/lib/config.ts +3 -3
  425. package/src/lib/security.ts +14 -2
  426. package/src/models/components/availablescope.ts +1 -0
  427. package/src/models/components/benefitgrant.ts +0 -3
  428. package/src/models/components/benefitgrantcustomwebhook.ts +0 -3
  429. package/src/models/components/benefitgrantdiscordwebhook.ts +0 -3
  430. package/src/models/components/benefitgrantdownloadableswebhook.ts +0 -3
  431. package/src/models/components/benefitgrantfeatureflagwebhook.ts +0 -3
  432. package/src/models/components/benefitgrantgithubrepositorywebhook.ts +0 -3
  433. package/src/models/components/benefitgrantlicensekeyswebhook.ts +0 -3
  434. package/src/models/components/benefitgrantmetercreditwebhook.ts +0 -3
  435. package/src/models/components/customer.ts +17 -192
  436. package/src/models/components/customercreate.ts +16 -114
  437. package/src/models/components/customercreatedmetadata.ts +2 -2
  438. package/src/models/components/customerdeletedmetadata.ts +2 -2
  439. package/src/models/components/customerindividual.ts +231 -0
  440. package/src/models/components/customerindividualcreate.ts +140 -0
  441. package/src/models/components/customermeter.ts +0 -3
  442. package/src/models/components/customerportalcustomer.ts +2 -2
  443. package/src/models/components/customersession.ts +0 -3
  444. package/src/models/components/customerstate.ts +22 -248
  445. package/src/models/components/customerstateindividual.ts +284 -0
  446. package/src/models/components/customerstateteam.ts +282 -0
  447. package/src/models/components/customerteam.ts +227 -0
  448. package/src/models/components/customerteamcreate.ts +134 -0
  449. package/src/models/components/customerupdatedmetadata.ts +2 -2
  450. package/src/models/components/licensekeycustomer.ts +4 -7
  451. package/src/models/components/{listresource.ts → listresourcepayment.ts} +12 -10
  452. package/src/models/components/{ownercreate.ts → memberownercreate.ts} +14 -10
  453. package/src/models/components/metricdashboardcreate.ts +56 -0
  454. package/src/models/components/metricdashboardschema.ts +76 -0
  455. package/src/models/components/metricdashboardupdate.ts +42 -0
  456. package/src/models/components/oauth2clientconfiguration.ts +1 -1
  457. package/src/models/components/oauth2clientconfigurationupdate.ts +1 -1
  458. package/src/models/components/ordercustomer.ts +8 -11
  459. package/src/models/components/ordervoidedevent.ts +120 -0
  460. package/src/models/components/ordervoidedmetadata.ts +42 -0
  461. package/src/models/components/scope.ts +1 -0
  462. package/src/models/components/subscriptioncustomer.ts +8 -11
  463. package/src/models/components/systemevent.ts +6 -0
  464. package/src/models/components/webhookcustomercreatedpayload.ts +0 -3
  465. package/src/models/components/webhookcustomerdeletedpayload.ts +0 -3
  466. package/src/models/components/webhookcustomerstatechangedpayload.ts +0 -9
  467. package/src/models/components/webhookcustomerupdatedpayload.ts +0 -3
  468. package/src/models/operations/metricsdeletedashboard.ts +35 -0
  469. package/src/models/operations/metricsgetdashboard.ts +33 -0
  470. package/src/models/operations/metricslistdashboards.ts +76 -0
  471. package/src/models/operations/metricsupdatedashboard.ts +51 -0
  472. package/src/models/operations/paymentslist.ts +5 -5
  473. package/src/models/operations/subscriptionslist.ts +69 -0
  474. package/src/sdk/metrics.ts +106 -0
  475. package/dist/commonjs/models/components/listresource.d.ts.map +0 -1
  476. package/dist/commonjs/models/components/listresource.js.map +0 -1
  477. package/dist/commonjs/models/components/ownercreate.d.ts.map +0 -1
  478. package/dist/commonjs/models/components/ownercreate.js.map +0 -1
  479. package/dist/esm/models/components/listresource.d.ts.map +0 -1
  480. package/dist/esm/models/components/listresource.js.map +0 -1
  481. package/dist/esm/models/components/ownercreate.d.ts.map +0 -1
  482. package/dist/esm/models/components/ownercreate.js.map +0 -1
@@ -0,0 +1,140 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { smartUnion } from "../../types/smartUnion.js";
8
+ import {
9
+ AddressInput,
10
+ AddressInput$Outbound,
11
+ AddressInput$outboundSchema,
12
+ } from "./addressinput.js";
13
+ import {
14
+ MemberOwnerCreate,
15
+ MemberOwnerCreate$Outbound,
16
+ MemberOwnerCreate$outboundSchema,
17
+ } from "./memberownercreate.js";
18
+
19
+ export type CustomerIndividualCreateMetadata =
20
+ | string
21
+ | number
22
+ | number
23
+ | boolean;
24
+
25
+ export type CustomerIndividualCreate = {
26
+ /**
27
+ * Key-value object allowing you to store additional information.
28
+ *
29
+ * @remarks
30
+ *
31
+ * The key must be a string with a maximum length of **40 characters**.
32
+ * The value must be either:
33
+ *
34
+ * * A string with a maximum length of **500 characters**
35
+ * * An integer
36
+ * * A floating-point number
37
+ * * A boolean
38
+ *
39
+ * You can store up to **50 key-value pairs**.
40
+ */
41
+ metadata?: { [k: string]: string | number | number | boolean } | undefined;
42
+ /**
43
+ * The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
44
+ */
45
+ externalId?: string | null | undefined;
46
+ name?: string | null | undefined;
47
+ billingAddress?: AddressInput | null | undefined;
48
+ taxId?: string | null | undefined;
49
+ locale?: string | null | undefined;
50
+ /**
51
+ * The ID of the organization owning the customer. **Required unless you use an organization token.**
52
+ */
53
+ organizationId?: string | null | undefined;
54
+ /**
55
+ * Optional owner member to create with the customer. If not provided, an owner member will be automatically created using the customer's email and name.
56
+ */
57
+ owner?: MemberOwnerCreate | null | undefined;
58
+ type?: "individual" | undefined;
59
+ /**
60
+ * The email address of the customer. This must be unique within the organization.
61
+ */
62
+ email: string;
63
+ };
64
+
65
+ /** @internal */
66
+ export type CustomerIndividualCreateMetadata$Outbound =
67
+ | string
68
+ | number
69
+ | number
70
+ | boolean;
71
+
72
+ /** @internal */
73
+ export const CustomerIndividualCreateMetadata$outboundSchema: z.ZodMiniType<
74
+ CustomerIndividualCreateMetadata$Outbound,
75
+ CustomerIndividualCreateMetadata
76
+ > = smartUnion([z.string(), z.int(), z.number(), z.boolean()]);
77
+
78
+ export function customerIndividualCreateMetadataToJSON(
79
+ customerIndividualCreateMetadata: CustomerIndividualCreateMetadata,
80
+ ): string {
81
+ return JSON.stringify(
82
+ CustomerIndividualCreateMetadata$outboundSchema.parse(
83
+ customerIndividualCreateMetadata,
84
+ ),
85
+ );
86
+ }
87
+
88
+ /** @internal */
89
+ export type CustomerIndividualCreate$Outbound = {
90
+ metadata?: { [k: string]: string | number | number | boolean } | undefined;
91
+ external_id?: string | null | undefined;
92
+ name?: string | null | undefined;
93
+ billing_address?: AddressInput$Outbound | null | undefined;
94
+ tax_id?: string | null | undefined;
95
+ locale?: string | null | undefined;
96
+ organization_id?: string | null | undefined;
97
+ owner?: MemberOwnerCreate$Outbound | null | undefined;
98
+ type: "individual";
99
+ email: string;
100
+ };
101
+
102
+ /** @internal */
103
+ export const CustomerIndividualCreate$outboundSchema: z.ZodMiniType<
104
+ CustomerIndividualCreate$Outbound,
105
+ CustomerIndividualCreate
106
+ > = z.pipe(
107
+ z.object({
108
+ metadata: z.optional(
109
+ z.record(
110
+ z.string(),
111
+ smartUnion([z.string(), z.int(), z.number(), z.boolean()]),
112
+ ),
113
+ ),
114
+ externalId: z.optional(z.nullable(z.string())),
115
+ name: z.optional(z.nullable(z.string())),
116
+ billingAddress: z.optional(z.nullable(AddressInput$outboundSchema)),
117
+ taxId: z.optional(z.nullable(z.string())),
118
+ locale: z.optional(z.nullable(z.string())),
119
+ organizationId: z.optional(z.nullable(z.string())),
120
+ owner: z.optional(z.nullable(MemberOwnerCreate$outboundSchema)),
121
+ type: z._default(z.literal("individual"), "individual" as const),
122
+ email: z.string(),
123
+ }),
124
+ z.transform((v) => {
125
+ return remap$(v, {
126
+ externalId: "external_id",
127
+ billingAddress: "billing_address",
128
+ taxId: "tax_id",
129
+ organizationId: "organization_id",
130
+ });
131
+ }),
132
+ );
133
+
134
+ export function customerIndividualCreateToJSON(
135
+ customerIndividualCreate: CustomerIndividualCreate,
136
+ ): string {
137
+ return JSON.stringify(
138
+ CustomerIndividualCreate$outboundSchema.parse(customerIndividualCreate),
139
+ );
140
+ }
@@ -46,9 +46,6 @@ export type CustomerMeter = {
46
46
  * The balance of the meter, i.e. the difference between credited and consumed units.
47
47
  */
48
48
  balance: number;
49
- /**
50
- * A customer in an organization.
51
- */
52
49
  customer: Customer;
53
50
  meter: Meter;
54
51
  };
@@ -31,7 +31,7 @@ export type CustomerPortalCustomer = {
31
31
  * The ID of the object.
32
32
  */
33
33
  id: string;
34
- email: string;
34
+ email: string | null;
35
35
  emailVerified: boolean;
36
36
  name: string | null;
37
37
  billingName: string | null;
@@ -72,7 +72,7 @@ export const CustomerPortalCustomer$inboundSchema: z.ZodMiniType<
72
72
  z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))),
73
73
  ),
74
74
  id: z.string(),
75
- email: z.string(),
75
+ email: z.nullable(z.string()),
76
76
  email_verified: z.boolean(),
77
77
  name: z.nullable(z.string()),
78
78
  billing_name: z.nullable(z.string()),
@@ -30,9 +30,6 @@ export type CustomerSession = {
30
30
  returnUrl: string | null;
31
31
  customerPortalUrl: string;
32
32
  customerId: string;
33
- /**
34
- * A customer in an organization.
35
- */
36
33
  customer: Customer;
37
34
  };
38
35
 
@@ -3,271 +3,45 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { smartUnion } from "../../types/smartUnion.js";
10
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
9
  import {
12
- Address,
13
- Address$inboundSchema,
14
- Address$Outbound,
15
- Address$outboundSchema,
16
- } from "./address.js";
10
+ CustomerStateIndividual,
11
+ CustomerStateIndividual$inboundSchema,
12
+ CustomerStateIndividual$Outbound,
13
+ CustomerStateIndividual$outboundSchema,
14
+ } from "./customerstateindividual.js";
17
15
  import {
18
- CustomerStateBenefitGrant,
19
- CustomerStateBenefitGrant$inboundSchema,
20
- CustomerStateBenefitGrant$Outbound,
21
- CustomerStateBenefitGrant$outboundSchema,
22
- } from "./customerstatebenefitgrant.js";
23
- import {
24
- CustomerStateMeter,
25
- CustomerStateMeter$inboundSchema,
26
- CustomerStateMeter$Outbound,
27
- CustomerStateMeter$outboundSchema,
28
- } from "./customerstatemeter.js";
29
- import {
30
- CustomerStateSubscription,
31
- CustomerStateSubscription$inboundSchema,
32
- CustomerStateSubscription$Outbound,
33
- CustomerStateSubscription$outboundSchema,
34
- } from "./customerstatesubscription.js";
35
- import {
36
- CustomerType,
37
- CustomerType$inboundSchema,
38
- CustomerType$outboundSchema,
39
- } from "./customertype.js";
40
- import {
41
- MetadataOutputType,
42
- MetadataOutputType$inboundSchema,
43
- MetadataOutputType$Outbound,
44
- MetadataOutputType$outboundSchema,
45
- } from "./metadataoutputtype.js";
46
- import {
47
- TaxIDFormat,
48
- TaxIDFormat$inboundSchema,
49
- TaxIDFormat$outboundSchema,
50
- } from "./taxidformat.js";
51
-
52
- export type CustomerStateTaxId = string | TaxIDFormat;
16
+ CustomerStateTeam,
17
+ CustomerStateTeam$inboundSchema,
18
+ CustomerStateTeam$Outbound,
19
+ CustomerStateTeam$outboundSchema,
20
+ } from "./customerstateteam.js";
53
21
 
54
- /**
55
- * A customer along with additional state information:
56
- *
57
- * @remarks
58
- *
59
- * * Active subscriptions
60
- * * Granted benefits
61
- * * Active meters
62
- */
63
- export type CustomerState = {
64
- /**
65
- * The ID of the customer.
66
- */
67
- id: string;
68
- /**
69
- * Creation timestamp of the object.
70
- */
71
- createdAt: Date;
72
- /**
73
- * Last modification timestamp of the object.
74
- */
75
- modifiedAt: Date | null;
76
- metadata: { [k: string]: MetadataOutputType };
77
- /**
78
- * The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
79
- */
80
- externalId?: string | null | undefined;
81
- /**
82
- * The email address of the customer. This must be unique within the organization.
83
- */
84
- email: string;
85
- /**
86
- * Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.
87
- */
88
- emailVerified: boolean;
89
- /**
90
- * The type of customer: 'individual' for single users, 'team' for customers with multiple members. Legacy customers may have NULL type which is treated as 'individual'.
91
- */
92
- type?: CustomerType | null | undefined;
93
- /**
94
- * The name of the customer.
95
- */
96
- name: string | null;
97
- billingAddress: Address | null;
98
- taxId: Array<string | TaxIDFormat | null> | null;
99
- locale?: string | null | undefined;
100
- /**
101
- * The ID of the organization owning the customer.
102
- */
103
- organizationId: string;
104
- /**
105
- * Timestamp for when the customer was soft deleted.
106
- */
107
- deletedAt: Date | null;
108
- /**
109
- * The customer's active subscriptions.
110
- */
111
- activeSubscriptions: Array<CustomerStateSubscription>;
112
- /**
113
- * The customer's active benefit grants.
114
- */
115
- grantedBenefits: Array<CustomerStateBenefitGrant>;
116
- /**
117
- * The customer's active meters.
118
- */
119
- activeMeters: Array<CustomerStateMeter>;
120
- avatarUrl: string;
121
- };
122
-
123
- /** @internal */
124
- export const CustomerStateTaxId$inboundSchema: z.ZodMiniType<
125
- CustomerStateTaxId,
126
- unknown
127
- > = smartUnion([z.string(), TaxIDFormat$inboundSchema]);
128
- /** @internal */
129
- export type CustomerStateTaxId$Outbound = string | string;
130
-
131
- /** @internal */
132
- export const CustomerStateTaxId$outboundSchema: z.ZodMiniType<
133
- CustomerStateTaxId$Outbound,
134
- CustomerStateTaxId
135
- > = smartUnion([z.string(), TaxIDFormat$outboundSchema]);
136
-
137
- export function customerStateTaxIdToJSON(
138
- customerStateTaxId: CustomerStateTaxId,
139
- ): string {
140
- return JSON.stringify(
141
- CustomerStateTaxId$outboundSchema.parse(customerStateTaxId),
142
- );
143
- }
144
- export function customerStateTaxIdFromJSON(
145
- jsonString: string,
146
- ): SafeParseResult<CustomerStateTaxId, SDKValidationError> {
147
- return safeParse(
148
- jsonString,
149
- (x) => CustomerStateTaxId$inboundSchema.parse(JSON.parse(x)),
150
- `Failed to parse 'CustomerStateTaxId' from JSON`,
151
- );
152
- }
22
+ export type CustomerState = CustomerStateIndividual | CustomerStateTeam;
153
23
 
154
24
  /** @internal */
155
25
  export const CustomerState$inboundSchema: z.ZodMiniType<
156
26
  CustomerState,
157
27
  unknown
158
- > = z.pipe(
159
- z.object({
160
- id: z.string(),
161
- created_at: z.pipe(
162
- z.iso.datetime({ offset: true }),
163
- z.transform(v => new Date(v)),
164
- ),
165
- modified_at: z.nullable(
166
- z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))),
167
- ),
168
- metadata: z.record(z.string(), MetadataOutputType$inboundSchema),
169
- external_id: z.optional(z.nullable(z.string())),
170
- email: z.string(),
171
- email_verified: z.boolean(),
172
- type: z.optional(z.nullable(CustomerType$inboundSchema)),
173
- name: z.nullable(z.string()),
174
- billing_address: z.nullable(Address$inboundSchema),
175
- tax_id: z.nullable(
176
- z.array(z.nullable(smartUnion([z.string(), TaxIDFormat$inboundSchema]))),
177
- ),
178
- locale: z.optional(z.nullable(z.string())),
179
- organization_id: z.string(),
180
- deleted_at: z.nullable(
181
- z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))),
182
- ),
183
- active_subscriptions: z.array(CustomerStateSubscription$inboundSchema),
184
- granted_benefits: z.array(CustomerStateBenefitGrant$inboundSchema),
185
- active_meters: z.array(CustomerStateMeter$inboundSchema),
186
- avatar_url: z.string(),
187
- }),
188
- z.transform((v) => {
189
- return remap$(v, {
190
- "created_at": "createdAt",
191
- "modified_at": "modifiedAt",
192
- "external_id": "externalId",
193
- "email_verified": "emailVerified",
194
- "billing_address": "billingAddress",
195
- "tax_id": "taxId",
196
- "organization_id": "organizationId",
197
- "deleted_at": "deletedAt",
198
- "active_subscriptions": "activeSubscriptions",
199
- "granted_benefits": "grantedBenefits",
200
- "active_meters": "activeMeters",
201
- "avatar_url": "avatarUrl",
202
- });
203
- }),
204
- );
28
+ > = z.union([
29
+ CustomerStateIndividual$inboundSchema,
30
+ CustomerStateTeam$inboundSchema,
31
+ ]);
205
32
  /** @internal */
206
- export type CustomerState$Outbound = {
207
- id: string;
208
- created_at: string;
209
- modified_at: string | null;
210
- metadata: { [k: string]: MetadataOutputType$Outbound };
211
- external_id?: string | null | undefined;
212
- email: string;
213
- email_verified: boolean;
214
- type?: string | null | undefined;
215
- name: string | null;
216
- billing_address: Address$Outbound | null;
217
- tax_id: Array<string | string | null> | null;
218
- locale?: string | null | undefined;
219
- organization_id: string;
220
- deleted_at: string | null;
221
- active_subscriptions: Array<CustomerStateSubscription$Outbound>;
222
- granted_benefits: Array<CustomerStateBenefitGrant$Outbound>;
223
- active_meters: Array<CustomerStateMeter$Outbound>;
224
- avatar_url: string;
225
- };
33
+ export type CustomerState$Outbound =
34
+ | CustomerStateIndividual$Outbound
35
+ | CustomerStateTeam$Outbound;
226
36
 
227
37
  /** @internal */
228
38
  export const CustomerState$outboundSchema: z.ZodMiniType<
229
39
  CustomerState$Outbound,
230
40
  CustomerState
231
- > = z.pipe(
232
- z.object({
233
- id: z.string(),
234
- createdAt: z.pipe(z.date(), z.transform(v => v.toISOString())),
235
- modifiedAt: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
236
- metadata: z.record(z.string(), MetadataOutputType$outboundSchema),
237
- externalId: z.optional(z.nullable(z.string())),
238
- email: z.string(),
239
- emailVerified: z.boolean(),
240
- type: z.optional(z.nullable(CustomerType$outboundSchema)),
241
- name: z.nullable(z.string()),
242
- billingAddress: z.nullable(Address$outboundSchema),
243
- taxId: z.nullable(
244
- z.array(z.nullable(smartUnion([z.string(), TaxIDFormat$outboundSchema]))),
245
- ),
246
- locale: z.optional(z.nullable(z.string())),
247
- organizationId: z.string(),
248
- deletedAt: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
249
- activeSubscriptions: z.array(CustomerStateSubscription$outboundSchema),
250
- grantedBenefits: z.array(CustomerStateBenefitGrant$outboundSchema),
251
- activeMeters: z.array(CustomerStateMeter$outboundSchema),
252
- avatarUrl: z.string(),
253
- }),
254
- z.transform((v) => {
255
- return remap$(v, {
256
- createdAt: "created_at",
257
- modifiedAt: "modified_at",
258
- externalId: "external_id",
259
- emailVerified: "email_verified",
260
- billingAddress: "billing_address",
261
- taxId: "tax_id",
262
- organizationId: "organization_id",
263
- deletedAt: "deleted_at",
264
- activeSubscriptions: "active_subscriptions",
265
- grantedBenefits: "granted_benefits",
266
- activeMeters: "active_meters",
267
- avatarUrl: "avatar_url",
268
- });
269
- }),
270
- );
41
+ > = z.union([
42
+ CustomerStateIndividual$outboundSchema,
43
+ CustomerStateTeam$outboundSchema,
44
+ ]);
271
45
 
272
46
  export function customerStateToJSON(customerState: CustomerState): string {
273
47
  return JSON.stringify(CustomerState$outboundSchema.parse(customerState));