@unchainedshop/api 4.0.0-rc.5 → 4.0.0-rc.6
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/lib/errors.d.ts +1 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -0
- package/lib/errors.js.map +1 -1
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.js +2 -1
- package/lib/mcp/tools/assortment/addAssortmentMediaUploadHandler.js.map +1 -1
- package/lib/mcp/tools/assortment/assortmentMediaHandler.d.ts +32 -0
- package/lib/mcp/tools/assortment/assortmentMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/assortment/assortmentMediaHandler.js +48 -0
- package/lib/mcp/tools/assortment/assortmentMediaHandler.js.map +1 -0
- package/lib/mcp/tools/assortment/index.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/index.js +3 -1
- package/lib/mcp/tools/assortment/index.js.map +1 -1
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.js +3 -1
- package/lib/mcp/tools/assortment/removeAssortmentMediaHandler.js.map +1 -1
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.js +2 -2
- package/lib/mcp/tools/assortment/reorderAssortmentMediaHandler.js.map +1 -1
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.js +7 -1
- package/lib/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.js.map +1 -1
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.d.ts.map +1 -1
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.js +4 -1
- package/lib/mcp/tools/assortment/updateAssortmentMediaTextsHandler.js.map +1 -1
- package/lib/mcp/tools/product/addProductAssignmentHandler.d.ts.map +1 -1
- package/lib/mcp/tools/product/addProductAssignmentHandler.js +1 -1
- package/lib/mcp/tools/product/addProductAssignmentHandler.js.map +1 -1
- package/lib/mcp/tools/product/addProductBundleItemHandler.d.ts +48 -0
- package/lib/mcp/tools/product/addProductBundleItemHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/addProductBundleItemHandler.js +52 -0
- package/lib/mcp/tools/product/addProductBundleItemHandler.js.map +1 -0
- package/lib/mcp/tools/product/addProductMediaUploadHandler.d.ts.map +1 -1
- package/lib/mcp/tools/product/addProductMediaUploadHandler.js +3 -2
- package/lib/mcp/tools/product/addProductMediaUploadHandler.js.map +1 -1
- package/lib/mcp/tools/product/catalogPriceHandler.d.ts +28 -0
- package/lib/mcp/tools/product/catalogPriceHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/catalogPriceHandler.js +57 -0
- package/lib/mcp/tools/product/catalogPriceHandler.js.map +1 -0
- package/lib/mcp/tools/product/index.d.ts.map +1 -1
- package/lib/mcp/tools/product/index.js +27 -3
- package/lib/mcp/tools/product/index.js.map +1 -1
- package/lib/mcp/tools/product/productAssignmentsHandler.d.ts +24 -0
- package/lib/mcp/tools/product/productAssignmentsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productAssignmentsHandler.js +79 -0
- package/lib/mcp/tools/product/productAssignmentsHandler.js.map +1 -0
- package/lib/mcp/tools/product/productBundleItemsHandler.d.ts +20 -0
- package/lib/mcp/tools/product/productBundleItemsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productBundleItemsHandler.js +45 -0
- package/lib/mcp/tools/product/productBundleItemsHandler.js.map +1 -0
- package/lib/mcp/tools/product/productMediaHandler.d.ts +32 -0
- package/lib/mcp/tools/product/productMediaHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productMediaHandler.js +46 -0
- package/lib/mcp/tools/product/productMediaHandler.js.map +1 -0
- package/lib/mcp/tools/product/productSiblingsHandler.d.ts +36 -0
- package/lib/mcp/tools/product/productSiblingsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productSiblingsHandler.js +66 -0
- package/lib/mcp/tools/product/productSiblingsHandler.js.map +1 -0
- package/lib/mcp/tools/product/productVariationsHandler.d.ts +20 -0
- package/lib/mcp/tools/product/productVariationsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/productVariationsHandler.js +47 -0
- package/lib/mcp/tools/product/productVariationsHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductBundleItemHandler.d.ts +24 -0
- package/lib/mcp/tools/product/removeProductBundleItemHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/removeProductBundleItemHandler.js +46 -0
- package/lib/mcp/tools/product/removeProductBundleItemHandler.js.map +1 -0
- package/lib/mcp/tools/product/removeProductMediaHandler.js +1 -1
- package/lib/mcp/tools/product/removeProductMediaHandler.js.map +1 -1
- package/lib/mcp/tools/product/reorderProductMediaHandler.js +2 -2
- package/lib/mcp/tools/product/reorderProductMediaHandler.js.map +1 -1
- package/lib/mcp/tools/product/simulatedPriceHandler.d.ts +70 -0
- package/lib/mcp/tools/product/simulatedPriceHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/simulatedPriceHandler.js +74 -0
- package/lib/mcp/tools/product/simulatedPriceHandler.js.map +1 -0
- package/lib/mcp/tools/product/simulatedPriceRangeHandler.d.ts +74 -0
- package/lib/mcp/tools/product/simulatedPriceRangeHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/simulatedPriceRangeHandler.js +103 -0
- package/lib/mcp/tools/product/simulatedPriceRangeHandler.js.map +1 -0
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.d.ts.map +1 -1
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.js +7 -1
- package/lib/mcp/tools/product/translatedProductMediaTextsHandler.js.map +1 -1
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.d.ts.map +1 -1
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.js +7 -1
- package/lib/mcp/tools/product/translatedProductVariationTextsHandler.js.map +1 -1
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.js +1 -1
- package/lib/mcp/tools/product/updateProductMediaTextsHandler.js.map +1 -1
- package/lib/mcp/tools/product/updateProductPlanHandler.d.ts +47 -26
- package/lib/mcp/tools/product/updateProductPlanHandler.d.ts.map +1 -1
- package/lib/mcp/tools/product/updateProductPlanHandler.js +23 -7
- package/lib/mcp/tools/product/updateProductPlanHandler.js.map +1 -1
- package/lib/mcp/tools/product/updateProductVariationTextsHandler.d.ts +73 -0
- package/lib/mcp/tools/product/updateProductVariationTextsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/updateProductVariationTextsHandler.js +52 -0
- package/lib/mcp/tools/product/updateProductVariationTextsHandler.js.map +1 -0
- package/lib/mcp/tools/product/variationProductsHandler.d.ts +52 -0
- package/lib/mcp/tools/product/variationProductsHandler.d.ts.map +1 -0
- package/lib/mcp/tools/product/variationProductsHandler.js +54 -0
- package/lib/mcp/tools/product/variationProductsHandler.js.map +1 -0
- package/lib/mcp/tools/shopInfoHandler.d.ts.map +1 -1
- package/lib/mcp/tools/shopInfoHandler.js +4 -2
- package/lib/mcp/tools/shopInfoHandler.js.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js +25 -0
- package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.d.ts.map +1 -1
- package/lib/resolvers/mutations/filters/createFilter.js +14 -5
- package/lib/resolvers/mutations/filters/createFilter.js.map +1 -1
- package/lib/schema/types/product/bundle-product.js +1 -1
- package/package.json +6 -6
- package/src/errors.ts +5 -0
- package/src/mcp/tools/assortment/addAssortmentMediaUploadHandler.ts +2 -1
- package/src/mcp/tools/assortment/assortmentMediaHandler.ts +57 -0
- package/src/mcp/tools/assortment/index.ts +9 -1
- package/src/mcp/tools/assortment/removeAssortmentMediaHandler.ts +3 -1
- package/src/mcp/tools/assortment/reorderAssortmentMediaHandler.ts +2 -2
- package/src/mcp/tools/assortment/translatedAssortmentMediaTextsHandler.ts +8 -1
- package/src/mcp/tools/assortment/updateAssortmentMediaTextsHandler.ts +4 -1
- package/src/mcp/tools/product/addProductAssignmentHandler.ts +3 -1
- package/src/mcp/tools/product/addProductBundleItemHandler.ts +64 -0
- package/src/mcp/tools/product/addProductMediaUploadHandler.ts +3 -2
- package/src/mcp/tools/product/catalogPriceHandler.ts +61 -0
- package/src/mcp/tools/product/index.ts +104 -3
- package/src/mcp/tools/product/productAssignmentsHandler.ts +86 -0
- package/src/mcp/tools/product/productBundleItemsHandler.ts +50 -0
- package/src/mcp/tools/product/productMediaHandler.ts +53 -0
- package/src/mcp/tools/product/productSiblingsHandler.ts +82 -0
- package/src/mcp/tools/product/productVariationsHandler.ts +53 -0
- package/src/mcp/tools/product/removeProductBundleItemHandler.ts +55 -0
- package/src/mcp/tools/product/removeProductMediaHandler.ts +1 -1
- package/src/mcp/tools/product/reorderProductMediaHandler.ts +2 -2
- package/src/mcp/tools/product/simulatedPriceHandler.ts +82 -0
- package/src/mcp/tools/product/simulatedPriceRangeHandler.ts +126 -0
- package/src/mcp/tools/product/translatedProductMediaTextsHandler.ts +6 -2
- package/src/mcp/tools/product/translatedProductVariationTextsHandler.ts +6 -1
- package/src/mcp/tools/product/updateProductMediaTextsHandler.ts +1 -1
- package/src/mcp/tools/product/updateProductPlanHandler.ts +37 -7
- package/src/mcp/tools/product/updateProductVariationTextsHandler.ts +65 -0
- package/src/mcp/tools/product/variationProductsHandler.ts +61 -0
- package/src/mcp/tools/shopInfoHandler.ts +4 -2
- package/src/mcp/utils/getNormalizedProductDetails.ts +28 -0
- package/src/resolvers/mutations/filters/createFilter.ts +11 -6
- package/src/schema/types/product/bundle-product.ts +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const CatalogPriceSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
currencyCode: z.ZodOptional<z.ZodString>;
|
|
7
|
+
};
|
|
8
|
+
export declare const CatalogPriceZodSchema: z.ZodObject<{
|
|
9
|
+
productId: z.ZodString;
|
|
10
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
currencyCode: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
productId?: string;
|
|
14
|
+
currencyCode?: string;
|
|
15
|
+
quantity?: number;
|
|
16
|
+
}, {
|
|
17
|
+
productId?: string;
|
|
18
|
+
currencyCode?: string;
|
|
19
|
+
quantity?: number;
|
|
20
|
+
}>;
|
|
21
|
+
export type CatalogPriceParams = z.infer<typeof CatalogPriceZodSchema>;
|
|
22
|
+
export declare function catalogPriceHandler(context: Context, params: CatalogPriceParams): Promise<{
|
|
23
|
+
content: {
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
//# sourceMappingURL=catalogPriceHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogPriceHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/catalogPriceHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;CAY9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAA+B,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB;;;;;GAqCrF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ProductNotFoundError } from '../../../errors.js';
|
|
2
|
+
import { getNormalizedProductDetails } from '../../utils/getNormalizedProductDetails.js';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const CatalogPriceSchema = {
|
|
6
|
+
productId: z.string().min(1).describe('ID of the product to retrieve catalog price for'),
|
|
7
|
+
quantity: z
|
|
8
|
+
.number()
|
|
9
|
+
.int()
|
|
10
|
+
.positive()
|
|
11
|
+
.default(1)
|
|
12
|
+
.describe('Quantity to calculate catalog price for (default is 1)'),
|
|
13
|
+
currencyCode: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Optional currency code (e.g., "USD") for price calculation'),
|
|
17
|
+
};
|
|
18
|
+
export const CatalogPriceZodSchema = z.object(CatalogPriceSchema);
|
|
19
|
+
export async function catalogPriceHandler(context, params) {
|
|
20
|
+
const { productId, quantity, currencyCode: forcedCurrencyCode } = params;
|
|
21
|
+
const { modules, countryCode, currencyCode: defaultCurrencyCode, userId } = context;
|
|
22
|
+
try {
|
|
23
|
+
log('handler catalogPriceHandler', { userId, params });
|
|
24
|
+
const product = await getNormalizedProductDetails(productId, context);
|
|
25
|
+
if (!product)
|
|
26
|
+
throw new ProductNotFoundError({ productId });
|
|
27
|
+
const currencyCode = forcedCurrencyCode || defaultCurrencyCode;
|
|
28
|
+
const catalogPrice = await modules.products.prices.price(product, {
|
|
29
|
+
countryCode,
|
|
30
|
+
currencyCode,
|
|
31
|
+
quantity,
|
|
32
|
+
});
|
|
33
|
+
const leveledCatalogPrice = await modules.products.prices.catalogPricesLeveled(product, {
|
|
34
|
+
currencyCode,
|
|
35
|
+
countryCode,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: 'text',
|
|
41
|
+
text: JSON.stringify({ product, price: catalogPrice, leveledCatalogPrice }),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: `Error retrieving catalog price: ${error.message}`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=catalogPriceHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogPriceHandler.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/catalogPriceHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IACxF,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,OAAO,CAAC,CAAC,CAAC;SACV,QAAQ,CAAC,wDAAwD,CAAC;IACrE,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;CAC1E,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAGlE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAgB,EAAE,MAA0B;IACpF,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE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AAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA8F9C,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,EAAE,SAAS,OAAO,SAqRvE,CAAC"}
|
|
@@ -27,6 +27,18 @@ import { productReviewsHandler, ProductReviewsSchema } from './productReviewsHan
|
|
|
27
27
|
import { translatedProductTextsHandler, TranslatedProductTextsSchema, } from './translatedProductTextsHandler.js';
|
|
28
28
|
import { translatedProductMediaTextsHandler, TranslatedProductMediaTextsSchema, } from './translatedProductMediaTextsHandler.js';
|
|
29
29
|
import { translatedProductVariationTextsHandler, TranslatedProductVariationTextsSchema, } from './translatedProductVariationTextsHandler.js';
|
|
30
|
+
import { updateProductVariationTextsHandler, UpdateProductVariationTextsSchema, } from './updateProductVariationTextsHandler.js';
|
|
31
|
+
import { productSiblingsHandler, ProductSiblingsSchema } from './productSiblingsHandler.js';
|
|
32
|
+
import { productMediaHandler, ProductMediaSchema } from './productMediaHandler.js';
|
|
33
|
+
import { variationProductsHandler, VariationProductsSchema } from './variationProductsHandler.js';
|
|
34
|
+
import { productVariationsHandler, ProductVariationsSchema } from './productVariationsHandler.js';
|
|
35
|
+
import { addProductBundleItemHandler, AddProductBundleItemSchema, } from './addProductBundleItemHandler.js';
|
|
36
|
+
import { removeProductBundleItemHandler, RemoveProductBundleItemSchema, } from './removeProductBundleItemHandler.js';
|
|
37
|
+
import { productAssignmentsHandler, ProductAssignmentsSchema } from './productAssignmentsHandler.js';
|
|
38
|
+
import { productBundleItemsHandler, ProductBundleItemsSchema } from './productBundleItemsHandler.js';
|
|
39
|
+
import { simulatedPriceRangeHandler, SimulatedPriceRangeSchema } from './simulatedPriceRangeHandler.js';
|
|
40
|
+
import { simulatedPriceHandler, SimulatedPriceSchema } from './simulatedPriceHandler.js';
|
|
41
|
+
import { catalogPriceHandler, CatalogPriceSchema } from './catalogPriceHandler.js';
|
|
30
42
|
export const registerProductTools = (server, context) => {
|
|
31
43
|
server.tool('product_list', 'List products filtered by tags, slugs, or query string; supports pagination and sorting.', ProductsListSchema, async (params) => productsListHandler(context, params));
|
|
32
44
|
server.tool('product_count', 'Count products filtered by tags, slugs, draft status, or query string.', ProductsCountSchema, async (params) => productsCountHandler(context, params));
|
|
@@ -41,21 +53,33 @@ export const registerProductTools = (server, context) => {
|
|
|
41
53
|
server.tool('product_updateWarehousing', 'Update warehousing details (SKU, base unit) for a SIMPLE_PRODUCT type product', UpdateProductWarehousingSchema, async (params) => updateProductWarehousingHandler(context, params));
|
|
42
54
|
server.tool('product_updateSupply', 'Update the supply (delivery) details for a SIMPLE_PRODUCT type product', UpdateProductSupplySchema, async (params) => updateProductSupplyHandler(context, params));
|
|
43
55
|
server.tool('product_updateTokenization', 'Update tokenization details for a TOKENIZED_PRODUCT type product', UpdateProductTokenizationSchema, async (params) => updateProductTokenizationHandler(context, params));
|
|
44
|
-
server.tool('product_updatePlan', 'Update the plan
|
|
56
|
+
server.tool('product_updatePlan', 'Update the subscription plan configuration for a product of type PLAN. This includes usage calculation type (LICENSED or METERED), billing interval settings, and optional trial period configuration. This operation is only valid for products with type PLAN_PRODUCT.', UpdateProductPlanSchema, async (params) => updateProductPlanHandler(context, params));
|
|
45
57
|
server.tool('product_createVariation', 'Create a variation for a CONFIGURABLE_PRODUCT product including localized texts.', CreateProductVariationSchema, async (params) => createProductVariationHandler(context, params));
|
|
46
58
|
server.tool('productVariation_remove', 'Remove a product variation by its ID.', RemoveProductVariationSchema, async (params) => removeProductVariationHandler(context, params));
|
|
47
|
-
server.tool('product_assignVariation', 'Assign a product variant to a configurable product with a unique combination of
|
|
59
|
+
server.tool('product_assignVariation', 'Assign a product variant to a configurable product with a unique combination of option vectors. assigning with incomplete vector will fail. make sure all variation options are selected before calling this tool.', AssignProductVariationSchema, async (params) => addProductAssignmentHandler(context, params));
|
|
48
60
|
server.tool('product_createVariationOption', 'Create a new option for a product variation with localized titles and subtitles.', CreateProductVariationOptionSchema, async (params) => createProductVariationOptionHandler(context, params));
|
|
49
61
|
server.tool('productVariationOption_remove', 'Remove an option from a product variation by its value.', RemoveProductVariationOptionSchema, async (params) => removeProductVariationOptionHandler(context, params));
|
|
50
62
|
server.tool('product_removeAssignment', 'Remove a product variant assignment from a configurable product using attribute vectors.', RemoveProductAssignmentSchema, async (params) => removeProductAssignmentHandler(context, params));
|
|
51
63
|
server.tool('product_addMedia', 'Add a media asset to a product from a publicly accessible URL', AddProductMediaUploadSchema, async (params) => addProductMediaUploadHandler(context, params));
|
|
52
64
|
server.tool('productMedia_remove', 'Remove a product media asset by its ID.', RemoveProductMediaSchema, async (params) => removeProductMediaHandler(context, params));
|
|
53
65
|
server.tool('productMedia_updateTexts', 'Update localized texts (title, subtitle) of a product media asset.', UpdateProductMediaTextsSchema, async (params) => updateProductMediaTextsHandler(context, params));
|
|
54
|
-
server.tool('
|
|
66
|
+
server.tool('product_reorderMedias', 'Reorder media assets of a product by providing new sort keys.', ReorderProductMediaSchema, async (params) => reorderProductMediaHandler(context, params));
|
|
55
67
|
server.tool('productReviews_count', 'Count product reviews optionally filtered by query string.', ProductReviewsCountSchema, async (params) => productReviewsCountHandler(context, params));
|
|
56
68
|
server.tool('productReviews_list', 'Retrieve a paginated list of product reviews with optional filtering and sorting.', ProductReviewsSchema, async (params) => productReviewsHandler(context, params));
|
|
57
69
|
server.tool('product_getTexts', 'Retrieve translated texts associated with a specific product_', TranslatedProductTextsSchema, async (params) => translatedProductTextsHandler(context, params));
|
|
58
70
|
server.tool('productMedia_getTexts', 'Retrieve translated texts associated with a specific product media asset.', TranslatedProductMediaTextsSchema, async (params) => translatedProductMediaTextsHandler(context, params));
|
|
59
71
|
server.tool('productVariation_getTexts', 'Retrieve translated texts for a product variation or optionally a specific variation option.', TranslatedProductVariationTextsSchema, async (params) => translatedProductVariationTextsHandler(context, params));
|
|
72
|
+
server.tool('productVariation_updateTexts', 'Update product variation texts with the specified locales for product variations that match the provided variation ID and production option value.', UpdateProductVariationTextsSchema, async (params) => updateProductVariationTextsHandler(context, params));
|
|
73
|
+
server.tool('product_siblings', 'Retrieve sibling products of a given product, optionally filtered by assortment ID, with support for pagination and inclusion of inactive products.', ProductSiblingsSchema, async (params) => productSiblingsHandler(context, params));
|
|
74
|
+
server.tool('product_getMedias', 'Retrieve media assets associated with a product, optionally filtered by tags and paginated.', ProductMediaSchema, async (params) => productMediaHandler(context, params));
|
|
75
|
+
server.tool('product_variationProducts', 'Retrieve all variant products of a configurable product that exactly match the provided combination of variation key-value pairs (e.g., Color: Red, Size: M). You must provide at least one vector. Optionally include inactive variants in the result.', VariationProductsSchema, async (params) => variationProductsHandler(context, params));
|
|
76
|
+
server.tool('product_variations', 'Retrieve all defined variation attributes (e.g., Color, Size) and their possible values for a configurable product.', ProductVariationsSchema, async (params) => productVariationsHandler(context, params));
|
|
77
|
+
server.tool('product_addBundleItem', 'Adds a product as a bundled item to another product. Only works if the target product is of type BUNDLE_PRODUCT. You must provide the ID of the bundle and the ID and quantity of the item to include.', AddProductBundleItemSchema, async (params) => addProductBundleItemHandler(context, params));
|
|
78
|
+
server.tool('product_removeBundleItem', 'Removes a bundled product from a BUNDLE_PRODUCT using its 0-based index in the bundle list. The product must be of type BUNDLE_PRODUCT.', RemoveProductBundleItemSchema, async (params) => removeProductBundleItemHandler(context, params));
|
|
79
|
+
server.tool('product_assignments', 'Retrieve the full assignment matrix of a configurable product, including all assigned variants by their variation vectors. Optionally include inactive variants.', ProductAssignmentsSchema, async (params) => productAssignmentsHandler(context, params));
|
|
80
|
+
server.tool('product_bundleItems', 'Retrieve all bundle items from a product of type BUNDLE. Each item includes the configuration and quantity.', ProductBundleItemsSchema, async (params) => productBundleItemsHandler(context, params));
|
|
81
|
+
server.tool('product_simulatedPriceRange', 'Simulate the price range for a CONFIGURABLE_PRODUCT and its variant combinations based on quantity, variation selections, and pricing rules. Only applicable to configurable products.', SimulatedPriceRangeSchema, async (params) => simulatedPriceRangeHandler(context, params));
|
|
82
|
+
server.tool('product_simulatedPrice', 'Simulate the price for a product given a complete configuration vector and quantity. Useful for previewing dynamic pricing rules.', SimulatedPriceSchema, async (params) => simulatedPriceHandler(context, params));
|
|
83
|
+
server.tool('product_catalogPrice', 'Retrieve the catalog price for any product type, optionally for a specific quantity and currency. when ask for product price without specifying what, always use this tool', CatalogPriceSchema, async (params) => catalogPriceHandler(context, params));
|
|
60
84
|
};
|
|
61
85
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EACL,4BAA4B,EAC5B,2BAA2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M,CAAC,CAC/D,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,0BAA0B,EAC1B,yIAAyI,EACzI,6BAA6B,EAC7B,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,8BAA8B,CAAC,OAAO,EAAE,MAAM,CAAC,CAClE,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,kKAAkK,EAClK,wBAAwB,EACxB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,OAAO,EAAE,MAAM,CAAC,CAC7D,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,qBAAqB,EACrB,6GAA6G,EAC7G,wBAAwB,EACxB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,OAAO,EAAE,MAAM,CAAC,CAC7D,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,6BAA6B,EAC7B,wLAAwL,EACxL,yBAAyB,EACzB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,CAAC,CAC9D,CAAC;IACF,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,mIAAmI,EACnI,oBAAoB,EACpB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,CACzD,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,4KAA4K,EAC5K,kBAAkB,EAClB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CACvD,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const ProductAssignmentsSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProductAssignmentsZodSchema: z.ZodObject<{
|
|
8
|
+
productId: z.ZodString;
|
|
9
|
+
includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
productId?: string;
|
|
12
|
+
includeInactive?: boolean;
|
|
13
|
+
}, {
|
|
14
|
+
productId?: string;
|
|
15
|
+
includeInactive?: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
export type ProductAssignmentsParams = z.infer<typeof ProductAssignmentsZodSchema>;
|
|
18
|
+
export declare const productAssignmentsHandler: (context: Context, params: ProductAssignmentsParams) => Promise<{
|
|
19
|
+
content: {
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
}[];
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=productAssignmentsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productAssignmentsHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productAssignmentsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;CAUpC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;EAAqC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,yBAAyB,GAAU,SAAS,OAAO,EAAE,QAAQ,wBAAwB;;;;;EA8DjG,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ProductNotFoundError, ProductWrongTypeError } from '../../../errors.js';
|
|
2
|
+
import { ProductTypes } from '@unchainedshop/core-products';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import normalizeMediaUrl from '../../utils/normalizeMediaUrl.js';
|
|
6
|
+
import { getNormalizedProductDetails } from '../../utils/getNormalizedProductDetails.js';
|
|
7
|
+
export const ProductAssignmentsSchema = {
|
|
8
|
+
productId: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.describe('ID of the CONFIGURABLE_PRODUCT whose assignments should be fetched'),
|
|
12
|
+
includeInactive: z
|
|
13
|
+
.boolean()
|
|
14
|
+
.optional()
|
|
15
|
+
.default(false)
|
|
16
|
+
.describe('Whether to include inactive assigned products'),
|
|
17
|
+
};
|
|
18
|
+
export const ProductAssignmentsZodSchema = z.object(ProductAssignmentsSchema);
|
|
19
|
+
export const productAssignmentsHandler = async (context, params) => {
|
|
20
|
+
const { modules, userId, loaders, locale } = context;
|
|
21
|
+
const { productId, includeInactive } = params;
|
|
22
|
+
log('handler productAssignmentsHandler', { userId, params });
|
|
23
|
+
try {
|
|
24
|
+
const product = await getNormalizedProductDetails(productId, context);
|
|
25
|
+
if (!product)
|
|
26
|
+
throw new ProductNotFoundError({ productId });
|
|
27
|
+
if (product.type !== ProductTypes.ConfigurableProduct) {
|
|
28
|
+
throw new ProductWrongTypeError({
|
|
29
|
+
productId,
|
|
30
|
+
received: product.type,
|
|
31
|
+
required: ProductTypes.ConfigurableProduct,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const assignments = await modules.products.proxyAssignments(product, { includeInactive });
|
|
35
|
+
const normalizedAssignments = await Promise.all(assignments.map(async ({ assignment, ...rest }) => {
|
|
36
|
+
const product = await loaders.productLoader.load({
|
|
37
|
+
productId: assignment.productId,
|
|
38
|
+
});
|
|
39
|
+
const productMedias = await modules.products.media.findProductMedias({
|
|
40
|
+
productId: assignment.productId,
|
|
41
|
+
});
|
|
42
|
+
const media = await normalizeMediaUrl(productMedias, context);
|
|
43
|
+
const texts = await loaders.productTextLoader.load({
|
|
44
|
+
productId: assignment.productId,
|
|
45
|
+
locale,
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
assignment: {
|
|
49
|
+
...assignment,
|
|
50
|
+
product: {
|
|
51
|
+
...product,
|
|
52
|
+
media,
|
|
53
|
+
texts,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
...rest,
|
|
57
|
+
};
|
|
58
|
+
}));
|
|
59
|
+
return {
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: JSON.stringify({ product, assignments: normalizedAssignments }),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return {
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: 'text',
|
|
73
|
+
text: `Error fetching assignments: ${error.message}`,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=productAssignmentsHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productAssignmentsHandler.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productAssignmentsHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,oEAAoE,CAAC;IACjF,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,QAAQ,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AChC,CAAC,CAAC;YACH,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC;gBACnE,SAAS,EAAE,UAAU,CAAC,SAAS;aAChC,CAAC,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;YAC9D,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC;gBACjD,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,MAAM;aACP,CAAC,CAAC;YACH,OAAO;gBACL,UAAU,EAAE;oBACV,GAAG,UAAU;oBACb,OAAO,EAAE;wBACP,GAAG,OAAO;wBACV,KAAK;wBACL,KAAK;qBACN;iBACF;gBACD,GAAG,IAAI;aACR,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;QACF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;iBACtE;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,+BAAgC,KAAe,CAAC,OAAO,EAAE;iBAChE;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const ProductBundleItemsSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
};
|
|
6
|
+
export declare const ProductBundleItemsZodSchema: z.ZodObject<{
|
|
7
|
+
productId: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
productId?: string;
|
|
10
|
+
}, {
|
|
11
|
+
productId?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type ProductBundleItemsParams = z.infer<typeof ProductBundleItemsZodSchema>;
|
|
14
|
+
export declare const productBundleItemsHandler: (context: Context, params: ProductBundleItemsParams) => Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=productBundleItemsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productBundleItemsHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productBundleItemsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,wBAAwB;;CAEpC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;EAAqC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,yBAAyB,GAAU,SAAS,OAAO,EAAE,QAAQ,wBAAwB;;;;;EAmCjG,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ProductNotFoundError, ProductWrongTypeError } from '../../../errors.js';
|
|
2
|
+
import { getNormalizedProductDetails } from '../../utils/getNormalizedProductDetails.js';
|
|
3
|
+
import { ProductTypes } from '@unchainedshop/core-products';
|
|
4
|
+
import { log } from '@unchainedshop/logger';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const ProductBundleItemsSchema = {
|
|
7
|
+
productId: z.string().min(1).describe('ID of the product of type BUNDLE to retrieve its bundle items'),
|
|
8
|
+
};
|
|
9
|
+
export const ProductBundleItemsZodSchema = z.object(ProductBundleItemsSchema);
|
|
10
|
+
export const productBundleItemsHandler = async (context, params) => {
|
|
11
|
+
const { modules, userId } = context;
|
|
12
|
+
const { productId } = params;
|
|
13
|
+
log('handler productBundleItemsHandler', { userId, params });
|
|
14
|
+
try {
|
|
15
|
+
const product = await modules.products.findProduct({ productId });
|
|
16
|
+
if (!product)
|
|
17
|
+
throw new ProductNotFoundError({ productId });
|
|
18
|
+
if (product.type !== ProductTypes.BundleProduct) {
|
|
19
|
+
throw new ProductWrongTypeError({
|
|
20
|
+
productId,
|
|
21
|
+
received: product.type,
|
|
22
|
+
required: ProductTypes.BundleProduct,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
content: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text',
|
|
29
|
+
text: JSON.stringify({ product: await getNormalizedProductDetails(productId, context) }),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: `Error fetching bundle items: ${error.message}`,
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=productBundleItemsHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productBundleItemsHandler.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productBundleItemsHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM,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,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const ProductMediaSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
};
|
|
9
|
+
export declare const ProductMediaZodSchema: z.ZodObject<{
|
|
10
|
+
productId: z.ZodString;
|
|
11
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
tags?: string[];
|
|
16
|
+
productId?: string;
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
}, {
|
|
20
|
+
tags?: string[];
|
|
21
|
+
productId?: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}>;
|
|
25
|
+
export type ProductMediaParams = z.infer<typeof ProductMediaZodSchema>;
|
|
26
|
+
export declare function productMediaHandler(context: Context, params: ProductMediaParams): Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=productMediaHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productMediaHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productMediaHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAI/B,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB;;;;;GAgCrF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import normalizeMediaUrl from '../../utils/normalizeMediaUrl.js';
|
|
4
|
+
export const ProductMediaSchema = {
|
|
5
|
+
productId: z.string().min(1).describe('ID of the product to retrieve media for'),
|
|
6
|
+
limit: z.number().int().min(1).max(100).default(10).describe('Number of media items to return'),
|
|
7
|
+
offset: z.number().int().min(0).default(0).describe('Pagination offset'),
|
|
8
|
+
tags: z.array(z.string().min(1)).optional().describe('Filter media by lowercase tags'),
|
|
9
|
+
};
|
|
10
|
+
export const ProductMediaZodSchema = z
|
|
11
|
+
.object(ProductMediaSchema)
|
|
12
|
+
.describe('Retrieve media assets associated with a product, optionally filtered by tags and paginated.');
|
|
13
|
+
export async function productMediaHandler(context, params) {
|
|
14
|
+
const { productId, limit, offset, tags } = params;
|
|
15
|
+
const { modules, loaders, userId } = context;
|
|
16
|
+
try {
|
|
17
|
+
log('handler productMediaHandler', { userId, params });
|
|
18
|
+
let media = [];
|
|
19
|
+
if (offset || tags) {
|
|
20
|
+
media = await modules.products.media.findProductMedias({
|
|
21
|
+
productId,
|
|
22
|
+
...params,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
media = (await loaders.productMediasLoader.load({ productId })).slice(offset, offset + limit);
|
|
26
|
+
return {
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: JSON.stringify({ media: await normalizeMediaUrl(media, context) }),
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: 'text',
|
|
40
|
+
text: `Error retrieving product media: ${error.message}`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=productMediaHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productMediaHandler.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productMediaHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IAChF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IAC/F,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACxE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACvF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,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';
|
|
3
|
+
export declare const ProductSiblingsSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
assortmentId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
};
|
|
10
|
+
export declare const ProductSiblingsZodSchema: z.ZodObject<{
|
|
11
|
+
productId: z.ZodString;
|
|
12
|
+
assortmentId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
assortmentId?: string;
|
|
18
|
+
productId?: string;
|
|
19
|
+
includeInactive?: boolean;
|
|
20
|
+
limit?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
}, {
|
|
23
|
+
assortmentId?: string;
|
|
24
|
+
productId?: string;
|
|
25
|
+
includeInactive?: boolean;
|
|
26
|
+
limit?: number;
|
|
27
|
+
offset?: number;
|
|
28
|
+
}>;
|
|
29
|
+
export type ProductSiblingsParams = z.infer<typeof ProductSiblingsZodSchema>;
|
|
30
|
+
export declare function productSiblingsHandler(context: Context, params: ProductSiblingsParams): Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=productSiblingsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productSiblingsHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productSiblingsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;CAUjC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;EAIlC,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB;;;;;GAuD3F"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { log } from '@unchainedshop/logger';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { getNormalizedProductDetails } from '../../utils/getNormalizedProductDetails.js';
|
|
4
|
+
export const ProductSiblingsSchema = {
|
|
5
|
+
productId: z.string().describe('Product ID to get siblings of'),
|
|
6
|
+
assortmentId: z.string().optional().describe('Assortment ID to filter siblings (optional)'),
|
|
7
|
+
limit: z.number().int().min(1).max(100).default(10).describe('Number of siblings to return'),
|
|
8
|
+
offset: z.number().int().min(0).default(0).describe('Pagination offset'),
|
|
9
|
+
includeInactive: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.optional()
|
|
12
|
+
.default(false)
|
|
13
|
+
.describe('Whether to include inactive sibling products'),
|
|
14
|
+
};
|
|
15
|
+
export const ProductSiblingsZodSchema = z
|
|
16
|
+
.object(ProductSiblingsSchema)
|
|
17
|
+
.describe('Retrieve sibling products of a given product, optionally filtered by assortment ID, with support for pagination and inclusion of inactive products.');
|
|
18
|
+
export async function productSiblingsHandler(context, params) {
|
|
19
|
+
const { modules, userId } = context;
|
|
20
|
+
const { productId, assortmentId, limit, offset, includeInactive } = params;
|
|
21
|
+
try {
|
|
22
|
+
log('handler productSiblingsHandler', { userId, params });
|
|
23
|
+
const assortmentIds = assortmentId
|
|
24
|
+
? [assortmentId]
|
|
25
|
+
: await modules.assortments.products.findAssortmentIds({ productId });
|
|
26
|
+
if (!assortmentIds.length)
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text',
|
|
31
|
+
text: JSON.stringify({ products: [] }),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
const productIds = await modules.assortments.products.findSiblings({
|
|
36
|
+
productId,
|
|
37
|
+
assortmentIds,
|
|
38
|
+
});
|
|
39
|
+
const products = await modules.products.findProducts({
|
|
40
|
+
productIds,
|
|
41
|
+
includeDrafts: includeInactive,
|
|
42
|
+
limit,
|
|
43
|
+
offset,
|
|
44
|
+
});
|
|
45
|
+
const normalizedProducts = (await Promise.allSettled(products.map(({ _id }) => getNormalizedProductDetails(_id, context)))).flatMap((r) => (r.status === 'fulfilled' ? [r.value] : []));
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: JSON.stringify({ products: normalizedProducts }),
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: 'text',
|
|
60
|
+
text: `Error retrieving product siblings: ${error.message}`,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=productSiblingsHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productSiblingsHandler.js","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productSiblingsHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEzF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,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|
|
2
|
+
import { Context } from '../../../context.js';
|
|
3
|
+
export declare const ProductVariationsSchema: {
|
|
4
|
+
productId: z.ZodString;
|
|
5
|
+
};
|
|
6
|
+
export declare const ProductVariationsZodSchema: z.ZodObject<{
|
|
7
|
+
productId: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
productId?: string;
|
|
10
|
+
}, {
|
|
11
|
+
productId?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type ProductVariationsParams = z.infer<typeof ProductVariationsZodSchema>;
|
|
14
|
+
export declare const productVariationsHandler: (context: Context, params: ProductVariationsParams) => Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=productVariationsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productVariationsHandler.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/product/productVariationsHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,eAAO,MAAM,uBAAuB;;CAEnC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;EAAoC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,wBAAwB,GAAU,SAAS,OAAO,EAAE,QAAQ,uBAAuB;;;;;EAuC/F,CAAC"}
|