@fran-834/gs-microservice-core
Version:
Core package for Node.js microservices by Galduria Software. Includes security, logging, validation, and error handling middlewares.
60 lines (50 loc) • 1.36 kB
TypeScript
import { CorsOptions } from "cors";
import { HelmetOptions } from "helmet";
type coreMiddlewareOptions = {
gateway?: boolean;
jwtSecret?: string;
helmetConfig?: HelmetOptions;
corsOptions?: CorsOptions;
};
declare const helloWorld: () => void;
declare const setupCoreMiddlewares: (
app: any,
{ gateway, jwtSecret, helmetConfig, corsOptions }: coreMiddlewareOptions
) => void;
declare const setupErrorHandler: (app: any) => void;
declare const microserviceIPs: { [key: string]: string };
declare const logError: (error: any) => void;
declare const logInfo: (message: string) => void;
declare const logDebug: (message: string) => void;
declare const logOperation: (req: any) => void;
declare const AppError: any;
declare const commonErrors: any;
declare const commonHTTPErrors: any;
declare const standardResponse: (
res: any,
code: number,
message: string,
data?: any,
time?: number,
invalidatedAt?: Date,
schema?: any,
count?: number
) => void;
declare const validateSchema: (schema: any, data: any) => boolean;
declare const verifyToken: (req: any, res: any, next: any) => void;
export {
helloWorld,
setupCoreMiddlewares,
setupErrorHandler,
logError,
logInfo,
logDebug,
logOperation,
AppError,
commonErrors,
commonHTTPErrors,
standardResponse,
validateSchema,
verifyToken,
microserviceIPs,
};