@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/mcp.js
CHANGED
|
@@ -1151,6 +1151,26 @@ var ACTIONS = [
|
|
|
1151
1151
|
"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."
|
|
1152
1152
|
]
|
|
1153
1153
|
},
|
|
1154
|
+
{
|
|
1155
|
+
id: "get_currency_coverage",
|
|
1156
|
+
title: "Currency coverage",
|
|
1157
|
+
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.",
|
|
1158
|
+
kind: "read",
|
|
1159
|
+
scopes: ["connectors:read"],
|
|
1160
|
+
input: [
|
|
1161
|
+
{
|
|
1162
|
+
name: "applicationId",
|
|
1163
|
+
type: "string",
|
|
1164
|
+
required: false,
|
|
1165
|
+
description: "Application to read from. Defaults to the one this connection was authorized for. Call list_applications to see the others."
|
|
1166
|
+
}
|
|
1167
|
+
],
|
|
1168
|
+
requests: [{ method: "GET", path: "/api/v1/connectors/currency-coverage" }],
|
|
1169
|
+
channels: ["mcp"],
|
|
1170
|
+
guardrails: [
|
|
1171
|
+
"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."
|
|
1172
|
+
]
|
|
1173
|
+
},
|
|
1154
1174
|
{
|
|
1155
1175
|
id: "get_integration_status",
|
|
1156
1176
|
title: "Integration readiness",
|
|
@@ -2594,6 +2614,7 @@ var HANDLERS = {
|
|
|
2594
2614
|
otherDecline: otherDecline.ok ? otherDecline.value : otherDecline.unavailable
|
|
2595
2615
|
};
|
|
2596
2616
|
},
|
|
2617
|
+
get_currency_coverage: (ctx, args) => ctx.client.get("/api/v1/connectors/currency-coverage", void 0, { applicationId: args.applicationId }),
|
|
2597
2618
|
get_integration_status: async (ctx, args) => {
|
|
2598
2619
|
const opts = { applicationId: args.applicationId };
|
|
2599
2620
|
const [connectors, endpoints, coverage] = await Promise.all([
|
|
@@ -2937,7 +2958,16 @@ var ORDER = {
|
|
|
2937
2958
|
refundedAmount: M,
|
|
2938
2959
|
compAmount: M,
|
|
2939
2960
|
shippingMethod: { amount: M },
|
|
2940
|
-
lineItems: [LINE_ITEM]
|
|
2961
|
+
lineItems: [LINE_ITEM],
|
|
2962
|
+
// MC4-R93: what order creation writes into metadata (commerce-orders).
|
|
2963
|
+
// `appliedDiscount.amount` is the order's own discount, in its currency. The
|
|
2964
|
+
// F-6 `discountScope.value` is the code's config copied as it was: on a fixed
|
|
2965
|
+
// code, the main-currency amount (500 USD on a EUR order), so it is dropped;
|
|
2966
|
+
// a percentage code's value is its percent and stays.
|
|
2967
|
+
metadata: {
|
|
2968
|
+
discountScope: { value: DROP_WHEN("type", "fixed_amount") },
|
|
2969
|
+
appliedDiscount: { amount: M }
|
|
2970
|
+
}
|
|
2941
2971
|
};
|
|
2942
2972
|
var PAYMENT = { amount: M, capturedAmount: M, usdAmountMinor: DROP };
|
|
2943
2973
|
var TRANSACTION = { amount: M };
|
|
@@ -3715,6 +3745,22 @@ var OAUTH_PROJECTIONS = {
|
|
|
3715
3745
|
otherDecline: section({ rules: [{ errorCode: S, conditions: [{ type: S, op: S, values: [S] }] }] }),
|
|
3716
3746
|
routingConnectors: section([{ id: S, displayName: T, method: S }])
|
|
3717
3747
|
},
|
|
3748
|
+
get_currency_coverage: {
|
|
3749
|
+
mainCurrency: S,
|
|
3750
|
+
connection: S,
|
|
3751
|
+
currencies: [{
|
|
3752
|
+
currency: S,
|
|
3753
|
+
main: S,
|
|
3754
|
+
enabled: S,
|
|
3755
|
+
payable: S,
|
|
3756
|
+
valuation: S,
|
|
3757
|
+
services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3758
|
+
usage: { openCarts: S, activeSubscriptions: S }
|
|
3759
|
+
}],
|
|
3760
|
+
services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3761
|
+
unknownServices: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
|
|
3762
|
+
readAt: S
|
|
3763
|
+
},
|
|
3718
3764
|
get_integration_status: {
|
|
3719
3765
|
environment: { slug: S, kind: S, providerEnvironment: S },
|
|
3720
3766
|
workspace: { name: T, slug: S },
|
|
@@ -3838,7 +3884,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3838
3884
|
};
|
|
3839
3885
|
|
|
3840
3886
|
// src/server.ts
|
|
3841
|
-
var VERSION = true ? "0.
|
|
3887
|
+
var VERSION = true ? "0.6.0" : "0.0.0-dev";
|
|
3842
3888
|
function registerableActions(policy) {
|
|
3843
3889
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3844
3890
|
return actionsForChannel("mcp").filter((action) => {
|