/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Downloads the INSPIRE Addresses theme Kadaster publishes for the Netherlands. * * ## One feed and one file * * PDOK serves an ATOM download service with a single entry, and that entry's one data link is the * whole country. There is no service document above it and no dataset feed below it, so the * resolution is one request: * * adressen_inspire_geharmoniseerd.xml → addresses.gml.gz * * The entry's `` names a sibling feed, `adressen_inspire_geharmoniseerd_epsg4258.xml`, which * answers HTTP 404. A reader that followed the `` rather than the `rel="alternate"` link would * therefore raise on that 404, so this one reads the link. * * ## Why the download stays compressed * * `#nl/adapters/kadaster/adapter` inflates `.gml.gz` through `gunzipChunks` as it streams. The * member is 29,677,448,685 bytes against the download's 819,465,603, so inflating it here would * cost 36 times the disk for no reader that wants it. * * ## Freshness * * The entry's `` is the signal recorded in the manifest. A skip requires the feed to * state an `` value: * where it states none both sides read `null`, an equality test would hold, and a download of * unknown age would be kept for as long as the feed stayed silent. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The ATOM download service for the theme, which holds the country's one entry. */ export declare const NL_KADASTER_FEED_URL = "https://service.pdok.nl/kadaster/ad/atom/adressen_inspire_geharmoniseerd.xml"; /** * The name the download is written under, which is what the adapter's `inputPath` states. * * The publisher's own name for the file. * The adapter reads a `.gml.gz` by inflating it, so the suffix is load-bearing. */ export declare const NL_KADASTER_DOWNLOAD_FILENAME = "addresses.gml.gz"; /** * The attribution recorded in the manifest. * * CC0 1.0 reserves no act and owes no attribution clause, so this is the credit the * repository chooses to carry rather than a condition of the grant. */ export declare const NL_KADASTER_ATTRIBUTION = "Kadaster"; /** * What one run recorded. * * `feed_updated` is the entry's own ``. * A later run downloads again when that value changes, which is what the ATOM * pattern offers in place of an HTTP validator. * * `rights` is the license URL the feed states, recorded so a change of terms is * visible in the artifact rather than only in the register. */ export interface NLKadasterManifest extends SourceManifest { feed_url: string; feed_updated: string | null; rights: string | null; license: string; attribution: string; } /** * Per-invocation options. */ export interface DownloadNLKadasterOptions { outputDir: PathBuilderLike; /** * Downloads the file even where the feed reports the recorded ``. */ force?: boolean; retries?: number; retryDelayMs?: number; signal?: AbortSignal; report?: (line: string) => void; } /** * Where the download is, and what the feed states about it. */ export interface NLKadasterPublication { downloadURL: string; /** * The entry's own ``, or `null` where the feed states none. * * `updated` sits on the Atom entry as well as on the feed, and this reads * the entry that carried the data link. * The feed reported `2026-09-02T11:45:47Z` when this reader was written. */ feedUpdated: string | null; /** * The entry's ``, or `null` where it states none. */ rights: string | null; /** * The byte count the link claims, or `null` where it claims none. * * Never taken as the size of the download: the bytes recorded in the manifest * are counted off the delivered body. */ claimedBytes: number | null; } /** * Reads the feed and answers the one entry's data link. * * Raises where the feed lists no entry, or where its entry offers no data link. * The alternative would return `{fetched: 0, skipped: 0, failed: 0}`, which a caller * reads as a fetch that completed and found the publisher empty. * * Separate from {@linkcode downloadNLKadaster} because the resolution is the part a test can drive. * The download runs on global `fetch`, which a unit test cannot intercept. */ export declare function readNLKadasterPublication(client: Pick, options?: { signal?: AbortSignal; report?: (line: string) => void; }): Promise; /** * Whether the file on disk is the one the feed currently offers. * * A skip requires the feed to state an `` value. * Where it states none, both sides read `null` and an equality test would hold, * which would keep a download of unknown age for as long as the feed stayed silent. * * Downloading 782 MiB again is the slower error and the recoverable one. */ export declare function nlKadasterPublicationIsRecorded(recorded: NLKadasterManifest, bytesOnDisk: number, publication: NLKadasterPublication): boolean; /** * Resolves the feed to its one file and downloads it. */ export declare function downloadNLKadaster(client: Pick, options: DownloadNLKadasterOptions): Promise; /** * The path `#nl/adapters/kadaster/adapter` reads, given the root a fetch wrote under. */ export declare function nlKadasterInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; /** * Per-invocation options for the registry entry. */ export interface FetchNLKadasterOptions extends BaseFetchOptions { force?: boolean; retries?: number; retryDelayMs?: number; signal?: AbortSignal; } /** * The registry entry. */ export declare function fetchNLKadaster(options: FetchNLKadasterOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=kadaster.d.ts.map