Skip to main content

@getriebe/http-client

Call the same-origin worklist and session API from a browser host.

Source revision 49560371f6cd34d30383df5619df46969c594ae4.

Browser client for a Getriebe API routed through this page’s origin.

export declare function createGetriebeClient(options?: {
readonly fetch?: typeof fetch;
readonly apiPath?: string;
}): GetriebeClient;
export type FailureKind = "unauthenticated" | "forbidden" | "conflict" | "http" | "invalid-response";
export interface GetriebeClient {
login(username: string, password: string): Promise<void>;
logout(): Promise<void>;
worklist(query?: WorklistQuery): Promise<TaskPage>;
claim(taskId: string): Promise<TaskSummary>;
release(taskId: string): Promise<TaskSummary>;
}
export declare class GetriebeError extends Error {
readonly kind: FailureKind;
readonly status: number | undefined;
readonly problemType: string | undefined;
constructor(kind: FailureKind, message: string, status?: number, problemType?: string);
}
export declare function readScopePath(value: unknown): readonly SubProcessExecution[] | undefined;
export interface SubProcessExecution {
readonly id: string;
readonly bpmnElementId: string;
readonly targetVersionId?: string;
}
export interface TaskPage {
readonly items: readonly TaskSummary[];
readonly nextCursor?: string;
}
export interface TaskSummary {
readonly id: string;
readonly instanceId: string;
readonly modelId: string;
readonly versionId: string;
readonly bpmnElementId: string;
readonly state: string;
readonly createdAt: string;
readonly dueAt?: string;
readonly scopePath?: readonly SubProcessExecution[];
readonly multiInstance?: {
readonly roundId: string;
readonly index: number;
readonly item: string;
};
readonly actions: readonly string[];
readonly assignee?: {
readonly id: string;
readonly displayName?: string;
};
readonly role?: {
readonly key: string;
readonly name?: string;
};
}
export interface WorklistQuery {
readonly cursor?: string;
readonly limit?: number;
readonly roleKey?: string;
readonly instanceId?: string;
}