@tirdad/sdk 2.1.46 → 2.1.48

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 (322) hide show
  1. package/esm/funcs/commitments-get-commitment-billing-terms.d.ts +17 -0
  2. package/esm/funcs/commitments-get-commitment-billing-terms.d.ts.map +1 -0
  3. package/esm/funcs/commitments-get-commitment-billing-terms.js +91 -0
  4. package/esm/funcs/commitments-get-commitment-billing-terms.js.map +1 -0
  5. package/esm/funcs/commitments-list-commitment-instalments.d.ts +17 -0
  6. package/esm/funcs/commitments-list-commitment-instalments.d.ts.map +1 -0
  7. package/esm/funcs/commitments-list-commitment-instalments.js +96 -0
  8. package/esm/funcs/commitments-list-commitment-instalments.js.map +1 -0
  9. package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts +17 -0
  10. package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts.map +1 -0
  11. package/esm/funcs/commitments-preview-commitment-billing-terms.js +93 -0
  12. package/esm/funcs/commitments-preview-commitment-billing-terms.js.map +1 -0
  13. package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts +17 -0
  14. package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts.map +1 -0
  15. package/esm/funcs/commitments-replace-commitment-billing-terms.js +93 -0
  16. package/esm/funcs/commitments-replace-commitment-billing-terms.js.map +1 -0
  17. package/esm/funcs/commitments-terminate-commitment.d.ts +1 -1
  18. package/esm/funcs/commitments-terminate-commitment.js +1 -1
  19. package/esm/funcs/commitments-trigger-commitment-instalment.d.ts +17 -0
  20. package/esm/funcs/commitments-trigger-commitment-instalment.d.ts.map +1 -0
  21. package/esm/funcs/commitments-trigger-commitment-instalment.js +98 -0
  22. package/esm/funcs/commitments-trigger-commitment-instalment.js.map +1 -0
  23. package/esm/funcs/events-get-usage-analytics.d.ts +5 -0
  24. package/esm/funcs/events-get-usage-analytics.d.ts.map +1 -1
  25. package/esm/funcs/events-get-usage-analytics.js +5 -0
  26. package/esm/funcs/events-get-usage-analytics.js.map +1 -1
  27. package/esm/funcs/prices-get-price-history.d.ts +17 -0
  28. package/esm/funcs/prices-get-price-history.d.ts.map +1 -0
  29. package/esm/funcs/prices-get-price-history.js +91 -0
  30. package/esm/funcs/prices-get-price-history.js.map +1 -0
  31. package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts +17 -0
  32. package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts.map +1 -0
  33. package/esm/funcs/subscriptions-get-subscription-line-item-history.js +91 -0
  34. package/esm/funcs/subscriptions-get-subscription-line-item-history.js.map +1 -0
  35. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts +17 -0
  36. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts.map +1 -0
  37. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js +69 -0
  38. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js.map +1 -0
  39. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts +17 -0
  40. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts.map +1 -0
  41. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js +69 -0
  42. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js.map +1 -0
  43. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts +17 -0
  44. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts.map +1 -0
  45. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js +69 -0
  46. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js.map +1 -0
  47. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts +17 -0
  48. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts.map +1 -0
  49. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js +69 -0
  50. package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js.map +1 -0
  51. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts +17 -0
  52. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts.map +1 -0
  53. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js +69 -0
  54. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js.map +1 -0
  55. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts +17 -0
  56. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts.map +1 -0
  57. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js +69 -0
  58. package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js.map +1 -0
  59. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts +17 -0
  60. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts.map +1 -0
  61. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js +69 -0
  62. package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js.map +1 -0
  63. package/esm/lib/config.d.ts +3 -3
  64. package/esm/lib/config.d.ts.map +1 -1
  65. package/esm/lib/config.js +10 -2
  66. package/esm/lib/config.js.map +1 -1
  67. package/esm/sdk/commitments.d.ts +36 -1
  68. package/esm/sdk/commitments.d.ts.map +1 -1
  69. package/esm/sdk/commitments.js +51 -1
  70. package/esm/sdk/commitments.js.map +1 -1
  71. package/esm/sdk/events.d.ts +5 -0
  72. package/esm/sdk/events.d.ts.map +1 -1
  73. package/esm/sdk/events.js +5 -0
  74. package/esm/sdk/events.js.map +1 -1
  75. package/esm/sdk/models/billing-term-input.d.ts +67 -0
  76. package/esm/sdk/models/billing-term-input.d.ts.map +1 -0
  77. package/esm/sdk/models/billing-term-input.js +43 -0
  78. package/esm/sdk/models/billing-term-input.js.map +1 -0
  79. package/esm/sdk/models/billing-term-kind.d.ts +12 -0
  80. package/esm/sdk/models/billing-term-kind.d.ts.map +1 -0
  81. package/esm/sdk/models/billing-term-kind.js +13 -0
  82. package/esm/sdk/models/billing-term-kind.js.map +1 -0
  83. package/esm/sdk/models/billing-term-owner-type.d.ts +9 -0
  84. package/esm/sdk/models/billing-term-owner-type.d.ts.map +1 -0
  85. package/esm/sdk/models/billing-term-owner-type.js +10 -0
  86. package/esm/sdk/models/billing-term-owner-type.js.map +1 -0
  87. package/esm/sdk/models/billing-term-split.d.ts +12 -0
  88. package/esm/sdk/models/billing-term-split.d.ts.map +1 -0
  89. package/esm/sdk/models/billing-term-split.js +13 -0
  90. package/esm/sdk/models/billing-term-split.js.map +1 -0
  91. package/esm/sdk/models/billing-term-value-type.d.ts +19 -0
  92. package/esm/sdk/models/billing-term-value-type.d.ts.map +1 -0
  93. package/esm/sdk/models/billing-term-value-type.js +17 -0
  94. package/esm/sdk/models/billing-term-value-type.js.map +1 -0
  95. package/esm/sdk/models/billing-terms-response.d.ts +13 -0
  96. package/esm/sdk/models/billing-terms-response.d.ts.map +1 -0
  97. package/esm/sdk/models/billing-terms-response.js +22 -0
  98. package/esm/sdk/models/billing-terms-response.js.map +1 -0
  99. package/esm/sdk/models/billingterm-instalment.d.ts +43 -0
  100. package/esm/sdk/models/billingterm-instalment.d.ts.map +1 -0
  101. package/esm/sdk/models/billingterm-instalment.js +68 -0
  102. package/esm/sdk/models/billingterm-instalment.js.map +1 -0
  103. package/esm/sdk/models/billingterm-term.d.ts +57 -0
  104. package/esm/sdk/models/billingterm-term.d.ts.map +1 -0
  105. package/esm/sdk/models/billingterm-term.js +65 -0
  106. package/esm/sdk/models/billingterm-term.js.map +1 -0
  107. package/esm/sdk/models/cancellation-fee-input.d.ts +18 -0
  108. package/esm/sdk/models/cancellation-fee-input.d.ts.map +1 -0
  109. package/esm/sdk/models/cancellation-fee-input.js +14 -0
  110. package/esm/sdk/models/cancellation-fee-input.js.map +1 -0
  111. package/esm/sdk/models/cancellation-fee-type.d.ts +16 -0
  112. package/esm/sdk/models/cancellation-fee-type.d.ts.map +1 -0
  113. package/esm/sdk/models/cancellation-fee-type.js +14 -0
  114. package/esm/sdk/models/cancellation-fee-type.js.map +1 -0
  115. package/esm/sdk/models/commitment-response.d.ts +9 -1
  116. package/esm/sdk/models/commitment-response.d.ts.map +1 -1
  117. package/esm/sdk/models/commitment-response.js +7 -1
  118. package/esm/sdk/models/commitment-response.js.map +1 -1
  119. package/esm/sdk/models/create-commitment-request.d.ts +12 -0
  120. package/esm/sdk/models/create-commitment-request.d.ts.map +1 -1
  121. package/esm/sdk/models/create-commitment-request.js +6 -0
  122. package/esm/sdk/models/create-commitment-request.js.map +1 -1
  123. package/esm/sdk/models/get-commitment-billing-terms-op.d.ts +15 -0
  124. package/esm/sdk/models/get-commitment-billing-terms-op.d.ts.map +1 -0
  125. package/esm/sdk/models/get-commitment-billing-terms-op.js +12 -0
  126. package/esm/sdk/models/get-commitment-billing-terms-op.js.map +1 -0
  127. package/esm/sdk/models/get-price-history-op.d.ts +15 -0
  128. package/esm/sdk/models/get-price-history-op.d.ts.map +1 -0
  129. package/esm/sdk/models/get-price-history-op.js +12 -0
  130. package/esm/sdk/models/get-price-history-op.js.map +1 -0
  131. package/esm/sdk/models/get-subscription-line-item-history-op.d.ts +15 -0
  132. package/esm/sdk/models/get-subscription-line-item-history-op.d.ts.map +1 -0
  133. package/esm/sdk/models/get-subscription-line-item-history-op.js +12 -0
  134. package/esm/sdk/models/get-subscription-line-item-history-op.js.map +1 -0
  135. package/esm/sdk/models/get-subscription-v2-op.d.ts +1 -1
  136. package/esm/sdk/models/grouped-invoicing-child-request.d.ts +3 -0
  137. package/esm/sdk/models/grouped-invoicing-child-request.d.ts.map +1 -1
  138. package/esm/sdk/models/grouped-invoicing-child-request.js +3 -0
  139. package/esm/sdk/models/grouped-invoicing-child-request.js.map +1 -1
  140. package/esm/sdk/models/index.d.ts +28 -0
  141. package/esm/sdk/models/index.d.ts.map +1 -1
  142. package/esm/sdk/models/index.js +28 -0
  143. package/esm/sdk/models/index.js.map +1 -1
  144. package/esm/sdk/models/instalment-bill-trigger.d.ts +12 -0
  145. package/esm/sdk/models/instalment-bill-trigger.d.ts.map +1 -0
  146. package/esm/sdk/models/instalment-bill-trigger.js +13 -0
  147. package/esm/sdk/models/instalment-bill-trigger.js.map +1 -0
  148. package/esm/sdk/models/instalment-delivery.d.ts +12 -0
  149. package/esm/sdk/models/instalment-delivery.d.ts.map +1 -0
  150. package/esm/sdk/models/instalment-delivery.js +13 -0
  151. package/esm/sdk/models/instalment-delivery.js.map +1 -0
  152. package/esm/sdk/models/instalment-kind.d.ts +10 -0
  153. package/esm/sdk/models/instalment-kind.d.ts.map +1 -0
  154. package/esm/sdk/models/instalment-kind.js +11 -0
  155. package/esm/sdk/models/instalment-kind.js.map +1 -0
  156. package/esm/sdk/models/instalment-status.d.ts +11 -0
  157. package/esm/sdk/models/instalment-status.d.ts.map +1 -0
  158. package/esm/sdk/models/instalment-status.js +12 -0
  159. package/esm/sdk/models/instalment-status.js.map +1 -0
  160. package/esm/sdk/models/invoice-billing-reason.d.ts +2 -0
  161. package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
  162. package/esm/sdk/models/invoice-billing-reason.js +2 -0
  163. package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
  164. package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
  165. package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
  166. package/esm/sdk/models/invoice-line-item-response.js +2 -0
  167. package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
  168. package/esm/sdk/models/list-commitment-instalments-op.d.ts +20 -0
  169. package/esm/sdk/models/list-commitment-instalments-op.d.ts.map +1 -0
  170. package/esm/sdk/models/list-commitment-instalments-op.js +13 -0
  171. package/esm/sdk/models/list-commitment-instalments-op.js.map +1 -0
  172. package/esm/sdk/models/list-instalments-response.d.ts +11 -0
  173. package/esm/sdk/models/list-instalments-response.d.ts.map +1 -0
  174. package/esm/sdk/models/list-instalments-response.js +15 -0
  175. package/esm/sdk/models/list-instalments-response.js.map +1 -0
  176. package/esm/sdk/models/payment-attempt-response.d.ts +1 -0
  177. package/esm/sdk/models/payment-attempt-response.d.ts.map +1 -1
  178. package/esm/sdk/models/payment-attempt-response.js +2 -0
  179. package/esm/sdk/models/payment-attempt-response.js.map +1 -1
  180. package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts +21 -0
  181. package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts.map +1 -0
  182. package/esm/sdk/models/preview-commitment-billing-terms-op.js +14 -0
  183. package/esm/sdk/models/preview-commitment-billing-terms-op.js.map +1 -0
  184. package/esm/sdk/models/replace-billing-terms-request.d.ts +13 -0
  185. package/esm/sdk/models/replace-billing-terms-request.d.ts.map +1 -0
  186. package/esm/sdk/models/replace-billing-terms-request.js +18 -0
  187. package/esm/sdk/models/replace-billing-terms-request.js.map +1 -0
  188. package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts +21 -0
  189. package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts.map +1 -0
  190. package/esm/sdk/models/replace-commitment-billing-terms-op.js +14 -0
  191. package/esm/sdk/models/replace-commitment-billing-terms-op.js.map +1 -0
  192. package/esm/sdk/models/subscription-response-v2.d.ts +5 -0
  193. package/esm/sdk/models/subscription-response-v2.d.ts.map +1 -1
  194. package/esm/sdk/models/subscription-response-v2.js +2 -0
  195. package/esm/sdk/models/subscription-response-v2.js.map +1 -1
  196. package/esm/sdk/models/subscription-response.d.ts +5 -0
  197. package/esm/sdk/models/subscription-response.d.ts.map +1 -1
  198. package/esm/sdk/models/subscription-response.js +2 -0
  199. package/esm/sdk/models/subscription-response.js.map +1 -1
  200. package/esm/sdk/models/terminate-commitment-request.d.ts +6 -2
  201. package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -1
  202. package/esm/sdk/models/terminate-commitment-request.js +2 -1
  203. package/esm/sdk/models/terminate-commitment-request.js.map +1 -1
  204. package/esm/sdk/models/trigger-commitment-instalment-op.d.ts +26 -0
  205. package/esm/sdk/models/trigger-commitment-instalment-op.d.ts.map +1 -0
  206. package/esm/sdk/models/trigger-commitment-instalment-op.js +20 -0
  207. package/esm/sdk/models/trigger-commitment-instalment-op.js.map +1 -0
  208. package/esm/sdk/models/trigger-instalment-request.d.ts +15 -0
  209. package/esm/sdk/models/trigger-instalment-request.d.ts.map +1 -0
  210. package/esm/sdk/models/trigger-instalment-request.js +17 -0
  211. package/esm/sdk/models/trigger-instalment-request.js.map +1 -0
  212. package/esm/sdk/models/update-commitment-request.d.ts +5 -0
  213. package/esm/sdk/models/update-commitment-request.d.ts.map +1 -1
  214. package/esm/sdk/models/update-commitment-request.js +2 -0
  215. package/esm/sdk/models/update-commitment-request.js.map +1 -1
  216. package/esm/sdk/models/update-subscription-request.d.ts +3 -0
  217. package/esm/sdk/models/update-subscription-request.d.ts.map +1 -1
  218. package/esm/sdk/models/update-subscription-request.js +3 -0
  219. package/esm/sdk/models/update-subscription-request.js.map +1 -1
  220. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts +13 -0
  221. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts.map +1 -0
  222. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js +22 -0
  223. package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js.map +1 -0
  224. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts +16 -0
  225. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts.map +1 -0
  226. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js +28 -0
  227. package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js.map +1 -0
  228. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts +1 -0
  229. package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts.map +1 -1
  230. package/esm/sdk/models/webhook-dto-invoice-line-item.js +2 -0
  231. package/esm/sdk/models/webhook-dto-invoice-line-item.js.map +1 -1
  232. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts +17 -0
  233. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts.map +1 -0
  234. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js +27 -0
  235. package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js.map +1 -0
  236. package/esm/sdk/models/webhook-dto-payment-attempt.d.ts +17 -0
  237. package/esm/sdk/models/webhook-dto-payment-attempt.d.ts.map +1 -0
  238. package/esm/sdk/models/webhook-dto-payment-attempt.js +27 -0
  239. package/esm/sdk/models/webhook-dto-payment-attempt.js.map +1 -0
  240. package/esm/sdk/models/webhook-event-name.d.ts +7 -0
  241. package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
  242. package/esm/sdk/models/webhook-event-name.js +7 -0
  243. package/esm/sdk/models/webhook-event-name.js.map +1 -1
  244. package/esm/sdk/prices.d.ts +7 -0
  245. package/esm/sdk/prices.d.ts.map +1 -1
  246. package/esm/sdk/prices.js +10 -0
  247. package/esm/sdk/prices.js.map +1 -1
  248. package/esm/sdk/subscriptions.d.ts +7 -0
  249. package/esm/sdk/subscriptions.d.ts.map +1 -1
  250. package/esm/sdk/subscriptions.js +10 -0
  251. package/esm/sdk/subscriptions.js.map +1 -1
  252. package/esm/sdk/webhook-events.d.ts +49 -0
  253. package/esm/sdk/webhook-events.d.ts.map +1 -1
  254. package/esm/sdk/webhook-events.js +70 -0
  255. package/esm/sdk/webhook-events.js.map +1 -1
  256. package/jsr.json +1 -1
  257. package/package.json +1 -1
  258. package/src/funcs/commitments-get-commitment-billing-terms.ts +182 -0
  259. package/src/funcs/commitments-list-commitment-instalments.ts +191 -0
  260. package/src/funcs/commitments-preview-commitment-billing-terms.ts +192 -0
  261. package/src/funcs/commitments-replace-commitment-billing-terms.ts +190 -0
  262. package/src/funcs/commitments-terminate-commitment.ts +1 -1
  263. package/src/funcs/commitments-trigger-commitment-instalment.ts +197 -0
  264. package/src/funcs/events-get-usage-analytics.ts +5 -0
  265. package/src/funcs/prices-get-price-history.ts +181 -0
  266. package/src/funcs/subscriptions-get-subscription-line-item-history.ts +185 -0
  267. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.ts +144 -0
  268. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-created.ts +144 -0
  269. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.ts +144 -0
  270. package/src/funcs/webhook-events-post-webhook-events-billing-instalment-updated.ts +144 -0
  271. package/src/funcs/webhook-events-post-webhook-events-billing-terms-created.ts +144 -0
  272. package/src/funcs/webhook-events-post-webhook-events-billing-terms-updated.ts +144 -0
  273. package/src/funcs/webhook-events-post-webhook-events-payment-attempt-failed.ts +144 -0
  274. package/src/lib/config.ts +10 -2
  275. package/src/sdk/commitments.ts +101 -1
  276. package/src/sdk/events.ts +5 -0
  277. package/src/sdk/models/billing-term-input.ts +127 -0
  278. package/src/sdk/models/billing-term-kind.ts +24 -0
  279. package/src/sdk/models/billing-term-owner-type.ts +16 -0
  280. package/src/sdk/models/billing-term-split.ts +24 -0
  281. package/src/sdk/models/billing-term-value-type.ts +31 -0
  282. package/src/sdk/models/billing-terms-response.ts +49 -0
  283. package/src/sdk/models/billingterm-instalment.ts +128 -0
  284. package/src/sdk/models/billingterm-term.ts +143 -0
  285. package/src/sdk/models/cancellation-fee-input.ts +40 -0
  286. package/src/sdk/models/cancellation-fee-type.ts +23 -0
  287. package/src/sdk/models/commitment-response.ts +22 -2
  288. package/src/sdk/models/create-commitment-request.ts +23 -0
  289. package/src/sdk/models/get-commitment-billing-terms-op.ts +35 -0
  290. package/src/sdk/models/get-price-history-op.ts +33 -0
  291. package/src/sdk/models/get-subscription-line-item-history-op.ts +36 -0
  292. package/src/sdk/models/get-subscription-v2-op.ts +1 -1
  293. package/src/sdk/models/grouped-invoicing-child-request.ts +8 -0
  294. package/src/sdk/models/index.ts +28 -0
  295. package/src/sdk/models/instalment-bill-trigger.ts +24 -0
  296. package/src/sdk/models/instalment-delivery.ts +24 -0
  297. package/src/sdk/models/instalment-kind.ts +19 -0
  298. package/src/sdk/models/instalment-status.ts +20 -0
  299. package/src/sdk/models/invoice-billing-reason.ts +2 -0
  300. package/src/sdk/models/invoice-line-item-response.ts +6 -0
  301. package/src/sdk/models/list-commitment-instalments-op.ts +41 -0
  302. package/src/sdk/models/list-instalments-response.ts +35 -0
  303. package/src/sdk/models/payment-attempt-response.ts +3 -0
  304. package/src/sdk/models/preview-commitment-billing-terms-op.ts +46 -0
  305. package/src/sdk/models/replace-billing-terms-request.ts +43 -0
  306. package/src/sdk/models/replace-commitment-billing-terms-op.ts +46 -0
  307. package/src/sdk/models/subscription-response-v2.ts +9 -0
  308. package/src/sdk/models/subscription-response.ts +9 -0
  309. package/src/sdk/models/terminate-commitment-request.ts +11 -3
  310. package/src/sdk/models/trigger-commitment-instalment-op.ts +60 -0
  311. package/src/sdk/models/trigger-instalment-request.ts +41 -0
  312. package/src/sdk/models/update-commitment-request.ts +7 -0
  313. package/src/sdk/models/update-subscription-request.ts +8 -0
  314. package/src/sdk/models/webhook-dto-billing-instalment-webhook-payload.ts +53 -0
  315. package/src/sdk/models/webhook-dto-billing-terms-webhook-payload.ts +61 -0
  316. package/src/sdk/models/webhook-dto-invoice-line-item.ts +3 -0
  317. package/src/sdk/models/webhook-dto-payment-attempt-webhook-payload.ts +61 -0
  318. package/src/sdk/models/webhook-dto-payment-attempt.ts +52 -0
  319. package/src/sdk/models/webhook-event-name.ts +7 -0
  320. package/src/sdk/prices.ts +18 -0
  321. package/src/sdk/subscriptions.ts +18 -0
  322. package/src/sdk/webhook-events.ts +112 -0
@@ -0,0 +1,197 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { TirdadCore } from "../core.js";
7
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../sdk/models/http-client-errors.js";
22
+ import * as models from "../sdk/models/index.js";
23
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
24
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
25
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Trigger instalment
31
+ *
32
+ * @remarks
33
+ * Bills a manual instalment of an active commitment on bill_on, now by default, which must fall within the commitment term. The instalment goes on the first subscription invoice at or after that date, or on its own invoice once due when its instalment_invoicing, the term's or else the commitment's, is separate_invoice. Either way it waits while the subscription is trialing or paused. Until it is triggered, a manual instalment waits at the end of the term, and bill_on can only move earlier; edit the billing terms to bill it later.
34
+ */
35
+ export function commitmentsTriggerCommitmentInstalment(
36
+ client: TirdadCore,
37
+ id: string,
38
+ instalmentId: string,
39
+ body?: models.TriggerInstalmentRequest | undefined,
40
+ options?: RequestOptions,
41
+ ): APIPromise<
42
+ Result<
43
+ models.BillingtermInstalment,
44
+ | models.ErrorsErrorResponse
45
+ | TirdadError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ id,
58
+ instalmentId,
59
+ body,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ async function $do(
65
+ client: TirdadCore,
66
+ id: string,
67
+ instalmentId: string,
68
+ body?: models.TriggerInstalmentRequest | undefined,
69
+ options?: RequestOptions,
70
+ ): Promise<
71
+ [
72
+ Result<
73
+ models.BillingtermInstalment,
74
+ | models.ErrorsErrorResponse
75
+ | TirdadError
76
+ | ResponseValidationError
77
+ | ConnectionError
78
+ | RequestAbortedError
79
+ | RequestTimeoutError
80
+ | InvalidRequestError
81
+ | UnexpectedClientError
82
+ | SDKValidationError
83
+ >,
84
+ APICall,
85
+ ]
86
+ > {
87
+ const input: models.TriggerCommitmentInstalmentRequest = {
88
+ id: id,
89
+ instalmentId: instalmentId,
90
+ body: body,
91
+ };
92
+
93
+ const parsed = safeParse(
94
+ input,
95
+ (value) =>
96
+ z.parse(models.TriggerCommitmentInstalmentRequest$outboundSchema, value),
97
+ "Input validation failed",
98
+ );
99
+ if (!parsed.ok) {
100
+ return [parsed, { status: "invalid" }];
101
+ }
102
+ const payload = parsed.value;
103
+ const body$ = encodeJSON("body", payload.body, { explode: true });
104
+
105
+ const pathParams = {
106
+ id: encodeSimple("id", payload.id, {
107
+ explode: false,
108
+ charEncoding: "percent",
109
+ }),
110
+ instalment_id: encodeSimple("instalment_id", payload.instalment_id, {
111
+ explode: false,
112
+ charEncoding: "percent",
113
+ }),
114
+ };
115
+ const path = pathToFunc(
116
+ "/commitments/{id}/instalments/{instalment_id}/trigger",
117
+ )(pathParams);
118
+
119
+ const headers = new Headers(compactMap({
120
+ "Content-Type": "application/json",
121
+ Accept: "application/json",
122
+ }));
123
+
124
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
125
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
126
+ const requestSecurity = resolveGlobalSecurity(securityInput);
127
+
128
+ const context = {
129
+ options: client._options,
130
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
131
+ operationID: "triggerCommitmentInstalment",
132
+ oAuth2Scopes: null,
133
+
134
+ resolvedSecurity: requestSecurity,
135
+
136
+ securitySource: client._options.apiKeyAuth,
137
+ retryConfig: options?.retries
138
+ || client._options.retryConfig
139
+ || { strategy: "none" },
140
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
141
+ };
142
+
143
+ const requestRes = client._createRequest(context, {
144
+ security: requestSecurity,
145
+ method: "POST",
146
+ baseURL: options?.serverURL,
147
+ path: path,
148
+ headers: headers,
149
+ body: body$,
150
+ userAgent: client._options.userAgent,
151
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
152
+ }, options);
153
+ if (!requestRes.ok) {
154
+ return [requestRes, { status: "invalid" }];
155
+ }
156
+ const req = requestRes.value;
157
+
158
+ const doResult = await client._do(req, {
159
+ context,
160
+ isErrorStatusCode: (statusCode: number) =>
161
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
162
+ retryConfig: context.retryConfig,
163
+ retryCodes: context.retryCodes,
164
+ });
165
+ if (!doResult.ok) {
166
+ return [doResult, { status: "request-error", request: req }];
167
+ }
168
+ const response = doResult.value;
169
+
170
+ const responseFields = {
171
+ HttpMeta: { Response: response, Request: req },
172
+ };
173
+
174
+ const [result] = await M.match<
175
+ models.BillingtermInstalment,
176
+ | models.ErrorsErrorResponse
177
+ | TirdadError
178
+ | ResponseValidationError
179
+ | ConnectionError
180
+ | RequestAbortedError
181
+ | RequestTimeoutError
182
+ | InvalidRequestError
183
+ | UnexpectedClientError
184
+ | SDKValidationError
185
+ >(
186
+ M.json(200, models.BillingtermInstalment$inboundSchema),
187
+ M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
188
+ M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
189
+ M.fail("4XX"),
190
+ M.fail("5XX"),
191
+ )(response, req, { extraFields: responseFields });
192
+ if (!result.ok) {
193
+ return [result, { status: "complete", request: req, response }];
194
+ }
195
+
196
+ return [result, { status: "complete", request: req, response }];
197
+ }
@@ -31,6 +31,11 @@ import { Result } from "../types/fp.js";
31
31
  *
32
32
  * @remarks
33
33
  * Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.
34
+ * Groups and regular-meter time-series points contain usage-proportional cost allocations, not independently priced charges.
35
+ * Source/property filters return the unfiltered usage charge for the same time range multiplied by filtered quantity / full quantity; groups split that filtered share. Filtered costs exclude commitments and true-up.
36
+ * When full quantity is zero, no proportional rate is defined; costs retain direct per-group/per-bucket pricing.
37
+ * Analytics are eventually consistent: concurrent ingestion or late events can make filtered allocations approximate across separate reads. These allocations are not an invoice preview.
38
+ * For non-additive meters such as MAX, quantities use the meter's aggregation, so individual group shares can change when filtering or grouping changes.
34
39
  */
35
40
  export function eventsGetUsageAnalytics(
36
41
  client: TirdadCore,
@@ -0,0 +1,181 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { TirdadCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../sdk/models/http-client-errors.js";
22
+ import * as models from "../sdk/models/index.js";
23
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
24
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
25
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get price history
31
+ *
32
+ * @remarks
33
+ * Use when you need every version of a plan price, oldest first. Pass the ID of any version; the same timeline is returned.
34
+ */
35
+ export function pricesGetPriceHistory(
36
+ client: TirdadCore,
37
+ id: string,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.ListPricesResponse,
42
+ | models.ErrorsErrorResponse
43
+ | TirdadError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ id,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: TirdadCore,
62
+ id: string,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ models.ListPricesResponse,
68
+ | models.ErrorsErrorResponse
69
+ | TirdadError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const input: models.GetPriceHistoryRequest = {
82
+ id: id,
83
+ };
84
+
85
+ const parsed = safeParse(
86
+ input,
87
+ (value) => z.parse(models.GetPriceHistoryRequest$outboundSchema, value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const pathParams = {
97
+ id: encodeSimple("id", payload.id, {
98
+ explode: false,
99
+ charEncoding: "percent",
100
+ }),
101
+ };
102
+ const path = pathToFunc("/prices/{id}/history")(pathParams);
103
+
104
+ const headers = new Headers(compactMap({
105
+ Accept: "application/json",
106
+ }));
107
+
108
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
109
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
110
+ const requestSecurity = resolveGlobalSecurity(securityInput);
111
+
112
+ const context = {
113
+ options: client._options,
114
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
115
+ operationID: "getPriceHistory",
116
+ oAuth2Scopes: null,
117
+
118
+ resolvedSecurity: requestSecurity,
119
+
120
+ securitySource: client._options.apiKeyAuth,
121
+ retryConfig: options?.retries
122
+ || client._options.retryConfig
123
+ || { strategy: "none" },
124
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
125
+ };
126
+
127
+ const requestRes = client._createRequest(context, {
128
+ security: requestSecurity,
129
+ method: "GET",
130
+ baseURL: options?.serverURL,
131
+ path: path,
132
+ headers: headers,
133
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ isErrorStatusCode: (statusCode: number) =>
145
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const responseFields = {
155
+ HttpMeta: { Response: response, Request: req },
156
+ };
157
+
158
+ const [result] = await M.match<
159
+ models.ListPricesResponse,
160
+ | models.ErrorsErrorResponse
161
+ | TirdadError
162
+ | ResponseValidationError
163
+ | ConnectionError
164
+ | RequestAbortedError
165
+ | RequestTimeoutError
166
+ | InvalidRequestError
167
+ | UnexpectedClientError
168
+ | SDKValidationError
169
+ >(
170
+ M.json(200, models.ListPricesResponse$inboundSchema),
171
+ M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
172
+ M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
173
+ M.fail("4XX"),
174
+ M.fail("5XX"),
175
+ )(response, req, { extraFields: responseFields });
176
+ if (!result.ok) {
177
+ return [result, { status: "complete", request: req, response }];
178
+ }
179
+
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
@@ -0,0 +1,185 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { TirdadCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../sdk/models/http-client-errors.js";
22
+ import * as models from "../sdk/models/index.js";
23
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
24
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
25
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get subscription line item history
31
+ *
32
+ * @remarks
33
+ * Use when you need every version of a subscription line item, oldest first. Pass the ID of any version; the same timeline is returned. Versions cancelled before they started are left out unless requested directly.
34
+ */
35
+ export function subscriptionsGetSubscriptionLineItemHistory(
36
+ client: TirdadCore,
37
+ id: string,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.ListSubscriptionLineItemsResponse,
42
+ | models.ErrorsErrorResponse
43
+ | TirdadError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ id,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: TirdadCore,
62
+ id: string,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ models.ListSubscriptionLineItemsResponse,
68
+ | models.ErrorsErrorResponse
69
+ | TirdadError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const input: models.GetSubscriptionLineItemHistoryRequest = {
82
+ id: id,
83
+ };
84
+
85
+ const parsed = safeParse(
86
+ input,
87
+ (value) =>
88
+ z.parse(
89
+ models.GetSubscriptionLineItemHistoryRequest$outboundSchema,
90
+ value,
91
+ ),
92
+ "Input validation failed",
93
+ );
94
+ if (!parsed.ok) {
95
+ return [parsed, { status: "invalid" }];
96
+ }
97
+ const payload = parsed.value;
98
+ const body = null;
99
+
100
+ const pathParams = {
101
+ id: encodeSimple("id", payload.id, {
102
+ explode: false,
103
+ charEncoding: "percent",
104
+ }),
105
+ };
106
+ const path = pathToFunc("/subscriptions/lineitems/{id}/history")(pathParams);
107
+
108
+ const headers = new Headers(compactMap({
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
113
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ options: client._options,
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "getSubscriptionLineItemHistory",
120
+ oAuth2Scopes: null,
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.apiKeyAuth,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "GET",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ isErrorStatusCode: (statusCode: number) =>
149
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
150
+ retryConfig: context.retryConfig,
151
+ retryCodes: context.retryCodes,
152
+ });
153
+ if (!doResult.ok) {
154
+ return [doResult, { status: "request-error", request: req }];
155
+ }
156
+ const response = doResult.value;
157
+
158
+ const responseFields = {
159
+ HttpMeta: { Response: response, Request: req },
160
+ };
161
+
162
+ const [result] = await M.match<
163
+ models.ListSubscriptionLineItemsResponse,
164
+ | models.ErrorsErrorResponse
165
+ | TirdadError
166
+ | ResponseValidationError
167
+ | ConnectionError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | InvalidRequestError
171
+ | UnexpectedClientError
172
+ | SDKValidationError
173
+ >(
174
+ M.json(200, models.ListSubscriptionLineItemsResponse$inboundSchema),
175
+ M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
176
+ M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
177
+ M.fail("4XX"),
178
+ M.fail("5XX"),
179
+ )(response, req, { extraFields: responseFields });
180
+ if (!result.ok) {
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
183
+
184
+ return [result, { status: "complete", request: req, response }];
185
+ }