observation-js
Version:
A fully-typed TypeScript client for the waarneming.nl API.
39 lines (38 loc) • 1.63 kB
TypeScript
import type { ObservationClient } from '../core/client';
import type { Export, ExportStartResponse, Paginated, StartExportOptions } from '../types';
export declare class Exports {
#private;
/**
* @internal
*/
constructor(client: ObservationClient);
/**
* Fetches a list of the authenticated user's observation exports.
*
* @returns A promise that resolves to a paginated list of the user's exports.
* @throws {AuthenticationError} If the request is not authenticated.
* @throws {ApiError} If the request fails.
*/
list(): Promise<Paginated<Export>>;
/**
* Fetches the details of a single export by its ID.
* The export must belong to the authenticated user.
*
* @param exportId - The unique identifier for the export.
* @returns A promise that resolves to the export object.
* @throws {AuthenticationError} If the request is not authenticated.
* @throws {ApiError} If the request fails.
*/
get(exportId: number): Promise<Export>;
/**
* Starts a new observation export job.
* This sends a request to the server to begin generating an export file.
* The status of the job can be tracked via the `get` method.
*
* @param options - The export options, specifying the type, format, and filters.
* @returns A promise that resolves to an object containing the new export's ID and status URL.
* @throws {AuthenticationError} If the request is not authenticated.
* @throws {ApiError} If the request fails.
*/
start(options: StartExportOptions): Promise<ExportStartResponse>;
}