@vendure/core
Version:
A modern, headless ecommerce framework
58 lines (57 loc) • 2.03 kB
TypeScript
import { Injector } from '../common/injector';
import { HealthCheckStrategy } from '../config/system/health-check-strategy';
import { HealthIndicator, HealthIndicatorFunction, HealthIndicatorResult } from './terminus-compat';
/**
* @deprecated This interface is part of the deprecated health check feature and will be removed in v4.0.0.
*/
export interface HttpHealthCheckOptions {
key: string;
url: string;
timeout?: number;
}
/**
* @description
* A {@link HealthCheckStrategy} used to check health by pinging a url.
*
* @example
* ```ts
* import { HttpHealthCheckStrategy, TypeORMHealthCheckStrategy } from '\@vendure/core';
*
* export const config = {
* // ...
* systemOptions: {
* healthChecks: [
* new TypeORMHealthCheckStrategy(),
* new HttpHealthCheckStrategy({ key: 'my-service', url: 'https://my-service.com' }),
* ]
* },
* };
* ```
*
* @docsCategory health-check
* @deprecated Use infrastructure-level health checks (e.g. Kubernetes probes, Docker healthchecks,
* load balancer checks) instead of application-level health checks. This class will be removed in v4.0.0.
*/
export declare class HttpHealthCheckStrategy implements HealthCheckStrategy {
private options;
constructor(options: HttpHealthCheckOptions);
private injector;
init(injector: Injector): void;
getHealthIndicator(): HealthIndicatorFunction;
}
/**
* A simple HTTP health indicator that pings a URL via the native `fetch` API
* and converts any error into a `HealthCheckError`. Subclasses {@link HealthIndicator}
* to pick up the shared `getStatus()` helper.
*
* @deprecated This class is part of the deprecated health check feature and will be removed in v4.0.0.
*/
export declare class CustomHttpHealthIndicator extends HealthIndicator {
/**
* Prepares and throw a HealthCheckError
*
* @throws {HealthCheckError}
*/
private generateHttpError;
pingCheck(key: string, url: string, timeout?: number): Promise<HealthIndicatorResult>;
}