The hook reads contract.metadata.idempotency and enforces it with
ctx.ports.idempotency. In beforeHandle it reserves the client key after
request parsing and route hook identity resolution, replays completed matching
responses with an idempotency-replayed: true header, and rejects in-progress
or conflicting keys with the framework
IdempotencyInProgress/IdempotencyConflict catalog errors. After the
response-validation phase, it stores final route-owned 2xx framework-neutral
responses for replay and releases the reservation for framework-owned
responses, errors, non-2xx responses, and native Response results, which
are not replayable.
Use runIdempotently(...) from @beignet/core/idempotency for non-HTTP
workflows such as jobs, listeners, webhooks, and schedules.
Create metadata-driven idempotency hooks.
The hook reads
contract.metadata.idempotencyand enforces it withctx.ports.idempotency. InbeforeHandleit reserves the client key after request parsing and route hook identity resolution, replays completed matching responses with anidempotency-replayed: trueheader, and rejects in-progress or conflicting keys with the frameworkIdempotencyInProgress/IdempotencyConflictcatalog errors. After the response-validation phase, it stores final route-owned 2xx framework-neutral responses for replay and releases the reservation for framework-owned responses, errors, non-2xx responses, and nativeResponseresults, which are not replayable.Use
runIdempotently(...)from@beignet/core/idempotencyfor non-HTTP workflows such as jobs, listeners, webhooks, and schedules.