/** * Maps Registry — product/version/locale → mapId resolution * * Builds a lookup table from FT's GET /api/khub/maps response. * All mapIds are dynamically discovered, nothing hardcoded. * * Key concepts: * - `bundleStem`: product identifier without version (e.g., "jamf-pro-documentation") * Derived from `version_bundle_stem` metadata, or parsed from `bundle` values. * - Each map is locale-specific (separate mapId per language) * - `latestVersion=yes` marks the current version */ import { fetchMaps } from './ft-client.js'; import { type LocaleId } from '../constants.js'; import type { CacheProvider, MapsProvider } from './interfaces/index.js'; export interface MapEntry { mapId: string; title: string; bundleStem: string; version: string; locale: string; isLatest: boolean; bundleValues: string[]; } export interface RegistryProductInfo { bundleStem: string; title: string; versions: string[]; } export declare class MapsRegistry { private readonly cache; private entries; private builtAt; private buildPromise; private readonly fetchMapsFn; private readonly mapsProvider; private readonly cacheTtl; constructor(cache: CacheProvider, fetchMapsFn?: typeof fetchMaps, mapsProvider?: MapsProvider, cacheTtl?: number); /** * Reset the registry so the next `ensureBuilt()` call re-fetches from * the API (or cache). Use this to force invalidation when stale data * is suspected. */ reset(): void; /** * Build the registry from FT API (cached). * Uses in-flight deduplication to prevent thundering herd when * multiple concurrent callers invoke ensureBuilt() simultaneously. */ ensureBuilt(): Promise; /** * Internal build logic: fetch maps from cache or API and populate entries. */ private doBuild; private parseMap; /** * Resolve a product + optional version + locale to a mapId. * Returns null if not found. */ resolveMapId(bundleStem: string, version?: string, locale?: LocaleId): Promise; private findMap; /** * Resolve a legacy bundleId (e.g., "jamf-pro-documentation-11.12.0") * to a mapId. */ resolveFromBundleId(bundleId: string, locale?: LocaleId): Promise; /** * Find the glossary map for a given locale. * Searches for maps with bundleStem containing "glossary". */ resolveGlossaryMapId(locale?: LocaleId): Promise; /** * Get all unique products for a locale. */ getProducts(locale?: LocaleId): Promise; /** * Get available versions for a product. * Filters entries directly instead of rebuilding the full product catalogue. */ getVersions(bundleStem: string, locale?: LocaleId): Promise; } //# sourceMappingURL=maps-registry.d.ts.map