@usethrottle/mcp 0.4.1 → 0.4.2
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 +14 -7
- package/dist/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +43 -2
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +43 -2
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +43 -2
- package/dist/mcp.js.map +1 -1
- package/package.json +3 -3
package/dist/lib.js
CHANGED
|
@@ -62,6 +62,8 @@ add("Customers", "customers", ["read", "write"], { read: "View customers", write
|
|
|
62
62
|
add("Customers", "customer_pii", ["read"], { read: "View customer PII" }, { sensitive: true });
|
|
63
63
|
add("Customers", "customer_addresses", ["read", "write"], { read: "View addresses", write: "Manage addresses" });
|
|
64
64
|
add("Customers", "customer_payment_methods", ["read", "write"], { read: "View stored cards", write: "Manage stored cards" }, { sensitive: true });
|
|
65
|
+
add("Customers", "customer_tokens", ["read"], { read: "Check shoppers' sign-in tokens" });
|
|
66
|
+
add("Customers", "customer_directory", ["read"], { read: "Find customers by name or email" }, { sensitive: true });
|
|
65
67
|
add(
|
|
66
68
|
"Customer accounts",
|
|
67
69
|
"customer_accounts",
|
|
@@ -194,6 +196,7 @@ var EVENT_SCOPE_OVERRIDES = {
|
|
|
194
196
|
"subscription.invoice_refunded": "payment_refunds:read",
|
|
195
197
|
"payment.disputed": "payment_disputes:read",
|
|
196
198
|
"payment.dispute_cleared": "payment_disputes:read",
|
|
199
|
+
"payment.dispute_lost": "payment_disputes:read",
|
|
197
200
|
"fulfillment.digital.delivered": "fulfillment_digital:read"
|
|
198
201
|
};
|
|
199
202
|
var PREFIX_RULES = [
|
|
@@ -1347,7 +1350,7 @@ var ACTIONS = [
|
|
|
1347
1350
|
{
|
|
1348
1351
|
id: "create_customer",
|
|
1349
1352
|
title: "Create a customer",
|
|
1350
|
-
description: "Create a customer record.
|
|
1353
|
+
description: "Create a customer record. Email and externalId are each unique per application: a value that already belongs to a customer fails with 409 customer_already_exists rather than returning the existing record, so use search_customers first if the buyer may already exist.",
|
|
1351
1354
|
kind: "write",
|
|
1352
1355
|
scopes: ["customers:write"],
|
|
1353
1356
|
input: [
|
|
@@ -1579,6 +1582,29 @@ var ACTIONS = [
|
|
|
1579
1582
|
channels: ["mcp", "zapier", "make", "n8n"],
|
|
1580
1583
|
idempotent: true
|
|
1581
1584
|
},
|
|
1585
|
+
{
|
|
1586
|
+
id: "set_subscription_payment_method",
|
|
1587
|
+
title: "Change a subscription's card",
|
|
1588
|
+
description: "Set the saved card one subscription renews on. Only that subscription moves; the customer's default card and their other subscriptions stay as they are. Nothing is charged now.",
|
|
1589
|
+
kind: "write",
|
|
1590
|
+
scopes: ["subscriptions:write"],
|
|
1591
|
+
input: [
|
|
1592
|
+
{ name: "id", type: "string", required: true, description: "Subscription id." },
|
|
1593
|
+
{
|
|
1594
|
+
name: "paymentMethodId",
|
|
1595
|
+
type: "string",
|
|
1596
|
+
required: true,
|
|
1597
|
+
description: "One of the subscription customer's saved cards (GET /api/v1/customers/:id/payment-methods): active and in date."
|
|
1598
|
+
}
|
|
1599
|
+
],
|
|
1600
|
+
requests: [{ method: "PATCH", path: "/api/v1/subscriptions/:id/payment-method" }],
|
|
1601
|
+
channels: ["mcp", "zapier", "make", "n8n"],
|
|
1602
|
+
idempotent: true,
|
|
1603
|
+
guardrails: [
|
|
1604
|
+
"Changes which card future renewals charge. Confirm the subscription and the card (brand, last four) with the user first.",
|
|
1605
|
+
"409 payment_method_unusable: the card is not this customer's active, in-date saved card. 409 invalid_state: the subscription is cancelled or completed."
|
|
1606
|
+
]
|
|
1607
|
+
},
|
|
1582
1608
|
{
|
|
1583
1609
|
id: "cancel_subscription",
|
|
1584
1610
|
title: "Cancel a subscription",
|
|
@@ -2417,6 +2443,14 @@ var HANDLERS = {
|
|
|
2417
2443
|
idempotencyKey: `mcp-manage-subscription-${id}-${action}-${Date.now()}`
|
|
2418
2444
|
});
|
|
2419
2445
|
},
|
|
2446
|
+
set_subscription_payment_method: async (ctx, args) => {
|
|
2447
|
+
const id = String(args.id);
|
|
2448
|
+
return ctx.client.patch(`/api/v1/subscriptions/${id}/payment-method`, {
|
|
2449
|
+
// `id` is the path parameter; the body is `.strict()`.
|
|
2450
|
+
body: { paymentMethodId: args.paymentMethodId },
|
|
2451
|
+
idempotencyKey: `mcp-set-subscription-card-${id}-${String(args.paymentMethodId)}-${Date.now()}`
|
|
2452
|
+
});
|
|
2453
|
+
},
|
|
2420
2454
|
create_quote: async (ctx, args) => {
|
|
2421
2455
|
const items = Array.isArray(args.items) ? args.items : [];
|
|
2422
2456
|
if (args.netN !== void 0 && items.some((item) => item && item.recurring)) {
|
|
@@ -2681,6 +2715,7 @@ var DISPLAY_QUALIFIERS = [
|
|
|
2681
2715
|
"Payment processing",
|
|
2682
2716
|
"Disputed",
|
|
2683
2717
|
"Authorization expired",
|
|
2718
|
+
"Chargeback lost",
|
|
2684
2719
|
"Returned",
|
|
2685
2720
|
"Partially returned",
|
|
2686
2721
|
"Delivered",
|
|
@@ -2758,6 +2793,8 @@ var PAYMENT = {
|
|
|
2758
2793
|
cardBrand: S,
|
|
2759
2794
|
disputed: S,
|
|
2760
2795
|
disputeOpenedAt: S,
|
|
2796
|
+
disputeOutcome: S,
|
|
2797
|
+
disputeClosedAt: S,
|
|
2761
2798
|
errorCode: S,
|
|
2762
2799
|
netN: S,
|
|
2763
2800
|
netNSource: S,
|
|
@@ -2820,6 +2857,10 @@ var SUBSCRIPTION = {
|
|
|
2820
2857
|
pendingIntervalCount: S,
|
|
2821
2858
|
scheduleTotal: S,
|
|
2822
2859
|
nextPaymentAmount: S,
|
|
2860
|
+
// A physical subscription (0236): the method is an enum, and the ship-to is
|
|
2861
|
+
// kept to its country like every other address here.
|
|
2862
|
+
deliveryMethod: S,
|
|
2863
|
+
shippingAddress: ADDRESS,
|
|
2823
2864
|
paymentSchedule: [{
|
|
2824
2865
|
index: S,
|
|
2825
2866
|
amount: S,
|
|
@@ -3196,7 +3237,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
3196
3237
|
};
|
|
3197
3238
|
|
|
3198
3239
|
// src/server.ts
|
|
3199
|
-
var VERSION = true ? "0.4.
|
|
3240
|
+
var VERSION = true ? "0.4.2" : "0.0.0-dev";
|
|
3200
3241
|
function registerableActions(policy) {
|
|
3201
3242
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
3202
3243
|
return actionsForChannel("mcp").filter((action) => {
|