/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Downloads Romania's school network workbook for the `ro-retea-scolara` adapter. * * The Ministry of Education publishes a new workbook each school year under one data.gov.ro dataset, * and each upload has a new resource URL. The fetcher therefore asks the portal's CKAN API for the * dataset's resources and downloads the newest XLSX, rather than holding a URL that the next upload * retires. The manifest records the resource URL, the CKAN `last_modified` and the license id the * portal states, so a corpus row traces to one upload. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The data.gov.ro dataset that holds every school year's workbook. */ export declare const RO_RETEA_SCOLARA_DATASET_ID = "69392a50-5750-4a54-90c1-d461de44da6d"; /** * The CKAN call that lists the dataset's resources and its license. */ export declare const RO_RETEA_SCOLARA_PACKAGE_URL = "https://data.gov.ro/api/3/action/package_show?id=69392a50-5750-4a54-90c1-d461de44da6d"; /** * The file name the adapter reads, whatever the upload's own name. */ export declare const RO_RETEA_SCOLARA_FILENAME = "retea-scolara.xlsx"; /** * One CKAN resource, as `package_show` lists it. */ export interface CKANResource { url: string; format?: string | null; name?: string | null; last_modified?: string | null; created?: string | null; } export interface ReteaScolaraManifest extends SourceManifest { resource_name: string | null; last_modified: string | null; license_id: string | null; } /** * The newest XLSX resource, by its `last_modified` or else its `created` date. * * @throws When the dataset lists no XLSX resource. */ export declare function newestXLSXResource(resources: readonly CKANResource[]): CKANResource; export interface DownloadReteaScolaraOptions { outputDir: PathBuilderLike; force?: boolean; retries?: number; retryDelayMs?: number; signal?: AbortSignal; report?: (line: string) => void; } export declare function downloadReteaScolara(client: Pick, options: DownloadReteaScolaraOptions): Promise; /** * The workbook path the adapter reads under a fetch root. */ export declare function reteaScolaraInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; export interface FetchReteaScolaraOptions extends BaseFetchOptions { force?: boolean; retries?: number; signal?: AbortSignal; } export declare function fetchReteaScolara(options: FetchReteaScolaraOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=retea-scolara.d.ts.map