x
This commit is contained in:
1 parent
c449de2482
commit
7e4e89e33c
50 files changed
+306
-140
No files matched your search
@@ -189,11 +189,11 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
},
|
||||
{
|
||||
name: "update_store_settings_translation",
|
||||
description: "Add or update translations for store settings.",
|
||||
description: "Update translated footer and newsletter text for a specific language.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
lang: { type: "string", description: "Language code" },
|
||||
lang: { type: "string" },
|
||||
footerDescription: { type: "string" },
|
||||
newsletterTitle: { type: "string" },
|
||||
newsletterDescription: { type: "string" },
|
||||
@@ -203,6 +203,33 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
required: ["lang"]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "update_theme_tokens",
|
||||
description: "Update the theme tokens (colors, fonts, shadows) in the store settings.",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
brandPrimary: { type: "string" },
|
||||
brandPrimaryHover: { type: "string" },
|
||||
brandAccent: { type: "string" },
|
||||
brandWarm: { type: "string" },
|
||||
brandCool: { type: "string" },
|
||||
brandSuccess: { type: "string" },
|
||||
brandSoft: { type: "string" },
|
||||
surfacePage: { type: "string" },
|
||||
surfaceNavRest: { type: "string" },
|
||||
surfaceCard: { type: "string" },
|
||||
textMain: { type: "string" },
|
||||
mutedText: { type: "string" },
|
||||
linePrimary: { type: "string" },
|
||||
linePrimaryHover: { type: "string" },
|
||||
fontBody: { type: "string" },
|
||||
fontDisplay: { type: "string" },
|
||||
shadowCard: { type: "string" },
|
||||
shadowCardHover: { type: "string" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "update_brand_name",
|
||||
description: "Update the brand name used across website and SPA headers, footers, and brand displays.",
|
||||
@@ -523,6 +550,39 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const res = await api.patch(`/settings/translations`, payload);
|
||||
return { content: [{ type: "text", text: JSON.stringify(res.data, null, 2) }] };
|
||||
}
|
||||
case "update_theme_tokens": {
|
||||
const tokenParams = params as Record<string, string>;
|
||||
|
||||
const currentSettingsRes = await api.get("/settings");
|
||||
const currentSettings = currentSettingsRes.data || {};
|
||||
const currentTokens = currentSettings.themeTokens || {};
|
||||
const newTokens = { ...currentTokens };
|
||||
|
||||
const validKeys = [
|
||||
"brandPrimary", "brandPrimaryHover", "brandAccent", "brandWarm",
|
||||
"brandCool", "brandSuccess", "brandSoft", "surfacePage",
|
||||
"surfaceNavRest", "surfaceCard", "textMain", "mutedText",
|
||||
"linePrimary", "linePrimaryHover", "fontBody", "fontDisplay",
|
||||
"shadowCard", "shadowCardHover"
|
||||
];
|
||||
|
||||
for (const key of validKeys) {
|
||||
if (tokenParams[key] !== undefined) {
|
||||
newTokens[key] = tokenParams[key];
|
||||
}
|
||||
}
|
||||
|
||||
const mergedSettings = { ...currentSettings, themeTokens: newTokens };
|
||||
|
||||
for (const key in mergedSettings) {
|
||||
if (mergedSettings[key] === null) {
|
||||
delete mergedSettings[key];
|
||||
}
|
||||
}
|
||||
|
||||
const res = await api.put("/settings", mergedSettings);
|
||||
return { content: [{ type: "text", text: "Theme tokens updated successfully:\\n" + JSON.stringify(res.data.themeTokens, null, 2) }] };
|
||||
}
|
||||
case "update_brand_name": {
|
||||
const { brandName } = params as any;
|
||||
const currentSettingsRes = await api.get("/settings");
|
||||
|
||||
Reference in new issue
Block a user