@yawlabs/lemonsqueezy-mcp 0.2.0 → 0.2.1
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/index.js +83 -271
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -21078,7 +21078,7 @@ async function apiRequest(method, path, body) {
|
|
|
21078
21078
|
return { ok: false, status: res.status, error: errorBody };
|
|
21079
21079
|
}
|
|
21080
21080
|
}
|
|
21081
|
-
if (res.status === 204
|
|
21081
|
+
if (res.status === 204) {
|
|
21082
21082
|
return { ok: true, status: res.status };
|
|
21083
21083
|
}
|
|
21084
21084
|
const data = await res.json();
|
|
@@ -21107,7 +21107,12 @@ async function licenseRequest(path, body) {
|
|
|
21107
21107
|
const errorBody = await res.text();
|
|
21108
21108
|
try {
|
|
21109
21109
|
const parsed = JSON.parse(errorBody);
|
|
21110
|
-
return {
|
|
21110
|
+
return {
|
|
21111
|
+
ok: false,
|
|
21112
|
+
status: res.status,
|
|
21113
|
+
data: parsed,
|
|
21114
|
+
error: parsed.errors?.[0]?.detail ?? parsed.error ?? errorBody
|
|
21115
|
+
};
|
|
21111
21116
|
} catch {
|
|
21112
21117
|
return { ok: false, status: res.status, error: errorBody };
|
|
21113
21118
|
}
|
|
@@ -21115,6 +21120,27 @@ async function licenseRequest(path, body) {
|
|
|
21115
21120
|
const data = await res.json();
|
|
21116
21121
|
return { ok: true, status: res.status, data };
|
|
21117
21122
|
}
|
|
21123
|
+
function getHandler(endpoint, idField) {
|
|
21124
|
+
return async (input) => {
|
|
21125
|
+
const query = buildQuery({ include: input.include?.split(",") });
|
|
21126
|
+
return apiGet(`${endpoint}/${input[idField]}${query}`);
|
|
21127
|
+
};
|
|
21128
|
+
}
|
|
21129
|
+
function listHandler(endpoint, filterMap = {}) {
|
|
21130
|
+
return async (input) => {
|
|
21131
|
+
const filter = {};
|
|
21132
|
+
for (const [inputKey, apiKey] of Object.entries(filterMap)) {
|
|
21133
|
+
const val = input[inputKey];
|
|
21134
|
+
if (val !== void 0) filter[apiKey] = String(val);
|
|
21135
|
+
}
|
|
21136
|
+
const query = buildQuery({
|
|
21137
|
+
include: input.include?.split(","),
|
|
21138
|
+
filter,
|
|
21139
|
+
page: { number: input.pageNumber, size: input.pageSize }
|
|
21140
|
+
});
|
|
21141
|
+
return apiGet(`${endpoint}${query}`);
|
|
21142
|
+
};
|
|
21143
|
+
}
|
|
21118
21144
|
async function apiGet(path) {
|
|
21119
21145
|
return apiRequest("GET", path);
|
|
21120
21146
|
}
|
|
@@ -21144,10 +21170,7 @@ var checkoutTools = [
|
|
|
21144
21170
|
checkoutId: external_exports.string().describe("The checkout ID"),
|
|
21145
21171
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store,variant')")
|
|
21146
21172
|
}),
|
|
21147
|
-
handler:
|
|
21148
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21149
|
-
return apiGet(`/checkouts/${input.checkoutId}${query}`);
|
|
21150
|
-
}
|
|
21173
|
+
handler: getHandler("/checkouts", "checkoutId")
|
|
21151
21174
|
},
|
|
21152
21175
|
{
|
|
21153
21176
|
name: "ls_list_checkouts",
|
|
@@ -21166,17 +21189,7 @@ var checkoutTools = [
|
|
|
21166
21189
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21167
21190
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21168
21191
|
}),
|
|
21169
|
-
handler:
|
|
21170
|
-
const filter = {};
|
|
21171
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
21172
|
-
if (input.variantId) filter.variant_id = input.variantId;
|
|
21173
|
-
const query = buildQuery({
|
|
21174
|
-
include: input.include?.split(","),
|
|
21175
|
-
filter,
|
|
21176
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21177
|
-
});
|
|
21178
|
-
return apiGet(`/checkouts${query}`);
|
|
21179
|
-
}
|
|
21192
|
+
handler: listHandler("/checkouts", { storeId: "store_id", variantId: "variant_id" })
|
|
21180
21193
|
},
|
|
21181
21194
|
{
|
|
21182
21195
|
name: "ls_create_checkout",
|
|
@@ -21254,10 +21267,7 @@ var customerTools = [
|
|
|
21254
21267
|
customerId: external_exports.string().describe("The customer ID"),
|
|
21255
21268
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store,orders,subscriptions,license-keys')")
|
|
21256
21269
|
}),
|
|
21257
|
-
handler:
|
|
21258
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21259
|
-
return apiGet(`/customers/${input.customerId}${query}`);
|
|
21260
|
-
}
|
|
21270
|
+
handler: getHandler("/customers", "customerId")
|
|
21261
21271
|
},
|
|
21262
21272
|
{
|
|
21263
21273
|
name: "ls_list_customers",
|
|
@@ -21276,17 +21286,7 @@ var customerTools = [
|
|
|
21276
21286
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21277
21287
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21278
21288
|
}),
|
|
21279
|
-
handler:
|
|
21280
|
-
const filter = {};
|
|
21281
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
21282
|
-
if (input.email) filter.email = input.email;
|
|
21283
|
-
const query = buildQuery({
|
|
21284
|
-
include: input.include?.split(","),
|
|
21285
|
-
filter,
|
|
21286
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21287
|
-
});
|
|
21288
|
-
return apiGet(`/customers${query}`);
|
|
21289
|
-
}
|
|
21289
|
+
handler: listHandler("/customers", { storeId: "store_id", email: "email" })
|
|
21290
21290
|
},
|
|
21291
21291
|
{
|
|
21292
21292
|
name: "ls_create_customer",
|
|
@@ -21402,10 +21402,7 @@ var discountRedemptionTools = [
|
|
|
21402
21402
|
discountRedemptionId: external_exports.string().describe("The discount redemption ID"),
|
|
21403
21403
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'discount,order')")
|
|
21404
21404
|
}),
|
|
21405
|
-
handler:
|
|
21406
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21407
|
-
return apiGet(`/discount-redemptions/${input.discountRedemptionId}${query}`);
|
|
21408
|
-
}
|
|
21405
|
+
handler: getHandler("/discount-redemptions", "discountRedemptionId")
|
|
21409
21406
|
},
|
|
21410
21407
|
{
|
|
21411
21408
|
name: "ls_list_discount_redemptions",
|
|
@@ -21424,17 +21421,7 @@ var discountRedemptionTools = [
|
|
|
21424
21421
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21425
21422
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21426
21423
|
}),
|
|
21427
|
-
handler:
|
|
21428
|
-
const filter = {};
|
|
21429
|
-
if (input.discountId) filter.discount_id = input.discountId;
|
|
21430
|
-
if (input.orderId) filter.order_id = input.orderId;
|
|
21431
|
-
const query = buildQuery({
|
|
21432
|
-
include: input.include?.split(","),
|
|
21433
|
-
filter,
|
|
21434
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21435
|
-
});
|
|
21436
|
-
return apiGet(`/discount-redemptions${query}`);
|
|
21437
|
-
}
|
|
21424
|
+
handler: listHandler("/discount-redemptions", { discountId: "discount_id", orderId: "order_id" })
|
|
21438
21425
|
}
|
|
21439
21426
|
];
|
|
21440
21427
|
|
|
@@ -21454,10 +21441,7 @@ var discountTools = [
|
|
|
21454
21441
|
discountId: external_exports.string().describe("The discount ID"),
|
|
21455
21442
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store,variants,discount-redemptions')")
|
|
21456
21443
|
}),
|
|
21457
|
-
handler:
|
|
21458
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21459
|
-
return apiGet(`/discounts/${input.discountId}${query}`);
|
|
21460
|
-
}
|
|
21444
|
+
handler: getHandler("/discounts", "discountId")
|
|
21461
21445
|
},
|
|
21462
21446
|
{
|
|
21463
21447
|
name: "ls_list_discounts",
|
|
@@ -21475,16 +21459,7 @@ var discountTools = [
|
|
|
21475
21459
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21476
21460
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21477
21461
|
}),
|
|
21478
|
-
handler:
|
|
21479
|
-
const filter = {};
|
|
21480
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
21481
|
-
const query = buildQuery({
|
|
21482
|
-
include: input.include?.split(","),
|
|
21483
|
-
filter,
|
|
21484
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21485
|
-
});
|
|
21486
|
-
return apiGet(`/discounts${query}`);
|
|
21487
|
-
}
|
|
21462
|
+
handler: listHandler("/discounts", { storeId: "store_id" })
|
|
21488
21463
|
},
|
|
21489
21464
|
{
|
|
21490
21465
|
name: "ls_create_discount",
|
|
@@ -21579,10 +21554,7 @@ var fileTools = [
|
|
|
21579
21554
|
fileId: external_exports.string().describe("The file ID"),
|
|
21580
21555
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'variant')")
|
|
21581
21556
|
}),
|
|
21582
|
-
handler:
|
|
21583
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21584
|
-
return apiGet(`/files/${input.fileId}${query}`);
|
|
21585
|
-
}
|
|
21557
|
+
handler: getHandler("/files", "fileId")
|
|
21586
21558
|
},
|
|
21587
21559
|
{
|
|
21588
21560
|
name: "ls_list_files",
|
|
@@ -21600,16 +21572,7 @@ var fileTools = [
|
|
|
21600
21572
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21601
21573
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21602
21574
|
}),
|
|
21603
|
-
handler:
|
|
21604
|
-
const filter = {};
|
|
21605
|
-
if (input.variantId) filter.variant_id = input.variantId;
|
|
21606
|
-
const query = buildQuery({
|
|
21607
|
-
include: input.include?.split(","),
|
|
21608
|
-
filter,
|
|
21609
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21610
|
-
});
|
|
21611
|
-
return apiGet(`/files${query}`);
|
|
21612
|
-
}
|
|
21575
|
+
handler: listHandler("/files", { variantId: "variant_id" })
|
|
21613
21576
|
}
|
|
21614
21577
|
];
|
|
21615
21578
|
|
|
@@ -21629,10 +21592,7 @@ var licenseKeyInstanceTools = [
|
|
|
21629
21592
|
licenseKeyInstanceId: external_exports.string().describe("The license key instance ID"),
|
|
21630
21593
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'license-key')")
|
|
21631
21594
|
}),
|
|
21632
|
-
handler:
|
|
21633
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21634
|
-
return apiGet(`/license-key-instances/${input.licenseKeyInstanceId}${query}`);
|
|
21635
|
-
}
|
|
21595
|
+
handler: getHandler("/license-key-instances", "licenseKeyInstanceId")
|
|
21636
21596
|
},
|
|
21637
21597
|
{
|
|
21638
21598
|
name: "ls_list_license_key_instances",
|
|
@@ -21650,16 +21610,7 @@ var licenseKeyInstanceTools = [
|
|
|
21650
21610
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21651
21611
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21652
21612
|
}),
|
|
21653
|
-
handler:
|
|
21654
|
-
const filter = {};
|
|
21655
|
-
if (input.licenseKeyId) filter.license_key_id = input.licenseKeyId;
|
|
21656
|
-
const query = buildQuery({
|
|
21657
|
-
include: input.include?.split(","),
|
|
21658
|
-
filter,
|
|
21659
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21660
|
-
});
|
|
21661
|
-
return apiGet(`/license-key-instances${query}`);
|
|
21662
|
-
}
|
|
21613
|
+
handler: listHandler("/license-key-instances", { licenseKeyId: "license_key_id" })
|
|
21663
21614
|
}
|
|
21664
21615
|
];
|
|
21665
21616
|
|
|
@@ -21681,10 +21632,7 @@ var licenseKeyTools = [
|
|
|
21681
21632
|
"Comma-separated related resources to include (e.g. 'store,customer,order,order-item,product,license-key-instances')"
|
|
21682
21633
|
)
|
|
21683
21634
|
}),
|
|
21684
|
-
handler:
|
|
21685
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21686
|
-
return apiGet(`/license-keys/${input.licenseKeyId}${query}`);
|
|
21687
|
-
}
|
|
21635
|
+
handler: getHandler("/license-keys", "licenseKeyId")
|
|
21688
21636
|
},
|
|
21689
21637
|
{
|
|
21690
21638
|
name: "ls_list_license_keys",
|
|
@@ -21707,19 +21655,12 @@ var licenseKeyTools = [
|
|
|
21707
21655
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21708
21656
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21709
21657
|
}),
|
|
21710
|
-
handler:
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21716
|
-
const query = buildQuery({
|
|
21717
|
-
include: input.include?.split(","),
|
|
21718
|
-
filter,
|
|
21719
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21720
|
-
});
|
|
21721
|
-
return apiGet(`/license-keys${query}`);
|
|
21722
|
-
}
|
|
21658
|
+
handler: listHandler("/license-keys", {
|
|
21659
|
+
storeId: "store_id",
|
|
21660
|
+
orderId: "order_id",
|
|
21661
|
+
orderItemId: "order_item_id",
|
|
21662
|
+
productId: "product_id"
|
|
21663
|
+
})
|
|
21723
21664
|
},
|
|
21724
21665
|
{
|
|
21725
21666
|
name: "ls_update_license_key",
|
|
@@ -21835,10 +21776,7 @@ var orderItemTools = [
|
|
|
21835
21776
|
orderItemId: external_exports.string().describe("The order item ID"),
|
|
21836
21777
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'order,product,variant')")
|
|
21837
21778
|
}),
|
|
21838
|
-
handler:
|
|
21839
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21840
|
-
return apiGet(`/order-items/${input.orderItemId}${query}`);
|
|
21841
|
-
}
|
|
21779
|
+
handler: getHandler("/order-items", "orderItemId")
|
|
21842
21780
|
},
|
|
21843
21781
|
{
|
|
21844
21782
|
name: "ls_list_order_items",
|
|
@@ -21858,18 +21796,7 @@ var orderItemTools = [
|
|
|
21858
21796
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21859
21797
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21860
21798
|
}),
|
|
21861
|
-
handler:
|
|
21862
|
-
const filter = {};
|
|
21863
|
-
if (input.orderId) filter.order_id = input.orderId;
|
|
21864
|
-
if (input.productId) filter.product_id = input.productId;
|
|
21865
|
-
if (input.variantId) filter.variant_id = input.variantId;
|
|
21866
|
-
const query = buildQuery({
|
|
21867
|
-
include: input.include?.split(","),
|
|
21868
|
-
filter,
|
|
21869
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21870
|
-
});
|
|
21871
|
-
return apiGet(`/order-items${query}`);
|
|
21872
|
-
}
|
|
21799
|
+
handler: listHandler("/order-items", { orderId: "order_id", productId: "product_id", variantId: "variant_id" })
|
|
21873
21800
|
}
|
|
21874
21801
|
];
|
|
21875
21802
|
|
|
@@ -21891,10 +21818,7 @@ var orderTools = [
|
|
|
21891
21818
|
"Comma-separated related resources to include (e.g. 'store,customer,order-items,subscriptions,license-keys,discount-redemptions')"
|
|
21892
21819
|
)
|
|
21893
21820
|
}),
|
|
21894
|
-
handler:
|
|
21895
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
21896
|
-
return apiGet(`/orders/${input.orderId}${query}`);
|
|
21897
|
-
}
|
|
21821
|
+
handler: getHandler("/orders", "orderId")
|
|
21898
21822
|
},
|
|
21899
21823
|
{
|
|
21900
21824
|
name: "ls_list_orders",
|
|
@@ -21915,17 +21839,7 @@ var orderTools = [
|
|
|
21915
21839
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
21916
21840
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
21917
21841
|
}),
|
|
21918
|
-
handler:
|
|
21919
|
-
const filter = {};
|
|
21920
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
21921
|
-
if (input.userEmail) filter.user_email = input.userEmail;
|
|
21922
|
-
const query = buildQuery({
|
|
21923
|
-
include: input.include?.split(","),
|
|
21924
|
-
filter,
|
|
21925
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
21926
|
-
});
|
|
21927
|
-
return apiGet(`/orders${query}`);
|
|
21928
|
-
}
|
|
21842
|
+
handler: listHandler("/orders", { storeId: "store_id", userEmail: "user_email" })
|
|
21929
21843
|
},
|
|
21930
21844
|
{
|
|
21931
21845
|
name: "ls_generate_order_invoice",
|
|
@@ -22000,10 +21914,7 @@ var priceTools = [
|
|
|
22000
21914
|
priceId: external_exports.string().describe("The price ID"),
|
|
22001
21915
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'variant')")
|
|
22002
21916
|
}),
|
|
22003
|
-
handler:
|
|
22004
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22005
|
-
return apiGet(`/prices/${input.priceId}${query}`);
|
|
22006
|
-
}
|
|
21917
|
+
handler: getHandler("/prices", "priceId")
|
|
22007
21918
|
},
|
|
22008
21919
|
{
|
|
22009
21920
|
name: "ls_list_prices",
|
|
@@ -22021,16 +21932,7 @@ var priceTools = [
|
|
|
22021
21932
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22022
21933
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22023
21934
|
}),
|
|
22024
|
-
handler:
|
|
22025
|
-
const filter = {};
|
|
22026
|
-
if (input.variantId) filter.variant_id = input.variantId;
|
|
22027
|
-
const query = buildQuery({
|
|
22028
|
-
include: input.include?.split(","),
|
|
22029
|
-
filter,
|
|
22030
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22031
|
-
});
|
|
22032
|
-
return apiGet(`/prices${query}`);
|
|
22033
|
-
}
|
|
21935
|
+
handler: listHandler("/prices", { variantId: "variant_id" })
|
|
22034
21936
|
}
|
|
22035
21937
|
];
|
|
22036
21938
|
|
|
@@ -22050,10 +21952,7 @@ var productTools = [
|
|
|
22050
21952
|
productId: external_exports.string().describe("The product ID"),
|
|
22051
21953
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store,variants')")
|
|
22052
21954
|
}),
|
|
22053
|
-
handler:
|
|
22054
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22055
|
-
return apiGet(`/products/${input.productId}${query}`);
|
|
22056
|
-
}
|
|
21955
|
+
handler: getHandler("/products", "productId")
|
|
22057
21956
|
},
|
|
22058
21957
|
{
|
|
22059
21958
|
name: "ls_list_products",
|
|
@@ -22071,16 +21970,7 @@ var productTools = [
|
|
|
22071
21970
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22072
21971
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22073
21972
|
}),
|
|
22074
|
-
handler:
|
|
22075
|
-
const filter = {};
|
|
22076
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
22077
|
-
const query = buildQuery({
|
|
22078
|
-
include: input.include?.split(","),
|
|
22079
|
-
filter,
|
|
22080
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22081
|
-
});
|
|
22082
|
-
return apiGet(`/products${query}`);
|
|
22083
|
-
}
|
|
21973
|
+
handler: listHandler("/products", { storeId: "store_id" })
|
|
22084
21974
|
}
|
|
22085
21975
|
];
|
|
22086
21976
|
|
|
@@ -22102,10 +21992,7 @@ var storeTools = [
|
|
|
22102
21992
|
"Comma-separated related resources to include (e.g. 'products,discounts,license-keys,subscriptions,webhooks')"
|
|
22103
21993
|
)
|
|
22104
21994
|
}),
|
|
22105
|
-
handler:
|
|
22106
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22107
|
-
return apiGet(`/stores/${input.storeId}${query}`);
|
|
22108
|
-
}
|
|
21995
|
+
handler: getHandler("/stores", "storeId")
|
|
22109
21996
|
},
|
|
22110
21997
|
{
|
|
22111
21998
|
name: "ls_list_stores",
|
|
@@ -22124,13 +22011,7 @@ var storeTools = [
|
|
|
22124
22011
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22125
22012
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22126
22013
|
}),
|
|
22127
|
-
handler:
|
|
22128
|
-
const query = buildQuery({
|
|
22129
|
-
include: input.include?.split(","),
|
|
22130
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22131
|
-
});
|
|
22132
|
-
return apiGet(`/stores${query}`);
|
|
22133
|
-
}
|
|
22014
|
+
handler: listHandler("/stores")
|
|
22134
22015
|
}
|
|
22135
22016
|
];
|
|
22136
22017
|
|
|
@@ -22150,10 +22031,7 @@ var subscriptionInvoiceTools = [
|
|
|
22150
22031
|
subscriptionInvoiceId: external_exports.string().describe("The subscription invoice ID"),
|
|
22151
22032
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store,subscription')")
|
|
22152
22033
|
}),
|
|
22153
|
-
handler:
|
|
22154
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22155
|
-
return apiGet(`/subscription-invoices/${input.subscriptionInvoiceId}${query}`);
|
|
22156
|
-
}
|
|
22034
|
+
handler: getHandler("/subscription-invoices", "subscriptionInvoiceId")
|
|
22157
22035
|
},
|
|
22158
22036
|
{
|
|
22159
22037
|
name: "ls_list_subscription_invoices",
|
|
@@ -22174,19 +22052,12 @@ var subscriptionInvoiceTools = [
|
|
|
22174
22052
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22175
22053
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22176
22054
|
}),
|
|
22177
|
-
handler:
|
|
22178
|
-
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
const query = buildQuery({
|
|
22184
|
-
include: input.include?.split(","),
|
|
22185
|
-
filter,
|
|
22186
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22187
|
-
});
|
|
22188
|
-
return apiGet(`/subscription-invoices${query}`);
|
|
22189
|
-
}
|
|
22055
|
+
handler: listHandler("/subscription-invoices", {
|
|
22056
|
+
storeId: "store_id",
|
|
22057
|
+
subscriptionId: "subscription_id",
|
|
22058
|
+
status: "status",
|
|
22059
|
+
refunded: "refunded"
|
|
22060
|
+
})
|
|
22190
22061
|
},
|
|
22191
22062
|
{
|
|
22192
22063
|
name: "ls_generate_subscription_invoice",
|
|
@@ -22265,10 +22136,7 @@ var subscriptionItemTools = [
|
|
|
22265
22136
|
subscriptionItemId: external_exports.string().describe("The subscription item ID"),
|
|
22266
22137
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'subscription,price,usage-records')")
|
|
22267
22138
|
}),
|
|
22268
|
-
handler:
|
|
22269
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22270
|
-
return apiGet(`/subscription-items/${input.subscriptionItemId}${query}`);
|
|
22271
|
-
}
|
|
22139
|
+
handler: getHandler("/subscription-items", "subscriptionItemId")
|
|
22272
22140
|
},
|
|
22273
22141
|
{
|
|
22274
22142
|
name: "ls_list_subscription_items",
|
|
@@ -22287,17 +22155,7 @@ var subscriptionItemTools = [
|
|
|
22287
22155
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22288
22156
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22289
22157
|
}),
|
|
22290
|
-
handler:
|
|
22291
|
-
const filter = {};
|
|
22292
|
-
if (input.subscriptionId) filter.subscription_id = input.subscriptionId;
|
|
22293
|
-
if (input.priceId) filter.price_id = input.priceId;
|
|
22294
|
-
const query = buildQuery({
|
|
22295
|
-
include: input.include?.split(","),
|
|
22296
|
-
filter,
|
|
22297
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22298
|
-
});
|
|
22299
|
-
return apiGet(`/subscription-items${query}`);
|
|
22300
|
-
}
|
|
22158
|
+
handler: listHandler("/subscription-items", { subscriptionId: "subscription_id", priceId: "price_id" })
|
|
22301
22159
|
},
|
|
22302
22160
|
{
|
|
22303
22161
|
name: "ls_update_subscription_item",
|
|
@@ -22360,10 +22218,7 @@ var subscriptionTools = [
|
|
|
22360
22218
|
"Comma-separated related resources to include (e.g. 'store,customer,order,order-item,product,variant,subscription-items,subscription-invoices')"
|
|
22361
22219
|
)
|
|
22362
22220
|
}),
|
|
22363
|
-
handler:
|
|
22364
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22365
|
-
return apiGet(`/subscriptions/${input.subscriptionId}${query}`);
|
|
22366
|
-
}
|
|
22221
|
+
handler: getHandler("/subscriptions", "subscriptionId")
|
|
22367
22222
|
},
|
|
22368
22223
|
{
|
|
22369
22224
|
name: "ls_list_subscriptions",
|
|
@@ -22389,22 +22244,15 @@ var subscriptionTools = [
|
|
|
22389
22244
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22390
22245
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22391
22246
|
}),
|
|
22392
|
-
handler:
|
|
22393
|
-
|
|
22394
|
-
|
|
22395
|
-
|
|
22396
|
-
|
|
22397
|
-
|
|
22398
|
-
|
|
22399
|
-
|
|
22400
|
-
|
|
22401
|
-
const query = buildQuery({
|
|
22402
|
-
include: input.include?.split(","),
|
|
22403
|
-
filter,
|
|
22404
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22405
|
-
});
|
|
22406
|
-
return apiGet(`/subscriptions${query}`);
|
|
22407
|
-
}
|
|
22247
|
+
handler: listHandler("/subscriptions", {
|
|
22248
|
+
storeId: "store_id",
|
|
22249
|
+
orderId: "order_id",
|
|
22250
|
+
orderItemId: "order_item_id",
|
|
22251
|
+
productId: "product_id",
|
|
22252
|
+
variantId: "variant_id",
|
|
22253
|
+
userEmail: "user_email",
|
|
22254
|
+
status: "status"
|
|
22255
|
+
})
|
|
22408
22256
|
},
|
|
22409
22257
|
{
|
|
22410
22258
|
name: "ls_update_subscription",
|
|
@@ -22481,10 +22329,7 @@ var usageRecordTools = [
|
|
|
22481
22329
|
usageRecordId: external_exports.string().describe("The usage record ID"),
|
|
22482
22330
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'subscription-item')")
|
|
22483
22331
|
}),
|
|
22484
|
-
handler:
|
|
22485
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22486
|
-
return apiGet(`/usage-records/${input.usageRecordId}${query}`);
|
|
22487
|
-
}
|
|
22332
|
+
handler: getHandler("/usage-records", "usageRecordId")
|
|
22488
22333
|
},
|
|
22489
22334
|
{
|
|
22490
22335
|
name: "ls_list_usage_records",
|
|
@@ -22502,16 +22347,7 @@ var usageRecordTools = [
|
|
|
22502
22347
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22503
22348
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22504
22349
|
}),
|
|
22505
|
-
handler:
|
|
22506
|
-
const filter = {};
|
|
22507
|
-
if (input.subscriptionItemId) filter.subscription_item_id = input.subscriptionItemId;
|
|
22508
|
-
const query = buildQuery({
|
|
22509
|
-
include: input.include?.split(","),
|
|
22510
|
-
filter,
|
|
22511
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22512
|
-
});
|
|
22513
|
-
return apiGet(`/usage-records${query}`);
|
|
22514
|
-
}
|
|
22350
|
+
handler: listHandler("/usage-records", { subscriptionItemId: "subscription_item_id" })
|
|
22515
22351
|
},
|
|
22516
22352
|
{
|
|
22517
22353
|
name: "ls_create_usage_record",
|
|
@@ -22583,10 +22419,7 @@ var variantTools = [
|
|
|
22583
22419
|
variantId: external_exports.string().describe("The variant ID"),
|
|
22584
22420
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'product,files')")
|
|
22585
22421
|
}),
|
|
22586
|
-
handler:
|
|
22587
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22588
|
-
return apiGet(`/variants/${input.variantId}${query}`);
|
|
22589
|
-
}
|
|
22422
|
+
handler: getHandler("/variants", "variantId")
|
|
22590
22423
|
},
|
|
22591
22424
|
{
|
|
22592
22425
|
name: "ls_list_variants",
|
|
@@ -22604,16 +22437,7 @@ var variantTools = [
|
|
|
22604
22437
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22605
22438
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22606
22439
|
}),
|
|
22607
|
-
handler:
|
|
22608
|
-
const filter = {};
|
|
22609
|
-
if (input.productId) filter.product_id = input.productId;
|
|
22610
|
-
const query = buildQuery({
|
|
22611
|
-
include: input.include?.split(","),
|
|
22612
|
-
filter,
|
|
22613
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22614
|
-
});
|
|
22615
|
-
return apiGet(`/variants${query}`);
|
|
22616
|
-
}
|
|
22440
|
+
handler: listHandler("/variants", { productId: "product_id" })
|
|
22617
22441
|
}
|
|
22618
22442
|
];
|
|
22619
22443
|
|
|
@@ -22633,10 +22457,7 @@ var webhookTools = [
|
|
|
22633
22457
|
webhookId: external_exports.string().describe("The webhook ID"),
|
|
22634
22458
|
include: external_exports.string().optional().describe("Comma-separated related resources to include (e.g. 'store')")
|
|
22635
22459
|
}),
|
|
22636
|
-
handler:
|
|
22637
|
-
const query = buildQuery({ include: input.include?.split(",") });
|
|
22638
|
-
return apiGet(`/webhooks/${input.webhookId}${query}`);
|
|
22639
|
-
}
|
|
22460
|
+
handler: getHandler("/webhooks", "webhookId")
|
|
22640
22461
|
},
|
|
22641
22462
|
{
|
|
22642
22463
|
name: "ls_list_webhooks",
|
|
@@ -22654,16 +22475,7 @@ var webhookTools = [
|
|
|
22654
22475
|
pageNumber: external_exports.number().int().min(1).optional().describe("Page number (1-indexed)"),
|
|
22655
22476
|
pageSize: external_exports.number().int().min(1).max(100).optional().describe("Results per page (1-100)")
|
|
22656
22477
|
}),
|
|
22657
|
-
handler:
|
|
22658
|
-
const filter = {};
|
|
22659
|
-
if (input.storeId) filter.store_id = input.storeId;
|
|
22660
|
-
const query = buildQuery({
|
|
22661
|
-
include: input.include?.split(","),
|
|
22662
|
-
filter,
|
|
22663
|
-
page: { number: input.pageNumber, size: input.pageSize }
|
|
22664
|
-
});
|
|
22665
|
-
return apiGet(`/webhooks${query}`);
|
|
22666
|
-
}
|
|
22478
|
+
handler: listHandler("/webhooks", { storeId: "store_id" })
|
|
22667
22479
|
},
|
|
22668
22480
|
{
|
|
22669
22481
|
name: "ls_create_webhook",
|
|
@@ -22749,7 +22561,7 @@ var webhookTools = [
|
|
|
22749
22561
|
];
|
|
22750
22562
|
|
|
22751
22563
|
// src/index.ts
|
|
22752
|
-
var version2 = true ? "0.2.
|
|
22564
|
+
var version2 = true ? "0.2.1" : (await null).createRequire(import.meta.url)("../package.json").version;
|
|
22753
22565
|
var subcommand = process.argv[2];
|
|
22754
22566
|
if (subcommand === "version" || subcommand === "--version") {
|
|
22755
22567
|
console.log(version2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yawlabs/lemonsqueezy-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "LemonSqueezy MCP server for managing your store from AI assistants",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "YawLabs <contact@yaw.sh>",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test:ci": "npm run test",
|
|
35
35
|
"lint": "biome check src/",
|
|
36
36
|
"lint:fix": "biome check --write src/",
|
|
37
|
-
"prepublishOnly": "npm run build"
|
|
37
|
+
"prepublishOnly": "npm run build && node --test dist/**/*.test.js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {},
|
|
40
40
|
"devDependencies": {
|