OrbitSpaceDevelopers

TYPESCRIPT / JAVASCRIPT

Client & errors

Method reference generated from the public package declarations · v0.3.0

Configure one API origin, tenant context, request lifetime and safe-read retries. Convenience operations throw OrbitSpaceError; raw generated operations retain their result contract.

export class OrbitSpaceClient

constructor

constructor(options: OrbitSpaceClientOptions);

approvals

readonly approvals: ApprovalsResource;

artifacts

readonly artifacts: ArtifactsResource;

authenticatedFetch

readonly authenticatedFetch: typeof globalThis.fetch;

baseUrl

readonly baseUrl: string;

fetch

fetch(path: string, init?: RequestInit): Promise<Response>;

goals

readonly goals: GoalsResource;

invocations

readonly invocations: InvocationsResource;

paginate

paginate<T = unknown>(path: string, options: PaginateOptions<T>): AsyncGenerator<T>;

request

request<T = unknown>(method: string, path: string, options?: RequestOptions): Promise<T>;

stream

stream<T = unknown>(path: string, options?: StreamOptions): AsyncGenerator<ServerSentEvent<T>>;

tasks

readonly tasks: TasksResource;

transport

readonly transport: GeneratedClient;

watchControlPlaneEvents

watchControlPlaneEvents<T = Record<string, unknown>>(options?: ControlPlaneWatchOptions): AsyncGenerator<ServerSentEvent<T>>;

watchGoalEvents

watchGoalEvents<T = Record<string, unknown>>(goalId: string, options?: WatchOptions): AsyncGenerator<ServerSentEvent<T>>;

watchGoalExperience

watchGoalExperience<T = Record<string, unknown>>(experience: GoalExperienceReference, options?: WatchOptions): AsyncGenerator<ServerSentEvent<T>>;

watchInvocationEvents

watchInvocationEvents<T = Record<string, unknown>>(invocationId: string, options?: WatchOptions): AsyncGenerator<ServerSentEvent<T>>;

watchTaskEvents

watchTaskEvents<T = Record<string, unknown>>(taskId: string, options?: WatchOptions): AsyncGenerator<ServerSentEvent<T>>;

watchWorkflowEvents

watchWorkflowEvents<T = Record<string, unknown>>(workflowExecutionId: string, options?: WatchOptions): AsyncGenerator<ServerSentEvent<T>>;
export type OrbitSpaceClientOptions = {
    baseUrl: string;
    token?: TokenProvider;
    fetch?: typeof globalThis.fetch;
    headers?: HeadersInit;
    maxErrorBodyBytes?: number;
    tenantId?: string;
    timeoutMs?: number;
    retry?: RetryOptions;
};
export type TokenProvider = string | ((context?: TokenProviderContext) => string | undefined | Promise<string | undefined>);
export type TokenProviderContext = {
    signal?: AbortSignal;
};
export type RequestOptions = {
    query?: Record<string, QueryValue | readonly QueryValue[]>;
    body?: unknown;
    headers?: HeadersInit;
    signal?: AbortSignal;
    responseType?: "json" | "text" | "bytes" | "response";
};
export type QueryValue = string | number | bigint | boolean | Date | null | undefined;
export type PaginateOptions<T> = {
    itemsKey: string;
    query?: Record<string, QueryValue | readonly QueryValue[]>;
    pageSize?: number;
    map?: (item: unknown) => T;
    signal?: AbortSignal;
};
export type RetryOptions = {
    maxRetries?: number;
    initialDelayMs?: number;
    maxDelayMs?: number;
};
export class OrbitSpaceError

constructor

constructor(input: {
    message: string;
    status: number;
    reason?: string;
    code?: number | string;
    metadata?: Record<string, unknown>;
    requestId?: string;
});

code

readonly code?: number | string;

metadata

readonly metadata?: Record<string, unknown>;

reason

readonly reason: string;

requestId

readonly requestId?: string;

status

readonly status: number;

Download method index JSON ↓ · Source digest 5f558e57b94420ef8fc60d9a8274a2ab5b92ac85d23f370a5bac4bc7ad2baae2