@unchainedshop/api 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/lib/chat/generateImageHandler.js +5 -6
  2. package/lib/express/createMCPMiddleware.js +1 -1
  3. package/lib/fastify/mcpHandler.js +1 -1
  4. package/lib/loaders/buildTextMap.js +13 -15
  5. package/lib/mcp/tools/assortment/assortmentManagement.d.ts +2 -2
  6. package/lib/mcp/tools/assortment/assortmentManagement.js +2 -2
  7. package/lib/mcp/tools/assortment/handlers/getAssortment.js +1 -1
  8. package/lib/mcp/tools/assortment/schemas.d.ts +141 -322
  9. package/lib/mcp/tools/assortment/schemas.js +96 -179
  10. package/lib/mcp/tools/filter/filterManagement.d.ts +2 -2
  11. package/lib/mcp/tools/filter/filterManagement.js +2 -2
  12. package/lib/mcp/tools/filter/schemas.d.ts +75 -184
  13. package/lib/mcp/tools/filter/schemas.js +51 -87
  14. package/lib/mcp/tools/localization/localizationManagement.d.ts +2 -2
  15. package/lib/mcp/tools/localization/localizationManagement.js +2 -2
  16. package/lib/mcp/tools/localization/schemas.d.ts +47 -110
  17. package/lib/mcp/tools/localization/schemas.js +36 -51
  18. package/lib/mcp/tools/order/orderManagement.d.ts +2 -2
  19. package/lib/mcp/tools/order/orderManagement.js +2 -2
  20. package/lib/mcp/tools/order/schemas.d.ts +75 -184
  21. package/lib/mcp/tools/order/schemas.js +51 -113
  22. package/lib/mcp/tools/product/handlers/getProduct.js +1 -1
  23. package/lib/mcp/tools/product/productManagement.d.ts +2 -2
  24. package/lib/mcp/tools/product/productManagement.js +2 -2
  25. package/lib/mcp/tools/product/schemas.d.ts +317 -642
  26. package/lib/mcp/tools/product/schemas.js +191 -287
  27. package/lib/mcp/tools/provider/providerManagement.d.ts +2 -2
  28. package/lib/mcp/tools/provider/providerManagement.js +2 -2
  29. package/lib/mcp/tools/provider/schemas.d.ts +47 -142
  30. package/lib/mcp/tools/provider/schemas.js +32 -67
  31. package/lib/mcp/tools/quotation/quotationManagement.d.ts +2 -2
  32. package/lib/mcp/tools/quotation/quotationManagement.js +2 -2
  33. package/lib/mcp/tools/quotation/schemas.d.ts +40 -111
  34. package/lib/mcp/tools/quotation/schemas.js +29 -54
  35. package/lib/mcp/tools/system/schemas.d.ts +84 -179
  36. package/lib/mcp/tools/system/schemas.js +67 -188
  37. package/lib/mcp/tools/system/systemManagement.d.ts +1 -1
  38. package/lib/mcp/tools/system/systemManagement.js +1 -1
  39. package/lib/mcp/tools/users/schemas.d.ts +163 -296
  40. package/lib/mcp/tools/users/schemas.js +71 -152
  41. package/lib/mcp/tools/users/usersManagement.d.ts +2 -2
  42. package/lib/mcp/tools/users/usersManagement.js +2 -2
  43. package/lib/mcp/utils/sharedSchemas.d.ts +39 -28
  44. package/lib/mcp/utils/sharedSchemas.js +47 -28
  45. package/lib/resolvers/mutations/accounts/changePassword.js +1 -4
  46. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4-mini';
2
2
  import mime from 'mime/lite';
3
3
  import { createLogger } from '@unchainedshop/logger';
4
4
  const logger = createLogger('unchained:api:mcp');
@@ -12,9 +12,9 @@ try {
12
12
  catch {
13
13
  }
14
14
  const inputSchema = z.object({
15
- prompt: z.string().describe('The prompt to generate the image from'),
15
+ prompt: z.string().check(z.describe('The prompt to generate the image from')),
16
16
  size: z
17
- .enum([
17
+ .optional(z.enum([
18
18
  '512x512',
19
19
  '768x768',
20
20
  '1024x1024',
@@ -26,9 +26,8 @@ const inputSchema = z.object({
26
26
  '1120x640',
27
27
  '1344x768',
28
28
  '1792x1024',
29
- ])
30
- .optional()
31
- .describe('The size of the image (default is 1024x1024).'),
29
+ ]))
30
+ .check(z.describe('The size of the image (default is 1024x1024).')),
32
31
  });
33
32
  const generateImageHandler = (req) => ({ model, uploadUrl = `${process.env.ROOT_URL}/temp-upload`, }) => {
34
33
  return tool({
@@ -1,4 +1,3 @@
1
- import initMCPServer from "../mcp/index.js";
2
1
  import { createLogger } from '@unchainedshop/logger';
3
2
  const logger = createLogger('unchained:api:mcp');
4
3
  let StreamableHTTPServerTransport;
@@ -35,6 +34,7 @@ const handlePostRequest = async (req, res) => {
35
34
  }
36
35
  };
37
36
  const roles = req.unchainedContext.user?.roles || [];
37
+ const { default: initMCPServer } = await import("../mcp/index.js");
38
38
  const server = initMCPServer(new McpServer({
39
39
  name: 'Unchained MCP Server',
40
40
  version: '1.0.0',
@@ -1,4 +1,3 @@
1
- import initMCPServer from "../mcp/index.js";
2
1
  import { createLogger } from '@unchainedshop/logger';
3
2
  const logger = createLogger('unchained:api:mcp');
4
3
  let StreamableHTTPServerTransport;
@@ -45,6 +44,7 @@ const mcpHandler = async (req, res) => {
45
44
  }
46
45
  };
47
46
  const roles = req.unchainedContext.user.roles || [];
47
+ const { default: initMCPServer } = await import("../mcp/index.js");
48
48
  const server = initMCPServer(new McpServer({
49
49
  name: 'Unchained MCP Server',
50
50
  version: '1.0.0',
@@ -1,22 +1,20 @@
1
1
  export default function buildTextMap(localeMap, texts, buildId) {
2
2
  const textsMap = {};
3
- const localeMapKeys = Object.keys(localeMap);
4
- for (let i = 0; i < localeMapKeys.length; i++) {
5
- const originLocale = localeMapKeys[i];
6
- const localesForText = localeMap[originLocale];
7
- for (let j = 0; j < texts.length; j++) {
8
- const text = texts[j];
9
- if (originLocale !== text.locale)
3
+ for (let j = 0; j < texts.length; j++) {
4
+ const text = texts[j];
5
+ if (!text.locale)
6
+ continue;
7
+ const localesForText = localeMap[text.locale];
8
+ if (!localesForText)
9
+ continue;
10
+ const idPart = buildId(text);
11
+ for (let k = 0; k < localesForText.length; k++) {
12
+ const locale = localesForText[k];
13
+ const key = locale + idPart;
14
+ if (textsMap[key] && locale !== text.locale) {
10
15
  continue;
11
- const idPart = buildId(text);
12
- for (let k = 0; k < localesForText.length; k++) {
13
- const locale = localesForText[k];
14
- const key = locale + idPart;
15
- if (textsMap[key] && locale !== text.locale) {
16
- continue;
17
- }
18
- textsMap[key] = text;
19
16
  }
17
+ textsMap[key] = text;
20
18
  }
21
19
  }
22
20
  return textsMap;
@@ -1,6 +1,6 @@
1
1
  import type { Context } from '../../../context.ts';
2
- import { AssortmentManagementSchema, AssortmentManagementZodSchema, type AssortmentManagementParams } from './schemas.ts';
3
- export { AssortmentManagementSchema, AssortmentManagementZodSchema };
2
+ import { AssortmentManagementSchema, type AssortmentManagementParams } from './schemas.ts';
3
+ export { AssortmentManagementSchema };
4
4
  export type { AssortmentManagementParams };
5
5
  export declare function assortmentManagement(context: Context, params: AssortmentManagementParams): Promise<{
6
6
  content: {
@@ -1,8 +1,8 @@
1
1
  import { log } from '@unchainedshop/logger';
2
- import { actionValidators, AssortmentManagementSchema, AssortmentManagementZodSchema, } from "./schemas.js";
2
+ import { actionValidators, AssortmentManagementSchema, } from "./schemas.js";
3
3
  import actionHandlers from "./handlers/index.js";
4
4
  import { createMcpResponse, createMcpErrorResponse } from "../../utils/sharedSchemas.js";
5
- export { AssortmentManagementSchema, AssortmentManagementZodSchema };
5
+ export { AssortmentManagementSchema };
6
6
  export async function assortmentManagement(context, params) {
7
7
  const { action, ...actionParams } = params;
8
8
  log('MCP assortmentManagement', { userId: context.userId, params });
@@ -3,7 +3,7 @@ import { getNormalizedAssortmentDetails } from "../../../utils/getNormalizedAsso
3
3
  export default async function getAssortment(context, params) {
4
4
  const { modules } = context;
5
5
  const { assortmentId, slug } = params;
6
- let query = {};
6
+ let query;
7
7
  if (assortmentId)
8
8
  query = { assortmentId };
9
9
  else if (slug)
@@ -1,369 +1,188 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4-mini';
2
2
  export declare const sortDirectionKeys: [string, ...string[]];
3
- export declare const AssortmentTextInputSchema: z.ZodObject<{
4
- locale: z.ZodString;
5
- title: z.ZodString;
6
- subtitle: z.ZodOptional<z.ZodString>;
7
- slug: z.ZodOptional<z.ZodString>;
8
- description: z.ZodOptional<z.ZodString>;
3
+ export declare const AssortmentTextInputSchema: z.ZodMiniObject<{
4
+ locale: z.ZodMiniString<string>;
5
+ title: z.ZodMiniString<string>;
6
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
7
+ slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
8
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
9
9
  }, z.core.$strip>;
10
- export declare const AssortmentMediaTextInputSchema: z.ZodObject<{
11
- locale: z.ZodString;
12
- title: z.ZodString;
13
- subtitle: z.ZodOptional<z.ZodString>;
10
+ export declare const AssortmentMediaTextInputSchema: z.ZodMiniObject<{
11
+ locale: z.ZodMiniString<string>;
12
+ title: z.ZodMiniString<string>;
13
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
14
14
  }, z.core.$strip>;
15
- export declare const AssortmentSchema: z.ZodObject<{
16
- isRoot: z.ZodOptional<z.ZodBoolean>;
17
- isActive: z.ZodOptional<z.ZodBoolean>;
18
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- sequence: z.ZodOptional<z.ZodNumber>;
20
- meta: z.ZodOptional<z.ZodRecord<z.ZodAny, z.ZodAny>>;
15
+ export declare const AssortmentSchema: z.ZodMiniObject<{
16
+ isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
17
+ isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
18
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
19
+ sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
20
+ meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
21
21
  }, z.core.$strip>;
22
22
  export declare const actionValidators: {
23
- readonly CREATE: z.ZodObject<{
24
- assortment: z.ZodObject<{
25
- isRoot: z.ZodOptional<z.ZodBoolean>;
26
- isActive: z.ZodOptional<z.ZodBoolean>;
27
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
- sequence: z.ZodOptional<z.ZodNumber>;
29
- meta: z.ZodOptional<z.ZodRecord<z.ZodAny, z.ZodAny>>;
23
+ readonly CREATE: z.ZodMiniObject<{
24
+ assortment: z.ZodMiniObject<{
25
+ isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
26
+ isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
27
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
28
+ sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
29
+ meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
30
30
  }, z.core.$strip>;
31
- texts: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
- locale: z.ZodString;
33
- title: z.ZodString;
34
- subtitle: z.ZodOptional<z.ZodString>;
35
- slug: z.ZodOptional<z.ZodString>;
36
- description: z.ZodOptional<z.ZodString>;
31
+ texts: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
32
+ locale: z.ZodMiniString<string>;
33
+ title: z.ZodMiniString<string>;
34
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
35
+ slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
36
+ description: z.ZodMiniOptional<z.ZodMiniString<string>>;
37
37
  }, z.core.$strip>>>;
38
38
  }, z.core.$strip>;
39
- readonly UPDATE: z.ZodObject<{
40
- assortmentId: z.ZodString;
41
- assortment: z.ZodObject<{
42
- isRoot: z.ZodOptional<z.ZodBoolean>;
43
- isActive: z.ZodOptional<z.ZodBoolean>;
44
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
- sequence: z.ZodOptional<z.ZodNumber>;
46
- meta: z.ZodOptional<z.ZodRecord<z.ZodAny, z.ZodAny>>;
39
+ readonly UPDATE: z.ZodMiniObject<{
40
+ assortmentId: z.ZodMiniString<string>;
41
+ assortment: z.ZodMiniObject<{
42
+ isRoot: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
43
+ isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
44
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
45
+ sequence: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
46
+ meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
47
47
  }, z.core.$strip>;
48
48
  }, z.core.$strip>;
49
- readonly REMOVE: z.ZodObject<{
50
- assortmentId: z.ZodString;
51
- }, z.core.$strip>;
52
- readonly GET: z.ZodObject<{
53
- assortmentId: z.ZodOptional<z.ZodString>;
54
- slug: z.ZodOptional<z.ZodString>;
55
- }, z.core.$strip>;
56
- readonly LIST: z.ZodObject<{
57
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
- slugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
- includeLeaves: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
60
- queryString: z.ZodOptional<z.ZodString>;
61
- includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
62
- sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
- key: z.ZodString;
64
- value: z.ZodEnum<{
49
+ readonly REMOVE: z.ZodMiniObject<{
50
+ assortmentId: z.ZodMiniString<string>;
51
+ }, z.core.$strip>;
52
+ readonly GET: z.ZodMiniObject<{
53
+ assortmentId: z.ZodMiniOptional<z.ZodMiniString<string>>;
54
+ slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
55
+ }, z.core.$strip>;
56
+ readonly LIST: z.ZodMiniObject<{
57
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
58
+ slugs: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
59
+ includeLeaves: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
60
+ queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
61
+ includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
62
+ sort: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
63
+ key: z.ZodMiniString<string>;
64
+ value: z.ZodMiniEnum<{
65
65
  [x: string]: string;
66
66
  }>;
67
67
  }, z.core.$strip>>>;
68
- limit: z.ZodOptional<z.ZodNumber>;
69
- offset: z.ZodOptional<z.ZodNumber>;
70
- }, z.core.$strip>;
71
- readonly COUNT: z.ZodObject<{
72
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
- slugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
- includeLeaves: z.ZodOptional<z.ZodBoolean>;
75
- queryString: z.ZodOptional<z.ZodString>;
76
- includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
77
- }, z.core.$strip>;
78
- readonly UPDATE_STATUS: z.ZodObject<{
79
- assortmentId: z.ZodString;
80
- statusAction: z.ZodEnum<{
68
+ limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
69
+ offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
70
+ }, z.core.$strip>;
71
+ readonly COUNT: z.ZodMiniObject<{
72
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
73
+ slugs: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
74
+ includeLeaves: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
75
+ queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
76
+ includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
77
+ }, z.core.$strip>;
78
+ readonly UPDATE_STATUS: z.ZodMiniObject<{
79
+ assortmentId: z.ZodMiniString<string>;
80
+ statusAction: z.ZodMiniEnum<{
81
81
  ACTIVATE: "ACTIVATE";
82
82
  DEACTIVATE: "DEACTIVATE";
83
83
  }>;
84
84
  }, z.core.$strip>;
85
- readonly ADD_MEDIA: z.ZodObject<{
86
- assortmentId: z.ZodString;
87
- mediaId: z.ZodString;
88
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
+ readonly ADD_MEDIA: z.ZodMiniObject<{
86
+ assortmentId: z.ZodMiniString<string>;
87
+ mediaId: z.ZodMiniString<string>;
88
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
89
89
  }, z.core.$strip>;
90
- readonly REMOVE_MEDIA: z.ZodObject<{
91
- mediaId: z.ZodString;
90
+ readonly REMOVE_MEDIA: z.ZodMiniObject<{
91
+ mediaId: z.ZodMiniString<string>;
92
92
  }, z.core.$strip>;
93
- readonly REORDER_MEDIA: z.ZodObject<{
94
- sortKeys: z.ZodArray<z.ZodObject<{
95
- assortmentMediaId: z.ZodString;
96
- sortKey: z.ZodNumber;
93
+ readonly REORDER_MEDIA: z.ZodMiniObject<{
94
+ sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
95
+ assortmentMediaId: z.ZodMiniString<string>;
96
+ sortKey: z.ZodMiniNumberFormat;
97
97
  }, z.core.$strip>>;
98
98
  }, z.core.$strip>;
99
- readonly GET_MEDIA: z.ZodObject<{
100
- limit: z.ZodOptional<z.ZodNumber>;
101
- offset: z.ZodOptional<z.ZodNumber>;
102
- assortmentId: z.ZodString;
103
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
- }, z.core.$strip>;
105
- readonly UPDATE_MEDIA_TEXTS: z.ZodObject<{
106
- assortmentMediaId: z.ZodString;
107
- mediaTexts: z.ZodArray<z.ZodObject<{
108
- locale: z.ZodString;
109
- title: z.ZodString;
110
- subtitle: z.ZodOptional<z.ZodString>;
99
+ readonly GET_MEDIA: z.ZodMiniObject<{
100
+ limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
101
+ offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
102
+ assortmentId: z.ZodMiniString<string>;
103
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
104
+ }, z.core.$strip>;
105
+ readonly UPDATE_MEDIA_TEXTS: z.ZodMiniObject<{
106
+ assortmentMediaId: z.ZodMiniString<string>;
107
+ mediaTexts: z.ZodMiniArray<z.ZodMiniObject<{
108
+ locale: z.ZodMiniString<string>;
109
+ title: z.ZodMiniString<string>;
110
+ subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
111
111
  }, z.core.$strip>>;
112
112
  }, z.core.$strip>;
113
- readonly ADD_PRODUCT: z.ZodObject<{
114
- assortmentId: z.ZodString;
115
- productId: z.ZodString;
116
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
113
+ readonly ADD_PRODUCT: z.ZodMiniObject<{
114
+ assortmentId: z.ZodMiniString<string>;
115
+ productId: z.ZodMiniString<string>;
116
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
117
117
  }, z.core.$strip>;
118
- readonly REMOVE_PRODUCT: z.ZodObject<{
119
- assortmentProductId: z.ZodString;
118
+ readonly REMOVE_PRODUCT: z.ZodMiniObject<{
119
+ assortmentProductId: z.ZodMiniString<string>;
120
120
  }, z.core.$strip>;
121
- readonly GET_PRODUCTS: z.ZodObject<{
122
- assortmentId: z.ZodString;
121
+ readonly GET_PRODUCTS: z.ZodMiniObject<{
122
+ assortmentId: z.ZodMiniString<string>;
123
123
  }, z.core.$strip>;
124
- readonly REORDER_PRODUCTS: z.ZodObject<{
125
- sortKeys: z.ZodArray<z.ZodObject<{
126
- assortmentProductId: z.ZodString;
127
- sortKey: z.ZodNumber;
124
+ readonly REORDER_PRODUCTS: z.ZodMiniObject<{
125
+ sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
126
+ assortmentProductId: z.ZodMiniString<string>;
127
+ sortKey: z.ZodMiniNumberFormat;
128
128
  }, z.core.$strip>>;
129
129
  }, z.core.$strip>;
130
- readonly ADD_FILTER: z.ZodObject<{
131
- assortmentId: z.ZodString;
132
- filterId: z.ZodString;
133
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
130
+ readonly ADD_FILTER: z.ZodMiniObject<{
131
+ assortmentId: z.ZodMiniString<string>;
132
+ filterId: z.ZodMiniString<string>;
133
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
134
134
  }, z.core.$strip>;
135
- readonly REMOVE_FILTER: z.ZodObject<{
136
- assortmentFilterId: z.ZodString;
135
+ readonly REMOVE_FILTER: z.ZodMiniObject<{
136
+ assortmentFilterId: z.ZodMiniString<string>;
137
137
  }, z.core.$strip>;
138
- readonly GET_FILTERS: z.ZodObject<{
139
- assortmentId: z.ZodString;
138
+ readonly GET_FILTERS: z.ZodMiniObject<{
139
+ assortmentId: z.ZodMiniString<string>;
140
140
  }, z.core.$strip>;
141
- readonly REORDER_FILTERS: z.ZodObject<{
142
- sortKeys: z.ZodArray<z.ZodObject<{
143
- assortmentFilterId: z.ZodString;
144
- sortKey: z.ZodNumber;
141
+ readonly REORDER_FILTERS: z.ZodMiniObject<{
142
+ sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
143
+ assortmentFilterId: z.ZodMiniString<string>;
144
+ sortKey: z.ZodMiniNumberFormat;
145
145
  }, z.core.$strip>>;
146
146
  }, z.core.$strip>;
147
- readonly ADD_LINK: z.ZodObject<{
148
- parentAssortmentId: z.ZodString;
149
- childAssortmentId: z.ZodString;
150
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ readonly ADD_LINK: z.ZodMiniObject<{
148
+ parentAssortmentId: z.ZodMiniString<string>;
149
+ childAssortmentId: z.ZodMiniString<string>;
150
+ tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
151
151
  }, z.core.$strip>;
152
- readonly REMOVE_LINK: z.ZodObject<{
153
- assortmentLinkId: z.ZodString;
152
+ readonly REMOVE_LINK: z.ZodMiniObject<{
153
+ assortmentLinkId: z.ZodMiniString<string>;
154
154
  }, z.core.$strip>;
155
- readonly GET_LINKS: z.ZodObject<{
156
- assortmentId: z.ZodString;
155
+ readonly GET_LINKS: z.ZodMiniObject<{
156
+ assortmentId: z.ZodMiniString<string>;
157
157
  }, z.core.$strip>;
158
- readonly REORDER_LINKS: z.ZodObject<{
159
- sortKeys: z.ZodArray<z.ZodObject<{
160
- assortmentLinkId: z.ZodString;
161
- sortKey: z.ZodNumber;
158
+ readonly REORDER_LINKS: z.ZodMiniObject<{
159
+ sortKeys: z.ZodMiniArray<z.ZodMiniObject<{
160
+ assortmentLinkId: z.ZodMiniString<string>;
161
+ sortKey: z.ZodMiniNumberFormat;
162
162
  }, z.core.$strip>>;
163
163
  }, z.core.$strip>;
164
- readonly GET_CHILDREN: z.ZodObject<{
165
- assortmentId: z.ZodString;
166
- includeInactive: z.ZodOptional<z.ZodBoolean>;
164
+ readonly GET_CHILDREN: z.ZodMiniObject<{
165
+ assortmentId: z.ZodMiniString<string>;
166
+ includeInactive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
167
167
  }, z.core.$strip>;
168
- readonly SEARCH_PRODUCTS: z.ZodObject<{
169
- queryString: z.ZodOptional<z.ZodString>;
170
- includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
171
- limit: z.ZodOptional<z.ZodNumber>;
172
- offset: z.ZodOptional<z.ZodNumber>;
173
- assortmentId: z.ZodString;
168
+ readonly SEARCH_PRODUCTS: z.ZodMiniObject<{
169
+ queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
170
+ includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
171
+ limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
172
+ offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
173
+ assortmentId: z.ZodMiniString<string>;
174
174
  }, z.core.$strip>;
175
- readonly GET_TEXTS: z.ZodObject<{
176
- assortmentId: z.ZodString;
175
+ readonly GET_TEXTS: z.ZodMiniObject<{
176
+ assortmentId: z.ZodMiniString<string>;
177
177
  }, z.core.$strip>;
178
- readonly GET_MEDIA_TEXTS: z.ZodObject<{
179
- assortmentMediaId: z.ZodString;
178
+ readonly GET_MEDIA_TEXTS: z.ZodMiniObject<{
179
+ assortmentMediaId: z.ZodMiniString<string>;
180
180
  }, z.core.$strip>;
181
181
  };
182
182
  export declare const AssortmentManagementSchema: {
183
- includeLeaves: z.ZodOptional<z.ZodBoolean>;
184
- slugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
- queryString: z.ZodOptional<z.ZodString>;
186
- includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
187
- sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
188
- key: z.ZodString;
189
- value: z.ZodEnum<{
190
- [x: string]: string;
191
- }>;
192
- }, z.core.$strip>>>;
193
- limit: z.ZodOptional<z.ZodNumber>;
194
- offset: z.ZodOptional<z.ZodNumber>;
195
- action: z.ZodEnum<{
196
- GET: "GET";
197
- CREATE: "CREATE";
198
- UPDATE: "UPDATE";
199
- REMOVE: "REMOVE";
200
- LIST: "LIST";
201
- COUNT: "COUNT";
202
- GET_TEXTS: "GET_TEXTS";
203
- UPDATE_STATUS: "UPDATE_STATUS";
204
- ADD_MEDIA: "ADD_MEDIA";
205
- REMOVE_MEDIA: "REMOVE_MEDIA";
206
- REORDER_MEDIA: "REORDER_MEDIA";
207
- GET_MEDIA: "GET_MEDIA";
208
- UPDATE_MEDIA_TEXTS: "UPDATE_MEDIA_TEXTS";
209
- GET_MEDIA_TEXTS: "GET_MEDIA_TEXTS";
210
- ADD_PRODUCT: "ADD_PRODUCT";
211
- REMOVE_PRODUCT: "REMOVE_PRODUCT";
212
- GET_PRODUCTS: "GET_PRODUCTS";
213
- REORDER_PRODUCTS: "REORDER_PRODUCTS";
214
- ADD_FILTER: "ADD_FILTER";
215
- REMOVE_FILTER: "REMOVE_FILTER";
216
- GET_FILTERS: "GET_FILTERS";
217
- REORDER_FILTERS: "REORDER_FILTERS";
218
- ADD_LINK: "ADD_LINK";
219
- REMOVE_LINK: "REMOVE_LINK";
220
- GET_LINKS: "GET_LINKS";
221
- REORDER_LINKS: "REORDER_LINKS";
222
- GET_CHILDREN: "GET_CHILDREN";
223
- SEARCH_PRODUCTS: "SEARCH_PRODUCTS";
224
- }>;
225
- assortmentId: z.ZodOptional<z.ZodString>;
226
- slug: z.ZodOptional<z.ZodString>;
227
- assortmentMediaId: z.ZodOptional<z.ZodString>;
228
- assortment: z.ZodOptional<z.ZodObject<{
229
- isRoot: z.ZodOptional<z.ZodBoolean>;
230
- isActive: z.ZodOptional<z.ZodBoolean>;
231
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
232
- sequence: z.ZodOptional<z.ZodNumber>;
233
- meta: z.ZodOptional<z.ZodRecord<z.ZodAny, z.ZodAny>>;
234
- }, z.core.$strip>>;
235
- texts: z.ZodOptional<z.ZodArray<z.ZodObject<{
236
- locale: z.ZodString;
237
- title: z.ZodString;
238
- subtitle: z.ZodOptional<z.ZodString>;
239
- slug: z.ZodOptional<z.ZodString>;
240
- description: z.ZodOptional<z.ZodString>;
241
- }, z.core.$strip>>>;
242
- statusAction: z.ZodOptional<z.ZodEnum<{
243
- ACTIVATE: "ACTIVATE";
244
- DEACTIVATE: "DEACTIVATE";
245
- }>>;
246
- mediaId: z.ZodOptional<z.ZodString>;
247
- sortKeys: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
248
- assortmentMediaId: z.ZodString;
249
- sortKey: z.ZodNumber;
250
- }, z.core.$strip>, z.ZodObject<{
251
- assortmentProductId: z.ZodString;
252
- sortKey: z.ZodNumber;
253
- }, z.core.$strip>, z.ZodObject<{
254
- assortmentFilterId: z.ZodString;
255
- sortKey: z.ZodNumber;
256
- }, z.core.$strip>, z.ZodObject<{
257
- assortmentLinkId: z.ZodString;
258
- sortKey: z.ZodNumber;
259
- }, z.core.$strip>]>>>;
260
- mediaTexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
261
- locale: z.ZodString;
262
- title: z.ZodString;
263
- subtitle: z.ZodOptional<z.ZodString>;
264
- }, z.core.$strip>>>;
265
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
266
- assortmentProductId: z.ZodOptional<z.ZodString>;
267
- productId: z.ZodOptional<z.ZodString>;
268
- filterId: z.ZodOptional<z.ZodString>;
269
- assortmentFilterId: z.ZodOptional<z.ZodString>;
270
- parentAssortmentId: z.ZodOptional<z.ZodString>;
271
- childAssortmentId: z.ZodOptional<z.ZodString>;
272
- assortmentLinkId: z.ZodOptional<z.ZodString>;
273
- };
274
- export declare const AssortmentManagementZodSchema: z.ZodObject<{
275
- includeLeaves: z.ZodOptional<z.ZodBoolean>;
276
- slugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
- queryString: z.ZodOptional<z.ZodString>;
278
- includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
279
- sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
280
- key: z.ZodString;
281
- value: z.ZodEnum<{
282
- [x: string]: string;
283
- }>;
284
- }, z.core.$strip>>>;
285
- limit: z.ZodOptional<z.ZodNumber>;
286
- offset: z.ZodOptional<z.ZodNumber>;
287
- action: z.ZodEnum<{
288
- GET: "GET";
289
- CREATE: "CREATE";
290
- UPDATE: "UPDATE";
291
- REMOVE: "REMOVE";
292
- LIST: "LIST";
293
- COUNT: "COUNT";
294
- GET_TEXTS: "GET_TEXTS";
295
- UPDATE_STATUS: "UPDATE_STATUS";
296
- ADD_MEDIA: "ADD_MEDIA";
297
- REMOVE_MEDIA: "REMOVE_MEDIA";
298
- REORDER_MEDIA: "REORDER_MEDIA";
299
- GET_MEDIA: "GET_MEDIA";
300
- UPDATE_MEDIA_TEXTS: "UPDATE_MEDIA_TEXTS";
301
- GET_MEDIA_TEXTS: "GET_MEDIA_TEXTS";
302
- ADD_PRODUCT: "ADD_PRODUCT";
303
- REMOVE_PRODUCT: "REMOVE_PRODUCT";
304
- GET_PRODUCTS: "GET_PRODUCTS";
305
- REORDER_PRODUCTS: "REORDER_PRODUCTS";
306
- ADD_FILTER: "ADD_FILTER";
307
- REMOVE_FILTER: "REMOVE_FILTER";
308
- GET_FILTERS: "GET_FILTERS";
309
- REORDER_FILTERS: "REORDER_FILTERS";
310
- ADD_LINK: "ADD_LINK";
311
- REMOVE_LINK: "REMOVE_LINK";
312
- GET_LINKS: "GET_LINKS";
313
- REORDER_LINKS: "REORDER_LINKS";
314
- GET_CHILDREN: "GET_CHILDREN";
315
- SEARCH_PRODUCTS: "SEARCH_PRODUCTS";
316
- }>;
317
- assortmentId: z.ZodOptional<z.ZodString>;
318
- slug: z.ZodOptional<z.ZodString>;
319
- assortmentMediaId: z.ZodOptional<z.ZodString>;
320
- assortment: z.ZodOptional<z.ZodObject<{
321
- isRoot: z.ZodOptional<z.ZodBoolean>;
322
- isActive: z.ZodOptional<z.ZodBoolean>;
323
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
324
- sequence: z.ZodOptional<z.ZodNumber>;
325
- meta: z.ZodOptional<z.ZodRecord<z.ZodAny, z.ZodAny>>;
326
- }, z.core.$strip>>;
327
- texts: z.ZodOptional<z.ZodArray<z.ZodObject<{
328
- locale: z.ZodString;
329
- title: z.ZodString;
330
- subtitle: z.ZodOptional<z.ZodString>;
331
- slug: z.ZodOptional<z.ZodString>;
332
- description: z.ZodOptional<z.ZodString>;
333
- }, z.core.$strip>>>;
334
- statusAction: z.ZodOptional<z.ZodEnum<{
335
- ACTIVATE: "ACTIVATE";
336
- DEACTIVATE: "DEACTIVATE";
337
- }>>;
338
- mediaId: z.ZodOptional<z.ZodString>;
339
- sortKeys: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
340
- assortmentMediaId: z.ZodString;
341
- sortKey: z.ZodNumber;
342
- }, z.core.$strip>, z.ZodObject<{
343
- assortmentProductId: z.ZodString;
344
- sortKey: z.ZodNumber;
345
- }, z.core.$strip>, z.ZodObject<{
346
- assortmentFilterId: z.ZodString;
347
- sortKey: z.ZodNumber;
348
- }, z.core.$strip>, z.ZodObject<{
349
- assortmentLinkId: z.ZodString;
350
- sortKey: z.ZodNumber;
351
- }, z.core.$strip>]>>>;
352
- mediaTexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
353
- locale: z.ZodString;
354
- title: z.ZodString;
355
- subtitle: z.ZodOptional<z.ZodString>;
356
- }, z.core.$strip>>>;
357
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
358
- assortmentProductId: z.ZodOptional<z.ZodString>;
359
- productId: z.ZodOptional<z.ZodString>;
360
- filterId: z.ZodOptional<z.ZodString>;
361
- assortmentFilterId: z.ZodOptional<z.ZodString>;
362
- parentAssortmentId: z.ZodOptional<z.ZodString>;
363
- childAssortmentId: z.ZodOptional<z.ZodString>;
364
- assortmentLinkId: z.ZodOptional<z.ZodString>;
365
- }, z.core.$strip>;
366
- export type AssortmentManagementParams = z.infer<typeof AssortmentManagementZodSchema>;
183
+ action: z.core.$ZodType<string>;
184
+ } & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
185
+ export type { ManagementParams as AssortmentManagementParams } from '../../utils/sharedSchemas.ts';
367
186
  export type ActionName = keyof typeof actionValidators;
368
187
  export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
369
188
  export type Handler<T extends ActionName> = (assortmentModule: any, params: Params<T>) => Promise<unknown>;