import * as express from 'express'; import * as TransportStream from 'winston-transport'; import { Tracer } from './Tracer'; import { Context, TraceId } from 'zipkin'; import { TransformFunction } from 'logform'; import { Config } from './Config'; import { Logger, LoggerModule } from './Logger'; import { FetchRequester, RequestRequester, RequesterModule } from './Request'; import { TracerService } from './Tracer'; import { HealthCheckList } from './types'; export interface AppOptions { appAccessLoggingBypassUrls?: string[]; appCookieSessionName?: string; appCorsWhitelist?: string[]; appCspChildSrc?: string[]; appCspConnectSrc?: string[]; appCspDefaultSrc?: string[]; appCspFontSrc?: string[]; appCspFrameSrc?: string[]; appCspImgSrc?: string[]; appCspMediaSrc?: string[]; appCspObjectSrc?: string[]; appCspReportUri?: string; appCspScriptSrc?: string[]; appCspStyleSrc?: string[]; appEnableCors?: boolean; appEnableCsp?: boolean; appJsonBodyContentType?: string; appJsonBodySizeLimit?: string; appLivenessChecks?: HealthCheckList; appLivenessCheckEndpoint?: string; appMetricsEndpoint?: string; appReadinessChecks?: HealthCheckList; appReadinessCheckEndpoint?: string; appUrlEncodedBodyContentType?: string; appUrlEncodedBodySizeLimit?: string; } export interface LoggerWinstonOptions { logger?: LoggerModule; winstonFormats?: TransformFunction[]; winstonLevel?: string; winstonLevels?: { [key: string]: string; }; winstonTransports?: TransportStream[]; } export declare type LoggerModuleOptions = LoggerWinstonOptions; export declare type LogsCollator = TransportStream; export declare type LogsCollatorService = 'fluentd'; export interface LogsCollatorFluentdOptions { logsCollator?: LogsCollatorService; fluentdHost?: string; fluentdPort?: string; } export declare type LogsCollatorOptions = LogsCollatorFluentdOptions; export declare type Requester = RequestRequester | FetchRequester; export interface RequestRequestOptions { requester?: RequesterModule; } export declare type RequesterModuleOptions = RequestRequestOptions; export interface TracerZipkinOptions { tracer?: TracerService; zipkinHeaders?: object; zipkinHost?: string; zipkinPort?: string; zipkinSampleFrequency?: number; zipkinScheme?: 'http' | 'https'; } export declare type TracerOptions = TracerZipkinOptions; export interface BoilerplateInitOptions extends AppOptions, LoggerModuleOptions, LogsCollatorOptions, RequesterModuleOptions, TracerZipkinOptions { serviceId?: string; } export declare class Boilerplate { static app: express.Application; static config: Config; static context: Context; static logsCollator: LogsCollator; static logger: Logger; static request: Requester; static serviceId: string; static tracer: Tracer; static init({ logger, logsCollator, requester, tracer, appAccessLoggingBypassUrls, appCookieSessionName, appCorsWhitelist, appCspChildSrc, appCspConnectSrc, appCspDefaultSrc, appCspFontSrc, appCspFrameSrc, appCspImgSrc, appCspMediaSrc, appCspObjectSrc, appCspReportUri, appCspScriptSrc, appCspStyleSrc, appEnableCors, appEnableCsp, appJsonBodyContentType, appJsonBodySizeLimit, appLivenessChecks, appLivenessCheckEndpoint, appMetricsEndpoint, appReadinessChecks, appReadinessCheckEndpoint, appUrlEncodedBodyContentType, appUrlEncodedBodySizeLimit, fluentdHost, fluentdPort, serviceId, winstonFormats, winstonLevel, winstonTransports, zipkinHeaders, zipkinHost, zipkinPort, zipkinSampleFrequency, zipkinScheme, }?: BoilerplateInitOptions): void; }