@wandelbots/nova-js
Version:
Official JS client for the Wandelbots API
67 lines • 2.56 kB
TypeScript
import type { Configuration as BaseConfiguration } from "@wandelbots/nova-api/v2";
import { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
import { ConnectedMotionGroup } from "./ConnectedMotionGroup";
import { MockNovaInstance } from "./mock/MockNovaInstance";
import { MotionStreamConnection } from "./MotionStreamConnection";
import { NovaCellAPIClient } from "./NovaCellAPIClient";
export type NovaClientConfig = {
/**
* Url of the deployed Nova instance to connect to
* e.g. https://saeattii.instance.wandelbots.io
*/
instanceUrl: string | "https://mock.example.com";
/**
* Identifier of the cell on the Nova instance to connect this client to.
* If omitted, the default identifier "cell" is used.
**/
cellId?: string;
/**
* Username for basic auth to the Nova instance.
* @deprecated use accessToken instead
*/
username?: string;
/**
* Password for basic auth to the Nova instance.
* @deprecated use accessToken instead
*/
password?: string;
/**
* Access token for Bearer authentication.
*/
accessToken?: string;
} & Omit<BaseConfiguration, "isJsonMime" | "basePath">;
type NovaClientConfigWithDefaults = NovaClientConfig & {
cellId: string;
};
/**
* EXPERIMENTAL
*
* This client provides a starting point to migrate NOVA api v2.
* As v2 is still in development, this client has to be considered unstable
*
* Client for connecting to a Nova instance and controlling robots.
*/
export declare class NovaClient {
readonly api: NovaCellAPIClient;
readonly config: NovaClientConfigWithDefaults;
readonly mock?: MockNovaInstance;
authPromise: Promise<string | null> | null;
accessToken: string | null;
constructor(config: NovaClientConfig);
renewAuthentication(): Promise<void>;
makeWebsocketURL(path: string): string;
/**
* Retrieve an AutoReconnectingWebsocket to the given path on the Nova instance.
* If you explicitly want to reconnect an existing websocket, call `reconnect`
* on the returned object.
*/
openReconnectingWebsocket(path: string): AutoReconnectingWebsocket;
/**
* Connect to the motion state websocket(s) for a given motion group
*/
connectMotionStream(motionGroupId: string): Promise<MotionStreamConnection>;
connectMotionGroups(motionGroupIds: string[]): Promise<ConnectedMotionGroup[]>;
connectMotionGroup(motionGroupId: string): Promise<ConnectedMotionGroup>;
}
export {};
//# sourceMappingURL=NovaClient.d.ts.map