observation-js
Version:
A fully-typed TypeScript client for the waarneming.nl API.
24 lines (23 loc) • 662 B
JavaScript
export class Countries {
#client;
/**
* @internal
*/
constructor(client) {
this.#client = client;
}
/**
* Fetches a paginated list of all countries.
* The names of the countries will be returned in the language set on the client (default: 'en').
* This is a public endpoint and does not require authentication.
*
* @returns A promise that resolves to a paginated list of country objects.
* @throws {ApiError} If the request fails.
*/
async list() {
return this.#client.publicRequest('countries/', {
method: 'GET',
clientCache: true,
});
}
}