UNPKG

apitally

Version:

Simple API monitoring & analytics for REST APIs built with Express, Fastify, NestJS, AdonisJS, Hono, H3, Elysia, and Koa.

54 lines (51 loc) 1.27 kB
import { ApitallyConfig, ApitallyConsumer } from '../common/types.cjs'; import { Elysia } from 'elysia'; import '../common/logging.cjs'; import 'winston'; import '../common/requestLogger.cjs'; import 'node:buffer'; import 'node:http'; import '../common/tempGzipFile.cjs'; declare const START_TIME_SYMBOL: unique symbol; declare const REQUEST_BODY_SYMBOL: unique symbol; declare const RESPONSE_SYMBOL: unique symbol; declare const ERROR_SYMBOL: unique symbol; declare global { interface Request { [START_TIME_SYMBOL]?: number; [REQUEST_BODY_SYMBOL]?: Buffer; [RESPONSE_SYMBOL]?: Response; [ERROR_SYMBOL]?: Readonly<Error>; } } interface ApitallyContext { consumer?: ApitallyConsumer | string; } declare function apitallyPlugin(config: ApitallyConfig): (app: Elysia) => Elysia<"", { decorator: { apitally: ApitallyContext; }; store: {}; derive: {}; resolve: {}; }, { typebox: {}; error: {}; }, { schema: {}; standaloneSchema: {}; macro: {}; macroFn: {}; parser: {}; }, {}, { derive: {}; resolve: {}; schema: {}; standaloneSchema: {}; }, { derive: {}; resolve: {}; schema: {}; standaloneSchema: {}; }>; export { apitallyPlugin as default };