import type { PathBuilder } from "path-ts"; import type { BaseFetchOptions, FetchSummary } from "#tools/fetch/download"; import { type WikidataBotCredentials } from "#tools/fetch/wikidata/session"; import { type VitalPlaceCounts } from "#tools/fetch/wikidata/vital-places/inventory"; import { type ProgressReporter } from "#tools/fetch/wikidata/vital-places/progress"; /** * The source id, and the directory under the fetch root. */ export declare const VITAL_PLACES_SLUG = "wikidata-vital-places"; /** * The number of ranked items read when a caller sets no count. */ export declare const DEFAULT_TOP = 50000; /** * The files a run writes under its directory. */ export declare const VITAL_PLACES_FILES: { readonly entities: "entities.jsonl"; readonly countries: "countries.json"; readonly classRoots: "class-roots.v3.json"; readonly places: "places.jsonl"; readonly counts: "counts.json"; readonly manifest: "MANIFEST.json"; readonly httpCache: "http-cache"; }; /** * Options for {@linkcode fetchWikidataVitalPlaces}. */ export interface FetchWikidataVitalPlacesOptions extends BaseFetchOptions { /** * The number of ranked items to describe, from the top of the list. * @defaultValue {@linkcode DEFAULT_TOP} */ top?: number; /** * The languages whose labels and aliases are kept. * @defaultValue {@linkcode DEFAULT_LANGUAGES} */ languages?: readonly string[] | null; /** * The ids one entity request asks for. * @defaultValue {@linkcode DEFAULT_ENTITY_BATCH} */ batchSize?: number | null; /** * The entity requests in flight at once, capped at 1 anonymously and 3 logged in. * @defaultValue the mode's cap */ concurrency?: number | null; /** * The bot login. * * Absent reads `WIKIDATA_BOT_USERNAME` and `WIKIDATA_BOT_PASSWORD`. * `null` fetches anonymously. */ credentials?: WikidataBotCredentials | null; } interface VitalPlacesFile { filename: string; bytes: number; sha256: string; } /** * The manifest a run writes, with the inputs' licenses and every file's digest. */ export interface VitalPlacesManifest { source: string; downloaded_at: string; user_agent: string; inputs: Array<{ name: string; url: string; license: string; }>; top: number; languages: readonly string[]; place_roots: readonly string[]; excluded_roots: readonly string[]; qrank_version: string; counts: VitalPlaceCounts; files: VitalPlacesFile[]; } /** * The directory the inventory is written under a fetch root. */ export declare function vitalPlacesPath(outRoot: PathBuilder): PathBuilder; /** * Run the four phases and write the inventory under `/wikidata-vital-places/`. * * The registry entry point. * `fetched` counts the places written, `skipped` the ranked ids already described * before this run, and `failed` the requests that failed after their retries. * A rerun repeats those. */ export declare function fetchWikidataVitalPlaces(options: FetchWikidataVitalPlacesOptions, report?: ProgressReporter): Promise; export {}; //# sourceMappingURL=vital-places.d.ts.map