Retrieves the stored rate limiter data for a given key. Used to load existing state when evaluating subsequent attempts. Returns null if the rate limiter hasn't been initialized yet.
Readable execution context for the operation
Unique identifier for the rate limiter
The stored rate limiter data if found, otherwise null
Inserts a new rate limiter or updates an existing one (upsert operation). Used when recording a new attempt or updating metrics after evaluation. Implementations should use database UPSERT semantics if available.
Readable execution context for the operation
Unique identifier for the rate limiter
The new metrics/state object from the policy
The calculated expiration date for this state
Transaction interface for rate limiter storage operations. Provides atomic operations within a database transaction context. All methods execute within the same transaction for ACID compliance.
IMPORT_PATH:
"@daiso-tech/core/rate-limiter/contracts"