/** * Fetches Chunghwa Post's list of its post offices (中華郵政全國營業據點, data.gov.tw dataset 5950), * the source of Taiwan's post offices in the structures layer (`#tw/structures/chunghwa-post`). * * The dataset record at `https://data.gov.tw/api/v2/rest/dataset/5950` names the provider * (提供機關 中華郵政股份有限公司), the license (政府資料開放授權條款-第1版, the Open Government Data License, Taiwan, v1.0) * and the CSV distribution on `www.post.gov.tw`. * The record is saved beside the CSV as `dataset.json`, because it holds the license * and the update date the attribution cites. * * The CSV is downloaded to a staging file and moves into place only once it parses * and holds the columns the adapter reads. * A failed run leaves the previous file as it was. * * Invoke via `mailwoman corpus fetch tw-chunghwa-post-offices`. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The dataset record on data.gov.tw. */ export declare const TW_CHUNGHWA_POST_DATASET_URL = "https://data.gov.tw/api/v2/rest/dataset/5950"; /** * The CSV distribution the dataset record names. */ export declare const TW_CHUNGHWA_POST_CSV_URL = "https://www.post.gov.tw/post/internet/Templates/getOpenDataFile.jsp?vkey=B484EB27-B3F0-4D02-8F62-047D20C64078"; /** * The file the dataset record is saved to, beside the CSV. */ export declare const TW_CHUNGHWA_POST_DATASET_FILENAME = "dataset.json"; /** * What one run recorded. * `publisher_version` is the record's `modifiedDate`. */ export interface TWChunghwaPostManifest extends SourceManifest { dataset_url: string; records: number; } export interface DownloadTWChunghwaPostOptions { outputDir: PathBuilderLike; retryDelayMs?: number; report?: (line: string) => void; } /** * Downloads the CSV into `/post-offices.csv` and writes the dataset record and the manifest. * * @throws When the CSV answers an error status, or lacks a column the adapter reads. */ export declare function downloadTWChunghwaPost(client: Pick, options: DownloadTWChunghwaPostOptions): Promise; /** * The registry entry. */ export declare function fetchTWChunghwaPost(options: BaseFetchOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=chunghwa-post.d.ts.map