feat: expose brands list per source via /pipeline/sources API

Each source module now exports a brands[] array:
- motousher: 44 brands (full list from brands.js)
- dirtstreet: 5 brands (SC Project, Evotech, etc.)
- retrorides: 10 bike brands (BMW, Ducati, Aprilia, etc.)
- kyt: KYT
- brocks-performance: Brock's Performance
- yuasa: Yuasa

listSources() passes brands[] through in the API response so the
frontend can render the per-source brand list without a separate call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MOHAN 2026-07-07 13:58:05 +05:30
parent 07fff6ac5a
commit 4b5b7cab9f
7 changed files with 7 additions and 0 deletions

View File

@ -206,6 +206,7 @@ async function fetchWebsiteData({ paths: runPaths }) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: ["Brock's Performance"],
defaultBrand: "Brock's Performance", defaultBrand: "Brock's Performance",
defaultImageBaseUrl: "", defaultImageBaseUrl: "",
envImageBaseUrl: "BROCKS_PERFORMANCE_IMAGE_BASE_URL", envImageBaseUrl: "BROCKS_PERFORMANCE_IMAGE_BASE_URL",

View File

@ -155,6 +155,7 @@ function convertToShopifyProducts(input, options = {}) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: BRANDS.map((b) => b.name),
defaultBrand: "Dirtstreet", defaultBrand: "Dirtstreet",
defaultImageBaseUrl: "", defaultImageBaseUrl: "",
envImageBaseUrl: "DIRTSTREET_IMAGE_BASE_URL", envImageBaseUrl: "DIRTSTREET_IMAGE_BASE_URL",

View File

@ -32,6 +32,7 @@ function listSources() {
return Object.values(sources).map((source) => ({ return Object.values(sources).map((source) => ({
sourceKey: source.sourceKey, sourceKey: source.sourceKey,
label: source.label, label: source.label,
brands: Array.isArray(source.brands) ? source.brands : [],
})); }));
} }

View File

@ -39,6 +39,7 @@ function convertToShopifyProducts(input, options = {}) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: ["KYT"],
defaultBrand: "KYT", defaultBrand: "KYT",
defaultImageBaseUrl: "https://kytindia.com/server/public/uploads", defaultImageBaseUrl: "https://kytindia.com/server/public/uploads",
envImageBaseUrl: "KYT_IMAGE_BASE_URL", envImageBaseUrl: "KYT_IMAGE_BASE_URL",

View File

@ -157,6 +157,7 @@ function convertToShopifyProducts(input, options = {}) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: BRANDS.map((b) => b.name),
defaultBrand: "Motousher", defaultBrand: "Motousher",
defaultImageBaseUrl: "", defaultImageBaseUrl: "",
envImageBaseUrl: "MOTOUSHER_IMAGE_BASE_URL", envImageBaseUrl: "MOTOUSHER_IMAGE_BASE_URL",

View File

@ -126,6 +126,7 @@ function convertToShopifyProducts(input, options = {}) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: ["BMW", "Ducati", "Aprilia", "Honda", "Kawasaki", "Triumph", "Suzuki", "Yamaha", "KTM", "Husqvarna"],
defaultBrand: "Retro Rides", defaultBrand: "Retro Rides",
defaultImageBaseUrl: "", defaultImageBaseUrl: "",
envImageBaseUrl: "RETRORIDES_IMAGE_BASE_URL", envImageBaseUrl: "RETRORIDES_IMAGE_BASE_URL",

View File

@ -135,6 +135,7 @@ function convertToShopifyProducts(input, options = {}) {
module.exports = { module.exports = {
sourceKey, sourceKey,
label, label,
brands: ["Yuasa"],
defaultBrand: "Yuasa", defaultBrand: "Yuasa",
defaultImageBaseUrl: "", defaultImageBaseUrl: "",
envImageBaseUrl: "YUASA_IMAGE_BASE_URL", envImageBaseUrl: "YUASA_IMAGE_BASE_URL",