Beignet API reference
    Preparing search index...

    Interface IdempotencyHooksOptions<Ctx>

    Options for createIdempotencyHooks(...).

    interface IdempotencyHooksOptions<Ctx> {
        fingerprintInput?: (
            args: { body: unknown; path: unknown; query: unknown },
        ) => unknown;
        namespace?: (args: { contract: { name: string } }) => string;
        scope?: (
            args: { ctx: Ctx; meta: IdempotencyMeta; req: HttpRequestLike },
        ) => IdempotencyScope;
    }

    Type Parameters

    • Ctx
    Index
    fingerprintInput?: (
        args: { body: unknown; path: unknown; query: unknown },
    ) => unknown

    Build the fingerprint input from the parsed request.

    Defaults to { path, query, body }.

    namespace?: (args: { contract: { name: string } }) => string

    Build the idempotency namespace for a contract.

    Defaults to http.<contract name> so HTTP reservations never collide with use-case runIdempotently(...) namespaces.

    scope?: (
        args: { ctx: Ctx; meta: IdempotencyMeta; req: HttpRequestLike },
    ) => IdempotencyScope

    Build the idempotency scope after context exists.

    Defaults to a scope derived from meta.scope: omitted metadata scopes by ctx.actor?.id and also ctx.tenant?.id when present, "actor" scopes by the actor only, "global" stays global, "tenant" scopes by the tenant, and "actor-tenant" scopes by both.