@flexprice/mcp-server 2.1.19 → 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.
- package/bin/mcp-server.js +5440 -3801
- package/bin/mcp-server.js.map +190 -142
- package/bun.lock +47 -40
- package/esm/funcs/customersGetCustomerEntitlementsByExternalID.d.ts +16 -0
- package/esm/funcs/customersGetCustomerEntitlementsByExternalID.d.ts.map +1 -0
- package/esm/funcs/customersGetCustomerEntitlementsByExternalID.js +87 -0
- package/esm/funcs/customersGetCustomerEntitlementsByExternalID.js.map +1 -0
- package/esm/funcs/customersGetSubscriptionsForCustomer.d.ts +16 -0
- package/esm/funcs/customersGetSubscriptionsForCustomer.d.ts.map +1 -0
- package/esm/funcs/customersGetSubscriptionsForCustomer.js +91 -0
- package/esm/funcs/customersGetSubscriptionsForCustomer.js.map +1 -0
- package/esm/funcs/eventsGetEvent.d.ts +1 -1
- package/esm/funcs/eventsGetEvent.js +7 -9
- package/esm/funcs/eventsGetEvent.js.map +1 -1
- package/esm/funcs/eventsGetHuggingfaceInferenceData.d.ts +3 -2
- package/esm/funcs/eventsGetHuggingfaceInferenceData.d.ts.map +1 -1
- package/esm/funcs/eventsGetHuggingfaceInferenceData.js +15 -4
- package/esm/funcs/eventsGetHuggingfaceInferenceData.js.map +1 -1
- package/esm/funcs/invoicesGetInvoice.js +1 -0
- package/esm/funcs/invoicesGetInvoice.js.map +1 -1
- package/esm/funcs/invoicesUpdateInvoice.d.ts +1 -1
- package/esm/funcs/invoicesUpdateInvoice.js +1 -1
- package/esm/funcs/subscriptionsAddSubscriptionAddon.d.ts +3 -0
- package/esm/funcs/subscriptionsAddSubscriptionAddon.d.ts.map +1 -1
- package/esm/funcs/subscriptionsAddSubscriptionAddon.js +3 -0
- package/esm/funcs/subscriptionsAddSubscriptionAddon.js.map +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts +16 -0
- package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -0
- package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js +88 -0
- package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts +16 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts.map +1 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.js +88 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.js.map +1 -0
- package/esm/funcs/subscriptionsRemoveSubscriptionAddon.d.ts +3 -0
- package/esm/funcs/subscriptionsRemoveSubscriptionAddon.d.ts.map +1 -1
- package/esm/funcs/subscriptionsRemoveSubscriptionAddon.js +3 -0
- package/esm/funcs/subscriptionsRemoveSubscriptionAddon.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/http.d.ts +1 -1
- package/esm/lib/http.d.ts.map +1 -1
- package/esm/lib/http.js +1 -1
- package/esm/lib/http.js.map +1 -1
- package/esm/lib/retries.js +7 -0
- package/esm/lib/retries.js.map +1 -1
- package/esm/lib/security.d.ts +5 -4
- package/esm/lib/security.d.ts.map +1 -1
- package/esm/lib/security.js +4 -5
- package/esm/lib/security.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +10 -2
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.d.ts +7 -0
- package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.d.ts.map +1 -0
- package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.js +35 -0
- package/esm/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.js.map +1 -0
- package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.d.ts +7 -0
- package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.d.ts.map +1 -0
- package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.js +35 -0
- package/esm/mcp-server/tools/customersGetSubscriptionsForCustomer.js.map +1 -0
- package/esm/mcp-server/tools/eventsGetEvent.js +1 -1
- package/esm/mcp-server/tools/eventsGetEvent.js.map +1 -1
- package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.d.ts +5 -1
- package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.d.ts.map +1 -1
- package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.js +8 -3
- package/esm/mcp-server/tools/eventsGetHuggingfaceInferenceData.js.map +1 -1
- package/esm/mcp-server/tools/invoicesUpdateInvoice.js +1 -1
- package/esm/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.d.ts.map +1 -1
- package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.js +1 -0
- package/esm/mcp-server/tools/subscriptionsAddSubscriptionAddon.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts +7 -0
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -0
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js +35 -0
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts +7 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.d.ts.map +1 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.js +35 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.js.map +1 -0
- package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.d.ts.map +1 -1
- package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.js +1 -0
- package/esm/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.js.map +1 -1
- package/esm/mcp-server/tools.d.ts.map +1 -1
- package/esm/mcp-server/tools.js +2 -0
- package/esm/mcp-server/tools.js.map +1 -1
- package/esm/models/addaddonparams.d.ts +8 -0
- package/esm/models/addaddonparams.d.ts.map +1 -0
- package/esm/models/addaddonparams.js +10 -0
- package/esm/models/addaddonparams.js.map +1 -0
- package/esm/models/addaddonref.d.ts +12 -0
- package/esm/models/addaddonref.d.ts.map +1 -0
- package/esm/models/addaddonref.js +14 -0
- package/esm/models/addaddonref.js.map +1 -0
- package/esm/models/addaddonrequest.d.ts +4 -0
- package/esm/models/addaddonrequest.d.ts.map +1 -1
- package/esm/models/addaddonrequest.js +5 -0
- package/esm/models/addaddonrequest.js.map +1 -1
- package/esm/models/addaddontosubscriptionrequest.d.ts +2 -0
- package/esm/models/addaddontosubscriptionrequest.d.ts.map +1 -1
- package/esm/models/addaddontosubscriptionrequest.js +3 -0
- package/esm/models/addaddontosubscriptionrequest.js.map +1 -1
- package/esm/models/addaddontosubscriptionresponse.d.ts +31 -0
- package/esm/models/addaddontosubscriptionresponse.d.ts.map +1 -0
- package/esm/models/addaddontosubscriptionresponse.js +31 -0
- package/esm/models/addaddontosubscriptionresponse.js.map +1 -0
- package/esm/models/addonresponse.d.ts +2 -0
- package/esm/models/addonresponse.d.ts.map +1 -1
- package/esm/models/addonresponse.js +2 -0
- package/esm/models/addonresponse.js.map +1 -1
- package/esm/models/addonstatus.d.ts +1 -1
- package/esm/models/addsubscriptionaddonop.d.ts +2 -2
- package/esm/models/addsubscriptionaddonop.d.ts.map +1 -1
- package/esm/models/addsubscriptionaddonop.js +2 -2
- package/esm/models/addsubscriptionaddonop.js.map +1 -1
- package/esm/models/aggregatedentitlement.d.ts +9 -0
- package/esm/models/aggregatedentitlement.d.ts.map +1 -1
- package/esm/models/aggregatedentitlement.js +7 -1
- package/esm/models/aggregatedentitlement.js.map +1 -1
- package/esm/models/aggregatedentitlementbucket.d.ts +14 -0
- package/esm/models/aggregatedentitlementbucket.d.ts.map +1 -0
- package/esm/models/aggregatedentitlementbucket.js +16 -0
- package/esm/models/aggregatedentitlementbucket.js.map +1 -0
- package/esm/models/alertthreshold.d.ts +1 -1
- package/esm/models/alertthreshold.js +1 -1
- package/esm/models/applicationstatus.d.ts +3 -3
- package/esm/models/autotopup.d.ts +7 -0
- package/esm/models/autotopup.d.ts.map +1 -1
- package/esm/models/autotopup.js +7 -0
- package/esm/models/autotopup.js.map +1 -1
- package/esm/models/checkoutaction.d.ts +16 -0
- package/esm/models/checkoutaction.d.ts.map +1 -0
- package/esm/models/checkoutaction.js +17 -0
- package/esm/models/checkoutaction.js.map +1 -0
- package/esm/models/checkoutjsonbcheckoutconfiguration.d.ts +13 -0
- package/esm/models/checkoutjsonbcheckoutconfiguration.d.ts.map +1 -0
- package/esm/models/checkoutjsonbcheckoutconfiguration.js +15 -0
- package/esm/models/checkoutjsonbcheckoutconfiguration.js.map +1 -0
- package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.d.ts +10 -0
- package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.d.ts.map +1 -0
- package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.js +12 -0
- package/esm/models/checkoutjsonbcheckoutpaymentproviderconfig.js.map +1 -0
- package/esm/models/checkoutjsonbcheckoutproviderresult.d.ts +13 -0
- package/esm/models/checkoutjsonbcheckoutproviderresult.d.ts.map +1 -0
- package/esm/models/checkoutjsonbcheckoutproviderresult.js +13 -0
- package/esm/models/checkoutjsonbcheckoutproviderresult.js.map +1 -0
- package/esm/models/checkoutjsonbcheckoutresult.d.ts +7 -0
- package/esm/models/checkoutjsonbcheckoutresult.d.ts.map +1 -0
- package/esm/models/checkoutjsonbcheckoutresult.js +9 -0
- package/esm/models/checkoutjsonbcheckoutresult.js.map +1 -0
- package/esm/models/checkoutparams.d.ts +16 -0
- package/esm/models/checkoutparams.d.ts.map +1 -0
- package/esm/models/checkoutparams.js +16 -0
- package/esm/models/checkoutparams.js.map +1 -0
- package/esm/models/checkoutpaymentprovider.d.ts +10 -0
- package/esm/models/checkoutpaymentprovider.d.ts.map +1 -0
- package/esm/models/checkoutpaymentprovider.js +11 -0
- package/esm/models/checkoutpaymentprovider.js.map +1 -0
- package/esm/models/checkoutpaymentproviderconfig.d.ts +10 -0
- package/esm/models/checkoutpaymentproviderconfig.d.ts.map +1 -0
- package/esm/models/checkoutpaymentproviderconfig.js +12 -0
- package/esm/models/checkoutpaymentproviderconfig.js.map +1 -0
- package/esm/models/checkoutsessionresponse.d.ts +44 -0
- package/esm/models/checkoutsessionresponse.d.ts.map +1 -0
- package/esm/models/checkoutsessionresponse.js +45 -0
- package/esm/models/checkoutsessionresponse.js.map +1 -0
- package/esm/models/checkoutstatus.d.ts +18 -0
- package/esm/models/checkoutstatus.d.ts.map +1 -0
- package/esm/models/checkoutstatus.js +19 -0
- package/esm/models/checkoutstatus.js.map +1 -0
- package/esm/models/couponassociationresponse.d.ts +4 -2
- package/esm/models/couponassociationresponse.d.ts.map +1 -1
- package/esm/models/couponassociationresponse.js +4 -2
- package/esm/models/couponassociationresponse.js.map +1 -1
- package/esm/models/{coupon.d.ts → couponresponse.d.ts} +3 -3
- package/esm/models/couponresponse.d.ts.map +1 -0
- package/esm/models/{coupon.js → couponresponse.js} +2 -2
- package/esm/models/couponresponse.js.map +1 -0
- package/esm/models/createcreditgrantrequest.d.ts +1 -0
- package/esm/models/createcreditgrantrequest.d.ts.map +1 -1
- package/esm/models/createcreditgrantrequest.js +1 -0
- package/esm/models/createcreditgrantrequest.js.map +1 -1
- package/esm/models/createcustomerrequest.d.ts +4 -1
- package/esm/models/createcustomerrequest.d.ts.map +1 -1
- package/esm/models/createcustomerrequest.js +4 -1
- package/esm/models/createcustomerrequest.js.map +1 -1
- package/esm/models/createinvoicerequest.d.ts +1 -0
- package/esm/models/createinvoicerequest.d.ts.map +1 -1
- package/esm/models/createinvoicerequest.js +1 -0
- package/esm/models/createinvoicerequest.js.map +1 -1
- package/esm/models/createsubscriptionparams.d.ts +16 -0
- package/esm/models/createsubscriptionparams.d.ts.map +1 -0
- package/esm/models/createsubscriptionparams.js +16 -0
- package/esm/models/createsubscriptionparams.js.map +1 -0
- package/esm/models/createsubscriptionrequest.d.ts +3 -1
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +19 -18
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/createsubscriptionresult.d.ts +8 -0
- package/esm/models/createsubscriptionresult.d.ts.map +1 -0
- package/esm/models/createsubscriptionresult.js +10 -0
- package/esm/models/createsubscriptionresult.js.map +1 -0
- package/esm/models/creditgrantresponse.d.ts +1 -0
- package/esm/models/creditgrantresponse.d.ts.map +1 -1
- package/esm/models/creditgrantresponse.js +1 -0
- package/esm/models/creditgrantresponse.js.map +1 -1
- package/esm/models/creditgrantscope.d.ts +2 -0
- package/esm/models/creditgrantscope.d.ts.map +1 -1
- package/esm/models/creditgrantscope.js +2 -0
- package/esm/models/creditgrantscope.js.map +1 -1
- package/esm/models/customer.d.ts +2 -0
- package/esm/models/customer.d.ts.map +1 -1
- package/esm/models/customer.js +2 -0
- package/esm/models/customer.js.map +1 -1
- package/esm/models/customerentitlementsresponse.d.ts +2 -0
- package/esm/models/customerentitlementsresponse.d.ts.map +1 -1
- package/esm/models/customerentitlementsresponse.js +2 -0
- package/esm/models/customerentitlementsresponse.js.map +1 -1
- package/esm/models/customerresponse.d.ts +2 -0
- package/esm/models/customerresponse.d.ts.map +1 -1
- package/esm/models/customerresponse.js +2 -0
- package/esm/models/customerresponse.js.map +1 -1
- package/esm/models/durationunit.d.ts +16 -0
- package/esm/models/durationunit.d.ts.map +1 -0
- package/esm/models/durationunit.js +17 -0
- package/esm/models/durationunit.js.map +1 -0
- package/esm/models/entitlementaggregationmode.d.ts +12 -0
- package/esm/models/entitlementaggregationmode.d.ts.map +1 -0
- package/esm/models/entitlementaggregationmode.js +13 -0
- package/esm/models/entitlementaggregationmode.js.map +1 -0
- package/esm/models/entitlementgrantdurationunit.d.ts +14 -0
- package/esm/models/entitlementgrantdurationunit.d.ts.map +1 -0
- package/esm/models/entitlementgrantdurationunit.js +15 -0
- package/esm/models/entitlementgrantdurationunit.js.map +1 -0
- package/esm/models/entitlementgrantmeasure.d.ts +12 -0
- package/esm/models/entitlementgrantmeasure.d.ts.map +1 -0
- package/esm/models/entitlementgrantmeasure.js +13 -0
- package/esm/models/entitlementgrantmeasure.js.map +1 -0
- package/esm/models/entitlementresponse.d.ts +11 -0
- package/esm/models/entitlementresponse.d.ts.map +1 -1
- package/esm/models/entitlementresponse.js +9 -0
- package/esm/models/entitlementresponse.js.map +1 -1
- package/esm/models/entitlementsource.d.ts +3 -0
- package/esm/models/entitlementsource.d.ts.map +1 -1
- package/esm/models/entitlementsource.js +1 -0
- package/esm/models/entitlementsource.js.map +1 -1
- package/esm/models/entitychangebehaviour.d.ts +12 -0
- package/esm/models/entitychangebehaviour.d.ts.map +1 -0
- package/esm/models/entitychangebehaviour.js +13 -0
- package/esm/models/entitychangebehaviour.js.map +1 -0
- package/esm/models/entitychangepolicy.d.ts +10 -0
- package/esm/models/entitychangepolicy.d.ts.map +1 -0
- package/esm/models/entitychangepolicy.js +12 -0
- package/esm/models/entitychangepolicy.js.map +1 -0
- package/esm/models/entitychangeresult.d.ts +11 -0
- package/esm/models/entitychangeresult.d.ts.map +1 -0
- package/esm/models/entitychangeresult.js +14 -0
- package/esm/models/entitychangeresult.js.map +1 -0
- package/esm/models/errorcode.d.ts +2 -0
- package/esm/models/errorcode.d.ts.map +1 -1
- package/esm/models/errorcode.js +2 -0
- package/esm/models/errorcode.js.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +4 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.js +4 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -1
- package/esm/models/executesubscriptionplanchangev2op.d.ts +12 -0
- package/esm/models/executesubscriptionplanchangev2op.d.ts.map +1 -0
- package/esm/models/executesubscriptionplanchangev2op.js +16 -0
- package/esm/models/executesubscriptionplanchangev2op.js.map +1 -0
- package/esm/models/featuretype.d.ts +2 -0
- package/esm/models/featuretype.d.ts.map +1 -1
- package/esm/models/featuretype.js +2 -0
- package/esm/models/featuretype.js.map +1 -1
- package/esm/models/filteroperatortype.d.ts +2 -0
- package/esm/models/filteroperatortype.d.ts.map +1 -1
- package/esm/models/filteroperatortype.js +2 -0
- package/esm/models/filteroperatortype.js.map +1 -1
- package/esm/models/getcustomerentitlementsbyexternalidop.d.ts +10 -0
- package/esm/models/getcustomerentitlementsbyexternalidop.d.ts.map +1 -0
- package/esm/models/getcustomerentitlementsbyexternalidop.js +14 -0
- package/esm/models/getcustomerentitlementsbyexternalidop.js.map +1 -0
- package/esm/models/gethuggingfacebillingdatarequest.d.ts +6 -0
- package/esm/models/gethuggingfacebillingdatarequest.d.ts.map +1 -0
- package/esm/models/gethuggingfacebillingdatarequest.js +8 -0
- package/esm/models/gethuggingfacebillingdatarequest.js.map +1 -0
- package/esm/models/getinvoiceop.d.ts +1 -0
- package/esm/models/getinvoiceop.d.ts.map +1 -1
- package/esm/models/getinvoiceop.js +1 -0
- package/esm/models/getinvoiceop.js.map +1 -1
- package/esm/models/getsubscriptionsforcustomerop.d.ts +11 -0
- package/esm/models/getsubscriptionsforcustomerop.d.ts.map +1 -0
- package/esm/models/getsubscriptionsforcustomerop.js +15 -0
- package/esm/models/getsubscriptionsforcustomerop.js.map +1 -0
- package/esm/models/getusageanalyticsresponse.d.ts +2 -0
- package/esm/models/getusageanalyticsresponse.d.ts.map +1 -1
- package/esm/models/getusageanalyticsresponse.js +3 -1
- package/esm/models/getusageanalyticsresponse.js.map +1 -1
- package/esm/models/getusagebymeterrequest.d.ts +1 -0
- package/esm/models/getusagebymeterrequest.d.ts.map +1 -1
- package/esm/models/getusagebymeterrequest.js +1 -0
- package/esm/models/getusagebymeterrequest.js.map +1 -1
- package/esm/models/getusagerequest.d.ts +2 -0
- package/esm/models/getusagerequest.d.ts.map +1 -1
- package/esm/models/getusagerequest.js +3 -1
- package/esm/models/getusagerequest.js.map +1 -1
- package/esm/models/groupedinvoicingchildrequest.d.ts +37 -0
- package/esm/models/groupedinvoicingchildrequest.d.ts.map +1 -0
- package/esm/models/groupedinvoicingchildrequest.js +40 -0
- package/esm/models/groupedinvoicingchildrequest.js.map +1 -0
- package/esm/models/integrationentitytype.d.ts +2 -0
- package/esm/models/integrationentitytype.d.ts.map +1 -1
- package/esm/models/integrationentitytype.js +2 -0
- package/esm/models/integrationentitytype.js.map +1 -1
- package/esm/models/invoicelineitemcoupon.d.ts +1 -0
- package/esm/models/invoicelineitemcoupon.d.ts.map +1 -1
- package/esm/models/invoicelineitemcoupon.js +1 -0
- package/esm/models/invoicelineitemcoupon.js.map +1 -1
- package/esm/models/invoicelineitemresponse.d.ts +1 -0
- package/esm/models/invoicelineitemresponse.d.ts.map +1 -1
- package/esm/models/invoicelineitemresponse.js +1 -0
- package/esm/models/invoicelineitemresponse.js.map +1 -1
- package/esm/models/invoiceresponse.d.ts +1 -0
- package/esm/models/invoiceresponse.d.ts.map +1 -1
- package/esm/models/invoiceresponse.js +1 -0
- package/esm/models/invoiceresponse.js.map +1 -1
- package/esm/models/lineitemcommitmentconfig.d.ts.map +1 -1
- package/esm/models/lineitemcommitmentconfig.js +6 -6
- package/esm/models/lineitemcommitmentconfig.js.map +1 -1
- package/esm/models/lineitemquantitychange.d.ts +1 -1
- package/esm/models/lineitemquantitychange.d.ts.map +1 -1
- package/esm/models/lineitemquantitychange.js +1 -1
- package/esm/models/lineitemquantitychange.js.map +1 -1
- package/esm/models/modifysubscriptionlineitem.d.ts +8 -0
- package/esm/models/modifysubscriptionlineitem.d.ts.map +1 -0
- package/esm/models/modifysubscriptionlineitem.js +10 -0
- package/esm/models/modifysubscriptionlineitem.js.map +1 -0
- package/esm/models/modifysubscriptionparams.d.ts +8 -0
- package/esm/models/modifysubscriptionparams.d.ts.map +1 -0
- package/esm/models/modifysubscriptionparams.js +11 -0
- package/esm/models/modifysubscriptionparams.js.map +1 -0
- package/esm/models/overrideentitlementrequest.d.ts +3 -0
- package/esm/models/overrideentitlementrequest.d.ts.map +1 -1
- package/esm/models/overrideentitlementrequest.js +1 -0
- package/esm/models/overrideentitlementrequest.js.map +1 -1
- package/esm/models/pausestatus.d.ts +2 -2
- package/esm/models/paymentaction.d.ts +8 -0
- package/esm/models/paymentaction.d.ts.map +1 -0
- package/esm/models/paymentaction.js +10 -0
- package/esm/models/paymentaction.js.map +1 -0
- package/esm/models/paymentactiontype.d.ts +12 -0
- package/esm/models/paymentactiontype.d.ts.map +1 -0
- package/esm/models/paymentactiontype.js +13 -0
- package/esm/models/paymentactiontype.js.map +1 -0
- package/esm/models/paymentmethodtype.d.ts +20 -0
- package/esm/models/paymentmethodtype.d.ts.map +1 -0
- package/esm/models/paymentmethodtype.js +21 -0
- package/esm/models/paymentmethodtype.js.map +1 -0
- package/esm/models/paymentstatus.d.ts +2 -0
- package/esm/models/paymentstatus.d.ts.map +1 -1
- package/esm/models/paymentstatus.js +2 -0
- package/esm/models/paymentstatus.js.map +1 -1
- package/esm/models/pointbucket.d.ts +7 -0
- package/esm/models/pointbucket.d.ts.map +1 -0
- package/esm/models/pointbucket.js +9 -0
- package/esm/models/pointbucket.js.map +1 -0
- package/esm/models/previewsubscriptionplanchangev2op.d.ts +12 -0
- package/esm/models/previewsubscriptionplanchangev2op.d.ts.map +1 -0
- package/esm/models/previewsubscriptionplanchangev2op.js +16 -0
- package/esm/models/previewsubscriptionplanchangev2op.js.map +1 -0
- package/esm/models/removeaddonrequest.js +1 -1
- package/esm/models/removeaddonrequest.js.map +1 -1
- package/esm/models/schedulestatus.d.ts +1 -1
- package/esm/models/submodifyaddonparams.d.ts +11 -0
- package/esm/models/submodifyaddonparams.d.ts.map +1 -0
- package/esm/models/submodifyaddonparams.js +14 -0
- package/esm/models/submodifyaddonparams.js.map +1 -0
- package/esm/models/submodifycouponparams.d.ts +1 -1
- package/esm/models/submodifycouponparams.d.ts.map +1 -1
- package/esm/models/submodifycouponparams.js +1 -1
- package/esm/models/submodifycouponparams.js.map +1 -1
- package/esm/models/submodifytaxparams.d.ts +1 -1
- package/esm/models/submodifytaxparams.d.ts.map +1 -1
- package/esm/models/submodifytaxparams.js +1 -1
- package/esm/models/submodifytaxparams.js.map +1 -1
- package/esm/models/subscriptionchangeentitypolicies.d.ts +7 -0
- package/esm/models/subscriptionchangeentitypolicies.d.ts.map +1 -0
- package/esm/models/subscriptionchangeentitypolicies.js +9 -0
- package/esm/models/subscriptionchangeentitypolicies.js.map +1 -0
- package/esm/models/subscriptionchangev2request.d.ts +14 -0
- package/esm/models/subscriptionchangev2request.d.ts.map +1 -0
- package/esm/models/subscriptionchangev2request.js +14 -0
- package/esm/models/subscriptionchangev2request.js.map +1 -0
- package/esm/models/subscriptionchangev2response.d.ts +21 -0
- package/esm/models/subscriptionchangev2response.d.ts.map +1 -0
- package/esm/models/subscriptionchangev2response.js +21 -0
- package/esm/models/subscriptionchangev2response.js.map +1 -0
- package/esm/models/subscriptioncouponinput.d.ts.map +1 -1
- package/esm/models/subscriptioncouponinput.js +4 -4
- package/esm/models/subscriptioncouponinput.js.map +1 -1
- package/esm/models/subscriptionfilter.d.ts +1 -0
- package/esm/models/subscriptionfilter.d.ts.map +1 -1
- package/esm/models/subscriptionfilter.js +2 -1
- package/esm/models/subscriptionfilter.js.map +1 -1
- package/esm/models/subscriptioninheritanceconfig.d.ts +2 -0
- package/esm/models/subscriptioninheritanceconfig.d.ts.map +1 -1
- package/esm/models/subscriptioninheritanceconfig.js +6 -4
- package/esm/models/subscriptioninheritanceconfig.js.map +1 -1
- package/esm/models/subscriptionlineitemfilter.d.ts +1 -0
- package/esm/models/subscriptionlineitemfilter.d.ts.map +1 -1
- package/esm/models/subscriptionlineitemfilter.js +2 -1
- package/esm/models/subscriptionlineitemfilter.js.map +1 -1
- package/esm/models/subscriptionlineitemresponse.d.ts +2 -0
- package/esm/models/subscriptionlineitemresponse.d.ts.map +1 -1
- package/esm/models/subscriptionlineitemresponse.js +2 -0
- package/esm/models/subscriptionlineitemresponse.js.map +1 -1
- package/esm/models/subscriptionmodificationaction.d.ts +12 -0
- package/esm/models/subscriptionmodificationaction.d.ts.map +1 -0
- package/esm/models/subscriptionmodificationaction.js +13 -0
- package/esm/models/subscriptionmodificationaction.js.map +1 -0
- package/esm/models/subscriptionmodifyresponse.d.ts +2 -0
- package/esm/models/subscriptionmodifyresponse.d.ts.map +1 -1
- package/esm/models/subscriptionmodifyresponse.js +2 -0
- package/esm/models/subscriptionmodifyresponse.js.map +1 -1
- package/esm/models/subscriptionmodifytype.d.ts +2 -0
- package/esm/models/subscriptionmodifytype.d.ts.map +1 -1
- package/esm/models/subscriptionmodifytype.js +2 -0
- package/esm/models/subscriptionmodifytype.js.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.js +2 -2
- package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
- package/esm/models/subscriptionresponse.d.ts +5 -1
- package/esm/models/subscriptionresponse.d.ts.map +1 -1
- package/esm/models/subscriptionresponse.js +5 -1
- package/esm/models/subscriptionresponse.js.map +1 -1
- package/esm/models/subscriptionresponsev2.d.ts +1 -1
- package/esm/models/subscriptionresponsev2.d.ts.map +1 -1
- package/esm/models/subscriptionresponsev2.js +1 -1
- package/esm/models/subscriptionresponsev2.js.map +1 -1
- package/esm/models/subscriptionstatus.d.ts +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.d.ts +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.d.ts.map +1 -1
- package/esm/models/subscriptionsubscriptionlineitem.js +2 -0
- package/esm/models/subscriptionsubscriptionlineitem.js.map +1 -1
- package/esm/models/transactionreason.d.ts +2 -0
- package/esm/models/transactionreason.d.ts.map +1 -1
- package/esm/models/transactionreason.js +2 -0
- package/esm/models/transactionreason.js.map +1 -1
- package/esm/models/transactionstatus.d.ts +1 -1
- package/esm/models/updatecustomerrequest.d.ts +2 -0
- package/esm/models/updatecustomerrequest.d.ts.map +1 -1
- package/esm/models/updatecustomerrequest.js +2 -0
- package/esm/models/updatecustomerrequest.js.map +1 -1
- package/esm/models/updateinvoicerequest.d.ts +1 -0
- package/esm/models/updateinvoicerequest.d.ts.map +1 -1
- package/esm/models/updateinvoicerequest.js +1 -0
- package/esm/models/updateinvoicerequest.js.map +1 -1
- package/esm/models/usageanalyticitem.d.ts +2 -0
- package/esm/models/usageanalyticitem.d.ts.map +1 -1
- package/esm/models/usageanalyticitem.js +3 -1
- package/esm/models/usageanalyticitem.js.map +1 -1
- package/esm/models/usageanalyticpoint.d.ts +4 -2
- package/esm/models/usageanalyticpoint.d.ts.map +1 -1
- package/esm/models/usageanalyticpoint.js +5 -3
- package/esm/models/usageanalyticpoint.js.map +1 -1
- package/esm/models/walletresponse.d.ts +2 -0
- package/esm/models/walletresponse.d.ts.map +1 -1
- package/esm/models/walletresponse.js +2 -0
- package/esm/models/walletresponse.js.map +1 -1
- package/esm/models/wallettopupparams.d.ts +7 -0
- package/esm/models/wallettopupparams.d.ts.map +1 -0
- package/esm/models/wallettopupparams.js +10 -0
- package/esm/models/wallettopupparams.js.map +1 -0
- package/esm/models/wallettransactionresponse.d.ts +1 -0
- package/esm/models/wallettransactionresponse.d.ts.map +1 -1
- package/esm/models/wallettransactionresponse.js +1 -0
- package/esm/models/wallettransactionresponse.js.map +1 -1
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +26 -10
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +27 -11
- package/package.json +9 -2
- package/src/funcs/customersGetCustomerEntitlementsByExternalID.ts +153 -0
- package/src/funcs/customersGetSubscriptionsForCustomer.ts +156 -0
- package/src/funcs/eventsGetEvent.ts +7 -12
- package/src/funcs/eventsGetHuggingfaceInferenceData.ts +22 -1
- package/src/funcs/invoicesGetInvoice.ts +1 -0
- package/src/funcs/invoicesUpdateInvoice.ts +1 -1
- package/src/funcs/subscriptionsAddSubscriptionAddon.ts +3 -0
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.ts +153 -0
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/funcs/subscriptionsPreviewSubscriptionPlanChangeV2.ts +153 -0
- package/src/funcs/subscriptionsRemoveSubscriptionAddon.ts +3 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/http.ts +3 -1
- package/src/lib/retries.ts +8 -0
- package/src/lib/security.ts +10 -5
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +10 -2
- package/src/mcp-server/tools/customersGetCustomerEntitlementsByExternalID.ts +45 -0
- package/src/mcp-server/tools/customersGetSubscriptionsForCustomer.ts +45 -0
- package/src/mcp-server/tools/eventsGetEvent.ts +1 -1
- package/src/mcp-server/tools/eventsGetHuggingfaceInferenceData.ts +12 -3
- package/src/mcp-server/tools/invoicesUpdateInvoice.ts +1 -1
- package/src/mcp-server/tools/subscriptionsAddSubscriptionAddon.ts +1 -0
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +1 -1
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.ts +45 -0
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +1 -1
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionPlanChangeV2.ts +45 -0
- package/src/mcp-server/tools/subscriptionsRemoveSubscriptionAddon.ts +1 -0
- package/src/mcp-server/tools.ts +2 -0
- package/src/models/addaddonparams.ts +16 -0
- package/src/models/addaddonref.ts +26 -0
- package/src/models/addaddonrequest.ts +12 -0
- package/src/models/addaddontosubscriptionrequest.ts +9 -0
- package/src/models/addaddontosubscriptionresponse.ts +65 -0
- package/src/models/addonresponse.ts +6 -0
- package/src/models/addsubscriptionaddonop.ts +5 -5
- package/src/models/aggregatedentitlement.ts +21 -3
- package/src/models/aggregatedentitlementbucket.ts +35 -0
- package/src/models/alertthreshold.ts +2 -2
- package/src/models/autotopup.ts +14 -0
- package/src/models/checkoutaction.ts +21 -0
- package/src/models/checkoutjsonbcheckoutconfiguration.ts +34 -0
- package/src/models/checkoutjsonbcheckoutpaymentproviderconfig.ts +27 -0
- package/src/models/checkoutjsonbcheckoutproviderresult.ts +32 -0
- package/src/models/checkoutjsonbcheckoutresult.ts +19 -0
- package/src/models/checkoutparams.ts +33 -0
- package/src/models/checkoutpaymentprovider.ts +17 -0
- package/src/models/checkoutpaymentproviderconfig.ts +27 -0
- package/src/models/checkoutsessionresponse.ts +106 -0
- package/src/models/checkoutstatus.ts +23 -0
- package/src/models/couponassociationresponse.ts +9 -3
- package/src/models/{coupon.ts → couponresponse.ts} +2 -2
- package/src/models/createcreditgrantrequest.ts +2 -0
- package/src/models/createcustomerrequest.ts +14 -2
- package/src/models/createinvoicerequest.ts +4 -0
- package/src/models/createsubscriptionparams.ts +30 -0
- package/src/models/createsubscriptionrequest.ts +21 -39
- package/src/models/createsubscriptionresult.ts +19 -0
- package/src/models/creditgrantresponse.ts +2 -0
- package/src/models/creditgrantscope.ts +2 -0
- package/src/models/customer.ts +8 -0
- package/src/models/customerentitlementsresponse.ts +6 -0
- package/src/models/customerresponse.ts +8 -0
- package/src/models/durationunit.ts +21 -0
- package/src/models/entitlementaggregationmode.ts +19 -0
- package/src/models/entitlementgrantdurationunit.ts +21 -0
- package/src/models/entitlementgrantmeasure.ts +19 -0
- package/src/models/entitlementresponse.ts +24 -0
- package/src/models/entitlementsource.ts +2 -0
- package/src/models/entitychangebehaviour.ts +17 -0
- package/src/models/entitychangepolicy.ts +23 -0
- package/src/models/entitychangeresult.ts +28 -0
- package/src/models/errorcode.ts +2 -0
- package/src/models/executesubscriptionmodifyrequest.ts +9 -0
- package/src/models/executesubscriptionplanchangev2op.ts +37 -0
- package/src/models/featuretype.ts +2 -0
- package/src/models/filteroperatortype.ts +2 -0
- package/src/models/getcustomerentitlementsbyexternalidop.ts +31 -0
- package/src/models/gethuggingfacebillingdatarequest.ts +13 -0
- package/src/models/getinvoiceop.ts +4 -0
- package/src/models/getsubscriptionsforcustomerop.ts +35 -0
- package/src/models/getusageanalyticsresponse.ts +7 -1
- package/src/models/getusagebymeterrequest.ts +2 -0
- package/src/models/getusagerequest.ts +7 -1
- package/src/models/groupedinvoicingchildrequest.ts +104 -0
- package/src/models/integrationentitytype.ts +2 -0
- package/src/models/invoicelineitemcoupon.ts +2 -0
- package/src/models/invoicelineitemresponse.ts +4 -0
- package/src/models/invoiceresponse.ts +4 -0
- package/src/models/lineitemcommitmentconfig.ts +6 -10
- package/src/models/lineitemquantitychange.ts +2 -2
- package/src/models/modifysubscriptionlineitem.ts +19 -0
- package/src/models/modifysubscriptionparams.ts +22 -0
- package/src/models/overrideentitlementrequest.ts +4 -0
- package/src/models/paymentaction.ts +19 -0
- package/src/models/paymentactiontype.ts +17 -0
- package/src/models/paymentmethodtype.ts +25 -0
- package/src/models/paymentstatus.ts +2 -0
- package/src/models/pointbucket.ts +15 -0
- package/src/models/previewsubscriptionplanchangev2op.ts +37 -0
- package/src/models/removeaddonrequest.ts +1 -1
- package/src/models/submodifyaddonparams.ts +30 -0
- package/src/models/submodifycouponparams.ts +2 -2
- package/src/models/submodifytaxparams.ts +4 -4
- package/src/models/subscriptionchangeentitypolicies.ts +19 -0
- package/src/models/subscriptionchangev2request.ts +31 -0
- package/src/models/subscriptionchangev2response.ts +48 -0
- package/src/models/subscriptioncouponinput.ts +4 -12
- package/src/models/subscriptionfilter.ts +5 -1
- package/src/models/subscriptioninheritanceconfig.ts +14 -4
- package/src/models/subscriptionlineitemfilter.ts +5 -1
- package/src/models/subscriptionlineitemresponse.ts +3 -0
- package/src/models/subscriptionmodificationaction.ts +19 -0
- package/src/models/subscriptionmodifyresponse.ts +6 -0
- package/src/models/subscriptionmodifytype.ts +2 -0
- package/src/models/subscriptionphasecreaterequest.ts +2 -2
- package/src/models/subscriptionresponse.ts +16 -2
- package/src/models/subscriptionresponsev2.ts +2 -2
- package/src/models/subscriptionsubscriptionlineitem.ts +3 -0
- package/src/models/transactionreason.ts +2 -0
- package/src/models/updatecustomerrequest.ts +8 -0
- package/src/models/updateinvoicerequest.ts +4 -0
- package/src/models/usageanalyticitem.ts +7 -1
- package/src/models/usageanalyticpoint.ts +11 -6
- package/src/models/walletresponse.ts +4 -0
- package/src/models/wallettopupparams.ts +16 -0
- package/src/models/wallettransactionresponse.ts +4 -0
- package/src/tool-names.ts +26 -10
- package/esm/models/coupon.d.ts.map +0 -1
- 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
|
|
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.
|
|
73
|
-
genVersion: "2.
|
|
72
|
+
sdkVersion: "2.1.24",
|
|
73
|
+
genVersion: "2.931.0",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/mcp-typescript 2.1.
|
|
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(
|
|
50
|
+
constructor(options: HTTPClientOptions = {}) {
|
|
51
|
+
this.options = options;
|
|
50
52
|
this.fetcher = options.fetcher || DEFAULT_FETCHER;
|
|
51
53
|
}
|
|
52
54
|
|
package/src/lib/retries.ts
CHANGED
|
@@ -194,6 +194,14 @@ async function retryBackoff(
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function retryIntervalFromResponse(res: Response): number {
|
|
197
|
+
const retryAfterMsVal = res.headers.get("retry-after-ms");
|
|
198
|
+
if (retryAfterMsVal) {
|
|
199
|
+
const parsedMs = Number(retryAfterMsVal);
|
|
200
|
+
if (Number.isFinite(parsedMs) && parsedMs >= 0) {
|
|
201
|
+
return parsedMs;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
197
205
|
const retryVal = res.headers.get("retry-after") || "";
|
|
198
206
|
if (!retryVal) {
|
|
199
207
|
return 0;
|
package/src/lib/security.ts
CHANGED
|
@@ -12,17 +12,22 @@ type OAuth2PasswordFlow = {
|
|
|
12
12
|
tokenURL: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export
|
|
16
|
-
Incomplete
|
|
17
|
-
UnrecognisedSecurityType
|
|
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
|
-
|
|
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
|
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -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.
|
|
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).
|
|
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
|
-
|
|
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
|
-
|
|
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).
|
|
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
|
|
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": "",
|