import { type RequestOptions } from '../lib/api.client.js'; import type { HarmonyRequest } from '../lib/harmony/harmony.request.js'; export declare const Environments: { readonly PROD: "PROD"; readonly UAT: "UAT"; }; export type Environments = (typeof Environments)[keyof typeof Environments]; export declare const HARMONY_URLS: { PROD: string; UAT: string; ANONYMOUS_ACCESS: string; }; export declare const CLOUD_GIOVANNI_URLS: { PROD: string; UAT: string; }; export declare enum Status { FETCHING = "fetching", PREVIEWING = "previewing", RUNNING = "running", SUCCESSFUL = "successful", FAILED = "failed", CANCELED = "canceled", PAUSED = "paused", RUNNING_WITH_ERRORS = "running_with_errors", COMPLETE_WITH_ERRORS = "complete_with_errors" } export declare const FINAL_STATUSES: Set; export declare const OUTPUT_FORMATS: { readonly 'application/x-netcdf4': "X-NETCDF-4"; readonly 'application/netcdf4': "NETCDF-4"; readonly 'application/x-netcdf4;profile=opendap_url': "X-NETCDF-4 (OPeNDAP URL)"; readonly 'application/netcdf': "NETCDF"; readonly 'application/x-hdf': "X-HDF"; readonly 'image/tiff': "GEOTIFF"; readonly 'image/gif': "GIF"; readonly 'image/png': "PNG"; readonly 'image/jpeg': "JPEG"; readonly 'text/csv': "CSV"; readonly 'application/shapefile+zip': "Shapefile+zip"; readonly 'application/x-zarr': "ZARR"; }; export type OutputFormats = (typeof OUTPUT_FORMATS)[keyof typeof OUTPUT_FORMATS]; export interface HarmonyCapabilitiesResponse { conceptId: string; shortName: string; summary: HarmonyCapabilitiesSummary; services: Service[]; variables: Variable[]; capabilitiesVersion: string; configuredOutputFormats: ConfiguredOutputFormat[]; } export interface HarmonyCapabilitiesSummary { subsetting: { bbox: boolean; dimension: boolean; shape: boolean; temporal: boolean; variable: boolean; }; reprojection: { supported: boolean; supportedProjections: string[]; interpolationMethods: string[]; }; averaging: { time: boolean; area: boolean; }; concatenation: boolean; outputFormats: string[]; } export type ConfiguredOutputFormat = { key: string; label: string; description: string; isGiovanniFormat?: boolean; }; export interface Service { name: string; href: string; capabilities: Capabilities; } export interface Capabilities { subsetting: Subsetting; outputFormats: string[]; averaging?: Averaging; } export interface Averaging { time: boolean; area: boolean; } export interface Subsetting { temporal: boolean; variable: boolean; multiple_variable?: boolean; bbox?: boolean; shape?: boolean; } export interface Variable { conceptId: string; name: string; href: string; } export type SubsetJobStatus = { jobID: string; status: Status; message: string; progress: number; createdAt: string; updatedAt: string; dataExpiration: string; request: string; numInputGranules: number; originalDataSize?: string; outputDataSize?: string; dataSizePercentChange?: string; labels?: string[]; errors?: Array; links: Array; /** Thumbnail image blob stored locally in IndexedDB, if available */ thumbnailBlob?: Blob; }; export type SubsetJobError = { url: string; message: string; }; export type SubsetJobLink = { title: string; href: string; rel: string; type: string; bbox?: number[]; temporal?: { start: string; end: string; }; }; export type SearchOptions = { signal?: AbortSignal; bearerToken?: string | null; environment?: 'uat' | 'prod'; }; export type SubsetJobs = { count: number; jobs: Array; }; /** * Harmony REST API wrapper for OGC-based subset job operations. * Makes direct HTTP calls to the Harmony service endpoints. */ declare class HarmonyApi { #private; /** * Returns collection capabilities including available services, output formats, subsetting options, etc. * from the Harmony /capabilities endpoint */ getCollectionCapabilities(conceptId?: string, options?: RequestOptions): Promise; /** * Gets a user's Harmony jobs */ getJobs(params?: { page?: number; limit?: number; label?: string; }, options?: SearchOptions): Promise<{ count: number; jobs: SubsetJobStatus[]; links: SubsetJobLink[]; }>; /** * Create a subset job by sending a GET request to the Harmony OGC API endpoint. * When the request includes a shape, sends a multipart POST with all params in the * form body alongside the shapefile (per HARMONY-290, query params + file upload * cannot be combined). */ createJob(harmonyRequest: HarmonyRequest, options?: SearchOptions): Promise; /** * Get the current status of an existing subset job. * Intended for polling until the job reaches a final state. */ getJobStatus(jobId: string, options?: SearchOptions): Promise; /** * Normalizes a job link so that data links with a missing or generic title * ("OPeNDAP Request URL") get a more informative title derived from the href. * Everything after `/granules/` in the URL is used; if that segment is not * present the full href is used as a fallback. */ static normalizeJobLink(link: SubsetJobLink): SubsetJobLink; /** * Removes one or more labels from one or more Harmony jobs. * After removal, the jobs will no longer match label-based filters. * * @example * await harmonyApi.removeJobLabels({ jobIDs: ['abc', 'def'], labels: ['my-label'] }, { bearerToken }) */ removeJobLabels(params: { jobIDs: string[]; labels: string[]; }, options?: SearchOptions): Promise; /** * Given a jobId for a running job, send a cancellation request to the Harmony API. * Returns the updated job status after cancellation. */ cancelJob(jobId: string, options?: SearchOptions): Promise; /** * When a Harmony job finishes, it provides URLs for downloading the results. This method can be used to fetch the results from those URLs, which may require authentication if the data is not public. */ fetchUrl(url: string, options?: SearchOptions): Promise; /** * Extracts the variable concept ID from the variable's href and adds it as a property on the variable object. */ addConceptIdToVariables(variables: Variable[]): Variable[]; /** * Processes the Harmony capabilities response to generate a list of output format options with user-friendly labels and descriptions. * If Giovanni is the only service available, only return Giovanni-specific formats. * If Giovanni is present with other services, include both Giovanni and non-Giovanni formats, avoiding duplicates. * If Giovanni is not present, return only non-Giovanni formats. */ getOutputFormatOptions(capabilities: HarmonyCapabilitiesResponse): ConfiguredOutputFormat[]; } export declare const harmonyApi: HarmonyApi; export {};