@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/lib.cjs CHANGED
@@ -82,6 +82,7 @@ function add(group, resource, actions, labels, opts = {}) {
82
82
  }
83
83
  add("Orders", "orders", ["read", "write"], { read: "View orders", write: "Manage orders" });
84
84
  add("Quotes", "quotes", ["read", "write"], { read: "View quotes", write: "Manage quotes" });
85
+ add("Forms", "forms", ["read", "write"], { read: "View site forms and their submissions", write: "Manage site forms" }, { sensitive: true });
85
86
  add("Orders", "order_cancellations", ["write"], { write: "Cancel orders" });
86
87
  add("Orders", "order_returns", ["read", "write"], { read: "View returns", write: "Process returns" });
87
88
  add("Orders", "order_comps", ["write"], { write: "Comp orders (write off the balance)" }, { sensitive: true });
@@ -250,6 +251,7 @@ var PREFIX_RULES = [
250
251
  ["cart.", "carts:read"],
251
252
  ["order.", "orders:read"],
252
253
  ["quote.", "quotes:read"],
254
+ ["form.", "forms:read"],
253
255
  ["return.", "order_returns:read"],
254
256
  ["payment.", "payments:read"],
255
257
  ["customer_group.", "customer_groups:read"],
@@ -1523,7 +1525,9 @@ var ACTIONS = [
1523
1525
  { name: "name", type: "string", required: true, description: "Group name, 1 to 100 characters." },
1524
1526
  { name: "kind", type: "string", required: true, description: "fixed or percent." },
1525
1527
  { name: "percentBps", type: "number", required: false, description: "Percent rate in basis points, 1-10000. Required for percent groups." },
1526
- { name: "enabled", type: "boolean", required: false, description: "Whether the group is active.", default: true }
1528
+ { name: "enabled", type: "boolean", required: false, description: "Whether the group is active.", default: true },
1529
+ { name: "taxExempt", type: "boolean", required: false, description: "Members are exempt from tax. Needs taxExemptReason.", default: false },
1530
+ { name: "taxExemptReason", type: "string", required: false, description: "Avalara entity-use code (A-R) that explains the exemption. Required when taxExempt is true." }
1527
1531
  ],
1528
1532
  requests: [{ method: "POST", path: "/api/v1/customer-groups" }],
1529
1533
  channels: ["mcp"],
@@ -1540,7 +1544,9 @@ var ACTIONS = [
1540
1544
  { name: "name", type: "string", required: false, description: "Group name, 1 to 100 characters." },
1541
1545
  { name: "kind", type: "string", required: false, description: "fixed or percent." },
1542
1546
  { 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)." },
1543
- { name: "enabled", type: "boolean", required: false, description: "Whether the group is active." }
1547
+ { name: "enabled", type: "boolean", required: false, description: "Whether the group is active." },
1548
+ { name: "taxExempt", type: "boolean", required: false, description: "Members are exempt from tax. Needs taxExemptReason." },
1549
+ { name: "taxExemptReason", type: "string", required: false, description: "Avalara entity-use code (A-R). Set null to clear when taxExempt is false." }
1544
1550
  ],
1545
1551
  requests: [{ method: "PATCH", path: "/api/v1/customer-groups/:id" }],
1546
1552
  channels: ["mcp"],
@@ -2568,13 +2574,27 @@ var HANDLERS = {
2568
2574
  list_customer_groups: async (ctx) => ctx.client.get("/api/v1/customer-groups"),
2569
2575
  get_customer_group: async (ctx, args) => ctx.client.get(`/api/v1/customer-groups/${String(args.id)}`),
2570
2576
  create_customer_group: async (ctx, args) => ctx.client.post("/api/v1/customer-groups", {
2571
- body: { name: args.name, kind: args.kind, percentBps: args.percentBps, enabled: args.enabled },
2577
+ body: {
2578
+ name: args.name,
2579
+ kind: args.kind,
2580
+ percentBps: args.percentBps,
2581
+ enabled: args.enabled,
2582
+ taxExempt: args.taxExempt,
2583
+ taxExemptReason: args.taxExemptReason
2584
+ },
2572
2585
  // Never put the merchant-written name in a header: non-Latin-1 chars make fetch throw.
2573
2586
  idempotencyKey: `mcp-create-customer-group-${Date.now()}-${(0, import_node_crypto.randomUUID)()}`
2574
2587
  }),
2575
2588
  // A null percentBps is meaningful (fixed group), so only `undefined` is dropped.
2576
2589
  update_customer_group: async (ctx, args) => ctx.client.patch(`/api/v1/customer-groups/${String(args.id)}`, {
2577
- body: { name: args.name, kind: args.kind, percentBps: args.percentBps, enabled: args.enabled }
2590
+ body: {
2591
+ name: args.name,
2592
+ kind: args.kind,
2593
+ percentBps: args.percentBps,
2594
+ enabled: args.enabled,
2595
+ taxExempt: args.taxExempt,
2596
+ taxExemptReason: args.taxExemptReason
2597
+ }
2578
2598
  }),
2579
2599
  delete_customer_group: async (ctx, args) => ctx.client.delete(`/api/v1/customer-groups/${String(args.id)}`),
2580
2600
  add_customer_group_members: async (ctx, args) => ctx.client.post(`/api/v1/customer-groups/${String(args.id)}/members`, {
@@ -3671,6 +3691,8 @@ var CUSTOMER_GROUP = {
3671
3691
  kind: S,
3672
3692
  percentBps: S,
3673
3693
  enabled: S,
3694
+ taxExempt: S,
3695
+ taxExemptReason: T,
3674
3696
  version: S,
3675
3697
  memberCount: S,
3676
3698
  discountCount: S,
@@ -4145,7 +4167,7 @@ var OAUTH_PROJECTIONS = {
4145
4167
  };
4146
4168
 
4147
4169
  // src/server.ts
4148
- var VERSION = true ? "0.7.0" : "0.0.0-dev";
4170
+ var VERSION = true ? "0.8.0" : "0.0.0-dev";
4149
4171
  function registerableActions(policy) {
4150
4172
  const isProduction = policy.identity.environment.providerEnvironment === "production";
4151
4173
  return actionsForChannel("mcp").filter((action) => {