@tirdad/sdk 2.1.43 → 2.1.44

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 (309) hide show
  1. package/esm/funcs/commitments-create-commitment.d.ts +17 -0
  2. package/esm/funcs/commitments-create-commitment.d.ts.map +1 -0
  3. package/esm/funcs/commitments-create-commitment.js +83 -0
  4. package/esm/funcs/commitments-create-commitment.js.map +1 -0
  5. package/esm/funcs/commitments-get-commitment.d.ts +17 -0
  6. package/esm/funcs/commitments-get-commitment.d.ts.map +1 -0
  7. package/esm/funcs/commitments-get-commitment.js +91 -0
  8. package/esm/funcs/commitments-get-commitment.js.map +1 -0
  9. package/esm/funcs/commitments-preview-commitment.d.ts +17 -0
  10. package/esm/funcs/commitments-preview-commitment.d.ts.map +1 -0
  11. package/esm/funcs/commitments-preview-commitment.js +83 -0
  12. package/esm/funcs/commitments-preview-commitment.js.map +1 -0
  13. package/esm/funcs/commitments-query-commitment.d.ts +17 -0
  14. package/esm/funcs/commitments-query-commitment.d.ts.map +1 -0
  15. package/esm/funcs/commitments-query-commitment.js +83 -0
  16. package/esm/funcs/commitments-query-commitment.js.map +1 -0
  17. package/esm/funcs/commitments-terminate-commitment.d.ts +17 -0
  18. package/esm/funcs/commitments-terminate-commitment.d.ts.map +1 -0
  19. package/esm/funcs/commitments-terminate-commitment.js +93 -0
  20. package/esm/funcs/commitments-terminate-commitment.js.map +1 -0
  21. package/esm/funcs/commitments-update-commitment.d.ts +17 -0
  22. package/esm/funcs/commitments-update-commitment.d.ts.map +1 -0
  23. package/esm/funcs/commitments-update-commitment.js +93 -0
  24. package/esm/funcs/commitments-update-commitment.js.map +1 -0
  25. package/esm/funcs/events-delete-events.d.ts +17 -0
  26. package/esm/funcs/events-delete-events.d.ts.map +1 -0
  27. package/esm/funcs/events-delete-events.js +86 -0
  28. package/esm/funcs/events-delete-events.js.map +1 -0
  29. package/esm/funcs/self-billing-get-self-billing-summary.d.ts +1 -1
  30. package/esm/funcs/self-billing-get-self-billing-summary.js +1 -1
  31. package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts +17 -0
  32. package/esm/funcs/webhook-events-post-webhook-events-commitment-created.d.ts.map +1 -0
  33. package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js +69 -0
  34. package/esm/funcs/webhook-events-post-webhook-events-commitment-created.js.map +1 -0
  35. package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts +17 -0
  36. package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.d.ts.map +1 -0
  37. package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js +69 -0
  38. package/esm/funcs/webhook-events-post-webhook-events-commitment-terminated.js.map +1 -0
  39. package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts +17 -0
  40. package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.d.ts.map +1 -0
  41. package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js +69 -0
  42. package/esm/funcs/webhook-events-post-webhook-events-commitment-updated.js.map +1 -0
  43. package/esm/lib/config.d.ts +2 -2
  44. package/esm/lib/config.js +2 -2
  45. package/esm/sdk/commitments.d.ts +47 -0
  46. package/esm/sdk/commitments.d.ts.map +1 -0
  47. package/esm/sdk/commitments.js +68 -0
  48. package/esm/sdk/commitments.js.map +1 -0
  49. package/esm/sdk/events.d.ts +7 -0
  50. package/esm/sdk/events.d.ts.map +1 -1
  51. package/esm/sdk/events.js +10 -0
  52. package/esm/sdk/events.js.map +1 -1
  53. package/esm/sdk/models/active-window.d.ts +20 -0
  54. package/esm/sdk/models/active-window.d.ts.map +1 -0
  55. package/esm/sdk/models/active-window.js +24 -0
  56. package/esm/sdk/models/active-window.js.map +1 -0
  57. package/esm/sdk/models/commitment-collection-method.d.ts +12 -0
  58. package/esm/sdk/models/commitment-collection-method.d.ts.map +1 -0
  59. package/esm/sdk/models/commitment-collection-method.js +13 -0
  60. package/esm/sdk/models/commitment-collection-method.js.map +1 -0
  61. package/esm/sdk/models/commitment-early-termination.d.ts +11 -0
  62. package/esm/sdk/models/commitment-early-termination.d.ts.map +1 -0
  63. package/esm/sdk/models/commitment-early-termination.js +12 -0
  64. package/esm/sdk/models/commitment-early-termination.js.map +1 -0
  65. package/esm/sdk/models/commitment-filter.d.ts +60 -0
  66. package/esm/sdk/models/commitment-filter.d.ts.map +1 -0
  67. package/esm/sdk/models/commitment-filter.js +51 -0
  68. package/esm/sdk/models/commitment-filter.js.map +1 -0
  69. package/esm/sdk/models/commitment-measurement.d.ts +12 -0
  70. package/esm/sdk/models/commitment-measurement.d.ts.map +1 -0
  71. package/esm/sdk/models/commitment-measurement.js +13 -0
  72. package/esm/sdk/models/commitment-measurement.js.map +1 -0
  73. package/esm/sdk/models/commitment-price-input.d.ts +24 -0
  74. package/esm/sdk/models/commitment-price-input.d.ts.map +1 -0
  75. package/esm/sdk/models/commitment-price-input.js +27 -0
  76. package/esm/sdk/models/commitment-price-input.js.map +1 -0
  77. package/esm/sdk/models/commitment-response.d.ts +56 -0
  78. package/esm/sdk/models/commitment-response.d.ts.map +1 -0
  79. package/esm/sdk/models/commitment-response.js +88 -0
  80. package/esm/sdk/models/commitment-response.js.map +1 -0
  81. package/esm/sdk/models/commitment-scope-input.d.ts +18 -0
  82. package/esm/sdk/models/commitment-scope-input.d.ts.map +1 -0
  83. package/esm/sdk/models/commitment-scope-input.js +20 -0
  84. package/esm/sdk/models/commitment-scope-input.js.map +1 -0
  85. package/esm/sdk/models/commitment-scope-type.d.ts +14 -0
  86. package/esm/sdk/models/commitment-scope-type.d.ts.map +1 -0
  87. package/esm/sdk/models/commitment-scope-type.js +15 -0
  88. package/esm/sdk/models/commitment-scope-type.js.map +1 -0
  89. package/esm/sdk/models/commitment-status.d.ts +13 -0
  90. package/esm/sdk/models/commitment-status.d.ts.map +1 -0
  91. package/esm/sdk/models/commitment-status.js +14 -0
  92. package/esm/sdk/models/commitment-status.js.map +1 -0
  93. package/esm/sdk/models/commitment-usage-breakdown.d.ts +33 -0
  94. package/esm/sdk/models/commitment-usage-breakdown.d.ts.map +1 -0
  95. package/esm/sdk/models/commitment-usage-breakdown.js +37 -0
  96. package/esm/sdk/models/commitment-usage-breakdown.js.map +1 -0
  97. package/esm/sdk/models/commitment-usage-value.d.ts +11 -0
  98. package/esm/sdk/models/commitment-usage-value.d.ts.map +1 -0
  99. package/esm/sdk/models/commitment-usage-value.js +15 -0
  100. package/esm/sdk/models/commitment-usage-value.js.map +1 -0
  101. package/esm/sdk/models/create-commitment-request.d.ts +64 -0
  102. package/esm/sdk/models/create-commitment-request.d.ts.map +1 -0
  103. package/esm/sdk/models/create-commitment-request.js +50 -0
  104. package/esm/sdk/models/create-commitment-request.js.map +1 -0
  105. package/esm/sdk/models/create-entitlement-request.d.ts +3 -0
  106. package/esm/sdk/models/create-entitlement-request.d.ts.map +1 -1
  107. package/esm/sdk/models/create-entitlement-request.js.map +1 -1
  108. package/esm/sdk/models/create-price-tier.d.ts +3 -0
  109. package/esm/sdk/models/create-price-tier.d.ts.map +1 -1
  110. package/esm/sdk/models/create-price-tier.js +3 -0
  111. package/esm/sdk/models/create-price-tier.js.map +1 -1
  112. package/esm/sdk/models/create-subscription-request.d.ts +9 -0
  113. package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
  114. package/esm/sdk/models/create-subscription-request.js +2 -0
  115. package/esm/sdk/models/create-subscription-request.js.map +1 -1
  116. package/esm/sdk/models/delete-events-op.d.ts +14 -0
  117. package/esm/sdk/models/delete-events-op.d.ts.map +1 -0
  118. package/esm/sdk/models/delete-events-op.js +21 -0
  119. package/esm/sdk/models/delete-events-op.js.map +1 -0
  120. package/esm/sdk/models/delete-events-request.d.ts +38 -0
  121. package/esm/sdk/models/delete-events-request.d.ts.map +1 -0
  122. package/esm/sdk/models/delete-events-request.js +27 -0
  123. package/esm/sdk/models/delete-events-request.js.map +1 -0
  124. package/esm/sdk/models/delete-events-response.d.ts +11 -0
  125. package/esm/sdk/models/delete-events-response.d.ts.map +1 -0
  126. package/esm/sdk/models/delete-events-response.js +21 -0
  127. package/esm/sdk/models/delete-events-response.js.map +1 -0
  128. package/esm/sdk/models/get-commitment-op.d.ts +15 -0
  129. package/esm/sdk/models/get-commitment-op.d.ts.map +1 -0
  130. package/esm/sdk/models/get-commitment-op.js +12 -0
  131. package/esm/sdk/models/get-commitment-op.js.map +1 -0
  132. package/esm/sdk/models/get-usage-by-subscription-response.d.ts +5 -0
  133. package/esm/sdk/models/get-usage-by-subscription-response.d.ts.map +1 -1
  134. package/esm/sdk/models/get-usage-by-subscription-response.js +2 -0
  135. package/esm/sdk/models/get-usage-by-subscription-response.js.map +1 -1
  136. package/esm/sdk/models/index.d.ts +28 -0
  137. package/esm/sdk/models/index.d.ts.map +1 -1
  138. package/esm/sdk/models/index.js +28 -0
  139. package/esm/sdk/models/index.js.map +1 -1
  140. package/esm/sdk/models/invoice-filter.d.ts +10 -0
  141. package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
  142. package/esm/sdk/models/invoice-filter.js +4 -0
  143. package/esm/sdk/models/invoice-filter.js.map +1 -1
  144. package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
  145. package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
  146. package/esm/sdk/models/invoice-line-item-response.js +2 -0
  147. package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
  148. package/esm/sdk/models/invoice-sync-settings.d.ts +2 -0
  149. package/esm/sdk/models/invoice-sync-settings.d.ts.map +1 -1
  150. package/esm/sdk/models/invoice-sync-settings.js +3 -0
  151. package/esm/sdk/models/invoice-sync-settings.js.map +1 -1
  152. package/esm/sdk/models/list-commitments-response.d.ts +13 -0
  153. package/esm/sdk/models/list-commitments-response.d.ts.map +1 -0
  154. package/esm/sdk/models/list-commitments-response.js +17 -0
  155. package/esm/sdk/models/list-commitments-response.js.map +1 -0
  156. package/esm/sdk/models/price-price-tier.d.ts +2 -0
  157. package/esm/sdk/models/price-price-tier.d.ts.map +1 -1
  158. package/esm/sdk/models/price-price-tier.js +3 -0
  159. package/esm/sdk/models/price-price-tier.js.map +1 -1
  160. package/esm/sdk/models/price-transform-quantity.d.ts +5 -0
  161. package/esm/sdk/models/price-transform-quantity.d.ts.map +1 -1
  162. package/esm/sdk/models/price-transform-quantity.js +15 -1
  163. package/esm/sdk/models/price-transform-quantity.js.map +1 -1
  164. package/esm/sdk/models/report-query-request.d.ts +2 -0
  165. package/esm/sdk/models/report-query-request.d.ts.map +1 -1
  166. package/esm/sdk/models/report-query-request.js +1 -0
  167. package/esm/sdk/models/report-query-request.js.map +1 -1
  168. package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
  169. package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
  170. package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
  171. package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
  172. package/esm/sdk/models/self-billing-charge-response.d.ts +45 -0
  173. package/esm/sdk/models/self-billing-charge-response.d.ts.map +1 -0
  174. package/esm/sdk/models/self-billing-charge-response.js +63 -0
  175. package/esm/sdk/models/self-billing-charge-response.js.map +1 -0
  176. package/esm/sdk/models/self-billing-plan-response.d.ts +14 -0
  177. package/esm/sdk/models/self-billing-plan-response.d.ts.map +1 -0
  178. package/esm/sdk/models/self-billing-plan-response.js +18 -0
  179. package/esm/sdk/models/self-billing-plan-response.js.map +1 -0
  180. package/esm/sdk/models/self-billing-summary-response.d.ts +2 -0
  181. package/esm/sdk/models/self-billing-summary-response.d.ts.map +1 -1
  182. package/esm/sdk/models/self-billing-summary-response.js +2 -0
  183. package/esm/sdk/models/self-billing-summary-response.js.map +1 -1
  184. package/esm/sdk/models/subscription-line-item-response.d.ts +5 -0
  185. package/esm/sdk/models/subscription-line-item-response.d.ts.map +1 -1
  186. package/esm/sdk/models/subscription-line-item-response.js +4 -0
  187. package/esm/sdk/models/subscription-line-item-response.js.map +1 -1
  188. package/esm/sdk/models/subscription-subscription-line-item.d.ts +5 -0
  189. package/esm/sdk/models/subscription-subscription-line-item.d.ts.map +1 -1
  190. package/esm/sdk/models/subscription-subscription-line-item.js +4 -0
  191. package/esm/sdk/models/subscription-subscription-line-item.js.map +1 -1
  192. package/esm/sdk/models/terminate-commitment-op.d.ts +21 -0
  193. package/esm/sdk/models/terminate-commitment-op.d.ts.map +1 -0
  194. package/esm/sdk/models/terminate-commitment-op.js +14 -0
  195. package/esm/sdk/models/terminate-commitment-op.js.map +1 -0
  196. package/esm/sdk/models/terminate-commitment-request.d.ts +14 -0
  197. package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -0
  198. package/esm/sdk/models/terminate-commitment-request.js +19 -0
  199. package/esm/sdk/models/terminate-commitment-request.js.map +1 -0
  200. package/esm/sdk/models/trigger-force-run-request.d.ts +5 -0
  201. package/esm/sdk/models/trigger-force-run-request.d.ts.map +1 -1
  202. package/esm/sdk/models/trigger-force-run-request.js +2 -0
  203. package/esm/sdk/models/trigger-force-run-request.js.map +1 -1
  204. package/esm/sdk/models/update-commitment-op.d.ts +21 -0
  205. package/esm/sdk/models/update-commitment-op.d.ts.map +1 -0
  206. package/esm/sdk/models/update-commitment-op.js +14 -0
  207. package/esm/sdk/models/update-commitment-op.js.map +1 -0
  208. package/esm/sdk/models/update-commitment-request.d.ts +22 -0
  209. package/esm/sdk/models/update-commitment-request.d.ts.map +1 -0
  210. package/esm/sdk/models/update-commitment-request.js +21 -0
  211. package/esm/sdk/models/update-commitment-request.js.map +1 -0
  212. package/esm/sdk/models/update-entitlement-request.d.ts +3 -0
  213. package/esm/sdk/models/update-entitlement-request.d.ts.map +1 -1
  214. package/esm/sdk/models/update-entitlement-request.js.map +1 -1
  215. package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts +13 -0
  216. package/esm/sdk/models/webhook-dto-commitment-webhook-payload.d.ts.map +1 -0
  217. package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js +22 -0
  218. package/esm/sdk/models/webhook-dto-commitment-webhook-payload.js.map +1 -0
  219. package/esm/sdk/models/webhook-event-name.d.ts +3 -0
  220. package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
  221. package/esm/sdk/models/webhook-event-name.js +3 -0
  222. package/esm/sdk/models/webhook-event-name.js.map +1 -1
  223. package/esm/sdk/models/zoho-pay-pal-payment-method.d.ts +10 -0
  224. package/esm/sdk/models/zoho-pay-pal-payment-method.d.ts.map +1 -0
  225. package/esm/sdk/models/zoho-pay-pal-payment-method.js +11 -0
  226. package/esm/sdk/models/zoho-pay-pal-payment-method.js.map +1 -0
  227. package/esm/sdk/models/zoho-payment-gateway-settings.d.ts +14 -0
  228. package/esm/sdk/models/zoho-payment-gateway-settings.d.ts.map +1 -0
  229. package/esm/sdk/models/zoho-payment-gateway-settings.js +23 -0
  230. package/esm/sdk/models/zoho-payment-gateway-settings.js.map +1 -0
  231. package/esm/sdk/models/zoho-payment-gateway.d.ts +15 -0
  232. package/esm/sdk/models/zoho-payment-gateway.d.ts.map +1 -0
  233. package/esm/sdk/models/zoho-payment-gateway.js +16 -0
  234. package/esm/sdk/models/zoho-payment-gateway.js.map +1 -0
  235. package/esm/sdk/sdk.d.ts +3 -0
  236. package/esm/sdk/sdk.d.ts.map +1 -1
  237. package/esm/sdk/sdk.js +5 -0
  238. package/esm/sdk/sdk.js.map +1 -1
  239. package/esm/sdk/self-billing.d.ts +1 -1
  240. package/esm/sdk/self-billing.js +1 -1
  241. package/esm/sdk/webhook-events.d.ts +21 -0
  242. package/esm/sdk/webhook-events.d.ts.map +1 -1
  243. package/esm/sdk/webhook-events.js +30 -0
  244. package/esm/sdk/webhook-events.js.map +1 -1
  245. package/jsr.json +1 -1
  246. package/package.json +1 -1
  247. package/src/funcs/commitments-create-commitment.ts +172 -0
  248. package/src/funcs/commitments-get-commitment.ts +181 -0
  249. package/src/funcs/commitments-preview-commitment.ts +172 -0
  250. package/src/funcs/commitments-query-commitment.ts +172 -0
  251. package/src/funcs/commitments-terminate-commitment.ts +187 -0
  252. package/src/funcs/commitments-update-commitment.ts +187 -0
  253. package/src/funcs/events-delete-events.ts +175 -0
  254. package/src/funcs/self-billing-get-self-billing-summary.ts +1 -1
  255. package/src/funcs/webhook-events-post-webhook-events-commitment-created.ts +144 -0
  256. package/src/funcs/webhook-events-post-webhook-events-commitment-terminated.ts +144 -0
  257. package/src/funcs/webhook-events-post-webhook-events-commitment-updated.ts +144 -0
  258. package/src/lib/config.ts +2 -2
  259. package/src/sdk/commitments.ts +121 -0
  260. package/src/sdk/events.ts +18 -0
  261. package/src/sdk/models/active-window.ts +54 -0
  262. package/src/sdk/models/commitment-collection-method.ts +26 -0
  263. package/src/sdk/models/commitment-early-termination.ts +22 -0
  264. package/src/sdk/models/commitment-filter.ts +127 -0
  265. package/src/sdk/models/commitment-measurement.ts +24 -0
  266. package/src/sdk/models/commitment-price-input.ts +64 -0
  267. package/src/sdk/models/commitment-response.ts +164 -0
  268. package/src/sdk/models/commitment-scope-input.ts +49 -0
  269. package/src/sdk/models/commitment-scope-type.ts +26 -0
  270. package/src/sdk/models/commitment-status.ts +25 -0
  271. package/src/sdk/models/commitment-usage-breakdown.ts +86 -0
  272. package/src/sdk/models/commitment-usage-value.ts +33 -0
  273. package/src/sdk/models/create-commitment-request.ts +134 -0
  274. package/src/sdk/models/create-entitlement-request.ts +3 -0
  275. package/src/sdk/models/create-price-tier.ts +9 -0
  276. package/src/sdk/models/create-subscription-request.ts +14 -0
  277. package/src/sdk/models/delete-events-op.ts +45 -0
  278. package/src/sdk/models/delete-events-request.ts +74 -0
  279. package/src/sdk/models/delete-events-response.ts +42 -0
  280. package/src/sdk/models/get-commitment-op.ts +33 -0
  281. package/src/sdk/models/get-usage-by-subscription-response.ts +11 -0
  282. package/src/sdk/models/index.ts +28 -0
  283. package/src/sdk/models/invoice-filter.ts +14 -0
  284. package/src/sdk/models/invoice-line-item-response.ts +6 -0
  285. package/src/sdk/models/invoice-sync-settings.ts +7 -0
  286. package/src/sdk/models/list-commitments-response.ts +41 -0
  287. package/src/sdk/models/price-price-tier.ts +7 -0
  288. package/src/sdk/models/price-transform-quantity.ts +33 -1
  289. package/src/sdk/models/report-query-request.ts +3 -0
  290. package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
  291. package/src/sdk/models/self-billing-charge-response.ts +124 -0
  292. package/src/sdk/models/self-billing-plan-response.ts +41 -0
  293. package/src/sdk/models/self-billing-summary-response.ts +6 -0
  294. package/src/sdk/models/subscription-line-item-response.ts +9 -0
  295. package/src/sdk/models/subscription-subscription-line-item.ts +9 -0
  296. package/src/sdk/models/terminate-commitment-op.ts +46 -0
  297. package/src/sdk/models/terminate-commitment-request.ts +44 -0
  298. package/src/sdk/models/trigger-force-run-request.ts +7 -0
  299. package/src/sdk/models/update-commitment-op.ts +46 -0
  300. package/src/sdk/models/update-commitment-request.ts +48 -0
  301. package/src/sdk/models/update-entitlement-request.ts +3 -0
  302. package/src/sdk/models/webhook-dto-commitment-webhook-payload.ts +50 -0
  303. package/src/sdk/models/webhook-event-name.ts +3 -0
  304. package/src/sdk/models/zoho-pay-pal-payment-method.ts +19 -0
  305. package/src/sdk/models/zoho-payment-gateway-settings.ts +53 -0
  306. package/src/sdk/models/zoho-payment-gateway.ts +24 -0
  307. package/src/sdk/sdk.ts +6 -0
  308. package/src/sdk/self-billing.ts +1 -1
  309. package/src/sdk/webhook-events.ts +48 -0
@@ -0,0 +1,175 @@
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 } 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
+ * Delete events
31
+ *
32
+ * @remarks
33
+ * Hard-deletes ingested events and the meter usage they produced for the named customers and period, optionally narrowed by feature or by exact event id. Refused when anything in scope has already been invoiced. Irreversible.
34
+ */
35
+ export function eventsDeleteEvents(
36
+ client: TirdadCore,
37
+ request: models.DeleteEventsRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.DeleteEventsResponseResponse,
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
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: TirdadCore,
62
+ request: models.DeleteEventsRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ models.DeleteEventsResponseResponse,
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 parsed = safeParse(
82
+ request,
83
+ (value) => z.parse(models.DeleteEventsRequest$outboundSchema, value),
84
+ "Input validation failed",
85
+ );
86
+ if (!parsed.ok) {
87
+ return [parsed, { status: "invalid" }];
88
+ }
89
+ const payload = parsed.value;
90
+ const body = encodeJSON("body", payload, { explode: true });
91
+
92
+ const path = pathToFunc("/events/delete")();
93
+
94
+ const headers = new Headers(compactMap({
95
+ "Content-Type": "application/json",
96
+ Accept: "application/json",
97
+ }));
98
+
99
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
100
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
101
+ const requestSecurity = resolveGlobalSecurity(securityInput);
102
+
103
+ const context = {
104
+ options: client._options,
105
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
106
+ operationID: "deleteEvents",
107
+ oAuth2Scopes: null,
108
+
109
+ resolvedSecurity: requestSecurity,
110
+
111
+ securitySource: client._options.apiKeyAuth,
112
+ retryConfig: options?.retries
113
+ || client._options.retryConfig
114
+ || { strategy: "none" },
115
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
116
+ };
117
+
118
+ const requestRes = client._createRequest(context, {
119
+ security: requestSecurity,
120
+ method: "POST",
121
+ baseURL: options?.serverURL,
122
+ path: path,
123
+ headers: headers,
124
+ body: body,
125
+ userAgent: client._options.userAgent,
126
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
127
+ }, options);
128
+ if (!requestRes.ok) {
129
+ return [requestRes, { status: "invalid" }];
130
+ }
131
+ const req = requestRes.value;
132
+
133
+ const doResult = await client._do(req, {
134
+ context,
135
+ isErrorStatusCode: (statusCode: number) =>
136
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
137
+ retryConfig: context.retryConfig,
138
+ retryCodes: context.retryCodes,
139
+ });
140
+ if (!doResult.ok) {
141
+ return [doResult, { status: "request-error", request: req }];
142
+ }
143
+ const response = doResult.value;
144
+
145
+ const responseFields = {
146
+ HttpMeta: { Response: response, Request: req },
147
+ };
148
+
149
+ const [result] = await M.match<
150
+ models.DeleteEventsResponseResponse,
151
+ | models.ErrorsErrorResponse
152
+ | TirdadError
153
+ | ResponseValidationError
154
+ | ConnectionError
155
+ | RequestAbortedError
156
+ | RequestTimeoutError
157
+ | InvalidRequestError
158
+ | UnexpectedClientError
159
+ | SDKValidationError
160
+ >(
161
+ M.json(200, models.DeleteEventsResponseResponse$inboundSchema, {
162
+ hdrs: true,
163
+ key: "Result",
164
+ }),
165
+ M.jsonErr([400, 403, 409], models.ErrorsErrorResponse$inboundSchema),
166
+ M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
167
+ M.fail("4XX"),
168
+ M.fail("5XX"),
169
+ )(response, req, { extraFields: responseFields });
170
+ if (!result.ok) {
171
+ return [result, { status: "complete", request: req, response }];
172
+ }
173
+
174
+ return [result, { status: "complete", request: req, response }];
175
+ }
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
27
27
  * Get self-billing summary
28
28
  *
29
29
  * @remarks
30
- * Returns the caller tenant's billing status, subscription, recent invoices and usage.
30
+ * Returns billing status, recent invoices, usage and a plan with charges. Charges use expanded subscription line-item prices, including overrides; without a current subscription they use the configured self-serve plan. Pricing terms are not an invoice total.
31
31
  */
32
32
  export function selfBillingGetSelfBillingSummary(
33
33
  client: TirdadCore,
@@ -0,0 +1,144 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { TirdadCore } from "../core.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/http-client-errors.js";
19
+ import * as models from "../sdk/models/index.js";
20
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
21
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
22
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * commitment.created
28
+ *
29
+ * @remarks
30
+ * Fired when a commitment is created on a subscription. Doc-only for parsing.
31
+ */
32
+ export function webhookEventsPostWebhookEventsCommitmentCreated(
33
+ client: TirdadCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ models.WebhookDtoCommitmentWebhookPayload,
38
+ | TirdadError
39
+ | ResponseValidationError
40
+ | ConnectionError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | InvalidRequestError
44
+ | UnexpectedClientError
45
+ | SDKValidationError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: TirdadCore,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ models.WebhookDtoCommitmentWebhookPayload,
61
+ | TirdadError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/webhook-events/commitment.created")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
80
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "post_/webhook-events/commitment.created",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.apiKeyAuth,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || { strategy: "none" },
95
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
+ };
97
+
98
+ const requestRes = client._createRequest(context, {
99
+ security: requestSecurity,
100
+ method: "POST",
101
+ baseURL: options?.serverURL,
102
+ path: path,
103
+ headers: headers,
104
+ userAgent: client._options.userAgent,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return [requestRes, { status: "invalid" }];
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ isErrorStatusCode: (statusCode: number) =>
115
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
116
+ retryConfig: context.retryConfig,
117
+ retryCodes: context.retryCodes,
118
+ });
119
+ if (!doResult.ok) {
120
+ return [doResult, { status: "request-error", request: req }];
121
+ }
122
+ const response = doResult.value;
123
+
124
+ const [result] = await M.match<
125
+ models.WebhookDtoCommitmentWebhookPayload,
126
+ | TirdadError
127
+ | ResponseValidationError
128
+ | ConnectionError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | InvalidRequestError
132
+ | UnexpectedClientError
133
+ | SDKValidationError
134
+ >(
135
+ M.json(200, models.WebhookDtoCommitmentWebhookPayload$inboundSchema),
136
+ M.fail("4XX"),
137
+ M.fail("5XX"),
138
+ )(response, req);
139
+ if (!result.ok) {
140
+ return [result, { status: "complete", request: req, response }];
141
+ }
142
+
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
@@ -0,0 +1,144 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { TirdadCore } from "../core.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/http-client-errors.js";
19
+ import * as models from "../sdk/models/index.js";
20
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
21
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
22
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * commitment.terminated
28
+ *
29
+ * @remarks
30
+ * Fired when a commitment is terminated. Doc-only for parsing.
31
+ */
32
+ export function webhookEventsPostWebhookEventsCommitmentTerminated(
33
+ client: TirdadCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ models.WebhookDtoCommitmentWebhookPayload,
38
+ | TirdadError
39
+ | ResponseValidationError
40
+ | ConnectionError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | InvalidRequestError
44
+ | UnexpectedClientError
45
+ | SDKValidationError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: TirdadCore,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ models.WebhookDtoCommitmentWebhookPayload,
61
+ | TirdadError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/webhook-events/commitment.terminated")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
80
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "post_/webhook-events/commitment.terminated",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.apiKeyAuth,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || { strategy: "none" },
95
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
+ };
97
+
98
+ const requestRes = client._createRequest(context, {
99
+ security: requestSecurity,
100
+ method: "POST",
101
+ baseURL: options?.serverURL,
102
+ path: path,
103
+ headers: headers,
104
+ userAgent: client._options.userAgent,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return [requestRes, { status: "invalid" }];
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ isErrorStatusCode: (statusCode: number) =>
115
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
116
+ retryConfig: context.retryConfig,
117
+ retryCodes: context.retryCodes,
118
+ });
119
+ if (!doResult.ok) {
120
+ return [doResult, { status: "request-error", request: req }];
121
+ }
122
+ const response = doResult.value;
123
+
124
+ const [result] = await M.match<
125
+ models.WebhookDtoCommitmentWebhookPayload,
126
+ | TirdadError
127
+ | ResponseValidationError
128
+ | ConnectionError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | InvalidRequestError
132
+ | UnexpectedClientError
133
+ | SDKValidationError
134
+ >(
135
+ M.json(200, models.WebhookDtoCommitmentWebhookPayload$inboundSchema),
136
+ M.fail("4XX"),
137
+ M.fail("5XX"),
138
+ )(response, req);
139
+ if (!result.ok) {
140
+ return [result, { status: "complete", request: req, response }];
141
+ }
142
+
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
@@ -0,0 +1,144 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { TirdadCore } from "../core.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import {
13
+ ConnectionError,
14
+ InvalidRequestError,
15
+ RequestAbortedError,
16
+ RequestTimeoutError,
17
+ UnexpectedClientError,
18
+ } from "../sdk/models/http-client-errors.js";
19
+ import * as models from "../sdk/models/index.js";
20
+ import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
21
+ import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
22
+ import { TirdadError } from "../sdk/models/tirdad-error.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * commitment.updated
28
+ *
29
+ * @remarks
30
+ * Fired when a commitment's descriptive fields are updated. Doc-only for parsing.
31
+ */
32
+ export function webhookEventsPostWebhookEventsCommitmentUpdated(
33
+ client: TirdadCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ models.WebhookDtoCommitmentWebhookPayload,
38
+ | TirdadError
39
+ | ResponseValidationError
40
+ | ConnectionError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | InvalidRequestError
44
+ | UnexpectedClientError
45
+ | SDKValidationError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: TirdadCore,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ models.WebhookDtoCommitmentWebhookPayload,
61
+ | TirdadError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/webhook-events/commitment.updated")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
80
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "post_/webhook-events/commitment.updated",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.apiKeyAuth,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || { strategy: "none" },
95
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
+ };
97
+
98
+ const requestRes = client._createRequest(context, {
99
+ security: requestSecurity,
100
+ method: "POST",
101
+ baseURL: options?.serverURL,
102
+ path: path,
103
+ headers: headers,
104
+ userAgent: client._options.userAgent,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return [requestRes, { status: "invalid" }];
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ isErrorStatusCode: (statusCode: number) =>
115
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
116
+ retryConfig: context.retryConfig,
117
+ retryCodes: context.retryCodes,
118
+ });
119
+ if (!doResult.ok) {
120
+ return [doResult, { status: "request-error", request: req }];
121
+ }
122
+ const response = doResult.value;
123
+
124
+ const [result] = await M.match<
125
+ models.WebhookDtoCommitmentWebhookPayload,
126
+ | TirdadError
127
+ | ResponseValidationError
128
+ | ConnectionError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | InvalidRequestError
132
+ | UnexpectedClientError
133
+ | SDKValidationError
134
+ >(
135
+ M.json(200, models.WebhookDtoCommitmentWebhookPayload$inboundSchema),
136
+ M.fail("4XX"),
137
+ M.fail("5XX"),
138
+ )(response, req);
139
+ if (!result.ok) {
140
+ return [result, { status: "complete", request: req, response }];
141
+ }
142
+
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
package/src/lib/config.ts CHANGED
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
69
  export const SDK_METADATA = {
70
70
  language: "typescript",
71
71
  openapiDocVersion: "1.0",
72
- sdkVersion: "2.1.43",
72
+ sdkVersion: "2.1.44",
73
73
  genVersion: "2.948.4",
74
- userAgent: "speakeasy-sdk/typescript 2.1.43 2.948.4 1.0 @tirdad/sdk",
74
+ userAgent: "speakeasy-sdk/typescript 2.1.44 2.948.4 1.0 @tirdad/sdk",
75
75
  } as const;