@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/dist/lib.js CHANGED
@@ -1025,6 +1025,26 @@ var ACTIONS = [
1025
1025
  "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."
1026
1026
  ]
1027
1027
  },
1028
+ {
1029
+ id: "get_currency_coverage",
1030
+ title: "Currency coverage",
1031
+ 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.",
1032
+ kind: "read",
1033
+ scopes: ["connectors:read"],
1034
+ input: [
1035
+ {
1036
+ name: "applicationId",
1037
+ type: "string",
1038
+ required: false,
1039
+ description: "Application to read from. Defaults to the one this connection was authorized for. Call list_applications to see the others."
1040
+ }
1041
+ ],
1042
+ requests: [{ method: "GET", path: "/api/v1/connectors/currency-coverage" }],
1043
+ channels: ["mcp"],
1044
+ guardrails: [
1045
+ "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."
1046
+ ]
1047
+ },
1028
1048
  {
1029
1049
  id: "get_integration_status",
1030
1050
  title: "Integration readiness",
@@ -2595,6 +2615,7 @@ var HANDLERS = {
2595
2615
  otherDecline: otherDecline.ok ? otherDecline.value : otherDecline.unavailable
2596
2616
  };
2597
2617
  },
2618
+ get_currency_coverage: (ctx, args) => ctx.client.get("/api/v1/connectors/currency-coverage", void 0, { applicationId: args.applicationId }),
2598
2619
  get_integration_status: async (ctx, args) => {
2599
2620
  const opts = { applicationId: args.applicationId };
2600
2621
  const [connectors, endpoints, coverage] = await Promise.all([
@@ -3021,7 +3042,16 @@ var ORDER = {
3021
3042
  refundedAmount: M,
3022
3043
  compAmount: M,
3023
3044
  shippingMethod: { amount: M },
3024
- lineItems: [LINE_ITEM]
3045
+ lineItems: [LINE_ITEM],
3046
+ // MC4-R93: what order creation writes into metadata (commerce-orders).
3047
+ // `appliedDiscount.amount` is the order's own discount, in its currency. The
3048
+ // F-6 `discountScope.value` is the code's config copied as it was: on a fixed
3049
+ // code, the main-currency amount (500 USD on a EUR order), so it is dropped;
3050
+ // a percentage code's value is its percent and stays.
3051
+ metadata: {
3052
+ discountScope: { value: DROP_WHEN("type", "fixed_amount") },
3053
+ appliedDiscount: { amount: M }
3054
+ }
3025
3055
  };
3026
3056
  var PAYMENT = { amount: M, capturedAmount: M, usdAmountMinor: DROP };
3027
3057
  var TRANSACTION = { amount: M };
@@ -3799,6 +3829,22 @@ var OAUTH_PROJECTIONS = {
3799
3829
  otherDecline: section({ rules: [{ errorCode: S, conditions: [{ type: S, op: S, values: [S] }] }] }),
3800
3830
  routingConnectors: section([{ id: S, displayName: T, method: S }])
3801
3831
  },
3832
+ get_currency_coverage: {
3833
+ mainCurrency: S,
3834
+ connection: S,
3835
+ currencies: [{
3836
+ currency: S,
3837
+ main: S,
3838
+ enabled: S,
3839
+ payable: S,
3840
+ valuation: S,
3841
+ services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
3842
+ usage: { openCarts: S, activeSubscriptions: S }
3843
+ }],
3844
+ services: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
3845
+ unknownServices: [{ id: S, displayName: T, method: S, active: S, inherited: S }],
3846
+ readAt: S
3847
+ },
3802
3848
  get_integration_status: {
3803
3849
  environment: { slug: S, kind: S, providerEnvironment: S },
3804
3850
  workspace: { name: T, slug: S },
@@ -3922,7 +3968,7 @@ var OAUTH_PROJECTIONS = {
3922
3968
  };
3923
3969
 
3924
3970
  // src/server.ts
3925
- var VERSION = true ? "0.5.0" : "0.0.0-dev";
3971
+ var VERSION = true ? "0.6.0" : "0.0.0-dev";
3926
3972
  function registerableActions(policy) {
3927
3973
  const isProduction = policy.identity.environment.providerEnvironment === "production";
3928
3974
  return actionsForChannel("mcp").filter((action) => {