Comparing version 0.1.2 to 0.1.3
@@ -7,5 +7,5 @@ /** | ||
export declare type KnownKeys<T> = { | ||
[K in keyof T]: string extends K ? never : number extends K ? never : K; | ||
[K in keyof T]: string extends K ? never : K; | ||
} extends { | ||
[_ in keyof T]: infer U; | ||
} ? U : never; | ||
} ? U & string : never; |
{ | ||
"name": "nice-grpc", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A gRPC library that is nice to you", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"ts-jest": "^26.4.1", | ||
"typescript": "^4.0.3" | ||
"typescript": "~4.2.0" | ||
}, | ||
@@ -46,0 +46,0 @@ "dependencies": { |
@@ -160,2 +160,5 @@ # nice-grpc [![npm version][npm-image]][npm-url] | ||
See [gRPC docs](https://grpc.github.io/grpc/core/md_doc_statuscodes.html) for | ||
the correct usage of status codes. | ||
```ts | ||
@@ -480,3 +483,3 @@ import {status} from '@grpc/grpc-js'; | ||
if (authorization == null) { | ||
throw new ServiceError( | ||
throw new ServerError( | ||
grpc.status.UNAUTHENTICATED, | ||
@@ -490,3 +493,3 @@ 'Missing Authorization metadata', | ||
if (parts.length !== 2 || parts[0] !== 'Bearer') { | ||
throw new ServiceError( | ||
throw new ServerError( | ||
grpc.status.UNAUTHENTICATED, | ||
@@ -501,3 +504,3 @@ 'Invalid Authorization metadata format. Expected "Bearer <token>"', | ||
if (error instanceof JOSEError) { | ||
throw new ServiceError(grpc.status.UNAUTHENTICATED, error.message); | ||
throw new ServerError(grpc.status.UNAUTHENTICATED, error.message); | ||
} else { | ||
@@ -504,0 +507,0 @@ throw error; |
@@ -7,3 +7,5 @@ /** | ||
export type KnownKeys<T> = { | ||
[K in keyof T]: string extends K ? never : number extends K ? never : K | ||
} extends { [_ in keyof T]: infer U } ? U : never; | ||
[K in keyof T]: string extends K ? never : K; | ||
} extends {[_ in keyof T]: infer U} | ||
? U & string | ||
: never; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
161089
2886
883