import { TimeService } from "./time/TimeService.js"; import { TimeUrlBuilder } from "./time/TimeUrlBuilder.js"; import { HttpSource } from "./time/datasource/HttpSource.js"; import { RR0CaseMapping } from "./time/datasource/rr0/RR0CaseMapping.js"; import { TimeElementFactory } from "./time/html/TimeElementFactory.js"; import { TimeRenderer } from "./time/html/TimeRenderer.js"; import { TimeReplacer } from "./time/html/TimeReplacer.js"; import { TimeTextBuilder } from "./time/text/TimeTextBuilder.js"; import { CaseDirectoryStep } from "./science/crypto/ufo/enquete/dossier/CaseDirectoryStep.js"; import { CaseFactory } from "./science/crypto/ufo/enquete/dossier/CaseFactory.js"; import { CaseService } from "./science/crypto/ufo/enquete/dossier/CaseService.js"; import { OrganizationService } from "./org/OrganizationService.js"; import { DepartmentService } from "./org/country/region/department/DepartmentService.js"; import { CityService } from "./org/country/region/department/city/CityService.js"; import { HtmlRR0Context, RR0ContextImpl } from "./RR0Context.js"; import { FileWriteConfig, ReplaceCommand } from "ssg-api"; import { PeopleDirectoryStepOptions } from "./people/PeopleDirectoryStepFactory.js"; import { PersistentSourceRegistry } from "./source/PersistentSourceRegistry.js"; import { SourceRenderer } from "./source/SourceRenderer.js"; import { SourceReplacerFactory } from "./source/SourceReplacerFactory.js"; import { AllDataService, PeopleFactory, PeopleService } from "@rr0/data"; import { GooglePlaceService } from "@rr0/place"; import { PeopleHtmlRenderer } from "./people/PeopleHtmlRenderer.js"; import { CountryService } from "./org/country/CountryService.js"; import { CMSContext } from "./CMSContext.js"; import { TimeOptions } from "./time/TimeOptions.js"; import { DataOptions } from "./DataOptions.js"; export interface CMSGeneratorOptions { contentRoots: string[]; copies: string[]; outDir: string; locale: string; googleMapsApiKey: string; mail: string; dataOptions: { time: TimeOptions; org: DataOptions; }; siteBaseUrl: string; /** * Where the redirects read out of `.htaccess` are written, and in which of Netlify's two formats. * * Defaults to a `netlify.toml` at the repository root, which is what this has always produced. * * The `redirects` format writes Netlify's plainer `_redirects` instead, and the reason to choose * it is WHERE it can be put. `netlify.toml` is read from the CLONE, before any build command runs, * so a site built by Netlify from git must keep it in version control — a generated file, tracked, * inviting exactly the hand-edit that overwrites itself. `_redirects` and `_headers` are read from * the DEPLOYED directory, so they can be build output like everything else and never need to be * committed at all. * * `preambleFile` holds whatever the `.htaccess` cannot say and is emitted ahead of the generated * lines: a redirect carrying its own status or `force` (`301!` in the plain format), one from an * absolute URL on another domain. Without it those lines have nowhere to live but the generated * file itself, where every full build wipes them — which is exactly how one site's `ufoathome.org` * redirects and its CORS headers disappeared twice. See ssg-api's HtAccessReplaceCommand; naming a * file that is not there fails the build rather than dropping it in silence. * * Headers have no generator because `.htaccess` here carries no `Header` directive worth * translating: in the plain format they are simply a static `_headers` file among the copies. */ netlify?: { format: "toml" | "redirects"; outputPath: string; preambleFile?: string; }; timeFormat: Intl.DateTimeFormatOptions; directoryPages: string[]; ufoCaseDirectoryFile: string; ufoCasesExclusions: string[]; sourceRegistryFileName: string; directoryExcluded: string[]; directoryOptions: PeopleDirectoryStepOptions; mappings: RR0CaseMapping[]; contentReplacers?: ReplaceCommand[]; } export interface CMSGenerationOptions { /** * Configuration file name. */ config?: string; /** * If the search index must be regenerated or not. * For ex: "pages,sources" */ reindex?: string[]; /** * Comma-separated list of file patterns to parse as contents. */ contents?: string[]; /** * Comma-separated list of file patterns to copy to out dir. */ copies?: string[]; /** * Comma-separated list of file patterns to books to generate TOCs for. */ books?: string; /** * Force re-generation even if file has not changed. */ force?: string; } export declare class CMSGenerator implements CMSContext { protected options: CMSGeneratorOptions; readonly config: FileWriteConfig; readonly context: RR0ContextImpl; readonly placeService: GooglePlaceService; readonly orgService: OrganizationService; readonly caseFactory: CaseFactory; readonly dataService: AllDataService; readonly peopleFactory: PeopleFactory; readonly cityService: CityService; readonly departmentService: DepartmentService; readonly countryService: CountryService; readonly timeTextBuilder: TimeTextBuilder; readonly timeService: TimeService; readonly timeRenderer: TimeRenderer; readonly timeUrlBuilder: TimeUrlBuilder; readonly http: HttpSource; constructor(options: CMSGeneratorOptions); generate(args: CMSGenerationOptions): Promise; protected setupSources(timeTextBuilder: TimeTextBuilder, timeFormat: Intl.DateTimeFormatOptions): { sourceRenderer: SourceRenderer; sourceFactory: PersistentSourceRegistry; sourceReplacerFactory: SourceReplacerFactory; }; protected setupTime(context: RR0ContextImpl): { timeFiles: string[]; timeElementFactory: TimeElementFactory; timeReplacer: TimeReplacer; }; /** * The other names each people's page can be searched by — their pseudonyms and their surnames, the latter said as * " " so that a surname alone doesn't leave the reader guessing whose it is. Keyed by page URL, * the people's own page only: their other pages (a CV, say) are not that person's name. */ protected peopleNames(peopleService: PeopleService): Promise>; protected setupPeople(context: RR0ContextImpl, peopleRenderer: PeopleHtmlRenderer, copies: string[]): Promise<{ peopleService: PeopleService; peopleSteps: import("./index.js").PeopleDirectoryStep[]; copies: string[]; }>; private setupNotes; protected setupCases(timeElementFactory: TimeElementFactory): Promise<{ caseService: CaseService; ufoCasesStep: CaseDirectoryStep; }>; }