Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

Client library collection for exercising Probitas scenarios against real services.

License

Notifications You must be signed in to change notification settings

probitas-test/probitas-client

Repository files navigation

⚠️ DEPRECATED

Merged into https://github.com/probitas-test/probitas-packages


Probitas Client

Test Publish codecov

Client library collection for exercising Probitas scenarios against real services. Each protocol-specific client shares the same ergonomics and error model so scenario code stays consistent.

Highlights

  • Multi-protocol coverage: HTTP, ConnectRPC/gRPC/gRPC-Web, GraphQL, SQL (Postgres/MySQL/SQLite/DuckDB), MongoDB, Redis, RabbitMQ, SQS, and Deno KV
  • Shared ClientError hierarchy with per-client literal kind values for safe narrowing
  • AsyncDisposable-aware clients for predictable resource cleanup in Probitas scenarios
  • Built for Deno 2.x and published on JSR under the @probitas/* namespace

Packages

Package JSR Description
@probitas/client JSR Core options and error base types shared by all clients
@probitas/client-http JSR HTTP client with buffered responses and cookie support
@probitas/client-connectrpc JSR ConnectRPC client supporting Connect, gRPC, and gRPC-Web protocols
@probitas/client-grpc JSR gRPC client (thin wrapper over client-connectrpc with protocol="grpc")
@probitas/client-graphql JSR GraphQL client with data/error helpers
@probitas/client-sql JSR Shared SQL result/transaction types
@probitas/client-sql-postgres JSR PostgreSQL client built on the shared SQL types
@probitas/client-sql-mysql JSR MySQL client built on the shared SQL types
@probitas/client-sql-sqlite JSR SQLite client built on the shared SQL types
@probitas/client-sql-duckdb JSR DuckDB client built on the shared SQL types
@probitas/client-mongodb JSR MongoDB client with session/transaction helpers
@probitas/client-redis JSR Redis client for command execution
@probitas/client-deno-kv JSR Deno KV client for key-value storage
@probitas/client-sqs JSR SQS client targeting LocalStack for integration testing
@probitas/client-rabbitmq JSR RabbitMQ client with channel lifecycle management

Quick Start

Add the clients you need to your deno.json imports (JSR aliases are already provided in the workspace):

{
  "imports": {
    "@probitas/client-http": "jsr:@probitas/client-http@^0"
  }
}

Use them inside Probitas scenarios with resource-managed clients:

import { scenario } from "jsr:@probitas/probitas";
import { createHttpClient } from "@probitas/client-http";
import { assertEquals } from "@std/assert";

export default scenario("example http request")
  .resource(
    "http",
    () => createHttpClient({ url: "http://localhost:18080" }),
  )
  .step("call API", (ctx) => ctx.resources.http.get("/get?hello=world"))
  .step("assert response", (ctx) => {
    const response = ctx.previous;
    assertEquals(response.status, 200);
    assertEquals(response.json.args.hello, "world");
  })
  .build();

Refer to docs/clients.md for package-specific usage notes and to the Probitas framework for scenario authoring.

Development

  • Tooling: Deno 2.x. A Nix flake is provided (nix develop) for consistent tooling.
  • Tasks: deno task verify runs fmt, lint, type-check, and tests. See deno.jsonc for the full task list.
  • Integration services: compose.yaml starts local dependencies (HTTP/ConnectRPC/gRPC/GraphQL echo servers, Postgres/MySQL, Redis, MongoDB, RabbitMQ, LocalStack, Deno KV). Echo server images are published to ghcr.io/probitas-test/.
  • Specs: Detailed protocol expectations are tracked in docs/specs/00-overview.md.

Documentation

  • docs/overview.md – architecture, design principles, error model, and testing approach
  • docs/clients.md – client capabilities, configuration, and integration tips

License

See LICENSE for details.

About

Client library collection for exercising Probitas scenarios against real services.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project