dodopayments-mcp 2.4.4 → 2.4.6

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 (418) hide show
  1. package/code-tool.js +1 -1
  2. package/code-tool.mjs +1 -1
  3. package/filtering.d.mts +1 -0
  4. package/filtering.d.mts.map +1 -1
  5. package/filtering.d.ts +1 -0
  6. package/filtering.d.ts.map +1 -1
  7. package/filtering.js +4 -0
  8. package/filtering.js.map +1 -1
  9. package/filtering.mjs +3 -0
  10. package/filtering.mjs.map +1 -1
  11. package/headers.d.mts.map +1 -1
  12. package/headers.d.ts.map +1 -1
  13. package/headers.js +1 -1
  14. package/headers.js.map +1 -1
  15. package/headers.mjs +1 -1
  16. package/headers.mjs.map +1 -1
  17. package/http.js +2 -2
  18. package/http.js.map +1 -1
  19. package/http.mjs +2 -2
  20. package/http.mjs.map +1 -1
  21. package/package.json +3 -3
  22. package/server.js +1 -1
  23. package/server.mjs +1 -1
  24. package/src/code-tool.ts +1 -1
  25. package/src/filtering.ts +4 -0
  26. package/src/headers.ts +3 -1
  27. package/src/http.ts +2 -2
  28. package/src/server.ts +1 -1
  29. package/src/tools/addons/create-addons.ts +10 -3
  30. package/src/tools/addons/list-addons.ts +10 -3
  31. package/src/tools/addons/retrieve-addons.ts +10 -3
  32. package/src/tools/addons/update-addons.ts +10 -3
  33. package/src/tools/addons/update-images-addons.ts +10 -3
  34. package/src/tools/brands/create-brands.ts +10 -3
  35. package/src/tools/brands/list-brands.ts +10 -3
  36. package/src/tools/brands/retrieve-brands.ts +10 -3
  37. package/src/tools/brands/update-brands.ts +10 -3
  38. package/src/tools/brands/update-images-brands.ts +10 -3
  39. package/src/tools/checkout-sessions/retrieve-checkout-sessions.ts +10 -3
  40. package/src/tools/customers/create-customers.ts +10 -3
  41. package/src/tools/customers/customer-portal/create-customers-customer-portal.ts +12 -5
  42. package/src/tools/customers/list-customers.ts +10 -3
  43. package/src/tools/customers/retrieve-customers.ts +10 -3
  44. package/src/tools/customers/update-customers.ts +12 -3
  45. package/src/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.ts +12 -5
  46. package/src/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.ts +10 -3
  47. package/src/tools/customers/wallets/list-customers-wallets.ts +12 -3
  48. package/src/tools/discounts/create-discounts.ts +10 -3
  49. package/src/tools/discounts/list-discounts.ts +10 -3
  50. package/src/tools/discounts/retrieve-discounts.ts +10 -3
  51. package/src/tools/discounts/update-discounts.ts +12 -3
  52. package/src/tools/disputes/list-disputes.ts +10 -3
  53. package/src/tools/disputes/retrieve-disputes.ts +10 -3
  54. package/src/tools/invoices/payments/retrieve-invoices-payments.ts +1 -1
  55. package/src/tools/invoices/payments/retrieve-refund-invoices-payments.ts +1 -1
  56. package/src/tools/license-key-instances/list-license-key-instances.ts +10 -3
  57. package/src/tools/license-key-instances/retrieve-license-key-instances.ts +10 -3
  58. package/src/tools/license-key-instances/update-license-key-instances.ts +12 -3
  59. package/src/tools/license-keys/list-license-keys.ts +10 -3
  60. package/src/tools/license-keys/retrieve-license-keys.ts +10 -3
  61. package/src/tools/license-keys/update-license-keys.ts +10 -3
  62. package/src/tools/licenses/activate-licenses.ts +10 -3
  63. package/src/tools/licenses/validate-licenses.ts +10 -3
  64. package/src/tools/misc/list-supported-countries-misc.ts +10 -3
  65. package/src/tools/payments/list-payments.ts +10 -3
  66. package/src/tools/payments/retrieve-line-items-payments.ts +12 -5
  67. package/src/tools/payouts/list-payouts.ts +10 -3
  68. package/src/tools/products/images/update-products-images.ts +10 -3
  69. package/src/tools/products/update-files-products.ts +10 -3
  70. package/src/tools/refunds/create-refunds.ts +10 -3
  71. package/src/tools/refunds/list-refunds.ts +10 -3
  72. package/src/tools/refunds/retrieve-refunds.ts +10 -3
  73. package/src/tools/subscriptions/charge-subscriptions.ts +12 -5
  74. package/src/tools/subscriptions/retrieve-usage-history-subscriptions.ts +10 -3
  75. package/src/tools/types.ts +12 -0
  76. package/src/tools/usage-events/ingest-usage-events.ts +10 -3
  77. package/src/tools/usage-events/list-usage-events.ts +10 -3
  78. package/src/tools/usage-events/retrieve-usage-events.ts +10 -3
  79. package/src/tools/webhooks/create-webhooks.ts +10 -3
  80. package/src/tools/webhooks/headers/retrieve-webhooks-headers.ts +12 -5
  81. package/src/tools/webhooks/list-webhooks.ts +10 -3
  82. package/src/tools/webhooks/retrieve-secret-webhooks.ts +12 -3
  83. package/src/tools/webhooks/retrieve-webhooks.ts +10 -3
  84. package/src/tools/webhooks/update-webhooks.ts +10 -3
  85. package/tools/addons/create-addons.d.mts.map +1 -1
  86. package/tools/addons/create-addons.d.ts.map +1 -1
  87. package/tools/addons/create-addons.js +9 -1
  88. package/tools/addons/create-addons.js.map +1 -1
  89. package/tools/addons/create-addons.mjs +11 -3
  90. package/tools/addons/create-addons.mjs.map +1 -1
  91. package/tools/addons/list-addons.d.mts.map +1 -1
  92. package/tools/addons/list-addons.d.ts.map +1 -1
  93. package/tools/addons/list-addons.js +9 -1
  94. package/tools/addons/list-addons.js.map +1 -1
  95. package/tools/addons/list-addons.mjs +11 -3
  96. package/tools/addons/list-addons.mjs.map +1 -1
  97. package/tools/addons/retrieve-addons.d.mts.map +1 -1
  98. package/tools/addons/retrieve-addons.d.ts.map +1 -1
  99. package/tools/addons/retrieve-addons.js +9 -1
  100. package/tools/addons/retrieve-addons.js.map +1 -1
  101. package/tools/addons/retrieve-addons.mjs +11 -3
  102. package/tools/addons/retrieve-addons.mjs.map +1 -1
  103. package/tools/addons/update-addons.d.mts.map +1 -1
  104. package/tools/addons/update-addons.d.ts.map +1 -1
  105. package/tools/addons/update-addons.js +9 -1
  106. package/tools/addons/update-addons.js.map +1 -1
  107. package/tools/addons/update-addons.mjs +11 -3
  108. package/tools/addons/update-addons.mjs.map +1 -1
  109. package/tools/addons/update-images-addons.d.mts.map +1 -1
  110. package/tools/addons/update-images-addons.d.ts.map +1 -1
  111. package/tools/addons/update-images-addons.js +9 -1
  112. package/tools/addons/update-images-addons.js.map +1 -1
  113. package/tools/addons/update-images-addons.mjs +11 -3
  114. package/tools/addons/update-images-addons.mjs.map +1 -1
  115. package/tools/brands/create-brands.d.mts.map +1 -1
  116. package/tools/brands/create-brands.d.ts.map +1 -1
  117. package/tools/brands/create-brands.js +9 -1
  118. package/tools/brands/create-brands.js.map +1 -1
  119. package/tools/brands/create-brands.mjs +11 -3
  120. package/tools/brands/create-brands.mjs.map +1 -1
  121. package/tools/brands/list-brands.d.mts.map +1 -1
  122. package/tools/brands/list-brands.d.ts.map +1 -1
  123. package/tools/brands/list-brands.js +9 -1
  124. package/tools/brands/list-brands.js.map +1 -1
  125. package/tools/brands/list-brands.mjs +11 -3
  126. package/tools/brands/list-brands.mjs.map +1 -1
  127. package/tools/brands/retrieve-brands.d.mts.map +1 -1
  128. package/tools/brands/retrieve-brands.d.ts.map +1 -1
  129. package/tools/brands/retrieve-brands.js +9 -1
  130. package/tools/brands/retrieve-brands.js.map +1 -1
  131. package/tools/brands/retrieve-brands.mjs +11 -3
  132. package/tools/brands/retrieve-brands.mjs.map +1 -1
  133. package/tools/brands/update-brands.d.mts.map +1 -1
  134. package/tools/brands/update-brands.d.ts.map +1 -1
  135. package/tools/brands/update-brands.js +9 -1
  136. package/tools/brands/update-brands.js.map +1 -1
  137. package/tools/brands/update-brands.mjs +11 -3
  138. package/tools/brands/update-brands.mjs.map +1 -1
  139. package/tools/brands/update-images-brands.d.mts.map +1 -1
  140. package/tools/brands/update-images-brands.d.ts.map +1 -1
  141. package/tools/brands/update-images-brands.js +9 -1
  142. package/tools/brands/update-images-brands.js.map +1 -1
  143. package/tools/brands/update-images-brands.mjs +11 -3
  144. package/tools/brands/update-images-brands.mjs.map +1 -1
  145. package/tools/checkout-sessions/retrieve-checkout-sessions.d.mts.map +1 -1
  146. package/tools/checkout-sessions/retrieve-checkout-sessions.d.ts.map +1 -1
  147. package/tools/checkout-sessions/retrieve-checkout-sessions.js +9 -1
  148. package/tools/checkout-sessions/retrieve-checkout-sessions.js.map +1 -1
  149. package/tools/checkout-sessions/retrieve-checkout-sessions.mjs +11 -3
  150. package/tools/checkout-sessions/retrieve-checkout-sessions.mjs.map +1 -1
  151. package/tools/customers/create-customers.d.mts.map +1 -1
  152. package/tools/customers/create-customers.d.ts.map +1 -1
  153. package/tools/customers/create-customers.js +9 -1
  154. package/tools/customers/create-customers.js.map +1 -1
  155. package/tools/customers/create-customers.mjs +11 -3
  156. package/tools/customers/create-customers.mjs.map +1 -1
  157. package/tools/customers/customer-portal/create-customers-customer-portal.d.mts.map +1 -1
  158. package/tools/customers/customer-portal/create-customers-customer-portal.d.ts.map +1 -1
  159. package/tools/customers/customer-portal/create-customers-customer-portal.js +9 -1
  160. package/tools/customers/customer-portal/create-customers-customer-portal.js.map +1 -1
  161. package/tools/customers/customer-portal/create-customers-customer-portal.mjs +11 -3
  162. package/tools/customers/customer-portal/create-customers-customer-portal.mjs.map +1 -1
  163. package/tools/customers/list-customers.d.mts.map +1 -1
  164. package/tools/customers/list-customers.d.ts.map +1 -1
  165. package/tools/customers/list-customers.js +9 -1
  166. package/tools/customers/list-customers.js.map +1 -1
  167. package/tools/customers/list-customers.mjs +11 -3
  168. package/tools/customers/list-customers.mjs.map +1 -1
  169. package/tools/customers/retrieve-customers.d.mts.map +1 -1
  170. package/tools/customers/retrieve-customers.d.ts.map +1 -1
  171. package/tools/customers/retrieve-customers.js +9 -1
  172. package/tools/customers/retrieve-customers.js.map +1 -1
  173. package/tools/customers/retrieve-customers.mjs +11 -3
  174. package/tools/customers/retrieve-customers.mjs.map +1 -1
  175. package/tools/customers/update-customers.d.mts.map +1 -1
  176. package/tools/customers/update-customers.d.ts.map +1 -1
  177. package/tools/customers/update-customers.js +9 -1
  178. package/tools/customers/update-customers.js.map +1 -1
  179. package/tools/customers/update-customers.mjs +11 -3
  180. package/tools/customers/update-customers.mjs.map +1 -1
  181. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.d.mts.map +1 -1
  182. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.d.ts.map +1 -1
  183. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.js +9 -1
  184. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.js.map +1 -1
  185. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.mjs +11 -3
  186. package/tools/customers/wallets/ledger-entries/create-wallets-customers-ledger-entries.mjs.map +1 -1
  187. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.d.mts.map +1 -1
  188. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.d.ts.map +1 -1
  189. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.js +9 -1
  190. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.js.map +1 -1
  191. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.mjs +11 -3
  192. package/tools/customers/wallets/ledger-entries/list-wallets-customers-ledger-entries.mjs.map +1 -1
  193. package/tools/customers/wallets/list-customers-wallets.d.mts.map +1 -1
  194. package/tools/customers/wallets/list-customers-wallets.d.ts.map +1 -1
  195. package/tools/customers/wallets/list-customers-wallets.js +9 -1
  196. package/tools/customers/wallets/list-customers-wallets.js.map +1 -1
  197. package/tools/customers/wallets/list-customers-wallets.mjs +11 -3
  198. package/tools/customers/wallets/list-customers-wallets.mjs.map +1 -1
  199. package/tools/discounts/create-discounts.d.mts.map +1 -1
  200. package/tools/discounts/create-discounts.d.ts.map +1 -1
  201. package/tools/discounts/create-discounts.js +9 -1
  202. package/tools/discounts/create-discounts.js.map +1 -1
  203. package/tools/discounts/create-discounts.mjs +11 -3
  204. package/tools/discounts/create-discounts.mjs.map +1 -1
  205. package/tools/discounts/list-discounts.d.mts.map +1 -1
  206. package/tools/discounts/list-discounts.d.ts.map +1 -1
  207. package/tools/discounts/list-discounts.js +9 -1
  208. package/tools/discounts/list-discounts.js.map +1 -1
  209. package/tools/discounts/list-discounts.mjs +11 -3
  210. package/tools/discounts/list-discounts.mjs.map +1 -1
  211. package/tools/discounts/retrieve-discounts.d.mts.map +1 -1
  212. package/tools/discounts/retrieve-discounts.d.ts.map +1 -1
  213. package/tools/discounts/retrieve-discounts.js +9 -1
  214. package/tools/discounts/retrieve-discounts.js.map +1 -1
  215. package/tools/discounts/retrieve-discounts.mjs +11 -3
  216. package/tools/discounts/retrieve-discounts.mjs.map +1 -1
  217. package/tools/discounts/update-discounts.d.mts.map +1 -1
  218. package/tools/discounts/update-discounts.d.ts.map +1 -1
  219. package/tools/discounts/update-discounts.js +9 -1
  220. package/tools/discounts/update-discounts.js.map +1 -1
  221. package/tools/discounts/update-discounts.mjs +11 -3
  222. package/tools/discounts/update-discounts.mjs.map +1 -1
  223. package/tools/disputes/list-disputes.d.mts.map +1 -1
  224. package/tools/disputes/list-disputes.d.ts.map +1 -1
  225. package/tools/disputes/list-disputes.js +9 -1
  226. package/tools/disputes/list-disputes.js.map +1 -1
  227. package/tools/disputes/list-disputes.mjs +11 -3
  228. package/tools/disputes/list-disputes.mjs.map +1 -1
  229. package/tools/disputes/retrieve-disputes.d.mts.map +1 -1
  230. package/tools/disputes/retrieve-disputes.d.ts.map +1 -1
  231. package/tools/disputes/retrieve-disputes.js +9 -1
  232. package/tools/disputes/retrieve-disputes.js.map +1 -1
  233. package/tools/disputes/retrieve-disputes.mjs +11 -3
  234. package/tools/disputes/retrieve-disputes.mjs.map +1 -1
  235. package/tools/invoices/payments/retrieve-invoices-payments.js +1 -1
  236. package/tools/invoices/payments/retrieve-invoices-payments.js.map +1 -1
  237. package/tools/invoices/payments/retrieve-invoices-payments.mjs +1 -1
  238. package/tools/invoices/payments/retrieve-invoices-payments.mjs.map +1 -1
  239. package/tools/invoices/payments/retrieve-refund-invoices-payments.js +1 -1
  240. package/tools/invoices/payments/retrieve-refund-invoices-payments.js.map +1 -1
  241. package/tools/invoices/payments/retrieve-refund-invoices-payments.mjs +1 -1
  242. package/tools/invoices/payments/retrieve-refund-invoices-payments.mjs.map +1 -1
  243. package/tools/license-key-instances/list-license-key-instances.d.mts.map +1 -1
  244. package/tools/license-key-instances/list-license-key-instances.d.ts.map +1 -1
  245. package/tools/license-key-instances/list-license-key-instances.js +9 -1
  246. package/tools/license-key-instances/list-license-key-instances.js.map +1 -1
  247. package/tools/license-key-instances/list-license-key-instances.mjs +11 -3
  248. package/tools/license-key-instances/list-license-key-instances.mjs.map +1 -1
  249. package/tools/license-key-instances/retrieve-license-key-instances.d.mts.map +1 -1
  250. package/tools/license-key-instances/retrieve-license-key-instances.d.ts.map +1 -1
  251. package/tools/license-key-instances/retrieve-license-key-instances.js +9 -1
  252. package/tools/license-key-instances/retrieve-license-key-instances.js.map +1 -1
  253. package/tools/license-key-instances/retrieve-license-key-instances.mjs +11 -3
  254. package/tools/license-key-instances/retrieve-license-key-instances.mjs.map +1 -1
  255. package/tools/license-key-instances/update-license-key-instances.d.mts.map +1 -1
  256. package/tools/license-key-instances/update-license-key-instances.d.ts.map +1 -1
  257. package/tools/license-key-instances/update-license-key-instances.js +9 -1
  258. package/tools/license-key-instances/update-license-key-instances.js.map +1 -1
  259. package/tools/license-key-instances/update-license-key-instances.mjs +11 -3
  260. package/tools/license-key-instances/update-license-key-instances.mjs.map +1 -1
  261. package/tools/license-keys/list-license-keys.d.mts.map +1 -1
  262. package/tools/license-keys/list-license-keys.d.ts.map +1 -1
  263. package/tools/license-keys/list-license-keys.js +9 -1
  264. package/tools/license-keys/list-license-keys.js.map +1 -1
  265. package/tools/license-keys/list-license-keys.mjs +11 -3
  266. package/tools/license-keys/list-license-keys.mjs.map +1 -1
  267. package/tools/license-keys/retrieve-license-keys.d.mts.map +1 -1
  268. package/tools/license-keys/retrieve-license-keys.d.ts.map +1 -1
  269. package/tools/license-keys/retrieve-license-keys.js +9 -1
  270. package/tools/license-keys/retrieve-license-keys.js.map +1 -1
  271. package/tools/license-keys/retrieve-license-keys.mjs +11 -3
  272. package/tools/license-keys/retrieve-license-keys.mjs.map +1 -1
  273. package/tools/license-keys/update-license-keys.d.mts.map +1 -1
  274. package/tools/license-keys/update-license-keys.d.ts.map +1 -1
  275. package/tools/license-keys/update-license-keys.js +9 -1
  276. package/tools/license-keys/update-license-keys.js.map +1 -1
  277. package/tools/license-keys/update-license-keys.mjs +11 -3
  278. package/tools/license-keys/update-license-keys.mjs.map +1 -1
  279. package/tools/licenses/activate-licenses.d.mts.map +1 -1
  280. package/tools/licenses/activate-licenses.d.ts.map +1 -1
  281. package/tools/licenses/activate-licenses.js +9 -1
  282. package/tools/licenses/activate-licenses.js.map +1 -1
  283. package/tools/licenses/activate-licenses.mjs +11 -3
  284. package/tools/licenses/activate-licenses.mjs.map +1 -1
  285. package/tools/licenses/validate-licenses.d.mts.map +1 -1
  286. package/tools/licenses/validate-licenses.d.ts.map +1 -1
  287. package/tools/licenses/validate-licenses.js +9 -1
  288. package/tools/licenses/validate-licenses.js.map +1 -1
  289. package/tools/licenses/validate-licenses.mjs +11 -3
  290. package/tools/licenses/validate-licenses.mjs.map +1 -1
  291. package/tools/misc/list-supported-countries-misc.d.mts.map +1 -1
  292. package/tools/misc/list-supported-countries-misc.d.ts.map +1 -1
  293. package/tools/misc/list-supported-countries-misc.js +9 -1
  294. package/tools/misc/list-supported-countries-misc.js.map +1 -1
  295. package/tools/misc/list-supported-countries-misc.mjs +11 -3
  296. package/tools/misc/list-supported-countries-misc.mjs.map +1 -1
  297. package/tools/payments/list-payments.d.mts.map +1 -1
  298. package/tools/payments/list-payments.d.ts.map +1 -1
  299. package/tools/payments/list-payments.js +9 -1
  300. package/tools/payments/list-payments.js.map +1 -1
  301. package/tools/payments/list-payments.mjs +11 -3
  302. package/tools/payments/list-payments.mjs.map +1 -1
  303. package/tools/payments/retrieve-line-items-payments.d.mts.map +1 -1
  304. package/tools/payments/retrieve-line-items-payments.d.ts.map +1 -1
  305. package/tools/payments/retrieve-line-items-payments.js +9 -1
  306. package/tools/payments/retrieve-line-items-payments.js.map +1 -1
  307. package/tools/payments/retrieve-line-items-payments.mjs +11 -3
  308. package/tools/payments/retrieve-line-items-payments.mjs.map +1 -1
  309. package/tools/payouts/list-payouts.d.mts.map +1 -1
  310. package/tools/payouts/list-payouts.d.ts.map +1 -1
  311. package/tools/payouts/list-payouts.js +9 -1
  312. package/tools/payouts/list-payouts.js.map +1 -1
  313. package/tools/payouts/list-payouts.mjs +11 -3
  314. package/tools/payouts/list-payouts.mjs.map +1 -1
  315. package/tools/products/images/update-products-images.d.mts.map +1 -1
  316. package/tools/products/images/update-products-images.d.ts.map +1 -1
  317. package/tools/products/images/update-products-images.js +9 -1
  318. package/tools/products/images/update-products-images.js.map +1 -1
  319. package/tools/products/images/update-products-images.mjs +11 -3
  320. package/tools/products/images/update-products-images.mjs.map +1 -1
  321. package/tools/products/update-files-products.d.mts.map +1 -1
  322. package/tools/products/update-files-products.d.ts.map +1 -1
  323. package/tools/products/update-files-products.js +9 -1
  324. package/tools/products/update-files-products.js.map +1 -1
  325. package/tools/products/update-files-products.mjs +11 -3
  326. package/tools/products/update-files-products.mjs.map +1 -1
  327. package/tools/refunds/create-refunds.d.mts.map +1 -1
  328. package/tools/refunds/create-refunds.d.ts.map +1 -1
  329. package/tools/refunds/create-refunds.js +9 -1
  330. package/tools/refunds/create-refunds.js.map +1 -1
  331. package/tools/refunds/create-refunds.mjs +11 -3
  332. package/tools/refunds/create-refunds.mjs.map +1 -1
  333. package/tools/refunds/list-refunds.d.mts.map +1 -1
  334. package/tools/refunds/list-refunds.d.ts.map +1 -1
  335. package/tools/refunds/list-refunds.js +9 -1
  336. package/tools/refunds/list-refunds.js.map +1 -1
  337. package/tools/refunds/list-refunds.mjs +11 -3
  338. package/tools/refunds/list-refunds.mjs.map +1 -1
  339. package/tools/refunds/retrieve-refunds.d.mts.map +1 -1
  340. package/tools/refunds/retrieve-refunds.d.ts.map +1 -1
  341. package/tools/refunds/retrieve-refunds.js +9 -1
  342. package/tools/refunds/retrieve-refunds.js.map +1 -1
  343. package/tools/refunds/retrieve-refunds.mjs +11 -3
  344. package/tools/refunds/retrieve-refunds.mjs.map +1 -1
  345. package/tools/subscriptions/charge-subscriptions.d.mts.map +1 -1
  346. package/tools/subscriptions/charge-subscriptions.d.ts.map +1 -1
  347. package/tools/subscriptions/charge-subscriptions.js +9 -1
  348. package/tools/subscriptions/charge-subscriptions.js.map +1 -1
  349. package/tools/subscriptions/charge-subscriptions.mjs +11 -3
  350. package/tools/subscriptions/charge-subscriptions.mjs.map +1 -1
  351. package/tools/subscriptions/retrieve-usage-history-subscriptions.d.mts.map +1 -1
  352. package/tools/subscriptions/retrieve-usage-history-subscriptions.d.ts.map +1 -1
  353. package/tools/subscriptions/retrieve-usage-history-subscriptions.js +9 -1
  354. package/tools/subscriptions/retrieve-usage-history-subscriptions.js.map +1 -1
  355. package/tools/subscriptions/retrieve-usage-history-subscriptions.mjs +11 -3
  356. package/tools/subscriptions/retrieve-usage-history-subscriptions.mjs.map +1 -1
  357. package/tools/types.d.mts +1 -0
  358. package/tools/types.d.mts.map +1 -1
  359. package/tools/types.d.ts +1 -0
  360. package/tools/types.d.ts.map +1 -1
  361. package/tools/types.js +12 -0
  362. package/tools/types.js.map +1 -1
  363. package/tools/types.mjs +11 -0
  364. package/tools/types.mjs.map +1 -1
  365. package/tools/usage-events/ingest-usage-events.d.mts.map +1 -1
  366. package/tools/usage-events/ingest-usage-events.d.ts.map +1 -1
  367. package/tools/usage-events/ingest-usage-events.js +9 -1
  368. package/tools/usage-events/ingest-usage-events.js.map +1 -1
  369. package/tools/usage-events/ingest-usage-events.mjs +11 -3
  370. package/tools/usage-events/ingest-usage-events.mjs.map +1 -1
  371. package/tools/usage-events/list-usage-events.d.mts.map +1 -1
  372. package/tools/usage-events/list-usage-events.d.ts.map +1 -1
  373. package/tools/usage-events/list-usage-events.js +9 -1
  374. package/tools/usage-events/list-usage-events.js.map +1 -1
  375. package/tools/usage-events/list-usage-events.mjs +11 -3
  376. package/tools/usage-events/list-usage-events.mjs.map +1 -1
  377. package/tools/usage-events/retrieve-usage-events.d.mts.map +1 -1
  378. package/tools/usage-events/retrieve-usage-events.d.ts.map +1 -1
  379. package/tools/usage-events/retrieve-usage-events.js +9 -1
  380. package/tools/usage-events/retrieve-usage-events.js.map +1 -1
  381. package/tools/usage-events/retrieve-usage-events.mjs +11 -3
  382. package/tools/usage-events/retrieve-usage-events.mjs.map +1 -1
  383. package/tools/webhooks/create-webhooks.d.mts.map +1 -1
  384. package/tools/webhooks/create-webhooks.d.ts.map +1 -1
  385. package/tools/webhooks/create-webhooks.js +9 -1
  386. package/tools/webhooks/create-webhooks.js.map +1 -1
  387. package/tools/webhooks/create-webhooks.mjs +11 -3
  388. package/tools/webhooks/create-webhooks.mjs.map +1 -1
  389. package/tools/webhooks/headers/retrieve-webhooks-headers.d.mts.map +1 -1
  390. package/tools/webhooks/headers/retrieve-webhooks-headers.d.ts.map +1 -1
  391. package/tools/webhooks/headers/retrieve-webhooks-headers.js +9 -1
  392. package/tools/webhooks/headers/retrieve-webhooks-headers.js.map +1 -1
  393. package/tools/webhooks/headers/retrieve-webhooks-headers.mjs +11 -3
  394. package/tools/webhooks/headers/retrieve-webhooks-headers.mjs.map +1 -1
  395. package/tools/webhooks/list-webhooks.d.mts.map +1 -1
  396. package/tools/webhooks/list-webhooks.d.ts.map +1 -1
  397. package/tools/webhooks/list-webhooks.js +9 -1
  398. package/tools/webhooks/list-webhooks.js.map +1 -1
  399. package/tools/webhooks/list-webhooks.mjs +11 -3
  400. package/tools/webhooks/list-webhooks.mjs.map +1 -1
  401. package/tools/webhooks/retrieve-secret-webhooks.d.mts.map +1 -1
  402. package/tools/webhooks/retrieve-secret-webhooks.d.ts.map +1 -1
  403. package/tools/webhooks/retrieve-secret-webhooks.js +9 -1
  404. package/tools/webhooks/retrieve-secret-webhooks.js.map +1 -1
  405. package/tools/webhooks/retrieve-secret-webhooks.mjs +11 -3
  406. package/tools/webhooks/retrieve-secret-webhooks.mjs.map +1 -1
  407. package/tools/webhooks/retrieve-webhooks.d.mts.map +1 -1
  408. package/tools/webhooks/retrieve-webhooks.d.ts.map +1 -1
  409. package/tools/webhooks/retrieve-webhooks.js +9 -1
  410. package/tools/webhooks/retrieve-webhooks.js.map +1 -1
  411. package/tools/webhooks/retrieve-webhooks.mjs +11 -3
  412. package/tools/webhooks/retrieve-webhooks.mjs.map +1 -1
  413. package/tools/webhooks/update-webhooks.d.mts.map +1 -1
  414. package/tools/webhooks/update-webhooks.d.ts.map +1 -1
  415. package/tools/webhooks/update-webhooks.js +9 -1
  416. package/tools/webhooks/update-webhooks.js.map +1 -1
  417. package/tools/webhooks/update-webhooks.mjs +11 -3
  418. package/tools/webhooks/update-webhooks.mjs.map +1 -1
package/code-tool.js CHANGED
@@ -50,7 +50,7 @@ async function codeTool() {
50
50
  const metadata = { resource: 'all', operation: 'write', tags: [] };
51
51
  const tool = {
52
52
  name: 'execute',
53
- description: 'Runs TypeScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
53
+ description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
54
54
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
55
55
  };
56
56
  // Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
package/code-tool.mjs CHANGED
@@ -14,7 +14,7 @@ export async function codeTool() {
14
14
  const metadata = { resource: 'all', operation: 'write', tags: [] };
15
15
  const tool = {
16
16
  name: 'execute',
17
- description: 'Runs TypeScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
17
+ description: 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
18
18
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
19
19
  };
20
20
  // Import dynamically to avoid failing at import time in cases where the environment is not well-supported.
package/filtering.d.mts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any>;
2
+ export declare function isJqError(error: any): error is Error;
2
3
  //# sourceMappingURL=filtering.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
1
+ {"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
package/filtering.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any>;
2
+ export declare function isJqError(error: any): error is Error;
2
3
  //# sourceMappingURL=filtering.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
1
+ {"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
package/filtering.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.maybeFilter = maybeFilter;
7
+ exports.isJqError = isJqError;
7
8
  // @ts-nocheck
8
9
  const jq_web_1 = __importDefault(require("jq-web"));
9
10
  async function maybeFilter(jqFilter, response) {
@@ -17,4 +18,7 @@ async function maybeFilter(jqFilter, response) {
17
18
  async function jq(json, jqFilter) {
18
19
  return (await jq_web_1.default).json(json, jqFilter);
19
20
  }
21
+ function isJqError(error) {
22
+ return error instanceof Error && 'stderr' in error;
23
+ }
20
24
  //# sourceMappingURL=filtering.js.map
package/filtering.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AATD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AAMD,8BAEC;AAjBD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
package/filtering.mjs CHANGED
@@ -10,4 +10,7 @@ export async function maybeFilter(jqFilter, response) {
10
10
  async function jq(json, jqFilter) {
11
11
  return (await initJq).json(json, jqFilter);
12
12
  }
13
+ export function isJqError(error) {
14
+ return error instanceof Error && 'stderr' in error;
15
+ }
13
16
  //# sourceMappingURL=filtering.mjs.map
package/filtering.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
package/headers.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAiB5E,CAAC"}
1
+ {"version":3,"file":"headers.d.mts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAmB5E,CAAC"}
package/headers.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAiB5E,CAAC"}
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE,MAAM,WAAW;OACpC,EAAE,aAAa,EAAE,MAAM,cAAc;AAE5C,eAAO,MAAM,gBAAgB,GAAI,KAAK,eAAe,KAAG,OAAO,CAAC,aAAa,CAmB5E,CAAC"}
package/headers.js CHANGED
@@ -10,7 +10,7 @@ const parseAuthHeaders = (req) => {
10
10
  case 'Bearer':
11
11
  return { bearerToken: req.headers.authorization.slice('Bearer '.length) };
12
12
  default:
13
- throw new Error(`Unsupported authorization scheme`);
13
+ throw new Error('Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).');
14
14
  }
15
15
  }
16
16
  const bearerToken = Array.isArray(req.headers['x-dodo-payments-api-key']) ?
package/headers.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QACrD,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3C,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC;AAjBW,QAAA,gBAAgB,oBAiB3B"}
1
+ {"version":3,"file":"headers.js","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAK/E,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CACb,0GAA0G,CAC3G,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QACrD,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3C,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC;AAnBW,QAAA,gBAAgB,oBAmB3B"}
package/headers.mjs CHANGED
@@ -7,7 +7,7 @@ export const parseAuthHeaders = (req) => {
7
7
  case 'Bearer':
8
8
  return { bearerToken: req.headers.authorization.slice('Bearer '.length) };
9
9
  default:
10
- throw new Error(`Unsupported authorization scheme`);
10
+ throw new Error('Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).');
11
11
  }
12
12
  }
13
13
  const bearerToken = Array.isArray(req.headers['x-dodo-payments-api-key']) ?
package/headers.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QACrD,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3C,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"headers.mjs","sourceRoot":"","sources":["src/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAKtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAA0B,EAAE;IAC/E,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QACxD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjE,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5E;gBACE,MAAM,IAAI,KAAK,CACb,0GAA0G,CAC3G,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM,WAAW,GACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QACrD,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3C,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC,CAAC"}
package/http.js CHANGED
@@ -38,12 +38,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
38
38
  mcpOptions,
39
39
  });
40
40
  }
41
- catch {
41
+ catch (error) {
42
42
  res.status(401).json({
43
43
  jsonrpc: '2.0',
44
44
  error: {
45
45
  code: -32000,
46
- message: 'Unauthorized',
46
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
47
47
  },
48
48
  });
49
49
  return null;
package/http.js.map CHANGED
@@ -1 +1 @@
1
- {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,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAClB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACnD,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAErB,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEK,MAAM,0BAA0B,GAAG,KAAK,EAAE,OAAmB,EAAE,IAAiC,EAAE,EAAE;IACzG,MAAM,GAAG,GAAG,IAAA,yBAAiB,EAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAEjC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,CAAC,KAAK,CAAC,4CAA4C,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;SAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CAAC,iDAAiD,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,iDAAiD,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
package/http.mjs CHANGED
@@ -32,12 +32,12 @@ const newServer = ({ clientOptions, mcpOptions: defaultMcpOptions, req, res, })
32
32
  mcpOptions,
33
33
  });
34
34
  }
35
- catch {
35
+ catch (error) {
36
36
  res.status(401).json({
37
37
  jsonrpc: '2.0',
38
38
  error: {
39
39
  code: -32000,
40
- message: 'Unauthorized',
40
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
41
41
  },
42
42
  });
43
43
  return null;
package/http.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"http.mjs","sourceRoot":"","sources":["src/http.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,6BAA6B,EAAE,MAAM,oDAAoD;OAE3F,OAAO,MAAM,SAAS;OACtB,EAAE,SAAS,EAAE,MAAM,yBAAyB;OAC5C,EAAc,iBAAiB,EAAE;OACjC,EAAiB,aAAa,EAAE,YAAY,EAAE;OAC9C,EAAE,gBAAgB,EAAE;AAE3B,MAAM,SAAS,GAAG,CAAC,EACjB,aAAa,EACb,UAAU,EAAE,iBAAiB,EAC7B,GAAG,EACH,GAAG,GAMJ,EAAoB,EAAE;IACrB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,IAAI,UAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,UAAU,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC,KAAK;gBACZ,OAAO,EAAE,oBAAoB,SAAS,CAAC,KAAK,CAAC,EAAE;aAChD;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAC1C,aAAa,CAAC;YACZ,MAAM,EAAE,MAAM;YACd,aAAa,EAAE;gBACb,GAAG,aAAa;gBAChB,GAAG,WAAW;aACf;YACD,UAAU;SACX,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;Y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
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "description": "The official MCP Server for the Dodo Payments API",
5
5
  "author": "Dodo Payments <support@dodopayments.com>",
6
6
  "types": "./index.d.ts",
@@ -27,14 +27,14 @@
27
27
  "fix": "eslint --fix --ext ts,js ."
28
28
  },
29
29
  "dependencies": {
30
- "dodopayments": "^2.4.4",
30
+ "dodopayments": "^2.4.6",
31
31
  "@cloudflare/cabidela": "^0.2.4",
32
32
  "@modelcontextprotocol/sdk": "^1.11.5",
33
33
  "@valtown/deno-http-worker": "^0.0.21",
34
34
  "cors": "^2.8.5",
35
35
  "express": "^5.1.0",
36
36
  "fuse.js": "^7.1.0",
37
- "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
37
+ "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
38
38
  "qs": "^6.14.0",
39
39
  "typescript": "5.8.3",
40
40
  "yargs": "^17.7.2",
package/server.js CHANGED
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
22
22
  Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
23
23
  const newMcpServer = () => new mcp_js_1.McpServer({
24
24
  name: 'dodopayments_api',
25
- version: '2.4.4',
25
+ version: '2.4.6',
26
26
  }, { capabilities: { tools: {}, logging: {} } });
27
27
  exports.newMcpServer = newMcpServer;
28
28
  // Create server instance
package/server.mjs CHANGED
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
11
11
  export { endpoints } from "./tools.mjs";
12
12
  export const newMcpServer = () => new McpServer({
13
13
  name: 'dodopayments_api',
14
- version: '2.4.4',
14
+ version: '2.4.6',
15
15
  }, { capabilities: { tools: {}, logging: {} } });
16
16
  // Create server instance
17
17
  export const server = newMcpServer();
package/src/code-tool.ts CHANGED
@@ -23,7 +23,7 @@ export async function codeTool(): Promise<Endpoint> {
23
23
  const tool: Tool = {
24
24
  name: 'execute',
25
25
  description:
26
- 'Runs TypeScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
26
+ 'Runs JavaScript code to interact with the API.\n\nYou are a skilled programmer writing code to interface with the service.\nDefine an async function named "run" that takes a single parameter of an initialized client named "client", and it will be run.\nWrite code within this template:\n\n```\nasync function run(client) {\n // Fill this out\n}\n```\n\nYou will be returned anything that your function returns, plus the results of any console.log statements.\nIf any code triggers an error, the tool will return an error response, so you do not need to add error handling unless you want to output something more helpful than the raw error.\nIt is not necessary to add comments to code, unless by adding those comments you believe that you can generate better code.\nThis code will run in a container, and you will not be able to use fetch or otherwise interact with the network calls other than through the client you are given.\nAny variables you define won\'t live between successive uses of this call, so make sure to return or log any data you might need later.',
27
27
  inputSchema: { type: 'object', properties: { code: { type: 'string' } } },
28
28
  };
29
29
 
package/src/filtering.ts CHANGED
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
12
12
  async function jq(json: any, jqFilter: string) {
13
13
  return (await initJq).json(json, jqFilter);
14
14
  }
15
+
16
+ export function isJqError(error: any): error is Error {
17
+ return error instanceof Error && 'stderr' in error;
18
+ }
package/src/headers.ts CHANGED
@@ -11,7 +11,9 @@ export const parseAuthHeaders = (req: IncomingMessage): Partial<ClientOptions> =
11
11
  case 'Bearer':
12
12
  return { bearerToken: req.headers.authorization.slice('Bearer '.length) };
13
13
  default:
14
- throw new Error(`Unsupported authorization scheme`);
14
+ throw new Error(
15
+ 'Unsupported authorization scheme. Expected the "Authorization" header to be a supported scheme (Bearer).',
16
+ );
15
17
  }
16
18
  }
17
19
 
package/src/http.ts CHANGED
@@ -46,12 +46,12 @@ const newServer = ({
46
46
  },
47
47
  mcpOptions,
48
48
  });
49
- } catch {
49
+ } catch (error) {
50
50
  res.status(401).json({
51
51
  jsonrpc: '2.0',
52
52
  error: {
53
53
  code: -32000,
54
- message: 'Unauthorized',
54
+ message: `Unauthorized: ${error instanceof Error ? error.message : error}`,
55
55
  },
56
56
  });
57
57
  return null;
package/src/server.ts CHANGED
@@ -34,7 +34,7 @@ export const newMcpServer = () =>
34
34
  new McpServer(
35
35
  {
36
36
  name: 'dodopayments_api',
37
- version: '2.4.4',
37
+ version: '2.4.6',
38
38
  },
39
39
  { capabilities: { tools: {}, logging: {} } },
40
40
  );
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -212,7 +212,14 @@ export const tool: Tool = {
212
212
 
213
213
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
214
214
  const { jq_filter, ...body } = args as any;
215
- return asTextContentResult(await maybeFilter(jq_filter, await client.addons.create(body)));
215
+ try {
216
+ return asTextContentResult(await maybeFilter(jq_filter, await client.addons.create(body)));
217
+ } catch (error) {
218
+ if (isJqError(error)) {
219
+ return asErrorResult(error.message);
220
+ }
221
+ throw error;
222
+ }
216
223
  };
217
224
 
218
225
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -47,7 +47,14 @@ export const tool: Tool = {
47
47
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
48
48
  const { jq_filter, ...body } = args as any;
49
49
  const response = await client.addons.list(body).asResponse();
50
- return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
50
+ try {
51
+ return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
52
+ } catch (error) {
53
+ if (isJqError(error)) {
54
+ return asErrorResult(error.message);
55
+ }
56
+ throw error;
57
+ }
51
58
  };
52
59
 
53
60
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
43
  const { id, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.addons.retrieve(id)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.addons.retrieve(id)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -219,7 +219,14 @@ export const tool: Tool = {
219
219
 
220
220
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
221
221
  const { id, jq_filter, ...body } = args as any;
222
- return asTextContentResult(await maybeFilter(jq_filter, await client.addons.update(id, body)));
222
+ try {
223
+ return asTextContentResult(await maybeFilter(jq_filter, await client.addons.update(id, body)));
224
+ } catch (error) {
225
+ if (isJqError(error)) {
226
+ return asErrorResult(error.message);
227
+ }
228
+ throw error;
229
+ }
223
230
  };
224
231
 
225
232
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
43
  const { id, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.addons.updateImages(id)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.addons.updateImages(id)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -51,7 +51,14 @@ export const tool: Tool = {
51
51
 
52
52
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
53
53
  const { jq_filter, ...body } = args as any;
54
- return asTextContentResult(await maybeFilter(jq_filter, await client.brands.create(body)));
54
+ try {
55
+ return asTextContentResult(await maybeFilter(jq_filter, await client.brands.create(body)));
56
+ } catch (error) {
57
+ if (isJqError(error)) {
58
+ return asErrorResult(error.message);
59
+ }
60
+ throw error;
61
+ }
55
62
  };
56
63
 
57
64
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -38,7 +38,14 @@ export const tool: Tool = {
38
38
 
39
39
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
40
40
  const { jq_filter } = args as any;
41
- return asTextContentResult(await maybeFilter(jq_filter, await client.brands.list()));
41
+ try {
42
+ return asTextContentResult(await maybeFilter(jq_filter, await client.brands.list()));
43
+ } catch (error) {
44
+ if (isJqError(error)) {
45
+ return asErrorResult(error.message);
46
+ }
47
+ throw error;
48
+ }
42
49
  };
43
50
 
44
51
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
43
  const { id, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.brands.retrieve(id)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.brands.retrieve(id)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -52,7 +52,14 @@ export const tool: Tool = {
52
52
 
53
53
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
54
54
  const { id, jq_filter, ...body } = args as any;
55
- return asTextContentResult(await maybeFilter(jq_filter, await client.brands.update(id, body)));
55
+ try {
56
+ return asTextContentResult(await maybeFilter(jq_filter, await client.brands.update(id, body)));
57
+ } catch (error) {
58
+ if (isJqError(error)) {
59
+ return asErrorResult(error.message);
60
+ }
61
+ throw error;
62
+ }
56
63
  };
57
64
 
58
65
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
43
  const { id, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.brands.updateImages(id)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.brands.updateImages(id)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from 'dodopayments-mcp/filtering';
4
- import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
3
+ import { isJqError, maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import DodoPayments from 'dodopayments';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
43
  const { id, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.checkoutSessions.retrieve(id)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.checkoutSessions.retrieve(id)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };