webcake-storefront-mcp 1.12.1 → 1.13.0
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/dist/changelog.json +7 -7
- package/dist/tools/cms-files.js +26 -1
- package/package.json +1 -1
package/dist/changelog.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "1.13.0",
|
|
4
|
+
"d": "24/06/2026",
|
|
5
|
+
"type": "Added",
|
|
6
|
+
"en": "New restore_file_version tool rolls a CMS file back to a saved version in one step: it reads the chosen version's content (via get_file_versions)…",
|
|
7
|
+
"vi": "Tool mới restore_file_version khôi phục CMS file về một phiên bản đã lưu chỉ trong một bước: đọc nội dung phiên bản được chọn (qua…"
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"v": "1.12.1",
|
|
4
11
|
"d": "24/06/2026",
|
|
@@ -33,12 +40,5 @@
|
|
|
33
40
|
"type": "Added",
|
|
34
41
|
"en": "New scaffold_store_pages tool creates the standard storefront pages (Category, Product, Cart, Checkout, Thank-you) so navigation links resolve…",
|
|
35
42
|
"vi": "Tool mới scaffold_store_pages tạo các trang storefront tiêu chuẩn (Category, Product, Cart, Checkout, Thank-you) để các liên kết điều hướng không bị…"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"v": "1.9.0",
|
|
39
|
-
"d": "24/06/2026",
|
|
40
|
-
"type": "Added",
|
|
41
|
-
"en": "search_images now accepts an upload parameter (default true) that re-hosts each Pexels result on the WebCake CDN and adds a cdn_url field to every…",
|
|
42
|
-
"vi": "search_images nay nhận thêm tham số upload (mặc định true) để tự động tải từng kết quả Pexels lên WebCake CDN và bổ sung trường cdn_url vào mỗi ảnh,…"
|
|
43
43
|
}
|
|
44
44
|
]
|
package/dist/tools/cms-files.js
CHANGED
|
@@ -252,6 +252,31 @@ Example: "get_Products" → function_name="Products", method="GET"`, {
|
|
|
252
252
|
}, ({ cms_file_id, content, is_public }) =>
|
|
253
253
|
// Backend reads `file_id` (it stores it as cms_file_id); a `cms_file_id` key alone is ignored.
|
|
254
254
|
handle(() => api.saveFileVersion({ file_id: cms_file_id, content, is_public })));
|
|
255
|
-
server.tool("get_file_versions", "View version history of a CMS file. Each version includes its saved content — to restore, pass that content back to update_http_function (the http_function file) or update_cms_file.", { cms_file_id: z.string().describe("CMS file ID") }, ({ cms_file_id }) => handle(() => api.getFileVersions({ file_id: cms_file_id })));
|
|
255
|
+
server.tool("get_file_versions", "View version history of a CMS file. Each version includes its saved content — to restore, pass that content back to update_http_function (the http_function file) or update_cms_file, or use restore_file_version.", { cms_file_id: z.string().describe("CMS file ID") }, ({ cms_file_id }) => handle(() => api.getFileVersions({ file_id: cms_file_id })));
|
|
256
|
+
server.tool("restore_file_version", "Roll a CMS file back to a saved version in one step: reads the version's content and writes it back to the file. Omit version_id to restore the most recent snapshot. Tip: save_file_version on the current content first if you want an undo point.", {
|
|
257
|
+
cms_file_id: z.string().describe("CMS file ID to restore"),
|
|
258
|
+
version_id: z.string().optional().describe("Which version to restore (from get_file_versions). Omit = latest snapshot."),
|
|
259
|
+
}, ({ cms_file_id, version_id }) => handle(async () => {
|
|
260
|
+
const res = await api.getFileVersions({ file_id: cms_file_id });
|
|
261
|
+
const body = res?.data ?? res;
|
|
262
|
+
const list = Array.isArray(body) ? body : body?.data || [];
|
|
263
|
+
if (!list.length)
|
|
264
|
+
throw new Error("No saved versions for this file — nothing to restore.");
|
|
265
|
+
const version = version_id ? list.find((v) => v.id === version_id) : list[0];
|
|
266
|
+
if (!version)
|
|
267
|
+
throw new Error(`Version "${version_id}" not found. Use get_file_versions to list available versions.`);
|
|
268
|
+
const content = version.content;
|
|
269
|
+
if (content == null)
|
|
270
|
+
throw new Error("That version has no stored content; cannot restore.");
|
|
271
|
+
await api.updateCmsFile(cms_file_id, { content });
|
|
272
|
+
return {
|
|
273
|
+
success: true,
|
|
274
|
+
cms_file_id,
|
|
275
|
+
restored_version_id: version.id,
|
|
276
|
+
restored_at: version.inserted_at || version.created_at || undefined,
|
|
277
|
+
content_length: String(content).length,
|
|
278
|
+
note: "File reverted. Run/debug it to confirm, then publish if needed.",
|
|
279
|
+
};
|
|
280
|
+
}));
|
|
256
281
|
server.tool("toggle_debug_render", "Toggle debug render mode for a CMS file", { cms_file_id: z.string().describe("CMS file ID") }, ({ cms_file_id }) => handle(() => api.toggleDebugRender({ cms_file_id })));
|
|
257
282
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-storefront-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "MCP server for the WebCake/StoreCake storefront builder — page CRUD, page authoring, products, orders, and more",
|
|
5
5
|
"mcpName": "io.github.vuluu2k/webcake-storefront-mcp",
|
|
6
6
|
"license": "MIT",
|