webcake-storefront-mcp 1.41.0 → 2.0.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/README.md +2 -2
- package/README.vi.md +2 -2
- package/dist/api-catalog.generated.json +677 -0
- package/dist/api.js +0 -425
- package/dist/builder/attributes.js +1 -1
- package/dist/builder/catalog.js +1 -1
- package/dist/builder/element-keys.generated.json +136 -4105
- package/dist/builder/element-schema.js +297 -0
- package/dist/builder/page.js +38 -26
- package/dist/changelog.json +14 -14
- package/dist/server.js +3 -1
- package/dist/tools/api-gateway.js +198 -0
- package/dist/tools/appointment.js +5 -49
- package/dist/tools/apps-extra.js +0 -28
- package/dist/tools/apps.js +0 -11
- package/dist/tools/builder-extras.js +3 -1
- package/dist/tools/builder.js +12 -3
- package/dist/tools/cms-files.js +2 -10
- package/dist/tools/families.js +132 -0
- package/dist/tools/marketing.js +0 -45
- package/dist/tools/multilingual.js +0 -16
- package/dist/tools/orders.js +0 -1
- package/dist/tools/pages.js +0 -3
- package/dist/tools/products.js +0 -5
- package/dist/tools/registry.js +53 -26
- package/dist/tools/retired-tools.json +141 -0
- package/dist/tools/reviews.js +0 -5
- package/dist/tools/site-config.js +0 -78
- package/dist/web-guide.js +1 -1
- package/package.json +3 -1
- package/dist/tools/affiliate.js +0 -27
- package/dist/tools/catalog-extras.js +0 -88
- package/dist/tools/media.js +0 -39
- package/dist/tools/sale-channels.js +0 -45
package/dist/tools/affiliate.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Affiliate / referral app (Enum.Application affiliates = 4).
|
|
3
|
-
// Install first via install_app({ app: "affiliates" }). Endpoints under /affiliate/*.
|
|
4
|
-
// Programs define commission rules; products opt in; accounts are affiliates; payouts settle commissions.
|
|
5
|
-
export function registerAffiliateTools(server, api, handle) {
|
|
6
|
-
const listShape = {
|
|
7
|
-
page: z.number().optional().describe("Page number (default 1)"),
|
|
8
|
-
limit: z.number().optional().describe("Items per page"),
|
|
9
|
-
term: z.string().optional().describe("Search term"),
|
|
10
|
-
};
|
|
11
|
-
const unwrap = (res, key) => res?.data?.[key] ?? res?.[key] ?? res?.data ?? res;
|
|
12
|
-
server.tool("get_affiliate_programs", "Get the affiliate commission programs (order-level and product-level) configured for the site.", {}, () => handle(async () => unwrap(await api.getProgramAffiliates(), "program_affiliates")));
|
|
13
|
-
server.tool("get_affiliate_statistic", "Get aggregate affiliate statistics (clicks, orders, commission, payouts) for the site.", {}, () => handle(async () => unwrap(await api.getAffiliateStatistic(), "statistic")));
|
|
14
|
-
server.tool("list_affiliate_products", "List products enrolled in the affiliate program (with their commission settings).", listShape, (query) => handle(async () => unwrap(await api.getProductAffiliates(query), "product_affiliates")));
|
|
15
|
-
server.tool("list_affiliate_orders", "List affiliate-attributed orders (referrals that converted).", { ...listShape, status: z.number().optional().describe("Filter by order status code") }, (query) => handle(async () => unwrap(await api.getOrderAffiliates(query), "order_affiliates")));
|
|
16
|
-
server.tool("list_affiliate_accounts", "List affiliate accounts (registered affiliates / referrers).", listShape, (query) => handle(async () => unwrap(await api.getAccountAffiliates(query), "account_affiliates")));
|
|
17
|
-
server.tool("list_affiliate_payouts", "List affiliate payout requests/records.", { ...listShape, status: z.number().optional().describe("Filter by payout status code") }, (query) => handle(async () => unwrap(await api.getPayoutAffiliates(query), "payout_affiliates")));
|
|
18
|
-
server.tool("update_affiliate_order_program", `Create/update the order-level affiliate commission program. \`payload\` is the program object
|
|
19
|
-
(e.g. { "is_activated": true, "commission_type": ..., "commission_value": ... }).`, { payload: z.record(z.any()).describe("Order program settings object") }, ({ payload }) => handle(() => api.upsertOrderProgramAffiliate(payload)));
|
|
20
|
-
server.tool("update_affiliate_product_program", "Create/update the product-level affiliate commission program. `payload` is the program object.", { payload: z.record(z.any()).describe("Product program settings object") }, ({ payload }) => handle(() => api.upsertProductProgramAffiliate(payload)));
|
|
21
|
-
server.tool("upsert_affiliate_product", `Enroll/update a product in the affiliate program with its own commission. \`payload\` includes the
|
|
22
|
-
product id and commission fields (e.g. { "product_id": "...", "commission_type": ..., "commission_value": ... }).`, { payload: z.record(z.any()).describe("Affiliate-product settings object") }, ({ payload }) => handle(() => api.upsertProductAffiliate(payload)));
|
|
23
|
-
server.tool("delete_affiliate_products", "Remove products from the affiliate program. `payload` typically { ids: [...] }.", { payload: z.record(z.any()).describe('e.g. { "ids": ["..."] }') }, ({ payload }) => handle(() => api.deleteProductAffiliates(payload)));
|
|
24
|
-
server.tool("update_affiliate_payout_status", `Update the status of affiliate payout(s). \`payload\` typically { ids: [...], status: <code> }.`, { payload: z.record(z.any()).describe('e.g. { "ids": ["..."], "status": 1 }') }, ({ payload }) => handle(() => api.updatePayoutAffiliateStatus(payload)));
|
|
25
|
-
server.tool("delete_affiliate_accounts", "Remove affiliate accounts. `payload` typically { ids: [...] }.", { payload: z.record(z.any()).describe('e.g. { "ids": ["..."] }') }, ({ payload }) => handle(() => api.deleteAccountAffiliates(payload)));
|
|
26
|
-
server.tool("update_affiliate_account", "Update an affiliate account (e.g. commission rate, status). `payload` is the account object incl. its id.", { payload: z.record(z.any()).describe("Affiliate account object incl. id") }, ({ payload }) => handle(() => api.updateAccountAffiliate(payload)));
|
|
27
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Catalog taxonomy/extras that the dashboard exposes around products:
|
|
3
|
-
// brands, suppliers, product tags, ribbons (sale badges), materials, variations,
|
|
4
|
-
// measurement units, blocked phone numbers, and "contact for price" config.
|
|
5
|
-
// All create_or_update endpoints upsert by id; pass is_removed:true to soft-delete.
|
|
6
|
-
export function registerCatalogExtraTools(server, api, handle) {
|
|
7
|
-
const unwrap = (res, key) => res?.data?.[key] ?? res?.[key] ?? res?.data ?? res;
|
|
8
|
-
// ── Brands ──
|
|
9
|
-
server.tool("list_product_brands", "List product brand tags for the site.", {}, () => handle(async () => unwrap(await api.listProductBrands(), "brand_tags")));
|
|
10
|
-
server.tool("upsert_product_brand", "Create or update a product brand. Omit `id` to create; pass `is_removed:true` with an `id` to delete.", {
|
|
11
|
-
id: z.string().optional().describe("Brand id (omit to create)"),
|
|
12
|
-
name: z.string().describe("Brand name"),
|
|
13
|
-
slug: z.string().optional().describe("URL slug"),
|
|
14
|
-
description: z.string().optional().describe("Description"),
|
|
15
|
-
is_removed: z.boolean().optional().describe("Set true to soft-delete"),
|
|
16
|
-
}, (body) => handle(async () => unwrap(await api.upsertProductBrand(body), "brand_tag")));
|
|
17
|
-
// ── Suppliers ──
|
|
18
|
-
server.tool("list_product_suppliers", "List product supplier tags for the site.", {}, () => handle(async () => unwrap(await api.listProductSuppliers(), "supplier_tags")));
|
|
19
|
-
server.tool("upsert_product_supplier", "Create or update a product supplier. Omit `id` to create; `is_removed:true` to delete.", {
|
|
20
|
-
id: z.string().optional().describe("Supplier id (omit to create)"),
|
|
21
|
-
name: z.string().describe("Supplier name"),
|
|
22
|
-
is_removed: z.boolean().optional().describe("Set true to soft-delete"),
|
|
23
|
-
}, (body) => handle(async () => unwrap(await api.upsertProductSupplier(body), "supplier_tag")));
|
|
24
|
-
// ── Product tags ──
|
|
25
|
-
server.tool("list_product_tags", "List product tags (paginated, searchable by name).", {
|
|
26
|
-
page: z.number().optional().describe("Page number (default 1)"),
|
|
27
|
-
limit: z.number().optional().describe("Items per page (default 20)"),
|
|
28
|
-
term: z.string().optional().describe("Search by name"),
|
|
29
|
-
}, (query) => handle(async () => unwrap(await api.listProductTags(query), "data")));
|
|
30
|
-
server.tool("upsert_product_tag", "Create or update a product tag. Omit `id` to create; `is_removed:true` to delete (also detaches from products).", {
|
|
31
|
-
id: z.string().optional().describe("Tag id (omit to create)"),
|
|
32
|
-
name: z.string().describe("Tag name"),
|
|
33
|
-
slug: z.string().optional().describe("URL slug"),
|
|
34
|
-
is_removed: z.boolean().optional().describe("Set true to soft-delete"),
|
|
35
|
-
}, (body) => handle(async () => unwrap(await api.upsertProductTag(body), "product_tag")));
|
|
36
|
-
// ── Ribbons (sale badges) ──
|
|
37
|
-
server.tool("list_ribbons", "List ribbons (product sale badges) for the site.", {}, () => handle(async () => unwrap(await api.listRibbons(), "ribbons")));
|
|
38
|
-
server.tool("upsert_ribbon", "Create or update a ribbon (sale badge). `type` and `name` are unique per site. Omit `id` to create; `is_removed:true` to delete.", {
|
|
39
|
-
id: z.string().optional().describe("Ribbon id (omit to create)"),
|
|
40
|
-
name: z.string().describe("Ribbon name (unique per site)"),
|
|
41
|
-
type: z.number().describe("Ribbon type code (unique per site)"),
|
|
42
|
-
status: z.number().optional().describe("Status code"),
|
|
43
|
-
start_time: z.string().optional().describe("ISO datetime the ribbon starts"),
|
|
44
|
-
end_time: z.string().optional().describe("ISO datetime the ribbon ends"),
|
|
45
|
-
end_day: z.number().optional().describe("Auto-expire after N days"),
|
|
46
|
-
is_removed: z.boolean().optional().describe("Set true to soft-delete"),
|
|
47
|
-
}, (body) => handle(async () => unwrap(await api.upsertRibbon(body), "ribbon")));
|
|
48
|
-
// ── Materials ──
|
|
49
|
-
server.tool("list_materials", "List product materials for the site.", {}, () => handle(async () => unwrap(await api.listMaterials(), "materials")));
|
|
50
|
-
server.tool("upsert_material", "Create or update a product material. Supports nesting via parent_id. Omit `id` to create; `is_removed:true` to delete.", {
|
|
51
|
-
id: z.string().optional().describe("Material id (omit to create)"),
|
|
52
|
-
name: z.string().describe("Material name"),
|
|
53
|
-
slug: z.string().optional().describe("URL slug"),
|
|
54
|
-
description: z.string().optional().describe("Description"),
|
|
55
|
-
parent_id: z.string().optional().describe("Parent material id (for nesting)"),
|
|
56
|
-
is_removed: z.boolean().optional().describe("Set true to soft-delete"),
|
|
57
|
-
}, (body) => handle(async () => unwrap(await api.upsertMaterial(body), "material")));
|
|
58
|
-
// ── Variations ──
|
|
59
|
-
server.tool("get_variation", "Get a single product variation by its id.", { variation_id: z.string().describe("Variation id") }, ({ variation_id }) => handle(async () => unwrap(await api.getVariation(variation_id), "variation")));
|
|
60
|
-
// ── Measurement units ──
|
|
61
|
-
server.tool("get_product_measurement", "Get the product measurement-unit tree (units with exchange values).", {}, () => handle(async () => unwrap(await api.getProductMeasurement(), "product_measures")));
|
|
62
|
-
server.tool("update_product_measurement", "Upsert product measurement units (full list). Each unit upserts by id; pass is_removed:true to delete one.", {
|
|
63
|
-
units: z.array(z.object({
|
|
64
|
-
id: z.string().optional().describe("Unit id (omit to create)"),
|
|
65
|
-
name: z.string().describe("Unit name"),
|
|
66
|
-
is_default: z.boolean().describe("Whether this is the default/base unit"),
|
|
67
|
-
exchange_value: z.number().describe("Conversion value vs the base unit"),
|
|
68
|
-
parent_id: z.string().optional().describe("Parent unit id"),
|
|
69
|
-
is_removed: z.boolean().optional().describe("Set true to delete this unit"),
|
|
70
|
-
}).passthrough()).describe("Full list of measurement units"),
|
|
71
|
-
}, ({ units }) => handle(() => api.updateProductMeasurement(units)));
|
|
72
|
-
// ── Blocked phone numbers ──
|
|
73
|
-
server.tool("list_blocked_phones", "List blocked phone numbers (e.g. blacklisted customers).", {
|
|
74
|
-
term: z.string().optional().describe("Search term"),
|
|
75
|
-
type: z.number().optional().describe("Block type code"),
|
|
76
|
-
}, (query) => handle(async () => unwrap(await api.listBlockPhoneNumbers(query), "block_list")));
|
|
77
|
-
server.tool("block_phone_customers", "Block customer phone numbers (upsert the given list).", { phone_numbers: z.array(z.string()).min(1).describe("Phone numbers to block") }, ({ phone_numbers }) => handle(() => api.upsertBlockPhoneCustomers(phone_numbers)));
|
|
78
|
-
server.tool("unblock_all_phone_customers", "Remove all blocked customer phone numbers for the site.", {}, () => handle(() => api.removeAllBlockPhoneCustomers()));
|
|
79
|
-
// ── Contact for price ──
|
|
80
|
-
server.tool("get_price_contact", 'Get the "contact for price" config. type 1 = applied to products, 2 = applied to categories.', { type: z.number().optional().describe("1 = products, 2 = categories") }, ({ type }) => handle(async () => unwrap(await api.getPriceContacts(type), "price_contacts")));
|
|
81
|
-
server.tool("update_price_contact", 'Set which products/categories are "contact for price" (full replace within the given type). type 1 → pass product_ids; type 2 → pass category_ids.', {
|
|
82
|
-
type: z.number().describe("1 = products, 2 = categories"),
|
|
83
|
-
product_ids: z.array(z.string()).optional().describe("Product ids (when type=1)"),
|
|
84
|
-
category_ids: z.array(z.string()).optional().describe("Category ids (when type=2)"),
|
|
85
|
-
}, (body) => handle(() => api.updatePriceContact(body)));
|
|
86
|
-
// ── Category detail ──
|
|
87
|
-
server.tool("get_category", "Get a single product category by id (includes custom sort product ids).", { category_id: z.string().describe("Category id") }, ({ category_id }) => handle(async () => unwrap(await api.getCategoryById(category_id), "data")));
|
|
88
|
-
}
|
package/dist/tools/media.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Media library (folders + content) and PWA manifest. Binary file upload uses
|
|
3
|
-
// multipart on the dashboard; here we expose listing, base64 upload, folder/content
|
|
4
|
-
// edits, capacity, trash, and PWA config — the parts that work over JSON.
|
|
5
|
-
export function registerMediaTools(server, api, handle) {
|
|
6
|
-
const unwrap = (res, key) => (key && (res?.data?.[key] ?? res?.[key])) ?? res?.data ?? res;
|
|
7
|
-
const listShape = {
|
|
8
|
-
folder_id: z.string().optional().describe("Folder id (omit for root)"),
|
|
9
|
-
keyword: z.string().optional().describe("Search keyword"),
|
|
10
|
-
is_trash: z.boolean().optional().describe("List trashed items"),
|
|
11
|
-
page: z.number().optional().describe("Page number"),
|
|
12
|
-
page_size: z.number().optional().describe("Items per page"),
|
|
13
|
-
order: z.string().optional().describe("Sort order"),
|
|
14
|
-
};
|
|
15
|
-
server.tool("list_media_folders", "List media-library folders (optionally under a parent folder).", { ...listShape, is_tree: z.boolean().optional().describe("Return the full folder tree") }, (query) => handle(async () => unwrap(await api.listMediaFolders(query))));
|
|
16
|
-
server.tool("list_media_content", "List media-library content (images/videos/files), optionally filtered by folder.", { ...listShape, media_types: z.array(z.string()).optional().describe("Filter by type, e.g. ['image']") }, (query) => handle(async () => unwrap(await api.listMediaContent(query))));
|
|
17
|
-
server.tool("list_media_all", "List folders and content together in one call.", listShape, (query) => handle(async () => unwrap(await api.listMediaAll(query))));
|
|
18
|
-
server.tool("get_media_capacity", "Get media storage capacity/usage for the site.", {}, () => handle(async () => unwrap(await api.getMediaCapacity())));
|
|
19
|
-
server.tool("upload_media_base64", "Upload an image to the media library from a base64 data URI. Returns the CDN URL.", { base64: z.string().describe("Base64 data URI (data:image/...;base64,...)") }, ({ base64 }) => handle(async () => unwrap(await api.uploadBase64Media(base64))));
|
|
20
|
-
server.tool("update_media_folder", "Update a media folder (rename, move, or trash). Pass `id` plus fields.", {
|
|
21
|
-
id: z.string().describe("Folder id"),
|
|
22
|
-
name: z.string().optional().describe("New name"),
|
|
23
|
-
folder_id: z.string().optional().describe("Move under this parent folder"),
|
|
24
|
-
is_deleted: z.boolean().optional().describe("Move to trash"),
|
|
25
|
-
}, (body) => handle(async () => unwrap(await api.updateMediaFolder(body))));
|
|
26
|
-
server.tool("update_media_content", "Update a media content item (rename, move, or trash). Pass `id` plus fields.", {
|
|
27
|
-
id: z.string().describe("Content id"),
|
|
28
|
-
name: z.string().optional().describe("New name"),
|
|
29
|
-
folder_id: z.string().optional().describe("Move into this folder"),
|
|
30
|
-
is_deleted: z.boolean().optional().describe("Move to trash"),
|
|
31
|
-
}, (body) => handle(async () => unwrap(await api.updateMediaContent(body))));
|
|
32
|
-
server.tool("empty_media_trash", "Permanently delete all trashed media folders and content.", {}, () => handle(() => api.emptyMediaTrash()));
|
|
33
|
-
// ── PWA ──
|
|
34
|
-
server.tool("get_pwa", "Get the site's PWA configuration (manifest + iOS icon).", {}, () => handle(() => api.getPwa()));
|
|
35
|
-
server.tool("update_pwa", "Update the PWA manifest (the full manifest object replaces the existing one).", {
|
|
36
|
-
manifest: z.record(z.any()).describe("PWA manifest object (name, short_name, icons, display, …)"),
|
|
37
|
-
ios_icon_url: z.string().optional().describe("iOS home-screen icon URL"),
|
|
38
|
-
}, (body) => handle(() => api.upsertPwa(body)));
|
|
39
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Sale-channels app: partner product feeds (Google/Facebook/etc.) and catalog syncs.
|
|
3
|
-
// Sitemaps need no tool: the backend builds them at render time (<domain>/root_sitemaps.xml). Google Ads / OAuth-connect flows are intentionally omitted —
|
|
4
|
-
// they require an externally-authorized Google/Facebook partner.
|
|
5
|
-
export function registerSaleChannelTools(server, api, handle) {
|
|
6
|
-
const unwrap = (res, key) => (key && (res?.data?.[key] ?? res?.[key])) ?? res?.data ?? res;
|
|
7
|
-
// ── Partner feeds ──
|
|
8
|
-
server.tool("list_partner_feeds", "List product feeds for sale channels (Google Shopping, Facebook, etc.).", {
|
|
9
|
-
page: z.number().optional().describe("Page number"),
|
|
10
|
-
limit: z.number().optional().describe("Items per page"),
|
|
11
|
-
term: z.string().optional().describe("Search term"),
|
|
12
|
-
type: z.string().optional().describe("Feed type filter"),
|
|
13
|
-
}, (query) => handle(async () => unwrap(await api.listPartnerFeeds(query), "partner_feeds")));
|
|
14
|
-
server.tool("create_partner_feed", "Create a product feed. `name` is required; slug auto-generates. Optionally pass product_conditions to auto-populate.", {
|
|
15
|
-
type: z.string().describe("Feed type, e.g. 'google', 'facebook'"),
|
|
16
|
-
partner_feed: z.object({
|
|
17
|
-
name: z.string().describe("Feed name"),
|
|
18
|
-
slug: z.string().optional(),
|
|
19
|
-
type: z.string().optional(),
|
|
20
|
-
product_conditions: z.array(z.any()).optional().describe("Auto-include conditions"),
|
|
21
|
-
condition_type: z.string().optional(),
|
|
22
|
-
settings: z.record(z.any()).optional(),
|
|
23
|
-
status: z.string().optional(),
|
|
24
|
-
}).passthrough().describe("Feed object"),
|
|
25
|
-
add_partner_product_feed_ids: z.array(z.string()).optional().describe("Product ids to add"),
|
|
26
|
-
delete_partner_product_feed_ids: z.array(z.string()).optional().describe("Product ids to remove"),
|
|
27
|
-
}, (body) => handle(async () => unwrap(await api.createPartnerFeed(body), "partner_feed")));
|
|
28
|
-
server.tool("update_partner_feed", "Update a product feed. `partner_feed.id` must match `partner_feed_id`.", {
|
|
29
|
-
partner_feed_id: z.string().describe("Feed id (path)"),
|
|
30
|
-
type: z.string().describe("Feed type"),
|
|
31
|
-
partner_feed: z.record(z.any()).describe("Feed object incl. id"),
|
|
32
|
-
add_partner_product_feed_ids: z.array(z.string()).optional(),
|
|
33
|
-
delete_partner_product_feed_ids: z.array(z.string()).optional(),
|
|
34
|
-
}, ({ partner_feed_id, ...body }) => handle(async () => unwrap(await api.updatePartnerFeed(partner_feed_id, body), "partner_feed")));
|
|
35
|
-
server.tool("delete_partner_feeds", "Delete product feeds by id.", { ids: z.array(z.string()).min(1).describe("Feed ids") }, ({ ids }) => handle(() => api.deletePartnerFeeds(ids)));
|
|
36
|
-
server.tool("list_partner_feed_products", "List the products inside a specific product feed.", {
|
|
37
|
-
partner_feed_id: z.string().describe("Feed id"),
|
|
38
|
-
page: z.number().optional().describe("Page number"),
|
|
39
|
-
limit: z.number().optional().describe("Items per page"),
|
|
40
|
-
term: z.string().optional().describe("Search term"),
|
|
41
|
-
}, ({ partner_feed_id, ...query }) => handle(async () => unwrap(await api.listPartnerFeedProducts(partner_feed_id, query), "product_feeds")));
|
|
42
|
-
server.tool("sync_partner_feed", "Publish/sync a feed's products to its destination channel.", { partner_feed_id: z.string().describe("Feed id") }, ({ partner_feed_id }) => handle(() => api.syncPartnerFeed(partner_feed_id)));
|
|
43
|
-
// ── Google merchants (read) ──
|
|
44
|
-
server.tool("list_google_merchants", "List the Google Merchant records linked to the site (read-only).", { platform: z.number().optional().describe("Platform code (default 1 = google_merchant)") }, (query) => handle(async () => unwrap(await api.listGoogleMerchants(query), "merchants")));
|
|
45
|
-
}
|