dodopayments-mcp 1.30.0 → 1.32.0
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/dynamic-tools.d.mts +1 -1
- package/dynamic-tools.d.mts.map +1 -1
- package/dynamic-tools.d.ts +1 -1
- package/dynamic-tools.d.ts.map +1 -1
- package/dynamic-tools.js +5 -4
- package/dynamic-tools.js.map +1 -1
- package/dynamic-tools.mjs +5 -4
- package/dynamic-tools.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts +1 -6
- package/server.d.mts.map +1 -1
- package/server.d.ts +1 -6
- package/server.d.ts.map +1 -1
- package/server.js +2 -10
- package/server.js.map +1 -1
- package/server.mjs +2 -10
- package/server.mjs.map +1 -1
- package/src/dynamic-tools.ts +13 -7
- package/src/server.ts +2 -10
- package/src/tools/addons/create-addons.ts +4 -2
- package/src/tools/addons/list-addons.ts +4 -2
- package/src/tools/addons/retrieve-addons.ts +4 -2
- package/src/tools/addons/update-addons.ts +4 -2
- package/src/tools/addons/update-images-addons.ts +4 -2
- package/src/tools/brands/create-brands.ts +4 -2
- package/src/tools/brands/list-brands.ts +4 -2
- package/src/tools/brands/retrieve-brands.ts +4 -2
- package/src/tools/brands/update-brands.ts +4 -2
- package/src/tools/brands/update-images-brands.ts +4 -2
- package/src/tools/customers/create-customers.ts +4 -2
- package/src/tools/customers/customer-portal/create-customers-customer-portal.ts +4 -2
- package/src/tools/customers/list-customers.ts +4 -2
- package/src/tools/customers/retrieve-customers.ts +4 -2
- package/src/tools/customers/update-customers.ts +10 -2
- package/src/tools/discounts/create-discounts.ts +4 -2
- package/src/tools/discounts/delete-discounts.ts +5 -2
- package/src/tools/discounts/list-discounts.ts +4 -2
- package/src/tools/discounts/retrieve-discounts.ts +4 -2
- package/src/tools/discounts/update-discounts.ts +4 -2
- package/src/tools/disputes/list-disputes.ts +4 -2
- package/src/tools/disputes/retrieve-disputes.ts +4 -2
- package/src/tools/index.ts +3 -23
- package/src/tools/invoices/payments/retrieve-invoices-payments.ts +4 -2
- package/src/tools/license-key-instances/list-license-key-instances.ts +4 -2
- package/src/tools/license-key-instances/retrieve-license-key-instances.ts +4 -2
- package/src/tools/license-key-instances/update-license-key-instances.ts +4 -2
- package/src/tools/license-keys/list-license-keys.ts +4 -2
- package/src/tools/license-keys/retrieve-license-keys.ts +4 -2
- package/src/tools/license-keys/update-license-keys.ts +4 -2
- package/src/tools/licenses/activate-licenses.ts +4 -2
- package/src/tools/licenses/deactivate-licenses.ts +5 -2
- package/src/tools/licenses/validate-licenses.ts +4 -2
- package/src/tools/misc/list-supported-countries-misc.ts +4 -2
- package/src/tools/payments/create-payments.ts +4 -2
- package/src/tools/payments/list-payments.ts +4 -2
- package/src/tools/payments/retrieve-line-items-payments.ts +4 -2
- package/src/tools/payments/retrieve-payments.ts +4 -2
- package/src/tools/payouts/list-payouts.ts +4 -2
- package/src/tools/products/create-products.ts +4 -2
- package/src/tools/products/delete-products.ts +5 -2
- package/src/tools/products/images/update-products-images.ts +4 -2
- package/src/tools/products/list-products.ts +4 -2
- package/src/tools/products/retrieve-products.ts +4 -2
- package/src/tools/products/unarchive-products.ts +5 -2
- package/src/tools/products/update-products.ts +5 -2
- package/src/tools/refunds/create-refunds.ts +4 -2
- package/src/tools/refunds/list-refunds.ts +4 -2
- package/src/tools/refunds/retrieve-refunds.ts +4 -2
- package/src/tools/subscriptions/change-plan-subscriptions.ts +33 -2
- package/src/tools/subscriptions/charge-subscriptions.ts +4 -2
- package/src/tools/subscriptions/create-subscriptions.ts +4 -2
- package/src/tools/subscriptions/list-subscriptions.ts +4 -2
- package/src/tools/subscriptions/retrieve-subscriptions.ts +4 -2
- package/src/tools/subscriptions/update-subscriptions.ts +7 -2
- package/src/tools/types.ts +104 -0
- package/src/tools/webhook-events/list-webhook-events.ts +8 -2
- package/src/tools/webhook-events/retrieve-webhook-events.ts +4 -2
- package/tools/addons/create-addons.d.mts +2 -2
- package/tools/addons/create-addons.d.mts.map +1 -1
- package/tools/addons/create-addons.d.ts +2 -2
- package/tools/addons/create-addons.d.ts.map +1 -1
- package/tools/addons/create-addons.js +3 -2
- package/tools/addons/create-addons.js.map +1 -1
- package/tools/addons/create-addons.mjs +3 -2
- package/tools/addons/create-addons.mjs.map +1 -1
- package/tools/addons/list-addons.d.mts +2 -2
- package/tools/addons/list-addons.d.mts.map +1 -1
- package/tools/addons/list-addons.d.ts +2 -2
- package/tools/addons/list-addons.d.ts.map +1 -1
- package/tools/addons/list-addons.js +3 -2
- package/tools/addons/list-addons.js.map +1 -1
- package/tools/addons/list-addons.mjs +3 -2
- package/tools/addons/list-addons.mjs.map +1 -1
- package/tools/addons/retrieve-addons.d.mts +2 -2
- package/tools/addons/retrieve-addons.d.mts.map +1 -1
- package/tools/addons/retrieve-addons.d.ts +2 -2
- package/tools/addons/retrieve-addons.d.ts.map +1 -1
- package/tools/addons/retrieve-addons.js +3 -2
- package/tools/addons/retrieve-addons.js.map +1 -1
- package/tools/addons/retrieve-addons.mjs +3 -2
- package/tools/addons/retrieve-addons.mjs.map +1 -1
- package/tools/addons/update-addons.d.mts +2 -2
- package/tools/addons/update-addons.d.mts.map +1 -1
- package/tools/addons/update-addons.d.ts +2 -2
- package/tools/addons/update-addons.d.ts.map +1 -1
- package/tools/addons/update-addons.js +3 -2
- package/tools/addons/update-addons.js.map +1 -1
- package/tools/addons/update-addons.mjs +3 -2
- package/tools/addons/update-addons.mjs.map +1 -1
- package/tools/addons/update-images-addons.d.mts +2 -2
- package/tools/addons/update-images-addons.d.mts.map +1 -1
- package/tools/addons/update-images-addons.d.ts +2 -2
- package/tools/addons/update-images-addons.d.ts.map +1 -1
- package/tools/addons/update-images-addons.js +3 -2
- package/tools/addons/update-images-addons.js.map +1 -1
- package/tools/addons/update-images-addons.mjs +3 -2
- package/tools/addons/update-images-addons.mjs.map +1 -1
- package/tools/brands/create-brands.d.mts +2 -2
- package/tools/brands/create-brands.d.mts.map +1 -1
- package/tools/brands/create-brands.d.ts +2 -2
- package/tools/brands/create-brands.d.ts.map +1 -1
- package/tools/brands/create-brands.js +3 -2
- package/tools/brands/create-brands.js.map +1 -1
- package/tools/brands/create-brands.mjs +3 -2
- package/tools/brands/create-brands.mjs.map +1 -1
- package/tools/brands/list-brands.d.mts +2 -2
- package/tools/brands/list-brands.d.mts.map +1 -1
- package/tools/brands/list-brands.d.ts +2 -2
- package/tools/brands/list-brands.d.ts.map +1 -1
- package/tools/brands/list-brands.js +3 -2
- package/tools/brands/list-brands.js.map +1 -1
- package/tools/brands/list-brands.mjs +3 -2
- package/tools/brands/list-brands.mjs.map +1 -1
- package/tools/brands/retrieve-brands.d.mts +2 -2
- package/tools/brands/retrieve-brands.d.mts.map +1 -1
- package/tools/brands/retrieve-brands.d.ts +2 -2
- package/tools/brands/retrieve-brands.d.ts.map +1 -1
- package/tools/brands/retrieve-brands.js +3 -2
- package/tools/brands/retrieve-brands.js.map +1 -1
- package/tools/brands/retrieve-brands.mjs +3 -2
- package/tools/brands/retrieve-brands.mjs.map +1 -1
- package/tools/brands/update-brands.d.mts +2 -2
- package/tools/brands/update-brands.d.mts.map +1 -1
- package/tools/brands/update-brands.d.ts +2 -2
- package/tools/brands/update-brands.d.ts.map +1 -1
- package/tools/brands/update-brands.js +3 -2
- package/tools/brands/update-brands.js.map +1 -1
- package/tools/brands/update-brands.mjs +3 -2
- package/tools/brands/update-brands.mjs.map +1 -1
- package/tools/brands/update-images-brands.d.mts +2 -2
- package/tools/brands/update-images-brands.d.mts.map +1 -1
- package/tools/brands/update-images-brands.d.ts +2 -2
- package/tools/brands/update-images-brands.d.ts.map +1 -1
- package/tools/brands/update-images-brands.js +3 -2
- package/tools/brands/update-images-brands.js.map +1 -1
- package/tools/brands/update-images-brands.mjs +3 -2
- package/tools/brands/update-images-brands.mjs.map +1 -1
- package/tools/customers/create-customers.d.mts +2 -2
- package/tools/customers/create-customers.d.mts.map +1 -1
- package/tools/customers/create-customers.d.ts +2 -2
- package/tools/customers/create-customers.d.ts.map +1 -1
- package/tools/customers/create-customers.js +3 -2
- package/tools/customers/create-customers.js.map +1 -1
- package/tools/customers/create-customers.mjs +3 -2
- package/tools/customers/create-customers.mjs.map +1 -1
- package/tools/customers/customer-portal/create-customers-customer-portal.d.mts +2 -2
- package/tools/customers/customer-portal/create-customers-customer-portal.d.mts.map +1 -1
- package/tools/customers/customer-portal/create-customers-customer-portal.d.ts +2 -2
- package/tools/customers/customer-portal/create-customers-customer-portal.d.ts.map +1 -1
- package/tools/customers/customer-portal/create-customers-customer-portal.js +3 -2
- package/tools/customers/customer-portal/create-customers-customer-portal.js.map +1 -1
- package/tools/customers/customer-portal/create-customers-customer-portal.mjs +3 -2
- package/tools/customers/customer-portal/create-customers-customer-portal.mjs.map +1 -1
- package/tools/customers/list-customers.d.mts +2 -2
- package/tools/customers/list-customers.d.mts.map +1 -1
- package/tools/customers/list-customers.d.ts +2 -2
- package/tools/customers/list-customers.d.ts.map +1 -1
- package/tools/customers/list-customers.js +3 -2
- package/tools/customers/list-customers.js.map +1 -1
- package/tools/customers/list-customers.mjs +3 -2
- package/tools/customers/list-customers.mjs.map +1 -1
- package/tools/customers/retrieve-customers.d.mts +2 -2
- package/tools/customers/retrieve-customers.d.mts.map +1 -1
- package/tools/customers/retrieve-customers.d.ts +2 -2
- package/tools/customers/retrieve-customers.d.ts.map +1 -1
- package/tools/customers/retrieve-customers.js +3 -2
- package/tools/customers/retrieve-customers.js.map +1 -1
- package/tools/customers/retrieve-customers.mjs +3 -2
- package/tools/customers/retrieve-customers.mjs.map +1 -1
- package/tools/customers/update-customers.d.mts +2 -2
- package/tools/customers/update-customers.d.mts.map +1 -1
- package/tools/customers/update-customers.d.ts +2 -2
- package/tools/customers/update-customers.d.ts.map +1 -1
- package/tools/customers/update-customers.js +9 -2
- package/tools/customers/update-customers.js.map +1 -1
- package/tools/customers/update-customers.mjs +9 -2
- package/tools/customers/update-customers.mjs.map +1 -1
- package/tools/discounts/create-discounts.d.mts +2 -2
- package/tools/discounts/create-discounts.d.mts.map +1 -1
- package/tools/discounts/create-discounts.d.ts +2 -2
- package/tools/discounts/create-discounts.d.ts.map +1 -1
- package/tools/discounts/create-discounts.js +3 -2
- package/tools/discounts/create-discounts.js.map +1 -1
- package/tools/discounts/create-discounts.mjs +3 -2
- package/tools/discounts/create-discounts.mjs.map +1 -1
- package/tools/discounts/delete-discounts.d.mts +2 -2
- package/tools/discounts/delete-discounts.d.mts.map +1 -1
- package/tools/discounts/delete-discounts.d.ts +2 -2
- package/tools/discounts/delete-discounts.d.ts.map +1 -1
- package/tools/discounts/delete-discounts.js +4 -2
- package/tools/discounts/delete-discounts.js.map +1 -1
- package/tools/discounts/delete-discounts.mjs +4 -2
- package/tools/discounts/delete-discounts.mjs.map +1 -1
- package/tools/discounts/list-discounts.d.mts +2 -2
- package/tools/discounts/list-discounts.d.mts.map +1 -1
- package/tools/discounts/list-discounts.d.ts +2 -2
- package/tools/discounts/list-discounts.d.ts.map +1 -1
- package/tools/discounts/list-discounts.js +3 -2
- package/tools/discounts/list-discounts.js.map +1 -1
- package/tools/discounts/list-discounts.mjs +3 -2
- package/tools/discounts/list-discounts.mjs.map +1 -1
- package/tools/discounts/retrieve-discounts.d.mts +2 -2
- package/tools/discounts/retrieve-discounts.d.mts.map +1 -1
- package/tools/discounts/retrieve-discounts.d.ts +2 -2
- package/tools/discounts/retrieve-discounts.d.ts.map +1 -1
- package/tools/discounts/retrieve-discounts.js +3 -2
- package/tools/discounts/retrieve-discounts.js.map +1 -1
- package/tools/discounts/retrieve-discounts.mjs +3 -2
- package/tools/discounts/retrieve-discounts.mjs.map +1 -1
- package/tools/discounts/update-discounts.d.mts +2 -2
- package/tools/discounts/update-discounts.d.mts.map +1 -1
- package/tools/discounts/update-discounts.d.ts +2 -2
- package/tools/discounts/update-discounts.d.ts.map +1 -1
- package/tools/discounts/update-discounts.js +3 -2
- package/tools/discounts/update-discounts.js.map +1 -1
- package/tools/discounts/update-discounts.mjs +3 -2
- package/tools/discounts/update-discounts.mjs.map +1 -1
- package/tools/disputes/list-disputes.d.mts +2 -2
- package/tools/disputes/list-disputes.d.mts.map +1 -1
- package/tools/disputes/list-disputes.d.ts +2 -2
- package/tools/disputes/list-disputes.d.ts.map +1 -1
- package/tools/disputes/list-disputes.js +3 -2
- package/tools/disputes/list-disputes.js.map +1 -1
- package/tools/disputes/list-disputes.mjs +3 -2
- package/tools/disputes/list-disputes.mjs.map +1 -1
- package/tools/disputes/retrieve-disputes.d.mts +2 -2
- package/tools/disputes/retrieve-disputes.d.mts.map +1 -1
- package/tools/disputes/retrieve-disputes.d.ts +2 -2
- package/tools/disputes/retrieve-disputes.d.ts.map +1 -1
- package/tools/disputes/retrieve-disputes.js +3 -2
- package/tools/disputes/retrieve-disputes.js.map +1 -1
- package/tools/disputes/retrieve-disputes.mjs +3 -2
- package/tools/disputes/retrieve-disputes.mjs.map +1 -1
- package/tools/index.d.mts +2 -16
- package/tools/index.d.mts.map +1 -1
- package/tools/index.d.ts +2 -16
- package/tools/index.d.ts.map +1 -1
- package/tools/index.js.map +1 -1
- package/tools/index.mjs.map +1 -1
- package/tools/invoices/payments/retrieve-invoices-payments.d.mts +2 -2
- package/tools/invoices/payments/retrieve-invoices-payments.d.mts.map +1 -1
- package/tools/invoices/payments/retrieve-invoices-payments.d.ts +2 -2
- package/tools/invoices/payments/retrieve-invoices-payments.d.ts.map +1 -1
- package/tools/invoices/payments/retrieve-invoices-payments.js +3 -2
- package/tools/invoices/payments/retrieve-invoices-payments.js.map +1 -1
- package/tools/invoices/payments/retrieve-invoices-payments.mjs +3 -2
- package/tools/invoices/payments/retrieve-invoices-payments.mjs.map +1 -1
- package/tools/license-key-instances/list-license-key-instances.d.mts +2 -2
- package/tools/license-key-instances/list-license-key-instances.d.mts.map +1 -1
- package/tools/license-key-instances/list-license-key-instances.d.ts +2 -2
- package/tools/license-key-instances/list-license-key-instances.d.ts.map +1 -1
- package/tools/license-key-instances/list-license-key-instances.js +3 -2
- package/tools/license-key-instances/list-license-key-instances.js.map +1 -1
- package/tools/license-key-instances/list-license-key-instances.mjs +3 -2
- package/tools/license-key-instances/list-license-key-instances.mjs.map +1 -1
- package/tools/license-key-instances/retrieve-license-key-instances.d.mts +2 -2
- package/tools/license-key-instances/retrieve-license-key-instances.d.mts.map +1 -1
- package/tools/license-key-instances/retrieve-license-key-instances.d.ts +2 -2
- package/tools/license-key-instances/retrieve-license-key-instances.d.ts.map +1 -1
- package/tools/license-key-instances/retrieve-license-key-instances.js +3 -2
- package/tools/license-key-instances/retrieve-license-key-instances.js.map +1 -1
- package/tools/license-key-instances/retrieve-license-key-instances.mjs +3 -2
- package/tools/license-key-instances/retrieve-license-key-instances.mjs.map +1 -1
- package/tools/license-key-instances/update-license-key-instances.d.mts +2 -2
- package/tools/license-key-instances/update-license-key-instances.d.mts.map +1 -1
- package/tools/license-key-instances/update-license-key-instances.d.ts +2 -2
- package/tools/license-key-instances/update-license-key-instances.d.ts.map +1 -1
- package/tools/license-key-instances/update-license-key-instances.js +3 -2
- package/tools/license-key-instances/update-license-key-instances.js.map +1 -1
- package/tools/license-key-instances/update-license-key-instances.mjs +3 -2
- package/tools/license-key-instances/update-license-key-instances.mjs.map +1 -1
- package/tools/license-keys/list-license-keys.d.mts +2 -2
- package/tools/license-keys/list-license-keys.d.mts.map +1 -1
- package/tools/license-keys/list-license-keys.d.ts +2 -2
- package/tools/license-keys/list-license-keys.d.ts.map +1 -1
- package/tools/license-keys/list-license-keys.js +3 -2
- package/tools/license-keys/list-license-keys.js.map +1 -1
- package/tools/license-keys/list-license-keys.mjs +3 -2
- package/tools/license-keys/list-license-keys.mjs.map +1 -1
- package/tools/license-keys/retrieve-license-keys.d.mts +2 -2
- package/tools/license-keys/retrieve-license-keys.d.mts.map +1 -1
- package/tools/license-keys/retrieve-license-keys.d.ts +2 -2
- package/tools/license-keys/retrieve-license-keys.d.ts.map +1 -1
- package/tools/license-keys/retrieve-license-keys.js +3 -2
- package/tools/license-keys/retrieve-license-keys.js.map +1 -1
- package/tools/license-keys/retrieve-license-keys.mjs +3 -2
- package/tools/license-keys/retrieve-license-keys.mjs.map +1 -1
- package/tools/license-keys/update-license-keys.d.mts +2 -2
- package/tools/license-keys/update-license-keys.d.mts.map +1 -1
- package/tools/license-keys/update-license-keys.d.ts +2 -2
- package/tools/license-keys/update-license-keys.d.ts.map +1 -1
- package/tools/license-keys/update-license-keys.js +3 -2
- package/tools/license-keys/update-license-keys.js.map +1 -1
- package/tools/license-keys/update-license-keys.mjs +3 -2
- package/tools/license-keys/update-license-keys.mjs.map +1 -1
- package/tools/licenses/activate-licenses.d.mts +2 -2
- package/tools/licenses/activate-licenses.d.mts.map +1 -1
- package/tools/licenses/activate-licenses.d.ts +2 -2
- package/tools/licenses/activate-licenses.d.ts.map +1 -1
- package/tools/licenses/activate-licenses.js +3 -2
- package/tools/licenses/activate-licenses.js.map +1 -1
- package/tools/licenses/activate-licenses.mjs +3 -2
- package/tools/licenses/activate-licenses.mjs.map +1 -1
- package/tools/licenses/deactivate-licenses.d.mts +2 -2
- package/tools/licenses/deactivate-licenses.d.mts.map +1 -1
- package/tools/licenses/deactivate-licenses.d.ts +2 -2
- package/tools/licenses/deactivate-licenses.d.ts.map +1 -1
- package/tools/licenses/deactivate-licenses.js +4 -2
- package/tools/licenses/deactivate-licenses.js.map +1 -1
- package/tools/licenses/deactivate-licenses.mjs +4 -2
- package/tools/licenses/deactivate-licenses.mjs.map +1 -1
- package/tools/licenses/validate-licenses.d.mts +2 -2
- package/tools/licenses/validate-licenses.d.mts.map +1 -1
- package/tools/licenses/validate-licenses.d.ts +2 -2
- package/tools/licenses/validate-licenses.d.ts.map +1 -1
- package/tools/licenses/validate-licenses.js +3 -2
- package/tools/licenses/validate-licenses.js.map +1 -1
- package/tools/licenses/validate-licenses.mjs +3 -2
- package/tools/licenses/validate-licenses.mjs.map +1 -1
- package/tools/misc/list-supported-countries-misc.d.mts +2 -2
- package/tools/misc/list-supported-countries-misc.d.mts.map +1 -1
- package/tools/misc/list-supported-countries-misc.d.ts +2 -2
- package/tools/misc/list-supported-countries-misc.d.ts.map +1 -1
- package/tools/misc/list-supported-countries-misc.js +3 -2
- package/tools/misc/list-supported-countries-misc.js.map +1 -1
- package/tools/misc/list-supported-countries-misc.mjs +3 -2
- package/tools/misc/list-supported-countries-misc.mjs.map +1 -1
- package/tools/payments/create-payments.d.mts +2 -2
- package/tools/payments/create-payments.d.mts.map +1 -1
- package/tools/payments/create-payments.d.ts +2 -2
- package/tools/payments/create-payments.d.ts.map +1 -1
- package/tools/payments/create-payments.js +3 -2
- package/tools/payments/create-payments.js.map +1 -1
- package/tools/payments/create-payments.mjs +3 -2
- package/tools/payments/create-payments.mjs.map +1 -1
- package/tools/payments/list-payments.d.mts +2 -2
- package/tools/payments/list-payments.d.mts.map +1 -1
- package/tools/payments/list-payments.d.ts +2 -2
- package/tools/payments/list-payments.d.ts.map +1 -1
- package/tools/payments/list-payments.js +3 -2
- package/tools/payments/list-payments.js.map +1 -1
- package/tools/payments/list-payments.mjs +3 -2
- package/tools/payments/list-payments.mjs.map +1 -1
- package/tools/payments/retrieve-line-items-payments.d.mts +2 -2
- package/tools/payments/retrieve-line-items-payments.d.mts.map +1 -1
- package/tools/payments/retrieve-line-items-payments.d.ts +2 -2
- package/tools/payments/retrieve-line-items-payments.d.ts.map +1 -1
- package/tools/payments/retrieve-line-items-payments.js +3 -2
- package/tools/payments/retrieve-line-items-payments.js.map +1 -1
- package/tools/payments/retrieve-line-items-payments.mjs +3 -2
- package/tools/payments/retrieve-line-items-payments.mjs.map +1 -1
- package/tools/payments/retrieve-payments.d.mts +2 -2
- package/tools/payments/retrieve-payments.d.mts.map +1 -1
- package/tools/payments/retrieve-payments.d.ts +2 -2
- package/tools/payments/retrieve-payments.d.ts.map +1 -1
- package/tools/payments/retrieve-payments.js +3 -2
- package/tools/payments/retrieve-payments.js.map +1 -1
- package/tools/payments/retrieve-payments.mjs +3 -2
- package/tools/payments/retrieve-payments.mjs.map +1 -1
- package/tools/payouts/list-payouts.d.mts +2 -2
- package/tools/payouts/list-payouts.d.mts.map +1 -1
- package/tools/payouts/list-payouts.d.ts +2 -2
- package/tools/payouts/list-payouts.d.ts.map +1 -1
- package/tools/payouts/list-payouts.js +3 -2
- package/tools/payouts/list-payouts.js.map +1 -1
- package/tools/payouts/list-payouts.mjs +3 -2
- package/tools/payouts/list-payouts.mjs.map +1 -1
- package/tools/products/create-products.d.mts +2 -2
- package/tools/products/create-products.d.mts.map +1 -1
- package/tools/products/create-products.d.ts +2 -2
- package/tools/products/create-products.d.ts.map +1 -1
- package/tools/products/create-products.js +3 -2
- package/tools/products/create-products.js.map +1 -1
- package/tools/products/create-products.mjs +3 -2
- package/tools/products/create-products.mjs.map +1 -1
- package/tools/products/delete-products.d.mts +2 -2
- package/tools/products/delete-products.d.mts.map +1 -1
- package/tools/products/delete-products.d.ts +2 -2
- package/tools/products/delete-products.d.ts.map +1 -1
- package/tools/products/delete-products.js +4 -2
- package/tools/products/delete-products.js.map +1 -1
- package/tools/products/delete-products.mjs +4 -2
- package/tools/products/delete-products.mjs.map +1 -1
- package/tools/products/images/update-products-images.d.mts +2 -2
- package/tools/products/images/update-products-images.d.mts.map +1 -1
- package/tools/products/images/update-products-images.d.ts +2 -2
- package/tools/products/images/update-products-images.d.ts.map +1 -1
- package/tools/products/images/update-products-images.js +3 -2
- package/tools/products/images/update-products-images.js.map +1 -1
- package/tools/products/images/update-products-images.mjs +3 -2
- package/tools/products/images/update-products-images.mjs.map +1 -1
- package/tools/products/list-products.d.mts +2 -2
- package/tools/products/list-products.d.mts.map +1 -1
- package/tools/products/list-products.d.ts +2 -2
- package/tools/products/list-products.d.ts.map +1 -1
- package/tools/products/list-products.js +3 -2
- package/tools/products/list-products.js.map +1 -1
- package/tools/products/list-products.mjs +3 -2
- package/tools/products/list-products.mjs.map +1 -1
- package/tools/products/retrieve-products.d.mts +2 -2
- package/tools/products/retrieve-products.d.mts.map +1 -1
- package/tools/products/retrieve-products.d.ts +2 -2
- package/tools/products/retrieve-products.d.ts.map +1 -1
- package/tools/products/retrieve-products.js +3 -2
- package/tools/products/retrieve-products.js.map +1 -1
- package/tools/products/retrieve-products.mjs +3 -2
- package/tools/products/retrieve-products.mjs.map +1 -1
- package/tools/products/unarchive-products.d.mts +2 -2
- package/tools/products/unarchive-products.d.mts.map +1 -1
- package/tools/products/unarchive-products.d.ts +2 -2
- package/tools/products/unarchive-products.d.ts.map +1 -1
- package/tools/products/unarchive-products.js +4 -2
- package/tools/products/unarchive-products.js.map +1 -1
- package/tools/products/unarchive-products.mjs +4 -2
- package/tools/products/unarchive-products.mjs.map +1 -1
- package/tools/products/update-products.d.mts +2 -2
- package/tools/products/update-products.d.mts.map +1 -1
- package/tools/products/update-products.d.ts +2 -2
- package/tools/products/update-products.d.ts.map +1 -1
- package/tools/products/update-products.js +4 -2
- package/tools/products/update-products.js.map +1 -1
- package/tools/products/update-products.mjs +4 -2
- package/tools/products/update-products.mjs.map +1 -1
- package/tools/refunds/create-refunds.d.mts +2 -2
- package/tools/refunds/create-refunds.d.mts.map +1 -1
- package/tools/refunds/create-refunds.d.ts +2 -2
- package/tools/refunds/create-refunds.d.ts.map +1 -1
- package/tools/refunds/create-refunds.js +3 -2
- package/tools/refunds/create-refunds.js.map +1 -1
- package/tools/refunds/create-refunds.mjs +3 -2
- package/tools/refunds/create-refunds.mjs.map +1 -1
- package/tools/refunds/list-refunds.d.mts +2 -2
- package/tools/refunds/list-refunds.d.mts.map +1 -1
- package/tools/refunds/list-refunds.d.ts +2 -2
- package/tools/refunds/list-refunds.d.ts.map +1 -1
- package/tools/refunds/list-refunds.js +3 -2
- package/tools/refunds/list-refunds.js.map +1 -1
- package/tools/refunds/list-refunds.mjs +3 -2
- package/tools/refunds/list-refunds.mjs.map +1 -1
- package/tools/refunds/retrieve-refunds.d.mts +2 -2
- package/tools/refunds/retrieve-refunds.d.mts.map +1 -1
- package/tools/refunds/retrieve-refunds.d.ts +2 -2
- package/tools/refunds/retrieve-refunds.d.ts.map +1 -1
- package/tools/refunds/retrieve-refunds.js +3 -2
- package/tools/refunds/retrieve-refunds.js.map +1 -1
- package/tools/refunds/retrieve-refunds.mjs +3 -2
- package/tools/refunds/retrieve-refunds.mjs.map +1 -1
- package/tools/subscriptions/change-plan-subscriptions.d.mts +2 -2
- package/tools/subscriptions/change-plan-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/change-plan-subscriptions.d.ts +2 -2
- package/tools/subscriptions/change-plan-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/change-plan-subscriptions.js +32 -2
- package/tools/subscriptions/change-plan-subscriptions.js.map +1 -1
- package/tools/subscriptions/change-plan-subscriptions.mjs +32 -2
- package/tools/subscriptions/change-plan-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/charge-subscriptions.d.mts +2 -2
- package/tools/subscriptions/charge-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/charge-subscriptions.d.ts +2 -2
- package/tools/subscriptions/charge-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/charge-subscriptions.js +3 -2
- package/tools/subscriptions/charge-subscriptions.js.map +1 -1
- package/tools/subscriptions/charge-subscriptions.mjs +3 -2
- package/tools/subscriptions/charge-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/create-subscriptions.d.mts +2 -2
- package/tools/subscriptions/create-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/create-subscriptions.d.ts +2 -2
- package/tools/subscriptions/create-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/create-subscriptions.js +3 -2
- package/tools/subscriptions/create-subscriptions.js.map +1 -1
- package/tools/subscriptions/create-subscriptions.mjs +3 -2
- package/tools/subscriptions/create-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/list-subscriptions.d.mts +2 -2
- package/tools/subscriptions/list-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/list-subscriptions.d.ts +2 -2
- package/tools/subscriptions/list-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/list-subscriptions.js +3 -2
- package/tools/subscriptions/list-subscriptions.js.map +1 -1
- package/tools/subscriptions/list-subscriptions.mjs +3 -2
- package/tools/subscriptions/list-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/retrieve-subscriptions.d.mts +2 -2
- package/tools/subscriptions/retrieve-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/retrieve-subscriptions.d.ts +2 -2
- package/tools/subscriptions/retrieve-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/retrieve-subscriptions.js +3 -2
- package/tools/subscriptions/retrieve-subscriptions.js.map +1 -1
- package/tools/subscriptions/retrieve-subscriptions.mjs +3 -2
- package/tools/subscriptions/retrieve-subscriptions.mjs.map +1 -1
- package/tools/subscriptions/update-subscriptions.d.mts +2 -2
- package/tools/subscriptions/update-subscriptions.d.mts.map +1 -1
- package/tools/subscriptions/update-subscriptions.d.ts +2 -2
- package/tools/subscriptions/update-subscriptions.d.ts.map +1 -1
- package/tools/subscriptions/update-subscriptions.js +6 -2
- package/tools/subscriptions/update-subscriptions.js.map +1 -1
- package/tools/subscriptions/update-subscriptions.mjs +6 -2
- package/tools/subscriptions/update-subscriptions.mjs.map +1 -1
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools/webhook-events/list-webhook-events.d.mts +2 -2
- package/tools/webhook-events/list-webhook-events.d.mts.map +1 -1
- package/tools/webhook-events/list-webhook-events.d.ts +2 -2
- package/tools/webhook-events/list-webhook-events.d.ts.map +1 -1
- package/tools/webhook-events/list-webhook-events.js +7 -2
- package/tools/webhook-events/list-webhook-events.js.map +1 -1
- package/tools/webhook-events/list-webhook-events.mjs +7 -2
- package/tools/webhook-events/list-webhook-events.mjs.map +1 -1
- package/tools/webhook-events/retrieve-webhook-events.d.mts +2 -2
- package/tools/webhook-events/retrieve-webhook-events.d.mts.map +1 -1
- package/tools/webhook-events/retrieve-webhook-events.d.ts +2 -2
- package/tools/webhook-events/retrieve-webhook-events.d.ts.map +1 -1
- package/tools/webhook-events/retrieve-webhook-events.js +3 -2
- package/tools/webhook-events/retrieve-webhook-events.js.map +1 -1
- package/tools/webhook-events/retrieve-webhook-events.mjs +3 -2
- package/tools/webhook-events/retrieve-webhook-events.mjs.map +1 -1
package/dynamic-tools.d.mts
CHANGED
package/dynamic-tools.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-tools.d.mts","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"OACO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"dynamic-tools.d.mts","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"OACO,EAAE,QAAQ,EAAuC;AAYxD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAwI9D"}
|
package/dynamic-tools.d.ts
CHANGED
package/dynamic-tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-tools.d.ts","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"OACO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"dynamic-tools.d.ts","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"OACO,EAAE,QAAQ,EAAuC;AAYxD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAwI9D"}
|
package/dynamic-tools.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.dynamicTools = dynamicTools;
|
|
4
|
+
const types_1 = require("./tools/types.js");
|
|
4
5
|
const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
const cabidela_1 = require("@cloudflare/cabidela");
|
|
@@ -51,7 +52,7 @@ function dynamicTools(endpoints) {
|
|
|
51
52
|
return fieldsToMatch.some((field) => field && field.toLowerCase().includes(query.toLowerCase()));
|
|
52
53
|
})
|
|
53
54
|
: endpoints;
|
|
54
|
-
return {
|
|
55
|
+
return (0, types_1.asTextContentResult)({
|
|
55
56
|
tools: filteredEndpoints.map(({ tool, metadata }) => ({
|
|
56
57
|
name: tool.name,
|
|
57
58
|
description: tool.description,
|
|
@@ -59,7 +60,7 @@ function dynamicTools(endpoints) {
|
|
|
59
60
|
operation: metadata.operation,
|
|
60
61
|
tags: metadata.tags,
|
|
61
62
|
})),
|
|
62
|
-
};
|
|
63
|
+
});
|
|
63
64
|
},
|
|
64
65
|
};
|
|
65
66
|
const getEndpointSchema = zod_1.z.object({
|
|
@@ -85,7 +86,7 @@ function dynamicTools(endpoints) {
|
|
|
85
86
|
if (!endpoint) {
|
|
86
87
|
throw new Error(`Endpoint ${endpointName} not found`);
|
|
87
88
|
}
|
|
88
|
-
return endpoint.tool;
|
|
89
|
+
return (0, types_1.asTextContentResult)(endpoint.tool);
|
|
89
90
|
},
|
|
90
91
|
};
|
|
91
92
|
const invokeEndpointSchema = zod_1.z.object({
|
|
@@ -126,7 +127,7 @@ function dynamicTools(endpoints) {
|
|
|
126
127
|
catch (error) {
|
|
127
128
|
throw new Error(`Invalid arguments for endpoint ${endpoint_name}:\n${error}`);
|
|
128
129
|
}
|
|
129
|
-
return endpoint.handler(client, endpointArgs);
|
|
130
|
+
return await endpoint.handler(client, endpointArgs);
|
|
130
131
|
},
|
|
131
132
|
};
|
|
132
133
|
return [getEndpointTool, listEndpointsTool, invokeEndpointTool];
|
package/dynamic-tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-tools.js","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":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AC;YACtE,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CAAC,mCAAmC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YACxE,CAAC;YACD,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;YAEnD,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;YACtE,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CACb,YAAY,aAAa,yFAAyF,CACnH,CAAC;YACJ,CAAC;YAED,IAAI,CAAC;gBACH,2DAA2D;gBAC3D,MAAM,QAAQ,GAAG,IAAI,mBAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/E,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,aAAa,MAAM,KAAK,EAAE,CAAC,CAAC;YAChF,CAAC;YAED,OAAO,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtD,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAClE,CAAC"}
|
package/dynamic-tools.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { asTextContentResult } from "./tools/types.mjs";
|
|
1
2
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { Cabidela } from '@cloudflare/cabidela';
|
|
@@ -48,7 +49,7 @@ export function dynamicTools(endpoints) {
|
|
|
48
49
|
return fieldsToMatch.some((field) => field && field.toLowerCase().includes(query.toLowerCase()));
|
|
49
50
|
})
|
|
50
51
|
: endpoints;
|
|
51
|
-
return {
|
|
52
|
+
return asTextContentResult({
|
|
52
53
|
tools: filteredEndpoints.map(({ tool, metadata }) => ({
|
|
53
54
|
name: tool.name,
|
|
54
55
|
description: tool.description,
|
|
@@ -56,7 +57,7 @@ export function dynamicTools(endpoints) {
|
|
|
56
57
|
operation: metadata.operation,
|
|
57
58
|
tags: metadata.tags,
|
|
58
59
|
})),
|
|
59
|
-
};
|
|
60
|
+
});
|
|
60
61
|
},
|
|
61
62
|
};
|
|
62
63
|
const getEndpointSchema = z.object({
|
|
@@ -82,7 +83,7 @@ export function dynamicTools(endpoints) {
|
|
|
82
83
|
if (!endpoint) {
|
|
83
84
|
throw new Error(`Endpoint ${endpointName} not found`);
|
|
84
85
|
}
|
|
85
|
-
return endpoint.tool;
|
|
86
|
+
return asTextContentResult(endpoint.tool);
|
|
86
87
|
},
|
|
87
88
|
};
|
|
88
89
|
const invokeEndpointSchema = z.object({
|
|
@@ -123,7 +124,7 @@ export function dynamicTools(endpoints) {
|
|
|
123
124
|
catch (error) {
|
|
124
125
|
throw new Error(`Invalid arguments for endpoint ${endpoint_name}:\n${error}`);
|
|
125
126
|
}
|
|
126
|
-
return endpoint.handler(client, endpointArgs);
|
|
127
|
+
return await endpoint.handler(client, endpointArgs);
|
|
127
128
|
},
|
|
128
129
|
};
|
|
129
130
|
return [getEndpointTool, listEndpointsTool, invokeEndpointTool];
|
package/dynamic-tools.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-tools.mjs","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-tools.mjs","sourceRoot":"","sources":["src/dynamic-tools.ts"],"names":[],"mappings":"OACO,EAAY,mBAAmB,EAAkB;OACjD,EAAE,eAAe,EAAE,MAAM,oBAAoB;OAC7C,EAAE,CAAC,E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,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;YAEnD,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;YACtE,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CACb,YAAY,aAAa,yFAAyF,CACnH,CAAC;YACJ,CAAC;YAED,IAAI,CAAC;gBACH,2DAA2D;gBAC3D,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/E,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,aAAa,MAAM,KAAK,EAAE,CAAC,CAAC;YAChF,CAAC;YAED,OAAO,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtD,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAClE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dodopayments-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "The official MCP Server for the Dodo Payments API",
|
|
5
5
|
"author": "Dodo Payments <founders@dodopayments.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"fix": "eslint --fix --ext ts,js ."
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"dodopayments": "^1.
|
|
27
|
+
"dodopayments": "^1.32.0",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
29
29
|
"yargs": "^17.7.2",
|
|
30
30
|
"@cloudflare/cabidela": "^0.2.4",
|
package/server.d.mts
CHANGED
|
@@ -27,12 +27,7 @@ export declare function selectTools(endpoints: Endpoint[], options: ParsedOption
|
|
|
27
27
|
/**
|
|
28
28
|
* Runs the provided handler with the given client and arguments.
|
|
29
29
|
*/
|
|
30
|
-
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: DodoPayments, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<
|
|
31
|
-
content: {
|
|
32
|
-
type: string;
|
|
33
|
-
text: string;
|
|
34
|
-
}[];
|
|
35
|
-
}>;
|
|
30
|
+
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: DodoPayments, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<import("./tools/types").ToolCallResult>;
|
|
36
31
|
export declare const readEnv: (env: string) => string | undefined;
|
|
37
32
|
export declare const readEnvOrError: (env: string) => string;
|
|
38
33
|
//# sourceMappingURL=server.d.mts.map
|
package/server.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.mts","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,MAAM,2CAA2C;OAC3D,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAE,QAAQ,EAAa,eAAe,EAAS;OAC/C,EAAiD,IAAI,EAAE,MAAM,oCAAoC;OACjG,YAAY,MAAM,cAAc;OAChC,EAEL,kBAAkB,EAGnB;OAEM,EAAE,aAAa,EAAE;OACjB,EAAE,SAAS,EAAE;AAGpB,eAAO,MAAM,MAAM,WAUlB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;I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AO,EAAE,aAAa,cAkBxE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,oBAAoB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,mDAOnD;AAED,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAO9C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAM5C,CAAC"}
|
package/server.d.ts
CHANGED
|
@@ -27,12 +27,7 @@ export declare function selectTools(endpoints: Endpoint[], options: ParsedOption
|
|
|
27
27
|
/**
|
|
28
28
|
* Runs the provided handler with the given client and arguments.
|
|
29
29
|
*/
|
|
30
|
-
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: DodoPayments, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<
|
|
31
|
-
content: {
|
|
32
|
-
type: string;
|
|
33
|
-
text: string;
|
|
34
|
-
}[];
|
|
35
|
-
}>;
|
|
30
|
+
export declare function executeHandler(tool: Tool, handler: HandlerFunction, client: DodoPayments, args: Record<string, unknown> | undefined, compatibilityOptions?: Partial<ClientCapabilities>): Promise<import("./tools/types").ToolCallResult>;
|
|
36
31
|
export declare const readEnv: (env: string) => string | undefined;
|
|
37
32
|
export declare const readEnvOrError: (env: string) => string;
|
|
38
33
|
//# sourceMappingURL=server.d.ts.map
|
package/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"OAEO,EAAE,MAAM,EAAE,MAAM,2CAA2C;OAC3D,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAE,QAAQ,EAAa,eAAe,EAAS;OAC/C,EAAiD,IAAI,EAAE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CAAC;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;IACvD,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5C,QAyBA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,aAAa,cAkBxE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,oBAAoB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,mDAOnD;AAED,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAO9C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAM5C,CAAC"}
|
package/server.js
CHANGED
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "endpoints", { enumerable: true, get: function ()
|
|
|
19
19
|
// Create server instance
|
|
20
20
|
exports.server = new mcp_js_1.McpServer({
|
|
21
21
|
name: 'dodopayments_api',
|
|
22
|
-
version: '1.
|
|
22
|
+
version: '1.32.0',
|
|
23
23
|
}, {
|
|
24
24
|
capabilities: {
|
|
25
25
|
tools: {},
|
|
@@ -74,15 +74,7 @@ async function executeHandler(tool, handler, client, args, compatibilityOptions)
|
|
|
74
74
|
if (options.validJson && args) {
|
|
75
75
|
args = (0, compat_1.parseEmbeddedJSON)(args, tool.inputSchema);
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
content: [
|
|
80
|
-
{
|
|
81
|
-
type: 'text',
|
|
82
|
-
text: JSON.stringify(result, null, 2),
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
};
|
|
77
|
+
return await handler(client, args || {});
|
|
86
78
|
}
|
|
87
79
|
const readEnv = (env) => {
|
|
88
80
|
if (typeof globalThis.process !== 'undefined') {
|
package/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAkCtF,oBA8BC;AAKD,kCAkBC;AAKD,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAkCtF,oBA8BC;AAKD,kCAkBC;AAKD,wCAYC;AArGD,oEAAoE;AACpE,sCAAsE;AACtE,iEAAyG;AACzG,gEAAwC;AACxC,wCAKkB;AAClB,sDAA+C;AAE/C,oCAAoC;AAA3B,kGAAA,SAAS,OAAA;AAElB,yBAAyB;AACZ,QAAA,MAAM,GAAG,IAAI,kBAAS,CACjC;IACE,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,QAAQ;CAClB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF;;;GAGG;AACH,SAAgB,IAAI,CAAC,MAKpB;IACC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,YAAY,kBAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzF,MAAM,iBAAiB,GAAG,MAAM,CAAC,SAAS,IAAI,iBAAS,CAAC;IAExD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE5G,MAAM,MAAM,GACV,MAAM,CAAC,MAAM;QACb,IAAI,sBAAY,CAAC,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AAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
package/server.mjs
CHANGED
|
@@ -9,7 +9,7 @@ export { endpoints } from "./tools.mjs";
|
|
|
9
9
|
// Create server instance
|
|
10
10
|
export const server = new McpServer({
|
|
11
11
|
name: 'dodopayments_api',
|
|
12
|
-
version: '1.
|
|
12
|
+
version: '1.32.0',
|
|
13
13
|
}, {
|
|
14
14
|
capabilities: {
|
|
15
15
|
tools: {},
|
|
@@ -64,15 +64,7 @@ export async function executeHandler(tool, handler, client, args, compatibilityO
|
|
|
64
64
|
if (options.validJson && args) {
|
|
65
65
|
args = parseEmbeddedJSON(args, tool.inputSchema);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
content: [
|
|
70
|
-
{
|
|
71
|
-
type: 'text',
|
|
72
|
-
text: JSON.stringify(result, null, 2),
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
};
|
|
67
|
+
return await handler(client, args || {});
|
|
76
68
|
}
|
|
77
69
|
export const readEnv = (env) => {
|
|
78
70
|
if (typeof globalThis.process !== 'undefined') {
|
package/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","sourceRoot":"","sources":["src/server.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAG/E,EAAE,SAAS,EAAE,MAAM,yCAAyC;OAC5D,EAAY,SAAS,EAAmB,KAAK,EAAE;OAC/C,EAAE,qBAAqB,EAAE,sBAAsB,EAAQ,MAAM,oCAAoC;OACjG,YAAY,MAAM,cAAc;OAChC,EACL,iCAAiC,EAEjC,yBAAyB,EACzB,iBAAiB,GAClB;OACM,EAAE,YAAY,EAAE;OAEhB,EAAE,SAAS,EAAE;AAEpB,yBAAyB;AACzB,MAAM,CAA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ments';
|
|
2
|
-
import { Endpoint } from './tools';
|
|
2
|
+
import { Endpoint, asTextContentResult, ToolCallResult } from './tools/types';
|
|
3
3
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { Cabidela } from '@cloudflare/cabidela';
|
|
@@ -41,7 +41,10 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
41
41
|
description: 'List or search for all endpoints in the Dodo Payments Node API',
|
|
42
42
|
inputSchema: zodToInputSchema(listEndpointsSchema),
|
|
43
43
|
},
|
|
44
|
-
handler: async (
|
|
44
|
+
handler: async (
|
|
45
|
+
client: DodoPayments,
|
|
46
|
+
args: Record<string, unknown> | undefined,
|
|
47
|
+
): Promise<ToolCallResult> => {
|
|
45
48
|
const query = args && listEndpointsSchema.parse(args).search_query?.trim();
|
|
46
49
|
|
|
47
50
|
const filteredEndpoints =
|
|
@@ -58,7 +61,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
58
61
|
})
|
|
59
62
|
: endpoints;
|
|
60
63
|
|
|
61
|
-
return {
|
|
64
|
+
return asTextContentResult({
|
|
62
65
|
tools: filteredEndpoints.map(({ tool, metadata }) => ({
|
|
63
66
|
name: tool.name,
|
|
64
67
|
description: tool.description,
|
|
@@ -66,7 +69,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
66
69
|
operation: metadata.operation,
|
|
67
70
|
tags: metadata.tags,
|
|
68
71
|
})),
|
|
69
|
-
};
|
|
72
|
+
});
|
|
70
73
|
},
|
|
71
74
|
};
|
|
72
75
|
|
|
@@ -95,7 +98,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
95
98
|
if (!endpoint) {
|
|
96
99
|
throw new Error(`Endpoint ${endpointName} not found`);
|
|
97
100
|
}
|
|
98
|
-
return endpoint.tool;
|
|
101
|
+
return asTextContentResult(endpoint.tool);
|
|
99
102
|
},
|
|
100
103
|
};
|
|
101
104
|
|
|
@@ -120,7 +123,10 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
120
123
|
'Invoke an endpoint in the Dodo Payments Node API. Note: use the `list_api_endpoints` tool to get the list of endpoints and `get_api_endpoint_schema` tool to get the schema for an endpoint.',
|
|
121
124
|
inputSchema: zodToInputSchema(invokeEndpointSchema),
|
|
122
125
|
},
|
|
123
|
-
handler: async (
|
|
126
|
+
handler: async (
|
|
127
|
+
client: DodoPayments,
|
|
128
|
+
args: Record<string, unknown> | undefined,
|
|
129
|
+
): Promise<ToolCallResult> => {
|
|
124
130
|
if (!args) {
|
|
125
131
|
throw new Error('No endpoint provided');
|
|
126
132
|
}
|
|
@@ -145,7 +151,7 @@ export function dynamicTools(endpoints: Endpoint[]): Endpoint[] {
|
|
|
145
151
|
throw new Error(`Invalid arguments for endpoint ${endpoint_name}:\n${error}`);
|
|
146
152
|
}
|
|
147
153
|
|
|
148
|
-
return endpoint.handler(client, endpointArgs);
|
|
154
|
+
return await endpoint.handler(client, endpointArgs);
|
|
149
155
|
},
|
|
150
156
|
};
|
|
151
157
|
|
package/src/server.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { endpoints } from './tools';
|
|
|
19
19
|
export const server = new McpServer(
|
|
20
20
|
{
|
|
21
21
|
name: 'dodopayments_api',
|
|
22
|
-
version: '1.
|
|
22
|
+
version: '1.32.0',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
capabilities: {
|
|
@@ -101,15 +101,7 @@ export async function executeHandler(
|
|
|
101
101
|
if (options.validJson && args) {
|
|
102
102
|
args = parseEmbeddedJSON(args, tool.inputSchema);
|
|
103
103
|
}
|
|
104
|
-
|
|
105
|
-
return {
|
|
106
|
-
content: [
|
|
107
|
-
{
|
|
108
|
-
type: 'text',
|
|
109
|
-
text: JSON.stringify(result, null, 2),
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
};
|
|
104
|
+
return await handler(client, args || {});
|
|
113
105
|
}
|
|
114
106
|
|
|
115
107
|
export const readEnv = (env: string): string | undefined => {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -199,9 +201,9 @@ export const tool: Tool = {
|
|
|
199
201
|
},
|
|
200
202
|
};
|
|
201
203
|
|
|
202
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
204
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
203
205
|
const body = args as any;
|
|
204
|
-
return client.addons.create(body);
|
|
206
|
+
return asTextContentResult(await client.addons.create(body));
|
|
205
207
|
};
|
|
206
208
|
|
|
207
209
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -31,9 +33,9 @@ export const tool: Tool = {
|
|
|
31
33
|
},
|
|
32
34
|
};
|
|
33
35
|
|
|
34
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
36
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
35
37
|
const body = args as any;
|
|
36
|
-
return client.addons.list(body);
|
|
38
|
+
return asTextContentResult(await client.addons.list(body));
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -26,9 +28,9 @@ export const tool: Tool = {
|
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
30
32
|
const { id, ...body } = args as any;
|
|
31
|
-
return client.addons.retrieve(id);
|
|
33
|
+
return asTextContentResult(await client.addons.retrieve(id));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -206,9 +208,9 @@ export const tool: Tool = {
|
|
|
206
208
|
},
|
|
207
209
|
};
|
|
208
210
|
|
|
209
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
211
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
210
212
|
const { id, ...body } = args as any;
|
|
211
|
-
return client.addons.update(id, body);
|
|
213
|
+
return asTextContentResult(await client.addons.update(id, body));
|
|
212
214
|
};
|
|
213
215
|
|
|
214
216
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -26,9 +28,9 @@ export const tool: Tool = {
|
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
30
32
|
const { id, ...body } = args as any;
|
|
31
|
-
return client.addons.updateImages(id);
|
|
33
|
+
return asTextContentResult(await client.addons.updateImages(id));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -38,9 +40,9 @@ export const tool: Tool = {
|
|
|
38
40
|
},
|
|
39
41
|
};
|
|
40
42
|
|
|
41
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
42
44
|
const body = args as any;
|
|
43
|
-
return client.brands.create(body);
|
|
45
|
+
return asTextContentResult(await client.brands.create(body));
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -22,8 +24,8 @@ export const tool: Tool = {
|
|
|
22
24
|
},
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
26
|
-
return client.brands.list();
|
|
27
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
28
|
+
return asTextContentResult(await client.brands.list());
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -26,9 +28,9 @@ export const tool: Tool = {
|
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
30
32
|
const { id, ...body } = args as any;
|
|
31
|
-
return client.brands.retrieve(id);
|
|
33
|
+
return asTextContentResult(await client.brands.retrieve(id));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -39,9 +41,9 @@ export const tool: Tool = {
|
|
|
39
41
|
},
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
44
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
43
45
|
const { id, ...body } = args as any;
|
|
44
|
-
return client.brands.update(id, body);
|
|
46
|
+
return asTextContentResult(await client.brands.update(id, body));
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -26,9 +28,9 @@ export const tool: Tool = {
|
|
|
26
28
|
},
|
|
27
29
|
};
|
|
28
30
|
|
|
29
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
31
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
30
32
|
const { id, ...body } = args as any;
|
|
31
|
-
return client.brands.updateImages(id);
|
|
33
|
+
return asTextContentResult(await client.brands.updateImages(id));
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
export default { metadata, tool, handler };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
import { asTextContentResult } from 'dodopayments-mcp/tools/types';
|
|
4
|
+
|
|
3
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
6
|
import type { Metadata } from '../';
|
|
5
7
|
import DodoPayments from 'dodopayments';
|
|
@@ -32,9 +34,9 @@ export const tool: Tool = {
|
|
|
32
34
|
},
|
|
33
35
|
};
|
|
34
36
|
|
|
35
|
-
export const handler = (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
37
|
+
export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
|
|
36
38
|
const body = args as any;
|
|
37
|
-
return client.customers.create(body);
|
|
39
|
+
return asTextContentResult(await client.customers.create(body));
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
export default { metadata, tool, handler };
|