@flexprice/mcp-server 2.1.20 → 2.1.24

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 (604) hide show
  1. package/bin/mcp-server.js +5424 -3807
  2. package/bin/mcp-server.js.map +187 -139
  3. package/bun.lock +46 -39
  4. package/esm/funcs/customersGetCustomerEntitlementsByExternalID.d.ts +16 -0
  5. package/esm/funcs/customersGetCustomerEntitlementsByExternalID.d.ts.map +1 -0
  6. package/esm/funcs/customersGetCustomerEntitlementsByExternalID.js +87 -0
  7. package/esm/funcs/customersGetCustomerEntitlementsByExternalID.js.map +1 -0
  8. package/esm/funcs/customersGetSubscriptionsForCustomer.d.ts +16 -0
  9. package/esm/funcs/customersGetSubscriptionsForCustomer.d.ts.map +1 -0
  10. package/esm/funcs/customersGetSubscriptionsForCustomer.js +91 -0
  11. package/esm/funcs/customersGetSubscriptionsForCustomer.js.map +1 -0
  12. package/esm/funcs/eventsGetEvent.d.ts +1 -1
  13. package/esm/funcs/eventsGetEvent.js +7 -9
  14. package/esm/funcs/eventsGetEvent.js.map +1 -1
  15. package/esm/funcs/eventsGetHuggingfaceInferenceData.d.ts +3 -2
  16. package/esm/funcs/eventsGetHuggingfaceInferenceData.d.ts.map +1 -1
  17. package/esm/funcs/eventsGetHuggingfaceInferenceData.js +15 -4
  18. package/esm/funcs/eventsGetHuggingfaceInferenceData.js.map +1 -1
  19. package/esm/funcs/invoicesGetInvoice.js +1 -0
  20. package/esm/funcs/invoicesGetInvoice.js.map +1 -1
  21. package/esm/funcs/invoicesUpdateInvoice.d.ts +1 -1
  22. package/esm/funcs/invoicesUpdateInvoice.js +1 -1
  23. package/esm/funcs/subscriptionsAddSubscriptionAddon.d.ts +3 -0
  24. package/esm/funcs/subscriptionsAddSubscriptionAddon.d.ts.map +1 -1
  25. package/esm/funcs/subscriptionsAddSubscriptionAddon.js +3 -0
  26. package/esm/funcs/subscriptionsAddSubscriptionAddon.js.map +1 -1
  27. package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
  28. package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +1 -1
  29. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts +16 -0
  30. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -0
  31. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js +88 -0
  32. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -0
  33. package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +1 -1
  34. package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +1 -1
  35. package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts +16 -0
  36. package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts.map +1 -0
  37. package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.js +88 -0
  38. package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.js.map +1 -0
  39. package/esm/funcs/subscriptionsRemoveSubscriptionAddon.d.ts +3 -0
  40. package/esm/funcs/subscriptionsRemoveSubscriptionAddon.d.ts.map +1 -1
  41. package/esm/funcs/subscriptionsRemoveSubscriptionAddon.js +3 -0
  42. package/esm/funcs/subscriptionsRemoveSubscriptionAddon.js.map +1 -1
  43. package/esm/lib/config.d.ts +3 -3
  44. package/esm/lib/config.js +3 -3
  45. package/esm/lib/http.d.ts +1 -1
  46. package/esm/lib/http.d.ts.map +1 -1
  47. package/esm/lib/http.js +1 -1
  48. package/esm/lib/http.js.map +1 -1
  49. package/esm/lib/security.d.ts +5 -4
  50. package/esm/lib/security.d.ts.map +1 -1
  51. package/esm/lib/security.js +4 -5
  52. package/esm/lib/security.js.map +1 -1
  53. package/esm/mcp-server/mcp-server.js +1 -1
  54. package/esm/mcp-server/server.d.ts.map +1 -1
  55. package/esm/mcp-server/server.js +10 -2
  56. package/esm/mcp-server/server.js.map +1 -1
  57. package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.d.ts +7 -0
  58. package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.d.ts.map +1 -0
  59. package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.js +35 -0
  60. package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.js.map +1 -0
  61. package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.d.ts +7 -0
  62. package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.d.ts.map +1 -0
  63. package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.js +35 -0
  64. package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.js.map +1 -0
  65. package/esm/mcp-server/tools/eventsGetEvent.js +1 -1
  66. package/esm/mcp-server/tools/eventsGetEvent.js.map +1 -1
  67. package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.d.ts +5 -1
  68. package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.d.ts.map +1 -1
  69. package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.js +8 -3
  70. package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.js.map +1 -1
  71. package/esm/mcp-server/tools/invoicesUpdateInvoice.js +1 -1
  72. package/esm/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -1
  73. package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.d.ts.map +1 -1
  74. package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.js +1 -0
  75. package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.js.map +1 -1
  76. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +1 -1
  77. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
  78. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts +7 -0
  79. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -0
  80. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js +35 -0
  81. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -0
  82. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +1 -1
  83. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -1
  84. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts +7 -0
  85. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts.map +1 -0
  86. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.js +35 -0
  87. package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.js.map +1 -0
  88. package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.d.ts.map +1 -1
  89. package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.js +1 -0
  90. package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.js.map +1 -1
  91. package/esm/mcp-server/tools.d.ts.map +1 -1
  92. package/esm/mcp-server/tools.js +2 -0
  93. package/esm/mcp-server/tools.js.map +1 -1
  94. package/esm/models/addaddonparams.d.ts +8 -0
  95. package/esm/models/addaddonparams.d.ts.map +1 -0
  96. package/esm/models/addaddonparams.js +10 -0
  97. package/esm/models/addaddonparams.js.map +1 -0
  98. package/esm/models/addaddonref.d.ts +12 -0
  99. package/esm/models/addaddonref.d.ts.map +1 -0
  100. package/esm/models/addaddonref.js +14 -0
  101. package/esm/models/addaddonref.js.map +1 -0
  102. package/esm/models/addaddonrequest.d.ts +4 -0
  103. package/esm/models/addaddonrequest.d.ts.map +1 -1
  104. package/esm/models/addaddonrequest.js +5 -0
  105. package/esm/models/addaddonrequest.js.map +1 -1
  106. package/esm/models/addaddontosubscriptionrequest.d.ts +2 -0
  107. package/esm/models/addaddontosubscriptionrequest.d.ts.map +1 -1
  108. package/esm/models/addaddontosubscriptionrequest.js +3 -0
  109. package/esm/models/addaddontosubscriptionrequest.js.map +1 -1
  110. package/esm/models/addaddontosubscriptionresponse.d.ts +31 -0
  111. package/esm/models/addaddontosubscriptionresponse.d.ts.map +1 -0
  112. package/esm/models/addaddontosubscriptionresponse.js +31 -0
  113. package/esm/models/addaddontosubscriptionresponse.js.map +1 -0
  114. package/esm/models/addonresponse.d.ts +2 -0
  115. package/esm/models/addonresponse.d.ts.map +1 -1
  116. package/esm/models/addonresponse.js +2 -0
  117. package/esm/models/addonresponse.js.map +1 -1
  118. package/esm/models/addonstatus.d.ts +1 -1
  119. package/esm/models/addsubscriptionaddonop.d.ts +2 -2
  120. package/esm/models/addsubscriptionaddonop.d.ts.map +1 -1
  121. package/esm/models/addsubscriptionaddonop.js +2 -2
  122. package/esm/models/addsubscriptionaddonop.js.map +1 -1
  123. package/esm/models/aggregatedentitlement.d.ts +9 -0
  124. package/esm/models/aggregatedentitlement.d.ts.map +1 -1
  125. package/esm/models/aggregatedentitlement.js +7 -1
  126. package/esm/models/aggregatedentitlement.js.map +1 -1
  127. package/esm/models/aggregatedentitlementbucket.d.ts +14 -0
  128. package/esm/models/aggregatedentitlementbucket.d.ts.map +1 -0
  129. package/esm/models/aggregatedentitlementbucket.js +16 -0
  130. package/esm/models/aggregatedentitlementbucket.js.map +1 -0
  131. package/esm/models/alertthreshold.d.ts +1 -1
  132. package/esm/models/alertthreshold.js +1 -1
  133. package/esm/models/applicationstatus.d.ts +3 -3
  134. package/esm/models/autotopup.d.ts +7 -0
  135. package/esm/models/autotopup.d.ts.map +1 -1
  136. package/esm/models/autotopup.js +7 -0
  137. package/esm/models/autotopup.js.map +1 -1
  138. package/esm/models/checkoutaction.d.ts +16 -0
  139. package/esm/models/checkoutaction.d.ts.map +1 -0
  140. package/esm/models/checkoutaction.js +17 -0
  141. package/esm/models/checkoutaction.js.map +1 -0
  142. package/esm/models/checkoutjsonbcheckoutconfiguration.d.ts +13 -0
  143. package/esm/models/checkoutjsonbcheckoutconfiguration.d.ts.map +1 -0
  144. package/esm/models/checkoutjsonbcheckoutconfiguration.js +15 -0
  145. package/esm/models/checkoutjsonbcheckoutconfiguration.js.map +1 -0
  146. package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.d.ts +10 -0
  147. package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.d.ts.map +1 -0
  148. package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.js +12 -0
  149. package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.js.map +1 -0
  150. package/esm/models/checkoutjsonbcheckoutproviderresult.d.ts +13 -0
  151. package/esm/models/checkoutjsonbcheckoutproviderresult.d.ts.map +1 -0
  152. package/esm/models/checkoutjsonbcheckoutproviderresult.js +13 -0
  153. package/esm/models/checkoutjsonbcheckoutproviderresult.js.map +1 -0
  154. package/esm/models/checkoutjsonbcheckoutresult.d.ts +7 -0
  155. package/esm/models/checkoutjsonbcheckoutresult.d.ts.map +1 -0
  156. package/esm/models/checkoutjsonbcheckoutresult.js +9 -0
  157. package/esm/models/checkoutjsonbcheckoutresult.js.map +1 -0
  158. package/esm/models/checkoutparams.d.ts +16 -0
  159. package/esm/models/checkoutparams.d.ts.map +1 -0
  160. package/esm/models/checkoutparams.js +16 -0
  161. package/esm/models/checkoutparams.js.map +1 -0
  162. package/esm/models/checkoutpaymentprovider.d.ts +10 -0
  163. package/esm/models/checkoutpaymentprovider.d.ts.map +1 -0
  164. package/esm/models/checkoutpaymentprovider.js +11 -0
  165. package/esm/models/checkoutpaymentprovider.js.map +1 -0
  166. package/esm/models/checkoutpaymentproviderconfig.d.ts +10 -0
  167. package/esm/models/checkoutpaymentproviderconfig.d.ts.map +1 -0
  168. package/esm/models/checkoutpaymentproviderconfig.js +12 -0
  169. package/esm/models/checkoutpaymentproviderconfig.js.map +1 -0
  170. package/esm/models/checkoutsessionresponse.d.ts +44 -0
  171. package/esm/models/checkoutsessionresponse.d.ts.map +1 -0
  172. package/esm/models/checkoutsessionresponse.js +45 -0
  173. package/esm/models/checkoutsessionresponse.js.map +1 -0
  174. package/esm/models/checkoutstatus.d.ts +18 -0
  175. package/esm/models/checkoutstatus.d.ts.map +1 -0
  176. package/esm/models/checkoutstatus.js +19 -0
  177. package/esm/models/checkoutstatus.js.map +1 -0
  178. package/esm/models/couponassociationresponse.d.ts +4 -2
  179. package/esm/models/couponassociationresponse.d.ts.map +1 -1
  180. package/esm/models/couponassociationresponse.js +4 -2
  181. package/esm/models/couponassociationresponse.js.map +1 -1
  182. package/esm/models/{coupon.d.ts → couponresponse.d.ts} +3 -3
  183. package/esm/models/couponresponse.d.ts.map +1 -0
  184. package/esm/models/{coupon.js → couponresponse.js} +2 -2
  185. package/esm/models/couponresponse.js.map +1 -0
  186. package/esm/models/createcreditgrantrequest.d.ts +1 -0
  187. package/esm/models/createcreditgrantrequest.d.ts.map +1 -1
  188. package/esm/models/createcreditgrantrequest.js +1 -0
  189. package/esm/models/createcreditgrantrequest.js.map +1 -1
  190. package/esm/models/createcustomerrequest.d.ts +4 -1
  191. package/esm/models/createcustomerrequest.d.ts.map +1 -1
  192. package/esm/models/createcustomerrequest.js +4 -1
  193. package/esm/models/createcustomerrequest.js.map +1 -1
  194. package/esm/models/createinvoicerequest.d.ts +1 -0
  195. package/esm/models/createinvoicerequest.d.ts.map +1 -1
  196. package/esm/models/createinvoicerequest.js +1 -0
  197. package/esm/models/createinvoicerequest.js.map +1 -1
  198. package/esm/models/createsubscriptionparams.d.ts +16 -0
  199. package/esm/models/createsubscriptionparams.d.ts.map +1 -0
  200. package/esm/models/createsubscriptionparams.js +16 -0
  201. package/esm/models/createsubscriptionparams.js.map +1 -0
  202. package/esm/models/createsubscriptionrequest.d.ts +3 -1
  203. package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
  204. package/esm/models/createsubscriptionrequest.js +19 -18
  205. package/esm/models/createsubscriptionrequest.js.map +1 -1
  206. package/esm/models/createsubscriptionresult.d.ts +8 -0
  207. package/esm/models/createsubscriptionresult.d.ts.map +1 -0
  208. package/esm/models/createsubscriptionresult.js +10 -0
  209. package/esm/models/createsubscriptionresult.js.map +1 -0
  210. package/esm/models/creditgrantresponse.d.ts +1 -0
  211. package/esm/models/creditgrantresponse.d.ts.map +1 -1
  212. package/esm/models/creditgrantresponse.js +1 -0
  213. package/esm/models/creditgrantresponse.js.map +1 -1
  214. package/esm/models/creditgrantscope.d.ts +2 -0
  215. package/esm/models/creditgrantscope.d.ts.map +1 -1
  216. package/esm/models/creditgrantscope.js +2 -0
  217. package/esm/models/creditgrantscope.js.map +1 -1
  218. package/esm/models/customer.d.ts +2 -0
  219. package/esm/models/customer.d.ts.map +1 -1
  220. package/esm/models/customer.js +2 -0
  221. package/esm/models/customer.js.map +1 -1
  222. package/esm/models/customerentitlementsresponse.d.ts +2 -0
  223. package/esm/models/customerentitlementsresponse.d.ts.map +1 -1
  224. package/esm/models/customerentitlementsresponse.js +2 -0
  225. package/esm/models/customerentitlementsresponse.js.map +1 -1
  226. package/esm/models/customerresponse.d.ts +2 -0
  227. package/esm/models/customerresponse.d.ts.map +1 -1
  228. package/esm/models/customerresponse.js +2 -0
  229. package/esm/models/customerresponse.js.map +1 -1
  230. package/esm/models/durationunit.d.ts +16 -0
  231. package/esm/models/durationunit.d.ts.map +1 -0
  232. package/esm/models/durationunit.js +17 -0
  233. package/esm/models/durationunit.js.map +1 -0
  234. package/esm/models/entitlementaggregationmode.d.ts +12 -0
  235. package/esm/models/entitlementaggregationmode.d.ts.map +1 -0
  236. package/esm/models/entitlementaggregationmode.js +13 -0
  237. package/esm/models/entitlementaggregationmode.js.map +1 -0
  238. package/esm/models/entitlementgrantdurationunit.d.ts +14 -0
  239. package/esm/models/entitlementgrantdurationunit.d.ts.map +1 -0
  240. package/esm/models/entitlementgrantdurationunit.js +15 -0
  241. package/esm/models/entitlementgrantdurationunit.js.map +1 -0
  242. package/esm/models/entitlementgrantmeasure.d.ts +12 -0
  243. package/esm/models/entitlementgrantmeasure.d.ts.map +1 -0
  244. package/esm/models/entitlementgrantmeasure.js +13 -0
  245. package/esm/models/entitlementgrantmeasure.js.map +1 -0
  246. package/esm/models/entitlementresponse.d.ts +11 -0
  247. package/esm/models/entitlementresponse.d.ts.map +1 -1
  248. package/esm/models/entitlementresponse.js +9 -0
  249. package/esm/models/entitlementresponse.js.map +1 -1
  250. package/esm/models/entitlementsource.d.ts +3 -0
  251. package/esm/models/entitlementsource.d.ts.map +1 -1
  252. package/esm/models/entitlementsource.js +1 -0
  253. package/esm/models/entitlementsource.js.map +1 -1
  254. package/esm/models/entitychangebehaviour.d.ts +12 -0
  255. package/esm/models/entitychangebehaviour.d.ts.map +1 -0
  256. package/esm/models/entitychangebehaviour.js +13 -0
  257. package/esm/models/entitychangebehaviour.js.map +1 -0
  258. package/esm/models/entitychangepolicy.d.ts +10 -0
  259. package/esm/models/entitychangepolicy.d.ts.map +1 -0
  260. package/esm/models/entitychangepolicy.js +12 -0
  261. package/esm/models/entitychangepolicy.js.map +1 -0
  262. package/esm/models/entitychangeresult.d.ts +11 -0
  263. package/esm/models/entitychangeresult.d.ts.map +1 -0
  264. package/esm/models/entitychangeresult.js +14 -0
  265. package/esm/models/entitychangeresult.js.map +1 -0
  266. package/esm/models/errorcode.d.ts +2 -0
  267. package/esm/models/errorcode.d.ts.map +1 -1
  268. package/esm/models/errorcode.js +2 -0
  269. package/esm/models/errorcode.js.map +1 -1
  270. package/esm/models/executesubscriptionmodifyrequest.d.ts +4 -0
  271. package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
  272. package/esm/models/executesubscriptionmodifyrequest.js +4 -0
  273. package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
  274. package/esm/models/executesubscriptionplanchangev2op.d.ts +12 -0
  275. package/esm/models/executesubscriptionplanchangev2op.d.ts.map +1 -0
  276. package/esm/models/executesubscriptionplanchangev2op.js +16 -0
  277. package/esm/models/executesubscriptionplanchangev2op.js.map +1 -0
  278. package/esm/models/featuretype.d.ts +2 -0
  279. package/esm/models/featuretype.d.ts.map +1 -1
  280. package/esm/models/featuretype.js +2 -0
  281. package/esm/models/featuretype.js.map +1 -1
  282. package/esm/models/filteroperatortype.d.ts +2 -0
  283. package/esm/models/filteroperatortype.d.ts.map +1 -1
  284. package/esm/models/filteroperatortype.js +2 -0
  285. package/esm/models/filteroperatortype.js.map +1 -1
  286. package/esm/models/getcustomerentitlementsbyexternalidop.d.ts +10 -0
  287. package/esm/models/getcustomerentitlementsbyexternalidop.d.ts.map +1 -0
  288. package/esm/models/getcustomerentitlementsbyexternalidop.js +14 -0
  289. package/esm/models/getcustomerentitlementsbyexternalidop.js.map +1 -0
  290. package/esm/models/gethuggingfacebillingdatarequest.d.ts +6 -0
  291. package/esm/models/gethuggingfacebillingdatarequest.d.ts.map +1 -0
  292. package/esm/models/gethuggingfacebillingdatarequest.js +8 -0
  293. package/esm/models/gethuggingfacebillingdatarequest.js.map +1 -0
  294. package/esm/models/getinvoiceop.d.ts +1 -0
  295. package/esm/models/getinvoiceop.d.ts.map +1 -1
  296. package/esm/models/getinvoiceop.js +1 -0
  297. package/esm/models/getinvoiceop.js.map +1 -1
  298. package/esm/models/getsubscriptionsforcustomerop.d.ts +11 -0
  299. package/esm/models/getsubscriptionsforcustomerop.d.ts.map +1 -0
  300. package/esm/models/getsubscriptionsforcustomerop.js +15 -0
  301. package/esm/models/getsubscriptionsforcustomerop.js.map +1 -0
  302. package/esm/models/getusageanalyticsresponse.d.ts +2 -0
  303. package/esm/models/getusageanalyticsresponse.d.ts.map +1 -1
  304. package/esm/models/getusageanalyticsresponse.js +3 -1
  305. package/esm/models/getusageanalyticsresponse.js.map +1 -1
  306. package/esm/models/getusagebymeterrequest.d.ts +1 -0
  307. package/esm/models/getusagebymeterrequest.d.ts.map +1 -1
  308. package/esm/models/getusagebymeterrequest.js +1 -0
  309. package/esm/models/getusagebymeterrequest.js.map +1 -1
  310. package/esm/models/getusagerequest.d.ts +1 -0
  311. package/esm/models/getusagerequest.d.ts.map +1 -1
  312. package/esm/models/getusagerequest.js +1 -0
  313. package/esm/models/getusagerequest.js.map +1 -1
  314. package/esm/models/groupedinvoicingchildrequest.d.ts +37 -0
  315. package/esm/models/groupedinvoicingchildrequest.d.ts.map +1 -0
  316. package/esm/models/groupedinvoicingchildrequest.js +40 -0
  317. package/esm/models/groupedinvoicingchildrequest.js.map +1 -0
  318. package/esm/models/integrationentitytype.d.ts +2 -0
  319. package/esm/models/integrationentitytype.d.ts.map +1 -1
  320. package/esm/models/integrationentitytype.js +2 -0
  321. package/esm/models/integrationentitytype.js.map +1 -1
  322. package/esm/models/invoicelineitemcoupon.d.ts +1 -0
  323. package/esm/models/invoicelineitemcoupon.d.ts.map +1 -1
  324. package/esm/models/invoicelineitemcoupon.js +1 -0
  325. package/esm/models/invoicelineitemcoupon.js.map +1 -1
  326. package/esm/models/invoicelineitemresponse.d.ts +1 -0
  327. package/esm/models/invoicelineitemresponse.d.ts.map +1 -1
  328. package/esm/models/invoicelineitemresponse.js +1 -0
  329. package/esm/models/invoicelineitemresponse.js.map +1 -1
  330. package/esm/models/invoiceresponse.d.ts +1 -0
  331. package/esm/models/invoiceresponse.d.ts.map +1 -1
  332. package/esm/models/invoiceresponse.js +1 -0
  333. package/esm/models/invoiceresponse.js.map +1 -1
  334. package/esm/models/lineitemcommitmentconfig.d.ts.map +1 -1
  335. package/esm/models/lineitemcommitmentconfig.js +6 -6
  336. package/esm/models/lineitemcommitmentconfig.js.map +1 -1
  337. package/esm/models/lineitemquantitychange.d.ts +1 -1
  338. package/esm/models/lineitemquantitychange.d.ts.map +1 -1
  339. package/esm/models/lineitemquantitychange.js +1 -1
  340. package/esm/models/lineitemquantitychange.js.map +1 -1
  341. package/esm/models/modifysubscriptionlineitem.d.ts +8 -0
  342. package/esm/models/modifysubscriptionlineitem.d.ts.map +1 -0
  343. package/esm/models/modifysubscriptionlineitem.js +10 -0
  344. package/esm/models/modifysubscriptionlineitem.js.map +1 -0
  345. package/esm/models/modifysubscriptionparams.d.ts +8 -0
  346. package/esm/models/modifysubscriptionparams.d.ts.map +1 -0
  347. package/esm/models/modifysubscriptionparams.js +11 -0
  348. package/esm/models/modifysubscriptionparams.js.map +1 -0
  349. package/esm/models/overrideentitlementrequest.d.ts +3 -0
  350. package/esm/models/overrideentitlementrequest.d.ts.map +1 -1
  351. package/esm/models/overrideentitlementrequest.js +1 -0
  352. package/esm/models/overrideentitlementrequest.js.map +1 -1
  353. package/esm/models/pausestatus.d.ts +2 -2
  354. package/esm/models/paymentaction.d.ts +8 -0
  355. package/esm/models/paymentaction.d.ts.map +1 -0
  356. package/esm/models/paymentaction.js +10 -0
  357. package/esm/models/paymentaction.js.map +1 -0
  358. package/esm/models/paymentactiontype.d.ts +12 -0
  359. package/esm/models/paymentactiontype.d.ts.map +1 -0
  360. package/esm/models/paymentactiontype.js +13 -0
  361. package/esm/models/paymentactiontype.js.map +1 -0
  362. package/esm/models/paymentmethodtype.d.ts +20 -0
  363. package/esm/models/paymentmethodtype.d.ts.map +1 -0
  364. package/esm/models/paymentmethodtype.js +21 -0
  365. package/esm/models/paymentmethodtype.js.map +1 -0
  366. package/esm/models/paymentstatus.d.ts +2 -0
  367. package/esm/models/paymentstatus.d.ts.map +1 -1
  368. package/esm/models/paymentstatus.js +2 -0
  369. package/esm/models/paymentstatus.js.map +1 -1
  370. package/esm/models/previewsubscriptionplanchangev2op.d.ts +12 -0
  371. package/esm/models/previewsubscriptionplanchangev2op.d.ts.map +1 -0
  372. package/esm/models/previewsubscriptionplanchangev2op.js +16 -0
  373. package/esm/models/previewsubscriptionplanchangev2op.js.map +1 -0
  374. package/esm/models/removeaddonrequest.js +1 -1
  375. package/esm/models/removeaddonrequest.js.map +1 -1
  376. package/esm/models/schedulestatus.d.ts +1 -1
  377. package/esm/models/submodifyaddonparams.d.ts +11 -0
  378. package/esm/models/submodifyaddonparams.d.ts.map +1 -0
  379. package/esm/models/submodifyaddonparams.js +14 -0
  380. package/esm/models/submodifyaddonparams.js.map +1 -0
  381. package/esm/models/subscriptionchangeentitypolicies.d.ts +7 -0
  382. package/esm/models/subscriptionchangeentitypolicies.d.ts.map +1 -0
  383. package/esm/models/subscriptionchangeentitypolicies.js +9 -0
  384. package/esm/models/subscriptionchangeentitypolicies.js.map +1 -0
  385. package/esm/models/subscriptionchangev2request.d.ts +14 -0
  386. package/esm/models/subscriptionchangev2request.d.ts.map +1 -0
  387. package/esm/models/subscriptionchangev2request.js +14 -0
  388. package/esm/models/subscriptionchangev2request.js.map +1 -0
  389. package/esm/models/subscriptionchangev2response.d.ts +21 -0
  390. package/esm/models/subscriptionchangev2response.d.ts.map +1 -0
  391. package/esm/models/subscriptionchangev2response.js +21 -0
  392. package/esm/models/subscriptionchangev2response.js.map +1 -0
  393. package/esm/models/subscriptioncouponinput.d.ts.map +1 -1
  394. package/esm/models/subscriptioncouponinput.js +4 -4
  395. package/esm/models/subscriptioncouponinput.js.map +1 -1
  396. package/esm/models/subscriptionfilter.d.ts +1 -0
  397. package/esm/models/subscriptionfilter.d.ts.map +1 -1
  398. package/esm/models/subscriptionfilter.js +2 -1
  399. package/esm/models/subscriptionfilter.js.map +1 -1
  400. package/esm/models/subscriptioninheritanceconfig.d.ts +2 -0
  401. package/esm/models/subscriptioninheritanceconfig.d.ts.map +1 -1
  402. package/esm/models/subscriptioninheritanceconfig.js +6 -4
  403. package/esm/models/subscriptioninheritanceconfig.js.map +1 -1
  404. package/esm/models/subscriptionlineitemfilter.d.ts +1 -0
  405. package/esm/models/subscriptionlineitemfilter.d.ts.map +1 -1
  406. package/esm/models/subscriptionlineitemfilter.js +2 -1
  407. package/esm/models/subscriptionlineitemfilter.js.map +1 -1
  408. package/esm/models/subscriptionlineitemresponse.d.ts +2 -0
  409. package/esm/models/subscriptionlineitemresponse.d.ts.map +1 -1
  410. package/esm/models/subscriptionlineitemresponse.js +2 -0
  411. package/esm/models/subscriptionlineitemresponse.js.map +1 -1
  412. package/esm/models/subscriptionmodificationaction.d.ts +12 -0
  413. package/esm/models/subscriptionmodificationaction.d.ts.map +1 -0
  414. package/esm/models/subscriptionmodificationaction.js +13 -0
  415. package/esm/models/subscriptionmodificationaction.js.map +1 -0
  416. package/esm/models/subscriptionmodifyresponse.d.ts +2 -0
  417. package/esm/models/subscriptionmodifyresponse.d.ts.map +1 -1
  418. package/esm/models/subscriptionmodifyresponse.js +2 -0
  419. package/esm/models/subscriptionmodifyresponse.js.map +1 -1
  420. package/esm/models/subscriptionmodifytype.d.ts +2 -0
  421. package/esm/models/subscriptionmodifytype.d.ts.map +1 -1
  422. package/esm/models/subscriptionmodifytype.js +2 -0
  423. package/esm/models/subscriptionmodifytype.js.map +1 -1
  424. package/esm/models/subscriptionphasecreaterequest.js +2 -2
  425. package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
  426. package/esm/models/subscriptionresponse.d.ts +5 -1
  427. package/esm/models/subscriptionresponse.d.ts.map +1 -1
  428. package/esm/models/subscriptionresponse.js +5 -1
  429. package/esm/models/subscriptionresponse.js.map +1 -1
  430. package/esm/models/subscriptionresponsev2.d.ts +1 -1
  431. package/esm/models/subscriptionresponsev2.d.ts.map +1 -1
  432. package/esm/models/subscriptionresponsev2.js +1 -1
  433. package/esm/models/subscriptionresponsev2.js.map +1 -1
  434. package/esm/models/subscriptionstatus.d.ts +1 -1
  435. package/esm/models/subscriptionsubscriptionlineitem.d.ts +2 -0
  436. package/esm/models/subscriptionsubscriptionlineitem.d.ts.map +1 -1
  437. package/esm/models/subscriptionsubscriptionlineitem.js +2 -0
  438. package/esm/models/subscriptionsubscriptionlineitem.js.map +1 -1
  439. package/esm/models/transactionreason.d.ts +2 -0
  440. package/esm/models/transactionreason.d.ts.map +1 -1
  441. package/esm/models/transactionreason.js +2 -0
  442. package/esm/models/transactionreason.js.map +1 -1
  443. package/esm/models/transactionstatus.d.ts +1 -1
  444. package/esm/models/updatecustomerrequest.d.ts +2 -0
  445. package/esm/models/updatecustomerrequest.d.ts.map +1 -1
  446. package/esm/models/updatecustomerrequest.js +2 -0
  447. package/esm/models/updatecustomerrequest.js.map +1 -1
  448. package/esm/models/updateinvoicerequest.d.ts +1 -0
  449. package/esm/models/updateinvoicerequest.d.ts.map +1 -1
  450. package/esm/models/updateinvoicerequest.js +1 -0
  451. package/esm/models/updateinvoicerequest.js.map +1 -1
  452. package/esm/models/usageanalyticitem.d.ts +2 -0
  453. package/esm/models/usageanalyticitem.d.ts.map +1 -1
  454. package/esm/models/usageanalyticitem.js +3 -1
  455. package/esm/models/usageanalyticitem.js.map +1 -1
  456. package/esm/models/usageanalyticpoint.d.ts +2 -0
  457. package/esm/models/usageanalyticpoint.d.ts.map +1 -1
  458. package/esm/models/usageanalyticpoint.js +3 -1
  459. package/esm/models/usageanalyticpoint.js.map +1 -1
  460. package/esm/models/walletresponse.d.ts +2 -0
  461. package/esm/models/walletresponse.d.ts.map +1 -1
  462. package/esm/models/walletresponse.js +2 -0
  463. package/esm/models/walletresponse.js.map +1 -1
  464. package/esm/models/wallettopupparams.d.ts +7 -0
  465. package/esm/models/wallettopupparams.d.ts.map +1 -0
  466. package/esm/models/wallettopupparams.js +10 -0
  467. package/esm/models/wallettopupparams.js.map +1 -0
  468. package/esm/models/wallettransactionresponse.d.ts +1 -0
  469. package/esm/models/wallettransactionresponse.d.ts.map +1 -1
  470. package/esm/models/wallettransactionresponse.js +1 -0
  471. package/esm/models/wallettransactionresponse.js.map +1 -1
  472. package/esm/tool-names.d.ts.map +1 -1
  473. package/esm/tool-names.js +26 -10
  474. package/esm/tool-names.js.map +1 -1
  475. package/esm/tsconfig.tsbuildinfo +1 -1
  476. package/manifest.json +27 -11
  477. package/package.json +9 -2
  478. package/src/funcs/customersGetCustomerEntitlementsByExternalID.ts +153 -0
  479. package/src/funcs/customersGetSubscriptionsForCustomer.ts +156 -0
  480. package/src/funcs/eventsGetEvent.ts +7 -12
  481. package/src/funcs/eventsGetHuggingfaceInferenceData.ts +22 -1
  482. package/src/funcs/invoicesGetInvoice.ts +1 -0
  483. package/src/funcs/invoicesUpdateInvoice.ts +1 -1
  484. package/src/funcs/subscriptionsAddSubscriptionAddon.ts +3 -0
  485. package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +1 -1
  486. package/src/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.ts +153 -0
  487. package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +1 -1
  488. package/src/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.ts +153 -0
  489. package/src/funcs/subscriptionsRemoveSubscriptionAddon.ts +3 -0
  490. package/src/lib/config.ts +3 -3
  491. package/src/lib/http.ts +3 -1
  492. package/src/lib/security.ts +10 -5
  493. package/src/mcp-server/mcp-server.ts +1 -1
  494. package/src/mcp-server/server.ts +10 -2
  495. package/src/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.ts +45 -0
  496. package/src/mcp-server/tools/customersGetSubscriptionsForCustomer.ts +45 -0
  497. package/src/mcp-server/tools/eventsGetEvent.ts +1 -1
  498. package/src/mcp-server/tools/eventsGetHuggingfaceInferenceData.ts +12 -3
  499. package/src/mcp-server/tools/invoicesUpdateInvoice.ts +1 -1
  500. package/src/mcp-server/tools/subscriptionsAddSubscriptionAddon.ts +1 -0
  501. package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +1 -1
  502. package/src/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.ts +45 -0
  503. package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +1 -1
  504. package/src/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.ts +45 -0
  505. package/src/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.ts +1 -0
  506. package/src/mcp-server/tools.ts +2 -0
  507. package/src/models/addaddonparams.ts +16 -0
  508. package/src/models/addaddonref.ts +26 -0
  509. package/src/models/addaddonrequest.ts +12 -0
  510. package/src/models/addaddontosubscriptionrequest.ts +9 -0
  511. package/src/models/addaddontosubscriptionresponse.ts +65 -0
  512. package/src/models/addonresponse.ts +6 -0
  513. package/src/models/addsubscriptionaddonop.ts +5 -5
  514. package/src/models/aggregatedentitlement.ts +21 -3
  515. package/src/models/aggregatedentitlementbucket.ts +35 -0
  516. package/src/models/alertthreshold.ts +2 -2
  517. package/src/models/autotopup.ts +14 -0
  518. package/src/models/checkoutaction.ts +21 -0
  519. package/src/models/checkoutjsonbcheckoutconfiguration.ts +34 -0
  520. package/src/models/checkoutjsonbcheckoutpaymentproviderconfig.ts +27 -0
  521. package/src/models/checkoutjsonbcheckoutproviderresult.ts +32 -0
  522. package/src/models/checkoutjsonbcheckoutresult.ts +19 -0
  523. package/src/models/checkoutparams.ts +33 -0
  524. package/src/models/checkoutpaymentprovider.ts +17 -0
  525. package/src/models/checkoutpaymentproviderconfig.ts +27 -0
  526. package/src/models/checkoutsessionresponse.ts +106 -0
  527. package/src/models/checkoutstatus.ts +23 -0
  528. package/src/models/couponassociationresponse.ts +9 -3
  529. package/src/models/{coupon.ts → couponresponse.ts} +2 -2
  530. package/src/models/createcreditgrantrequest.ts +2 -0
  531. package/src/models/createcustomerrequest.ts +14 -2
  532. package/src/models/createinvoicerequest.ts +4 -0
  533. package/src/models/createsubscriptionparams.ts +30 -0
  534. package/src/models/createsubscriptionrequest.ts +21 -39
  535. package/src/models/createsubscriptionresult.ts +19 -0
  536. package/src/models/creditgrantresponse.ts +2 -0
  537. package/src/models/creditgrantscope.ts +2 -0
  538. package/src/models/customer.ts +8 -0
  539. package/src/models/customerentitlementsresponse.ts +6 -0
  540. package/src/models/customerresponse.ts +8 -0
  541. package/src/models/durationunit.ts +21 -0
  542. package/src/models/entitlementaggregationmode.ts +19 -0
  543. package/src/models/entitlementgrantdurationunit.ts +21 -0
  544. package/src/models/entitlementgrantmeasure.ts +19 -0
  545. package/src/models/entitlementresponse.ts +24 -0
  546. package/src/models/entitlementsource.ts +2 -0
  547. package/src/models/entitychangebehaviour.ts +17 -0
  548. package/src/models/entitychangepolicy.ts +23 -0
  549. package/src/models/entitychangeresult.ts +28 -0
  550. package/src/models/errorcode.ts +2 -0
  551. package/src/models/executesubscriptionmodifyrequest.ts +9 -0
  552. package/src/models/executesubscriptionplanchangev2op.ts +37 -0
  553. package/src/models/featuretype.ts +2 -0
  554. package/src/models/filteroperatortype.ts +2 -0
  555. package/src/models/getcustomerentitlementsbyexternalidop.ts +31 -0
  556. package/src/models/gethuggingfacebillingdatarequest.ts +13 -0
  557. package/src/models/getinvoiceop.ts +4 -0
  558. package/src/models/getsubscriptionsforcustomerop.ts +35 -0
  559. package/src/models/getusageanalyticsresponse.ts +7 -1
  560. package/src/models/getusagebymeterrequest.ts +2 -0
  561. package/src/models/getusagerequest.ts +2 -0
  562. package/src/models/groupedinvoicingchildrequest.ts +104 -0
  563. package/src/models/integrationentitytype.ts +2 -0
  564. package/src/models/invoicelineitemcoupon.ts +2 -0
  565. package/src/models/invoicelineitemresponse.ts +4 -0
  566. package/src/models/invoiceresponse.ts +4 -0
  567. package/src/models/lineitemcommitmentconfig.ts +6 -10
  568. package/src/models/lineitemquantitychange.ts +2 -2
  569. package/src/models/modifysubscriptionlineitem.ts +19 -0
  570. package/src/models/modifysubscriptionparams.ts +22 -0
  571. package/src/models/overrideentitlementrequest.ts +4 -0
  572. package/src/models/paymentaction.ts +19 -0
  573. package/src/models/paymentactiontype.ts +17 -0
  574. package/src/models/paymentmethodtype.ts +25 -0
  575. package/src/models/paymentstatus.ts +2 -0
  576. package/src/models/previewsubscriptionplanchangev2op.ts +37 -0
  577. package/src/models/removeaddonrequest.ts +1 -1
  578. package/src/models/submodifyaddonparams.ts +30 -0
  579. package/src/models/subscriptionchangeentitypolicies.ts +19 -0
  580. package/src/models/subscriptionchangev2request.ts +31 -0
  581. package/src/models/subscriptionchangev2response.ts +48 -0
  582. package/src/models/subscriptioncouponinput.ts +4 -12
  583. package/src/models/subscriptionfilter.ts +5 -1
  584. package/src/models/subscriptioninheritanceconfig.ts +14 -4
  585. package/src/models/subscriptionlineitemfilter.ts +5 -1
  586. package/src/models/subscriptionlineitemresponse.ts +3 -0
  587. package/src/models/subscriptionmodificationaction.ts +19 -0
  588. package/src/models/subscriptionmodifyresponse.ts +6 -0
  589. package/src/models/subscriptionmodifytype.ts +2 -0
  590. package/src/models/subscriptionphasecreaterequest.ts +2 -2
  591. package/src/models/subscriptionresponse.ts +16 -2
  592. package/src/models/subscriptionresponsev2.ts +2 -2
  593. package/src/models/subscriptionsubscriptionlineitem.ts +3 -0
  594. package/src/models/transactionreason.ts +2 -0
  595. package/src/models/updatecustomerrequest.ts +8 -0
  596. package/src/models/updateinvoicerequest.ts +4 -0
  597. package/src/models/usageanalyticitem.ts +7 -1
  598. package/src/models/usageanalyticpoint.ts +7 -1
  599. package/src/models/walletresponse.ts +4 -0
  600. package/src/models/wallettopupparams.ts +16 -0
  601. package/src/models/wallettransactionresponse.ts +4 -0
  602. package/src/tool-names.ts +26 -10
  603. package/esm/models/coupon.d.ts.map +0 -1
  604. package/esm/models/coupon.js.map +0 -1
@@ -0,0 +1,153 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { FlexpriceCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { compactMap } from "../lib/primitives.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import { APIError } from "../models/errors/apierror.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
+ import {
22
+ ExecuteSubscriptionPlanChangeV2Request,
23
+ ExecuteSubscriptionPlanChangeV2Request$zodSchema,
24
+ } from "../models/executesubscriptionplanchangev2op.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Execute a plan change (v2, swap in place)
30
+ *
31
+ * @remarks
32
+ * Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.
33
+ */
34
+ export function subscriptionsExecuteSubscriptionPlanChangeV2(
35
+ client$: FlexpriceCore,
36
+ request: ExecuteSubscriptionPlanChangeV2Request,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ Response,
41
+ | APIError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client$,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client$: FlexpriceCore,
59
+ request: ExecuteSubscriptionPlanChangeV2Request,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ Response,
65
+ | APIError
66
+ | SDKValidationError
67
+ | UnexpectedClientError
68
+ | InvalidRequestError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | ConnectionError
72
+ >,
73
+ APICall,
74
+ ]
75
+ > {
76
+ const parsed$ = safeParse(
77
+ request,
78
+ (value$) => ExecuteSubscriptionPlanChangeV2Request$zodSchema.parse(value$),
79
+ "Input validation failed",
80
+ );
81
+ if (!parsed$.ok) {
82
+ return [parsed$, { status: "invalid" }];
83
+ }
84
+ const payload$ = parsed$.value;
85
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
86
+
87
+ const pathParams$ = {
88
+ id: encodeSimple("id", payload$.id, {
89
+ explode: false,
90
+ charEncoding: "percent",
91
+ }),
92
+ };
93
+ const path$ = pathToFunc("/subscriptions/{id}/change/v2/execute")(
94
+ pathParams$,
95
+ );
96
+
97
+ const headers$ = new Headers(compactMap({
98
+ "Content-Type": "application/json",
99
+ Accept: "application/json",
100
+ }));
101
+ const securityInput = await extractSecurity(client$._options.security);
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client$._options,
106
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
107
+ operationID: "executeSubscriptionPlanChangeV2",
108
+ oAuth2Scopes: null,
109
+ resolvedSecurity: requestSecurity,
110
+ securitySource: client$._options.security,
111
+ retryConfig: options?.retries
112
+ || client$._options.retryConfig
113
+ || { strategy: "none" },
114
+ retryCodes: options?.retryCodes || [
115
+ "429",
116
+ "500",
117
+ "502",
118
+ "503",
119
+ "504",
120
+ ],
121
+ };
122
+
123
+ const requestRes = client$._createRequest(context, {
124
+ security: requestSecurity,
125
+ method: "POST",
126
+ baseURL: options?.serverURL,
127
+ path: path$,
128
+ headers: headers$,
129
+ body: body$,
130
+ userAgent: client$._options.userAgent,
131
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
132
+ || -1,
133
+ }, options);
134
+ if (!requestRes.ok) {
135
+ return [requestRes, { status: "invalid" }];
136
+ }
137
+ const req$ = requestRes.value;
138
+
139
+ const doResult = await client$._do(req$, {
140
+ context,
141
+ errorCodes: [],
142
+ retryConfig: context.retryConfig,
143
+ retryCodes: context.retryCodes,
144
+ });
145
+ if (!doResult.ok) {
146
+ return [doResult, { status: "request-error", request: req$ }];
147
+ }
148
+ return [doResult, {
149
+ status: "complete",
150
+ "request": req$,
151
+ response: doResult.value,
152
+ }];
153
+ }
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
29
29
  * Preview subscription modification
30
30
  *
31
31
  * @remarks
32
- * Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax) without committing changes.
32
+ * Preview the impact of a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, or addon add/remove) without committing changes.
33
33
  */
34
34
  export function subscriptionsPreviewSubscriptionModify(
35
35
  client$: FlexpriceCore,
@@ -0,0 +1,153 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { FlexpriceCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import { compactMap } from "../lib/primitives.js";
8
+ import { safeParse } from "../lib/schemas.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import { APIError } from "../models/errors/apierror.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
+ import {
22
+ PreviewSubscriptionPlanChangeV2Request,
23
+ PreviewSubscriptionPlanChangeV2Request$zodSchema,
24
+ } from "../models/previewsubscriptionplanchangev2op.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Preview a plan change (v2, swap in place)
30
+ *
31
+ * @remarks
32
+ * Preview a subscription plan change without writing. Swap-in-place: subscription id, billing anchor and period bounds are preserved.
33
+ */
34
+ export function subscriptionsPreviewSubscriptionPlanChangeV2(
35
+ client$: FlexpriceCore,
36
+ request: PreviewSubscriptionPlanChangeV2Request,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ Response,
41
+ | APIError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ return new APIPromise($do(
51
+ client$,
52
+ request,
53
+ options,
54
+ ));
55
+ }
56
+
57
+ async function $do(
58
+ client$: FlexpriceCore,
59
+ request: PreviewSubscriptionPlanChangeV2Request,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ Response,
65
+ | APIError
66
+ | SDKValidationError
67
+ | UnexpectedClientError
68
+ | InvalidRequestError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | ConnectionError
72
+ >,
73
+ APICall,
74
+ ]
75
+ > {
76
+ const parsed$ = safeParse(
77
+ request,
78
+ (value$) => PreviewSubscriptionPlanChangeV2Request$zodSchema.parse(value$),
79
+ "Input validation failed",
80
+ );
81
+ if (!parsed$.ok) {
82
+ return [parsed$, { status: "invalid" }];
83
+ }
84
+ const payload$ = parsed$.value;
85
+ const body$ = encodeJSON("body", payload$.body, { explode: true });
86
+
87
+ const pathParams$ = {
88
+ id: encodeSimple("id", payload$.id, {
89
+ explode: false,
90
+ charEncoding: "percent",
91
+ }),
92
+ };
93
+ const path$ = pathToFunc("/subscriptions/{id}/change/v2/preview")(
94
+ pathParams$,
95
+ );
96
+
97
+ const headers$ = new Headers(compactMap({
98
+ "Content-Type": "application/json",
99
+ Accept: "application/json",
100
+ }));
101
+ const securityInput = await extractSecurity(client$._options.security);
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client$._options,
106
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
107
+ operationID: "previewSubscriptionPlanChangeV2",
108
+ oAuth2Scopes: null,
109
+ resolvedSecurity: requestSecurity,
110
+ securitySource: client$._options.security,
111
+ retryConfig: options?.retries
112
+ || client$._options.retryConfig
113
+ || { strategy: "none" },
114
+ retryCodes: options?.retryCodes || [
115
+ "429",
116
+ "500",
117
+ "502",
118
+ "503",
119
+ "504",
120
+ ],
121
+ };
122
+
123
+ const requestRes = client$._createRequest(context, {
124
+ security: requestSecurity,
125
+ method: "POST",
126
+ baseURL: options?.serverURL,
127
+ path: path$,
128
+ headers: headers$,
129
+ body: body$,
130
+ userAgent: client$._options.userAgent,
131
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs
132
+ || -1,
133
+ }, options);
134
+ if (!requestRes.ok) {
135
+ return [requestRes, { status: "invalid" }];
136
+ }
137
+ const req$ = requestRes.value;
138
+
139
+ const doResult = await client$._do(req$, {
140
+ context,
141
+ errorCodes: [],
142
+ retryConfig: context.retryConfig,
143
+ retryCodes: context.retryCodes,
144
+ });
145
+ if (!doResult.ok) {
146
+ return [doResult, { status: "request-error", request: req$ }];
147
+ }
148
+ return [doResult, {
149
+ status: "complete",
150
+ "request": req$,
151
+ response: doResult.value,
152
+ }];
153
+ }
@@ -29,7 +29,10 @@ import { Result } from "../types/fp.js";
29
29
  * Remove addon from subscription
30
30
  *
31
31
  * @remarks
32
+ * Deprecated: use POST /subscriptions/{id}/modify/execute with type "addon" and action "remove", which also supports previewing the proration credit first.
32
33
  * Use when removing an add-on from a subscription (e.g. downgrade or opt-out).
34
+ *
35
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
33
36
  */
34
37
  export function subscriptionsRemoveSubscriptionAddon(
35
38
  client$: FlexpriceCore,
package/src/lib/config.ts CHANGED
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
69
  export const SDK_METADATA = {
70
70
  language: "typescript",
71
71
  openapiDocVersion: "1.0",
72
- sdkVersion: "2.1.20",
73
- genVersion: "2.911.0",
72
+ sdkVersion: "2.1.24",
73
+ genVersion: "2.931.0",
74
74
  userAgent:
75
- "speakeasy-sdk/mcp-typescript 2.1.20 2.911.0 1.0 @flexprice/mcp-server",
75
+ "speakeasy-sdk/mcp-typescript 2.1.24 2.931.0 1.0 @flexprice/mcp-server",
76
76
  } as const;
package/src/lib/http.ts CHANGED
@@ -45,8 +45,10 @@ export class HTTPClient {
45
45
  private requestHooks: BeforeRequestHook[] = [];
46
46
  private requestErrorHooks: RequestErrorHook[] = [];
47
47
  private responseHooks: ResponseHook[] = [];
48
+ private options: HTTPClientOptions;
48
49
 
49
- constructor(private options: HTTPClientOptions = {}) {
50
+ constructor(options: HTTPClientOptions = {}) {
51
+ this.options = options;
50
52
  this.fetcher = options.fetcher || DEFAULT_FETCHER;
51
53
  }
52
54
 
@@ -12,17 +12,22 @@ type OAuth2PasswordFlow = {
12
12
  tokenURL: string;
13
13
  };
14
14
 
15
- export enum SecurityErrorCode {
16
- Incomplete = "incomplete",
17
- UnrecognisedSecurityType = "unrecognized_security_type",
18
- }
15
+ export const SecurityErrorCode = {
16
+ Incomplete: "incomplete",
17
+ UnrecognisedSecurityType: "unrecognized_security_type",
18
+ } as const;
19
+ export type SecurityErrorCode =
20
+ (typeof SecurityErrorCode)[keyof typeof SecurityErrorCode];
19
21
 
20
22
  export class SecurityError extends Error {
23
+ public code: SecurityErrorCode;
24
+
21
25
  constructor(
22
- public code: SecurityErrorCode,
26
+ code: SecurityErrorCode,
23
27
  message: string,
24
28
  ) {
25
29
  super(message);
30
+ this.code = code;
26
31
  this.name = "SecurityError";
27
32
  }
28
33
 
@@ -21,7 +21,7 @@ const routes = buildRouteMap({
21
21
  export const app = buildApplication(routes, {
22
22
  name: "mcp",
23
23
  versionInfo: {
24
- currentVersion: "2.1.20",
24
+ currentVersion: "2.1.24",
25
25
  },
26
26
  });
27
27
 
@@ -22,8 +22,10 @@ import { tool$customersDeleteCustomer } from "./tools/customersDeleteCustomer.js
22
22
  import { tool$customersGetCustomer } from "./tools/customersGetCustomer.js";
23
23
  import { tool$customersGetCustomerByExternalId } from "./tools/customersGetCustomerByExternalId.js";
24
24
  import { tool$customersGetCustomerEntitlements } from "./tools/customersGetCustomerEntitlements.js";
25
+ import { tool$customersGetCustomerEntitlementsByExternalID } from "./tools/customersGetCustomerEntitlementsByExternalID.js";
25
26
  import { tool$customersGetCustomerUpcomingGrants } from "./tools/customersGetCustomerUpcomingGrants.js";
26
27
  import { tool$customersGetCustomerUsageSummary } from "./tools/customersGetCustomerUsageSummary.js";
28
+ import { tool$customersGetSubscriptionsForCustomer } from "./tools/customersGetSubscriptionsForCustomer.js";
27
29
  import { tool$customersQueryCustomer } from "./tools/customersQueryCustomer.js";
28
30
  import { tool$customersUpdateCustomer } from "./tools/customersUpdateCustomer.js";
29
31
  import { tool$eventsGetEvent } from "./tools/eventsGetEvent.js";
@@ -71,6 +73,7 @@ import { tool$subscriptionsCreateSubscriptionLineItem } from "./tools/subscripti
71
73
  import { tool$subscriptionsDeleteSubscriptionLineItem } from "./tools/subscriptionsDeleteSubscriptionLineItem.js";
72
74
  import { tool$subscriptionsExecuteSubscriptionChange } from "./tools/subscriptionsExecuteSubscriptionChange.js";
73
75
  import { tool$subscriptionsExecuteSubscriptionModify } from "./tools/subscriptionsExecuteSubscriptionModify.js";
76
+ import { tool$subscriptionsExecuteSubscriptionPlanChangeV2 } from "./tools/subscriptionsExecuteSubscriptionPlanChangeV2.js";
74
77
  import { tool$subscriptionsGetSubscription } from "./tools/subscriptionsGetSubscription.js";
75
78
  import { tool$subscriptionsGetSubscriptionAddonAssociations } from "./tools/subscriptionsGetSubscriptionAddonAssociations.js";
76
79
  import { tool$subscriptionsGetSubscriptionEntitlements } from "./tools/subscriptionsGetSubscriptionEntitlements.js";
@@ -82,6 +85,7 @@ import { tool$subscriptionsListAllSubscriptionSchedules } from "./tools/subscrip
82
85
  import { tool$subscriptionsListSubscriptionSchedules } from "./tools/subscriptionsListSubscriptionSchedules.js";
83
86
  import { tool$subscriptionsPreviewSubscriptionChange } from "./tools/subscriptionsPreviewSubscriptionChange.js";
84
87
  import { tool$subscriptionsPreviewSubscriptionModify } from "./tools/subscriptionsPreviewSubscriptionModify.js";
88
+ import { tool$subscriptionsPreviewSubscriptionPlanChangeV2 } from "./tools/subscriptionsPreviewSubscriptionPlanChangeV2.js";
85
89
  import { tool$subscriptionsQuerySubscription } from "./tools/subscriptionsQuerySubscription.js";
86
90
  import { tool$subscriptionsQuerySubscriptionLineItems } from "./tools/subscriptionsQuerySubscriptionLineItems.js";
87
91
  import { tool$subscriptionsRemoveSubscriptionAddon } from "./tools/subscriptionsRemoveSubscriptionAddon.js";
@@ -101,7 +105,7 @@ export function createMCPServer(deps: {
101
105
  }) {
102
106
  const server = new McpServer({
103
107
  name: "Flexprice",
104
- version: "2.1.20",
108
+ version: "2.1.24",
105
109
  });
106
110
 
107
111
  const getClient = deps.getSDK || (() =>
@@ -149,6 +153,8 @@ export function createMCPServer(deps: {
149
153
  tool(tool$customersUpdateCustomer);
150
154
  tool(tool$customersCreateCustomer);
151
155
  tool(tool$customersGetCustomerByExternalId);
156
+ tool(tool$customersGetCustomerEntitlementsByExternalID);
157
+ tool(tool$customersGetSubscriptionsForCustomer);
152
158
  tool(tool$customersQueryCustomer);
153
159
  tool(tool$customersGetCustomerUsageSummary);
154
160
  tool(tool$customersGetCustomer);
@@ -173,10 +179,10 @@ export function createMCPServer(deps: {
173
179
  tool(tool$eventsGetUsageAnalytics);
174
180
  tool(tool$eventsIngestEventsBulk);
175
181
  tool(tool$eventsGetHuggingfaceInferenceData);
182
+ tool(tool$eventsGetEvent);
176
183
  tool(tool$eventsListRawEvents);
177
184
  tool(tool$eventsGetUsageStatistics);
178
185
  tool(tool$eventsGetUsageByMeter);
179
- tool(tool$eventsGetEvent);
180
186
  tool(tool$plansCreatePlan);
181
187
  tool(tool$plansQueryPlan);
182
188
  tool(tool$plansGetPlan);
@@ -206,6 +212,8 @@ export function createMCPServer(deps: {
206
212
  tool(tool$subscriptionsCancelSubscription);
207
213
  tool(tool$subscriptionsExecuteSubscriptionChange);
208
214
  tool(tool$subscriptionsPreviewSubscriptionChange);
215
+ tool(tool$subscriptionsExecuteSubscriptionPlanChangeV2);
216
+ tool(tool$subscriptionsPreviewSubscriptionPlanChangeV2);
209
217
  tool(tool$subscriptionsGetSubscriptionEntitlements);
210
218
  tool(tool$subscriptionsGetSubscriptionUpcomingGrants);
211
219
  tool(tool$subscriptionsCreateSubscriptionLineItem);
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { customersGetCustomerEntitlementsByExternalID } from "../../funcs/customersGetCustomerEntitlementsByExternalID.js";
6
+ import { GetCustomerEntitlementsByExternalIDRequest$zodSchema } from "../../models/getcustomerentitlementsbyexternalidop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: GetCustomerEntitlementsByExternalIDRequest$zodSchema,
11
+ };
12
+
13
+ export const tool$customersGetCustomerEntitlementsByExternalID: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "get-customer-entitlements-by-external-i-d",
17
+ description: `Get customer entitlements by external ID
18
+
19
+ Use when checking entitlements by your app's customer id (e.g. feature gating at the edge). Supports optional filters (feature_ids, subscription_ids).`,
20
+ scopes: ["read"],
21
+ annotations: {
22
+ "title": "",
23
+ "destructiveHint": false,
24
+ "idempotentHint": false,
25
+ "openWorldHint": false,
26
+ "readOnlyHint": true,
27
+ },
28
+ args,
29
+ tool: async (client, args, ctx) => {
30
+ const [result] = await customersGetCustomerEntitlementsByExternalID(
31
+ client,
32
+ args.request,
33
+ { fetchOptions: { signal: ctx.signal } },
34
+ ).$inspect();
35
+
36
+ if (!result.ok) {
37
+ return {
38
+ content: [{ type: "text", text: result.error.message }],
39
+ isError: true,
40
+ };
41
+ }
42
+
43
+ return formatResult(result.value);
44
+ },
45
+ };
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { customersGetSubscriptionsForCustomer } from "../../funcs/customersGetSubscriptionsForCustomer.js";
6
+ import { GetSubscriptionsForCustomerRequest$zodSchema } from "../../models/getsubscriptionsforcustomerop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: GetSubscriptionsForCustomerRequest$zodSchema,
11
+ };
12
+
13
+ export const tool$customersGetSubscriptionsForCustomer: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "get-subscriptions-for-customer",
17
+ description: `Get subscriptions for customer by external ID
18
+
19
+ Returns all subscriptions for a customer looked up by external_id, with line-item meters and entitlements attached (no pagination).`,
20
+ scopes: ["read"],
21
+ annotations: {
22
+ "title": "",
23
+ "destructiveHint": false,
24
+ "idempotentHint": false,
25
+ "openWorldHint": false,
26
+ "readOnlyHint": true,
27
+ },
28
+ args,
29
+ tool: async (client, args, ctx) => {
30
+ const [result] = await customersGetSubscriptionsForCustomer(
31
+ client,
32
+ args.request,
33
+ { fetchOptions: { signal: ctx.signal } },
34
+ ).$inspect();
35
+
36
+ if (!result.ok) {
37
+ return {
38
+ content: [{ type: "text", text: result.error.message }],
39
+ isError: true,
40
+ };
41
+ }
42
+
43
+ return formatResult(result.value);
44
+ },
45
+ };
@@ -14,7 +14,7 @@ export const tool$eventsGetEvent: ToolDefinition<typeof args> = {
14
14
  name: "get-event",
15
15
  description: `Get event
16
16
 
17
- Use when debugging a specific event (e.g. why it failed or how it was aggregated). Includes processing status and debug info.`,
17
+ Use when debugging a specific event (e.g. why it failed or how it was aggregated). Reads the meter-usage pipeline; includes processing status and step-by-step debug tracker when unprocessed. Uses ?id= query param because event IDs can contain "/".`,
18
18
  scopes: ["read"],
19
19
  annotations: {
20
20
  "title": "",
@@ -3,13 +3,20 @@
3
3
  */
4
4
 
5
5
  import { eventsGetHuggingfaceInferenceData } from "../../funcs/eventsGetHuggingfaceInferenceData.js";
6
+ import { GetHuggingFaceBillingDataRequest$zodSchema } from "../../models/gethuggingfacebillingdatarequest.js";
6
7
  import { formatResult, ToolDefinition } from "../tools.js";
7
8
 
8
- export const tool$eventsGetHuggingfaceInferenceData: ToolDefinition = {
9
+ const args = {
10
+ request: GetHuggingFaceBillingDataRequest$zodSchema.describe(`Request body`),
11
+ };
12
+
13
+ export const tool$eventsGetHuggingfaceInferenceData: ToolDefinition<
14
+ typeof args
15
+ > = {
9
16
  name: "get-huggingface-inference-data",
10
17
  description: `Get Hugging Face inference data
11
18
 
12
- Use when fetching Hugging Face inference usage or billing data (e.g. for HF-specific reporting or reconciliation).`,
19
+ Use when fetching Hugging Face inference usage or billing data (e.g. for HF-specific reporting or reconciliation). Reads the meter-usage pipeline.`,
13
20
  scopes: ["write"],
14
21
  annotations: {
15
22
  "title": "",
@@ -18,9 +25,11 @@ Use when fetching Hugging Face inference usage or billing data (e.g. for HF-spec
18
25
  "openWorldHint": false,
19
26
  "readOnlyHint": false,
20
27
  },
21
- tool: async (client, ctx) => {
28
+ args,
29
+ tool: async (client, args, ctx) => {
22
30
  const [result] = await eventsGetHuggingfaceInferenceData(
23
31
  client,
32
+ args.request,
24
33
  { fetchOptions: { signal: ctx.signal } },
25
34
  ).$inspect();
26
35
 
@@ -14,7 +14,7 @@ export const tool$invoicesUpdateInvoice: ToolDefinition<typeof args> = {
14
14
  name: "update-invoice",
15
15
  description: `Update invoice
16
16
 
17
- Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For paid invoices only safe fields can be updated.`,
17
+ Use when updating invoice metadata or due date (e.g. PDF URL, net terms), or when recalculating this draft invoice's discount from its current standing coupon associations via apply_discount:true (idempotent, does not attach a new coupon). Allowed for invoices in draft or finalized status.`,
18
18
  scopes: ["write"],
19
19
  annotations: {
20
20
  "title": "",
@@ -16,6 +16,7 @@ export const tool$subscriptionsAddSubscriptionAddon: ToolDefinition<
16
16
  name: "add-subscription-addon",
17
17
  description: `Add addon to subscription
18
18
 
19
+ Deprecated: use POST /subscriptions/{id}/modify/execute with type "addon" and action "add", which also supports previewing the proration charge first.
19
20
  Use when adding an optional product or add-on to an existing subscription (e.g. extra storage or support tier).`,
20
21
  scopes: ["write"],
21
22
  annotations: {
@@ -16,7 +16,7 @@ export const tool$subscriptionsExecuteSubscriptionModify: ToolDefinition<
16
16
  name: "execute-subscription-modify",
17
17
  description: `Execute subscription modification
18
18
 
19
- Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, or tax).`,
19
+ Execute a mid-cycle subscription modification (inheritance, quantity change, grouped invoicing, trial end, coupon, tax, or addon add/remove).`,
20
20
  scopes: ["write"],
21
21
  annotations: {
22
22
  "title": "",
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { subscriptionsExecuteSubscriptionPlanChangeV2 } from "../../funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js";
6
+ import { ExecuteSubscriptionPlanChangeV2Request$zodSchema } from "../../models/executesubscriptionplanchangev2op.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: ExecuteSubscriptionPlanChangeV2Request$zodSchema,
11
+ };
12
+
13
+ export const tool$subscriptionsExecuteSubscriptionPlanChangeV2: ToolDefinition<
14
+ typeof args
15
+ > = {
16
+ name: "execute-subscription-plan-change-v2",
17
+ description: `Execute a plan change (v2, swap in place)
18
+
19
+ Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.`,
20
+ scopes: ["write"],
21
+ annotations: {
22
+ "title": "",
23
+ "destructiveHint": false,
24
+ "idempotentHint": false,
25
+ "openWorldHint": false,
26
+ "readOnlyHint": false,
27
+ },
28
+ args,
29
+ tool: async (client, args, ctx) => {
30
+ const [result] = await subscriptionsExecuteSubscriptionPlanChangeV2(
31
+ client,
32
+ args.request,
33
+ { fetchOptions: { signal: ctx.signal } },
34
+ ).$inspect();
35
+
36
+ if (!result.ok) {
37
+ return {
38
+ content: [{ type: "text", text: result.error.message }],
39
+ isError: true,
40
+ };
41
+ }
42
+
43
+ return formatResult(result.value);
44
+ },
45
+ };