/** * Fetches OPT-NC's agencies, the source of the `nc-opt-agences` adapter * and New Caledonia's post offices in the structures layer. * * The dataset record `localisation-des-agences-opt-nc` on `data.gouv.nc` states the publisher * and the license, and its `references` point at OPT-NC's open-data GIS. * That GIS serves the features from FeatureServer `Agences_opendata` layer 0. * * The service itself states no license (`copyrightText` and the hub item's `licenseInfo` are empty), * so the record is saved beside the features as `dataset.json`. * * The layer is paged by `OBJECTID` with `pageArcGISLayer`, and a pull whose size * differs from the count the service stated is refused. * * Invoke via `mailwoman corpus fetch nc-opt-agences`. */ import { APIClient } from "@mailwoman/core/api"; import { type PathBuilderLike } from "path-ts"; import { type OPTNCAgencyFeature } from "#nc/adapters/opt-nc/adapter"; import type { BaseFetchOptions, FetchSummary, SourceManifest } from "#tools/fetch/download"; /** * The FeatureServer that serves the agencies. */ export declare const OPT_NC_SERVICE_URL = "https://services6.arcgis.com/k3ZIRnRpeM4Ht4fG/arcgis/rest/services/Agences_opendata/FeatureServer"; /** * The dataset record on `data.gouv.nc`, which states the publisher and the license. */ export declare const OPT_NC_DATASET_URL = "https://data.gouv.nc/api/explore/v2.1/catalog/datasets/localisation-des-agences-opt-nc"; /** * The service's `maxRecordCount`. */ export declare const OPT_NC_PAGE_SIZE = 1000; /** * The service fields the fetcher asks for, in the service's spelling. */ export declare const OPT_NC_FIELDS: readonly ["OBJECTID", "ID", "TEXTE", "TYPE", "NOM", "ADRESSE", "CODE_POSTAL", "VILLE", "GLOBALID"]; /** * The file the dataset record is saved to, beside the features. */ export declare const OPT_NC_DATASET_FILENAME = "dataset.json"; /** * What one run recorded. * `publisher_version` is the dataset record's `modified`. */ export interface OPTNCAgencesManifest extends SourceManifest { service_url: string; dataset_url: string; feature_count: number; license: string | null; license_url: string | null; publisher: string | null; } /** * One service feature in the shape the adapter reads. * * @throws When the value isn't a GeoJSON feature, or has no `OBJECTID`. */ export declare function normalizeOPTNCFeature(value: unknown): OPTNCAgencyFeature; export interface DownloadOPTNCAgencesOptions { outputDir: PathBuilderLike; signal?: AbortSignal; report?: (line: string) => void; } /** * Pages the layer into `/agences.geojsonl` and writes the dataset record and the manifest. * * @throws When the service answers an error, or a pull whose size differs from its count. */ export declare function downloadOPTNCAgences(client: Pick, options: DownloadOPTNCAgencesOptions): Promise; /** * The path `#nc/adapters/opt-nc/adapter` reads, given the root a fetch wrote under. */ export declare function optNCAgencesInputPath(outRoot: BaseFetchOptions["outRoot"]): PathBuilderLike; export interface FetchOPTNCAgencesOptions extends BaseFetchOptions { signal?: AbortSignal; } /** * The registry entry. */ export declare function fetchOPTNCAgences(options: FetchOPTNCAgencesOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=opt-nc.d.ts.map