@unchainedshop/api 4.8.0 → 4.8.2
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/chat/generateImageHandler.js +5 -6
- package/lib/express/createBulkImportMiddleware.js +3 -2
- package/lib/express/createMCPMiddleware.js +1 -1
- package/lib/fastify/bulkImportHandler.js +3 -2
- package/lib/fastify/mcpHandler.js +1 -1
- package/lib/loaders/buildTextMap.js +13 -15
- package/lib/mcp/tools/assortment/assortmentManagement.d.ts +2 -2
- package/lib/mcp/tools/assortment/assortmentManagement.js +2 -2
- package/lib/mcp/tools/assortment/handlers/getAssortment.js +1 -1
- package/lib/mcp/tools/assortment/schemas.d.ts +141 -322
- package/lib/mcp/tools/assortment/schemas.js +96 -179
- package/lib/mcp/tools/filter/filterManagement.d.ts +2 -2
- package/lib/mcp/tools/filter/filterManagement.js +2 -2
- package/lib/mcp/tools/filter/schemas.d.ts +75 -184
- package/lib/mcp/tools/filter/schemas.js +51 -87
- package/lib/mcp/tools/localization/localizationManagement.d.ts +2 -2
- package/lib/mcp/tools/localization/localizationManagement.js +2 -2
- package/lib/mcp/tools/localization/schemas.d.ts +47 -110
- package/lib/mcp/tools/localization/schemas.js +36 -51
- package/lib/mcp/tools/order/orderManagement.d.ts +2 -2
- package/lib/mcp/tools/order/orderManagement.js +2 -2
- package/lib/mcp/tools/order/schemas.d.ts +75 -184
- package/lib/mcp/tools/order/schemas.js +51 -113
- package/lib/mcp/tools/product/handlers/getProduct.js +1 -1
- package/lib/mcp/tools/product/productManagement.d.ts +2 -2
- package/lib/mcp/tools/product/productManagement.js +2 -2
- package/lib/mcp/tools/product/schemas.d.ts +317 -642
- package/lib/mcp/tools/product/schemas.js +191 -287
- package/lib/mcp/tools/provider/providerManagement.d.ts +2 -2
- package/lib/mcp/tools/provider/providerManagement.js +2 -2
- package/lib/mcp/tools/provider/schemas.d.ts +47 -142
- package/lib/mcp/tools/provider/schemas.js +32 -67
- package/lib/mcp/tools/quotation/quotationManagement.d.ts +2 -2
- package/lib/mcp/tools/quotation/quotationManagement.js +2 -2
- package/lib/mcp/tools/quotation/schemas.d.ts +40 -111
- package/lib/mcp/tools/quotation/schemas.js +29 -54
- package/lib/mcp/tools/system/schemas.d.ts +84 -179
- package/lib/mcp/tools/system/schemas.js +67 -188
- package/lib/mcp/tools/system/systemManagement.d.ts +1 -1
- package/lib/mcp/tools/system/systemManagement.js +1 -1
- package/lib/mcp/tools/users/schemas.d.ts +163 -296
- package/lib/mcp/tools/users/schemas.js +71 -152
- package/lib/mcp/tools/users/usersManagement.d.ts +2 -2
- package/lib/mcp/tools/users/usersManagement.js +2 -2
- package/lib/mcp/utils/sharedSchemas.d.ts +39 -28
- package/lib/mcp/utils/sharedSchemas.js +47 -28
- package/lib/resolvers/mutations/accounts/changePassword.js +1 -4
- package/lib/resolvers/mutations/worker/addWork.js +2 -2
- package/lib/resolvers/queries/events/registeredEventTypes.d.ts +1 -0
- package/lib/resolvers/queries/events/registeredEventTypes.js +4 -0
- package/lib/resolvers/queries/index.d.ts +1 -0
- package/lib/resolvers/queries/index.js +2 -0
- package/lib/schema/query.js +5 -0
- package/package.json +1 -1
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import { SortDirection } from '@unchainedshop/utils';
|
|
3
3
|
export declare const sortDirectionKeys: [keyof typeof SortDirection, ...(keyof typeof SortDirection)[]];
|
|
4
|
-
export declare const LocalizationTypeEnum: z.
|
|
4
|
+
export declare const LocalizationTypeEnum: z.ZodMiniEnum<{
|
|
5
5
|
COUNTRY: "COUNTRY";
|
|
6
6
|
CURRENCY: "CURRENCY";
|
|
7
7
|
LANGUAGE: "LANGUAGE";
|
|
8
8
|
}>;
|
|
9
|
-
export declare const LocalizationEntitySchema: z.
|
|
10
|
-
isoCode: z.
|
|
11
|
-
isActive: z.
|
|
12
|
-
defaultCurrencyCode: z.
|
|
13
|
-
contractAddress: z.
|
|
14
|
-
decimals: z.
|
|
9
|
+
export declare const LocalizationEntitySchema: z.ZodMiniObject<{
|
|
10
|
+
isoCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
11
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
12
|
+
defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
13
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
14
|
+
decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
export declare const actionValidators: {
|
|
17
|
-
readonly CREATE: z.
|
|
18
|
-
localizationType: z.
|
|
17
|
+
readonly CREATE: z.ZodMiniObject<{
|
|
18
|
+
localizationType: z.ZodMiniEnum<{
|
|
19
19
|
COUNTRY: "COUNTRY";
|
|
20
20
|
CURRENCY: "CURRENCY";
|
|
21
21
|
LANGUAGE: "LANGUAGE";
|
|
22
22
|
}>;
|
|
23
|
-
entity: z.
|
|
24
|
-
isActive: z.
|
|
25
|
-
defaultCurrencyCode: z.
|
|
26
|
-
contractAddress: z.
|
|
27
|
-
decimals: z.
|
|
28
|
-
isoCode: z.
|
|
23
|
+
entity: z.ZodMiniObject<{
|
|
24
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
25
|
+
defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
26
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
27
|
+
decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
28
|
+
isoCode: z.ZodMiniString<string>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
|
-
readonly UPDATE: z.
|
|
32
|
-
localizationType: z.
|
|
31
|
+
readonly UPDATE: z.ZodMiniObject<{
|
|
32
|
+
localizationType: z.ZodMiniEnum<{
|
|
33
33
|
COUNTRY: "COUNTRY";
|
|
34
34
|
CURRENCY: "CURRENCY";
|
|
35
35
|
LANGUAGE: "LANGUAGE";
|
|
36
36
|
}>;
|
|
37
|
-
entityId: z.
|
|
38
|
-
entity: z.
|
|
39
|
-
isoCode: z.
|
|
40
|
-
isActive: z.
|
|
41
|
-
defaultCurrencyCode: z.
|
|
42
|
-
contractAddress: z.
|
|
43
|
-
decimals: z.
|
|
37
|
+
entityId: z.ZodMiniString<string>;
|
|
38
|
+
entity: z.ZodMiniObject<{
|
|
39
|
+
isoCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
40
|
+
isActive: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
41
|
+
defaultCurrencyCode: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
42
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
decimals: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
44
44
|
}, z.core.$strip>;
|
|
45
45
|
}, z.core.$strip>;
|
|
46
|
-
readonly REMOVE: z.
|
|
47
|
-
localizationType: z.
|
|
46
|
+
readonly REMOVE: z.ZodMiniObject<{
|
|
47
|
+
localizationType: z.ZodMiniEnum<{
|
|
48
48
|
COUNTRY: "COUNTRY";
|
|
49
49
|
CURRENCY: "CURRENCY";
|
|
50
50
|
LANGUAGE: "LANGUAGE";
|
|
51
51
|
}>;
|
|
52
|
-
entityId: z.
|
|
52
|
+
entityId: z.ZodMiniString<string>;
|
|
53
53
|
}, z.core.$strip>;
|
|
54
|
-
readonly GET: z.
|
|
55
|
-
localizationType: z.
|
|
54
|
+
readonly GET: z.ZodMiniObject<{
|
|
55
|
+
localizationType: z.ZodMiniEnum<{
|
|
56
56
|
COUNTRY: "COUNTRY";
|
|
57
57
|
CURRENCY: "CURRENCY";
|
|
58
58
|
LANGUAGE: "LANGUAGE";
|
|
59
59
|
}>;
|
|
60
|
-
entityId: z.
|
|
60
|
+
entityId: z.ZodMiniString<string>;
|
|
61
61
|
}, z.core.$strip>;
|
|
62
|
-
readonly LIST: z.
|
|
63
|
-
queryString: z.
|
|
64
|
-
includeInactive: z.
|
|
65
|
-
sort: z.
|
|
66
|
-
key: z.
|
|
67
|
-
value: z.
|
|
62
|
+
readonly LIST: z.ZodMiniObject<{
|
|
63
|
+
queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
64
|
+
includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
|
|
65
|
+
sort: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
66
|
+
key: z.ZodMiniString<string>;
|
|
67
|
+
value: z.ZodMiniEnum<{
|
|
68
68
|
[x: string]: string;
|
|
69
69
|
}>;
|
|
70
70
|
}, z.core.$strip>>>;
|
|
71
|
-
limit: z.
|
|
72
|
-
offset: z.
|
|
73
|
-
localizationType: z.
|
|
71
|
+
limit: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
72
|
+
offset: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
|
|
73
|
+
localizationType: z.ZodMiniEnum<{
|
|
74
74
|
COUNTRY: "COUNTRY";
|
|
75
75
|
CURRENCY: "CURRENCY";
|
|
76
76
|
LANGUAGE: "LANGUAGE";
|
|
77
77
|
}>;
|
|
78
78
|
}, z.core.$strip>;
|
|
79
|
-
readonly COUNT: z.
|
|
80
|
-
queryString: z.
|
|
81
|
-
includeInactive: z.
|
|
82
|
-
localizationType: z.
|
|
79
|
+
readonly COUNT: z.ZodMiniObject<{
|
|
80
|
+
queryString: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
81
|
+
includeInactive: z.ZodMiniDefault<z.ZodMiniBoolean<boolean>>;
|
|
82
|
+
localizationType: z.ZodMiniEnum<{
|
|
83
83
|
COUNTRY: "COUNTRY";
|
|
84
84
|
CURRENCY: "CURRENCY";
|
|
85
85
|
LANGUAGE: "LANGUAGE";
|
|
@@ -87,72 +87,9 @@ export declare const actionValidators: {
|
|
|
87
87
|
}, z.core.$strip>;
|
|
88
88
|
};
|
|
89
89
|
export declare const LocalizationManagementSchema: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
key: z.ZodString;
|
|
94
|
-
value: z.ZodEnum<{
|
|
95
|
-
[x: string]: string;
|
|
96
|
-
}>;
|
|
97
|
-
}, z.core.$strip>>>;
|
|
98
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
99
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
action: z.ZodEnum<{
|
|
101
|
-
GET: "GET";
|
|
102
|
-
CREATE: "CREATE";
|
|
103
|
-
UPDATE: "UPDATE";
|
|
104
|
-
REMOVE: "REMOVE";
|
|
105
|
-
LIST: "LIST";
|
|
106
|
-
COUNT: "COUNT";
|
|
107
|
-
}>;
|
|
108
|
-
localizationType: z.ZodEnum<{
|
|
109
|
-
COUNTRY: "COUNTRY";
|
|
110
|
-
CURRENCY: "CURRENCY";
|
|
111
|
-
LANGUAGE: "LANGUAGE";
|
|
112
|
-
}>;
|
|
113
|
-
entity: z.ZodOptional<z.ZodObject<{
|
|
114
|
-
isoCode: z.ZodOptional<z.ZodString>;
|
|
115
|
-
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
-
defaultCurrencyCode: z.ZodOptional<z.ZodString>;
|
|
117
|
-
contractAddress: z.ZodOptional<z.ZodString>;
|
|
118
|
-
decimals: z.ZodOptional<z.ZodNumber>;
|
|
119
|
-
}, z.core.$strip>>;
|
|
120
|
-
entityId: z.ZodOptional<z.ZodString>;
|
|
121
|
-
};
|
|
122
|
-
export declare const LocalizationManagementZodSchema: z.ZodObject<{
|
|
123
|
-
queryString: z.ZodOptional<z.ZodString>;
|
|
124
|
-
includeInactive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
125
|
-
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
126
|
-
key: z.ZodString;
|
|
127
|
-
value: z.ZodEnum<{
|
|
128
|
-
[x: string]: string;
|
|
129
|
-
}>;
|
|
130
|
-
}, z.core.$strip>>>;
|
|
131
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
132
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
133
|
-
action: z.ZodEnum<{
|
|
134
|
-
GET: "GET";
|
|
135
|
-
CREATE: "CREATE";
|
|
136
|
-
UPDATE: "UPDATE";
|
|
137
|
-
REMOVE: "REMOVE";
|
|
138
|
-
LIST: "LIST";
|
|
139
|
-
COUNT: "COUNT";
|
|
140
|
-
}>;
|
|
141
|
-
localizationType: z.ZodEnum<{
|
|
142
|
-
COUNTRY: "COUNTRY";
|
|
143
|
-
CURRENCY: "CURRENCY";
|
|
144
|
-
LANGUAGE: "LANGUAGE";
|
|
145
|
-
}>;
|
|
146
|
-
entity: z.ZodOptional<z.ZodObject<{
|
|
147
|
-
isoCode: z.ZodOptional<z.ZodString>;
|
|
148
|
-
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
-
defaultCurrencyCode: z.ZodOptional<z.ZodString>;
|
|
150
|
-
contractAddress: z.ZodOptional<z.ZodString>;
|
|
151
|
-
decimals: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
}, z.core.$strip>>;
|
|
153
|
-
entityId: z.ZodOptional<z.ZodString>;
|
|
154
|
-
}, z.core.$strip>;
|
|
155
|
-
export type LocalizationManagementParams = z.infer<typeof LocalizationManagementZodSchema>;
|
|
90
|
+
action: z.core.$ZodType<string>;
|
|
91
|
+
} & Record<string, z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
92
|
+
export type { ManagementParams as LocalizationManagementParams } from '../../utils/sharedSchemas.ts';
|
|
156
93
|
export type ActionName = keyof typeof actionValidators;
|
|
157
94
|
export type Params<T extends ActionName> = z.infer<(typeof actionValidators)[T]>;
|
|
158
95
|
export type Handler<T extends ActionName> = (localizationModule: any, params: Params<T>) => Promise<unknown>;
|
|
@@ -1,83 +1,68 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import { SortDirection } from '@unchainedshop/utils';
|
|
3
|
-
import { PaginationSchema, SortingSchema, SearchSchema } from "../../utils/sharedSchemas.js";
|
|
3
|
+
import { PaginationSchema, SortingSchema, SearchSchema, createManagementSchemaFromValidators, } from "../../utils/sharedSchemas.js";
|
|
4
4
|
export const sortDirectionKeys = Object.keys(SortDirection);
|
|
5
5
|
export const LocalizationTypeEnum = z
|
|
6
6
|
.enum(['COUNTRY', 'CURRENCY', 'LANGUAGE'])
|
|
7
|
-
.describe('Type of localization entity - COUNTRY for geographic regions (US, DE, CH), CURRENCY for monetary units (USD, EUR, CHF), LANGUAGE for locale support (en, de, fr)');
|
|
7
|
+
.check(z.describe('Type of localization entity - COUNTRY for geographic regions (US, DE, CH), CURRENCY for monetary units (USD, EUR, CHF), LANGUAGE for locale support (en, de, fr)'));
|
|
8
8
|
export const LocalizationEntitySchema = z.object({
|
|
9
9
|
isoCode: z
|
|
10
|
-
.string()
|
|
11
|
-
.
|
|
12
|
-
.optional()
|
|
13
|
-
.describe('ISO identifier: Countries need 2-letter codes (US, DE), Currencies need 3-letter codes (USD, EUR), Languages accept 2-10 characters (en, de-CH). isoCode is required for both CREATE and UPDATE operations'),
|
|
10
|
+
.optional(z.string().check(z.minLength(1)))
|
|
11
|
+
.check(z.describe('ISO identifier: Countries need 2-letter codes (US, DE), Currencies need 3-letter codes (USD, EUR), Languages accept 2-10 characters (en, de-CH). isoCode is required for both CREATE and UPDATE operations')),
|
|
14
12
|
isActive: z
|
|
15
|
-
.boolean()
|
|
16
|
-
.
|
|
17
|
-
.describe('Active status for the entity - used for all localization types (COUNTRY, CURRENCY, LANGUAGE)'),
|
|
13
|
+
.optional(z.boolean())
|
|
14
|
+
.check(z.describe('Active status for the entity - used for all localization types (COUNTRY, CURRENCY, LANGUAGE)')),
|
|
18
15
|
defaultCurrencyCode: z
|
|
19
|
-
.string()
|
|
20
|
-
.
|
|
21
|
-
.describe('Default currency code for the country - only used when localizationType is COUNTRY, ignored otherwise'),
|
|
16
|
+
.optional(z.string())
|
|
17
|
+
.check(z.describe('Default currency code for the country - only used when localizationType is COUNTRY, ignored otherwise')),
|
|
22
18
|
contractAddress: z
|
|
19
|
+
.optional(z
|
|
23
20
|
.string()
|
|
24
|
-
.regex(/^0x[a-fA-F0-9]{40}$/, 'Must be a valid 42-character blockchain address starting with 0x')
|
|
25
|
-
.
|
|
26
|
-
.describe('Blockchain contract address for tokenized currencies - only used when localizationType is CURRENCY, ignored otherwise'),
|
|
21
|
+
.check(z.regex(/^0x[a-fA-F0-9]{40}$/, 'Must be a valid 42-character blockchain address starting with 0x')))
|
|
22
|
+
.check(z.describe('Blockchain contract address for tokenized currencies - only used when localizationType is CURRENCY, ignored otherwise')),
|
|
27
23
|
decimals: z
|
|
28
|
-
.
|
|
29
|
-
.
|
|
30
|
-
.nonnegative()
|
|
31
|
-
.optional()
|
|
32
|
-
.describe('Decimal precision for currency calculations - only used when localizationType is CURRENCY (2 for traditional currencies like USD, 18 for crypto tokens), ignored otherwise'),
|
|
24
|
+
.optional(z.int().check(z.nonnegative()))
|
|
25
|
+
.check(z.describe('Decimal precision for currency calculations - only used when localizationType is CURRENCY (2 for traditional currencies like USD, 18 for crypto tokens), ignored otherwise')),
|
|
33
26
|
});
|
|
34
27
|
export const actionValidators = {
|
|
35
28
|
CREATE: z.object({
|
|
36
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
37
|
-
entity:
|
|
29
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on')),
|
|
30
|
+
entity: z
|
|
31
|
+
.extend(LocalizationEntitySchema, {
|
|
38
32
|
isoCode: z
|
|
39
33
|
.string()
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
.check(z.minLength(1), z.describe('ISO identifier: Countries need 2-letter codes (US, DE), Currencies need 3-letter codes (USD, EUR), Languages accept 2-10 characters (en, de-CH)')),
|
|
35
|
+
})
|
|
36
|
+
.check(z.describe('Entity configuration data (required for CREATE)')),
|
|
43
37
|
}),
|
|
44
38
|
UPDATE: z.object({
|
|
45
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on, wj'),
|
|
46
|
-
entityId: z
|
|
47
|
-
|
|
39
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on, wj')),
|
|
40
|
+
entityId: z
|
|
41
|
+
.string()
|
|
42
|
+
.check(z.minLength(1), z.describe('Database ID of the specific entity instance')),
|
|
43
|
+
entity: LocalizationEntitySchema.check(z.describe('Entity data to update')),
|
|
48
44
|
}),
|
|
49
45
|
REMOVE: z.object({
|
|
50
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
51
|
-
entityId: z
|
|
46
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on')),
|
|
47
|
+
entityId: z
|
|
48
|
+
.string()
|
|
49
|
+
.check(z.minLength(1), z.describe('Database ID of the specific entity instance')),
|
|
52
50
|
}),
|
|
53
51
|
GET: z.object({
|
|
54
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
55
|
-
entityId: z
|
|
52
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on')),
|
|
53
|
+
entityId: z
|
|
54
|
+
.string()
|
|
55
|
+
.check(z.minLength(1), z.describe('Database ID of the specific entity instance')),
|
|
56
56
|
}),
|
|
57
57
|
LIST: z.object({
|
|
58
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
58
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on')),
|
|
59
59
|
...PaginationSchema,
|
|
60
60
|
...SortingSchema,
|
|
61
61
|
...SearchSchema,
|
|
62
62
|
}),
|
|
63
63
|
COUNT: z.object({
|
|
64
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
64
|
+
localizationType: LocalizationTypeEnum.check(z.describe('Type of localization system to operate on')),
|
|
65
65
|
...SearchSchema,
|
|
66
66
|
}),
|
|
67
67
|
};
|
|
68
|
-
export const LocalizationManagementSchema =
|
|
69
|
-
action: z
|
|
70
|
-
.enum(['CREATE', 'UPDATE', 'REMOVE', 'GET', 'LIST', 'COUNT'])
|
|
71
|
-
.describe('Localization action: CREATE (new entity), UPDATE (modify existing), REMOVE (soft delete), GET (retrieve single), LIST (find multiple with pagination), COUNT (get totals for analytics)'),
|
|
72
|
-
localizationType: LocalizationTypeEnum.describe('Type of localization system to operate on'),
|
|
73
|
-
entity: LocalizationEntitySchema.optional().describe('Entity configuration data (required for CREATE, optional for UPDATE)'),
|
|
74
|
-
entityId: z
|
|
75
|
-
.string()
|
|
76
|
-
.min(1)
|
|
77
|
-
.optional()
|
|
78
|
-
.describe('Database ID of the specific entity instance (required for UPDATE, REMOVE, GET actions)'),
|
|
79
|
-
...PaginationSchema,
|
|
80
|
-
...SortingSchema,
|
|
81
|
-
...SearchSchema,
|
|
82
|
-
};
|
|
83
|
-
export const LocalizationManagementZodSchema = z.object(LocalizationManagementSchema);
|
|
68
|
+
export const LocalizationManagementSchema = createManagementSchemaFromValidators(actionValidators);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context } from '../../../context.ts';
|
|
2
|
-
import { OrderManagementSchema,
|
|
3
|
-
export { OrderManagementSchema
|
|
2
|
+
import { OrderManagementSchema, type OrderManagementParams } from './schemas.ts';
|
|
3
|
+
export { OrderManagementSchema };
|
|
4
4
|
export type { OrderManagementParams };
|
|
5
5
|
export declare function orderManagement(context: Context, params: OrderManagementParams): Promise<{
|
|
6
6
|
content: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { log } from '@unchainedshop/logger';
|
|
2
|
-
import { actionValidators, OrderManagementSchema,
|
|
2
|
+
import { actionValidators, OrderManagementSchema, } from "./schemas.js";
|
|
3
3
|
import actionHandlers from "./handlers/index.js";
|
|
4
4
|
import { createMcpResponse, createMcpErrorResponse } from "../../utils/sharedSchemas.js";
|
|
5
|
-
export { OrderManagementSchema
|
|
5
|
+
export { OrderManagementSchema };
|
|
6
6
|
export async function orderManagement(context, params) {
|
|
7
7
|
const { action, ...actionParams } = params;
|
|
8
8
|
log('MCP handler orderManagement ', { userId: context.userId, params });
|