idempotency-middleware · packages
Every package shipped from reaatech/idempotency-middleware, published or pending.
6 packages
@reaatech/idempotency-middleware
A framework-agnostic TypeScript middleware that makes POST, PUT, and PATCH requests idempotent by caching responses keyed to an `Idempotency-Key` header, with pluggable storage adapters (in-memory, Redis, DynamoDB, Firestore) and distributed locking to prevent concurrent handler execution for the same key. Exports an `IdempotencyMiddleware` class with an `execute` method that wraps any async handler.
- status
- published
- published
- 1 month ago
@reaatech/idempotency-middleware-adapter-dynamodb
A DynamoDB storage adapter for `@reaatech/idempotency-middleware` that implements the `StorageAdapter` interface using conditional writes for distributed locking and TTL-compatible `expiresAt` attributes. It pairs with `@aws-sdk/client-dynamodb` and `@aws-sdk/util-dynamodb` at runtime.
- status
- published
- published
- 5 days ago
@reaatech/idempotency-middleware-adapter-firestore
A Firestore storage adapter for `@reaatech/idempotency-middleware` that provides transaction-gated distributed locking and TTL-compatible expiry via `expiresAt` Date fields. Exports a `FirestoreAdapter` class implementing the `StorageAdapter` interface, requiring a `@google-cloud/firestore` `Firestore` instance and an optional collection name.
- status
- published
- published
- 8 days ago
@reaatech/idempotency-middleware-adapter-redis
Redis storage adapter for `@reaatech/idempotency-middleware` that implements the `StorageAdapter` interface using ioredis, providing distributed idempotency caching with token-guarded locking via `SET NX` and Lua-based lock release.
- status
- published
- published
- 1 month ago
@reaatech/idempotency-middleware-express
Express middleware that caches responses keyed by the `Idempotency-Key` header, preventing duplicate processing of retried requests. It monkey-patches `res.json()` and `res.send()` to capture response bodies, and requires a storage adapter from `@reaatech/idempotency-middleware` (e.g., `MemoryAdapter`).
- status
- published
- published
- 1 month ago
@reaatech/idempotency-middleware-koa
Koa middleware that caches responses keyed by the `Idempotency-Key` header, preventing duplicate processing of the same request. It provides an `idempotentKoa(storage, config?)` function that wraps route handlers, automatically capturing `ctx.body` and `ctx.status` after `await next()` for replay on subsequent identical requests. Requires `koa` and a body parser middleware like `koa-bodyparser`.
- status
- published
- published
- 1 month ago