@nmtjs/ws-client 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import type { Protocol, ProtocolBaseClientCallOptions, ProtocolBaseTransformer } from '@nmtjs/protocol/client';
1
2
  import { ClientMessageType } from '@nmtjs/protocol';
2
- import { type Protocol, type ProtocolBaseClientCallOptions, type ProtocolBaseTransformer, ProtocolTransport } from '@nmtjs/protocol/client';
3
+ import { ProtocolTransport } from '@nmtjs/protocol/client';
3
4
  export type WebSocketClientTransportOptions = {
4
5
  /**
5
6
  * The origin of the server
@@ -21,8 +22,7 @@ export declare class WebSocketClientTransport extends ProtocolTransport {
21
22
  constructor(protocol: Protocol, options: WebSocketClientTransportOptions);
22
23
  connect(auth: any, transformer: ProtocolBaseTransformer): Promise<void>;
23
24
  disconnect(): Promise<void>;
24
- call(namespace: string, procedure: string, payload: any, options: ProtocolBaseClientCallOptions, transformer: ProtocolBaseTransformer): Promise<import("@nmtjs/common").InteractivePromise<unknown> & {
25
- namespace: string;
25
+ call(procedure: string, payload: any, options: ProtocolBaseClientCallOptions, transformer: ProtocolBaseTransformer): Promise<import("@nmtjs/common").InteractivePromise<unknown> & {
26
26
  procedure: string;
27
27
  signal: AbortSignal;
28
28
  }>;
package/dist/index.js CHANGED
@@ -8,10 +8,7 @@ export class WebSocketClientTransport extends ProtocolTransport {
8
8
  constructor(protocol, options) {
9
9
  super();
10
10
  this.protocol = protocol;
11
- this.options = {
12
- debug: false,
13
- ...options,
14
- };
11
+ this.options = { debug: false, ...options };
15
12
  }
16
13
  connect(auth, transformer) {
17
14
  // this.auth = auth
@@ -56,8 +53,8 @@ export class WebSocketClientTransport extends ProtocolTransport {
56
53
  this.webSocket.close(1000, 'client');
57
54
  return _once(this.webSocket, 'close');
58
55
  }
59
- async call(namespace, procedure, payload, options, transformer) {
60
- const { call, buffer } = this.protocol.createRpc(namespace, procedure, payload, options, transformer);
56
+ async call(procedure, payload, options, transformer) {
57
+ const { call, buffer } = this.protocol.createRpc(procedure, payload, options, transformer);
61
58
  await this.send(ClientMessageType.Rpc, buffer);
62
59
  return call;
63
60
  }
package/package.json CHANGED
@@ -9,21 +9,21 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@nmtjs/client": "0.13.0",
13
- "@nmtjs/common": "0.13.0",
14
- "@nmtjs/protocol": "0.13.0"
12
+ "@nmtjs/client": "0.14.0",
13
+ "@nmtjs/protocol": "0.14.0",
14
+ "@nmtjs/common": "0.14.0"
15
15
  },
16
16
  "peerDependencies": {
17
- "@nmtjs/client": "0.13.0",
18
- "@nmtjs/common": "0.13.0",
19
- "@nmtjs/protocol": "0.13.0"
17
+ "@nmtjs/common": "0.14.0",
18
+ "@nmtjs/client": "0.14.0",
19
+ "@nmtjs/protocol": "0.14.0"
20
20
  },
21
21
  "files": [
22
22
  "dist",
23
23
  "LICENSE.md",
24
24
  "README.md"
25
25
  ],
26
- "version": "0.13.0",
26
+ "version": "0.14.0",
27
27
  "scripts": {
28
28
  "build": "tsc",
29
29
  "type-check": "tsc --noEmit"