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