/** * STAC Server client for fast CID resolution. * * This module provides direct access to a STAC server API for resolving dataset CIDs, * which is faster than traversing the IPFS-hosted catalog structure. */ import type { DatasetCatalog, StacReleaseMetadata, StacZarrResolution } from "./stac-catalog.js"; export declare const DEFAULT_STAC_SERVER_URL = "https://api.stac.dclimate.net"; export interface StacServerSearchResponse { type: "FeatureCollection"; features: StacServerItem[]; numberMatched?: number; numberReturned?: number; links?: Array<{ rel: string; href: string; method?: string; headers?: Record; body?: Record; merge?: boolean; }>; } export interface StacServerItem { type: "Feature"; id: string; collection?: string; properties: Record; assets: Record; } export interface ResolvedCidFromServer extends StacReleaseMetadata { cid: string; collectionId: string; dataset: string; variant: string; zarrResolutions: StacZarrResolution[]; } /** * Resolve dataset CID via STAC server /search API. * * Uses the same API format as the frontend (POST /search with collections filter). * * @param collection - Collection ID (e.g., 'ecmwf_aifs', 'ecmwf_era5') * @param dataset - Dataset name (e.g., 'temperature', 'precipitation') * @param variant - Optional variant name (e.g., 'ensemble', 'deterministic') * @param serverUrl - STAC server base URL * @returns The resolved CID and metadata * @throws Error if dataset or variant is not found, or if server request fails */ export declare function resolveCidFromStacServer(collection: string, dataset: string, variant?: string, serverUrl?: string): Promise; /** * Simple function to just get the CID string. */ export declare function resolveDatasetCidFromStacServer(collection: string, dataset: string, variant?: string, serverUrl?: string): Promise; /** * List all datasets/variants by querying a STAC API server directly. * * This is the fast path that mirrors `listAvailableDatasetsFromStac` (the IPFS * walker) without traversing the IPFS-hosted catalog tree. Two requests: * 1. GET /collections — collection ids, titles * 2. POST /search — items, with dataset/variant/CID in properties * * Returns the same {@link DatasetCatalog} shape as the IPFS walker so callers * don't need to know which path produced it. * * Notes: * - Organization is derived from the `{org}_{name}` collection-id convention * (e.g. `noaa_aigfs` → org=`noaa`). The IPFS walker reads it from a * `dclimate:id` field on an org-level link; the STAC API doesn't expose * organizations as first-class entities. * - Category (historical/forecast) isn't populated here — the IPFS walker * pulls it from `dclimate:collections:` on the org link, which * has no STAC API equivalent. * - Search pagination is bounded and repeated requests are detected to avoid * looping on malformed `next` links. */ export declare function listAvailableDatasetsFromStacServer(serverUrl?: string): Promise; //# sourceMappingURL=stac-server.d.ts.map