@paygentic/sdk 0.6.19 → 0.6.21

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 (317) hide show
  1. package/README.md +18 -5
  2. package/dist/commonjs/funcs/customersList.d.ts +1 -1
  3. package/dist/commonjs/funcs/customersList.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/customersList.js +2 -2
  5. package/dist/commonjs/funcs/customersList.js.map +1 -1
  6. package/dist/commonjs/funcs/entitlementsGrantsCreate.d.ts +19 -0
  7. package/dist/commonjs/funcs/entitlementsGrantsCreate.d.ts.map +1 -0
  8. package/dist/commonjs/funcs/entitlementsGrantsCreate.js +127 -0
  9. package/dist/commonjs/funcs/entitlementsGrantsCreate.js.map +1 -0
  10. package/dist/commonjs/funcs/entitlementsGrantsGet.d.ts +19 -0
  11. package/dist/commonjs/funcs/entitlementsGrantsGet.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/entitlementsGrantsGet.js +128 -0
  13. package/dist/commonjs/funcs/entitlementsGrantsGet.js.map +1 -0
  14. package/dist/commonjs/funcs/entitlementsGrantsList.d.ts +18 -0
  15. package/dist/commonjs/funcs/entitlementsGrantsList.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/entitlementsGrantsList.js +129 -0
  17. package/dist/commonjs/funcs/entitlementsGrantsList.js.map +1 -0
  18. package/dist/commonjs/funcs/entitlementsGrantsPurchase.d.ts +21 -0
  19. package/dist/commonjs/funcs/entitlementsGrantsPurchase.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/entitlementsGrantsPurchase.js +129 -0
  21. package/dist/commonjs/funcs/entitlementsGrantsPurchase.js.map +1 -0
  22. package/dist/commonjs/funcs/entitlementsGrantsVoid.d.ts +19 -0
  23. package/dist/commonjs/funcs/entitlementsGrantsVoid.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/entitlementsGrantsVoid.js +128 -0
  25. package/dist/commonjs/funcs/entitlementsGrantsVoid.js.map +1 -0
  26. package/dist/commonjs/funcs/revenueGet.d.ts +3 -3
  27. package/dist/commonjs/funcs/revenueGet.d.ts.map +1 -1
  28. package/dist/commonjs/funcs/revenueGet.js +4 -4
  29. package/dist/commonjs/funcs/revenueGet.js.map +1 -1
  30. package/dist/commonjs/funcs/subscriptionsList.js +2 -0
  31. package/dist/commonjs/funcs/subscriptionsList.js.map +1 -1
  32. package/dist/commonjs/lib/config.d.ts +3 -3
  33. package/dist/commonjs/lib/config.js +3 -3
  34. package/dist/commonjs/models/creategrantrequest.d.ts +30 -0
  35. package/dist/commonjs/models/creategrantrequest.d.ts.map +1 -0
  36. package/dist/commonjs/models/creategrantrequest.js +52 -0
  37. package/dist/commonjs/models/creategrantrequest.js.map +1 -0
  38. package/dist/commonjs/models/grant.d.ts +45 -0
  39. package/dist/commonjs/models/grant.d.ts.map +1 -0
  40. package/dist/commonjs/models/grant.js +64 -0
  41. package/dist/commonjs/models/grant.js.map +1 -0
  42. package/dist/commonjs/models/groupinvoicesummary.d.ts +21 -0
  43. package/dist/commonjs/models/groupinvoicesummary.d.ts.map +1 -0
  44. package/dist/commonjs/models/groupinvoicesummary.js +55 -0
  45. package/dist/commonjs/models/groupinvoicesummary.js.map +1 -0
  46. package/dist/commonjs/models/grouptrendentry.d.ts +21 -0
  47. package/dist/commonjs/models/grouptrendentry.d.ts.map +1 -0
  48. package/dist/commonjs/models/{revenuetimeseriesresponse.js → grouptrendentry.js} +9 -9
  49. package/dist/commonjs/models/grouptrendentry.js.map +1 -0
  50. package/dist/commonjs/models/index.d.ts +11 -3
  51. package/dist/commonjs/models/index.d.ts.map +1 -1
  52. package/dist/commonjs/models/index.js +11 -3
  53. package/dist/commonjs/models/index.js.map +1 -1
  54. package/dist/commonjs/models/invoicecategorysummary.d.ts +17 -0
  55. package/dist/commonjs/models/invoicecategorysummary.d.ts.map +1 -0
  56. package/dist/commonjs/models/{revenuestats.js → invoicecategorysummary.js} +8 -14
  57. package/dist/commonjs/models/invoicecategorysummary.js.map +1 -0
  58. package/dist/commonjs/models/invoicesummary.d.ts +14 -0
  59. package/dist/commonjs/models/invoicesummary.d.ts.map +1 -0
  60. package/dist/commonjs/models/invoicesummary.js +54 -0
  61. package/dist/commonjs/models/invoicesummary.js.map +1 -0
  62. package/dist/commonjs/models/operations/createentitlementgrant.d.ts +18 -0
  63. package/dist/commonjs/models/operations/createentitlementgrant.d.ts.map +1 -0
  64. package/dist/commonjs/models/operations/createentitlementgrant.js +56 -0
  65. package/dist/commonjs/models/operations/createentitlementgrant.js.map +1 -0
  66. package/dist/commonjs/models/operations/getentitlementgrant.d.ts +20 -0
  67. package/dist/commonjs/models/operations/getentitlementgrant.d.ts.map +1 -0
  68. package/dist/commonjs/models/operations/getentitlementgrant.js +50 -0
  69. package/dist/commonjs/models/operations/getentitlementgrant.js.map +1 -0
  70. package/dist/commonjs/models/operations/getrevenue.d.ts +19 -7
  71. package/dist/commonjs/models/operations/getrevenue.d.ts.map +1 -1
  72. package/dist/commonjs/models/operations/getrevenue.js +14 -5
  73. package/dist/commonjs/models/operations/getrevenue.js.map +1 -1
  74. package/dist/commonjs/models/operations/index.d.ts +5 -0
  75. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  76. package/dist/commonjs/models/operations/index.js +5 -0
  77. package/dist/commonjs/models/operations/index.js.map +1 -1
  78. package/dist/commonjs/models/operations/listcustomers.d.ts +2 -2
  79. package/dist/commonjs/models/operations/listentitlementgrants.d.ts +54 -0
  80. package/dist/commonjs/models/operations/listentitlementgrants.d.ts.map +1 -0
  81. package/dist/commonjs/models/operations/listentitlementgrants.js +69 -0
  82. package/dist/commonjs/models/operations/listentitlementgrants.js.map +1 -0
  83. package/dist/commonjs/models/operations/listsubscriptions.d.ts +23 -0
  84. package/dist/commonjs/models/operations/listsubscriptions.d.ts.map +1 -1
  85. package/dist/commonjs/models/operations/listsubscriptions.js +13 -1
  86. package/dist/commonjs/models/operations/listsubscriptions.js.map +1 -1
  87. package/dist/commonjs/models/operations/purchaseentitlementgrant.d.ts +18 -0
  88. package/dist/commonjs/models/operations/purchaseentitlementgrant.d.ts.map +1 -0
  89. package/dist/commonjs/models/operations/purchaseentitlementgrant.js +56 -0
  90. package/dist/commonjs/models/operations/purchaseentitlementgrant.js.map +1 -0
  91. package/dist/commonjs/models/operations/voidentitlementgrant.d.ts +20 -0
  92. package/dist/commonjs/models/operations/voidentitlementgrant.d.ts.map +1 -0
  93. package/dist/commonjs/models/operations/voidentitlementgrant.js +50 -0
  94. package/dist/commonjs/models/operations/voidentitlementgrant.js.map +1 -0
  95. package/dist/commonjs/models/paymentsummary.d.ts +33 -0
  96. package/dist/commonjs/models/paymentsummary.d.ts.map +1 -0
  97. package/dist/commonjs/models/paymentsummary.js +55 -0
  98. package/dist/commonjs/models/paymentsummary.js.map +1 -0
  99. package/dist/commonjs/models/purchasegrantrequest.d.ts +50 -0
  100. package/dist/commonjs/models/purchasegrantrequest.d.ts.map +1 -0
  101. package/dist/commonjs/models/purchasegrantrequest.js +56 -0
  102. package/dist/commonjs/models/purchasegrantrequest.js.map +1 -0
  103. package/dist/commonjs/models/purchasegrantresponse.d.ts +58 -0
  104. package/dist/commonjs/models/purchasegrantresponse.d.ts.map +1 -0
  105. package/dist/commonjs/models/purchasegrantresponse.js +71 -0
  106. package/dist/commonjs/models/purchasegrantresponse.js.map +1 -0
  107. package/dist/commonjs/models/revenuesummaryresponse.d.ts +31 -0
  108. package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -0
  109. package/dist/commonjs/models/revenuesummaryresponse.js +59 -0
  110. package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -0
  111. package/dist/commonjs/models/revenuetrendbucket.d.ts +30 -0
  112. package/dist/commonjs/models/revenuetrendbucket.d.ts.map +1 -0
  113. package/dist/commonjs/models/{revenuetimebucket.js → revenuetrendbucket.js} +11 -9
  114. package/dist/commonjs/models/revenuetrendbucket.js.map +1 -0
  115. package/dist/commonjs/models/subscription.d.ts +38 -0
  116. package/dist/commonjs/models/subscription.d.ts.map +1 -1
  117. package/dist/commonjs/models/subscription.js +33 -1
  118. package/dist/commonjs/models/subscription.js.map +1 -1
  119. package/dist/commonjs/sdk/entitlements.d.ts +3 -0
  120. package/dist/commonjs/sdk/entitlements.d.ts.map +1 -1
  121. package/dist/commonjs/sdk/entitlements.js +4 -0
  122. package/dist/commonjs/sdk/entitlements.js.map +1 -1
  123. package/dist/commonjs/sdk/grants.d.ts +43 -0
  124. package/dist/commonjs/sdk/grants.d.ts.map +1 -0
  125. package/dist/commonjs/sdk/grants.js +64 -0
  126. package/dist/commonjs/sdk/grants.js.map +1 -0
  127. package/dist/commonjs/sdk/revenue.d.ts +3 -3
  128. package/dist/commonjs/sdk/revenue.d.ts.map +1 -1
  129. package/dist/commonjs/sdk/revenue.js +2 -2
  130. package/dist/esm/funcs/customersList.d.ts +1 -1
  131. package/dist/esm/funcs/customersList.d.ts.map +1 -1
  132. package/dist/esm/funcs/customersList.js +2 -2
  133. package/dist/esm/funcs/customersList.js.map +1 -1
  134. package/dist/esm/funcs/entitlementsGrantsCreate.d.ts +19 -0
  135. package/dist/esm/funcs/entitlementsGrantsCreate.d.ts.map +1 -0
  136. package/dist/esm/funcs/entitlementsGrantsCreate.js +91 -0
  137. package/dist/esm/funcs/entitlementsGrantsCreate.js.map +1 -0
  138. package/dist/esm/funcs/entitlementsGrantsGet.d.ts +19 -0
  139. package/dist/esm/funcs/entitlementsGrantsGet.d.ts.map +1 -0
  140. package/dist/esm/funcs/entitlementsGrantsGet.js +92 -0
  141. package/dist/esm/funcs/entitlementsGrantsGet.js.map +1 -0
  142. package/dist/esm/funcs/entitlementsGrantsList.d.ts +18 -0
  143. package/dist/esm/funcs/entitlementsGrantsList.d.ts.map +1 -0
  144. package/dist/esm/funcs/entitlementsGrantsList.js +93 -0
  145. package/dist/esm/funcs/entitlementsGrantsList.js.map +1 -0
  146. package/dist/esm/funcs/entitlementsGrantsPurchase.d.ts +21 -0
  147. package/dist/esm/funcs/entitlementsGrantsPurchase.d.ts.map +1 -0
  148. package/dist/esm/funcs/entitlementsGrantsPurchase.js +93 -0
  149. package/dist/esm/funcs/entitlementsGrantsPurchase.js.map +1 -0
  150. package/dist/esm/funcs/entitlementsGrantsVoid.d.ts +19 -0
  151. package/dist/esm/funcs/entitlementsGrantsVoid.d.ts.map +1 -0
  152. package/dist/esm/funcs/entitlementsGrantsVoid.js +92 -0
  153. package/dist/esm/funcs/entitlementsGrantsVoid.js.map +1 -0
  154. package/dist/esm/funcs/revenueGet.d.ts +3 -3
  155. package/dist/esm/funcs/revenueGet.d.ts.map +1 -1
  156. package/dist/esm/funcs/revenueGet.js +4 -4
  157. package/dist/esm/funcs/revenueGet.js.map +1 -1
  158. package/dist/esm/funcs/subscriptionsList.js +2 -0
  159. package/dist/esm/funcs/subscriptionsList.js.map +1 -1
  160. package/dist/esm/lib/config.d.ts +3 -3
  161. package/dist/esm/lib/config.js +3 -3
  162. package/dist/esm/models/creategrantrequest.d.ts +30 -0
  163. package/dist/esm/models/creategrantrequest.d.ts.map +1 -0
  164. package/dist/esm/models/creategrantrequest.js +15 -0
  165. package/dist/esm/models/creategrantrequest.js.map +1 -0
  166. package/dist/esm/models/grant.d.ts +45 -0
  167. package/dist/esm/models/grant.d.ts.map +1 -0
  168. package/dist/esm/models/grant.js +27 -0
  169. package/dist/esm/models/grant.js.map +1 -0
  170. package/dist/esm/models/groupinvoicesummary.d.ts +21 -0
  171. package/dist/esm/models/groupinvoicesummary.d.ts.map +1 -0
  172. package/dist/esm/models/groupinvoicesummary.js +18 -0
  173. package/dist/esm/models/groupinvoicesummary.js.map +1 -0
  174. package/dist/esm/models/grouptrendentry.d.ts +21 -0
  175. package/dist/esm/models/grouptrendentry.d.ts.map +1 -0
  176. package/dist/esm/models/grouptrendentry.js +15 -0
  177. package/dist/esm/models/grouptrendentry.js.map +1 -0
  178. package/dist/esm/models/index.d.ts +11 -3
  179. package/dist/esm/models/index.d.ts.map +1 -1
  180. package/dist/esm/models/index.js +11 -3
  181. package/dist/esm/models/index.js.map +1 -1
  182. package/dist/esm/models/invoicecategorysummary.d.ts +17 -0
  183. package/dist/esm/models/invoicecategorysummary.d.ts.map +1 -0
  184. package/dist/esm/models/invoicecategorysummary.js +14 -0
  185. package/dist/esm/models/invoicecategorysummary.js.map +1 -0
  186. package/dist/esm/models/invoicesummary.d.ts +14 -0
  187. package/dist/esm/models/invoicesummary.d.ts.map +1 -0
  188. package/dist/esm/models/invoicesummary.js +17 -0
  189. package/dist/esm/models/invoicesummary.js.map +1 -0
  190. package/dist/esm/models/operations/createentitlementgrant.d.ts +18 -0
  191. package/dist/esm/models/operations/createentitlementgrant.d.ts.map +1 -0
  192. package/dist/esm/models/operations/createentitlementgrant.js +19 -0
  193. package/dist/esm/models/operations/createentitlementgrant.js.map +1 -0
  194. package/dist/esm/models/operations/getentitlementgrant.d.ts +20 -0
  195. package/dist/esm/models/operations/getentitlementgrant.d.ts.map +1 -0
  196. package/dist/esm/models/operations/getentitlementgrant.js +13 -0
  197. package/dist/esm/models/operations/getentitlementgrant.js.map +1 -0
  198. package/dist/esm/models/operations/getrevenue.d.ts +19 -7
  199. package/dist/esm/models/operations/getrevenue.d.ts.map +1 -1
  200. package/dist/esm/models/operations/getrevenue.js +13 -4
  201. package/dist/esm/models/operations/getrevenue.js.map +1 -1
  202. package/dist/esm/models/operations/index.d.ts +5 -0
  203. package/dist/esm/models/operations/index.d.ts.map +1 -1
  204. package/dist/esm/models/operations/index.js +5 -0
  205. package/dist/esm/models/operations/index.js.map +1 -1
  206. package/dist/esm/models/operations/listcustomers.d.ts +2 -2
  207. package/dist/esm/models/operations/listentitlementgrants.d.ts +54 -0
  208. package/dist/esm/models/operations/listentitlementgrants.d.ts.map +1 -0
  209. package/dist/esm/models/operations/listentitlementgrants.js +31 -0
  210. package/dist/esm/models/operations/listentitlementgrants.js.map +1 -0
  211. package/dist/esm/models/operations/listsubscriptions.d.ts +23 -0
  212. package/dist/esm/models/operations/listsubscriptions.d.ts.map +1 -1
  213. package/dist/esm/models/operations/listsubscriptions.js +12 -0
  214. package/dist/esm/models/operations/listsubscriptions.js.map +1 -1
  215. package/dist/esm/models/operations/purchaseentitlementgrant.d.ts +18 -0
  216. package/dist/esm/models/operations/purchaseentitlementgrant.d.ts.map +1 -0
  217. package/dist/esm/models/operations/purchaseentitlementgrant.js +19 -0
  218. package/dist/esm/models/operations/purchaseentitlementgrant.js.map +1 -0
  219. package/dist/esm/models/operations/voidentitlementgrant.d.ts +20 -0
  220. package/dist/esm/models/operations/voidentitlementgrant.d.ts.map +1 -0
  221. package/dist/esm/models/operations/voidentitlementgrant.js +13 -0
  222. package/dist/esm/models/operations/voidentitlementgrant.js.map +1 -0
  223. package/dist/esm/models/paymentsummary.d.ts +33 -0
  224. package/dist/esm/models/paymentsummary.d.ts.map +1 -0
  225. package/dist/esm/models/paymentsummary.js +18 -0
  226. package/dist/esm/models/paymentsummary.js.map +1 -0
  227. package/dist/esm/models/purchasegrantrequest.d.ts +50 -0
  228. package/dist/esm/models/purchasegrantrequest.d.ts.map +1 -0
  229. package/dist/esm/models/purchasegrantrequest.js +19 -0
  230. package/dist/esm/models/purchasegrantrequest.js.map +1 -0
  231. package/dist/esm/models/purchasegrantresponse.d.ts +58 -0
  232. package/dist/esm/models/purchasegrantresponse.d.ts.map +1 -0
  233. package/dist/esm/models/purchasegrantresponse.js +33 -0
  234. package/dist/esm/models/purchasegrantresponse.js.map +1 -0
  235. package/dist/esm/models/revenuesummaryresponse.d.ts +31 -0
  236. package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -0
  237. package/dist/esm/models/revenuesummaryresponse.js +22 -0
  238. package/dist/esm/models/revenuesummaryresponse.js.map +1 -0
  239. package/dist/esm/models/revenuetrendbucket.d.ts +30 -0
  240. package/dist/esm/models/revenuetrendbucket.d.ts.map +1 -0
  241. package/dist/esm/models/revenuetrendbucket.js +18 -0
  242. package/dist/esm/models/revenuetrendbucket.js.map +1 -0
  243. package/dist/esm/models/subscription.d.ts +38 -0
  244. package/dist/esm/models/subscription.d.ts.map +1 -1
  245. package/dist/esm/models/subscription.js +29 -0
  246. package/dist/esm/models/subscription.js.map +1 -1
  247. package/dist/esm/sdk/entitlements.d.ts +3 -0
  248. package/dist/esm/sdk/entitlements.d.ts.map +1 -1
  249. package/dist/esm/sdk/entitlements.js +4 -0
  250. package/dist/esm/sdk/entitlements.js.map +1 -1
  251. package/dist/esm/sdk/grants.d.ts +43 -0
  252. package/dist/esm/sdk/grants.d.ts.map +1 -0
  253. package/dist/esm/sdk/grants.js +60 -0
  254. package/dist/esm/sdk/grants.js.map +1 -0
  255. package/dist/esm/sdk/revenue.d.ts +3 -3
  256. package/dist/esm/sdk/revenue.d.ts.map +1 -1
  257. package/dist/esm/sdk/revenue.js +2 -2
  258. package/jsr.json +1 -1
  259. package/package.json +1 -1
  260. package/src/funcs/customersList.ts +5 -1
  261. package/src/funcs/entitlementsGrantsCreate.ts +187 -0
  262. package/src/funcs/entitlementsGrantsGet.ts +188 -0
  263. package/src/funcs/entitlementsGrantsList.ts +190 -0
  264. package/src/funcs/entitlementsGrantsPurchase.ts +189 -0
  265. package/src/funcs/entitlementsGrantsVoid.ts +188 -0
  266. package/src/funcs/revenueGet.ts +7 -7
  267. package/src/funcs/subscriptionsList.ts +2 -0
  268. package/src/lib/config.ts +3 -3
  269. package/src/models/creategrantrequest.ts +52 -0
  270. package/src/models/grant.ts +81 -0
  271. package/src/models/groupinvoicesummary.ts +49 -0
  272. package/src/models/grouptrendentry.ts +44 -0
  273. package/src/models/index.ts +11 -3
  274. package/src/models/invoicecategorysummary.ts +39 -0
  275. package/src/models/invoicesummary.ts +41 -0
  276. package/src/models/operations/createentitlementgrant.ts +45 -0
  277. package/src/models/operations/getentitlementgrant.ts +40 -0
  278. package/src/models/operations/getrevenue.ts +24 -9
  279. package/src/models/operations/index.ts +5 -0
  280. package/src/models/operations/listcustomers.ts +2 -2
  281. package/src/models/operations/listentitlementgrants.ts +104 -0
  282. package/src/models/operations/listsubscriptions.ts +28 -0
  283. package/src/models/operations/purchaseentitlementgrant.ts +45 -0
  284. package/src/models/operations/voidentitlementgrant.ts +42 -0
  285. package/src/models/paymentsummary.ts +59 -0
  286. package/src/models/purchasegrantrequest.ts +76 -0
  287. package/src/models/purchasegrantresponse.ts +112 -0
  288. package/src/models/revenuesummaryresponse.ts +69 -0
  289. package/src/models/revenuetrendbucket.ts +58 -0
  290. package/src/models/subscription.ts +97 -0
  291. package/src/sdk/entitlements.ts +6 -0
  292. package/src/sdk/grants.ts +102 -0
  293. package/src/sdk/revenue.ts +3 -3
  294. package/dist/commonjs/models/revenuestats.d.ts +0 -41
  295. package/dist/commonjs/models/revenuestats.d.ts.map +0 -1
  296. package/dist/commonjs/models/revenuestats.js.map +0 -1
  297. package/dist/commonjs/models/revenuetimebucket.d.ts +0 -21
  298. package/dist/commonjs/models/revenuetimebucket.d.ts.map +0 -1
  299. package/dist/commonjs/models/revenuetimebucket.js.map +0 -1
  300. package/dist/commonjs/models/revenuetimeseriesresponse.d.ts +0 -18
  301. package/dist/commonjs/models/revenuetimeseriesresponse.d.ts.map +0 -1
  302. package/dist/commonjs/models/revenuetimeseriesresponse.js.map +0 -1
  303. package/dist/esm/models/revenuestats.d.ts +0 -41
  304. package/dist/esm/models/revenuestats.d.ts.map +0 -1
  305. package/dist/esm/models/revenuestats.js +0 -20
  306. package/dist/esm/models/revenuestats.js.map +0 -1
  307. package/dist/esm/models/revenuetimebucket.d.ts +0 -21
  308. package/dist/esm/models/revenuetimebucket.d.ts.map +0 -1
  309. package/dist/esm/models/revenuetimebucket.js +0 -16
  310. package/dist/esm/models/revenuetimebucket.js.map +0 -1
  311. package/dist/esm/models/revenuetimeseriesresponse.d.ts +0 -18
  312. package/dist/esm/models/revenuetimeseriesresponse.d.ts.map +0 -1
  313. package/dist/esm/models/revenuetimeseriesresponse.js +0 -15
  314. package/dist/esm/models/revenuetimeseriesresponse.js.map +0 -1
  315. package/src/models/revenuestats.ts +0 -69
  316. package/src/models/revenuetimebucket.ts +0 -42
  317. package/src/models/revenuetimeseriesresponse.ts +0 -43
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Purchase Grant
31
+ *
32
+ * @remarks
33
+ * Create an ad-hoc invoice with a payment session for a grant purchase. The customer pays via the returned payment URL; the grant is created automatically on payment completion. If payment expires, the invoice is cancelled and no grant is created.
34
+ *
35
+ * After the consumer completes payment, the grant is created automatically. To confirm payment completion, poll `GET /v2/invoices/{invoiceId}` using the `invoiceId` from the response and check for `status === "PAID"`. Recommended polling interval: 2 seconds, timeout: 60 seconds.
36
+ */
37
+ export function entitlementsGrantsPurchase(
38
+ client: PaygenticCore,
39
+ request: operations.PurchaseEntitlementGrantRequest,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ models.PurchaseGrantResponse,
44
+ | errors.BadRequest
45
+ | errors.ErrorT
46
+ | PaygenticError
47
+ | ResponseValidationError
48
+ | ConnectionError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | InvalidRequestError
52
+ | UnexpectedClientError
53
+ | SDKValidationError
54
+ >
55
+ > {
56
+ return new APIPromise($do(
57
+ client,
58
+ request,
59
+ options,
60
+ ));
61
+ }
62
+
63
+ async function $do(
64
+ client: PaygenticCore,
65
+ request: operations.PurchaseEntitlementGrantRequest,
66
+ options?: RequestOptions,
67
+ ): Promise<
68
+ [
69
+ Result<
70
+ models.PurchaseGrantResponse,
71
+ | errors.BadRequest
72
+ | errors.ErrorT
73
+ | PaygenticError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ operations.PurchaseEntitlementGrantRequest$outboundSchema.parse(value),
89
+ "Input validation failed",
90
+ );
91
+ if (!parsed.ok) {
92
+ return [parsed, { status: "invalid" }];
93
+ }
94
+ const payload = parsed.value;
95
+ const body = encodeJSON("body", payload.PurchaseGrantRequest, {
96
+ explode: true,
97
+ });
98
+
99
+ const pathParams = {
100
+ entitlementId: encodeSimple("entitlementId", payload.entitlementId, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ };
105
+
106
+ const path = pathToFunc("/v1/entitlements/{entitlementId}/grants/purchase")(
107
+ pathParams,
108
+ );
109
+
110
+ const headers = new Headers(compactMap({
111
+ "Content-Type": "application/json",
112
+ Accept: "application/json",
113
+ }));
114
+
115
+ const secConfig = await extractSecurity(client._options.bearerAuth);
116
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
117
+ const requestSecurity = resolveGlobalSecurity(securityInput);
118
+
119
+ const context = {
120
+ options: client._options,
121
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
122
+ operationID: "purchaseEntitlementGrant",
123
+ oAuth2Scopes: null,
124
+
125
+ resolvedSecurity: requestSecurity,
126
+
127
+ securitySource: client._options.bearerAuth,
128
+ retryConfig: options?.retries
129
+ || client._options.retryConfig
130
+ || { strategy: "none" },
131
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
132
+ };
133
+
134
+ const requestRes = client._createRequest(context, {
135
+ security: requestSecurity,
136
+ method: "POST",
137
+ baseURL: options?.serverURL,
138
+ path: path,
139
+ headers: headers,
140
+ body: body,
141
+ userAgent: client._options.userAgent,
142
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
143
+ }, options);
144
+ if (!requestRes.ok) {
145
+ return [requestRes, { status: "invalid" }];
146
+ }
147
+ const req = requestRes.value;
148
+
149
+ const doResult = await client._do(req, {
150
+ context,
151
+ errorCodes: ["400", "403", "404", "409", "4XX", "500", "5XX"],
152
+ retryConfig: context.retryConfig,
153
+ retryCodes: context.retryCodes,
154
+ });
155
+ if (!doResult.ok) {
156
+ return [doResult, { status: "request-error", request: req }];
157
+ }
158
+ const response = doResult.value;
159
+
160
+ const responseFields = {
161
+ HttpMeta: { Response: response, Request: req },
162
+ };
163
+
164
+ const [result] = await M.match<
165
+ models.PurchaseGrantResponse,
166
+ | errors.BadRequest
167
+ | errors.ErrorT
168
+ | PaygenticError
169
+ | ResponseValidationError
170
+ | ConnectionError
171
+ | RequestAbortedError
172
+ | RequestTimeoutError
173
+ | InvalidRequestError
174
+ | UnexpectedClientError
175
+ | SDKValidationError
176
+ >(
177
+ M.json(201, models.PurchaseGrantResponse$inboundSchema),
178
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
179
+ M.jsonErr([403, 404, 409], errors.ErrorT$inboundSchema),
180
+ M.jsonErr(500, errors.ErrorT$inboundSchema),
181
+ M.fail("4XX"),
182
+ M.fail("5XX"),
183
+ )(response, req, { extraFields: responseFields });
184
+ if (!result.ok) {
185
+ return [result, { status: "complete", request: req, response }];
186
+ }
187
+
188
+ return [result, { status: "complete", request: req, response }];
189
+ }
@@ -0,0 +1,188 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { PaygenticCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import * as errors from "../models/errors/index.js";
21
+ import { PaygenticError } from "../models/errors/paygenticerror.js";
22
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as models from "../models/index.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Void Grant
31
+ *
32
+ * @remarks
33
+ * Void a grant, removing it from the customer's balance. This operation is idempotent — voiding an already-voided grant returns the voided grant without error.
34
+ */
35
+ export function entitlementsGrantsVoid(
36
+ client: PaygenticCore,
37
+ request: operations.VoidEntitlementGrantRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.Grant,
42
+ | errors.BadRequest
43
+ | errors.ErrorT
44
+ | PaygenticError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: PaygenticCore,
63
+ request: operations.VoidEntitlementGrantRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ models.Grant,
69
+ | errors.BadRequest
70
+ | errors.ErrorT
71
+ | PaygenticError
72
+ | ResponseValidationError
73
+ | ConnectionError
74
+ | RequestAbortedError
75
+ | RequestTimeoutError
76
+ | InvalidRequestError
77
+ | UnexpectedClientError
78
+ | SDKValidationError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) =>
86
+ operations.VoidEntitlementGrantRequest$outboundSchema.parse(value),
87
+ "Input validation failed",
88
+ );
89
+ if (!parsed.ok) {
90
+ return [parsed, { status: "invalid" }];
91
+ }
92
+ const payload = parsed.value;
93
+ const body = null;
94
+
95
+ const pathParams = {
96
+ entitlementId: encodeSimple("entitlementId", payload.entitlementId, {
97
+ explode: false,
98
+ charEncoding: "percent",
99
+ }),
100
+ grantId: encodeSimple("grantId", payload.grantId, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ };
105
+
106
+ const path = pathToFunc("/v1/entitlements/{entitlementId}/grants/{grantId}")(
107
+ pathParams,
108
+ );
109
+
110
+ const headers = new Headers(compactMap({
111
+ Accept: "application/json",
112
+ }));
113
+
114
+ const secConfig = await extractSecurity(client._options.bearerAuth);
115
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
116
+ const requestSecurity = resolveGlobalSecurity(securityInput);
117
+
118
+ const context = {
119
+ options: client._options,
120
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
121
+ operationID: "voidEntitlementGrant",
122
+ oAuth2Scopes: null,
123
+
124
+ resolvedSecurity: requestSecurity,
125
+
126
+ securitySource: client._options.bearerAuth,
127
+ retryConfig: options?.retries
128
+ || client._options.retryConfig
129
+ || { strategy: "none" },
130
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
131
+ };
132
+
133
+ const requestRes = client._createRequest(context, {
134
+ security: requestSecurity,
135
+ method: "DELETE",
136
+ baseURL: options?.serverURL,
137
+ path: path,
138
+ headers: headers,
139
+ body: body,
140
+ userAgent: client._options.userAgent,
141
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
142
+ }, options);
143
+ if (!requestRes.ok) {
144
+ return [requestRes, { status: "invalid" }];
145
+ }
146
+ const req = requestRes.value;
147
+
148
+ const doResult = await client._do(req, {
149
+ context,
150
+ errorCodes: ["400", "403", "404", "4XX", "500", "5XX"],
151
+ retryConfig: context.retryConfig,
152
+ retryCodes: context.retryCodes,
153
+ });
154
+ if (!doResult.ok) {
155
+ return [doResult, { status: "request-error", request: req }];
156
+ }
157
+ const response = doResult.value;
158
+
159
+ const responseFields = {
160
+ HttpMeta: { Response: response, Request: req },
161
+ };
162
+
163
+ const [result] = await M.match<
164
+ models.Grant,
165
+ | errors.BadRequest
166
+ | errors.ErrorT
167
+ | PaygenticError
168
+ | ResponseValidationError
169
+ | ConnectionError
170
+ | RequestAbortedError
171
+ | RequestTimeoutError
172
+ | InvalidRequestError
173
+ | UnexpectedClientError
174
+ | SDKValidationError
175
+ >(
176
+ M.json(200, models.Grant$inboundSchema),
177
+ M.jsonErr(400, errors.BadRequest$inboundSchema),
178
+ M.jsonErr([403, 404], errors.ErrorT$inboundSchema),
179
+ M.jsonErr(500, errors.ErrorT$inboundSchema),
180
+ M.fail("4XX"),
181
+ M.fail("5XX"),
182
+ )(response, req, { extraFields: responseFields });
183
+ if (!result.ok) {
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
186
+
187
+ return [result, { status: "complete", request: req, response }];
188
+ }
@@ -27,10 +27,10 @@ import { APICall, APIPromise } from "../types/async.js";
27
27
  import { Result } from "../types/fp.js";
28
28
 
29
29
  /**
30
- * Get revenue time series
30
+ * Get revenue summary
31
31
  *
32
32
  * @remarks
33
- * Returns time-bucketed revenue data including usage charges, fee charges, and refunds. Data is aggregated by subscription with an optional 'other' bucket for subscriptions outside the top N.
33
+ * Returns revenue summary with invoice and payment breakdowns (outstanding/paid/writtenOff), plus a time-series trend. Revenue is sourced from all issued invoices (v0 + v1) and completed payments.
34
34
  */
35
35
  export function revenueGet(
36
36
  client: PaygenticCore,
@@ -38,7 +38,7 @@ export function revenueGet(
38
38
  options?: RequestOptions,
39
39
  ): APIPromise<
40
40
  Result<
41
- models.RevenueTimeSeriesResponse,
41
+ models.RevenueSummaryResponse,
42
42
  | errors.BadRequest
43
43
  | errors.ErrorT
44
44
  | PaygenticError
@@ -65,7 +65,7 @@ async function $do(
65
65
  ): Promise<
66
66
  [
67
67
  Result<
68
- models.RevenueTimeSeriesResponse,
68
+ models.RevenueSummaryResponse,
69
69
  | errors.BadRequest
70
70
  | errors.ErrorT
71
71
  | PaygenticError
@@ -97,10 +97,10 @@ async function $do(
97
97
  "bucketWidth": payload.bucketWidth,
98
98
  "customerId": payload.customerId,
99
99
  "endTime": payload.endTime,
100
+ "groupBy": payload.groupBy,
100
101
  "merchantId": payload.merchantId,
101
102
  "startTime": payload.startTime,
102
103
  "subscriptionIds": payload.subscriptionIds,
103
- "topN": payload.topN,
104
104
  });
105
105
 
106
106
  const headers = new Headers(compactMap({
@@ -158,7 +158,7 @@ async function $do(
158
158
  };
159
159
 
160
160
  const [result] = await M.match<
161
- models.RevenueTimeSeriesResponse,
161
+ models.RevenueSummaryResponse,
162
162
  | errors.BadRequest
163
163
  | errors.ErrorT
164
164
  | PaygenticError
@@ -170,7 +170,7 @@ async function $do(
170
170
  | UnexpectedClientError
171
171
  | SDKValidationError
172
172
  >(
173
- M.json(200, models.RevenueTimeSeriesResponse$inboundSchema),
173
+ M.json(200, models.RevenueSummaryResponse$inboundSchema),
174
174
  M.jsonErr(400, errors.BadRequest$inboundSchema),
175
175
  M.jsonErr([401, 403], errors.ErrorT$inboundSchema),
176
176
  M.jsonErr(500, errors.ErrorT$inboundSchema),
@@ -95,9 +95,11 @@ async function $do(
95
95
  const query = encodeFormQuery({
96
96
  "consumerId": payload?.consumerId,
97
97
  "customerId": payload?.customerId,
98
+ "include": payload?.include,
98
99
  "limit": payload?.limit,
99
100
  "merchantId": payload?.merchantId,
100
101
  "offset": payload?.offset,
102
+ "startedBefore": payload?.startedBefore,
101
103
  "status": payload?.status,
102
104
  });
103
105
 
package/src/lib/config.ts CHANGED
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.1.0",
64
- sdkVersion: "0.6.17",
65
- genVersion: "2.859.2",
66
- userAgent: "speakeasy-sdk/typescript 0.6.17 2.859.2 0.1.0 @paygentic/sdk",
64
+ sdkVersion: "0.6.20",
65
+ genVersion: "2.865.2",
66
+ userAgent: "speakeasy-sdk/typescript 0.6.20 2.865.2 0.1.0 @paygentic/sdk",
67
67
  } as const;
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ export type CreateGrantRequest = {
8
+ /**
9
+ * The number of credits to grant.
10
+ */
11
+ amount: number;
12
+ /**
13
+ * When the grant becomes effective. Defaults to now.
14
+ */
15
+ effectiveAt?: Date | undefined;
16
+ /**
17
+ * When the grant expires. If omitted, the grant does not expire.
18
+ */
19
+ expiresAt?: Date | null | undefined;
20
+ /**
21
+ * Idempotency key to prevent duplicate grants. Must be unique per entitlement.
22
+ */
23
+ idempotencyKey: string;
24
+ };
25
+
26
+ /** @internal */
27
+ export type CreateGrantRequest$Outbound = {
28
+ amount: number;
29
+ effectiveAt?: string | undefined;
30
+ expiresAt?: string | null | undefined;
31
+ idempotencyKey: string;
32
+ };
33
+
34
+ /** @internal */
35
+ export const CreateGrantRequest$outboundSchema: z.ZodType<
36
+ CreateGrantRequest$Outbound,
37
+ z.ZodTypeDef,
38
+ CreateGrantRequest
39
+ > = z.object({
40
+ amount: z.number(),
41
+ effectiveAt: z.date().transform(v => v.toISOString()).optional(),
42
+ expiresAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
43
+ idempotencyKey: z.string(),
44
+ });
45
+
46
+ export function createGrantRequestToJSON(
47
+ createGrantRequest: CreateGrantRequest,
48
+ ): string {
49
+ return JSON.stringify(
50
+ CreateGrantRequest$outboundSchema.parse(createGrantRequest),
51
+ );
52
+ }
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { ClosedEnum } from "../types/enums.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
10
+
11
+ export const GrantObject = {
12
+ Grant: "grant",
13
+ } as const;
14
+ export type GrantObject = ClosedEnum<typeof GrantObject>;
15
+
16
+ export type Grant = {
17
+ object: GrantObject;
18
+ /**
19
+ * Unique identifier for the grant.
20
+ */
21
+ id: string;
22
+ /**
23
+ * The entitlement this grant belongs to.
24
+ */
25
+ entitlementId: string;
26
+ /**
27
+ * The number of credits granted.
28
+ */
29
+ amount: number;
30
+ /**
31
+ * When the grant becomes effective.
32
+ */
33
+ effectiveAt: Date;
34
+ /**
35
+ * When the grant expires. Null means no expiration.
36
+ */
37
+ expiresAt?: Date | null | undefined;
38
+ /**
39
+ * When the grant was voided. Null means the grant is active.
40
+ */
41
+ voidedAt?: Date | null | undefined;
42
+ /**
43
+ * When the grant was created.
44
+ */
45
+ createdAt: Date;
46
+ };
47
+
48
+ /** @internal */
49
+ export const GrantObject$inboundSchema: z.ZodNativeEnum<typeof GrantObject> = z
50
+ .nativeEnum(GrantObject);
51
+
52
+ /** @internal */
53
+ export const Grant$inboundSchema: z.ZodType<Grant, z.ZodTypeDef, unknown> = z
54
+ .object({
55
+ object: GrantObject$inboundSchema.default("grant"),
56
+ id: z.string(),
57
+ entitlementId: z.string(),
58
+ amount: z.number(),
59
+ effectiveAt: z.string().datetime({ offset: true }).transform(v =>
60
+ new Date(v)
61
+ ),
62
+ expiresAt: z.nullable(
63
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
64
+ ).optional(),
65
+ voidedAt: z.nullable(
66
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
67
+ ).optional(),
68
+ createdAt: z.string().datetime({ offset: true }).transform(v =>
69
+ new Date(v)
70
+ ),
71
+ });
72
+
73
+ export function grantFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<Grant, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => Grant$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'Grant' from JSON`,
80
+ );
81
+ }
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+ import {
10
+ InvoiceCategorySummary,
11
+ InvoiceCategorySummary$inboundSchema,
12
+ } from "./invoicecategorysummary.js";
13
+
14
+ export type GroupInvoiceSummary = {
15
+ /**
16
+ * Unique identifier for the group (e.g. plan ID, or 'other')
17
+ */
18
+ groupKey: string;
19
+ /**
20
+ * Human-readable label for the group (e.g. plan name)
21
+ */
22
+ groupLabel: string;
23
+ outstanding: InvoiceCategorySummary;
24
+ paid: InvoiceCategorySummary;
25
+ writtenOff: InvoiceCategorySummary;
26
+ };
27
+
28
+ /** @internal */
29
+ export const GroupInvoiceSummary$inboundSchema: z.ZodType<
30
+ GroupInvoiceSummary,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ groupKey: z.string(),
35
+ groupLabel: z.string(),
36
+ outstanding: InvoiceCategorySummary$inboundSchema,
37
+ paid: InvoiceCategorySummary$inboundSchema,
38
+ writtenOff: InvoiceCategorySummary$inboundSchema,
39
+ });
40
+
41
+ export function groupInvoiceSummaryFromJSON(
42
+ jsonString: string,
43
+ ): SafeParseResult<GroupInvoiceSummary, SDKValidationError> {
44
+ return safeParse(
45
+ jsonString,
46
+ (x) => GroupInvoiceSummary$inboundSchema.parse(JSON.parse(x)),
47
+ `Failed to parse 'GroupInvoiceSummary' from JSON`,
48
+ );
49
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
9
+
10
+ export type GroupTrendEntry = {
11
+ /**
12
+ * Unique identifier for the group (e.g. plan ID, or 'other')
13
+ */
14
+ groupKey: string;
15
+ /**
16
+ * Human-readable label for the group (e.g. plan name)
17
+ */
18
+ groupLabel: string;
19
+ /**
20
+ * Total issued invoice amount in dollars for this group in this bucket
21
+ */
22
+ issuedInvoices: string;
23
+ };
24
+
25
+ /** @internal */
26
+ export const GroupTrendEntry$inboundSchema: z.ZodType<
27
+ GroupTrendEntry,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ groupKey: z.string(),
32
+ groupLabel: z.string(),
33
+ issuedInvoices: z.string(),
34
+ });
35
+
36
+ export function groupTrendEntryFromJSON(
37
+ jsonString: string,
38
+ ): SafeParseResult<GroupTrendEntry, SDKValidationError> {
39
+ return safeParse(
40
+ jsonString,
41
+ (x) => GroupTrendEntry$inboundSchema.parse(JSON.parse(x)),
42
+ `Failed to parse 'GroupTrendEntry' from JSON`,
43
+ );
44
+ }