grpc-server-js
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -104,2 +104,4 @@ /// <reference types="node" /> | ||
export declare type ServiceError = StatusObject & Error; | ||
export declare type ServerStatusResponse = Partial<StatusObject>; | ||
export declare type ServerErrorResponse = ServerStatusResponse & Error; | ||
@@ -123,3 +125,3 @@ | ||
export declare type sendUnaryData<ResponseType> = | ||
(error: ServiceError | null, | ||
(error: ServerErrorResponse | ServerStatusResponse | null, | ||
value: ResponseType | null, | ||
@@ -147,6 +149,13 @@ trailer?: Metadata, | ||
export declare type UntypedHandleCall = HandleCall<any, any>; | ||
export interface UntypedServiceImplementation { | ||
[name: string]: UntypedHandleCall; | ||
} | ||
export declare class Server { | ||
constructor(options?: object); | ||
addProtoService(): void; | ||
addService(service: ServiceDefinition, implementation: object): void; | ||
addService(service: ServiceDefinition, | ||
implementation: UntypedServiceImplementation): void; | ||
bind(port: string, creds: ServerCredentials): Promise<void>; | ||
@@ -153,0 +162,0 @@ bindAsync(port: string, |
@@ -155,3 +155,3 @@ 'use strict'; | ||
if (error.hasOwnProperty('message')) { | ||
if ('message' in error) { | ||
status.details = error.message; | ||
@@ -162,6 +162,6 @@ } else { | ||
if (error.hasOwnProperty('code') && Number.isInteger(error.code)) { | ||
if ('code' in error && Number.isInteger(error.code)) { | ||
status.code = error.code; | ||
if (error.hasOwnProperty('details')) { | ||
if ('details' in error && typeof error.details === 'string') { | ||
status.details = error.details; | ||
@@ -173,3 +173,3 @@ } | ||
if (error.hasOwnProperty('metadata')) { | ||
if ('metadata' in error && error.metadata !== undefined) { | ||
status.metadata = error.metadata; | ||
@@ -176,0 +176,0 @@ } |
{ | ||
"name": "grpc-server-js", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Pure JavaScript gRPC Server", | ||
@@ -26,3 +26,3 @@ "author": "Colin J. Ihrig <cjihrig@gmail.com> (http://www.cjihrig.com/)", | ||
"dependencies": { | ||
"@grpc/grpc-js": "0.5.1" | ||
"@grpc/grpc-js": "0.5.3" | ||
}, | ||
@@ -33,3 +33,3 @@ "devDependencies": { | ||
"cb-barrier": "1.x.x", | ||
"@hapi/lab": "19.x.x" | ||
"@hapi/lab": "20.x.x" | ||
}, | ||
@@ -36,0 +36,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44301
1199
+ Added@grpc/grpc-js@0.5.3(transitive)
- Removed@grpc/grpc-js@0.5.1(transitive)
Updated@grpc/grpc-js@0.5.3