UNPKG

@olakai/sdk

Version:

This document demonstrates how to use the Olakai SDK with all its features.

30 lines 1.06 kB
import { Middleware } from "./index"; /** * Create a common middleware stack * Stack details: * 1. Logging middleware * 2. Rate limiting middleware * 3. Validation middleware * 4. Circuit breaker middleware * See exports from ./middleware/index.ts for details on each middleware. * @param functionName - The name of the function to monitor. This is just for logging purposes. * @param options - The options for the middleware * @returns An array of middleware functions */ export declare function createCommonMiddleware<TArgs extends any[], TResult>(functionName: string, options?: { enableLogging?: boolean; enableMetrics?: boolean; enableRateLimit?: { maxCalls: number; windowMs: number; }; enableValidation?: { validateArgs?: (args: TArgs) => boolean | string; validateResult?: (result: TResult) => boolean | string; }; enableCircuitBreaker?: { failureThreshold: number; resetTimeoutMs: number; }; }): Middleware<TArgs, TResult>[]; //# sourceMappingURL=common.d.ts.map