webcake-storefront-mcp 1.12.0 → 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.
@@ -1,4 +1,18 @@
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
+ },
9
+ {
10
+ "v": "1.12.1",
11
+ "d": "24/06/2026",
12
+ "type": "Fixed",
13
+ "en": "save_file_version and get_file_versions both sent the parameter as cms_file_id, but the backend reads file_id; versions were saved unlinked to any…",
14
+ "vi": "save_file_version và get_file_versions đều gửi tham số dưới key cms_file_id, trong khi backend đọc file_id; các phiên bản được lưu mà không liên kết…"
15
+ },
2
16
  {
3
17
  "v": "1.12.0",
4
18
  "d": "24/06/2026",
@@ -26,19 +40,5 @@
26
40
  "type": "Added",
27
41
  "en": "New scaffold_store_pages tool creates the standard storefront pages (Category, Product, Cart, Checkout, Thank-you) so navigation links resolve…",
28
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ị…"
29
- },
30
- {
31
- "v": "1.9.0",
32
- "d": "24/06/2026",
33
- "type": "Added",
34
- "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…",
35
- "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,…"
36
- },
37
- {
38
- "v": "1.8.0",
39
- "d": "23/06/2026",
40
- "type": "Added",
41
- "en": "New list_automations tool returns each automation's id, name, status, and trigger info so agents can find the automation_id required by send_mail or…",
42
- "vi": "Tool mới list_automations trả về id, name, status và thông tin trigger của từng automation, giúp agent tìm được automation_id cần truyền vào…"
43
43
  }
44
44
  ]
@@ -249,7 +249,34 @@ Example: "get_Products" → function_name="Products", method="GET"`, {
249
249
  cms_file_id: z.string().describe("CMS file ID"),
250
250
  content: z.string().describe("Content to save"),
251
251
  is_public: z.boolean().default(false).describe("Mark as public version"),
252
- }, ({ cms_file_id, content, is_public }) => handle(() => api.saveFileVersion({ cms_file_id, content, is_public })));
253
- server.tool("get_file_versions", "View version history of a CMS file", { cms_file_id: z.string().describe("CMS file ID") }, ({ cms_file_id }) => handle(() => api.getFileVersions({ cms_file_id })));
252
+ }, ({ cms_file_id, content, is_public }) =>
253
+ // Backend reads `file_id` (it stores it as cms_file_id); a `cms_file_id` key alone is ignored.
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, 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
+ }));
254
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 })));
255
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-storefront-mcp",
3
- "version": "1.12.0",
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",