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.
Unique identifier for the rate limiter
Readable execution context for the operation
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.
Unique identifier for the rate limiter
The new metrics/state object from the policy
The calculated expiration date for this state
Readable execution context for the operation
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"