@usethrottle/mcp 0.7.0 → 0.8.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/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +27 -5
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +27 -5
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +27 -5
- package/dist/mcp.js.map +1 -1
- package/package.json +2 -2
package/dist/lib.js
CHANGED
|
@@ -45,6 +45,7 @@ function add(group, resource, actions, labels, opts = {}) {
|
|
|
45
45
|
}
|
|
46
46
|
add("Orders", "orders", ["read", "write"], { read: "View orders", write: "Manage orders" });
|
|
47
47
|
add("Quotes", "quotes", ["read", "write"], { read: "View quotes", write: "Manage quotes" });
|
|
48
|
+
add("Forms", "forms", ["read", "write"], { read: "View site forms and their submissions", write: "Manage site forms" }, { sensitive: true });
|
|
48
49
|
add("Orders", "order_cancellations", ["write"], { write: "Cancel orders" });
|
|
49
50
|
add("Orders", "order_returns", ["read", "write"], { read: "View returns", write: "Process returns" });
|
|
50
51
|
add("Orders", "order_comps", ["write"], { write: "Comp orders (write off the balance)" }, { sensitive: true });
|
|
@@ -213,6 +214,7 @@ var PREFIX_RULES = [
|
|
|
213
214
|
["cart.", "carts:read"],
|
|
214
215
|
["order.", "orders:read"],
|
|
215
216
|
["quote.", "quotes:read"],
|
|
217
|
+
["form.", "forms:read"],
|
|
216
218
|
["return.", "order_returns:read"],
|
|
217
219
|
["payment.", "payments:read"],
|
|
218
220
|
["customer_group.", "customer_groups:read"],
|
|
@@ -1486,7 +1488,9 @@ var ACTIONS = [
|
|
|
1486
1488
|
{ name: "name", type: "string", required: true, description: "Group name, 1 to 100 characters." },
|
|
1487
1489
|
{ name: "kind", type: "string", required: true, description: "fixed or percent." },
|
|
1488
1490
|
{ name: "percentBps", type: "number", required: false, description: "Percent rate in basis points, 1-10000. Required for percent groups." },
|
|
1489
|
-
{ name: "enabled", type: "boolean", required: false, description: "Whether the group is active.", default: true }
|
|
1491
|
+
{ name: "enabled", type: "boolean", required: false, description: "Whether the group is active.", default: true },
|
|
1492
|
+
{ name: "taxExempt", type: "boolean", required: false, description: "Members are exempt from tax. Needs taxExemptReason.", default: false },
|
|
1493
|
+
{ name: "taxExemptReason", type: "string", required: false, description: "Avalara entity-use code (A-R) that explains the exemption. Required when taxExempt is true." }
|
|
1490
1494
|
],
|
|
1491
1495
|
requests: [{ method: "POST", path: "/api/v1/customer-groups" }],
|
|
1492
1496
|
channels: ["mcp"],
|
|
@@ -1503,7 +1507,9 @@ var ACTIONS = [
|
|
|
1503
1507
|
{ name: "name", type: "string", required: false, description: "Group name, 1 to 100 characters." },
|
|
1504
1508
|
{ name: "kind", type: "string", required: false, description: "fixed or percent." },
|
|
1505
1509
|
{ name: "percentBps", type: "number", required: false, description: "Percent rate in basis points, 1-10000. To make the group fixed, set kind to fixed (the rate is cleared)." },
|
|
1506
|
-
{ name: "enabled", type: "boolean", required: false, description: "Whether the group is active." }
|
|
1510
|
+
{ name: "enabled", type: "boolean", required: false, description: "Whether the group is active." },
|
|
1511
|
+
{ name: "taxExempt", type: "boolean", required: false, description: "Members are exempt from tax. Needs taxExemptReason." },
|
|
1512
|
+
{ name: "taxExemptReason", type: "string", required: false, description: "Avalara entity-use code (A-R). Set null to clear when taxExempt is false." }
|
|
1507
1513
|
],
|
|
1508
1514
|
requests: [{ method: "PATCH", path: "/api/v1/customer-groups/:id" }],
|
|
1509
1515
|
channels: ["mcp"],
|
|
@@ -2531,13 +2537,27 @@ var HANDLERS = {
|
|
|
2531
2537
|
list_customer_groups: async (ctx) => ctx.client.get("/api/v1/customer-groups"),
|
|
2532
2538
|
get_customer_group: async (ctx, args) => ctx.client.get(`/api/v1/customer-groups/${String(args.id)}`),
|
|
2533
2539
|
create_customer_group: async (ctx, args) => ctx.client.post("/api/v1/customer-groups", {
|
|
2534
|
-
body: {
|
|
2540
|
+
body: {
|
|
2541
|
+
name: args.name,
|
|
2542
|
+
kind: args.kind,
|
|
2543
|
+
percentBps: args.percentBps,
|
|
2544
|
+
enabled: args.enabled,
|
|
2545
|
+
taxExempt: args.taxExempt,
|
|
2546
|
+
taxExemptReason: args.taxExemptReason
|
|
2547
|
+
},
|
|
2535
2548
|
// Never put the merchant-written name in a header: non-Latin-1 chars make fetch throw.
|
|
2536
2549
|
idempotencyKey: `mcp-create-customer-group-${Date.now()}-${randomUUID()}`
|
|
2537
2550
|
}),
|
|
2538
2551
|
// A null percentBps is meaningful (fixed group), so only `undefined` is dropped.
|
|
2539
2552
|
update_customer_group: async (ctx, args) => ctx.client.patch(`/api/v1/customer-groups/${String(args.id)}`, {
|
|
2540
|
-
body: {
|
|
2553
|
+
body: {
|
|
2554
|
+
name: args.name,
|
|
2555
|
+
kind: args.kind,
|
|
2556
|
+
percentBps: args.percentBps,
|
|
2557
|
+
enabled: args.enabled,
|
|
2558
|
+
taxExempt: args.taxExempt,
|
|
2559
|
+
taxExemptReason: args.taxExemptReason
|
|
2560
|
+
}
|
|
2541
2561
|
}),
|
|
2542
2562
|
delete_customer_group: async (ctx, args) => ctx.client.delete(`/api/v1/customer-groups/${String(args.id)}`),
|
|
2543
2563
|
add_customer_group_members: async (ctx, args) => ctx.client.post(`/api/v1/customer-groups/${String(args.id)}/members`, {
|
|
@@ -3634,6 +3654,8 @@ var CUSTOMER_GROUP = {
|
|
|
3634
3654
|
kind: S,
|
|
3635
3655
|
percentBps: S,
|
|
3636
3656
|
enabled: S,
|
|
3657
|
+
taxExempt: S,
|
|
3658
|
+
taxExemptReason: T,
|
|
3637
3659
|
version: S,
|
|
3638
3660
|
memberCount: S,
|
|
3639
3661
|
discountCount: S,
|
|
@@ -4108,7 +4130,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
4108
4130
|
};
|
|
4109
4131
|
|
|
4110
4132
|
// src/server.ts
|
|
4111
|
-
var VERSION = true ? "0.
|
|
4133
|
+
var VERSION = true ? "0.8.0" : "0.0.0-dev";
|
|
4112
4134
|
function registerableActions(policy) {
|
|
4113
4135
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
4114
4136
|
return actionsForChannel("mcp").filter((action) => {
|