Setu-TS
    Preparing search index...

    Type Alias IdempotencyStoreConfig

    IdempotencyStoreConfig:
        | {
            maxBytes?: number;
            maxEntries?: number;
            maxEntriesPerScope?: number;
            type: "memory";
        }
        | {
            client?: never;
            commandTimeoutMs?: number;
            keyPrefix?: string;
            namespace: string;
            type: "redis";
            url: string;
        }
        | {
            client: IRedisIdempotencyClient;
            keyPrefix?: string;
            namespace: string;
            type: "redis";
            url?: never;
        }
        | { store: IIdempotencyStore; type: "custom" }

    Which store backs the idempotency service (plan §4.1).

    Type Declaration

    • {
          maxBytes?: number;
          maxEntries?: number;
          maxEntriesPerScope?: number;
          type: "memory";
      }
      • Optional ReadonlymaxBytes?: number

        Global byte cap (approximate). Default 67,108,864.

      • Optional ReadonlymaxEntries?: number

        Global entry cap. Default 100,000.

      • Optional ReadonlymaxEntriesPerScope?: number

        Per-scope entry cap. Default 1,000; at most maxEntries.

      • Readonlytype: "memory"

        The in-process store.

    • {
          client?: never;
          commandTimeoutMs?: number;
          keyPrefix?: string;
          namespace: string;
          type: "redis";
          url: string;
      }
      • Optional Readonlyclient?: never

        Must be absent on this arm — a URL and a client are mutually exclusive.

      • Optional ReadonlycommandTimeoutMs?: number

        Per-command timeout in ms. Default 15,000; 0 disables.

      • Optional ReadonlykeyPrefix?: string

        Key prefix. Default 'setu:idempotency:'.

      • Readonlynamespace: string

        Required. Isolates this application's records from another on the same Redis.

      • Readonlytype: "redis"

        The Redis store, over a client this package builds lazily.

      • Readonlyurl: string

        The Redis connection URL.

    • {
          client: IRedisIdempotencyClient;
          keyPrefix?: string;
          namespace: string;
          type: "redis";
          url?: never;
      }
      • Readonlyclient: IRedisIdempotencyClient

        The caller-owned Redis client.

      • Optional ReadonlykeyPrefix?: string

        Key prefix. Default 'setu:idempotency:'.

      • Readonlynamespace: string

        Required. Isolates this application's records from another on the same Redis.

      • Readonlytype: "redis"

        The Redis store, over a caller-supplied client.

      • Optional Readonlyurl?: never

        Must be absent on this arm — a client and a URL are mutually exclusive.

    • { store: IIdempotencyStore; type: "custom" }
      • Readonlystore: IIdempotencyStore

        The store instance, passed through unchanged.

      • Readonlytype: "custom"

        Any IIdempotencyStore the application supplies.

    0.9.0