14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
|
|
import { request } from './client';
|
||
|
|
|
||
|
|
export interface ReadinessResponse {
|
||
|
|
status: 'ready' | 'unavailable';
|
||
|
|
version: string;
|
||
|
|
checks: Record<string, string>;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const readyQueryKey = ['readyz'] as const;
|
||
|
|
|
||
|
|
export function fetchReadiness(signal?: AbortSignal): Promise<ReadinessResponse> {
|
||
|
|
return request<ReadinessResponse>('/readyz', signal === undefined ? {} : { signal });
|
||
|
|
}
|