UNPKG

@obelisk/client

Version:

Typescript client to interact with Obelisk on a higher level than the regular ReST API calls.

32 lines (31 loc) 1.26 kB
import { Observable } from 'rxjs'; import { TPageResponse } from '.'; import { ApiVersion } from '../interfaces'; import { ObeliskClient } from '../obelisk-client'; /** * Endpoint class represents an Obelisk API Endpoint. * You can just execute it, or request soms higher level function from it, like give me a range. */ export declare class TPageEndpoint { private client; private _url; private _apiVersion; /** * Absolute url to use in requests */ get url(): string; /** * Creates an TPageEndpoint instance, the client is used to add tokens and uri is relative path starting after /api/<version>. * Examples are: <code>/things/my_thing/metrics/my_metric/events?from=1530089953000</code> or <code>/locations/my_loc/metrics/my_metric/stats/unit</code> */ static create(client: ObeliskClient, uri: string, apiVersion?: ApiVersion): TPageEndpoint; private constructor(); private get; /** * Executes the call to the given endpoint. * If the call requires authentication, it will add it. * If the call requires extra handling because it defines a range of multple buckets, * it will handle it. */ execute(): Observable<TPageResponse>; }