@pulzar/core
Version:
Next-generation Node.js framework for ultra-fast web applications with zero-reflection DI, GraphQL, WebSockets, events, and edge runtime support
34 lines • 1.24 kB
TypeScript
import type { FastifyRequest, FastifyReply, FastifyInstance } from "fastify";
import { z } from "zod";
export interface TransformOptions {
schema?: z.ZodSchema;
transform?: (data: any) => any;
excludePaths?: string[];
}
export declare function createTransformPipe(options?: TransformOptions): (request: FastifyRequest, reply: FastifyReply, payload: any) => Promise<any>;
export declare const responseTransformers: {
apiResponse: (data: any) => {
success: boolean;
data: any;
timestamp: string;
};
errorResponse: (error: any) => {
success: boolean;
error: any;
timestamp: string;
};
paginatedResponse: (data: any[], page: number, limit: number, total: number) => {
success: boolean;
data: any[];
pagination: {
page: number;
limit: number;
total: number;
pages: number;
};
timestamp: string;
};
};
export declare function registerTransformPlugin(fastify: FastifyInstance, options?: TransformOptions): void;
export declare const transformPipe: (request: FastifyRequest, reply: FastifyReply, payload: any) => Promise<any>;
//# sourceMappingURL=transform.pipe.d.ts.map