UNPKG

@eristack/idempotency

Version:

Idempotency-Key guard with Drizzle store, scoped keys, lease, Express/Nest/client adapters

18 lines • 768 B
import { type CallHandler, type ExecutionContext, type NestInterceptor } from "@nestjs/common"; import type { Observable } from "rxjs"; import type { IdempotencyGuard, IdempotencyScope } from "../core/types.js"; export type IdempotencyInterceptorOptions = { guard: IdempotencyGuard; header?: string; scopeFromContext?: (ctx: ExecutionContext) => IdempotencyScope; }; export declare class IdempotencyInterceptor implements NestInterceptor { private readonly options; constructor(options: IdempotencyInterceptorOptions); intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>; } export declare function mapIdempotencyError(err: unknown): { status: number; body: unknown; } | null; //# sourceMappingURL=index.d.ts.map