mirror of https://github.com/grpc/grpc-node.git
gprc-js: Merge remote-tracking branch 'upstream/master' into patch/grpc-js-linting
This commit is contained in:
commit
873e6d411c
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@grpc/grpc-js",
|
"name": "@grpc/grpc-js",
|
||||||
"version": "0.7.7",
|
"version": "0.7.8",
|
||||||
"description": "gRPC Library for Node - pure JS implementation",
|
"description": "gRPC Library for Node - pure JS implementation",
|
||||||
"homepage": "https://grpc.io/",
|
"homepage": "https://grpc.io/",
|
||||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||||
|
|
|
@ -58,7 +58,7 @@ function getProxyInfo(): ProxyInfo {
|
||||||
try {
|
try {
|
||||||
proxyUrl = new URL(proxyEnv);
|
proxyUrl = new URL(proxyEnv);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(LogVerbosity.INFO, `cannot parse value of "${envVar}" env var`);
|
log(LogVerbosity.ERROR, `cannot parse value of "${envVar}" env var`);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
if (proxyUrl.protocol !== 'http:') {
|
if (proxyUrl.protocol !== 'http:') {
|
||||||
|
@ -167,7 +167,7 @@ export function getProxiedConnection(
|
||||||
request.once('connect', (res, socket, head) => {
|
request.once('connect', (res, socket, head) => {
|
||||||
request.removeAllListeners();
|
request.removeAllListeners();
|
||||||
socket.removeAllListeners();
|
socket.removeAllListeners();
|
||||||
if (res.statusCode === http.STATUS_CODES.OK) {
|
if (res.statusCode === 200) {
|
||||||
trace(
|
trace(
|
||||||
'Successfully connected to ' +
|
'Successfully connected to ' +
|
||||||
subchannelAddress +
|
subchannelAddress +
|
||||||
|
@ -176,7 +176,8 @@ export function getProxiedConnection(
|
||||||
);
|
);
|
||||||
resolve(socket);
|
resolve(socket);
|
||||||
} else {
|
} else {
|
||||||
trace(
|
log(
|
||||||
|
LogVerbosity.ERROR,
|
||||||
'Failed to connect to ' +
|
'Failed to connect to ' +
|
||||||
subchannelAddress +
|
subchannelAddress +
|
||||||
' through proxy ' +
|
' through proxy ' +
|
||||||
|
@ -187,7 +188,10 @@ export function getProxiedConnection(
|
||||||
});
|
});
|
||||||
request.once('error', (err) => {
|
request.once('error', (err) => {
|
||||||
request.removeAllListeners();
|
request.removeAllListeners();
|
||||||
trace('Failed to connect to proxy ' + PROXY_INFO.address);
|
log(
|
||||||
|
LogVerbosity.ERROR,
|
||||||
|
'Failed to connect to proxy ' + PROXY_INFO.address
|
||||||
|
);
|
||||||
reject();
|
reject();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -40,6 +40,7 @@ import {
|
||||||
Deserialize,
|
Deserialize,
|
||||||
loadPackageDefinition,
|
loadPackageDefinition,
|
||||||
makeClientConstructor,
|
makeClientConstructor,
|
||||||
|
MethodDefinition,
|
||||||
Serialize,
|
Serialize,
|
||||||
ServiceDefinition,
|
ServiceDefinition,
|
||||||
} from './make-client';
|
} from './make-client';
|
||||||
|
@ -235,6 +236,7 @@ export {
|
||||||
ClientWritableStream,
|
ClientWritableStream,
|
||||||
ClientDuplexStream,
|
ClientDuplexStream,
|
||||||
CallOptions,
|
CallOptions,
|
||||||
|
MethodDefinition,
|
||||||
StatusObject,
|
StatusObject,
|
||||||
ServiceError,
|
ServiceError,
|
||||||
ServerUnaryCall,
|
ServerUnaryCall,
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
import { ChannelCredentials } from './channel-credentials';
|
import { ChannelCredentials } from './channel-credentials';
|
||||||
import { ChannelOptions } from './channel-options';
|
import { ChannelOptions } from './channel-options';
|
||||||
import { Client } from './client';
|
import { Client } from './client';
|
||||||
|
import { UntypedServiceImplementation } from './server';
|
||||||
|
|
||||||
export interface Serialize<T> {
|
export interface Serialize<T> {
|
||||||
(value: T): Buffer;
|
(value: T): Buffer;
|
||||||
|
@ -49,10 +50,12 @@ export interface MethodDefinition<RequestType, ResponseType>
|
||||||
extends ClientMethodDefinition<RequestType, ResponseType>,
|
extends ClientMethodDefinition<RequestType, ResponseType>,
|
||||||
ServerMethodDefinition<RequestType, ResponseType> {}
|
ServerMethodDefinition<RequestType, ResponseType> {}
|
||||||
|
|
||||||
export interface ServiceDefinition {
|
export type ServiceDefinition<
|
||||||
|
ImplementationType = UntypedServiceImplementation
|
||||||
|
> = {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
[index: string]: MethodDefinition<any, any>;
|
readonly [index in keyof ImplementationType]: MethodDefinition<any, any>;
|
||||||
}
|
};
|
||||||
|
|
||||||
export interface ProtobufTypeDefinition {
|
export interface ProtobufTypeDefinition {
|
||||||
format: string;
|
format: string;
|
||||||
|
|
Loading…
Reference in New Issue