@revenexx/cover 0.2.25 → 0.2.27

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 (83) hide show
  1. package/app/api/brands.ts +5 -0
  2. package/app/api/categories.ts +1 -0
  3. package/app/api/product.ts +2 -0
  4. package/app/app.config.ts +8 -0
  5. package/app/components/cart/quickadd/CartQuickAdd.vue +110 -34
  6. package/app/components/category/view/GridView.vue +34 -13
  7. package/app/components/category/view/ListView.vue +5 -5
  8. package/app/components/checkout/onepage/CheckoutDeliverySection.vue +29 -1
  9. package/app/components/checkout/onepage/CheckoutPaymentSection.vue +30 -1
  10. package/app/components/layout/AppLogo.vue +2 -1
  11. package/app/components/layout/footer/Footer.vue +9 -3
  12. package/app/components/layout/header/CategoryPanel.vue +92 -0
  13. package/app/components/layout/header/MainNav.vue +89 -2
  14. package/app/components/listing/ListingResults.vue +16 -2
  15. package/app/components/listing/ListingSubcategories.vue +124 -0
  16. package/app/components/product/card/Compact.vue +144 -0
  17. package/app/components/product/detail/ProductDetailAssociations.vue +96 -0
  18. package/app/components/product/detail/ProductDetailIdentity.vue +50 -5
  19. package/app/components/product/detail/ProductDetailVariantRow.vue +139 -0
  20. package/app/components/product/detail/ProductDetailVariants.vue +613 -0
  21. package/app/components/product/media/ProductMediaImage.vue +70 -0
  22. package/app/components/ui/forms/SearchInput.vue +14 -2
  23. package/app/components/ui/media/ImageSlider.vue +158 -0
  24. package/app/composables/useBranding.ts +22 -0
  25. package/app/composables/useBrands.ts +42 -0
  26. package/app/composables/useCategories.ts +55 -1
  27. package/app/composables/useProduct.ts +5 -4
  28. package/app/composables/useProductAssociations.ts +35 -0
  29. package/app/composables/useProductImage.ts +35 -2
  30. package/app/composables/useProductVariants.ts +46 -0
  31. package/app/composables/useSearchListing.ts +16 -5
  32. package/app/composables/useSubcategoryTiles.ts +36 -0
  33. package/app/config/navigation.ts +9 -0
  34. package/app/config/palette.ts +1 -0
  35. package/app/config/quickActions.ts +137 -0
  36. package/app/config/themes.ts +1 -0
  37. package/app/interfaces/brand.ts +16 -0
  38. package/app/interfaces/category.ts +45 -0
  39. package/app/interfaces/image-slider.ts +18 -0
  40. package/app/interfaces/product-associations.ts +32 -0
  41. package/app/interfaces/product-detail.ts +6 -0
  42. package/app/interfaces/product-variants.ts +73 -0
  43. package/i18n/locales/de/account.json +17 -0
  44. package/i18n/locales/de/cart.json +5 -1
  45. package/i18n/locales/de/checkout.json +2 -0
  46. package/i18n/locales/de/common.json +42 -2
  47. package/i18n/locales/de/editor.json +91 -0
  48. package/i18n/locales/de/product.json +48 -2
  49. package/i18n/locales/de/search.json +4 -2
  50. package/i18n/locales/en/account.json +17 -0
  51. package/i18n/locales/en/cart.json +4 -0
  52. package/i18n/locales/en/checkout.json +2 -0
  53. package/i18n/locales/en/common.json +42 -2
  54. package/i18n/locales/en/editor.json +91 -0
  55. package/i18n/locales/en/product.json +47 -1
  56. package/i18n/locales/en/search.json +3 -1
  57. package/nuxt.config.ts +10 -0
  58. package/package.json +3 -1
  59. package/public/img/brands/revenexx.svg +39 -0
  60. package/server/api/brands.get.ts +27 -0
  61. package/server/api/categories/[slug]/subcategories.get.ts +280 -0
  62. package/server/api/product/[id]/associations.get.ts +27 -0
  63. package/server/api/product/[id]/variants.get.ts +27 -0
  64. package/server/api/quick-actions.get.ts +43 -0
  65. package/server/api/typesense/search.post.ts +116 -13
  66. package/server/data/categories.json +5 -0
  67. package/server/data/product-associations.json +44 -0
  68. package/server/data/product-detail.json +346 -0
  69. package/server/data/product-list.json +340 -0
  70. package/server/data/product-variant-models.json +75 -0
  71. package/server/interfaces/brand.ts +17 -0
  72. package/server/interfaces/product.ts +14 -0
  73. package/server/services/ApiBrandService.ts +110 -0
  74. package/server/services/ApiProductService.ts +43 -9
  75. package/server/services/LocalFileProductService.ts +200 -6
  76. package/server/services/MockBrandService.ts +52 -0
  77. package/server/utils/brandService.ts +24 -0
  78. package/server/utils/contentTenant.ts +67 -0
  79. package/server/utils/liveCatalog.ts +744 -46
  80. package/server/utils/productService.ts +6 -1
  81. package/server/utils/productsSchema.ts +5 -2
  82. package/server/utils/revenexxCredentials.ts +258 -0
  83. package/server/utils/revenexxSdk.ts +38 -47
@@ -240,6 +240,23 @@
240
240
  "noRequisitions": "No open requisitions.",
241
241
  "noBudgets": "No budgets configured."
242
242
  },
243
+ "quickActions": {
244
+ "directOrder": { "title": "Quick entry", "description": "Enter article numbers directly" },
245
+ "orderLists": { "description": "Recurring requirements" },
246
+ "orders": { "description": "Status & reordering" },
247
+ "cart": { "description": "Go to checkout" },
248
+ "dashboard": { "description": "Your account at a glance" },
249
+ "carts": { "description": "Saved shopping carts" },
250
+ "requisitions": { "description": "Request and track approvals" },
251
+ "approvals": { "description": "Handle pending approvals" },
252
+ "costCenters": { "description": "Budgets and allocation" },
253
+ "workflows": { "description": "Manage approval processes" },
254
+ "profile": { "description": "Master data and password" },
255
+ "organization": { "description": "Manage your organization" },
256
+ "team": { "description": "Access and roles" },
257
+ "preferences": { "description": "Defaults for your orders" },
258
+ "addresses": { "description": "Delivery and billing addresses" }
259
+ },
243
260
  "comingSoon": {
244
261
  "title": "In development",
245
262
  "description": "This area is part of the product roadmap and will be built here.",
@@ -133,6 +133,10 @@
133
133
  "add": "Add",
134
134
  "added": "Added {quantity}× {name}"
135
135
  },
136
+ "quickOrder": {
137
+ "title": "Straight to your order",
138
+ "description": "Enter an article number or article name, choose a quantity and add it straight to the cart."
139
+ },
136
140
  "requisition": {
137
141
  "title": "Requisition",
138
142
  "meta": "Requested by {name} on {date}",
@@ -114,6 +114,7 @@
114
114
  "businessDays": "business days",
115
115
  "free": "Free",
116
116
  "onRequest": "On request",
117
+ "noneAvailable": "No shipping method could be determined for this basket. Please contact us.",
117
118
  "requestedDate": "Requested Delivery Date",
118
119
  "deliveryNote": "Delivery Note",
119
120
  "deliveryNotePlaceholder": "Special delivery instructions...",
@@ -124,6 +125,7 @@
124
125
  },
125
126
  "payment": {
126
127
  "method": "Payment Method",
128
+ "noneAvailable": "No payment method available. Please contact us.",
127
129
  "poNumber": "PO Number",
128
130
  "poNumberPlaceholder": "Enter PO number...",
129
131
  "costCenter": "Cost Center",
@@ -10,7 +10,13 @@
10
10
  "services": "Services",
11
11
  "knowledge": "Knowledge",
12
12
  "mainNavigation": "Main navigation",
13
- "backToShop": "Back to shop"
13
+ "backToShop": "Back to shop",
14
+ "catalog": {
15
+ "loading": "Loading product groups…",
16
+ "showAllGroups": "all {count} groups",
17
+ "browseAll": "Browse the whole catalogue",
18
+ "groupCount": "{count} product groups"
19
+ }
14
20
  },
15
21
  "summary": {
16
22
  "subtotal": "Subtotal",
@@ -30,7 +36,30 @@
30
36
  "appName": "Cover",
31
37
  "footer": {
32
38
  "tagline": "B2B supply solutions for modern businesses.",
33
- "copyright": "© {year} Cover Corp — All rights reserved."
39
+ "copyright": "© {year} Cover Corp — All rights reserved.",
40
+ "columns": {
41
+ "products": {
42
+ "heading": "Products",
43
+ "all": "All products",
44
+ "new": "New arrivals",
45
+ "featured": "Featured",
46
+ "catalog": "Catalogue"
47
+ },
48
+ "account": {
49
+ "heading": "Account",
50
+ "orders": "Orders",
51
+ "invoices": "Invoices",
52
+ "lists": "Lists",
53
+ "contracts": "Contracts"
54
+ },
55
+ "support": {
56
+ "heading": "Support",
57
+ "contact": "Contact",
58
+ "docs": "Documentation",
59
+ "status": "System status",
60
+ "quote": "Request a quote"
61
+ }
62
+ }
34
63
  },
35
64
  "topbar": {
36
65
  "freeShipping": "Free shipping on orders over €100",
@@ -76,5 +105,16 @@
76
105
  "placeholder": "Pick a date…",
77
106
  "clear": "Clear"
78
107
  }
108
+ },
109
+ "slider": {
110
+ "region": "Campaigns",
111
+ "slide": "Slide {index}",
112
+ "previous": "Previous slide",
113
+ "next": "Next slide"
114
+ },
115
+ "legal": {
116
+ "privacy": "Privacy policy",
117
+ "terms": "Terms of service",
118
+ "cookies": "Cookie policy"
79
119
  }
80
120
  }
@@ -3,6 +3,97 @@
3
3
  "provider": {
4
4
  "editLabel": "Edit page"
5
5
  },
6
+ "pages": {
7
+ "title": "Pages",
8
+ "description": "This tenant's pages. Pick one to open it in the editor.",
9
+ "searchPlaceholder": "Search by title or slug …",
10
+ "columns": {
11
+ "title": "Title",
12
+ "slug": "Slug",
13
+ "status": "Status",
14
+ "updated": "Updated"
15
+ },
16
+ "edit": "Edit",
17
+ "view": "View",
18
+ "reload": "Reload",
19
+ "empty": "No pages found.",
20
+ "count": "{count} pages",
21
+ "mode": {
22
+ "live": "Live API",
23
+ "mock": "Local demo data"
24
+ },
25
+ "tenant": {
26
+ "label": "Tenant",
27
+ "hint": "Content, navigation and theme settings come from this tenant."
28
+ },
29
+ "create": {
30
+ "button": "New page",
31
+ "title": "Create a page",
32
+ "fields": {
33
+ "title": "Title",
34
+ "slug": "Slug",
35
+ "bundle": "Bundle"
36
+ },
37
+ "placeholders": {
38
+ "title": "About us",
39
+ "slug": "about-us"
40
+ },
41
+ "slugHelp": "Lowercase letters, digits, \"-\" and \"/\" for nested paths.",
42
+ "bundleHelp": "Always treated as \"standard\" locally; the value only takes effect once the page is promoted and served by the live API.",
43
+ "warnings": {
44
+ "routeSlug": "This slug belongs to a named route — the page will not be reachable at that path."
45
+ },
46
+ "errors": {
47
+ "duplicate": "A page with this slug already exists.",
48
+ "invalidSlug": "Lowercase letters and digits only, separated by \"-\" or \"/\"."
49
+ },
50
+ "cancel": "Cancel",
51
+ "submit": "Create and edit",
52
+ "saved": "Page created.",
53
+ "error": "The page could not be created."
54
+ },
55
+ "localOverride": {
56
+ "badge": "local copy",
57
+ "baselineBadge": "committed baseline",
58
+ "hint": "Local working copy {file} (changed {modified}) overrides the committed baseline. Delete the file to reset, copy it over {baseFile} to promote.",
59
+ "invalid": "{file} is not valid JSON and is being ignored — showing the committed baseline instead.",
60
+ "baselineHint": "Showing the committed baseline. The local working copy {file} is untouched and read-only — switch back to it to edit.",
61
+ "source": {
62
+ "label": "Content source",
63
+ "local": "Local working copy",
64
+ "baseline": "Committed baseline"
65
+ }
66
+ },
67
+ "liveData": {
68
+ "label": "Live catalogue data",
69
+ "hint": "Products, categories, prices and stock come from this tenant's API instead of the demo data.",
70
+ "hintFrom": "Products, categories, prices and stock come from gateway tenant “{gateway}” instead of the demo data.",
71
+ "unavailable": "No API credentials resolve for “{tenant}” — neither an entry of its own (NUXT_REVENEXX_TENANTS) nor the env pair (NUXT_REVENEXX_TENANT / NUXT_REVENEXX_API_KEY)."
72
+ }
73
+ },
74
+ "canvas": {
75
+ "noData": "No data",
76
+ "productMissing": {
77
+ "title": "Sample product not found",
78
+ "description": "The stored product id “{id}” does not exist in this tenant's catalogue, so the preview stays empty. On a real product URL the product comes from the path.",
79
+ "descriptionNoId": "The catalogue returns no product to preview for this tenant. On a real product URL the product comes from the path."
80
+ },
81
+ "productFallback": {
82
+ "title": "Preview shows a different product",
83
+ "description": "The stored product id “{id}” does not exist in the active catalogue, so “{name}” is previewed instead. Pick the right tenant and switch “Live catalogue data” on to preview the pinned product."
84
+ },
85
+ "blocks": {
86
+ "product_gallery": "Gallery",
87
+ "product_identity": "Product header",
88
+ "product_stock": "Availability",
89
+ "product_add_to_cart": "Add to cart",
90
+ "product_pricing": "Volume pricing",
91
+ "product_description": "Description",
92
+ "product_specifications": "Specifications",
93
+ "product_variants": "Variants",
94
+ "product_associations": "Accessories & references"
95
+ }
96
+ },
6
97
  "appearance": {
7
98
  "colorScheme": {
8
99
  "title": "Color scheme"
@@ -3,6 +3,30 @@
3
3
  "sku": "SKU",
4
4
  "description": "Description",
5
5
  "specifications": "Specifications",
6
+ "associations": {
7
+ "mandatoryNote": "must be ordered along"
8
+ },
9
+ "variants": {
10
+ "title": "Variants",
11
+ "count": "{count} variant | {count} variants",
12
+ "countFiltered": "{shown} of {total}",
13
+ "filterSkuAria": "Filter by item number",
14
+ "availableOnly": "In stock only",
15
+ "chipAvailable": "In stock",
16
+ "clearAxis": "Clear",
17
+ "resetAll": "Reset all",
18
+ "reset": "Reset",
19
+ "empty": "No variant matches these filters.",
20
+ "notOrderable": "Not orderable",
21
+ "addToCartAria": "Add to cart: {sku}",
22
+ "sortBy": "Sort by {column}",
23
+ "showAll": "Show all {count} variants",
24
+ "columns": {
25
+ "name": "Description",
26
+ "price": "Price",
27
+ "availability": "Availability"
28
+ }
29
+ },
6
30
  "pricing": {
7
31
  "volumePricing": "Volume Pricing",
8
32
  "minQuantity": "Min. Quantity",
@@ -20,7 +44,10 @@
20
44
  },
21
45
  "price": {
22
46
  "from": "from",
23
- "onRequest": "Price on request"
47
+ "onRequest": "Price on request",
48
+ "inclTax": "incl. VAT",
49
+ "exclTax": "excl. VAT",
50
+ "volume": "Volume pricing available"
24
51
  },
25
52
  "actions": {
26
53
  "info": "Info",
@@ -66,6 +93,25 @@
66
93
  "delivery": "Delivery in 1–3 working days",
67
94
  "paymentTerms": "Buy on invoice — 30 days net",
68
95
  "volume": "Volume pricing for bulk orders"
96
+ },
97
+ "grid": {
98
+ "count": "{count} item | {count} items",
99
+ "error": "Products could not be loaded",
100
+ "noSelection": {
101
+ "title": "No category or brand selected",
102
+ "description": "Pick a category or a brand in the block options."
103
+ },
104
+ "empty": {
105
+ "title": "No products found",
106
+ "description": "There are currently no products for this selection."
107
+ }
108
+ },
109
+ "brandGrid": {
110
+ "error": "Brands could not be loaded",
111
+ "empty": {
112
+ "title": "No brands found",
113
+ "description": "The catalogue currently lists no manufacturer."
114
+ }
69
115
  }
70
116
  }
71
117
  }
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "results": {
10
10
  "title": "Search results for \"{query}\"",
11
+ "catalogTitle": "Catalog",
11
12
  "count": "{count} result | {count} results",
12
13
  "error": "Search failed",
13
14
  "emptyTitle": "No matches",
@@ -50,7 +51,8 @@
50
51
  },
51
52
  "category": {
52
53
  "searchPlaceholder": "Search within this category…",
53
- "allProducts": "All products"
54
+ "allProducts": "All products",
55
+ "productCount": "{count} product | {count} products"
54
56
  }
55
57
  }
56
58
  }
package/nuxt.config.ts CHANGED
@@ -76,6 +76,16 @@ export default defineNuxtConfig({
76
76
  revenexxApiUrl: "https://api.revenexx.com",
77
77
  revenexxTenant: "",
78
78
  revenexxApiKey: "",
79
+ // Per-content-tenant gateway credentials, keyed by the `cover-tenant`
80
+ // cookie: {"eltric":{"tenant":"eltric","apiKey":"rvxk_…"}}. Lets one dev
81
+ // server serve several tenants' real catalogues (server/utils/
82
+ // revenexxCredentials.ts). Nitro destr()s NUXT_* values, so the env form
83
+ // arrives here already parsed — the parser accepts both shapes.
84
+ //
85
+ // DEV/PREVIEW ONLY. A deployed Site gets its tenant from the brokered
86
+ // request context, and a populated map here would let the cover-tenant
87
+ // cookie pick which tenant's API key the BFF authenticates with.
88
+ revenexxTenants: "",
79
89
  typesenseHost: "localhost",
80
90
  typesensePort: 8108,
81
91
  typesenseProtocol: "http",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -26,6 +26,8 @@
26
26
  "./composables/*": "./app/composables/*.ts",
27
27
  "./config/*": "./app/config/*.ts",
28
28
  "./interfaces/*": "./app/interfaces/*.ts",
29
+ "./server/services/*": "./server/services/*.ts",
30
+ "./server/utils/*": "./server/utils/*.ts",
29
31
  "./shared/*": "./app/shared/*.ts",
30
32
  "./validations/*": "./app/validations/*.ts"
31
33
  },
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Manufacturer logo of the demo catalogue's own brand "revenexx" — the single
4
+ brand the bundled demo data carries a logo for, so the product detail's
5
+ identity block can show what a real catalogue logo looks like (third-party
6
+ demo brands stay logo-less on purpose and render no logo at all).
7
+
8
+ Same wordmark as apps/website/public/brand/logo/, recoloured for a light
9
+ product page: violet wordmark and mark, white glyph inside the mark.
10
+ -->
11
+ <svg id="LOGO" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 2858.64 427.65">
12
+ <defs>
13
+ <style>
14
+ .st0 {
15
+ fill: #fff;
16
+ }
17
+
18
+ .st1 {
19
+ fill: #2d009e;
20
+ }
21
+ </style>
22
+ </defs>
23
+ <g>
24
+ <path class="st1" d="M2783.61,359.02l-71.98-99.61-65.46,99.61h-70.85l101.43-148.22-102-141.61h73.19l72.62,100.81,67.85-100.81h70.23l-103.2,148.79,101.43,141.04h-73.26Z"/>
25
+ <path class="st1" d="M2460.31,359.02l-72.01-99.61-65.44,99.61h-70.87l101.45-148.22-102.02-141.61h73.21l72.62,100.81,67.85-100.81h70.23l-103.23,148.79,101.45,141.04h-73.26.02Z"/>
26
+ <path class="st1" d="M2225.22,196.99c0-78.62-52.84-136.18-133.28-136.18s-136.26,59.39-136.26,153.01,58.27,153.02,141.11,153.02c61.23,0,105.68-34.8,126.03-89.4l-52.2-16.77c-12.6,30.01-36.06,49.18-72.05,49.18-46.22,0-74.46-32.4-79.83-79.82h204.72c1.21-11.98,1.77-25.22,1.77-32.97v-.06h-.01ZM2019.92,183.81c7.82-39.59,31.83-66.01,72.05-66.01,43.84,0,67.21,31.77,72.08,66.01h-144.13Z"/>
27
+ <path class="st1" d="M1842.58,195.79c0-53.4-24.03-76.79-60.03-76.79-43.81,0-68.39,35.43-68.39,87v153.01h-64.82V69.19h58.82v52.2c18.03-37.83,50.43-60.59,97.22-60.59,60.03,0,102.07,37.83,102.07,113.42v184.79h-64.8v-163.23h-.07,0Z"/>
28
+ <path class="st1" d="M1596.81,196.99c0-78.62-52.84-136.18-133.28-136.18s-136.25,59.39-136.25,153.01,58.26,153.02,141.04,153.02c61.21,0,105.66-34.8,126.03-89.4l-52.2-16.77c-12.62,30.01-36,49.18-72.06,49.18-46.21,0-74.46-32.4-79.82-79.82h204.72c1.18-11.98,1.82-25.22,1.82-32.97v-.06h0ZM1391.53,183.81c7.82-39.59,31.84-66.01,72.06-66.01,43.82,0,67.21,31.77,72.05,66.01h-144.12,0Z"/>
29
+ <path class="st1" d="M1142.88,359.02l-112.85-289.83h67.27l74.4,205.22,73.83-205.22h67.27l-112.85,289.83h-57.07Z"/>
30
+ <path class="st1" d="M1016.53,196.99c0-78.62-52.83-136.18-133.28-136.18s-136.24,59.39-136.24,153.01,58.25,153.02,141.04,153.02c61.22,0,105.67-34.8,126.03-89.4l-52.2-16.77c-12.61,30.01-36,49.18-72.06,49.18-46.21,0-74.46-32.4-79.82-79.82h204.71c1.2-11.98,1.83-25.22,1.83-32.97v-.06h-.01ZM811.18,183.81c7.82-39.59,31.84-66.01,72.06-66.01,43.82,0,67.21,31.77,72.06,66.01h-144.13.01Z"/>
31
+ <path class="st1" d="M557.8,359.02V69.19h59.45v56.99c15.01-43.19,43.82-65.38,85.24-65.38,10.78,0,19.8,1.2,25.79,2.39v65.38c-9.58-2.39-18.03-3.03-25.22-3.03-46.84,0-79.82,34.17-79.82,112.22v121.18h-65.44v.08Z"/>
32
+ </g>
33
+ <g id="Layer_3">
34
+ <g>
35
+ <path class="st1" d="M38.36,0h347.67c21.17,0,38.36,17.19,38.36,38.36v350.93c0,21.17-17.19,38.36-38.36,38.36H38.36c-21.17,0-38.36-17.19-38.36-38.36V38.36C0,17.19,17.19,0,38.36,0Z"/>
36
+ <path class="st0" d="M62.03,248.41l81.87,47.21c13.57,7.84,21.92,22.3,21.92,38.04v26.37l47.72-27.71v-26.38c0-15.67-8.35-30.19-21.92-38.03l-69.7-40.2c-7.52-4.33-16.82-4.33-24.34,0l-35.49,20.65-.06.06h0ZM218.56,246.83c13.63,7.84,22.04,22.36,22.04,38.04v32.04l47.85-27.59v-32.04c0-15.74-8.41-30.26-22.04-38.04l-122-70.01c-7.52-4.33-16.76-4.33-24.27,0l-35.68,20.58,134.11,76.96v.06h-.01ZM340.7,170.06c13.57,7.83,21.98,22.29,21.98,38.03v38.1l-47.72,27.71v-38.09c0-15.67-8.35-30.2-21.98-38.04L107.46,90.86l35.61-20.64c7.52-4.4,16.82-4.4,24.34,0l173.35,99.9-.06-.06h0Z"/>
37
+ </g>
38
+ </g>
39
+ </svg>
@@ -0,0 +1,27 @@
1
+ /** Grid sizes the block offers top out at 12; 24 leaves room without inviting a scrape. */
2
+ const MAX_LIMIT = 24;
3
+ const DEFAULT_LIMIT = 8;
4
+
5
+ export default defineEventHandler(async (event) => {
6
+ const query = getQuery(event);
7
+ // `all=1` answers the complete manufacturer list without logos — the shape
8
+ // a picker needs. The limit cap only guards the logo-enriched default mode.
9
+ const wantsAll = String(query.all ?? "") === "1";
10
+
11
+ const parsed = Number.parseInt(String(query.limit ?? ""), 10);
12
+ const limit = Number.isFinite(parsed)
13
+ ? Math.min(Math.max(parsed, 1), MAX_LIMIT)
14
+ : DEFAULT_LIMIT;
15
+
16
+ try {
17
+ const service = getBrandService(event);
18
+ const locale = resolveLocale(event);
19
+ return wantsAll
20
+ ? await service.listBrandNames(locale)
21
+ : await service.listBrands(limit, locale);
22
+ }
23
+ catch (err) {
24
+ getLogService().error("Service error: brands/list", toErrorContext(err));
25
+ throw createError({ statusCode: 500, message: "Internal server error" });
26
+ }
27
+ });