The product-level cache key.
The cached product data and its timestamp, or undefined on a miss.
const entry = await getSupplierProductDataCacheEntry("Loudwolf|SKU-1");
entry?.timestamp; // => 1712345678901
export async function getSupplierProductDataCacheEntry(
cacheKey: string,
): Promise<CachedProductEntry | undefined> {
try {
const db = await getDB();
const record = await db.get(IDB_STORE.SUPPLIER_PRODUCT_DATA_CACHE, cacheKey);
if (!record) return undefined;
return {
data: record.data,
timestamp: record.timestamp,
};
} catch (error) {
logger.error('Failed to get supplier product data cache entry from IndexedDB', { error });
return undefined;
}
}
Reads one entry from the supplier product data cache, which holds per-product detail fetched lazily after a search.