@lokalise/fastify-extras
Version:
Opinionated set of fastify plugins, commonly used in Lokalise
23 lines (22 loc) • 769 B
TypeScript
import type { FastifyPluginCallback } from 'fastify';
import type { HealthChecker } from './healthcheckCommons.js';
export interface PublicHealthcheckPluginOptions {
responsePayload?: Record<string, unknown>;
url?: string;
logLevel?: 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
healthChecks: readonly HealthCheck[];
infoProviders?: readonly InfoProvider[];
}
export type InfoProvider = {
name: string;
dataResolver: () => Record<string, unknown>;
};
export type HealthCheck = {
name: string;
isMandatory: boolean;
checker: HealthChecker;
};
/**
* @deprecated use commonSyncHealthcheckPlugin instead
*/
export declare const publicHealthcheckPlugin: FastifyPluginCallback<PublicHealthcheckPluginOptions>;