@unchainedshop/api 4.8.21 → 4.8.23

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.
Files changed (52) hide show
  1. package/README.md +6 -4
  2. package/lib/chat/utils.d.ts +8 -0
  3. package/lib/chat/utils.js +54 -2
  4. package/lib/express/chatHandler.js +52 -61
  5. package/lib/express/createMCPMiddleware.js +18 -99
  6. package/lib/fastify/chatHandler.js +48 -55
  7. package/lib/fastify/mcpHandler.js +24 -94
  8. package/lib/locale-context.d.ts +2 -2
  9. package/lib/locale-context.js +3 -6
  10. package/lib/mcp/handleMcpHttpRequest.d.ts +2 -0
  11. package/lib/mcp/handleMcpHttpRequest.js +83 -0
  12. package/lib/mcp/index.d.ts +1 -1
  13. package/lib/mcp/nodeHttpBridge.d.ts +3 -0
  14. package/lib/mcp/nodeHttpBridge.js +64 -0
  15. package/lib/mcp/resources/localization.d.ts +5 -1
  16. package/lib/mcp/resources/localization.js +93 -69
  17. package/lib/mcp/tools/assortment/index.d.ts +1 -1
  18. package/lib/mcp/tools/assortment/index.js +4 -1
  19. package/lib/mcp/tools/assortment/schemas.d.ts +1 -3
  20. package/lib/mcp/tools/filter/index.d.ts +1 -1
  21. package/lib/mcp/tools/filter/index.js +4 -1
  22. package/lib/mcp/tools/filter/schemas.d.ts +1 -3
  23. package/lib/mcp/tools/localization/index.d.ts +1 -1
  24. package/lib/mcp/tools/localization/index.js +4 -1
  25. package/lib/mcp/tools/localization/schemas.d.ts +1 -3
  26. package/lib/mcp/tools/order/index.d.ts +1 -1
  27. package/lib/mcp/tools/order/index.js +4 -1
  28. package/lib/mcp/tools/order/schemas.d.ts +1 -3
  29. package/lib/mcp/tools/product/index.d.ts +1 -1
  30. package/lib/mcp/tools/product/index.js +4 -1
  31. package/lib/mcp/tools/product/schemas.d.ts +1 -3
  32. package/lib/mcp/tools/provider/index.d.ts +1 -1
  33. package/lib/mcp/tools/provider/index.js +4 -1
  34. package/lib/mcp/tools/provider/schemas.d.ts +1 -3
  35. package/lib/mcp/tools/quotation/index.d.ts +1 -1
  36. package/lib/mcp/tools/quotation/index.js +4 -1
  37. package/lib/mcp/tools/quotation/schemas.d.ts +1 -3
  38. package/lib/mcp/tools/system/index.d.ts +1 -1
  39. package/lib/mcp/tools/system/index.js +4 -1
  40. package/lib/mcp/tools/system/schemas.d.ts +1 -3
  41. package/lib/mcp/tools/users/index.d.ts +1 -1
  42. package/lib/mcp/tools/users/index.js +4 -1
  43. package/lib/mcp/tools/users/schemas.d.ts +1 -3
  44. package/lib/mcp/utils/sharedSchemas.d.ts +3 -5
  45. package/lib/mcp/utils/sharedSchemas.js +18 -2
  46. package/lib/resolvers/type/filter/loaded-filter-types.d.ts +1 -1
  47. package/lib/resolvers/type/filter/loaded-filter-types.js +1 -1
  48. package/lib/resolvers/type/index.d.ts +1 -1
  49. package/lib/schema/types/filter.js +2 -2
  50. package/lib/utils/optionalPeerError.d.ts +1 -0
  51. package/lib/utils/optionalPeerError.js +6 -0
  52. package/package.json +32 -8
@@ -1,4 +1,7 @@
1
1
  import { productManagement, ProductManagementSchema } from "./productManagement.js";
2
2
  export const registerProductTools = (server, context) => {
3
- server.tool('product_management', 'Unified product management system with comprehensive action-based operations: CREATE/UPDATE/REMOVE/GET/LIST/COUNT products, UPDATE_STATUS (publish/unpublish), ADD_MEDIA/REMOVE_MEDIA/REORDER_MEDIA/GET_MEDIA/UPDATE_MEDIA_TEXTS, CREATE_VARIATION/REMOVE_VARIATION/ADD_VARIATION_OPTION/REMOVE_VARIATION_OPTION/UPDATE_VARIATION_TEXTS, ADD_ASSIGNMENT/REMOVE_ASSIGNMENT/GET_ASSIGNMENTS/GET_VARIATION_PRODUCTS, ADD_BUNDLE_ITEM/REMOVE_BUNDLE_ITEM/GET_BUNDLE_ITEMS, SIMULATE_PRICE/SIMULATE_PRICE_RANGE/GET_CATALOG_PRICE, GET_PRODUCT_TEXTS/GET_MEDIA_TEXTS/GET_VARIATION_TEXTS, GET_REVIEWS/COUNT_REVIEWS, GET_SIBLINGS. Supports all product types (SIMPLE, CONFIGURABLE, BUNDLE, PLAN, TOKENIZED) with type-specific validations and comprehensive error handling.', ProductManagementSchema, async (params) => productManagement(context, params));
3
+ server.registerTool('product_management', {
4
+ description: 'Unified product management system with comprehensive action-based operations: CREATE/UPDATE/REMOVE/GET/LIST/COUNT products, UPDATE_STATUS (publish/unpublish), ADD_MEDIA/REMOVE_MEDIA/REORDER_MEDIA/GET_MEDIA/UPDATE_MEDIA_TEXTS, CREATE_VARIATION/REMOVE_VARIATION/ADD_VARIATION_OPTION/REMOVE_VARIATION_OPTION/UPDATE_VARIATION_TEXTS, ADD_ASSIGNMENT/REMOVE_ASSIGNMENT/GET_ASSIGNMENTS/GET_VARIATION_PRODUCTS, ADD_BUNDLE_ITEM/REMOVE_BUNDLE_ITEM/GET_BUNDLE_ITEMS, SIMULATE_PRICE/SIMULATE_PRICE_RANGE/GET_CATALOG_PRICE, GET_PRODUCT_TEXTS/GET_MEDIA_TEXTS/GET_VARIATION_TEXTS, GET_REVIEWS/COUNT_REVIEWS, GET_SIBLINGS. Supports all product types (SIMPLE, CONFIGURABLE, BUNDLE, PLAN, TOKENIZED) with type-specific validations and comprehensive error handling.',
5
+ inputSchema: ProductManagementSchema,
6
+ }, async (params) => productManagement(context, params));
4
7
  };
@@ -461,9 +461,7 @@ export declare const actionValidators: {
461
461
  }, z.core.$strip>>;
462
462
  }, z.core.$strip>;
463
463
  };
464
- export declare const ProductManagementSchema: {
465
- action: z.core.$ZodType<string>;
466
- } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
464
+ export declare const ProductManagementSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<import("../../utils/sharedSchemas.ts").ManagementParams, import("../../utils/sharedSchemas.ts").ManagementParams>;
467
465
  export type { ManagementParams as ProductManagementParams } from '../../utils/sharedSchemas.ts';
468
466
  export type ActionName = keyof typeof actionValidators;
469
467
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
@@ -1,3 +1,3 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer } from '@modelcontextprotocol/server';
2
2
  import type { Context } from '../../../context.ts';
3
3
  export declare const registerProviderTools: (server: McpServer, context: Context) => void;
@@ -1,4 +1,7 @@
1
1
  import { providerManagement, ProviderManagementSchema } from "./providerManagement.js";
2
2
  export const registerProviderTools = (server, context) => {
3
- server.tool('provider_management', 'Unified provider management tool for all provider operations (CREATE, UPDATE, REMOVE, GET, LIST, INTERFACES) across payment processing (Stripe, PayPal), delivery services (FedEx, UPS), and warehousing systems. Use action parameter to specify operation type.', ProviderManagementSchema, async (params) => providerManagement(context, params));
3
+ server.registerTool('provider_management', {
4
+ description: 'Unified provider management tool for all provider operations (CREATE, UPDATE, REMOVE, GET, LIST, INTERFACES) across payment processing (Stripe, PayPal), delivery services (FedEx, UPS), and warehousing systems. Use action parameter to specify operation type.',
5
+ inputSchema: ProviderManagementSchema,
6
+ }, async (params) => providerManagement(context, params));
4
7
  };
@@ -129,9 +129,7 @@ export declare const actionValidators: {
129
129
  }>]>>;
130
130
  }, z.core.$strip>;
131
131
  };
132
- export declare const ProviderManagementSchema: {
133
- action: z.core.$ZodType<string>;
134
- } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
132
+ export declare const ProviderManagementSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<import("../../utils/sharedSchemas.ts").ManagementParams, import("../../utils/sharedSchemas.ts").ManagementParams>;
135
133
  export type { ManagementParams as ProviderManagementParams } from '../../utils/sharedSchemas.ts';
136
134
  export type ActionName = keyof typeof actionValidators;
137
135
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
@@ -1,3 +1,3 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer } from '@modelcontextprotocol/server';
2
2
  import type { Context } from '../../../context.ts';
3
3
  export declare const registerQuotationTools: (server: McpServer, context: Context) => void;
@@ -1,4 +1,7 @@
1
1
  import { quotationManagement, QuotationManagementSchema } from "./quotationManagement.js";
2
2
  export const registerQuotationTools = (server, context) => {
3
- server.tool('quotation_management', 'Unified quotation management system. Supports: LIST (get quotations with filters and pagination), GET (single quotation by ID), COUNT (count quotations), VERIFY (verify a REQUESTED quotation), MAKE_PROPOSAL (create proposal for PROCESSING quotation), REJECT (reject any quotation except FULFILLED). Quotations go through lifecycle: REQUESTED → PROCESSING → PROPOSED → FULFILLED/REJECTED.', QuotationManagementSchema, async (params) => quotationManagement(context, params));
3
+ server.registerTool('quotation_management', {
4
+ description: 'Unified quotation management system. Supports: LIST (get quotations with filters and pagination), GET (single quotation by ID), COUNT (count quotations), VERIFY (verify a REQUESTED quotation), MAKE_PROPOSAL (create proposal for PROCESSING quotation), REJECT (reject any quotation except FULFILLED). Quotations go through lifecycle: REQUESTED → PROCESSING → PROPOSED → FULFILLED/REJECTED.',
5
+ inputSchema: QuotationManagementSchema,
6
+ }, async (params) => quotationManagement(context, params));
4
7
  };
@@ -65,9 +65,7 @@ export declare const actionValidators: {
65
65
  quotationContext: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
66
66
  }, z.core.$strip>;
67
67
  };
68
- export declare const QuotationManagementSchema: {
69
- action: z.core.$ZodType<string>;
70
- } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
68
+ export declare const QuotationManagementSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<import("../../utils/sharedSchemas.ts").ManagementParams, import("../../utils/sharedSchemas.ts").ManagementParams>;
71
69
  export type { ManagementParams as QuotationManagementParams } from '../../utils/sharedSchemas.ts';
72
70
  export type ActionName = keyof typeof actionValidators;
73
71
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
@@ -1,3 +1,3 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer } from '@modelcontextprotocol/server';
2
2
  import type { Context } from '../../../context.ts';
3
3
  export declare const registerSystemTools: (server: McpServer, context: Context) => void;
@@ -1,5 +1,8 @@
1
1
  import { systemManagement } from "./systemManagement.js";
2
2
  import { SystemManagementSchema } from "./schemas.js";
3
3
  export const registerSystemTools = (server, context) => {
4
- server.tool('system_management', 'Comprehensive system management with unified system information, worker queue, and event operations. System actions: SHOP_INFO (returns shop configuration including default locale settings). Worker actions: WORKER_ADD (add work items), WORKER_REMOVE (delete work items), WORKER_GET (retrieve work item), WORKER_LIST (search work items), WORKER_COUNT (count work items), WORKER_ALLOCATE (allocate work to workers), WORKER_FINISH_WORK (mark work complete), WORKER_PROCESS_NEXT (get next work item), WORKER_STATISTICS (work queue statistics), WORKER_ACTIVE_WORK_TYPES (get active work types). Event actions: EVENT_GET (retrieve event), EVENT_LIST (search events), EVENT_COUNT (count events), EVENT_STATISTICS (event analytics).', SystemManagementSchema, async (params) => systemManagement(context, params));
4
+ server.registerTool('system_management', {
5
+ description: 'Comprehensive system management with unified system information, worker queue, and event operations. System actions: SHOP_INFO (returns shop configuration including default locale settings). Worker actions: WORKER_ADD (add work items), WORKER_REMOVE (delete work items), WORKER_GET (retrieve work item), WORKER_LIST (search work items), WORKER_COUNT (count work items), WORKER_ALLOCATE (allocate work to workers), WORKER_FINISH_WORK (mark work complete), WORKER_PROCESS_NEXT (get next work item), WORKER_STATISTICS (work queue statistics), WORKER_ACTIVE_WORK_TYPES (get active work types). Event actions: EVENT_GET (retrieve event), EVENT_LIST (search events), EVENT_COUNT (count events), EVENT_STATISTICS (event analytics).',
6
+ inputSchema: SystemManagementSchema,
7
+ }, async (params) => systemManagement(context, params));
5
8
  };
@@ -111,9 +111,7 @@ export declare const actionValidators: {
111
111
  }, z.core.$strip>>;
112
112
  }, z.core.$strip>;
113
113
  };
114
- export declare const SystemManagementSchema: {
115
- action: z.core.$ZodType<string>;
116
- } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
114
+ export declare const SystemManagementSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<import("../../utils/sharedSchemas.ts").ManagementParams, import("../../utils/sharedSchemas.ts").ManagementParams>;
117
115
  export type { ManagementParams as SystemManagementParams } from '../../utils/sharedSchemas.ts';
118
116
  export type ActionName = keyof typeof actionValidators;
119
117
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
@@ -1,3 +1,3 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer } from '@modelcontextprotocol/server';
2
2
  import type { Context } from '../../../context.ts';
3
3
  export declare const registerUsersTools: (server: McpServer, context: Context) => void;
@@ -1,4 +1,7 @@
1
1
  import { usersManagement, UsersManagementSchema } from "./usersManagement.js";
2
2
  export const registerUsersTools = (server, context) => {
3
- server.tool('users_management', 'Comprehensive user management system for Unchained e-commerce platform. Core operations: LIST (paginated user listing with filters for guests, email verification, last login dates), COUNT (user count with same filters), GET (retrieve user by ID), CREATE (new user with optional profile), UPDATE (profile/metadata updates), REMOVE (soft delete with optional review cleanup), ENROLL (create user + send enrollment email). User administration: SET_ROLES (assign admin/editor roles), SET_TAGS (categorization tags), SET_PASSWORD (admin password reset), SET_USERNAME (username changes). Email management: ADD_EMAIL/REMOVE_EMAIL (multi-email support), SEND_ENROLLMENT_EMAIL (trigger enrollment), SEND_VERIFICATION_EMAIL (email verification). Data access: GET_ORDERS (user order history with cart inclusion), GET_ENROLLMENTS (subscription enrollments), GET_QUOTATIONS (price quotes), GET_BOOKMARKS (saved products), GET_CART (active user cart), GET_PAYMENT_CREDENTIALS (stored payment methods), GET_AVATAR (profile image), GET_REVIEWS/GET_REVIEWS_COUNT (product reviews), REMOVE_PRODUCT_REVIEWS (bulk review cleanup), GET_CURRENT_USER (current session logged in user). Supports pagination, sorting, filtering, date ranges, and proper validation for all operations.', UsersManagementSchema, async (params) => usersManagement(context, params));
3
+ server.registerTool('users_management', {
4
+ description: 'Comprehensive user management system for Unchained e-commerce platform. Core operations: LIST (paginated user listing with filters for guests, email verification, last login dates), COUNT (user count with same filters), GET (retrieve user by ID), CREATE (new user with optional profile), UPDATE (profile/metadata updates), REMOVE (soft delete with optional review cleanup), ENROLL (create user + send enrollment email). User administration: SET_ROLES (assign admin/editor roles), SET_TAGS (categorization tags), SET_PASSWORD (admin password reset), SET_USERNAME (username changes). Email management: ADD_EMAIL/REMOVE_EMAIL (multi-email support), SEND_ENROLLMENT_EMAIL (trigger enrollment), SEND_VERIFICATION_EMAIL (email verification). Data access: GET_ORDERS (user order history with cart inclusion), GET_ENROLLMENTS (subscription enrollments), GET_QUOTATIONS (price quotes), GET_BOOKMARKS (saved products), GET_CART (active user cart), GET_PAYMENT_CREDENTIALS (stored payment methods), GET_AVATAR (profile image), GET_REVIEWS/GET_REVIEWS_COUNT (product reviews), REMOVE_PRODUCT_REVIEWS (bulk review cleanup), GET_CURRENT_USER (current session logged in user). Supports pagination, sorting, filtering, date ranges, and proper validation for all operations.',
5
+ inputSchema: UsersManagementSchema,
6
+ }, async (params) => usersManagement(context, params));
4
7
  };
@@ -200,9 +200,7 @@ export declare const actionValidators: {
200
200
  userId: z.ZodMiniString<string>;
201
201
  }, z.core.$strip>;
202
202
  };
203
- export declare const UsersManagementSchema: {
204
- action: z.core.$ZodType<string>;
205
- } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
203
+ export declare const UsersManagementSchema: import("@modelcontextprotocol/server").StandardSchemaWithJSON<import("../../utils/sharedSchemas.ts").ManagementParams, import("../../utils/sharedSchemas.ts").ManagementParams>;
206
204
  export type { ManagementParams as UsersManagementParams } from '../../utils/sharedSchemas.ts';
207
205
  export type ActionName = keyof typeof actionValidators;
208
206
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod/v4-mini';
2
+ import type { StandardSchemaWithJSON } from '@modelcontextprotocol/server';
2
3
  export declare const PaginationSchema: {
3
4
  limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
4
5
  offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -60,12 +61,10 @@ export interface ManagementParams {
60
61
  action: string;
61
62
  [key: string]: unknown;
62
63
  }
63
- type ManagementSchemaShape = {
64
- action: z.core.$ZodType<string>;
65
- } & Record<string, z.core.$ZodType>;
64
+ export declare function withStandardJsonSchema<T extends z.core.$ZodType>(schema: T): T;
66
65
  export declare function createManagementSchemaFromValidators(validators: Record<string, {
67
66
  shape: Record<string, z.core.$ZodType>;
68
- }>): ManagementSchemaShape;
67
+ }>): StandardSchemaWithJSON<ManagementParams, ManagementParams>;
69
68
  export declare function createMcpResponse(response: any): {
70
69
  content: {
71
70
  type: "text";
@@ -79,4 +78,3 @@ export declare function createMcpErrorResponse(action: string, error: Error): {
79
78
  text: string;
80
79
  }[];
81
80
  };
82
- export {};
@@ -60,6 +60,22 @@ export function createManagementSchema(actions, additionalFields = {}) {
60
60
  ...additionalFields,
61
61
  };
62
62
  }
63
+ export function withStandardJsonSchema(schema) {
64
+ const standard = schema['~standard'];
65
+ if (standard?.jsonSchema)
66
+ return schema;
67
+ Object.defineProperty(schema, '~standard', {
68
+ value: {
69
+ ...standard,
70
+ jsonSchema: {
71
+ input: ({ target } = {}) => z.toJSONSchema(schema, { io: 'input', ...(target ? { target } : {}) }),
72
+ output: ({ target } = {}) => z.toJSONSchema(schema, { io: 'output', ...(target ? { target } : {}) }),
73
+ },
74
+ },
75
+ configurable: true,
76
+ });
77
+ return schema;
78
+ }
63
79
  export function createManagementSchemaFromValidators(validators) {
64
80
  const merged = {};
65
81
  for (const validator of Object.values(validators)) {
@@ -69,12 +85,12 @@ export function createManagementSchemaFromValidators(validators) {
69
85
  }
70
86
  }
71
87
  }
72
- return {
88
+ return withStandardJsonSchema(z.object({
73
89
  action: z
74
90
  .enum(Object.keys(validators))
75
91
  .check(z.describe('Action to perform')),
76
92
  ...merged,
77
- };
93
+ }));
78
94
  }
79
95
  export function createMcpResponse(response) {
80
96
  return {
@@ -10,7 +10,7 @@ export interface LoadedFilterData {
10
10
  }
11
11
  export declare const LoadedFilter: {
12
12
  definition: ({ filter }: LoadedFilterData) => Filter;
13
- isSelected: ({ searchQuery, filter }: LoadedFilterData) => boolean | undefined;
13
+ isSelected: ({ searchQuery, filter }: LoadedFilterData) => boolean;
14
14
  filteredProductsCount: ({ filteredByOtherFiltersSet, filteredByThisFilterSet, searchQuery }: LoadedFilterData, _: never, context: Context) => Promise<number>;
15
15
  productsCount: ({ examinedProductIdSet, searchQuery }: LoadedFilterData, _: never, context: Context) => Promise<number>;
16
16
  options: ({ filter, filteredByOtherFiltersSet, forceLiveCollection, searchQuery }: LoadedFilterData, _: never, context: Context) => Promise<({
@@ -4,7 +4,7 @@ export const LoadedFilter = {
4
4
  return filter;
5
5
  },
6
6
  isSelected: ({ searchQuery, filter }) => {
7
- return searchQuery?.filterQuery?.some((q) => q.key === filter.key);
7
+ return Boolean(searchQuery?.filterQuery?.some((q) => q.key === filter.key));
8
8
  },
9
9
  filteredProductsCount: async ({ filteredByOtherFiltersSet, filteredByThisFilterSet, searchQuery }, _, context) => {
10
10
  const filterActions = await FilterDirector.actions({ searchQuery }, context);
@@ -279,7 +279,7 @@ declare const types: {
279
279
  Language: import("./language-types.ts").LanguageHelperTypes;
280
280
  LoadedFilter: {
281
281
  definition: ({ filter }: import("./filter/loaded-filter-types.ts").LoadedFilterData) => import("@unchainedshop/core-filters").Filter;
282
- isSelected: ({ searchQuery, filter }: import("./filter/loaded-filter-types.ts").LoadedFilterData) => boolean | undefined;
282
+ isSelected: ({ searchQuery, filter }: import("./filter/loaded-filter-types.ts").LoadedFilterData) => boolean;
283
283
  filteredProductsCount: ({ filteredByOtherFiltersSet, filteredByThisFilterSet, searchQuery }: import("./filter/loaded-filter-types.ts").LoadedFilterData, _: never, context: import("../../context.ts").Context) => Promise<number>;
284
284
  productsCount: ({ examinedProductIdSet, searchQuery }: import("./filter/loaded-filter-types.ts").LoadedFilterData, _: never, context: import("../../context.ts").Context) => Promise<number>;
285
285
  options: ({ filter, filteredByOtherFiltersSet, forceLiveCollection, searchQuery }: import("./filter/loaded-filter-types.ts").LoadedFilterData, _: never, context: import("../../context.ts").Context) => Promise<({
@@ -49,14 +49,14 @@ export default [
49
49
  type LoadedFilterOption @cacheControl(maxAge: 180) {
50
50
  filteredProductsCount: Int!
51
51
  definition: FilterOption!
52
- isSelected: Boolean
52
+ isSelected: Boolean!
53
53
  }
54
54
 
55
55
  type LoadedFilter @cacheControl(maxAge: 180) {
56
56
  productsCount: Int!
57
57
  filteredProductsCount: Int!
58
58
  definition: Filter!
59
- isSelected: Boolean
59
+ isSelected: Boolean!
60
60
  options: [LoadedFilterOption!]
61
61
  }
62
62
  `,
@@ -0,0 +1 @@
1
+ export declare function isPeerNotInstalledError(packageName: string, error: unknown): boolean;
@@ -0,0 +1,6 @@
1
+ export function isPeerNotInstalledError(packageName, error) {
2
+ if (error?.code !== 'ERR_MODULE_NOT_FOUND')
3
+ return false;
4
+ const match = String(error?.message || '').match(/^Cannot find (?:package|module) '([^']+)'/);
5
+ return !!match && (match[1] === packageName || match[1].startsWith(`${packageName}/`));
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/api",
3
3
  "description": "GraphQL API layer for the Unchained Engine with Express/Fastify adapters and MCP server",
4
- "version": "4.8.21",
4
+ "version": "4.8.23",
5
5
  "main": "lib/api-index.js",
6
6
  "types": "lib/api-index.d.ts",
7
7
  "type": "module",
@@ -61,28 +61,35 @@
61
61
  "homepage": "https://github.com/unchainedshop/unchained#readme",
62
62
  "peerDependencies": {
63
63
  "@ai-sdk/mcp": "^2.0.29",
64
- "graphql": ">= 16.14 < 18",
65
64
  "@fastify/cookie": ">= 11 < 12",
66
65
  "@fastify/multipart": ">= 9 < 11",
67
66
  "@fastify/session": ">= 11 < 12",
68
67
  "@fastify/static": ">= 10.1.3 < 11",
69
- "@modelcontextprotocol/sdk": ">= 1 < 2",
68
+ "@modelcontextprotocol/server": ">= 2 < 3",
70
69
  "ai": ">= 7 < 8",
71
70
  "express": ">= 5 < 6",
72
71
  "express-session": ">= 1.18 < 2",
73
72
  "fastify": ">= 5.2 < 6",
73
+ "graphql": ">= 16.14 < 18",
74
74
  "graphql-yoga": ">= 5.9 < 6",
75
+ "mongodb": ">= 7 < 8",
75
76
  "multer": ">= 2 < 3",
76
77
  "passport": ">= 0.7 < 1"
77
78
  },
78
79
  "peerDependenciesMeta": {
80
+ "graphql": {
81
+ "optional": false
82
+ },
79
83
  "graphql-yoga": {
80
84
  "optional": false
81
85
  },
82
86
  "express-session": {
83
87
  "optional": false
84
88
  },
85
- "@modelcontextprotocol/sdk": {
89
+ "mongodb": {
90
+ "optional": false
91
+ },
92
+ "@modelcontextprotocol/server": {
86
93
  "optional": true
87
94
  },
88
95
  "ai": {
@@ -119,16 +126,32 @@
119
126
  "dependencies": {
120
127
  "@envelop/core": "^5.6.0",
121
128
  "@unchainedshop/core": "^4.8.12",
129
+ "@unchainedshop/core-assortments": "^4.8.12",
130
+ "@unchainedshop/core-bookmarks": "^4.8.12",
131
+ "@unchainedshop/core-countries": "^4.8.12",
132
+ "@unchainedshop/core-currencies": "^4.8.12",
133
+ "@unchainedshop/core-delivery": "^4.8.12",
134
+ "@unchainedshop/core-enrollments": "^4.8.12",
135
+ "@unchainedshop/core-events": "^4.8.12",
136
+ "@unchainedshop/core-files": "^4.8.12",
137
+ "@unchainedshop/core-filters": "^4.8.12",
138
+ "@unchainedshop/core-languages": "^4.8.12",
139
+ "@unchainedshop/core-orders": "^4.8.12",
140
+ "@unchainedshop/core-payment": "^4.8.12",
141
+ "@unchainedshop/core-products": "^4.8.12",
142
+ "@unchainedshop/core-quotations": "^4.8.12",
143
+ "@unchainedshop/core-users": "^4.8.12",
144
+ "@unchainedshop/core-warehousing": "^4.8.12",
145
+ "@unchainedshop/core-worker": "^4.8.12",
122
146
  "@unchainedshop/events": "^4.8.12",
123
147
  "@unchainedshop/logger": "^4.8.12",
148
+ "@unchainedshop/mongodb": "^4.8.12",
124
149
  "@unchainedshop/roles": "^4.8.12",
125
150
  "@unchainedshop/utils": "^4.8.12",
126
151
  "dataloader": "^2.2.3",
127
- "expiry-map": "^2.0.0",
128
152
  "graphql-scalars": "^2.0.0",
129
153
  "mime": ">= 4 < 5",
130
- "p-memoize": "^8.0.0",
131
- "zod": "^3.25.76 || ^4"
154
+ "zod": "^4.2.0"
132
155
  },
133
156
  "devDependencies": {
134
157
  "@ai-sdk/mcp": "^2.0.34",
@@ -136,7 +159,7 @@
136
159
  "@fastify/multipart": "^10.1.1",
137
160
  "@fastify/session": "^11.1.0",
138
161
  "@fastify/static": "^10.1.3",
139
- "@modelcontextprotocol/sdk": "^1.15.1",
162
+ "@modelcontextprotocol/server": "^2.0.0",
140
163
  "@types/express": "^5.0.3",
141
164
  "@types/express-session": "^1.18.2",
142
165
  "@types/node": "^26.2.0",
@@ -145,6 +168,7 @@
145
168
  "express-session": "^1.18.1",
146
169
  "fastify": "^5.12.1",
147
170
  "graphql": "^17.0.2",
171
+ "mongodb": "^7.5.0",
148
172
  "multer": "^2.0.1",
149
173
  "passport": "^0.7.0",
150
174
  "typescript": "^5.8.3"