import type { Profile } from '../profiles/index.js'; /** * Default doc version segment for *constructed* fallback PDF URLs. * * Salesforce serves PDFs from `https://resources.docs.salesforce.com// * latest/en-us/sfdc/pdf/`. The previous default used `latest/latest`, * which is an invalid path and always 404s. The authoritative URL is resolved * at fetch time via {@link resolvePdfUrl} (the Atlas metadata API); this * constant only backs a constructed fallback when resolution is unavailable * (e.g. the metadata API itself is unreachable). * * Verified 2026-06 against the live metadata API: the current release path is * `262/latest` (e.g. apexcode → `262/latest/.../salesforce_apex_developer_guide.pdf`). */ export declare const DEFAULT_DOC_VERSION = "262"; export declare const PDF_BASE_URL = "https://resources.docs.salesforce.com/262/latest/en-us/sfdc/pdf"; export type PdfRegistryEntry = { product: string; filename: string | null; scope: string; verifyUrl: boolean; profileIds: string[]; /** * Atlas metadata deliverable key (the `` in * `atlas.en-us..meta`). When set, the fetcher resolves the authoritative, * version-current PDF URL via {@link resolvePdfUrl} before falling back to a * URL constructed from {@link PDF_BASE_URL}. Only populated for entries whose * deliverable key was verified against the live metadata API to return a * `pdf_url`; left undefined where the key could not be confirmed. */ deliverable?: string; }; export type WebReferenceEntry = { title: string; url: string; scope: string; profileIds: string[]; /** * Atlas metadata deliverable key for an HTML reference (the `` in * `atlas.en-us..meta`). The raw `.htm` URL of these references is a * client-rendered SPA shell (~21 visible chars); when this key is set the * fetcher resolves the server-rendered page body via {@link resolveAtlasContent} * and persists that instead. Only populated for deliverables verified against * the live metadata API to return a non-empty `content` field. Left undefined * for references on the newer AI docs platform (e.g. `agentforce`, `ai`, * `einstein_platform`), whose metadata endpoint returns an empty body — their * content is not available via this API. */ deliverable?: string; /** * `help.salesforce.com` article id for an HTML reference — the `id=` query * value minus its trailing `.htm`, WITH its namespace prefix (`ind.`, `sf.`, * etc.) intact, e.g. `ind.cg_licenses`. Mutually exclusive with * {@link deliverable}: this site has no Atlas metadata API, so the fetcher * instead resolves the server-rendered article body via * `resolveHelpArticleContent` (Aura-endpoint interception in * `help-article-resolver.ts`). Only populated for article ids individually * verified to return real content (not a `{"type":"NotFound"}` response). */ helpArticleId?: string; }; export declare const WEB_REFERENCES: WebReferenceEntry[]; export declare const PDF_REGISTRY: PdfRegistryEntry[]; export type FetchableRef = { filename: string; /** Profiles that own this reference. Empty means universally applicable. */ profileIds?: string[]; /** Registry-defined subject boundary for the reference. */ scope?: string; /** * Candidate download URL. For PDFs this is a constructed fallback built from * {@link PDF_BASE_URL}; the fetcher prefers the authoritative URL resolved via * {@link resolvePdfUrl} when {@link deliverable} is set. For web references * this is the canonical HTML URL. */ url: string; /** * Atlas metadata deliverable key, propagated from the originating * {@link PdfRegistryEntry} or {@link WebReferenceEntry}. For PDF refs it lets * the fetcher resolve the version-current `pdf_url` first (falling back to * {@link url}); for HTML refs it lets the fetcher resolve the server-rendered * page content instead of the client-rendered SPA shell. Present only for * deliverables verified against the live metadata API. */ deliverable?: string; /** * `help.salesforce.com` article id, propagated from the originating * {@link WebReferenceEntry}. Lets the fetcher resolve the article's * server-rendered body via `resolveHelpArticleContent` instead of the * client-rendered SPA shell. Mutually exclusive with {@link deliverable}. */ helpArticleId?: string; }; /** * Derive a safe local cache filename from a web reference URL. * * Uses the last meaningful path segment and ensures an `.html` extension, * matching the convention used for HTML references (e.g. the Commerce and * Agentforce dev guides → `b2b-b2c-comm-dev-guide.html`, * `agentforce-developer-guide.html`). Falls back to a slug of the host + path * when no usable trailing segment exists, so every web reference yields a * deterministic, filesystem-safe name. */ export declare function deriveWebReferenceFilename(url: string): string; /** * Single source of truth for which reference documents `update --fetch-refs` * should download for a given set of active profiles. * * Derives directly from {@link PDF_REGISTRY} and {@link WEB_REFERENCES} so the * downloader can never drift from the rendered registry again. Includes every * {@link PDF_REGISTRY} entry with a non-null `filename` active for the given * profiles (as a downloadable PDF_BASE_URL/filename), plus every * {@link WEB_REFERENCES} entry active for the given profiles (with a filename * derived from its URL). * * `profileIds.length === 0` entries are universal and always included, matching * the `isActive` semantics used by {@link generatePdfRegistry}. Results are * deduped by filename. */ export declare function getFetchableRefs(activeProfileIds: string[]): FetchableRef[]; /** * Return the FULL reference catalog — every downloadable {@link PDF_REGISTRY} * entry (non-null `filename`) plus every {@link WEB_REFERENCES} entry — ignoring * profiles entirely, deduped by filename. * * Unlike {@link getFetchableRefs}, which filters by active profiles (and where * `getFetchableRefs([])` returns only the universal `profileIds: []` entries), * this accessor returns the complete catalog so onboarding (`init`) can cache * the entire reference set up front, regardless of which profiles are active. */ export declare function getAllFetchableRefs(): FetchableRef[]; export declare function generatePdfRegistry(profiles: Profile[], version: string): string;