Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions example/grpc/build/proto/Example_grpc_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
// file: Example.proto

/* tslint:disable */
/* eslint-disable */

import * as grpc from "grpc";
import * as Example_pb from "./Example_pb";

interface IExampleService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
setMovies: IExampleService_ISetMovies;
getMovies: IExampleService_IGetMovies;
searchMoviesByCast: IExampleService_ISearchMoviesByCast;
}

interface IExampleService_ISetMovies extends grpc.MethodDefinition<Example_pb.EmptyRequest, Example_pb.MoviesResult> {
path: string; // "/io.xtech.example.Example/SetMovies"
interface IExampleService_IGetMovies extends grpc.MethodDefinition<Example_pb.EmptyRequest, Example_pb.MoviesResult> {
path: string; // "/io.xtech.example.Example/GetMovies"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<Example_pb.EmptyRequest>;
Expand All @@ -33,23 +34,23 @@ interface IExampleService_ISearchMoviesByCast extends grpc.MethodDefinition<Exam
export const ExampleService: IExampleService;

export interface IExampleServer {
setMovies: grpc.handleUnaryCall<Example_pb.EmptyRequest, Example_pb.MoviesResult>;
getMovies: grpc.handleUnaryCall<Example_pb.EmptyRequest, Example_pb.MoviesResult>;
searchMoviesByCast: grpc.handleServerStreamingCall<Example_pb.SearchByCastInput, Example_pb.Movie>;
}

export interface IExampleClient {
setMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
searchMoviesByCast(request: Example_pb.SearchByCastInput, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
searchMoviesByCast(request: Example_pb.SearchByCastInput, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
}

export class ExampleClient extends grpc.Client implements IExampleClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
public setMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public searchMoviesByCast(request: Example_pb.SearchByCastInput, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
public searchMoviesByCast(request: Example_pb.SearchByCastInput, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
}
18 changes: 11 additions & 7 deletions example/grpc/build/proto/Example_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function serialize_io_xtech_example_EmptyRequest(arg) {
if (!(arg instanceof Example_pb.EmptyRequest)) {
throw new Error('Expected argument of type io.xtech.example.EmptyRequest');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_EmptyRequest(buffer_arg) {
Expand All @@ -19,7 +19,7 @@ function serialize_io_xtech_example_Movie(arg) {
if (!(arg instanceof Example_pb.Movie)) {
throw new Error('Expected argument of type io.xtech.example.Movie');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_Movie(buffer_arg) {
Expand All @@ -30,7 +30,7 @@ function serialize_io_xtech_example_MoviesResult(arg) {
if (!(arg instanceof Example_pb.MoviesResult)) {
throw new Error('Expected argument of type io.xtech.example.MoviesResult');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_MoviesResult(buffer_arg) {
Expand All @@ -41,7 +41,7 @@ function serialize_io_xtech_example_SearchByCastInput(arg) {
if (!(arg instanceof Example_pb.SearchByCastInput)) {
throw new Error('Expected argument of type io.xtech.example.SearchByCastInput');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_SearchByCastInput(buffer_arg) {
Expand All @@ -50,8 +50,10 @@ function deserialize_io_xtech_example_SearchByCastInput(buffer_arg) {


var ExampleService = exports.ExampleService = {
setMovies: {
path: '/io.xtech.example.Example/SetMovies',
// *
// get all movies
getMovies: {
path: '/io.xtech.example.Example/GetMovies',
requestStream: false,
responseStream: false,
requestType: Example_pb.EmptyRequest,
Expand All @@ -61,7 +63,9 @@ var ExampleService = exports.ExampleService = {
responseSerialize: serialize_io_xtech_example_MoviesResult,
responseDeserialize: deserialize_io_xtech_example_MoviesResult,
},
searchMoviesByCast: {
// *
// search movies by the name of the cast
searchMoviesByCast: {
path: '/io.xtech.example.Example/SearchMoviesByCast',
requestStream: false,
responseStream: true,
Expand Down
1 change: 1 addition & 0 deletions example/grpc/build/proto/Example_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// file: Example.proto

/* tslint:disable */
/* eslint-disable */

import * as jspb from "google-protobuf";

Expand Down
22 changes: 11 additions & 11 deletions example/grpc/build/proto/Example_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ proto.io.xtech.example.Movie.prototype.getName = function() {

/** @param {string} value */
proto.io.xtech.example.Movie.prototype.setName = function(value) {
jspb.Message.setField(this, 1, value);
jspb.Message.setProto3StringField(this, 1, value);
};


Expand All @@ -211,7 +211,7 @@ proto.io.xtech.example.Movie.prototype.getYear = function() {

/** @param {number} value */
proto.io.xtech.example.Movie.prototype.setYear = function(value) {
jspb.Message.setField(this, 2, value);
jspb.Message.setProto3IntField(this, 2, value);
};


Expand All @@ -226,27 +226,27 @@ proto.io.xtech.example.Movie.prototype.getRating = function() {

/** @param {number} value */
proto.io.xtech.example.Movie.prototype.setRating = function(value) {
jspb.Message.setField(this, 3, value);
jspb.Message.setProto3FloatField(this, 3, value);
};


/**
* repeated string cast = 4;
* @return {!Array.<string>}
* @return {!Array<string>}
*/
proto.io.xtech.example.Movie.prototype.getCastList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 4));
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 4));
};


/** @param {!Array.<string>} value */
/** @param {!Array<string>} value */
proto.io.xtech.example.Movie.prototype.setCastList = function(value) {
jspb.Message.setField(this, 4, value || []);
};


/**
* @param {!string} value
* @param {string} value
* @param {number=} opt_index
*/
proto.io.xtech.example.Movie.prototype.addCast = function(value, opt_index) {
Expand Down Expand Up @@ -513,7 +513,7 @@ proto.io.xtech.example.SearchByCastInput.prototype.getCastname = function() {

/** @param {string} value */
proto.io.xtech.example.SearchByCastInput.prototype.setCastname = function(value) {
jspb.Message.setField(this, 1, value);
jspb.Message.setProto3StringField(this, 1, value);
};


Expand Down Expand Up @@ -656,15 +656,15 @@ proto.io.xtech.example.MoviesResult.serializeBinaryToWriter = function(message,

/**
* repeated Movie result = 1;
* @return {!Array.<!proto.io.xtech.example.Movie>}
* @return {!Array<!proto.io.xtech.example.Movie>}
*/
proto.io.xtech.example.MoviesResult.prototype.getResultList = function() {
return /** @type{!Array.<!proto.io.xtech.example.Movie>} */ (
return /** @type{!Array<!proto.io.xtech.example.Movie>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.io.xtech.example.Movie, 1));
};


/** @param {!Array.<!proto.io.xtech.example.Movie>} value */
/** @param {!Array<!proto.io.xtech.example.Movie>} value */
proto.io.xtech.example.MoviesResult.prototype.setResultList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 1, value);
};
Expand Down
2 changes: 1 addition & 1 deletion example/grpc/build/server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions example/grpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@
"license": "ISC",
"dependencies": {
"debug": "^4.1.1",
"google-protobuf": "^3.6.1",
"grpc": "^1.17.0"
"google-protobuf": "^3.11.4",
"grpc": "^1.24.2"
},
"devDependencies": {
"@types/debug": "^0.0.31",
"@types/google-protobuf": "^3.2.7",
"@types/node": "^10.12.18",
"grpc-tools": "^1.6.6",
"grpc_tools_node_protoc_ts": "^2.4.2",
"typescript": "^3.2.2"
"@types/google-protobuf": "^3.7.2",
"@types/node": "^13.9.1",
"grpc-tools": "^1.8.1",
"grpc_tools_node_protoc_ts": "^2.5.10",
"typescript": "^3.8.3"
},
"volta": {
"node": "12.16.1",
"yarn": "1.21.1"
}
}
21 changes: 11 additions & 10 deletions example/grpc/src/proto/Example_grpc_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
// file: Example.proto

/* tslint:disable */
/* eslint-disable */

import * as grpc from "grpc";
import * as Example_pb from "./Example_pb";

interface IExampleService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
setMovies: IExampleService_ISetMovies;
getMovies: IExampleService_IGetMovies;
searchMoviesByCast: IExampleService_ISearchMoviesByCast;
}

interface IExampleService_ISetMovies extends grpc.MethodDefinition<Example_pb.EmptyRequest, Example_pb.MoviesResult> {
path: string; // "/io.xtech.example.Example/SetMovies"
interface IExampleService_IGetMovies extends grpc.MethodDefinition<Example_pb.EmptyRequest, Example_pb.MoviesResult> {
path: string; // "/io.xtech.example.Example/GetMovies"
requestStream: boolean; // false
responseStream: boolean; // false
requestSerialize: grpc.serialize<Example_pb.EmptyRequest>;
Expand All @@ -33,23 +34,23 @@ interface IExampleService_ISearchMoviesByCast extends grpc.MethodDefinition<Exam
export const ExampleService: IExampleService;

export interface IExampleServer {
setMovies: grpc.handleUnaryCall<Example_pb.EmptyRequest, Example_pb.MoviesResult>;
getMovies: grpc.handleUnaryCall<Example_pb.EmptyRequest, Example_pb.MoviesResult>;
searchMoviesByCast: grpc.handleServerStreamingCall<Example_pb.SearchByCastInput, Example_pb.Movie>;
}

export interface IExampleClient {
setMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
searchMoviesByCast(request: Example_pb.SearchByCastInput, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
searchMoviesByCast(request: Example_pb.SearchByCastInput, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
}

export class ExampleClient extends grpc.Client implements IExampleClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
public setMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public setMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public getMovies(request: Example_pb.EmptyRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Example_pb.MoviesResult) => void): grpc.ClientUnaryCall;
public searchMoviesByCast(request: Example_pb.SearchByCastInput, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
public searchMoviesByCast(request: Example_pb.SearchByCastInput, metadata?: grpc.Metadata, options?: Partial<grpc.CallOptions>): grpc.ClientReadableStream<Example_pb.Movie>;
}
18 changes: 11 additions & 7 deletions example/grpc/src/proto/Example_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function serialize_io_xtech_example_EmptyRequest(arg) {
if (!(arg instanceof Example_pb.EmptyRequest)) {
throw new Error('Expected argument of type io.xtech.example.EmptyRequest');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_EmptyRequest(buffer_arg) {
Expand All @@ -19,7 +19,7 @@ function serialize_io_xtech_example_Movie(arg) {
if (!(arg instanceof Example_pb.Movie)) {
throw new Error('Expected argument of type io.xtech.example.Movie');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_Movie(buffer_arg) {
Expand All @@ -30,7 +30,7 @@ function serialize_io_xtech_example_MoviesResult(arg) {
if (!(arg instanceof Example_pb.MoviesResult)) {
throw new Error('Expected argument of type io.xtech.example.MoviesResult');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_MoviesResult(buffer_arg) {
Expand All @@ -41,7 +41,7 @@ function serialize_io_xtech_example_SearchByCastInput(arg) {
if (!(arg instanceof Example_pb.SearchByCastInput)) {
throw new Error('Expected argument of type io.xtech.example.SearchByCastInput');
}
return new Buffer(arg.serializeBinary());
return Buffer.from(arg.serializeBinary());
}

function deserialize_io_xtech_example_SearchByCastInput(buffer_arg) {
Expand All @@ -50,8 +50,10 @@ function deserialize_io_xtech_example_SearchByCastInput(buffer_arg) {


var ExampleService = exports.ExampleService = {
setMovies: {
path: '/io.xtech.example.Example/SetMovies',
// *
// get all movies
getMovies: {
path: '/io.xtech.example.Example/GetMovies',
requestStream: false,
responseStream: false,
requestType: Example_pb.EmptyRequest,
Expand All @@ -61,7 +63,9 @@ var ExampleService = exports.ExampleService = {
responseSerialize: serialize_io_xtech_example_MoviesResult,
responseDeserialize: deserialize_io_xtech_example_MoviesResult,
},
searchMoviesByCast: {
// *
// search movies by the name of the cast
searchMoviesByCast: {
path: '/io.xtech.example.Example/SearchMoviesByCast',
requestStream: false,
responseStream: true,
Expand Down
1 change: 1 addition & 0 deletions example/grpc/src/proto/Example_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// file: Example.proto

/* tslint:disable */
/* eslint-disable */

import * as jspb from "google-protobuf";

Expand Down
Loading