@henrylabs/mcp 0.10.0 → 0.12.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/README.md +11 -11
- package/filtering.d.mts +1 -0
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -0
- package/filtering.d.ts.map +1 -1
- package/filtering.js +4 -0
- package/filtering.js.map +1 -1
- package/filtering.mjs +3 -0
- package/filtering.mjs.map +1 -1
- package/package.json +3 -3
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/filtering.ts +4 -0
- package/src/server.ts +1 -1
- package/src/tools/cart/create-cart-checkout.ts +11 -4
- package/src/tools/cart/items/add-cart-items.ts +11 -4
- package/src/tools/cart/items/clear-cart-items.ts +11 -4
- package/src/tools/cart/items/list-cart-items.ts +11 -4
- package/src/tools/cart/items/remove-cart-items.ts +11 -4
- package/src/tools/checkout/session/confirm-checkout-session.ts +13 -6
- package/src/tools/checkout/session/create-checkout-session.ts +11 -4
- package/src/tools/orders/retrieve-status-orders.ts +11 -4
- package/src/tools/products/retrieve-product-details.ts +4 -11
- package/src/tools/products/search-products.ts +44 -12
- package/src/tools/types.ts +12 -0
- package/src/tools/wallet/collect-payment-details.ts +11 -4
- package/tools/cart/create-cart-checkout.d.mts.map +1 -1
- package/tools/cart/create-cart-checkout.d.ts.map +1 -1
- package/tools/cart/create-cart-checkout.js +10 -2
- package/tools/cart/create-cart-checkout.js.map +1 -1
- package/tools/cart/create-cart-checkout.mjs +12 -4
- package/tools/cart/create-cart-checkout.mjs.map +1 -1
- package/tools/cart/items/add-cart-items.d.mts.map +1 -1
- package/tools/cart/items/add-cart-items.d.ts.map +1 -1
- package/tools/cart/items/add-cart-items.js +10 -2
- package/tools/cart/items/add-cart-items.js.map +1 -1
- package/tools/cart/items/add-cart-items.mjs +12 -4
- package/tools/cart/items/add-cart-items.mjs.map +1 -1
- package/tools/cart/items/clear-cart-items.d.mts.map +1 -1
- package/tools/cart/items/clear-cart-items.d.ts.map +1 -1
- package/tools/cart/items/clear-cart-items.js +10 -2
- package/tools/cart/items/clear-cart-items.js.map +1 -1
- package/tools/cart/items/clear-cart-items.mjs +12 -4
- package/tools/cart/items/clear-cart-items.mjs.map +1 -1
- package/tools/cart/items/list-cart-items.d.mts.map +1 -1
- package/tools/cart/items/list-cart-items.d.ts.map +1 -1
- package/tools/cart/items/list-cart-items.js +10 -2
- package/tools/cart/items/list-cart-items.js.map +1 -1
- package/tools/cart/items/list-cart-items.mjs +12 -4
- package/tools/cart/items/list-cart-items.mjs.map +1 -1
- package/tools/cart/items/remove-cart-items.d.mts.map +1 -1
- package/tools/cart/items/remove-cart-items.d.ts.map +1 -1
- package/tools/cart/items/remove-cart-items.js +10 -2
- package/tools/cart/items/remove-cart-items.js.map +1 -1
- package/tools/cart/items/remove-cart-items.mjs +12 -4
- package/tools/cart/items/remove-cart-items.mjs.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.d.mts.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.d.ts.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.js +10 -2
- package/tools/checkout/session/confirm-checkout-session.js.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.mjs +12 -4
- package/tools/checkout/session/confirm-checkout-session.mjs.map +1 -1
- package/tools/checkout/session/create-checkout-session.d.mts.map +1 -1
- package/tools/checkout/session/create-checkout-session.d.ts.map +1 -1
- package/tools/checkout/session/create-checkout-session.js +10 -2
- package/tools/checkout/session/create-checkout-session.js.map +1 -1
- package/tools/checkout/session/create-checkout-session.mjs +12 -4
- package/tools/checkout/session/create-checkout-session.mjs.map +1 -1
- package/tools/orders/retrieve-status-orders.d.mts.map +1 -1
- package/tools/orders/retrieve-status-orders.d.ts.map +1 -1
- package/tools/orders/retrieve-status-orders.js +10 -2
- package/tools/orders/retrieve-status-orders.js.map +1 -1
- package/tools/orders/retrieve-status-orders.mjs +12 -4
- package/tools/orders/retrieve-status-orders.mjs.map +1 -1
- package/tools/products/retrieve-product-details.d.mts.map +1 -1
- package/tools/products/retrieve-product-details.d.ts.map +1 -1
- package/tools/products/retrieve-product-details.js +4 -10
- package/tools/products/retrieve-product-details.js.map +1 -1
- package/tools/products/retrieve-product-details.mjs +4 -10
- package/tools/products/retrieve-product-details.mjs.map +1 -1
- package/tools/products/search-products.d.mts.map +1 -1
- package/tools/products/search-products.d.ts.map +1 -1
- package/tools/products/search-products.js +43 -10
- package/tools/products/search-products.js.map +1 -1
- package/tools/products/search-products.mjs +45 -12
- package/tools/products/search-products.mjs.map +1 -1
- package/tools/types.d.mts +1 -0
- package/tools/types.d.mts.map +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +12 -0
- package/tools/types.js.map +1 -1
- package/tools/types.mjs +11 -0
- package/tools/types.mjs.map +1 -1
- package/tools/wallet/collect-payment-details.d.mts.map +1 -1
- package/tools/wallet/collect-payment-details.d.ts.map +1 -1
- package/tools/wallet/collect-payment-details.js +10 -2
- package/tools/wallet/collect-payment-details.js.map +1 -1
- package/tools/wallet/collect-payment-details.mjs +12 -4
- package/tools/wallet/collect-payment-details.mjs.map +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'products',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/products/search',
|
|
15
15
|
operationId: 'searchProducts',
|
|
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
|
|
|
18
18
|
export const tool: Tool = {
|
|
19
19
|
name: 'search_products',
|
|
20
20
|
description:
|
|
21
|
-
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n pagination: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string'\n },\n previousCursor: {\n type: 'string'\n }\n },\n required: [ 'nextCursor',\n 'previousCursor'\n ]\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'pagination',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
22
|
inputSchema: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
properties: {
|
|
@@ -28,15 +28,23 @@ export const tool: Tool = {
|
|
|
28
28
|
},
|
|
29
29
|
color: {
|
|
30
30
|
type: 'string',
|
|
31
|
-
description: '
|
|
31
|
+
description: '[Deprecated] Filter results by color',
|
|
32
|
+
},
|
|
33
|
+
cursor: {
|
|
34
|
+
type: 'integer',
|
|
35
|
+
description: 'Cursor returned from the previous response (SerpAPI start param)',
|
|
36
|
+
},
|
|
37
|
+
freeShipping: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
description: 'Restrict results to listings with free shipping',
|
|
32
40
|
},
|
|
33
41
|
gender: {
|
|
34
42
|
type: 'string',
|
|
35
|
-
description: '
|
|
43
|
+
description: '[Deprecated] Filter results by gender',
|
|
36
44
|
},
|
|
37
45
|
greaterThanPrice: {
|
|
38
46
|
type: 'number',
|
|
39
|
-
description: '
|
|
47
|
+
description: '[Deprecated] Alias for minPrice. Maintained for backwards compatibility.',
|
|
40
48
|
},
|
|
41
49
|
limit: {
|
|
42
50
|
type: 'integer',
|
|
@@ -44,19 +52,36 @@ export const tool: Tool = {
|
|
|
44
52
|
},
|
|
45
53
|
lowerThanPrice: {
|
|
46
54
|
type: 'number',
|
|
47
|
-
description: '
|
|
55
|
+
description: '[Deprecated] Alias for maxPrice. Maintained for backwards compatibility.',
|
|
48
56
|
},
|
|
49
57
|
manufacturer: {
|
|
50
58
|
type: 'string',
|
|
51
|
-
description: '
|
|
59
|
+
description: '[Deprecated] Filter results by manufacturer',
|
|
60
|
+
},
|
|
61
|
+
maxPrice: {
|
|
62
|
+
type: 'number',
|
|
63
|
+
description: 'Maximum price filter',
|
|
64
|
+
},
|
|
65
|
+
minPrice: {
|
|
66
|
+
type: 'number',
|
|
67
|
+
description: 'Minimum price filter',
|
|
52
68
|
},
|
|
53
69
|
region: {
|
|
54
70
|
type: 'string',
|
|
55
|
-
description: 'Region',
|
|
71
|
+
description: '[Deprecated] Region filter (defaults to `us`).',
|
|
56
72
|
},
|
|
57
73
|
size: {
|
|
58
74
|
type: 'string',
|
|
59
|
-
description: '
|
|
75
|
+
description: '[Deprecated] Filter results by size',
|
|
76
|
+
},
|
|
77
|
+
smallBusiness: {
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
description: 'Restrict results to merchants labeled as small business',
|
|
80
|
+
},
|
|
81
|
+
sortBy: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Sort order: 1 = price low→high, 2 = price high→low',
|
|
84
|
+
enum: [1, 2],
|
|
60
85
|
},
|
|
61
86
|
jq_filter: {
|
|
62
87
|
type: 'string',
|
|
@@ -72,7 +97,14 @@ export const tool: Tool = {
|
|
|
72
97
|
|
|
73
98
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
74
99
|
const { jq_filter, ...body } = args as any;
|
|
75
|
-
|
|
100
|
+
try {
|
|
101
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.products.search(body)));
|
|
102
|
+
} catch (error) {
|
|
103
|
+
if (isJqError(error)) {
|
|
104
|
+
return asErrorResult(error.message);
|
|
105
|
+
}
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
76
108
|
};
|
|
77
109
|
|
|
78
110
|
export default { metadata, tool, handler };
|
package/src/tools/types.ts
CHANGED
|
@@ -87,6 +87,18 @@ export async function asBinaryContentResult(response: Response): Promise<ToolCal
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export function asErrorResult(message: string): ToolCallResult {
|
|
91
|
+
return {
|
|
92
|
+
content: [
|
|
93
|
+
{
|
|
94
|
+
type: 'text',
|
|
95
|
+
text: message,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
isError: true,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
90
102
|
export type Metadata = {
|
|
91
103
|
resource: string;
|
|
92
104
|
operation: 'read' | 'write';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'wallet',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/wallet/card-collect',
|
|
15
15
|
operationId: 'initiateCardCollect',
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.wallet.createCardCollection(body)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.d.mts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.d.mts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.d.ts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.d.ts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAwBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -7,7 +7,7 @@ const types_1 = require("@henrylabs/mcp/tools/types");
|
|
|
7
7
|
exports.metadata = {
|
|
8
8
|
resource: 'cart',
|
|
9
9
|
operation: 'write',
|
|
10
|
-
tags: [
|
|
10
|
+
tags: [],
|
|
11
11
|
httpMethod: 'post',
|
|
12
12
|
httpPath: '/cart/checkout',
|
|
13
13
|
operationId: 'createHostedCheckoutPage',
|
|
@@ -37,7 +37,15 @@ exports.tool = {
|
|
|
37
37
|
};
|
|
38
38
|
const handler = async (client, args) => {
|
|
39
39
|
const { jq_filter, ...body } = args;
|
|
40
|
-
|
|
40
|
+
try {
|
|
41
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.createCheckout(body)));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
45
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
41
49
|
};
|
|
42
50
|
exports.handler = handler;
|
|
43
51
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,6hDAA6hD;IAC/hD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iEAAiE;aAC/E;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'cart',
|
|
6
6
|
operation: 'write',
|
|
7
|
-
tags: [
|
|
7
|
+
tags: [],
|
|
8
8
|
httpMethod: 'post',
|
|
9
9
|
httpPath: '/cart/checkout',
|
|
10
10
|
operationId: 'createHostedCheckoutPage',
|
|
@@ -34,7 +34,15 @@ export const tool = {
|
|
|
34
34
|
};
|
|
35
35
|
export const handler = async (client, args) => {
|
|
36
36
|
const { jq_filter, ...body } = args;
|
|
37
|
-
|
|
37
|
+
try {
|
|
38
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (isJqError(error)) {
|
|
42
|
+
return asErrorResult(error.message);
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
38
46
|
};
|
|
39
47
|
export default { metadata, tool, handler };
|
|
40
48
|
//# sourceMappingURL=create-cart-checkout.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,6hDAA6hD;IAC/hD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iEAAiE;aAC/E;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"add-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"add-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAoElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -7,7 +7,7 @@ const types_1 = require("@henrylabs/mcp/tools/types");
|
|
|
7
7
|
exports.metadata = {
|
|
8
8
|
resource: 'cart.items',
|
|
9
9
|
operation: 'write',
|
|
10
|
-
tags: ['
|
|
10
|
+
tags: ['hosted'],
|
|
11
11
|
httpMethod: 'post',
|
|
12
12
|
httpPath: '/cart/items',
|
|
13
13
|
operationId: 'addCartItems',
|
|
@@ -79,7 +79,15 @@ exports.tool = {
|
|
|
79
79
|
};
|
|
80
80
|
const handler = async (client, args) => {
|
|
81
81
|
const { jq_filter, ...body } = args;
|
|
82
|
-
|
|
82
|
+
try {
|
|
83
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.add(body)));
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
87
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
88
|
+
}
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
83
91
|
};
|
|
84
92
|
exports.handler = handler;
|
|
85
93
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"add-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8oJAA8oJ;IAChpJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,eAAe;yBAC7B;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BAC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AS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'cart.items',
|
|
6
6
|
operation: 'write',
|
|
7
|
-
tags: ['
|
|
7
|
+
tags: ['hosted'],
|
|
8
8
|
httpMethod: 'post',
|
|
9
9
|
httpPath: '/cart/items',
|
|
10
10
|
operationId: 'addCartItems',
|
|
@@ -76,7 +76,15 @@ export const tool = {
|
|
|
76
76
|
};
|
|
77
77
|
export const handler = async (client, args) => {
|
|
78
78
|
const { jq_filter, ...body } = args;
|
|
79
|
-
|
|
79
|
+
try {
|
|
80
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (isJqError(error)) {
|
|
84
|
+
return asErrorResult(error.message);
|
|
85
|
+
}
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
80
88
|
};
|
|
81
89
|
export default { metadata, tool, handler };
|
|
82
90
|
//# sourceMappingURL=add-cart-items.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"add-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8oJAA8oJ;IAChpJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,eAAe;yBAC7B;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,UAAU;yBACxB;wBACD,oBAAoB,EAAE;4BACpB,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,iGAAiG;yBACpG;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,W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
-
{"version":3,"file":"clear-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"clear-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"clear-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -7,7 +7,7 @@ const types_1 = require("@henrylabs/mcp/tools/types");
|
|
|
7
7
|
exports.metadata = {
|
|
8
8
|
resource: 'cart.items',
|
|
9
9
|
operation: 'write',
|
|
10
|
-
tags: ['
|
|
10
|
+
tags: ['hosted'],
|
|
11
11
|
httpMethod: 'delete',
|
|
12
12
|
httpPath: '/cart/items',
|
|
13
13
|
operationId: 'deleteAllCartItems',
|
|
@@ -35,7 +35,15 @@ exports.tool = {
|
|
|
35
35
|
};
|
|
36
36
|
const handler = async (client, args) => {
|
|
37
37
|
const { jq_filter, ...body } = args;
|
|
38
|
-
|
|
38
|
+
try {
|
|
39
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.clear(body)));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
43
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
39
47
|
};
|
|
40
48
|
exports.handler = handler;
|
|
41
49
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"clear-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAA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{ maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'cart.items',
|
|
6
6
|
operation: 'write',
|
|
7
|
-
tags: ['
|
|
7
|
+
tags: ['hosted'],
|
|
8
8
|
httpMethod: 'delete',
|
|
9
9
|
httpPath: '/cart/items',
|
|
10
10
|
operationId: 'deleteAllCartItems',
|
|
@@ -32,7 +32,15 @@ export const tool = {
|
|
|
32
32
|
};
|
|
33
33
|
export const handler = async (client, args) => {
|
|
34
34
|
const { jq_filter, ...body } = args;
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (isJqError(error)) {
|
|
40
|
+
return asErrorResult(error.message);
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
36
44
|
};
|
|
37
45
|
export default { metadata, tool, handler };
|
|
38
46
|
//# sourceMappingURL=clear-cart-items.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"clear-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;I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tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"list-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"list-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -7,7 +7,7 @@ const types_1 = require("@henrylabs/mcp/tools/types");
|
|
|
7
7
|
exports.metadata = {
|
|
8
8
|
resource: 'cart.items',
|
|
9
9
|
operation: 'read',
|
|
10
|
-
tags: ['
|
|
10
|
+
tags: ['hosted'],
|
|
11
11
|
httpMethod: 'get',
|
|
12
12
|
httpPath: '/cart/items',
|
|
13
13
|
operationId: 'getCartItems',
|
|
@@ -35,7 +35,15 @@ exports.tool = {
|
|
|
35
35
|
};
|
|
36
36
|
const handler = async (client, args) => {
|
|
37
37
|
const { jq_filter, ...body } = args;
|
|
38
|
-
|
|
38
|
+
try {
|
|
39
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.list(body)));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
43
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
39
47
|
};
|
|
40
48
|
exports.handler = handler;
|
|
41
49
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"list-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,ytFAAytF;IAC3tF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'cart.items',
|
|
6
6
|
operation: 'read',
|
|
7
|
-
tags: ['
|
|
7
|
+
tags: ['hosted'],
|
|
8
8
|
httpMethod: 'get',
|
|
9
9
|
httpPath: '/cart/items',
|
|
10
10
|
operationId: 'getCartItems',
|
|
@@ -32,7 +32,15 @@ export const tool = {
|
|
|
32
32
|
};
|
|
33
33
|
export const handler = async (client, args) => {
|
|
34
34
|
const { jq_filter, ...body } = args;
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.list(body)));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (isJqError(error)) {
|
|
40
|
+
return asErrorResult(error.message);
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
36
44
|
};
|
|
37
45
|
export default { metadata, tool, handler };
|
|
38
46
|
//# sourceMappingURL=list-cart-items.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"list-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,ytFAAytF;IAC3tF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"remove-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAyBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"remove-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAyBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -7,7 +7,7 @@ const types_1 = require("@henrylabs/mcp/tools/types");
|
|
|
7
7
|
exports.metadata = {
|
|
8
8
|
resource: 'cart.items',
|
|
9
9
|
operation: 'write',
|
|
10
|
-
tags: ['
|
|
10
|
+
tags: ['hosted'],
|
|
11
11
|
httpMethod: 'delete',
|
|
12
12
|
httpPath: '/cart/items/{productId}',
|
|
13
13
|
operationId: 'deleteCartItem',
|
|
@@ -38,7 +38,15 @@ exports.tool = {
|
|
|
38
38
|
};
|
|
39
39
|
const handler = async (client, args) => {
|
|
40
40
|
const { productId, jq_filter, ...body } = args;
|
|
41
|
-
|
|
41
|
+
try {
|
|
42
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.remove(productId, body)));
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
46
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
42
50
|
};
|
|
43
51
|
exports.handler = handler;
|
|
44
52
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"remove-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/remove-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,yBAAyB;IACnC,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACT,6wBAA6wB;IAC/wB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;KACrC;IACD,WAAW,EAAE;QACX,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IACtD,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'cart.items',
|
|
6
6
|
operation: 'write',
|
|
7
|
-
tags: ['
|
|
7
|
+
tags: ['hosted'],
|
|
8
8
|
httpMethod: 'delete',
|
|
9
9
|
httpPath: '/cart/items/{productId}',
|
|
10
10
|
operationId: 'deleteCartItem',
|
|
@@ -35,7 +35,15 @@ export const tool = {
|
|
|
35
35
|
};
|
|
36
36
|
export const handler = async (client, args) => {
|
|
37
37
|
const { productId, jq_filter, ...body } = args;
|
|
38
|
-
|
|
38
|
+
try {
|
|
39
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.remove(productId, body)));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (isJqError(error)) {
|
|
43
|
+
return asErrorResult(error.message);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
39
47
|
};
|
|
40
48
|
export default { metadata, tool, handler };
|
|
41
49
|
//# sourceMappingURL=remove-cart-items.mjs.map
|