@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.js CHANGED
@@ -1496,6 +1496,17 @@ var ACTIONS = [
1496
1496
  "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."
1497
1497
  ]
1498
1498
  },
1499
+ // ------------------------------------------------------------ order fees
1500
+ {
1501
+ id: "list_fees",
1502
+ title: "List order fees",
1503
+ 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.",
1504
+ kind: "read",
1505
+ scopes: ["applications:read"],
1506
+ input: [],
1507
+ requests: [{ method: "GET", path: "/api/v1/fees" }],
1508
+ channels: ["mcp"]
1509
+ },
1499
1510
  // ------------------------------------------------------------ customer groups
1500
1511
  {
1501
1512
  id: "list_customer_groups",
@@ -2597,6 +2608,8 @@ var HANDLERS = {
2597
2608
  },
2598
2609
  idempotencyKey: `mcp-update-customer-${String(args.id)}-${Date.now()}`
2599
2610
  }),
2611
+ // ----------------------------------------------------------- order fees
2612
+ list_fees: async (ctx) => ctx.client.get("/api/v1/fees"),
2600
2613
  // ----------------------------------------------------------- customer groups
2601
2614
  list_customer_groups: async (ctx) => ctx.client.get("/api/v1/customer-groups"),
2602
2615
  get_customer_group: async (ctx, args) => ctx.client.get(`/api/v1/customer-groups/${String(args.id)}`),
@@ -3242,11 +3255,14 @@ var LINE_ITEM = {
3242
3255
  // amount: a trial line's renewal price; schedule: per-unit installment amounts.
3243
3256
  recurring: { amount: M, scheduleUnitTotal: M, schedule: [{ amount: M }] }
3244
3257
  };
3258
+ var FEE = { baseAmount: M, amount: M, taxAmount: M };
3245
3259
  var ORDER = {
3246
3260
  subtotal: M,
3247
3261
  discountTotal: M,
3248
3262
  shippingTotal: M,
3249
3263
  shippingDiscountTotal: M,
3264
+ feeTotal: M,
3265
+ fees: [FEE],
3250
3266
  taxTotal: M,
3251
3267
  total: M,
3252
3268
  capturedAmount: M,
@@ -3274,7 +3290,8 @@ var SUBSCRIPTION = {
3274
3290
  scheduleTotal: M,
3275
3291
  nextPaymentAmount: M,
3276
3292
  paymentSchedule: [{ amount: M, discount: M, net: M }],
3277
- renewalIssue: { charge: { amount: M } }
3293
+ renewalIssue: { charge: { amount: M } },
3294
+ fees: [FEE]
3278
3295
  };
3279
3296
  var QUOTE_ITEM = {
3280
3297
  unitPrice: M,
@@ -3288,6 +3305,8 @@ var QUOTE_REVISION = {
3288
3305
  subtotal: M,
3289
3306
  discountTotal: M,
3290
3307
  shippingTotal: M,
3308
+ feeTotal: M,
3309
+ fees: [FEE],
3291
3310
  taxTotal: M,
3292
3311
  total: M,
3293
3312
  depositAmount: M,
@@ -3310,15 +3329,19 @@ var INVOICE = {
3310
3329
  taxTotal: M,
3311
3330
  shippingTotal: M,
3312
3331
  discountTotal: M,
3332
+ feeTotal: M,
3333
+ fees: [{ amount: M }],
3313
3334
  total: M,
3314
3335
  amountRefunded: M,
3315
3336
  billingSnapshot: {
3316
3337
  lineItems: [{ unitPrice: M, taxAmount: M, discountAmount: M, total: M }],
3338
+ fees: [FEE],
3317
3339
  totals: {
3318
3340
  subtotal: M,
3319
3341
  taxTotal: M,
3320
3342
  shippingTotal: M,
3321
3343
  discountTotal: M,
3344
+ feeTotal: M,
3322
3345
  total: M,
3323
3346
  orderTotal: M,
3324
3347
  amountPaid: M,
@@ -3339,6 +3362,8 @@ var CART = {
3339
3362
  discountTotal: M,
3340
3363
  shippingTotal: M,
3341
3364
  shippingDiscountTotal: M,
3365
+ feeTotal: M,
3366
+ fees: [FEE],
3342
3367
  total: M,
3343
3368
  lineItems: [LINE_ITEM],
3344
3369
  items: [LINE_ITEM],
@@ -3424,6 +3449,8 @@ var MONEY_SPECS = {
3424
3449
  // GET /api/v1/stores: `settings.shipping` is stamped with its own currency
3425
3450
  // (MC1-R74); an unstamped one takes the store's.
3426
3451
  list_applications: [{ settings: { shipping: { flatRateCents: M, freeThresholdCents: M } } }],
3452
+ // GET /api/v1/fees: fee definitions hold per-currency amounts, keyed by the currency code.
3453
+ list_fees: [{ flatAmounts: MK(M), minAmounts: MK(M), maxAmounts: MK(M), minOrderAmounts: MK(M) }],
3427
3454
  // ---------------------------------------------------------------- analytics
3428
3455
  get_sales_timeseries: {
3429
3456
  totalGrossCents: DROP,
@@ -3653,6 +3680,19 @@ var LINE_ITEM2 = {
3653
3680
  recurring: { ...LINE_RECURRING, amount: MONEY, count: S, scheduleUnitTotal: MONEY },
3654
3681
  subscriptionId: S
3655
3682
  };
3683
+ var FEE2 = {
3684
+ id: S,
3685
+ source: S,
3686
+ label: T,
3687
+ kind: S,
3688
+ rateBps: S,
3689
+ baseAmount: MONEY,
3690
+ amount: MONEY,
3691
+ taxable: S,
3692
+ taxAmount: MONEY,
3693
+ appliesToOneTime: S,
3694
+ appliesToSubscription: S
3695
+ };
3656
3696
  var ORDER2 = {
3657
3697
  id: S,
3658
3698
  orderNumber: S,
@@ -3667,6 +3707,8 @@ var ORDER2 = {
3667
3707
  discountTotal: MONEY,
3668
3708
  shippingTotal: MONEY,
3669
3709
  shippingDiscountTotal: MONEY,
3710
+ feeTotal: MONEY,
3711
+ fees: [FEE2],
3670
3712
  taxTotal: MONEY,
3671
3713
  total: MONEY,
3672
3714
  capturedAmount: MONEY,
@@ -3777,6 +3819,7 @@ var SUBSCRIPTION2 = {
3777
3819
  pendingIntervalCount: S,
3778
3820
  scheduleTotal: MONEY,
3779
3821
  nextPaymentAmount: MONEY,
3822
+ fees: [FEE2],
3780
3823
  // A physical subscription (0236): the method is an enum, and the ship-to is
3781
3824
  // kept to its country like every other address here.
3782
3825
  deliveryMethod: S,
@@ -3816,6 +3859,8 @@ var QUOTE2 = {
3816
3859
  subtotal: MONEY,
3817
3860
  discountTotal: MONEY,
3818
3861
  shippingTotal: MONEY,
3862
+ feeTotal: MONEY,
3863
+ fees: [FEE2],
3819
3864
  taxTotal: MONEY,
3820
3865
  total: MONEY,
3821
3866
  depositAmount: MONEY,
@@ -3851,6 +3896,8 @@ var INVOICE2 = {
3851
3896
  subtotal: MONEY,
3852
3897
  discountTotal: MONEY,
3853
3898
  shippingTotal: MONEY,
3899
+ feeTotal: MONEY,
3900
+ fees: [{ label: T, amount: MONEY }],
3854
3901
  taxTotal: MONEY,
3855
3902
  total: MONEY,
3856
3903
  amountRefunded: MONEY,
@@ -3863,7 +3910,7 @@ var INVOICE2 = {
3863
3910
  planName: T,
3864
3911
  period: { start: S, end: S },
3865
3912
  lineItems: [{ quantity: S, unitPrice: MONEY, discountAmount: MONEY, taxAmount: MONEY, total: MONEY }],
3866
- totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, taxTotal: MONEY, total: MONEY },
3913
+ totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, feeTotal: MONEY, taxTotal: MONEY, total: MONEY },
3867
3914
  payment: { method: S, brand: S, status: S }
3868
3915
  }
3869
3916
  };
@@ -4051,6 +4098,8 @@ var OAUTH_PROJECTIONS = {
4051
4098
  discountTotal: MONEY,
4052
4099
  shippingTotal: MONEY,
4053
4100
  shippingDiscountTotal: MONEY,
4101
+ feeTotal: MONEY,
4102
+ fees: [FEE2],
4054
4103
  taxTotal: MONEY,
4055
4104
  total: MONEY,
4056
4105
  itemCount: S,
@@ -4121,6 +4170,25 @@ var OAUTH_PROJECTIONS = {
4121
4170
  get_workspace_settings: { name: T, slug: S, brandColor: S, logoUrl: T, onboardingCompletedAt: S },
4122
4171
  // What happened and to which record; not which team member did it.
4123
4172
  get_audit_log: page3({ id: S, action: S, resourceType: S, resourceId: S, createdAt: S }),
4173
+ list_fees: [{
4174
+ id: S,
4175
+ name: T,
4176
+ kind: S,
4177
+ rateBps: S,
4178
+ flatAmounts: mapOf(MONEY),
4179
+ minAmounts: mapOf(MONEY),
4180
+ maxAmounts: mapOf(MONEY),
4181
+ minOrderAmounts: mapOf(MONEY),
4182
+ taxable: S,
4183
+ taxCode: S,
4184
+ appliesToOneTime: S,
4185
+ appliesToSubscription: S,
4186
+ customerGroupIds: [S],
4187
+ active: S,
4188
+ sortOrder: S,
4189
+ createdAt: S,
4190
+ updatedAt: S
4191
+ }],
4124
4192
  list_applications: [{ id: S, name: T, slug: S, currency: S, isActive: S }],
4125
4193
  // Analytics: computed aggregates, listed field by field all the same.
4126
4194
  get_business_summary: {
@@ -4220,7 +4288,7 @@ var OAUTH_PROJECTIONS = {
4220
4288
  };
4221
4289
 
4222
4290
  // src/server.ts
4223
- var VERSION = true ? "0.10.0" : "0.0.0-dev";
4291
+ var VERSION = true ? "0.11.0" : "0.0.0-dev";
4224
4292
  function registerableActions(policy) {
4225
4293
  const isProduction = policy.identity.environment.providerEnvironment === "production";
4226
4294
  return actionsForChannel("mcp").filter((action) => {