Files
worldmonitor/server/_shared/cache-keys.ts
Elie Habib 7ecb7f06b8 fix: wire bootstrap hydration for 8 missing data sources (#1065)
Register 6 new seeds in bootstrap.js (crypto, gulf, stablecoin, unrest,
iran, ucdp) and wire getHydratedData() in 7 service files. Also adds
hydration for 2 previously-registered keys (cyberThreats, flightDelays)
that had no frontend consumer. Syncs cache-keys.ts with bootstrap.js
for test parity.

Cyber hydration correctly maps through toCyberThreat() to convert proto
enum strings to friendly types.
2026-03-05 18:24:22 +04:00

54 lines
2.4 KiB
TypeScript

/**
* Static cache keys for the bootstrap endpoint.
* Only keys with NO request-varying suffixes are included.
*/
export const BOOTSTRAP_CACHE_KEYS: Record<string, string> = {
earthquakes: 'seismology:earthquakes:v1',
outages: 'infra:outages:v1',
serviceStatuses: 'infra:service-statuses:v1',
sectors: 'market:sectors:v1',
etfFlows: 'market:etf-flows:v1',
macroSignals: 'economic:macro-signals:v1',
bisPolicy: 'economic:bis:policy:v1',
bisExchange: 'economic:bis:eer:v1',
bisCredit: 'economic:bis:credit:v1',
shippingRates: 'supply_chain:shipping:v2',
chokepoints: 'supply_chain:chokepoints:v2',
minerals: 'supply_chain:minerals:v2',
giving: 'giving:summary:v1',
climateAnomalies: 'climate:anomalies:v1',
wildfires: 'wildfire:fires:v1',
marketQuotes: 'market:stocks-bootstrap:v1',
commodityQuotes: 'market:commodities-bootstrap:v1',
cyberThreats: 'cyber:threats-bootstrap:v2',
techReadiness: 'economic:worldbank-techreadiness:v1',
positiveGeoEvents: 'positive-events:geo-bootstrap:v1',
theaterPosture: 'theater-posture:sebuf:stale:v1',
riskScores: 'risk:scores:sebuf:stale:v1',
naturalEvents: 'natural:events:v1',
flightDelays: 'aviation:delays-bootstrap:v1',
insights: 'news:insights:v1',
predictions: 'prediction:markets-bootstrap:v1',
cryptoQuotes: 'market:crypto:v1',
gulfQuotes: 'market:gulf-quotes:v1',
stablecoinMarkets: 'market:stablecoins:v1',
unrestEvents: 'unrest:events:v1',
iranEvents: 'conflict:iran-events:v1',
ucdpEvents: 'conflict:ucdp-events:v1',
};
export const BOOTSTRAP_TIERS: Record<string, 'slow' | 'fast'> = {
bisPolicy: 'slow', bisExchange: 'slow', bisCredit: 'slow',
minerals: 'slow', giving: 'slow', sectors: 'slow',
etfFlows: 'slow', shippingRates: 'slow', wildfires: 'slow',
climateAnomalies: 'slow', cyberThreats: 'slow', techReadiness: 'slow',
theaterPosture: 'slow', naturalEvents: 'slow',
cryptoQuotes: 'slow', gulfQuotes: 'slow', stablecoinMarkets: 'slow',
unrestEvents: 'slow', ucdpEvents: 'slow',
earthquakes: 'fast', outages: 'fast', serviceStatuses: 'fast',
macroSignals: 'fast', chokepoints: 'fast', riskScores: 'fast',
marketQuotes: 'fast', commodityQuotes: 'fast', positiveGeoEvents: 'fast',
flightDelays: 'fast', insights: 'fast', predictions: 'fast',
iranEvents: 'fast',
};