added sale-price

This commit is contained in:
2026-03-07 16:09:22 +03:30
parent 2e4389e311
commit d4ddc1f987
4991 changed files with 489998 additions and 7072 deletions
@@ -0,0 +1,78 @@
import { k as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
import { createClient } from '@supabase/supabase-js';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'vue';
import 'node:url';
import 'consola';
import 'fast-xml-parser';
import 'ipx';
let _client = null;
function ensureClient() {
if (_client) return _client;
const SUPABASE_URL = useState("supabase-url").value;
const SUPABASE_KEY = useState("supabase-key").value;
if (!SUPABASE_URL || !SUPABASE_KEY) {
console.warn("[supabase] Missing SUPABASE_URL/KEY");
}
_client = createClient(SUPABASE_URL, SUPABASE_KEY);
return _client;
}
const supabase = new Proxy({}, {
get(_t, prop, receiver) {
const c = ensureClient();
return Reflect.get(c, prop, receiver);
},
apply(_t, thisArg, argArray) {
var _a, _b;
return (_b = (_a = ensureClient()) == null ? void 0 : _a.apply) == null ? void 0 : _b.call(_a, thisArg, argArray);
}
});
const urls = defineSitemapEventHandler(async () => {
const urls = [];
try {
const { data: categorys, error } = await supabase.from("collections").select(`title`);
if (categorys && categorys.length) {
categorys.forEach((item) => {
urls.push(`/search/main?category=${item.title}`);
});
}
} catch (e) {
console.log(e);
}
try {
const { data: brands, error } = await supabase.from("brands").select(`title`);
if (brands && brands.length) {
brands.forEach((item) => {
urls.push(`/search/main?brand=${item.title}`);
});
}
} catch (e) {
console.log(e);
}
try {
const { data: products, error } = await supabase.from("products").select(`title`);
if (products && products.length) {
products.forEach((item) => {
urls.push(`/product_detail/${item.title}`);
});
}
} catch (e) {
console.log(e);
}
urls.push(`/`);
urls.push(`/home`);
urls.push(`/search`);
urls.push(`/search/main`);
urls.push(`/user`);
return urls;
});
export { urls as default };
@@ -0,0 +1 @@