/** * Fetches NGA's World Port Index (Pub. 150), the source of the structures * layer's seaports (`#us/structures/nga-wpi`). * * The Maritime Safety Information portal serves the index as `UpdatedPub150.csv` from its * publications download endpoint, and calls that CSV the official version of the content. * While the portal is under maintenance, its maintenance page links the same file * zipped as `apology_objects/WPI.zip`, so a fetch that the download endpoint refuses * reads the CSV out of that archive and records which URL served it. * * The CSV is written to a staging file and moves into place only once it parses * and holds the columns the structures module reads. * A failed run leaves the previous file as it was. * * Invoke via `mailwoman corpus fetch nga-wpi`. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The CSV as the portal's publications endpoint serves it. */ export declare const NGA_WPI_CSV_URL = "https://msi.nga.mil/api/publications/download?key=16920959/SFH00000/UpdatedPub150.csv&type=view"; /** * The zipped CSV the portal's maintenance page links. */ export declare const NGA_WPI_MAINTENANCE_ZIP_URL = "https://msi.nga.mil/apology_objects/WPI.zip"; /** * What one run recorded. * * `publisher_version` is the `Last-Modified` the serving URL stated. */ export interface NGAWPIManifest extends SourceManifest { records: number; } export interface DownloadNGAWPIOptions { outputDir: PathBuilderLike; report?: (line: string) => void; } /** * Downloads the index into `/UpdatedPub150.csv` and writes the manifest. * * @throws When neither URL serves the CSV, or the CSV lacks a column the structures module reads. */ export declare function downloadNGAWPI(client: Pick, options: DownloadNGAWPIOptions): Promise; /** * The registry entry. */ export declare function fetchNGAWPI(options: BaseFetchOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=nga-wpi.d.ts.map