@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Type Alias IdempotencyCheckResult

    IdempotencyCheckResult:
        | { kind: "replay"; response: unknown }
        | { kind: "conflict" }
        | { kind: "expired" }
        | { kind: "in-flight"; retryAfterSeconds: number }
        | { kind: "miss"; payloadHash: string }

    Result of checking the store for a given key + payload.

    Type Declaration

    • { kind: "replay"; response: unknown }
      • kind: "replay"

        Cache hit with matching payload — replay the cached response.

      • response: unknown
    • { kind: "conflict" }
      • kind: "conflict"

        Cache hit with different payload — reject as IDEMPOTENCY_CONFLICT.

    • { kind: "expired" }
      • kind: "expired"

        Cached key exists but is past TTL — reject as IDEMPOTENCY_EXPIRED.

    • { kind: "in-flight"; retryAfterSeconds: number }
      • kind: "in-flight"

        A parallel request is currently executing the same key — the caller should retry the check.

      • retryAfterSeconds: number

        Suggested retry delay in seconds, derived from the remaining TTL on the first request's in-flight claim (expiresAt - now, capped at IN_FLIGHT_RETRY_HINT_CAP_SECONDS). The middleware surfaces this as the retry_after hint on the IDEMPOTENCY_IN_FLIGHT response so a buyer's transient-retry decays toward the expected completion instead of slamming back instantly. Always >= 1.

    • { kind: "miss"; payloadHash: string }
      • kind: "miss"

        No prior execution for this key — caller should run the handler and save.

      • payloadHash: string