Aller au contenu
Français

IdempotencyOptionsBuilder

Ce contenu n’est pas encore disponible dans votre langue.

Defined in: src/http/cache/IdempotencyOptions.ts:52

Fluent builder for IdempotencyOptionsType:

idempotent(IdempotencyOptions.create().withCache(cache).withTtlMs(24 * 60 * 60_000))

new IdempotencyOptionsBuilder(): IdempotencyOptionsBuilder

IdempotencyOptionsBuilder

OptionsBuilder.constructor

build(): Partial<T>

Defined in: src/util/OptionsBuilder.ts:51

Snapshot the set fields as an independent Partial<T> (own props only).

Partial<T>

OptionsBuilder.build


withCache(cache): this

Defined in: src/http/cache/IdempotencyOptions.ts:59

Backing cache used to record first responses.

Cache

this


withHeaderName(headerName): this

Defined in: src/http/cache/IdempotencyOptions.ts:69

Header to read the idempotency key from. Default: 'idempotency-key'.

string

this


withIdentity(identity): this

Defined in: src/http/cache/IdempotencyOptions.ts:84

Per-caller scope folded into the cache key (security audit HTTP-4).

(request) => string | Promise<string>

this


withKeyPrefix(keyPrefix): this

Defined in: src/http/cache/IdempotencyOptions.ts:74

Cache-key namespace. Default: 'idem:'.

string

this


withMissingHeader(missingHeader): this

Defined in: src/http/cache/IdempotencyOptions.ts:79

Behaviour when the request lacks the header. Default: 'reject'.

"reject" | "pass-through"

this


withTtlMs(ttlMs): this

Defined in: src/http/cache/IdempotencyOptions.ts:64

How long to remember responses (ms). Default: 24 hours.

number

this


static create(): IdempotencyOptionsBuilder

Defined in: src/http/cache/IdempotencyOptions.ts:54

Start a fresh builder. Equivalent to new IdempotencyOptionsBuilder().

IdempotencyOptionsBuilder