diff --git a/package.json b/package.json index 47fa35f..c476640 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@overflow/rpc-js", - "version": "0.0.1", + "version": "0.0.4", "description": "TypeScript library setup for multiple compilation targets using tsc and webpack", "main": "./bundles/index.umd.js", "module": "./esm5/index.js", diff --git a/src/client/client.ts b/src/client/client.ts index 3c51333..beb24a4 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -70,6 +70,13 @@ export abstract class Client { this.clientRWC.disconnect(); } + /** + * connectionStatus + */ + public connectionStatus(): Observable | undefined { + return this.clientRWC.connectionStatus(); + } + /** * notify */ diff --git a/src/protocol/json/client.ts b/src/protocol/json/client.ts index 5f52fbb..ddc69d6 100644 --- a/src/protocol/json/client.ts +++ b/src/protocol/json/client.ts @@ -20,7 +20,7 @@ export class JSONClientCodec implements ClientCodec { jsonrpc: version, method, params: 0 === params.length ? null : params, - id, + id: undefined !== id && 0 < id ? id : undefined, }; return this.codecSelector.encode(JSON.stringify(req)); diff --git a/src/protocol/json/client_notification.ts b/src/protocol/json/client_notification.ts index 712704a..b833d1a 100644 --- a/src/protocol/json/client_notification.ts +++ b/src/protocol/json/client_notification.ts @@ -12,7 +12,7 @@ export class JSONClientNotificationCodec implements ClientNotificationCodec { public method(): string { return this.noti.method; } - public params(): any[] | undefined { + public params(): string[] | undefined { return this.noti.params; } } diff --git a/src/protocol/registry_codec.ts b/src/protocol/registry_codec.ts index 2de5c4a..70b2d2e 100644 --- a/src/protocol/registry_codec.ts +++ b/src/protocol/registry_codec.ts @@ -1,4 +1,4 @@ export interface RegistryCodec { method(): string; - params(): any | undefined; + params(): string[] | undefined; }