@usethrottle/mcp 0.10.0 → 0.11.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
@@ -1533,6 +1533,17 @@ var ACTIONS = [
1533
1533
  "The updated record is echoed back with email, phone, firstName, lastName and name nulled unless the credential holds customer_pii:read, which OAuth connections cannot hold \u2014 the update still applied, only the response is redacted."
1534
1534
  ]
1535
1535
  },
1536
+ // ------------------------------------------------------------ order fees
1537
+ {
1538
+ id: "list_fees",
1539
+ title: "List order fees",
1540
+ description: "List the order fee definitions of the application (convenience, handling, insurance fees), in display order: kind (percentage or flat), rate in basis points, flat/min/max/min-order amounts per currency, taxable, which orders they apply to and the customer groups they are limited to. Fees only charge while the application has order fees turned on.",
1541
+ kind: "read",
1542
+ scopes: ["applications:read"],
1543
+ input: [],
1544
+ requests: [{ method: "GET", path: "/api/v1/fees" }],
1545
+ channels: ["mcp"]
1546
+ },
1536
1547
  // ------------------------------------------------------------ customer groups
1537
1548
  {
1538
1549
  id: "list_customer_groups",
@@ -2634,6 +2645,8 @@ var HANDLERS = {
2634
2645
  },
2635
2646
  idempotencyKey: `mcp-update-customer-${String(args.id)}-${Date.now()}`
2636
2647
  }),
2648
+ // ----------------------------------------------------------- order fees
2649
+ list_fees: async (ctx) => ctx.client.get("/api/v1/fees"),
2637
2650
  // ----------------------------------------------------------- customer groups
2638
2651
  list_customer_groups: async (ctx) => ctx.client.get("/api/v1/customer-groups"),
2639
2652
  get_customer_group: async (ctx, args) => ctx.client.get(`/api/v1/customer-groups/${String(args.id)}`),
@@ -3279,11 +3292,14 @@ var LINE_ITEM = {
3279
3292
  // amount: a trial line's renewal price; schedule: per-unit installment amounts.
3280
3293
  recurring: { amount: M, scheduleUnitTotal: M, schedule: [{ amount: M }] }
3281
3294
  };
3295
+ var FEE = { baseAmount: M, amount: M, taxAmount: M };
3282
3296
  var ORDER = {
3283
3297
  subtotal: M,
3284
3298
  discountTotal: M,
3285
3299
  shippingTotal: M,
3286
3300
  shippingDiscountTotal: M,
3301
+ feeTotal: M,
3302
+ fees: [FEE],
3287
3303
  taxTotal: M,
3288
3304
  total: M,
3289
3305
  capturedAmount: M,
@@ -3311,7 +3327,8 @@ var SUBSCRIPTION = {
3311
3327
  scheduleTotal: M,
3312
3328
  nextPaymentAmount: M,
3313
3329
  paymentSchedule: [{ amount: M, discount: M, net: M }],
3314
- renewalIssue: { charge: { amount: M } }
3330
+ renewalIssue: { charge: { amount: M } },
3331
+ fees: [FEE]
3315
3332
  };
3316
3333
  var QUOTE_ITEM = {
3317
3334
  unitPrice: M,
@@ -3325,6 +3342,8 @@ var QUOTE_REVISION = {
3325
3342
  subtotal: M,
3326
3343
  discountTotal: M,
3327
3344
  shippingTotal: M,
3345
+ feeTotal: M,
3346
+ fees: [FEE],
3328
3347
  taxTotal: M,
3329
3348
  total: M,
3330
3349
  depositAmount: M,
@@ -3347,15 +3366,19 @@ var INVOICE = {
3347
3366
  taxTotal: M,
3348
3367
  shippingTotal: M,
3349
3368
  discountTotal: M,
3369
+ feeTotal: M,
3370
+ fees: [{ amount: M }],
3350
3371
  total: M,
3351
3372
  amountRefunded: M,
3352
3373
  billingSnapshot: {
3353
3374
  lineItems: [{ unitPrice: M, taxAmount: M, discountAmount: M, total: M }],
3375
+ fees: [FEE],
3354
3376
  totals: {
3355
3377
  subtotal: M,
3356
3378
  taxTotal: M,
3357
3379
  shippingTotal: M,
3358
3380
  discountTotal: M,
3381
+ feeTotal: M,
3359
3382
  total: M,
3360
3383
  orderTotal: M,
3361
3384
  amountPaid: M,
@@ -3376,6 +3399,8 @@ var CART = {
3376
3399
  discountTotal: M,
3377
3400
  shippingTotal: M,
3378
3401
  shippingDiscountTotal: M,
3402
+ feeTotal: M,
3403
+ fees: [FEE],
3379
3404
  total: M,
3380
3405
  lineItems: [LINE_ITEM],
3381
3406
  items: [LINE_ITEM],
@@ -3461,6 +3486,8 @@ var MONEY_SPECS = {
3461
3486
  // GET /api/v1/stores: `settings.shipping` is stamped with its own currency
3462
3487
  // (MC1-R74); an unstamped one takes the store's.
3463
3488
  list_applications: [{ settings: { shipping: { flatRateCents: M, freeThresholdCents: M } } }],
3489
+ // GET /api/v1/fees: fee definitions hold per-currency amounts, keyed by the currency code.
3490
+ list_fees: [{ flatAmounts: MK(M), minAmounts: MK(M), maxAmounts: MK(M), minOrderAmounts: MK(M) }],
3464
3491
  // ---------------------------------------------------------------- analytics
3465
3492
  get_sales_timeseries: {
3466
3493
  totalGrossCents: DROP,
@@ -3690,6 +3717,19 @@ var LINE_ITEM2 = {
3690
3717
  recurring: { ...LINE_RECURRING, amount: MONEY, count: S, scheduleUnitTotal: MONEY },
3691
3718
  subscriptionId: S
3692
3719
  };
3720
+ var FEE2 = {
3721
+ id: S,
3722
+ source: S,
3723
+ label: T,
3724
+ kind: S,
3725
+ rateBps: S,
3726
+ baseAmount: MONEY,
3727
+ amount: MONEY,
3728
+ taxable: S,
3729
+ taxAmount: MONEY,
3730
+ appliesToOneTime: S,
3731
+ appliesToSubscription: S
3732
+ };
3693
3733
  var ORDER2 = {
3694
3734
  id: S,
3695
3735
  orderNumber: S,
@@ -3704,6 +3744,8 @@ var ORDER2 = {
3704
3744
  discountTotal: MONEY,
3705
3745
  shippingTotal: MONEY,
3706
3746
  shippingDiscountTotal: MONEY,
3747
+ feeTotal: MONEY,
3748
+ fees: [FEE2],
3707
3749
  taxTotal: MONEY,
3708
3750
  total: MONEY,
3709
3751
  capturedAmount: MONEY,
@@ -3814,6 +3856,7 @@ var SUBSCRIPTION2 = {
3814
3856
  pendingIntervalCount: S,
3815
3857
  scheduleTotal: MONEY,
3816
3858
  nextPaymentAmount: MONEY,
3859
+ fees: [FEE2],
3817
3860
  // A physical subscription (0236): the method is an enum, and the ship-to is
3818
3861
  // kept to its country like every other address here.
3819
3862
  deliveryMethod: S,
@@ -3853,6 +3896,8 @@ var QUOTE2 = {
3853
3896
  subtotal: MONEY,
3854
3897
  discountTotal: MONEY,
3855
3898
  shippingTotal: MONEY,
3899
+ feeTotal: MONEY,
3900
+ fees: [FEE2],
3856
3901
  taxTotal: MONEY,
3857
3902
  total: MONEY,
3858
3903
  depositAmount: MONEY,
@@ -3888,6 +3933,8 @@ var INVOICE2 = {
3888
3933
  subtotal: MONEY,
3889
3934
  discountTotal: MONEY,
3890
3935
  shippingTotal: MONEY,
3936
+ feeTotal: MONEY,
3937
+ fees: [{ label: T, amount: MONEY }],
3891
3938
  taxTotal: MONEY,
3892
3939
  total: MONEY,
3893
3940
  amountRefunded: MONEY,
@@ -3900,7 +3947,7 @@ var INVOICE2 = {
3900
3947
  planName: T,
3901
3948
  period: { start: S, end: S },
3902
3949
  lineItems: [{ quantity: S, unitPrice: MONEY, discountAmount: MONEY, taxAmount: MONEY, total: MONEY }],
3903
- totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, taxTotal: MONEY, total: MONEY },
3950
+ totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, feeTotal: MONEY, taxTotal: MONEY, total: MONEY },
3904
3951
  payment: { method: S, brand: S, status: S }
3905
3952
  }
3906
3953
  };
@@ -4088,6 +4135,8 @@ var OAUTH_PROJECTIONS = {
4088
4135
  discountTotal: MONEY,
4089
4136
  shippingTotal: MONEY,
4090
4137
  shippingDiscountTotal: MONEY,
4138
+ feeTotal: MONEY,
4139
+ fees: [FEE2],
4091
4140
  taxTotal: MONEY,
4092
4141
  total: MONEY,
4093
4142
  itemCount: S,
@@ -4158,6 +4207,25 @@ var OAUTH_PROJECTIONS = {
4158
4207
  get_workspace_settings: { name: T, slug: S, brandColor: S, logoUrl: T, onboardingCompletedAt: S },
4159
4208
  // What happened and to which record; not which team member did it.
4160
4209
  get_audit_log: page3({ id: S, action: S, resourceType: S, resourceId: S, createdAt: S }),
4210
+ list_fees: [{
4211
+ id: S,
4212
+ name: T,
4213
+ kind: S,
4214
+ rateBps: S,
4215
+ flatAmounts: mapOf(MONEY),
4216
+ minAmounts: mapOf(MONEY),
4217
+ maxAmounts: mapOf(MONEY),
4218
+ minOrderAmounts: mapOf(MONEY),
4219
+ taxable: S,
4220
+ taxCode: S,
4221
+ appliesToOneTime: S,
4222
+ appliesToSubscription: S,
4223
+ customerGroupIds: [S],
4224
+ active: S,
4225
+ sortOrder: S,
4226
+ createdAt: S,
4227
+ updatedAt: S
4228
+ }],
4161
4229
  list_applications: [{ id: S, name: T, slug: S, currency: S, isActive: S }],
4162
4230
  // Analytics: computed aggregates, listed field by field all the same.
4163
4231
  get_business_summary: {
@@ -4257,7 +4325,7 @@ var OAUTH_PROJECTIONS = {
4257
4325
  };
4258
4326
 
4259
4327
  // src/server.ts
4260
- var VERSION = true ? "0.10.0" : "0.0.0-dev";
4328
+ var VERSION = true ? "0.11.0" : "0.0.0-dev";
4261
4329
  function registerableActions(policy) {
4262
4330
  const isProduction = policy.identity.environment.providerEnvironment === "production";
4263
4331
  return actionsForChannel("mcp").filter((action) => {