@mochabug/adapt-web
Version:
The client library to execute automations, without effort, in a browser environment
29 lines (28 loc) • 1.44 kB
TypeScript
import type { GetSessionResponseJson, InheritSessionResponseJson, ReadOutputResponseJson, ReadUrlsResponseJson, StartSessionRequestJson, StartSessionResponseJson } from "./genproto/mochabugapis/adapt/automations/v1/automations_pb.js";
export * from "./pubsub-client.js";
export interface AdaptConfig {
baseUrl: string;
wsBaseUrl: string;
}
export declare function configure(config: Partial<AdaptConfig>): void;
export declare function getConfig(): AdaptConfig;
export declare function resetConfig(): void;
export declare function startSession(req: StartSessionRequestJson, token?: string): Promise<StartSessionResponseJson>;
export declare function inheritSession(id: string, sessionToken: string): Promise<InheritSessionResponseJson>;
export declare function getSession(id: string, sessionToken: string): Promise<GetSessionResponseJson>;
export declare function readOutput(id: string, sessionToken: string, options?: {
pageSize?: number;
vertex?: string;
newerThan?: string;
}): Promise<ReadOutputResponseJson>;
export declare function readUrls(id: string, sessionToken: string, options?: {
pageSize?: number;
newerThan?: string;
}): Promise<ReadUrlsResponseJson>;
export declare function stopSession(id: string, sessionToken: string): Promise<void>;
export declare class RestClientError extends Error {
status: number;
statusText: string;
response: Response;
constructor(response: Response);
}