@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
44 lines (43 loc) • 1.55 kB
TypeScript
import { Client } from '../client/Client';
import type { SortOptions, EventFilter } from '../interfaces/common';
import { WpEntity as WpEntityClass } from '../entities/WpEntity';
import { Related as RelatedClass } from '../entities/Related';
import { Markers as MarkersClass } from '../entities/Markers';
export interface SingleEventResponse {
event: WpEntityClass;
related?: RelatedClass;
markers?: MarkersClass;
}
/**
* Events API for accessing event content
*
* This class provides type-safe methods for querying and retrieving event content
* from the GraphQL API.
*/
export declare class Events {
private client;
private readonly defaultEventFields;
private readonly defaultMarkersFields;
constructor(client: Client);
/**
* List events with optional filtering and sorting
*
* @param filter Optional filtering options
* @param sortBy Optional sorting options
* @param fields Optional GraphQL fields to return
* @returns Array of event entities and markers
*/
list(filter: EventFilter, sortBy?: SortOptions, fields?: string): Promise<{
events: WpEntityClass[];
markers?: MarkersClass;
}>;
/**
* Get a specific event by ID
*
* @param id The event ID
* @param lang Language code ('en' or 'sv' or 'de')
* @param fields Optional GraphQL fields to return
* @returns Event entity with related content and markers
*/
getById(id: number, lang: 'en' | 'sv' | 'de', fields?: string): Promise<SingleEventResponse>;
}