# @probitas/expect > Version: 0.4.1 Type-safe expectation library for Probitas scenario testing with specialized assertions for various client types. This module provides a unified `expect()` function that automatically dispatches to the appropriate expectation based on the input type, along with specialized expectations for each client type. ## Features - **Type-safe expectations**: Compile-time safety with TypeScript - **Unified API**: Single `expect()` function that dispatches to specialized expectations - **Client-specific assertions**: Tailored expectations for HTTP, GraphQL, SQL, Redis, MongoDB, and more - **Method chaining**: Fluent API for readable test assertions - **Consistent naming**: All methods follow `toBeXxx` or `toHaveXxx` patterns - **Generic fallback**: Chainable wrapper for @std/expect matchers ## Usage ### Unified expect Function The `expect()` function automatically dispatches to the appropriate expectation based on the input type: ## Classes ### `ExpectationError` ```typescript class ExpectationError extends Error ``` Custom error class for expectation failures. This class is used to identify expectation errors and format them differently from regular errors (e.g., without "Error:" prefix in reporters). **Constructor:** ```typescript new ExpectationError(message: string) ``` --- ### `HttpError` ```typescript class HttpError extends ClientError ``` HTTP error class for non-2xx responses. This error is thrown (or returned in response.error) when the server responds with a 4xx or 5xx status code. It includes the response body for inspecting error details. **Constructor:** ```typescript new HttpError(status: number, statusText: string, options?: HttpErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"http"` - [readonly] `status`: `number` — HTTP status code - [readonly] `statusText`: `string` — HTTP status text - [readonly] `headers`: `Headers | null` — Response headers (null if not available) **Methods:** ```typescript body(): unknown ``` Response body as raw bytes (null if no body) ```typescript arrayBuffer(): unknown ``` Get body as ArrayBuffer (null if no body) ```typescript blob(): unknown ``` Get body as Blob (null if no body) ```typescript text(): unknown ``` Get body as text (null if no body) ```typescript json(): unknown ``` Get body as parsed JSON (null if no body). **Example:** Check status code and body ```ts import { createHttpClient, HttpError } from "@probitas/client-http"; const http = createHttpClient({ url: "http://localhost:3000", throwOnError: true }); try { await http.get("/not-found"); } catch (error) { if (error instanceof HttpError && error.status === 404) { console.log("Not found:", error.text); } } ``` --- ### `HttpNetworkError` ```typescript class HttpNetworkError extends ClientError ``` Error thrown when a network-level failure occurs. This error indicates that the request could not be processed by the server due to network issues (connection refused, DNS resolution failure, etc.). **Constructor:** ```typescript new HttpNetworkError(message: string, options?: ErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"network"` --- ### `GraphqlExecutionError` ```typescript class GraphqlExecutionError extends ClientError ``` Error thrown for GraphQL execution errors. This error is returned when the GraphQL server processes the request but returns errors in the response (validation errors, resolver errors, etc.). **Constructor:** ```typescript new GraphqlExecutionError( errors: readonly GraphqlErrorItem[], options?: ErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"graphql"` - [readonly] `errors`: `readonly GraphqlErrorItem[]` — GraphQL errors from response --- ### `GraphqlNetworkError` ```typescript class GraphqlNetworkError extends ClientError ``` Error thrown for network-level failures. This error indicates that the request could not reach or be processed by the GraphQL server (connection refused, HTTP errors, etc.). **Constructor:** ```typescript new GraphqlNetworkError(message: string, options?: ErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"network"` --- ### `ConnectRpcNetworkError` ```typescript class ConnectRpcNetworkError extends ClientError ``` Error thrown when a network-level failure occurs. This error indicates that the request could not be processed by the server due to network issues (connection refused, DNS resolution failure, timeout, etc.). Unlike ConnectRpcError, this error means the server was never reached. **Constructor:** ```typescript new ConnectRpcNetworkError(message: string, options?: ErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connectrpc"` --- ### `ConnectRpcError` ```typescript class ConnectRpcError extends ClientError ``` Error class for ConnectRPC/gRPC errors. Use `statusCode` to distinguish between different gRPC error codes. **Constructor:** ```typescript new ConnectRpcError( message: string, statusCode: ConnectRpcStatusCode, statusMessage: string, options?: ConnectRpcErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connectrpc"` - [readonly] `statusCode`: `ConnectRpcStatusCode` - [readonly] `statusMessage`: `string` - [readonly] `metadata`: `Headers | null` - [readonly] `details`: `readonly ErrorDetail[]` --- ### `RedisError` ```typescript class RedisError extends ClientError ``` Base error class for Redis client errors. **Constructor:** ```typescript new RedisError(message: string, _: unknown, options?: RedisErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `code?`: `string` --- ### `RedisConnectionError` ```typescript class RedisConnectionError extends RedisError ``` Error thrown when a Redis connection cannot be established. **Constructor:** ```typescript new RedisConnectionError(message: string, options?: RedisErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `RedisCommandError` ```typescript class RedisCommandError extends RedisError ``` Error thrown when a Redis command fails. **Constructor:** ```typescript new RedisCommandError(message: string, options: RedisCommandErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"command"` - [readonly] `command`: `string` --- ### `RedisScriptError` ```typescript class RedisScriptError extends RedisError ``` Error thrown when a Redis Lua script fails. **Constructor:** ```typescript new RedisScriptError(message: string, options: RedisScriptErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"script"` - [readonly] `script`: `string` --- ### `MongoError` ```typescript class MongoError extends ClientError ``` Base error class for MongoDB client errors. **Constructor:** ```typescript new MongoError(message: string, _: unknown, options?: MongoErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `code?`: `number` --- ### `MongoConnectionError` ```typescript class MongoConnectionError extends MongoError ``` Error thrown when a MongoDB connection cannot be established. **Constructor:** ```typescript new MongoConnectionError(message: string, options?: MongoErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `MongoQueryError` ```typescript class MongoQueryError extends MongoError ``` Error thrown when a MongoDB query fails. **Constructor:** ```typescript new MongoQueryError( message: string, collection: string, options?: MongoErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"query"` - [readonly] `collection`: `string` --- ### `MongoDuplicateKeyError` ```typescript class MongoDuplicateKeyError extends MongoError ``` Error thrown when a duplicate key constraint is violated. **Constructor:** ```typescript new MongoDuplicateKeyError( message: string, keyPattern: Record, keyValue: Record, options?: MongoErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"duplicate_key"` - [readonly] `keyPattern`: `Record` - [readonly] `keyValue`: `Record` --- ### `MongoValidationError` ```typescript class MongoValidationError extends MongoError ``` Error thrown when document validation fails. **Constructor:** ```typescript new MongoValidationError( message: string, validationErrors: readonly string[], options?: MongoErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"validation"` - [readonly] `validationErrors`: `readonly string[]` --- ### `MongoWriteError` ```typescript class MongoWriteError extends MongoError ``` Error thrown when a write operation fails. **Constructor:** ```typescript new MongoWriteError( message: string, writeErrors: readonly { index: number; code: number; message: string }[], options?: MongoErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"write"` - [readonly] `writeErrors`: `readonly { index: number; code: number; message: string }[]` --- ### `MongoNotFoundError` ```typescript class MongoNotFoundError extends MongoError ``` Error thrown when a document is not found (for firstOrThrow, lastOrThrow). **Constructor:** ```typescript new MongoNotFoundError(message: string, options?: MongoErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"not_found"` --- ### `DenoKvError` ```typescript class DenoKvError extends ClientError ``` Base error class for Deno KV operations. Use the `kind` property to distinguish between error types: - `"kv"`: General KV operation error - `"quota"`: Quota limit exceeded - `"connection"`: Network/connection failure **Constructor:** ```typescript new DenoKvError(message: string, _: unknown, options?: ErrorOptions) ``` **Properties:** - [readonly] `name`: `string` --- ### `DenoKvConnectionError` ```typescript class DenoKvConnectionError extends DenoKvError ``` Error thrown when a connection to Deno KV fails. This typically occurs when: - Network errors prevent reaching Deno Deploy KV - Authentication/authorization fails - Service is unavailable **Constructor:** ```typescript new DenoKvConnectionError(message: string, options?: ErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `DenoKvAtomicBuilderImpl` ```typescript class DenoKvAtomicBuilderImpl implements DenoKvAtomicBuilder ``` Implementation of DenoKvAtomicBuilder. **Constructor:** ```typescript new DenoKvAtomicBuilderImpl(kv: Deno.Kv, options?: AtomicBuilderOptions) ``` **Methods:** ```typescript check(): unknown ``` ```typescript set(): unknown ``` ```typescript delete(): unknown ``` ```typescript sum(): unknown ``` ```typescript min(): unknown ``` ```typescript max(): unknown ``` ```typescript commit(): unknown ``` --- ### `SqsBatchError` ```typescript class SqsBatchError extends SqsError ``` Error thrown when a batch operation partially fails. **Constructor:** ```typescript new SqsBatchError( message: string, failedCount: number, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"batch"` - [readonly] `failedCount`: `number` --- ### `SqsCommandError` ```typescript class SqsCommandError extends SqsError ``` Error thrown when an SQS command fails. **Constructor:** ```typescript new SqsCommandError(message: string, options: SqsCommandErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"command"` - [readonly] `operation`: `string` --- ### `SqsConnectionError` ```typescript class SqsConnectionError extends SqsError ``` Error thrown when an SQS connection cannot be established. **Constructor:** ```typescript new SqsConnectionError(message: string, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `SqsError` ```typescript class SqsError extends ClientError ``` Base error class for SQS client errors. **Constructor:** ```typescript new SqsError(message: string, _: unknown, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `code?`: `string` --- ### `SqsMessageNotFoundError` ```typescript class SqsMessageNotFoundError extends SqsError ``` Error thrown when a message is not found or receipt handle is invalid. **Constructor:** ```typescript new SqsMessageNotFoundError(message: string, options?: SqsErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"message_not_found"` --- ### `SqsMessageTooLargeError` ```typescript class SqsMessageTooLargeError extends SqsError ``` Error thrown when a message exceeds the size limit. **Constructor:** ```typescript new SqsMessageTooLargeError( message: string, size: number, maxSize: number, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"message_too_large"` - [readonly] `size`: `number` - [readonly] `maxSize`: `number` --- ### `SqsQueueNotFoundError` ```typescript class SqsQueueNotFoundError extends SqsError ``` Error thrown when a queue is not found. **Constructor:** ```typescript new SqsQueueNotFoundError( message: string, queueUrl: string, options?: SqsErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"queue_not_found"` - [readonly] `queueUrl`: `string` --- ### `RabbitMqError` ```typescript class RabbitMqError extends ClientError ``` Base error class for RabbitMQ client errors. **Constructor:** ```typescript new RabbitMqError(message: string, _: unknown, options?: RabbitMqErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `code?`: `number` --- ### `RabbitMqConnectionError` ```typescript class RabbitMqConnectionError extends RabbitMqError ``` Error thrown when a RabbitMQ connection cannot be established. **Constructor:** ```typescript new RabbitMqConnectionError(message: string, options?: RabbitMqErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ### `RabbitMqChannelError` ```typescript class RabbitMqChannelError extends RabbitMqError ``` Error thrown when a RabbitMQ channel operation fails. **Constructor:** ```typescript new RabbitMqChannelError(message: string, options?: RabbitMqChannelErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"channel"` - [readonly] `channelId?`: `number` --- ### `RabbitMqNotFoundError` ```typescript class RabbitMqNotFoundError extends RabbitMqError ``` Error thrown when a RabbitMQ resource (queue or exchange) is not found. **Constructor:** ```typescript new RabbitMqNotFoundError( message: string, options: RabbitMqNotFoundErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"not_found"` - [readonly] `resource`: `string` --- ### `RabbitMqPreconditionFailedError` ```typescript class RabbitMqPreconditionFailedError extends RabbitMqError ``` Error thrown when a RabbitMQ precondition check fails. **Constructor:** ```typescript new RabbitMqPreconditionFailedError( message: string, options: RabbitMqPreconditionFailedErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"precondition_failed"` - [readonly] `reason`: `string` --- ### `SqlError` ```typescript class SqlError extends ClientError ``` Base error class for SQL-specific errors. Extends ClientError with SQL-specific properties. **Constructor:** ```typescript new SqlError(message: string, kind: SqlErrorKind, options?: SqlErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `SqlErrorKind` - [readonly] `sqlState`: `string | null` --- ### `QuerySyntaxError` ```typescript class QuerySyntaxError extends SqlError ``` Error thrown when a SQL query has syntax errors. **Constructor:** ```typescript new QuerySyntaxError(message: string, options?: SqlErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"query"` --- ### `ConstraintError` ```typescript class ConstraintError extends SqlError ``` Error thrown when a constraint violation occurs. **Constructor:** ```typescript new ConstraintError( message: string, constraint: string, options?: SqlErrorOptions, ) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"constraint"` - [readonly] `constraint`: `string` --- ### `DeadlockError` ```typescript class DeadlockError extends SqlError ``` Error thrown when a deadlock is detected. **Constructor:** ```typescript new DeadlockError(message: string, options?: SqlErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"deadlock"` --- ### `SqlConnectionError` ```typescript class SqlConnectionError extends SqlError ``` Error thrown when a connection or network-level error occurs. This includes: - Connection refused (server not running) - Authentication failure - Connection timeout - Pool exhaustion - TLS handshake failure - DNS resolution failure **Constructor:** ```typescript new SqlConnectionError(message: string, options?: SqlErrorOptions) ``` **Properties:** - [readonly] `name`: `string` - [readonly] `kind`: `"connection"` --- ## Interfaces ### `AnythingExpectation` ```typescript interface AnythingExpectation ``` Chainable expectation interface for any value using @std/expect matchers. Unlike @std/expect which returns void from matchers, this interface returns `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBe(expected: unknown): this ``` Asserts that the value is strictly equal (`===`) to the expected value. ```typescript toEqual(expected: unknown): this ``` Asserts that the value is deeply equal to the expected value. ```typescript toStrictEqual(expected: unknown): this ``` Asserts that the value is strictly deeply equal to the expected value. Unlike {@linkcode toEqual}, this checks object types and `undefined` properties. ```typescript toMatch(expected: string | RegExp): this ``` Asserts that the string matches the expected pattern. ```typescript toMatchObject(expected: Record): this ``` Asserts that the object matches a subset of properties. ```typescript toBeDefined(): this ``` Asserts that the value is not `undefined`. ```typescript toBeUndefined(): this ``` Asserts that the value is `undefined`. ```typescript toBeNull(): this ``` Asserts that the value is `null`. ```typescript toBeNaN(): this ``` Asserts that the value is `NaN`. ```typescript toBeTruthy(): this ``` Asserts that the value is truthy (not `false`, `0`, `""`, `null`, `undefined`, or `NaN`). ```typescript toBeFalsy(): this ``` Asserts that the value is falsy (`false`, `0`, `""`, `null`, `undefined`, or `NaN`). ```typescript toContain(expected: unknown): this ``` Asserts that an array or string contains the expected item or substring. ```typescript toContainEqual(expected: unknown): this ``` Asserts that an array contains an item equal to the expected value. ```typescript toHaveLength(expected: number): this ``` Asserts that the array or string has the expected length. ```typescript toBeGreaterThan(expected: number): this ``` Asserts that the number is greater than the expected value. ```typescript toBeGreaterThanOrEqual(expected: number): this ``` Asserts that the number is greater than or equal to the expected value. ```typescript toBeLessThan(expected: number): this ``` Asserts that the number is less than the expected value. ```typescript toBeLessThanOrEqual(expected: number): this ``` Asserts that the number is less than or equal to the expected value. ```typescript toBeCloseTo(expected: number, numDigits?: number): this ``` Asserts that the number is close to the expected value within a certain precision. ```typescript toBeInstanceOf(expected: (_: any[]) => unknown): this ``` Asserts that the value is an instance of the expected class. ```typescript toThrow(expected?: string | RegExp | Error): this ``` Asserts that a function throws an error matching the expected pattern. ```typescript toHaveProperty(keyPath: string | string[], expectedValue?: unknown): this ``` Asserts that the object has a property at the specified path. ```typescript toHaveBeenCalled(): this ``` Asserts that a mock function was called at least once. ```typescript toHaveBeenCalledTimes(expected: number): this ``` Asserts that a mock function was called exactly the specified number of times. ```typescript toHaveBeenCalledWith(_: unknown[]): this ``` Asserts that a mock function was called with the specified arguments. ```typescript toHaveBeenLastCalledWith(_: unknown[]): this ``` Asserts that a mock function was last called with the specified arguments. ```typescript toHaveBeenNthCalledWith(n: number, _: unknown[]): this ``` Asserts that the nth call of a mock function was with the specified arguments. ```typescript toHaveReturned(): this ``` Asserts that a mock function returned successfully at least once. ```typescript toHaveReturnedTimes(expected: number): this ``` Asserts that a mock function returned successfully the specified number of times. ```typescript toHaveReturnedWith(expected: unknown): this ``` Asserts that a mock function returned the specified value at least once. ```typescript toHaveLastReturnedWith(expected: unknown): this ``` Asserts that a mock function last returned the specified value. ```typescript toHaveNthReturnedWith(n: number, expected: unknown): this ``` Asserts that the nth call of a mock function returned the specified value. --- ### `HttpResponseExpectation` ```typescript interface HttpResponseExpectation ``` Fluent API for HTTP response validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the response is successful (status 2xx). ```typescript toHaveStatus(expected: unknown): this ``` Asserts that the status equals the expected value. ```typescript toHaveStatusEqual(expected: unknown): this ``` Asserts that the status equals the expected value using deep equality. ```typescript toHaveStatusStrictEqual(expected: unknown): this ``` Asserts that the status strictly equals the expected value. ```typescript toHaveStatusSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the status satisfies the provided matcher function. ```typescript toHaveStatusNaN(): this ``` Asserts that the status is NaN. ```typescript toHaveStatusGreaterThan(expected: number): this ``` Asserts that the status is greater than the expected value. ```typescript toHaveStatusGreaterThanOrEqual(expected: number): this ``` Asserts that the status is greater than or equal to the expected value. ```typescript toHaveStatusLessThan(expected: number): this ``` Asserts that the status is less than the expected value. ```typescript toHaveStatusLessThanOrEqual(expected: number): this ``` Asserts that the status is less than or equal to the expected value. ```typescript toHaveStatusCloseTo(expected: number, numDigits?: number): this ``` Asserts that the status is close to the expected value. ```typescript toHaveStatusOneOf(values: unknown[]): this ``` Asserts that the status is one of the specified values. ```typescript toHaveStatusText(expected: unknown): this ``` Asserts that the status text equals the expected value. ```typescript toHaveStatusTextEqual(expected: unknown): this ``` Asserts that the status text equals the expected value using deep equality. ```typescript toHaveStatusTextStrictEqual(expected: unknown): this ``` Asserts that the status text strictly equals the expected value. ```typescript toHaveStatusTextSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the status text satisfies the provided matcher function. ```typescript toHaveStatusTextContaining(substr: string): this ``` Asserts that the status text contains the specified substring. ```typescript toHaveStatusTextMatching(expected: RegExp): this ``` Asserts that the status text matches the specified regular expression. ```typescript toHaveHeaders(expected: unknown): this ``` Asserts that the headers equal the expected value. ```typescript toHaveHeadersEqual(expected: unknown): this ``` Asserts that the headers equal the expected value using deep equality. ```typescript toHaveHeadersStrictEqual(expected: unknown): this ``` Asserts that the headers strictly equal the expected value. ```typescript toHaveHeadersSatisfying(matcher: (value: HttpHeaders) => unknown): this ``` Asserts that the headers satisfy the provided matcher function. ```typescript toHaveHeadersMatching( subset: Record | Record[], ): this ``` Asserts that the headers match the specified subset. ```typescript toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the headers have the specified property. ```typescript toHaveHeadersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the headers property contains the expected value. ```typescript toHaveHeadersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the headers property matches the specified subset. ```typescript toHaveHeadersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the headers property satisfies the provided matcher function. ```typescript toHaveUrl(expected: unknown): this ``` Asserts that the URL equals the expected value. ```typescript toHaveUrlEqual(expected: unknown): this ``` Asserts that the URL equals the expected value using deep equality. ```typescript toHaveUrlStrictEqual(expected: unknown): this ``` Asserts that the URL strictly equals the expected value. ```typescript toHaveUrlSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the URL satisfies the provided matcher function. ```typescript toHaveUrlContaining(substr: string): this ``` Asserts that the URL contains the specified substring. ```typescript toHaveUrlMatching(expected: RegExp): this ``` Asserts that the URL matches the specified regular expression. ```typescript toHaveBody(expected: unknown): this ``` Asserts that the body equals the expected value. ```typescript toHaveBodyEqual(expected: unknown): this ``` Asserts that the body equals the expected value using deep equality. ```typescript toHaveBodyStrictEqual(expected: unknown): this ``` Asserts that the body strictly equals the expected value. ```typescript toHaveBodySatisfying(matcher: (value: Uint8Array | null) => unknown): this ``` Asserts that the body satisfies the provided matcher function. ```typescript toHaveBodyPresent(): this ``` Asserts that the body is present (not null or undefined). ```typescript toHaveBodyNull(): this ``` Asserts that the body is null. ```typescript toHaveBodyUndefined(): this ``` Asserts that the body is undefined. ```typescript toHaveBodyNullish(): this ``` Asserts that the body is nullish (null or undefined). ```typescript toHaveBodyLength(expected: unknown): this ``` Asserts that the body length equals the expected value. ```typescript toHaveBodyLengthEqual(expected: unknown): this ``` Asserts that the body length equals the expected value using deep equality. ```typescript toHaveBodyLengthStrictEqual(expected: unknown): this ``` Asserts that the body length strictly equals the expected value. ```typescript toHaveBodyLengthSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the body length satisfies the provided matcher function. ```typescript toHaveBodyLengthNaN(): this ``` Asserts that the body length is NaN. ```typescript toHaveBodyLengthGreaterThan(expected: number): this ``` Asserts that the body length is greater than the expected value. ```typescript toHaveBodyLengthGreaterThanOrEqual(expected: number): this ``` Asserts that the body length is greater than or equal to the expected value. ```typescript toHaveBodyLengthLessThan(expected: number): this ``` Asserts that the body length is less than the expected value. ```typescript toHaveBodyLengthLessThanOrEqual(expected: number): this ``` Asserts that the body length is less than or equal to the expected value. ```typescript toHaveBodyLengthCloseTo(expected: number, numDigits?: number): this ``` Asserts that the body length is close to the expected value. ```typescript toHaveText(expected: unknown): this ``` Asserts that the text equals the expected value. ```typescript toHaveTextEqual(expected: unknown): this ``` Asserts that the text equals the expected value using deep equality. ```typescript toHaveTextStrictEqual(expected: unknown): this ``` Asserts that the text strictly equals the expected value. ```typescript toHaveTextSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the text satisfies the provided matcher function. ```typescript toHaveTextContaining(substr: string): this ``` Asserts that the text contains the specified substring. ```typescript toHaveTextMatching(expected: RegExp): this ``` Asserts that the text matches the specified regular expression. ```typescript toHaveTextPresent(): this ``` Asserts that the text is present (not null or undefined). ```typescript toHaveTextNull(): this ``` Asserts that the text is null. ```typescript toHaveTextUndefined(): this ``` Asserts that the text is undefined. ```typescript toHaveTextNullish(): this ``` Asserts that the text is nullish (null or undefined). ```typescript toHaveTextLength(expected: unknown): this ``` Asserts that the text length equals the expected value. ```typescript toHaveTextLengthEqual(expected: unknown): this ``` Asserts that the text length equals the expected value using deep equality. ```typescript toHaveTextLengthStrictEqual(expected: unknown): this ``` Asserts that the text length strictly equals the expected value. ```typescript toHaveTextLengthSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the text length satisfies the provided matcher function. ```typescript toHaveTextLengthNaN(): this ``` Asserts that the text length is NaN. ```typescript toHaveTextLengthGreaterThan(expected: number): this ``` Asserts that the text length is greater than the expected value. ```typescript toHaveTextLengthGreaterThanOrEqual(expected: number): this ``` Asserts that the text length is greater than or equal to the expected value. ```typescript toHaveTextLengthLessThan(expected: number): this ``` Asserts that the text length is less than the expected value. ```typescript toHaveTextLengthLessThanOrEqual(expected: number): this ``` Asserts that the text length is less than or equal to the expected value. ```typescript toHaveTextLengthCloseTo(expected: number, numDigits?: number): this ``` Asserts that the text length is close to the expected value. ```typescript toHaveJson(expected: unknown): this ``` Asserts that the JSON equals the expected value. ```typescript toHaveJsonEqual(expected: unknown): this ``` Asserts that the JSON equals the expected value using deep equality. ```typescript toHaveJsonStrictEqual(expected: unknown): this ``` Asserts that the JSON strictly equals the expected value. ```typescript toHaveJsonSatisfying( matcher: (value: Record | null) => unknown, ): this ``` Asserts that the JSON satisfies the provided matcher function. ```typescript toHaveJsonPresent(): this ``` Asserts that the JSON is present (not null or undefined). ```typescript toHaveJsonNull(): this ``` Asserts that the JSON is null. ```typescript toHaveJsonUndefined(): this ``` Asserts that the JSON is undefined. ```typescript toHaveJsonNullish(): this ``` Asserts that the JSON is nullish (null or undefined). ```typescript toHaveJsonMatching( subset: Record | Record[], ): this ``` Asserts that the JSON matches the specified subset. ```typescript toHaveJsonProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the JSON has the specified property. ```typescript toHaveJsonPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the JSON property contains the expected value. ```typescript toHaveJsonPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the JSON property matches the specified subset. ```typescript toHaveJsonPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the JSON property satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `HttpResponseError` ```typescript interface HttpResponseError extends HttpResponseBase ``` HTTP response for error responses (4xx/5xx status codes). Server received and processed the request, but returned an error status. **Properties:** - [readonly] `processed`: `true` — Server processed the request. - [readonly] `ok`: `false` — Response was not successful (4xx/5xx). - [readonly] `error`: `HttpError` — Error describing the HTTP error. - [readonly] `status`: `number` — HTTP status code (4xx/5xx). - [readonly] `statusText`: `string` — HTTP status text. - [readonly] `headers`: `Headers` — Response headers. - [readonly] `raw`: `globalThis.Response` — Raw Web standard Response. --- ### `HttpResponseFailure` ```typescript interface HttpResponseFailure extends HttpResponseBase ``` HTTP response for request failures (network errors, timeouts, etc.). Request could not be processed by the server (network error, DNS failure, connection refused, timeout, aborted, etc.). **Properties:** - [readonly] `processed`: `false` — Server did not process the request. - [readonly] `ok`: `false` — Request failed. - [readonly] `error`: `HttpFailureError` — Error describing the failure (ConnectionError, TimeoutError, AbortError). - [readonly] `status`: `null` — No HTTP status (request didn't reach server). - [readonly] `statusText`: `null` — No HTTP status text (request didn't reach server). - [readonly] `headers`: `null` — No headers (request didn't reach server). - [readonly] `body`: `null` — No body (request didn't reach server). - [readonly] `raw`: `null` — No raw response (request didn't reach server). --- ### `HttpResponseSuccess` ```typescript interface HttpResponseSuccess extends HttpResponseBase ``` HTTP response for successful requests (2xx status codes). Wraps Web standard Response, allowing body to be read synchronously and multiple times (unlike the streaming-based standard Response). **Properties:** - [readonly] `processed`: `true` — Server processed the request. - [readonly] `ok`: `true` — Response was successful (2xx). - [readonly] `error`: `null` — No error for successful responses. - [readonly] `status`: `number` — HTTP status code (200-299). - [readonly] `statusText`: `string` — HTTP status text. - [readonly] `headers`: `Headers` — Response headers. - [readonly] `raw`: `globalThis.Response` — Raw Web standard Response. --- ### `HttpOptions` ```typescript interface HttpOptions extends CommonOptions ``` Options for individual HTTP requests. **Properties:** - [readonly] `query?`: `QueryParams` — Query parameters (arrays for multi-value params) - [readonly] `headers?`: `HeadersInit` — Additional request headers - [readonly] `redirect?`: `RedirectMode` — Redirect handling mode. - [readonly] `throwOnError?`: `boolean` — Whether to throw HttpError for non-2xx responses. When false, non-2xx responses are returned as HttpResponse. --- ### `HttpRequestOptions` ```typescript interface HttpRequestOptions extends HttpOptions ``` Options for HTTP requests that may include a body. **Properties:** - [readonly] `body?`: `BodyInit` — Request body --- ### `CookieConfig` ```typescript interface CookieConfig ``` Cookie handling configuration. **Properties:** - [readonly] `disabled?`: `boolean` — Disable automatic cookie handling. When disabled, cookies are not stored or sent automatically. - [readonly] `initial?`: `Record` — Initial cookies to populate the cookie jar. --- ### `HttpConnectionConfig` ```typescript interface HttpConnectionConfig extends CommonConnectionConfig ``` HTTP connection configuration. Extends CommonConnectionConfig with HTTP-specific options. **Properties:** - [readonly] `protocol?`: `"http" | "https"` — Protocol to use. - [readonly] `path?`: `string` — Base path prefix for all requests. --- ### `HttpClientConfig` ```typescript interface HttpClientConfig extends CommonOptions ``` HTTP client configuration. **Properties:** - [readonly] `url`: `string | HttpConnectionConfig` — Base URL for all requests. Can be a URL string or a connection configuration object. - [readonly] `headers?`: `HeadersInit` — Default headers for all requests - [readonly] `fetch?`: `fetch` — Custom fetch implementation (for testing/mocking) - [readonly] `redirect?`: `RedirectMode` — Default redirect handling mode. Can be overridden per-request via HttpOptions. - [readonly] `throwOnError?`: `boolean` — Whether to throw HttpError for non-2xx responses. Can be overridden per-request via HttpOptions. - [readonly] `cookies?`: `CookieConfig` — Cookie handling configuration. By default, the client maintains a cookie jar for automatic cookie management across requests. Set `cookies: { disabled: true }` to disable. --- ### `HttpClient` ```typescript interface HttpClient extends AsyncDisposable ``` HTTP client interface. **Properties:** - [readonly] `config`: `HttpClientConfig` — Client configuration **Methods:** ```typescript get(path: string, options?: HttpOptions): Promise ``` Send GET request ```typescript head(path: string, options?: HttpOptions): Promise ``` Send HEAD request ```typescript post(path: string, options?: HttpRequestOptions): Promise ``` Send POST request ```typescript put(path: string, options?: HttpRequestOptions): Promise ``` Send PUT request ```typescript patch(path: string, options?: HttpRequestOptions): Promise ``` Send PATCH request ```typescript delete(path: string, options?: HttpRequestOptions): Promise ``` Send DELETE request ```typescript options(path: string, options?: HttpOptions): Promise ``` Send OPTIONS request ```typescript request( method: string, path: string, options?: HttpRequestOptions, ): Promise ``` Send request with arbitrary method ```typescript getCookies(): Record ``` Get all cookies in the cookie jar. Returns empty object if cookies are disabled. ```typescript setCookie(name: string, value: string): void ``` Set a cookie in the cookie jar. ```typescript clearCookies(): void ``` Clear all cookies from the cookie jar. No-op if cookies are disabled. ```typescript close(): Promise ``` Close the client and release resources --- ### `HttpErrorOptions` ```typescript interface HttpErrorOptions extends ErrorOptions ``` Options for creating an HttpError. **Properties:** - [readonly] `body?`: `Uint8Array | null` — Response body as raw bytes - [readonly] `headers?`: `Headers | null` — Response headers --- ### `GraphqlResponseExpectation` ```typescript interface GraphqlResponseExpectation ``` Fluent API for GraphQL response validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the response is successful (no errors). ```typescript toHaveStatus(expected: unknown): this ``` Asserts that the status equals the expected value. ```typescript toHaveStatusEqual(expected: unknown): this ``` Asserts that the status equals the expected value using deep equality. ```typescript toHaveStatusStrictEqual(expected: unknown): this ``` Asserts that the status strictly equals the expected value. ```typescript toHaveStatusSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the status satisfies the provided matcher function. ```typescript toHaveStatusNaN(): this ``` Asserts that the status is NaN. ```typescript toHaveStatusGreaterThan(expected: number): this ``` Asserts that the status is greater than the expected value. ```typescript toHaveStatusGreaterThanOrEqual(expected: number): this ``` Asserts that the status is greater than or equal to the expected value. ```typescript toHaveStatusLessThan(expected: number): this ``` Asserts that the status is less than the expected value. ```typescript toHaveStatusLessThanOrEqual(expected: number): this ``` Asserts that the status is less than or equal to the expected value. ```typescript toHaveStatusCloseTo(expected: number, numDigits?: number): this ``` Asserts that the status is close to the expected value. ```typescript toHaveStatusOneOf(values: unknown[]): this ``` Asserts that the status is one of the specified values. ```typescript toHaveHeaders(expected: unknown): this ``` Asserts that the headers equal the expected value. ```typescript toHaveHeadersEqual(expected: unknown): this ``` Asserts that the headers equal the expected value using deep equality. ```typescript toHaveHeadersStrictEqual(expected: unknown): this ``` Asserts that the headers strictly equal the expected value. ```typescript toHaveHeadersSatisfying(matcher: (value: GraphqlHeaders) => unknown): this ``` Asserts that the headers satisfy the provided matcher function. ```typescript toHaveHeadersMatching( subset: Record | Record[], ): this ``` Asserts that the headers match the specified subset. ```typescript toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the headers have the specified property. ```typescript toHaveHeadersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the headers property contains the expected value. ```typescript toHaveHeadersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the headers property matches the specified subset. ```typescript toHaveHeadersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the headers property satisfies the provided matcher function. ```typescript toHaveError(expected: unknown): this ``` Asserts that the error equals the expected value. ```typescript toHaveErrorEqual(expected: unknown): this ``` Asserts that the error equals the expected value using deep equality. ```typescript toHaveErrorStrictEqual(expected: unknown): this ``` Asserts that the error strictly equals the expected value. ```typescript toHaveErrorSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the error satisfies the provided matcher function. ```typescript toHaveErrorPresent(): this ``` Asserts that the error is present (not null or undefined). ```typescript toHaveErrorNull(): this ``` Asserts that the error is null. ```typescript toHaveErrorUndefined(): this ``` Asserts that the error is undefined. ```typescript toHaveErrorNullish(): this ``` Asserts that the error is nullish (null or undefined). ```typescript toHaveExtensions(expected: unknown): this ``` Asserts that the extensions equal the expected value. ```typescript toHaveExtensionsEqual(expected: unknown): this ``` Asserts that the extensions equal the expected value using deep equality. ```typescript toHaveExtensionsStrictEqual(expected: unknown): this ``` Asserts that the extensions strictly equal the expected value. ```typescript toHaveExtensionsSatisfying( matcher: (value: Record) => unknown, ): this ``` Asserts that the extensions satisfy the provided matcher function. ```typescript toHaveExtensionsMatching( subset: Record | Record[], ): this ``` Asserts that the extensions match the specified subset. ```typescript toHaveExtensionsProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the extensions have the specified property. ```typescript toHaveExtensionsPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the extensions property contains the expected value. ```typescript toHaveExtensionsPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the extensions property matches the specified subset. ```typescript toHaveExtensionsPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the extensions property satisfies the provided matcher function. ```typescript toHaveExtensionsPresent(): this ``` Asserts that the extensions are present (not null or undefined). ```typescript toHaveExtensionsNull(): this ``` Asserts that the extensions are null. ```typescript toHaveExtensionsUndefined(): this ``` Asserts that the extensions are undefined. ```typescript toHaveExtensionsNullish(): this ``` Asserts that the extensions are nullish (null or undefined). ```typescript toHaveData(expected: unknown): this ``` Asserts that the data equals the expected value. ```typescript toHaveDataEqual(expected: unknown): this ``` Asserts that the data equals the expected value using deep equality. ```typescript toHaveDataStrictEqual(expected: unknown): this ``` Asserts that the data strictly equals the expected value. ```typescript toHaveDataSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the data satisfies the provided matcher function. ```typescript toHaveDataMatching( subset: Record | Record[], ): this ``` Asserts that the data matches the specified subset. ```typescript toHaveDataProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the data has the specified property. ```typescript toHaveDataPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the data property contains the specified value. ```typescript toHaveDataPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the data property matches the specified subset. ```typescript toHaveDataPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the data property satisfies the provided matcher function. ```typescript toHaveDataPresent(): this ``` Asserts that the data is present (not null or undefined). ```typescript toHaveDataNull(): this ``` Asserts that the data is null. ```typescript toHaveDataUndefined(): this ``` Asserts that the data is undefined. ```typescript toHaveDataNullish(): this ``` Asserts that the data is nullish (null or undefined). ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `GraphqlErrorItem` ```typescript interface GraphqlErrorItem ``` GraphQL error item as per GraphQL specification. **Properties:** - [readonly] `message`: `string` — Error message - [readonly] `locations`: `readonly { line: number; column: number }[] | null` — Location(s) in the GraphQL document where the error occurred - [readonly] `path`: `readonly unknown[] | null` — Path to the field that caused the error - [readonly] `extensions`: `Record | null` — Additional error metadata --- ### `GraphqlResponseError` ```typescript interface GraphqlResponseError extends GraphqlResponseBase ``` GraphQL response with execution errors. Note: GraphQL allows partial success where both data and errors are present. Use data() to access any partial data. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `GraphqlExecutionError` - [readonly] `status`: `number` — HTTP status code. - [readonly] `headers`: `Headers` — HTTP response headers. - [readonly] `extensions`: `Record | null` — Response extensions. - [readonly] `raw`: `globalThis.Response` — Raw Web standard Response. - [readonly] `data`: `T | null` — Response data (null if no data, may be partial data with errors). --- ### `GraphqlResponseFailure` ```typescript interface GraphqlResponseFailure extends GraphqlResponseBase ``` Failed GraphQL request (network error, HTTP error, etc.). The request did not reach GraphQL processing. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `GraphqlFailureError` - [readonly] `extensions`: `null` — Response extensions (always null for failures). - [readonly] `status`: `null` — HTTP status code (null for network failures). - [readonly] `headers`: `null` — HTTP response headers (null for failures). - [readonly] `raw`: `null` — No raw response (request didn't reach server). - [readonly] `data`: `null` — No data (request didn't reach server). --- ### `GraphqlResponseSuccess` ```typescript interface GraphqlResponseSuccess extends GraphqlResponseBase ``` Successful GraphQL response (no errors). **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `status`: `number` — HTTP status code. - [readonly] `headers`: `Headers` — HTTP response headers. - [readonly] `extensions`: `Record | null` — Response extensions. - [readonly] `raw`: `globalThis.Response` — Raw Web standard Response. - [readonly] `data`: `T | null` — Response data (null if no data). --- ### `GraphqlOptions` ```typescript interface GraphqlOptions extends CommonOptions ``` Options for individual GraphQL requests. **Properties:** - [readonly] `headers?`: `HeadersInit` — Additional request headers - [readonly] `operationName?`: `string` — Operation name (for documents with multiple operations) - [readonly] `throwOnError?`: `boolean` — Whether to throw GraphqlError when response contains errors or request fails. --- ### `GraphqlConnectionConfig` ```typescript interface GraphqlConnectionConfig extends CommonConnectionConfig ``` GraphQL connection configuration. Extends CommonConnectionConfig with GraphQL-specific options. **Properties:** - [readonly] `protocol?`: `"http" | "https"` — Protocol to use. - [readonly] `path?`: `string` — GraphQL endpoint path. --- ### `GraphqlClientConfig` ```typescript interface GraphqlClientConfig extends CommonOptions ``` GraphQL client configuration. **Properties:** - [readonly] `url`: `string | GraphqlConnectionConfig` — GraphQL endpoint URL. Can be a URL string or a connection configuration object. - [readonly] `headers?`: `HeadersInit` — Default headers for all requests - [readonly] `wsEndpoint?`: `string` — WebSocket endpoint URL (for subscriptions) - [readonly] `fetch?`: `fetch` — Custom fetch implementation (for testing/mocking) - [readonly] `throwOnError?`: `boolean` — Whether to throw GraphqlError when response contains errors or request fails. Can be overridden per-request via GraphqlOptions. --- ### `GraphqlClient` ```typescript interface GraphqlClient extends AsyncDisposable ``` GraphQL client interface. **Properties:** - [readonly] `config`: `GraphqlClientConfig` — Client configuration **Methods:** ```typescript query>( query: string, variables?: TVariables, options?: GraphqlOptions, ): Promise> ``` Execute a GraphQL query ```typescript mutation>( mutation: string, variables?: TVariables, options?: GraphqlOptions, ): Promise> ``` Execute a GraphQL mutation ```typescript execute>( document: string, variables?: TVariables, options?: GraphqlOptions, ): Promise> ``` Execute a GraphQL document (query or mutation) ```typescript subscribe>( document: string, variables?: TVariables, options?: GraphqlOptions, ): AsyncIterable> ``` Subscribe to a GraphQL subscription via WebSocket ```typescript close(): Promise ``` Close the client and release resources --- ### `GraphqlResponseSuccessParams` ```typescript interface GraphqlResponseSuccessParams ``` Parameters for creating a successful GraphqlResponse. **Properties:** - [readonly] `url`: `string` - [readonly] `data`: `T | null` - [readonly] `extensions`: `Record | null` - [readonly] `duration`: `number` - [readonly] `status`: `number` - [readonly] `raw`: `globalThis.Response` --- ### `GraphqlResponseErrorParams` ```typescript interface GraphqlResponseErrorParams ``` Parameters for creating an error GraphqlResponse. **Properties:** - [readonly] `url`: `string` - [readonly] `data`: `T | null` - [readonly] `error`: `GraphqlExecutionError` - [readonly] `extensions`: `Record | null` - [readonly] `duration`: `number` - [readonly] `status`: `number` - [readonly] `raw`: `globalThis.Response` --- ### `GraphqlResponseFailureParams` ```typescript interface GraphqlResponseFailureParams ``` Parameters for creating a failure GraphqlResponse. **Properties:** - [readonly] `url`: `string` - [readonly] `error`: `GraphqlFailureError` - [readonly] `duration`: `number` --- ### `ConnectRpcResponseExpectation` ```typescript interface ConnectRpcResponseExpectation ``` Fluent assertion interface for ConnectRpcResponse. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the response is successful (code 0). ```typescript toHaveStatusCode(expected: unknown): this ``` Asserts that the code equals the expected value. ```typescript toHaveStatusCodeEqual(expected: unknown): this ``` Asserts that the code equals the expected value using deep equality. ```typescript toHaveStatusCodeStrictEqual(expected: unknown): this ``` Asserts that the code strictly equals the expected value. ```typescript toHaveStatusCodeSatisfying( matcher: (value: ConnectRpcStatusCode) => unknown, ): this ``` Asserts that the code satisfies the provided matcher function. ```typescript toHaveStatusCodeNaN(): this ``` Asserts that the code is NaN. ```typescript toHaveStatusCodeGreaterThan(expected: number): this ``` Asserts that the code is greater than the expected value. ```typescript toHaveStatusCodeGreaterThanOrEqual(expected: number): this ``` Asserts that the code is greater than or equal to the expected value. ```typescript toHaveStatusCodeLessThan(expected: number): this ``` Asserts that the code is less than the expected value. ```typescript toHaveStatusCodeLessThanOrEqual(expected: number): this ``` Asserts that the code is less than or equal to the expected value. ```typescript toHaveStatusCodeCloseTo(expected: number, numDigits?: number): this ``` Asserts that the code is close to the expected value. ```typescript toHaveStatusCodeOneOf(values: unknown[]): this ``` Asserts that the code is one of the specified values. ```typescript toHaveStatusMessage(expected: unknown): this ``` Asserts that the message equals the expected value. ```typescript toHaveStatusMessageEqual(expected: unknown): this ``` Asserts that the message equals the expected value using deep equality. ```typescript toHaveStatusMessageStrictEqual(expected: unknown): this ``` Asserts that the message strictly equals the expected value. ```typescript toHaveStatusMessageSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the message satisfies the provided matcher function. ```typescript toHaveStatusMessageContaining(substr: string): this ``` Asserts that the message contains the specified substring. ```typescript toHaveStatusMessageMatching(expected: RegExp): this ``` Asserts that the message matches the specified regular expression. ```typescript toHaveStatusMessagePresent(): this ``` Asserts that the message is present (not null or undefined). ```typescript toHaveStatusMessageNull(): this ``` Asserts that the message is null. ```typescript toHaveStatusMessageUndefined(): this ``` Asserts that the message is undefined. ```typescript toHaveStatusMessageNullish(): this ``` Asserts that the message is nullish (null or undefined). ```typescript toHaveHeaders(expected: unknown): this ``` Asserts that the headers equal the expected value. ```typescript toHaveHeadersEqual(expected: unknown): this ``` Asserts that the headers equal the expected value using deep equality. ```typescript toHaveHeadersStrictEqual(expected: unknown): this ``` Asserts that the headers strictly equal the expected value. ```typescript toHaveHeadersSatisfying(matcher: (value: ConnectRpcHeaders) => unknown): this ``` Asserts that the headers satisfy the provided matcher function. ```typescript toHaveHeadersMatching( subset: Record | Record[], ): this ``` Asserts that the headers match the specified subset. ```typescript toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the headers have the specified property. ```typescript toHaveHeadersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the headers property contains the expected value. ```typescript toHaveHeadersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the headers property matches the specified subset. ```typescript toHaveHeadersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the headers property satisfies the provided matcher function. ```typescript toHaveTrailers(expected: unknown): this ``` Asserts that the trailers equal the expected value. ```typescript toHaveTrailersEqual(expected: unknown): this ``` Asserts that the trailers equal the expected value using deep equality. ```typescript toHaveTrailersStrictEqual(expected: unknown): this ``` Asserts that the trailers strictly equal the expected value. ```typescript toHaveTrailersSatisfying(matcher: (value: ConnectRpcTrailers) => unknown): this ``` Asserts that the trailers satisfy the provided matcher function. ```typescript toHaveTrailersMatching( subset: Record | Record[], ): this ``` Asserts that the trailers match the specified subset. ```typescript toHaveTrailersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the trailers have the specified property. ```typescript toHaveTrailersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the trailers property contains the expected value. ```typescript toHaveTrailersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the trailers property matches the specified subset. ```typescript toHaveTrailersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the trailers property satisfies the provided matcher function. ```typescript toHaveData(expected: unknown): this ``` Asserts that the data equals the expected value. ```typescript toHaveDataEqual(expected: unknown): this ``` Asserts that the data equals the expected value using deep equality. ```typescript toHaveDataStrictEqual(expected: unknown): this ``` Asserts that the data strictly equals the expected value. ```typescript toHaveDataSatisfying( matcher: (value: Record | null) => unknown, ): this ``` Asserts that the data satisfies the provided matcher function. ```typescript toHaveDataPresent(): this ``` Asserts that the data is present (not null or undefined). ```typescript toHaveDataNull(): this ``` Asserts that the data is null. ```typescript toHaveDataUndefined(): this ``` Asserts that the data is undefined. ```typescript toHaveDataNullish(): this ``` Asserts that the data is nullish (null or undefined). ```typescript toHaveDataMatching( subset: Record | Record[], ): this ``` Asserts that the data matches the specified subset. ```typescript toHaveDataProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the data has the specified property. ```typescript toHaveDataPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the data property contains the expected value. ```typescript toHaveDataPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the data property matches the specified subset. ```typescript toHaveDataPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the data property satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `ConnectRpcResponseError` ```typescript interface ConnectRpcResponseError extends ConnectRpcResponseBase ``` ConnectRPC response with gRPC error (statusCode !== 0). The server processed the request but returned an error status. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `ConnectRpcError` - [readonly] `statusCode`: `ConnectRpcStatusCode` — gRPC status code (1-16). - [readonly] `statusMessage`: `string` — Status message describing the error. - [readonly] `headers`: `Headers` — Response headers. - [readonly] `trailers`: `Headers` — Response trailers (sent at end of RPC). - [readonly] `raw`: `ConnectError` — Raw ConnectError. - [readonly] `data`: `null` — No data for error responses. --- ### `ConnectRpcResponseFailure` ```typescript interface ConnectRpcResponseFailure extends ConnectRpcResponseBase ``` Failed ConnectRPC request (network error, connection refused, etc.). The request did not reach gRPC processing. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `ConnectRpcFailureError` - [readonly] `statusCode`: `null` — Status code (null for network failures). - [readonly] `statusMessage`: `null` — Status message (null for network failures). - [readonly] `headers`: `null` — Response headers (null for failures). - [readonly] `trailers`: `null` — Response trailers (null for failures). - [readonly] `raw`: `null` — No raw response (request didn't reach server). - [readonly] `data`: `null` — No data (request didn't reach server). --- ### `ConnectRpcResponseSuccess` ```typescript interface ConnectRpcResponseSuccess extends ConnectRpcResponseBase ``` Successful ConnectRPC response (statusCode === 0). **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `statusCode`: `0` — gRPC status code (always 0 for success). - [readonly] `statusMessage`: `null` — Status message (null for successful responses). - [readonly] `headers`: `Headers` — Response headers. - [readonly] `trailers`: `Headers` — Response trailers (sent at end of RPC). - [readonly] `raw`: `unknown` — Raw protobuf Message object. - [readonly] `data`: `T | null` — Response data as plain JavaScript object (JSON representation). --- ### `TlsConfig` ```typescript interface TlsConfig ``` TLS configuration for ConnectRPC connections. **Properties:** - [readonly] `rootCerts?`: `Uint8Array` — Root CA certificate (PEM format). - [readonly] `clientCert?`: `Uint8Array` — Client certificate (PEM format). - [readonly] `clientKey?`: `Uint8Array` — Client private key (PEM format). - [readonly] `insecure?`: `boolean` — Skip server certificate verification (use only for testing). --- ### `ConnectRpcConnectionConfig` ```typescript interface ConnectRpcConnectionConfig extends CommonConnectionConfig ``` ConnectRPC connection configuration. Extends CommonConnectionConfig with ConnectRPC-specific options. **Properties:** - [readonly] `protocol?`: `"http" | "https"` — Protocol to use. - [readonly] `path?`: `string` — Service path prefix. --- ### `ConnectRpcClientConfig` ```typescript interface ConnectRpcClientConfig extends CommonOptions ``` Configuration for creating a ConnectRPC client. **Properties:** - [readonly] `url`: `string | ConnectRpcConnectionConfig` — Server URL for ConnectRPC connections. Can be a URL string or a connection configuration object. - [readonly] `protocol?`: `ConnectProtocol` — Protocol to use. - [readonly] `httpVersion?`: `HttpVersion` — HTTP version to use. - [readonly] `tls?`: `TlsConfig` — TLS configuration. If not provided, uses insecure credentials. - [readonly] `metadata?`: `HeadersInit` — Default metadata to send with every request. - [readonly] `schema?`: `"reflection" | string | Uint8Array | FileDescriptorSet` — Schema resolution configuration. - "reflection": Use Server Reflection to discover services dynamically (default) - string: Path to FileDescriptorSet binary file (from `buf build --output set.binpb`) - Uint8Array: FileDescriptorSet binary data - FileDescriptorSet: Pre-parsed FileDescriptorSet message object - [readonly] `useBinaryFormat?`: `boolean` — Whether to use binary format for messages. - [readonly] `throwOnError?`: `boolean` — Whether to throw ConnectRpcError on non-OK responses (code !== 0) or failures. Can be overridden per-request via ConnectRpcOptions.throwOnError. --- ### `ConnectRpcOptions` ```typescript interface ConnectRpcOptions extends CommonOptions ``` Options for individual ConnectRPC calls. **Properties:** - [readonly] `metadata?`: `HeadersInit` — Metadata to send with the request. - [readonly] `throwOnError?`: `boolean` — Whether to throw ConnectRpcError on non-OK responses (code !== 0) or failures. Overrides ConnectRpcClientConfig.throwOnError. --- ### `ServiceInfo` ```typescript interface ServiceInfo ``` Service information from reflection. **Properties:** - [readonly] `name`: `string` — Fully qualified service name (e.g., "echo.EchoService") - [readonly] `file`: `string` — Proto file name --- ### `MethodInfo` ```typescript interface MethodInfo ``` Method information from reflection. **Properties:** - [readonly] `name`: `string` — Method name (e.g., "Echo") - [readonly] `localName`: `string` — Local name (camelCase) - [readonly] `kind`: `"unary" | "server_streaming" | "client_streaming" | "bidi_streaming"` — Method kind - [readonly] `inputType`: `string` — Input message type name - [readonly] `outputType`: `string` — Output message type name - [readonly] `idempotent`: `boolean` — Whether the method is idempotent --- ### `ServiceDetail` ```typescript interface ServiceDetail ``` Detailed service information. **Properties:** - [readonly] `name`: `string` — Service name - [readonly] `fullName`: `string` — Fully qualified service name - [readonly] `packageName`: `string` — Package name - [readonly] `protoFile`: `string` — Proto file name - [readonly] `methods`: `readonly MethodInfo[]` — All methods --- ### `ErrorDetail` ```typescript interface ErrorDetail ``` Rich error detail from google.rpc.Status. ConnectRPC errors can include structured details encoded in error responses. These details follow the google.protobuf.Any format with a type URL and value. **Properties:** - [readonly] `typeUrl`: `string` — Type URL identifying the error detail type. Common types include: - "type.googleapis.com/google.rpc.BadRequest" - "type.googleapis.com/google.rpc.DebugInfo" - "type.googleapis.com/google.rpc.RetryInfo" - "type.googleapis.com/google.rpc.QuotaFailure" - [readonly] `value`: `unknown` — Decoded error detail value. The structure depends on the typeUrl. --- ### `ConnectRpcErrorOptions` ```typescript interface ConnectRpcErrorOptions extends ErrorOptions ``` Options for ConnectRpcError construction. **Properties:** - [readonly] `metadata?`: `Headers | null` — Headers/metadata from the ConnectRPC response. - [readonly] `details?`: `readonly ErrorDetail[] | null` — Rich error details from google.rpc.Status. --- ### `ConnectRpcResponseSuccessParams` ```typescript interface ConnectRpcResponseSuccessParams ``` Parameters for creating a successful ConnectRpcResponse. **Properties:** - [readonly] `response`: `T | null` - [readonly] `schema`: `DescMessage | null` - [readonly] `headers`: `Headers` - [readonly] `trailers`: `Headers` - [readonly] `duration`: `number` --- ### `ConnectRpcResponseErrorParams` ```typescript interface ConnectRpcResponseErrorParams ``` Parameters for creating an error ConnectRpcResponse. **Properties:** - [readonly] `error`: `ConnectError` - [readonly] `rpcError`: `ConnectRpcError` - [readonly] `headers`: `Headers` - [readonly] `trailers`: `Headers` - [readonly] `duration`: `number` --- ### `ConnectRpcResponseFailureParams` ```typescript interface ConnectRpcResponseFailureParams ``` Parameters for creating a failure ConnectRpcResponse. **Properties:** - [readonly] `error`: `ConnectRpcFailureError` - [readonly] `duration`: `number` --- ### `ReflectionApi` ```typescript interface ReflectionApi ``` Reflection API for ConnectRPC client. Only available when client is created with schema: "reflection". **Properties:** - [readonly] `enabled`: `boolean` — Check if reflection is enabled. **Methods:** ```typescript listServices(): Promise ``` List all available services on the server. ```typescript getServiceInfo(serviceName: string): Promise ``` Get detailed information about a specific service. ```typescript listMethods(serviceName: string): Promise ``` Get methods for a specific service. ```typescript hasService(serviceName: string): Promise ``` Check if a service exists. --- ### `ConnectRpcClient` ```typescript interface ConnectRpcClient extends AsyncDisposable ``` ConnectRPC client interface. ## Field Name Conventions This client automatically handles field name conversion between protobuf and JavaScript: - **Request fields**: Accept both `snake_case` (protobuf style) and `camelCase` (JavaScript style) - **Response fields**: Converted to JavaScript conventions based on response type: - `response.data`: Plain JSON object with `camelCase` field names (no `$typeName`) - `response.raw`: Original protobuf Message object with all metadata (includes `$typeName`) **Properties:** - [readonly] `config`: `ConnectRpcClientConfig` — Client configuration - [readonly] `reflection`: `ReflectionApi` — Reflection API (only available when schema: "reflection") **Methods:** ```typescript call( serviceName: string, methodName: string, request: TRequest, options?: ConnectRpcOptions, ): Promise ``` Make a unary RPC call. ```typescript serverStream( serviceName: string, methodName: string, request: TRequest, options?: ConnectRpcOptions, ): AsyncIterable ``` Make a server streaming RPC call. ```typescript clientStream( serviceName: string, methodName: string, requests: AsyncIterable, options?: ConnectRpcOptions, ): Promise ``` Make a client streaming RPC call. ```typescript bidiStream( serviceName: string, methodName: string, requests: AsyncIterable, options?: ConnectRpcOptions, ): AsyncIterable ``` Make a bidirectional streaming RPC call. ```typescript close(): Promise ``` Close the client connection. **Example:** ```ts const client = createConnectRpcClient({ url: "http://localhost:50051" }); // Request: Both formats work await client.call("echo.Echo", "echoWithDelay", { message: "hello", delayMs: 100, // camelCase (recommended) // delay_ms: 100, // snake_case also works }); // Response: data is JSON, raw is protobuf Message const response = await client.call("echo.Echo", "echo", { message: "test" }); console.log(response.data); // { message: "test", metadata: {...} } console.log(response.raw); // { $typeName: "echo.EchoResponse", message: "test", ... } ``` --- ### `GrpcResponseExpectation` ```typescript interface GrpcResponseExpectation ``` Fluent expectation interface for gRPC responses. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the response is successful (code 0). ```typescript toHaveStatusCode(expected: unknown): this ``` Asserts that the code equals the expected value. ```typescript toHaveStatusCodeEqual(expected: unknown): this ``` Asserts that the code equals the expected value using deep equality. ```typescript toHaveStatusCodeStrictEqual(expected: unknown): this ``` Asserts that the code strictly equals the expected value. ```typescript toHaveStatusCodeSatisfying(matcher: (value: GrpcStatusCode) => unknown): this ``` Asserts that the code satisfies the provided matcher function. ```typescript toHaveStatusCodeNaN(): this ``` Asserts that the code is NaN. ```typescript toHaveStatusCodeGreaterThan(expected: number): this ``` Asserts that the code is greater than the expected value. ```typescript toHaveStatusCodeGreaterThanOrEqual(expected: number): this ``` Asserts that the code is greater than or equal to the expected value. ```typescript toHaveStatusCodeLessThan(expected: number): this ``` Asserts that the code is less than the expected value. ```typescript toHaveStatusCodeLessThanOrEqual(expected: number): this ``` Asserts that the code is less than or equal to the expected value. ```typescript toHaveStatusCodeCloseTo(expected: number, numDigits?: number): this ``` Asserts that the code is close to the expected value. ```typescript toHaveStatusCodeOneOf(values: unknown[]): this ``` Asserts that the code is one of the specified values. ```typescript toHaveStatusMessage(expected: unknown): this ``` Asserts that the message equals the expected value. ```typescript toHaveStatusMessageEqual(expected: unknown): this ``` Asserts that the message equals the expected value using deep equality. ```typescript toHaveStatusMessageStrictEqual(expected: unknown): this ``` Asserts that the message strictly equals the expected value. ```typescript toHaveStatusMessageSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the message satisfies the provided matcher function. ```typescript toHaveStatusMessageContaining(substr: string): this ``` Asserts that the message contains the specified substring. ```typescript toHaveStatusMessageMatching(expected: RegExp): this ``` Asserts that the message matches the specified regular expression. ```typescript toHaveStatusMessagePresent(): this ``` Asserts that the message is present (not null or undefined). ```typescript toHaveStatusMessageNull(): this ``` Asserts that the message is null. ```typescript toHaveStatusMessageUndefined(): this ``` Asserts that the message is undefined. ```typescript toHaveStatusMessageNullish(): this ``` Asserts that the message is nullish (null or undefined). ```typescript toHaveHeaders(expected: unknown): this ``` Asserts that the headers equal the expected value. ```typescript toHaveHeadersEqual(expected: unknown): this ``` Asserts that the headers equal the expected value using deep equality. ```typescript toHaveHeadersStrictEqual(expected: unknown): this ``` Asserts that the headers strictly equal the expected value. ```typescript toHaveHeadersSatisfying(matcher: (value: GrpcHeaders) => unknown): this ``` Asserts that the headers satisfy the provided matcher function. ```typescript toHaveHeadersMatching( subset: Record | Record[], ): this ``` Asserts that the headers match the specified subset. ```typescript toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the headers have the specified property. ```typescript toHaveHeadersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the headers property contains the expected value. ```typescript toHaveHeadersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the headers property matches the specified subset. ```typescript toHaveHeadersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the headers property satisfies the provided matcher function. ```typescript toHaveTrailers(expected: unknown): this ``` Asserts that the trailers equal the expected value. ```typescript toHaveTrailersEqual(expected: unknown): this ``` Asserts that the trailers equal the expected value using deep equality. ```typescript toHaveTrailersStrictEqual(expected: unknown): this ``` Asserts that the trailers strictly equal the expected value. ```typescript toHaveTrailersSatisfying(matcher: (value: GrpcTrailers) => unknown): this ``` Asserts that the trailers satisfy the provided matcher function. ```typescript toHaveTrailersMatching( subset: Record | Record[], ): this ``` Asserts that the trailers match the specified subset. ```typescript toHaveTrailersProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the trailers have the specified property. ```typescript toHaveTrailersPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the trailers property contains the expected value. ```typescript toHaveTrailersPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the trailers property matches the specified subset. ```typescript toHaveTrailersPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the trailers property satisfies the provided matcher function. ```typescript toHaveData(expected: unknown): this ``` Asserts that the data equals the expected value. ```typescript toHaveDataEqual(expected: unknown): this ``` Asserts that the data equals the expected value using deep equality. ```typescript toHaveDataStrictEqual(expected: unknown): this ``` Asserts that the data strictly equals the expected value. ```typescript toHaveDataSatisfying( matcher: (value: Record | null) => unknown, ): this ``` Asserts that the data satisfies the provided matcher function. ```typescript toHaveDataPresent(): this ``` Asserts that the data is present (not null or undefined). ```typescript toHaveDataNull(): this ``` Asserts that the data is null. ```typescript toHaveDataUndefined(): this ``` Asserts that the data is undefined. ```typescript toHaveDataNullish(): this ``` Asserts that the data is nullish (null or undefined). ```typescript toHaveDataMatching( subset: Record | Record[], ): this ``` Asserts that the data matches the specified subset. ```typescript toHaveDataProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the data has the specified property. ```typescript toHaveDataPropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the data property contains the expected value. ```typescript toHaveDataPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the data property matches the specified subset. ```typescript toHaveDataPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the data property satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `GrpcClientConfig` ```typescript interface GrpcClientConfig extends Omit ``` Configuration for creating a gRPC client. This is a subset of ConnectRpcClientConfig with protocol fixed to "grpc". --- ### `RedisArrayResultExpectation` ```typescript interface RedisArrayResultExpectation ``` Fluent API for Redis array result validation. Provides chainable assertions specifically designed for array-based results (e.g., LRANGE, SMEMBERS, KEYS operations). **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: RedisArrayValue) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValueContaining(item: unknown): this ``` Asserts that the value array contains the specified item. ```typescript toHaveValueContainingEqual(item: unknown): this ``` Asserts that the value array contains an item equal to the specified value. ```typescript toHaveValueMatching( subset: Record | Record[], ): this ``` Asserts that the value array matches the specified subset. ```typescript toHaveValueEmpty(): this ``` Asserts that the value array is empty. ```typescript toHaveValueCount(expected: unknown): this ``` Asserts that the value count equals the expected value. ```typescript toHaveValueCountEqual(expected: unknown): this ``` Asserts that the value count equals the expected value using deep equality. ```typescript toHaveValueCountStrictEqual(expected: unknown): this ``` Asserts that the value count strictly equals the expected value. ```typescript toHaveValueCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the value count satisfies the provided matcher function. ```typescript toHaveValueCountNaN(): this ``` Asserts that the value count is NaN. ```typescript toHaveValueCountGreaterThan(expected: number): this ``` Asserts that the value count is greater than the expected value. ```typescript toHaveValueCountGreaterThanOrEqual(expected: number): this ``` Asserts that the value count is greater than or equal to the expected value. ```typescript toHaveValueCountLessThan(expected: number): this ``` Asserts that the value count is less than the expected value. ```typescript toHaveValueCountLessThanOrEqual(expected: number): this ``` Asserts that the value count is less than or equal to the expected value. ```typescript toHaveValueCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the value count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisCommonResultExpectation` ```typescript interface RedisCommonResultExpectation ``` Fluent API for Redis common result validation. Provides chainable assertions for generic Redis operation results. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisCountResultExpectation` ```typescript interface RedisCountResultExpectation ``` Fluent API for Redis count result validation. Provides chainable assertions specifically designed for count-based results (e.g., DEL, LPUSH, SCARD operations). **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValueNaN(): this ``` Asserts that the value is NaN. ```typescript toHaveValueGreaterThan(expected: number): this ``` Asserts that the value is greater than the expected value. ```typescript toHaveValueGreaterThanOrEqual(expected: number): this ``` Asserts that the value is greater than or equal to the expected value. ```typescript toHaveValueLessThan(expected: number): this ``` Asserts that the value is less than the expected value. ```typescript toHaveValueLessThanOrEqual(expected: number): this ``` Asserts that the value is less than or equal to the expected value. ```typescript toHaveValueCloseTo(expected: number, numDigits?: number): this ``` Asserts that the value is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisGetResultExpectation` ```typescript interface RedisGetResultExpectation ``` Fluent API for Redis get result validation. Provides chainable assertions specifically designed for Redis GET operation results. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValueContaining(substr: string): this ``` Asserts that the value contains the specified substring. ```typescript toHaveValueMatching(expected: RegExp): this ``` Asserts that the value matches the specified regular expression. ```typescript toHaveValuePresent(): this ``` Asserts that the value is present (not null or undefined). ```typescript toHaveValueNull(): this ``` Asserts that the value is null. ```typescript toHaveValueUndefined(): this ``` Asserts that the value is undefined. ```typescript toHaveValueNullish(): this ``` Asserts that the value is nullish (null or undefined). ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisHashResultExpectation` ```typescript interface RedisHashResultExpectation ``` Fluent API for Redis hash result validation. Provides chainable assertions specifically designed for hash-based results (e.g., HGETALL, HMGET operations). **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValueMatching( subset: Record | Record[], ): this ``` Asserts that the value matches the specified subset. ```typescript toHaveValueProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the value has the specified property. ```typescript toHaveValuePropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the value property contains the expected value. ```typescript toHaveValuePropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the value property matches the specified subset. ```typescript toHaveValuePropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the value property satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisSetResultExpectation` ```typescript interface RedisSetResultExpectation ``` Fluent API for Redis set result validation. Provides chainable assertions specifically designed for Redis SET operation results. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: RedisSetValue) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValueContaining(substr: string): this ``` Asserts that the value contains the specified substring. ```typescript toHaveValueMatching(expected: RegExp): this ``` Asserts that the value matches the specified regular expression. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RedisCommandOptions` ```typescript interface RedisCommandOptions extends CommonOptions ``` Redis command options. Extends CommonOptions with Redis-specific behavior options. **Properties:** - [readonly] `throwOnError?`: `boolean` — Whether to throw an error when the operation fails. When `true`, failures will throw an error instead of returning a result with `ok: false`. --- ### `RedisSetOptions` ```typescript interface RedisSetOptions extends RedisCommandOptions ``` Redis SET options **Properties:** - [readonly] `ex?`: `number` — Expiration in seconds - [readonly] `px?`: `number` — Expiration in milliseconds - [readonly] `nx?`: `boolean` — Only set if key does not exist - [readonly] `xx?`: `boolean` — Only set if key exists --- ### `RedisMessage` ```typescript interface RedisMessage ``` Redis Pub/Sub message **Properties:** - [readonly] `channel`: `string` - [readonly] `message`: `string` --- ### `RedisConnectionConfig` ```typescript interface RedisConnectionConfig extends CommonConnectionConfig ``` Redis connection configuration. Extends CommonConnectionConfig with Redis-specific options. **Properties:** - [readonly] `db?`: `number` — Database index. --- ### `RedisClientConfig` ```typescript interface RedisClientConfig extends CommonOptions ``` Redis client configuration. **Properties:** - [readonly] `url`: `string | RedisConnectionConfig` — Redis connection URL or configuration object. - [readonly] `throwOnError?`: `boolean` — Whether to throw an error when operations fail. When `true`, failures will throw an error instead of returning a result with `ok: false`. This can be overridden per-command. --- ### `RedisTransaction` ```typescript interface RedisTransaction ``` Redis transaction interface **Methods:** ```typescript get(key: string): this ``` ```typescript set(key: string, value: string, options?: RedisSetOptions): this ``` ```typescript del(_: string[]): this ``` ```typescript incr(key: string): this ``` ```typescript decr(key: string): this ``` ```typescript hget(key: string, field: string): this ``` ```typescript hset(key: string, field: string, value: string): this ``` ```typescript hgetall(key: string): this ``` ```typescript hdel(key: string, _: string[]): this ``` ```typescript lpush(key: string, _: string[]): this ``` ```typescript rpush(key: string, _: string[]): this ``` ```typescript lpop(key: string): this ``` ```typescript rpop(key: string): this ``` ```typescript lrange(key: string, start: number, stop: number): this ``` ```typescript llen(key: string): this ``` ```typescript sadd(key: string, _: string[]): this ``` ```typescript srem(key: string, _: string[]): this ``` ```typescript smembers(key: string): this ``` ```typescript sismember(key: string, member: string): this ``` ```typescript zadd(key: string, _: { score: number; member: string }[]): this ``` ```typescript zrange(key: string, start: number, stop: number): this ``` ```typescript zscore(key: string, member: string): this ``` ```typescript exec(options?: RedisCommandOptions): Promise> ``` ```typescript discard(): void ``` --- ### `RedisClient` ```typescript interface RedisClient extends AsyncDisposable ``` Redis client interface **Properties:** - [readonly] `config`: `RedisClientConfig` **Methods:** ```typescript get(key: string, options?: RedisCommandOptions): Promise ``` ```typescript set( key: string, value: string, options?: RedisSetOptions, ): Promise ``` ```typescript del(keys: string[], options?: RedisCommandOptions): Promise ``` ```typescript incr(key: string, options?: RedisCommandOptions): Promise ``` ```typescript decr(key: string, options?: RedisCommandOptions): Promise ``` ```typescript hget( key: string, field: string, options?: RedisCommandOptions, ): Promise ``` ```typescript hset( key: string, field: string, value: string, options?: RedisCommandOptions, ): Promise ``` ```typescript hgetall(key: string, options?: RedisCommandOptions): Promise ``` ```typescript hdel( key: string, fields: string[], options?: RedisCommandOptions, ): Promise ``` ```typescript lpush( key: string, values: string[], options?: RedisCommandOptions, ): Promise ``` ```typescript rpush( key: string, values: string[], options?: RedisCommandOptions, ): Promise ``` ```typescript lpop(key: string, options?: RedisCommandOptions): Promise ``` ```typescript rpop(key: string, options?: RedisCommandOptions): Promise ``` ```typescript lrange( key: string, start: number, stop: number, options?: RedisCommandOptions, ): Promise ``` ```typescript llen(key: string, options?: RedisCommandOptions): Promise ``` ```typescript sadd( key: string, members: string[], options?: RedisCommandOptions, ): Promise ``` ```typescript srem( key: string, members: string[], options?: RedisCommandOptions, ): Promise ``` ```typescript smembers(key: string, options?: RedisCommandOptions): Promise ``` ```typescript sismember( key: string, member: string, options?: RedisCommandOptions, ): Promise> ``` ```typescript zadd( key: string, entries: { score: number; member: string }[], options?: RedisCommandOptions, ): Promise ``` ```typescript zrange( key: string, start: number, stop: number, options?: RedisCommandOptions, ): Promise ``` ```typescript zscore( key: string, member: string, options?: RedisCommandOptions, ): Promise> ``` ```typescript publish( channel: string, message: string, options?: RedisCommandOptions, ): Promise ``` ```typescript subscribe(channel: string): AsyncIterable ``` ```typescript multi(): RedisTransaction ``` ```typescript command( cmd: string, args: unknown[], options?: RedisCommandOptions, ): Promise> ``` ```typescript close(): Promise ``` --- ### `RedisGetResultSuccess` ```typescript interface RedisGetResultSuccess extends RedisGetResultBase ``` Successful GET result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `string | null` --- ### `RedisGetResultError` ```typescript interface RedisGetResultError extends RedisGetResultBase ``` GET result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisGetResultFailure` ```typescript interface RedisGetResultFailure extends RedisGetResultBase ``` GET result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisSetResultSuccess` ```typescript interface RedisSetResultSuccess extends RedisSetResultBase ``` Successful SET result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `"OK"` --- ### `RedisSetResultError` ```typescript interface RedisSetResultError extends RedisSetResultBase ``` SET result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisSetResultFailure` ```typescript interface RedisSetResultFailure extends RedisSetResultBase ``` SET result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisCountResultSuccess` ```typescript interface RedisCountResultSuccess extends RedisCountResultBase ``` Successful count result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `number` --- ### `RedisCountResultError` ```typescript interface RedisCountResultError extends RedisCountResultBase ``` Count result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisCountResultFailure` ```typescript interface RedisCountResultFailure extends RedisCountResultBase ``` Count result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisArrayResultSuccess` ```typescript interface RedisArrayResultSuccess extends RedisArrayResultBase ``` Successful array result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `readonly T[]` --- ### `RedisArrayResultError` ```typescript interface RedisArrayResultError extends RedisArrayResultBase ``` Array result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisArrayResultFailure` ```typescript interface RedisArrayResultFailure extends RedisArrayResultBase ``` Array result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisHashResultSuccess` ```typescript interface RedisHashResultSuccess extends RedisHashResultBase ``` Successful hash result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `Record` --- ### `RedisHashResultError` ```typescript interface RedisHashResultError extends RedisHashResultBase ``` Hash result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisHashResultFailure` ```typescript interface RedisHashResultFailure extends RedisHashResultBase ``` Hash result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisCommonResultSuccess` ```typescript interface RedisCommonResultSuccess extends RedisCommonResultBase ``` Successful common result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `value`: `T` --- ### `RedisCommonResultError` ```typescript interface RedisCommonResultError extends RedisCommonResultBase ``` Common result with Redis error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RedisOperationError` - [readonly] `value`: `null` --- ### `RedisCommonResultFailure` ```typescript interface RedisCommonResultFailure extends RedisCommonResultBase ``` Common result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RedisFailureError` - [readonly] `value`: `null` --- ### `RedisErrorOptions` ```typescript interface RedisErrorOptions extends ErrorOptions ``` Options for Redis errors. **Properties:** - [readonly] `code?`: `string` --- ### `RedisCommandErrorOptions` ```typescript interface RedisCommandErrorOptions extends RedisErrorOptions ``` Options for Redis command errors. **Properties:** - [readonly] `command`: `string` --- ### `RedisScriptErrorOptions` ```typescript interface RedisScriptErrorOptions extends RedisErrorOptions ``` Options for Redis script errors. **Properties:** - [readonly] `script`: `string` --- ### `MongoCountResultExpectation` ```typescript interface MongoCountResultExpectation ``` Fluent API for MongoDB count result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the count result is successful. ```typescript toHaveCount(expected: unknown): this ``` Asserts that the count equals the expected value. ```typescript toHaveCountEqual(expected: unknown): this ``` Asserts that the count equals the expected value using deep equality. ```typescript toHaveCountStrictEqual(expected: unknown): this ``` Asserts that the count strictly equals the expected value. ```typescript toHaveCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the count satisfies the provided matcher function. ```typescript toHaveCountNaN(): this ``` Asserts that the count is NaN. ```typescript toHaveCountGreaterThan(expected: number): this ``` Asserts that the count is greater than the expected value. ```typescript toHaveCountGreaterThanOrEqual(expected: number): this ``` Asserts that the count is greater than or equal to the expected value. ```typescript toHaveCountLessThan(expected: number): this ``` Asserts that the count is less than the expected value. ```typescript toHaveCountLessThanOrEqual(expected: number): this ``` Asserts that the count is less than or equal to the expected value. ```typescript toHaveCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoDeleteResultExpectation` ```typescript interface MongoDeleteResultExpectation ``` Fluent API for MongoDB delete result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the delete result is successful. ```typescript toHaveDeletedCount(expected: unknown): this ``` Asserts that the deleted count equals the expected value. ```typescript toHaveDeletedCountEqual(expected: unknown): this ``` Asserts that the deleted count equals the expected value using deep equality. ```typescript toHaveDeletedCountStrictEqual(expected: unknown): this ``` Asserts that the deleted count strictly equals the expected value. ```typescript toHaveDeletedCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the deleted count satisfies the provided matcher function. ```typescript toHaveDeletedCountNaN(): this ``` Asserts that the deleted count is NaN. ```typescript toHaveDeletedCountGreaterThan(expected: number): this ``` Asserts that the deleted count is greater than the expected value. ```typescript toHaveDeletedCountGreaterThanOrEqual(expected: number): this ``` Asserts that the deleted count is greater than or equal to the expected value. ```typescript toHaveDeletedCountLessThan(expected: number): this ``` Asserts that the deleted count is less than the expected value. ```typescript toHaveDeletedCountLessThanOrEqual(expected: number): this ``` Asserts that the deleted count is less than or equal to the expected value. ```typescript toHaveDeletedCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the deleted count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoFindOneResultExpectation` ```typescript interface MongoFindOneResultExpectation<_T = unknown> ``` Fluent API for MongoDB findOne result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the findOne result is successful. ```typescript toHaveDoc(expected: unknown): this ``` Asserts that the doc equals the expected value. ```typescript toHaveDocEqual(expected: unknown): this ``` Asserts that the doc equals the expected value using deep equality. ```typescript toHaveDocStrictEqual(expected: unknown): this ``` Asserts that the doc strictly equals the expected value. ```typescript toHaveDocSatisfying(matcher: (value: MongoFindOneDoc<_T>) => unknown): this ``` Asserts that the doc satisfies the provided matcher function. ```typescript toHaveDocPresent(): this ``` Asserts that the doc is present (not null or undefined). ```typescript toHaveDocNull(): this ``` Asserts that the doc is null. ```typescript toHaveDocUndefined(): this ``` Asserts that the doc is undefined. ```typescript toHaveDocNullish(): this ``` Asserts that the doc is nullish (null or undefined). ```typescript toHaveDocMatching( subset: Record | Record[], ): this ``` Asserts that the doc matches the specified subset. ```typescript toHaveDocProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the doc has the specified property. ```typescript toHaveDocPropertyContaining(keyPath: string | string[], expected: unknown): this ``` Asserts that the doc property contains the expected value. ```typescript toHaveDocPropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the doc property matches the specified subset. ```typescript toHaveDocPropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the doc property satisfies the provided matcher function. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoFindResultExpectation` ```typescript interface MongoFindResultExpectation<_T = unknown> ``` Fluent API for MongoDB find result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the find result is successful. ```typescript toHaveDocs(expected: unknown): this ``` Asserts that the docs equal the expected value. ```typescript toHaveDocsEqual(expected: unknown): this ``` Asserts that the docs equal the expected value using deep equality. ```typescript toHaveDocsStrictEqual(expected: unknown): this ``` Asserts that the docs strictly equal the expected value. ```typescript toHaveDocsSatisfying(matcher: (value: MongoFindDocs<_T>) => unknown): this ``` Asserts that the docs satisfy the provided matcher function. ```typescript toHaveDocsContaining(item: unknown): this ``` Asserts that the docs array contains the specified item. ```typescript toHaveDocsContainingEqual(item: unknown): this ``` Asserts that the docs array contains an item equal to the specified value. ```typescript toHaveDocsMatching( subset: Record | Record[], ): this ``` Asserts that the docs array matches the specified subset. ```typescript toHaveDocsEmpty(): this ``` Asserts that the docs array is empty. ```typescript toHaveDocsCount(expected: unknown): this ``` Asserts that the docs count equals the expected value. ```typescript toHaveDocsCountEqual(expected: unknown): this ``` Asserts that the docs count equals the expected value using deep equality. ```typescript toHaveDocsCountStrictEqual(expected: unknown): this ``` Asserts that the docs count strictly equals the expected value. ```typescript toHaveDocsCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the docs count satisfies the provided matcher function. ```typescript toHaveDocsCountNaN(): this ``` Asserts that the docs count is NaN. ```typescript toHaveDocsCountGreaterThan(expected: number): this ``` Asserts that the docs count is greater than the expected value. ```typescript toHaveDocsCountGreaterThanOrEqual(expected: number): this ``` Asserts that the docs count is greater than or equal to the expected value. ```typescript toHaveDocsCountLessThan(expected: number): this ``` Asserts that the docs count is less than the expected value. ```typescript toHaveDocsCountLessThanOrEqual(expected: number): this ``` Asserts that the docs count is less than or equal to the expected value. ```typescript toHaveDocsCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the docs count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoInsertManyResultExpectation` ```typescript interface MongoInsertManyResultExpectation ``` Fluent API for MongoDB insertMany result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the insert result is successful. ```typescript toHaveInsertedIds(expected: unknown): this ``` Asserts that the inserted IDs equal the expected value. ```typescript toHaveInsertedIdsEqual(expected: unknown): this ``` Asserts that the inserted IDs equal the expected value using deep equality. ```typescript toHaveInsertedIdsStrictEqual(expected: unknown): this ``` Asserts that the inserted IDs strictly equal the expected value. ```typescript toHaveInsertedIdsSatisfying(matcher: (value: string[]) => unknown): this ``` Asserts that the inserted IDs satisfy the provided matcher function. ```typescript toHaveInsertedIdsContaining(item: unknown): this ``` Asserts that the inserted IDs array contains the specified item. ```typescript toHaveInsertedIdsContainingEqual(item: unknown): this ``` Asserts that the inserted IDs array contains an item equal to the specified value. ```typescript toHaveInsertedIdsMatching( subset: Record | Record[], ): this ``` Asserts that the inserted IDs array matches the specified subset. ```typescript toHaveInsertedIdsEmpty(): this ``` Asserts that the inserted IDs array is empty. ```typescript toHaveInsertedCount(expected: unknown): this ``` Asserts that the inserted count equals the expected value. ```typescript toHaveInsertedCountEqual(expected: unknown): this ``` Asserts that the inserted count equals the expected value using deep equality. ```typescript toHaveInsertedCountStrictEqual(expected: unknown): this ``` Asserts that the inserted count strictly equals the expected value. ```typescript toHaveInsertedCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the inserted count satisfies the provided matcher function. ```typescript toHaveInsertedCountNaN(): this ``` Asserts that the inserted count is NaN. ```typescript toHaveInsertedCountGreaterThan(expected: number): this ``` Asserts that the inserted count is greater than the expected value. ```typescript toHaveInsertedCountGreaterThanOrEqual(expected: number): this ``` Asserts that the inserted count is greater than or equal to the expected value. ```typescript toHaveInsertedCountLessThan(expected: number): this ``` Asserts that the inserted count is less than the expected value. ```typescript toHaveInsertedCountLessThanOrEqual(expected: number): this ``` Asserts that the inserted count is less than or equal to the expected value. ```typescript toHaveInsertedCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the inserted count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoInsertOneResultExpectation` ```typescript interface MongoInsertOneResultExpectation ``` Fluent API for MongoDB insertOne result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the insert result is successful. ```typescript toHaveInsertedId(expected: unknown): this ``` Asserts that the inserted ID equals the expected value. ```typescript toHaveInsertedIdEqual(expected: unknown): this ``` Asserts that the inserted ID equals the expected value using deep equality. ```typescript toHaveInsertedIdStrictEqual(expected: unknown): this ``` Asserts that the inserted ID strictly equals the expected value. ```typescript toHaveInsertedIdSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the inserted ID satisfies the provided matcher function. ```typescript toHaveInsertedIdContaining(substr: string): this ``` Asserts that the inserted ID contains the specified substring. ```typescript toHaveInsertedIdMatching(expected: RegExp): this ``` Asserts that the inserted ID matches the specified regular expression. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoUpdateResultExpectation` ```typescript interface MongoUpdateResultExpectation ``` Fluent API for MongoDB update result validation. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the update result is successful. ```typescript toHaveMatchedCount(expected: unknown): this ``` Asserts that the matched count equals the expected value. ```typescript toHaveMatchedCountEqual(expected: unknown): this ``` Asserts that the matched count equals the expected value using deep equality. ```typescript toHaveMatchedCountStrictEqual(expected: unknown): this ``` Asserts that the matched count strictly equals the expected value. ```typescript toHaveMatchedCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the matched count satisfies the provided matcher function. ```typescript toHaveMatchedCountNaN(): this ``` Asserts that the matched count is NaN. ```typescript toHaveMatchedCountGreaterThan(expected: number): this ``` Asserts that the matched count is greater than the expected value. ```typescript toHaveMatchedCountGreaterThanOrEqual(expected: number): this ``` Asserts that the matched count is greater than or equal to the expected value. ```typescript toHaveMatchedCountLessThan(expected: number): this ``` Asserts that the matched count is less than the expected value. ```typescript toHaveMatchedCountLessThanOrEqual(expected: number): this ``` Asserts that the matched count is less than or equal to the expected value. ```typescript toHaveMatchedCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the matched count is close to the expected value. ```typescript toHaveModifiedCount(expected: unknown): this ``` Asserts that the modified count equals the expected value. ```typescript toHaveModifiedCountEqual(expected: unknown): this ``` Asserts that the modified count equals the expected value using deep equality. ```typescript toHaveModifiedCountStrictEqual(expected: unknown): this ``` Asserts that the modified count strictly equals the expected value. ```typescript toHaveModifiedCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the modified count satisfies the provided matcher function. ```typescript toHaveModifiedCountNaN(): this ``` Asserts that the modified count is NaN. ```typescript toHaveModifiedCountGreaterThan(expected: number): this ``` Asserts that the modified count is greater than the expected value. ```typescript toHaveModifiedCountGreaterThanOrEqual(expected: number): this ``` Asserts that the modified count is greater than or equal to the expected value. ```typescript toHaveModifiedCountLessThan(expected: number): this ``` Asserts that the modified count is less than the expected value. ```typescript toHaveModifiedCountLessThanOrEqual(expected: number): this ``` Asserts that the modified count is less than or equal to the expected value. ```typescript toHaveModifiedCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the modified count is close to the expected value. ```typescript toHaveUpsertedId(expected: unknown): this ``` Asserts that the upserted ID equals the expected value. ```typescript toHaveUpsertedIdEqual(expected: unknown): this ``` Asserts that the upserted ID equals the expected value using deep equality. ```typescript toHaveUpsertedIdStrictEqual(expected: unknown): this ``` Asserts that the upserted ID strictly equals the expected value. ```typescript toHaveUpsertedIdSatisfying(matcher: (value: MongoUpsertedId) => unknown): this ``` Asserts that the upserted ID satisfies the provided matcher function. ```typescript toHaveUpsertedIdPresent(): this ``` Asserts that the upserted ID is present (not null or undefined). ```typescript toHaveUpsertedIdNull(): this ``` Asserts that the upserted ID is null. ```typescript toHaveUpsertedIdUndefined(): this ``` Asserts that the upserted ID is undefined. ```typescript toHaveUpsertedIdNullish(): this ``` Asserts that the upserted ID is nullish (null or undefined). ```typescript toHaveUpsertedIdContaining(substr: string): this ``` Asserts that the upserted ID contains the specified substring. ```typescript toHaveUpsertedIdMatching(expected: RegExp): this ``` Asserts that the upserted ID matches the specified regular expression. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `MongoOptions` ```typescript interface MongoOptions extends CommonOptions ``` Common options with throwOnError support. **Properties:** - [readonly] `throwOnError?`: `boolean` — If true, throws errors instead of returning them in the result. If false (default), errors are returned in the result object. --- ### `MongoConnectionConfig` ```typescript interface MongoConnectionConfig extends CommonConnectionConfig ``` MongoDB connection configuration. Extends CommonConnectionConfig with MongoDB-specific options. **Properties:** - [readonly] `database?`: `string` — Database name to connect to. - [readonly] `authSource?`: `string` — Authentication database. - [readonly] `replicaSet?`: `string` — Replica set name. --- ### `MongoFindOptions` ```typescript interface MongoFindOptions extends MongoOptions ``` MongoDB find options **Properties:** - [readonly] `sort?`: `Record` - [readonly] `limit?`: `number` - [readonly] `skip?`: `number` - [readonly] `projection?`: `Record` --- ### `MongoUpdateOptions` ```typescript interface MongoUpdateOptions extends MongoOptions ``` MongoDB update options **Properties:** - [readonly] `upsert?`: `boolean` --- ### `MongoClientConfig` ```typescript interface MongoClientConfig extends MongoOptions ``` MongoDB client configuration. **Properties:** - [readonly] `url`: `string | MongoConnectionConfig` — MongoDB connection URL or configuration object. - [readonly] `database`: `string` — Database name to connect to. **Example:** Using a connection string ```ts const config: MongoClientConfig = { url: "mongodb://localhost:27017", database: "testdb", }; ``` Using a configuration object ```ts const config: MongoClientConfig = { url: { host: "localhost", port: 27017, username: "admin", password: "secret", authSource: "admin", }, database: "testdb", }; ``` --- ### `MongoSession` ```typescript interface MongoSession ``` MongoDB session interface (for transactions) **Methods:** ```typescript collection(name: string): MongoCollection ``` --- ### `MongoCollection` ```typescript interface MongoCollection ``` MongoDB collection interface **Methods:** ```typescript find(filter?: Filter, options?: MongoFindOptions): Promise> ``` ```typescript findOne(filter: Filter, options?: MongoOptions): Promise> ``` ```typescript insertOne( doc: Omit, options?: MongoOptions, ): Promise ``` ```typescript insertMany( docs: Omit[], options?: MongoOptions, ): Promise ``` ```typescript updateOne( filter: Filter, update: UpdateFilter, options?: MongoUpdateOptions, ): Promise ``` ```typescript updateMany( filter: Filter, update: UpdateFilter, options?: MongoUpdateOptions, ): Promise ``` ```typescript deleteOne(filter: Filter, options?: MongoOptions): Promise ``` ```typescript deleteMany(filter: Filter, options?: MongoOptions): Promise ``` ```typescript aggregate( pipeline: Document[], options?: MongoOptions, ): Promise> ``` ```typescript countDocuments( filter?: Filter, options?: MongoOptions, ): Promise ``` --- ### `MongoClient` ```typescript interface MongoClient extends AsyncDisposable ``` MongoDB client interface **Properties:** - [readonly] `config`: `MongoClientConfig` **Methods:** ```typescript collection(name: string): MongoCollection ``` ```typescript db(name: string): MongoClient ``` ```typescript transaction(fn: (session: MongoSession) => unknown): Promise ``` ```typescript close(): Promise ``` --- ### `MongoErrorOptions` ```typescript interface MongoErrorOptions extends ErrorOptions ``` Options for MongoDB errors. **Properties:** - [readonly] `code?`: `number` --- ### `MongoFindResultSuccess` ```typescript interface MongoFindResultSuccess extends MongoFindResultBase ``` Successful find result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `docs`: `readonly T[]` --- ### `MongoFindResultError` ```typescript interface MongoFindResultError extends MongoFindResultBase ``` Find result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `docs`: `readonly T[]` --- ### `MongoFindResultFailure` ```typescript interface MongoFindResultFailure extends MongoFindResultBase ``` Find result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `docs`: `null` --- ### `MongoFindOneResultSuccess` ```typescript interface MongoFindOneResultSuccess extends MongoFindOneResultBase ``` Successful findOne result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `doc`: `T | null` --- ### `MongoFindOneResultError` ```typescript interface MongoFindOneResultError extends MongoFindOneResultBase ``` FindOne result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `doc`: `null` --- ### `MongoFindOneResultFailure` ```typescript interface MongoFindOneResultFailure extends MongoFindOneResultBase ``` FindOne result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `doc`: `null` --- ### `MongoInsertOneResultSuccess` ```typescript interface MongoInsertOneResultSuccess extends MongoInsertOneResultBase ``` Successful insertOne result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `insertedId`: `string` --- ### `MongoInsertOneResultError` ```typescript interface MongoInsertOneResultError extends MongoInsertOneResultBase ``` InsertOne result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `insertedId`: `null` --- ### `MongoInsertOneResultFailure` ```typescript interface MongoInsertOneResultFailure extends MongoInsertOneResultBase ``` InsertOne result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `insertedId`: `null` --- ### `MongoInsertManyResultSuccess` ```typescript interface MongoInsertManyResultSuccess extends MongoInsertManyResultBase ``` Successful insertMany result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `insertedIds`: `readonly string[]` - [readonly] `insertedCount`: `number` --- ### `MongoInsertManyResultError` ```typescript interface MongoInsertManyResultError extends MongoInsertManyResultBase ``` InsertMany result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `insertedIds`: `null` - [readonly] `insertedCount`: `null` --- ### `MongoInsertManyResultFailure` ```typescript interface MongoInsertManyResultFailure extends MongoInsertManyResultBase ``` InsertMany result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `insertedIds`: `null` - [readonly] `insertedCount`: `null` --- ### `MongoUpdateResultSuccess` ```typescript interface MongoUpdateResultSuccess extends MongoUpdateResultBase ``` Successful update result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `matchedCount`: `number` - [readonly] `modifiedCount`: `number` - [readonly] `upsertedId`: `string | null` --- ### `MongoUpdateResultError` ```typescript interface MongoUpdateResultError extends MongoUpdateResultBase ``` Update result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `matchedCount`: `null` - [readonly] `modifiedCount`: `null` - [readonly] `upsertedId`: `null` --- ### `MongoUpdateResultFailure` ```typescript interface MongoUpdateResultFailure extends MongoUpdateResultBase ``` Update result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `matchedCount`: `null` - [readonly] `modifiedCount`: `null` - [readonly] `upsertedId`: `null` --- ### `MongoDeleteResultSuccess` ```typescript interface MongoDeleteResultSuccess extends MongoDeleteResultBase ``` Successful delete result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `deletedCount`: `number` --- ### `MongoDeleteResultError` ```typescript interface MongoDeleteResultError extends MongoDeleteResultBase ``` Delete result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `deletedCount`: `null` --- ### `MongoDeleteResultFailure` ```typescript interface MongoDeleteResultFailure extends MongoDeleteResultBase ``` Delete result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `deletedCount`: `null` --- ### `MongoCountResultSuccess` ```typescript interface MongoCountResultSuccess extends MongoCountResultBase ``` Successful count result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `count`: `number` --- ### `MongoCountResultError` ```typescript interface MongoCountResultError extends MongoCountResultBase ``` Count result with MongoDB error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `MongoError` - [readonly] `count`: `null` --- ### `MongoCountResultFailure` ```typescript interface MongoCountResultFailure extends MongoCountResultBase ``` Count result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `MongoFailureError` - [readonly] `count`: `null` --- ### `DenoKvAtomicResultExpectation` ```typescript interface DenoKvAtomicResultExpectation ``` Fluent API for validating DenoKvAtomicResult. Provides chainable assertions specifically designed for Deno KV atomic operation results. All assertion methods return `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveVersionstamp(expected: unknown): this ``` Asserts that the versionstamp equals the expected value. ```typescript toHaveVersionstampEqual(expected: unknown): this ``` Asserts that the versionstamp equals the expected value using deep equality. ```typescript toHaveVersionstampStrictEqual(expected: unknown): this ``` Asserts that the versionstamp strictly equals the expected value. ```typescript toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the versionstamp satisfies the provided matcher function. ```typescript toHaveVersionstampContaining(substr: string): this ``` Asserts that the versionstamp contains the specified substring. ```typescript toHaveVersionstampMatching(expected: RegExp): this ``` Asserts that the versionstamp matches the specified regular expression. ```typescript toHaveVersionstampPresent(): this ``` Asserts that the versionstamp is present (not null or undefined). ```typescript toHaveVersionstampNull(): this ``` Asserts that the versionstamp is null. ```typescript toHaveVersionstampUndefined(): this ``` Asserts that the versionstamp is undefined. ```typescript toHaveVersionstampNullish(): this ``` Asserts that the versionstamp is nullish (null or undefined). ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `DenoKvDeleteResultExpectation` ```typescript interface DenoKvDeleteResultExpectation ``` Fluent API for validating DenoKvDeleteResult. Provides chainable assertions specifically designed for Deno KV delete operation results. All assertion methods return `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `DenoKvGetResultExpectation` ```typescript interface DenoKvGetResultExpectation<_T = unknown> ``` Fluent API for validating DenoKvGetResult. Provides chainable assertions specifically designed for Deno KV get operation results. All assertion methods return `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveKey(expected: unknown): this ``` Asserts that the key equals the expected value. ```typescript toHaveKeyEqual(expected: unknown): this ``` Asserts that the key equals the expected value using deep equality. ```typescript toHaveKeyStrictEqual(expected: unknown): this ``` Asserts that the key strictly equals the expected value. ```typescript toHaveKeySatisfying(matcher: (value: DenoKvKey<_T>) => unknown): this ``` Asserts that the key satisfies the provided matcher function. ```typescript toHaveKeyContaining(item: unknown): this ``` Asserts that the key array contains the specified item. ```typescript toHaveKeyContainingEqual(item: unknown): this ``` Asserts that the key array contains an item equal to the specified value. ```typescript toHaveKeyMatching( subset: Record | Record[], ): this ``` Asserts that the key array matches the specified subset. ```typescript toHaveKeyEmpty(): this ``` Asserts that the key array is empty. ```typescript toHaveValue(expected: unknown): this ``` Asserts that the value equals the expected value. ```typescript toHaveValueEqual(expected: unknown): this ``` Asserts that the value equals the expected value using deep equality. ```typescript toHaveValueStrictEqual(expected: unknown): this ``` Asserts that the value strictly equals the expected value. ```typescript toHaveValueSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the value satisfies the provided matcher function. ```typescript toHaveValuePresent(): this ``` Asserts that the value is present (not null or undefined). ```typescript toHaveValueNull(): this ``` Asserts that the value is null. ```typescript toHaveValueUndefined(): this ``` Asserts that the value is undefined. ```typescript toHaveValueNullish(): this ``` Asserts that the value is nullish (null or undefined). ```typescript toHaveValueMatching( subset: Record | Record[], ): this ``` Asserts that the value matches the specified subset. ```typescript toHaveValueProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the value has the specified property. ```typescript toHaveValuePropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the value property contains the expected value. ```typescript toHaveValuePropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the value property matches the specified subset. ```typescript toHaveValuePropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the value property satisfies the provided matcher function. ```typescript toHaveVersionstamp(expected: unknown): this ``` Asserts that the versionstamp equals the expected value. ```typescript toHaveVersionstampEqual(expected: unknown): this ``` Asserts that the versionstamp equals the expected value using deep equality. ```typescript toHaveVersionstampStrictEqual(expected: unknown): this ``` Asserts that the versionstamp strictly equals the expected value. ```typescript toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the versionstamp satisfies the provided matcher function. ```typescript toHaveVersionstampContaining(substr: string): this ``` Asserts that the versionstamp contains the specified substring. ```typescript toHaveVersionstampMatching(expected: RegExp): this ``` Asserts that the versionstamp matches the specified regular expression. ```typescript toHaveVersionstampPresent(): this ``` Asserts that the versionstamp is present (not null or undefined). ```typescript toHaveVersionstampNull(): this ``` Asserts that the versionstamp is null. ```typescript toHaveVersionstampUndefined(): this ``` Asserts that the versionstamp is undefined. ```typescript toHaveVersionstampNullish(): this ``` Asserts that the versionstamp is nullish (null or undefined). ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `DenoKvListResultExpectation` ```typescript interface DenoKvListResultExpectation<_T = unknown> ``` Fluent API for validating DenoKvListResult. Provides chainable assertions specifically designed for Deno KV list operation results. All assertion methods return `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveEntries(expected: unknown): this ``` Asserts that the entries equal the expected value. ```typescript toHaveEntriesEqual(expected: unknown): this ``` Asserts that the entries equal the expected value using deep equality. ```typescript toHaveEntriesStrictEqual(expected: unknown): this ``` Asserts that the entries strictly equal the expected value. ```typescript toHaveEntriesSatisfying(matcher: (value: DenoKvEntries<_T>) => unknown): this ``` Asserts that the entries satisfy the provided matcher function. ```typescript toHaveEntriesContaining(item: unknown): this ``` Asserts that the entries array contains the specified item. ```typescript toHaveEntriesContainingEqual(item: unknown): this ``` Asserts that the entries array contains an item equal to the specified value. ```typescript toHaveEntriesMatching( subset: Record | Record[], ): this ``` Asserts that the entries array matches the specified subset. ```typescript toHaveEntriesEmpty(): this ``` Asserts that the entries array is empty. ```typescript toHaveEntryCount(expected: unknown): this ``` Asserts that the entry count equals the expected value. ```typescript toHaveEntryCountEqual(expected: unknown): this ``` Asserts that the entry count equals the expected value using deep equality. ```typescript toHaveEntryCountStrictEqual(expected: unknown): this ``` Asserts that the entry count strictly equals the expected value. ```typescript toHaveEntryCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the entry count satisfies the provided matcher function. ```typescript toHaveEntryCountNaN(): this ``` Asserts that the entry count is NaN. ```typescript toHaveEntryCountGreaterThan(expected: number): this ``` Asserts that the entry count is greater than the expected value. ```typescript toHaveEntryCountGreaterThanOrEqual(expected: number): this ``` Asserts that the entry count is greater than or equal to the expected value. ```typescript toHaveEntryCountLessThan(expected: number): this ``` Asserts that the entry count is less than the expected value. ```typescript toHaveEntryCountLessThanOrEqual(expected: number): this ``` Asserts that the entry count is less than or equal to the expected value. ```typescript toHaveEntryCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the entry count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `DenoKvSetResultExpectation` ```typescript interface DenoKvSetResultExpectation ``` Fluent API for validating DenoKvSetResult. Provides chainable assertions specifically designed for Deno KV set operation results. All assertion methods return `this` to enable method chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveVersionstamp(expected: unknown): this ``` Asserts that the versionstamp equals the expected value. ```typescript toHaveVersionstampEqual(expected: unknown): this ``` Asserts that the versionstamp equals the expected value using deep equality. ```typescript toHaveVersionstampStrictEqual(expected: unknown): this ``` Asserts that the versionstamp strictly equals the expected value. ```typescript toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the versionstamp satisfies the provided matcher function. ```typescript toHaveVersionstampContaining(substr: string): this ``` Asserts that the versionstamp contains the specified substring. ```typescript toHaveVersionstampMatching(expected: RegExp): this ``` Asserts that the versionstamp matches the specified regular expression. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `DenoKvOptions` ```typescript interface DenoKvOptions extends CommonOptions ``` Options for Deno KV operations. Extends CommonOptions with error handling behavior configuration. **Properties:** - [readonly] `throwOnError?`: `boolean` — Whether to throw errors instead of returning them in the result. - `false` (default): Errors are returned in the result's `error` property - `true`: Errors are thrown as exceptions This applies to both KV errors (quota exceeded, etc.) and connection errors. Note: Atomic check failures are NOT errors and will never be thrown. --- ### `DenoKvClientConfig` ```typescript interface DenoKvClientConfig extends DenoKvOptions ``` Configuration for DenoKvClient. **Properties:** - [readonly] `path?`: `string` — Path to the KV database file. If not specified, uses in-memory storage or Deno Deploy's KV. --- ### `DenoKvGetOptions` ```typescript interface DenoKvGetOptions extends DenoKvOptions ``` Options for get operations. --- ### `DenoKvSetOptions` ```typescript interface DenoKvSetOptions extends DenoKvOptions ``` Options for set operations. **Properties:** - [readonly] `expireIn?`: `number` — Time-to-live in milliseconds. The entry will automatically expire after this duration. --- ### `DenoKvDeleteOptions` ```typescript interface DenoKvDeleteOptions extends DenoKvOptions ``` Options for delete operations. --- ### `DenoKvListOptions` ```typescript interface DenoKvListOptions extends DenoKvOptions ``` Options for list operations. **Properties:** - [readonly] `limit?`: `number` — Maximum number of entries to return. - [readonly] `cursor?`: `string` — Cursor for pagination. - [readonly] `reverse?`: `boolean` — Whether to iterate in reverse order. --- ### `DenoKvAtomicOptions` ```typescript interface DenoKvAtomicOptions extends DenoKvOptions ``` Options for atomic operations. --- ### `DenoKvGetResultSuccess` ```typescript interface DenoKvGetResultSuccess extends DenoKvGetResultBase ``` Successful get operation result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `key`: `Deno.KvKey` - [readonly] `value`: `T | null` - [readonly] `versionstamp`: `string | null` --- ### `DenoKvGetResultError` ```typescript interface DenoKvGetResultError extends DenoKvGetResultBase ``` Get operation result with KV error (quota exceeded, etc.). **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvError` - [readonly] `key`: `Deno.KvKey` - [readonly] `value`: `null` - [readonly] `versionstamp`: `null` --- ### `DenoKvGetResultFailure` ```typescript interface DenoKvGetResultFailure extends DenoKvGetResultBase ``` Get operation result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvFailureError` - [readonly] `key`: `null` - [readonly] `value`: `null` - [readonly] `versionstamp`: `null` --- ### `DenoKvSetResultSuccess` ```typescript interface DenoKvSetResultSuccess extends DenoKvSetResultBase ``` Successful set operation result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `versionstamp`: `string` --- ### `DenoKvSetResultError` ```typescript interface DenoKvSetResultError extends DenoKvSetResultBase ``` Set operation result with KV error (quota exceeded, etc.). **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvError` - [readonly] `versionstamp`: `null` --- ### `DenoKvSetResultFailure` ```typescript interface DenoKvSetResultFailure extends DenoKvSetResultBase ``` Set operation result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvFailureError` - [readonly] `versionstamp`: `null` --- ### `DenoKvDeleteResultSuccess` ```typescript interface DenoKvDeleteResultSuccess extends DenoKvDeleteResultBase ``` Successful delete operation result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `DenoKvDeleteResultError` ```typescript interface DenoKvDeleteResultError extends DenoKvDeleteResultBase ``` Delete operation result with KV error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvError` --- ### `DenoKvDeleteResultFailure` ```typescript interface DenoKvDeleteResultFailure extends DenoKvDeleteResultBase ``` Delete operation result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvFailureError` --- ### `DenoKvEntry` ```typescript interface DenoKvEntry ``` A single entry in the KV store. **Properties:** - [readonly] `key`: `Deno.KvKey` - [readonly] `value`: `T` - [readonly] `versionstamp`: `string` --- ### `DenoKvListResultSuccess` ```typescript interface DenoKvListResultSuccess extends DenoKvListResultBase ``` Successful list operation result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `entries`: `readonly DenoKvEntry[]` --- ### `DenoKvListResultError` ```typescript interface DenoKvListResultError extends DenoKvListResultBase ``` List operation result with KV error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvError` - [readonly] `entries`: `readonly DenoKvEntry[]` --- ### `DenoKvListResultFailure` ```typescript interface DenoKvListResultFailure extends DenoKvListResultBase ``` List operation result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvFailureError` - [readonly] `entries`: `readonly DenoKvEntry[]` --- ### `DenoKvAtomicResultCommitted` ```typescript interface DenoKvAtomicResultCommitted extends DenoKvAtomicResultBase ``` Atomic operation successfully committed. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `versionstamp`: `string` --- ### `DenoKvAtomicResultCheckFailed` ```typescript interface DenoKvAtomicResultCheckFailed extends DenoKvAtomicResultBase ``` Atomic operation check failed (version mismatch). This is NOT an error - it's an expected outcome when using optimistic concurrency. Retry the operation with updated versionstamps. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `null` - [readonly] `versionstamp`: `null` --- ### `DenoKvAtomicResultError` ```typescript interface DenoKvAtomicResultError extends DenoKvAtomicResultBase ``` Atomic operation failed with KV error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvError` - [readonly] `versionstamp`: `null` --- ### `DenoKvAtomicResultFailure` ```typescript interface DenoKvAtomicResultFailure extends DenoKvAtomicResultBase ``` Atomic operation failed with connection error. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `DenoKvFailureError` - [readonly] `versionstamp`: `null` --- ### `AtomicBuilderOptions` ```typescript interface AtomicBuilderOptions ``` Options for atomic operations. **Properties:** - [readonly] `throwOnError?`: `boolean` — Whether to throw errors instead of returning them in the result. --- ### `DenoKvAtomicBuilder` ```typescript interface DenoKvAtomicBuilder ``` Builder for atomic KV operations. **Methods:** ```typescript check(_: Deno.AtomicCheck[]): this ``` Add version checks to the atomic operation. If any check fails, the entire operation will fail. ```typescript set(key: Deno.KvKey, value: T, options?: { expireIn?: number }): this ``` Set a value in the KV store. ```typescript delete(key: Deno.KvKey): this ``` Delete a key from the KV store. ```typescript sum(key: Deno.KvKey, n: bigint): this ``` Atomically add to a bigint value (Deno.KvU64). ```typescript min(key: Deno.KvKey, n: bigint): this ``` Atomically set to minimum of current and provided value. ```typescript max(key: Deno.KvKey, n: bigint): this ``` Atomically set to maximum of current and provided value. ```typescript commit(): Promise ``` Commit the atomic operation. --- ### `DenoKvClient` ```typescript interface DenoKvClient extends AsyncDisposable ``` Deno KV client for Probitas scenario testing. **Properties:** - [readonly] `config`: `DenoKvClientConfig` — Client configuration. **Methods:** ```typescript get( key: Deno.KvKey, options?: DenoKvGetOptions, ): Promise> ``` Get a single value by key. ```typescript getMany( keys: readonly [unknown], options?: DenoKvGetOptions, ): Promise ``` Get multiple values by keys. ```typescript set( key: Deno.KvKey, value: T, options?: DenoKvSetOptions, ): Promise ``` Set a value. ```typescript delete( key: Deno.KvKey, options?: DenoKvDeleteOptions, ): Promise ``` Delete a key. ```typescript list( selector: Deno.KvListSelector, options?: DenoKvListOptions, ): Promise> ``` List entries by selector. ```typescript atomic(options?: DenoKvAtomicOptions): DenoKvAtomicBuilder ``` Create an atomic operation builder. ```typescript close(): Promise ``` Close the KV connection. --- ### `SqsDeleteBatchResultExpectation` ```typescript interface SqsDeleteBatchResultExpectation ``` **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` ```typescript toHaveSuccessful(expected: unknown): this ``` ```typescript toHaveSuccessfulEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulStrictEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulSatisfying( matcher: (value: SqsDeleteBatchSuccessful) => unknown, ): this ``` ```typescript toHaveSuccessfulContaining(item: unknown): this ``` ```typescript toHaveSuccessfulContainingEqual(item: unknown): this ``` ```typescript toHaveSuccessfulMatching( subset: Record | Record[], ): this ``` ```typescript toHaveSuccessfulEmpty(): this ``` ```typescript toHaveSuccessfulCount(expected: unknown): this ``` ```typescript toHaveSuccessfulCountEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulCountStrictEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulCountSatisfying(matcher: (value: number) => unknown): this ``` ```typescript toHaveSuccessfulCountNaN(): this ``` ```typescript toHaveSuccessfulCountGreaterThan(expected: number): this ``` ```typescript toHaveSuccessfulCountGreaterThanOrEqual(expected: number): this ``` ```typescript toHaveSuccessfulCountLessThan(expected: number): this ``` ```typescript toHaveSuccessfulCountLessThanOrEqual(expected: number): this ``` ```typescript toHaveSuccessfulCountCloseTo(expected: number, numDigits?: number): this ``` ```typescript toHaveFailed(expected: unknown): this ``` ```typescript toHaveFailedEqual(expected: unknown): this ``` ```typescript toHaveFailedStrictEqual(expected: unknown): this ``` ```typescript toHaveFailedSatisfying(matcher: (value: SqsDeleteBatchFailed) => unknown): this ``` ```typescript toHaveFailedContaining(item: unknown): this ``` ```typescript toHaveFailedContainingEqual(item: unknown): this ``` ```typescript toHaveFailedMatching( subset: Record | Record[], ): this ``` ```typescript toHaveFailedEmpty(): this ``` ```typescript toHaveFailedCount(expected: unknown): this ``` ```typescript toHaveFailedCountEqual(expected: unknown): this ``` ```typescript toHaveFailedCountStrictEqual(expected: unknown): this ``` ```typescript toHaveFailedCountSatisfying(matcher: (value: number) => unknown): this ``` ```typescript toHaveFailedCountNaN(): this ``` ```typescript toHaveFailedCountGreaterThan(expected: number): this ``` ```typescript toHaveFailedCountGreaterThanOrEqual(expected: number): this ``` ```typescript toHaveFailedCountLessThan(expected: number): this ``` ```typescript toHaveFailedCountLessThanOrEqual(expected: number): this ``` ```typescript toHaveFailedCountCloseTo(expected: number, numDigits?: number): this ``` ```typescript toHaveDuration(expected: unknown): this ``` ```typescript toHaveDurationEqual(expected: unknown): this ``` ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` ```typescript toHaveDurationNaN(): this ``` ```typescript toHaveDurationGreaterThan(expected: number): this ``` ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` ```typescript toHaveDurationLessThan(expected: number): this ``` ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` --- ### `SqsDeleteQueueResultExpectation` ```typescript interface SqsDeleteQueueResultExpectation ``` Fluent API for SQS delete queue result validation. Provides chainable assertions for queue deletion results. Delete queue results only have ok and duration properties. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsDeleteResultExpectation` ```typescript interface SqsDeleteResultExpectation ``` Fluent API for SQS delete result validation. Provides chainable assertions for message deletion results. Delete results only have ok and duration properties. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsEnsureQueueResultExpectation` ```typescript interface SqsEnsureQueueResultExpectation ``` Fluent API for SQS ensure queue result validation. Provides chainable assertions for queue creation/retrieval results including queue URL. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveQueueUrl(expected: unknown): this ``` Asserts that the queue URL equals the expected value. ```typescript toHaveQueueUrlEqual(expected: unknown): this ``` Asserts that the queue URL equals the expected value using deep equality. ```typescript toHaveQueueUrlStrictEqual(expected: unknown): this ``` Asserts that the queue URL strictly equals the expected value. ```typescript toHaveQueueUrlSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the queue URL satisfies the provided matcher function. ```typescript toHaveQueueUrlContaining(substr: string): this ``` Asserts that the queue URL contains the specified substring. ```typescript toHaveQueueUrlMatching(expected: RegExp): this ``` Asserts that the queue URL matches the specified regular expression. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsReceiveResultExpectation` ```typescript interface SqsReceiveResultExpectation ``` Fluent API for SQS receive result validation. Provides chainable assertions specifically designed for message receive results including messages array and message count. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveMessages(expected: unknown): this ``` Asserts that the messages equals the expected value. ```typescript toHaveMessagesEqual(expected: unknown): this ``` Asserts that the messages equals the expected value using deep equality. ```typescript toHaveMessagesStrictEqual(expected: unknown): this ``` Asserts that the messages strictly equals the expected value. ```typescript toHaveMessagesSatisfying(matcher: (value: SqsMessages) => unknown): this ``` Asserts that the messages satisfies the provided matcher function. ```typescript toHaveMessagesContaining(item: unknown): this ``` Asserts that the messages contains the specified item. ```typescript toHaveMessagesContainingEqual(item: unknown): this ``` Asserts that the messages contains an item equal to the specified value. ```typescript toHaveMessagesMatching( subset: Record | Record[], ): this ``` Asserts that the messages matches the specified subset. ```typescript toHaveMessagesEmpty(): this ``` Asserts that the messages is empty. ```typescript toHaveMessagesCount(expected: unknown): this ``` Asserts that the messages count equals the expected value. ```typescript toHaveMessagesCountEqual(expected: unknown): this ``` Asserts that the messages count equals the expected value using deep equality. ```typescript toHaveMessagesCountStrictEqual(expected: unknown): this ``` Asserts that the messages count strictly equals the expected value. ```typescript toHaveMessagesCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the messages count satisfies the provided matcher function. ```typescript toHaveMessagesCountNaN(): this ``` Asserts that the messages count is NaN. ```typescript toHaveMessagesCountGreaterThan(expected: number): this ``` Asserts that the messages count is greater than the expected value. ```typescript toHaveMessagesCountGreaterThanOrEqual(expected: number): this ``` Asserts that the messages count is greater than or equal to the expected value. ```typescript toHaveMessagesCountLessThan(expected: number): this ``` Asserts that the messages count is less than the expected value. ```typescript toHaveMessagesCountLessThanOrEqual(expected: number): this ``` Asserts that the messages count is less than or equal to the expected value. ```typescript toHaveMessagesCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the messages count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsSendBatchResultExpectation` ```typescript interface SqsSendBatchResultExpectation ``` Fluent API for SQS send batch result validation. Provides chainable assertions specifically designed for batch message send results including successful and failed messages arrays. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveSuccessful(expected: unknown): this ``` ```typescript toHaveSuccessfulEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulStrictEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulSatisfying( matcher: (value: SqsSendBatchSuccessful) => unknown, ): this ``` ```typescript toHaveSuccessfulContaining(item: unknown): this ``` ```typescript toHaveSuccessfulContainingEqual(item: unknown): this ``` ```typescript toHaveSuccessfulMatching( subset: Record | Record[], ): this ``` ```typescript toHaveSuccessfulEmpty(): this ``` ```typescript toHaveSuccessfulCount(expected: unknown): this ``` ```typescript toHaveSuccessfulCountEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulCountStrictEqual(expected: unknown): this ``` ```typescript toHaveSuccessfulCountSatisfying(matcher: (value: number) => unknown): this ``` ```typescript toHaveSuccessfulCountNaN(): this ``` ```typescript toHaveSuccessfulCountGreaterThan(expected: number): this ``` ```typescript toHaveSuccessfulCountGreaterThanOrEqual(expected: number): this ``` ```typescript toHaveSuccessfulCountLessThan(expected: number): this ``` ```typescript toHaveSuccessfulCountLessThanOrEqual(expected: number): this ``` ```typescript toHaveSuccessfulCountCloseTo(expected: number, numDigits?: number): this ``` ```typescript toHaveFailed(expected: unknown): this ``` ```typescript toHaveFailedEqual(expected: unknown): this ``` ```typescript toHaveFailedStrictEqual(expected: unknown): this ``` ```typescript toHaveFailedSatisfying(matcher: (value: SqsSendBatchFailed) => unknown): this ``` ```typescript toHaveFailedContaining(item: unknown): this ``` ```typescript toHaveFailedContainingEqual(item: unknown): this ``` ```typescript toHaveFailedMatching( subset: Record | Record[], ): this ``` ```typescript toHaveFailedEmpty(): this ``` ```typescript toHaveFailedCount(expected: unknown): this ``` ```typescript toHaveFailedCountEqual(expected: unknown): this ``` ```typescript toHaveFailedCountStrictEqual(expected: unknown): this ``` ```typescript toHaveFailedCountSatisfying(matcher: (value: number) => unknown): this ``` ```typescript toHaveFailedCountNaN(): this ``` ```typescript toHaveFailedCountGreaterThan(expected: number): this ``` ```typescript toHaveFailedCountGreaterThanOrEqual(expected: number): this ``` ```typescript toHaveFailedCountLessThan(expected: number): this ``` ```typescript toHaveFailedCountLessThanOrEqual(expected: number): this ``` ```typescript toHaveFailedCountCloseTo(expected: number, numDigits?: number): this ``` ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsSendResultExpectation` ```typescript interface SqsSendResultExpectation ``` Fluent API for SQS send result validation. Provides chainable assertions specifically designed for single message send results including message ID and sequence number. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveMessageId(expected: unknown): this ``` Asserts that the message ID equals the expected value. ```typescript toHaveMessageIdEqual(expected: unknown): this ``` Asserts that the message ID equals the expected value using deep equality. ```typescript toHaveMessageIdStrictEqual(expected: unknown): this ``` Asserts that the message ID strictly equals the expected value. ```typescript toHaveMessageIdSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the message ID satisfies the provided matcher function. ```typescript toHaveMessageIdContaining(substr: string): this ``` Asserts that the message ID contains the specified substring. ```typescript toHaveMessageIdMatching(expected: RegExp): this ``` Asserts that the message ID matches the specified regular expression. ```typescript toHaveMd5OfBody(expected: unknown): this ``` Asserts that the MD5 of body equals the expected value. ```typescript toHaveMd5OfBodyEqual(expected: unknown): this ``` Asserts that the MD5 of body equals the expected value using deep equality. ```typescript toHaveMd5OfBodyStrictEqual(expected: unknown): this ``` Asserts that the MD5 of body strictly equals the expected value. ```typescript toHaveMd5OfBodySatisfying(matcher: (value: string) => unknown): this ``` Asserts that the MD5 of body satisfies the provided matcher function. ```typescript toHaveMd5OfBodyContaining(substr: string): this ``` Asserts that the MD5 of body contains the specified substring. ```typescript toHaveMd5OfBodyMatching(expected: RegExp): this ``` Asserts that the MD5 of body matches the specified regular expression. ```typescript toHaveSequenceNumber(expected: unknown): this ``` Asserts that the sequence number equals the expected value. ```typescript toHaveSequenceNumberEqual(expected: unknown): this ``` Asserts that the sequence number equals the expected value using deep equality. ```typescript toHaveSequenceNumberStrictEqual(expected: unknown): this ``` Asserts that the sequence number strictly equals the expected value. ```typescript toHaveSequenceNumberSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the sequence number satisfies the provided matcher function. ```typescript toHaveSequenceNumberContaining(substr: string): this ``` Asserts that the sequence number contains the specified substring. ```typescript toHaveSequenceNumberMatching(expected: RegExp): this ``` Asserts that the sequence number matches the specified regular expression. ```typescript toHaveSequenceNumberPresent(): this ``` Asserts that the sequence number is present (not null or undefined). ```typescript toHaveSequenceNumberNull(): this ``` Asserts that the sequence number is null. ```typescript toHaveSequenceNumberUndefined(): this ``` Asserts that the sequence number is undefined. ```typescript toHaveSequenceNumberNullish(): this ``` Asserts that the sequence number is nullish (null or undefined). ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqsOptions` ```typescript interface SqsOptions extends CommonOptions ``` Common options with throwOnError support. **Properties:** - [readonly] `throwOnError?`: `boolean` — If true, throws errors instead of returning them in the result. If false (default), errors are returned in the result object. --- ### `SqsConnectionConfig` ```typescript interface SqsConnectionConfig extends CommonConnectionConfig ``` SQS connection configuration. Extends CommonConnectionConfig with SQS-specific options. **Properties:** - [readonly] `protocol?`: `"http" | "https"` — Protocol to use. - [readonly] `path?`: `string` — Custom path (for LocalStack or custom endpoints). - [readonly] `region?`: `string` — AWS region (required for AWS, optional for LocalStack). --- ### `SqsClientConfig` ```typescript interface SqsClientConfig extends SqsOptions ``` SQS client configuration. **Properties:** - [readonly] `region`: `string` — AWS region - [readonly] `credentials?`: `{ accessKeyId: string; secretAccessKey: string }` — AWS credentials - [readonly] `queueUrl?`: `string` — SQS queue URL (optional - can be set later or used with ensureQueue) - [readonly] `url?`: `string | SqsConnectionConfig` — SQS endpoint URL (e.g., "http://localhost:4566" for LocalStack). Can be a string URL or a connection config object. Optional for real AWS (uses default endpoint), required for LocalStack. --- ### `SqsMessageAttribute` ```typescript interface SqsMessageAttribute ``` SQS message attributes. **Properties:** - [readonly] `dataType`: `"String" | "Number" | "Binary"` - [readonly] `stringValue?`: `string` - [readonly] `binaryValue?`: `Uint8Array` --- ### `SqsMessage` ```typescript interface SqsMessage ``` SQS message received from a queue. **Properties:** - [readonly] `messageId`: `string` - [readonly] `body`: `string` - [readonly] `receiptHandle`: `string` - [readonly] `attributes`: `Record` - [readonly] `messageAttributes?`: `Record` - [readonly] `md5OfBody`: `string` --- ### `SqsSendOptions` ```typescript interface SqsSendOptions extends SqsOptions ``` Options for sending a message. **Properties:** - [readonly] `delaySeconds?`: `number` — Delay in seconds before the message becomes visible (0-900) - [readonly] `messageAttributes?`: `Record` — Message attributes - [readonly] `messageGroupId?`: `string` — Message group ID (required for FIFO queues) - [readonly] `messageDeduplicationId?`: `string` — Message deduplication ID (required for FIFO queues without content-based deduplication) --- ### `SqsBatchMessage` ```typescript interface SqsBatchMessage ``` Batch message for sendBatch. **Properties:** - [readonly] `id`: `string` - [readonly] `body`: `string` - [readonly] `delaySeconds?`: `number` - [readonly] `messageAttributes?`: `Record` --- ### `SqsReceiveOptions` ```typescript interface SqsReceiveOptions extends SqsOptions ``` Options for receiving messages. **Properties:** - [readonly] `maxMessages?`: `number` — Maximum number of messages to receive (1-10, default: 1) - [readonly] `waitTimeSeconds?`: `number` — Wait time in seconds for long polling (0-20) - [readonly] `visibilityTimeout?`: `number` — Visibility timeout in seconds (0-43200) - [readonly] `attributeNames?`: `readonly string[]` — System attribute names to retrieve - [readonly] `messageAttributeNames?`: `readonly string[]` — Message attribute names to retrieve --- ### `SqsBatchSuccessEntry` ```typescript interface SqsBatchSuccessEntry ``` Successful batch send entry. **Properties:** - [readonly] `messageId`: `string` - [readonly] `id`: `string` --- ### `SqsBatchFailedEntry` ```typescript interface SqsBatchFailedEntry ``` Failed batch entry. **Properties:** - [readonly] `id`: `string` - [readonly] `code`: `string` - [readonly] `message`: `string` --- ### `SqsEnsureQueueOptions` ```typescript interface SqsEnsureQueueOptions extends SqsOptions ``` Options for ensuring a queue exists. **Properties:** - [readonly] `attributes?`: `Record` — Queue attributes (e.g., DelaySeconds, MessageRetentionPeriod) - [readonly] `tags?`: `Record` — Queue tags --- ### `SqsDeleteOptions` ```typescript interface SqsDeleteOptions extends SqsOptions ``` Options for deleting a message. --- ### `SqsBatchOptions` ```typescript interface SqsBatchOptions extends SqsOptions ``` Options for batch operations. --- ### `SqsDeleteQueueOptions` ```typescript interface SqsDeleteQueueOptions extends SqsOptions ``` Options for deleting a queue. --- ### `SqsClient` ```typescript interface SqsClient extends AsyncDisposable ``` SQS client interface. **Properties:** - [readonly] `config`: `SqsClientConfig` - [readonly] `queueUrl`: `string | undefined` — The current queue URL. Can be set via config, ensureQueue(), or setQueueUrl(). **Methods:** ```typescript setQueueUrl(queueUrl: string): void ``` Set the queue URL for subsequent operations. ```typescript ensureQueue( queueName: string, options?: SqsEnsureQueueOptions, ): Promise ``` Ensure a queue exists. Creates the queue if it doesn't exist. If the queue already exists with the same attributes, returns the existing queue URL. Also sets the queue URL for subsequent operations. ```typescript deleteQueue( queueUrl: string, options?: SqsDeleteQueueOptions, ): Promise ``` Delete a queue by URL. ```typescript send(body: string, options?: SqsSendOptions): Promise ``` Send a message to the queue. ```typescript sendBatch( messages: SqsBatchMessage[], options?: SqsBatchOptions, ): Promise ``` Send multiple messages to the queue in a single request. ```typescript receive(options?: SqsReceiveOptions): Promise ``` Receive messages from the queue. ```typescript delete( receiptHandle: string, options?: SqsDeleteOptions, ): Promise ``` Delete a message from the queue. ```typescript deleteBatch( receiptHandles: string[], options?: SqsBatchOptions, ): Promise ``` Delete multiple messages from the queue in a single request. ```typescript purge(options?: SqsOptions): Promise ``` Purge all messages from the queue. ```typescript close(): Promise ``` Close the client and release resources. --- ### `SqsErrorOptions` ```typescript interface SqsErrorOptions extends ErrorOptions ``` Options for SQS errors. **Properties:** - [readonly] `code?`: `string` --- ### `SqsCommandErrorOptions` ```typescript interface SqsCommandErrorOptions extends SqsErrorOptions ``` Options for SQS command errors. **Properties:** - [readonly] `operation`: `string` --- ### `SqsSendResultSuccess` ```typescript interface SqsSendResultSuccess extends SqsSendResultBase ``` Successful send result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `messageId`: `string` — Unique identifier for the sent message. - [readonly] `md5OfBody`: `string` — MD5 hash of the message body (for integrity verification). - [readonly] `sequenceNumber`: `string | null` — Sequence number for FIFO queues (present only for FIFO queues). --- ### `SqsSendResultError` ```typescript interface SqsSendResultError extends SqsSendResultBase ``` Send result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `messageId`: `null` - [readonly] `md5OfBody`: `null` - [readonly] `sequenceNumber`: `null` --- ### `SqsSendResultFailure` ```typescript interface SqsSendResultFailure extends SqsSendResultBase ``` Send result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `messageId`: `null` - [readonly] `md5OfBody`: `null` - [readonly] `sequenceNumber`: `null` --- ### `SqsSendBatchResultSuccess` ```typescript interface SqsSendBatchResultSuccess extends SqsSendBatchResultBase ``` Successful batch send result. Note: `ok: true` even if some messages failed (partial failure). Check `failed.length > 0` to detect partial failures. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `successful`: `readonly SqsBatchSuccessEntry[]` — Array of successfully sent messages. - [readonly] `failed`: `readonly SqsBatchFailedEntry[]` — Array of messages that failed to send (may be non-empty even with ok: true). --- ### `SqsSendBatchResultError` ```typescript interface SqsSendBatchResultError extends SqsSendBatchResultBase ``` Batch send result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `successful`: `readonly []` - [readonly] `failed`: `readonly []` --- ### `SqsSendBatchResultFailure` ```typescript interface SqsSendBatchResultFailure extends SqsSendBatchResultBase ``` Batch send result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `successful`: `null` - [readonly] `failed`: `null` --- ### `SqsReceiveResultSuccess` ```typescript interface SqsReceiveResultSuccess extends SqsReceiveResultBase ``` Successful receive result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `messages`: `readonly SqsMessage[]` — Array of received messages (may be empty). --- ### `SqsReceiveResultError` ```typescript interface SqsReceiveResultError extends SqsReceiveResultBase ``` Receive result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `messages`: `readonly []` --- ### `SqsReceiveResultFailure` ```typescript interface SqsReceiveResultFailure extends SqsReceiveResultBase ``` Receive result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `messages`: `null` --- ### `SqsDeleteResultSuccess` ```typescript interface SqsDeleteResultSuccess extends SqsDeleteResultBase ``` Successful delete result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `SqsDeleteResultError` ```typescript interface SqsDeleteResultError extends SqsDeleteResultBase ``` Delete result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` --- ### `SqsDeleteResultFailure` ```typescript interface SqsDeleteResultFailure extends SqsDeleteResultBase ``` Delete result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` --- ### `SqsDeleteBatchResultSuccess` ```typescript interface SqsDeleteBatchResultSuccess extends SqsDeleteBatchResultBase ``` Successful batch delete result. Note: `ok: true` even if some messages failed (partial failure). Check `failed.length > 0` to detect partial failures. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `successful`: `readonly string[]` — Array of message IDs that were successfully deleted. - [readonly] `failed`: `readonly SqsBatchFailedEntry[]` — Array of messages that failed to delete (may be non-empty even with ok: true). --- ### `SqsDeleteBatchResultError` ```typescript interface SqsDeleteBatchResultError extends SqsDeleteBatchResultBase ``` Batch delete result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `successful`: `readonly []` - [readonly] `failed`: `readonly []` --- ### `SqsDeleteBatchResultFailure` ```typescript interface SqsDeleteBatchResultFailure extends SqsDeleteBatchResultBase ``` Batch delete result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `successful`: `null` - [readonly] `failed`: `null` --- ### `SqsEnsureQueueResultSuccess` ```typescript interface SqsEnsureQueueResultSuccess extends SqsEnsureQueueResultBase ``` Successful ensure queue result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `queueUrl`: `string` — URL of the queue (existing or newly created). --- ### `SqsEnsureQueueResultError` ```typescript interface SqsEnsureQueueResultError extends SqsEnsureQueueResultBase ``` Ensure queue result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` - [readonly] `queueUrl`: `null` --- ### `SqsEnsureQueueResultFailure` ```typescript interface SqsEnsureQueueResultFailure extends SqsEnsureQueueResultBase ``` Ensure queue result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` - [readonly] `queueUrl`: `null` --- ### `SqsDeleteQueueResultSuccess` ```typescript interface SqsDeleteQueueResultSuccess extends SqsDeleteQueueResultBase ``` Successful delete queue result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `SqsDeleteQueueResultError` ```typescript interface SqsDeleteQueueResultError extends SqsDeleteQueueResultBase ``` Delete queue result with SQS error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `SqsError` --- ### `SqsDeleteQueueResultFailure` ```typescript interface SqsDeleteQueueResultFailure extends SqsDeleteQueueResultBase ``` Delete queue result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `SqsFailureError` --- ### `RabbitMqAckResultExpectation` ```typescript interface RabbitMqAckResultExpectation ``` Fluent API for RabbitMQ ack result validation. Provides chainable assertions for message acknowledgment results. Ack results only have ok and duration properties. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RabbitMqConsumeResultExpectation` ```typescript interface RabbitMqConsumeResultExpectation ``` Fluent API for RabbitMQ consume result validation. Provides chainable assertions specifically designed for message consumption results including message content, properties, headers, and metadata. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveMessage(expected: unknown): this ``` Asserts that the message equals the expected value. ```typescript toHaveMessageEqual(expected: unknown): this ``` Asserts that the message equals the expected value using deep equality. ```typescript toHaveMessageStrictEqual(expected: unknown): this ``` Asserts that the message strictly equals the expected value. ```typescript toHaveMessageSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the message satisfies the provided matcher function. ```typescript toHaveMessagePresent(): this ``` Asserts that the message is present (not null or undefined). ```typescript toHaveMessageNull(): this ``` Asserts that the message is null (no message received). ```typescript toHaveMessageUndefined(): this ``` Asserts that the message is undefined. ```typescript toHaveMessageNullish(): this ``` Asserts that the message is nullish (null or undefined). ```typescript toHaveMessageMatching( subset: Record | Record[], ): this ``` Asserts that the message matches the specified subset. ```typescript toHaveMessageProperty(keyPath: string | string[], value?: unknown): this ``` Asserts that the message has the specified property. ```typescript toHaveMessagePropertyContaining( keyPath: string | string[], expected: unknown, ): this ``` Asserts that the message property contains the expected value. ```typescript toHaveMessagePropertyMatching( keyPath: string | string[], subset: Record | Record[], ): this ``` Asserts that the message property matches the specified subset. ```typescript toHaveMessagePropertySatisfying( keyPath: string | string[], matcher: (value: any) => unknown, ): this ``` Asserts that the message property satisfies the provided matcher function. ```typescript toHaveContent(expected: unknown): this ``` Asserts that the content equals the expected value. ```typescript toHaveContentEqual(expected: unknown): this ``` Asserts that the content equals the expected value using deep equality. ```typescript toHaveContentStrictEqual(expected: unknown): this ``` Asserts that the content strictly equals the expected value. ```typescript toHaveContentSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the content satisfies the provided matcher function. ```typescript toHaveContentPresent(): this ``` Asserts that the content is present (not null or undefined). ```typescript toHaveContentNull(): this ``` Asserts that the content is null. ```typescript toHaveContentUndefined(): this ``` Asserts that the content is undefined. ```typescript toHaveContentNullish(): this ``` Asserts that the content is nullish (null or undefined). ```typescript toHaveContentLength(expected: unknown): this ``` Asserts that the content length equals the expected value. ```typescript toHaveContentLengthEqual(expected: unknown): this ``` Asserts that the content length equals the expected value using deep equality. ```typescript toHaveContentLengthStrictEqual(expected: unknown): this ``` Asserts that the content length strictly equals the expected value. ```typescript toHaveContentLengthSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the content length satisfies the provided matcher function. ```typescript toHaveContentLengthNaN(): this ``` Asserts that the content length is NaN. ```typescript toHaveContentLengthGreaterThan(expected: number): this ``` Asserts that the content length is greater than the expected value. ```typescript toHaveContentLengthGreaterThanOrEqual(expected: number): this ``` Asserts that the content length is greater than or equal to the expected value. ```typescript toHaveContentLengthLessThan(expected: number): this ``` Asserts that the content length is less than the expected value. ```typescript toHaveContentLengthLessThanOrEqual(expected: number): this ``` Asserts that the content length is less than or equal to the expected value. ```typescript toHaveContentLengthCloseTo(expected: number, numDigits?: number): this ``` Asserts that the content length is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RabbitMqExchangeResultExpectation` ```typescript interface RabbitMqExchangeResultExpectation ``` Fluent API for RabbitMQ exchange result validation. Provides chainable assertions for exchange declaration/deletion results. Exchange results only have ok and duration properties. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RabbitMqPublishResultExpectation` ```typescript interface RabbitMqPublishResultExpectation ``` Fluent API for RabbitMQ publish result validation. Publish results only have ok and duration properties. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RabbitMqQueueResultExpectation` ```typescript interface RabbitMqQueueResultExpectation ``` Fluent API for RabbitMQ queue result validation. Provides chainable assertions specifically designed for queue declaration results (e.g., assertQueue, checkQueue operations). **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveQueue(expected: unknown): this ``` Asserts that the queue name equals the expected value. ```typescript toHaveQueueEqual(expected: unknown): this ``` Asserts that the queue name equals the expected value using deep equality. ```typescript toHaveQueueStrictEqual(expected: unknown): this ``` Asserts that the queue name strictly equals the expected value. ```typescript toHaveQueueSatisfying(matcher: (value: string) => unknown): this ``` Asserts that the queue name satisfies the provided matcher function. ```typescript toHaveQueueContaining(substr: string): this ``` Asserts that the queue name contains the specified substring. ```typescript toHaveQueueMatching(expected: RegExp): this ``` Asserts that the queue name matches the specified regular expression. ```typescript toHaveMessageCount(expected: unknown): this ``` Asserts that the message count equals the expected value. ```typescript toHaveMessageCountEqual(expected: unknown): this ``` Asserts that the message count equals the expected value using deep equality. ```typescript toHaveMessageCountStrictEqual(expected: unknown): this ``` Asserts that the message count strictly equals the expected value. ```typescript toHaveMessageCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the message count satisfies the provided matcher function. ```typescript toHaveMessageCountNaN(): this ``` Asserts that the message count is NaN. ```typescript toHaveMessageCountGreaterThan(expected: number): this ``` Asserts that the message count is greater than the expected value. ```typescript toHaveMessageCountGreaterThanOrEqual(expected: number): this ``` Asserts that the message count is greater than or equal to the expected value. ```typescript toHaveMessageCountLessThan(expected: number): this ``` Asserts that the message count is less than the expected value. ```typescript toHaveMessageCountLessThanOrEqual(expected: number): this ``` Asserts that the message count is less than or equal to the expected value. ```typescript toHaveMessageCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the message count is close to the expected value. ```typescript toHaveConsumerCount(expected: unknown): this ``` Asserts that the consumer count equals the expected value. ```typescript toHaveConsumerCountEqual(expected: unknown): this ``` Asserts that the consumer count equals the expected value using deep equality. ```typescript toHaveConsumerCountStrictEqual(expected: unknown): this ``` Asserts that the consumer count strictly equals the expected value. ```typescript toHaveConsumerCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the consumer count satisfies the provided matcher function. ```typescript toHaveConsumerCountNaN(): this ``` Asserts that the consumer count is NaN. ```typescript toHaveConsumerCountGreaterThan(expected: number): this ``` Asserts that the consumer count is greater than the expected value. ```typescript toHaveConsumerCountGreaterThanOrEqual(expected: number): this ``` Asserts that the consumer count is greater than or equal to the expected value. ```typescript toHaveConsumerCountLessThan(expected: number): this ``` Asserts that the consumer count is less than the expected value. ```typescript toHaveConsumerCountLessThanOrEqual(expected: number): this ``` Asserts that the consumer count is less than or equal to the expected value. ```typescript toHaveConsumerCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the consumer count is close to the expected value. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `RabbitMqMessageProperties` ```typescript interface RabbitMqMessageProperties ``` RabbitMQ message properties. **Properties:** - [readonly] `contentType?`: `string` - [readonly] `contentEncoding?`: `string` - [readonly] `headers?`: `Record` - [readonly] `deliveryMode?`: `1 | 2` — 1: non-persistent, 2: persistent - [readonly] `priority?`: `number` - [readonly] `correlationId?`: `string` - [readonly] `replyTo?`: `string` - [readonly] `expiration?`: `string` - [readonly] `messageId?`: `string` - [readonly] `timestamp?`: `number` - [readonly] `type?`: `string` - [readonly] `userId?`: `string` - [readonly] `appId?`: `string` --- ### `RabbitMqMessageFields` ```typescript interface RabbitMqMessageFields ``` RabbitMQ message fields. **Properties:** - [readonly] `deliveryTag`: `bigint` - [readonly] `redelivered`: `boolean` - [readonly] `exchange`: `string` - [readonly] `routingKey`: `string` --- ### `RabbitMqMessage` ```typescript interface RabbitMqMessage ``` RabbitMQ message. **Properties:** - [readonly] `content`: `Uint8Array` - [readonly] `properties`: `RabbitMqMessageProperties` - [readonly] `fields`: `RabbitMqMessageFields` --- ### `RabbitMqConnectionConfig` ```typescript interface RabbitMqConnectionConfig extends CommonConnectionConfig ``` RabbitMQ connection configuration. Extends CommonConnectionConfig with RabbitMQ-specific options. **Properties:** - [readonly] `vhost?`: `string` — Virtual host. --- ### `RabbitMqClientConfig` ```typescript interface RabbitMqClientConfig extends CommonOptions ``` RabbitMQ client configuration. **Properties:** - [readonly] `url`: `string | RabbitMqConnectionConfig` — RabbitMQ connection URL or configuration object. - [readonly] `heartbeat?`: `number` — Heartbeat interval in seconds - [readonly] `prefetch?`: `number` — Default prefetch count for channels - [readonly] `throwOnError?`: `boolean` — Whether to throw errors instead of returning them in results. --- ### `RabbitMqOptions` ```typescript interface RabbitMqOptions extends CommonOptions ``` Base options for RabbitMQ operations. **Properties:** - [readonly] `throwOnError?`: `boolean` — Whether to throw errors instead of returning them in results. Overrides the client-level `throwOnError` setting. --- ### `RabbitMqExchangeOptions` ```typescript interface RabbitMqExchangeOptions extends RabbitMqOptions ``` Exchange options. **Properties:** - [readonly] `durable?`: `boolean` - [readonly] `autoDelete?`: `boolean` - [readonly] `internal?`: `boolean` - [readonly] `arguments?`: `Record` --- ### `RabbitMqQueueOptions` ```typescript interface RabbitMqQueueOptions extends RabbitMqOptions ``` Queue options. **Properties:** - [readonly] `durable?`: `boolean` - [readonly] `exclusive?`: `boolean` - [readonly] `autoDelete?`: `boolean` - [readonly] `arguments?`: `Record` - [readonly] `messageTtl?`: `number` - [readonly] `maxLength?`: `number` - [readonly] `deadLetterExchange?`: `string` - [readonly] `deadLetterRoutingKey?`: `string` --- ### `RabbitMqPublishOptions` ```typescript interface RabbitMqPublishOptions extends RabbitMqOptions ``` Publish options. **Properties:** - [readonly] `persistent?`: `boolean` - [readonly] `contentType?`: `string` - [readonly] `contentEncoding?`: `string` - [readonly] `headers?`: `Record` - [readonly] `correlationId?`: `string` - [readonly] `replyTo?`: `string` - [readonly] `expiration?`: `string` - [readonly] `messageId?`: `string` - [readonly] `priority?`: `number` --- ### `RabbitMqConsumeOptions` ```typescript interface RabbitMqConsumeOptions extends RabbitMqOptions ``` Consume options. **Properties:** - [readonly] `noAck?`: `boolean` - [readonly] `exclusive?`: `boolean` - [readonly] `priority?`: `number` --- ### `RabbitMqNackOptions` ```typescript interface RabbitMqNackOptions extends RabbitMqOptions ``` Nack options. **Properties:** - [readonly] `requeue?`: `boolean` - [readonly] `allUpTo?`: `boolean` --- ### `RabbitMqRejectOptions` ```typescript interface RabbitMqRejectOptions extends RabbitMqOptions ``` Reject options. **Properties:** - [readonly] `requeue?`: `boolean` --- ### `RabbitMqChannel` ```typescript interface RabbitMqChannel extends AsyncDisposable ``` RabbitMQ channel interface. **Methods:** ```typescript assertExchange( name: string, type: RabbitMqExchangeType, options?: RabbitMqExchangeOptions, ): Promise ``` ```typescript deleteExchange( name: string, options?: RabbitMqOptions, ): Promise ``` ```typescript assertQueue( name: string, options?: RabbitMqQueueOptions, ): Promise ``` ```typescript deleteQueue( name: string, options?: RabbitMqOptions, ): Promise ``` ```typescript purgeQueue( name: string, options?: RabbitMqOptions, ): Promise ``` ```typescript bindQueue( queue: string, exchange: string, routingKey: string, options?: RabbitMqOptions, ): Promise ``` ```typescript unbindQueue( queue: string, exchange: string, routingKey: string, options?: RabbitMqOptions, ): Promise ``` ```typescript publish( exchange: string, routingKey: string, content: Uint8Array, options?: RabbitMqPublishOptions, ): Promise ``` ```typescript sendToQueue( queue: string, content: Uint8Array, options?: RabbitMqPublishOptions, ): Promise ``` ```typescript get(queue: string, options?: RabbitMqOptions): Promise ``` ```typescript consume( queue: string, options?: RabbitMqConsumeOptions, ): AsyncIterable ``` ```typescript ack( message: RabbitMqMessage, options?: RabbitMqOptions, ): Promise ``` ```typescript nack( message: RabbitMqMessage, options?: RabbitMqNackOptions, ): Promise ``` ```typescript reject( message: RabbitMqMessage, options?: RabbitMqRejectOptions, ): Promise ``` ```typescript prefetch(count: number): Promise ``` ```typescript close(): Promise ``` --- ### `RabbitMqClient` ```typescript interface RabbitMqClient extends AsyncDisposable ``` RabbitMQ client interface. **Properties:** - [readonly] `config`: `RabbitMqClientConfig` **Methods:** ```typescript channel(): Promise ``` ```typescript close(): Promise ``` --- ### `RabbitMqErrorOptions` ```typescript interface RabbitMqErrorOptions extends ErrorOptions ``` Options for RabbitMQ errors. **Properties:** - [readonly] `code?`: `number` --- ### `RabbitMqChannelErrorOptions` ```typescript interface RabbitMqChannelErrorOptions extends RabbitMqErrorOptions ``` Options for RabbitMQ channel errors. **Properties:** - [readonly] `channelId?`: `number` --- ### `RabbitMqNotFoundErrorOptions` ```typescript interface RabbitMqNotFoundErrorOptions extends RabbitMqErrorOptions ``` Options for RabbitMQ not found errors. **Properties:** - [readonly] `resource`: `string` --- ### `RabbitMqPreconditionFailedErrorOptions` ```typescript interface RabbitMqPreconditionFailedErrorOptions extends RabbitMqErrorOptions ``` Options for RabbitMQ precondition failed errors. **Properties:** - [readonly] `reason`: `string` --- ### `RabbitMqPublishResultSuccess` ```typescript interface RabbitMqPublishResultSuccess extends RabbitMqPublishResultBase ``` Successful publish result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `RabbitMqPublishResultError` ```typescript interface RabbitMqPublishResultError extends RabbitMqPublishResultBase ``` Publish result with RabbitMQ error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqOperationError` --- ### `RabbitMqPublishResultFailure` ```typescript interface RabbitMqPublishResultFailure extends RabbitMqPublishResultBase ``` Publish result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqFailureError` --- ### `RabbitMqConsumeResultSuccess` ```typescript interface RabbitMqConsumeResultSuccess extends RabbitMqConsumeResultBase ``` Successful consume result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `message`: `RabbitMqMessage | null` --- ### `RabbitMqConsumeResultError` ```typescript interface RabbitMqConsumeResultError extends RabbitMqConsumeResultBase ``` Consume result with RabbitMQ error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqOperationError` - [readonly] `message`: `null` --- ### `RabbitMqConsumeResultFailure` ```typescript interface RabbitMqConsumeResultFailure extends RabbitMqConsumeResultBase ``` Consume result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqFailureError` - [readonly] `message`: `null` --- ### `RabbitMqAckResultSuccess` ```typescript interface RabbitMqAckResultSuccess extends RabbitMqAckResultBase ``` Successful ack result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `RabbitMqAckResultError` ```typescript interface RabbitMqAckResultError extends RabbitMqAckResultBase ``` Ack result with RabbitMQ error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqOperationError` --- ### `RabbitMqAckResultFailure` ```typescript interface RabbitMqAckResultFailure extends RabbitMqAckResultBase ``` Ack result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqFailureError` --- ### `RabbitMqQueueResultSuccess` ```typescript interface RabbitMqQueueResultSuccess extends RabbitMqQueueResultBase ``` Successful queue result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` - [readonly] `queue`: `string` - [readonly] `messageCount`: `number` - [readonly] `consumerCount`: `number` --- ### `RabbitMqQueueResultError` ```typescript interface RabbitMqQueueResultError extends RabbitMqQueueResultBase ``` Queue result with RabbitMQ error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqOperationError` - [readonly] `queue`: `null` - [readonly] `messageCount`: `null` - [readonly] `consumerCount`: `null` --- ### `RabbitMqQueueResultFailure` ```typescript interface RabbitMqQueueResultFailure extends RabbitMqQueueResultBase ``` Queue result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqFailureError` - [readonly] `queue`: `null` - [readonly] `messageCount`: `null` - [readonly] `consumerCount`: `null` --- ### `RabbitMqExchangeResultSuccess` ```typescript interface RabbitMqExchangeResultSuccess extends RabbitMqExchangeResultBase ``` Successful exchange result. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `true` - [readonly] `error`: `null` --- ### `RabbitMqExchangeResultError` ```typescript interface RabbitMqExchangeResultError extends RabbitMqExchangeResultBase ``` Exchange result with RabbitMQ error. **Properties:** - [readonly] `processed`: `true` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqOperationError` --- ### `RabbitMqExchangeResultFailure` ```typescript interface RabbitMqExchangeResultFailure extends RabbitMqExchangeResultBase ``` Exchange result with connection failure. **Properties:** - [readonly] `processed`: `false` - [readonly] `ok`: `false` - [readonly] `error`: `RabbitMqFailureError` --- ### `SqlQueryResultExpectation` ```typescript interface SqlQueryResultExpectation ``` Expectation interface for SQL query results. All methods return `this` for chaining. **Properties:** - [readonly] `not`: `this` — Negates the next assertion. **Methods:** ```typescript toBeOk(): this ``` Asserts that the result is successful. ```typescript toHaveRows(expected: unknown): this ``` Asserts that the rows equal the expected value. ```typescript toHaveRowsEqual(expected: unknown): this ``` Asserts that the rows equal the expected value using deep equality. ```typescript toHaveRowsStrictEqual(expected: unknown): this ``` Asserts that the rows strictly equal the expected value. ```typescript toHaveRowsSatisfying(matcher: (value: SqlRows) => unknown): this ``` Asserts that the rows satisfy the provided matcher function. ```typescript toHaveRowsContaining(item: unknown): this ``` Asserts that the rows array contains the specified item. ```typescript toHaveRowsContainingEqual(item: unknown): this ``` Asserts that the rows array contains an item equal to the specified value. ```typescript toHaveRowsMatching( subset: Record | Record[], ): this ``` Asserts that the rows array matches the specified subset. ```typescript toHaveRowsEmpty(): this ``` Asserts that the rows array is empty. ```typescript toHaveRowCount(expected: unknown): this ``` Asserts that the row count equals the expected value. ```typescript toHaveRowCountEqual(expected: unknown): this ``` Asserts that the row count equals the expected value using deep equality. ```typescript toHaveRowCountStrictEqual(expected: unknown): this ``` Asserts that the row count strictly equals the expected value. ```typescript toHaveRowCountSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the row count satisfies the provided matcher function. ```typescript toHaveRowCountNaN(): this ``` Asserts that the row count is NaN. ```typescript toHaveRowCountGreaterThan(expected: number): this ``` Asserts that the row count is greater than the expected value. ```typescript toHaveRowCountGreaterThanOrEqual(expected: number): this ``` Asserts that the row count is greater than or equal to the expected value. ```typescript toHaveRowCountLessThan(expected: number): this ``` Asserts that the row count is less than the expected value. ```typescript toHaveRowCountLessThanOrEqual(expected: number): this ``` Asserts that the row count is less than or equal to the expected value. ```typescript toHaveRowCountCloseTo(expected: number, numDigits?: number): this ``` Asserts that the row count is close to the expected value. ```typescript toHaveLastInsertId(expected: unknown): this ``` Asserts that the last insert ID equals the expected value. ```typescript toHaveLastInsertIdEqual(expected: unknown): this ``` Asserts that the last insert ID equals the expected value using deep equality. ```typescript toHaveLastInsertIdStrictEqual(expected: unknown): this ``` Asserts that the last insert ID strictly equals the expected value. ```typescript toHaveLastInsertIdSatisfying(matcher: (value: any) => unknown): this ``` Asserts that the last insert ID satisfies the provided matcher function. ```typescript toHaveLastInsertIdPresent(): this ``` Asserts that the last insert ID is present (not null or undefined). ```typescript toHaveLastInsertIdNull(): this ``` Asserts that the last insert ID is null. ```typescript toHaveLastInsertIdUndefined(): this ``` Asserts that the last insert ID is undefined. ```typescript toHaveLastInsertIdNullish(): this ``` Asserts that the last insert ID is nullish (null or undefined). ```typescript toHaveWarnings(expected: unknown): this ``` Asserts that the warnings equal the expected value. ```typescript toHaveWarningsEqual(expected: unknown): this ``` Asserts that the warnings equal the expected value using deep equality. ```typescript toHaveWarningsStrictEqual(expected: unknown): this ``` Asserts that the warnings strictly equal the expected value. ```typescript toHaveWarningsSatisfying(matcher: (value: SqlWarnings) => unknown): this ``` Asserts that the warnings satisfy the provided matcher function. ```typescript toHaveWarningsPresent(): this ``` Asserts that the warnings are present (not null or undefined). ```typescript toHaveWarningsNull(): this ``` Asserts that the warnings are null. ```typescript toHaveWarningsUndefined(): this ``` Asserts that the warnings are undefined. ```typescript toHaveWarningsNullish(): this ``` Asserts that the warnings are nullish (null or undefined). ```typescript toHaveWarningsContaining(item: unknown): this ``` Asserts that the warnings array contains the specified item. ```typescript toHaveWarningsContainingEqual(item: unknown): this ``` Asserts that the warnings array contains an item equal to the specified value. ```typescript toHaveWarningsMatching( subset: Record | Record[], ): this ``` Asserts that the warnings array matches the specified subset. ```typescript toHaveWarningsEmpty(): this ``` Asserts that the warnings array is empty. ```typescript toHaveDuration(expected: unknown): this ``` Asserts that the duration equals the expected value. ```typescript toHaveDurationEqual(expected: unknown): this ``` Asserts that the duration equals the expected value using deep equality. ```typescript toHaveDurationStrictEqual(expected: unknown): this ``` Asserts that the duration strictly equals the expected value. ```typescript toHaveDurationSatisfying(matcher: (value: number) => unknown): this ``` Asserts that the duration satisfies the provided matcher function. ```typescript toHaveDurationNaN(): this ``` Asserts that the duration is NaN. ```typescript toHaveDurationGreaterThan(expected: number): this ``` Asserts that the duration is greater than the expected value. ```typescript toHaveDurationGreaterThanOrEqual(expected: number): this ``` Asserts that the duration is greater than or equal to the expected value. ```typescript toHaveDurationLessThan(expected: number): this ``` Asserts that the duration is less than the expected value. ```typescript toHaveDurationLessThanOrEqual(expected: number): this ``` Asserts that the duration is less than or equal to the expected value. ```typescript toHaveDurationCloseTo(expected: number, numDigits?: number): this ``` Asserts that the duration is close to the expected value. --- ### `SqlQueryOptions` ```typescript interface SqlQueryOptions extends CommonOptions ``` Options for individual SQL queries. **Properties:** - [readonly] `throwOnError?`: `boolean` — Whether to throw an error for query failures. When false, failures are returned as SqlQueryResultError or SqlQueryResultFailure. --- ### `SqlTransactionOptions` ```typescript interface SqlTransactionOptions ``` Options for starting a transaction. **Properties:** - [readonly] `isolationLevel?`: `SqlIsolationLevel` — Isolation level for the transaction --- ### `SqlTransaction` ```typescript interface SqlTransaction ``` SQL transaction interface. Implementations should provide actual database-specific transaction handling. **Methods:** ```typescript query>( sql: string, params?: unknown[], options?: SqlQueryOptions, ): Promise> ``` Execute a query within the transaction. ```typescript queryOne>( sql: string, params?: unknown[], options?: SqlQueryOptions, ): Promise ``` Execute a query and return the first row or undefined. ```typescript commit(): Promise ``` Commit the transaction. ```typescript rollback(): Promise ``` Rollback the transaction. --- ### `SqlErrorOptions` ```typescript interface SqlErrorOptions extends ErrorOptions ``` Options for SqlError constructor. **Properties:** - [readonly] `sqlState?`: `string` — SQL State code (e.g., "23505" for unique violation) --- ### `SqlQueryResultSuccess` ```typescript interface SqlQueryResultSuccess extends SqlQueryResultBase ``` SQL query result for successful queries. The query was executed successfully and returned results. **Properties:** - [readonly] `processed`: `true` — Server processed the query. - [readonly] `ok`: `true` — Query succeeded. - [readonly] `error`: `null` — No error for successful queries. - [readonly] `rows`: `readonly T[]` — Query result rows. - [readonly] `rowCount`: `number` — Number of affected rows. - [readonly] `lastInsertId`: `bigint | string | null` — Last inserted ID (for INSERT statements). - [readonly] `warnings`: `unknown | null` — Warning messages from the database. --- ### `SqlQueryResultError` ```typescript interface SqlQueryResultError extends SqlQueryResultBase ``` SQL query result for query errors (syntax errors, constraint violations, etc.). Server received and processed the query, but it failed due to a SQL error. **Properties:** - [readonly] `processed`: `true` — Server processed the query. - [readonly] `ok`: `false` — Query failed. - [readonly] `error`: `SqlError` — Error describing the SQL error. - [readonly] `rows`: `readonly never[]` — Empty rows for failed queries. - [readonly] `rowCount`: `0` — Zero affected rows for failed queries. - [readonly] `lastInsertId`: `null` — No lastInsertId for failed queries. - [readonly] `warnings`: `null` — No warnings for failed queries. --- ### `SqlQueryResultFailure` ```typescript interface SqlQueryResultFailure extends SqlQueryResultBase ``` SQL query result for connection failures (network errors, timeouts, etc.). Query could not be processed by the server (connection refused, timeout, pool exhausted, authentication failure, etc.). **Properties:** - [readonly] `processed`: `false` — Server did not process the query. - [readonly] `ok`: `false` — Query failed. - [readonly] `error`: `SqlFailureError` — Error describing the failure. - [readonly] `rows`: `null` — No rows (query didn't reach server). - [readonly] `rowCount`: `null` — No row count (query didn't reach server). - [readonly] `lastInsertId`: `null` — No lastInsertId (query didn't reach server). - [readonly] `warnings`: `null` — No warnings (query didn't reach server). --- ### `SqlQueryResultSuccessParams` ```typescript interface SqlQueryResultSuccessParams ``` Parameters for creating a SqlQueryResultSuccess. **Properties:** - [readonly] `rows`: `readonly T[]` — The result rows - [readonly] `rowCount`: `number` — Number of affected rows (for INSERT/UPDATE/DELETE) - [readonly] `duration`: `number` — Query execution duration in milliseconds - [readonly] `lastInsertId?`: `bigint | string` — Last inserted ID (for INSERT statements) - [readonly] `warnings?`: `readonly string[]` — Warning messages from the database --- ## Functions ### `expect` (11 overloads) **Overload 1:** ```typescript function expect( value: NotAny, ): HttpResponseExpectation ``` Unified expect function that dispatches to the appropriate expectation function based on the type of the input object. **Overload 2:** ```typescript function expect( value: NotAny, ): ConnectRpcResponseExpectation ``` **Overload 3:** ```typescript function expect( value: NotAny, ): GraphqlResponseExpectation ``` **Overload 4:** ```typescript function expect( value: NotAny, ): SqlQueryResultExpectation ``` **Overload 5:** ```typescript function expect(value: NotAny): DenoKvExpectation ``` **Overload 6:** ```typescript function expect(value: NotAny): RedisExpectation ``` **Overload 7:** ```typescript function expect(value: NotAny): MongoExpectation ``` **Overload 8:** ```typescript function expect( value: NotAny, ): RabbitMqExpectation ``` **Overload 9:** ```typescript function expect(value: NotAny): SqsExpectation ``` **Overload 10:** ```typescript function expect(value: any): AnythingExpectation ``` **Overload 11:** ```typescript function expect(value: unknown): unknown ``` --- ### `isExpectationError` ```typescript function isExpectationError(err: unknown): boolean ``` Check if an error is an ExpectationError. Handles both same-process (instanceof) and cross-process (name check) scenarios, supporting worker serialization. **Parameters:** - `err`: `unknown` **Returns:** `boolean` --- ### `expectAnything` ```typescript function expectAnything(value: T): AnythingExpectation ``` Creates a chainable expectation for any value using @std/expect matchers. This wrapper allows method chaining, unlike @std/expect which returns void. **Parameters:** - `value`: `T` — - Value to test **Returns:** `AnythingExpectation` Chainable expectation interface **Example:** ```ts import { expectAnything } from "@probitas/expect"; // Method chaining expectAnything(42) .toBeDefined() .toBeGreaterThan(40) .toBeLessThan(50); // Negation with continued chaining expectAnything("hello") .not.toBe("world") .not.toBeNull() .toContain("ello"); ``` --- ### `expectHttpResponse` ```typescript function expectHttpResponse(response: HttpResponse): HttpResponseExpectation ``` **Parameters:** - `response`: `HttpResponse` **Returns:** `HttpResponseExpectation` --- ### `createHttpClient` ```typescript function createHttpClient(config: HttpClientConfig): HttpClient ``` Create a new HTTP client instance. The client provides methods for making HTTP requests with automatic cookie handling, response body pre-loading, and error handling. **Parameters:** - `config`: `HttpClientConfig` — - Client configuration including URL and default options **Returns:** `HttpClient` A new HTTP client instance **Example:** Basic usage with string URL ```ts import { createHttpClient } from "@probitas/client-http"; const http = createHttpClient({ url: "http://localhost:3000" }); const response = await http.get("/users/123"); console.log(response.json); await http.close(); ``` With connection config object ```ts import { createHttpClient } from "@probitas/client-http"; const http = createHttpClient({ url: { host: "api.example.com", port: 443, protocol: "https" }, }); await http.close(); ``` With default headers ```ts import { createHttpClient } from "@probitas/client-http"; const http = createHttpClient({ url: "http://localhost:3000", headers: { "Authorization": "Bearer token123", "Accept": "application/json", }, }); await http.close(); ``` Using `await using` for automatic cleanup ```ts import { createHttpClient } from "@probitas/client-http"; await using http = createHttpClient({ url: "http://localhost:3000" }); const response = await http.get("/health"); console.log(response.ok); ``` --- ### `expectGraphqlResponse` ```typescript function expectGraphqlResponse( response: GraphqlResponse, ): GraphqlResponseExpectation ``` **Parameters:** - `response`: `GraphqlResponse` **Returns:** `GraphqlResponseExpectation` --- ### `createGraphqlClient` ```typescript function createGraphqlClient(config: GraphqlClientConfig): GraphqlClient ``` Create a new GraphQL client instance. The client provides methods for executing GraphQL queries, mutations, and subscriptions with automatic error handling and response parsing. **Parameters:** - `config`: `GraphqlClientConfig` — - Client configuration including URL and default options **Returns:** `GraphqlClient` A new GraphQL client instance **Example:** Basic query ```ts import { createGraphqlClient } from "@probitas/client-graphql"; const client = createGraphqlClient({ url: "http://localhost:4000/graphql", }); const response = await client.query(` query GetUser($id: ID!) { user(id: $id) { id name email } } `, { id: "123" }); console.log(response.data); await client.close(); ``` Using connection config object ```ts import { createGraphqlClient } from "@probitas/client-graphql"; const client = createGraphqlClient({ url: { host: "api.example.com", port: 443, protocol: "https" }, }); await client.close(); ``` Mutation with error handling ```ts import { createGraphqlClient } from "@probitas/client-graphql"; const client = createGraphqlClient({ url: "http://localhost:4000/graphql" }); const response = await client.mutation(` mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { id } } `, { input: { name: "Alice", email: "alice@example.com" } }); if (response.ok) { console.log("Created user:", (response.data as any).createUser.id); } await client.close(); ``` Using `await using` for automatic cleanup ```ts import { createGraphqlClient } from "@probitas/client-graphql"; await using client = createGraphqlClient({ url: "http://localhost:4000/graphql", }); const response = await client.query(`{ __typename }`); // Client automatically closed when scope exits ``` --- ### `expectConnectRpcResponse` ```typescript function expectConnectRpcResponse( response: ConnectRpcResponse, ): ConnectRpcResponseExpectation ``` **Parameters:** - `response`: `ConnectRpcResponse` **Returns:** `ConnectRpcResponseExpectation` --- ### `getStatusName` ```typescript function getStatusName(code: ConnectRpcStatusCode): string ``` Get the name of a ConnectRPC/gRPC status code. **Parameters:** - `code`: `ConnectRpcStatusCode` **Returns:** `string` **Example:** ```typescript getStatusName(0); // "OK" getStatusName(5); // "NOT_FOUND" getStatusName(16); // "UNAUTHENTICATED" ``` --- ### `isConnectRpcStatusCode` ```typescript function isConnectRpcStatusCode(code: number): code is ConnectRpcStatusCode ``` Check if a number is a valid ConnectRPC/gRPC status code. **Parameters:** - `code`: `number` **Returns:** `code is ConnectRpcStatusCode` **Example:** ```typescript isConnectRpcStatusCode(0); // true isConnectRpcStatusCode(16); // true isConnectRpcStatusCode(99); // false ``` --- ### `fromConnectError` ```typescript function fromConnectError( error: ConnectError, metadata?: Headers, ): ConnectRpcError ``` Convert ConnectRPC's ConnectError to ConnectRpcError. **Parameters:** - `error`: `ConnectError` — - The ConnectError from @connectrpc/connect - `metadata`: `Headers` (optional) — - Optional metadata from the response **Returns:** `ConnectRpcError` ConnectRpcError with statusCode for discrimination --- ### `createConnectRpcClient` ```typescript function createConnectRpcClient( config: ConnectRpcClientConfig, ): ConnectRpcClient ``` Create a new ConnectRPC client instance. The client supports multiple protocols (Connect, gRPC, gRPC-Web) and provides Server Reflection for runtime service discovery without compile-time code generation. **Parameters:** - `config`: `ConnectRpcClientConfig` — - Client configuration including server URL and protocol options **Returns:** `ConnectRpcClient` A new ConnectRPC client instance **Example:** Basic usage with reflection ```ts import { createConnectRpcClient } from "@probitas/client-connectrpc"; const client = createConnectRpcClient({ url: "http://localhost:50051", }); // Call a method const response = await client.call( "echo.EchoService", "echo", { message: "Hello!" } ); console.log(response.data); await client.close(); ``` Service discovery with reflection ```ts import { createConnectRpcClient } from "@probitas/client-connectrpc"; const client = createConnectRpcClient({ url: "http://localhost:50051", }); // Discover available services const services = await client.reflection.listServices(); console.log("Services:", services); // Get method information const info = await client.reflection.getServiceInfo("echo.EchoService"); console.log("Methods:", info.methods); await client.close(); ``` Using different protocols ```ts import { createConnectRpcClient } from "@probitas/client-connectrpc"; // Connect protocol (HTTP/1.1 or HTTP/2) const connectClient = createConnectRpcClient({ url: "http://localhost:8080", protocol: "connect", }); // gRPC protocol (HTTP/2 with binary protobuf) const grpcClient = createConnectRpcClient({ url: "http://localhost:50051", protocol: "grpc", }); // gRPC-Web protocol (for browser compatibility) const grpcWebClient = createConnectRpcClient({ url: "http://localhost:8080", protocol: "grpc-web", }); await connectClient.close(); await grpcClient.close(); await grpcWebClient.close(); ``` Using connection config object ```ts import { createConnectRpcClient } from "@probitas/client-connectrpc"; const client = createConnectRpcClient({ url: { host: "grpc.example.com", port: 443, protocol: "https", }, }); await client.close(); ``` Using `await using` for automatic cleanup ```ts import { createConnectRpcClient } from "@probitas/client-connectrpc"; await using client = createConnectRpcClient({ url: "http://localhost:50051", }); const res = await client.call("echo.EchoService", "echo", { message: "test" }); // Client automatically closed when scope exits ``` --- ### `expectGrpcResponse` ```typescript function expectGrpcResponse(response: GrpcResponse): GrpcResponseExpectation ``` **Parameters:** - `response`: `GrpcResponse` **Returns:** `GrpcResponseExpectation` --- ### `createGrpcClient` ```typescript function createGrpcClient(config: GrpcClientConfig): ConnectRpcClient ``` Create a new gRPC client instance. This is a thin wrapper around `createConnectRpcClient` with `protocol: "grpc"` fixed. The client provides Server Reflection support for runtime service discovery. **Parameters:** - `config`: `GrpcClientConfig` — - Client configuration including server address **Returns:** `ConnectRpcClient` A new gRPC client instance **Example:** Basic usage with reflection ```ts import { createGrpcClient } from "@probitas/client-grpc"; const client = createGrpcClient({ url: "http://localhost:50051", }); // Call a method const response = await client.call( "echo.EchoService", "echo", { message: "Hello!" } ); console.log(response.data); await client.close(); ``` Service discovery with reflection ```ts import { createGrpcClient } from "@probitas/client-grpc"; const client = createGrpcClient({ url: "http://localhost:50051", }); // Discover available services const services = await client.reflection.listServices(); console.log("Available services:", services); // Get method information const info = await client.reflection.getServiceInfo("echo.EchoService"); console.log("Methods:", info.methods); await client.close(); ``` Testing error responses ```ts import { createGrpcClient } from "@probitas/client-grpc"; const client = createGrpcClient({ url: "http://localhost:50051" }); const response = await client.call( "user.UserService", "getUser", { id: "non-existent" }, { throwOnError: false } ); if (!response.ok) { console.log("Error code:", response.statusCode); // NOT_FOUND = 5 } await client.close(); ``` Using `await using` for automatic cleanup ```ts import { createGrpcClient } from "@probitas/client-grpc"; await using client = createGrpcClient({ url: "http://localhost:50051", }); const res = await client.call("echo.EchoService", "echo", { message: "test" }); console.log(res.data); // Client automatically closed when scope exits ``` --- ### `expectRedisResult` ```typescript function expectRedisResult( result: R, ): RedisExpectation ``` Create a fluent expectation chain for any Redis result validation. This unified function accepts any Redis result type and returns the appropriate expectation interface based on the result's type discriminator. **Parameters:** - `result`: `R` **Returns:** `RedisExpectation` **Example:** ```ts import type { RedisGetResult, RedisCountResult, RedisArrayResult } from "@probitas/client-redis"; import { expectRedisResult } from "./redis.ts"; // For GET result - returns RedisGetResultExpectation const getResult = { kind: "redis:get", ok: true, value: "expected", duration: 0, } as unknown as RedisGetResult; expectRedisResult(getResult).toBeOk().toHaveValue("expected"); // For COUNT result - returns RedisCountResultExpectation const countResult = { kind: "redis:count", ok: true, value: 1, duration: 0, } as unknown as RedisCountResult; expectRedisResult(countResult).toBeOk().toHaveValue(1); // For ARRAY result - returns RedisArrayResultExpectation const arrayResult = { kind: "redis:array", ok: true, value: ["a", "b", "item"], duration: 0, } as unknown as RedisArrayResult; expectRedisResult(arrayResult).toBeOk().toHaveValueCount(3).toHaveValueContaining("item"); ``` --- ### `createRedisClient` ```typescript async function createRedisClient( config: RedisClientConfig, ): Promise ``` Create a new Redis client instance. The client provides comprehensive Redis data structure support including strings, hashes, lists, sets, sorted sets, pub/sub, and transactions. **Parameters:** - `config`: `RedisClientConfig` — - Redis client configuration **Returns:** `Promise` A promise resolving to a new Redis client instance **Example:** Using URL string ```ts import { createRedisClient } from "@probitas/client-redis"; const client = await createRedisClient({ url: "redis://localhost:6379/0", }); await client.set("key", "value"); const result = await client.get("key"); if (result.ok) { console.log(result.value); // "value" } await client.close(); ``` Using connection config object ```ts import { createRedisClient } from "@probitas/client-redis"; const client = await createRedisClient({ url: { host: "localhost", port: 6379, password: "secret", db: 0, }, }); await client.close(); ``` Set with expiration ```ts import { createRedisClient } from "@probitas/client-redis"; const client = await createRedisClient({ url: "redis://localhost:6379" }); const sessionData = JSON.stringify({ userId: "123" }); const data = "temporary value"; // Set key with 1 hour TTL await client.set("session", sessionData, { ex: 3600 }); // Set key with 5 second TTL in milliseconds await client.set("temp", data, { px: 5000 }); await client.close(); ``` Hash operations ```ts import { createRedisClient } from "@probitas/client-redis"; const client = await createRedisClient({ url: "redis://localhost:6379" }); await client.hset("user:123", "name", "Alice"); await client.hset("user:123", "email", "alice@example.com"); const user = await client.hgetall("user:123"); if (user.ok) { console.log(user.value); // { name: "Alice", email: "alice@example.com" } } await client.close(); ``` Pub/Sub ```ts import { createRedisClient } from "@probitas/client-redis"; const client = await createRedisClient({ url: "redis://localhost:6379" }); // Subscribe to channel (this would run indefinitely in practice) // for await (const message of client.subscribe("events")) { // console.log("Received:", message.message); // } // Publish to channel await client.publish("events", JSON.stringify({ type: "user.created" })); await client.close(); ``` Using `await using` for automatic cleanup ```ts import { createRedisClient } from "@probitas/client-redis"; await using client = await createRedisClient({ url: "redis://localhost:6379", }); await client.set("test", "value"); // Client automatically closed when scope exits ``` --- ### `expectMongoResult` ```typescript function expectMongoResult( result: R, ): MongoExpectation ``` Create a fluent expectation chain for any MongoDB result validation. This unified function accepts any MongoDB result type and returns the appropriate expectation interface based on the result's type discriminator. **Parameters:** - `result`: `R` **Returns:** `MongoExpectation` **Example:** ```ts import type { MongoFindResult, MongoInsertOneResult, MongoUpdateResult, MongoDeleteResult, MongoFindOneResult, MongoCountResult } from "@probitas/client-mongodb"; import { expectMongoResult } from "./mongodb.ts"; // For find result - returns MongoFindResultExpectation const findResult = { kind: "mongo:find", ok: true, docs: [{ name: "Alice" }], duration: 0, } as unknown as MongoFindResult; expectMongoResult(findResult).toBeOk().toHaveDocsCount(1); // For insert result - returns MongoInsertOneResultExpectation const insertResult = { kind: "mongo:insert-one", ok: true, insertedId: "123", duration: 0, } as unknown as MongoInsertOneResult; expectMongoResult(insertResult).toBeOk().toHaveInsertedId("123"); // For update result - returns MongoUpdateResultExpectation const updateResult = { kind: "mongo:update", ok: true, matchedCount: 1, modifiedCount: 1, duration: 0, } as unknown as MongoUpdateResult; expectMongoResult(updateResult).toBeOk().toHaveMatchedCount(1).toHaveModifiedCount(1); // For delete result - returns MongoDeleteResultExpectation const deleteResult = { kind: "mongo:delete", ok: true, deletedCount: 1, duration: 0, } as unknown as MongoDeleteResult; expectMongoResult(deleteResult).toBeOk().toHaveDeletedCount(1); // For findOne result - returns MongoFindOneResultExpectation const findOneResult = { kind: "mongo:find-one", ok: true, doc: { name: "Alice" }, duration: 0, } as unknown as MongoFindOneResult; expectMongoResult(findOneResult).toBeOk().toHaveDocPresent(); // For count result - returns MongoCountResultExpectation const countResult = { kind: "mongo:count", ok: true, count: 10, duration: 0, } as unknown as MongoCountResult; expectMongoResult(countResult).toBeOk().toHaveCount(10); ``` --- ### `createMongoClient` ```typescript async function createMongoClient( config: MongoClientConfig, ): Promise ``` Create a new MongoDB client instance. The client provides typed collection access, aggregation pipelines, transaction support, and comprehensive CRUD operations. **Parameters:** - `config`: `MongoClientConfig` — - MongoDB client configuration **Returns:** `Promise` A promise resolving to a new MongoDB client instance **Example:** Basic usage with connection string ```ts import { createMongoClient } from "@probitas/client-mongodb"; const mongo = await createMongoClient({ url: "mongodb://localhost:27017", database: "testdb", }); const users = mongo.collection<{ name: string; age: number }>("users"); const result = await users.find({ age: { $gte: 18 } }); if (result.ok) { console.log(result.docs[0]); } else { console.error("Error:", result.error.message); } await mongo.close(); ``` Using connection config object ```ts import { createMongoClient } from "@probitas/client-mongodb"; const mongo = await createMongoClient({ url: { host: "localhost", port: 27017, username: "admin", password: "secret", authSource: "admin", }, database: "testdb", }); await mongo.close(); ``` Insert and query documents ```ts import { createMongoClient } from "@probitas/client-mongodb"; interface User { name: string; age: number } const mongo = await createMongoClient({ url: "mongodb://localhost:27017", database: "testdb", }); const users = mongo.collection("users"); // Insert a document const insertResult = await users.insertOne({ name: "Alice", age: 30 }); if (insertResult.ok) { console.log("Inserted ID:", insertResult.insertedId); } // Find documents with projection and sorting const findResult = await users.find( { age: { $gte: 25 } }, { sort: { name: 1 }, limit: 10 } ); if (findResult.ok) { console.log("Found:", findResult.docs.length); } await mongo.close(); ``` Transaction with auto-commit/rollback ```ts import { createMongoClient } from "@probitas/client-mongodb"; interface User { _id?: unknown; name: string; age: number } const mongo = await createMongoClient({ url: "mongodb://localhost:27017", database: "testdb", }); await mongo.transaction(async (session) => { const users = session.collection("users"); const insertResult = await users.insertOne({ name: "Bob", age: 25 }); if (!insertResult.ok) throw insertResult.error; const updateResult = await users.updateOne( { name: "Alice" }, { $inc: { age: 1 } } ); if (!updateResult.ok) throw updateResult.error; }); await mongo.close(); ``` Aggregation pipeline ```ts import { createMongoClient } from "@probitas/client-mongodb"; interface User { name: string; age: number; department: string } const mongo = await createMongoClient({ url: "mongodb://localhost:27017", database: "testdb", }); const users = mongo.collection("users"); const result = await users.aggregate<{ _id: string; avgAge: number }>([ { $group: { _id: "$department", avgAge: { $avg: "$age" } } }, { $sort: { avgAge: -1 } }, ]); if (result.ok) { console.log(result.docs); } await mongo.close(); ``` Using `await using` for automatic cleanup ```ts import { createMongoClient } from "@probitas/client-mongodb"; await using mongo = await createMongoClient({ url: "mongodb://localhost:27017", database: "testdb", }); const result = await mongo.collection("users").find({}); if (result.ok) { console.log(result.docs); } // Client automatically closed when scope exits ``` --- ### `expectDenoKvResult` ```typescript function expectDenoKvResult( result: R, ): DenoKvExpectation ``` Create a fluent expectation chain for any Deno KV result validation. This unified function accepts any Deno KV result type and returns the appropriate expectation interface based on the result's type discriminator. **Parameters:** - `result`: `R` **Returns:** `DenoKvExpectation` **Example:** ```ts import type { DenoKvGetResult, DenoKvSetResult, DenoKvListResult, DenoKvDeleteResult, DenoKvAtomicResult } from "@probitas/client-deno-kv"; import { expectDenoKvResult } from "./deno_kv.ts"; // For GET result - returns DenoKvGetResultExpectation const getResult = { kind: "deno-kv:get", ok: true, key: ["users", "1"], value: { name: "Alice" }, versionstamp: "00000000000000010000", duration: 0, } as unknown as DenoKvGetResult<{ name: string }>; expectDenoKvResult(getResult).toBeOk().toHaveValuePresent(); // For SET result - returns DenoKvSetResultExpectation const setResult = { kind: "deno-kv:set", ok: true, versionstamp: "00000000000000010000", duration: 0, } as unknown as DenoKvSetResult; expectDenoKvResult(setResult).toBeOk().toHaveVersionstamp("00000000000000010000"); // For LIST result - returns DenoKvListResultExpectation const listResult = { kind: "deno-kv:list", ok: true, entries: [{ key: ["users", "1"], value: { name: "Alice" }, versionstamp: "00000000000000010000" }], duration: 0, } as unknown as DenoKvListResult<{ name: string }>; expectDenoKvResult(listResult).toBeOk().toHaveEntryCount(1); // For DELETE result - returns DenoKvDeleteResultExpectation const deleteResult = { kind: "deno-kv:delete", ok: true, duration: 0, } as unknown as DenoKvDeleteResult; expectDenoKvResult(deleteResult).toBeOk(); // For ATOMIC result - returns DenoKvAtomicResultExpectation const atomicResult = { kind: "deno-kv:atomic", ok: true, versionstamp: "00000000000000010000", duration: 0, } as unknown as DenoKvAtomicResult; expectDenoKvResult(atomicResult).toBeOk().toHaveVersionstamp("00000000000000010000"); ``` --- ### `createDenoKvClient` ```typescript async function createDenoKvClient( config?: DenoKvClientConfig, ): Promise ``` Create a new Deno KV client instance. The client provides key-value operations with support for atomic transactions, time-to-live (TTL), and prefix-based listing. **Parameters:** - `config`: `DenoKvClientConfig` (optional) — - Deno KV client configuration (optional) **Returns:** `Promise` A promise resolving to a new Deno KV client instance **Example:** Basic usage with in-memory database ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; interface User { name: string; email: string; } const kv = await createDenoKvClient(); await kv.set(["users", "123"], { name: "Alice", email: "alice@example.com" }); const result = await kv.get(["users", "123"]); if (result.ok) { console.log(result.value); // { name: "Alice", email: "alice@example.com" } } await kv.close(); ``` Using persistent storage ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; const kv = await createDenoKvClient({ path: "./data.kv", }); await kv.close(); ``` Set with expiration (TTL) ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; const kv = await createDenoKvClient(); const sessionId = "abc123"; const sessionData = { userId: "123", token: "xyz" }; await kv.set(["sessions", sessionId], sessionData, { expireIn: 3600_000, // Expire in 1 hour }); await kv.close(); ``` List entries by prefix ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; interface User { name: string; email: string; } const kv = await createDenoKvClient(); const result = await kv.list({ prefix: ["users"] }); if (result.ok) { for (const entry of result.entries) { console.log(entry.key, entry.value); } } await kv.close(); ``` Atomic transactions ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; const kv = await createDenoKvClient(); const atomicResult = await kv.atomic() .check({ key: ["counter"], versionstamp: null }) .set(["counter"], 1) .commit(); await kv.close(); ``` Using `await using` for automatic cleanup ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; await using kv = await createDenoKvClient(); await kv.set(["test"], "value"); // Client automatically closed when scope exits ``` Error handling with Failure pattern ```ts import { createDenoKvClient } from "@probitas/client-deno-kv"; async function example() { const kv = await createDenoKvClient(); const result = await kv.get(["key"]); if (!result.ok) { if (!result.processed) { // Connection failure console.error("Connection failed:", result.error.message); } else { // KV error (quota exceeded, etc.) console.error("KV error:", result.error.message); } await kv.close(); return; } console.log("Value:", result.value); await kv.close(); } ``` Using throwOnError for traditional exception handling ```ts import { createDenoKvClient, DenoKvError } from "@probitas/client-deno-kv"; const kv = await createDenoKvClient({ throwOnError: true }); try { const result = await kv.get(["key"]); console.log("Value:", result.value); } catch (error) { if (error instanceof DenoKvError) { console.error("KV error:", error.message); } } await kv.close(); ``` --- ### `expectSqsResult` ```typescript function expectSqsResult(result: R): SqsExpectation ``` Create a fluent expectation chain for any SQS result validation. This unified function accepts any SQS result type and returns the appropriate expectation interface based on the result's type discriminator. Supports send, sendBatch, receive, delete, deleteBatch, ensureQueue, and deleteQueue results. **Parameters:** - `result`: `R` — - The SQS result to create expectations for **Returns:** `SqsExpectation` A typed expectation object matching the result type **Example:** Send result validation ```ts import type { SqsSendResult } from "@probitas/client-sqs"; import { expectSqsResult } from "./sqs.ts"; const sendResult = { kind: "sqs:send", ok: true, messageId: "msg-123", md5OfBody: "abc123", sequenceNumber: undefined, duration: 50, } as unknown as SqsSendResult; expectSqsResult(sendResult) .toBeOk() .toHaveMessageIdContaining("msg") .toHaveDurationLessThan(1000); ``` Receive result validation ```ts import type { SqsReceiveResult } from "@probitas/client-sqs"; import { expectSqsResult } from "./sqs.ts"; const receiveResult = { kind: "sqs:receive", ok: true, messages: [{ body: "test message" }], duration: 0, } as unknown as SqsReceiveResult; expectSqsResult(receiveResult) .toBeOk() .toHaveMessagesCountGreaterThanOrEqual(1); ``` Batch operations ```ts import type { SqsSendBatchResult } from "@probitas/client-sqs"; import { expectSqsResult } from "./sqs.ts"; const batchResult = { kind: "sqs:send-batch", ok: true, successful: [{ id: "1" }, { id: "2" }], failed: [], duration: 0, } as unknown as SqsSendBatchResult; expectSqsResult(batchResult) .toBeOk() .toHaveSuccessfulCount(2) .toHaveFailedEmpty(); ``` Queue management ```ts import type { SqsEnsureQueueResult } from "@probitas/client-sqs"; import { expectSqsResult } from "./sqs.ts"; const ensureResult = { kind: "sqs:ensure-queue", ok: true, queueUrl: "https://sqs.example.com/test-queue", duration: 0, } as unknown as SqsEnsureQueueResult; expectSqsResult(ensureResult) .toBeOk() .toHaveQueueUrlContaining("test-queue"); ``` --- ### `createSqsClient` ```typescript function createSqsClient(config: SqsClientConfig): Promise ``` Create a new Amazon SQS client instance. The client provides queue management, message publishing and consumption, batch operations, and supports both standard and FIFO queues via AWS SDK. **Parameters:** - `config`: `SqsClientConfig` — - SQS client configuration **Returns:** `Promise` A promise resolving to a new SQS client instance **Example:** Basic usage with existing queue ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "ap-northeast-1", queueUrl: "https://sqs.ap-northeast-1.amazonaws.com/123456789/my-queue", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); // Send a message const sendResult = await sqs.send(JSON.stringify({ type: "ORDER", orderId: "123", })); if (sendResult.ok) { console.log("Message ID:", sendResult.messageId); } else { console.error("Error:", sendResult.error.message); } await sqs.close(); } ``` Using LocalStack for local development ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test", }, }); // Create queue dynamically (also sets queueUrl) const result = await sqs.ensureQueue("test-queue"); if (result.ok) { console.log(result.queueUrl); // http://localhost:4566/000000000000/test-queue } await sqs.close(); } ``` Receiving messages with long polling ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); // Long polling waits up to 20 seconds for messages const receiveResult = await sqs.receive({ maxMessages: 10, waitTimeSeconds: 20, visibilityTimeout: 30, }); if (receiveResult.ok) { console.log("Received:", receiveResult.messages.length); // Process and acknowledge messages for (const msg of receiveResult.messages) { const data = JSON.parse(msg.body); console.log("Processing:", data); // Delete after successful processing await sqs.delete(msg.receiptHandle); } } await sqs.close(); } ``` Batch operations for high throughput ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { const sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); // Send multiple messages in a single API call const batchResult = await sqs.sendBatch([ { id: "1", body: JSON.stringify({ event: "user.created", userId: "a1" }) }, { id: "2", body: JSON.stringify({ event: "user.created", userId: "a2" }) }, { id: "3", body: JSON.stringify({ event: "user.updated", userId: "a3" }) }, ]); if (batchResult.ok) { console.log(`Sent: ${batchResult.successful.length}`); console.log(`Failed: ${batchResult.failed.length}`); } // Batch delete processed messages const receiveResult = await sqs.receive({ maxMessages: 10 }); if (receiveResult.ok) { const handles = receiveResult.messages.map((m) => m.receiptHandle); await sqs.deleteBatch(handles); } await sqs.close(); } ``` Using `await using` for automatic cleanup ```ts import { createSqsClient } from "@probitas/client-sqs"; async function example() { await using sqs = await createSqsClient({ region: "us-east-1", url: "http://localhost:4566", credentials: { accessKeyId: "test", secretAccessKey: "test" }, }); await sqs.ensureQueue("test-queue"); await sqs.send("Hello, SQS!"); // Client automatically closed when scope exits } ``` --- ### `expectRabbitMqResult` ```typescript function expectRabbitMqResult( result: R, ): RabbitMqExpectation ``` Create a fluent expectation chain for any RabbitMQ result validation. This unified function accepts any RabbitMQ result type and returns the appropriate expectation interface based on the result's type discriminator. **Parameters:** - `result`: `R` **Returns:** `RabbitMqExpectation` **Example:** ```ts import type { RabbitMqPublishResult, RabbitMqConsumeResult, RabbitMqQueueResult, RabbitMqExchangeResult, RabbitMqAckResult } from "@probitas/client-rabbitmq"; import { expectRabbitMqResult } from "./rabbitmq.ts"; // For publish result - returns RabbitMqPublishResultExpectation const publishResult = { kind: "rabbitmq:publish", ok: true, duration: 0, } as unknown as RabbitMqPublishResult; expectRabbitMqResult(publishResult).toBeOk(); // For consume result - returns RabbitMqConsumeResultExpectation const consumeResult = { kind: "rabbitmq:consume", ok: true, message: { content: new Uint8Array() }, duration: 0, } as unknown as RabbitMqConsumeResult; expectRabbitMqResult(consumeResult).toBeOk().toHaveMessagePresent(); // For queue result - returns RabbitMqQueueResultExpectation const queueResult = { kind: "rabbitmq:queue", ok: true, queue: "my-queue", messageCount: 0, consumerCount: 0, duration: 0, } as unknown as RabbitMqQueueResult; expectRabbitMqResult(queueResult).toBeOk().toHaveMessageCount(0); // For exchange result - returns RabbitMqExchangeResultExpectation const exchangeResult = { kind: "rabbitmq:exchange", ok: true, duration: 0, } as unknown as RabbitMqExchangeResult; expectRabbitMqResult(exchangeResult).toBeOk(); // For ack result - returns RabbitMqAckResultExpectation const ackResult = { kind: "rabbitmq:ack", ok: true, duration: 0, } as unknown as RabbitMqAckResult; expectRabbitMqResult(ackResult).toBeOk(); ``` --- ### `createRabbitMqClient` ```typescript async function createRabbitMqClient( config: RabbitMqClientConfig, ): Promise ``` Create a new RabbitMQ client instance. The client provides queue and exchange management, message publishing and consumption, and acknowledgment handling via AMQP protocol. **Parameters:** - `config`: `RabbitMqClientConfig` — - RabbitMQ client configuration **Returns:** `Promise` A promise resolving to a new RabbitMQ client instance **Example:** Basic usage with string URL ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; const rabbit = await createRabbitMqClient({ url: "amqp://guest:guest@localhost:5672", }); const channel = await rabbit.channel(); await channel.assertQueue("my-queue", { durable: true }); const content = new TextEncoder().encode(JSON.stringify({ type: "ORDER" })); await channel.sendToQueue("my-queue", content, { persistent: true }); await channel.close(); await rabbit.close(); ``` With connection config object ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; const rabbit = await createRabbitMqClient({ url: { host: "localhost", port: 5672, username: "guest", password: "guest", vhost: "/", }, }); await rabbit.close(); ``` Exchange and binding ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" }); const channel = await rabbit.channel(); // Create exchange and queue await channel.assertExchange("events", "topic", { durable: true }); await channel.assertQueue("user-events"); await channel.bindQueue("user-events", "events", "user.*"); // Publish to exchange const content = new TextEncoder().encode(JSON.stringify({ id: 1 })); await channel.publish("events", "user.created", content); await rabbit.close(); ``` Consuming messages ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" }); const channel = await rabbit.channel(); await channel.assertQueue("my-queue"); for await (const message of channel.consume("my-queue")) { console.log("Received:", new TextDecoder().decode(message.content)); await channel.ack(message); break; } await rabbit.close(); ``` Get single message (polling) ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" }); const channel = await rabbit.channel(); await channel.assertQueue("my-queue"); const result = await channel.get("my-queue"); if (result.message) { await channel.ack(result.message); } await rabbit.close(); ``` Using `await using` for automatic cleanup ```ts import { createRabbitMqClient } from "@probitas/client-rabbitmq"; await using rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672", }); const channel = await rabbit.channel(); await channel.assertQueue("test"); // Client automatically closed when scope exits ``` --- ### `expectSqlQueryResult` ```typescript function expectSqlQueryResult>( result: SqlQueryResult, ): SqlQueryResultExpectation ``` **Parameters:** - `result`: `SqlQueryResult` **Returns:** `SqlQueryResultExpectation` --- ## Types ### `HttpResponse` ```typescript type HttpResponse = HttpResponseSuccess | HttpResponseError | HttpResponseFailure ``` HTTP response union type representing all possible response states. - **Success (2xx)**: `processed: true, ok: true, error: null` - **Error (4xx/5xx)**: `processed: true, ok: false, error: HttpError` - **Failure (network error)**: `processed: false, ok: false, error: Error` --- ### `QueryValue` ```typescript type QueryValue = string | number | boolean ``` Query parameter value type. --- ### `BodyInit` ```typescript type BodyInit = string | Uint8Array | FormData | URLSearchParams | unknown ``` Request body type. --- ### `RedirectMode` ```typescript type RedirectMode = "follow" | "manual" | "error" ``` Redirect handling mode. - "follow": Automatically follow redirects (default) - "manual": Return redirect response without following - "error": Throw error on redirect --- ### `QueryParams` ```typescript type QueryParams = URLSearchParams | Record ``` Query parameters type - accepts URLSearchParams or plain object. --- ### `HttpFailureError` ```typescript type HttpFailureError = HttpNetworkError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the request reaches the server. --- ### `GraphqlResponse` ```typescript type GraphqlResponse = GraphqlResponseSuccess | GraphqlResponseError | GraphqlResponseFailure ``` GraphQL response union type. Use `processed` to distinguish between server responses and failures: - `processed === true`: Server responded (Success or Error) - `processed === false`: Request failed (Failure) Use `ok` to check for success: - `ok === true`: Success (no errors) - `ok === false`: Error or Failure --- ### `GraphqlFailureError` ```typescript type GraphqlFailureError = GraphqlNetworkError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the request reaches the GraphQL server. --- ### `ConnectRpcResponse` ```typescript type ConnectRpcResponse = ConnectRpcResponseSuccess | ConnectRpcResponseError | ConnectRpcResponseFailure ``` ConnectRPC response union type. Use `processed` to distinguish between server responses and failures: - `processed === true`: Server responded (Success or Error) - `processed === false`: Request failed (Failure) Use `ok` to check for success: - `ok === true`: Success (statusCode === 0) - `ok === false`: Error or Failure --- ### `FileDescriptorSet` ```typescript type FileDescriptorSet = MessageShape ``` FileDescriptorSet message type from @bufbuild/protobuf. This is the decoded protobuf message containing file descriptors. --- ### `ConnectProtocol` ```typescript type ConnectProtocol = "connect" | "grpc" | "grpc-web" ``` Protocol to use for ConnectRPC transport. --- ### `HttpVersion` ```typescript type HttpVersion = "1.1" | "2" ``` HTTP version for transport. --- ### `ConnectRpcStatusCode` ```typescript type ConnectRpcStatusCode = unknown ``` ConnectRPC/gRPC status code type. Derived from ConnectRpcStatus values. --- ### `ConnectRpcFailureError` ```typescript type ConnectRpcFailureError = ConnectRpcNetworkError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the request reaches the server. --- ### `ConnectRpcErrorType` ```typescript type ConnectRpcErrorType = ConnectRpcError | ConnectRpcNetworkError ``` ConnectRPC error type union. Contains either: - ConnectRpcError: gRPC error returned by the server - ConnectRpcNetworkError: Network-level failure before reaching the server --- ### `RedisExpectation` ```typescript type RedisExpectation = R extends RedisCountResult ? RedisCountResultExpectation : R extends RedisArrayResult ? RedisArrayResultExpectation : R extends RedisGetResult ? RedisGetResultExpectation : R extends RedisSetResult ? RedisSetResultExpectation : R extends RedisHashResult ? RedisHashResultExpectation : R extends RedisCommonResult ? RedisCommonResultExpectation : never ``` Expectation type returned by expectRedisResult based on the result type. --- ### `RedisFailureError` ```typescript type RedisFailureError = RedisConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the Redis server. --- ### `RedisOperationError` ```typescript type RedisOperationError = RedisCommandError | RedisScriptError | RedisError ``` Error types that indicate the operation was processed but failed. These are errors returned by the Redis server. --- ### `RedisGetResult` ```typescript type RedisGetResult = RedisGetResultSuccess | RedisGetResultError | RedisGetResultFailure ``` Redis GET result. --- ### `RedisSetResult` ```typescript type RedisSetResult = RedisSetResultSuccess | RedisSetResultError | RedisSetResultFailure ``` Redis SET result. --- ### `RedisCountResult` ```typescript type RedisCountResult = RedisCountResultSuccess | RedisCountResultError | RedisCountResultFailure ``` Redis numeric result (DEL, LPUSH, SADD, etc.). --- ### `RedisArrayResult` ```typescript type RedisArrayResult = RedisArrayResultSuccess | RedisArrayResultError | RedisArrayResultFailure ``` Redis array result (LRANGE, SMEMBERS, etc.). --- ### `RedisHashResult` ```typescript type RedisHashResult = RedisHashResultSuccess | RedisHashResultError | RedisHashResultFailure ``` Redis hash result (HGETALL). --- ### `RedisCommonResult` ```typescript type RedisCommonResult = RedisCommonResultSuccess | RedisCommonResultError | RedisCommonResultFailure ``` Redis operation result (common/generic). Used for operations without a more specific result type. --- ### `RedisResult` ```typescript type RedisResult = RedisCommonResult | RedisGetResult | RedisSetResult | RedisCountResult | RedisArrayResult | RedisHashResult ``` Union of all Redis result types. --- ### `MongoExpectation` ```typescript type MongoExpectation = R extends MongoFindResult ? MongoFindResultExpectation : R extends MongoInsertOneResult ? MongoInsertOneResultExpectation : R extends MongoInsertManyResult ? MongoInsertManyResultExpectation : R extends MongoUpdateResult ? MongoUpdateResultExpectation : R extends MongoDeleteResult ? MongoDeleteResultExpectation : R extends MongoFindOneResult ? MongoFindOneResultExpectation : R extends MongoCountResult ? MongoCountResultExpectation : never ``` Expectation type returned by expectMongoResult based on the result type. --- ### `MongoCountResult` ```typescript type MongoCountResult = MongoCountResultSuccess | MongoCountResultError | MongoCountResultFailure ``` Count result. --- ### `MongoDeleteResult` ```typescript type MongoDeleteResult = MongoDeleteResultSuccess | MongoDeleteResultError | MongoDeleteResultFailure ``` Delete result. --- ### `MongoFailureError` ```typescript type MongoFailureError = MongoConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the MongoDB server. --- ### `MongoFindOneResult` ```typescript type MongoFindOneResult = MongoFindOneResultSuccess | MongoFindOneResultError | MongoFindOneResultFailure ``` FindOne result. --- ### `MongoFindResult` ```typescript type MongoFindResult = MongoFindResultSuccess | MongoFindResultError | MongoFindResultFailure ``` Query result (find, aggregate). --- ### `MongoInsertManyResult` ```typescript type MongoInsertManyResult = MongoInsertManyResultSuccess | MongoInsertManyResultError | MongoInsertManyResultFailure ``` Insert many result. --- ### `MongoInsertOneResult` ```typescript type MongoInsertOneResult = MongoInsertOneResultSuccess | MongoInsertOneResultError | MongoInsertOneResultFailure ``` Insert one result. --- ### `MongoResult` ```typescript type MongoResult = MongoFindResult | MongoInsertOneResult | MongoInsertManyResult | MongoUpdateResult | MongoDeleteResult | MongoFindOneResult | MongoCountResult ``` Union of all MongoDB result types. --- ### `MongoUpdateResult` ```typescript type MongoUpdateResult = MongoUpdateResultSuccess | MongoUpdateResultError | MongoUpdateResultFailure ``` Update result. --- ### `Document` ```typescript type Document = Record ``` MongoDB document type --- ### `Filter` ```typescript type Filter = Record ``` MongoDB filter type (simplified for compatibility with mongodb driver) Allows query operators like $gte, $lt, $in, etc. --- ### `UpdateFilter` ```typescript type UpdateFilter = Record ``` MongoDB update filter type (simplified for compatibility with mongodb driver) Allows update operators like $set, $inc, $unset, etc. --- ### `MongoOperationError` ```typescript type MongoOperationError = MongoQueryError | MongoDuplicateKeyError | MongoValidationError | MongoWriteError | MongoNotFoundError | MongoError ``` Error types that indicate a MongoDB operation error. These are errors where the operation reached the server but failed. --- ### `DenoKvExpectation` ```typescript type DenoKvExpectation = R extends DenoKvGetResult ? DenoKvGetResultExpectation : R extends DenoKvListResult ? DenoKvListResultExpectation : R extends DenoKvSetResult ? DenoKvSetResultExpectation : R extends DenoKvDeleteResult ? DenoKvDeleteResultExpectation : R extends DenoKvAtomicResult ? DenoKvAtomicResultExpectation : never ``` Expectation type returned by expectDenoKvResult based on the result type. --- ### `DenoKvFailureError` ```typescript type DenoKvFailureError = DenoKvConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the Deno KV server. --- ### `DenoKvGetResult` ```typescript type DenoKvGetResult = DenoKvGetResultSuccess | DenoKvGetResultError | DenoKvGetResultFailure ``` Result of a get operation. Use `ok` to check for success, then narrow the type: - `ok === true`: Success - value may be present - `ok === false && processed === true`: KV error (quota, etc.) - `ok === false && processed === false`: Connection failure --- ### `DenoKvSetResult` ```typescript type DenoKvSetResult = DenoKvSetResultSuccess | DenoKvSetResultError | DenoKvSetResultFailure ``` Result of a set operation. --- ### `DenoKvDeleteResult` ```typescript type DenoKvDeleteResult = DenoKvDeleteResultSuccess | DenoKvDeleteResultError | DenoKvDeleteResultFailure ``` Result of a delete operation. --- ### `DenoKvListResult` ```typescript type DenoKvListResult = DenoKvListResultSuccess | DenoKvListResultError | DenoKvListResultFailure ``` Result of a list operation. --- ### `DenoKvAtomicResult` ```typescript type DenoKvAtomicResult = DenoKvAtomicResultCommitted | DenoKvAtomicResultCheckFailed | DenoKvAtomicResultError | DenoKvAtomicResultFailure ``` Result of an atomic operation. Use `ok` and `error` to distinguish between outcomes: - `ok === true`: Committed successfully - `ok === false && error === null`: Check failed (retry with new versionstamp) - `ok === false && error !== null`: KV error or connection failure --- ### `DenoKvResult` ```typescript type DenoKvResult = DenoKvGetResult | DenoKvSetResult | DenoKvDeleteResult | DenoKvListResult | DenoKvAtomicResult ``` Union of all Deno KV result types. --- ### `SqsExpectation` ```typescript type SqsExpectation = R extends SqsSendResult ? SqsSendResultExpectation : R extends SqsSendBatchResult ? SqsSendBatchResultExpectation : R extends SqsReceiveResult ? SqsReceiveResultExpectation : R extends SqsDeleteResult ? SqsDeleteResultExpectation : R extends SqsDeleteBatchResult ? SqsSendBatchResultExpectation : R extends SqsEnsureQueueResult ? SqsEnsureQueueResultExpectation : R extends SqsDeleteQueueResult ? SqsDeleteQueueResultExpectation : never ``` Expectation type returned by expectSqsResult based on the result type. --- ### `SqsDeleteBatchResult` ```typescript type SqsDeleteBatchResult = SqsDeleteBatchResultSuccess | SqsDeleteBatchResultError | SqsDeleteBatchResultFailure ``` Result of batch deleting messages. --- ### `SqsDeleteQueueResult` ```typescript type SqsDeleteQueueResult = SqsDeleteQueueResultSuccess | SqsDeleteQueueResultError | SqsDeleteQueueResultFailure ``` Result of deleting a queue. --- ### `SqsDeleteResult` ```typescript type SqsDeleteResult = SqsDeleteResultSuccess | SqsDeleteResultError | SqsDeleteResultFailure ``` Result of deleting a message. --- ### `SqsEnsureQueueResult` ```typescript type SqsEnsureQueueResult = SqsEnsureQueueResultSuccess | SqsEnsureQueueResultError | SqsEnsureQueueResultFailure ``` Result of ensuring a queue exists. --- ### `SqsReceiveResult` ```typescript type SqsReceiveResult = SqsReceiveResultSuccess | SqsReceiveResultError | SqsReceiveResultFailure ``` Result of receiving messages. --- ### `SqsResult` ```typescript type SqsResult = SqsSendResult | SqsSendBatchResult | SqsReceiveResult | SqsDeleteResult | SqsDeleteBatchResult | SqsEnsureQueueResult | SqsDeleteQueueResult ``` Union type of all SQS result types. --- ### `SqsSendBatchResult` ```typescript type SqsSendBatchResult = SqsSendBatchResultSuccess | SqsSendBatchResultError | SqsSendBatchResultFailure ``` Result of batch sending messages. --- ### `SqsSendResult` ```typescript type SqsSendResult = SqsSendResultSuccess | SqsSendResultError | SqsSendResultFailure ``` Result of sending a message. --- ### `SqsOperationError` ```typescript type SqsOperationError = SqsCommandError | SqsQueueNotFoundError | SqsMessageTooLargeError | SqsBatchError | SqsMessageNotFoundError | SqsError ``` Error types that indicate an operation was processed by the server. These errors occur after the operation reaches the SQS service. --- ### `SqsFailureError` ```typescript type SqsFailureError = SqsConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the SQS service. --- ### `RabbitMqExpectation` ```typescript type RabbitMqExpectation = R extends RabbitMqConsumeResult ? RabbitMqConsumeResultExpectation : R extends RabbitMqQueueResult ? RabbitMqQueueResultExpectation : R extends RabbitMqPublishResult ? RabbitMqPublishResultExpectation : R extends RabbitMqExchangeResult ? RabbitMqExchangeResultExpectation : R extends RabbitMqAckResult ? RabbitMqAckResultExpectation : never ``` Expectation type returned by expectRabbitMqResult based on the result type. --- ### `RabbitMqExchangeType` ```typescript type RabbitMqExchangeType = "direct" | "topic" | "fanout" | "headers" ``` Exchange type. --- ### `RabbitMqOperationError` ```typescript type RabbitMqOperationError = RabbitMqChannelError | RabbitMqNotFoundError | RabbitMqPreconditionFailedError | RabbitMqError ``` Error types that indicate a RabbitMQ operation error. These are errors where the operation reached the server but failed. --- ### `RabbitMqFailureError` ```typescript type RabbitMqFailureError = RabbitMqConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the RabbitMQ server. --- ### `RabbitMqPublishResult` ```typescript type RabbitMqPublishResult = RabbitMqPublishResultSuccess | RabbitMqPublishResultError | RabbitMqPublishResultFailure ``` Publish result. --- ### `RabbitMqConsumeResult` ```typescript type RabbitMqConsumeResult = RabbitMqConsumeResultSuccess | RabbitMqConsumeResultError | RabbitMqConsumeResultFailure ``` Consume result (single message retrieval). --- ### `RabbitMqAckResult` ```typescript type RabbitMqAckResult = RabbitMqAckResultSuccess | RabbitMqAckResultError | RabbitMqAckResultFailure ``` Ack/Nack result. --- ### `RabbitMqQueueResult` ```typescript type RabbitMqQueueResult = RabbitMqQueueResultSuccess | RabbitMqQueueResultError | RabbitMqQueueResultFailure ``` Queue declaration result. --- ### `RabbitMqExchangeResult` ```typescript type RabbitMqExchangeResult = RabbitMqExchangeResultSuccess | RabbitMqExchangeResultError | RabbitMqExchangeResultFailure ``` Exchange declaration result. --- ### `RabbitMqResult` ```typescript type RabbitMqResult = RabbitMqPublishResult | RabbitMqConsumeResult | RabbitMqAckResult | RabbitMqQueueResult | RabbitMqExchangeResult ``` Union of all RabbitMQ result types. --- ### `SqlIsolationLevel` ```typescript type SqlIsolationLevel = "read_uncommitted" | "read_committed" | "repeatable_read" | "serializable" ``` Transaction isolation level. --- ### `SqlErrorKind` ```typescript type SqlErrorKind = "query" | "constraint" | "deadlock" | "connection" | "unknown" ``` SQL-specific error kinds. --- ### `SqlOperationError` ```typescript type SqlOperationError = QuerySyntaxError | ConstraintError | DeadlockError | SqlError ``` Error types that indicate an operation was processed by the server. These errors occur after the query reaches the SQL server. --- ### `SqlFailureError` ```typescript type SqlFailureError = SqlConnectionError | AbortError | TimeoutError ``` Error types that indicate the operation was not processed. These are errors that occur before the query reaches the SQL server. --- ### `SqlQueryResult` ```typescript type SqlQueryResult = SqlQueryResultSuccess | SqlQueryResultError | SqlQueryResultFailure ``` SQL query result union type representing all possible result states. - **Success**: `processed: true, ok: true, error: null` - **Error**: `processed: true, ok: false, error: SqlError` - **Failure**: `processed: false, ok: false, error: SqlConnectionError` --- ## Variables ### `outdent` ```typescript const outdent: Outdent ``` --- ### `ConnectRpcStatus` ```typescript const ConnectRpcStatus: { OK: number; CANCELLED: number; UNKNOWN: number; INVALID_ARGUMENT: number; DEADLINE_EXCEEDED: number; NOT_FOUND: number; ALREADY_EXISTS: number; PERMISSION_DENIED: number; RESOURCE_EXHAUSTED: number; FAILED_PRECONDITION: number; ABORTED: number; OUT_OF_RANGE: number; UNIMPLEMENTED: number; INTERNAL: number; UNAVAILABLE: number; DATA_LOSS: number; UNAUTHENTICATED: number; } ``` ConnectRPC/gRPC status codes. These codes are used by both gRPC and ConnectRPC protocols. --- ## Related Links ### This Package - [`AnythingExpectation`](https://probitas-test.github.io/documents/api/expect#AnythingExpectation) - [`AtomicBuilderOptions`](https://probitas-test.github.io/documents/api/expect#AtomicBuilderOptions) - [`BodyInit`](https://probitas-test.github.io/documents/api/expect#BodyInit) - [`ConnectProtocol`](https://probitas-test.github.io/documents/api/expect#ConnectProtocol) - [`ConnectRpcClient`](https://probitas-test.github.io/documents/api/expect#ConnectRpcClient) - [`ConnectRpcClientConfig`](https://probitas-test.github.io/documents/api/expect#ConnectRpcClientConfig) - [`ConnectRpcConnectionConfig`](https://probitas-test.github.io/documents/api/expect#ConnectRpcConnectionConfig) - [`ConnectRpcError`](https://probitas-test.github.io/documents/api/expect#ConnectRpcError) - [`ConnectRpcErrorOptions`](https://probitas-test.github.io/documents/api/expect#ConnectRpcErrorOptions) - [`ConnectRpcFailureError`](https://probitas-test.github.io/documents/api/expect#ConnectRpcFailureError) - [`ConnectRpcNetworkError`](https://probitas-test.github.io/documents/api/expect#ConnectRpcNetworkError) - [`ConnectRpcOptions`](https://probitas-test.github.io/documents/api/expect#ConnectRpcOptions) - [`ConnectRpcResponse`](https://probitas-test.github.io/documents/api/expect#ConnectRpcResponse) - [`ConnectRpcResponseError`](https://probitas-test.github.io/documents/api/expect#ConnectRpcResponseError) - [`ConnectRpcResponseExpectation`](https://probitas-test.github.io/documents/api/expect#ConnectRpcResponseExpectation) - [`ConnectRpcResponseFailure`](https://probitas-test.github.io/documents/api/expect#ConnectRpcResponseFailure) - [`ConnectRpcResponseSuccess`](https://probitas-test.github.io/documents/api/expect#ConnectRpcResponseSuccess) - [`ConnectRpcStatusCode`](https://probitas-test.github.io/documents/api/expect#ConnectRpcStatusCode) - [`ConstraintError`](https://probitas-test.github.io/documents/api/expect#ConstraintError) - [`CookieConfig`](https://probitas-test.github.io/documents/api/expect#CookieConfig) - [`DeadlockError`](https://probitas-test.github.io/documents/api/expect#DeadlockError) - [`DenoKvAtomicBuilder`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicBuilder) - [`DenoKvAtomicOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicOptions) - [`DenoKvAtomicResult`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicResult) - [`DenoKvAtomicResultCheckFailed`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicResultCheckFailed) - [`DenoKvAtomicResultCommitted`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicResultCommitted) - [`DenoKvAtomicResultError`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicResultError) - [`DenoKvAtomicResultFailure`](https://probitas-test.github.io/documents/api/expect#DenoKvAtomicResultFailure) - [`DenoKvClient`](https://probitas-test.github.io/documents/api/expect#DenoKvClient) - [`DenoKvClientConfig`](https://probitas-test.github.io/documents/api/expect#DenoKvClientConfig) - [`DenoKvConnectionError`](https://probitas-test.github.io/documents/api/expect#DenoKvConnectionError) - [`DenoKvDeleteOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvDeleteOptions) - [`DenoKvDeleteResult`](https://probitas-test.github.io/documents/api/expect#DenoKvDeleteResult) - [`DenoKvDeleteResultError`](https://probitas-test.github.io/documents/api/expect#DenoKvDeleteResultError) - [`DenoKvDeleteResultFailure`](https://probitas-test.github.io/documents/api/expect#DenoKvDeleteResultFailure) - [`DenoKvDeleteResultSuccess`](https://probitas-test.github.io/documents/api/expect#DenoKvDeleteResultSuccess) - [`DenoKvEntry`](https://probitas-test.github.io/documents/api/expect#DenoKvEntry) - [`DenoKvError`](https://probitas-test.github.io/documents/api/expect#DenoKvError) - [`DenoKvExpectation`](https://probitas-test.github.io/documents/api/expect#DenoKvExpectation) - [`DenoKvFailureError`](https://probitas-test.github.io/documents/api/expect#DenoKvFailureError) - [`DenoKvGetOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvGetOptions) - [`DenoKvGetResult`](https://probitas-test.github.io/documents/api/expect#DenoKvGetResult) - [`DenoKvGetResultError`](https://probitas-test.github.io/documents/api/expect#DenoKvGetResultError) - [`DenoKvGetResultFailure`](https://probitas-test.github.io/documents/api/expect#DenoKvGetResultFailure) - [`DenoKvGetResultSuccess`](https://probitas-test.github.io/documents/api/expect#DenoKvGetResultSuccess) - [`DenoKvListOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvListOptions) - [`DenoKvListResult`](https://probitas-test.github.io/documents/api/expect#DenoKvListResult) - [`DenoKvListResultError`](https://probitas-test.github.io/documents/api/expect#DenoKvListResultError) - [`DenoKvListResultFailure`](https://probitas-test.github.io/documents/api/expect#DenoKvListResultFailure) - [`DenoKvListResultSuccess`](https://probitas-test.github.io/documents/api/expect#DenoKvListResultSuccess) - [`DenoKvOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvOptions) - [`DenoKvResult`](https://probitas-test.github.io/documents/api/expect#DenoKvResult) - [`DenoKvSetOptions`](https://probitas-test.github.io/documents/api/expect#DenoKvSetOptions) - [`DenoKvSetResult`](https://probitas-test.github.io/documents/api/expect#DenoKvSetResult) - [`DenoKvSetResultError`](https://probitas-test.github.io/documents/api/expect#DenoKvSetResultError) - [`DenoKvSetResultFailure`](https://probitas-test.github.io/documents/api/expect#DenoKvSetResultFailure) - [`DenoKvSetResultSuccess`](https://probitas-test.github.io/documents/api/expect#DenoKvSetResultSuccess) - [`Document`](https://probitas-test.github.io/documents/api/expect#Document) - [`ErrorDetail`](https://probitas-test.github.io/documents/api/expect#ErrorDetail) - [`FileDescriptorSet`](https://probitas-test.github.io/documents/api/expect#FileDescriptorSet) - [`Filter`](https://probitas-test.github.io/documents/api/expect#Filter) - [`GraphqlClient`](https://probitas-test.github.io/documents/api/expect#GraphqlClient) - [`GraphqlClientConfig`](https://probitas-test.github.io/documents/api/expect#GraphqlClientConfig) - [`GraphqlConnectionConfig`](https://probitas-test.github.io/documents/api/expect#GraphqlConnectionConfig) - [`GraphqlErrorItem`](https://probitas-test.github.io/documents/api/expect#GraphqlErrorItem) - [`GraphqlExecutionError`](https://probitas-test.github.io/documents/api/expect#GraphqlExecutionError) - [`GraphqlFailureError`](https://probitas-test.github.io/documents/api/expect#GraphqlFailureError) - [`GraphqlNetworkError`](https://probitas-test.github.io/documents/api/expect#GraphqlNetworkError) - [`GraphqlOptions`](https://probitas-test.github.io/documents/api/expect#GraphqlOptions) - [`GraphqlResponse`](https://probitas-test.github.io/documents/api/expect#GraphqlResponse) - [`GraphqlResponseError`](https://probitas-test.github.io/documents/api/expect#GraphqlResponseError) - [`GraphqlResponseExpectation`](https://probitas-test.github.io/documents/api/expect#GraphqlResponseExpectation) - [`GraphqlResponseFailure`](https://probitas-test.github.io/documents/api/expect#GraphqlResponseFailure) - [`GraphqlResponseSuccess`](https://probitas-test.github.io/documents/api/expect#GraphqlResponseSuccess) - [`GrpcClientConfig`](https://probitas-test.github.io/documents/api/expect#GrpcClientConfig) - [`GrpcResponse`](https://probitas-test.github.io/documents/api/expect#GrpcResponse) - [`GrpcResponseExpectation`](https://probitas-test.github.io/documents/api/expect#GrpcResponseExpectation) - [`GrpcStatusCode`](https://probitas-test.github.io/documents/api/expect#GrpcStatusCode) - [`HttpClient`](https://probitas-test.github.io/documents/api/expect#HttpClient) - [`HttpClientConfig`](https://probitas-test.github.io/documents/api/expect#HttpClientConfig) - [`HttpConnectionConfig`](https://probitas-test.github.io/documents/api/expect#HttpConnectionConfig) - [`HttpError`](https://probitas-test.github.io/documents/api/expect#HttpError) - [`HttpErrorOptions`](https://probitas-test.github.io/documents/api/expect#HttpErrorOptions) - [`HttpFailureError`](https://probitas-test.github.io/documents/api/expect#HttpFailureError) - [`HttpNetworkError`](https://probitas-test.github.io/documents/api/expect#HttpNetworkError) - [`HttpOptions`](https://probitas-test.github.io/documents/api/expect#HttpOptions) - [`HttpRequestOptions`](https://probitas-test.github.io/documents/api/expect#HttpRequestOptions) - [`HttpResponse`](https://probitas-test.github.io/documents/api/expect#HttpResponse) - [`HttpResponseError`](https://probitas-test.github.io/documents/api/expect#HttpResponseError) - [`HttpResponseExpectation`](https://probitas-test.github.io/documents/api/expect#HttpResponseExpectation) - [`HttpResponseFailure`](https://probitas-test.github.io/documents/api/expect#HttpResponseFailure) - [`HttpResponseSuccess`](https://probitas-test.github.io/documents/api/expect#HttpResponseSuccess) - [`HttpVersion`](https://probitas-test.github.io/documents/api/expect#HttpVersion) - [`MethodInfo`](https://probitas-test.github.io/documents/api/expect#MethodInfo) - [`MongoClient`](https://probitas-test.github.io/documents/api/expect#MongoClient) - [`MongoClientConfig`](https://probitas-test.github.io/documents/api/expect#MongoClientConfig) - [`MongoCollection`](https://probitas-test.github.io/documents/api/expect#MongoCollection) - [`MongoConnectionConfig`](https://probitas-test.github.io/documents/api/expect#MongoConnectionConfig) - [`MongoConnectionError`](https://probitas-test.github.io/documents/api/expect#MongoConnectionError) - [`MongoCountResult`](https://probitas-test.github.io/documents/api/expect#MongoCountResult) - [`MongoCountResultError`](https://probitas-test.github.io/documents/api/expect#MongoCountResultError) - [`MongoCountResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoCountResultFailure) - [`MongoCountResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoCountResultSuccess) - [`MongoDeleteResult`](https://probitas-test.github.io/documents/api/expect#MongoDeleteResult) - [`MongoDeleteResultError`](https://probitas-test.github.io/documents/api/expect#MongoDeleteResultError) - [`MongoDeleteResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoDeleteResultFailure) - [`MongoDeleteResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoDeleteResultSuccess) - [`MongoDuplicateKeyError`](https://probitas-test.github.io/documents/api/expect#MongoDuplicateKeyError) - [`MongoError`](https://probitas-test.github.io/documents/api/expect#MongoError) - [`MongoErrorOptions`](https://probitas-test.github.io/documents/api/expect#MongoErrorOptions) - [`MongoExpectation`](https://probitas-test.github.io/documents/api/expect#MongoExpectation) - [`MongoFailureError`](https://probitas-test.github.io/documents/api/expect#MongoFailureError) - [`MongoFindOneResult`](https://probitas-test.github.io/documents/api/expect#MongoFindOneResult) - [`MongoFindOneResultError`](https://probitas-test.github.io/documents/api/expect#MongoFindOneResultError) - [`MongoFindOneResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoFindOneResultFailure) - [`MongoFindOneResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoFindOneResultSuccess) - [`MongoFindOptions`](https://probitas-test.github.io/documents/api/expect#MongoFindOptions) - [`MongoFindResult`](https://probitas-test.github.io/documents/api/expect#MongoFindResult) - [`MongoFindResultError`](https://probitas-test.github.io/documents/api/expect#MongoFindResultError) - [`MongoFindResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoFindResultFailure) - [`MongoFindResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoFindResultSuccess) - [`MongoInsertManyResult`](https://probitas-test.github.io/documents/api/expect#MongoInsertManyResult) - [`MongoInsertManyResultError`](https://probitas-test.github.io/documents/api/expect#MongoInsertManyResultError) - [`MongoInsertManyResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoInsertManyResultFailure) - [`MongoInsertManyResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoInsertManyResultSuccess) - [`MongoInsertOneResult`](https://probitas-test.github.io/documents/api/expect#MongoInsertOneResult) - [`MongoInsertOneResultError`](https://probitas-test.github.io/documents/api/expect#MongoInsertOneResultError) - [`MongoInsertOneResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoInsertOneResultFailure) - [`MongoInsertOneResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoInsertOneResultSuccess) - [`MongoNotFoundError`](https://probitas-test.github.io/documents/api/expect#MongoNotFoundError) - [`MongoOptions`](https://probitas-test.github.io/documents/api/expect#MongoOptions) - [`MongoQueryError`](https://probitas-test.github.io/documents/api/expect#MongoQueryError) - [`MongoResult`](https://probitas-test.github.io/documents/api/expect#MongoResult) - [`MongoSession`](https://probitas-test.github.io/documents/api/expect#MongoSession) - [`MongoUpdateOptions`](https://probitas-test.github.io/documents/api/expect#MongoUpdateOptions) - [`MongoUpdateResult`](https://probitas-test.github.io/documents/api/expect#MongoUpdateResult) - [`MongoUpdateResultError`](https://probitas-test.github.io/documents/api/expect#MongoUpdateResultError) - [`MongoUpdateResultFailure`](https://probitas-test.github.io/documents/api/expect#MongoUpdateResultFailure) - [`MongoUpdateResultSuccess`](https://probitas-test.github.io/documents/api/expect#MongoUpdateResultSuccess) - [`MongoValidationError`](https://probitas-test.github.io/documents/api/expect#MongoValidationError) - [`MongoWriteError`](https://probitas-test.github.io/documents/api/expect#MongoWriteError) - [`QueryParams`](https://probitas-test.github.io/documents/api/expect#QueryParams) - [`QuerySyntaxError`](https://probitas-test.github.io/documents/api/expect#QuerySyntaxError) - [`QueryValue`](https://probitas-test.github.io/documents/api/expect#QueryValue) - [`RabbitMqAckResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqAckResult) - [`RabbitMqAckResultError`](https://probitas-test.github.io/documents/api/expect#RabbitMqAckResultError) - [`RabbitMqAckResultFailure`](https://probitas-test.github.io/documents/api/expect#RabbitMqAckResultFailure) - [`RabbitMqAckResultSuccess`](https://probitas-test.github.io/documents/api/expect#RabbitMqAckResultSuccess) - [`RabbitMqChannel`](https://probitas-test.github.io/documents/api/expect#RabbitMqChannel) - [`RabbitMqChannelError`](https://probitas-test.github.io/documents/api/expect#RabbitMqChannelError) - [`RabbitMqChannelErrorOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqChannelErrorOptions) - [`RabbitMqClient`](https://probitas-test.github.io/documents/api/expect#RabbitMqClient) - [`RabbitMqClientConfig`](https://probitas-test.github.io/documents/api/expect#RabbitMqClientConfig) - [`RabbitMqConnectionConfig`](https://probitas-test.github.io/documents/api/expect#RabbitMqConnectionConfig) - [`RabbitMqConnectionError`](https://probitas-test.github.io/documents/api/expect#RabbitMqConnectionError) - [`RabbitMqConsumeOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqConsumeOptions) - [`RabbitMqConsumeResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqConsumeResult) - [`RabbitMqConsumeResultError`](https://probitas-test.github.io/documents/api/expect#RabbitMqConsumeResultError) - [`RabbitMqConsumeResultFailure`](https://probitas-test.github.io/documents/api/expect#RabbitMqConsumeResultFailure) - [`RabbitMqConsumeResultSuccess`](https://probitas-test.github.io/documents/api/expect#RabbitMqConsumeResultSuccess) - [`RabbitMqError`](https://probitas-test.github.io/documents/api/expect#RabbitMqError) - [`RabbitMqErrorOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqErrorOptions) - [`RabbitMqExchangeOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeOptions) - [`RabbitMqExchangeResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeResult) - [`RabbitMqExchangeResultError`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeResultError) - [`RabbitMqExchangeResultFailure`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeResultFailure) - [`RabbitMqExchangeResultSuccess`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeResultSuccess) - [`RabbitMqExchangeType`](https://probitas-test.github.io/documents/api/expect#RabbitMqExchangeType) - [`RabbitMqExpectation`](https://probitas-test.github.io/documents/api/expect#RabbitMqExpectation) - [`RabbitMqFailureError`](https://probitas-test.github.io/documents/api/expect#RabbitMqFailureError) - [`RabbitMqMessage`](https://probitas-test.github.io/documents/api/expect#RabbitMqMessage) - [`RabbitMqMessageFields`](https://probitas-test.github.io/documents/api/expect#RabbitMqMessageFields) - [`RabbitMqMessageProperties`](https://probitas-test.github.io/documents/api/expect#RabbitMqMessageProperties) - [`RabbitMqNackOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqNackOptions) - [`RabbitMqNotFoundError`](https://probitas-test.github.io/documents/api/expect#RabbitMqNotFoundError) - [`RabbitMqNotFoundErrorOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqNotFoundErrorOptions) - [`RabbitMqOperationError`](https://probitas-test.github.io/documents/api/expect#RabbitMqOperationError) - [`RabbitMqOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqOptions) - [`RabbitMqPreconditionFailedError`](https://probitas-test.github.io/documents/api/expect#RabbitMqPreconditionFailedError) - [`RabbitMqPreconditionFailedErrorOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqPreconditionFailedErrorOptions) - [`RabbitMqPublishOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqPublishOptions) - [`RabbitMqPublishResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqPublishResult) - [`RabbitMqPublishResultError`](https://probitas-test.github.io/documents/api/expect#RabbitMqPublishResultError) - [`RabbitMqPublishResultFailure`](https://probitas-test.github.io/documents/api/expect#RabbitMqPublishResultFailure) - [`RabbitMqPublishResultSuccess`](https://probitas-test.github.io/documents/api/expect#RabbitMqPublishResultSuccess) - [`RabbitMqQueueOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqQueueOptions) - [`RabbitMqQueueResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqQueueResult) - [`RabbitMqQueueResultError`](https://probitas-test.github.io/documents/api/expect#RabbitMqQueueResultError) - [`RabbitMqQueueResultFailure`](https://probitas-test.github.io/documents/api/expect#RabbitMqQueueResultFailure) - [`RabbitMqQueueResultSuccess`](https://probitas-test.github.io/documents/api/expect#RabbitMqQueueResultSuccess) - [`RabbitMqRejectOptions`](https://probitas-test.github.io/documents/api/expect#RabbitMqRejectOptions) - [`RabbitMqResult`](https://probitas-test.github.io/documents/api/expect#RabbitMqResult) - [`RedirectMode`](https://probitas-test.github.io/documents/api/expect#RedirectMode) - [`RedisArrayResult`](https://probitas-test.github.io/documents/api/expect#RedisArrayResult) - [`RedisArrayResultError`](https://probitas-test.github.io/documents/api/expect#RedisArrayResultError) - [`RedisArrayResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisArrayResultFailure) - [`RedisArrayResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisArrayResultSuccess) - [`RedisClient`](https://probitas-test.github.io/documents/api/expect#RedisClient) - [`RedisClientConfig`](https://probitas-test.github.io/documents/api/expect#RedisClientConfig) - [`RedisCommandError`](https://probitas-test.github.io/documents/api/expect#RedisCommandError) - [`RedisCommandErrorOptions`](https://probitas-test.github.io/documents/api/expect#RedisCommandErrorOptions) - [`RedisCommandOptions`](https://probitas-test.github.io/documents/api/expect#RedisCommandOptions) - [`RedisCommonResult`](https://probitas-test.github.io/documents/api/expect#RedisCommonResult) - [`RedisCommonResultError`](https://probitas-test.github.io/documents/api/expect#RedisCommonResultError) - [`RedisCommonResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisCommonResultFailure) - [`RedisCommonResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisCommonResultSuccess) - [`RedisConnectionConfig`](https://probitas-test.github.io/documents/api/expect#RedisConnectionConfig) - [`RedisConnectionError`](https://probitas-test.github.io/documents/api/expect#RedisConnectionError) - [`RedisCountResult`](https://probitas-test.github.io/documents/api/expect#RedisCountResult) - [`RedisCountResultError`](https://probitas-test.github.io/documents/api/expect#RedisCountResultError) - [`RedisCountResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisCountResultFailure) - [`RedisCountResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisCountResultSuccess) - [`RedisError`](https://probitas-test.github.io/documents/api/expect#RedisError) - [`RedisErrorOptions`](https://probitas-test.github.io/documents/api/expect#RedisErrorOptions) - [`RedisExpectation`](https://probitas-test.github.io/documents/api/expect#RedisExpectation) - [`RedisFailureError`](https://probitas-test.github.io/documents/api/expect#RedisFailureError) - [`RedisGetResult`](https://probitas-test.github.io/documents/api/expect#RedisGetResult) - [`RedisGetResultError`](https://probitas-test.github.io/documents/api/expect#RedisGetResultError) - [`RedisGetResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisGetResultFailure) - [`RedisGetResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisGetResultSuccess) - [`RedisHashResult`](https://probitas-test.github.io/documents/api/expect#RedisHashResult) - [`RedisHashResultError`](https://probitas-test.github.io/documents/api/expect#RedisHashResultError) - [`RedisHashResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisHashResultFailure) - [`RedisHashResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisHashResultSuccess) - [`RedisMessage`](https://probitas-test.github.io/documents/api/expect#RedisMessage) - [`RedisOperationError`](https://probitas-test.github.io/documents/api/expect#RedisOperationError) - [`RedisResult`](https://probitas-test.github.io/documents/api/expect#RedisResult) - [`RedisScriptError`](https://probitas-test.github.io/documents/api/expect#RedisScriptError) - [`RedisScriptErrorOptions`](https://probitas-test.github.io/documents/api/expect#RedisScriptErrorOptions) - [`RedisSetOptions`](https://probitas-test.github.io/documents/api/expect#RedisSetOptions) - [`RedisSetResult`](https://probitas-test.github.io/documents/api/expect#RedisSetResult) - [`RedisSetResultError`](https://probitas-test.github.io/documents/api/expect#RedisSetResultError) - [`RedisSetResultFailure`](https://probitas-test.github.io/documents/api/expect#RedisSetResultFailure) - [`RedisSetResultSuccess`](https://probitas-test.github.io/documents/api/expect#RedisSetResultSuccess) - [`RedisTransaction`](https://probitas-test.github.io/documents/api/expect#RedisTransaction) - [`ReflectionApi`](https://probitas-test.github.io/documents/api/expect#ReflectionApi) - [`ServiceDetail`](https://probitas-test.github.io/documents/api/expect#ServiceDetail) - [`ServiceInfo`](https://probitas-test.github.io/documents/api/expect#ServiceInfo) - [`SqlConnectionError`](https://probitas-test.github.io/documents/api/expect#SqlConnectionError) - [`SqlError`](https://probitas-test.github.io/documents/api/expect#SqlError) - [`SqlErrorKind`](https://probitas-test.github.io/documents/api/expect#SqlErrorKind) - [`SqlErrorOptions`](https://probitas-test.github.io/documents/api/expect#SqlErrorOptions) - [`SqlFailureError`](https://probitas-test.github.io/documents/api/expect#SqlFailureError) - [`SqlIsolationLevel`](https://probitas-test.github.io/documents/api/expect#SqlIsolationLevel) - [`SqlQueryOptions`](https://probitas-test.github.io/documents/api/expect#SqlQueryOptions) - [`SqlQueryResult`](https://probitas-test.github.io/documents/api/expect#SqlQueryResult) - [`SqlQueryResultError`](https://probitas-test.github.io/documents/api/expect#SqlQueryResultError) - [`SqlQueryResultExpectation`](https://probitas-test.github.io/documents/api/expect#SqlQueryResultExpectation) - [`SqlQueryResultFailure`](https://probitas-test.github.io/documents/api/expect#SqlQueryResultFailure) - [`SqlQueryResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqlQueryResultSuccess) - [`SqsBatchError`](https://probitas-test.github.io/documents/api/expect#SqsBatchError) - [`SqsBatchFailedEntry`](https://probitas-test.github.io/documents/api/expect#SqsBatchFailedEntry) - [`SqsBatchMessage`](https://probitas-test.github.io/documents/api/expect#SqsBatchMessage) - [`SqsBatchOptions`](https://probitas-test.github.io/documents/api/expect#SqsBatchOptions) - [`SqsBatchSuccessEntry`](https://probitas-test.github.io/documents/api/expect#SqsBatchSuccessEntry) - [`SqsClient`](https://probitas-test.github.io/documents/api/expect#SqsClient) - [`SqsClientConfig`](https://probitas-test.github.io/documents/api/expect#SqsClientConfig) - [`SqsCommandError`](https://probitas-test.github.io/documents/api/expect#SqsCommandError) - [`SqsCommandErrorOptions`](https://probitas-test.github.io/documents/api/expect#SqsCommandErrorOptions) - [`SqsConnectionConfig`](https://probitas-test.github.io/documents/api/expect#SqsConnectionConfig) - [`SqsConnectionError`](https://probitas-test.github.io/documents/api/expect#SqsConnectionError) - [`SqsDeleteBatchResult`](https://probitas-test.github.io/documents/api/expect#SqsDeleteBatchResult) - [`SqsDeleteBatchResultError`](https://probitas-test.github.io/documents/api/expect#SqsDeleteBatchResultError) - [`SqsDeleteBatchResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsDeleteBatchResultFailure) - [`SqsDeleteBatchResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsDeleteBatchResultSuccess) - [`SqsDeleteOptions`](https://probitas-test.github.io/documents/api/expect#SqsDeleteOptions) - [`SqsDeleteQueueOptions`](https://probitas-test.github.io/documents/api/expect#SqsDeleteQueueOptions) - [`SqsDeleteQueueResult`](https://probitas-test.github.io/documents/api/expect#SqsDeleteQueueResult) - [`SqsDeleteQueueResultError`](https://probitas-test.github.io/documents/api/expect#SqsDeleteQueueResultError) - [`SqsDeleteQueueResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsDeleteQueueResultFailure) - [`SqsDeleteQueueResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsDeleteQueueResultSuccess) - [`SqsDeleteResult`](https://probitas-test.github.io/documents/api/expect#SqsDeleteResult) - [`SqsDeleteResultError`](https://probitas-test.github.io/documents/api/expect#SqsDeleteResultError) - [`SqsDeleteResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsDeleteResultFailure) - [`SqsDeleteResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsDeleteResultSuccess) - [`SqsEnsureQueueOptions`](https://probitas-test.github.io/documents/api/expect#SqsEnsureQueueOptions) - [`SqsEnsureQueueResult`](https://probitas-test.github.io/documents/api/expect#SqsEnsureQueueResult) - [`SqsEnsureQueueResultError`](https://probitas-test.github.io/documents/api/expect#SqsEnsureQueueResultError) - [`SqsEnsureQueueResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsEnsureQueueResultFailure) - [`SqsEnsureQueueResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsEnsureQueueResultSuccess) - [`SqsError`](https://probitas-test.github.io/documents/api/expect#SqsError) - [`SqsErrorOptions`](https://probitas-test.github.io/documents/api/expect#SqsErrorOptions) - [`SqsExpectation`](https://probitas-test.github.io/documents/api/expect#SqsExpectation) - [`SqsFailureError`](https://probitas-test.github.io/documents/api/expect#SqsFailureError) - [`SqsMessage`](https://probitas-test.github.io/documents/api/expect#SqsMessage) - [`SqsMessageAttribute`](https://probitas-test.github.io/documents/api/expect#SqsMessageAttribute) - [`SqsMessageNotFoundError`](https://probitas-test.github.io/documents/api/expect#SqsMessageNotFoundError) - [`SqsMessageTooLargeError`](https://probitas-test.github.io/documents/api/expect#SqsMessageTooLargeError) - [`SqsOptions`](https://probitas-test.github.io/documents/api/expect#SqsOptions) - [`SqsQueueNotFoundError`](https://probitas-test.github.io/documents/api/expect#SqsQueueNotFoundError) - [`SqsReceiveOptions`](https://probitas-test.github.io/documents/api/expect#SqsReceiveOptions) - [`SqsReceiveResult`](https://probitas-test.github.io/documents/api/expect#SqsReceiveResult) - [`SqsReceiveResultError`](https://probitas-test.github.io/documents/api/expect#SqsReceiveResultError) - [`SqsReceiveResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsReceiveResultFailure) - [`SqsReceiveResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsReceiveResultSuccess) - [`SqsResult`](https://probitas-test.github.io/documents/api/expect#SqsResult) - [`SqsSendBatchResult`](https://probitas-test.github.io/documents/api/expect#SqsSendBatchResult) - [`SqsSendBatchResultError`](https://probitas-test.github.io/documents/api/expect#SqsSendBatchResultError) - [`SqsSendBatchResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsSendBatchResultFailure) - [`SqsSendBatchResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsSendBatchResultSuccess) - [`SqsSendOptions`](https://probitas-test.github.io/documents/api/expect#SqsSendOptions) - [`SqsSendResult`](https://probitas-test.github.io/documents/api/expect#SqsSendResult) - [`SqsSendResultError`](https://probitas-test.github.io/documents/api/expect#SqsSendResultError) - [`SqsSendResultFailure`](https://probitas-test.github.io/documents/api/expect#SqsSendResultFailure) - [`SqsSendResultSuccess`](https://probitas-test.github.io/documents/api/expect#SqsSendResultSuccess) - [`TlsConfig`](https://probitas-test.github.io/documents/api/expect#TlsConfig) - [`UpdateFilter`](https://probitas-test.github.io/documents/api/expect#UpdateFilter) ### Other Packages - [`AbortError`](https://probitas-test.github.io/documents/api/client#AbortError) (@probitas/client) - [`CommonConnectionConfig`](https://probitas-test.github.io/documents/api/client#CommonConnectionConfig) (@probitas/client) - [`CommonOptions`](https://probitas-test.github.io/documents/api/client#CommonOptions) (@probitas/client) - [`Outdent`](https://probitas-test.github.io/documents/api/probitas#Outdent) (@probitas/probitas) - [`TimeoutError`](https://probitas-test.github.io/documents/api/client#TimeoutError) (@probitas/client) ### Built-in Types - [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) - [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) - [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys) - [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) - [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) - [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) - [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) --- *Last updated: 2026-01-12*