Skip to content
PACKAGES

createFixedWindowRateLimitTransitionInput()

Create and strictly normalize one fixed-window-v1 evaluator input.

import { createFixedWindowRateLimitTransitionInput } from "@graphrefly/ts/rate-limit";
function createFixedWindowRateLimitTransitionInput(
request: unknown,
policy: unknown,
state: unknown,
observedAtMs: unknown,
): FixedWindowRateLimitTransitionInput
ParameterTypeDescription
requestunknownComplete strict request to evaluate.
policyunknownExact scoped fixed-window policy.
stateunknownExact scoped state, or null only when the host atomically confirms that no exact scoped state exists and authorizes this evaluation to perform first initialization.
observedAtMsunknownExternally supplied authoritative Unix epoch milliseconds.

The immutable normalized fixed-window evaluator input.

import { createFixedWindowRateLimitTransitionInput } from "@graphrefly/ts/rate-limit";

packages/ts/src/rate-limit/keyed-rate-limit-algorithms.ts