Skip to content

feat!: replace the openapi-ts client with protobuf-es + connect-gateway-es#2

Merged
philz3906 merged 1 commit into
mainfrom
protobuf-es-client
Jun 13, 2026
Merged

feat!: replace the openapi-ts client with protobuf-es + connect-gateway-es#2
philz3906 merged 1 commit into
mainfrom
protobuf-es-client

Conversation

@philz3906

Copy link
Copy Markdown
Contributor

What

@sentio/api v3: the client is now generated from Sentio's protobuf definitions with protobuf-es and calls the REST API through connect-es using the @sentio/connect-gateway-es transport.

  • src/gen/** — generated bindings (public REST surface, 13 services / 64 methods, exactly matching the OpenAPI spec)
  • src/client.tscreateSentioTransport({ apiKey, baseUrl, ... }) (sends the api-key header) and createSentioClient(Service, options)
  • src/index.ts — service re-exports; message types deep-import via @sentio/api/gen/*
  • ESM-only, Node 20+; deps: @bufbuild/protobuf, @connectrpc/connect, @sentio/connect-gateway-es@^1.0.0
  • openapi.json + doc/ unchanged (still synced from CI for the raw REST reference)

Why

  • Wire-faithful types (int64/oneof/enums/WKTs) instead of the lossy proto→openapi→TS double translation
  • Server-streaming endpoint support
  • Same codegen pipeline as Sentio's own frontend/backends; the surface is produced by visibility-filtered codegen that prunes everything non-public at the descriptor level

Testing

  • pnpm build + pnpm test green (offline construction test; live test runs when SENTIO_API_KEY is set)
  • Live smoke test against production: createSentioClient(PriceService).listCoins({ limit: 3 }) → typed response with oneof correctly parsed

Companion (to land after this): sentio-side PR switches the publish pipeline (openapi/push.sh) from openapi-ts generation to syncing the protobuf-es bindings into src/gen.

🤖 Generated with Claude Code

…ay-es

The TypeScript client is now built from Sentio's protobuf definitions
with protobuf-es and calls the REST API through connect-es using the
@sentio/connect-gateway-es transport (the grpc-gateway REST dialect).
Requests and responses are wire-faithful protobuf types — int64, oneof,
enums and well-known types survive without the openapi translation — and
server-streaming endpoints are supported.

- src/client.ts: createSentioTransport({ apiKey, baseUrl, ... }) (sends
  the api-key header; default baseUrl https://app.sentio.xyz) and
  createSentioClient(Service, options)
- src/index.ts: re-exports the public service descriptors; message types
  deep-import via @sentio/api/gen/*
- removed the hey-api output (client.gen.ts/sdk.gen.ts/types.gen.ts);
  src/gen is now generated by Sentio CI (visibility-filtered public REST
  surface) and synced into this repo
- deps: @bufbuild/protobuf, @connectrpc/connect, @sentio/connect-gateway-es;
  bumped tooling and require Node 24; pin pnpm 11.3.0
- add CLAUDE.md (+ AGENTS.md symlink) agent guide and a PR CI workflow
- disable pnpm's minimumReleaseAge supply-chain gate (rejects our own
  freshly published deps for a day without value for this trusted set)

BREAKING CHANGE: client.setConfig + static service classes are replaced
by connect-es clients (createSentioClient / createSentioTransport).
Errors are ConnectError. The package is ESM-only and requires Node 24+.
@philz3906 philz3906 force-pushed the protobuf-es-client branch from dc4de7d to 15b0c45 Compare June 13, 2026 02:45
@philz3906 philz3906 merged commit e88441c into main Jun 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant