@flexprice/mcp-server 2.1.1 → 2.1.3

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 (296) hide show
  1. package/bin/mcp-server.js +1499 -724
  2. package/bin/mcp-server.js.map +64 -28
  3. package/bun.lock +33 -33
  4. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts +16 -0
  5. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
  6. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js +82 -0
  7. package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
  8. package/esm/funcs/{plansPostPlansIdClone.d.ts → plansClonePlan.d.ts} +3 -3
  9. package/esm/funcs/plansClonePlan.d.ts.map +1 -0
  10. package/esm/funcs/{plansPostPlansIdClone.js → plansClonePlan.js} +5 -5
  11. package/esm/funcs/plansClonePlan.js.map +1 -0
  12. package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +4 -4
  13. package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts.map +1 -1
  14. package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +4 -4
  15. package/esm/funcs/subscriptionsExecuteSubscriptionModify.js.map +1 -1
  16. package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +16 -0
  17. package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
  18. package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +88 -0
  19. package/esm/funcs/subscriptionsPreviewSubscriptionModify.js.map +1 -0
  20. package/esm/lib/config.d.ts +3 -3
  21. package/esm/lib/config.js +3 -3
  22. package/esm/lib/config.js.map +1 -1
  23. package/esm/lib/encodings.d.ts +1 -0
  24. package/esm/lib/encodings.d.ts.map +1 -1
  25. package/esm/lib/encodings.js +6 -0
  26. package/esm/lib/encodings.js.map +1 -1
  27. package/esm/mcp-server/mcp-server.js +1 -1
  28. package/esm/mcp-server/server.d.ts.map +1 -1
  29. package/esm/mcp-server/server.js +7 -3
  30. package/esm/mcp-server/server.js.map +1 -1
  31. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts +7 -0
  32. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
  33. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js +35 -0
  34. package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
  35. package/esm/mcp-server/tools/plansClonePlan.d.ts +7 -0
  36. package/esm/mcp-server/tools/plansClonePlan.d.ts.map +1 -0
  37. package/esm/mcp-server/tools/{plansPostPlansIdClone.js → plansClonePlan.js} +7 -7
  38. package/esm/mcp-server/tools/plansClonePlan.js.map +1 -0
  39. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
  40. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +4 -4
  41. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
  42. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts +7 -0
  43. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
  44. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +35 -0
  45. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -0
  46. package/esm/models/address.d.ts +11 -0
  47. package/esm/models/address.d.ts.map +1 -0
  48. package/esm/models/address.js +13 -0
  49. package/esm/models/address.js.map +1 -0
  50. package/esm/models/alertstate.d.ts +16 -0
  51. package/esm/models/alertstate.d.ts.map +1 -0
  52. package/esm/models/alertstate.js +17 -0
  53. package/esm/models/alertstate.js.map +1 -0
  54. package/esm/models/autotopup.d.ts +9 -0
  55. package/esm/models/autotopup.d.ts.map +1 -0
  56. package/esm/models/autotopup.js +11 -0
  57. package/esm/models/autotopup.js.map +1 -0
  58. package/esm/models/billingcadence.d.ts +0 -2
  59. package/esm/models/billingcadence.d.ts.map +1 -1
  60. package/esm/models/billingcadence.js +0 -2
  61. package/esm/models/billingcadence.js.map +1 -1
  62. package/esm/models/billingperiod.d.ts +2 -0
  63. package/esm/models/billingperiod.d.ts.map +1 -1
  64. package/esm/models/billingperiod.js +2 -0
  65. package/esm/models/billingperiod.js.map +1 -1
  66. package/esm/models/changedinvoice.d.ts +14 -0
  67. package/esm/models/changedinvoice.d.ts.map +1 -0
  68. package/esm/models/changedinvoice.js +16 -0
  69. package/esm/models/changedinvoice.js.map +1 -0
  70. package/esm/models/changedinvoiceaction.d.ts +18 -0
  71. package/esm/models/changedinvoiceaction.d.ts.map +1 -0
  72. package/esm/models/changedinvoiceaction.js +16 -0
  73. package/esm/models/changedinvoiceaction.js.map +1 -0
  74. package/esm/models/changedinvoicestatus.d.ts +18 -0
  75. package/esm/models/changedinvoicestatus.d.ts.map +1 -0
  76. package/esm/models/changedinvoicestatus.js +16 -0
  77. package/esm/models/changedinvoicestatus.js.map +1 -0
  78. package/esm/models/changedlineitem.d.ts +12 -0
  79. package/esm/models/changedlineitem.d.ts.map +1 -0
  80. package/esm/models/changedlineitem.js +14 -0
  81. package/esm/models/changedlineitem.js.map +1 -0
  82. package/esm/models/changedlineitemaction.d.ts +20 -0
  83. package/esm/models/changedlineitemaction.d.ts.map +1 -0
  84. package/esm/models/changedlineitemaction.js +18 -0
  85. package/esm/models/changedlineitemaction.js.map +1 -0
  86. package/esm/models/changedresources.d.ts +11 -0
  87. package/esm/models/changedresources.d.ts.map +1 -0
  88. package/esm/models/changedresources.js +13 -0
  89. package/esm/models/changedresources.js.map +1 -0
  90. package/esm/models/changedsubscription.d.ts +10 -0
  91. package/esm/models/changedsubscription.d.ts.map +1 -0
  92. package/esm/models/changedsubscription.js +13 -0
  93. package/esm/models/changedsubscription.js.map +1 -0
  94. package/esm/models/changedsubscriptionaction.d.ts +18 -0
  95. package/esm/models/changedsubscriptionaction.d.ts.map +1 -0
  96. package/esm/models/changedsubscriptionaction.js +16 -0
  97. package/esm/models/changedsubscriptionaction.js.map +1 -0
  98. package/esm/models/cloneplanop.d.ts +12 -0
  99. package/esm/models/cloneplanop.d.ts.map +1 -0
  100. package/esm/models/{postplansidcloneop.js → cloneplanop.js} +4 -3
  101. package/esm/models/cloneplanop.js.map +1 -0
  102. package/esm/models/createpricerequest.d.ts +0 -2
  103. package/esm/models/createpricerequest.d.ts.map +1 -1
  104. package/esm/models/createpricerequest.js +0 -2
  105. package/esm/models/createpricerequest.js.map +1 -1
  106. package/esm/models/createsubscriptionrequest.d.ts +1 -2
  107. package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
  108. package/esm/models/createsubscriptionrequest.js +1 -2
  109. package/esm/models/createsubscriptionrequest.js.map +1 -1
  110. package/esm/models/creditbreakdown.d.ts +7 -0
  111. package/esm/models/creditbreakdown.d.ts.map +1 -0
  112. package/esm/models/creditbreakdown.js +9 -0
  113. package/esm/models/creditbreakdown.js.map +1 -0
  114. package/esm/models/creditgrantcadence.d.ts +1 -1
  115. package/esm/models/executesubscriptionmodifyop.d.ts +6 -6
  116. package/esm/models/executesubscriptionmodifyop.d.ts.map +1 -1
  117. package/esm/models/executesubscriptionmodifyop.js +5 -5
  118. package/esm/models/executesubscriptionmodifyop.js.map +1 -1
  119. package/esm/models/executesubscriptionmodifyrequest.d.ts +11 -0
  120. package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -0
  121. package/esm/models/executesubscriptionmodifyrequest.js +13 -0
  122. package/esm/models/executesubscriptionmodifyrequest.js.map +1 -0
  123. package/esm/models/getmeterusagepreviewinvoiceop.d.ts +6 -0
  124. package/esm/models/getmeterusagepreviewinvoiceop.d.ts.map +1 -0
  125. package/esm/models/getmeterusagepreviewinvoiceop.js +11 -0
  126. package/esm/models/getmeterusagepreviewinvoiceop.js.map +1 -0
  127. package/esm/models/invoicefilter.d.ts +1 -0
  128. package/esm/models/invoicefilter.d.ts.map +1 -1
  129. package/esm/models/invoicefilter.js +1 -0
  130. package/esm/models/invoicefilter.js.map +1 -1
  131. package/esm/models/invoiceresponse.d.ts +1 -0
  132. package/esm/models/invoiceresponse.d.ts.map +1 -1
  133. package/esm/models/invoiceresponse.js +1 -0
  134. package/esm/models/invoiceresponse.js.map +1 -1
  135. package/esm/models/lineitemquantitychange.d.ts +8 -0
  136. package/esm/models/lineitemquantitychange.d.ts.map +1 -0
  137. package/esm/models/lineitemquantitychange.js +10 -0
  138. package/esm/models/lineitemquantitychange.js.map +1 -0
  139. package/esm/models/previewsubscriptionmodifyop.d.ts +12 -0
  140. package/esm/models/previewsubscriptionmodifyop.d.ts.map +1 -0
  141. package/esm/models/previewsubscriptionmodifyop.js +16 -0
  142. package/esm/models/previewsubscriptionmodifyop.js.map +1 -0
  143. package/esm/models/submodifyinheritancerequest.d.ts +6 -0
  144. package/esm/models/submodifyinheritancerequest.d.ts.map +1 -0
  145. package/esm/models/{executesubscriptioninheritancerequest.js → submodifyinheritancerequest.js} +2 -2
  146. package/esm/models/submodifyinheritancerequest.js.map +1 -0
  147. package/esm/models/submodifyquantitychangerequest.d.ts +7 -0
  148. package/esm/models/submodifyquantitychangerequest.d.ts.map +1 -0
  149. package/esm/models/submodifyquantitychangerequest.js +9 -0
  150. package/esm/models/submodifyquantitychangerequest.js.map +1 -0
  151. package/esm/models/subscriptionmodifyresponse.d.ts +9 -0
  152. package/esm/models/subscriptionmodifyresponse.d.ts.map +1 -0
  153. package/esm/models/subscriptionmodifyresponse.js +11 -0
  154. package/esm/models/subscriptionmodifyresponse.js.map +1 -0
  155. package/esm/models/subscriptionmodifytype.d.ts +12 -0
  156. package/esm/models/subscriptionmodifytype.d.ts.map +1 -0
  157. package/esm/models/subscriptionmodifytype.js +13 -0
  158. package/esm/models/subscriptionmodifytype.js.map +1 -0
  159. package/esm/models/subscriptionphasecreaterequest.d.ts +2 -0
  160. package/esm/models/subscriptionphasecreaterequest.d.ts.map +1 -1
  161. package/esm/models/subscriptionphasecreaterequest.js +3 -0
  162. package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
  163. package/esm/models/subscriptionpricecreaterequest.d.ts +0 -2
  164. package/esm/models/subscriptionpricecreaterequest.d.ts.map +1 -1
  165. package/esm/models/subscriptionpricecreaterequest.js +0 -2
  166. package/esm/models/subscriptionpricecreaterequest.js.map +1 -1
  167. package/esm/models/tenantbillingdetails.d.ts +10 -0
  168. package/esm/models/tenantbillingdetails.d.ts.map +1 -0
  169. package/esm/models/tenantbillingdetails.js +13 -0
  170. package/esm/models/tenantbillingdetails.js.map +1 -0
  171. package/esm/models/tenantresponse.d.ts +15 -0
  172. package/esm/models/tenantresponse.d.ts.map +1 -0
  173. package/esm/models/tenantresponse.js +15 -0
  174. package/esm/models/tenantresponse.js.map +1 -0
  175. package/esm/models/transactionreason.d.ts +30 -0
  176. package/esm/models/transactionreason.d.ts.map +1 -0
  177. package/esm/models/transactionreason.js +31 -0
  178. package/esm/models/transactionreason.js.map +1 -0
  179. package/esm/models/transactionstatus.d.ts +14 -0
  180. package/esm/models/transactionstatus.d.ts.map +1 -0
  181. package/esm/models/transactionstatus.js +15 -0
  182. package/esm/models/transactionstatus.js.map +1 -0
  183. package/esm/models/transactiontype.d.ts +12 -0
  184. package/esm/models/transactiontype.d.ts.map +1 -0
  185. package/esm/models/transactiontype.js +13 -0
  186. package/esm/models/transactiontype.js.map +1 -0
  187. package/esm/models/userresponse.d.ts +12 -0
  188. package/esm/models/userresponse.d.ts.map +1 -0
  189. package/esm/models/userresponse.js +14 -0
  190. package/esm/models/userresponse.js.map +1 -0
  191. package/esm/models/usertype.d.ts +12 -0
  192. package/esm/models/usertype.d.ts.map +1 -0
  193. package/esm/models/usertype.js +13 -0
  194. package/esm/models/usertype.js.map +1 -0
  195. package/esm/models/walletconfig.d.ts +7 -0
  196. package/esm/models/walletconfig.d.ts.map +1 -0
  197. package/esm/models/walletconfig.js +10 -0
  198. package/esm/models/walletconfig.js.map +1 -0
  199. package/esm/models/walletconfigpricetype.d.ts +14 -0
  200. package/esm/models/walletconfigpricetype.d.ts.map +1 -0
  201. package/esm/models/walletconfigpricetype.js +15 -0
  202. package/esm/models/walletconfigpricetype.js.map +1 -0
  203. package/esm/models/walletresponse.d.ts +39 -0
  204. package/esm/models/walletresponse.d.ts.map +1 -0
  205. package/esm/models/walletresponse.js +39 -0
  206. package/esm/models/walletresponse.js.map +1 -0
  207. package/esm/models/walletstatus.d.ts +14 -0
  208. package/esm/models/walletstatus.d.ts.map +1 -0
  209. package/esm/models/walletstatus.js +15 -0
  210. package/esm/models/walletstatus.js.map +1 -0
  211. package/esm/models/wallettransactionresponse.d.ts +46 -0
  212. package/esm/models/wallettransactionresponse.d.ts.map +1 -0
  213. package/esm/models/wallettransactionresponse.js +46 -0
  214. package/esm/models/wallettransactionresponse.js.map +1 -0
  215. package/esm/models/wallettxreferencetype.d.ts +16 -0
  216. package/esm/models/wallettxreferencetype.d.ts.map +1 -0
  217. package/esm/models/wallettxreferencetype.js +17 -0
  218. package/esm/models/wallettxreferencetype.js.map +1 -0
  219. package/esm/models/wallettype.d.ts +12 -0
  220. package/esm/models/wallettype.d.ts.map +1 -0
  221. package/esm/models/wallettype.js +13 -0
  222. package/esm/models/wallettype.js.map +1 -0
  223. package/esm/tool-names.d.ts.map +1 -1
  224. package/esm/tool-names.js +10 -2
  225. package/esm/tool-names.js.map +1 -1
  226. package/esm/tsconfig.tsbuildinfo +1 -1
  227. package/manifest.json +11 -3
  228. package/package.json +1 -1
  229. package/src/funcs/invoicesGetMeterUsagePreviewInvoice.ts +144 -0
  230. package/src/funcs/{plansPostPlansIdClone.ts → plansClonePlan.ts} +9 -9
  231. package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +7 -7
  232. package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +153 -0
  233. package/src/lib/config.ts +3 -3
  234. package/src/lib/encodings.ts +9 -0
  235. package/src/mcp-server/mcp-server.ts +1 -1
  236. package/src/mcp-server/server.ts +7 -3
  237. package/src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts +47 -0
  238. package/src/mcp-server/tools/{plansPostPlansIdClone.ts → plansClonePlan.ts} +6 -6
  239. package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +4 -4
  240. package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +45 -0
  241. package/src/models/address.ts +23 -0
  242. package/src/models/alertstate.ts +21 -0
  243. package/src/models/autotopup.ts +19 -0
  244. package/src/models/billingcadence.ts +0 -2
  245. package/src/models/billingperiod.ts +2 -0
  246. package/src/models/changedinvoice.ts +41 -0
  247. package/src/models/changedinvoiceaction.ts +23 -0
  248. package/src/models/changedinvoicestatus.ts +25 -0
  249. package/src/models/changedlineitem.ts +29 -0
  250. package/src/models/changedlineitemaction.ts +25 -0
  251. package/src/models/changedresources.ts +28 -0
  252. package/src/models/changedsubscription.ts +28 -0
  253. package/src/models/changedsubscriptionaction.ts +25 -0
  254. package/src/models/{postplansidcloneop.ts → cloneplanop.ts} +9 -10
  255. package/src/models/createpricerequest.ts +0 -3
  256. package/src/models/createsubscriptionrequest.ts +4 -3
  257. package/src/models/creditbreakdown.ts +15 -0
  258. package/src/models/executesubscriptionmodifyop.ts +14 -14
  259. package/src/models/executesubscriptionmodifyrequest.ts +31 -0
  260. package/src/models/getmeterusagepreviewinvoiceop.ts +21 -0
  261. package/src/models/invoicefilter.ts +4 -0
  262. package/src/models/invoiceresponse.ts +4 -0
  263. package/src/models/lineitemquantitychange.ts +21 -0
  264. package/src/models/previewsubscriptionmodifyop.ts +39 -0
  265. package/src/models/{executesubscriptioninheritancerequest.ts → submodifyinheritancerequest.ts} +3 -3
  266. package/src/models/submodifyquantitychangerequest.ts +19 -0
  267. package/src/models/subscriptionmodifyresponse.ts +25 -0
  268. package/src/models/subscriptionmodifytype.ts +17 -0
  269. package/src/models/subscriptionphasecreaterequest.ts +9 -0
  270. package/src/models/subscriptionpricecreaterequest.ts +0 -3
  271. package/src/models/tenantbillingdetails.ts +21 -0
  272. package/src/models/tenantresponse.ts +29 -0
  273. package/src/models/transactionreason.ts +35 -0
  274. package/src/models/transactionstatus.ts +19 -0
  275. package/src/models/transactiontype.ts +17 -0
  276. package/src/models/userresponse.ts +23 -0
  277. package/src/models/usertype.ts +17 -0
  278. package/src/models/walletconfig.ts +20 -0
  279. package/src/models/walletconfigpricetype.ts +19 -0
  280. package/src/models/walletresponse.ts +74 -0
  281. package/src/models/walletstatus.ts +19 -0
  282. package/src/models/wallettransactionresponse.ts +104 -0
  283. package/src/models/wallettxreferencetype.ts +21 -0
  284. package/src/models/wallettype.ts +17 -0
  285. package/src/tool-names.ts +10 -2
  286. package/esm/funcs/plansPostPlansIdClone.d.ts.map +0 -1
  287. package/esm/funcs/plansPostPlansIdClone.js.map +0 -1
  288. package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts +0 -7
  289. package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts.map +0 -1
  290. package/esm/mcp-server/tools/plansPostPlansIdClone.js.map +0 -1
  291. package/esm/models/executesubscriptioninheritancerequest.d.ts +0 -6
  292. package/esm/models/executesubscriptioninheritancerequest.d.ts.map +0 -1
  293. package/esm/models/executesubscriptioninheritancerequest.js.map +0 -1
  294. package/esm/models/postplansidcloneop.d.ts +0 -12
  295. package/esm/models/postplansidcloneop.d.ts.map +0 -1
  296. package/esm/models/postplansidcloneop.js.map +0 -1
package/bin/mcp-server.js CHANGED
@@ -5911,6 +5911,17 @@ var init_dist = __esm(() => {
5911
5911
  }
5912
5912
  });
5913
5913
  });
5914
+ Object.defineProperty(requestPrototype, Symbol.for("nodejs.util.inspect.custom"), {
5915
+ value: function(depth, options, inspectFn) {
5916
+ const props = {
5917
+ method: this.method,
5918
+ url: this.url,
5919
+ headers: this.headers,
5920
+ nativeRequest: this[requestCache]
5921
+ };
5922
+ return `Request (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
5923
+ }
5924
+ });
5914
5925
  Object.setPrototypeOf(requestPrototype, Request2.prototype);
5915
5926
  responseCache = Symbol("responseCache");
5916
5927
  getResponseCache = Symbol("getResponseCache");
@@ -5975,6 +5986,17 @@ var init_dist = __esm(() => {
5975
5986
  }
5976
5987
  });
5977
5988
  });
5989
+ Object.defineProperty(Response2.prototype, Symbol.for("nodejs.util.inspect.custom"), {
5990
+ value: function(depth, options, inspectFn) {
5991
+ const props = {
5992
+ status: this.status,
5993
+ headers: this.headers,
5994
+ ok: this.ok,
5995
+ nativeResponse: this[responseCache]
5996
+ };
5997
+ return `Response (lightweight) ${inspectFn(props, { ...options, depth: depth == null ? null : depth - 1 })}`;
5998
+ }
5999
+ });
5978
6000
  Object.setPrototypeOf(Response2, GlobalResponse);
5979
6001
  Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
5980
6002
  if (typeof global.crypto === "undefined") {
@@ -23687,9 +23709,8 @@ var require_side_channel_list = __commonJS((exports, module) => {
23687
23709
  }
23688
23710
  },
23689
23711
  delete: function(key) {
23690
- var root = $o && $o.next;
23691
23712
  var deletedNode = listDelete($o, key);
23692
- if (deletedNode && root && root === deletedNode) {
23713
+ if (deletedNode && $o && !$o.next) {
23693
23714
  $o = undefined;
23694
23715
  }
23695
23716
  return !!deletedNode;
@@ -25133,8 +25154,8 @@ var require_parse = __commonJS((exports, module) => {
25133
25154
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
25134
25155
  cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
25135
25156
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
25136
- var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
25137
- if (options.throwOnLimitExceeded && parts.length > limit) {
25157
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded && typeof limit !== "undefined" ? limit + 1 : limit);
25158
+ if (options.throwOnLimitExceeded && typeof limit !== "undefined" && parts.length > limit) {
25138
25159
  throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
25139
25160
  }
25140
25161
  var skipIndex = -1;
@@ -29222,10 +29243,8 @@ var require_content_disposition = __commonJS((exports, module) => {
29222
29243
  */
29223
29244
  module.exports = contentDisposition;
29224
29245
  module.exports.parse = parse5;
29225
- var basename = __require("path").basename;
29246
+ var utf8Decoder = new TextDecoder("utf-8");
29226
29247
  var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
29227
- var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
29228
- var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
29229
29248
  var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g;
29230
29249
  var QESC_REGEXP = /\\([\u0000-\u007f])/g;
29231
29250
  var QUOTE_REGEXP = /([\\"])/g;
@@ -29261,7 +29280,7 @@ var require_content_disposition = __commonJS((exports, module) => {
29261
29280
  var isQuotedString = TEXT_REGEXP.test(name);
29262
29281
  var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name) : basename(fallback);
29263
29282
  var hasFallback = typeof fallbackName === "string" && fallbackName !== name;
29264
- if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
29283
+ if (hasFallback || !isQuotedString || hasHexEscape(name)) {
29265
29284
  params["filename*"] = name;
29266
29285
  }
29267
29286
  if (isQuotedString || hasFallback) {
@@ -29288,26 +29307,32 @@ var require_content_disposition = __commonJS((exports, module) => {
29288
29307
  return string4;
29289
29308
  }
29290
29309
  function decodefield(str) {
29291
- var match = EXT_VALUE_REGEXP.exec(str);
29310
+ const match = EXT_VALUE_REGEXP.exec(str);
29292
29311
  if (!match) {
29293
29312
  throw new TypeError("invalid extended field value");
29294
29313
  }
29295
- var charset = match[1].toLowerCase();
29296
- var encoded = match[2];
29297
- var value;
29298
- var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode);
29314
+ const charset = match[1].toLowerCase();
29315
+ const encoded = match[2];
29299
29316
  switch (charset) {
29300
- case "iso-8859-1":
29301
- value = getlatin1(binary);
29302
- break;
29317
+ case "iso-8859-1": {
29318
+ const binary = decodeHexEscapes(encoded);
29319
+ return getlatin1(binary);
29320
+ }
29303
29321
  case "utf-8":
29304
- case "utf8":
29305
- value = Buffer.from(binary, "binary").toString("utf8");
29306
- break;
29307
- default:
29308
- throw new TypeError("unsupported charset in extended field");
29322
+ case "utf8": {
29323
+ try {
29324
+ return decodeURIComponent(encoded);
29325
+ } catch {
29326
+ const binary = decodeHexEscapes(encoded);
29327
+ const bytes = new Uint8Array(binary.length);
29328
+ for (let idx = 0;idx < binary.length; idx++) {
29329
+ bytes[idx] = binary.charCodeAt(idx);
29330
+ }
29331
+ return utf8Decoder.decode(bytes);
29332
+ }
29333
+ }
29309
29334
  }
29310
- return value;
29335
+ throw new TypeError("unsupported charset in extended field");
29311
29336
  }
29312
29337
  function getlatin1(val) {
29313
29338
  return String(val).replace(NON_LATIN1_REGEXP, "?");
@@ -29357,9 +29382,6 @@ var require_content_disposition = __commonJS((exports, module) => {
29357
29382
  }
29358
29383
  return new ContentDisposition(type, params);
29359
29384
  }
29360
- function pdecode(str, hex) {
29361
- return String.fromCharCode(parseInt(hex, 16));
29362
- }
29363
29385
  function pencode(char) {
29364
29386
  return "%" + String(char).charCodeAt(0).toString(16).toUpperCase();
29365
29387
  }
@@ -29376,6 +29398,50 @@ var require_content_disposition = __commonJS((exports, module) => {
29376
29398
  this.type = type;
29377
29399
  this.parameters = parameters;
29378
29400
  }
29401
+ function basename(path) {
29402
+ const normalized = path.replaceAll("\\", "/");
29403
+ let end = normalized.length;
29404
+ while (end > 0 && normalized[end - 1] === "/") {
29405
+ end--;
29406
+ }
29407
+ if (end === 0) {
29408
+ return "";
29409
+ }
29410
+ let start = end - 1;
29411
+ while (start >= 0 && normalized[start] !== "/") {
29412
+ start--;
29413
+ }
29414
+ return normalized.slice(start + 1, end);
29415
+ }
29416
+ function isHexDigit(char) {
29417
+ const code = char.charCodeAt(0);
29418
+ return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102;
29419
+ }
29420
+ function hasHexEscape(str) {
29421
+ const maxIndex = str.length - 3;
29422
+ let lastIndex = -1;
29423
+ while ((lastIndex = str.indexOf("%", lastIndex + 1)) !== -1 && lastIndex <= maxIndex) {
29424
+ if (isHexDigit(str[lastIndex + 1]) && isHexDigit(str[lastIndex + 2])) {
29425
+ return true;
29426
+ }
29427
+ }
29428
+ return false;
29429
+ }
29430
+ function decodeHexEscapes(str) {
29431
+ const firstEscape = str.indexOf("%");
29432
+ if (firstEscape === -1)
29433
+ return str;
29434
+ let result = str.slice(0, firstEscape);
29435
+ for (let idx = firstEscape;idx < str.length; idx++) {
29436
+ if (str[idx] === "%" && idx + 2 < str.length && isHexDigit(str[idx + 1]) && isHexDigit(str[idx + 2])) {
29437
+ result += String.fromCharCode(Number.parseInt(str[idx + 1] + str[idx + 2], 16));
29438
+ idx += 2;
29439
+ } else {
29440
+ result += str[idx];
29441
+ }
29442
+ }
29443
+ return result;
29444
+ }
29379
29445
  });
29380
29446
 
29381
29447
  // node_modules/cookie-signature/index.js
@@ -50505,9 +50571,9 @@ var init_config = __esm(() => {
50505
50571
  SDK_METADATA = {
50506
50572
  language: "typescript",
50507
50573
  openapiDocVersion: "1.0",
50508
- sdkVersion: "2.1.1",
50509
- genVersion: "2.879.6",
50510
- userAgent: "speakeasy-sdk/mcp-typescript 2.1.1 2.879.6 1.0 @flexprice/mcp-server"
50574
+ sdkVersion: "2.1.3",
50575
+ genVersion: "2.879.13",
50576
+ userAgent: "speakeasy-sdk/mcp-typescript 2.1.3 2.879.13 1.0 @flexprice/mcp-server"
50511
50577
  };
50512
50578
  });
50513
50579
 
@@ -52610,7 +52676,8 @@ var init_billingperiod = __esm(() => {
52610
52676
  "WEEKLY",
52611
52677
  "DAILY",
52612
52678
  "QUARTERLY",
52613
- "HALF_YEARLY"
52679
+ "HALF_YEARLY",
52680
+ "ONETIME"
52614
52681
  ]);
52615
52682
  });
52616
52683
 
@@ -53916,8 +53983,7 @@ var BillingCadence$zodSchema;
53916
53983
  var init_billingcadence = __esm(() => {
53917
53984
  init_zod();
53918
53985
  BillingCadence$zodSchema = _enum([
53919
- "RECURRING",
53920
- "ONETIME"
53986
+ "RECURRING"
53921
53987
  ]);
53922
53988
  });
53923
53989
 
@@ -56878,6 +56944,8 @@ When set, it forms a parent→child link from this (voided) invoice to the new r
56878
56944
  These are actual refunds issued to the customer.`),
56879
56945
  status: Status$zodSchema.optional(),
56880
56946
  subscription: lazy(() => SubscriptionResponse$zodSchema).optional(),
56947
+ subscription_customer_id: string2().optional().describe(`subscription_customer_id is the subscription owner's customer ID (Subscription.CustomerID).
56948
+ It may differ from customer_id when the subscription uses an invoicing customer. Set internally; nullable in DB.`),
56881
56949
  subscription_id: string2().optional().describe("subscription_id is the ID of the subscription this invoice is associated with (only present for subscription-based invoices)"),
56882
56950
  subtotal: string2().optional().describe("subtotal is the sum of all line items before any taxes, discounts, or additional fees"),
56883
56951
  taxes: array(TaxAppliedResponse$zodSchema).optional().describe("tax_applied_records contains the tax applied records associated with this invoice"),
@@ -57286,67 +57354,18 @@ Use when showing a customer what they will be charged (e.g. preview before check
57286
57354
  };
57287
57355
  });
57288
57356
 
57289
- // src/models/invoicefilter.ts
57290
- var InvoiceFilterOrder$zodSchema, InvoiceFilter$zodSchema;
57291
- var init_invoicefilter = __esm(() => {
57292
- init_zod();
57293
- init_filtercondition();
57294
- init_invoicestatus();
57295
- init_invoicetype();
57296
- init_paymentstatus();
57297
- init_sortcondition();
57298
- init_status();
57299
- InvoiceFilterOrder$zodSchema = _enum([
57300
- "asc",
57301
- "desc"
57302
- ]);
57303
- InvoiceFilter$zodSchema = object({
57304
- amount_due_gt: number2().optional().describe(`amount_due_gt filters invoices with a total amount due greater than the specified value
57305
- Useful for finding invoices above a certain threshold or identifying high-value invoices`),
57306
- amount_remaining_gt: number2().optional().describe(`amount_remaining_gt filters invoices with an outstanding balance greater than the specified value
57307
- Useful for finding invoices that still have significant unpaid amounts`),
57308
- customer_id: string2().optional().describe(`customer_id filters invoices for a specific customer using FlexPrice's internal customer ID
57309
- This is the ID returned by FlexPrice when creating or retrieving customers`),
57310
- end_time: exports_iso.datetime({ offset: true }).optional(),
57311
- expand: string2().optional(),
57312
- external_customer_id: string2().optional().describe(`external_customer_id filters invoices for a customer using your system's customer identifier
57313
- This is the ID you provided when creating the customer in FlexPrice`),
57314
- filters: array(FilterCondition$zodSchema).optional(),
57315
- invoice_ids: array(string2()).optional().describe(`invoice_ids restricts results to invoices with the specified IDs
57316
- Use this to retrieve specific invoices when you know their exact identifiers`),
57317
- invoice_status: array(InvoiceStatus$zodSchema).optional().describe(`invoice_status filters by the current state of invoices in their lifecycle
57318
- Multiple statuses can be specified to include invoices in any of the listed states`),
57319
- invoice_type: InvoiceType$zodSchema.optional(),
57320
- limit: int().optional(),
57321
- offset: int().optional(),
57322
- order: InvoiceFilterOrder$zodSchema.optional(),
57323
- payment_status: array(PaymentStatus$zodSchema).optional().describe(`payment_status filters by the payment state of invoices
57324
- Multiple statuses can be specified to include invoices with any of the listed payment states`),
57325
- period_end_gte: string2().optional().describe("period_end_gte filters invoices with period_end >= value"),
57326
- period_end_lte: string2().optional().describe("period_end_lte filters invoices with period_end <= value"),
57327
- period_start_gte: string2().optional().describe("period_start_gte filters invoices with period_start >= value"),
57328
- period_start_lte: string2().optional().describe("period_start_lte filters invoices with period_start <= value"),
57329
- skip_line_items: boolean2().optional().describe("SkipLineItems if true, will not include line items in the response"),
57330
- sort: array(SortCondition$zodSchema).optional(),
57331
- start_time: exports_iso.datetime({ offset: true }).optional(),
57332
- status: Status$zodSchema.optional(),
57333
- subscription_id: string2().optional().describe(`subscription_id filters invoices generated for a specific subscription
57334
- Only returns invoices that were created as part of the specified subscription's billing`)
57335
- });
57336
- });
57337
-
57338
- // src/funcs/invoicesQueryInvoice.ts
57339
- function invoicesQueryInvoice(client$, request, options) {
57357
+ // src/funcs/invoicesGetMeterUsagePreviewInvoice.ts
57358
+ function invoicesGetMeterUsagePreviewInvoice(client$, request, options) {
57340
57359
  return new APIPromise($do25(client$, request, options));
57341
57360
  }
57342
57361
  async function $do25(client$, request, options) {
57343
- const parsed$ = safeParse4(request, (value$) => InvoiceFilter$zodSchema.parse(value$), "Input validation failed");
57362
+ const parsed$ = safeParse4(request, (value$) => GetPreviewInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
57344
57363
  if (!parsed$.ok) {
57345
57364
  return [parsed$, { status: "invalid" }];
57346
57365
  }
57347
57366
  const payload$ = parsed$.value;
57348
57367
  const body$ = encodeJSON("body", payload$, { explode: true });
57349
- const path$ = pathToFunc("/invoices/search")();
57368
+ const path$ = pathToFunc("/invoices/meter-usage-preview")();
57350
57369
  const headers$ = new Headers(compactMap({
57351
57370
  "Content-Type": "application/json",
57352
57371
  Accept: "application/json"
@@ -57356,7 +57375,7 @@ async function $do25(client$, request, options) {
57356
57375
  const context = {
57357
57376
  options: client$._options,
57358
57377
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
57359
- operationID: "queryInvoice",
57378
+ operationID: "getMeterUsagePreviewInvoice",
57360
57379
  oAuth2Scopes: null,
57361
57380
  resolvedSecurity: requestSecurity,
57362
57381
  securitySource: client$._options.security,
@@ -57398,30 +57417,30 @@ async function $do25(client$, request, options) {
57398
57417
  response: doResult.value
57399
57418
  }];
57400
57419
  }
57401
- var init_invoicesQueryInvoice = __esm(() => {
57420
+ var init_invoicesGetMeterUsagePreviewInvoice = __esm(() => {
57402
57421
  init_encodings();
57403
57422
  init_primitives();
57404
57423
  init_schemas4();
57405
57424
  init_security();
57406
57425
  init_url();
57407
- init_invoicefilter();
57426
+ init_getpreviewinvoicerequest();
57408
57427
  init_async();
57409
57428
  });
57410
57429
 
57411
- // src/mcp-server/tools/invoicesQueryInvoice.ts
57412
- var args24, tool$invoicesQueryInvoice;
57413
- var init_invoicesQueryInvoice2 = __esm(() => {
57414
- init_invoicesQueryInvoice();
57415
- init_invoicefilter();
57430
+ // src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts
57431
+ var args24, tool$invoicesGetMeterUsagePreviewInvoice;
57432
+ var init_invoicesGetMeterUsagePreviewInvoice2 = __esm(() => {
57433
+ init_invoicesGetMeterUsagePreviewInvoice();
57434
+ init_getpreviewinvoicerequest();
57416
57435
  init_tools();
57417
57436
  args24 = {
57418
- request: InvoiceFilter$zodSchema.describe(`Filter`)
57437
+ request: GetPreviewInvoiceRequest$zodSchema.describe(`Preview Invoice Request`)
57419
57438
  };
57420
- tool$invoicesQueryInvoice = {
57421
- name: "query-invoice",
57422
- description: `Query invoices
57439
+ tool$invoicesGetMeterUsagePreviewInvoice = {
57440
+ name: "get-meter-usage-preview-invoice",
57441
+ description: `Get invoice preview using meter_usage data
57423
57442
 
57424
- Use when listing or searching invoices (e.g. admin view or customer history). Returns a paginated list; supports filtering by customer, status, date range.`,
57443
+ Preview invoice using the meter_usage table for usage data instead of feature_usage.`,
57425
57444
  scopes: ["write"],
57426
57445
  annotations: {
57427
57446
  title: "",
@@ -57432,7 +57451,7 @@ Use when listing or searching invoices (e.g. admin view or customer history). Re
57432
57451
  },
57433
57452
  args: args24,
57434
57453
  tool: async (client, args25, ctx) => {
57435
- const [result] = await invoicesQueryInvoice(client, args25.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57454
+ const [result] = await invoicesGetMeterUsagePreviewInvoice(client, args25.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57436
57455
  if (!result.ok) {
57437
57456
  return {
57438
57457
  content: [{ type: "text", text: result.error.message }],
@@ -57444,51 +57463,70 @@ Use when listing or searching invoices (e.g. admin view or customer history). Re
57444
57463
  };
57445
57464
  });
57446
57465
 
57447
- // src/models/modelstemporalworkflowresult.ts
57448
- var ModelsTemporalWorkflowResult$zodSchema;
57449
- var init_modelstemporalworkflowresult = __esm(() => {
57450
- init_zod();
57451
- ModelsTemporalWorkflowResult$zodSchema = object({
57452
- message: string2().optional(),
57453
- run_id: string2().optional(),
57454
- workflow_id: string2().optional()
57455
- });
57456
- });
57457
-
57458
- // src/models/recalculateinvoiceop.ts
57459
- var RecalculateInvoiceRequest$zodSchema, RecalculateInvoiceResponse$zodSchema;
57460
- var init_recalculateinvoiceop = __esm(() => {
57466
+ // src/models/invoicefilter.ts
57467
+ var InvoiceFilterOrder$zodSchema, InvoiceFilter$zodSchema;
57468
+ var init_invoicefilter = __esm(() => {
57461
57469
  init_zod();
57462
- init_errorresponse();
57463
- init_modelstemporalworkflowresult();
57464
- RecalculateInvoiceRequest$zodSchema = object({
57465
- id: string2().describe("Invoice ID")
57466
- });
57467
- RecalculateInvoiceResponse$zodSchema = union([
57468
- ModelsTemporalWorkflowResult$zodSchema,
57469
- ErrorResponse$zodSchema
57470
+ init_filtercondition();
57471
+ init_invoicestatus();
57472
+ init_invoicetype();
57473
+ init_paymentstatus();
57474
+ init_sortcondition();
57475
+ init_status();
57476
+ InvoiceFilterOrder$zodSchema = _enum([
57477
+ "asc",
57478
+ "desc"
57470
57479
  ]);
57480
+ InvoiceFilter$zodSchema = object({
57481
+ amount_due_gt: number2().optional().describe(`amount_due_gt filters invoices with a total amount due greater than the specified value
57482
+ Useful for finding invoices above a certain threshold or identifying high-value invoices`),
57483
+ amount_remaining_gt: number2().optional().describe(`amount_remaining_gt filters invoices with an outstanding balance greater than the specified value
57484
+ Useful for finding invoices that still have significant unpaid amounts`),
57485
+ customer_id: string2().optional().describe(`customer_id filters invoices for a specific customer using FlexPrice's internal customer ID
57486
+ This is the ID returned by FlexPrice when creating or retrieving customers`),
57487
+ end_time: exports_iso.datetime({ offset: true }).optional(),
57488
+ expand: string2().optional(),
57489
+ external_customer_id: string2().optional().describe(`external_customer_id filters invoices for a customer using your system's customer identifier
57490
+ This is the ID you provided when creating the customer in FlexPrice`),
57491
+ filters: array(FilterCondition$zodSchema).optional(),
57492
+ invoice_ids: array(string2()).optional().describe(`invoice_ids restricts results to invoices with the specified IDs
57493
+ Use this to retrieve specific invoices when you know their exact identifiers`),
57494
+ invoice_status: array(InvoiceStatus$zodSchema).optional().describe(`invoice_status filters by the current state of invoices in their lifecycle
57495
+ Multiple statuses can be specified to include invoices in any of the listed states`),
57496
+ invoice_type: InvoiceType$zodSchema.optional(),
57497
+ limit: int().optional(),
57498
+ offset: int().optional(),
57499
+ order: InvoiceFilterOrder$zodSchema.optional(),
57500
+ payment_status: array(PaymentStatus$zodSchema).optional().describe(`payment_status filters by the payment state of invoices
57501
+ Multiple statuses can be specified to include invoices with any of the listed payment states`),
57502
+ period_end_gte: string2().optional().describe("period_end_gte filters invoices with period_end >= value"),
57503
+ period_end_lte: string2().optional().describe("period_end_lte filters invoices with period_end <= value"),
57504
+ period_start_gte: string2().optional().describe("period_start_gte filters invoices with period_start >= value"),
57505
+ period_start_lte: string2().optional().describe("period_start_lte filters invoices with period_start <= value"),
57506
+ skip_line_items: boolean2().optional().describe("SkipLineItems if true, will not include line items in the response"),
57507
+ sort: array(SortCondition$zodSchema).optional(),
57508
+ start_time: exports_iso.datetime({ offset: true }).optional(),
57509
+ status: Status$zodSchema.optional(),
57510
+ subscription_customer_id: array(string2()).optional().describe("subscription_customer_id filters invoices by the subscription owner's customer ID"),
57511
+ subscription_id: string2().optional().describe(`subscription_id filters invoices generated for a specific subscription
57512
+ Only returns invoices that were created as part of the specified subscription's billing`)
57513
+ });
57471
57514
  });
57472
57515
 
57473
- // src/funcs/invoicesRecalculateInvoice.ts
57474
- function invoicesRecalculateInvoice(client$, request, options) {
57516
+ // src/funcs/invoicesQueryInvoice.ts
57517
+ function invoicesQueryInvoice(client$, request, options) {
57475
57518
  return new APIPromise($do26(client$, request, options));
57476
57519
  }
57477
57520
  async function $do26(client$, request, options) {
57478
- const parsed$ = safeParse4(request, (value$) => RecalculateInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
57521
+ const parsed$ = safeParse4(request, (value$) => InvoiceFilter$zodSchema.parse(value$), "Input validation failed");
57479
57522
  if (!parsed$.ok) {
57480
57523
  return [parsed$, { status: "invalid" }];
57481
57524
  }
57482
57525
  const payload$ = parsed$.value;
57483
- const body$ = null;
57484
- const pathParams$ = {
57485
- id: encodeSimple("id", payload$.id, {
57486
- explode: false,
57487
- charEncoding: "percent"
57488
- })
57489
- };
57490
- const path$ = pathToFunc("/invoices/{id}/recalculate")(pathParams$);
57526
+ const body$ = encodeJSON("body", payload$, { explode: true });
57527
+ const path$ = pathToFunc("/invoices/search")();
57491
57528
  const headers$ = new Headers(compactMap({
57529
+ "Content-Type": "application/json",
57492
57530
  Accept: "application/json"
57493
57531
  }));
57494
57532
  const securityInput = await extractSecurity(client$._options.security);
@@ -57496,7 +57534,7 @@ async function $do26(client$, request, options) {
57496
57534
  const context = {
57497
57535
  options: client$._options,
57498
57536
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
57499
- operationID: "recalculateInvoice",
57537
+ operationID: "queryInvoice",
57500
57538
  oAuth2Scopes: null,
57501
57539
  resolvedSecurity: requestSecurity,
57502
57540
  securitySource: client$._options.security,
@@ -57538,30 +57576,30 @@ async function $do26(client$, request, options) {
57538
57576
  response: doResult.value
57539
57577
  }];
57540
57578
  }
57541
- var init_invoicesRecalculateInvoice = __esm(() => {
57579
+ var init_invoicesQueryInvoice = __esm(() => {
57542
57580
  init_encodings();
57543
57581
  init_primitives();
57544
57582
  init_schemas4();
57545
57583
  init_security();
57546
57584
  init_url();
57547
- init_recalculateinvoiceop();
57585
+ init_invoicefilter();
57548
57586
  init_async();
57549
57587
  });
57550
57588
 
57551
- // src/mcp-server/tools/invoicesRecalculateInvoice.ts
57552
- var args25, tool$invoicesRecalculateInvoice;
57553
- var init_invoicesRecalculateInvoice2 = __esm(() => {
57554
- init_invoicesRecalculateInvoice();
57555
- init_recalculateinvoiceop();
57589
+ // src/mcp-server/tools/invoicesQueryInvoice.ts
57590
+ var args25, tool$invoicesQueryInvoice;
57591
+ var init_invoicesQueryInvoice2 = __esm(() => {
57592
+ init_invoicesQueryInvoice();
57593
+ init_invoicefilter();
57556
57594
  init_tools();
57557
57595
  args25 = {
57558
- request: RecalculateInvoiceRequest$zodSchema
57596
+ request: InvoiceFilter$zodSchema.describe(`Filter`)
57559
57597
  };
57560
- tool$invoicesRecalculateInvoice = {
57561
- name: "recalculate-invoice",
57562
- description: `Recalculate invoice (voided invoice)
57598
+ tool$invoicesQueryInvoice = {
57599
+ name: "query-invoice",
57600
+ description: `Query invoices
57563
57601
 
57564
- Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.`,
57602
+ Use when listing or searching invoices (e.g. admin view or customer history). Returns a paginated list; supports filtering by customer, status, date range.`,
57565
57603
  scopes: ["write"],
57566
57604
  annotations: {
57567
57605
  title: "",
@@ -57572,7 +57610,7 @@ Starts an async workflow that creates a fresh replacement invoice for a voided S
57572
57610
  },
57573
57611
  args: args25,
57574
57612
  tool: async (client, args26, ctx) => {
57575
- const [result] = await invoicesRecalculateInvoice(client, args26.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57613
+ const [result] = await invoicesQueryInvoice(client, args26.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57576
57614
  if (!result.ok) {
57577
57615
  return {
57578
57616
  content: [{ type: "text", text: result.error.message }],
@@ -57584,28 +57622,38 @@ Starts an async workflow that creates a fresh replacement invoice for a voided S
57584
57622
  };
57585
57623
  });
57586
57624
 
57587
- // src/models/recalculateinvoicev2op.ts
57588
- var RecalculateInvoiceV2Request$zodSchema, RecalculateInvoiceV2Response$zodSchema;
57589
- var init_recalculateinvoicev2op = __esm(() => {
57625
+ // src/models/modelstemporalworkflowresult.ts
57626
+ var ModelsTemporalWorkflowResult$zodSchema;
57627
+ var init_modelstemporalworkflowresult = __esm(() => {
57628
+ init_zod();
57629
+ ModelsTemporalWorkflowResult$zodSchema = object({
57630
+ message: string2().optional(),
57631
+ run_id: string2().optional(),
57632
+ workflow_id: string2().optional()
57633
+ });
57634
+ });
57635
+
57636
+ // src/models/recalculateinvoiceop.ts
57637
+ var RecalculateInvoiceRequest$zodSchema, RecalculateInvoiceResponse$zodSchema;
57638
+ var init_recalculateinvoiceop = __esm(() => {
57590
57639
  init_zod();
57591
57640
  init_errorresponse();
57592
- init_invoiceresponse();
57593
- RecalculateInvoiceV2Request$zodSchema = object({
57594
- finalize: boolean2().describe("Whether to finalize the invoice after recalculation (default: true)").optional(),
57641
+ init_modelstemporalworkflowresult();
57642
+ RecalculateInvoiceRequest$zodSchema = object({
57595
57643
  id: string2().describe("Invoice ID")
57596
57644
  });
57597
- RecalculateInvoiceV2Response$zodSchema = union([
57598
- InvoiceResponse$zodSchema,
57645
+ RecalculateInvoiceResponse$zodSchema = union([
57646
+ ModelsTemporalWorkflowResult$zodSchema,
57599
57647
  ErrorResponse$zodSchema
57600
57648
  ]);
57601
57649
  });
57602
57650
 
57603
- // src/funcs/invoicesRecalculateInvoiceV2.ts
57604
- function invoicesRecalculateInvoiceV2(client$, request, options) {
57651
+ // src/funcs/invoicesRecalculateInvoice.ts
57652
+ function invoicesRecalculateInvoice(client$, request, options) {
57605
57653
  return new APIPromise($do27(client$, request, options));
57606
57654
  }
57607
57655
  async function $do27(client$, request, options) {
57608
- const parsed$ = safeParse4(request, (value$) => RecalculateInvoiceV2Request$zodSchema.parse(value$), "Input validation failed");
57656
+ const parsed$ = safeParse4(request, (value$) => RecalculateInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
57609
57657
  if (!parsed$.ok) {
57610
57658
  return [parsed$, { status: "invalid" }];
57611
57659
  }
@@ -57617,10 +57665,7 @@ async function $do27(client$, request, options) {
57617
57665
  charEncoding: "percent"
57618
57666
  })
57619
57667
  };
57620
- const path$ = pathToFunc("/invoices/{id}/recalculate-v2")(pathParams$);
57621
- const query$ = encodeFormQuery({
57622
- finalize: payload$.finalize
57623
- });
57668
+ const path$ = pathToFunc("/invoices/{id}/recalculate")(pathParams$);
57624
57669
  const headers$ = new Headers(compactMap({
57625
57670
  Accept: "application/json"
57626
57671
  }));
@@ -57629,7 +57674,7 @@ async function $do27(client$, request, options) {
57629
57674
  const context = {
57630
57675
  options: client$._options,
57631
57676
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
57632
- operationID: "recalculateInvoiceV2",
57677
+ operationID: "recalculateInvoice",
57633
57678
  oAuth2Scopes: null,
57634
57679
  resolvedSecurity: requestSecurity,
57635
57680
  securitySource: client$._options.security,
@@ -57648,7 +57693,6 @@ async function $do27(client$, request, options) {
57648
57693
  baseURL: options?.serverURL,
57649
57694
  path: path$,
57650
57695
  headers: headers$,
57651
- query: query$,
57652
57696
  body: body$,
57653
57697
  userAgent: client$._options.userAgent,
57654
57698
  timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
@@ -57672,30 +57716,30 @@ async function $do27(client$, request, options) {
57672
57716
  response: doResult.value
57673
57717
  }];
57674
57718
  }
57675
- var init_invoicesRecalculateInvoiceV2 = __esm(() => {
57719
+ var init_invoicesRecalculateInvoice = __esm(() => {
57676
57720
  init_encodings();
57677
57721
  init_primitives();
57678
57722
  init_schemas4();
57679
57723
  init_security();
57680
57724
  init_url();
57681
- init_recalculateinvoicev2op();
57725
+ init_recalculateinvoiceop();
57682
57726
  init_async();
57683
57727
  });
57684
57728
 
57685
- // src/mcp-server/tools/invoicesRecalculateInvoiceV2.ts
57686
- var args26, tool$invoicesRecalculateInvoiceV2;
57687
- var init_invoicesRecalculateInvoiceV22 = __esm(() => {
57688
- init_invoicesRecalculateInvoiceV2();
57689
- init_recalculateinvoicev2op();
57729
+ // src/mcp-server/tools/invoicesRecalculateInvoice.ts
57730
+ var args26, tool$invoicesRecalculateInvoice;
57731
+ var init_invoicesRecalculateInvoice2 = __esm(() => {
57732
+ init_invoicesRecalculateInvoice();
57733
+ init_recalculateinvoiceop();
57690
57734
  init_tools();
57691
57735
  args26 = {
57692
- request: RecalculateInvoiceV2Request$zodSchema
57736
+ request: RecalculateInvoiceRequest$zodSchema
57693
57737
  };
57694
- tool$invoicesRecalculateInvoiceV2 = {
57695
- name: "recalculate-invoice-v2",
57696
- description: `Recalculate draft invoice (v2)
57738
+ tool$invoicesRecalculateInvoice = {
57739
+ name: "recalculate-invoice",
57740
+ description: `Recalculate invoice (voided invoice)
57697
57741
 
57698
- Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.`,
57742
+ Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.`,
57699
57743
  scopes: ["write"],
57700
57744
  annotations: {
57701
57745
  title: "",
@@ -57706,7 +57750,7 @@ Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reappli
57706
57750
  },
57707
57751
  args: args26,
57708
57752
  tool: async (client, args27, ctx) => {
57709
- const [result] = await invoicesRecalculateInvoiceV2(client, args27.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57753
+ const [result] = await invoicesRecalculateInvoice(client, args27.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57710
57754
  if (!result.ok) {
57711
57755
  return {
57712
57756
  content: [{ type: "text", text: result.error.message }],
@@ -57718,27 +57762,28 @@ Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reappli
57718
57762
  };
57719
57763
  });
57720
57764
 
57721
- // src/models/triggerinvoicecommswebhookop.ts
57722
- var TriggerInvoiceCommsWebhookRequest$zodSchema, TriggerInvoiceCommsWebhookResponse$zodSchema;
57723
- var init_triggerinvoicecommswebhookop = __esm(() => {
57765
+ // src/models/recalculateinvoicev2op.ts
57766
+ var RecalculateInvoiceV2Request$zodSchema, RecalculateInvoiceV2Response$zodSchema;
57767
+ var init_recalculateinvoicev2op = __esm(() => {
57724
57768
  init_zod();
57725
57769
  init_errorresponse();
57726
- init_successresponse();
57727
- TriggerInvoiceCommsWebhookRequest$zodSchema = object({
57770
+ init_invoiceresponse();
57771
+ RecalculateInvoiceV2Request$zodSchema = object({
57772
+ finalize: boolean2().describe("Whether to finalize the invoice after recalculation (default: true)").optional(),
57728
57773
  id: string2().describe("Invoice ID")
57729
57774
  });
57730
- TriggerInvoiceCommsWebhookResponse$zodSchema = union([
57731
- SuccessResponse$zodSchema,
57775
+ RecalculateInvoiceV2Response$zodSchema = union([
57776
+ InvoiceResponse$zodSchema,
57732
57777
  ErrorResponse$zodSchema
57733
57778
  ]);
57734
57779
  });
57735
57780
 
57736
- // src/funcs/invoicesTriggerInvoiceCommsWebhook.ts
57737
- function invoicesTriggerInvoiceCommsWebhook(client$, request, options) {
57781
+ // src/funcs/invoicesRecalculateInvoiceV2.ts
57782
+ function invoicesRecalculateInvoiceV2(client$, request, options) {
57738
57783
  return new APIPromise($do28(client$, request, options));
57739
57784
  }
57740
57785
  async function $do28(client$, request, options) {
57741
- const parsed$ = safeParse4(request, (value$) => TriggerInvoiceCommsWebhookRequest$zodSchema.parse(value$), "Input validation failed");
57786
+ const parsed$ = safeParse4(request, (value$) => RecalculateInvoiceV2Request$zodSchema.parse(value$), "Input validation failed");
57742
57787
  if (!parsed$.ok) {
57743
57788
  return [parsed$, { status: "invalid" }];
57744
57789
  }
@@ -57750,7 +57795,10 @@ async function $do28(client$, request, options) {
57750
57795
  charEncoding: "percent"
57751
57796
  })
57752
57797
  };
57753
- const path$ = pathToFunc("/invoices/{id}/comms/trigger")(pathParams$);
57798
+ const path$ = pathToFunc("/invoices/{id}/recalculate-v2")(pathParams$);
57799
+ const query$ = encodeFormQuery({
57800
+ finalize: payload$.finalize
57801
+ });
57754
57802
  const headers$ = new Headers(compactMap({
57755
57803
  Accept: "application/json"
57756
57804
  }));
@@ -57759,7 +57807,7 @@ async function $do28(client$, request, options) {
57759
57807
  const context = {
57760
57808
  options: client$._options,
57761
57809
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
57762
- operationID: "triggerInvoiceCommsWebhook",
57810
+ operationID: "recalculateInvoiceV2",
57763
57811
  oAuth2Scopes: null,
57764
57812
  resolvedSecurity: requestSecurity,
57765
57813
  securitySource: client$._options.security,
@@ -57778,6 +57826,7 @@ async function $do28(client$, request, options) {
57778
57826
  baseURL: options?.serverURL,
57779
57827
  path: path$,
57780
57828
  headers: headers$,
57829
+ query: query$,
57781
57830
  body: body$,
57782
57831
  userAgent: client$._options.userAgent,
57783
57832
  timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
@@ -57801,30 +57850,30 @@ async function $do28(client$, request, options) {
57801
57850
  response: doResult.value
57802
57851
  }];
57803
57852
  }
57804
- var init_invoicesTriggerInvoiceCommsWebhook = __esm(() => {
57853
+ var init_invoicesRecalculateInvoiceV2 = __esm(() => {
57805
57854
  init_encodings();
57806
57855
  init_primitives();
57807
57856
  init_schemas4();
57808
57857
  init_security();
57809
57858
  init_url();
57810
- init_triggerinvoicecommswebhookop();
57859
+ init_recalculateinvoicev2op();
57811
57860
  init_async();
57812
57861
  });
57813
57862
 
57814
- // src/mcp-server/tools/invoicesTriggerInvoiceCommsWebhook.ts
57815
- var args27, tool$invoicesTriggerInvoiceCommsWebhook;
57816
- var init_invoicesTriggerInvoiceCommsWebhook2 = __esm(() => {
57817
- init_invoicesTriggerInvoiceCommsWebhook();
57818
- init_triggerinvoicecommswebhookop();
57863
+ // src/mcp-server/tools/invoicesRecalculateInvoiceV2.ts
57864
+ var args27, tool$invoicesRecalculateInvoiceV2;
57865
+ var init_invoicesRecalculateInvoiceV22 = __esm(() => {
57866
+ init_invoicesRecalculateInvoiceV2();
57867
+ init_recalculateinvoicev2op();
57819
57868
  init_tools();
57820
57869
  args27 = {
57821
- request: TriggerInvoiceCommsWebhookRequest$zodSchema
57870
+ request: RecalculateInvoiceV2Request$zodSchema
57822
57871
  };
57823
- tool$invoicesTriggerInvoiceCommsWebhook = {
57824
- name: "trigger-invoice-comms-webhook",
57825
- description: `Trigger invoice communication webhook
57872
+ tool$invoicesRecalculateInvoiceV2 = {
57873
+ name: "recalculate-invoice-v2",
57874
+ description: `Recalculate draft invoice (v2)
57826
57875
 
57827
- Use when sending an invoice to the customer (e.g. trigger email or Slack). Payload includes full invoice details for your integration.`,
57876
+ Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.`,
57828
57877
  scopes: ["write"],
57829
57878
  annotations: {
57830
57879
  title: "",
@@ -57835,7 +57884,7 @@ Use when sending an invoice to the customer (e.g. trigger email or Slack). Paylo
57835
57884
  },
57836
57885
  args: args27,
57837
57886
  tool: async (client, args28, ctx) => {
57838
- const [result] = await invoicesTriggerInvoiceCommsWebhook(client, args28.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57887
+ const [result] = await invoicesRecalculateInvoiceV2(client, args28.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57839
57888
  if (!result.ok) {
57840
57889
  return {
57841
57890
  content: [{ type: "text", text: result.error.message }],
@@ -57847,54 +57896,40 @@ Use when sending an invoice to the customer (e.g. trigger email or Slack). Paylo
57847
57896
  };
57848
57897
  });
57849
57898
 
57850
- // src/models/updateinvoicerequest.ts
57851
- var UpdateInvoiceRequest$zodSchema;
57852
- var init_updateinvoicerequest = __esm(() => {
57853
- init_zod();
57854
- UpdateInvoiceRequest$zodSchema = object({
57855
- due_date: exports_iso.datetime({ offset: true }).optional(),
57856
- invoice_pdf_url: string2().optional().describe("invoice_pdf_url is the URL where customers can download the PDF version of this invoice"),
57857
- metadata: record(string2(), string2()).optional()
57858
- });
57859
- });
57860
-
57861
- // src/models/updateinvoiceop.ts
57862
- var UpdateInvoiceRequestRequest$zodSchema, UpdateInvoiceResponse$zodSchema;
57863
- var init_updateinvoiceop = __esm(() => {
57899
+ // src/models/triggerinvoicecommswebhookop.ts
57900
+ var TriggerInvoiceCommsWebhookRequest$zodSchema, TriggerInvoiceCommsWebhookResponse$zodSchema;
57901
+ var init_triggerinvoicecommswebhookop = __esm(() => {
57864
57902
  init_zod();
57865
57903
  init_errorresponse();
57866
- init_invoiceresponse();
57867
- init_updateinvoicerequest();
57868
- UpdateInvoiceRequestRequest$zodSchema = object({
57869
- body: UpdateInvoiceRequest$zodSchema.describe("Invoice Update Request"),
57904
+ init_successresponse();
57905
+ TriggerInvoiceCommsWebhookRequest$zodSchema = object({
57870
57906
  id: string2().describe("Invoice ID")
57871
57907
  });
57872
- UpdateInvoiceResponse$zodSchema = union([
57873
- InvoiceResponse$zodSchema,
57908
+ TriggerInvoiceCommsWebhookResponse$zodSchema = union([
57909
+ SuccessResponse$zodSchema,
57874
57910
  ErrorResponse$zodSchema
57875
57911
  ]);
57876
57912
  });
57877
57913
 
57878
- // src/funcs/invoicesUpdateInvoice.ts
57879
- function invoicesUpdateInvoice(client$, request, options) {
57914
+ // src/funcs/invoicesTriggerInvoiceCommsWebhook.ts
57915
+ function invoicesTriggerInvoiceCommsWebhook(client$, request, options) {
57880
57916
  return new APIPromise($do29(client$, request, options));
57881
57917
  }
57882
57918
  async function $do29(client$, request, options) {
57883
- const parsed$ = safeParse4(request, (value$) => UpdateInvoiceRequestRequest$zodSchema.parse(value$), "Input validation failed");
57919
+ const parsed$ = safeParse4(request, (value$) => TriggerInvoiceCommsWebhookRequest$zodSchema.parse(value$), "Input validation failed");
57884
57920
  if (!parsed$.ok) {
57885
57921
  return [parsed$, { status: "invalid" }];
57886
57922
  }
57887
57923
  const payload$ = parsed$.value;
57888
- const body$ = encodeJSON("body", payload$.body, { explode: true });
57924
+ const body$ = null;
57889
57925
  const pathParams$ = {
57890
57926
  id: encodeSimple("id", payload$.id, {
57891
57927
  explode: false,
57892
57928
  charEncoding: "percent"
57893
57929
  })
57894
57930
  };
57895
- const path$ = pathToFunc("/invoices/{id}")(pathParams$);
57931
+ const path$ = pathToFunc("/invoices/{id}/comms/trigger")(pathParams$);
57896
57932
  const headers$ = new Headers(compactMap({
57897
- "Content-Type": "application/json",
57898
57933
  Accept: "application/json"
57899
57934
  }));
57900
57935
  const securityInput = await extractSecurity(client$._options.security);
@@ -57902,7 +57937,7 @@ async function $do29(client$, request, options) {
57902
57937
  const context = {
57903
57938
  options: client$._options,
57904
57939
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
57905
- operationID: "updateInvoice",
57940
+ operationID: "triggerInvoiceCommsWebhook",
57906
57941
  oAuth2Scopes: null,
57907
57942
  resolvedSecurity: requestSecurity,
57908
57943
  securitySource: client$._options.security,
@@ -57917,7 +57952,7 @@ async function $do29(client$, request, options) {
57917
57952
  };
57918
57953
  const requestRes = client$._createRequest(context, {
57919
57954
  security: requestSecurity,
57920
- method: "PUT",
57955
+ method: "POST",
57921
57956
  baseURL: options?.serverURL,
57922
57957
  path: path$,
57923
57958
  headers: headers$,
@@ -57944,30 +57979,30 @@ async function $do29(client$, request, options) {
57944
57979
  response: doResult.value
57945
57980
  }];
57946
57981
  }
57947
- var init_invoicesUpdateInvoice = __esm(() => {
57982
+ var init_invoicesTriggerInvoiceCommsWebhook = __esm(() => {
57948
57983
  init_encodings();
57949
57984
  init_primitives();
57950
57985
  init_schemas4();
57951
57986
  init_security();
57952
57987
  init_url();
57953
- init_updateinvoiceop();
57988
+ init_triggerinvoicecommswebhookop();
57954
57989
  init_async();
57955
57990
  });
57956
57991
 
57957
- // src/mcp-server/tools/invoicesUpdateInvoice.ts
57958
- var args28, tool$invoicesUpdateInvoice;
57959
- var init_invoicesUpdateInvoice2 = __esm(() => {
57960
- init_invoicesUpdateInvoice();
57961
- init_updateinvoiceop();
57992
+ // src/mcp-server/tools/invoicesTriggerInvoiceCommsWebhook.ts
57993
+ var args28, tool$invoicesTriggerInvoiceCommsWebhook;
57994
+ var init_invoicesTriggerInvoiceCommsWebhook2 = __esm(() => {
57995
+ init_invoicesTriggerInvoiceCommsWebhook();
57996
+ init_triggerinvoicecommswebhookop();
57962
57997
  init_tools();
57963
57998
  args28 = {
57964
- request: UpdateInvoiceRequestRequest$zodSchema
57999
+ request: TriggerInvoiceCommsWebhookRequest$zodSchema
57965
58000
  };
57966
- tool$invoicesUpdateInvoice = {
57967
- name: "update-invoice",
57968
- description: `Update invoice
58001
+ tool$invoicesTriggerInvoiceCommsWebhook = {
58002
+ name: "trigger-invoice-comms-webhook",
58003
+ description: `Trigger invoice communication webhook
57969
58004
 
57970
- Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For paid invoices only safe fields can be updated.`,
58005
+ Use when sending an invoice to the customer (e.g. trigger email or Slack). Payload includes full invoice details for your integration.`,
57971
58006
  scopes: ["write"],
57972
58007
  annotations: {
57973
58008
  title: "",
@@ -57978,7 +58013,7 @@ Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For pa
57978
58013
  },
57979
58014
  args: args28,
57980
58015
  tool: async (client, args29, ctx) => {
57981
- const [result] = await invoicesUpdateInvoice(client, args29.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58016
+ const [result] = await invoicesTriggerInvoiceCommsWebhook(client, args29.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57982
58017
  if (!result.ok) {
57983
58018
  return {
57984
58019
  content: [{ type: "text", text: result.error.message }],
@@ -57990,40 +58025,40 @@ Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For pa
57990
58025
  };
57991
58026
  });
57992
58027
 
57993
- // src/models/updatepaymentstatusrequest.ts
57994
- var UpdatePaymentStatusRequest$zodSchema;
57995
- var init_updatepaymentstatusrequest = __esm(() => {
58028
+ // src/models/updateinvoicerequest.ts
58029
+ var UpdateInvoiceRequest$zodSchema;
58030
+ var init_updateinvoicerequest = __esm(() => {
57996
58031
  init_zod();
57997
- init_paymentstatus();
57998
- UpdatePaymentStatusRequest$zodSchema = object({
57999
- amount: string2().optional().describe("amount is the optional payment amount to record"),
58000
- payment_status: PaymentStatus$zodSchema
58032
+ UpdateInvoiceRequest$zodSchema = object({
58033
+ due_date: exports_iso.datetime({ offset: true }).optional(),
58034
+ invoice_pdf_url: string2().optional().describe("invoice_pdf_url is the URL where customers can download the PDF version of this invoice"),
58035
+ metadata: record(string2(), string2()).optional()
58001
58036
  });
58002
58037
  });
58003
58038
 
58004
- // src/models/updateinvoicepaymentstatusop.ts
58005
- var UpdateInvoicePaymentStatusRequest$zodSchema, UpdateInvoicePaymentStatusResponse$zodSchema;
58006
- var init_updateinvoicepaymentstatusop = __esm(() => {
58039
+ // src/models/updateinvoiceop.ts
58040
+ var UpdateInvoiceRequestRequest$zodSchema, UpdateInvoiceResponse$zodSchema;
58041
+ var init_updateinvoiceop = __esm(() => {
58007
58042
  init_zod();
58008
58043
  init_errorresponse();
58009
58044
  init_invoiceresponse();
58010
- init_updatepaymentstatusrequest();
58011
- UpdateInvoicePaymentStatusRequest$zodSchema = object({
58012
- body: UpdatePaymentStatusRequest$zodSchema.describe("Payment Status Update Request"),
58045
+ init_updateinvoicerequest();
58046
+ UpdateInvoiceRequestRequest$zodSchema = object({
58047
+ body: UpdateInvoiceRequest$zodSchema.describe("Invoice Update Request"),
58013
58048
  id: string2().describe("Invoice ID")
58014
58049
  });
58015
- UpdateInvoicePaymentStatusResponse$zodSchema = union([
58050
+ UpdateInvoiceResponse$zodSchema = union([
58016
58051
  InvoiceResponse$zodSchema,
58017
58052
  ErrorResponse$zodSchema
58018
58053
  ]);
58019
58054
  });
58020
58055
 
58021
- // src/funcs/invoicesUpdateInvoicePaymentStatus.ts
58022
- function invoicesUpdateInvoicePaymentStatus(client$, request, options) {
58056
+ // src/funcs/invoicesUpdateInvoice.ts
58057
+ function invoicesUpdateInvoice(client$, request, options) {
58023
58058
  return new APIPromise($do30(client$, request, options));
58024
58059
  }
58025
58060
  async function $do30(client$, request, options) {
58026
- const parsed$ = safeParse4(request, (value$) => UpdateInvoicePaymentStatusRequest$zodSchema.parse(value$), "Input validation failed");
58061
+ const parsed$ = safeParse4(request, (value$) => UpdateInvoiceRequestRequest$zodSchema.parse(value$), "Input validation failed");
58027
58062
  if (!parsed$.ok) {
58028
58063
  return [parsed$, { status: "invalid" }];
58029
58064
  }
@@ -58035,7 +58070,7 @@ async function $do30(client$, request, options) {
58035
58070
  charEncoding: "percent"
58036
58071
  })
58037
58072
  };
58038
- const path$ = pathToFunc("/invoices/{id}/payment")(pathParams$);
58073
+ const path$ = pathToFunc("/invoices/{id}")(pathParams$);
58039
58074
  const headers$ = new Headers(compactMap({
58040
58075
  "Content-Type": "application/json",
58041
58076
  Accept: "application/json"
@@ -58045,7 +58080,7 @@ async function $do30(client$, request, options) {
58045
58080
  const context = {
58046
58081
  options: client$._options,
58047
58082
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58048
- operationID: "updateInvoicePaymentStatus",
58083
+ operationID: "updateInvoice",
58049
58084
  oAuth2Scopes: null,
58050
58085
  resolvedSecurity: requestSecurity,
58051
58086
  securitySource: client$._options.security,
@@ -58087,30 +58122,30 @@ async function $do30(client$, request, options) {
58087
58122
  response: doResult.value
58088
58123
  }];
58089
58124
  }
58090
- var init_invoicesUpdateInvoicePaymentStatus = __esm(() => {
58125
+ var init_invoicesUpdateInvoice = __esm(() => {
58091
58126
  init_encodings();
58092
58127
  init_primitives();
58093
58128
  init_schemas4();
58094
58129
  init_security();
58095
58130
  init_url();
58096
- init_updateinvoicepaymentstatusop();
58131
+ init_updateinvoiceop();
58097
58132
  init_async();
58098
58133
  });
58099
58134
 
58100
- // src/mcp-server/tools/invoicesUpdateInvoicePaymentStatus.ts
58101
- var args29, tool$invoicesUpdateInvoicePaymentStatus;
58102
- var init_invoicesUpdateInvoicePaymentStatus2 = __esm(() => {
58103
- init_invoicesUpdateInvoicePaymentStatus();
58104
- init_updateinvoicepaymentstatusop();
58135
+ // src/mcp-server/tools/invoicesUpdateInvoice.ts
58136
+ var args29, tool$invoicesUpdateInvoice;
58137
+ var init_invoicesUpdateInvoice2 = __esm(() => {
58138
+ init_invoicesUpdateInvoice();
58139
+ init_updateinvoiceop();
58105
58140
  init_tools();
58106
58141
  args29 = {
58107
- request: UpdateInvoicePaymentStatusRequest$zodSchema
58142
+ request: UpdateInvoiceRequestRequest$zodSchema
58108
58143
  };
58109
- tool$invoicesUpdateInvoicePaymentStatus = {
58110
- name: "update-invoice-payment-status",
58111
- description: `Update invoice payment status
58144
+ tool$invoicesUpdateInvoice = {
58145
+ name: "update-invoice",
58146
+ description: `Update invoice
58112
58147
 
58113
- Use when reconciling payment status from an external gateway or manual entry (e.g. mark paid after bank confirmation).`,
58148
+ Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For paid invoices only safe fields can be updated.`,
58114
58149
  scopes: ["write"],
58115
58150
  annotations: {
58116
58151
  title: "",
@@ -58121,7 +58156,7 @@ Use when reconciling payment status from an external gateway or manual entry (e.
58121
58156
  },
58122
58157
  args: args29,
58123
58158
  tool: async (client, args30, ctx) => {
58124
- const [result] = await invoicesUpdateInvoicePaymentStatus(client, args30.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58159
+ const [result] = await invoicesUpdateInvoice(client, args30.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58125
58160
  if (!result.ok) {
58126
58161
  return {
58127
58162
  content: [{ type: "text", text: result.error.message }],
@@ -58133,40 +58168,54 @@ Use when reconciling payment status from an external gateway or manual entry (e.
58133
58168
  };
58134
58169
  });
58135
58170
 
58136
- // src/models/voidinvoiceop.ts
58137
- var VoidInvoiceRequest$zodSchema, VoidInvoiceResponse$zodSchema;
58138
- var init_voidinvoiceop = __esm(() => {
58171
+ // src/models/updatepaymentstatusrequest.ts
58172
+ var UpdatePaymentStatusRequest$zodSchema;
58173
+ var init_updatepaymentstatusrequest = __esm(() => {
58174
+ init_zod();
58175
+ init_paymentstatus();
58176
+ UpdatePaymentStatusRequest$zodSchema = object({
58177
+ amount: string2().optional().describe("amount is the optional payment amount to record"),
58178
+ payment_status: PaymentStatus$zodSchema
58179
+ });
58180
+ });
58181
+
58182
+ // src/models/updateinvoicepaymentstatusop.ts
58183
+ var UpdateInvoicePaymentStatusRequest$zodSchema, UpdateInvoicePaymentStatusResponse$zodSchema;
58184
+ var init_updateinvoicepaymentstatusop = __esm(() => {
58139
58185
  init_zod();
58140
58186
  init_errorresponse();
58141
- init_successresponse();
58142
- VoidInvoiceRequest$zodSchema = object({
58187
+ init_invoiceresponse();
58188
+ init_updatepaymentstatusrequest();
58189
+ UpdateInvoicePaymentStatusRequest$zodSchema = object({
58190
+ body: UpdatePaymentStatusRequest$zodSchema.describe("Payment Status Update Request"),
58143
58191
  id: string2().describe("Invoice ID")
58144
58192
  });
58145
- VoidInvoiceResponse$zodSchema = union([
58146
- SuccessResponse$zodSchema,
58193
+ UpdateInvoicePaymentStatusResponse$zodSchema = union([
58194
+ InvoiceResponse$zodSchema,
58147
58195
  ErrorResponse$zodSchema
58148
58196
  ]);
58149
58197
  });
58150
58198
 
58151
- // src/funcs/invoicesVoidInvoice.ts
58152
- function invoicesVoidInvoice(client$, request, options) {
58199
+ // src/funcs/invoicesUpdateInvoicePaymentStatus.ts
58200
+ function invoicesUpdateInvoicePaymentStatus(client$, request, options) {
58153
58201
  return new APIPromise($do31(client$, request, options));
58154
58202
  }
58155
58203
  async function $do31(client$, request, options) {
58156
- const parsed$ = safeParse4(request, (value$) => VoidInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
58204
+ const parsed$ = safeParse4(request, (value$) => UpdateInvoicePaymentStatusRequest$zodSchema.parse(value$), "Input validation failed");
58157
58205
  if (!parsed$.ok) {
58158
58206
  return [parsed$, { status: "invalid" }];
58159
58207
  }
58160
58208
  const payload$ = parsed$.value;
58161
- const body$ = null;
58209
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
58162
58210
  const pathParams$ = {
58163
58211
  id: encodeSimple("id", payload$.id, {
58164
58212
  explode: false,
58165
58213
  charEncoding: "percent"
58166
58214
  })
58167
58215
  };
58168
- const path$ = pathToFunc("/invoices/{id}/void")(pathParams$);
58216
+ const path$ = pathToFunc("/invoices/{id}/payment")(pathParams$);
58169
58217
  const headers$ = new Headers(compactMap({
58218
+ "Content-Type": "application/json",
58170
58219
  Accept: "application/json"
58171
58220
  }));
58172
58221
  const securityInput = await extractSecurity(client$._options.security);
@@ -58174,7 +58223,7 @@ async function $do31(client$, request, options) {
58174
58223
  const context = {
58175
58224
  options: client$._options,
58176
58225
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58177
- operationID: "voidInvoice",
58226
+ operationID: "updateInvoicePaymentStatus",
58178
58227
  oAuth2Scopes: null,
58179
58228
  resolvedSecurity: requestSecurity,
58180
58229
  securitySource: client$._options.security,
@@ -58189,7 +58238,7 @@ async function $do31(client$, request, options) {
58189
58238
  };
58190
58239
  const requestRes = client$._createRequest(context, {
58191
58240
  security: requestSecurity,
58192
- method: "POST",
58241
+ method: "PUT",
58193
58242
  baseURL: options?.serverURL,
58194
58243
  path: path$,
58195
58244
  headers: headers$,
@@ -58216,30 +58265,30 @@ async function $do31(client$, request, options) {
58216
58265
  response: doResult.value
58217
58266
  }];
58218
58267
  }
58219
- var init_invoicesVoidInvoice = __esm(() => {
58268
+ var init_invoicesUpdateInvoicePaymentStatus = __esm(() => {
58220
58269
  init_encodings();
58221
58270
  init_primitives();
58222
58271
  init_schemas4();
58223
58272
  init_security();
58224
58273
  init_url();
58225
- init_voidinvoiceop();
58274
+ init_updateinvoicepaymentstatusop();
58226
58275
  init_async();
58227
58276
  });
58228
58277
 
58229
- // src/mcp-server/tools/invoicesVoidInvoice.ts
58230
- var args30, tool$invoicesVoidInvoice;
58231
- var init_invoicesVoidInvoice2 = __esm(() => {
58232
- init_invoicesVoidInvoice();
58233
- init_voidinvoiceop();
58278
+ // src/mcp-server/tools/invoicesUpdateInvoicePaymentStatus.ts
58279
+ var args30, tool$invoicesUpdateInvoicePaymentStatus;
58280
+ var init_invoicesUpdateInvoicePaymentStatus2 = __esm(() => {
58281
+ init_invoicesUpdateInvoicePaymentStatus();
58282
+ init_updateinvoicepaymentstatusop();
58234
58283
  init_tools();
58235
58284
  args30 = {
58236
- request: VoidInvoiceRequest$zodSchema
58285
+ request: UpdateInvoicePaymentStatusRequest$zodSchema
58237
58286
  };
58238
- tool$invoicesVoidInvoice = {
58239
- name: "void-invoice",
58240
- description: `Void invoice
58287
+ tool$invoicesUpdateInvoicePaymentStatus = {
58288
+ name: "update-invoice-payment-status",
58289
+ description: `Update invoice payment status
58241
58290
 
58242
- Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid invoices can be voided.`,
58291
+ Use when reconciling payment status from an external gateway or manual entry (e.g. mark paid after bank confirmation).`,
58243
58292
  scopes: ["write"],
58244
58293
  annotations: {
58245
58294
  title: "",
@@ -58250,7 +58299,7 @@ Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid
58250
58299
  },
58251
58300
  args: args30,
58252
58301
  tool: async (client, args31, ctx) => {
58253
- const [result] = await invoicesVoidInvoice(client, args31.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58302
+ const [result] = await invoicesUpdateInvoicePaymentStatus(client, args31.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58254
58303
  if (!result.ok) {
58255
58304
  return {
58256
58305
  content: [{ type: "text", text: result.error.message }],
@@ -58262,33 +58311,40 @@ Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid
58262
58311
  };
58263
58312
  });
58264
58313
 
58265
- // src/models/createplanrequest.ts
58266
- var CreatePlanRequest$zodSchema;
58267
- var init_createplanrequest = __esm(() => {
58314
+ // src/models/voidinvoiceop.ts
58315
+ var VoidInvoiceRequest$zodSchema, VoidInvoiceResponse$zodSchema;
58316
+ var init_voidinvoiceop = __esm(() => {
58268
58317
  init_zod();
58269
- CreatePlanRequest$zodSchema = object({
58270
- description: string2().optional(),
58271
- display_order: int().optional(),
58272
- lookup_key: string2().optional(),
58273
- metadata: record(string2(), string2()).optional(),
58274
- name: string2()
58318
+ init_errorresponse();
58319
+ init_successresponse();
58320
+ VoidInvoiceRequest$zodSchema = object({
58321
+ id: string2().describe("Invoice ID")
58275
58322
  });
58323
+ VoidInvoiceResponse$zodSchema = union([
58324
+ SuccessResponse$zodSchema,
58325
+ ErrorResponse$zodSchema
58326
+ ]);
58276
58327
  });
58277
58328
 
58278
- // src/funcs/plansCreatePlan.ts
58279
- function plansCreatePlan(client$, request, options) {
58329
+ // src/funcs/invoicesVoidInvoice.ts
58330
+ function invoicesVoidInvoice(client$, request, options) {
58280
58331
  return new APIPromise($do32(client$, request, options));
58281
58332
  }
58282
58333
  async function $do32(client$, request, options) {
58283
- const parsed$ = safeParse4(request, (value$) => CreatePlanRequest$zodSchema.parse(value$), "Input validation failed");
58334
+ const parsed$ = safeParse4(request, (value$) => VoidInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
58284
58335
  if (!parsed$.ok) {
58285
58336
  return [parsed$, { status: "invalid" }];
58286
58337
  }
58287
58338
  const payload$ = parsed$.value;
58288
- const body$ = encodeJSON("body", payload$, { explode: true });
58289
- const path$ = pathToFunc("/plans")();
58339
+ const body$ = null;
58340
+ const pathParams$ = {
58341
+ id: encodeSimple("id", payload$.id, {
58342
+ explode: false,
58343
+ charEncoding: "percent"
58344
+ })
58345
+ };
58346
+ const path$ = pathToFunc("/invoices/{id}/void")(pathParams$);
58290
58347
  const headers$ = new Headers(compactMap({
58291
- "Content-Type": "application/json",
58292
58348
  Accept: "application/json"
58293
58349
  }));
58294
58350
  const securityInput = await extractSecurity(client$._options.security);
@@ -58296,7 +58352,7 @@ async function $do32(client$, request, options) {
58296
58352
  const context = {
58297
58353
  options: client$._options,
58298
58354
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58299
- operationID: "createPlan",
58355
+ operationID: "voidInvoice",
58300
58356
  oAuth2Scopes: null,
58301
58357
  resolvedSecurity: requestSecurity,
58302
58358
  securitySource: client$._options.security,
@@ -58338,30 +58394,30 @@ async function $do32(client$, request, options) {
58338
58394
  response: doResult.value
58339
58395
  }];
58340
58396
  }
58341
- var init_plansCreatePlan = __esm(() => {
58397
+ var init_invoicesVoidInvoice = __esm(() => {
58342
58398
  init_encodings();
58343
58399
  init_primitives();
58344
58400
  init_schemas4();
58345
58401
  init_security();
58346
58402
  init_url();
58347
- init_createplanrequest();
58403
+ init_voidinvoiceop();
58348
58404
  init_async();
58349
58405
  });
58350
58406
 
58351
- // src/mcp-server/tools/plansCreatePlan.ts
58352
- var args31, tool$plansCreatePlan;
58353
- var init_plansCreatePlan2 = __esm(() => {
58354
- init_plansCreatePlan();
58355
- init_createplanrequest();
58407
+ // src/mcp-server/tools/invoicesVoidInvoice.ts
58408
+ var args31, tool$invoicesVoidInvoice;
58409
+ var init_invoicesVoidInvoice2 = __esm(() => {
58410
+ init_invoicesVoidInvoice();
58411
+ init_voidinvoiceop();
58356
58412
  init_tools();
58357
58413
  args31 = {
58358
- request: CreatePlanRequest$zodSchema.describe(`Plan configuration`)
58414
+ request: VoidInvoiceRequest$zodSchema
58359
58415
  };
58360
- tool$plansCreatePlan = {
58361
- name: "create-plan",
58362
- description: `Create plan
58416
+ tool$invoicesVoidInvoice = {
58417
+ name: "void-invoice",
58418
+ description: `Void invoice
58363
58419
 
58364
- Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices and entitlements; customers subscribe to plans.`,
58420
+ Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid invoices can be voided.`,
58365
58421
  scopes: ["write"],
58366
58422
  annotations: {
58367
58423
  title: "",
@@ -58372,7 +58428,7 @@ Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices
58372
58428
  },
58373
58429
  args: args31,
58374
58430
  tool: async (client, args32, ctx) => {
58375
- const [result] = await plansCreatePlan(client, args32.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58431
+ const [result] = await invoicesVoidInvoice(client, args32.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58376
58432
  if (!result.ok) {
58377
58433
  return {
58378
58434
  content: [{ type: "text", text: result.error.message }],
@@ -58384,40 +58440,56 @@ Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices
58384
58440
  };
58385
58441
  });
58386
58442
 
58387
- // src/models/deleteplanop.ts
58388
- var DeletePlanRequest$zodSchema, DeletePlanResponse$zodSchema;
58389
- var init_deleteplanop = __esm(() => {
58443
+ // src/models/cloneplanrequest.ts
58444
+ var ClonePlanRequest$zodSchema;
58445
+ var init_cloneplanrequest = __esm(() => {
58446
+ init_zod();
58447
+ ClonePlanRequest$zodSchema = object({
58448
+ description: string2().optional().describe("Description overrides the source plan's description when provided"),
58449
+ display_order: int().optional().describe("DisplayOrder overrides the source plan's display order when provided"),
58450
+ lookup_key: string2().optional().describe("LookupKey is required and must be unique across published plans"),
58451
+ metadata: record(string2(), string2()).optional(),
58452
+ name: string2().optional().describe("Name is required and must be different from the source plan's name")
58453
+ });
58454
+ });
58455
+
58456
+ // src/models/cloneplanop.ts
58457
+ var ClonePlanRequestRequest$zodSchema, ClonePlanResponse$zodSchema;
58458
+ var init_cloneplanop = __esm(() => {
58390
58459
  init_zod();
58460
+ init_cloneplanrequest();
58391
58461
  init_errorresponse();
58392
- init_successresponse();
58393
- DeletePlanRequest$zodSchema = object({
58394
- id: string2().describe("Plan ID")
58462
+ init_planresponse();
58463
+ ClonePlanRequestRequest$zodSchema = object({
58464
+ body: ClonePlanRequest$zodSchema.describe("Clone configuration"),
58465
+ id: string2().describe("Source Plan ID")
58395
58466
  });
58396
- DeletePlanResponse$zodSchema = union([
58397
- SuccessResponse$zodSchema,
58467
+ ClonePlanResponse$zodSchema = union([
58468
+ PlanResponse$zodSchema,
58398
58469
  ErrorResponse$zodSchema
58399
58470
  ]);
58400
58471
  });
58401
58472
 
58402
- // src/funcs/plansDeletePlan.ts
58403
- function plansDeletePlan(client$, request, options) {
58473
+ // src/funcs/plansClonePlan.ts
58474
+ function plansClonePlan(client$, request, options) {
58404
58475
  return new APIPromise($do33(client$, request, options));
58405
58476
  }
58406
58477
  async function $do33(client$, request, options) {
58407
- const parsed$ = safeParse4(request, (value$) => DeletePlanRequest$zodSchema.parse(value$), "Input validation failed");
58478
+ const parsed$ = safeParse4(request, (value$) => ClonePlanRequestRequest$zodSchema.parse(value$), "Input validation failed");
58408
58479
  if (!parsed$.ok) {
58409
58480
  return [parsed$, { status: "invalid" }];
58410
58481
  }
58411
58482
  const payload$ = parsed$.value;
58412
- const body$ = null;
58483
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
58413
58484
  const pathParams$ = {
58414
58485
  id: encodeSimple("id", payload$.id, {
58415
58486
  explode: false,
58416
58487
  charEncoding: "percent"
58417
58488
  })
58418
58489
  };
58419
- const path$ = pathToFunc("/plans/{id}")(pathParams$);
58490
+ const path$ = pathToFunc("/plans/{id}/clone")(pathParams$);
58420
58491
  const headers$ = new Headers(compactMap({
58492
+ "Content-Type": "application/json",
58421
58493
  Accept: "application/json"
58422
58494
  }));
58423
58495
  const securityInput = await extractSecurity(client$._options.security);
@@ -58425,7 +58497,7 @@ async function $do33(client$, request, options) {
58425
58497
  const context = {
58426
58498
  options: client$._options,
58427
58499
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58428
- operationID: "deletePlan",
58500
+ operationID: "clonePlan",
58429
58501
  oAuth2Scopes: null,
58430
58502
  resolvedSecurity: requestSecurity,
58431
58503
  securitySource: client$._options.security,
@@ -58440,7 +58512,7 @@ async function $do33(client$, request, options) {
58440
58512
  };
58441
58513
  const requestRes = client$._createRequest(context, {
58442
58514
  security: requestSecurity,
58443
- method: "DELETE",
58515
+ method: "POST",
58444
58516
  baseURL: options?.serverURL,
58445
58517
  path: path$,
58446
58518
  headers: headers$,
@@ -58467,41 +58539,41 @@ async function $do33(client$, request, options) {
58467
58539
  response: doResult.value
58468
58540
  }];
58469
58541
  }
58470
- var init_plansDeletePlan = __esm(() => {
58542
+ var init_plansClonePlan = __esm(() => {
58471
58543
  init_encodings();
58472
58544
  init_primitives();
58473
58545
  init_schemas4();
58474
58546
  init_security();
58475
58547
  init_url();
58476
- init_deleteplanop();
58548
+ init_cloneplanop();
58477
58549
  init_async();
58478
58550
  });
58479
58551
 
58480
- // src/mcp-server/tools/plansDeletePlan.ts
58481
- var args32, tool$plansDeletePlan;
58482
- var init_plansDeletePlan2 = __esm(() => {
58483
- init_plansDeletePlan();
58484
- init_deleteplanop();
58552
+ // src/mcp-server/tools/plansClonePlan.ts
58553
+ var args32, tool$plansClonePlan;
58554
+ var init_plansClonePlan2 = __esm(() => {
58555
+ init_plansClonePlan();
58556
+ init_cloneplanop();
58485
58557
  init_tools();
58486
58558
  args32 = {
58487
- request: DeletePlanRequest$zodSchema
58559
+ request: ClonePlanRequestRequest$zodSchema
58488
58560
  };
58489
- tool$plansDeletePlan = {
58490
- name: "delete-plan",
58491
- description: `Delete plan
58561
+ tool$plansClonePlan = {
58562
+ name: "clone-plan",
58563
+ description: `Clone a plan
58492
58564
 
58493
- Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message.`,
58494
- scopes: ["delete"],
58565
+ Clone an existing plan, copying its active prices, published entitlements, and published credit grants`,
58566
+ scopes: ["write"],
58495
58567
  annotations: {
58496
58568
  title: "",
58497
- destructiveHint: true,
58569
+ destructiveHint: false,
58498
58570
  idempotentHint: false,
58499
58571
  openWorldHint: false,
58500
58572
  readOnlyHint: false
58501
58573
  },
58502
58574
  args: args32,
58503
58575
  tool: async (client, args33, ctx) => {
58504
- const [result] = await plansDeletePlan(client, args33.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58576
+ const [result] = await plansClonePlan(client, args33.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58505
58577
  if (!result.ok) {
58506
58578
  return {
58507
58579
  content: [{ type: "text", text: result.error.message }],
@@ -58513,27 +58585,149 @@ Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affec
58513
58585
  };
58514
58586
  });
58515
58587
 
58516
- // src/models/getplanop.ts
58517
- var GetPlanRequest$zodSchema, GetPlanResponse$zodSchema;
58518
- var init_getplanop = __esm(() => {
58588
+ // src/models/createplanrequest.ts
58589
+ var CreatePlanRequest$zodSchema;
58590
+ var init_createplanrequest = __esm(() => {
58591
+ init_zod();
58592
+ CreatePlanRequest$zodSchema = object({
58593
+ description: string2().optional(),
58594
+ display_order: int().optional(),
58595
+ lookup_key: string2().optional(),
58596
+ metadata: record(string2(), string2()).optional(),
58597
+ name: string2()
58598
+ });
58599
+ });
58600
+
58601
+ // src/funcs/plansCreatePlan.ts
58602
+ function plansCreatePlan(client$, request, options) {
58603
+ return new APIPromise($do34(client$, request, options));
58604
+ }
58605
+ async function $do34(client$, request, options) {
58606
+ const parsed$ = safeParse4(request, (value$) => CreatePlanRequest$zodSchema.parse(value$), "Input validation failed");
58607
+ if (!parsed$.ok) {
58608
+ return [parsed$, { status: "invalid" }];
58609
+ }
58610
+ const payload$ = parsed$.value;
58611
+ const body$ = encodeJSON("body", payload$, { explode: true });
58612
+ const path$ = pathToFunc("/plans")();
58613
+ const headers$ = new Headers(compactMap({
58614
+ "Content-Type": "application/json",
58615
+ Accept: "application/json"
58616
+ }));
58617
+ const securityInput = await extractSecurity(client$._options.security);
58618
+ const requestSecurity = resolveGlobalSecurity(securityInput);
58619
+ const context = {
58620
+ options: client$._options,
58621
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
58622
+ operationID: "createPlan",
58623
+ oAuth2Scopes: null,
58624
+ resolvedSecurity: requestSecurity,
58625
+ securitySource: client$._options.security,
58626
+ retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
58627
+ retryCodes: options?.retryCodes || [
58628
+ "429",
58629
+ "500",
58630
+ "502",
58631
+ "503",
58632
+ "504"
58633
+ ]
58634
+ };
58635
+ const requestRes = client$._createRequest(context, {
58636
+ security: requestSecurity,
58637
+ method: "POST",
58638
+ baseURL: options?.serverURL,
58639
+ path: path$,
58640
+ headers: headers$,
58641
+ body: body$,
58642
+ userAgent: client$._options.userAgent,
58643
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
58644
+ }, options);
58645
+ if (!requestRes.ok) {
58646
+ return [requestRes, { status: "invalid" }];
58647
+ }
58648
+ const req$ = requestRes.value;
58649
+ const doResult = await client$._do(req$, {
58650
+ context,
58651
+ errorCodes: [],
58652
+ retryConfig: context.retryConfig,
58653
+ retryCodes: context.retryCodes
58654
+ });
58655
+ if (!doResult.ok) {
58656
+ return [doResult, { status: "request-error", request: req$ }];
58657
+ }
58658
+ return [doResult, {
58659
+ status: "complete",
58660
+ request: req$,
58661
+ response: doResult.value
58662
+ }];
58663
+ }
58664
+ var init_plansCreatePlan = __esm(() => {
58665
+ init_encodings();
58666
+ init_primitives();
58667
+ init_schemas4();
58668
+ init_security();
58669
+ init_url();
58670
+ init_createplanrequest();
58671
+ init_async();
58672
+ });
58673
+
58674
+ // src/mcp-server/tools/plansCreatePlan.ts
58675
+ var args33, tool$plansCreatePlan;
58676
+ var init_plansCreatePlan2 = __esm(() => {
58677
+ init_plansCreatePlan();
58678
+ init_createplanrequest();
58679
+ init_tools();
58680
+ args33 = {
58681
+ request: CreatePlanRequest$zodSchema.describe(`Plan configuration`)
58682
+ };
58683
+ tool$plansCreatePlan = {
58684
+ name: "create-plan",
58685
+ description: `Create plan
58686
+
58687
+ Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices and entitlements; customers subscribe to plans.`,
58688
+ scopes: ["write"],
58689
+ annotations: {
58690
+ title: "",
58691
+ destructiveHint: false,
58692
+ idempotentHint: false,
58693
+ openWorldHint: false,
58694
+ readOnlyHint: false
58695
+ },
58696
+ args: args33,
58697
+ tool: async (client, args34, ctx) => {
58698
+ const [result] = await plansCreatePlan(client, args34.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58699
+ if (!result.ok) {
58700
+ return {
58701
+ content: [{ type: "text", text: result.error.message }],
58702
+ isError: true
58703
+ };
58704
+ }
58705
+ return formatResult(result.value);
58706
+ }
58707
+ };
58708
+ });
58709
+
58710
+ // src/models/deleteplanop.ts
58711
+ var DeletePlanRequest$zodSchema, DeletePlanResponse$zodSchema;
58712
+ var init_deleteplanop = __esm(() => {
58519
58713
  init_zod();
58520
58714
  init_errorresponse();
58521
- init_planresponse();
58522
- GetPlanRequest$zodSchema = object({
58715
+ init_successresponse();
58716
+ DeletePlanRequest$zodSchema = object({
58523
58717
  id: string2().describe("Plan ID")
58524
58718
  });
58525
- GetPlanResponse$zodSchema = union([
58526
- PlanResponse$zodSchema,
58719
+ DeletePlanResponse$zodSchema = union([
58720
+ SuccessResponse$zodSchema,
58527
58721
  ErrorResponse$zodSchema
58528
58722
  ]);
58529
58723
  });
58530
58724
 
58531
- // src/funcs/plansGetPlan.ts
58532
- function plansGetPlan(client$, request, options) {
58533
- return new APIPromise($do34(client$, request, options));
58725
+ // src/funcs/plansDeletePlan.ts
58726
+ function plansDeletePlan(client$, request, options) {
58727
+ return new APIPromise($do35(client$, request, options));
58534
58728
  }
58535
- async function $do34(client$, request, options) {
58536
- const parsed$ = safeParse4(request, (value$) => GetPlanRequest$zodSchema.parse(value$), "Input validation failed");
58729
+ async function $do35(client$, request, options) {
58730
+ const parsed$ = safeParse4(request, (value$) => DeletePlanRequest$zodSchema.parse(value$), "Input validation failed");
58537
58731
  if (!parsed$.ok) {
58538
58732
  return [parsed$, { status: "invalid" }];
58539
58733
  }
@@ -58554,7 +58748,7 @@ async function $do34(client$, request, options) {
58554
58748
  const context = {
58555
58749
  options: client$._options,
58556
58750
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58557
- operationID: "getPlan",
58751
+ operationID: "deletePlan",
58558
58752
  oAuth2Scopes: null,
58559
58753
  resolvedSecurity: requestSecurity,
58560
58754
  securitySource: client$._options.security,
@@ -58569,7 +58763,7 @@ async function $do34(client$, request, options) {
58569
58763
  };
58570
58764
  const requestRes = client$._createRequest(context, {
58571
58765
  security: requestSecurity,
58572
- method: "GET",
58766
+ method: "DELETE",
58573
58767
  baseURL: options?.serverURL,
58574
58768
  path: path$,
58575
58769
  headers: headers$,
@@ -58596,41 +58790,41 @@ async function $do34(client$, request, options) {
58596
58790
  response: doResult.value
58597
58791
  }];
58598
58792
  }
58599
- var init_plansGetPlan = __esm(() => {
58793
+ var init_plansDeletePlan = __esm(() => {
58600
58794
  init_encodings();
58601
58795
  init_primitives();
58602
58796
  init_schemas4();
58603
58797
  init_security();
58604
58798
  init_url();
58605
- init_getplanop();
58799
+ init_deleteplanop();
58606
58800
  init_async();
58607
58801
  });
58608
58802
 
58609
- // src/mcp-server/tools/plansGetPlan.ts
58610
- var args33, tool$plansGetPlan;
58611
- var init_plansGetPlan2 = __esm(() => {
58612
- init_plansGetPlan();
58613
- init_getplanop();
58803
+ // src/mcp-server/tools/plansDeletePlan.ts
58804
+ var args34, tool$plansDeletePlan;
58805
+ var init_plansDeletePlan2 = __esm(() => {
58806
+ init_plansDeletePlan();
58807
+ init_deleteplanop();
58614
58808
  init_tools();
58615
- args33 = {
58616
- request: GetPlanRequest$zodSchema
58809
+ args34 = {
58810
+ request: DeletePlanRequest$zodSchema
58617
58811
  };
58618
- tool$plansGetPlan = {
58619
- name: "get-plan",
58620
- description: `Get plan
58812
+ tool$plansDeletePlan = {
58813
+ name: "delete-plan",
58814
+ description: `Delete plan
58621
58815
 
58622
- Use when you need to load a single plan (e.g. for display or to create a subscription).`,
58623
- scopes: ["read"],
58816
+ Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message.`,
58817
+ scopes: ["delete"],
58624
58818
  annotations: {
58625
58819
  title: "",
58626
- destructiveHint: false,
58820
+ destructiveHint: true,
58627
58821
  idempotentHint: false,
58628
58822
  openWorldHint: false,
58629
- readOnlyHint: true
58823
+ readOnlyHint: false
58630
58824
  },
58631
- args: args33,
58632
- tool: async (client, args34, ctx) => {
58633
- const [result] = await plansGetPlan(client, args34.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58825
+ args: args34,
58826
+ tool: async (client, args35, ctx) => {
58827
+ const [result] = await plansDeletePlan(client, args35.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58634
58828
  if (!result.ok) {
58635
58829
  return {
58636
58830
  content: [{ type: "text", text: result.error.message }],
@@ -58642,56 +58836,40 @@ Use when you need to load a single plan (e.g. for display or to create a subscri
58642
58836
  };
58643
58837
  });
58644
58838
 
58645
- // src/models/cloneplanrequest.ts
58646
- var ClonePlanRequest$zodSchema;
58647
- var init_cloneplanrequest = __esm(() => {
58648
- init_zod();
58649
- ClonePlanRequest$zodSchema = object({
58650
- description: string2().optional().describe("Description overrides the source plan's description when provided"),
58651
- display_order: int().optional().describe("DisplayOrder overrides the source plan's display order when provided"),
58652
- lookup_key: string2().optional().describe("LookupKey is required and must be unique across published plans"),
58653
- metadata: record(string2(), string2()).optional(),
58654
- name: string2().optional().describe("Name is required and must be different from the source plan's name")
58655
- });
58656
- });
58657
-
58658
- // src/models/postplansidcloneop.ts
58659
- var PostPlansIdCloneRequest$zodSchema, PostPlansIdCloneResponse$zodSchema;
58660
- var init_postplansidcloneop = __esm(() => {
58839
+ // src/models/getplanop.ts
58840
+ var GetPlanRequest$zodSchema, GetPlanResponse$zodSchema;
58841
+ var init_getplanop = __esm(() => {
58661
58842
  init_zod();
58662
- init_cloneplanrequest();
58663
58843
  init_errorresponse();
58664
58844
  init_planresponse();
58665
- PostPlansIdCloneRequest$zodSchema = object({
58666
- body: ClonePlanRequest$zodSchema.describe("Clone configuration"),
58667
- id: string2().describe("Source Plan ID")
58845
+ GetPlanRequest$zodSchema = object({
58846
+ id: string2().describe("Plan ID")
58668
58847
  });
58669
- PostPlansIdCloneResponse$zodSchema = union([
58848
+ GetPlanResponse$zodSchema = union([
58670
58849
  PlanResponse$zodSchema,
58671
58850
  ErrorResponse$zodSchema
58672
58851
  ]);
58673
58852
  });
58674
58853
 
58675
- // src/funcs/plansPostPlansIdClone.ts
58676
- function plansPostPlansIdClone(client$, request, options) {
58677
- return new APIPromise($do35(client$, request, options));
58854
+ // src/funcs/plansGetPlan.ts
58855
+ function plansGetPlan(client$, request, options) {
58856
+ return new APIPromise($do36(client$, request, options));
58678
58857
  }
58679
- async function $do35(client$, request, options) {
58680
- const parsed$ = safeParse4(request, (value$) => PostPlansIdCloneRequest$zodSchema.parse(value$), "Input validation failed");
58858
+ async function $do36(client$, request, options) {
58859
+ const parsed$ = safeParse4(request, (value$) => GetPlanRequest$zodSchema.parse(value$), "Input validation failed");
58681
58860
  if (!parsed$.ok) {
58682
58861
  return [parsed$, { status: "invalid" }];
58683
58862
  }
58684
58863
  const payload$ = parsed$.value;
58685
- const body$ = encodeJSON("body", payload$.body, { explode: true });
58864
+ const body$ = null;
58686
58865
  const pathParams$ = {
58687
58866
  id: encodeSimple("id", payload$.id, {
58688
58867
  explode: false,
58689
58868
  charEncoding: "percent"
58690
58869
  })
58691
58870
  };
58692
- const path$ = pathToFunc("/plans/{id}/clone")(pathParams$);
58871
+ const path$ = pathToFunc("/plans/{id}")(pathParams$);
58693
58872
  const headers$ = new Headers(compactMap({
58694
- "Content-Type": "application/json",
58695
58873
  Accept: "application/json"
58696
58874
  }));
58697
58875
  const securityInput = await extractSecurity(client$._options.security);
@@ -58699,7 +58877,7 @@ async function $do35(client$, request, options) {
58699
58877
  const context = {
58700
58878
  options: client$._options,
58701
58879
  baseURL: options?.serverURL ?? client$._baseURL ?? "",
58702
- operationID: "post_/plans/{id}/clone",
58880
+ operationID: "getPlan",
58703
58881
  oAuth2Scopes: null,
58704
58882
  resolvedSecurity: requestSecurity,
58705
58883
  securitySource: client$._options.security,
@@ -58714,7 +58892,7 @@ async function $do35(client$, request, options) {
58714
58892
  };
58715
58893
  const requestRes = client$._createRequest(context, {
58716
58894
  security: requestSecurity,
58717
- method: "POST",
58895
+ method: "GET",
58718
58896
  baseURL: options?.serverURL,
58719
58897
  path: path$,
58720
58898
  headers: headers$,
@@ -58741,41 +58919,41 @@ async function $do35(client$, request, options) {
58741
58919
  response: doResult.value
58742
58920
  }];
58743
58921
  }
58744
- var init_plansPostPlansIdClone = __esm(() => {
58922
+ var init_plansGetPlan = __esm(() => {
58745
58923
  init_encodings();
58746
58924
  init_primitives();
58747
58925
  init_schemas4();
58748
58926
  init_security();
58749
58927
  init_url();
58750
- init_postplansidcloneop();
58928
+ init_getplanop();
58751
58929
  init_async();
58752
58930
  });
58753
58931
 
58754
- // src/mcp-server/tools/plansPostPlansIdClone.ts
58755
- var args34, tool$plansPostPlansIdClone;
58756
- var init_plansPostPlansIdClone2 = __esm(() => {
58757
- init_plansPostPlansIdClone();
58758
- init_postplansidcloneop();
58932
+ // src/mcp-server/tools/plansGetPlan.ts
58933
+ var args35, tool$plansGetPlan;
58934
+ var init_plansGetPlan2 = __esm(() => {
58935
+ init_plansGetPlan();
58936
+ init_getplanop();
58759
58937
  init_tools();
58760
- args34 = {
58761
- request: PostPlansIdCloneRequest$zodSchema
58938
+ args35 = {
58939
+ request: GetPlanRequest$zodSchema
58762
58940
  };
58763
- tool$plansPostPlansIdClone = {
58764
- name: "plans-post-plans-id-clone",
58765
- description: `Clone a plan
58941
+ tool$plansGetPlan = {
58942
+ name: "get-plan",
58943
+ description: `Get plan
58766
58944
 
58767
- Clone an existing plan, copying its active prices, published entitlements, and published credit grants`,
58768
- scopes: ["write"],
58945
+ Use when you need to load a single plan (e.g. for display or to create a subscription).`,
58946
+ scopes: ["read"],
58769
58947
  annotations: {
58770
58948
  title: "",
58771
58949
  destructiveHint: false,
58772
58950
  idempotentHint: false,
58773
58951
  openWorldHint: false,
58774
- readOnlyHint: false
58952
+ readOnlyHint: true
58775
58953
  },
58776
- args: args34,
58777
- tool: async (client, args35, ctx) => {
58778
- const [result] = await plansPostPlansIdClone(client, args35.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58954
+ args: args35,
58955
+ tool: async (client, args36, ctx) => {
58956
+ const [result] = await plansGetPlan(client, args36.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58779
58957
  if (!result.ok) {
58780
58958
  return {
58781
58959
  content: [{ type: "text", text: result.error.message }],
@@ -58815,9 +58993,9 @@ var init_planfilter = __esm(() => {
58815
58993
 
58816
58994
  // src/funcs/plansQueryPlan.ts
58817
58995
  function plansQueryPlan(client$, request, options) {
58818
- return new APIPromise($do36(client$, request, options));
58996
+ return new APIPromise($do37(client$, request, options));
58819
58997
  }
58820
- async function $do36(client$, request, options) {
58998
+ async function $do37(client$, request, options) {
58821
58999
  const parsed$ = safeParse4(request, (value$) => PlanFilter$zodSchema.parse(value$), "Input validation failed");
58822
59000
  if (!parsed$.ok) {
58823
59001
  return [parsed$, { status: "invalid" }];
@@ -58887,12 +59065,12 @@ var init_plansQueryPlan = __esm(() => {
58887
59065
  });
58888
59066
 
58889
59067
  // src/mcp-server/tools/plansQueryPlan.ts
58890
- var args35, tool$plansQueryPlan;
59068
+ var args36, tool$plansQueryPlan;
58891
59069
  var init_plansQueryPlan2 = __esm(() => {
58892
59070
  init_plansQueryPlan();
58893
59071
  init_planfilter();
58894
59072
  init_tools();
58895
- args35 = {
59073
+ args36 = {
58896
59074
  request: PlanFilter$zodSchema.describe(`Filter`)
58897
59075
  };
58898
59076
  tool$plansQueryPlan = {
@@ -58908,9 +59086,9 @@ Use when listing or searching plans (e.g. plan picker or admin catalog). Returns
58908
59086
  openWorldHint: false,
58909
59087
  readOnlyHint: false
58910
59088
  },
58911
- args: args35,
58912
- tool: async (client, args36, ctx) => {
58913
- const [result] = await plansQueryPlan(client, args36.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59089
+ args: args36,
59090
+ tool: async (client, args37, ctx) => {
59091
+ const [result] = await plansQueryPlan(client, args37.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58914
59092
  if (!result.ok) {
58915
59093
  return {
58916
59094
  content: [{ type: "text", text: result.error.message }],
@@ -58939,9 +59117,9 @@ var init_syncplanpricesop = __esm(() => {
58939
59117
 
58940
59118
  // src/funcs/plansSyncPlanPrices.ts
58941
59119
  function plansSyncPlanPrices(client$, request, options) {
58942
- return new APIPromise($do37(client$, request, options));
59120
+ return new APIPromise($do38(client$, request, options));
58943
59121
  }
58944
- async function $do37(client$, request, options) {
59122
+ async function $do38(client$, request, options) {
58945
59123
  const parsed$ = safeParse4(request, (value$) => SyncPlanPricesRequest$zodSchema.parse(value$), "Input validation failed");
58946
59124
  if (!parsed$.ok) {
58947
59125
  return [parsed$, { status: "invalid" }];
@@ -59016,12 +59194,12 @@ var init_plansSyncPlanPrices = __esm(() => {
59016
59194
  });
59017
59195
 
59018
59196
  // src/mcp-server/tools/plansSyncPlanPrices.ts
59019
- var args36, tool$plansSyncPlanPrices;
59197
+ var args37, tool$plansSyncPlanPrices;
59020
59198
  var init_plansSyncPlanPrices2 = __esm(() => {
59021
59199
  init_plansSyncPlanPrices();
59022
59200
  init_syncplanpricesop();
59023
59201
  init_tools();
59024
- args36 = {
59202
+ args37 = {
59025
59203
  request: SyncPlanPricesRequest$zodSchema
59026
59204
  };
59027
59205
  tool$plansSyncPlanPrices = {
@@ -59037,9 +59215,9 @@ Use when you have changed plan prices and need to push them to all active subscr
59037
59215
  openWorldHint: false,
59038
59216
  readOnlyHint: false
59039
59217
  },
59040
- args: args36,
59041
- tool: async (client, args37, ctx) => {
59042
- const [result] = await plansSyncPlanPrices(client, args37.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59218
+ args: args37,
59219
+ tool: async (client, args38, ctx) => {
59220
+ const [result] = await plansSyncPlanPrices(client, args38.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59043
59221
  if (!result.ok) {
59044
59222
  return {
59045
59223
  content: [{ type: "text", text: result.error.message }],
@@ -59083,9 +59261,9 @@ var init_updateplanop = __esm(() => {
59083
59261
 
59084
59262
  // src/funcs/plansUpdatePlan.ts
59085
59263
  function plansUpdatePlan(client$, request, options) {
59086
- return new APIPromise($do38(client$, request, options));
59264
+ return new APIPromise($do39(client$, request, options));
59087
59265
  }
59088
- async function $do38(client$, request, options) {
59266
+ async function $do39(client$, request, options) {
59089
59267
  const parsed$ = safeParse4(request, (value$) => UpdatePlanRequestRequest$zodSchema.parse(value$), "Input validation failed");
59090
59268
  if (!parsed$.ok) {
59091
59269
  return [parsed$, { status: "invalid" }];
@@ -59161,12 +59339,12 @@ var init_plansUpdatePlan = __esm(() => {
59161
59339
  });
59162
59340
 
59163
59341
  // src/mcp-server/tools/plansUpdatePlan.ts
59164
- var args37, tool$plansUpdatePlan;
59342
+ var args38, tool$plansUpdatePlan;
59165
59343
  var init_plansUpdatePlan2 = __esm(() => {
59166
59344
  init_plansUpdatePlan();
59167
59345
  init_updateplanop();
59168
59346
  init_tools();
59169
- args37 = {
59347
+ args38 = {
59170
59348
  request: UpdatePlanRequestRequest$zodSchema
59171
59349
  };
59172
59350
  tool$plansUpdatePlan = {
@@ -59182,9 +59360,9 @@ Use when changing plan details (e.g. name, interval, or metadata). Partial updat
59182
59360
  openWorldHint: false,
59183
59361
  readOnlyHint: false
59184
59362
  },
59185
- args: args37,
59186
- tool: async (client, args38, ctx) => {
59187
- const [result] = await plansUpdatePlan(client, args38.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59363
+ args: args38,
59364
+ tool: async (client, args39, ctx) => {
59365
+ const [result] = await plansUpdatePlan(client, args39.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59188
59366
  if (!result.ok) {
59189
59367
  return {
59190
59368
  content: [{ type: "text", text: result.error.message }],
@@ -59238,7 +59416,6 @@ var init_priceunitconfig = __esm(() => {
59238
59416
  var CreatePriceRequest$zodSchema;
59239
59417
  var init_createpricerequest = __esm(() => {
59240
59418
  init_zod();
59241
- init_billingcadence();
59242
59419
  init_billingmodel();
59243
59420
  init_billingperiod();
59244
59421
  init_billingtier();
@@ -59251,7 +59428,6 @@ var init_createpricerequest = __esm(() => {
59251
59428
  init_priceunittype();
59252
59429
  CreatePriceRequest$zodSchema = object({
59253
59430
  amount: string2().optional(),
59254
- billing_cadence: BillingCadence$zodSchema,
59255
59431
  billing_model: BillingModel$zodSchema,
59256
59432
  billing_period: BillingPeriod$zodSchema,
59257
59433
  billing_period_count: int().optional(),
@@ -59281,9 +59457,9 @@ var init_createpricerequest = __esm(() => {
59281
59457
 
59282
59458
  // src/funcs/pricesCreatePrice.ts
59283
59459
  function pricesCreatePrice(client$, request, options) {
59284
- return new APIPromise($do39(client$, request, options));
59460
+ return new APIPromise($do40(client$, request, options));
59285
59461
  }
59286
- async function $do39(client$, request, options) {
59462
+ async function $do40(client$, request, options) {
59287
59463
  const parsed$ = safeParse4(request, (value$) => CreatePriceRequest$zodSchema.parse(value$), "Input validation failed");
59288
59464
  if (!parsed$.ok) {
59289
59465
  return [parsed$, { status: "invalid" }];
@@ -59353,12 +59529,12 @@ var init_pricesCreatePrice = __esm(() => {
59353
59529
  });
59354
59530
 
59355
59531
  // src/mcp-server/tools/pricesCreatePrice.ts
59356
- var args38, tool$pricesCreatePrice;
59532
+ var args39, tool$pricesCreatePrice;
59357
59533
  var init_pricesCreatePrice2 = __esm(() => {
59358
59534
  init_pricesCreatePrice();
59359
59535
  init_createpricerequest();
59360
59536
  init_tools();
59361
- args38 = {
59537
+ args39 = {
59362
59538
  request: CreatePriceRequest$zodSchema.describe(`Price configuration`)
59363
59539
  };
59364
59540
  tool$pricesCreatePrice = {
@@ -59374,9 +59550,9 @@ Use when adding a new price to a plan or catalog (e.g. per-seat, flat, or metere
59374
59550
  openWorldHint: false,
59375
59551
  readOnlyHint: false
59376
59552
  },
59377
- args: args38,
59378
- tool: async (client, args39, ctx) => {
59379
- const [result] = await pricesCreatePrice(client, args39.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59553
+ args: args39,
59554
+ tool: async (client, args40, ctx) => {
59555
+ const [result] = await pricesCreatePrice(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59380
59556
  if (!result.ok) {
59381
59557
  return {
59382
59558
  content: [{ type: "text", text: result.error.message }],
@@ -59400,9 +59576,9 @@ var init_createbulkpricerequest = __esm(() => {
59400
59576
 
59401
59577
  // src/funcs/pricesCreatePricesBulk.ts
59402
59578
  function pricesCreatePricesBulk(client$, request, options) {
59403
- return new APIPromise($do40(client$, request, options));
59579
+ return new APIPromise($do41(client$, request, options));
59404
59580
  }
59405
- async function $do40(client$, request, options) {
59581
+ async function $do41(client$, request, options) {
59406
59582
  const parsed$ = safeParse4(request, (value$) => CreateBulkPriceRequest$zodSchema.parse(value$), "Input validation failed");
59407
59583
  if (!parsed$.ok) {
59408
59584
  return [parsed$, { status: "invalid" }];
@@ -59472,12 +59648,12 @@ var init_pricesCreatePricesBulk = __esm(() => {
59472
59648
  });
59473
59649
 
59474
59650
  // src/mcp-server/tools/pricesCreatePricesBulk.ts
59475
- var args39, tool$pricesCreatePricesBulk;
59651
+ var args40, tool$pricesCreatePricesBulk;
59476
59652
  var init_pricesCreatePricesBulk2 = __esm(() => {
59477
59653
  init_pricesCreatePricesBulk();
59478
59654
  init_createbulkpricerequest();
59479
59655
  init_tools();
59480
- args39 = {
59656
+ args40 = {
59481
59657
  request: CreateBulkPriceRequest$zodSchema.describe(`Bulk price configuration`)
59482
59658
  };
59483
59659
  tool$pricesCreatePricesBulk = {
@@ -59493,9 +59669,9 @@ Use when creating many prices at once (e.g. importing a catalog or setting up a
59493
59669
  openWorldHint: false,
59494
59670
  readOnlyHint: false
59495
59671
  },
59496
- args: args39,
59497
- tool: async (client, args40, ctx) => {
59498
- const [result] = await pricesCreatePricesBulk(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59672
+ args: args40,
59673
+ tool: async (client, args41, ctx) => {
59674
+ const [result] = await pricesCreatePricesBulk(client, args41.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59499
59675
  if (!result.ok) {
59500
59676
  return {
59501
59677
  content: [{ type: "text", text: result.error.message }],
@@ -59535,9 +59711,9 @@ var init_deletepriceop = __esm(() => {
59535
59711
 
59536
59712
  // src/funcs/pricesDeletePrice.ts
59537
59713
  function pricesDeletePrice(client$, request, options) {
59538
- return new APIPromise($do41(client$, request, options));
59714
+ return new APIPromise($do42(client$, request, options));
59539
59715
  }
59540
- async function $do41(client$, request, options) {
59716
+ async function $do42(client$, request, options) {
59541
59717
  const parsed$ = safeParse4(request, (value$) => DeletePriceRequestRequest$zodSchema.parse(value$), "Input validation failed");
59542
59718
  if (!parsed$.ok) {
59543
59719
  return [parsed$, { status: "invalid" }];
@@ -59613,12 +59789,12 @@ var init_pricesDeletePrice = __esm(() => {
59613
59789
  });
59614
59790
 
59615
59791
  // src/mcp-server/tools/pricesDeletePrice.ts
59616
- var args40, tool$pricesDeletePrice;
59792
+ var args41, tool$pricesDeletePrice;
59617
59793
  var init_pricesDeletePrice2 = __esm(() => {
59618
59794
  init_pricesDeletePrice();
59619
59795
  init_deletepriceop();
59620
59796
  init_tools();
59621
- args40 = {
59797
+ args41 = {
59622
59798
  request: DeletePriceRequestRequest$zodSchema
59623
59799
  };
59624
59800
  tool$pricesDeletePrice = {
@@ -59634,9 +59810,9 @@ Use when retiring a price (e.g. end-of-life or replacement). Optional effective
59634
59810
  openWorldHint: false,
59635
59811
  readOnlyHint: false
59636
59812
  },
59637
- args: args40,
59638
- tool: async (client, args41, ctx) => {
59639
- const [result] = await pricesDeletePrice(client, args41.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59813
+ args: args41,
59814
+ tool: async (client, args42, ctx) => {
59815
+ const [result] = await pricesDeletePrice(client, args42.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59640
59816
  if (!result.ok) {
59641
59817
  return {
59642
59818
  content: [{ type: "text", text: result.error.message }],
@@ -59665,9 +59841,9 @@ var init_getpriceop = __esm(() => {
59665
59841
 
59666
59842
  // src/funcs/pricesGetPrice.ts
59667
59843
  function pricesGetPrice(client$, request, options) {
59668
- return new APIPromise($do42(client$, request, options));
59844
+ return new APIPromise($do43(client$, request, options));
59669
59845
  }
59670
- async function $do42(client$, request, options) {
59846
+ async function $do43(client$, request, options) {
59671
59847
  const parsed$ = safeParse4(request, (value$) => GetPriceRequest$zodSchema.parse(value$), "Input validation failed");
59672
59848
  if (!parsed$.ok) {
59673
59849
  return [parsed$, { status: "invalid" }];
@@ -59742,12 +59918,12 @@ var init_pricesGetPrice = __esm(() => {
59742
59918
  });
59743
59919
 
59744
59920
  // src/mcp-server/tools/pricesGetPrice.ts
59745
- var args41, tool$pricesGetPrice;
59921
+ var args42, tool$pricesGetPrice;
59746
59922
  var init_pricesGetPrice2 = __esm(() => {
59747
59923
  init_pricesGetPrice();
59748
59924
  init_getpriceop();
59749
59925
  init_tools();
59750
- args41 = {
59926
+ args42 = {
59751
59927
  request: GetPriceRequest$zodSchema
59752
59928
  };
59753
59929
  tool$pricesGetPrice = {
@@ -59763,9 +59939,9 @@ Use when you need to load a single price (e.g. for display or editing). Response
59763
59939
  openWorldHint: false,
59764
59940
  readOnlyHint: true
59765
59941
  },
59766
- args: args41,
59767
- tool: async (client, args42, ctx) => {
59768
- const [result] = await pricesGetPrice(client, args42.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59942
+ args: args42,
59943
+ tool: async (client, args43, ctx) => {
59944
+ const [result] = await pricesGetPrice(client, args43.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59769
59945
  if (!result.ok) {
59770
59946
  return {
59771
59947
  content: [{ type: "text", text: result.error.message }],
@@ -59794,9 +59970,9 @@ var init_getpricebylookupkeyop = __esm(() => {
59794
59970
 
59795
59971
  // src/funcs/pricesGetPriceByLookupKey.ts
59796
59972
  function pricesGetPriceByLookupKey(client$, request, options) {
59797
- return new APIPromise($do43(client$, request, options));
59973
+ return new APIPromise($do44(client$, request, options));
59798
59974
  }
59799
- async function $do43(client$, request, options) {
59975
+ async function $do44(client$, request, options) {
59800
59976
  const parsed$ = safeParse4(request, (value$) => GetPriceByLookupKeyRequest$zodSchema.parse(value$), "Input validation failed");
59801
59977
  if (!parsed$.ok) {
59802
59978
  return [parsed$, { status: "invalid" }];
@@ -59871,12 +60047,12 @@ var init_pricesGetPriceByLookupKey = __esm(() => {
59871
60047
  });
59872
60048
 
59873
60049
  // src/mcp-server/tools/pricesGetPriceByLookupKey.ts
59874
- var args42, tool$pricesGetPriceByLookupKey;
60050
+ var args43, tool$pricesGetPriceByLookupKey;
59875
60051
  var init_pricesGetPriceByLookupKey2 = __esm(() => {
59876
60052
  init_pricesGetPriceByLookupKey();
59877
60053
  init_getpricebylookupkeyop();
59878
60054
  init_tools();
59879
- args42 = {
60055
+ args43 = {
59880
60056
  request: GetPriceByLookupKeyRequest$zodSchema
59881
60057
  };
59882
60058
  tool$pricesGetPriceByLookupKey = {
@@ -59892,9 +60068,9 @@ Use when resolving a price by external id (e.g. from your catalog or CMS). Ideal
59892
60068
  openWorldHint: false,
59893
60069
  readOnlyHint: true
59894
60070
  },
59895
- args: args42,
59896
- tool: async (client, args43, ctx) => {
59897
- const [result] = await pricesGetPriceByLookupKey(client, args43.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60071
+ args: args43,
60072
+ tool: async (client, args44, ctx) => {
60073
+ const [result] = await pricesGetPriceByLookupKey(client, args44.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59898
60074
  if (!result.ok) {
59899
60075
  return {
59900
60076
  content: [{ type: "text", text: result.error.message }],
@@ -59941,9 +60117,9 @@ var init_pricefilter = __esm(() => {
59941
60117
 
59942
60118
  // src/funcs/pricesQueryPrice.ts
59943
60119
  function pricesQueryPrice(client$, request, options) {
59944
- return new APIPromise($do44(client$, request, options));
60120
+ return new APIPromise($do45(client$, request, options));
59945
60121
  }
59946
- async function $do44(client$, request, options) {
60122
+ async function $do45(client$, request, options) {
59947
60123
  const parsed$ = safeParse4(request, (value$) => PriceFilter$zodSchema.parse(value$), "Input validation failed");
59948
60124
  if (!parsed$.ok) {
59949
60125
  return [parsed$, { status: "invalid" }];
@@ -60013,12 +60189,12 @@ var init_pricesQueryPrice = __esm(() => {
60013
60189
  });
60014
60190
 
60015
60191
  // src/mcp-server/tools/pricesQueryPrice.ts
60016
- var args43, tool$pricesQueryPrice;
60192
+ var args44, tool$pricesQueryPrice;
60017
60193
  var init_pricesQueryPrice2 = __esm(() => {
60018
60194
  init_pricesQueryPrice();
60019
60195
  init_pricefilter();
60020
60196
  init_tools();
60021
- args43 = {
60197
+ args44 = {
60022
60198
  request: PriceFilter$zodSchema.describe(`Filter`)
60023
60199
  };
60024
60200
  tool$pricesQueryPrice = {
@@ -60034,9 +60210,9 @@ Use when listing or searching prices (e.g. plan builder or catalog). Returns a p
60034
60210
  openWorldHint: false,
60035
60211
  readOnlyHint: false
60036
60212
  },
60037
- args: args43,
60038
- tool: async (client, args44, ctx) => {
60039
- const [result] = await pricesQueryPrice(client, args44.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60213
+ args: args44,
60214
+ tool: async (client, args45, ctx) => {
60215
+ const [result] = await pricesQueryPrice(client, args45.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60040
60216
  if (!result.ok) {
60041
60217
  return {
60042
60218
  content: [{ type: "text", text: result.error.message }],
@@ -60096,9 +60272,9 @@ var init_updatepriceop = __esm(() => {
60096
60272
 
60097
60273
  // src/funcs/pricesUpdatePrice.ts
60098
60274
  function pricesUpdatePrice(client$, request, options) {
60099
- return new APIPromise($do45(client$, request, options));
60275
+ return new APIPromise($do46(client$, request, options));
60100
60276
  }
60101
- async function $do45(client$, request, options) {
60277
+ async function $do46(client$, request, options) {
60102
60278
  const parsed$ = safeParse4(request, (value$) => UpdatePriceRequestRequest$zodSchema.parse(value$), "Input validation failed");
60103
60279
  if (!parsed$.ok) {
60104
60280
  return [parsed$, { status: "invalid" }];
@@ -60174,12 +60350,12 @@ var init_pricesUpdatePrice = __esm(() => {
60174
60350
  });
60175
60351
 
60176
60352
  // src/mcp-server/tools/pricesUpdatePrice.ts
60177
- var args44, tool$pricesUpdatePrice;
60353
+ var args45, tool$pricesUpdatePrice;
60178
60354
  var init_pricesUpdatePrice2 = __esm(() => {
60179
60355
  init_pricesUpdatePrice();
60180
60356
  init_updatepriceop();
60181
60357
  init_tools();
60182
- args44 = {
60358
+ args45 = {
60183
60359
  request: UpdatePriceRequestRequest$zodSchema
60184
60360
  };
60185
60361
  tool$pricesUpdatePrice = {
@@ -60195,9 +60371,9 @@ Use when changing price configuration (e.g. amount, billing scheme, or metadata)
60195
60371
  openWorldHint: false,
60196
60372
  readOnlyHint: false
60197
60373
  },
60198
- args: args44,
60199
- tool: async (client, args45, ctx) => {
60200
- const [result] = await pricesUpdatePrice(client, args45.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60374
+ args: args45,
60375
+ tool: async (client, args46, ctx) => {
60376
+ const [result] = await pricesUpdatePrice(client, args46.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60201
60377
  if (!result.ok) {
60202
60378
  return {
60203
60379
  content: [{ type: "text", text: result.error.message }],
@@ -60237,9 +60413,9 @@ var init_activatesubscriptionop = __esm(() => {
60237
60413
 
60238
60414
  // src/funcs/subscriptionsActivateSubscription.ts
60239
60415
  function subscriptionsActivateSubscription(client$, request, options) {
60240
- return new APIPromise($do46(client$, request, options));
60416
+ return new APIPromise($do47(client$, request, options));
60241
60417
  }
60242
- async function $do46(client$, request, options) {
60418
+ async function $do47(client$, request, options) {
60243
60419
  const parsed$ = safeParse4(request, (value$) => ActivateSubscriptionRequest$zodSchema.parse(value$), "Input validation failed");
60244
60420
  if (!parsed$.ok) {
60245
60421
  return [parsed$, { status: "invalid" }];
@@ -60315,12 +60491,12 @@ var init_subscriptionsActivateSubscription = __esm(() => {
60315
60491
  });
60316
60492
 
60317
60493
  // src/mcp-server/tools/subscriptionsActivateSubscription.ts
60318
- var args45, tool$subscriptionsActivateSubscription;
60494
+ var args46, tool$subscriptionsActivateSubscription;
60319
60495
  var init_subscriptionsActivateSubscription2 = __esm(() => {
60320
60496
  init_subscriptionsActivateSubscription();
60321
60497
  init_activatesubscriptionop();
60322
60498
  init_tools();
60323
- args45 = {
60499
+ args46 = {
60324
60500
  request: ActivateSubscriptionRequest$zodSchema
60325
60501
  };
60326
60502
  tool$subscriptionsActivateSubscription = {
@@ -60336,9 +60512,9 @@ Use when turning a draft subscription live (e.g. after collecting payment or com
60336
60512
  openWorldHint: false,
60337
60513
  readOnlyHint: false
60338
60514
  },
60339
- args: args45,
60340
- tool: async (client, args46, ctx) => {
60341
- const [result] = await subscriptionsActivateSubscription(client, args46.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60515
+ args: args46,
60516
+ tool: async (client, args47, ctx) => {
60517
+ const [result] = await subscriptionsActivateSubscription(client, args47.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60342
60518
  if (!result.ok) {
60343
60519
  return {
60344
60520
  content: [{ type: "text", text: result.error.message }],
@@ -60383,9 +60559,9 @@ var init_addaddonrequest = __esm(() => {
60383
60559
 
60384
60560
  // src/funcs/subscriptionsAddSubscriptionAddon.ts
60385
60561
  function subscriptionsAddSubscriptionAddon(client$, request, options) {
60386
- return new APIPromise($do47(client$, request, options));
60562
+ return new APIPromise($do48(client$, request, options));
60387
60563
  }
60388
- async function $do47(client$, request, options) {
60564
+ async function $do48(client$, request, options) {
60389
60565
  const parsed$ = safeParse4(request, (value$) => AddAddonRequest$zodSchema.parse(value$), "Input validation failed");
60390
60566
  if (!parsed$.ok) {
60391
60567
  return [parsed$, { status: "invalid" }];
@@ -60455,12 +60631,12 @@ var init_subscriptionsAddSubscriptionAddon = __esm(() => {
60455
60631
  });
60456
60632
 
60457
60633
  // src/mcp-server/tools/subscriptionsAddSubscriptionAddon.ts
60458
- var args46, tool$subscriptionsAddSubscriptionAddon;
60634
+ var args47, tool$subscriptionsAddSubscriptionAddon;
60459
60635
  var init_subscriptionsAddSubscriptionAddon2 = __esm(() => {
60460
60636
  init_subscriptionsAddSubscriptionAddon();
60461
60637
  init_addaddonrequest();
60462
60638
  init_tools();
60463
- args46 = {
60639
+ args47 = {
60464
60640
  request: AddAddonRequest$zodSchema.describe(`Add Addon Request`)
60465
60641
  };
60466
60642
  tool$subscriptionsAddSubscriptionAddon = {
@@ -60476,9 +60652,9 @@ Use when adding an optional product or add-on to an existing subscription (e.g.
60476
60652
  openWorldHint: false,
60477
60653
  readOnlyHint: false
60478
60654
  },
60479
- args: args46,
60480
- tool: async (client, args47, ctx) => {
60481
- const [result] = await subscriptionsAddSubscriptionAddon(client, args47.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60655
+ args: args47,
60656
+ tool: async (client, args48, ctx) => {
60657
+ const [result] = await subscriptionsAddSubscriptionAddon(client, args48.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60482
60658
  if (!result.ok) {
60483
60659
  return {
60484
60660
  content: [{ type: "text", text: result.error.message }],
@@ -60584,9 +60760,9 @@ var init_cancelsubscriptionop = __esm(() => {
60584
60760
 
60585
60761
  // src/funcs/subscriptionsCancelSubscription.ts
60586
60762
  function subscriptionsCancelSubscription(client$, request, options) {
60587
- return new APIPromise($do48(client$, request, options));
60763
+ return new APIPromise($do49(client$, request, options));
60588
60764
  }
60589
- async function $do48(client$, request, options) {
60765
+ async function $do49(client$, request, options) {
60590
60766
  const parsed$ = safeParse4(request, (value$) => CancelSubscriptionRequestRequest$zodSchema.parse(value$), "Input validation failed");
60591
60767
  if (!parsed$.ok) {
60592
60768
  return [parsed$, { status: "invalid" }];
@@ -60662,12 +60838,12 @@ var init_subscriptionsCancelSubscription = __esm(() => {
60662
60838
  });
60663
60839
 
60664
60840
  // src/mcp-server/tools/subscriptionsCancelSubscription.ts
60665
- var args47, tool$subscriptionsCancelSubscription;
60841
+ var args48, tool$subscriptionsCancelSubscription;
60666
60842
  var init_subscriptionsCancelSubscription2 = __esm(() => {
60667
60843
  init_subscriptionsCancelSubscription();
60668
60844
  init_cancelsubscriptionop();
60669
60845
  init_tools();
60670
- args47 = {
60846
+ args48 = {
60671
60847
  request: CancelSubscriptionRequestRequest$zodSchema
60672
60848
  };
60673
60849
  tool$subscriptionsCancelSubscription = {
@@ -60683,9 +60859,9 @@ Use when a customer churns or downgrades. Supports immediate or end-of-period ca
60683
60859
  openWorldHint: false,
60684
60860
  readOnlyHint: false
60685
60861
  },
60686
- args: args47,
60687
- tool: async (client, args48, ctx) => {
60688
- const [result] = await subscriptionsCancelSubscription(client, args48.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60862
+ args: args48,
60863
+ tool: async (client, args49, ctx) => {
60864
+ const [result] = await subscriptionsCancelSubscription(client, args49.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60689
60865
  if (!result.ok) {
60690
60866
  return {
60691
60867
  content: [{ type: "text", text: result.error.message }],
@@ -60732,9 +60908,9 @@ var init_cancelsubscriptionscheduleop = __esm(() => {
60732
60908
 
60733
60909
  // src/funcs/subscriptionsCancelSubscriptionSchedule.ts
60734
60910
  function subscriptionsCancelSubscriptionSchedule(client$, request, options) {
60735
- return new APIPromise($do49(client$, request, options));
60911
+ return new APIPromise($do50(client$, request, options));
60736
60912
  }
60737
- async function $do49(client$, request, options) {
60913
+ async function $do50(client$, request, options) {
60738
60914
  const parsed$ = safeParse4(request, (value$) => CancelSubscriptionScheduleRequest$zodSchema.parse(value$), "Input validation failed");
60739
60915
  if (!parsed$.ok) {
60740
60916
  return [parsed$, { status: "invalid" }];
@@ -60810,12 +60986,12 @@ var init_subscriptionsCancelSubscriptionSchedule = __esm(() => {
60810
60986
  });
60811
60987
 
60812
60988
  // src/mcp-server/tools/subscriptionsCancelSubscriptionSchedule.ts
60813
- var args48, tool$subscriptionsCancelSubscriptionSchedule;
60989
+ var args49, tool$subscriptionsCancelSubscriptionSchedule;
60814
60990
  var init_subscriptionsCancelSubscriptionSchedule2 = __esm(() => {
60815
60991
  init_subscriptionsCancelSubscriptionSchedule();
60816
60992
  init_cancelsubscriptionscheduleop();
60817
60993
  init_tools();
60818
- args48 = {
60994
+ args49 = {
60819
60995
  request: CancelSubscriptionScheduleRequest$zodSchema
60820
60996
  };
60821
60997
  tool$subscriptionsCancelSubscriptionSchedule = {
@@ -60831,9 +61007,9 @@ Use when cancelling a scheduled change (e.g. customer changed mind). Identify by
60831
61007
  openWorldHint: false,
60832
61008
  readOnlyHint: false
60833
61009
  },
60834
- args: args48,
60835
- tool: async (client, args49, ctx) => {
60836
- const [result] = await subscriptionsCancelSubscriptionSchedule(client, args49.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61010
+ args: args49,
61011
+ tool: async (client, args50, ctx) => {
61012
+ const [result] = await subscriptionsCancelSubscriptionSchedule(client, args50.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
60837
61013
  if (!result.ok) {
60838
61014
  return {
60839
61015
  content: [{ type: "text", text: result.error.message }],
@@ -60908,7 +61084,6 @@ ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits`)
60908
61084
  var SubscriptionPriceCreateRequest$zodSchema;
60909
61085
  var init_subscriptionpricecreaterequest = __esm(() => {
60910
61086
  init_zod();
60911
- init_billingcadence();
60912
61087
  init_billingmodel();
60913
61088
  init_billingperiod();
60914
61089
  init_billingtier();
@@ -60920,7 +61095,6 @@ var init_subscriptionpricecreaterequest = __esm(() => {
60920
61095
  init_priceunittype();
60921
61096
  SubscriptionPriceCreateRequest$zodSchema = object({
60922
61097
  amount: string2().optional(),
60923
- billing_cadence: BillingCadence$zodSchema,
60924
61098
  billing_model: BillingModel$zodSchema,
60925
61099
  billing_period: BillingPeriod$zodSchema,
60926
61100
  billing_period_count: int().optional(),
@@ -61031,11 +61205,14 @@ var init_subscriptioninheritanceconfig = __esm(() => {
61031
61205
  var SubscriptionPhaseCreateRequest$zodSchema;
61032
61206
  var init_subscriptionphasecreaterequest = __esm(() => {
61033
61207
  init_zod();
61208
+ init_createsubscriptionlineitemrequest();
61034
61209
  init_overridelineitemrequest();
61035
61210
  SubscriptionPhaseCreateRequest$zodSchema = object({
61036
61211
  coupons: array(string2()).optional().describe("Coupons represents subscription-level coupons to be applied to this phase"),
61037
61212
  end_date: exports_iso.datetime({ offset: true }).optional(),
61038
61213
  line_item_coupons: record(string2(), array(string2())).optional().describe("LineItemCoupons represents line item-level coupons (map of line_item_id to coupon IDs)"),
61214
+ line_items: array(CreateSubscriptionLineItemRequest$zodSchema).optional().describe(`LineItems are extra line items to add during this phase, primarily one-time charges.
61215
+ Each item's start_date defaults to the phase's start_date when not provided.`),
61039
61216
  metadata: record(string2(), string2()).optional(),
61040
61217
  override_line_items: array(OverrideLineItemRequest$zodSchema).optional().describe(`OverrideLineItems allows customizing specific prices for this phase
61041
61218
  If not provided, phase will use the same line items as the subscription (plan prices)`),
@@ -61048,7 +61225,6 @@ var CreateSubscriptionRequest$zodSchema;
61048
61225
  var init_createsubscriptionrequest = __esm(() => {
61049
61226
  init_zod();
61050
61227
  init_addaddontosubscriptionrequest();
61051
- init_billingcadence();
61052
61228
  init_billingcycle();
61053
61229
  init_billingperiod();
61054
61230
  init_collectionmethod();
@@ -61066,7 +61242,10 @@ var init_createsubscriptionrequest = __esm(() => {
61066
61242
  init_taxrateoverride();
61067
61243
  CreateSubscriptionRequest$zodSchema = object({
61068
61244
  addons: array(AddAddonToSubscriptionRequest$zodSchema).optional().describe("Addons represents addons to be added to the subscription during creation"),
61069
- billing_cadence: BillingCadence$zodSchema,
61245
+ billing_anchor: exports_iso.datetime({ offset: true }).optional().describe(`BillingAnchor overrides the derived billing anchor when billing_cycle is anniversary.
61246
+ For monthly billing, the day-of-month (and time-of-day) define cycle boundaries: if start_date
61247
+ is before that day in the month, the first billing period ends on the next occurrence of that
61248
+ day in the same month (a shorter first period); subsequent periods follow the usual interval.`),
61070
61249
  billing_cycle: BillingCycle$zodSchema.optional(),
61071
61250
  billing_period: BillingPeriod$zodSchema,
61072
61251
  billing_period_count: int().optional(),
@@ -61109,9 +61288,9 @@ and must be same as what you provided as external_id while creating the customer
61109
61288
 
61110
61289
  // src/funcs/subscriptionsCreateSubscription.ts
61111
61290
  function subscriptionsCreateSubscription(client$, request, options) {
61112
- return new APIPromise($do50(client$, request, options));
61291
+ return new APIPromise($do51(client$, request, options));
61113
61292
  }
61114
- async function $do50(client$, request, options) {
61293
+ async function $do51(client$, request, options) {
61115
61294
  const parsed$ = safeParse4(request, (value$) => CreateSubscriptionRequest$zodSchema.parse(value$), "Input validation failed");
61116
61295
  if (!parsed$.ok) {
61117
61296
  return [parsed$, { status: "invalid" }];
@@ -61181,12 +61360,12 @@ var init_subscriptionsCreateSubscription = __esm(() => {
61181
61360
  });
61182
61361
 
61183
61362
  // src/mcp-server/tools/subscriptionsCreateSubscription.ts
61184
- var args49, tool$subscriptionsCreateSubscription;
61363
+ var args50, tool$subscriptionsCreateSubscription;
61185
61364
  var init_subscriptionsCreateSubscription2 = __esm(() => {
61186
61365
  init_subscriptionsCreateSubscription();
61187
61366
  init_createsubscriptionrequest();
61188
61367
  init_tools();
61189
- args49 = {
61368
+ args50 = {
61190
61369
  request: CreateSubscriptionRequest$zodSchema.describe(`Subscription Request`)
61191
61370
  };
61192
61371
  tool$subscriptionsCreateSubscription = {
@@ -61202,9 +61381,9 @@ Use when onboarding a customer to a plan or starting a new subscription. Ideal f
61202
61381
  openWorldHint: false,
61203
61382
  readOnlyHint: false
61204
61383
  },
61205
- args: args49,
61206
- tool: async (client, args50, ctx) => {
61207
- const [result] = await subscriptionsCreateSubscription(client, args50.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61384
+ args: args50,
61385
+ tool: async (client, args51, ctx) => {
61386
+ const [result] = await subscriptionsCreateSubscription(client, args51.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61208
61387
  if (!result.ok) {
61209
61388
  return {
61210
61389
  content: [{ type: "text", text: result.error.message }],
@@ -61288,9 +61467,9 @@ var init_createsubscriptionlineitemop = __esm(() => {
61288
61467
 
61289
61468
  // src/funcs/subscriptionsCreateSubscriptionLineItem.ts
61290
61469
  function subscriptionsCreateSubscriptionLineItem(client$, request, options) {
61291
- return new APIPromise($do51(client$, request, options));
61470
+ return new APIPromise($do52(client$, request, options));
61292
61471
  }
61293
- async function $do51(client$, request, options) {
61472
+ async function $do52(client$, request, options) {
61294
61473
  const parsed$ = safeParse4(request, (value$) => CreateSubscriptionLineItemRequestRequest$zodSchema.parse(value$), "Input validation failed");
61295
61474
  if (!parsed$.ok) {
61296
61475
  return [parsed$, { status: "invalid" }];
@@ -61366,12 +61545,12 @@ var init_subscriptionsCreateSubscriptionLineItem = __esm(() => {
61366
61545
  });
61367
61546
 
61368
61547
  // src/mcp-server/tools/subscriptionsCreateSubscriptionLineItem.ts
61369
- var args50, tool$subscriptionsCreateSubscriptionLineItem;
61548
+ var args51, tool$subscriptionsCreateSubscriptionLineItem;
61370
61549
  var init_subscriptionsCreateSubscriptionLineItem2 = __esm(() => {
61371
61550
  init_subscriptionsCreateSubscriptionLineItem();
61372
61551
  init_createsubscriptionlineitemop();
61373
61552
  init_tools();
61374
- args50 = {
61553
+ args51 = {
61375
61554
  request: CreateSubscriptionLineItemRequestRequest$zodSchema
61376
61555
  };
61377
61556
  tool$subscriptionsCreateSubscriptionLineItem = {
@@ -61387,9 +61566,9 @@ Use when adding a new charge or seat to a subscription (e.g. extra seat or one-t
61387
61566
  openWorldHint: false,
61388
61567
  readOnlyHint: false
61389
61568
  },
61390
- args: args50,
61391
- tool: async (client, args51, ctx) => {
61392
- const [result] = await subscriptionsCreateSubscriptionLineItem(client, args51.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61569
+ args: args51,
61570
+ tool: async (client, args52, ctx) => {
61571
+ const [result] = await subscriptionsCreateSubscriptionLineItem(client, args52.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61393
61572
  if (!result.ok) {
61394
61573
  return {
61395
61574
  content: [{ type: "text", text: result.error.message }],
@@ -61429,9 +61608,9 @@ var init_deletesubscriptionlineitemop = __esm(() => {
61429
61608
 
61430
61609
  // src/funcs/subscriptionsDeleteSubscriptionLineItem.ts
61431
61610
  function subscriptionsDeleteSubscriptionLineItem(client$, request, options) {
61432
- return new APIPromise($do52(client$, request, options));
61611
+ return new APIPromise($do53(client$, request, options));
61433
61612
  }
61434
- async function $do52(client$, request, options) {
61613
+ async function $do53(client$, request, options) {
61435
61614
  const parsed$ = safeParse4(request, (value$) => DeleteSubscriptionLineItemRequestRequest$zodSchema.parse(value$), "Input validation failed");
61436
61615
  if (!parsed$.ok) {
61437
61616
  return [parsed$, { status: "invalid" }];
@@ -61507,12 +61686,12 @@ var init_subscriptionsDeleteSubscriptionLineItem = __esm(() => {
61507
61686
  });
61508
61687
 
61509
61688
  // src/mcp-server/tools/subscriptionsDeleteSubscriptionLineItem.ts
61510
- var args51, tool$subscriptionsDeleteSubscriptionLineItem;
61689
+ var args52, tool$subscriptionsDeleteSubscriptionLineItem;
61511
61690
  var init_subscriptionsDeleteSubscriptionLineItem2 = __esm(() => {
61512
61691
  init_subscriptionsDeleteSubscriptionLineItem();
61513
61692
  init_deletesubscriptionlineitemop();
61514
61693
  init_tools();
61515
- args51 = {
61694
+ args52 = {
61516
61695
  request: DeleteSubscriptionLineItemRequestRequest$zodSchema
61517
61696
  };
61518
61697
  tool$subscriptionsDeleteSubscriptionLineItem = {
@@ -61528,9 +61707,9 @@ Use when removing a charge or seat from a subscription (e.g. downgrade). Line it
61528
61707
  openWorldHint: false,
61529
61708
  readOnlyHint: false
61530
61709
  },
61531
- args: args51,
61532
- tool: async (client, args52, ctx) => {
61533
- const [result] = await subscriptionsDeleteSubscriptionLineItem(client, args52.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61710
+ args: args52,
61711
+ tool: async (client, args53, ctx) => {
61712
+ const [result] = await subscriptionsDeleteSubscriptionLineItem(client, args53.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61534
61713
  if (!result.ok) {
61535
61714
  return {
61536
61715
  content: [{ type: "text", text: result.error.message }],
@@ -61663,9 +61842,9 @@ var init_executesubscriptionchangeop = __esm(() => {
61663
61842
 
61664
61843
  // src/funcs/subscriptionsExecuteSubscriptionChange.ts
61665
61844
  function subscriptionsExecuteSubscriptionChange(client$, request, options) {
61666
- return new APIPromise($do53(client$, request, options));
61845
+ return new APIPromise($do54(client$, request, options));
61667
61846
  }
61668
- async function $do53(client$, request, options) {
61847
+ async function $do54(client$, request, options) {
61669
61848
  const parsed$ = safeParse4(request, (value$) => ExecuteSubscriptionChangeRequest$zodSchema.parse(value$), "Input validation failed");
61670
61849
  if (!parsed$.ok) {
61671
61850
  return [parsed$, { status: "invalid" }];
@@ -61741,12 +61920,12 @@ var init_subscriptionsExecuteSubscriptionChange = __esm(() => {
61741
61920
  });
61742
61921
 
61743
61922
  // src/mcp-server/tools/subscriptionsExecuteSubscriptionChange.ts
61744
- var args52, tool$subscriptionsExecuteSubscriptionChange;
61923
+ var args53, tool$subscriptionsExecuteSubscriptionChange;
61745
61924
  var init_subscriptionsExecuteSubscriptionChange2 = __esm(() => {
61746
61925
  init_subscriptionsExecuteSubscriptionChange();
61747
61926
  init_executesubscriptionchangeop();
61748
61927
  init_tools();
61749
- args52 = {
61928
+ args53 = {
61750
61929
  request: ExecuteSubscriptionChangeRequest$zodSchema
61751
61930
  };
61752
61931
  tool$subscriptionsExecuteSubscriptionChange = {
@@ -61762,9 +61941,9 @@ Use when applying a plan change (e.g. upgrade or downgrade). Executes proration
61762
61941
  openWorldHint: false,
61763
61942
  readOnlyHint: false
61764
61943
  },
61765
- args: args52,
61766
- tool: async (client, args53, ctx) => {
61767
- const [result] = await subscriptionsExecuteSubscriptionChange(client, args53.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61944
+ args: args53,
61945
+ tool: async (client, args54, ctx) => {
61946
+ const [result] = await subscriptionsExecuteSubscriptionChange(client, args54.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61768
61947
  if (!result.ok) {
61769
61948
  return {
61770
61949
  content: [{ type: "text", text: result.error.message }],
@@ -61776,38 +61955,486 @@ Use when applying a plan change (e.g. upgrade or downgrade). Executes proration
61776
61955
  };
61777
61956
  });
61778
61957
 
61779
- // src/models/executesubscriptioninheritancerequest.ts
61780
- var ExecuteSubscriptionInheritanceRequest$zodSchema;
61781
- var init_executesubscriptioninheritancerequest = __esm(() => {
61958
+ // src/models/submodifyinheritancerequest.ts
61959
+ var SubModifyInheritanceRequest$zodSchema;
61960
+ var init_submodifyinheritancerequest = __esm(() => {
61782
61961
  init_zod();
61783
- ExecuteSubscriptionInheritanceRequest$zodSchema = object({
61962
+ SubModifyInheritanceRequest$zodSchema = object({
61784
61963
  external_customer_ids_to_inherit_subscription: array(string2()).optional()
61785
61964
  });
61786
61965
  });
61787
61966
 
61967
+ // src/models/lineitemquantitychange.ts
61968
+ var LineItemQuantityChange$zodSchema;
61969
+ var init_lineitemquantitychange = __esm(() => {
61970
+ init_zod();
61971
+ LineItemQuantityChange$zodSchema = object({
61972
+ effective_date: exports_iso.datetime({ offset: true }).optional().describe(`EffectiveDate is when the quantity change takes effect.
61973
+ If omitted, the change is effective immediately (now).`),
61974
+ id: string2(),
61975
+ quantity: string2()
61976
+ });
61977
+ });
61978
+
61979
+ // src/models/submodifyquantitychangerequest.ts
61980
+ var SubModifyQuantityChangeRequest$zodSchema;
61981
+ var init_submodifyquantitychangerequest = __esm(() => {
61982
+ init_zod();
61983
+ init_lineitemquantitychange();
61984
+ SubModifyQuantityChangeRequest$zodSchema = object({
61985
+ line_items: array(LineItemQuantityChange$zodSchema)
61986
+ });
61987
+ });
61988
+
61989
+ // src/models/subscriptionmodifytype.ts
61990
+ var SubscriptionModifyType$zodSchema;
61991
+ var init_subscriptionmodifytype = __esm(() => {
61992
+ init_zod();
61993
+ SubscriptionModifyType$zodSchema = _enum([
61994
+ "inheritance",
61995
+ "quantity_change"
61996
+ ]);
61997
+ });
61998
+
61999
+ // src/models/executesubscriptionmodifyrequest.ts
62000
+ var ExecuteSubscriptionModifyRequest$zodSchema;
62001
+ var init_executesubscriptionmodifyrequest = __esm(() => {
62002
+ init_zod();
62003
+ init_submodifyinheritancerequest();
62004
+ init_submodifyquantitychangerequest();
62005
+ init_subscriptionmodifytype();
62006
+ ExecuteSubscriptionModifyRequest$zodSchema = object({
62007
+ inheritance_params: SubModifyInheritanceRequest$zodSchema.optional(),
62008
+ quantity_change_params: SubModifyQuantityChangeRequest$zodSchema.optional(),
62009
+ type: SubscriptionModifyType$zodSchema
62010
+ });
62011
+ });
62012
+
62013
+ // src/models/changedinvoiceaction.ts
62014
+ var ChangedInvoiceAction$zodSchema;
62015
+ var init_changedinvoiceaction = __esm(() => {
62016
+ init_zod();
62017
+ ChangedInvoiceAction$zodSchema = _enum([
62018
+ "created",
62019
+ "wallet_credit"
62020
+ ]).describe("created (proration invoice) | wallet_credit (downgrade credit)");
62021
+ });
62022
+
62023
+ // src/models/changedinvoicestatus.ts
62024
+ var ChangedInvoiceStatus$zodSchema;
62025
+ var init_changedinvoicestatus = __esm(() => {
62026
+ init_zod();
62027
+ ChangedInvoiceStatus$zodSchema = _enum([
62028
+ "preview",
62029
+ "issued"
62030
+ ]).describe("preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED");
62031
+ });
62032
+
62033
+ // src/models/transactionreason.ts
62034
+ var TransactionReason$zodSchema;
62035
+ var init_transactionreason = __esm(() => {
62036
+ init_zod();
62037
+ TransactionReason$zodSchema = _enum([
62038
+ "INVOICE_PAYMENT",
62039
+ "FREE_CREDIT_GRANT",
62040
+ "SUBSCRIPTION_CREDIT_GRANT",
62041
+ "PURCHASED_CREDIT_INVOICED",
62042
+ "PURCHASED_CREDIT_DIRECT",
62043
+ "CREDIT_NOTE",
62044
+ "CREDIT_EXPIRED",
62045
+ "WALLET_TERMINATION",
62046
+ "MANUAL_BALANCE_DEBIT",
62047
+ "CREDIT_ADJUSTMENT",
62048
+ "INVOICE_VOID_REFUND"
62049
+ ]);
62050
+ });
62051
+
62052
+ // src/models/transactionstatus.ts
62053
+ var TransactionStatus$zodSchema;
62054
+ var init_transactionstatus = __esm(() => {
62055
+ init_zod();
62056
+ TransactionStatus$zodSchema = _enum([
62057
+ "pending",
62058
+ "completed",
62059
+ "failed"
62060
+ ]);
62061
+ });
62062
+
62063
+ // src/models/transactiontype.ts
62064
+ var TransactionType$zodSchema;
62065
+ var init_transactiontype = __esm(() => {
62066
+ init_zod();
62067
+ TransactionType$zodSchema = _enum([
62068
+ "credit",
62069
+ "debit"
62070
+ ]);
62071
+ });
62072
+
62073
+ // src/models/address.ts
62074
+ var Address$zodSchema;
62075
+ var init_address = __esm(() => {
62076
+ init_zod();
62077
+ Address$zodSchema = object({
62078
+ address_city: string2().optional(),
62079
+ address_country: string2().optional(),
62080
+ address_line1: string2().optional(),
62081
+ address_line2: string2().optional(),
62082
+ address_postal_code: string2().optional(),
62083
+ address_state: string2().optional()
62084
+ });
62085
+ });
62086
+
62087
+ // src/models/tenantbillingdetails.ts
62088
+ var TenantBillingDetails$zodSchema;
62089
+ var init_tenantbillingdetails = __esm(() => {
62090
+ init_zod();
62091
+ init_address();
62092
+ TenantBillingDetails$zodSchema = object({
62093
+ address: Address$zodSchema.optional(),
62094
+ email: string2().optional(),
62095
+ help_email: string2().optional(),
62096
+ phone: string2().optional()
62097
+ });
62098
+ });
62099
+
62100
+ // src/models/tenantresponse.ts
62101
+ var TenantResponse$zodSchema;
62102
+ var init_tenantresponse = __esm(() => {
62103
+ init_zod();
62104
+ init_tenantbillingdetails();
62105
+ TenantResponse$zodSchema = object({
62106
+ billing_details: TenantBillingDetails$zodSchema.optional(),
62107
+ created_at: exports_iso.datetime({ offset: true }).optional(),
62108
+ id: string2().optional(),
62109
+ metadata: record(string2(), string2()).optional(),
62110
+ name: string2().optional(),
62111
+ status: string2().optional(),
62112
+ updated_at: exports_iso.datetime({ offset: true }).optional()
62113
+ });
62114
+ });
62115
+
62116
+ // src/models/usertype.ts
62117
+ var UserType$zodSchema;
62118
+ var init_usertype = __esm(() => {
62119
+ init_zod();
62120
+ UserType$zodSchema = _enum([
62121
+ "user",
62122
+ "service_account"
62123
+ ]);
62124
+ });
62125
+
62126
+ // src/models/userresponse.ts
62127
+ var UserResponse$zodSchema;
62128
+ var init_userresponse = __esm(() => {
62129
+ init_zod();
62130
+ init_tenantresponse();
62131
+ init_usertype();
62132
+ UserResponse$zodSchema = object({
62133
+ email: string2().optional().describe("Empty for service accounts"),
62134
+ id: string2().optional(),
62135
+ roles: array(string2()).optional(),
62136
+ tenant: TenantResponse$zodSchema.optional(),
62137
+ type: UserType$zodSchema.optional()
62138
+ });
62139
+ });
62140
+
62141
+ // src/models/alertstate.ts
62142
+ var AlertState$zodSchema;
62143
+ var init_alertstate = __esm(() => {
62144
+ init_zod();
62145
+ AlertState$zodSchema = _enum([
62146
+ "ok",
62147
+ "info",
62148
+ "warning",
62149
+ "in_alarm"
62150
+ ]);
62151
+ });
62152
+
62153
+ // src/models/autotopup.ts
62154
+ var AutoTopup$zodSchema;
62155
+ var init_autotopup = __esm(() => {
62156
+ init_zod();
62157
+ AutoTopup$zodSchema = object({
62158
+ amount: number2().optional(),
62159
+ enabled: boolean2().optional(),
62160
+ invoicing: boolean2().optional(),
62161
+ threshold: number2().optional()
62162
+ });
62163
+ });
62164
+
62165
+ // src/models/creditbreakdown.ts
62166
+ var CreditBreakdown$zodSchema;
62167
+ var init_creditbreakdown = __esm(() => {
62168
+ init_zod();
62169
+ CreditBreakdown$zodSchema = object({
62170
+ free: string2().optional(),
62171
+ purchased: string2().optional()
62172
+ });
62173
+ });
62174
+
62175
+ // src/models/walletconfigpricetype.ts
62176
+ var WalletConfigPriceType$zodSchema;
62177
+ var init_walletconfigpricetype = __esm(() => {
62178
+ init_zod();
62179
+ WalletConfigPriceType$zodSchema = _enum([
62180
+ "ALL",
62181
+ "USAGE",
62182
+ "FIXED"
62183
+ ]);
62184
+ });
62185
+
62186
+ // src/models/walletconfig.ts
62187
+ var WalletConfig$zodSchema;
62188
+ var init_walletconfig = __esm(() => {
62189
+ init_zod();
62190
+ init_walletconfigpricetype();
62191
+ WalletConfig$zodSchema = object({
62192
+ allowed_price_types: array(WalletConfigPriceType$zodSchema).optional().describe(`AllowedPriceTypes is a list of price types that are allowed for the wallet
62193
+ nil means all price types are allowed`)
62194
+ });
62195
+ });
62196
+
62197
+ // src/models/walletstatus.ts
62198
+ var WalletStatus$zodSchema;
62199
+ var init_walletstatus = __esm(() => {
62200
+ init_zod();
62201
+ WalletStatus$zodSchema = _enum([
62202
+ "active",
62203
+ "frozen",
62204
+ "closed"
62205
+ ]);
62206
+ });
62207
+
62208
+ // src/models/wallettype.ts
62209
+ var WalletType$zodSchema;
62210
+ var init_wallettype = __esm(() => {
62211
+ init_zod();
62212
+ WalletType$zodSchema = _enum([
62213
+ "PRE_PAID",
62214
+ "POST_PAID"
62215
+ ]);
62216
+ });
62217
+
62218
+ // src/models/walletresponse.ts
62219
+ var WalletResponse$zodSchema;
62220
+ var init_walletresponse = __esm(() => {
62221
+ init_zod();
62222
+ init_alertsettings();
62223
+ init_alertstate();
62224
+ init_autotopup();
62225
+ init_creditbreakdown();
62226
+ init_status();
62227
+ init_walletconfig();
62228
+ init_walletstatus();
62229
+ init_wallettype();
62230
+ WalletResponse$zodSchema = object({
62231
+ alert_settings: AlertSettings$zodSchema.optional(),
62232
+ alert_state: AlertState$zodSchema.optional(),
62233
+ auto_topup: AutoTopup$zodSchema.optional(),
62234
+ balance: string2().optional(),
62235
+ config: WalletConfig$zodSchema.optional(),
62236
+ conversion_rate: string2().optional().describe(`amount in the currency = number of credits * conversion_rate
62237
+ ex if conversion_rate is 1, then 1 USD = 1 credit
62238
+ ex if conversion_rate is 2, then 1 USD = 0.5 credits
62239
+ ex if conversion_rate is 0.5, then 1 USD = 2 credits`),
62240
+ created_at: exports_iso.datetime({ offset: true }).optional(),
62241
+ created_by: string2().optional(),
62242
+ credit_balance: string2().optional(),
62243
+ credits_available_breakdown: CreditBreakdown$zodSchema.optional(),
62244
+ currency: string2().optional(),
62245
+ customer_id: string2().optional(),
62246
+ description: string2().optional(),
62247
+ environment_id: string2().optional(),
62248
+ id: string2().optional(),
62249
+ metadata: record(string2(), string2()).optional(),
62250
+ name: string2().optional(),
62251
+ status: Status$zodSchema.optional(),
62252
+ tenant_id: string2().optional(),
62253
+ topup_conversion_rate: string2().optional().describe(`topup_conversion_rate is the conversion rate for the topup to the currency
62254
+ ex if topup_conversion_rate is 1, then 1 USD = 1 credit
62255
+ ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits
62256
+ ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits`),
62257
+ updated_at: exports_iso.datetime({ offset: true }).optional(),
62258
+ updated_by: string2().optional(),
62259
+ wallet_status: WalletStatus$zodSchema.optional(),
62260
+ wallet_type: WalletType$zodSchema.optional()
62261
+ });
62262
+ });
62263
+
62264
+ // src/models/wallettxreferencetype.ts
62265
+ var WalletTxReferenceType$zodSchema;
62266
+ var init_wallettxreferencetype = __esm(() => {
62267
+ init_zod();
62268
+ WalletTxReferenceType$zodSchema = _enum([
62269
+ "PAYMENT",
62270
+ "EXTERNAL",
62271
+ "REQUEST",
62272
+ "INVOICE"
62273
+ ]);
62274
+ });
62275
+
62276
+ // src/models/wallettransactionresponse.ts
62277
+ var WalletTransactionResponse$zodSchema;
62278
+ var init_wallettransactionresponse = __esm(() => {
62279
+ init_zod();
62280
+ init_customerresponse();
62281
+ init_status();
62282
+ init_transactionreason();
62283
+ init_transactionstatus();
62284
+ init_transactiontype();
62285
+ init_userresponse();
62286
+ init_walletresponse();
62287
+ init_wallettxreferencetype();
62288
+ WalletTransactionResponse$zodSchema = object({
62289
+ amount: string2().optional(),
62290
+ conversion_rate: string2().optional().describe("conversion_rate is the conversion rate for the transaction to the currency"),
62291
+ created_at: exports_iso.datetime({ offset: true }).optional(),
62292
+ created_by: string2().optional(),
62293
+ created_by_user: UserResponse$zodSchema.optional(),
62294
+ credit_amount: string2().optional(),
62295
+ credit_balance_after: string2().optional(),
62296
+ credit_balance_before: string2().optional(),
62297
+ credits_available: string2().optional(),
62298
+ currency: string2().optional(),
62299
+ customer: CustomerResponse$zodSchema.optional().describe("Customer response object containing all customer information"),
62300
+ customer_id: string2().optional(),
62301
+ description: string2().optional(),
62302
+ environment_id: string2().optional(),
62303
+ expiry_date: exports_iso.datetime({ offset: true }).optional(),
62304
+ id: string2().optional(),
62305
+ idempotency_key: string2().optional(),
62306
+ metadata: record(string2(), string2()).optional(),
62307
+ priority: int().optional(),
62308
+ reference_id: string2().optional(),
62309
+ reference_type: WalletTxReferenceType$zodSchema.optional(),
62310
+ status: Status$zodSchema.optional(),
62311
+ tenant_id: string2().optional(),
62312
+ topup_conversion_rate: string2().optional().describe("topup_conversion_rate is the conversion rate for the topup to the currency"),
62313
+ transaction_reason: TransactionReason$zodSchema.optional(),
62314
+ transaction_status: TransactionStatus$zodSchema.optional(),
62315
+ type: TransactionType$zodSchema.optional(),
62316
+ updated_at: exports_iso.datetime({ offset: true }).optional(),
62317
+ updated_by: string2().optional(),
62318
+ wallet: WalletResponse$zodSchema.optional(),
62319
+ wallet_id: string2().optional()
62320
+ });
62321
+ });
62322
+
62323
+ // src/models/changedinvoice.ts
62324
+ var ChangedInvoice$zodSchema;
62325
+ var init_changedinvoice = __esm(() => {
62326
+ init_zod();
62327
+ init_changedinvoiceaction();
62328
+ init_changedinvoicestatus();
62329
+ init_invoiceresponse();
62330
+ init_wallettransactionresponse();
62331
+ ChangedInvoice$zodSchema = object({
62332
+ action: ChangedInvoiceAction$zodSchema.optional().describe("created (proration invoice) | wallet_credit (downgrade credit)"),
62333
+ id: string2().optional(),
62334
+ invoice: InvoiceResponse$zodSchema.optional(),
62335
+ status: ChangedInvoiceStatus$zodSchema.optional().describe("preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED"),
62336
+ wallet_transaction: WalletTransactionResponse$zodSchema.optional()
62337
+ });
62338
+ });
62339
+
62340
+ // src/models/changedlineitemaction.ts
62341
+ var ChangedLineItemAction$zodSchema;
62342
+ var init_changedlineitemaction = __esm(() => {
62343
+ init_zod();
62344
+ ChangedLineItemAction$zodSchema = _enum([
62345
+ "created",
62346
+ "updated",
62347
+ "ended"
62348
+ ]).describe("created | updated | ended");
62349
+ });
62350
+
62351
+ // src/models/changedlineitem.ts
62352
+ var ChangedLineItem$zodSchema;
62353
+ var init_changedlineitem = __esm(() => {
62354
+ init_zod();
62355
+ init_changedlineitemaction();
62356
+ ChangedLineItem$zodSchema = object({
62357
+ change_action: ChangedLineItemAction$zodSchema.optional().describe("created | updated | ended"),
62358
+ end_date: exports_iso.datetime({ offset: true }).optional(),
62359
+ id: string2().optional(),
62360
+ price_id: string2().optional(),
62361
+ quantity: string2().optional(),
62362
+ start_date: exports_iso.datetime({ offset: true }).optional()
62363
+ });
62364
+ });
62365
+
62366
+ // src/models/changedsubscriptionaction.ts
62367
+ var ChangedSubscriptionAction$zodSchema;
62368
+ var init_changedsubscriptionaction = __esm(() => {
62369
+ init_zod();
62370
+ ChangedSubscriptionAction$zodSchema = _enum([
62371
+ "created",
62372
+ "updated"
62373
+ ]).describe("created | updated");
62374
+ });
62375
+
62376
+ // src/models/changedsubscription.ts
62377
+ var ChangedSubscription$zodSchema;
62378
+ var init_changedsubscription = __esm(() => {
62379
+ init_zod();
62380
+ init_changedsubscriptionaction();
62381
+ init_subscriptionstatus();
62382
+ ChangedSubscription$zodSchema = object({
62383
+ action: ChangedSubscriptionAction$zodSchema.optional().describe("created | updated"),
62384
+ id: string2().optional(),
62385
+ status: SubscriptionStatus$zodSchema.optional()
62386
+ });
62387
+ });
62388
+
62389
+ // src/models/changedresources.ts
62390
+ var ChangedResources$zodSchema;
62391
+ var init_changedresources = __esm(() => {
62392
+ init_zod();
62393
+ init_changedinvoice();
62394
+ init_changedlineitem();
62395
+ init_changedsubscription();
62396
+ ChangedResources$zodSchema = object({
62397
+ invoices: array(ChangedInvoice$zodSchema).optional(),
62398
+ line_items: array(ChangedLineItem$zodSchema).optional(),
62399
+ subscriptions: array(ChangedSubscription$zodSchema).optional()
62400
+ });
62401
+ });
62402
+
62403
+ // src/models/subscriptionmodifyresponse.ts
62404
+ var SubscriptionModifyResponse$zodSchema;
62405
+ var init_subscriptionmodifyresponse = __esm(() => {
62406
+ init_zod();
62407
+ init_changedresources();
62408
+ init_subscriptionresponse();
62409
+ SubscriptionModifyResponse$zodSchema = object({
62410
+ changed_resources: ChangedResources$zodSchema.optional(),
62411
+ subscription: SubscriptionResponse$zodSchema.optional()
62412
+ });
62413
+ });
62414
+
61788
62415
  // src/models/executesubscriptionmodifyop.ts
61789
- var ExecuteSubscriptionModifyRequest$zodSchema, ExecuteSubscriptionModifyResponse$zodSchema;
62416
+ var ExecuteSubscriptionModifyRequestRequest$zodSchema, ExecuteSubscriptionModifyResponse$zodSchema;
61790
62417
  var init_executesubscriptionmodifyop = __esm(() => {
61791
62418
  init_zod();
61792
62419
  init_errorresponse();
61793
- init_executesubscriptioninheritancerequest();
61794
- init_subscriptionresponse();
61795
- ExecuteSubscriptionModifyRequest$zodSchema = object({
61796
- body: ExecuteSubscriptionInheritanceRequest$zodSchema.describe("External customer IDs to inherit"),
62420
+ init_executesubscriptionmodifyrequest();
62421
+ init_subscriptionmodifyresponse();
62422
+ ExecuteSubscriptionModifyRequestRequest$zodSchema = object({
62423
+ body: ExecuteSubscriptionModifyRequest$zodSchema.describe("Modification request"),
61797
62424
  id: string2().describe("Subscription ID")
61798
62425
  });
61799
62426
  ExecuteSubscriptionModifyResponse$zodSchema = union([
61800
- SubscriptionResponse$zodSchema,
62427
+ SubscriptionModifyResponse$zodSchema,
61801
62428
  ErrorResponse$zodSchema
61802
62429
  ]);
61803
62430
  });
61804
62431
 
61805
62432
  // src/funcs/subscriptionsExecuteSubscriptionModify.ts
61806
62433
  function subscriptionsExecuteSubscriptionModify(client$, request, options) {
61807
- return new APIPromise($do54(client$, request, options));
62434
+ return new APIPromise($do55(client$, request, options));
61808
62435
  }
61809
- async function $do54(client$, request, options) {
61810
- const parsed$ = safeParse4(request, (value$) => ExecuteSubscriptionModifyRequest$zodSchema.parse(value$), "Input validation failed");
62436
+ async function $do55(client$, request, options) {
62437
+ const parsed$ = safeParse4(request, (value$) => ExecuteSubscriptionModifyRequestRequest$zodSchema.parse(value$), "Input validation failed");
61811
62438
  if (!parsed$.ok) {
61812
62439
  return [parsed$, { status: "invalid" }];
61813
62440
  }
@@ -61882,19 +62509,19 @@ var init_subscriptionsExecuteSubscriptionModify = __esm(() => {
61882
62509
  });
61883
62510
 
61884
62511
  // src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts
61885
- var args53, tool$subscriptionsExecuteSubscriptionModify;
62512
+ var args54, tool$subscriptionsExecuteSubscriptionModify;
61886
62513
  var init_subscriptionsExecuteSubscriptionModify2 = __esm(() => {
61887
62514
  init_subscriptionsExecuteSubscriptionModify();
61888
62515
  init_executesubscriptionmodifyop();
61889
62516
  init_tools();
61890
- args53 = {
61891
- request: ExecuteSubscriptionModifyRequest$zodSchema
62517
+ args54 = {
62518
+ request: ExecuteSubscriptionModifyRequestRequest$zodSchema
61892
62519
  };
61893
62520
  tool$subscriptionsExecuteSubscriptionModify = {
61894
62521
  name: "execute-subscription-modify",
61895
- description: `Add customers to subscription inheritance
62522
+ description: `Execute subscription modification
61896
62523
 
61897
- Attach additional child customers (by external ID) to an active standalone or parent subscription; creates inherited skeleton subscriptions for each. The subscription must be active.`,
62524
+ Execute a mid-cycle subscription modification (inheritance or quantity change).`,
61898
62525
  scopes: ["write"],
61899
62526
  annotations: {
61900
62527
  title: "",
@@ -61903,9 +62530,9 @@ Attach additional child customers (by external ID) to an active standalone or pa
61903
62530
  openWorldHint: false,
61904
62531
  readOnlyHint: false
61905
62532
  },
61906
- args: args53,
61907
- tool: async (client, args54, ctx) => {
61908
- const [result] = await subscriptionsExecuteSubscriptionModify(client, args54.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62533
+ args: args54,
62534
+ tool: async (client, args55, ctx) => {
62535
+ const [result] = await subscriptionsExecuteSubscriptionModify(client, args55.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
61909
62536
  if (!result.ok) {
61910
62537
  return {
61911
62538
  content: [{ type: "text", text: result.error.message }],
@@ -61934,9 +62561,9 @@ var init_getsubscriptionop = __esm(() => {
61934
62561
 
61935
62562
  // src/funcs/subscriptionsGetSubscription.ts
61936
62563
  function subscriptionsGetSubscription(client$, request, options) {
61937
- return new APIPromise($do55(client$, request, options));
62564
+ return new APIPromise($do56(client$, request, options));
61938
62565
  }
61939
- async function $do55(client$, request, options) {
62566
+ async function $do56(client$, request, options) {
61940
62567
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionRequest$zodSchema.parse(value$), "Input validation failed");
61941
62568
  if (!parsed$.ok) {
61942
62569
  return [parsed$, { status: "invalid" }];
@@ -62011,12 +62638,12 @@ var init_subscriptionsGetSubscription = __esm(() => {
62011
62638
  });
62012
62639
 
62013
62640
  // src/mcp-server/tools/subscriptionsGetSubscription.ts
62014
- var args54, tool$subscriptionsGetSubscription;
62641
+ var args55, tool$subscriptionsGetSubscription;
62015
62642
  var init_subscriptionsGetSubscription2 = __esm(() => {
62016
62643
  init_subscriptionsGetSubscription();
62017
62644
  init_getsubscriptionop();
62018
62645
  init_tools();
62019
- args54 = {
62646
+ args55 = {
62020
62647
  request: GetSubscriptionRequest$zodSchema
62021
62648
  };
62022
62649
  tool$subscriptionsGetSubscription = {
@@ -62032,9 +62659,9 @@ Use when you need to load a single subscription (e.g. for a billing portal or to
62032
62659
  openWorldHint: false,
62033
62660
  readOnlyHint: true
62034
62661
  },
62035
- args: args54,
62036
- tool: async (client, args55, ctx) => {
62037
- const [result] = await subscriptionsGetSubscription(client, args55.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62662
+ args: args55,
62663
+ tool: async (client, args56, ctx) => {
62664
+ const [result] = await subscriptionsGetSubscription(client, args56.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62038
62665
  if (!result.ok) {
62039
62666
  return {
62040
62667
  content: [{ type: "text", text: result.error.message }],
@@ -62117,9 +62744,9 @@ var init_getsubscriptionaddonassociationsop = __esm(() => {
62117
62744
 
62118
62745
  // src/funcs/subscriptionsGetSubscriptionAddonAssociations.ts
62119
62746
  function subscriptionsGetSubscriptionAddonAssociations(client$, request, options) {
62120
- return new APIPromise($do56(client$, request, options));
62747
+ return new APIPromise($do57(client$, request, options));
62121
62748
  }
62122
- async function $do56(client$, request, options) {
62749
+ async function $do57(client$, request, options) {
62123
62750
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionAddonAssociationsRequest$zodSchema.parse(value$), "Input validation failed");
62124
62751
  if (!parsed$.ok) {
62125
62752
  return [parsed$, { status: "invalid" }];
@@ -62194,12 +62821,12 @@ var init_subscriptionsGetSubscriptionAddonAssociations = __esm(() => {
62194
62821
  });
62195
62822
 
62196
62823
  // src/mcp-server/tools/subscriptionsGetSubscriptionAddonAssociations.ts
62197
- var args55, tool$subscriptionsGetSubscriptionAddonAssociations;
62824
+ var args56, tool$subscriptionsGetSubscriptionAddonAssociations;
62198
62825
  var init_subscriptionsGetSubscriptionAddonAssociations2 = __esm(() => {
62199
62826
  init_subscriptionsGetSubscriptionAddonAssociations();
62200
62827
  init_getsubscriptionaddonassociationsop();
62201
62828
  init_tools();
62202
- args55 = {
62829
+ args56 = {
62203
62830
  request: GetSubscriptionAddonAssociationsRequest$zodSchema
62204
62831
  };
62205
62832
  tool$subscriptionsGetSubscriptionAddonAssociations = {
@@ -62215,9 +62842,9 @@ Use when listing which add-ons are currently attached to a subscription (e.g. fo
62215
62842
  openWorldHint: false,
62216
62843
  readOnlyHint: true
62217
62844
  },
62218
- args: args55,
62219
- tool: async (client, args56, ctx) => {
62220
- const [result] = await subscriptionsGetSubscriptionAddonAssociations(client, args56.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62845
+ args: args56,
62846
+ tool: async (client, args57, ctx) => {
62847
+ const [result] = await subscriptionsGetSubscriptionAddonAssociations(client, args57.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62221
62848
  if (!result.ok) {
62222
62849
  return {
62223
62850
  content: [{ type: "text", text: result.error.message }],
@@ -62259,9 +62886,9 @@ var init_getsubscriptionentitlementsop = __esm(() => {
62259
62886
 
62260
62887
  // src/funcs/subscriptionsGetSubscriptionEntitlements.ts
62261
62888
  function subscriptionsGetSubscriptionEntitlements(client$, request, options) {
62262
- return new APIPromise($do57(client$, request, options));
62889
+ return new APIPromise($do58(client$, request, options));
62263
62890
  }
62264
- async function $do57(client$, request, options) {
62891
+ async function $do58(client$, request, options) {
62265
62892
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionEntitlementsRequest$zodSchema.parse(value$), "Input validation failed");
62266
62893
  if (!parsed$.ok) {
62267
62894
  return [parsed$, { status: "invalid" }];
@@ -62340,12 +62967,12 @@ var init_subscriptionsGetSubscriptionEntitlements = __esm(() => {
62340
62967
  });
62341
62968
 
62342
62969
  // src/mcp-server/tools/subscriptionsGetSubscriptionEntitlements.ts
62343
- var args56, tool$subscriptionsGetSubscriptionEntitlements;
62970
+ var args57, tool$subscriptionsGetSubscriptionEntitlements;
62344
62971
  var init_subscriptionsGetSubscriptionEntitlements2 = __esm(() => {
62345
62972
  init_subscriptionsGetSubscriptionEntitlements();
62346
62973
  init_getsubscriptionentitlementsop();
62347
62974
  init_tools();
62348
- args56 = {
62975
+ args57 = {
62349
62976
  request: GetSubscriptionEntitlementsRequest$zodSchema
62350
62977
  };
62351
62978
  tool$subscriptionsGetSubscriptionEntitlements = {
@@ -62361,9 +62988,9 @@ Use when checking what features or limits a subscription has (e.g. entitlement c
62361
62988
  openWorldHint: false,
62362
62989
  readOnlyHint: true
62363
62990
  },
62364
- args: args56,
62365
- tool: async (client, args57, ctx) => {
62366
- const [result] = await subscriptionsGetSubscriptionEntitlements(client, args57.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62991
+ args: args57,
62992
+ tool: async (client, args58, ctx) => {
62993
+ const [result] = await subscriptionsGetSubscriptionEntitlements(client, args58.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62367
62994
  if (!result.ok) {
62368
62995
  return {
62369
62996
  content: [{ type: "text", text: result.error.message }],
@@ -62386,9 +63013,9 @@ var init_getsubscriptionscheduleop = __esm(() => {
62386
63013
 
62387
63014
  // src/funcs/subscriptionsGetSubscriptionSchedule.ts
62388
63015
  function subscriptionsGetSubscriptionSchedule(client$, request, options) {
62389
- return new APIPromise($do58(client$, request, options));
63016
+ return new APIPromise($do59(client$, request, options));
62390
63017
  }
62391
- async function $do58(client$, request, options) {
63018
+ async function $do59(client$, request, options) {
62392
63019
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionScheduleRequest$zodSchema.parse(value$), "Input validation failed");
62393
63020
  if (!parsed$.ok) {
62394
63021
  return [parsed$, { status: "invalid" }];
@@ -62463,12 +63090,12 @@ var init_subscriptionsGetSubscriptionSchedule = __esm(() => {
62463
63090
  });
62464
63091
 
62465
63092
  // src/mcp-server/tools/subscriptionsGetSubscriptionSchedule.ts
62466
- var args57, tool$subscriptionsGetSubscriptionSchedule;
63093
+ var args58, tool$subscriptionsGetSubscriptionSchedule;
62467
63094
  var init_subscriptionsGetSubscriptionSchedule2 = __esm(() => {
62468
63095
  init_subscriptionsGetSubscriptionSchedule();
62469
63096
  init_getsubscriptionscheduleop();
62470
63097
  init_tools();
62471
- args57 = {
63098
+ args58 = {
62472
63099
  request: GetSubscriptionScheduleRequest$zodSchema
62473
63100
  };
62474
63101
  tool$subscriptionsGetSubscriptionSchedule = {
@@ -62484,9 +63111,9 @@ Use when you need to load a single scheduled change (e.g. to show when a plan ch
62484
63111
  openWorldHint: false,
62485
63112
  readOnlyHint: true
62486
63113
  },
62487
- args: args57,
62488
- tool: async (client, args58, ctx) => {
62489
- const [result] = await subscriptionsGetSubscriptionSchedule(client, args58.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63114
+ args: args58,
63115
+ tool: async (client, args59, ctx) => {
63116
+ const [result] = await subscriptionsGetSubscriptionSchedule(client, args59.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62490
63117
  if (!result.ok) {
62491
63118
  return {
62492
63119
  content: [{ type: "text", text: result.error.message }],
@@ -62515,9 +63142,9 @@ var init_getsubscriptionupcominggrantsop = __esm(() => {
62515
63142
 
62516
63143
  // src/funcs/subscriptionsGetSubscriptionUpcomingGrants.ts
62517
63144
  function subscriptionsGetSubscriptionUpcomingGrants(client$, request, options) {
62518
- return new APIPromise($do59(client$, request, options));
63145
+ return new APIPromise($do60(client$, request, options));
62519
63146
  }
62520
- async function $do59(client$, request, options) {
63147
+ async function $do60(client$, request, options) {
62521
63148
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionUpcomingGrantsRequest$zodSchema.parse(value$), "Input validation failed");
62522
63149
  if (!parsed$.ok) {
62523
63150
  return [parsed$, { status: "invalid" }];
@@ -62592,12 +63219,12 @@ var init_subscriptionsGetSubscriptionUpcomingGrants = __esm(() => {
62592
63219
  });
62593
63220
 
62594
63221
  // src/mcp-server/tools/subscriptionsGetSubscriptionUpcomingGrants.ts
62595
- var args58, tool$subscriptionsGetSubscriptionUpcomingGrants;
63222
+ var args59, tool$subscriptionsGetSubscriptionUpcomingGrants;
62596
63223
  var init_subscriptionsGetSubscriptionUpcomingGrants2 = __esm(() => {
62597
63224
  init_subscriptionsGetSubscriptionUpcomingGrants();
62598
63225
  init_getsubscriptionupcominggrantsop();
62599
63226
  init_tools();
62600
- args58 = {
63227
+ args59 = {
62601
63228
  request: GetSubscriptionUpcomingGrantsRequest$zodSchema
62602
63229
  };
62603
63230
  tool$subscriptionsGetSubscriptionUpcomingGrants = {
@@ -62613,9 +63240,9 @@ Use when showing upcoming or pending credits for a subscription (e.g. in a porta
62613
63240
  openWorldHint: false,
62614
63241
  readOnlyHint: true
62615
63242
  },
62616
- args: args58,
62617
- tool: async (client, args59, ctx) => {
62618
- const [result] = await subscriptionsGetSubscriptionUpcomingGrants(client, args59.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63243
+ args: args59,
63244
+ tool: async (client, args60, ctx) => {
63245
+ const [result] = await subscriptionsGetSubscriptionUpcomingGrants(client, args60.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62619
63246
  if (!result.ok) {
62620
63247
  return {
62621
63248
  content: [{ type: "text", text: result.error.message }],
@@ -62641,9 +63268,9 @@ var init_getusagebysubscriptionrequest = __esm(() => {
62641
63268
 
62642
63269
  // src/funcs/subscriptionsGetSubscriptionUsage.ts
62643
63270
  function subscriptionsGetSubscriptionUsage(client$, request, options) {
62644
- return new APIPromise($do60(client$, request, options));
63271
+ return new APIPromise($do61(client$, request, options));
62645
63272
  }
62646
- async function $do60(client$, request, options) {
63273
+ async function $do61(client$, request, options) {
62647
63274
  const parsed$ = safeParse4(request, (value$) => GetUsageBySubscriptionRequest$zodSchema.parse(value$), "Input validation failed");
62648
63275
  if (!parsed$.ok) {
62649
63276
  return [parsed$, { status: "invalid" }];
@@ -62713,12 +63340,12 @@ var init_subscriptionsGetSubscriptionUsage = __esm(() => {
62713
63340
  });
62714
63341
 
62715
63342
  // src/mcp-server/tools/subscriptionsGetSubscriptionUsage.ts
62716
- var args59, tool$subscriptionsGetSubscriptionUsage;
63343
+ var args60, tool$subscriptionsGetSubscriptionUsage;
62717
63344
  var init_subscriptionsGetSubscriptionUsage2 = __esm(() => {
62718
63345
  init_subscriptionsGetSubscriptionUsage();
62719
63346
  init_getusagebysubscriptionrequest();
62720
63347
  init_tools();
62721
- args59 = {
63348
+ args60 = {
62722
63349
  request: GetUsageBySubscriptionRequest$zodSchema.describe(`Usage request`)
62723
63350
  };
62724
63351
  tool$subscriptionsGetSubscriptionUsage = {
@@ -62734,9 +63361,9 @@ Use when showing usage for a subscription (e.g. in a portal or for overage check
62734
63361
  openWorldHint: false,
62735
63362
  readOnlyHint: false
62736
63363
  },
62737
- args: args59,
62738
- tool: async (client, args60, ctx) => {
62739
- const [result] = await subscriptionsGetSubscriptionUsage(client, args60.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63364
+ args: args60,
63365
+ tool: async (client, args61, ctx) => {
63366
+ const [result] = await subscriptionsGetSubscriptionUsage(client, args61.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62740
63367
  if (!result.ok) {
62741
63368
  return {
62742
63369
  content: [{ type: "text", text: result.error.message }],
@@ -62848,9 +63475,9 @@ var init_getsubscriptionv2op = __esm(() => {
62848
63475
 
62849
63476
  // src/funcs/subscriptionsGetSubscriptionV2.ts
62850
63477
  function subscriptionsGetSubscriptionV2(client$, request, options) {
62851
- return new APIPromise($do61(client$, request, options));
63478
+ return new APIPromise($do62(client$, request, options));
62852
63479
  }
62853
- async function $do61(client$, request, options) {
63480
+ async function $do62(client$, request, options) {
62854
63481
  const parsed$ = safeParse4(request, (value$) => GetSubscriptionV2Request$zodSchema.parse(value$), "Input validation failed");
62855
63482
  if (!parsed$.ok) {
62856
63483
  return [parsed$, { status: "invalid" }];
@@ -62929,12 +63556,12 @@ var init_subscriptionsGetSubscriptionV2 = __esm(() => {
62929
63556
  });
62930
63557
 
62931
63558
  // src/mcp-server/tools/subscriptionsGetSubscriptionV2.ts
62932
- var args60, tool$subscriptionsGetSubscriptionV2;
63559
+ var args61, tool$subscriptionsGetSubscriptionV2;
62933
63560
  var init_subscriptionsGetSubscriptionV22 = __esm(() => {
62934
63561
  init_subscriptionsGetSubscriptionV2();
62935
63562
  init_getsubscriptionv2op();
62936
63563
  init_tools();
62937
- args60 = {
63564
+ args61 = {
62938
63565
  request: GetSubscriptionV2Request$zodSchema
62939
63566
  };
62940
63567
  tool$subscriptionsGetSubscriptionV2 = {
@@ -62950,9 +63577,9 @@ Use when you need a subscription with related data (line items, prices, plan). S
62950
63577
  openWorldHint: false,
62951
63578
  readOnlyHint: true
62952
63579
  },
62953
- args: args60,
62954
- tool: async (client, args61, ctx) => {
62955
- const [result] = await subscriptionsGetSubscriptionV2(client, args61.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63580
+ args: args61,
63581
+ tool: async (client, args62, ctx) => {
63582
+ const [result] = await subscriptionsGetSubscriptionV2(client, args62.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
62956
63583
  if (!result.ok) {
62957
63584
  return {
62958
63585
  content: [{ type: "text", text: result.error.message }],
@@ -62978,9 +63605,9 @@ var init_listallsubscriptionschedulesop = __esm(() => {
62978
63605
 
62979
63606
  // src/funcs/subscriptionsListAllSubscriptionSchedules.ts
62980
63607
  function subscriptionsListAllSubscriptionSchedules(client$, request, options) {
62981
- return new APIPromise($do62(client$, request, options));
63608
+ return new APIPromise($do63(client$, request, options));
62982
63609
  }
62983
- async function $do62(client$, request, options) {
63610
+ async function $do63(client$, request, options) {
62984
63611
  const parsed$ = safeParse4(request, (value$) => ListAllSubscriptionSchedulesRequest$zodSchema.optional().parse(value$), "Input validation failed");
62985
63612
  if (!parsed$.ok) {
62986
63613
  return [parsed$, { status: "invalid" }];
@@ -63056,12 +63683,12 @@ var init_subscriptionsListAllSubscriptionSchedules = __esm(() => {
63056
63683
  });
63057
63684
 
63058
63685
  // src/mcp-server/tools/subscriptionsListAllSubscriptionSchedules.ts
63059
- var args61, tool$subscriptionsListAllSubscriptionSchedules;
63686
+ var args62, tool$subscriptionsListAllSubscriptionSchedules;
63060
63687
  var init_subscriptionsListAllSubscriptionSchedules2 = __esm(() => {
63061
63688
  init_subscriptionsListAllSubscriptionSchedules();
63062
63689
  init_listallsubscriptionschedulesop();
63063
63690
  init_tools();
63064
- args61 = {
63691
+ args62 = {
63065
63692
  request: ListAllSubscriptionSchedulesRequest$zodSchema.optional()
63066
63693
  };
63067
63694
  tool$subscriptionsListAllSubscriptionSchedules = {
@@ -63077,9 +63704,9 @@ Use when listing or searching scheduled changes across subscriptions (e.g. admin
63077
63704
  openWorldHint: false,
63078
63705
  readOnlyHint: true
63079
63706
  },
63080
- args: args61,
63081
- tool: async (client, args62, ctx) => {
63082
- const [result] = await subscriptionsListAllSubscriptionSchedules(client, args62.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63707
+ args: args62,
63708
+ tool: async (client, args63, ctx) => {
63709
+ const [result] = await subscriptionsListAllSubscriptionSchedules(client, args63.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63083
63710
  if (!result.ok) {
63084
63711
  return {
63085
63712
  content: [{ type: "text", text: result.error.message }],
@@ -63152,9 +63779,9 @@ var init_listsubscriptionpausesop = __esm(() => {
63152
63779
 
63153
63780
  // src/funcs/subscriptionsListSubscriptionPauses.ts
63154
63781
  function subscriptionsListSubscriptionPauses(client$, request, options) {
63155
- return new APIPromise($do63(client$, request, options));
63782
+ return new APIPromise($do64(client$, request, options));
63156
63783
  }
63157
- async function $do63(client$, request, options) {
63784
+ async function $do64(client$, request, options) {
63158
63785
  const parsed$ = safeParse4(request, (value$) => ListSubscriptionPausesRequest$zodSchema.parse(value$), "Input validation failed");
63159
63786
  if (!parsed$.ok) {
63160
63787
  return [parsed$, { status: "invalid" }];
@@ -63229,12 +63856,12 @@ var init_subscriptionsListSubscriptionPauses = __esm(() => {
63229
63856
  });
63230
63857
 
63231
63858
  // src/mcp-server/tools/subscriptionsListSubscriptionPauses.ts
63232
- var args62, tool$subscriptionsListSubscriptionPauses;
63859
+ var args63, tool$subscriptionsListSubscriptionPauses;
63233
63860
  var init_subscriptionsListSubscriptionPauses2 = __esm(() => {
63234
63861
  init_subscriptionsListSubscriptionPauses();
63235
63862
  init_listsubscriptionpausesop();
63236
63863
  init_tools();
63237
- args62 = {
63864
+ args63 = {
63238
63865
  request: ListSubscriptionPausesRequest$zodSchema
63239
63866
  };
63240
63867
  tool$subscriptionsListSubscriptionPauses = {
@@ -63250,9 +63877,9 @@ Use when showing pause history for a subscription (e.g. support or audit). Retur
63250
63877
  openWorldHint: false,
63251
63878
  readOnlyHint: true
63252
63879
  },
63253
- args: args62,
63254
- tool: async (client, args63, ctx) => {
63255
- const [result] = await subscriptionsListSubscriptionPauses(client, args63.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63880
+ args: args63,
63881
+ tool: async (client, args64, ctx) => {
63882
+ const [result] = await subscriptionsListSubscriptionPauses(client, args64.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63256
63883
  if (!result.ok) {
63257
63884
  return {
63258
63885
  content: [{ type: "text", text: result.error.message }],
@@ -63275,9 +63902,9 @@ var init_listsubscriptionschedulesop = __esm(() => {
63275
63902
 
63276
63903
  // src/funcs/subscriptionsListSubscriptionSchedules.ts
63277
63904
  function subscriptionsListSubscriptionSchedules(client$, request, options) {
63278
- return new APIPromise($do64(client$, request, options));
63905
+ return new APIPromise($do65(client$, request, options));
63279
63906
  }
63280
- async function $do64(client$, request, options) {
63907
+ async function $do65(client$, request, options) {
63281
63908
  const parsed$ = safeParse4(request, (value$) => ListSubscriptionSchedulesRequest$zodSchema.parse(value$), "Input validation failed");
63282
63909
  if (!parsed$.ok) {
63283
63910
  return [parsed$, { status: "invalid" }];
@@ -63352,12 +63979,12 @@ var init_subscriptionsListSubscriptionSchedules = __esm(() => {
63352
63979
  });
63353
63980
 
63354
63981
  // src/mcp-server/tools/subscriptionsListSubscriptionSchedules.ts
63355
- var args63, tool$subscriptionsListSubscriptionSchedules;
63982
+ var args64, tool$subscriptionsListSubscriptionSchedules;
63356
63983
  var init_subscriptionsListSubscriptionSchedules2 = __esm(() => {
63357
63984
  init_subscriptionsListSubscriptionSchedules();
63358
63985
  init_listsubscriptionschedulesop();
63359
63986
  init_tools();
63360
- args63 = {
63987
+ args64 = {
63361
63988
  request: ListSubscriptionSchedulesRequest$zodSchema
63362
63989
  };
63363
63990
  tool$subscriptionsListSubscriptionSchedules = {
@@ -63373,9 +64000,9 @@ Use when listing scheduled changes for a subscription (e.g. upcoming plan change
63373
64000
  openWorldHint: false,
63374
64001
  readOnlyHint: true
63375
64002
  },
63376
- args: args63,
63377
- tool: async (client, args64, ctx) => {
63378
- const [result] = await subscriptionsListSubscriptionSchedules(client, args64.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64003
+ args: args64,
64004
+ tool: async (client, args65, ctx) => {
64005
+ const [result] = await subscriptionsListSubscriptionSchedules(client, args65.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63379
64006
  if (!result.ok) {
63380
64007
  return {
63381
64008
  content: [{ type: "text", text: result.error.message }],
@@ -63434,9 +64061,9 @@ var init_pausesubscriptionop = __esm(() => {
63434
64061
 
63435
64062
  // src/funcs/subscriptionsPauseSubscription.ts
63436
64063
  function subscriptionsPauseSubscription(client$, request, options) {
63437
- return new APIPromise($do65(client$, request, options));
64064
+ return new APIPromise($do66(client$, request, options));
63438
64065
  }
63439
- async function $do65(client$, request, options) {
64066
+ async function $do66(client$, request, options) {
63440
64067
  const parsed$ = safeParse4(request, (value$) => PauseSubscriptionRequestRequest$zodSchema.parse(value$), "Input validation failed");
63441
64068
  if (!parsed$.ok) {
63442
64069
  return [parsed$, { status: "invalid" }];
@@ -63512,12 +64139,12 @@ var init_subscriptionsPauseSubscription = __esm(() => {
63512
64139
  });
63513
64140
 
63514
64141
  // src/mcp-server/tools/subscriptionsPauseSubscription.ts
63515
- var args64, tool$subscriptionsPauseSubscription;
64142
+ var args65, tool$subscriptionsPauseSubscription;
63516
64143
  var init_subscriptionsPauseSubscription2 = __esm(() => {
63517
64144
  init_subscriptionsPauseSubscription();
63518
64145
  init_pausesubscriptionop();
63519
64146
  init_tools();
63520
- args64 = {
64147
+ args65 = {
63521
64148
  request: PauseSubscriptionRequestRequest$zodSchema
63522
64149
  };
63523
64150
  tool$subscriptionsPauseSubscription = {
@@ -63533,9 +64160,9 @@ Use when temporarily stopping a subscription (e.g. customer hold or seasonal pau
63533
64160
  openWorldHint: false,
63534
64161
  readOnlyHint: false
63535
64162
  },
63536
- args: args64,
63537
- tool: async (client, args65, ctx) => {
63538
- const [result] = await subscriptionsPauseSubscription(client, args65.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64163
+ args: args65,
64164
+ tool: async (client, args66, ctx) => {
64165
+ const [result] = await subscriptionsPauseSubscription(client, args66.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63539
64166
  if (!result.ok) {
63540
64167
  return {
63541
64168
  content: [{ type: "text", text: result.error.message }],
@@ -63647,9 +64274,9 @@ var init_previewsubscriptionchangeop = __esm(() => {
63647
64274
 
63648
64275
  // src/funcs/subscriptionsPreviewSubscriptionChange.ts
63649
64276
  function subscriptionsPreviewSubscriptionChange(client$, request, options) {
63650
- return new APIPromise($do66(client$, request, options));
64277
+ return new APIPromise($do67(client$, request, options));
63651
64278
  }
63652
- async function $do66(client$, request, options) {
64279
+ async function $do67(client$, request, options) {
63653
64280
  const parsed$ = safeParse4(request, (value$) => PreviewSubscriptionChangeRequest$zodSchema.parse(value$), "Input validation failed");
63654
64281
  if (!parsed$.ok) {
63655
64282
  return [parsed$, { status: "invalid" }];
@@ -63725,12 +64352,12 @@ var init_subscriptionsPreviewSubscriptionChange = __esm(() => {
63725
64352
  });
63726
64353
 
63727
64354
  // src/mcp-server/tools/subscriptionsPreviewSubscriptionChange.ts
63728
- var args65, tool$subscriptionsPreviewSubscriptionChange;
64355
+ var args66, tool$subscriptionsPreviewSubscriptionChange;
63729
64356
  var init_subscriptionsPreviewSubscriptionChange2 = __esm(() => {
63730
64357
  init_subscriptionsPreviewSubscriptionChange();
63731
64358
  init_previewsubscriptionchangeop();
63732
64359
  init_tools();
63733
- args65 = {
64360
+ args66 = {
63734
64361
  request: PreviewSubscriptionChangeRequest$zodSchema
63735
64362
  };
63736
64363
  tool$subscriptionsPreviewSubscriptionChange = {
@@ -63746,9 +64373,141 @@ Use when showing a customer the cost of a plan change before they confirm (e.g.
63746
64373
  openWorldHint: false,
63747
64374
  readOnlyHint: false
63748
64375
  },
63749
- args: args65,
63750
- tool: async (client, args66, ctx) => {
63751
- const [result] = await subscriptionsPreviewSubscriptionChange(client, args66.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64376
+ args: args66,
64377
+ tool: async (client, args67, ctx) => {
64378
+ const [result] = await subscriptionsPreviewSubscriptionChange(client, args67.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64379
+ if (!result.ok) {
64380
+ return {
64381
+ content: [{ type: "text", text: result.error.message }],
64382
+ isError: true
64383
+ };
64384
+ }
64385
+ return formatResult(result.value);
64386
+ }
64387
+ };
64388
+ });
64389
+
64390
+ // src/models/previewsubscriptionmodifyop.ts
64391
+ var PreviewSubscriptionModifyRequest$zodSchema, PreviewSubscriptionModifyResponse$zodSchema;
64392
+ var init_previewsubscriptionmodifyop = __esm(() => {
64393
+ init_zod();
64394
+ init_errorresponse();
64395
+ init_executesubscriptionmodifyrequest();
64396
+ init_subscriptionmodifyresponse();
64397
+ PreviewSubscriptionModifyRequest$zodSchema = object({
64398
+ body: ExecuteSubscriptionModifyRequest$zodSchema.describe("Modification preview request"),
64399
+ id: string2().describe("Subscription ID")
64400
+ });
64401
+ PreviewSubscriptionModifyResponse$zodSchema = union([
64402
+ SubscriptionModifyResponse$zodSchema,
64403
+ ErrorResponse$zodSchema
64404
+ ]);
64405
+ });
64406
+
64407
+ // src/funcs/subscriptionsPreviewSubscriptionModify.ts
64408
+ function subscriptionsPreviewSubscriptionModify(client$, request, options) {
64409
+ return new APIPromise($do68(client$, request, options));
64410
+ }
64411
+ async function $do68(client$, request, options) {
64412
+ const parsed$ = safeParse4(request, (value$) => PreviewSubscriptionModifyRequest$zodSchema.parse(value$), "Input validation failed");
64413
+ if (!parsed$.ok) {
64414
+ return [parsed$, { status: "invalid" }];
64415
+ }
64416
+ const payload$ = parsed$.value;
64417
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
64418
+ const pathParams$ = {
64419
+ id: encodeSimple("id", payload$.id, {
64420
+ explode: false,
64421
+ charEncoding: "percent"
64422
+ })
64423
+ };
64424
+ const path$ = pathToFunc("/subscriptions/{id}/modify/preview")(pathParams$);
64425
+ const headers$ = new Headers(compactMap({
64426
+ "Content-Type": "application/json",
64427
+ Accept: "application/json"
64428
+ }));
64429
+ const securityInput = await extractSecurity(client$._options.security);
64430
+ const requestSecurity = resolveGlobalSecurity(securityInput);
64431
+ const context = {
64432
+ options: client$._options,
64433
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
64434
+ operationID: "previewSubscriptionModify",
64435
+ oAuth2Scopes: null,
64436
+ resolvedSecurity: requestSecurity,
64437
+ securitySource: client$._options.security,
64438
+ retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
64439
+ retryCodes: options?.retryCodes || [
64440
+ "429",
64441
+ "500",
64442
+ "502",
64443
+ "503",
64444
+ "504"
64445
+ ]
64446
+ };
64447
+ const requestRes = client$._createRequest(context, {
64448
+ security: requestSecurity,
64449
+ method: "POST",
64450
+ baseURL: options?.serverURL,
64451
+ path: path$,
64452
+ headers: headers$,
64453
+ body: body$,
64454
+ userAgent: client$._options.userAgent,
64455
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
64456
+ }, options);
64457
+ if (!requestRes.ok) {
64458
+ return [requestRes, { status: "invalid" }];
64459
+ }
64460
+ const req$ = requestRes.value;
64461
+ const doResult = await client$._do(req$, {
64462
+ context,
64463
+ errorCodes: [],
64464
+ retryConfig: context.retryConfig,
64465
+ retryCodes: context.retryCodes
64466
+ });
64467
+ if (!doResult.ok) {
64468
+ return [doResult, { status: "request-error", request: req$ }];
64469
+ }
64470
+ return [doResult, {
64471
+ status: "complete",
64472
+ request: req$,
64473
+ response: doResult.value
64474
+ }];
64475
+ }
64476
+ var init_subscriptionsPreviewSubscriptionModify = __esm(() => {
64477
+ init_encodings();
64478
+ init_primitives();
64479
+ init_schemas4();
64480
+ init_security();
64481
+ init_url();
64482
+ init_previewsubscriptionmodifyop();
64483
+ init_async();
64484
+ });
64485
+
64486
+ // src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts
64487
+ var args67, tool$subscriptionsPreviewSubscriptionModify;
64488
+ var init_subscriptionsPreviewSubscriptionModify2 = __esm(() => {
64489
+ init_subscriptionsPreviewSubscriptionModify();
64490
+ init_previewsubscriptionmodifyop();
64491
+ init_tools();
64492
+ args67 = {
64493
+ request: PreviewSubscriptionModifyRequest$zodSchema
64494
+ };
64495
+ tool$subscriptionsPreviewSubscriptionModify = {
64496
+ name: "preview-subscription-modify",
64497
+ description: `Preview subscription modification
64498
+
64499
+ Preview the impact of a mid-cycle subscription modification without committing changes.`,
64500
+ scopes: ["read"],
64501
+ annotations: {
64502
+ title: "",
64503
+ destructiveHint: false,
64504
+ idempotentHint: false,
64505
+ openWorldHint: false,
64506
+ readOnlyHint: true
64507
+ },
64508
+ args: args67,
64509
+ tool: async (client, args68, ctx) => {
64510
+ const [result] = await subscriptionsPreviewSubscriptionModify(client, args68.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63752
64511
  if (!result.ok) {
63753
64512
  return {
63754
64513
  content: [{ type: "text", text: result.error.message }],
@@ -63806,9 +64565,9 @@ When nil, period/cancel cutoff logic is not applied by this field (see TimeRange
63806
64565
 
63807
64566
  // src/funcs/subscriptionsQuerySubscription.ts
63808
64567
  function subscriptionsQuerySubscription(client$, request, options) {
63809
- return new APIPromise($do67(client$, request, options));
64568
+ return new APIPromise($do69(client$, request, options));
63810
64569
  }
63811
- async function $do67(client$, request, options) {
64570
+ async function $do69(client$, request, options) {
63812
64571
  const parsed$ = safeParse4(request, (value$) => SubscriptionFilter$zodSchema.parse(value$), "Input validation failed");
63813
64572
  if (!parsed$.ok) {
63814
64573
  return [parsed$, { status: "invalid" }];
@@ -63878,12 +64637,12 @@ var init_subscriptionsQuerySubscription = __esm(() => {
63878
64637
  });
63879
64638
 
63880
64639
  // src/mcp-server/tools/subscriptionsQuerySubscription.ts
63881
- var args66, tool$subscriptionsQuerySubscription;
64640
+ var args68, tool$subscriptionsQuerySubscription;
63882
64641
  var init_subscriptionsQuerySubscription2 = __esm(() => {
63883
64642
  init_subscriptionsQuerySubscription();
63884
64643
  init_subscriptionfilter();
63885
64644
  init_tools();
63886
- args66 = {
64645
+ args68 = {
63887
64646
  request: SubscriptionFilter$zodSchema.describe(`Filter`)
63888
64647
  };
63889
64648
  tool$subscriptionsQuerySubscription = {
@@ -63899,9 +64658,9 @@ Use when listing or searching subscriptions (e.g. admin view or customer subscri
63899
64658
  openWorldHint: false,
63900
64659
  readOnlyHint: false
63901
64660
  },
63902
- args: args66,
63903
- tool: async (client, args67, ctx) => {
63904
- const [result] = await subscriptionsQuerySubscription(client, args67.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64661
+ args: args68,
64662
+ tool: async (client, args69, ctx) => {
64663
+ const [result] = await subscriptionsQuerySubscription(client, args69.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
63905
64664
  if (!result.ok) {
63906
64665
  return {
63907
64666
  content: [{ type: "text", text: result.error.message }],
@@ -63925,9 +64684,9 @@ var init_removeaddonrequest = __esm(() => {
63925
64684
 
63926
64685
  // src/funcs/subscriptionsRemoveSubscriptionAddon.ts
63927
64686
  function subscriptionsRemoveSubscriptionAddon(client$, request, options) {
63928
- return new APIPromise($do68(client$, request, options));
64687
+ return new APIPromise($do70(client$, request, options));
63929
64688
  }
63930
- async function $do68(client$, request, options) {
64689
+ async function $do70(client$, request, options) {
63931
64690
  const parsed$ = safeParse4(request, (value$) => RemoveAddonRequest$zodSchema.parse(value$), "Input validation failed");
63932
64691
  if (!parsed$.ok) {
63933
64692
  return [parsed$, { status: "invalid" }];
@@ -63997,12 +64756,12 @@ var init_subscriptionsRemoveSubscriptionAddon = __esm(() => {
63997
64756
  });
63998
64757
 
63999
64758
  // src/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.ts
64000
- var args67, tool$subscriptionsRemoveSubscriptionAddon;
64759
+ var args69, tool$subscriptionsRemoveSubscriptionAddon;
64001
64760
  var init_subscriptionsRemoveSubscriptionAddon2 = __esm(() => {
64002
64761
  init_subscriptionsRemoveSubscriptionAddon();
64003
64762
  init_removeaddonrequest();
64004
64763
  init_tools();
64005
- args67 = {
64764
+ args69 = {
64006
64765
  request: RemoveAddonRequest$zodSchema.describe(`Remove Addon Request`)
64007
64766
  };
64008
64767
  tool$subscriptionsRemoveSubscriptionAddon = {
@@ -64018,9 +64777,9 @@ Use when removing an add-on from a subscription (e.g. downgrade or opt-out).`,
64018
64777
  openWorldHint: false,
64019
64778
  readOnlyHint: false
64020
64779
  },
64021
- args: args67,
64022
- tool: async (client, args68, ctx) => {
64023
- const [result] = await subscriptionsRemoveSubscriptionAddon(client, args68.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64780
+ args: args69,
64781
+ tool: async (client, args70, ctx) => {
64782
+ const [result] = await subscriptionsRemoveSubscriptionAddon(client, args70.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64024
64783
  if (!result.ok) {
64025
64784
  return {
64026
64785
  content: [{ type: "text", text: result.error.message }],
@@ -64067,9 +64826,9 @@ var init_resumesubscriptionop = __esm(() => {
64067
64826
 
64068
64827
  // src/funcs/subscriptionsResumeSubscription.ts
64069
64828
  function subscriptionsResumeSubscription(client$, request, options) {
64070
- return new APIPromise($do69(client$, request, options));
64829
+ return new APIPromise($do71(client$, request, options));
64071
64830
  }
64072
- async function $do69(client$, request, options) {
64831
+ async function $do71(client$, request, options) {
64073
64832
  const parsed$ = safeParse4(request, (value$) => ResumeSubscriptionRequestRequest$zodSchema.parse(value$), "Input validation failed");
64074
64833
  if (!parsed$.ok) {
64075
64834
  return [parsed$, { status: "invalid" }];
@@ -64145,12 +64904,12 @@ var init_subscriptionsResumeSubscription = __esm(() => {
64145
64904
  });
64146
64905
 
64147
64906
  // src/mcp-server/tools/subscriptionsResumeSubscription.ts
64148
- var args68, tool$subscriptionsResumeSubscription;
64907
+ var args70, tool$subscriptionsResumeSubscription;
64149
64908
  var init_subscriptionsResumeSubscription2 = __esm(() => {
64150
64909
  init_subscriptionsResumeSubscription();
64151
64910
  init_resumesubscriptionop();
64152
64911
  init_tools();
64153
- args68 = {
64912
+ args70 = {
64154
64913
  request: ResumeSubscriptionRequestRequest$zodSchema
64155
64914
  };
64156
64915
  tool$subscriptionsResumeSubscription = {
@@ -64166,9 +64925,9 @@ Use when reactivating a paused subscription (e.g. end of hold). Billing and acce
64166
64925
  openWorldHint: false,
64167
64926
  readOnlyHint: false
64168
64927
  },
64169
- args: args68,
64170
- tool: async (client, args69, ctx) => {
64171
- const [result] = await subscriptionsResumeSubscription(client, args69.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64928
+ args: args70,
64929
+ tool: async (client, args71, ctx) => {
64930
+ const [result] = await subscriptionsResumeSubscription(client, args71.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64172
64931
  if (!result.ok) {
64173
64932
  return {
64174
64933
  content: [{ type: "text", text: result.error.message }],
@@ -64212,9 +64971,9 @@ var init_updatesubscriptionop = __esm(() => {
64212
64971
 
64213
64972
  // src/funcs/subscriptionsUpdateSubscription.ts
64214
64973
  function subscriptionsUpdateSubscription(client$, request, options) {
64215
- return new APIPromise($do70(client$, request, options));
64974
+ return new APIPromise($do72(client$, request, options));
64216
64975
  }
64217
- async function $do70(client$, request, options) {
64976
+ async function $do72(client$, request, options) {
64218
64977
  const parsed$ = safeParse4(request, (value$) => UpdateSubscriptionRequestRequest$zodSchema.parse(value$), "Input validation failed");
64219
64978
  if (!parsed$.ok) {
64220
64979
  return [parsed$, { status: "invalid" }];
@@ -64290,12 +65049,12 @@ var init_subscriptionsUpdateSubscription = __esm(() => {
64290
65049
  });
64291
65050
 
64292
65051
  // src/mcp-server/tools/subscriptionsUpdateSubscription.ts
64293
- var args69, tool$subscriptionsUpdateSubscription;
65052
+ var args71, tool$subscriptionsUpdateSubscription;
64294
65053
  var init_subscriptionsUpdateSubscription2 = __esm(() => {
64295
65054
  init_subscriptionsUpdateSubscription();
64296
65055
  init_updatesubscriptionop();
64297
65056
  init_tools();
64298
- args69 = {
65057
+ args71 = {
64299
65058
  request: UpdateSubscriptionRequestRequest$zodSchema
64300
65059
  };
64301
65060
  tool$subscriptionsUpdateSubscription = {
@@ -64311,9 +65070,9 @@ Use when changing subscription details (e.g. quantity, billing anchor, or parent
64311
65070
  openWorldHint: false,
64312
65071
  readOnlyHint: false
64313
65072
  },
64314
- args: args69,
64315
- tool: async (client, args70, ctx) => {
64316
- const [result] = await subscriptionsUpdateSubscription(client, args70.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
65073
+ args: args71,
65074
+ tool: async (client, args72, ctx) => {
65075
+ const [result] = await subscriptionsUpdateSubscription(client, args72.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64317
65076
  if (!result.ok) {
64318
65077
  return {
64319
65078
  content: [{ type: "text", text: result.error.message }],
@@ -64372,9 +65131,9 @@ var init_updatesubscriptionlineitemop = __esm(() => {
64372
65131
 
64373
65132
  // src/funcs/subscriptionsUpdateSubscriptionLineItem.ts
64374
65133
  function subscriptionsUpdateSubscriptionLineItem(client$, request, options) {
64375
- return new APIPromise($do71(client$, request, options));
65134
+ return new APIPromise($do73(client$, request, options));
64376
65135
  }
64377
- async function $do71(client$, request, options) {
65136
+ async function $do73(client$, request, options) {
64378
65137
  const parsed$ = safeParse4(request, (value$) => UpdateSubscriptionLineItemRequestRequest$zodSchema.parse(value$), "Input validation failed");
64379
65138
  if (!parsed$.ok) {
64380
65139
  return [parsed$, { status: "invalid" }];
@@ -64450,12 +65209,12 @@ var init_subscriptionsUpdateSubscriptionLineItem = __esm(() => {
64450
65209
  });
64451
65210
 
64452
65211
  // src/mcp-server/tools/subscriptionsUpdateSubscriptionLineItem.ts
64453
- var args70, tool$subscriptionsUpdateSubscriptionLineItem;
65212
+ var args72, tool$subscriptionsUpdateSubscriptionLineItem;
64454
65213
  var init_subscriptionsUpdateSubscriptionLineItem2 = __esm(() => {
64455
65214
  init_subscriptionsUpdateSubscriptionLineItem();
64456
65215
  init_updatesubscriptionlineitemop();
64457
65216
  init_tools();
64458
- args70 = {
65217
+ args72 = {
64459
65218
  request: UpdateSubscriptionLineItemRequestRequest$zodSchema
64460
65219
  };
64461
65220
  tool$subscriptionsUpdateSubscriptionLineItem = {
@@ -64471,9 +65230,9 @@ Use when changing a subscription line item (e.g. quantity or price). Implemented
64471
65230
  openWorldHint: false,
64472
65231
  readOnlyHint: false
64473
65232
  },
64474
- args: args70,
64475
- tool: async (client, args71, ctx) => {
64476
- const [result] = await subscriptionsUpdateSubscriptionLineItem(client, args71.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
65233
+ args: args72,
65234
+ tool: async (client, args73, ctx) => {
65235
+ const [result] = await subscriptionsUpdateSubscriptionLineItem(client, args73.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
64477
65236
  if (!result.ok) {
64478
65237
  return {
64479
65238
  content: [{ type: "text", text: result.error.message }],
@@ -64489,16 +65248,16 @@ Use when changing a subscription line item (e.g. quantity or price). Implemented
64489
65248
  function createMCPServer(deps) {
64490
65249
  const server = new McpServer({
64491
65250
  name: "Flexprice",
64492
- version: "2.1.1"
65251
+ version: "2.1.3"
64493
65252
  });
64494
65253
  const getClient = deps.getSDK || (() => new FlexpriceCore({
64495
65254
  security: deps.security,
64496
65255
  serverURL: deps.serverURL,
64497
65256
  serverIdx: deps.serverIdx,
64498
65257
  debugLogger: deps.logger.level === "debug" ? {
64499
- log: (...args71) => console.log(...args71),
64500
- group: (...args71) => console.group(...args71),
64501
- groupEnd: (...args71) => console.groupEnd(...args71)
65258
+ log: (...args73) => console.log(...args73),
65259
+ group: (...args73) => console.group(...args73),
65260
+ groupEnd: (...args73) => console.groupEnd(...args73)
64502
65261
  } : undefined
64503
65262
  }));
64504
65263
  const scopes = new Set(deps.scopes);
@@ -64519,6 +65278,7 @@ function createMCPServer(deps) {
64519
65278
  tool(tool$customersGetCustomerUpcomingGrants);
64520
65279
  tool(tool$invoicesGetCustomerInvoiceSummary);
64521
65280
  tool(tool$invoicesCreateInvoice);
65281
+ tool(tool$invoicesGetMeterUsagePreviewInvoice);
64522
65282
  tool(tool$invoicesGetInvoicePreview);
64523
65283
  tool(tool$invoicesQueryInvoice);
64524
65284
  tool(tool$invoicesGetInvoice);
@@ -64544,7 +65304,7 @@ function createMCPServer(deps) {
64544
65304
  tool(tool$plansGetPlan);
64545
65305
  tool(tool$plansUpdatePlan);
64546
65306
  tool(tool$plansDeletePlan);
64547
- tool(tool$plansPostPlansIdClone);
65307
+ tool(tool$plansClonePlan);
64548
65308
  tool(tool$plansSyncPlanPrices);
64549
65309
  tool(tool$pricesCreatePrice);
64550
65310
  tool(tool$pricesCreatePricesBulk);
@@ -64571,6 +65331,7 @@ function createMCPServer(deps) {
64571
65331
  tool(tool$subscriptionsGetSubscriptionUpcomingGrants);
64572
65332
  tool(tool$subscriptionsCreateSubscriptionLineItem);
64573
65333
  tool(tool$subscriptionsExecuteSubscriptionModify);
65334
+ tool(tool$subscriptionsPreviewSubscriptionModify);
64574
65335
  tool(tool$subscriptionsPauseSubscription);
64575
65336
  tool(tool$subscriptionsListSubscriptionPauses);
64576
65337
  tool(tool$subscriptionsResumeSubscription);
@@ -64613,6 +65374,7 @@ var init_server2 = __esm(() => {
64613
65374
  init_invoicesGetInvoice2();
64614
65375
  init_invoicesGetInvoicePdf2();
64615
65376
  init_invoicesGetInvoicePreview2();
65377
+ init_invoicesGetMeterUsagePreviewInvoice2();
64616
65378
  init_invoicesQueryInvoice2();
64617
65379
  init_invoicesRecalculateInvoice2();
64618
65380
  init_invoicesRecalculateInvoiceV22();
@@ -64620,10 +65382,10 @@ var init_server2 = __esm(() => {
64620
65382
  init_invoicesUpdateInvoice2();
64621
65383
  init_invoicesUpdateInvoicePaymentStatus2();
64622
65384
  init_invoicesVoidInvoice2();
65385
+ init_plansClonePlan2();
64623
65386
  init_plansCreatePlan2();
64624
65387
  init_plansDeletePlan2();
64625
65388
  init_plansGetPlan2();
64626
- init_plansPostPlansIdClone2();
64627
65389
  init_plansQueryPlan2();
64628
65390
  init_plansSyncPlanPrices2();
64629
65391
  init_plansUpdatePlan2();
@@ -64655,6 +65417,7 @@ var init_server2 = __esm(() => {
64655
65417
  init_subscriptionsListSubscriptionSchedules2();
64656
65418
  init_subscriptionsPauseSubscription2();
64657
65419
  init_subscriptionsPreviewSubscriptionChange2();
65420
+ init_subscriptionsPreviewSubscriptionModify2();
64658
65421
  init_subscriptionsQuerySubscription2();
64659
65422
  init_subscriptionsRemoveSubscriptionAddon2();
64660
65423
  init_subscriptionsResumeSubscription2();
@@ -64731,6 +65494,12 @@ Use when showing a customer's invoice overview (e.g. billing portal or balance s
64731
65494
  description: `Create one-off invoice
64732
65495
 
64733
65496
  Use when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready.`
65497
+ },
65498
+ {
65499
+ name: "get-meter-usage-preview-invoice",
65500
+ description: `Get invoice preview using meter_usage data
65501
+
65502
+ Preview invoice using the meter_usage table for usage data instead of feature_usage.`
64734
65503
  },
64735
65504
  {
64736
65505
  name: "get-invoice-preview",
@@ -64883,7 +65652,7 @@ Use when changing plan details (e.g. name, interval, or metadata). Partial updat
64883
65652
  Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message.`
64884
65653
  },
64885
65654
  {
64886
- name: "plans-post-plans-id-clone",
65655
+ name: "clone-plan",
64887
65656
  description: `Clone a plan
64888
65657
 
64889
65658
  Clone an existing plan, copying its active prices, published entitlements, and published credit grants`
@@ -65040,9 +65809,15 @@ Use when adding a new charge or seat to a subscription (e.g. extra seat or one-t
65040
65809
  },
65041
65810
  {
65042
65811
  name: "execute-subscription-modify",
65043
- description: `Add customers to subscription inheritance
65812
+ description: `Execute subscription modification
65813
+
65814
+ Execute a mid-cycle subscription modification (inheritance or quantity change).`
65815
+ },
65816
+ {
65817
+ name: "preview-subscription-modify",
65818
+ description: `Preview subscription modification
65044
65819
 
65045
- Attach additional child customers (by external ID) to an active standalone or parent subscription; creates inherited skeleton subscriptions for each. The subscription must be active.`
65820
+ Preview the impact of a mid-cycle subscription modification without committing changes.`
65046
65821
  },
65047
65822
  {
65048
65823
  name: "pause-subscription",
@@ -68636,7 +69411,7 @@ var routes = buildRouteMap({
68636
69411
  var app = buildApplication(routes, {
68637
69412
  name: "mcp",
68638
69413
  versionInfo: {
68639
- currentVersion: "2.1.1"
69414
+ currentVersion: "2.1.3"
68640
69415
  }
68641
69416
  });
68642
69417
  run(app, process4.argv.slice(2), buildContext(process4));
@@ -68644,5 +69419,5 @@ export {
68644
69419
  app
68645
69420
  };
68646
69421
 
68647
- //# debugId=23F6971ECC7C194964756E2164756E21
69422
+ //# debugId=AA4FC1138BDCFCDB64756E2164756E21
68648
69423
  //# sourceMappingURL=mcp-server.js.map