@usethrottle/mcp 0.5.0 → 0.6.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/README.md +1 -0
- package/dist/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +48 -2
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +48 -2
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +48 -2
- package/dist/mcp.js.map +1 -1
- package/package.json +3 -3
package/dist/lib.cjs
CHANGED
|
@@ -1062,6 +1062,26 @@ var ACTIONS = [
|
|
|
1062
1062
|
"Every sub-read proxies live to the payment provider's routing API and none are guaranteed to succeed together; report any that fail as unavailable rather than failing the whole call."
|
|
1063
1063
|
]
|
|
1064
1064
|
},
|
|
1065
|
+
{
|
|
1066
|
+
id: "get_currency_coverage",
|
|
1067
|
+
title: "Currency coverage",
|
|
1068
|
+
description: "Which currencies this application can actually be paid in: one row per enabled currency (and every currency an active payment service accepts), with the services that take it, whether it is payable, and how it is valued. Open cart and active subscription counts per currency are included only when the key also holds carts:read and subscriptions:read.",
|
|
1069
|
+
kind: "read",
|
|
1070
|
+
scopes: ["connectors:read"],
|
|
1071
|
+
input: [
|
|
1072
|
+
{
|
|
1073
|
+
name: "applicationId",
|
|
1074
|
+
type: "string",
|
|
1075
|
+
required: false,
|
|
1076
|
+
description: "Application to read from. Defaults to the one this connection was authorized for. Call list_applications to see the others."
|
|
1077
|
+
}
|
|
1078
|
+
],
|
|
1079
|
+
requests: [{ method: "GET", path: "/api/v1/connectors/currency-coverage" }],
|
|
1080
|
+
channels: ["mcp"],
|
|
1081
|
+
guardrails: [
|
|
1082
|
+
"Reads the payment provider live on every call. A currency with payable false is enabled but no active service takes it: a buyer cannot pay in it."
|
|
1083
|
+
]
|
|
1084
|
+
},
|
|
1065
1085
|
{
|
|
1066
1086
|
id: "get_integration_status",
|
|
1067
1087
|
title: "Integration readiness",
|
|
@@ -2632,6 +2652,7 @@ var HANDLERS = {
|
|
|
2632
2652
|
otherDecline: otherDecline.ok ? otherDecline.value : otherDecline.unavailable
|
|
2633
2653
|
};
|
|
2634
2654
|
},
|
|
2655
|
+
get_currency_coverage: (ctx, args) => ctx.client.get("/api/v1/connectors/currency-coverage", void 0, { applicationId: args.applicationId }),
|
|
2635
2656
|
get_integration_status: async (ctx, args) => {
|
|
2636
2657
|
const opts = { applicationId: args.applicationId };
|
|
2637
2658
|
const [connectors, endpoints, coverage] = await Promise.all([
|
|
@@ -3058,7 +3079,16 @@ var ORDER = {
|
|
|
3058
3079
|
refundedAmount: M,
|
|
3059
3080
|
compAmount: M,
|
|
3060
3081
|
shippingMethod: { amount: M },
|
|
3061
|
-
lineItems: [LINE_ITEM]
|
|
3082
|
+
lineItems: [LINE_ITEM],
|
|
3083
|
+
// MC4-R93: what order creation writes into metadata (commerce-orders).
|
|
3084
|
+
// `appliedDiscount.amount` is the order's own discount, in its currency. The
|
|
3085
|
+
// F-6 `discountScope.value` is the code's config copied as it was: on a fixed
|
|
3086
|
+
// code, the main-currency amount (500 USD on a EUR order), so it is dropped;
|
|
3087
|
+
// a percentage code's value is its percent and stays.
|
|
3088
|
+
metadata: {
|
|
3089
|
+
discountScope: { value: DROP_WHEN("type", "fixed_amount") },
|
|
3090
|
+
appliedDiscount: { amount: M }
|
|
3091
|
+
}
|
|
3062
3092
|
};
|
|
3063
3093
|
var PAYMENT = { amount: M, capturedAmount: M, usdAmountMinor: DROP };
|
|
3064
3094
|
var TRANSACTION = { amount: M };
|
|
@@ -3836,6 +3866,22 @@ var OAUTH_PROJECTIONS = {
|
|
|
3836
3866
|
otherDecline: section({ rules: [{ errorCode: S, conditions: [{ type: S, op: S, values: [S] }] }] }),
|
|
3837
3867
|
routingConnectors: section([{ id: S, displayName: T, method: S }])
|
|
3838
3868
|
},
|
|
3869
|
+
get_currency_coverage: {
|
|
3870
|
+
mainCurrency: S,
|
|
3871
|
+
connection: S,
|
|
3872
|
+
currencies: [{
|
|
3873
|
+
currency: S,
|
|
3874
|
+
main: S,
|
|
3875
|
+
enabled: S,
|
|
3876
|
+
payable: S,
|
|
3877
|
+
valuation: S,
|
|
3878
|
+
services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3879
|
+
usage: { openCarts: S, activeSubscriptions: S }
|
|
3880
|
+
}],
|
|
3881
|
+
services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3882
|
+
unknownServices: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3883
|
+
readAt: S
|
|
3884
|
+
},
|
|
3839
3885
|
get_integration_status: {
|
|
3840
3886
|
environment: { slug: S, kind: S, providerEnvironment: S },
|
|
3841
3887
|
workspace: { name: T, slug: S },
|
|
@@ -3959,7 +4005,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3959
4005
|
};
|
|
3960
4006
|
|
|
3961
4007
|
// src/server.ts
|
|
3962
|
-
var VERSION = true ? "0.
|
|
4008
|
+
var VERSION = true ? "0.6.0" : "0.0.0-dev";
|
|
3963
4009
|
function registerableActions(policy) {
|
|
3964
4010
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3965
4011
|
return actionsForChannel("mcp").filter((action) => {
|