gRPC client streaming typescript not created.
See original GitHub issueMinimal protobuf example:
syntax = "proto3";
package filestream;
service FileService {
rpc FileUploadCommand(stream FileUploadCommandRequest)
returns (FileUploadCommandResponse) {}
rpc FileDownloadCommand(FileDownloadCommandRequest)
returns (stream FileDownloadCommandResponse) {}
}
enum FileCommand {
FILE_UPLOAD = 0;
FILE_DOWNLOAD = 1;
}
message FileContent {
string filename = 1;
bytes filecontent = 2;
}
message FileUploadCommandRequest { FileContent filecontent = 1; }
message FileUploadCommandResponse {
string filename = 1;
int64 filesize = 2;
}
message FileDownloadCommandRequest { string filename = 1; }
message FileDownloadCommandResponse { FileContent filecontent = 1; }
gRPC version: 1.48.1
protoc --version
libprotoc 3.19.4
protoc-gen-grpc-web version: 1.3.1-linux-x86_64
Command:
protoc -I=$DIR file.proto \
--js_out=import_style=commonjs:$OUT_DIR \
--grpc-web_out=import_style=typescript,mode=grpcwebtext:$OUT_DIR
Output:
/**
* @fileoverview gRPC-Web generated client stub for filestream
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
import * as grpcWeb from 'grpc-web';
import * as file_pb from './file_pb';
export class FileServiceClient {
client_: grpcWeb.AbstractClientBase;
hostname_: string;
credentials_: null | { [index: string]: string; };
options_: null | { [index: string]: any; };
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: any; }) {
if (!options) options = {};
if (!credentials) credentials = {};
options['format'] = 'text';
this.client_ = new grpcWeb.GrpcWebClientBase(options);
this.hostname_ = hostname;
this.credentials_ = credentials;
this.options_ = options;
}
methodDescriptorFileDownloadCommand = new grpcWeb.MethodDescriptor(
'/filestream.FileService/FileDownloadCommand',
grpcWeb.MethodType.SERVER_STREAMING,
file_pb.FileDownloadCommandRequest,
file_pb.FileDownloadCommandResponse,
(request: file_pb.FileDownloadCommandRequest) => {
return request.serializeBinary();
},
file_pb.FileDownloadCommandResponse.deserializeBinary
);
fileDownloadCommand(
request: file_pb.FileDownloadCommandRequest,
metadata?: grpcWeb.Metadata): grpcWeb.ClientReadableStream<file_pb.FileDownloadCommandResponse> {
return this.client_.serverStreaming(
this.hostname_ +
'/filestream.FileService/FileDownloadCommand',
request,
metadata || {},
this.methodDescriptorFileDownloadCommand);
}
}
Expectations: expected fileUploadCommand to be generated.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
How to implement a gRPC client and server in TypeScript
How to achieve the perfect TypeScript + gRPC server and client ... First, we'll create our service definition in proto/songs.proto .
Read more >Use gRPC with Node.js and Typescript - DEV Community
And in this article, I am going to teach you how you can use gRPC to create high-performance RPC apps using node.js and...
Read more >Implementing a gRPC client and server in Typescript with Node
TypeScript brings many benefits to JavaScript. In this video, we will look at using gRPC to generate TypeScript files for interacting with a ......
Read more >Creating your gRPC w/ Protobuf Server in Node/Typescript ...
Hello viewers!Welcome back to my channel! In part 2 we are going to be creating our client which will be communicating with our...
Read more >Basics tutorial | Node - gRPC
The client reads from the returned stream until there are no more messages. ... First let's look at how we create a RouteGuide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @kkuehl , I think that the client streaming is still not supported.
Look also: a ticket about the same topic and the roadmap.
Feel free to close ticket.