From ef0db5256adb098f677351be54e0704fb5ec0cf6 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 15:47:30 -0400 Subject: [PATCH 1/6] Update references --- Makefile | 6 +- README.md | 4 +- packages/connect-express/README.md | 14 +- packages/connect-fastify/README.md | 16 +- packages/connect-next/README.md | 12 +- .../src/express-readme.spec.ts | 11 +- .../src/gen/grpc/testing/empty_pb.ts | 63 - .../src/gen/grpc/testing/messages_pb.ts | 1318 ----------------- .../src/gen/grpc/testing/test_connect.ts | 333 ----- .../src/gen/server/v1/server_pb.ts | 184 --- .../connect-node-test/src/node-readme.spec.ts | 17 +- .../connect-node-test/src/transports.spec.ts | 6 +- packages/connect-node/README.md | 22 +- packages/connect-web-bench/README.md | 12 +- packages/connect-web-bench/report.mjs | 12 +- .../connect-web-bench/src/entry-connect.ts | 4 +- .../connect-web-bench/src/entry-grpcweb.ts | 4 +- .../eliza/v1/eliza_connect.ts | 36 +- .../demo => connectrpc}/eliza/v1/eliza_pb.ts | 40 +- .../demo/eliza/v1/eliza_grpc_web_pb.d.ts | 41 - .../eliza/v1/eliza_grpc_web_pb.d.ts | 41 + .../eliza/v1/eliza_grpc_web_pb.js | 80 +- .../eliza/v1/eliza_pb.d.ts | 0 .../demo => connectrpc}/eliza/v1/eliza_pb.js | 268 ++-- .../src/browserstackonly/eliza.spec.ts | 6 +- packages/connect-web/README.md | 6 +- packages/connect/README.md | 4 +- packages/example/README.md | 32 +- packages/example/eliza.proto | 42 +- packages/example/src/gen/eliza_connect.ts | 38 +- packages/example/src/gen/eliza_pb.ts | 42 +- packages/protoc-gen-connect-es/README.md | 70 +- 32 files changed, 443 insertions(+), 2341 deletions(-) delete mode 100644 packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts delete mode 100644 packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts delete mode 100644 packages/connect-node-test/src/gen/grpc/testing/test_connect.ts delete mode 100644 packages/connect-node-test/src/gen/server/v1/server_pb.ts rename packages/connect-web-bench/src/gen/connectweb/{buf/connect/demo => connectrpc}/eliza/v1/eliza_connect.ts (53%) rename packages/connect-web-bench/src/gen/connectweb/{buf/connect/demo => connectrpc}/eliza/v1/eliza_pb.ts (85%) delete mode 100644 packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.d.ts create mode 100644 packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.d.ts rename packages/connect-web-bench/src/gen/grpcweb/{buf/connect/demo => connectrpc}/eliza/v1/eliza_grpc_web_pb.js (55%) rename packages/connect-web-bench/src/gen/grpcweb/{buf/connect/demo => connectrpc}/eliza/v1/eliza_pb.d.ts (100%) rename packages/connect-web-bench/src/gen/grpcweb/{buf/connect/demo => connectrpc}/eliza/v1/eliza_pb.js (65%) diff --git a/Makefile b/Makefile index 1228362a1..e746f61be 100644 --- a/Makefile +++ b/Makefile @@ -125,19 +125,19 @@ $(GEN)/connect: node_modules/.bin/protoc-gen-es packages/connect/buf.gen.yaml $( $(GEN)/connect-web-test: node_modules/.bin/protoc-gen-es $(BUILD)/protoc-gen-connect-es packages/connect-web-test/buf.gen.yaml Makefile rm -rf packages/connect-web-test/src/gen/* npm run -w packages/connect-web-test generate https://github.com/bufbuild/connect-crosstest.git#ref=$(CROSSTEST_VERSION),subdir=proto - npm run -w packages/connect-web-test generate buf.build/bufbuild/eliza + npm run -w packages/connect-web-test generate buf.build/connectrpc/eliza @mkdir -p $(@D) @touch $(@) $(GEN)/connect-node-test: node_modules/.bin/protoc-gen-es $(BUILD)/protoc-gen-connect-es packages/connect-node-test/buf.gen.yaml Makefile rm -rf packages/connect-node-test/src/gen/* - npm run -w packages/connect-node-test generate https://github.com/bufbuild/connect-crosstest.git#ref=$(CROSSTEST_VERSION),subdir=proto + npm run -w packages/connect-node-test generate https://github.com/connectrpc/connect-crosstest.git#ref=$(CROSSTEST_VERSION),subdir=proto @mkdir -p $(@D) @touch $(@) $(GEN)/connect-web-bench: node_modules/.bin/protoc-gen-es $(BUILD)/protoc-gen-connect-es packages/connect-web-bench/buf.gen.yaml Makefile rm -rf packages/connect-web-bench/src/gen/* - npm run -w packages/connect-web-bench generate buf.build/bufbuild/eliza:847d7675503fd7aef7137c62376fdbabcf777568 + npm run -w packages/connect-web-bench generate buf.build/connectrpc/eliza:d8fbf2620c604277a0ece1ff3a26f2ff @mkdir -p $(@D) @touch $(@) diff --git a/README.md b/README.md index 711baa0b4..784b08c8b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ can `curl` them if you want: curl \ --header 'Content-Type: application/json' \ --data '{"sentence": "I feel happy."}' \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Say + https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say ``` Connect uses [Protobuf-ES](https://github.com/bufbuild/protobuf-es), the only @@ -108,7 +108,7 @@ The libraries and the generated code are compatible with ES2017 and TypeScript 4 * [connect-go](https://github.com/bufbuild/connect-go): Go implementation of gRPC, gRPC-Web, and Connect * [connect-demo](https://github.com/bufbuild/connect-demo): - demonstration service powering demo.connect.build + demonstration service powering demo.connectrpc.com * [connect-crosstest](https://github.com/bufbuild/connect-crosstest): gRPC-Web and Connect interoperability tests * [Buf Studio](https://buf.build/studio): web UI for ad-hoc RPCs diff --git a/packages/connect-express/README.md b/packages/connect-express/README.md index b1f7a5885..824c52a16 100644 --- a/packages/connect-express/README.md +++ b/packages/connect-express/README.md @@ -4,7 +4,7 @@ Connect is a family of libraries for building and consuming APIs on different la [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings type-safe APIs with Protobuf to TypeScript. -`@bufbuild/connect-express` provides a middleware for [Express](https://expressjs.com/), the fast, +`@bufbuild/connect-express` provides a middleware for [Express](https://expressjs.com/), the fast, unopinionated, minimalist web framework for Node.js ### expressConnectMiddleware() @@ -32,8 +32,8 @@ import express from "express"; const app = express(); -+ app.use(expressConnectMiddleware({ -+ routes ++ app.use(expressConnectMiddleware({ ++ routes + })); http.createServer(app).listen(8080); @@ -47,7 +47,7 @@ With that server running, you can make requests with any gRPC-web or Connect cli curl \ --header "Content-Type: application/json" \ --data '{"sentence": "I feel happy."}' \ - http://localhost:8080/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say ``` Node.js with the gRPC-web protocol (using a transport from [@bufbuild/connect-node](https://www.npmjs.com/package/@bufbuild/connect-node)): @@ -68,14 +68,14 @@ console.log(sentence) // you said: I feel happy. ``` A client for the web browser actually looks identical to this example - it would -simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) +simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) instead. -Note that support for gRPC is limited, since many gRPC clients require HTTP/2, +Note that support for gRPC is limited, since many gRPC clients require HTTP/2, and Express does not support the Node.js `http2` module. ## Getting started To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) -for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). +for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-fastify/README.md b/packages/connect-fastify/README.md index 5b023329b..7bbd9a55a 100644 --- a/packages/connect-fastify/README.md +++ b/packages/connect-fastify/README.md @@ -4,7 +4,7 @@ Connect is a family of libraries for building and consuming APIs on different la [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings type-safe APIs with Protobuf to TypeScript. -`@bufbuild/connect-fastify` provides a plugin for [fastify](https://www.fastify.io/), the fast and +`@bufbuild/connect-fastify` provides a plugin for [fastify](https://www.fastify.io/), the fast and low overhead web framework, for Node.js. ### fastifyConnectPlugin() @@ -33,8 +33,8 @@ const server = fastify({ http2: true, }); -+ await server.register(fastifyConnectPlugin, { -+ routes ++ await server.register(fastifyConnectPlugin, { ++ routes + }); await server.listen({ @@ -48,10 +48,10 @@ With that server running, you can make requests with any gRPC, gRPC-Web, or Conn `buf curl` with the gRPC protocol: ```bash -buf curl --schema buf.build/bufbuild/eliza \ +buf curl --schema buf.build/connectrpc/eliza \ --protocol grpc --http2-prior-knowledge \ -d '{"sentence": "I feel happy."}' \ - http://localhost:8080/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say ``` `curl` with the Connect protocol: @@ -61,7 +61,7 @@ curl \ --header "Content-Type: application/json" \ --data '{"sentence": "I feel happy."}' \ --http2-prior-knowledge \ - http://localhost:8080/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say ``` Node.js with the gRPC protocol (using a transport from [@bufbuild/connect-node](https://www.npmjs.com/package/@bufbuild/connect-node)): @@ -82,11 +82,11 @@ console.log(sentence) // you said: I feel happy. ``` A client for the web browser actually looks identical to this example - it would -simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) +simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) instead. ## Getting started To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) -for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). +for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-next/README.md b/packages/connect-next/README.md index 0bd56340c..27827e2d2 100644 --- a/packages/connect-next/README.md +++ b/packages/connect-next/README.md @@ -4,13 +4,13 @@ Connect is a family of libraries for building and consuming APIs on different la [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings type-safe APIs with Protobuf to TypeScript. -`@bufbuild/connect-next` provides a plugin for [Next.js](https://nextjs.org/), +`@bufbuild/connect-next` provides a plugin for [Next.js](https://nextjs.org/), the React Framework for the Web. ### nextJsApiRouter() -Provide your Connect RPCs via Next.js API routes. To enable Connect in Next.js, +Provide your Connect RPCs via Next.js API routes. To enable Connect in Next.js, add two files to your project: ```diff @@ -35,7 +35,7 @@ export default function(router: ConnectRouter) { } ``` -`pages/api/[[..connect]].ts` is a Next.js [catch-all API route](https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes): +`pages/api/[[..connect]].ts` is a Next.js [catch-all API route](https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes): ```ts // pages/api/[[..connect]].ts @@ -56,7 +56,7 @@ curl \ --header "Content-Type: application/json" \ --data '{"sentence": "I feel happy."}' \ --http2-prior-knowledge \ - http://localhost:3000/api/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:3000/api/connectrpc.eliza.v1.ElizaService/Say ``` Node.js with the gRPC-web protocol (using a transport from [@bufbuild/connect-node](https://www.npmjs.com/package/@bufbuild/connect-node)): @@ -88,10 +88,10 @@ and Express does not support the Node.js `http2` module. Currently, `@bufbuild/connect-next` does not support the Vercel Edge runtime. It requires the Node.js server runtime, which is used by default when deploying -to Vercel. +to Vercel. ## Getting started To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) -for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). +for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-node-test/src/express-readme.spec.ts b/packages/connect-node-test/src/express-readme.spec.ts index d57c393ee..33a9b04f6 100644 --- a/packages/connect-node-test/src/express-readme.spec.ts +++ b/packages/connect-node-test/src/express-readme.spec.ts @@ -24,21 +24,20 @@ describe("express readme", function () { interface SayR extends Message { sentence: string; } - const SayR = proto3.makeMessageType( - "buf.connect.demo.eliza.v1.SayRequest", - [{ no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }], - ); + const SayR = proto3.makeMessageType("connectrpc.eliza.v1.SayRequest", [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); interface IntroduceRequest extends Message { name: string; } const IntroduceRequest = proto3.makeMessageType( - "buf.connect.demo.eliza.v1.IntroduceRequest", + "connectrpc.eliza.v1.IntroduceRequest", [{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }], ); const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { say: { name: "Say", diff --git a/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts b/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts deleted file mode 100644 index ddd1d3719..000000000 --- a/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts +++ /dev/null @@ -1,63 +0,0 @@ -// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/empty.proto - -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file grpc/testing/empty.proto (package grpc.testing, syntax proto3) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * An empty message that you can re-use to avoid defining duplicated empty - * messages in your project. A typical example is to use it as argument or the - * return value of a service API. For instance: - * - * service Foo { - * rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; - * }; - * - * - * @generated from message grpc.testing.Empty - */ -export class Empty extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.Empty"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Empty { - return new Empty().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Empty { - return new Empty().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Empty { - return new Empty().fromJsonString(jsonString, options); - } - - static equals(a: Empty | PlainMessage | undefined, b: Empty | PlainMessage | undefined): boolean { - return proto3.util.equals(Empty, a, b); - } -} - diff --git a/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts b/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts deleted file mode 100644 index 57b84cea2..000000000 --- a/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts +++ /dev/null @@ -1,1318 +0,0 @@ -// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/messages.proto - -// Copyright 2015-2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Message definitions to be used by integration test service definitions. - -// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file grpc/testing/messages.proto (package grpc.testing, syntax proto3) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Any, Message, proto3 } from "@bufbuild/protobuf"; - -/** - * The type of payload that should be returned. - * - * @generated from enum grpc.testing.PayloadType - */ -export enum PayloadType { - /** - * Compressable text format. - * - * @generated from enum value: COMPRESSABLE = 0; - */ - COMPRESSABLE = 0, -} -// Retrieve enum metadata with: proto3.getEnumType(PayloadType) -proto3.util.setEnumType(PayloadType, "grpc.testing.PayloadType", [ - { no: 0, name: "COMPRESSABLE" }, -]); - -/** - * The type of route that a client took to reach a server w.r.t. gRPCLB. - * The server must fill in "fallback" if it detects that the RPC reached - * the server via the "gRPCLB fallback" path, and "backend" if it detects - * that the RPC reached the server via "gRPCLB backend" path (i.e. if it got - * the address of this server from the gRPCLB server BalanceLoad RPC). Exactly - * how this detection is done is context and server dependent. - * - * @generated from enum grpc.testing.GrpclbRouteType - */ -export enum GrpclbRouteType { - /** - * Server didn't detect the route that a client took to reach it. - * - * @generated from enum value: GRPCLB_ROUTE_TYPE_UNKNOWN = 0; - */ - UNKNOWN = 0, - - /** - * Indicates that a client reached a server via gRPCLB fallback. - * - * @generated from enum value: GRPCLB_ROUTE_TYPE_FALLBACK = 1; - */ - FALLBACK = 1, - - /** - * Indicates that a client reached a server as a gRPCLB-given backend. - * - * @generated from enum value: GRPCLB_ROUTE_TYPE_BACKEND = 2; - */ - BACKEND = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(GrpclbRouteType) -proto3.util.setEnumType(GrpclbRouteType, "grpc.testing.GrpclbRouteType", [ - { no: 0, name: "GRPCLB_ROUTE_TYPE_UNKNOWN" }, - { no: 1, name: "GRPCLB_ROUTE_TYPE_FALLBACK" }, - { no: 2, name: "GRPCLB_ROUTE_TYPE_BACKEND" }, -]); - -/** - * TODO(dgq): Go back to using well-known types once - * https://github.com/grpc/grpc/issues/6980 has been fixed. - * import "google/protobuf/wrappers.proto"; - * - * @generated from message grpc.testing.BoolValue - */ -export class BoolValue extends Message { - /** - * The bool value. - * - * @generated from field: bool value = 1; - */ - value = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.BoolValue"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "value", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): BoolValue { - return new BoolValue().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): BoolValue { - return new BoolValue().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): BoolValue { - return new BoolValue().fromJsonString(jsonString, options); - } - - static equals(a: BoolValue | PlainMessage | undefined, b: BoolValue | PlainMessage | undefined): boolean { - return proto3.util.equals(BoolValue, a, b); - } -} - -/** - * A block of data, to simply increase gRPC message size. - * - * @generated from message grpc.testing.Payload - */ -export class Payload extends Message { - /** - * The type of data in body. - * - * @generated from field: grpc.testing.PayloadType type = 1; - */ - type = PayloadType.COMPRESSABLE; - - /** - * Primary contents of payload. - * - * @generated from field: bytes body = 2; - */ - body = new Uint8Array(0); - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.Payload"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(PayloadType) }, - { no: 2, name: "body", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Payload { - return new Payload().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Payload { - return new Payload().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Payload { - return new Payload().fromJsonString(jsonString, options); - } - - static equals(a: Payload | PlainMessage | undefined, b: Payload | PlainMessage | undefined): boolean { - return proto3.util.equals(Payload, a, b); - } -} - -/** - * A protobuf representation for grpc status. This is used by test - * clients to specify a status that the server should attempt to return. - * - * @generated from message grpc.testing.EchoStatus - */ -export class EchoStatus extends Message { - /** - * @generated from field: int32 code = 1; - */ - code = 0; - - /** - * @generated from field: string message = 2; - */ - message = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.EchoStatus"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "code", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): EchoStatus { - return new EchoStatus().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): EchoStatus { - return new EchoStatus().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): EchoStatus { - return new EchoStatus().fromJsonString(jsonString, options); - } - - static equals(a: EchoStatus | PlainMessage | undefined, b: EchoStatus | PlainMessage | undefined): boolean { - return proto3.util.equals(EchoStatus, a, b); - } -} - -/** - * Unary request. - * - * @generated from message grpc.testing.SimpleRequest - */ -export class SimpleRequest extends Message { - /** - * Desired payload type in the response from the server. - * If response_type is RANDOM, server randomly chooses one from other formats. - * - * @generated from field: grpc.testing.PayloadType response_type = 1; - */ - responseType = PayloadType.COMPRESSABLE; - - /** - * Desired payload size in the response from the server. - * - * @generated from field: int32 response_size = 2; - */ - responseSize = 0; - - /** - * Optional input payload sent along with the request. - * - * @generated from field: grpc.testing.Payload payload = 3; - */ - payload?: Payload; - - /** - * Whether SimpleResponse should include username. - * - * @generated from field: bool fill_username = 4; - */ - fillUsername = false; - - /** - * Whether SimpleResponse should include OAuth scope. - * - * @generated from field: bool fill_oauth_scope = 5; - */ - fillOauthScope = false; - - /** - * Whether to request the server to compress the response. This field is - * "nullable" in order to interoperate seamlessly with clients not able to - * implement the full compression tests by introspecting the call to verify - * the response's compression status. - * - * @generated from field: grpc.testing.BoolValue response_compressed = 6; - */ - responseCompressed?: BoolValue; - - /** - * Whether server should return a given status - * - * @generated from field: grpc.testing.EchoStatus response_status = 7; - */ - responseStatus?: EchoStatus; - - /** - * Whether the server should expect this request to be compressed. - * - * @generated from field: grpc.testing.BoolValue expect_compressed = 8; - */ - expectCompressed?: BoolValue; - - /** - * Whether SimpleResponse should include server_id. - * - * @generated from field: bool fill_server_id = 9; - */ - fillServerId = false; - - /** - * Whether SimpleResponse should include grpclb_route_type. - * - * @generated from field: bool fill_grpclb_route_type = 10; - */ - fillGrpclbRouteType = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.SimpleRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "response_type", kind: "enum", T: proto3.getEnumType(PayloadType) }, - { no: 2, name: "response_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "payload", kind: "message", T: Payload }, - { no: 4, name: "fill_username", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "fill_oauth_scope", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 6, name: "response_compressed", kind: "message", T: BoolValue }, - { no: 7, name: "response_status", kind: "message", T: EchoStatus }, - { no: 8, name: "expect_compressed", kind: "message", T: BoolValue }, - { no: 9, name: "fill_server_id", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 10, name: "fill_grpclb_route_type", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SimpleRequest { - return new SimpleRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SimpleRequest { - return new SimpleRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SimpleRequest { - return new SimpleRequest().fromJsonString(jsonString, options); - } - - static equals(a: SimpleRequest | PlainMessage | undefined, b: SimpleRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(SimpleRequest, a, b); - } -} - -/** - * Unary response, as configured by the request. - * - * @generated from message grpc.testing.SimpleResponse - */ -export class SimpleResponse extends Message { - /** - * Payload to increase message size. - * - * @generated from field: grpc.testing.Payload payload = 1; - */ - payload?: Payload; - - /** - * The user the request came from, for verifying authentication was - * successful when the client expected it. - * - * @generated from field: string username = 2; - */ - username = ""; - - /** - * OAuth scope. - * - * @generated from field: string oauth_scope = 3; - */ - oauthScope = ""; - - /** - * Server ID. This must be unique among different server instances, - * but the same across all RPC's made to a particular server instance. - * - * @generated from field: string server_id = 4; - */ - serverId = ""; - - /** - * gRPCLB Path. - * - * @generated from field: grpc.testing.GrpclbRouteType grpclb_route_type = 5; - */ - grpclbRouteType = GrpclbRouteType.UNKNOWN; - - /** - * Server hostname. - * - * @generated from field: string hostname = 6; - */ - hostname = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.SimpleResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "payload", kind: "message", T: Payload }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "oauth_scope", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "server_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "grpclb_route_type", kind: "enum", T: proto3.getEnumType(GrpclbRouteType) }, - { no: 6, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): SimpleResponse { - return new SimpleResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): SimpleResponse { - return new SimpleResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): SimpleResponse { - return new SimpleResponse().fromJsonString(jsonString, options); - } - - static equals(a: SimpleResponse | PlainMessage | undefined, b: SimpleResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(SimpleResponse, a, b); - } -} - -/** - * Client-streaming request. - * - * @generated from message grpc.testing.StreamingInputCallRequest - */ -export class StreamingInputCallRequest extends Message { - /** - * Optional input payload sent along with the request. - * - * @generated from field: grpc.testing.Payload payload = 1; - */ - payload?: Payload; - - /** - * Whether the server should expect this request to be compressed. This field - * is "nullable" in order to interoperate seamlessly with servers not able to - * implement the full compression tests by introspecting the call to verify - * the request's compression status. - * - * @generated from field: grpc.testing.BoolValue expect_compressed = 2; - */ - expectCompressed?: BoolValue; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.StreamingInputCallRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "payload", kind: "message", T: Payload }, - { no: 2, name: "expect_compressed", kind: "message", T: BoolValue }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): StreamingInputCallRequest { - return new StreamingInputCallRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): StreamingInputCallRequest { - return new StreamingInputCallRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): StreamingInputCallRequest { - return new StreamingInputCallRequest().fromJsonString(jsonString, options); - } - - static equals(a: StreamingInputCallRequest | PlainMessage | undefined, b: StreamingInputCallRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(StreamingInputCallRequest, a, b); - } -} - -/** - * Client-streaming response. - * - * @generated from message grpc.testing.StreamingInputCallResponse - */ -export class StreamingInputCallResponse extends Message { - /** - * Aggregated size of payloads received from the client. - * - * @generated from field: int32 aggregated_payload_size = 1; - */ - aggregatedPayloadSize = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.StreamingInputCallResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "aggregated_payload_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): StreamingInputCallResponse { - return new StreamingInputCallResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): StreamingInputCallResponse { - return new StreamingInputCallResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): StreamingInputCallResponse { - return new StreamingInputCallResponse().fromJsonString(jsonString, options); - } - - static equals(a: StreamingInputCallResponse | PlainMessage | undefined, b: StreamingInputCallResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(StreamingInputCallResponse, a, b); - } -} - -/** - * Configuration for a particular response. - * - * @generated from message grpc.testing.ResponseParameters - */ -export class ResponseParameters extends Message { - /** - * Desired payload sizes in responses from the server. - * - * @generated from field: int32 size = 1; - */ - size = 0; - - /** - * Desired interval between consecutive responses in the response stream in - * microseconds. - * - * @generated from field: int32 interval_us = 2; - */ - intervalUs = 0; - - /** - * Whether to request the server to compress the response. This field is - * "nullable" in order to interoperate seamlessly with clients not able to - * implement the full compression tests by introspecting the call to verify - * the response's compression status. - * - * @generated from field: grpc.testing.BoolValue compressed = 3; - */ - compressed?: BoolValue; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ResponseParameters"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "interval_us", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "compressed", kind: "message", T: BoolValue }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ResponseParameters { - return new ResponseParameters().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ResponseParameters { - return new ResponseParameters().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ResponseParameters { - return new ResponseParameters().fromJsonString(jsonString, options); - } - - static equals(a: ResponseParameters | PlainMessage | undefined, b: ResponseParameters | PlainMessage | undefined): boolean { - return proto3.util.equals(ResponseParameters, a, b); - } -} - -/** - * Server-streaming request. - * - * @generated from message grpc.testing.StreamingOutputCallRequest - */ -export class StreamingOutputCallRequest extends Message { - /** - * Desired payload type in the response from the server. - * If response_type is RANDOM, the payload from each response in the stream - * might be of different types. This is to simulate a mixed type of payload - * stream. - * - * @generated from field: grpc.testing.PayloadType response_type = 1; - */ - responseType = PayloadType.COMPRESSABLE; - - /** - * Configuration for each expected response message. - * - * @generated from field: repeated grpc.testing.ResponseParameters response_parameters = 2; - */ - responseParameters: ResponseParameters[] = []; - - /** - * Optional input payload sent along with the request. - * - * @generated from field: grpc.testing.Payload payload = 3; - */ - payload?: Payload; - - /** - * Whether server should return a given status - * - * @generated from field: grpc.testing.EchoStatus response_status = 7; - */ - responseStatus?: EchoStatus; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.StreamingOutputCallRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "response_type", kind: "enum", T: proto3.getEnumType(PayloadType) }, - { no: 2, name: "response_parameters", kind: "message", T: ResponseParameters, repeated: true }, - { no: 3, name: "payload", kind: "message", T: Payload }, - { no: 7, name: "response_status", kind: "message", T: EchoStatus }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): StreamingOutputCallRequest { - return new StreamingOutputCallRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): StreamingOutputCallRequest { - return new StreamingOutputCallRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): StreamingOutputCallRequest { - return new StreamingOutputCallRequest().fromJsonString(jsonString, options); - } - - static equals(a: StreamingOutputCallRequest | PlainMessage | undefined, b: StreamingOutputCallRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(StreamingOutputCallRequest, a, b); - } -} - -/** - * Server-streaming response, as configured by the request and parameters. - * - * @generated from message grpc.testing.StreamingOutputCallResponse - */ -export class StreamingOutputCallResponse extends Message { - /** - * Payload to increase response size. - * - * @generated from field: grpc.testing.Payload payload = 1; - */ - payload?: Payload; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.StreamingOutputCallResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "payload", kind: "message", T: Payload }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): StreamingOutputCallResponse { - return new StreamingOutputCallResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): StreamingOutputCallResponse { - return new StreamingOutputCallResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): StreamingOutputCallResponse { - return new StreamingOutputCallResponse().fromJsonString(jsonString, options); - } - - static equals(a: StreamingOutputCallResponse | PlainMessage | undefined, b: StreamingOutputCallResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(StreamingOutputCallResponse, a, b); - } -} - -/** - * For reconnect interop test only. - * Client tells server what reconnection parameters it used. - * - * @generated from message grpc.testing.ReconnectParams - */ -export class ReconnectParams extends Message { - /** - * @generated from field: int32 max_reconnect_backoff_ms = 1; - */ - maxReconnectBackoffMs = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ReconnectParams"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "max_reconnect_backoff_ms", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ReconnectParams { - return new ReconnectParams().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ReconnectParams { - return new ReconnectParams().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ReconnectParams { - return new ReconnectParams().fromJsonString(jsonString, options); - } - - static equals(a: ReconnectParams | PlainMessage | undefined, b: ReconnectParams | PlainMessage | undefined): boolean { - return proto3.util.equals(ReconnectParams, a, b); - } -} - -/** - * For reconnect interop test only. - * Server tells client whether its reconnects are following the spec and the - * reconnect backoffs it saw. - * - * @generated from message grpc.testing.ReconnectInfo - */ -export class ReconnectInfo extends Message { - /** - * @generated from field: bool passed = 1; - */ - passed = false; - - /** - * @generated from field: repeated int32 backoff_ms = 2; - */ - backoffMs: number[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ReconnectInfo"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "passed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "backoff_ms", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ReconnectInfo { - return new ReconnectInfo().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ReconnectInfo { - return new ReconnectInfo().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ReconnectInfo { - return new ReconnectInfo().fromJsonString(jsonString, options); - } - - static equals(a: ReconnectInfo | PlainMessage | undefined, b: ReconnectInfo | PlainMessage | undefined): boolean { - return proto3.util.equals(ReconnectInfo, a, b); - } -} - -/** - * @generated from message grpc.testing.LoadBalancerStatsRequest - */ -export class LoadBalancerStatsRequest extends Message { - /** - * Request stats for the next num_rpcs sent by client. - * - * @generated from field: int32 num_rpcs = 1; - */ - numRpcs = 0; - - /** - * If num_rpcs have not completed within timeout_sec, return partial results. - * - * @generated from field: int32 timeout_sec = 2; - */ - timeoutSec = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "num_rpcs", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "timeout_sec", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsRequest { - return new LoadBalancerStatsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsRequest { - return new LoadBalancerStatsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsRequest { - return new LoadBalancerStatsRequest().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerStatsRequest | PlainMessage | undefined, b: LoadBalancerStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerStatsRequest, a, b); - } -} - -/** - * @generated from message grpc.testing.LoadBalancerStatsResponse - */ -export class LoadBalancerStatsResponse extends Message { - /** - * The number of completed RPCs for each peer. - * - * @generated from field: map rpcs_by_peer = 1; - */ - rpcsByPeer: { [key: string]: number } = {}; - - /** - * The number of RPCs that failed to record a remote peer. - * - * @generated from field: int32 num_failures = 2; - */ - numFailures = 0; - - /** - * @generated from field: map rpcs_by_method = 3; - */ - rpcsByMethod: { [key: string]: LoadBalancerStatsResponse_RpcsByPeer } = {}; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rpcs_by_peer", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "num_failures", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "rpcs_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: LoadBalancerStatsResponse_RpcsByPeer} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsResponse { - return new LoadBalancerStatsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsResponse { - return new LoadBalancerStatsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsResponse { - return new LoadBalancerStatsResponse().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerStatsResponse | PlainMessage | undefined, b: LoadBalancerStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerStatsResponse, a, b); - } -} - -/** - * @generated from message grpc.testing.LoadBalancerStatsResponse.RpcsByPeer - */ -export class LoadBalancerStatsResponse_RpcsByPeer extends Message { - /** - * The number of completed RPCs for each peer. - * - * @generated from field: map rpcs_by_peer = 1; - */ - rpcsByPeer: { [key: string]: number } = {}; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rpcs_by_peer", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { - return new LoadBalancerStatsResponse_RpcsByPeer().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { - return new LoadBalancerStatsResponse_RpcsByPeer().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { - return new LoadBalancerStatsResponse_RpcsByPeer().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerStatsResponse_RpcsByPeer | PlainMessage | undefined, b: LoadBalancerStatsResponse_RpcsByPeer | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerStatsResponse_RpcsByPeer, a, b); - } -} - -/** - * Request for retrieving a test client's accumulated stats. - * - * @generated from message grpc.testing.LoadBalancerAccumulatedStatsRequest - */ -export class LoadBalancerAccumulatedStatsRequest extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsRequest { - return new LoadBalancerAccumulatedStatsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsRequest { - return new LoadBalancerAccumulatedStatsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsRequest { - return new LoadBalancerAccumulatedStatsRequest().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerAccumulatedStatsRequest | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerAccumulatedStatsRequest, a, b); - } -} - -/** - * Accumulated stats for RPCs sent by a test client. - * - * @generated from message grpc.testing.LoadBalancerAccumulatedStatsResponse - */ -export class LoadBalancerAccumulatedStatsResponse extends Message { - /** - * The total number of RPCs have ever issued for each type. - * Deprecated: use stats_per_method.rpcs_started instead. - * - * @generated from field: map num_rpcs_started_by_method = 1 [deprecated = true]; - * @deprecated - */ - numRpcsStartedByMethod: { [key: string]: number } = {}; - - /** - * The total number of RPCs have ever completed successfully for each type. - * Deprecated: use stats_per_method.result instead. - * - * @generated from field: map num_rpcs_succeeded_by_method = 2 [deprecated = true]; - * @deprecated - */ - numRpcsSucceededByMethod: { [key: string]: number } = {}; - - /** - * The total number of RPCs have ever failed for each type. - * Deprecated: use stats_per_method.result instead. - * - * @generated from field: map num_rpcs_failed_by_method = 3 [deprecated = true]; - * @deprecated - */ - numRpcsFailedByMethod: { [key: string]: number } = {}; - - /** - * Per-method RPC statistics. The key is the RpcType in string form; e.g. - * 'EMPTY_CALL' or 'UNARY_CALL' - * - * @generated from field: map stats_per_method = 4; - */ - statsPerMethod: { [key: string]: LoadBalancerAccumulatedStatsResponse_MethodStats } = {}; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "num_rpcs_started_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 2, name: "num_rpcs_succeeded_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 3, name: "num_rpcs_failed_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - { no: 4, name: "stats_per_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: LoadBalancerAccumulatedStatsResponse_MethodStats} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsResponse { - return new LoadBalancerAccumulatedStatsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsResponse { - return new LoadBalancerAccumulatedStatsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsResponse { - return new LoadBalancerAccumulatedStatsResponse().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerAccumulatedStatsResponse | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerAccumulatedStatsResponse, a, b); - } -} - -/** - * @generated from message grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats - */ -export class LoadBalancerAccumulatedStatsResponse_MethodStats extends Message { - /** - * The number of RPCs that were started for this method. - * - * @generated from field: int32 rpcs_started = 1; - */ - rpcsStarted = 0; - - /** - * The number of RPCs that completed with each status for this method. The - * key is the integral value of a google.rpc.Code; the value is the count. - * - * @generated from field: map result = 2; - */ - result: { [key: number]: number } = {}; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "rpcs_started", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "result", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { - return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { - return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { - return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromJsonString(jsonString, options); - } - - static equals(a: LoadBalancerAccumulatedStatsResponse_MethodStats | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsResponse_MethodStats | PlainMessage | undefined): boolean { - return proto3.util.equals(LoadBalancerAccumulatedStatsResponse_MethodStats, a, b); - } -} - -/** - * Configurations for a test client. - * - * @generated from message grpc.testing.ClientConfigureRequest - */ -export class ClientConfigureRequest extends Message { - /** - * The types of RPCs the client sends. - * - * @generated from field: repeated grpc.testing.ClientConfigureRequest.RpcType types = 1; - */ - types: ClientConfigureRequest_RpcType[] = []; - - /** - * The collection of custom metadata to be attached to RPCs sent by the client. - * - * @generated from field: repeated grpc.testing.ClientConfigureRequest.Metadata metadata = 2; - */ - metadata: ClientConfigureRequest_Metadata[] = []; - - /** - * The deadline to use, in seconds, for all RPCs. If unset or zero, the - * client will use the default from the command-line. - * - * @generated from field: int32 timeout_sec = 3; - */ - timeoutSec = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ClientConfigureRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "types", kind: "enum", T: proto3.getEnumType(ClientConfigureRequest_RpcType), repeated: true }, - { no: 2, name: "metadata", kind: "message", T: ClientConfigureRequest_Metadata, repeated: true }, - { no: 3, name: "timeout_sec", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureRequest { - return new ClientConfigureRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureRequest { - return new ClientConfigureRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ClientConfigureRequest { - return new ClientConfigureRequest().fromJsonString(jsonString, options); - } - - static equals(a: ClientConfigureRequest | PlainMessage | undefined, b: ClientConfigureRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ClientConfigureRequest, a, b); - } -} - -/** - * Type of RPCs to send. - * - * @generated from enum grpc.testing.ClientConfigureRequest.RpcType - */ -export enum ClientConfigureRequest_RpcType { - /** - * @generated from enum value: EMPTY_CALL = 0; - */ - EMPTY_CALL = 0, - - /** - * @generated from enum value: UNARY_CALL = 1; - */ - UNARY_CALL = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(ClientConfigureRequest_RpcType) -proto3.util.setEnumType(ClientConfigureRequest_RpcType, "grpc.testing.ClientConfigureRequest.RpcType", [ - { no: 0, name: "EMPTY_CALL" }, - { no: 1, name: "UNARY_CALL" }, -]); - -/** - * Metadata to be attached for the given type of RPCs. - * - * @generated from message grpc.testing.ClientConfigureRequest.Metadata - */ -export class ClientConfigureRequest_Metadata extends Message { - /** - * @generated from field: grpc.testing.ClientConfigureRequest.RpcType type = 1; - */ - type = ClientConfigureRequest_RpcType.EMPTY_CALL; - - /** - * @generated from field: string key = 2; - */ - key = ""; - - /** - * @generated from field: string value = 3; - */ - value = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ClientConfigureRequest.Metadata"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ClientConfigureRequest_RpcType) }, - { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureRequest_Metadata { - return new ClientConfigureRequest_Metadata().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureRequest_Metadata { - return new ClientConfigureRequest_Metadata().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ClientConfigureRequest_Metadata { - return new ClientConfigureRequest_Metadata().fromJsonString(jsonString, options); - } - - static equals(a: ClientConfigureRequest_Metadata | PlainMessage | undefined, b: ClientConfigureRequest_Metadata | PlainMessage | undefined): boolean { - return proto3.util.equals(ClientConfigureRequest_Metadata, a, b); - } -} - -/** - * Response for updating a test client's configuration. - * - * @generated from message grpc.testing.ClientConfigureResponse - */ -export class ClientConfigureResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ClientConfigureResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureResponse { - return new ClientConfigureResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureResponse { - return new ClientConfigureResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ClientConfigureResponse { - return new ClientConfigureResponse().fromJsonString(jsonString, options); - } - - static equals(a: ClientConfigureResponse | PlainMessage | undefined, b: ClientConfigureResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ClientConfigureResponse, a, b); - } -} - -/** - * @generated from message grpc.testing.ErrorDetail - */ -export class ErrorDetail extends Message { - /** - * @generated from field: string reason = 1; - */ - reason = ""; - - /** - * @generated from field: string domain = 2; - */ - domain = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ErrorDetail"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ErrorDetail { - return new ErrorDetail().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ErrorDetail { - return new ErrorDetail().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ErrorDetail { - return new ErrorDetail().fromJsonString(jsonString, options); - } - - static equals(a: ErrorDetail | PlainMessage | undefined, b: ErrorDetail | PlainMessage | undefined): boolean { - return proto3.util.equals(ErrorDetail, a, b); - } -} - -/** - * @generated from message grpc.testing.ErrorStatus - */ -export class ErrorStatus extends Message { - /** - * @generated from field: int32 code = 1; - */ - code = 0; - - /** - * @generated from field: string message = 2; - */ - message = ""; - - /** - * @generated from field: repeated google.protobuf.Any details = 3; - */ - details: Any[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "grpc.testing.ErrorStatus"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "code", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "details", kind: "message", T: Any, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ErrorStatus { - return new ErrorStatus().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ErrorStatus { - return new ErrorStatus().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ErrorStatus { - return new ErrorStatus().fromJsonString(jsonString, options); - } - - static equals(a: ErrorStatus | PlainMessage | undefined, b: ErrorStatus | PlainMessage | undefined): boolean { - return proto3.util.equals(ErrorStatus, a, b); - } -} - diff --git a/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts b/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts deleted file mode 100644 index e5cb5737a..000000000 --- a/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts +++ /dev/null @@ -1,333 +0,0 @@ -// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/test.proto -// -// The TestService has been extended to include the following RPCs: -// FailUnaryCall(SimpleRequest) returns (SimpleResponse): this RPC is a unary -// call that always returns a readable non-ASCII error with error details. -// FailStreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse): -// this RPC is a server streaming call that always returns a readable non-ASCII error with error details. -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC -// is a server streaming call that will not be implemented. -// -// The UnimplementedService has been extended to include the following RPCs: -// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC -// is a server streaming call that will not be implemented. - -// Copyright 2015-2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. - -// @generated by protoc-gen-connect-es v0.12.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file grpc/testing/test.proto (package grpc.testing, syntax proto3) -/* eslint-disable */ - -import { Empty } from "./empty_pb.js"; -import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; -import { ClientConfigureRequest, ClientConfigureResponse, LoadBalancerAccumulatedStatsRequest, LoadBalancerAccumulatedStatsResponse, LoadBalancerStatsRequest, LoadBalancerStatsResponse, ReconnectInfo, ReconnectParams, SimpleRequest, SimpleResponse, StreamingInputCallRequest, StreamingInputCallResponse, StreamingOutputCallRequest, StreamingOutputCallResponse } from "./messages_pb.js"; - -/** - * A simple service to test the various types of RPCs and experiment with - * performance with various types of payload. - * - * @generated from service grpc.testing.TestService - */ -export const TestService = { - typeName: "grpc.testing.TestService", - methods: { - /** - * One empty request followed by one empty response. - * - * @generated from rpc grpc.testing.TestService.EmptyCall - */ - emptyCall: { - name: "EmptyCall", - I: Empty, - O: Empty, - kind: MethodKind.Unary, - }, - /** - * One request followed by one response. - * - * @generated from rpc grpc.testing.TestService.UnaryCall - */ - unaryCall: { - name: "UnaryCall", - I: SimpleRequest, - O: SimpleResponse, - kind: MethodKind.Unary, - }, - /** - * One request followed by one response. This RPC always fails. - * - * @generated from rpc grpc.testing.TestService.FailUnaryCall - */ - failUnaryCall: { - name: "FailUnaryCall", - I: SimpleRequest, - O: SimpleResponse, - kind: MethodKind.Unary, - }, - /** - * One request followed by one response. Response has cache control - * headers set such that a caching HTTP proxy (such as GFE) can - * satisfy subsequent requests. - * - * @generated from rpc grpc.testing.TestService.CacheableUnaryCall - */ - cacheableUnaryCall: { - name: "CacheableUnaryCall", - I: SimpleRequest, - O: SimpleResponse, - kind: MethodKind.Unary, - idempotency: MethodIdempotency.NoSideEffects, - }, - /** - * One request followed by a sequence of responses (streamed download). - * The server returns the payload with client desired type and sizes. - * - * @generated from rpc grpc.testing.TestService.StreamingOutputCall - */ - streamingOutputCall: { - name: "StreamingOutputCall", - I: StreamingOutputCallRequest, - O: StreamingOutputCallResponse, - kind: MethodKind.ServerStreaming, - }, - /** - * One request followed by a sequence of responses (streamed download). - * The server returns the payload with client desired type and sizes. - * This RPC always responds with an error status. - * - * @generated from rpc grpc.testing.TestService.FailStreamingOutputCall - */ - failStreamingOutputCall: { - name: "FailStreamingOutputCall", - I: StreamingOutputCallRequest, - O: StreamingOutputCallResponse, - kind: MethodKind.ServerStreaming, - }, - /** - * A sequence of requests followed by one response (streamed upload). - * The server returns the aggregated size of client payload as the result. - * - * @generated from rpc grpc.testing.TestService.StreamingInputCall - */ - streamingInputCall: { - name: "StreamingInputCall", - I: StreamingInputCallRequest, - O: StreamingInputCallResponse, - kind: MethodKind.ClientStreaming, - }, - /** - * A sequence of requests with each request served by the server immediately. - * As one request could lead to multiple responses, this interface - * demonstrates the idea of full duplexing. - * - * @generated from rpc grpc.testing.TestService.FullDuplexCall - */ - fullDuplexCall: { - name: "FullDuplexCall", - I: StreamingOutputCallRequest, - O: StreamingOutputCallResponse, - kind: MethodKind.BiDiStreaming, - }, - /** - * A sequence of requests followed by a sequence of responses. - * The server buffers all the client requests and then serves them in order. A - * stream of responses are returned to the client when the server starts with - * first request. - * - * @generated from rpc grpc.testing.TestService.HalfDuplexCall - */ - halfDuplexCall: { - name: "HalfDuplexCall", - I: StreamingOutputCallRequest, - O: StreamingOutputCallResponse, - kind: MethodKind.BiDiStreaming, - }, - /** - * The test server will not implement this method. It will be used - * to test the behavior when clients call unimplemented methods. - * - * @generated from rpc grpc.testing.TestService.UnimplementedCall - */ - unimplementedCall: { - name: "UnimplementedCall", - I: Empty, - O: Empty, - kind: MethodKind.Unary, - }, - /** - * The test server will not implement this method. It will be used - * to test the behavior when clients call unimplemented streaming output methods. - * - * @generated from rpc grpc.testing.TestService.UnimplementedStreamingOutputCall - */ - unimplementedStreamingOutputCall: { - name: "UnimplementedStreamingOutputCall", - I: Empty, - O: Empty, - kind: MethodKind.ServerStreaming, - }, - } -} as const; - -/** - * A simple service NOT implemented at servers so clients can test for - * that case. - * - * @generated from service grpc.testing.UnimplementedService - */ -export const UnimplementedService = { - typeName: "grpc.testing.UnimplementedService", - methods: { - /** - * A call that no server should implement - * - * @generated from rpc grpc.testing.UnimplementedService.UnimplementedCall - */ - unimplementedCall: { - name: "UnimplementedCall", - I: Empty, - O: Empty, - kind: MethodKind.Unary, - }, - /** - * A call that no server should implement - * - * @generated from rpc grpc.testing.UnimplementedService.UnimplementedStreamingOutputCall - */ - unimplementedStreamingOutputCall: { - name: "UnimplementedStreamingOutputCall", - I: Empty, - O: Empty, - kind: MethodKind.ServerStreaming, - }, - } -} as const; - -/** - * A service used to control reconnect server. - * - * @generated from service grpc.testing.ReconnectService - */ -export const ReconnectService = { - typeName: "grpc.testing.ReconnectService", - methods: { - /** - * @generated from rpc grpc.testing.ReconnectService.Start - */ - start: { - name: "Start", - I: ReconnectParams, - O: Empty, - kind: MethodKind.Unary, - }, - /** - * @generated from rpc grpc.testing.ReconnectService.Stop - */ - stop: { - name: "Stop", - I: Empty, - O: ReconnectInfo, - kind: MethodKind.Unary, - }, - } -} as const; - -/** - * A service used to obtain stats for verifying LB behavior. - * - * @generated from service grpc.testing.LoadBalancerStatsService - */ -export const LoadBalancerStatsService = { - typeName: "grpc.testing.LoadBalancerStatsService", - methods: { - /** - * Gets the backend distribution for RPCs sent by a test client. - * - * @generated from rpc grpc.testing.LoadBalancerStatsService.GetClientStats - */ - getClientStats: { - name: "GetClientStats", - I: LoadBalancerStatsRequest, - O: LoadBalancerStatsResponse, - kind: MethodKind.Unary, - }, - /** - * Gets the accumulated stats for RPCs sent by a test client. - * - * @generated from rpc grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats - */ - getClientAccumulatedStats: { - name: "GetClientAccumulatedStats", - I: LoadBalancerAccumulatedStatsRequest, - O: LoadBalancerAccumulatedStatsResponse, - kind: MethodKind.Unary, - }, - } -} as const; - -/** - * A service to remotely control health status of an xDS test server. - * - * @generated from service grpc.testing.XdsUpdateHealthService - */ -export const XdsUpdateHealthService = { - typeName: "grpc.testing.XdsUpdateHealthService", - methods: { - /** - * @generated from rpc grpc.testing.XdsUpdateHealthService.SetServing - */ - setServing: { - name: "SetServing", - I: Empty, - O: Empty, - kind: MethodKind.Unary, - }, - /** - * @generated from rpc grpc.testing.XdsUpdateHealthService.SetNotServing - */ - setNotServing: { - name: "SetNotServing", - I: Empty, - O: Empty, - kind: MethodKind.Unary, - }, - } -} as const; - -/** - * A service to dynamically update the configuration of an xDS test client. - * - * @generated from service grpc.testing.XdsUpdateClientConfigureService - */ -export const XdsUpdateClientConfigureService = { - typeName: "grpc.testing.XdsUpdateClientConfigureService", - methods: { - /** - * Update the tes client's configuration. - * - * @generated from rpc grpc.testing.XdsUpdateClientConfigureService.Configure - */ - configure: { - name: "Configure", - I: ClientConfigureRequest, - O: ClientConfigureResponse, - kind: MethodKind.Unary, - }, - } -} as const; - diff --git a/packages/connect-node-test/src/gen/server/v1/server_pb.ts b/packages/connect-node-test/src/gen/server/v1/server_pb.ts deleted file mode 100644 index 6f030bc29..000000000 --- a/packages/connect-node-test/src/gen/server/v1/server_pb.ts +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file server/v1/server.proto (package server.v1, syntax proto3) -/* eslint-disable */ - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum server.v1.Protocol - */ -export enum Protocol { - /** - * @generated from enum value: PROTOCOL_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: PROTOCOL_GRPC = 1; - */ - GRPC = 1, - - /** - * @generated from enum value: PROTOCOL_GRPC_WEB = 2; - */ - GRPC_WEB = 2, -} -// Retrieve enum metadata with: proto3.getEnumType(Protocol) -proto3.util.setEnumType(Protocol, "server.v1.Protocol", [ - { no: 0, name: "PROTOCOL_UNSPECIFIED" }, - { no: 1, name: "PROTOCOL_GRPC" }, - { no: 2, name: "PROTOCOL_GRPC_WEB" }, -]); - -/** - * ServerMetadata is the metadata returned from the server started by the server binary. - * - * @generated from message server.v1.ServerMetadata - */ -export class ServerMetadata extends Message { - /** - * @generated from field: string host = 1; - */ - host = ""; - - /** - * @generated from field: repeated server.v1.ProtocolSupport protocols = 2; - */ - protocols: ProtocolSupport[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "server.v1.ServerMetadata"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "host", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "protocols", kind: "message", T: ProtocolSupport, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ServerMetadata { - return new ServerMetadata().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ServerMetadata { - return new ServerMetadata().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ServerMetadata { - return new ServerMetadata().fromJsonString(jsonString, options); - } - - static equals(a: ServerMetadata | PlainMessage | undefined, b: ServerMetadata | PlainMessage | undefined): boolean { - return proto3.util.equals(ServerMetadata, a, b); - } -} - -/** - * @generated from message server.v1.ProtocolSupport - */ -export class ProtocolSupport extends Message { - /** - * @generated from field: server.v1.Protocol protocol = 1; - */ - protocol = Protocol.UNSPECIFIED; - - /** - * @generated from field: repeated server.v1.HTTPVersion http_versions = 2; - */ - httpVersions: HTTPVersion[] = []; - - /** - * @generated from field: string port = 3; - */ - port = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "server.v1.ProtocolSupport"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "protocol", kind: "enum", T: proto3.getEnumType(Protocol) }, - { no: 2, name: "http_versions", kind: "message", T: HTTPVersion, repeated: true }, - { no: 3, name: "port", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ProtocolSupport { - return new ProtocolSupport().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ProtocolSupport { - return new ProtocolSupport().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ProtocolSupport { - return new ProtocolSupport().fromJsonString(jsonString, options); - } - - static equals(a: ProtocolSupport | PlainMessage | undefined, b: ProtocolSupport | PlainMessage | undefined): boolean { - return proto3.util.equals(ProtocolSupport, a, b); - } -} - -/** - * @generated from message server.v1.HTTPVersion - */ -export class HTTPVersion extends Message { - /** - * @generated from field: int32 major = 1; - */ - major = 0; - - /** - * @generated from field: int32 minor = 2; - */ - minor = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "server.v1.HTTPVersion"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "major", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "minor", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): HTTPVersion { - return new HTTPVersion().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): HTTPVersion { - return new HTTPVersion().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): HTTPVersion { - return new HTTPVersion().fromJsonString(jsonString, options); - } - - static equals(a: HTTPVersion | PlainMessage | undefined, b: HTTPVersion | PlainMessage | undefined): boolean { - return proto3.util.equals(HTTPVersion, a, b); - } -} - diff --git a/packages/connect-node-test/src/node-readme.spec.ts b/packages/connect-node-test/src/node-readme.spec.ts index 0e2469e0e..4a417cc9e 100644 --- a/packages/connect-node-test/src/node-readme.spec.ts +++ b/packages/connect-node-test/src/node-readme.spec.ts @@ -29,21 +29,20 @@ describe("node readme", function () { interface SayR extends Message { sentence: string; } - const SayR = proto3.makeMessageType( - "buf.connect.demo.eliza.v1.SayRequest", - [{ no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }], - ); + const SayR = proto3.makeMessageType("connectrpc.eliza.v1.SayRequest", [ + { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); interface IntroduceRequest extends Message { name: string; } const IntroduceRequest = proto3.makeMessageType( - "buf.connect.demo.eliza.v1.IntroduceRequest", + "connectrpc.eliza.v1.IntroduceRequest", [{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }], ); const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { say: { name: "Say", @@ -61,18 +60,18 @@ describe("node readme", function () { } as const; const optionsHttp2 = { - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", httpVersion: "2" as const, }; const optionsHttp1 = { - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", httpVersion: "1.1" as const, }; it("createConnectTransport()", async function () { // A transport for clients using the gRPC protocol with Node.js `http` module const transport = createConnectTransport({ - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", httpVersion: "1.1", }); const client = createPromiseClient(ElizaService, transport); diff --git a/packages/connect-node-test/src/transports.spec.ts b/packages/connect-node-test/src/transports.spec.ts index a13fc7520..1979a7149 100644 --- a/packages/connect-node-test/src/transports.spec.ts +++ b/packages/connect-node-test/src/transports.spec.ts @@ -68,7 +68,7 @@ describe("createConnectTransport()", function () { describe("using a session manager to open a connection before starting an application", function () { it("should work", async function () { - const sm = new Http2SessionManager("https://demo.connect.build"); + const sm = new Http2SessionManager("https://demo.connectrpc.com"); for (let backoff = 1; ; backoff++) { const state = await sm.connect(); if (state == "error") { @@ -93,11 +93,11 @@ describe("using a session manager to explicitly close all connections", function it("should work", function () { // create a client, keeping a reference to the session manage const sessionManager = new Http2SessionManager( - "https://demo.connect.build", + "https://demo.connectrpc.com", ); createConnectTransport({ httpVersion: "2", - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", sessionManager, }); // const client = createPromiseClient(..., transport); diff --git a/packages/connect-node/README.md b/packages/connect-node/README.md index 6bd12dec0..901514871 100644 --- a/packages/connect-node/README.md +++ b/packages/connect-node/README.md @@ -1,7 +1,7 @@ # @bufbuild/connect-node -Connect is a family of libraries for building and consuming APIs on different languages and platforms, and -[@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings type-safe APIs with Protobuf to +Connect is a family of libraries for building and consuming APIs on different languages and platforms, and +[@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings type-safe APIs with Protobuf to TypeScript. `@bufbuild/connect-node` provides the following adapters for Node.js: @@ -17,7 +17,7 @@ import { ElizaService } from "./gen/eliza_connect.js"; + // A transport for clients using the Connect protocol with Node.js `http` module + const transport = createConnectTransport({ -+ baseUrl: "https://demo.connect.build", ++ baseUrl: "https://demo.connectrpc.com", + httpVersion: "1.1" + }); @@ -37,7 +37,7 @@ import { ElizaService } from "./gen/eliza_connect.js"; + // A transport for clients using the gRPC protocol with Node.js `http2` module + const transport = createGrpcTransport({ -+ baseUrl: "https://demo.connect.build", ++ baseUrl: "https://demo.connectrpc.com", + httpVersion: "2" + }); @@ -57,7 +57,7 @@ import { ElizaService } from "./gen/eliza_connect.js"; + // A transport for clients using the Connect protocol with Node.js `http` module + const transport = createGrpcWebTransport({ -+ baseUrl: "https://demo.connect.build", ++ baseUrl: "https://demo.connectrpc.com", + httpVersion: "1.1" + }); @@ -100,10 +100,10 @@ With that server running, you can make requests with any gRPC, gRPC-Web, or Conn `buf curl` with the gRPC protocol: ```bash -buf curl --schema buf.build/bufbuild/eliza \ +buf curl --schema buf.build/connectrpc/eliza \ --protocol grpc --http2-prior-knowledge \ -d '{"sentence": "I feel happy."}' \ - http://localhost:8080/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say ``` `curl` with the Connect protocol: @@ -113,7 +113,7 @@ curl \ --header "Content-Type: application/json" \ --data '{"sentence": "I feel happy."}' \ --http2-prior-knowledge \ - http://localhost:8080/buf.connect.demo.eliza.v1.ElizaService/Say + http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say ``` Node.js with the gRPC protocol: @@ -134,11 +134,11 @@ console.log(sentence) // you said: I feel happy. ``` A client for the web browser actually looks identical to this example - it would -simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) +simply use `createConnectTransport` from [@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web) instead. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) -for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). +To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-web-bench/README.md b/packages/connect-web-bench/README.md index 9a4569933..c91aed1e3 100644 --- a/packages/connect-web-bench/README.md +++ b/packages/connect-web-bench/README.md @@ -2,13 +2,13 @@ This is a simple code size comparison between Connect-Web and gRPC-web. -We are generating code for the module [buf.build/bufbuild/eliza](https://buf.build/bufbuild/eliza) -once with `protoc-gen-grpc-web`, once with `protoc-gen-connect-es`. -Then we bundle a client for the service `buf.connect.demo.eliza.v1.ElizaService` -with [esbuild](https://esbuild.github.io/), minify the bundle, and compress +We are generating code for the module [buf.build/connectrpc/eliza](https://buf.build/connectrpc/eliza) +once with `protoc-gen-grpc-web`, once with `protoc-gen-connect-es`. +Then we bundle a client for the service `connectrpc.eliza.v1.ElizaService` +with [esbuild](https://esbuild.github.io/), minify the bundle, and compress it like a web server would usually do. | code generator | bundle size | minified | compressed | |----------------|-------------------:|-----------------------:|---------------------:| -| connect | 112,284 b | 49,541 b | 13,335 b | -| grpc-web | 414,906 b | 301,127 b | 53,279 b | +| connect | 112,246 b | 49,500 b | 13,336 b | +| grpc-web | 414,071 b | 300,352 b | 53,255 b | diff --git a/packages/connect-web-bench/report.mjs b/packages/connect-web-bench/report.mjs index 01294ab2a..0f83f2500 100644 --- a/packages/connect-web-bench/report.mjs +++ b/packages/connect-web-bench/report.mjs @@ -1,5 +1,5 @@ -import {buildSync} from "esbuild"; -import {compress} from "brotli"; +import { buildSync } from "esbuild"; +import { compress } from "brotli"; const connect = gather("src/entry-connect.ts"); const grpcweb = gather("src/entry-grpcweb.ts"); @@ -8,10 +8,10 @@ process.stdout.write(`# Code size comparison This is a simple code size comparison between Connect-Web and gRPC-web. -We are generating code for the module [buf.build/bufbuild/eliza](https://buf.build/bufbuild/eliza) -once with \`protoc-gen-grpc-web\`, once with \`protoc-gen-connect-es\`. -Then we bundle a client for the service \`buf.connect.demo.eliza.v1.ElizaService\` -with [esbuild](https://esbuild.github.io/), minify the bundle, and compress +We are generating code for the module [buf.build/connectrpc/eliza](https://buf.build/connectrpc/eliza) +once with \`protoc-gen-grpc-web\`, once with \`protoc-gen-connect-es\`. +Then we bundle a client for the service \`connectrpc.eliza.v1.ElizaService\` +with [esbuild](https://esbuild.github.io/), minify the bundle, and compress it like a web server would usually do. | code generator | bundle size | minified | compressed | diff --git a/packages/connect-web-bench/src/entry-connect.ts b/packages/connect-web-bench/src/entry-connect.ts index ca5885f25..76f5f8211 100644 --- a/packages/connect-web-bench/src/entry-connect.ts +++ b/packages/connect-web-bench/src/entry-connect.ts @@ -14,12 +14,12 @@ import { createPromiseClient } from "@bufbuild/connect"; import { createConnectTransport } from "@bufbuild/connect-web"; -import { ElizaService } from "./gen/connectweb/buf/connect/demo/eliza/v1/eliza_connect.js"; +import { ElizaService } from "./gen/connectweb/connectrpc/eliza/v1/eliza_connect.js"; const client = createPromiseClient( ElizaService, createConnectTransport({ - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", }), ); diff --git a/packages/connect-web-bench/src/entry-grpcweb.ts b/packages/connect-web-bench/src/entry-grpcweb.ts index 1dc996550..46b479247 100644 --- a/packages/connect-web-bench/src/entry-grpcweb.ts +++ b/packages/connect-web-bench/src/entry-grpcweb.ts @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ElizaServiceClient } from "./gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.js"; +import { ElizaServiceClient } from "./gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.js"; -const client = new ElizaServiceClient("https://demo.connect.build"); +const client = new ElizaServiceClient("https://demo.connectrpc.com"); // eslint-disable-next-line no-console -- log statement makes sure the variable is in use console.log(client); diff --git a/packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_connect.ts b/packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_connect.ts similarity index 53% rename from packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_connect.ts rename to packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_connect.ts index 57e24bba2..d2186af34 100644 --- a/packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_connect.ts +++ b/packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_connect.ts @@ -13,30 +13,29 @@ // limitations under the License. // @generated by protoc-gen-connect-es v0.12.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file buf/connect/demo/eliza/v1/eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** - * ElizaService provides a way to talk to the ELIZA, which is a port of - * the DOCTOR script for Joseph Weizenbaum's original ELIZA program. - * Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, - * ELIZA demonstrates the superficiality of human-computer communication. - * DOCTOR simulates a psychotherapist, and is commonly found as an Easter - * egg in emacs distributions. + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. * - * @generated from service buf.connect.demo.eliza.v1.ElizaService + * @generated from service connectrpc.eliza.v1.ElizaService */ export const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { /** - * Say is a unary request demo. This method should allow for a one sentence - * response given a one sentence request. + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Say + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say */ say: { name: "Say", @@ -45,10 +44,11 @@ export const ElizaService = { kind: MethodKind.Unary, }, /** - * Converse is a bi-directional streaming request demo. This method should allow for - * many requests and many responses. + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Converse + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse */ converse: { name: "Converse", @@ -57,10 +57,10 @@ export const ElizaService = { kind: MethodKind.BiDiStreaming, }, /** - * Introduce is a server-streaming request demo. This method allows for a single request that will return a series - * of responses + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Introduce + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce */ introduce: { name: "Introduce", diff --git a/packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_pb.ts b/packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_pb.ts similarity index 85% rename from packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_pb.ts rename to packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_pb.ts index 11350bfd5..0ecd180ff 100644 --- a/packages/connect-web-bench/src/gen/connectweb/buf/connect/demo/eliza/v1/eliza_pb.ts +++ b/packages/connect-web-bench/src/gen/connectweb/connectrpc/eliza/v1/eliza_pb.ts @@ -13,16 +13,16 @@ // limitations under the License. // @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file buf/connect/demo/eliza/v1/eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** - * SayRequest describes the sentence said to the ELIZA program. + * SayRequest is a single-sentence request. * - * @generated from message buf.connect.demo.eliza.v1.SayRequest + * @generated from message connectrpc.eliza.v1.SayRequest */ export class SayRequest extends Message { /** @@ -36,7 +36,7 @@ export class SayRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayRequest"; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -59,9 +59,9 @@ export class SayRequest extends Message { } /** - * SayResponse describes the sentence responded by the ELIZA program. + * SayResponse is a single-sentence response. * - * @generated from message buf.connect.demo.eliza.v1.SayResponse + * @generated from message connectrpc.eliza.v1.SayResponse */ export class SayResponse extends Message { /** @@ -75,7 +75,7 @@ export class SayResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayResponse"; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -98,9 +98,10 @@ export class SayResponse extends Message { } /** - * ConverseRequest describes the sentence said to the ELIZA program. + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. * - * @generated from message buf.connect.demo.eliza.v1.ConverseRequest + * @generated from message connectrpc.eliza.v1.ConverseRequest */ export class ConverseRequest extends Message { /** @@ -114,7 +115,7 @@ export class ConverseRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseRequest"; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -137,9 +138,10 @@ export class ConverseRequest extends Message { } /** - * ConverseResponse describes the sentence responded by the ELIZA program. + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. * - * @generated from message buf.connect.demo.eliza.v1.ConverseResponse + * @generated from message connectrpc.eliza.v1.ConverseResponse */ export class ConverseResponse extends Message { /** @@ -153,7 +155,7 @@ export class ConverseResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseResponse"; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -176,9 +178,9 @@ export class ConverseResponse extends Message { } /** - * IntroduceRequest describes a request for details from the ELIZA program. + * IntroduceRequest asks Eliza to introduce itself to the named user. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceRequest + * @generated from message connectrpc.eliza.v1.IntroduceRequest */ export class IntroduceRequest extends Message { /** @@ -192,7 +194,7 @@ export class IntroduceRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceRequest"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -215,9 +217,9 @@ export class IntroduceRequest extends Message { } /** - * IntroduceResponse describes the sentence responded by the ELIZA program. + * IntroduceResponse is one sentence of Eliza's introductory monologue. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceResponse + * @generated from message connectrpc.eliza.v1.IntroduceResponse */ export class IntroduceResponse extends Message { /** @@ -231,7 +233,7 @@ export class IntroduceResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceResponse"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); diff --git a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.d.ts b/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.d.ts deleted file mode 100644 index bb7bd8b6a..000000000 --- a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as grpcWeb from 'grpc-web'; - -import * as buf_connect_demo_eliza_v1_eliza_pb from '../../../../../buf/connect/demo/eliza/v1/eliza_pb'; - - -export class ElizaServiceClient { - constructor (hostname: string, - credentials?: null | { [index: string]: string; }, - options?: null | { [index: string]: any; }); - - say( - request: buf_connect_demo_eliza_v1_eliza_pb.SayRequest, - metadata: grpcWeb.Metadata | undefined, - callback: (err: grpcWeb.RpcError, - response: buf_connect_demo_eliza_v1_eliza_pb.SayResponse) => void - ): grpcWeb.ClientReadableStream; - - introduce( - request: buf_connect_demo_eliza_v1_eliza_pb.IntroduceRequest, - metadata?: grpcWeb.Metadata - ): grpcWeb.ClientReadableStream; - -} - -export class ElizaServicePromiseClient { - constructor (hostname: string, - credentials?: null | { [index: string]: string; }, - options?: null | { [index: string]: any; }); - - say( - request: buf_connect_demo_eliza_v1_eliza_pb.SayRequest, - metadata?: grpcWeb.Metadata - ): Promise; - - introduce( - request: buf_connect_demo_eliza_v1_eliza_pb.IntroduceRequest, - metadata?: grpcWeb.Metadata - ): grpcWeb.ClientReadableStream; - -} - diff --git a/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.d.ts b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.d.ts new file mode 100644 index 000000000..81e0f85fa --- /dev/null +++ b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.d.ts @@ -0,0 +1,41 @@ +import * as grpcWeb from 'grpc-web'; + +import * as connectrpc_eliza_v1_eliza_pb from '../../../connectrpc/eliza/v1/eliza_pb'; + + +export class ElizaServiceClient { + constructor (hostname: string, + credentials?: null | { [index: string]: string; }, + options?: null | { [index: string]: any; }); + + say( + request: connectrpc_eliza_v1_eliza_pb.SayRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.RpcError, + response: connectrpc_eliza_v1_eliza_pb.SayResponse) => void + ): grpcWeb.ClientReadableStream; + + introduce( + request: connectrpc_eliza_v1_eliza_pb.IntroduceRequest, + metadata?: grpcWeb.Metadata + ): grpcWeb.ClientReadableStream; + +} + +export class ElizaServicePromiseClient { + constructor (hostname: string, + credentials?: null | { [index: string]: string; }, + options?: null | { [index: string]: any; }); + + say( + request: connectrpc_eliza_v1_eliza_pb.SayRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + introduce( + request: connectrpc_eliza_v1_eliza_pb.IntroduceRequest, + metadata?: grpcWeb.Metadata + ): grpcWeb.ClientReadableStream; + +} + diff --git a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.js b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.js similarity index 55% rename from packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.js rename to packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.js index bc1bc9ed6..d28feb5d3 100644 --- a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_grpc_web_pb.js +++ b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_grpc_web_pb.js @@ -1,5 +1,5 @@ /** - * @fileoverview gRPC-Web generated client stub for buf.connect.demo.eliza.v1 + * @fileoverview gRPC-Web generated client stub for connectrpc.eliza.v1 * @enhanceable * @public */ @@ -8,7 +8,7 @@ // versions: // protoc-gen-grpc-web v1.4.2 // protoc v0.0.0 -// source: buf/connect/demo/eliza/v1/eliza.proto +// source: connectrpc/eliza/v1/eliza.proto /* eslint-disable */ @@ -20,11 +20,9 @@ const grpc = {}; grpc.web = require('grpc-web'); const proto = {}; -proto.buf = {}; -proto.buf.connect = {}; -proto.buf.connect.demo = {}; -proto.buf.connect.demo.eliza = {}; -proto.buf.connect.demo.eliza.v1 = require('./eliza_pb.js'); +proto.connectrpc = {}; +proto.connectrpc.eliza = {}; +proto.connectrpc.eliza.v1 = require('./eliza_pb.js'); /** * @param {string} hostname @@ -34,7 +32,7 @@ proto.buf.connect.demo.eliza.v1 = require('./eliza_pb.js'); * @struct * @final */ -proto.buf.connect.demo.eliza.v1.ElizaServiceClient = +proto.connectrpc.eliza.v1.ElizaServiceClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'binary'; @@ -60,7 +58,7 @@ proto.buf.connect.demo.eliza.v1.ElizaServiceClient = * @struct * @final */ -proto.buf.connect.demo.eliza.v1.ElizaServicePromiseClient = +proto.connectrpc.eliza.v1.ElizaServicePromiseClient = function(hostname, credentials, options) { if (!options) options = {}; options.format = 'binary'; @@ -81,39 +79,39 @@ proto.buf.connect.demo.eliza.v1.ElizaServicePromiseClient = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.buf.connect.demo.eliza.v1.SayRequest, - * !proto.buf.connect.demo.eliza.v1.SayResponse>} + * !proto.connectrpc.eliza.v1.SayRequest, + * !proto.connectrpc.eliza.v1.SayResponse>} */ const methodDescriptor_ElizaService_Say = new grpc.web.MethodDescriptor( - '/buf.connect.demo.eliza.v1.ElizaService/Say', + '/connectrpc.eliza.v1.ElizaService/Say', grpc.web.MethodType.UNARY, - proto.buf.connect.demo.eliza.v1.SayRequest, - proto.buf.connect.demo.eliza.v1.SayResponse, + proto.connectrpc.eliza.v1.SayRequest, + proto.connectrpc.eliza.v1.SayResponse, /** - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} request + * @param {!proto.connectrpc.eliza.v1.SayRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.buf.connect.demo.eliza.v1.SayResponse.deserializeBinary + proto.connectrpc.eliza.v1.SayResponse.deserializeBinary ); /** - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} request The + * @param {!proto.connectrpc.eliza.v1.SayRequest} request The * request proto * @param {?Object} metadata User defined * call metadata - * @param {function(?grpc.web.RpcError, ?proto.buf.connect.demo.eliza.v1.SayResponse)} + * @param {function(?grpc.web.RpcError, ?proto.connectrpc.eliza.v1.SayResponse)} * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} + * @return {!grpc.web.ClientReadableStream|undefined} * The XHR Node Readable Stream */ -proto.buf.connect.demo.eliza.v1.ElizaServiceClient.prototype.say = +proto.connectrpc.eliza.v1.ElizaServiceClient.prototype.say = function(request, metadata, callback) { return this.client_.rpcCall(this.hostname_ + - '/buf.connect.demo.eliza.v1.ElizaService/Say', + '/connectrpc.eliza.v1.ElizaService/Say', request, metadata || {}, methodDescriptor_ElizaService_Say, @@ -122,17 +120,17 @@ proto.buf.connect.demo.eliza.v1.ElizaServiceClient.prototype.say = /** - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} request The + * @param {!proto.connectrpc.eliza.v1.SayRequest} request The * request proto * @param {?Object=} metadata User defined * call metadata - * @return {!Promise} + * @return {!Promise} * Promise that resolves to the response */ -proto.buf.connect.demo.eliza.v1.ElizaServicePromiseClient.prototype.say = +proto.connectrpc.eliza.v1.ElizaServicePromiseClient.prototype.say = function(request, metadata) { return this.client_.unaryCall(this.hostname_ + - '/buf.connect.demo.eliza.v1.ElizaService/Say', + '/connectrpc.eliza.v1.ElizaService/Say', request, metadata || {}, methodDescriptor_ElizaService_Say); @@ -142,36 +140,36 @@ proto.buf.connect.demo.eliza.v1.ElizaServicePromiseClient.prototype.say = /** * @const * @type {!grpc.web.MethodDescriptor< - * !proto.buf.connect.demo.eliza.v1.IntroduceRequest, - * !proto.buf.connect.demo.eliza.v1.IntroduceResponse>} + * !proto.connectrpc.eliza.v1.IntroduceRequest, + * !proto.connectrpc.eliza.v1.IntroduceResponse>} */ const methodDescriptor_ElizaService_Introduce = new grpc.web.MethodDescriptor( - '/buf.connect.demo.eliza.v1.ElizaService/Introduce', + '/connectrpc.eliza.v1.ElizaService/Introduce', grpc.web.MethodType.SERVER_STREAMING, - proto.buf.connect.demo.eliza.v1.IntroduceRequest, - proto.buf.connect.demo.eliza.v1.IntroduceResponse, + proto.connectrpc.eliza.v1.IntroduceRequest, + proto.connectrpc.eliza.v1.IntroduceResponse, /** - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} request + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} request * @return {!Uint8Array} */ function(request) { return request.serializeBinary(); }, - proto.buf.connect.demo.eliza.v1.IntroduceResponse.deserializeBinary + proto.connectrpc.eliza.v1.IntroduceResponse.deserializeBinary ); /** - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} request The request proto + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} request The request proto * @param {?Object=} metadata User defined * call metadata - * @return {!grpc.web.ClientReadableStream} + * @return {!grpc.web.ClientReadableStream} * The XHR Node Readable Stream */ -proto.buf.connect.demo.eliza.v1.ElizaServiceClient.prototype.introduce = +proto.connectrpc.eliza.v1.ElizaServiceClient.prototype.introduce = function(request, metadata) { return this.client_.serverStreaming(this.hostname_ + - '/buf.connect.demo.eliza.v1.ElizaService/Introduce', + '/connectrpc.eliza.v1.ElizaService/Introduce', request, metadata || {}, methodDescriptor_ElizaService_Introduce); @@ -179,21 +177,21 @@ proto.buf.connect.demo.eliza.v1.ElizaServiceClient.prototype.introduce = /** - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} request The request proto + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} request The request proto * @param {?Object=} metadata User defined * call metadata - * @return {!grpc.web.ClientReadableStream} + * @return {!grpc.web.ClientReadableStream} * The XHR Node Readable Stream */ -proto.buf.connect.demo.eliza.v1.ElizaServicePromiseClient.prototype.introduce = +proto.connectrpc.eliza.v1.ElizaServicePromiseClient.prototype.introduce = function(request, metadata) { return this.client_.serverStreaming(this.hostname_ + - '/buf.connect.demo.eliza.v1.ElizaService/Introduce', + '/connectrpc.eliza.v1.ElizaService/Introduce', request, metadata || {}, methodDescriptor_ElizaService_Introduce); }; -module.exports = proto.buf.connect.demo.eliza.v1; +module.exports = proto.connectrpc.eliza.v1; diff --git a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_pb.d.ts b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_pb.d.ts similarity index 100% rename from packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_pb.d.ts rename to packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_pb.d.ts diff --git a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_pb.js b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_pb.js similarity index 65% rename from packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_pb.js rename to packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_pb.js index 4fd14f202..612211382 100644 --- a/packages/connect-web-bench/src/gen/grpcweb/buf/connect/demo/eliza/v1/eliza_pb.js +++ b/packages/connect-web-bench/src/gen/grpcweb/connectrpc/eliza/v1/eliza_pb.js @@ -1,4 +1,4 @@ -// source: buf/connect/demo/eliza/v1/eliza.proto +// source: connectrpc/eliza/v1/eliza.proto /** * @fileoverview * @enhanceable @@ -21,12 +21,12 @@ var global = (function () { return this; }).call(null) || Function('return this')(); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.ConverseRequest', null, global); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.ConverseResponse', null, global); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.IntroduceRequest', null, global); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.IntroduceResponse', null, global); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.SayRequest', null, global); -goog.exportSymbol('proto.buf.connect.demo.eliza.v1.SayResponse', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.ConverseRequest', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.ConverseResponse', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.IntroduceRequest', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.IntroduceResponse', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.SayRequest', null, global); +goog.exportSymbol('proto.connectrpc.eliza.v1.SayResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -37,16 +37,16 @@ goog.exportSymbol('proto.buf.connect.demo.eliza.v1.SayResponse', null, global); * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.SayRequest = function(opt_data) { +proto.connectrpc.eliza.v1.SayRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.SayRequest, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.SayRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.SayRequest.displayName = 'proto.buf.connect.demo.eliza.v1.SayRequest'; + proto.connectrpc.eliza.v1.SayRequest.displayName = 'proto.connectrpc.eliza.v1.SayRequest'; } /** * Generated by JsPbCodeGenerator. @@ -58,16 +58,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.SayResponse = function(opt_data) { +proto.connectrpc.eliza.v1.SayResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.SayResponse, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.SayResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.SayResponse.displayName = 'proto.buf.connect.demo.eliza.v1.SayResponse'; + proto.connectrpc.eliza.v1.SayResponse.displayName = 'proto.connectrpc.eliza.v1.SayResponse'; } /** * Generated by JsPbCodeGenerator. @@ -79,16 +79,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.ConverseRequest = function(opt_data) { +proto.connectrpc.eliza.v1.ConverseRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.ConverseRequest, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.ConverseRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.ConverseRequest.displayName = 'proto.buf.connect.demo.eliza.v1.ConverseRequest'; + proto.connectrpc.eliza.v1.ConverseRequest.displayName = 'proto.connectrpc.eliza.v1.ConverseRequest'; } /** * Generated by JsPbCodeGenerator. @@ -100,16 +100,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.ConverseResponse = function(opt_data) { +proto.connectrpc.eliza.v1.ConverseResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.ConverseResponse, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.ConverseResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.ConverseResponse.displayName = 'proto.buf.connect.demo.eliza.v1.ConverseResponse'; + proto.connectrpc.eliza.v1.ConverseResponse.displayName = 'proto.connectrpc.eliza.v1.ConverseResponse'; } /** * Generated by JsPbCodeGenerator. @@ -121,16 +121,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest = function(opt_data) { +proto.connectrpc.eliza.v1.IntroduceRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.IntroduceRequest, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.IntroduceRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.IntroduceRequest.displayName = 'proto.buf.connect.demo.eliza.v1.IntroduceRequest'; + proto.connectrpc.eliza.v1.IntroduceRequest.displayName = 'proto.connectrpc.eliza.v1.IntroduceRequest'; } /** * Generated by JsPbCodeGenerator. @@ -142,16 +142,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse = function(opt_data) { +proto.connectrpc.eliza.v1.IntroduceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.buf.connect.demo.eliza.v1.IntroduceResponse, jspb.Message); +goog.inherits(proto.connectrpc.eliza.v1.IntroduceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.buf.connect.demo.eliza.v1.IntroduceResponse.displayName = 'proto.buf.connect.demo.eliza.v1.IntroduceResponse'; + proto.connectrpc.eliza.v1.IntroduceResponse.displayName = 'proto.connectrpc.eliza.v1.IntroduceResponse'; } @@ -169,8 +169,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.SayRequest.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.SayRequest.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.SayRequest.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.SayRequest.toObject(opt_includeInstance, this); }; @@ -179,11 +179,11 @@ proto.buf.connect.demo.eliza.v1.SayRequest.prototype.toObject = function(opt_inc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.SayRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.SayRequest.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.SayRequest.toObject = function(includeInstance, msg) { var f, obj = { sentence: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -199,23 +199,23 @@ proto.buf.connect.demo.eliza.v1.SayRequest.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.SayRequest} + * @return {!proto.connectrpc.eliza.v1.SayRequest} */ -proto.buf.connect.demo.eliza.v1.SayRequest.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.SayRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.SayRequest; - return proto.buf.connect.demo.eliza.v1.SayRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.SayRequest; + return proto.connectrpc.eliza.v1.SayRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.SayRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.SayRequest} + * @return {!proto.connectrpc.eliza.v1.SayRequest} */ -proto.buf.connect.demo.eliza.v1.SayRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.SayRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -239,9 +239,9 @@ proto.buf.connect.demo.eliza.v1.SayRequest.deserializeBinaryFromReader = functio * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.SayRequest.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.SayRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.SayRequest.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.SayRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -249,11 +249,11 @@ proto.buf.connect.demo.eliza.v1.SayRequest.prototype.serializeBinary = function( /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.SayRequest} message + * @param {!proto.connectrpc.eliza.v1.SayRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.SayRequest.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.SayRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSentence(); if (f.length > 0) { @@ -269,16 +269,16 @@ proto.buf.connect.demo.eliza.v1.SayRequest.serializeBinaryToWriter = function(me * optional string sentence = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.SayRequest.prototype.getSentence = function() { +proto.connectrpc.eliza.v1.SayRequest.prototype.getSentence = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.SayRequest} returns this + * @return {!proto.connectrpc.eliza.v1.SayRequest} returns this */ -proto.buf.connect.demo.eliza.v1.SayRequest.prototype.setSentence = function(value) { +proto.connectrpc.eliza.v1.SayRequest.prototype.setSentence = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -299,8 +299,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.SayResponse.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.SayResponse.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.SayResponse.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.SayResponse.toObject(opt_includeInstance, this); }; @@ -309,11 +309,11 @@ proto.buf.connect.demo.eliza.v1.SayResponse.prototype.toObject = function(opt_in * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.SayResponse} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.SayResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.SayResponse.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.SayResponse.toObject = function(includeInstance, msg) { var f, obj = { sentence: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -329,23 +329,23 @@ proto.buf.connect.demo.eliza.v1.SayResponse.toObject = function(includeInstance, /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.SayResponse} + * @return {!proto.connectrpc.eliza.v1.SayResponse} */ -proto.buf.connect.demo.eliza.v1.SayResponse.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.SayResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.SayResponse; - return proto.buf.connect.demo.eliza.v1.SayResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.SayResponse; + return proto.connectrpc.eliza.v1.SayResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.SayResponse} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.SayResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.SayResponse} + * @return {!proto.connectrpc.eliza.v1.SayResponse} */ -proto.buf.connect.demo.eliza.v1.SayResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.SayResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -369,9 +369,9 @@ proto.buf.connect.demo.eliza.v1.SayResponse.deserializeBinaryFromReader = functi * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.SayResponse.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.SayResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.SayResponse.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.SayResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -379,11 +379,11 @@ proto.buf.connect.demo.eliza.v1.SayResponse.prototype.serializeBinary = function /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.SayResponse} message + * @param {!proto.connectrpc.eliza.v1.SayResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.SayResponse.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.SayResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSentence(); if (f.length > 0) { @@ -399,16 +399,16 @@ proto.buf.connect.demo.eliza.v1.SayResponse.serializeBinaryToWriter = function(m * optional string sentence = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.SayResponse.prototype.getSentence = function() { +proto.connectrpc.eliza.v1.SayResponse.prototype.getSentence = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.SayResponse} returns this + * @return {!proto.connectrpc.eliza.v1.SayResponse} returns this */ -proto.buf.connect.demo.eliza.v1.SayResponse.prototype.setSentence = function(value) { +proto.connectrpc.eliza.v1.SayResponse.prototype.setSentence = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -429,8 +429,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.ConverseRequest.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.ConverseRequest.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.ConverseRequest.toObject(opt_includeInstance, this); }; @@ -439,11 +439,11 @@ proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.toObject = function(op * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.ConverseRequest} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.ConverseRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.ConverseRequest.toObject = function(includeInstance, msg) { var f, obj = { sentence: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -459,23 +459,23 @@ proto.buf.connect.demo.eliza.v1.ConverseRequest.toObject = function(includeInsta /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.ConverseRequest} + * @return {!proto.connectrpc.eliza.v1.ConverseRequest} */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.ConverseRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.ConverseRequest; - return proto.buf.connect.demo.eliza.v1.ConverseRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.ConverseRequest; + return proto.connectrpc.eliza.v1.ConverseRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.ConverseRequest} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.ConverseRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.ConverseRequest} + * @return {!proto.connectrpc.eliza.v1.ConverseRequest} */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.ConverseRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -499,9 +499,9 @@ proto.buf.connect.demo.eliza.v1.ConverseRequest.deserializeBinaryFromReader = fu * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.ConverseRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.ConverseRequest.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.ConverseRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -509,11 +509,11 @@ proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.serializeBinary = func /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.ConverseRequest} message + * @param {!proto.connectrpc.eliza.v1.ConverseRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.ConverseRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSentence(); if (f.length > 0) { @@ -529,16 +529,16 @@ proto.buf.connect.demo.eliza.v1.ConverseRequest.serializeBinaryToWriter = functi * optional string sentence = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.getSentence = function() { +proto.connectrpc.eliza.v1.ConverseRequest.prototype.getSentence = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.ConverseRequest} returns this + * @return {!proto.connectrpc.eliza.v1.ConverseRequest} returns this */ -proto.buf.connect.demo.eliza.v1.ConverseRequest.prototype.setSentence = function(value) { +proto.connectrpc.eliza.v1.ConverseRequest.prototype.setSentence = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -559,8 +559,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.ConverseResponse.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.ConverseResponse.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.ConverseResponse.toObject(opt_includeInstance, this); }; @@ -569,11 +569,11 @@ proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.toObject = function(o * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.ConverseResponse} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.ConverseResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.ConverseResponse.toObject = function(includeInstance, msg) { var f, obj = { sentence: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -589,23 +589,23 @@ proto.buf.connect.demo.eliza.v1.ConverseResponse.toObject = function(includeInst /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.ConverseResponse} + * @return {!proto.connectrpc.eliza.v1.ConverseResponse} */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.ConverseResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.ConverseResponse; - return proto.buf.connect.demo.eliza.v1.ConverseResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.ConverseResponse; + return proto.connectrpc.eliza.v1.ConverseResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.ConverseResponse} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.ConverseResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.ConverseResponse} + * @return {!proto.connectrpc.eliza.v1.ConverseResponse} */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.ConverseResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -629,9 +629,9 @@ proto.buf.connect.demo.eliza.v1.ConverseResponse.deserializeBinaryFromReader = f * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.ConverseResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.ConverseResponse.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.ConverseResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -639,11 +639,11 @@ proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.serializeBinary = fun /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.ConverseResponse} message + * @param {!proto.connectrpc.eliza.v1.ConverseResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.ConverseResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSentence(); if (f.length > 0) { @@ -659,16 +659,16 @@ proto.buf.connect.demo.eliza.v1.ConverseResponse.serializeBinaryToWriter = funct * optional string sentence = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.getSentence = function() { +proto.connectrpc.eliza.v1.ConverseResponse.prototype.getSentence = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.ConverseResponse} returns this + * @return {!proto.connectrpc.eliza.v1.ConverseResponse} returns this */ -proto.buf.connect.demo.eliza.v1.ConverseResponse.prototype.setSentence = function(value) { +proto.connectrpc.eliza.v1.ConverseResponse.prototype.setSentence = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -689,8 +689,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.IntroduceRequest.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.IntroduceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.IntroduceRequest.toObject(opt_includeInstance, this); }; @@ -699,11 +699,11 @@ proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.toObject = function(o * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.IntroduceRequest.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -719,23 +719,23 @@ proto.buf.connect.demo.eliza.v1.IntroduceRequest.toObject = function(includeInst /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} + * @return {!proto.connectrpc.eliza.v1.IntroduceRequest} */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.IntroduceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.IntroduceRequest; - return proto.buf.connect.demo.eliza.v1.IntroduceRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.IntroduceRequest; + return proto.connectrpc.eliza.v1.IntroduceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} + * @return {!proto.connectrpc.eliza.v1.IntroduceRequest} */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.IntroduceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -759,9 +759,9 @@ proto.buf.connect.demo.eliza.v1.IntroduceRequest.deserializeBinaryFromReader = f * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.IntroduceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.IntroduceRequest.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.IntroduceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -769,11 +769,11 @@ proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.serializeBinary = fun /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} message + * @param {!proto.connectrpc.eliza.v1.IntroduceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.IntroduceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { @@ -789,16 +789,16 @@ proto.buf.connect.demo.eliza.v1.IntroduceRequest.serializeBinaryToWriter = funct * optional string name = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.getName = function() { +proto.connectrpc.eliza.v1.IntroduceRequest.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceRequest} returns this + * @return {!proto.connectrpc.eliza.v1.IntroduceRequest} returns this */ -proto.buf.connect.demo.eliza.v1.IntroduceRequest.prototype.setName = function(value) { +proto.connectrpc.eliza.v1.IntroduceRequest.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -819,8 +819,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.buf.connect.demo.eliza.v1.IntroduceResponse.toObject(opt_includeInstance, this); +proto.connectrpc.eliza.v1.IntroduceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.connectrpc.eliza.v1.IntroduceResponse.toObject(opt_includeInstance, this); }; @@ -829,11 +829,11 @@ proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.toObject = function( * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} msg The msg instance to transform. + * @param {!proto.connectrpc.eliza.v1.IntroduceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.toObject = function(includeInstance, msg) { +proto.connectrpc.eliza.v1.IntroduceResponse.toObject = function(includeInstance, msg) { var f, obj = { sentence: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -849,23 +849,23 @@ proto.buf.connect.demo.eliza.v1.IntroduceResponse.toObject = function(includeIns /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} + * @return {!proto.connectrpc.eliza.v1.IntroduceResponse} */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.deserializeBinary = function(bytes) { +proto.connectrpc.eliza.v1.IntroduceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.buf.connect.demo.eliza.v1.IntroduceResponse; - return proto.buf.connect.demo.eliza.v1.IntroduceResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.connectrpc.eliza.v1.IntroduceResponse; + return proto.connectrpc.eliza.v1.IntroduceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} msg The message object to deserialize into. + * @param {!proto.connectrpc.eliza.v1.IntroduceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} + * @return {!proto.connectrpc.eliza.v1.IntroduceResponse} */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.connectrpc.eliza.v1.IntroduceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -889,9 +889,9 @@ proto.buf.connect.demo.eliza.v1.IntroduceResponse.deserializeBinaryFromReader = * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.serializeBinary = function() { +proto.connectrpc.eliza.v1.IntroduceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.buf.connect.demo.eliza.v1.IntroduceResponse.serializeBinaryToWriter(this, writer); + proto.connectrpc.eliza.v1.IntroduceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -899,11 +899,11 @@ proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.serializeBinary = fu /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} message + * @param {!proto.connectrpc.eliza.v1.IntroduceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.serializeBinaryToWriter = function(message, writer) { +proto.connectrpc.eliza.v1.IntroduceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSentence(); if (f.length > 0) { @@ -919,18 +919,18 @@ proto.buf.connect.demo.eliza.v1.IntroduceResponse.serializeBinaryToWriter = func * optional string sentence = 1; * @return {string} */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.getSentence = function() { +proto.connectrpc.eliza.v1.IntroduceResponse.prototype.getSentence = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value - * @return {!proto.buf.connect.demo.eliza.v1.IntroduceResponse} returns this + * @return {!proto.connectrpc.eliza.v1.IntroduceResponse} returns this */ -proto.buf.connect.demo.eliza.v1.IntroduceResponse.prototype.setSentence = function(value) { +proto.connectrpc.eliza.v1.IntroduceResponse.prototype.setSentence = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; -goog.object.extend(exports, proto.buf.connect.demo.eliza.v1); +goog.object.extend(exports, proto.connectrpc.eliza.v1); diff --git a/packages/connect-web-test/src/browserstackonly/eliza.spec.ts b/packages/connect-web-test/src/browserstackonly/eliza.spec.ts index af21b0449..e331ce16d 100644 --- a/packages/connect-web-test/src/browserstackonly/eliza.spec.ts +++ b/packages/connect-web-test/src/browserstackonly/eliza.spec.ts @@ -14,14 +14,14 @@ import { createPromiseClient } from "@bufbuild/connect"; import { createConnectTransport } from "@bufbuild/connect-web"; -import { ElizaService } from "../gen/buf/connect/demo/eliza/v1/eliza_connect.js"; -import { IntroduceRequest } from "../gen/buf/connect/demo/eliza/v1/eliza_pb.js"; +import { ElizaService } from "../gen/connectrpc/eliza/v1/eliza_connect.js"; +import { IntroduceRequest } from "../gen/connectrpc/eliza/v1/eliza_pb.js"; const timeoutMs = 15000; describe("eliza", () => { const transport = createConnectTransport({ - baseUrl: "https://demo.connect.build", + baseUrl: "https://demo.connectrpc.com", }); it( "say()", diff --git a/packages/connect-web/README.md b/packages/connect-web/README.md index c421749c6..f7efe5c9b 100644 --- a/packages/connect-web/README.md +++ b/packages/connect-web/README.md @@ -19,7 +19,7 @@ import { ElizaService } from "./gen/eliza_connect.js"; + // A transport for clients using the Connect protocol with fetch() + const transport = createConnectTransport({ -+ baseUrl: "https://demo.connect.build", ++ baseUrl: "https://demo.connectrpc.com", + }); const client = createPromiseClient(ElizaService, transport); @@ -38,7 +38,7 @@ import { ElizaService } from "./gen/eliza_connect.js"; + // A transport for clients using the Connect protocol with fetch() + const transport = createGrpcWebTransport({ -+ baseUrl: "https://demo.connect.build", ++ baseUrl: "https://demo.connectrpc.com", + }); const client = createPromiseClient(ElizaService, transport); @@ -52,6 +52,6 @@ console.log(sentence) // you said: I feel happy. To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). -Connect plays nice with Vue, Svelte, Remix, Next.js, Angular and many others. Take a look at +Connect plays nice with Vue, Svelte, Remix, Next.js, Angular and many others. Take a look at [our examples](https://github.com/bufbuild/connect-es-integration) for various frameworks. diff --git a/packages/connect/README.md b/packages/connect/README.md index eb8bab994..ab014f51e 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -1,6 +1,6 @@ # @bufbuild/connect -Connect is a family of libraries for building type-safe APIs with different languages and platforms. +Connect is a family of libraries for building type-safe APIs with different languages and platforms. [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect) brings them to TypeScript, the web browser, and to Node.js. @@ -29,7 +29,7 @@ and you can `curl` them if you want: curl \ --header 'Content-Type: application/json' \ --data '{"sentence": "I feel happy."}' \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Say + https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say ``` With Connect for ECMAScript, you can spin up a service in Node.js and call it diff --git a/packages/example/README.md b/packages/example/README.md index 128b630e5..a12904e20 100644 --- a/packages/example/README.md +++ b/packages/example/README.md @@ -1,16 +1,16 @@ # Code example -This directory contains a simple example for running a Connect client from your web browser and a +This directory contains a simple example for running a Connect client from your web browser and a client from your terminal against a server running in Node.js. -The application is a stripped-down version of [ELIZA](https://en.wikipedia.org/wiki/ELIZA), a very -simple natural language processor built in the 1960s to represent a psychotherapist. +The application is a stripped-down version of [ELIZA](https://en.wikipedia.org/wiki/ELIZA), a very +simple natural language processor built in the 1960s to represent a psychotherapist. -You can find the protocol buffer schema [on the BSR](https://buf.build/bufbuild/eliza/tree/main:buf/connect/demo/eliza/v1/eliza.proto). +You can find the protocol buffer schema [on the BSR](https://buf.build/connectrpc/eliza/file/main:connectrpc/eliza/v1/eliza.proto). ## Run the example -You will need [Node](https://nodejs.org/en/download/) in version 16 or later installed. Download +You will need [Node](https://nodejs.org/en/download/) in version 16 or later installed. Download the example project and install its dependencies: ```shell @@ -31,11 +31,11 @@ mkcert localhost 127.0.0.1 ::1 export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" ``` -If you don't use macOS or `brew`, see the [mkcert docs](https://github.com/FiloSottile/mkcert#installation) -for instructions. You can copy the last line to your `~/.zprofile` or `~/.profile`, so that +If you don't use macOS or `brew`, see the [mkcert docs](https://github.com/FiloSottile/mkcert#installation) +for instructions. You can copy the last line to your `~/.zprofile` or `~/.profile`, so that the environment variable for Node.js is set every time to open a terminal. -If you already use `mkcert`, just run `mkcert localhost 127.0.0.1 ::1` to issue a certificate +If you already use `mkcert`, just run `mkcert localhost 127.0.0.1 ::1` to issue a certificate for our example server. Once we have that out of the way, let's start the Connect server: @@ -44,7 +44,7 @@ Once we have that out of the way, let's start the Connect server: npm start ``` -That's it! You should now be able to open a web browser to https://localhost:8443 and see the +That's it! You should now be able to open a web browser to https://localhost:8443 and see the example running locally. ![Screenshot](README.png) @@ -52,7 +52,7 @@ example running locally. ## Using Node.js as a client -The file `src/client.ts` implements a CLI client that you can run in Node.js. +The file `src/client.ts` implements a CLI client that you can run in Node.js. ```shell $ npm run client @@ -68,23 +68,23 @@ How are you feeling today? > █ ``` -## Using other clients +## Using other clients -Because Connect is POST-only protocol that works over HTTP/1.1 and HTTP/2, we can also use +Because Connect is POST-only protocol that works over HTTP/1.1 and HTTP/2, we can also use `curl` to call our RPC: ```shell curl \ --header 'Content-Type: application/json' \ --data '{"sentence": "I feel happy."}' \ - https://localhost:8443/buf.connect.demo.eliza.v1.ElizaService/Say + https://localhost:8443/connectrpc.eliza.v1.ElizaService/Say ``` We can also use any gRPC client like `buf curl`: ```shell npx buf curl --protocol grpc --schema . -d '{"name": "John"}' \ - https://localhost:8443/buf.connect.demo.eliza.v1.ElizaService/Introduce + https://localhost:8443/connectrpc.eliza.v1.ElizaService/Introduce ``` @@ -93,8 +93,8 @@ npx buf curl --protocol grpc --schema . -d '{"name": "John"}' \ If you make changes to `eliza.proto`, make sure to re-generate the code. For example, you could rename a field, or add a procedure. To do so, run `npx buf generate` in this directory. -This will generate the service definitions and message types into the directory `src/gen`. The -[`buf.gen.yaml` file](./buf.gen.yaml) contains the plugin configuration. +This will generate the service definitions and message types into the directory `src/gen`. The +[`buf.gen.yaml` file](./buf.gen.yaml) contains the plugin configuration. Of course, you can use `protoc` as well if desired: diff --git a/packages/example/eliza.proto b/packages/example/eliza.proto index 2a71c954a..4818da6a9 100644 --- a/packages/example/eliza.proto +++ b/packages/example/eliza.proto @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Buf Technologies, Inc. +// Copyright 2022 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,52 +14,54 @@ syntax = "proto3"; -package buf.connect.demo.eliza.v1; +package connectrpc.eliza.v1; -// ElizaService provides a way to talk to the ELIZA, which is a port of -// the DOCTOR script for Joseph Weizenbaum's original ELIZA program. -// Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, -// ELIZA demonstrates the superficiality of human-computer communication. -// DOCTOR simulates a psychotherapist, and is commonly found as an Easter -// egg in emacs distributions. +// ElizaService provides a way to talk to Eliza, a port of the DOCTOR script +// for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at +// the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the +// superficiality of human-computer communication. DOCTOR simulates a +// psychotherapist, and is commonly found as an Easter egg in emacs +// distributions. service ElizaService { - // Say is a unary request demo. This method should allow for a one sentence - // response given a one sentence request. + // Say is a unary RPC. Eliza responds to the prompt with a single sentence. rpc Say(SayRequest) returns (SayResponse) {} - // Converse is a bi-directional streaming request demo. This method should allow for - // many requests and many responses. + // Converse is a bidirectional RPC. The caller may exchange multiple + // back-and-forth messages with Eliza over a long-lived connection. Eliza + // responds to each ConverseRequest with a ConverseResponse. rpc Converse(stream ConverseRequest) returns (stream ConverseResponse) {} - // Introduce is a server-streaming request demo. This method allows for a single request that will return a series - // of responses + // Introduce is a server streaming RPC. Given the caller's name, Eliza + // returns a stream of sentences to introduce itself. rpc Introduce(IntroduceRequest) returns (stream IntroduceResponse) {} } -// SayRequest describes the sentence said to the ELIZA program. +// SayRequest is a single-sentence request. message SayRequest { string sentence = 1; } -// SayResponse describes the sentence responded by the ELIZA program. +// SayResponse is a single-sentence response. message SayResponse { string sentence = 1; } -// ConverseRequest describes the sentence said to the ELIZA program. +// ConverseRequest is a single sentence request sent as part of a +// back-and-forth conversation. message ConverseRequest { string sentence = 1; } -// ConverseResponse describes the sentence responded by the ELIZA program. +// ConverseResponse is a single sentence response sent in answer to a +// ConverseRequest. message ConverseResponse { string sentence = 1; } -// IntroduceRequest describes a request for details from the ELIZA program. +// IntroduceRequest asks Eliza to introduce itself to the named user. message IntroduceRequest { string name = 1; } -// IntroduceResponse describes the sentence responded by the ELIZA program. +// IntroduceResponse is one sentence of Eliza's introductory monologue. message IntroduceResponse { string sentence = 1; } diff --git a/packages/example/src/gen/eliza_connect.ts b/packages/example/src/gen/eliza_connect.ts index 6d19a0bd0..222b3b01d 100644 --- a/packages/example/src/gen/eliza_connect.ts +++ b/packages/example/src/gen/eliza_connect.ts @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Buf Technologies, Inc. +// Copyright 2022 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ // limitations under the License. // @generated by protoc-gen-connect-es v0.12.0 with parameter "target=ts" -// @generated from file eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -21,23 +21,22 @@ import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, import { MethodKind } from "@bufbuild/protobuf"; /** - * ElizaService provides a way to talk to the ELIZA, which is a port of - * the DOCTOR script for Joseph Weizenbaum's original ELIZA program. - * Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, - * ELIZA demonstrates the superficiality of human-computer communication. - * DOCTOR simulates a psychotherapist, and is commonly found as an Easter - * egg in emacs distributions. + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. * - * @generated from service buf.connect.demo.eliza.v1.ElizaService + * @generated from service connectrpc.eliza.v1.ElizaService */ export const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { /** - * Say is a unary request demo. This method should allow for a one sentence - * response given a one sentence request. + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Say + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say */ say: { name: "Say", @@ -46,10 +45,11 @@ export const ElizaService = { kind: MethodKind.Unary, }, /** - * Converse is a bi-directional streaming request demo. This method should allow for - * many requests and many responses. + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Converse + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse */ converse: { name: "Converse", @@ -58,10 +58,10 @@ export const ElizaService = { kind: MethodKind.BiDiStreaming, }, /** - * Introduce is a server-streaming request demo. This method allows for a single request that will return a series - * of responses + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Introduce + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce */ introduce: { name: "Introduce", diff --git a/packages/example/src/gen/eliza_pb.ts b/packages/example/src/gen/eliza_pb.ts index 4244e6520..01af4c74c 100644 --- a/packages/example/src/gen/eliza_pb.ts +++ b/packages/example/src/gen/eliza_pb.ts @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Buf Technologies, Inc. +// Copyright 2022 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,7 +13,7 @@ // limitations under the License. // @generated by protoc-gen-es v1.3.0 with parameter "target=ts" -// @generated from file eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -21,9 +21,9 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM import { Message, proto3 } from "@bufbuild/protobuf"; /** - * SayRequest describes the sentence said to the ELIZA program. + * SayRequest is a single-sentence request. * - * @generated from message buf.connect.demo.eliza.v1.SayRequest + * @generated from message connectrpc.eliza.v1.SayRequest */ export class SayRequest extends Message { /** @@ -37,7 +37,7 @@ export class SayRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayRequest"; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -60,9 +60,9 @@ export class SayRequest extends Message { } /** - * SayResponse describes the sentence responded by the ELIZA program. + * SayResponse is a single-sentence response. * - * @generated from message buf.connect.demo.eliza.v1.SayResponse + * @generated from message connectrpc.eliza.v1.SayResponse */ export class SayResponse extends Message { /** @@ -76,7 +76,7 @@ export class SayResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayResponse"; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -99,9 +99,10 @@ export class SayResponse extends Message { } /** - * ConverseRequest describes the sentence said to the ELIZA program. + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. * - * @generated from message buf.connect.demo.eliza.v1.ConverseRequest + * @generated from message connectrpc.eliza.v1.ConverseRequest */ export class ConverseRequest extends Message { /** @@ -115,7 +116,7 @@ export class ConverseRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseRequest"; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -138,9 +139,10 @@ export class ConverseRequest extends Message { } /** - * ConverseResponse describes the sentence responded by the ELIZA program. + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. * - * @generated from message buf.connect.demo.eliza.v1.ConverseResponse + * @generated from message connectrpc.eliza.v1.ConverseResponse */ export class ConverseResponse extends Message { /** @@ -154,7 +156,7 @@ export class ConverseResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseResponse"; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -177,9 +179,9 @@ export class ConverseResponse extends Message { } /** - * IntroduceRequest describes a request for details from the ELIZA program. + * IntroduceRequest asks Eliza to introduce itself to the named user. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceRequest + * @generated from message connectrpc.eliza.v1.IntroduceRequest */ export class IntroduceRequest extends Message { /** @@ -193,7 +195,7 @@ export class IntroduceRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceRequest"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -216,9 +218,9 @@ export class IntroduceRequest extends Message { } /** - * IntroduceResponse describes the sentence responded by the ELIZA program. + * IntroduceResponse is one sentence of Eliza's introductory monologue. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceResponse + * @generated from message connectrpc.eliza.v1.IntroduceResponse */ export class IntroduceResponse extends Message { /** @@ -232,7 +234,7 @@ export class IntroduceResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceResponse"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); diff --git a/packages/protoc-gen-connect-es/README.md b/packages/protoc-gen-connect-es/README.md index bc339f303..e6fba10fc 100644 --- a/packages/protoc-gen-connect-es/README.md +++ b/packages/protoc-gen-connect-es/README.md @@ -8,12 +8,12 @@ Learn more about Connect at [github.com/bufbuild/connect-es](https://github.com/ ## Installation -`protoc-gen-connect-es` is a code generator plugin for Protocol Buffer compilers, +`protoc-gen-connect-es` is a code generator plugin for Protocol Buffer compilers, like [buf](https://github.com/bufbuild/buf) and [protoc](https://github.com/protocolbuffers/protobuf/releases). It generates clients as well as server definitions from your Protocol Buffer schema, and works in tandem with [@bufbuild/protoc-gen-es](https://www.npmjs.com/package/@bufbuild/protoc-gen-es), -the code generator plugin for all Protocol Buffer base types. The code these two -plugins generate requires the runtime libraries [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect), +the code generator plugin for all Protocol Buffer base types. The code these two +plugins generate requires the runtime libraries [@bufbuild/connect](https://www.npmjs.com/package/@bufbuild/connect), and [@bufbuild/protobuf](https://www.npmjs.com/package/@bufbuild/protobuf). To install `buf`, the plugins and their runtime libraries, run: @@ -23,8 +23,8 @@ npm install --save-dev @bufbuild/buf @bufbuild/protoc-gen-es @bufbuild/protoc-ge npm install @bufbuild/connect @bufbuild/protobuf ``` -If you want to call Connect or gRPC-web services from a web browsers, make sure to install -[@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web). If you want servers too, +If you want to call Connect or gRPC-web services from a web browsers, make sure to install +[@bufbuild/connect-web](https://www.npmjs.com/package/@bufbuild/connect-web). If you want servers too, install [@bufbuild/connect-node](https://www.npmjs.com/package/@bufbuild/connect-node), [@bufbuild/connect-fastify](https://www.npmjs.com/package/@bufbuild/connect-fastify), or [@bufbuild/connect-express](https://www.npmjs.com/package/@bufbuild/connect-express) @@ -54,7 +54,7 @@ plugins: out: src/gen opt: # Add more plugin options here - - target=ts + - target=ts ``` To generate code for all protobuf files within your project, simply run: @@ -63,9 +63,9 @@ To generate code for all protobuf files within your project, simply run: npx buf generate ``` -Note that `buf` can generate from various [inputs](https://docs.buf.build/reference/inputs), -not just local protobuf files. For example, `npx buf generate buf.build/bufbuild/eliza` -generates code for the module [bufbuild/eliza](https://buf.build/bufbuild/eliza) on the Buf Schema +Note that `buf` can generate from various [inputs](https://docs.buf.build/reference/inputs), +not just local protobuf files. For example, `npx buf generate buf.build/connectrpc/eliza` +generates code for the module [connectrpc/eliza](https://buf.build/connectrpc/eliza) on the Buf Schema Registry. @@ -81,10 +81,10 @@ PATH=$PATH:$(pwd)/node_modules/.bin \ a.proto b.proto c.proto ``` -Note that we are adding `node_modules/.bin` to the `$PATH`, so that the protocol +Note that we are adding `node_modules/.bin` to the `$PATH`, so that the protocol buffer compiler can find them. This happens automatically with npm scripts. -Since yarn v2 and above does not use a `node_modules` directory, you need to +Since yarn v2 and above does not use a `node_modules` directory, you need to change the variable a bit: ```bash @@ -108,7 +108,7 @@ Multiple values can be given by separating them with `+`, for example `target=js+dts`. By default, we generate JavaScript and TypeScript declaration files, which -produces the smallest code size and is the most compatible with various +produces the smallest code size and is the most compatible with various bundler configurations. If you prefer to generate TypeScript, use `target=ts`. ### `import_extension=.js` @@ -118,8 +118,8 @@ By default, [protoc-gen-connect-es](https://www.npmjs.com/package/@bufbuild/prot uses a `.js` file extensions in import paths, even in TypeScript files. This is unintuitive, but necessary for [ECMAScript modules in Node.js](https://www.typescriptlang.org/docs/handbook/esm-node.html). -Unfortunately, not all bundlers and tools have caught up yet, and Deno -requires `.ts`. With this plugin option, you can replace `.js` extensions +Unfortunately, not all bundlers and tools have caught up yet, and Deno +requires `.ts`. With this plugin option, you can replace `.js` extensions in import paths with the given value. For example, set - `import_extension=none` to remove the `.js` extension @@ -143,26 +143,25 @@ Unless you use Bazel, it is very unlikely that you need this option. ```protobuf syntax = "proto3"; -package buf.connect.demo.eliza.v1; +package connectrpc.eliza.v1; -// ElizaService provides a way to talk to the ELIZA, which is a port of -// the DOCTOR script for Joseph Weizenbaum's original ELIZA program. -// Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, -// ELIZA demonstrates the superficiality of human-computer communication. -// DOCTOR simulates a psychotherapist, and is commonly found as an Easter -// egg in emacs distributions. +// ElizaService provides a way to talk to Eliza, a port of the DOCTOR script +// for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at +// the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the +// superficiality of human-computer communication. DOCTOR simulates a +// psychotherapist, and is commonly found as an Easter egg in emacs +// distributions. service ElizaService { - // Say is a unary request demo. This method should allow for a one sentence - // response given a one sentence request. + // Say is a unary RPC. Eliza responds to the prompt with a single sentence. rpc Say(SayRequest) returns (SayResponse) {} } -// SayRequest describes the sentence said to the ELIZA program. +// SayRequest is a single-sentence request. message SayRequest { string sentence = 1; } -// SayResponse describes the sentence responded by the ELIZA program. +// SayRequest is a single-sentence response. message SayResponse { string sentence = 1; } @@ -171,23 +170,22 @@ message SayResponse { `eliza_connect.ts` ```ts /** - * ElizaService provides a way to talk to the ELIZA, which is a port of - * the DOCTOR script for Joseph Weizenbaum's original ELIZA program. - * Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, - * ELIZA demonstrates the superficiality of human-computer communication. - * DOCTOR simulates a psychotherapist, and is commonly found as an Easter - * egg in emacs distributions. + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. * - * @generated from service buf.connect.demo.eliza.v1.ElizaService + * @generated from service connectrpc.eliza.v1.ElizaService */ export const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { /** - * Say is a unary request demo. This method should allow for a one sentence - * response given a one sentence request. + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Say + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say */ say: { name: "Say", From 7643e6d161fab17024fa8b9faebd6e0a1fe4f03a Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 15:48:56 -0400 Subject: [PATCH 2/6] Update references --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e746f61be..2573c1a6a 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ $(GEN)/connect-web-test: node_modules/.bin/protoc-gen-es $(BUILD)/protoc-gen-con $(GEN)/connect-node-test: node_modules/.bin/protoc-gen-es $(BUILD)/protoc-gen-connect-es packages/connect-node-test/buf.gen.yaml Makefile rm -rf packages/connect-node-test/src/gen/* - npm run -w packages/connect-node-test generate https://github.com/connectrpc/connect-crosstest.git#ref=$(CROSSTEST_VERSION),subdir=proto + npm run -w packages/connect-node-test generate https://github.com/bufbuild/connect-crosstest.git#ref=$(CROSSTEST_VERSION),subdir=proto @mkdir -p $(@D) @touch $(@) From 506943c3f5f0672fa1456708a1cbd2e4018832f2 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 15:56:04 -0400 Subject: [PATCH 3/6] Regen --- .../src/gen/grpc/testing/empty_pb.ts | 63 + .../src/gen/grpc/testing/messages_pb.ts | 1318 +++++++++++++++++ .../src/gen/grpc/testing/test_connect.ts | 333 +++++ .../src/gen/server/v1/server_pb.ts | 184 +++ .../eliza/v1/eliza_connect.ts | 36 +- .../demo => connectrpc}/eliza/v1/eliza_pb.ts | 40 +- 6 files changed, 1937 insertions(+), 37 deletions(-) create mode 100644 packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts create mode 100644 packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts create mode 100644 packages/connect-node-test/src/gen/grpc/testing/test_connect.ts create mode 100644 packages/connect-node-test/src/gen/server/v1/server_pb.ts rename packages/connect-web-test/src/gen/{buf/connect/demo => connectrpc}/eliza/v1/eliza_connect.ts (53%) rename packages/connect-web-test/src/gen/{buf/connect/demo => connectrpc}/eliza/v1/eliza_pb.ts (85%) diff --git a/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts b/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts new file mode 100644 index 000000000..ddd1d3719 --- /dev/null +++ b/packages/connect-node-test/src/gen/grpc/testing/empty_pb.ts @@ -0,0 +1,63 @@ +// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/empty.proto + +// Copyright 2015 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" +// @generated from file grpc/testing/empty.proto (package grpc.testing, syntax proto3) +/* eslint-disable */ + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * An empty message that you can re-use to avoid defining duplicated empty + * messages in your project. A typical example is to use it as argument or the + * return value of a service API. For instance: + * + * service Foo { + * rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; + * }; + * + * + * @generated from message grpc.testing.Empty + */ +export class Empty extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.Empty"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Empty { + return new Empty().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Empty { + return new Empty().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Empty { + return new Empty().fromJsonString(jsonString, options); + } + + static equals(a: Empty | PlainMessage | undefined, b: Empty | PlainMessage | undefined): boolean { + return proto3.util.equals(Empty, a, b); + } +} + diff --git a/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts b/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts new file mode 100644 index 000000000..57b84cea2 --- /dev/null +++ b/packages/connect-node-test/src/gen/grpc/testing/messages_pb.ts @@ -0,0 +1,1318 @@ +// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/messages.proto + +// Copyright 2015-2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Message definitions to be used by integration test service definitions. + +// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" +// @generated from file grpc/testing/messages.proto (package grpc.testing, syntax proto3) +/* eslint-disable */ + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Any, Message, proto3 } from "@bufbuild/protobuf"; + +/** + * The type of payload that should be returned. + * + * @generated from enum grpc.testing.PayloadType + */ +export enum PayloadType { + /** + * Compressable text format. + * + * @generated from enum value: COMPRESSABLE = 0; + */ + COMPRESSABLE = 0, +} +// Retrieve enum metadata with: proto3.getEnumType(PayloadType) +proto3.util.setEnumType(PayloadType, "grpc.testing.PayloadType", [ + { no: 0, name: "COMPRESSABLE" }, +]); + +/** + * The type of route that a client took to reach a server w.r.t. gRPCLB. + * The server must fill in "fallback" if it detects that the RPC reached + * the server via the "gRPCLB fallback" path, and "backend" if it detects + * that the RPC reached the server via "gRPCLB backend" path (i.e. if it got + * the address of this server from the gRPCLB server BalanceLoad RPC). Exactly + * how this detection is done is context and server dependent. + * + * @generated from enum grpc.testing.GrpclbRouteType + */ +export enum GrpclbRouteType { + /** + * Server didn't detect the route that a client took to reach it. + * + * @generated from enum value: GRPCLB_ROUTE_TYPE_UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * Indicates that a client reached a server via gRPCLB fallback. + * + * @generated from enum value: GRPCLB_ROUTE_TYPE_FALLBACK = 1; + */ + FALLBACK = 1, + + /** + * Indicates that a client reached a server as a gRPCLB-given backend. + * + * @generated from enum value: GRPCLB_ROUTE_TYPE_BACKEND = 2; + */ + BACKEND = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(GrpclbRouteType) +proto3.util.setEnumType(GrpclbRouteType, "grpc.testing.GrpclbRouteType", [ + { no: 0, name: "GRPCLB_ROUTE_TYPE_UNKNOWN" }, + { no: 1, name: "GRPCLB_ROUTE_TYPE_FALLBACK" }, + { no: 2, name: "GRPCLB_ROUTE_TYPE_BACKEND" }, +]); + +/** + * TODO(dgq): Go back to using well-known types once + * https://github.com/grpc/grpc/issues/6980 has been fixed. + * import "google/protobuf/wrappers.proto"; + * + * @generated from message grpc.testing.BoolValue + */ +export class BoolValue extends Message { + /** + * The bool value. + * + * @generated from field: bool value = 1; + */ + value = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.BoolValue"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BoolValue { + return new BoolValue().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BoolValue { + return new BoolValue().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BoolValue { + return new BoolValue().fromJsonString(jsonString, options); + } + + static equals(a: BoolValue | PlainMessage | undefined, b: BoolValue | PlainMessage | undefined): boolean { + return proto3.util.equals(BoolValue, a, b); + } +} + +/** + * A block of data, to simply increase gRPC message size. + * + * @generated from message grpc.testing.Payload + */ +export class Payload extends Message { + /** + * The type of data in body. + * + * @generated from field: grpc.testing.PayloadType type = 1; + */ + type = PayloadType.COMPRESSABLE; + + /** + * Primary contents of payload. + * + * @generated from field: bytes body = 2; + */ + body = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.Payload"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(PayloadType) }, + { no: 2, name: "body", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Payload { + return new Payload().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Payload { + return new Payload().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Payload { + return new Payload().fromJsonString(jsonString, options); + } + + static equals(a: Payload | PlainMessage | undefined, b: Payload | PlainMessage | undefined): boolean { + return proto3.util.equals(Payload, a, b); + } +} + +/** + * A protobuf representation for grpc status. This is used by test + * clients to specify a status that the server should attempt to return. + * + * @generated from message grpc.testing.EchoStatus + */ +export class EchoStatus extends Message { + /** + * @generated from field: int32 code = 1; + */ + code = 0; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.EchoStatus"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EchoStatus { + return new EchoStatus().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EchoStatus { + return new EchoStatus().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EchoStatus { + return new EchoStatus().fromJsonString(jsonString, options); + } + + static equals(a: EchoStatus | PlainMessage | undefined, b: EchoStatus | PlainMessage | undefined): boolean { + return proto3.util.equals(EchoStatus, a, b); + } +} + +/** + * Unary request. + * + * @generated from message grpc.testing.SimpleRequest + */ +export class SimpleRequest extends Message { + /** + * Desired payload type in the response from the server. + * If response_type is RANDOM, server randomly chooses one from other formats. + * + * @generated from field: grpc.testing.PayloadType response_type = 1; + */ + responseType = PayloadType.COMPRESSABLE; + + /** + * Desired payload size in the response from the server. + * + * @generated from field: int32 response_size = 2; + */ + responseSize = 0; + + /** + * Optional input payload sent along with the request. + * + * @generated from field: grpc.testing.Payload payload = 3; + */ + payload?: Payload; + + /** + * Whether SimpleResponse should include username. + * + * @generated from field: bool fill_username = 4; + */ + fillUsername = false; + + /** + * Whether SimpleResponse should include OAuth scope. + * + * @generated from field: bool fill_oauth_scope = 5; + */ + fillOauthScope = false; + + /** + * Whether to request the server to compress the response. This field is + * "nullable" in order to interoperate seamlessly with clients not able to + * implement the full compression tests by introspecting the call to verify + * the response's compression status. + * + * @generated from field: grpc.testing.BoolValue response_compressed = 6; + */ + responseCompressed?: BoolValue; + + /** + * Whether server should return a given status + * + * @generated from field: grpc.testing.EchoStatus response_status = 7; + */ + responseStatus?: EchoStatus; + + /** + * Whether the server should expect this request to be compressed. + * + * @generated from field: grpc.testing.BoolValue expect_compressed = 8; + */ + expectCompressed?: BoolValue; + + /** + * Whether SimpleResponse should include server_id. + * + * @generated from field: bool fill_server_id = 9; + */ + fillServerId = false; + + /** + * Whether SimpleResponse should include grpclb_route_type. + * + * @generated from field: bool fill_grpclb_route_type = 10; + */ + fillGrpclbRouteType = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.SimpleRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "response_type", kind: "enum", T: proto3.getEnumType(PayloadType) }, + { no: 2, name: "response_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "payload", kind: "message", T: Payload }, + { no: 4, name: "fill_username", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "fill_oauth_scope", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "response_compressed", kind: "message", T: BoolValue }, + { no: 7, name: "response_status", kind: "message", T: EchoStatus }, + { no: 8, name: "expect_compressed", kind: "message", T: BoolValue }, + { no: 9, name: "fill_server_id", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "fill_grpclb_route_type", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SimpleRequest { + return new SimpleRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SimpleRequest { + return new SimpleRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SimpleRequest { + return new SimpleRequest().fromJsonString(jsonString, options); + } + + static equals(a: SimpleRequest | PlainMessage | undefined, b: SimpleRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SimpleRequest, a, b); + } +} + +/** + * Unary response, as configured by the request. + * + * @generated from message grpc.testing.SimpleResponse + */ +export class SimpleResponse extends Message { + /** + * Payload to increase message size. + * + * @generated from field: grpc.testing.Payload payload = 1; + */ + payload?: Payload; + + /** + * The user the request came from, for verifying authentication was + * successful when the client expected it. + * + * @generated from field: string username = 2; + */ + username = ""; + + /** + * OAuth scope. + * + * @generated from field: string oauth_scope = 3; + */ + oauthScope = ""; + + /** + * Server ID. This must be unique among different server instances, + * but the same across all RPC's made to a particular server instance. + * + * @generated from field: string server_id = 4; + */ + serverId = ""; + + /** + * gRPCLB Path. + * + * @generated from field: grpc.testing.GrpclbRouteType grpclb_route_type = 5; + */ + grpclbRouteType = GrpclbRouteType.UNKNOWN; + + /** + * Server hostname. + * + * @generated from field: string hostname = 6; + */ + hostname = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.SimpleResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "payload", kind: "message", T: Payload }, + { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "oauth_scope", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "server_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "grpclb_route_type", kind: "enum", T: proto3.getEnumType(GrpclbRouteType) }, + { no: 6, name: "hostname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SimpleResponse { + return new SimpleResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SimpleResponse { + return new SimpleResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SimpleResponse { + return new SimpleResponse().fromJsonString(jsonString, options); + } + + static equals(a: SimpleResponse | PlainMessage | undefined, b: SimpleResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SimpleResponse, a, b); + } +} + +/** + * Client-streaming request. + * + * @generated from message grpc.testing.StreamingInputCallRequest + */ +export class StreamingInputCallRequest extends Message { + /** + * Optional input payload sent along with the request. + * + * @generated from field: grpc.testing.Payload payload = 1; + */ + payload?: Payload; + + /** + * Whether the server should expect this request to be compressed. This field + * is "nullable" in order to interoperate seamlessly with servers not able to + * implement the full compression tests by introspecting the call to verify + * the request's compression status. + * + * @generated from field: grpc.testing.BoolValue expect_compressed = 2; + */ + expectCompressed?: BoolValue; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.StreamingInputCallRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "payload", kind: "message", T: Payload }, + { no: 2, name: "expect_compressed", kind: "message", T: BoolValue }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StreamingInputCallRequest { + return new StreamingInputCallRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StreamingInputCallRequest { + return new StreamingInputCallRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StreamingInputCallRequest { + return new StreamingInputCallRequest().fromJsonString(jsonString, options); + } + + static equals(a: StreamingInputCallRequest | PlainMessage | undefined, b: StreamingInputCallRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(StreamingInputCallRequest, a, b); + } +} + +/** + * Client-streaming response. + * + * @generated from message grpc.testing.StreamingInputCallResponse + */ +export class StreamingInputCallResponse extends Message { + /** + * Aggregated size of payloads received from the client. + * + * @generated from field: int32 aggregated_payload_size = 1; + */ + aggregatedPayloadSize = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.StreamingInputCallResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "aggregated_payload_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StreamingInputCallResponse { + return new StreamingInputCallResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StreamingInputCallResponse { + return new StreamingInputCallResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StreamingInputCallResponse { + return new StreamingInputCallResponse().fromJsonString(jsonString, options); + } + + static equals(a: StreamingInputCallResponse | PlainMessage | undefined, b: StreamingInputCallResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(StreamingInputCallResponse, a, b); + } +} + +/** + * Configuration for a particular response. + * + * @generated from message grpc.testing.ResponseParameters + */ +export class ResponseParameters extends Message { + /** + * Desired payload sizes in responses from the server. + * + * @generated from field: int32 size = 1; + */ + size = 0; + + /** + * Desired interval between consecutive responses in the response stream in + * microseconds. + * + * @generated from field: int32 interval_us = 2; + */ + intervalUs = 0; + + /** + * Whether to request the server to compress the response. This field is + * "nullable" in order to interoperate seamlessly with clients not able to + * implement the full compression tests by introspecting the call to verify + * the response's compression status. + * + * @generated from field: grpc.testing.BoolValue compressed = 3; + */ + compressed?: BoolValue; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ResponseParameters"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "interval_us", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "compressed", kind: "message", T: BoolValue }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResponseParameters { + return new ResponseParameters().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResponseParameters { + return new ResponseParameters().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResponseParameters { + return new ResponseParameters().fromJsonString(jsonString, options); + } + + static equals(a: ResponseParameters | PlainMessage | undefined, b: ResponseParameters | PlainMessage | undefined): boolean { + return proto3.util.equals(ResponseParameters, a, b); + } +} + +/** + * Server-streaming request. + * + * @generated from message grpc.testing.StreamingOutputCallRequest + */ +export class StreamingOutputCallRequest extends Message { + /** + * Desired payload type in the response from the server. + * If response_type is RANDOM, the payload from each response in the stream + * might be of different types. This is to simulate a mixed type of payload + * stream. + * + * @generated from field: grpc.testing.PayloadType response_type = 1; + */ + responseType = PayloadType.COMPRESSABLE; + + /** + * Configuration for each expected response message. + * + * @generated from field: repeated grpc.testing.ResponseParameters response_parameters = 2; + */ + responseParameters: ResponseParameters[] = []; + + /** + * Optional input payload sent along with the request. + * + * @generated from field: grpc.testing.Payload payload = 3; + */ + payload?: Payload; + + /** + * Whether server should return a given status + * + * @generated from field: grpc.testing.EchoStatus response_status = 7; + */ + responseStatus?: EchoStatus; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.StreamingOutputCallRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "response_type", kind: "enum", T: proto3.getEnumType(PayloadType) }, + { no: 2, name: "response_parameters", kind: "message", T: ResponseParameters, repeated: true }, + { no: 3, name: "payload", kind: "message", T: Payload }, + { no: 7, name: "response_status", kind: "message", T: EchoStatus }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StreamingOutputCallRequest { + return new StreamingOutputCallRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StreamingOutputCallRequest { + return new StreamingOutputCallRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StreamingOutputCallRequest { + return new StreamingOutputCallRequest().fromJsonString(jsonString, options); + } + + static equals(a: StreamingOutputCallRequest | PlainMessage | undefined, b: StreamingOutputCallRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(StreamingOutputCallRequest, a, b); + } +} + +/** + * Server-streaming response, as configured by the request and parameters. + * + * @generated from message grpc.testing.StreamingOutputCallResponse + */ +export class StreamingOutputCallResponse extends Message { + /** + * Payload to increase response size. + * + * @generated from field: grpc.testing.Payload payload = 1; + */ + payload?: Payload; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.StreamingOutputCallResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "payload", kind: "message", T: Payload }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StreamingOutputCallResponse { + return new StreamingOutputCallResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StreamingOutputCallResponse { + return new StreamingOutputCallResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StreamingOutputCallResponse { + return new StreamingOutputCallResponse().fromJsonString(jsonString, options); + } + + static equals(a: StreamingOutputCallResponse | PlainMessage | undefined, b: StreamingOutputCallResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(StreamingOutputCallResponse, a, b); + } +} + +/** + * For reconnect interop test only. + * Client tells server what reconnection parameters it used. + * + * @generated from message grpc.testing.ReconnectParams + */ +export class ReconnectParams extends Message { + /** + * @generated from field: int32 max_reconnect_backoff_ms = 1; + */ + maxReconnectBackoffMs = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ReconnectParams"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "max_reconnect_backoff_ms", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReconnectParams { + return new ReconnectParams().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReconnectParams { + return new ReconnectParams().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ReconnectParams { + return new ReconnectParams().fromJsonString(jsonString, options); + } + + static equals(a: ReconnectParams | PlainMessage | undefined, b: ReconnectParams | PlainMessage | undefined): boolean { + return proto3.util.equals(ReconnectParams, a, b); + } +} + +/** + * For reconnect interop test only. + * Server tells client whether its reconnects are following the spec and the + * reconnect backoffs it saw. + * + * @generated from message grpc.testing.ReconnectInfo + */ +export class ReconnectInfo extends Message { + /** + * @generated from field: bool passed = 1; + */ + passed = false; + + /** + * @generated from field: repeated int32 backoff_ms = 2; + */ + backoffMs: number[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ReconnectInfo"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "passed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "backoff_ms", kind: "scalar", T: 5 /* ScalarType.INT32 */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ReconnectInfo { + return new ReconnectInfo().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ReconnectInfo { + return new ReconnectInfo().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ReconnectInfo { + return new ReconnectInfo().fromJsonString(jsonString, options); + } + + static equals(a: ReconnectInfo | PlainMessage | undefined, b: ReconnectInfo | PlainMessage | undefined): boolean { + return proto3.util.equals(ReconnectInfo, a, b); + } +} + +/** + * @generated from message grpc.testing.LoadBalancerStatsRequest + */ +export class LoadBalancerStatsRequest extends Message { + /** + * Request stats for the next num_rpcs sent by client. + * + * @generated from field: int32 num_rpcs = 1; + */ + numRpcs = 0; + + /** + * If num_rpcs have not completed within timeout_sec, return partial results. + * + * @generated from field: int32 timeout_sec = 2; + */ + timeoutSec = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerStatsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "num_rpcs", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "timeout_sec", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsRequest { + return new LoadBalancerStatsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsRequest { + return new LoadBalancerStatsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsRequest { + return new LoadBalancerStatsRequest().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerStatsRequest | PlainMessage | undefined, b: LoadBalancerStatsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerStatsRequest, a, b); + } +} + +/** + * @generated from message grpc.testing.LoadBalancerStatsResponse + */ +export class LoadBalancerStatsResponse extends Message { + /** + * The number of completed RPCs for each peer. + * + * @generated from field: map rpcs_by_peer = 1; + */ + rpcsByPeer: { [key: string]: number } = {}; + + /** + * The number of RPCs that failed to record a remote peer. + * + * @generated from field: int32 num_failures = 2; + */ + numFailures = 0; + + /** + * @generated from field: map rpcs_by_method = 3; + */ + rpcsByMethod: { [key: string]: LoadBalancerStatsResponse_RpcsByPeer } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerStatsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rpcs_by_peer", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + { no: 2, name: "num_failures", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "rpcs_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: LoadBalancerStatsResponse_RpcsByPeer} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsResponse { + return new LoadBalancerStatsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsResponse { + return new LoadBalancerStatsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsResponse { + return new LoadBalancerStatsResponse().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerStatsResponse | PlainMessage | undefined, b: LoadBalancerStatsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerStatsResponse, a, b); + } +} + +/** + * @generated from message grpc.testing.LoadBalancerStatsResponse.RpcsByPeer + */ +export class LoadBalancerStatsResponse_RpcsByPeer extends Message { + /** + * The number of completed RPCs for each peer. + * + * @generated from field: map rpcs_by_peer = 1; + */ + rpcsByPeer: { [key: string]: number } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerStatsResponse.RpcsByPeer"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rpcs_by_peer", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { + return new LoadBalancerStatsResponse_RpcsByPeer().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { + return new LoadBalancerStatsResponse_RpcsByPeer().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerStatsResponse_RpcsByPeer { + return new LoadBalancerStatsResponse_RpcsByPeer().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerStatsResponse_RpcsByPeer | PlainMessage | undefined, b: LoadBalancerStatsResponse_RpcsByPeer | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerStatsResponse_RpcsByPeer, a, b); + } +} + +/** + * Request for retrieving a test client's accumulated stats. + * + * @generated from message grpc.testing.LoadBalancerAccumulatedStatsRequest + */ +export class LoadBalancerAccumulatedStatsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsRequest { + return new LoadBalancerAccumulatedStatsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsRequest { + return new LoadBalancerAccumulatedStatsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsRequest { + return new LoadBalancerAccumulatedStatsRequest().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerAccumulatedStatsRequest | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerAccumulatedStatsRequest, a, b); + } +} + +/** + * Accumulated stats for RPCs sent by a test client. + * + * @generated from message grpc.testing.LoadBalancerAccumulatedStatsResponse + */ +export class LoadBalancerAccumulatedStatsResponse extends Message { + /** + * The total number of RPCs have ever issued for each type. + * Deprecated: use stats_per_method.rpcs_started instead. + * + * @generated from field: map num_rpcs_started_by_method = 1 [deprecated = true]; + * @deprecated + */ + numRpcsStartedByMethod: { [key: string]: number } = {}; + + /** + * The total number of RPCs have ever completed successfully for each type. + * Deprecated: use stats_per_method.result instead. + * + * @generated from field: map num_rpcs_succeeded_by_method = 2 [deprecated = true]; + * @deprecated + */ + numRpcsSucceededByMethod: { [key: string]: number } = {}; + + /** + * The total number of RPCs have ever failed for each type. + * Deprecated: use stats_per_method.result instead. + * + * @generated from field: map num_rpcs_failed_by_method = 3 [deprecated = true]; + * @deprecated + */ + numRpcsFailedByMethod: { [key: string]: number } = {}; + + /** + * Per-method RPC statistics. The key is the RpcType in string form; e.g. + * 'EMPTY_CALL' or 'UNARY_CALL' + * + * @generated from field: map stats_per_method = 4; + */ + statsPerMethod: { [key: string]: LoadBalancerAccumulatedStatsResponse_MethodStats } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "num_rpcs_started_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + { no: 2, name: "num_rpcs_succeeded_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + { no: 3, name: "num_rpcs_failed_by_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + { no: 4, name: "stats_per_method", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: LoadBalancerAccumulatedStatsResponse_MethodStats} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsResponse { + return new LoadBalancerAccumulatedStatsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsResponse { + return new LoadBalancerAccumulatedStatsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsResponse { + return new LoadBalancerAccumulatedStatsResponse().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerAccumulatedStatsResponse | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerAccumulatedStatsResponse, a, b); + } +} + +/** + * @generated from message grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats + */ +export class LoadBalancerAccumulatedStatsResponse_MethodStats extends Message { + /** + * The number of RPCs that were started for this method. + * + * @generated from field: int32 rpcs_started = 1; + */ + rpcsStarted = 0; + + /** + * The number of RPCs that completed with each status for this method. The + * key is the integral value of a google.rpc.Code; the value is the count. + * + * @generated from field: map result = 2; + */ + result: { [key: number]: number } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.LoadBalancerAccumulatedStatsResponse.MethodStats"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "rpcs_started", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "result", kind: "map", K: 5 /* ScalarType.INT32 */, V: {kind: "scalar", T: 5 /* ScalarType.INT32 */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { + return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { + return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoadBalancerAccumulatedStatsResponse_MethodStats { + return new LoadBalancerAccumulatedStatsResponse_MethodStats().fromJsonString(jsonString, options); + } + + static equals(a: LoadBalancerAccumulatedStatsResponse_MethodStats | PlainMessage | undefined, b: LoadBalancerAccumulatedStatsResponse_MethodStats | PlainMessage | undefined): boolean { + return proto3.util.equals(LoadBalancerAccumulatedStatsResponse_MethodStats, a, b); + } +} + +/** + * Configurations for a test client. + * + * @generated from message grpc.testing.ClientConfigureRequest + */ +export class ClientConfigureRequest extends Message { + /** + * The types of RPCs the client sends. + * + * @generated from field: repeated grpc.testing.ClientConfigureRequest.RpcType types = 1; + */ + types: ClientConfigureRequest_RpcType[] = []; + + /** + * The collection of custom metadata to be attached to RPCs sent by the client. + * + * @generated from field: repeated grpc.testing.ClientConfigureRequest.Metadata metadata = 2; + */ + metadata: ClientConfigureRequest_Metadata[] = []; + + /** + * The deadline to use, in seconds, for all RPCs. If unset or zero, the + * client will use the default from the command-line. + * + * @generated from field: int32 timeout_sec = 3; + */ + timeoutSec = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ClientConfigureRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "types", kind: "enum", T: proto3.getEnumType(ClientConfigureRequest_RpcType), repeated: true }, + { no: 2, name: "metadata", kind: "message", T: ClientConfigureRequest_Metadata, repeated: true }, + { no: 3, name: "timeout_sec", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureRequest { + return new ClientConfigureRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureRequest { + return new ClientConfigureRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClientConfigureRequest { + return new ClientConfigureRequest().fromJsonString(jsonString, options); + } + + static equals(a: ClientConfigureRequest | PlainMessage | undefined, b: ClientConfigureRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ClientConfigureRequest, a, b); + } +} + +/** + * Type of RPCs to send. + * + * @generated from enum grpc.testing.ClientConfigureRequest.RpcType + */ +export enum ClientConfigureRequest_RpcType { + /** + * @generated from enum value: EMPTY_CALL = 0; + */ + EMPTY_CALL = 0, + + /** + * @generated from enum value: UNARY_CALL = 1; + */ + UNARY_CALL = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(ClientConfigureRequest_RpcType) +proto3.util.setEnumType(ClientConfigureRequest_RpcType, "grpc.testing.ClientConfigureRequest.RpcType", [ + { no: 0, name: "EMPTY_CALL" }, + { no: 1, name: "UNARY_CALL" }, +]); + +/** + * Metadata to be attached for the given type of RPCs. + * + * @generated from message grpc.testing.ClientConfigureRequest.Metadata + */ +export class ClientConfigureRequest_Metadata extends Message { + /** + * @generated from field: grpc.testing.ClientConfigureRequest.RpcType type = 1; + */ + type = ClientConfigureRequest_RpcType.EMPTY_CALL; + + /** + * @generated from field: string key = 2; + */ + key = ""; + + /** + * @generated from field: string value = 3; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ClientConfigureRequest.Metadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ClientConfigureRequest_RpcType) }, + { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureRequest_Metadata { + return new ClientConfigureRequest_Metadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureRequest_Metadata { + return new ClientConfigureRequest_Metadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClientConfigureRequest_Metadata { + return new ClientConfigureRequest_Metadata().fromJsonString(jsonString, options); + } + + static equals(a: ClientConfigureRequest_Metadata | PlainMessage | undefined, b: ClientConfigureRequest_Metadata | PlainMessage | undefined): boolean { + return proto3.util.equals(ClientConfigureRequest_Metadata, a, b); + } +} + +/** + * Response for updating a test client's configuration. + * + * @generated from message grpc.testing.ClientConfigureResponse + */ +export class ClientConfigureResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ClientConfigureResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ClientConfigureResponse { + return new ClientConfigureResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ClientConfigureResponse { + return new ClientConfigureResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ClientConfigureResponse { + return new ClientConfigureResponse().fromJsonString(jsonString, options); + } + + static equals(a: ClientConfigureResponse | PlainMessage | undefined, b: ClientConfigureResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ClientConfigureResponse, a, b); + } +} + +/** + * @generated from message grpc.testing.ErrorDetail + */ +export class ErrorDetail extends Message { + /** + * @generated from field: string reason = 1; + */ + reason = ""; + + /** + * @generated from field: string domain = 2; + */ + domain = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ErrorDetail"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "reason", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ErrorDetail { + return new ErrorDetail().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ErrorDetail { + return new ErrorDetail().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ErrorDetail { + return new ErrorDetail().fromJsonString(jsonString, options); + } + + static equals(a: ErrorDetail | PlainMessage | undefined, b: ErrorDetail | PlainMessage | undefined): boolean { + return proto3.util.equals(ErrorDetail, a, b); + } +} + +/** + * @generated from message grpc.testing.ErrorStatus + */ +export class ErrorStatus extends Message { + /** + * @generated from field: int32 code = 1; + */ + code = 0; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: repeated google.protobuf.Any details = 3; + */ + details: Any[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "grpc.testing.ErrorStatus"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "code", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "details", kind: "message", T: Any, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ErrorStatus { + return new ErrorStatus().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ErrorStatus { + return new ErrorStatus().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ErrorStatus { + return new ErrorStatus().fromJsonString(jsonString, options); + } + + static equals(a: ErrorStatus | PlainMessage | undefined, b: ErrorStatus | PlainMessage | undefined): boolean { + return proto3.util.equals(ErrorStatus, a, b); + } +} + diff --git a/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts b/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts new file mode 100644 index 000000000..e5cb5737a --- /dev/null +++ b/packages/connect-node-test/src/gen/grpc/testing/test_connect.ts @@ -0,0 +1,333 @@ +// This is copied from gRPC's testing Protobuf definitions: https://github.com/grpc/grpc/blob/master/src/proto/grpc/testing/test.proto +// +// The TestService has been extended to include the following RPCs: +// FailUnaryCall(SimpleRequest) returns (SimpleResponse): this RPC is a unary +// call that always returns a readable non-ASCII error with error details. +// FailStreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse): +// this RPC is a server streaming call that always returns a readable non-ASCII error with error details. +// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC +// is a server streaming call that will not be implemented. +// +// The UnimplementedService has been extended to include the following RPCs: +// UnimplementedStreamingOutputCall(grpc.testing.Empty) returns (stream grpc.testing.Empty): this RPC +// is a server streaming call that will not be implemented. + +// Copyright 2015-2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An integration test service that covers all the method signature permutations +// of unary/streaming requests/responses. + +// @generated by protoc-gen-connect-es v0.12.0 with parameter "ts_nocheck=false,target=ts" +// @generated from file grpc/testing/test.proto (package grpc.testing, syntax proto3) +/* eslint-disable */ + +import { Empty } from "./empty_pb.js"; +import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; +import { ClientConfigureRequest, ClientConfigureResponse, LoadBalancerAccumulatedStatsRequest, LoadBalancerAccumulatedStatsResponse, LoadBalancerStatsRequest, LoadBalancerStatsResponse, ReconnectInfo, ReconnectParams, SimpleRequest, SimpleResponse, StreamingInputCallRequest, StreamingInputCallResponse, StreamingOutputCallRequest, StreamingOutputCallResponse } from "./messages_pb.js"; + +/** + * A simple service to test the various types of RPCs and experiment with + * performance with various types of payload. + * + * @generated from service grpc.testing.TestService + */ +export const TestService = { + typeName: "grpc.testing.TestService", + methods: { + /** + * One empty request followed by one empty response. + * + * @generated from rpc grpc.testing.TestService.EmptyCall + */ + emptyCall: { + name: "EmptyCall", + I: Empty, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * One request followed by one response. + * + * @generated from rpc grpc.testing.TestService.UnaryCall + */ + unaryCall: { + name: "UnaryCall", + I: SimpleRequest, + O: SimpleResponse, + kind: MethodKind.Unary, + }, + /** + * One request followed by one response. This RPC always fails. + * + * @generated from rpc grpc.testing.TestService.FailUnaryCall + */ + failUnaryCall: { + name: "FailUnaryCall", + I: SimpleRequest, + O: SimpleResponse, + kind: MethodKind.Unary, + }, + /** + * One request followed by one response. Response has cache control + * headers set such that a caching HTTP proxy (such as GFE) can + * satisfy subsequent requests. + * + * @generated from rpc grpc.testing.TestService.CacheableUnaryCall + */ + cacheableUnaryCall: { + name: "CacheableUnaryCall", + I: SimpleRequest, + O: SimpleResponse, + kind: MethodKind.Unary, + idempotency: MethodIdempotency.NoSideEffects, + }, + /** + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + * + * @generated from rpc grpc.testing.TestService.StreamingOutputCall + */ + streamingOutputCall: { + name: "StreamingOutputCall", + I: StreamingOutputCallRequest, + O: StreamingOutputCallResponse, + kind: MethodKind.ServerStreaming, + }, + /** + * One request followed by a sequence of responses (streamed download). + * The server returns the payload with client desired type and sizes. + * This RPC always responds with an error status. + * + * @generated from rpc grpc.testing.TestService.FailStreamingOutputCall + */ + failStreamingOutputCall: { + name: "FailStreamingOutputCall", + I: StreamingOutputCallRequest, + O: StreamingOutputCallResponse, + kind: MethodKind.ServerStreaming, + }, + /** + * A sequence of requests followed by one response (streamed upload). + * The server returns the aggregated size of client payload as the result. + * + * @generated from rpc grpc.testing.TestService.StreamingInputCall + */ + streamingInputCall: { + name: "StreamingInputCall", + I: StreamingInputCallRequest, + O: StreamingInputCallResponse, + kind: MethodKind.ClientStreaming, + }, + /** + * A sequence of requests with each request served by the server immediately. + * As one request could lead to multiple responses, this interface + * demonstrates the idea of full duplexing. + * + * @generated from rpc grpc.testing.TestService.FullDuplexCall + */ + fullDuplexCall: { + name: "FullDuplexCall", + I: StreamingOutputCallRequest, + O: StreamingOutputCallResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * A sequence of requests followed by a sequence of responses. + * The server buffers all the client requests and then serves them in order. A + * stream of responses are returned to the client when the server starts with + * first request. + * + * @generated from rpc grpc.testing.TestService.HalfDuplexCall + */ + halfDuplexCall: { + name: "HalfDuplexCall", + I: StreamingOutputCallRequest, + O: StreamingOutputCallResponse, + kind: MethodKind.BiDiStreaming, + }, + /** + * The test server will not implement this method. It will be used + * to test the behavior when clients call unimplemented methods. + * + * @generated from rpc grpc.testing.TestService.UnimplementedCall + */ + unimplementedCall: { + name: "UnimplementedCall", + I: Empty, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * The test server will not implement this method. It will be used + * to test the behavior when clients call unimplemented streaming output methods. + * + * @generated from rpc grpc.testing.TestService.UnimplementedStreamingOutputCall + */ + unimplementedStreamingOutputCall: { + name: "UnimplementedStreamingOutputCall", + I: Empty, + O: Empty, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + +/** + * A simple service NOT implemented at servers so clients can test for + * that case. + * + * @generated from service grpc.testing.UnimplementedService + */ +export const UnimplementedService = { + typeName: "grpc.testing.UnimplementedService", + methods: { + /** + * A call that no server should implement + * + * @generated from rpc grpc.testing.UnimplementedService.UnimplementedCall + */ + unimplementedCall: { + name: "UnimplementedCall", + I: Empty, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * A call that no server should implement + * + * @generated from rpc grpc.testing.UnimplementedService.UnimplementedStreamingOutputCall + */ + unimplementedStreamingOutputCall: { + name: "UnimplementedStreamingOutputCall", + I: Empty, + O: Empty, + kind: MethodKind.ServerStreaming, + }, + } +} as const; + +/** + * A service used to control reconnect server. + * + * @generated from service grpc.testing.ReconnectService + */ +export const ReconnectService = { + typeName: "grpc.testing.ReconnectService", + methods: { + /** + * @generated from rpc grpc.testing.ReconnectService.Start + */ + start: { + name: "Start", + I: ReconnectParams, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc grpc.testing.ReconnectService.Stop + */ + stop: { + name: "Stop", + I: Empty, + O: ReconnectInfo, + kind: MethodKind.Unary, + }, + } +} as const; + +/** + * A service used to obtain stats for verifying LB behavior. + * + * @generated from service grpc.testing.LoadBalancerStatsService + */ +export const LoadBalancerStatsService = { + typeName: "grpc.testing.LoadBalancerStatsService", + methods: { + /** + * Gets the backend distribution for RPCs sent by a test client. + * + * @generated from rpc grpc.testing.LoadBalancerStatsService.GetClientStats + */ + getClientStats: { + name: "GetClientStats", + I: LoadBalancerStatsRequest, + O: LoadBalancerStatsResponse, + kind: MethodKind.Unary, + }, + /** + * Gets the accumulated stats for RPCs sent by a test client. + * + * @generated from rpc grpc.testing.LoadBalancerStatsService.GetClientAccumulatedStats + */ + getClientAccumulatedStats: { + name: "GetClientAccumulatedStats", + I: LoadBalancerAccumulatedStatsRequest, + O: LoadBalancerAccumulatedStatsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + +/** + * A service to remotely control health status of an xDS test server. + * + * @generated from service grpc.testing.XdsUpdateHealthService + */ +export const XdsUpdateHealthService = { + typeName: "grpc.testing.XdsUpdateHealthService", + methods: { + /** + * @generated from rpc grpc.testing.XdsUpdateHealthService.SetServing + */ + setServing: { + name: "SetServing", + I: Empty, + O: Empty, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc grpc.testing.XdsUpdateHealthService.SetNotServing + */ + setNotServing: { + name: "SetNotServing", + I: Empty, + O: Empty, + kind: MethodKind.Unary, + }, + } +} as const; + +/** + * A service to dynamically update the configuration of an xDS test client. + * + * @generated from service grpc.testing.XdsUpdateClientConfigureService + */ +export const XdsUpdateClientConfigureService = { + typeName: "grpc.testing.XdsUpdateClientConfigureService", + methods: { + /** + * Update the tes client's configuration. + * + * @generated from rpc grpc.testing.XdsUpdateClientConfigureService.Configure + */ + configure: { + name: "Configure", + I: ClientConfigureRequest, + O: ClientConfigureResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/connect-node-test/src/gen/server/v1/server_pb.ts b/packages/connect-node-test/src/gen/server/v1/server_pb.ts new file mode 100644 index 000000000..6f030bc29 --- /dev/null +++ b/packages/connect-node-test/src/gen/server/v1/server_pb.ts @@ -0,0 +1,184 @@ +// Copyright 2022 Buf Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" +// @generated from file server/v1/server.proto (package server.v1, syntax proto3) +/* eslint-disable */ + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum server.v1.Protocol + */ +export enum Protocol { + /** + * @generated from enum value: PROTOCOL_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: PROTOCOL_GRPC = 1; + */ + GRPC = 1, + + /** + * @generated from enum value: PROTOCOL_GRPC_WEB = 2; + */ + GRPC_WEB = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(Protocol) +proto3.util.setEnumType(Protocol, "server.v1.Protocol", [ + { no: 0, name: "PROTOCOL_UNSPECIFIED" }, + { no: 1, name: "PROTOCOL_GRPC" }, + { no: 2, name: "PROTOCOL_GRPC_WEB" }, +]); + +/** + * ServerMetadata is the metadata returned from the server started by the server binary. + * + * @generated from message server.v1.ServerMetadata + */ +export class ServerMetadata extends Message { + /** + * @generated from field: string host = 1; + */ + host = ""; + + /** + * @generated from field: repeated server.v1.ProtocolSupport protocols = 2; + */ + protocols: ProtocolSupport[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "server.v1.ServerMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "host", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "protocols", kind: "message", T: ProtocolSupport, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ServerMetadata { + return new ServerMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ServerMetadata { + return new ServerMetadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ServerMetadata { + return new ServerMetadata().fromJsonString(jsonString, options); + } + + static equals(a: ServerMetadata | PlainMessage | undefined, b: ServerMetadata | PlainMessage | undefined): boolean { + return proto3.util.equals(ServerMetadata, a, b); + } +} + +/** + * @generated from message server.v1.ProtocolSupport + */ +export class ProtocolSupport extends Message { + /** + * @generated from field: server.v1.Protocol protocol = 1; + */ + protocol = Protocol.UNSPECIFIED; + + /** + * @generated from field: repeated server.v1.HTTPVersion http_versions = 2; + */ + httpVersions: HTTPVersion[] = []; + + /** + * @generated from field: string port = 3; + */ + port = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "server.v1.ProtocolSupport"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "protocol", kind: "enum", T: proto3.getEnumType(Protocol) }, + { no: 2, name: "http_versions", kind: "message", T: HTTPVersion, repeated: true }, + { no: 3, name: "port", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ProtocolSupport { + return new ProtocolSupport().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ProtocolSupport { + return new ProtocolSupport().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ProtocolSupport { + return new ProtocolSupport().fromJsonString(jsonString, options); + } + + static equals(a: ProtocolSupport | PlainMessage | undefined, b: ProtocolSupport | PlainMessage | undefined): boolean { + return proto3.util.equals(ProtocolSupport, a, b); + } +} + +/** + * @generated from message server.v1.HTTPVersion + */ +export class HTTPVersion extends Message { + /** + * @generated from field: int32 major = 1; + */ + major = 0; + + /** + * @generated from field: int32 minor = 2; + */ + minor = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "server.v1.HTTPVersion"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "major", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "minor", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): HTTPVersion { + return new HTTPVersion().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): HTTPVersion { + return new HTTPVersion().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): HTTPVersion { + return new HTTPVersion().fromJsonString(jsonString, options); + } + + static equals(a: HTTPVersion | PlainMessage | undefined, b: HTTPVersion | PlainMessage | undefined): boolean { + return proto3.util.equals(HTTPVersion, a, b); + } +} + diff --git a/packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_connect.ts b/packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_connect.ts similarity index 53% rename from packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_connect.ts rename to packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_connect.ts index 57e24bba2..d2186af34 100644 --- a/packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_connect.ts +++ b/packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_connect.ts @@ -13,30 +13,29 @@ // limitations under the License. // @generated by protoc-gen-connect-es v0.12.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file buf/connect/demo/eliza/v1/eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ import { ConverseRequest, ConverseResponse, IntroduceRequest, IntroduceResponse, SayRequest, SayResponse } from "./eliza_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** - * ElizaService provides a way to talk to the ELIZA, which is a port of - * the DOCTOR script for Joseph Weizenbaum's original ELIZA program. - * Created in the mid-1960s at the MIT Artificial Intelligence Laboratory, - * ELIZA demonstrates the superficiality of human-computer communication. - * DOCTOR simulates a psychotherapist, and is commonly found as an Easter - * egg in emacs distributions. + * ElizaService provides a way to talk to Eliza, a port of the DOCTOR script + * for Joseph Weizenbaum's original ELIZA program. Created in the mid-1960s at + * the MIT Artificial Intelligence Laboratory, ELIZA demonstrates the + * superficiality of human-computer communication. DOCTOR simulates a + * psychotherapist, and is commonly found as an Easter egg in emacs + * distributions. * - * @generated from service buf.connect.demo.eliza.v1.ElizaService + * @generated from service connectrpc.eliza.v1.ElizaService */ export const ElizaService = { - typeName: "buf.connect.demo.eliza.v1.ElizaService", + typeName: "connectrpc.eliza.v1.ElizaService", methods: { /** - * Say is a unary request demo. This method should allow for a one sentence - * response given a one sentence request. + * Say is a unary RPC. Eliza responds to the prompt with a single sentence. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Say + * @generated from rpc connectrpc.eliza.v1.ElizaService.Say */ say: { name: "Say", @@ -45,10 +44,11 @@ export const ElizaService = { kind: MethodKind.Unary, }, /** - * Converse is a bi-directional streaming request demo. This method should allow for - * many requests and many responses. + * Converse is a bidirectional RPC. The caller may exchange multiple + * back-and-forth messages with Eliza over a long-lived connection. Eliza + * responds to each ConverseRequest with a ConverseResponse. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Converse + * @generated from rpc connectrpc.eliza.v1.ElizaService.Converse */ converse: { name: "Converse", @@ -57,10 +57,10 @@ export const ElizaService = { kind: MethodKind.BiDiStreaming, }, /** - * Introduce is a server-streaming request demo. This method allows for a single request that will return a series - * of responses + * Introduce is a server streaming RPC. Given the caller's name, Eliza + * returns a stream of sentences to introduce itself. * - * @generated from rpc buf.connect.demo.eliza.v1.ElizaService.Introduce + * @generated from rpc connectrpc.eliza.v1.ElizaService.Introduce */ introduce: { name: "Introduce", diff --git a/packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_pb.ts b/packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_pb.ts similarity index 85% rename from packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_pb.ts rename to packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_pb.ts index 11350bfd5..0ecd180ff 100644 --- a/packages/connect-web-test/src/gen/buf/connect/demo/eliza/v1/eliza_pb.ts +++ b/packages/connect-web-test/src/gen/connectrpc/eliza/v1/eliza_pb.ts @@ -13,16 +13,16 @@ // limitations under the License. // @generated by protoc-gen-es v1.3.0 with parameter "ts_nocheck=false,target=ts" -// @generated from file buf/connect/demo/eliza/v1/eliza.proto (package buf.connect.demo.eliza.v1, syntax proto3) +// @generated from file connectrpc/eliza/v1/eliza.proto (package connectrpc.eliza.v1, syntax proto3) /* eslint-disable */ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** - * SayRequest describes the sentence said to the ELIZA program. + * SayRequest is a single-sentence request. * - * @generated from message buf.connect.demo.eliza.v1.SayRequest + * @generated from message connectrpc.eliza.v1.SayRequest */ export class SayRequest extends Message { /** @@ -36,7 +36,7 @@ export class SayRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayRequest"; + static readonly typeName = "connectrpc.eliza.v1.SayRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -59,9 +59,9 @@ export class SayRequest extends Message { } /** - * SayResponse describes the sentence responded by the ELIZA program. + * SayResponse is a single-sentence response. * - * @generated from message buf.connect.demo.eliza.v1.SayResponse + * @generated from message connectrpc.eliza.v1.SayResponse */ export class SayResponse extends Message { /** @@ -75,7 +75,7 @@ export class SayResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.SayResponse"; + static readonly typeName = "connectrpc.eliza.v1.SayResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -98,9 +98,10 @@ export class SayResponse extends Message { } /** - * ConverseRequest describes the sentence said to the ELIZA program. + * ConverseRequest is a single sentence request sent as part of a + * back-and-forth conversation. * - * @generated from message buf.connect.demo.eliza.v1.ConverseRequest + * @generated from message connectrpc.eliza.v1.ConverseRequest */ export class ConverseRequest extends Message { /** @@ -114,7 +115,7 @@ export class ConverseRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseRequest"; + static readonly typeName = "connectrpc.eliza.v1.ConverseRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -137,9 +138,10 @@ export class ConverseRequest extends Message { } /** - * ConverseResponse describes the sentence responded by the ELIZA program. + * ConverseResponse is a single sentence response sent in answer to a + * ConverseRequest. * - * @generated from message buf.connect.demo.eliza.v1.ConverseResponse + * @generated from message connectrpc.eliza.v1.ConverseResponse */ export class ConverseResponse extends Message { /** @@ -153,7 +155,7 @@ export class ConverseResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.ConverseResponse"; + static readonly typeName = "connectrpc.eliza.v1.ConverseResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -176,9 +178,9 @@ export class ConverseResponse extends Message { } /** - * IntroduceRequest describes a request for details from the ELIZA program. + * IntroduceRequest asks Eliza to introduce itself to the named user. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceRequest + * @generated from message connectrpc.eliza.v1.IntroduceRequest */ export class IntroduceRequest extends Message { /** @@ -192,7 +194,7 @@ export class IntroduceRequest extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceRequest"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceRequest"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); @@ -215,9 +217,9 @@ export class IntroduceRequest extends Message { } /** - * IntroduceResponse describes the sentence responded by the ELIZA program. + * IntroduceResponse is one sentence of Eliza's introductory monologue. * - * @generated from message buf.connect.demo.eliza.v1.IntroduceResponse + * @generated from message connectrpc.eliza.v1.IntroduceResponse */ export class IntroduceResponse extends Message { /** @@ -231,7 +233,7 @@ export class IntroduceResponse extends Message { } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "buf.connect.demo.eliza.v1.IntroduceResponse"; + static readonly typeName = "connectrpc.eliza.v1.IntroduceResponse"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "sentence", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); From 00e4dcbe94a09bd404fc8851a6f1e33a60bcc133 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 15:58:45 -0400 Subject: [PATCH 4/6] Make --- packages/example/eliza.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/example/eliza.proto b/packages/example/eliza.proto index 4818da6a9..806ad8c6d 100644 --- a/packages/example/eliza.proto +++ b/packages/example/eliza.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Buf Technologies, Inc. +// Copyright 2021-2023 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 37d337320ed46a748873a37c32951fcb01aa75a1 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 16:06:56 -0400 Subject: [PATCH 5/6] Fix docs reference --- README.md | 8 ++++---- packages/connect-express/README.md | 2 +- packages/connect-fastify/README.md | 2 +- packages/connect-next/README.md | 2 +- packages/connect-node/README.md | 2 +- packages/connect-web/README.md | 2 +- packages/connect/README.md | 6 +++--- packages/connect/src/code.ts | 2 +- packages/connect/src/protocol-connect/end-stream.ts | 2 +- packages/connect/src/protocol-connect/error-json.ts | 2 +- packages/connect/src/protocol-connect/http-status.ts | 4 ++-- packages/connect/src/protocol/envelope.ts | 2 +- packages/connect/src/router.ts | 2 +- packages/example/README.md | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 784b08c8b..5a73e2a9c 100644 --- a/README.md +++ b/README.md @@ -39,14 +39,14 @@ Connect uses [Protobuf-ES](https://github.com/bufbuild/protobuf-es), the only [fully-compliant](https://buf.build/blog/protobuf-conformance) Protobuf JavaScript library. Connect implements RPC three protocols: The widely available gRPC and -gRPC-web protocols, and Connect's [own protocol](https://connect.build/docs/protocol/), +gRPC-web protocols, and Connect's [own protocol](https://connectrpc.com/docs/protocol/), optimized for the web. This gives you unparalleled interoperability across many platforms and languages, with type-safety end-to-end. ## Get started on the web -Follow our [10 minute tutorial](https://connect.build/docs/web/getting-started) where +Follow our [10 minute tutorial](https://connectrpc.com/docs/web/getting-started) where we use [Vite](https://vitejs.dev/) and [React](https://reactjs.org/) to create a web interface for ELIZA. @@ -59,11 +59,11 @@ and the [Encoding API](https://developer.mozilla.org/en-US/docs/Web/API/Encoding ## Get started on Node.js -Follow our [10 minute tutorial](https://connect.build/docs/node/getting-started) +Follow our [10 minute tutorial](https://connectrpc.com/docs/node/getting-started) to spin up a service in Node.js, and call it from the web, and from a gRPC client in your terminal. -You can serve your Connect RPCs with vanilla Node.js, or use our [server plugins](https://connect.build/docs/node/server-plugins) +You can serve your Connect RPCs with vanilla Node.js, or use our [server plugins](https://connectrpc.com/docs/node/server-plugins) for **Fastify**, **Next.js**, and **Express**. We support Node.js v16 and later with the builtin `http` and `http2` modules. diff --git a/packages/connect-express/README.md b/packages/connect-express/README.md index 824c52a16..904fa535c 100644 --- a/packages/connect-express/README.md +++ b/packages/connect-express/README.md @@ -77,5 +77,5 @@ and Express does not support the Node.js `http2` module. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +To get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-fastify/README.md b/packages/connect-fastify/README.md index 7bbd9a55a..6ccc01313 100644 --- a/packages/connect-fastify/README.md +++ b/packages/connect-fastify/README.md @@ -88,5 +88,5 @@ instead. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +To get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-next/README.md b/packages/connect-next/README.md index 27827e2d2..eb143a93d 100644 --- a/packages/connect-next/README.md +++ b/packages/connect-next/README.md @@ -93,5 +93,5 @@ to Vercel. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +To get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-node/README.md b/packages/connect-node/README.md index 901514871..2834cf0bc 100644 --- a/packages/connect-node/README.md +++ b/packages/connect-node/README.md @@ -140,5 +140,5 @@ instead. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +To get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). diff --git a/packages/connect-web/README.md b/packages/connect-web/README.md index f7efe5c9b..f255b506c 100644 --- a/packages/connect-web/README.md +++ b/packages/connect-web/README.md @@ -49,7 +49,7 @@ console.log(sentence) // you said: I feel happy. ## Getting started -To get started with Connect, head over to the [docs](https://connect.build/docs/node/getting-started) +To get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started) for a tutorial, or take a look at [our example](https://github.com/bufbuild/connect-es/tree/main/packages/example). Connect plays nice with Vue, Svelte, Remix, Next.js, Angular and many others. Take a look at diff --git a/packages/connect/README.md b/packages/connect/README.md index ab014f51e..ce64b612d 100644 --- a/packages/connect/README.md +++ b/packages/connect/README.md @@ -36,14 +36,14 @@ With Connect for ECMAScript, you can spin up a service in Node.js and call it from the web, the terminal, or native mobile clients. Under the hood, it uses [Protocol Buffers](https://github.com/bufbuild/protobuf-es) for the schema, and implements RPC (remote procedure calls) with three protocols: The widely available -gRPC and gRPC-web, and Connect's [own protocol](https://connect.build/docs/protocol/), +gRPC and gRPC-web, and Connect's [own protocol](https://connectrpc.com/docs/protocol/), optimized for the web. This gives you unparalleled interoperability with full-stack type-safety. ## Get started on the web -Follow our [10 minute tutorial](https://connect.build/docs/web/getting-started) where +Follow our [10 minute tutorial](https://connectrpc.com/docs/web/getting-started) where we use [Vite](https://vitejs.dev/) and [React](https://reactjs.org/) to create a web interface for ELIZA. @@ -56,7 +56,7 @@ and the [Encoding API](https://developer.mozilla.org/en-US/docs/Web/API/Encoding ## Get started on Node.js -Follow our [10 minute tutorial](https://connect.build/docs/node/getting-started) +Follow our [10 minute tutorial](https://connectrpc.com/docs/node/getting-started) to spin up a service in Node.js, and call it from the web, and from a gRPC client in your terminal. diff --git a/packages/connect/src/code.ts b/packages/connect/src/code.ts index a2fef624a..fe809e5da 100644 --- a/packages/connect/src/code.ts +++ b/packages/connect/src/code.ts @@ -18,7 +18,7 @@ * match gRPC. Only the codes below are valid — there are no user-defined * codes. * - * See the specification at https://connect.build/docs/protocol#error-codes + * See the specification at https://connectrpc.com/docs/protocol#error-codes * for details. */ export enum Code { diff --git a/packages/connect/src/protocol-connect/end-stream.ts b/packages/connect/src/protocol-connect/end-stream.ts index d1e8df9e2..e81fefc25 100644 --- a/packages/connect/src/protocol-connect/end-stream.ts +++ b/packages/connect/src/protocol-connect/end-stream.ts @@ -102,7 +102,7 @@ export function endStreamFromJson( * human-readable representation of error details if the detail uses * google.protobuf.Any. * - * See https://connect.build/docs/protocol#error-end-stream + * See https://connectrpc.com/docs/protocol#error-end-stream * * @private Internal code, does not follow semantic versioning. */ diff --git a/packages/connect/src/protocol-connect/error-json.ts b/packages/connect/src/protocol-connect/error-json.ts index e5dfe131d..40d834582 100644 --- a/packages/connect/src/protocol-connect/error-json.ts +++ b/packages/connect/src/protocol-connect/error-json.ts @@ -110,7 +110,7 @@ export function errorFromJsonBytes( * google.protobuf.Any. If serialization of the "debug" value fails, it * is silently disregarded. * - * See https://connect.build/docs/protocol#error-end-stream + * See https://connectrpc.com/docs/protocol#error-end-stream * * @private Internal code, does not follow semantic versioning. */ diff --git a/packages/connect/src/protocol-connect/http-status.ts b/packages/connect/src/protocol-connect/http-status.ts index 612795eca..5074b4f41 100644 --- a/packages/connect/src/protocol-connect/http-status.ts +++ b/packages/connect/src/protocol-connect/http-status.ts @@ -16,7 +16,7 @@ import { Code } from "../code.js"; /** * Determine the Connect error code for the given HTTP status code. - * See https://connect.build/docs/protocol#error-codes + * See https://connectrpc.com/docs/protocol#error-codes * * @private Internal code, does not follow semantic versioning. */ @@ -57,7 +57,7 @@ export function codeFromHttpStatus(httpStatus: number): Code { /** * Returns a HTTP status code for the given Connect code. - * See https://connect.build/docs/protocol#error-codes + * See https://connectrpc.com/docs/protocol#error-codes * * @private Internal code, does not follow semantic versioning. */ diff --git a/packages/connect/src/protocol/envelope.ts b/packages/connect/src/protocol/envelope.ts index 0454c41d4..94e3d2ed2 100644 --- a/packages/connect/src/protocol/envelope.ts +++ b/packages/connect/src/protocol/envelope.ts @@ -19,7 +19,7 @@ import type { Compression } from "./compression.js"; /** * Represents an Enveloped-Message of the Connect protocol. - * https://connect.build/docs/protocol#streaming-rpcs + * https://connectrpc.com/docs/protocol#streaming-rpcs * * @private Internal code, does not follow semantic versioning. */ diff --git a/packages/connect/src/router.ts b/packages/connect/src/router.ts index 6da5ef249..6fefead5c 100644 --- a/packages/connect/src/router.ts +++ b/packages/connect/src/router.ts @@ -99,7 +99,7 @@ export interface ConnectRouterOptions extends Partial { /** * Enable the Connect protocol and make your API available to all Connect - * clients, but also for a simple call with curl. See https://connect.build/ + * clients, but also for a simple call with curl. See https://connectrpc.com/ * * The protocol is enabled by default. Set this option to `false` to disable * it, but mind that at least one protocol must be enabled. diff --git a/packages/example/README.md b/packages/example/README.md index a12904e20..f9076f67e 100644 --- a/packages/example/README.md +++ b/packages/example/README.md @@ -110,7 +110,7 @@ protoc -I . eliza.proto \ ## More examples -To get started, head over to the [docs](https://connect.build/docs/web/getting-started) +To get started, head over to the [docs](https://connectrpc.com/docs/web/getting-started) for a tutorial. You will also find API documentation and best practices there. For using Connect with your favorite framework, take a look at [connect-es-integration](https://github.com/bufbuild/connect-es-integration). From 1f5a899fb3430b5d429d468b3a23b1cd742b9a95 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Tue, 1 Aug 2023 16:09:56 -0400 Subject: [PATCH 6/6] Gen --- packages/example/src/gen/eliza_connect.ts | 2 +- packages/example/src/gen/eliza_pb.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/example/src/gen/eliza_connect.ts b/packages/example/src/gen/eliza_connect.ts index 222b3b01d..4f2170bad 100644 --- a/packages/example/src/gen/eliza_connect.ts +++ b/packages/example/src/gen/eliza_connect.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Buf Technologies, Inc. +// Copyright 2021-2023 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/example/src/gen/eliza_pb.ts b/packages/example/src/gen/eliza_pb.ts index 01af4c74c..f0d78c934 100644 --- a/packages/example/src/gen/eliza_pb.ts +++ b/packages/example/src/gen/eliza_pb.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Buf Technologies, Inc. +// Copyright 2021-2023 Buf Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.