/** * metrics-sdk-admin * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 5.4.9 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AuthenticatedConnection } from './connection'; export declare const DEFAULT_REST_ENDPOINT: string, DEFAULT_SOCKET_ENDPOINT: string; export declare const DEFAULT_REQUEST_TIMEOUT = 5000; export declare const BASE_PATH: string; export interface ConfigurationParameters { basePath?: string; username?: string; password?: string; apiKey?: string | ((name: string) => string); accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); credentials?: RequestCredentials; } export declare class Configuration { private configuration; constructor(configuration?: ConfigurationParameters); set config(configuration: Configuration); get basePath(): string; get username(): string | undefined; get password(): string | undefined; get apiKey(): ((name: string) => string) | undefined; get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined; set accessToken(token: ((name?: string, scopes?: string[]) => string | Promise) | undefined); get credentials(): RequestCredentials | undefined; } export interface ConnectionOptions { restEndpoint?: string; socketEndpoint?: string; persistConnection?: boolean; requestTimeout?: number; } export interface ConnectionEvent { socketConnection: boolean; } export interface PushDataEvent { context: string; from: number; message: any; room: string; sentAt: number; } export declare class MetricsConnection { private readonly _restEndpoint; private readonly _socketEndpoint; private _persistConnection; private readonly _requestTimeout; private _socket; private _lastMessageId; private _checkCallbacksTimeoutInstance; private _socketRetryAttempts; private readonly _callbacks; private readonly _socketBulkhead; private readonly _retryStrategy; private readonly _onDisposeEvent; private readonly _onConnectionChangeEvent; private readonly _onPushDataEvent; private accessToken; constructor(options?: ConnectionOptions); get token(): string | null; set token(token: string | null); get onDisposeEvent(): import("./event").IEvent; dispose(): void; get socketConnected(): boolean; get persistConnection(): boolean; get onConnectionChangeEvent(): import("./event").IEvent; get onPushDataEvent(): import("./event").IEvent; get baseUrl(): URL; private openConnection; private onSocketOpened; private onSocketClosed; private closeConnection; private dispatchConnectionChange; private onSocketMessage; action(action: string, route: string, method: HTTPMethod, params: Object | undefined, pathParams: Object | undefined, headers: HTTPHeaders, body?: HTTPBody): Promise; private checkCallbacks; private pong; private parseResponse; private parseMessage; private actionSocket; /** * Flattens an HTTP body for merging into socket action params. * - Plain objects: spread into params (keys merged at top level). * - Arrays, FormData, URLSearchParams, primitives: wrapped as `{ body }`. * - null/undefined: returns empty object `{}`. */ private flattenBody; private actionRest; } /** * This is the base class for all generated API classes. */ export declare class BaseAPI { connection: AuthenticatedConnection; constructor(connection: AuthenticatedConnection); protected request(context: RequestOpts, authenticated?: boolean): Promise; } export declare class ResponseError extends Error { response: Response; name: "ResponseError"; constructor(response: Response, msg?: string); } export declare class FetchError extends Error { cause: Error; name: "FetchError"; constructor(cause: Error, msg?: string); } export declare class RequiredError extends Error { field: string; name: "RequiredError"; constructor(field: string, msg?: string); } export type Json = any; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HTTPHeaders = { [key: string]: string; }; export type Consume = { contentType: string; }; export declare function canConsumeForm(consumes: Consume[] | undefined | null): boolean; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery; }; export type HTTPBody = Json | FormData | URLSearchParams; export interface RequestOpts { path: string; action: string; method: HTTPMethod; headers: HTTPHeaders; query?: HTTPQuery; pathParams?: HTTPQuery; body?: HTTPBody; } export declare function mapValues(data: any, fn: (item: any) => any): {}; export declare function exists(json: any, key: string): boolean;