@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/contract-index.json +1 -1
- package/dist/docs-index.json +1 -1
- package/dist/lib.cjs +71 -3
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.js +71 -3
- package/dist/lib.js.map +1 -1
- package/dist/mcp.js +71 -3
- package/dist/mcp.js.map +1 -1
- package/package.json +4 -4
package/dist/mcp.js
CHANGED
|
@@ -1626,6 +1626,17 @@ var ACTIONS = [
|
|
|
1626
1626
|
"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."
|
|
1627
1627
|
]
|
|
1628
1628
|
},
|
|
1629
|
+
// ------------------------------------------------------------ order fees
|
|
1630
|
+
{
|
|
1631
|
+
id: "list_fees",
|
|
1632
|
+
title: "List order fees",
|
|
1633
|
+
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.",
|
|
1634
|
+
kind: "read",
|
|
1635
|
+
scopes: ["applications:read"],
|
|
1636
|
+
input: [],
|
|
1637
|
+
requests: [{ method: "GET", path: "/api/v1/fees" }],
|
|
1638
|
+
channels: ["mcp"]
|
|
1639
|
+
},
|
|
1629
1640
|
// ------------------------------------------------------------ customer groups
|
|
1630
1641
|
{
|
|
1631
1642
|
id: "list_customer_groups",
|
|
@@ -2596,6 +2607,8 @@ var HANDLERS = {
|
|
|
2596
2607
|
},
|
|
2597
2608
|
idempotencyKey: `mcp-update-customer-${String(args.id)}-${Date.now()}`
|
|
2598
2609
|
}),
|
|
2610
|
+
// ----------------------------------------------------------- order fees
|
|
2611
|
+
list_fees: async (ctx) => ctx.client.get("/api/v1/fees"),
|
|
2599
2612
|
// ----------------------------------------------------------- customer groups
|
|
2600
2613
|
list_customer_groups: async (ctx) => ctx.client.get("/api/v1/customer-groups"),
|
|
2601
2614
|
get_customer_group: async (ctx, args) => ctx.client.get(`/api/v1/customer-groups/${String(args.id)}`),
|
|
@@ -3158,11 +3171,14 @@ var LINE_ITEM = {
|
|
|
3158
3171
|
// amount: a trial line's renewal price; schedule: per-unit installment amounts.
|
|
3159
3172
|
recurring: { amount: M, scheduleUnitTotal: M, schedule: [{ amount: M }] }
|
|
3160
3173
|
};
|
|
3174
|
+
var FEE = { baseAmount: M, amount: M, taxAmount: M };
|
|
3161
3175
|
var ORDER = {
|
|
3162
3176
|
subtotal: M,
|
|
3163
3177
|
discountTotal: M,
|
|
3164
3178
|
shippingTotal: M,
|
|
3165
3179
|
shippingDiscountTotal: M,
|
|
3180
|
+
feeTotal: M,
|
|
3181
|
+
fees: [FEE],
|
|
3166
3182
|
taxTotal: M,
|
|
3167
3183
|
total: M,
|
|
3168
3184
|
capturedAmount: M,
|
|
@@ -3190,7 +3206,8 @@ var SUBSCRIPTION = {
|
|
|
3190
3206
|
scheduleTotal: M,
|
|
3191
3207
|
nextPaymentAmount: M,
|
|
3192
3208
|
paymentSchedule: [{ amount: M, discount: M, net: M }],
|
|
3193
|
-
renewalIssue: { charge: { amount: M } }
|
|
3209
|
+
renewalIssue: { charge: { amount: M } },
|
|
3210
|
+
fees: [FEE]
|
|
3194
3211
|
};
|
|
3195
3212
|
var QUOTE_ITEM = {
|
|
3196
3213
|
unitPrice: M,
|
|
@@ -3204,6 +3221,8 @@ var QUOTE_REVISION = {
|
|
|
3204
3221
|
subtotal: M,
|
|
3205
3222
|
discountTotal: M,
|
|
3206
3223
|
shippingTotal: M,
|
|
3224
|
+
feeTotal: M,
|
|
3225
|
+
fees: [FEE],
|
|
3207
3226
|
taxTotal: M,
|
|
3208
3227
|
total: M,
|
|
3209
3228
|
depositAmount: M,
|
|
@@ -3226,15 +3245,19 @@ var INVOICE = {
|
|
|
3226
3245
|
taxTotal: M,
|
|
3227
3246
|
shippingTotal: M,
|
|
3228
3247
|
discountTotal: M,
|
|
3248
|
+
feeTotal: M,
|
|
3249
|
+
fees: [{ amount: M }],
|
|
3229
3250
|
total: M,
|
|
3230
3251
|
amountRefunded: M,
|
|
3231
3252
|
billingSnapshot: {
|
|
3232
3253
|
lineItems: [{ unitPrice: M, taxAmount: M, discountAmount: M, total: M }],
|
|
3254
|
+
fees: [FEE],
|
|
3233
3255
|
totals: {
|
|
3234
3256
|
subtotal: M,
|
|
3235
3257
|
taxTotal: M,
|
|
3236
3258
|
shippingTotal: M,
|
|
3237
3259
|
discountTotal: M,
|
|
3260
|
+
feeTotal: M,
|
|
3238
3261
|
total: M,
|
|
3239
3262
|
orderTotal: M,
|
|
3240
3263
|
amountPaid: M,
|
|
@@ -3255,6 +3278,8 @@ var CART = {
|
|
|
3255
3278
|
discountTotal: M,
|
|
3256
3279
|
shippingTotal: M,
|
|
3257
3280
|
shippingDiscountTotal: M,
|
|
3281
|
+
feeTotal: M,
|
|
3282
|
+
fees: [FEE],
|
|
3258
3283
|
total: M,
|
|
3259
3284
|
lineItems: [LINE_ITEM],
|
|
3260
3285
|
items: [LINE_ITEM],
|
|
@@ -3340,6 +3365,8 @@ var MONEY_SPECS = {
|
|
|
3340
3365
|
// GET /api/v1/stores: `settings.shipping` is stamped with its own currency
|
|
3341
3366
|
// (MC1-R74); an unstamped one takes the store's.
|
|
3342
3367
|
list_applications: [{ settings: { shipping: { flatRateCents: M, freeThresholdCents: M } } }],
|
|
3368
|
+
// GET /api/v1/fees: fee definitions hold per-currency amounts, keyed by the currency code.
|
|
3369
|
+
list_fees: [{ flatAmounts: MK(M), minAmounts: MK(M), maxAmounts: MK(M), minOrderAmounts: MK(M) }],
|
|
3343
3370
|
// ---------------------------------------------------------------- analytics
|
|
3344
3371
|
get_sales_timeseries: {
|
|
3345
3372
|
totalGrossCents: DROP,
|
|
@@ -3569,6 +3596,19 @@ var LINE_ITEM2 = {
|
|
|
3569
3596
|
recurring: { ...LINE_RECURRING, amount: MONEY, count: S, scheduleUnitTotal: MONEY },
|
|
3570
3597
|
subscriptionId: S
|
|
3571
3598
|
};
|
|
3599
|
+
var FEE2 = {
|
|
3600
|
+
id: S,
|
|
3601
|
+
source: S,
|
|
3602
|
+
label: T,
|
|
3603
|
+
kind: S,
|
|
3604
|
+
rateBps: S,
|
|
3605
|
+
baseAmount: MONEY,
|
|
3606
|
+
amount: MONEY,
|
|
3607
|
+
taxable: S,
|
|
3608
|
+
taxAmount: MONEY,
|
|
3609
|
+
appliesToOneTime: S,
|
|
3610
|
+
appliesToSubscription: S
|
|
3611
|
+
};
|
|
3572
3612
|
var ORDER2 = {
|
|
3573
3613
|
id: S,
|
|
3574
3614
|
orderNumber: S,
|
|
@@ -3583,6 +3623,8 @@ var ORDER2 = {
|
|
|
3583
3623
|
discountTotal: MONEY,
|
|
3584
3624
|
shippingTotal: MONEY,
|
|
3585
3625
|
shippingDiscountTotal: MONEY,
|
|
3626
|
+
feeTotal: MONEY,
|
|
3627
|
+
fees: [FEE2],
|
|
3586
3628
|
taxTotal: MONEY,
|
|
3587
3629
|
total: MONEY,
|
|
3588
3630
|
capturedAmount: MONEY,
|
|
@@ -3693,6 +3735,7 @@ var SUBSCRIPTION2 = {
|
|
|
3693
3735
|
pendingIntervalCount: S,
|
|
3694
3736
|
scheduleTotal: MONEY,
|
|
3695
3737
|
nextPaymentAmount: MONEY,
|
|
3738
|
+
fees: [FEE2],
|
|
3696
3739
|
// A physical subscription (0236): the method is an enum, and the ship-to is
|
|
3697
3740
|
// kept to its country like every other address here.
|
|
3698
3741
|
deliveryMethod: S,
|
|
@@ -3732,6 +3775,8 @@ var QUOTE2 = {
|
|
|
3732
3775
|
subtotal: MONEY,
|
|
3733
3776
|
discountTotal: MONEY,
|
|
3734
3777
|
shippingTotal: MONEY,
|
|
3778
|
+
feeTotal: MONEY,
|
|
3779
|
+
fees: [FEE2],
|
|
3735
3780
|
taxTotal: MONEY,
|
|
3736
3781
|
total: MONEY,
|
|
3737
3782
|
depositAmount: MONEY,
|
|
@@ -3767,6 +3812,8 @@ var INVOICE2 = {
|
|
|
3767
3812
|
subtotal: MONEY,
|
|
3768
3813
|
discountTotal: MONEY,
|
|
3769
3814
|
shippingTotal: MONEY,
|
|
3815
|
+
feeTotal: MONEY,
|
|
3816
|
+
fees: [{ label: T, amount: MONEY }],
|
|
3770
3817
|
taxTotal: MONEY,
|
|
3771
3818
|
total: MONEY,
|
|
3772
3819
|
amountRefunded: MONEY,
|
|
@@ -3779,7 +3826,7 @@ var INVOICE2 = {
|
|
|
3779
3826
|
planName: T,
|
|
3780
3827
|
period: { start: S, end: S },
|
|
3781
3828
|
lineItems: [{ quantity: S, unitPrice: MONEY, discountAmount: MONEY, taxAmount: MONEY, total: MONEY }],
|
|
3782
|
-
totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, taxTotal: MONEY, total: MONEY },
|
|
3829
|
+
totals: { currency: S, subtotal: MONEY, discountTotal: MONEY, shippingTotal: MONEY, feeTotal: MONEY, taxTotal: MONEY, total: MONEY },
|
|
3783
3830
|
payment: { method: S, brand: S, status: S }
|
|
3784
3831
|
}
|
|
3785
3832
|
};
|
|
@@ -3967,6 +4014,8 @@ var OAUTH_PROJECTIONS = {
|
|
|
3967
4014
|
discountTotal: MONEY,
|
|
3968
4015
|
shippingTotal: MONEY,
|
|
3969
4016
|
shippingDiscountTotal: MONEY,
|
|
4017
|
+
feeTotal: MONEY,
|
|
4018
|
+
fees: [FEE2],
|
|
3970
4019
|
taxTotal: MONEY,
|
|
3971
4020
|
total: MONEY,
|
|
3972
4021
|
itemCount: S,
|
|
@@ -4037,6 +4086,25 @@ var OAUTH_PROJECTIONS = {
|
|
|
4037
4086
|
get_workspace_settings: { name: T, slug: S, brandColor: S, logoUrl: T, onboardingCompletedAt: S },
|
|
4038
4087
|
// What happened and to which record; not which team member did it.
|
|
4039
4088
|
get_audit_log: page3({ id: S, action: S, resourceType: S, resourceId: S, createdAt: S }),
|
|
4089
|
+
list_fees: [{
|
|
4090
|
+
id: S,
|
|
4091
|
+
name: T,
|
|
4092
|
+
kind: S,
|
|
4093
|
+
rateBps: S,
|
|
4094
|
+
flatAmounts: mapOf(MONEY),
|
|
4095
|
+
minAmounts: mapOf(MONEY),
|
|
4096
|
+
maxAmounts: mapOf(MONEY),
|
|
4097
|
+
minOrderAmounts: mapOf(MONEY),
|
|
4098
|
+
taxable: S,
|
|
4099
|
+
taxCode: S,
|
|
4100
|
+
appliesToOneTime: S,
|
|
4101
|
+
appliesToSubscription: S,
|
|
4102
|
+
customerGroupIds: [S],
|
|
4103
|
+
active: S,
|
|
4104
|
+
sortOrder: S,
|
|
4105
|
+
createdAt: S,
|
|
4106
|
+
updatedAt: S
|
|
4107
|
+
}],
|
|
4040
4108
|
list_applications: [{ id: S, name: T, slug: S, currency: S, isActive: S }],
|
|
4041
4109
|
// Analytics: computed aggregates, listed field by field all the same.
|
|
4042
4110
|
get_business_summary: {
|
|
@@ -4136,7 +4204,7 @@ var OAUTH_PROJECTIONS = {
|
|
|
4136
4204
|
};
|
|
4137
4205
|
|
|
4138
4206
|
// src/server.ts
|
|
4139
|
-
var VERSION = true ? "0.
|
|
4207
|
+
var VERSION = true ? "0.11.0" : "0.0.0-dev";
|
|
4140
4208
|
function registerableActions(policy) {
|
|
4141
4209
|
const isProduction = policy.identity.environment.providerEnvironment === "production";
|
|
4142
4210
|
return actionsForChannel("mcp").filter((action) => {
|