/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Downloads the INSPIRE Addresses theme the Service public de Wallonie publishes for the Walloon * Region. * * ## Two feeds and one archive * * The service document lists one dataset feed, and that feed offers one archive for the whole * region rather than one per municipality. Czechia's ČÚZK publishes 6,258 archives through the same * INSPIRE pattern, so the resolution here is the same shape with a list of one: * * AD_Service.xml → AD_Dataset_.xml → AD.Addresses.gml.zip * * The service document's `` is the freshness signal this fetcher records. A dataset feed * that reports the same value as the manifest means the archive on disk is the one the publisher * serves, and the download is skipped. * * ## Why the archive stays compressed * * `#be/adapters/wallonie/adapter` reads the member through `inspireGMLChunks`, which inflates from * the archive. The member is 5,163,917,131 bytes against the archive's 106,665,832, so unpacking it * here would cost 48 times the disk for no reader that wants it. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The ATOM service document, which lists the region's one dataset feed. */ export declare const BE_WALLONIE_SERVICE_URL = "https://geoservices.wallonie.be/inspire/atom/AD_Service.xml"; /** * The name the archive is written under, which is what the adapter's `inputPath` states. */ export declare const BE_WALLONIE_ARCHIVE_FILENAME = "AD.Addresses.gml.zip"; /** * The attribution the publisher's own license statement requires, quoted as it writes it. */ export declare const BE_WALLONIE_ATTRIBUTION = "Service public de Wallonie (SPW)"; /** * What one run recorded. * * `feed_updated` is the dataset feed's own ``. * A later run downloads again when that value changes, which is what the INSPIRE * pattern offers in place of an HTTP validator. */ export interface WallonieManifest extends SourceManifest { service_url: string; dataset_feed_url: string; feed_updated: string | null; attribution: string; } /** * Per-invocation options. */ export interface DownloadWallonieOptions { outputDir: PathBuilderLike; /** * Downloads the archive even where the dataset feed reports the recorded ``. */ force?: boolean; retries?: number; retryDelayMs?: number; signal?: AbortSignal; report?: (line: string) => void; } /** * Where the archive is, and what the publisher states about its freshness. */ export interface WallonieArchiveReference { archiveURL: string; datasetFeedURL: string; /** * The archive entry's own ``, or `null` where the feed states none. * * `updated` sits on an Atom entry rather than on the feed, so this reads the * entry that carried the archive link. * Wallonia's feed reported `2025-12-11` when this reader was written. */ feedUpdated: string | null; } /** * Resolves the service document to the one archive it leads to, through the dataset feed it lists. * * Raises where the service document lists no dataset feed, or where that feed offers no archive. * 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 downloadWallonie} 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 resolveWallonieArchive(client: Pick, options?: { signal?: AbortSignal; report?: (line: string) => void; }): Promise; /** * Resolves the service document to its one archive and downloads it. */ export declare function downloadWallonie(client: Pick, options: DownloadWallonieOptions): Promise; /** * The path `#be/adapters/wallonie/adapter` reads, given the root a fetch wrote under. */ export declare function wallonieInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; /** * Per-invocation options for the registry entry. */ export interface FetchWallonieOptions extends BaseFetchOptions { force?: boolean; retries?: number; retryDelayMs?: number; signal?: AbortSignal; } /** * The registry entry. */ export declare function fetchWallonie(options: FetchWallonieOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=wallonie.d.ts.map