IdempotencyOptionsBuilder
このコンテンツはまだ日本語訳がありません。
Defined in: src/http/cache/IdempotencyOptions.ts:52
Fluent builder for IdempotencyOptionsType:
idempotent(IdempotencyOptions.create().withCache(cache).withTtlMs(24 * 60 * 60_000))Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IdempotencyOptionsBuilder():
IdempotencyOptionsBuilder
Returns
Section titled “Returns”IdempotencyOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withCache()
Section titled “withCache()”withCache(
cache):this
Defined in: src/http/cache/IdempotencyOptions.ts:59
Backing cache used to record first responses.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
withHeaderName()
Section titled “withHeaderName()”withHeaderName(
headerName):this
Defined in: src/http/cache/IdempotencyOptions.ts:69
Header to read the idempotency key from. Default: 'idempotency-key'.
Parameters
Section titled “Parameters”headerName
Section titled “headerName”string
Returns
Section titled “Returns”this
withIdentity()
Section titled “withIdentity()”withIdentity(
identity):this
Defined in: src/http/cache/IdempotencyOptions.ts:84
Per-caller scope folded into the cache key (security audit HTTP-4).
Parameters
Section titled “Parameters”identity
Section titled “identity”(request) => string | Promise<string>
Returns
Section titled “Returns”this
withKeyPrefix()
Section titled “withKeyPrefix()”withKeyPrefix(
keyPrefix):this
Defined in: src/http/cache/IdempotencyOptions.ts:74
Cache-key namespace. Default: 'idem:'.
Parameters
Section titled “Parameters”keyPrefix
Section titled “keyPrefix”string
Returns
Section titled “Returns”this
withMissingHeader()
Section titled “withMissingHeader()”withMissingHeader(
missingHeader):this
Defined in: src/http/cache/IdempotencyOptions.ts:79
Behaviour when the request lacks the header. Default: 'reject'.
Parameters
Section titled “Parameters”missingHeader
Section titled “missingHeader”"reject" | "pass-through"
Returns
Section titled “Returns”this
withTtlMs()
Section titled “withTtlMs()”withTtlMs(
ttlMs):this
Defined in: src/http/cache/IdempotencyOptions.ts:64
How long to remember responses (ms). Default: 24 hours.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():IdempotencyOptionsBuilder
Defined in: src/http/cache/IdempotencyOptions.ts:54
Start a fresh builder. Equivalent to new IdempotencyOptionsBuilder().
Returns
Section titled “Returns”IdempotencyOptionsBuilder
