sbuilder-mcp 0.64.0 → 0.66.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/CHANGELOG.vi.md +45 -0
  3. package/README.md +6 -5
  4. package/README.vi.md +6 -5
  5. package/dist/catalog/api.generated.js +240 -9
  6. package/dist/catalog/appscaffolds.generated.js +35 -21
  7. package/dist/catalog/checkout.generated.js +163 -46
  8. package/dist/catalog/deadkeys.generated.js +3 -3
  9. package/dist/catalog/elements.generated.js +5848 -2011
  10. package/dist/catalog/fieldskin.generated.js +134 -8
  11. package/dist/catalog/overlays.generated.js +3193 -684
  12. package/dist/catalog/shapes.generated.js +59 -8
  13. package/dist/catalog/source.generated.js +2 -2
  14. package/dist/catalog/storepages.generated.js +517 -41
  15. package/dist/catalog/translations.generated.js +57 -4
  16. package/dist/core/patch.js +20 -0
  17. package/dist/domains/site/builder.js +69 -6
  18. package/dist/domains/site/ids.js +72 -0
  19. package/dist/domains/site/importmap.js +10 -3
  20. package/dist/domains/site/inert.js +10 -0
  21. package/dist/domains/site/inventory.js +30 -30
  22. package/dist/domains/site/node.js +2 -2
  23. package/dist/domains/site/pagestate.js +16 -2
  24. package/dist/domains/site/patterns.js +10 -1
  25. package/dist/domains/site/readiness-fetch.js +15 -8
  26. package/dist/domains/site/readiness.js +79 -30
  27. package/dist/domains/site/review.js +12 -3
  28. package/dist/domains/site/storepage.js +5 -3
  29. package/dist/live/session.js +73 -8
  30. package/dist/tools/app.js +2 -1
  31. package/dist/tools/chrome.js +340 -21
  32. package/dist/tools/live.js +1 -0
  33. package/dist/tools/menu.js +24 -8
  34. package/dist/tools/overlay.js +64 -3
  35. package/dist/tools/page.js +502 -78
  36. package/dist/tools/store.js +36 -73
  37. package/dist/tools/theme.js +99 -4
  38. package/dist/transport/http.js +95 -2
  39. package/dist/transport/pages.js +16 -3
  40. package/dist/transport/socket.js +9 -2
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,51 @@ All notable changes to this project are documented in this file.
6
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.66.0] - 2026-09-25
10
+
11
+ ### Added
12
+ - `sb_add` can now create a satellite on its host — such as the `cart-count` badge on a cart icon — instead of refusing it as a non-container, and `sb_remove` removes one and clears the host's reference to it; the `cartCount` readiness remedy now names `sb_add`.
13
+ - `sb_store` action `cart` now seeds the site's cart drawer in the site's own language, read from `settings.locale`, instead of always seeding English, falling back to English when no per-locale seed exists.
14
+ - `sb_store` action `chrome` now builds a real site menu and wires the header to it — a hover/dropdown desktop menu hidden on mobile, a hamburger drawer holding its own vertical menu on mobile, an account icon to `/account`, and a cart icon carrying `open_cart` badged by `cart-count` — replacing the row of buttons `sb_review` itself flagged as `handbuilt_menu`; it also creates the site's cart drawer when the header's cart icon would otherwise open nothing.
15
+ - `sb_review` warns once per site (`site_language`) when the page's copy doesn't match the site's `settings.locale`, and `sb_theme` gains a `locale` argument to set it.
16
+ - `sb_publish` lists other pages with unpublished drafts as `unpublished_drafts`, and `publish_drafts: true` publishes them in the same call.
17
+ - A page save now sends the draft's revision as `baseRev` and yields — re-pulling and rebasing — when the platform reports the draft moved underneath it (`source_stale`) or broadcasts a newer revision; it names the live peer on a save (`X-WB-Live-Peer`) only once every patch in that save is confirmed acknowledged by the room, so an editor tab with unsaved edits can adopt the save instead of quietly losing it later.
18
+
19
+ ### Changed
20
+ - A page-document write that bypasses `sb_set` — a raw `sb_api_call` PUT, `sb_page_repair`, a version or history restore, or a `sb_store` flow — now reaches a live editor watching that page as ops and marks this session's own copy stale, instead of one side silently overwriting the other.
21
+ - The generated catalog was regenerated against the platform: 120 elements and per-locale cart drawer seeds.
22
+
23
+ ### Fixed
24
+ - Closed several races in the save-and-rebase path that could lose an edit under concurrent access: a 409 rebase no longer republishes ops already sent to the room, a finishing save no longer clears another in-flight save's slot, a peer's edit landing mid-save is no longer discarded by that save, a source frame arriving during a re-read is judged against the revision it actually reports, and an editor's own change is no longer mistaken for this session's unsaved edit.
25
+ - Rejoining a live room no longer vouches for ops the previous room never acknowledged, and the auth/session frame is never reported as a snapshot provider (`noSnapshot`), closing two ways a stale save could be replayed under a peer's name.
26
+ - `sb_theme`'s locale write no longer partially applies: it validates the language tag and reads settings before the theme PUT, tries the full settings body with every credential before falling back to a locale-only body, and writes the locale only after the theme save and every other check succeed.
27
+ - `sb_store` action `chrome` no longer overwrites a merchant's fully-linked menu when a transient lookup failure makes it look unresolved, and now fills a reused placeholder menu (four `type:none` rows) in with real links instead of leaving it empty; its dry run now summarizes the cart drawer it would create instead of embedding the full seed document.
28
+ - A product card's image now shows as one square thumbnail instead of a strip of three empty ones, and a category tile now binds `category.image` instead of the product-image binding it inherited from the generic media pattern.
29
+ - `sb_review`'s `categoryScope` gap now fires only when the open page is the shared category template with every product repeater pinned to a named collection, not on every site with more than one category.
30
+ - `sb_review`'s `order_goes_nowhere` gap now judges only the checkout form, no longer flagging every login, register, forgot-password, and reset-password page because the cart drawer composed onto them also holds a cart total.
31
+ - A nested satellite given as part of a node spec is now seeded and attached correctly instead of being born bare or refused as a child of a non-container.
32
+ - Every page `sb_page_create` and `sb_store` create now mints fresh node ids instead of shipping the codegen placeholder ids verbatim, so two pages of the same type no longer share ids.
33
+ - `sb_page_state` now reports `canvas.minted_root` when a page's root node isn't called `ROOT`, warning that an older editor may paint it blank and autosave over it.
34
+ - The page a `sb_store` action `form` flow creates now wears the site's global header and footer, matching pages created by `sb_page_create`.
35
+
36
+ ## [0.65.0] - 2026-09-25
37
+
38
+ ### Added
39
+ - `sb_page_create` now infers the page's type from its name (about, contact, policy, faq) when no `type` argument is passed, and opens it with that purpose's own layout.
40
+ - `sb_page_repair` is a new tool that renames a page's root node to `ROOT` on one page, or every page on a site, when an older seed minted a different id (`sppro_1`, `rt_<hex>`); it defaults `dry_run` to true and lists the pages it would touch before writing anything.
41
+ - `sb_page_open` now reports `minted_root` when the opened page's root node is not called `ROOT`, warning that an editor built before web_builder `7322af49a` renders such a page as a blank white canvas and may autosave an empty document over it.
42
+ - `sb_store` action `form` now creates a login, register, or contact page as its own purpose type (`login`, `register`, `contact`) instead of a generic `page`, matching the platform's own routed page types.
43
+
44
+ ### Changed
45
+ - Every page document this server writes — `sb_page_create`'s seed, `sb_store`'s checkout and app-scaffold creates, and any raw `sb_api_call` carrying a page document — now leaves the process rooted at `ROOT`, healed in transport regardless of which tool produced it.
46
+ - A session whose save is rejected because the page changed underneath it now re-pulls the fresh document and reapplies the pending patches once automatically, instead of always requiring the caller to re-read and redo the edit; it still fails loudly when the other side touched one of the same nodes or local edits were unsaved.
47
+ - `sb_page_list`'s `page_types_note` now explains that about, contact, policy, faq, login, and register name a content page's purpose with its own type and icon, and that `sb_page_create` picks that type from the name automatically.
48
+ - The generated catalog was regenerated against the platform: 119 elements and 568 operations, including 18 page types and coverage for `FormKnobs`, `TextFieldKnobs`, and `SearchPanelKnobs` field-skin keys.
49
+ - `sb_import_site`'s page-token reader now reads only the page's own bands when picking up heading, text, and button styles, skipping a composed global header or footer so an inserted band no longer inherits a dark header's white-on-dark styling.
50
+
51
+ ### Fixed
52
+ - A newly added `countdown` element is now flagged as inert on add, since it seeds with no end time and paints four boxes counting down to nothing until `specials.endsAt` or `specials.sourceCode` is set.
53
+
9
54
  ## [0.64.0] - 2026-09-24
10
55
 
11
56
  ### Added
package/CHANGELOG.vi.md CHANGED
@@ -6,6 +6,51 @@ Mọi thay đổi đáng chú ý của dự án được ghi lại trong file n
6
6
  Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  và dự án tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.66.0] - 2026-09-25
10
+
11
+ ### Added
12
+ - `sb_add` giờ có thể tạo một satellite trên host của nó — ví dụ badge `cart-count` trên icon giỏ hàng — thay vì từ chối vì host không phải container, và `sb_remove` xoá satellite đó và dọn tham chiếu trên host; remedy `cartCount` của readiness giờ chỉ đích danh `sb_add`.
13
+ - Action `cart` của `sb_store` giờ gieo cart drawer của site bằng đúng ngôn ngữ của site, đọc từ `settings.locale`, thay vì luôn gieo bằng tiếng Anh, và rơi về tiếng Anh khi không có seed theo locale.
14
+ - Action `chrome` của `sb_store` giờ tạo một site menu thật và nối header vào đó — menu desktop kiểu hover/dropdown ẩn trên mobile, một hamburger drawer chứa menu dọc riêng trên mobile, icon tài khoản trỏ tới `/account`, và icon giỏ hàng mang `open_cart` kèm badge `cart-count` — thay cho hàng nút bấm mà chính `sb_review` từng gắn cờ `handbuilt_menu`; nó cũng tạo cart drawer cho site khi icon giỏ hàng trên header sẽ mở ra không gì cả.
15
+ - `sb_review` cảnh báo một lần cho mỗi site (`site_language`) khi nội dung trang không khớp `settings.locale` của site, và `sb_theme` có thêm tham số `locale` để đặt nó.
16
+ - `sb_publish` liệt kê các trang khác đang có draft chưa publish dưới `unpublished_drafts`, và `publish_drafts: true` sẽ publish luôn các trang đó trong cùng lệnh gọi.
17
+ - Một lần lưu trang giờ gửi revision của draft dưới dạng `baseRev` và nhường bước — đọc lại và rebase — khi nền tảng báo draft đã thay đổi bên dưới nó (`source_stale`) hoặc phát ra một revision mới hơn; nó chỉ đích danh live peer khi lưu (`X-WB-Live-Peer`) khi mọi patch trong lần lưu đó đã được phòng xác nhận, để một tab editor còn thay đổi chưa lưu có thể nhận lấy lần lưu này thay vì âm thầm mất nó sau đó.
18
+
19
+ ### Changed
20
+ - Một lần ghi tài liệu trang không đi qua `sb_set` — một PUT thô qua `sb_api_call`, `sb_page_repair`, khôi phục version hoặc history, hay một flow của `sb_store` — giờ đến được với editor đang xem trang đó dưới dạng ops và đánh dấu bản sao của session này là cũ, thay vì bên này âm thầm ghi đè bên kia.
21
+ - Catalog được sinh ra đã được làm mới dựa trên nền tảng: 120 element và cart drawer seed theo từng locale.
22
+
23
+ ### Fixed
24
+ - Đã đóng một số race trong luồng lưu-và-rebase có thể làm mất một thay đổi khi truy cập đồng thời: một rebase sau lỗi 409 không còn gửi lại các ops đã gửi lên phòng, một lần lưu vừa hoàn tất không còn xoá slot in-flight của một lần lưu khác, một chỉnh sửa của peer đến giữa lúc đang lưu không còn bị lần lưu đó xoá mất, một source frame đến trong lúc đang đọc lại được xét đúng theo revision mà nó thực sự báo, và thay đổi của chính editor không còn bị nhầm là thay đổi cục bộ chưa lưu của session này.
25
+ - Rejoin vào một phòng live không còn vouch cho các ops mà phòng cũ chưa từng ack, và frame auth/session không bao giờ bị báo là nơi cung cấp snapshot (`noSnapshot`), đóng lại hai cách một lần lưu cũ có thể bị phát lại dưới tên một peer.
26
+ - Lần ghi locale của `sb_theme` không còn áp dụng nửa chừng: nó kiểm tra language tag và đọc settings trước khi PUT theme, thử toàn bộ settings body với từng credential trước khi rơi về body chỉ có locale, và chỉ ghi locale sau khi lần lưu theme và mọi kiểm tra khác thành công.
27
+ - Action `chrome` của `sb_store` không còn ghi đè menu đã liên kết đầy đủ của merchant khi một lỗi lookup tạm thời khiến nó trông như chưa được liên kết, và giờ điền các liên kết thật vào một menu placeholder được dùng lại (bốn dòng `type:none`) thay vì để trống; dry run của nó giờ tóm tắt cart drawer sẽ tạo thay vì nhúng nguyên tài liệu seed.
28
+ - Ảnh trên thẻ sản phẩm giờ hiển thị một thumbnail vuông duy nhất thay vì một dải ba ảnh trống, và ô category giờ bind `category.image` thay vì binding ảnh sản phẩm mà nó thừa hưởng từ pattern media chung.
29
+ - Gap `categoryScope` của `sb_review` giờ chỉ nổ ra khi trang đang mở là category template dùng chung với mọi product repeater được ghim vào một collection có tên, không còn nổ ra trên mọi site có hơn một category.
30
+ - Gap `order_goes_nowhere` của `sb_review` giờ chỉ xét form checkout, không còn gắn cờ mọi trang login, register, quên mật khẩu và đặt lại mật khẩu chỉ vì cart drawer được compose lên các trang đó cũng có cart total.
31
+ - Một satellite lồng bên trong một node spec giờ được seed và gắn đúng cách thay vì sinh ra trống trơn hoặc bị từ chối vì host không phải container.
32
+ - Mỗi lần tạo trang qua `sb_page_create` và `sb_store` giờ sinh id node mới thay vì dùng nguyên id placeholder từ codegen, nên hai trang cùng loại không còn trùng id.
33
+ - `sb_page_state` giờ báo `canvas.minted_root` khi node root của một trang không mang tên `ROOT`, cảnh báo rằng một editor cũ hơn có thể vẽ trang đó trắng trơn và autosave đè lên nó.
34
+ - Trang mà flow `form` của `sb_store` tạo ra giờ mang header và footer chung của site, khớp với các trang do `sb_page_create` tạo.
35
+
36
+ ## [0.65.0] - 2026-09-25
37
+
38
+ ### Added
39
+ - `sb_page_create` giờ tự suy ra type của trang từ tên (about, contact, policy, faq) khi không truyền tham số `type`, và mở trang đó với layout đúng với mục đích của nó.
40
+ - `sb_page_repair` là một tool mới, đổi tên node root của trang thành `ROOT` trên một trang, hoặc trên mọi trang của một site, khi một seed cũ hơn đã sinh ra một id khác (`sppro_1`, `rt_<hex>`); tool mặc định `dry_run` là true và liệt kê các trang sẽ bị ảnh hưởng trước khi ghi bất cứ thứ gì.
41
+ - `sb_page_open` giờ báo cáo `minted_root` khi node root của trang đang mở không mang tên `ROOT`, cảnh báo rằng một editor được build trước web_builder `7322af49a` sẽ render trang đó thành một canvas trắng và có thể autosave một tài liệu rỗng đè lên nó.
42
+ - Action `form` của `sb_store` giờ tạo trang login, register, hoặc contact đúng theo type mục đích của nó (`login`, `register`, `contact`) thay vì một `page` chung chung, khớp với các page type đã được nền tảng định tuyến sẵn.
43
+
44
+ ### Changed
45
+ - Mọi tài liệu trang mà server này ghi ra — seed của `sb_page_create`, các lệnh tạo checkout và app-scaffold của `sb_store`, và bất kỳ `sb_api_call` thô nào mang theo tài liệu trang — giờ đều rời khỏi tiến trình với root là `ROOT`, được chữa ở tầng transport bất kể tool nào tạo ra nó.
46
+ - Một session mà lệnh lưu bị từ chối vì trang đã thay đổi bên dưới nó giờ sẽ tự động đọc lại tài liệu mới nhất và áp lại các patch đang chờ một lần, thay vì luôn bắt caller phải đọc lại và làm lại thay đổi; session vẫn báo lỗi rõ ràng khi bên kia đã sửa đúng những node này hoặc khi còn thay đổi cục bộ chưa lưu.
47
+ - `page_types_note` của `sb_page_list` giờ giải thích rằng about, contact, policy, faq, login và register đặt tên cho mục đích của một trang nội dung với type và icon riêng của nó, và `sb_page_create` tự chọn type đó từ tên trang.
48
+ - Catalog được sinh ra đã được làm mới dựa trên nền tảng: 119 element và 568 operation, bao gồm 18 page type và độ phủ cho các key field-skin `FormKnobs`, `TextFieldKnobs`, và `SearchPanelKnobs`.
49
+ - Bộ đọc token trang của `sb_import_site` giờ chỉ đọc các band thuộc về chính trang khi lấy style heading, text và button, bỏ qua một header hoặc footer dùng chung đã compose, để một band mới chèn vào không còn bị kế thừa kiểu chữ trắng-trên-nền-tối của header.
50
+
51
+ ### Fixed
52
+ - Một element `countdown` mới được thêm giờ được đánh dấu là inert khi thêm, vì nó được gieo sẵn không có thời gian kết thúc và vẽ ra bốn ô đếm ngược về không cho đến khi `specials.endsAt` hoặc `specials.sourceCode` được thiết lập.
53
+
9
54
  ## [0.64.0] - 2026-09-24
10
55
 
11
56
  ### Added
package/README.md CHANGED
@@ -98,8 +98,9 @@ in this client: one would put the very key the platform exists to hold back into
98
98
  | `sb_template_use` | Instantiate a template into a page |
99
99
  | `sb_page_list` | Every page on the site |
100
100
  | `sb_page_create` | Create a page — a store type arrives with the editor's own starting document; `type` is the route for checkout, product, category, post, course |
101
- | `sb_publish` | Compile the draft into the live page (cascades to shared globals), report which revision went live, and with `verify` check the origin is serving it |
101
+ | `sb_publish` | Compile the draft into the live page (cascades to shared globals), report which revision went live, and with `verify` check the origin is serving it; lists other pages with unpublished drafts (`publish_drafts` publishes them too) |
102
102
  | `sb_page_state` | Which of a page's three copies is which — the DRAFT the editor canvas shows, the PUBLISHED row the storefront serves, and this session's — plus whether the editor will render the canvas BLANK, and where the recovery points are |
103
+ | `sb_page_repair` | Rename a page root that is not `ROOT` (left by older seeds) so every editor build draws it — one page or the whole site |
103
104
  | `sb_review` | Every defect a visitor would see, each with its fix, plus the five gaps between this store and a paid order |
104
105
  | `sb_media_list` | The site's media library |
105
106
  | `sb_media_upload` | Add an image and get its URL — a local path, a URL the platform fetches, or a SEARCH for real photographs you read and pick from, one or several at a time |
@@ -109,12 +110,12 @@ in this client: one would put the very key the platform exists to hold back into
109
110
  | `sb_bind` | Bind a node's content to real store data, or make a button add to the cart |
110
111
  | `sb_import` | Read a page from any public URL and add its structure and content to the open page as real elements, styled with THIS page's own tokens — a translation, not a clone |
111
112
  | `sb_import_site` | Read a WHOLE site from one URL — its sitemap, or the links on that page — and give each page found its own draft page here, built from this site's tokens; the entry page's own colours and type scale also patch into this SITE'S theme, so it stops being purely a read |
112
- | `sb_theme` | Read or patch the site's palette and type scale — the layer every style preset resolves from, so one token repaints every page |
113
- | `sb_store` | Run a store flow that must happen in a fixed order — `checkout` (the four writes that make a working one), `form` (any of the platform's 17 templates with its own field document), `chrome` (one shared header or footer), `menu` (a menu node bound to the site's menu, its links resolved), `overlay_attach` (a pop-up or quick view on the open page) and `app` (a built-in app plus the pages it needs), `global_attach` / `global_detach` (put an EXISTING shared section on the open page, or take it off) |
113
+ | `sb_theme` | Read or patch the site's palette and type scale — the layer every style preset resolves from, so one token repaints every page; `locale` sets the site's language |
114
+ | `sb_store` | Run a store flow that must happen in a fixed order — `checkout` (the four writes that make a working one), `form` (any of the platform's 17 templates with its own field document), `chrome` (one shared header or footer on a real site menu — desktop menu, mobile drawer, cart and account icons), `menu` (a menu node bound to the site's menu, its links resolved), `overlay_attach` (a pop-up or quick view on the open page), `cart` (the site's cart drawer, when it has none) and `app` (a built-in app plus the pages it needs), `global_attach` / `global_detach` (put an EXISTING shared section on the open page, or take it off) |
114
115
  | `sb_undo` | Put back what a PUT replaced. The SECOND answer for a page, not the only one: the platform has versions, history and restore (`sb_api_find` "page versions"), which outlive this process — reach for those first and use this for every other shaped PUT |
115
116
 
116
- Twenty-eight tools, **560 API operations** (193 of the 251 writes carrying a body shape read
117
- off the handler), 113 elements, 79 binding sources. `sb_api_find`
117
+ Twenty-eight tools, **568 API operations** (195 of the 253 writes carrying a body shape read
118
+ off the handler), 120 elements, 79 binding sources. `sb_api_find`
118
119
  is an index rather than a tool per endpoint, so the tool list stays short while everything
119
120
  the platform can do stays reachable — and operations added to the platform arrive with the
120
121
  next `npm run codegen`.
package/README.vi.md CHANGED
@@ -95,8 +95,9 @@ nhét ngược lại vào mọi bản cài.
95
95
  | `sb_template_use` | Thả một template vào trang |
96
96
  | `sb_page_list` | Mọi trang của site |
97
97
  | `sb_page_create` | Tạo một trang — trang cửa hàng sinh ra đã có sẵn tài liệu như trong editor; `type` là đường đi cho checkout, product, category, post, course |
98
- | `sb_publish` | Biên dịch bản nháp thành trang live (lan sang global dùng chung), báo bản nào đã lên live, và với `verify` kiểm origin đã phục vụ đúng bản đó chưa |
98
+ | `sb_publish` | Biên dịch bản nháp thành trang live (lan sang global dùng chung), báo bản nào đã lên live, và với `verify` kiểm origin đã phục vụ đúng bản đó chưa; liệt kê các trang khác còn nháp chưa publish (`publish_drafts` publish luôn) |
99
99
  | `sb_page_state` | Ba bản sao của một trang, bản nào là bản nào — bản NHÁP canvas editor hiển thị, dòng PUBLISHED storefront phục vụ, và bản phiên này giữ — kèm dự báo editor có render canvas TRẮNG không, và các điểm phục hồi nằm ở đâu |
100
+ | `sb_page_repair` | Đổi gốc trang khác `ROOT` (do seed cũ để lại) về `ROOT` để mọi bản editor vẽ được — một trang hoặc cả site |
100
101
  | `sb_review` | Mọi khiếm khuyết người xem sẽ thấy, kèm lệnh sửa từng cái, và năm khoảng trống chắn giữa cửa hàng với một đơn đã thanh toán |
101
102
  | `sb_media_list` | Thư viện ảnh của site |
102
103
  | `sb_media_upload` | Thêm ảnh và lấy URL — file trên máy, một URL để nền tảng tự tải, hoặc TÌM ảnh chụp thật để đọc mô tả rồi chọn, một hoặc nhiều tấm một lượt |
@@ -106,12 +107,12 @@ nhét ngược lại vào mọi bản cài.
106
107
  | `sb_bind` | Gắn nội dung một node vào dữ liệu cửa hàng thật, hoặc biến một nút thành nút thêm vào giỏ |
107
108
  | `sb_import` | Đọc một trang từ URL công khai bất kỳ và thêm cấu trúc + nội dung của nó vào trang đang mở dưới dạng element thật, mang token của CHÍNH trang này — là dịch lại, không phải sao chép |
108
109
  | `sb_import_site` | Đọc CẢ website từ một URL — sitemap của nó, hoặc các link trên trang đó — và tạo cho mỗi trang tìm được một trang nháp riêng ở đây, dựng bằng token của site này; màu và thang chữ của trang gốc cũng được vá vào THEME của site này, nên đây không còn thuần là đọc |
109
- | `sb_theme` | Đọc hoặc vá bảng màu và thang chữ của site — tầng mà mọi style preset phân giải từ đó, nên một token thay áo cho mọi trang |
110
- | `sb_store` | Chạy một luồng cửa hàng bắt buộc đúng thứ tự — `checkout` (bốn lệnh ghi tạo nên trang thanh toán), `form` (một trong 17 template của nền tảng kèm field document của nó), `chrome` (một header hoặc footer dùng chung), `menu` (một node menu bind vào menu của site, link đã phân giải), `overlay_attach` (một pop-up hay quick view trên trang đang mở) `app` (một app dựng sẵn kèm những trang nó cần), và `global_attach` / `global_detach` (đặt một section dùng chung ĐÃ CÓ lên trang đang mở, hoặc gỡ ra) |
110
+ | `sb_theme` | Đọc hoặc vá bảng màu và thang chữ của site — tầng mà mọi style preset phân giải từ đó, nên một token thay áo cho mọi trang; `locale` đặt ngôn ngữ của site |
111
+ | `sb_store` | Chạy một luồng cửa hàng bắt buộc đúng thứ tự — `checkout` (bốn lệnh ghi tạo nên trang thanh toán), `form` (một trong 17 template của nền tảng kèm field document của nó), `chrome` (một header hoặc footer dùng chung trên menu thật của site — menu desktop, drawer mobile, icon giỏ hàng và tài khoản), `menu` (một node menu bind vào menu của site, link đã phân giải), `overlay_attach` (một pop-up hay quick view trên trang đang mở), `cart` (ngăn giỏ hàng của site, khi chưa có), `app` (một app dựng sẵn kèm những trang nó cần), và `global_attach` / `global_detach` (đặt một section dùng chung ĐÃ CÓ lên trang đang mở, hoặc gỡ ra) |
111
112
  | `sb_undo` | Trả lại thứ mà một lệnh PUT đã ghi đè. Với TRANG thì đây là đường về thứ hai chứ không phải duy nhất: nền tảng có version, history và restore (`sb_api_find` "page versions"), và chúng sống lâu hơn tiến trình này — hãy dùng chúng trước, còn tool này cho mọi PUT có hình dạng khác |
112
113
 
113
- Hai mươi tám tool, **560 operation API** (193 trong 251 lệnh ghi có hình dạng body đọc thẳng
114
- từ handler), 113 element, 79 nguồn binding. `sb_api_find` là
114
+ Hai mươi tám tool, **568 operation API** (195 trong 253 lệnh ghi có hình dạng body đọc thẳng
115
+ từ handler), 120 element, 79 nguồn binding. `sb_api_find` là
115
116
  một chỉ mục chứ không phải mỗi endpoint một tool, nên danh sách tool vẫn ngắn trong khi mọi
116
117
  thứ nền tảng làm được vẫn với tới — và operation mới thêm bên nền tảng sẽ tự có sau lần
117
118
  `npm run codegen` kế tiếp.
@@ -1,8 +1,8 @@
1
1
  export const SWAGGER_SOURCE = {
2
- "operations": 560,
3
- "definitions": 107,
4
- "bodyCarrying": 210,
5
- "bodyUndescribed": 91,
2
+ "operations": 568,
3
+ "definitions": 108,
4
+ "bodyCarrying": 214,
5
+ "bodyUndescribed": 92,
6
6
  "generatedFrom": "server/docs/swagger.json"
7
7
  };
8
8
  export const API_OPERATIONS = [
@@ -505,6 +505,19 @@ export const API_OPERATIONS = [
505
505
  "bodyRef": null,
506
506
  "credential": "siteScoped"
507
507
  },
508
+ {
509
+ "id": "get:/_wb/account/vouchers",
510
+ "method": "GET",
511
+ "path": "/_wb/account/vouchers",
512
+ "tags": [
513
+ "storeaccount"
514
+ ],
515
+ "summary": "The signed-in shopper's voucher wallet",
516
+ "params": [],
517
+ "bodyDescribed": false,
518
+ "bodyRef": null,
519
+ "credential": "siteScoped"
520
+ },
508
521
  {
509
522
  "id": "get:/_wb/account/wishlist",
510
523
  "method": "GET",
@@ -663,9 +676,16 @@ export const API_OPERATIONS = [
663
676
  {
664
677
  "name": "courseId",
665
678
  "in": "query",
666
- "required": true,
679
+ "required": false,
667
680
  "type": "string",
668
681
  "description": "The course id"
682
+ },
683
+ {
684
+ "name": "slug",
685
+ "in": "query",
686
+ "required": false,
687
+ "type": "string",
688
+ "description": "The course slug, when no id is known"
669
689
  }
670
690
  ],
671
691
  "bodyDescribed": false,
@@ -1146,6 +1166,19 @@ export const API_OPERATIONS = [
1146
1166
  "bodyRef": null,
1147
1167
  "credential": "siteScoped"
1148
1168
  },
1169
+ {
1170
+ "id": "get:/_wb/vouchers/list",
1171
+ "method": "GET",
1172
+ "path": "/_wb/vouchers/list",
1173
+ "tags": [
1174
+ "storevouchers"
1175
+ ],
1176
+ "summary": "List the site's publicly-listed vouchers",
1177
+ "params": [],
1178
+ "bodyDescribed": false,
1179
+ "bodyRef": null,
1180
+ "credential": "siteScoped"
1181
+ },
1149
1182
  {
1150
1183
  "id": "get:/api/admin/accounts/{id}/ai-credits",
1151
1184
  "method": "GET",
@@ -1438,7 +1471,7 @@ export const API_OPERATIONS = [
1438
1471
  "in": "body",
1439
1472
  "required": false,
1440
1473
  "type": "object",
1441
- "description": "{bankName,bankCode,accountNumber,accountHolder,codePrefix,webhookSecret} — PUT only"
1474
+ "description": "{bankName,bankCode,accountNumber,accountHolder,webhookSecret} — PUT only"
1442
1475
  }
1443
1476
  ],
1444
1477
  "bodyDescribed": false,
@@ -1459,7 +1492,7 @@ export const API_OPERATIONS = [
1459
1492
  "in": "body",
1460
1493
  "required": false,
1461
1494
  "type": "object",
1462
- "description": "{bankName,bankCode,accountNumber,accountHolder,codePrefix,webhookSecret} — PUT only"
1495
+ "description": "{bankName,bankCode,accountNumber,accountHolder,webhookSecret} — PUT only"
1463
1496
  }
1464
1497
  ],
1465
1498
  "bodyDescribed": false,
@@ -2552,6 +2585,55 @@ export const API_OPERATIONS = [
2552
2585
  "bodyRef": null,
2553
2586
  "credential": "siteScoped"
2554
2587
  },
2588
+ {
2589
+ "id": "get:/api/orgs/{id}/ai-credits",
2590
+ "method": "GET",
2591
+ "path": "/api/orgs/{id}/ai-credits",
2592
+ "tags": [
2593
+ "ai"
2594
+ ],
2595
+ "summary": "An organisation's AI credit balance",
2596
+ "params": [
2597
+ {
2598
+ "name": "id",
2599
+ "in": "path",
2600
+ "required": true,
2601
+ "type": "string",
2602
+ "description": "org id"
2603
+ }
2604
+ ],
2605
+ "bodyDescribed": false,
2606
+ "bodyRef": null,
2607
+ "credential": "siteScoped"
2608
+ },
2609
+ {
2610
+ "id": "post:/api/orgs/{id}/ai-credits/purchase",
2611
+ "method": "POST",
2612
+ "path": "/api/orgs/{id}/ai-credits/purchase",
2613
+ "tags": [
2614
+ "ai"
2615
+ ],
2616
+ "summary": "Buy AI credits for an organisation",
2617
+ "params": [
2618
+ {
2619
+ "name": "id",
2620
+ "in": "path",
2621
+ "required": true,
2622
+ "type": "string",
2623
+ "description": "org id"
2624
+ },
2625
+ {
2626
+ "name": "body",
2627
+ "in": "body",
2628
+ "required": true,
2629
+ "type": "object",
2630
+ "description": "{credits:N}"
2631
+ }
2632
+ ],
2633
+ "bodyDescribed": false,
2634
+ "bodyRef": null,
2635
+ "credential": "siteScoped"
2636
+ },
2555
2637
  {
2556
2638
  "id": "get:/api/orgs/{id}/invitations",
2557
2639
  "method": "GET",
@@ -7203,6 +7285,111 @@ export const API_OPERATIONS = [
7203
7285
  "bodyRef": "github_com_webbuilder_server_internal_discounts.Discount",
7204
7286
  "credential": "siteScoped"
7205
7287
  },
7288
+ {
7289
+ "id": "get:/api/sites/{siteId}/discounts/{id}/grants",
7290
+ "method": "GET",
7291
+ "path": "/api/sites/{siteId}/discounts/{id}/grants",
7292
+ "tags": [
7293
+ "discounts"
7294
+ ],
7295
+ "summary": "List, assign or revoke a discount's member grants",
7296
+ "params": [
7297
+ {
7298
+ "name": "siteId",
7299
+ "in": "path",
7300
+ "required": true,
7301
+ "type": "string",
7302
+ "description": "Site ID"
7303
+ },
7304
+ {
7305
+ "name": "id",
7306
+ "in": "path",
7307
+ "required": true,
7308
+ "type": "string",
7309
+ "description": "Discount ID"
7310
+ },
7311
+ {
7312
+ "name": "grant",
7313
+ "in": "body",
7314
+ "required": false,
7315
+ "type": "object",
7316
+ "description": "{customerId} (POST only)"
7317
+ }
7318
+ ],
7319
+ "bodyDescribed": true,
7320
+ "bodyRef": "internal_discounts_rest.grantRequest",
7321
+ "credential": "siteScoped"
7322
+ },
7323
+ {
7324
+ "id": "post:/api/sites/{siteId}/discounts/{id}/grants",
7325
+ "method": "POST",
7326
+ "path": "/api/sites/{siteId}/discounts/{id}/grants",
7327
+ "tags": [
7328
+ "discounts"
7329
+ ],
7330
+ "summary": "List, assign or revoke a discount's member grants",
7331
+ "params": [
7332
+ {
7333
+ "name": "siteId",
7334
+ "in": "path",
7335
+ "required": true,
7336
+ "type": "string",
7337
+ "description": "Site ID"
7338
+ },
7339
+ {
7340
+ "name": "id",
7341
+ "in": "path",
7342
+ "required": true,
7343
+ "type": "string",
7344
+ "description": "Discount ID"
7345
+ },
7346
+ {
7347
+ "name": "grant",
7348
+ "in": "body",
7349
+ "required": false,
7350
+ "type": "object",
7351
+ "description": "{customerId} (POST only)"
7352
+ }
7353
+ ],
7354
+ "bodyDescribed": true,
7355
+ "bodyRef": "internal_discounts_rest.grantRequest",
7356
+ "credential": "siteScoped"
7357
+ },
7358
+ {
7359
+ "id": "delete:/api/sites/{siteId}/discounts/{id}/grants/{grantId}",
7360
+ "method": "DELETE",
7361
+ "path": "/api/sites/{siteId}/discounts/{id}/grants/{grantId}",
7362
+ "tags": [
7363
+ "discounts"
7364
+ ],
7365
+ "summary": "List, assign or revoke a discount's member grants",
7366
+ "params": [
7367
+ {
7368
+ "name": "siteId",
7369
+ "in": "path",
7370
+ "required": true,
7371
+ "type": "string",
7372
+ "description": "Site ID"
7373
+ },
7374
+ {
7375
+ "name": "id",
7376
+ "in": "path",
7377
+ "required": true,
7378
+ "type": "string",
7379
+ "description": "Discount ID"
7380
+ },
7381
+ {
7382
+ "name": "grant",
7383
+ "in": "body",
7384
+ "required": false,
7385
+ "type": "object",
7386
+ "description": "{customerId} (POST only)"
7387
+ }
7388
+ ],
7389
+ "bodyDescribed": true,
7390
+ "bodyRef": "internal_discounts_rest.grantRequest",
7391
+ "credential": "siteScoped"
7392
+ },
7206
7393
  {
7207
7394
  "id": "get:/api/sites/{siteId}/domains",
7208
7395
  "method": "GET",
@@ -12441,6 +12628,34 @@ export const API_OPERATIONS = [
12441
12628
  "bodyRef": "github_com_webbuilder_server_internal_products.Product",
12442
12629
  "credential": "siteScoped"
12443
12630
  },
12631
+ {
12632
+ "id": "get:/api/sites/{siteId}/products/attributes",
12633
+ "method": "GET",
12634
+ "path": "/api/sites/{siteId}/products/attributes",
12635
+ "tags": [
12636
+ "products"
12637
+ ],
12638
+ "summary": "Attribute axes already used on this site",
12639
+ "params": [
12640
+ {
12641
+ "name": "siteId",
12642
+ "in": "path",
12643
+ "required": true,
12644
+ "type": "string",
12645
+ "description": "Site ID"
12646
+ },
12647
+ {
12648
+ "name": "limit",
12649
+ "in": "query",
12650
+ "required": false,
12651
+ "type": "integer",
12652
+ "description": "Max axes to return (clamped to products.MaxAttributeSuggestions)"
12653
+ }
12654
+ ],
12655
+ "bodyDescribed": false,
12656
+ "bodyRef": null,
12657
+ "credential": "siteScoped"
12658
+ },
12444
12659
  {
12445
12660
  "id": "get:/api/sites/{siteId}/products/export",
12446
12661
  "method": "GET",
@@ -16281,7 +16496,7 @@ export const API_OPERATIONS = [
16281
16496
  "in": "query",
16282
16497
  "required": false,
16283
16498
  "type": "string",
16284
- "description": "Filter by page type (page|product|category|blog|post|error|maintain|search|checkout|complete)"
16499
+ "description": "Filter by page type (page|product|category|blog|post|error|maintain|search|checkout|complete|account|course|about|contact|policy|faq|login|register|forgot|reset)"
16285
16500
  },
16286
16501
  {
16287
16502
  "name": "status",
@@ -16351,7 +16566,7 @@ export const API_OPERATIONS = [
16351
16566
  "in": "query",
16352
16567
  "required": false,
16353
16568
  "type": "string",
16354
- "description": "Filter by page type (page|product|category|blog|post|error|maintain|search|checkout|complete)"
16569
+ "description": "Filter by page type (page|product|category|blog|post|error|maintain|search|checkout|complete|account|course|about|contact|policy|faq|login|register|forgot|reset)"
16355
16570
  },
16356
16571
  {
16357
16572
  "name": "status",
@@ -17308,6 +17523,10 @@ export const API_DEFINITIONS = {
17308
17523
  "id": {
17309
17524
  "type": "string"
17310
17525
  },
17526
+ "memberBound": {
17527
+ "description": "MemberBound marks this discount as OWNED: it is redeemable only by a\ncustomer who holds a DiscountGrant for it (see grant.go), and the\nownership check lives in orders.Checkout.resolveDiscount — the one\nfunction both the quote and the order-create path call.\n\nOFF by construction exactly as PublicListed is: Go's zero value is\nfalse and the Postgres column defaults false, so a discount is a\nbearer code until somebody says otherwise. The opposite default would\nretroactively lock every shopper out of every code that works today.\n\nIT IS AN EXPLICIT FLAG RATHER THAN \"this discount has at least one\ngrant\", and that is the whole design (contract D3): deriving boundness\nwould mean that adding the FIRST grant to an ordinary shared code\nsilently made that code refuse for every other shopper on the site —\n\"save this one for Anna\" breaking SUMMER20 for everyone, with nothing\non screen and nothing in a log. With the flag, a grant on an UNBOUND\ncode is a bookmark that changes spendability for nobody, and a grant\non a BOUND code is an entitlement. Two facts, two words.\n\nNormalize keeps two invariants true for every write path: an automatic\ndiscount is never member-bound, and a member-bound discount is never\nPublicListed. See Normalize's clauses for why each one is there.",
17528
+ "type": "boolean"
17529
+ },
17311
17530
  "method": {
17312
17531
  "description": "Method decides how the discount is applied: \"code\" (customer enters a code)\nor \"automatic\" (applied at checkout with no code). Automatic discounts may\nhave a blank Code.",
17313
17532
  "type": "string"
@@ -17315,6 +17534,10 @@ export const API_DEFINITIONS = {
17315
17534
  "minOrderCents": {
17316
17535
  "type": "integer"
17317
17536
  },
17537
+ "publicListed": {
17538
+ "description": "PublicListed is the merchant's explicit opt-in to publish this code on the\nanonymous storefront list (GET /_wb/vouchers/list, package\ninternal/discounts/public). OFF by construction, not by care: the zero\nvalue is false and the Postgres column defaults false, so a discount is\nprivate until a merchant ticks the box — never the other way round on a\nfeature that publishes a working code to anyone who opens the shop.\n\nNormalize forces this back to false whenever UsageLimit == 1: a\nsingle-use code on a public list is a race by construction (the first\nanonymous reader spends it and every later reader gets a refusal), and\nit is also the exact shape of a loyalty-minted bearer voucher\n(loyaltyminter.MintFixedCode sets UsageLimit: 1 because \"the code ...\nmust die on first use\"). See Normalize's comment for why the rule keys\non UsageLimit rather than the minted code's \"DIEM-\" prefix.",
17539
+ "type": "boolean"
17540
+ },
17318
17541
  "siteId": {
17319
17542
  "type": "string"
17320
17543
  },
@@ -18952,6 +19175,14 @@ export const API_DEFINITIONS = {
18952
19175
  }
18953
19176
  }
18954
19177
  },
19178
+ "internal_discounts_rest.grantRequest": {
19179
+ "type": "object",
19180
+ "properties": {
19181
+ "customerId": {
19182
+ "type": "string"
19183
+ }
19184
+ }
19185
+ },
18955
19186
  "internal_giftcards_rest.adjustRequest": {
18956
19187
  "type": "object",
18957
19188
  "properties": {