@flexprice/mcp-server 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +1499 -724
- package/bin/mcp-server.js.map +64 -28
- package/bun.lock +33 -33
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts +16 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js +82 -0
- package/esm/funcs/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
- package/esm/funcs/{plansPostPlansIdClone.d.ts → plansClonePlan.d.ts} +3 -3
- package/esm/funcs/plansClonePlan.d.ts.map +1 -0
- package/esm/funcs/{plansPostPlansIdClone.js → plansClonePlan.js} +5 -5
- package/esm/funcs/plansClonePlan.js.map +1 -0
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts +4 -4
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.d.ts.map +1 -1
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js +4 -4
- package/esm/funcs/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts +16 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js +88 -0
- package/esm/funcs/subscriptionsPreviewSubscriptionModify.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +6 -0
- package/esm/lib/encodings.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 +7 -3
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts +7 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.d.ts.map +1 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js +35 -0
- package/esm/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.js.map +1 -0
- package/esm/mcp-server/tools/plansClonePlan.d.ts +7 -0
- package/esm/mcp-server/tools/plansClonePlan.d.ts.map +1 -0
- package/esm/mcp-server/tools/{plansPostPlansIdClone.js → plansClonePlan.js} +7 -7
- package/esm/mcp-server/tools/plansClonePlan.js.map +1 -0
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.d.ts +1 -1
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js +4 -4
- package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionModify.js.map +1 -1
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts +7 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.d.ts.map +1 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js +35 -0
- package/esm/mcp-server/tools/subscriptionsPreviewSubscriptionModify.js.map +1 -0
- package/esm/models/address.d.ts +11 -0
- package/esm/models/address.d.ts.map +1 -0
- package/esm/models/address.js +13 -0
- package/esm/models/address.js.map +1 -0
- package/esm/models/alertstate.d.ts +16 -0
- package/esm/models/alertstate.d.ts.map +1 -0
- package/esm/models/alertstate.js +17 -0
- package/esm/models/alertstate.js.map +1 -0
- package/esm/models/autotopup.d.ts +9 -0
- package/esm/models/autotopup.d.ts.map +1 -0
- package/esm/models/autotopup.js +11 -0
- package/esm/models/autotopup.js.map +1 -0
- package/esm/models/billingcadence.d.ts +0 -2
- package/esm/models/billingcadence.d.ts.map +1 -1
- package/esm/models/billingcadence.js +0 -2
- package/esm/models/billingcadence.js.map +1 -1
- package/esm/models/billingperiod.d.ts +2 -0
- package/esm/models/billingperiod.d.ts.map +1 -1
- package/esm/models/billingperiod.js +2 -0
- package/esm/models/billingperiod.js.map +1 -1
- package/esm/models/changedinvoice.d.ts +14 -0
- package/esm/models/changedinvoice.d.ts.map +1 -0
- package/esm/models/changedinvoice.js +16 -0
- package/esm/models/changedinvoice.js.map +1 -0
- package/esm/models/changedinvoiceaction.d.ts +18 -0
- package/esm/models/changedinvoiceaction.d.ts.map +1 -0
- package/esm/models/changedinvoiceaction.js +16 -0
- package/esm/models/changedinvoiceaction.js.map +1 -0
- package/esm/models/changedinvoicestatus.d.ts +18 -0
- package/esm/models/changedinvoicestatus.d.ts.map +1 -0
- package/esm/models/changedinvoicestatus.js +16 -0
- package/esm/models/changedinvoicestatus.js.map +1 -0
- package/esm/models/changedlineitem.d.ts +12 -0
- package/esm/models/changedlineitem.d.ts.map +1 -0
- package/esm/models/changedlineitem.js +14 -0
- package/esm/models/changedlineitem.js.map +1 -0
- package/esm/models/changedlineitemaction.d.ts +20 -0
- package/esm/models/changedlineitemaction.d.ts.map +1 -0
- package/esm/models/changedlineitemaction.js +18 -0
- package/esm/models/changedlineitemaction.js.map +1 -0
- package/esm/models/changedresources.d.ts +11 -0
- package/esm/models/changedresources.d.ts.map +1 -0
- package/esm/models/changedresources.js +13 -0
- package/esm/models/changedresources.js.map +1 -0
- package/esm/models/changedsubscription.d.ts +10 -0
- package/esm/models/changedsubscription.d.ts.map +1 -0
- package/esm/models/changedsubscription.js +13 -0
- package/esm/models/changedsubscription.js.map +1 -0
- package/esm/models/changedsubscriptionaction.d.ts +18 -0
- package/esm/models/changedsubscriptionaction.d.ts.map +1 -0
- package/esm/models/changedsubscriptionaction.js +16 -0
- package/esm/models/changedsubscriptionaction.js.map +1 -0
- package/esm/models/cloneplanop.d.ts +12 -0
- package/esm/models/cloneplanop.d.ts.map +1 -0
- package/esm/models/{postplansidcloneop.js → cloneplanop.js} +4 -3
- package/esm/models/cloneplanop.js.map +1 -0
- package/esm/models/createpricerequest.d.ts +0 -2
- package/esm/models/createpricerequest.d.ts.map +1 -1
- package/esm/models/createpricerequest.js +0 -2
- package/esm/models/createpricerequest.js.map +1 -1
- package/esm/models/createsubscriptionrequest.d.ts +1 -2
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +1 -2
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/creditbreakdown.d.ts +7 -0
- package/esm/models/creditbreakdown.d.ts.map +1 -0
- package/esm/models/creditbreakdown.js +9 -0
- package/esm/models/creditbreakdown.js.map +1 -0
- package/esm/models/creditgrantcadence.d.ts +1 -1
- package/esm/models/executesubscriptionmodifyop.d.ts +6 -6
- package/esm/models/executesubscriptionmodifyop.d.ts.map +1 -1
- package/esm/models/executesubscriptionmodifyop.js +5 -5
- package/esm/models/executesubscriptionmodifyop.js.map +1 -1
- package/esm/models/executesubscriptionmodifyrequest.d.ts +11 -0
- package/esm/models/executesubscriptionmodifyrequest.d.ts.map +1 -0
- package/esm/models/executesubscriptionmodifyrequest.js +13 -0
- package/esm/models/executesubscriptionmodifyrequest.js.map +1 -0
- package/esm/models/getmeterusagepreviewinvoiceop.d.ts +6 -0
- package/esm/models/getmeterusagepreviewinvoiceop.d.ts.map +1 -0
- package/esm/models/getmeterusagepreviewinvoiceop.js +11 -0
- package/esm/models/getmeterusagepreviewinvoiceop.js.map +1 -0
- package/esm/models/invoicefilter.d.ts +1 -0
- package/esm/models/invoicefilter.d.ts.map +1 -1
- package/esm/models/invoicefilter.js +1 -0
- package/esm/models/invoicefilter.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/lineitemquantitychange.d.ts +8 -0
- package/esm/models/lineitemquantitychange.d.ts.map +1 -0
- package/esm/models/lineitemquantitychange.js +10 -0
- package/esm/models/lineitemquantitychange.js.map +1 -0
- package/esm/models/previewsubscriptionmodifyop.d.ts +12 -0
- package/esm/models/previewsubscriptionmodifyop.d.ts.map +1 -0
- package/esm/models/previewsubscriptionmodifyop.js +16 -0
- package/esm/models/previewsubscriptionmodifyop.js.map +1 -0
- package/esm/models/submodifyinheritancerequest.d.ts +6 -0
- package/esm/models/submodifyinheritancerequest.d.ts.map +1 -0
- package/esm/models/{executesubscriptioninheritancerequest.js → submodifyinheritancerequest.js} +2 -2
- package/esm/models/submodifyinheritancerequest.js.map +1 -0
- package/esm/models/submodifyquantitychangerequest.d.ts +7 -0
- package/esm/models/submodifyquantitychangerequest.d.ts.map +1 -0
- package/esm/models/submodifyquantitychangerequest.js +9 -0
- package/esm/models/submodifyquantitychangerequest.js.map +1 -0
- package/esm/models/subscriptionmodifyresponse.d.ts +9 -0
- package/esm/models/subscriptionmodifyresponse.d.ts.map +1 -0
- package/esm/models/subscriptionmodifyresponse.js +11 -0
- package/esm/models/subscriptionmodifyresponse.js.map +1 -0
- package/esm/models/subscriptionmodifytype.d.ts +12 -0
- package/esm/models/subscriptionmodifytype.d.ts.map +1 -0
- package/esm/models/subscriptionmodifytype.js +13 -0
- package/esm/models/subscriptionmodifytype.js.map +1 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts +2 -0
- package/esm/models/subscriptionphasecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionphasecreaterequest.js +3 -0
- package/esm/models/subscriptionphasecreaterequest.js.map +1 -1
- package/esm/models/subscriptionpricecreaterequest.d.ts +0 -2
- package/esm/models/subscriptionpricecreaterequest.d.ts.map +1 -1
- package/esm/models/subscriptionpricecreaterequest.js +0 -2
- package/esm/models/subscriptionpricecreaterequest.js.map +1 -1
- package/esm/models/tenantbillingdetails.d.ts +10 -0
- package/esm/models/tenantbillingdetails.d.ts.map +1 -0
- package/esm/models/tenantbillingdetails.js +13 -0
- package/esm/models/tenantbillingdetails.js.map +1 -0
- package/esm/models/tenantresponse.d.ts +15 -0
- package/esm/models/tenantresponse.d.ts.map +1 -0
- package/esm/models/tenantresponse.js +15 -0
- package/esm/models/tenantresponse.js.map +1 -0
- package/esm/models/transactionreason.d.ts +30 -0
- package/esm/models/transactionreason.d.ts.map +1 -0
- package/esm/models/transactionreason.js +31 -0
- package/esm/models/transactionreason.js.map +1 -0
- package/esm/models/transactionstatus.d.ts +14 -0
- package/esm/models/transactionstatus.d.ts.map +1 -0
- package/esm/models/transactionstatus.js +15 -0
- package/esm/models/transactionstatus.js.map +1 -0
- package/esm/models/transactiontype.d.ts +12 -0
- package/esm/models/transactiontype.d.ts.map +1 -0
- package/esm/models/transactiontype.js +13 -0
- package/esm/models/transactiontype.js.map +1 -0
- package/esm/models/userresponse.d.ts +12 -0
- package/esm/models/userresponse.d.ts.map +1 -0
- package/esm/models/userresponse.js +14 -0
- package/esm/models/userresponse.js.map +1 -0
- package/esm/models/usertype.d.ts +12 -0
- package/esm/models/usertype.d.ts.map +1 -0
- package/esm/models/usertype.js +13 -0
- package/esm/models/usertype.js.map +1 -0
- package/esm/models/walletconfig.d.ts +7 -0
- package/esm/models/walletconfig.d.ts.map +1 -0
- package/esm/models/walletconfig.js +10 -0
- package/esm/models/walletconfig.js.map +1 -0
- package/esm/models/walletconfigpricetype.d.ts +14 -0
- package/esm/models/walletconfigpricetype.d.ts.map +1 -0
- package/esm/models/walletconfigpricetype.js +15 -0
- package/esm/models/walletconfigpricetype.js.map +1 -0
- package/esm/models/walletresponse.d.ts +39 -0
- package/esm/models/walletresponse.d.ts.map +1 -0
- package/esm/models/walletresponse.js +39 -0
- package/esm/models/walletresponse.js.map +1 -0
- package/esm/models/walletstatus.d.ts +14 -0
- package/esm/models/walletstatus.d.ts.map +1 -0
- package/esm/models/walletstatus.js +15 -0
- package/esm/models/walletstatus.js.map +1 -0
- package/esm/models/wallettransactionresponse.d.ts +46 -0
- package/esm/models/wallettransactionresponse.d.ts.map +1 -0
- package/esm/models/wallettransactionresponse.js +46 -0
- package/esm/models/wallettransactionresponse.js.map +1 -0
- package/esm/models/wallettxreferencetype.d.ts +16 -0
- package/esm/models/wallettxreferencetype.d.ts.map +1 -0
- package/esm/models/wallettxreferencetype.js +17 -0
- package/esm/models/wallettxreferencetype.js.map +1 -0
- package/esm/models/wallettype.d.ts +12 -0
- package/esm/models/wallettype.d.ts.map +1 -0
- package/esm/models/wallettype.js +13 -0
- package/esm/models/wallettype.js.map +1 -0
- package/esm/tool-names.d.ts.map +1 -1
- package/esm/tool-names.js +10 -2
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +11 -3
- package/package.json +1 -1
- package/src/funcs/invoicesGetMeterUsagePreviewInvoice.ts +144 -0
- package/src/funcs/{plansPostPlansIdClone.ts → plansClonePlan.ts} +9 -9
- package/src/funcs/subscriptionsExecuteSubscriptionModify.ts +7 -7
- package/src/funcs/subscriptionsPreviewSubscriptionModify.ts +153 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -3
- package/src/mcp-server/tools/invoicesGetMeterUsagePreviewInvoice.ts +47 -0
- package/src/mcp-server/tools/{plansPostPlansIdClone.ts → plansClonePlan.ts} +6 -6
- package/src/mcp-server/tools/subscriptionsExecuteSubscriptionModify.ts +4 -4
- package/src/mcp-server/tools/subscriptionsPreviewSubscriptionModify.ts +45 -0
- package/src/models/address.ts +23 -0
- package/src/models/alertstate.ts +21 -0
- package/src/models/autotopup.ts +19 -0
- package/src/models/billingcadence.ts +0 -2
- package/src/models/billingperiod.ts +2 -0
- package/src/models/changedinvoice.ts +41 -0
- package/src/models/changedinvoiceaction.ts +23 -0
- package/src/models/changedinvoicestatus.ts +25 -0
- package/src/models/changedlineitem.ts +29 -0
- package/src/models/changedlineitemaction.ts +25 -0
- package/src/models/changedresources.ts +28 -0
- package/src/models/changedsubscription.ts +28 -0
- package/src/models/changedsubscriptionaction.ts +25 -0
- package/src/models/{postplansidcloneop.ts → cloneplanop.ts} +9 -10
- package/src/models/createpricerequest.ts +0 -3
- package/src/models/createsubscriptionrequest.ts +4 -3
- package/src/models/creditbreakdown.ts +15 -0
- package/src/models/executesubscriptionmodifyop.ts +14 -14
- package/src/models/executesubscriptionmodifyrequest.ts +31 -0
- package/src/models/getmeterusagepreviewinvoiceop.ts +21 -0
- package/src/models/invoicefilter.ts +4 -0
- package/src/models/invoiceresponse.ts +4 -0
- package/src/models/lineitemquantitychange.ts +21 -0
- package/src/models/previewsubscriptionmodifyop.ts +39 -0
- package/src/models/{executesubscriptioninheritancerequest.ts → submodifyinheritancerequest.ts} +3 -3
- package/src/models/submodifyquantitychangerequest.ts +19 -0
- package/src/models/subscriptionmodifyresponse.ts +25 -0
- package/src/models/subscriptionmodifytype.ts +17 -0
- package/src/models/subscriptionphasecreaterequest.ts +9 -0
- package/src/models/subscriptionpricecreaterequest.ts +0 -3
- package/src/models/tenantbillingdetails.ts +21 -0
- package/src/models/tenantresponse.ts +29 -0
- package/src/models/transactionreason.ts +35 -0
- package/src/models/transactionstatus.ts +19 -0
- package/src/models/transactiontype.ts +17 -0
- package/src/models/userresponse.ts +23 -0
- package/src/models/usertype.ts +17 -0
- package/src/models/walletconfig.ts +20 -0
- package/src/models/walletconfigpricetype.ts +19 -0
- package/src/models/walletresponse.ts +74 -0
- package/src/models/walletstatus.ts +19 -0
- package/src/models/wallettransactionresponse.ts +104 -0
- package/src/models/wallettxreferencetype.ts +21 -0
- package/src/models/wallettype.ts +17 -0
- package/src/tool-names.ts +10 -2
- package/esm/funcs/plansPostPlansIdClone.d.ts.map +0 -1
- package/esm/funcs/plansPostPlansIdClone.js.map +0 -1
- package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts +0 -7
- package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts.map +0 -1
- package/esm/mcp-server/tools/plansPostPlansIdClone.js.map +0 -1
- package/esm/models/executesubscriptioninheritancerequest.d.ts +0 -6
- package/esm/models/executesubscriptioninheritancerequest.d.ts.map +0 -1
- package/esm/models/executesubscriptioninheritancerequest.js.map +0 -1
- package/esm/models/postplansidcloneop.d.ts +0 -12
- package/esm/models/postplansidcloneop.d.ts.map +0 -1
- package/esm/models/postplansidcloneop.js.map +0 -1
package/manifest.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"sensitive": true
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"version": "2.1.
|
|
51
|
+
"version": "2.1.3",
|
|
52
52
|
"tools": [
|
|
53
53
|
{
|
|
54
54
|
"name": "update-customer",
|
|
@@ -94,6 +94,10 @@
|
|
|
94
94
|
"name": "create-invoice",
|
|
95
95
|
"description": "Create one-off invoice\n\nUse when creating a manual or one-off invoice (e.g. custom charge or non-recurring billing). Invoice is created in draft; finalize when ready."
|
|
96
96
|
},
|
|
97
|
+
{
|
|
98
|
+
"name": "get-meter-usage-preview-invoice",
|
|
99
|
+
"description": "Get invoice preview using meter_usage data\n\nPreview invoice using the meter_usage table for usage data instead of feature_usage."
|
|
100
|
+
},
|
|
97
101
|
{
|
|
98
102
|
"name": "get-invoice-preview",
|
|
99
103
|
"description": "Get invoice preview\n\nUse when showing a customer what they will be charged (e.g. preview before checkout or plan change). No invoice is created."
|
|
@@ -195,7 +199,7 @@
|
|
|
195
199
|
"description": "Delete plan\n\nUse when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message."
|
|
196
200
|
},
|
|
197
201
|
{
|
|
198
|
-
"name": "
|
|
202
|
+
"name": "clone-plan",
|
|
199
203
|
"description": "Clone a plan\n\nClone an existing plan, copying its active prices, published entitlements, and published credit grants"
|
|
200
204
|
},
|
|
201
205
|
{
|
|
@@ -300,7 +304,11 @@
|
|
|
300
304
|
},
|
|
301
305
|
{
|
|
302
306
|
"name": "execute-subscription-modify",
|
|
303
|
-
"description": "
|
|
307
|
+
"description": "Execute subscription modification\n\nExecute a mid-cycle subscription modification (inheritance or quantity change)."
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "preview-subscription-modify",
|
|
311
|
+
"description": "Preview subscription modification\n\nPreview the impact of a mid-cycle subscription modification without committing changes."
|
|
304
312
|
},
|
|
305
313
|
{
|
|
306
314
|
"name": "pause-subscription",
|
package/package.json
CHANGED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { FlexpriceCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } 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
|
+
GetPreviewInvoiceRequest,
|
|
23
|
+
GetPreviewInvoiceRequest$zodSchema,
|
|
24
|
+
} from "../models/getpreviewinvoicerequest.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get invoice preview using meter_usage data
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Preview invoice using the meter_usage table for usage data instead of feature_usage.
|
|
33
|
+
*/
|
|
34
|
+
export function invoicesGetMeterUsagePreviewInvoice(
|
|
35
|
+
client$: FlexpriceCore,
|
|
36
|
+
request: GetPreviewInvoiceRequest,
|
|
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: GetPreviewInvoiceRequest,
|
|
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$) => GetPreviewInvoiceRequest$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$, { explode: true });
|
|
86
|
+
const path$ = pathToFunc("/invoices/meter-usage-preview")();
|
|
87
|
+
|
|
88
|
+
const headers$ = new Headers(compactMap({
|
|
89
|
+
"Content-Type": "application/json",
|
|
90
|
+
Accept: "application/json",
|
|
91
|
+
}));
|
|
92
|
+
const securityInput = await extractSecurity(client$._options.security);
|
|
93
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
94
|
+
|
|
95
|
+
const context = {
|
|
96
|
+
options: client$._options,
|
|
97
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
98
|
+
operationID: "getMeterUsagePreviewInvoice",
|
|
99
|
+
oAuth2Scopes: null,
|
|
100
|
+
resolvedSecurity: requestSecurity,
|
|
101
|
+
securitySource: client$._options.security,
|
|
102
|
+
retryConfig: options?.retries
|
|
103
|
+
|| client$._options.retryConfig
|
|
104
|
+
|| { strategy: "none" },
|
|
105
|
+
retryCodes: options?.retryCodes || [
|
|
106
|
+
"429",
|
|
107
|
+
"500",
|
|
108
|
+
"502",
|
|
109
|
+
"503",
|
|
110
|
+
"504",
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client$._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path$,
|
|
119
|
+
headers: headers$,
|
|
120
|
+
body: body$,
|
|
121
|
+
userAgent: client$._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs
|
|
123
|
+
|| -1,
|
|
124
|
+
}, options);
|
|
125
|
+
if (!requestRes.ok) {
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
127
|
+
}
|
|
128
|
+
const req$ = requestRes.value;
|
|
129
|
+
|
|
130
|
+
const doResult = await client$._do(req$, {
|
|
131
|
+
context,
|
|
132
|
+
errorCodes: [],
|
|
133
|
+
retryConfig: context.retryConfig,
|
|
134
|
+
retryCodes: context.retryCodes,
|
|
135
|
+
});
|
|
136
|
+
if (!doResult.ok) {
|
|
137
|
+
return [doResult, { status: "request-error", request: req$ }];
|
|
138
|
+
}
|
|
139
|
+
return [doResult, {
|
|
140
|
+
status: "complete",
|
|
141
|
+
"request": req$,
|
|
142
|
+
response: doResult.value,
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
@@ -9,6 +9,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
9
9
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ClonePlanRequestRequest,
|
|
14
|
+
ClonePlanRequestRequest$zodSchema,
|
|
15
|
+
} from "../models/cloneplanop.js";
|
|
12
16
|
import { APIError } from "../models/errors/apierror.js";
|
|
13
17
|
import {
|
|
14
18
|
ConnectionError,
|
|
@@ -18,10 +22,6 @@ import {
|
|
|
18
22
|
UnexpectedClientError,
|
|
19
23
|
} from "../models/errors/httpclienterrors.js";
|
|
20
24
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
-
import {
|
|
22
|
-
PostPlansIdCloneRequest,
|
|
23
|
-
PostPlansIdCloneRequest$zodSchema,
|
|
24
|
-
} from "../models/postplansidcloneop.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
@@ -31,9 +31,9 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* @remarks
|
|
32
32
|
* Clone an existing plan, copying its active prices, published entitlements, and published credit grants
|
|
33
33
|
*/
|
|
34
|
-
export function
|
|
34
|
+
export function plansClonePlan(
|
|
35
35
|
client$: FlexpriceCore,
|
|
36
|
-
request:
|
|
36
|
+
request: ClonePlanRequestRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
@@ -56,7 +56,7 @@ export function plansPostPlansIdClone(
|
|
|
56
56
|
|
|
57
57
|
async function $do(
|
|
58
58
|
client$: FlexpriceCore,
|
|
59
|
-
request:
|
|
59
|
+
request: ClonePlanRequestRequest,
|
|
60
60
|
options?: RequestOptions,
|
|
61
61
|
): Promise<
|
|
62
62
|
[
|
|
@@ -75,7 +75,7 @@ async function $do(
|
|
|
75
75
|
> {
|
|
76
76
|
const parsed$ = safeParse(
|
|
77
77
|
request,
|
|
78
|
-
(value$) =>
|
|
78
|
+
(value$) => ClonePlanRequestRequest$zodSchema.parse(value$),
|
|
79
79
|
"Input validation failed",
|
|
80
80
|
);
|
|
81
81
|
if (!parsed$.ok) {
|
|
@@ -104,7 +104,7 @@ async function $do(
|
|
|
104
104
|
const context = {
|
|
105
105
|
options: client$._options,
|
|
106
106
|
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
107
|
-
operationID: "
|
|
107
|
+
operationID: "clonePlan",
|
|
108
108
|
oAuth2Scopes: null,
|
|
109
109
|
resolvedSecurity: requestSecurity,
|
|
110
110
|
securitySource: client$._options.security,
|
|
@@ -19,21 +19,21 @@ import {
|
|
|
19
19
|
} from "../models/errors/httpclienterrors.js";
|
|
20
20
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
ExecuteSubscriptionModifyRequestRequest,
|
|
23
|
+
ExecuteSubscriptionModifyRequestRequest$zodSchema,
|
|
24
24
|
} from "../models/executesubscriptionmodifyop.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Execute subscription modification
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
*
|
|
32
|
+
* Execute a mid-cycle subscription modification (inheritance or quantity change).
|
|
33
33
|
*/
|
|
34
34
|
export function subscriptionsExecuteSubscriptionModify(
|
|
35
35
|
client$: FlexpriceCore,
|
|
36
|
-
request:
|
|
36
|
+
request: ExecuteSubscriptionModifyRequestRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
@@ -56,7 +56,7 @@ export function subscriptionsExecuteSubscriptionModify(
|
|
|
56
56
|
|
|
57
57
|
async function $do(
|
|
58
58
|
client$: FlexpriceCore,
|
|
59
|
-
request:
|
|
59
|
+
request: ExecuteSubscriptionModifyRequestRequest,
|
|
60
60
|
options?: RequestOptions,
|
|
61
61
|
): Promise<
|
|
62
62
|
[
|
|
@@ -75,7 +75,7 @@ async function $do(
|
|
|
75
75
|
> {
|
|
76
76
|
const parsed$ = safeParse(
|
|
77
77
|
request,
|
|
78
|
-
(value$) =>
|
|
78
|
+
(value$) => ExecuteSubscriptionModifyRequestRequest$zodSchema.parse(value$),
|
|
79
79
|
"Input validation failed",
|
|
80
80
|
);
|
|
81
81
|
if (!parsed$.ok) {
|
|
@@ -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
|
+
PreviewSubscriptionModifyRequest,
|
|
23
|
+
PreviewSubscriptionModifyRequest$zodSchema,
|
|
24
|
+
} from "../models/previewsubscriptionmodifyop.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Preview subscription modification
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Preview the impact of a mid-cycle subscription modification without committing changes.
|
|
33
|
+
*/
|
|
34
|
+
export function subscriptionsPreviewSubscriptionModify(
|
|
35
|
+
client$: FlexpriceCore,
|
|
36
|
+
request: PreviewSubscriptionModifyRequest,
|
|
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: PreviewSubscriptionModifyRequest,
|
|
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$) => PreviewSubscriptionModifyRequest$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}/modify/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: "previewSubscriptionModify",
|
|
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
|
+
}
|
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.879.
|
|
72
|
+
sdkVersion: "2.1.3",
|
|
73
|
+
genVersion: "2.879.13",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/mcp-typescript 2.1.
|
|
75
|
+
"speakeasy-sdk/mcp-typescript 2.1.3 2.879.13 1.0 @flexprice/mcp-server",
|
|
76
76
|
} as const;
|
package/src/lib/encodings.ts
CHANGED
|
@@ -513,3 +513,12 @@ export function appendForm(
|
|
|
513
513
|
fd.append(key, String(value));
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
+
|
|
517
|
+
export async function normalizeBlob(
|
|
518
|
+
value: Pick<Blob, "arrayBuffer" | "type">,
|
|
519
|
+
): Promise<Blob> {
|
|
520
|
+
if (value instanceof Blob) {
|
|
521
|
+
return value;
|
|
522
|
+
}
|
|
523
|
+
return new Blob([await value.arrayBuffer()], { type: value.type });
|
|
524
|
+
}
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { tool$invoicesGetCustomerInvoiceSummary } from "./tools/invoicesGetCusto
|
|
|
41
41
|
import { tool$invoicesGetInvoice } from "./tools/invoicesGetInvoice.js";
|
|
42
42
|
import { tool$invoicesGetInvoicePdf } from "./tools/invoicesGetInvoicePdf.js";
|
|
43
43
|
import { tool$invoicesGetInvoicePreview } from "./tools/invoicesGetInvoicePreview.js";
|
|
44
|
+
import { tool$invoicesGetMeterUsagePreviewInvoice } from "./tools/invoicesGetMeterUsagePreviewInvoice.js";
|
|
44
45
|
import { tool$invoicesQueryInvoice } from "./tools/invoicesQueryInvoice.js";
|
|
45
46
|
import { tool$invoicesRecalculateInvoice } from "./tools/invoicesRecalculateInvoice.js";
|
|
46
47
|
import { tool$invoicesRecalculateInvoiceV2 } from "./tools/invoicesRecalculateInvoiceV2.js";
|
|
@@ -48,10 +49,10 @@ import { tool$invoicesTriggerInvoiceCommsWebhook } from "./tools/invoicesTrigger
|
|
|
48
49
|
import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
|
|
49
50
|
import { tool$invoicesUpdateInvoicePaymentStatus } from "./tools/invoicesUpdateInvoicePaymentStatus.js";
|
|
50
51
|
import { tool$invoicesVoidInvoice } from "./tools/invoicesVoidInvoice.js";
|
|
52
|
+
import { tool$plansClonePlan } from "./tools/plansClonePlan.js";
|
|
51
53
|
import { tool$plansCreatePlan } from "./tools/plansCreatePlan.js";
|
|
52
54
|
import { tool$plansDeletePlan } from "./tools/plansDeletePlan.js";
|
|
53
55
|
import { tool$plansGetPlan } from "./tools/plansGetPlan.js";
|
|
54
|
-
import { tool$plansPostPlansIdClone } from "./tools/plansPostPlansIdClone.js";
|
|
55
56
|
import { tool$plansQueryPlan } from "./tools/plansQueryPlan.js";
|
|
56
57
|
import { tool$plansSyncPlanPrices } from "./tools/plansSyncPlanPrices.js";
|
|
57
58
|
import { tool$plansUpdatePlan } from "./tools/plansUpdatePlan.js";
|
|
@@ -83,6 +84,7 @@ import { tool$subscriptionsListSubscriptionPauses } from "./tools/subscriptionsL
|
|
|
83
84
|
import { tool$subscriptionsListSubscriptionSchedules } from "./tools/subscriptionsListSubscriptionSchedules.js";
|
|
84
85
|
import { tool$subscriptionsPauseSubscription } from "./tools/subscriptionsPauseSubscription.js";
|
|
85
86
|
import { tool$subscriptionsPreviewSubscriptionChange } from "./tools/subscriptionsPreviewSubscriptionChange.js";
|
|
87
|
+
import { tool$subscriptionsPreviewSubscriptionModify } from "./tools/subscriptionsPreviewSubscriptionModify.js";
|
|
86
88
|
import { tool$subscriptionsQuerySubscription } from "./tools/subscriptionsQuerySubscription.js";
|
|
87
89
|
import { tool$subscriptionsRemoveSubscriptionAddon } from "./tools/subscriptionsRemoveSubscriptionAddon.js";
|
|
88
90
|
import { tool$subscriptionsResumeSubscription } from "./tools/subscriptionsResumeSubscription.js";
|
|
@@ -102,7 +104,7 @@ export function createMCPServer(deps: {
|
|
|
102
104
|
}) {
|
|
103
105
|
const server = new McpServer({
|
|
104
106
|
name: "Flexprice",
|
|
105
|
-
version: "2.1.
|
|
107
|
+
version: "2.1.3",
|
|
106
108
|
});
|
|
107
109
|
|
|
108
110
|
const getClient = deps.getSDK || (() =>
|
|
@@ -158,6 +160,7 @@ export function createMCPServer(deps: {
|
|
|
158
160
|
tool(tool$customersGetCustomerUpcomingGrants);
|
|
159
161
|
tool(tool$invoicesGetCustomerInvoiceSummary);
|
|
160
162
|
tool(tool$invoicesCreateInvoice);
|
|
163
|
+
tool(tool$invoicesGetMeterUsagePreviewInvoice);
|
|
161
164
|
tool(tool$invoicesGetInvoicePreview);
|
|
162
165
|
tool(tool$invoicesQueryInvoice);
|
|
163
166
|
tool(tool$invoicesGetInvoice);
|
|
@@ -183,7 +186,7 @@ export function createMCPServer(deps: {
|
|
|
183
186
|
tool(tool$plansGetPlan);
|
|
184
187
|
tool(tool$plansUpdatePlan);
|
|
185
188
|
tool(tool$plansDeletePlan);
|
|
186
|
-
tool(tool$
|
|
189
|
+
tool(tool$plansClonePlan);
|
|
187
190
|
tool(tool$plansSyncPlanPrices);
|
|
188
191
|
tool(tool$pricesCreatePrice);
|
|
189
192
|
tool(tool$pricesCreatePricesBulk);
|
|
@@ -210,6 +213,7 @@ export function createMCPServer(deps: {
|
|
|
210
213
|
tool(tool$subscriptionsGetSubscriptionUpcomingGrants);
|
|
211
214
|
tool(tool$subscriptionsCreateSubscriptionLineItem);
|
|
212
215
|
tool(tool$subscriptionsExecuteSubscriptionModify);
|
|
216
|
+
tool(tool$subscriptionsPreviewSubscriptionModify);
|
|
213
217
|
tool(tool$subscriptionsPauseSubscription);
|
|
214
218
|
tool(tool$subscriptionsListSubscriptionPauses);
|
|
215
219
|
tool(tool$subscriptionsResumeSubscription);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesGetMeterUsagePreviewInvoice } from "../../funcs/invoicesGetMeterUsagePreviewInvoice.js";
|
|
6
|
+
import { GetPreviewInvoiceRequest$zodSchema } from "../../models/getpreviewinvoicerequest.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: GetPreviewInvoiceRequest$zodSchema.describe(
|
|
11
|
+
`Preview Invoice Request`,
|
|
12
|
+
),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const tool$invoicesGetMeterUsagePreviewInvoice: ToolDefinition<
|
|
16
|
+
typeof args
|
|
17
|
+
> = {
|
|
18
|
+
name: "get-meter-usage-preview-invoice",
|
|
19
|
+
description: `Get invoice preview using meter_usage data
|
|
20
|
+
|
|
21
|
+
Preview invoice using the meter_usage table for usage data instead of feature_usage.`,
|
|
22
|
+
scopes: ["write"],
|
|
23
|
+
annotations: {
|
|
24
|
+
"title": "",
|
|
25
|
+
"destructiveHint": false,
|
|
26
|
+
"idempotentHint": false,
|
|
27
|
+
"openWorldHint": false,
|
|
28
|
+
"readOnlyHint": false,
|
|
29
|
+
},
|
|
30
|
+
args,
|
|
31
|
+
tool: async (client, args, ctx) => {
|
|
32
|
+
const [result] = await invoicesGetMeterUsagePreviewInvoice(
|
|
33
|
+
client,
|
|
34
|
+
args.request,
|
|
35
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
36
|
+
).$inspect();
|
|
37
|
+
|
|
38
|
+
if (!result.ok) {
|
|
39
|
+
return {
|
|
40
|
+
content: [{ type: "text", text: result.error.message }],
|
|
41
|
+
isError: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return formatResult(result.value);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { plansClonePlan } from "../../funcs/plansClonePlan.js";
|
|
6
|
+
import { ClonePlanRequestRequest$zodSchema } from "../../models/cloneplanop.js";
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
|
-
request:
|
|
10
|
+
request: ClonePlanRequestRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$
|
|
14
|
-
name: "
|
|
13
|
+
export const tool$plansClonePlan: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "clone-plan",
|
|
15
15
|
description: `Clone a plan
|
|
16
16
|
|
|
17
17
|
Clone an existing plan, copying its active prices, published entitlements, and published credit grants`,
|
|
@@ -25,7 +25,7 @@ Clone an existing plan, copying its active prices, published entitlements, and p
|
|
|
25
25
|
},
|
|
26
26
|
args,
|
|
27
27
|
tool: async (client, args, ctx) => {
|
|
28
|
-
const [result] = await
|
|
28
|
+
const [result] = await plansClonePlan(
|
|
29
29
|
client,
|
|
30
30
|
args.request,
|
|
31
31
|
{ fetchOptions: { signal: ctx.signal } },
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { subscriptionsExecuteSubscriptionModify } from "../../funcs/subscriptionsExecuteSubscriptionModify.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ExecuteSubscriptionModifyRequestRequest$zodSchema } from "../../models/executesubscriptionmodifyop.js";
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
|
-
request:
|
|
10
|
+
request: ExecuteSubscriptionModifyRequestRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const tool$subscriptionsExecuteSubscriptionModify: ToolDefinition<
|
|
14
14
|
typeof args
|
|
15
15
|
> = {
|
|
16
16
|
name: "execute-subscription-modify",
|
|
17
|
-
description: `
|
|
17
|
+
description: `Execute subscription modification
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Execute a mid-cycle subscription modification (inheritance or quantity change).`,
|
|
20
20
|
scopes: ["write"],
|
|
21
21
|
annotations: {
|
|
22
22
|
"title": "",
|