@dxos/websocket-rpc 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

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/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@dxos/websocket-rpc",
3
- "version": "0.8.4-main.ae835ea",
3
+ "version": "0.8.4-main.bc674ce",
4
4
  "description": "websocket-rpc",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "DXOS.org",
9
- "sideEffects": true,
13
+ "sideEffects": false,
10
14
  "type": "module",
11
15
  "exports": {
12
16
  ".": {
@@ -28,11 +32,11 @@
28
32
  "dependencies": {
29
33
  "isomorphic-ws": "^5.0.0",
30
34
  "ws": "^8.14.2",
31
- "@dxos/async": "0.8.4-main.ae835ea",
32
- "@dxos/log": "0.8.4-main.ae835ea",
33
- "@dxos/node-std": "0.8.4-main.ae835ea",
34
- "@dxos/rpc": "0.8.4-main.ae835ea",
35
- "@dxos/protocols": "0.8.4-main.ae835ea"
35
+ "@dxos/async": "0.8.4-main.bc674ce",
36
+ "@dxos/protocols": "0.8.4-main.bc674ce",
37
+ "@dxos/node-std": "0.8.4-main.bc674ce",
38
+ "@dxos/rpc": "0.8.4-main.bc674ce",
39
+ "@dxos/log": "0.8.4-main.bc674ce"
36
40
  },
37
41
  "devDependencies": {},
38
42
  "publishConfig": {
package/src/client.ts CHANGED
@@ -10,7 +10,7 @@ import { type ProtoRpcPeer, type ProtoRpcPeerOptions, createProtoRpcPeer } from
10
10
 
11
11
  import { WebSocketWithTokenAuth } from './token-auth';
12
12
 
13
- export type WebsocketRpcClientParams<C, S> = {
13
+ export type WebsocketRpcClientProps<C, S> = {
14
14
  url: string;
15
15
  authenticationToken?: string;
16
16
  } & Pick<ProtoRpcPeerOptions<C, S>, 'requested' | 'exposed' | 'handlers' | 'noHandshake'>;
@@ -24,7 +24,7 @@ export class WebsocketRpcClient<C, S> {
24
24
  readonly disconnected = new Event();
25
25
  readonly error = new Event<Error>();
26
26
 
27
- constructor(private readonly _params: WebsocketRpcClientParams<C, S>) {
27
+ constructor(private readonly _params: WebsocketRpcClientProps<C, S>) {
28
28
  this._rpc = createProtoRpcPeer({
29
29
  requested: this._params.requested,
30
30
  exposed: this._params.exposed,
package/src/server.ts CHANGED
@@ -19,14 +19,14 @@ export type ConnectionHandler<C, S> = {
19
19
  onClose?: (rpc: ProtoRpcPeer<C>) => Promise<void>;
20
20
  } & Pick<ProtoRpcPeerOptions<C, S>, 'requested' | 'exposed' | 'handlers'>;
21
21
 
22
- export type WebsocketRpcServerParams<C, S> = {
22
+ export type WebsocketRpcServerProps<C, S> = {
23
23
  onConnection: (info: ConnectionInfo) => Promise<ConnectionHandler<C, S>>;
24
24
  } & WebSocket.ServerOptions;
25
25
 
26
26
  export class WebsocketRpcServer<C, S> {
27
27
  private _server?: WebSocket.Server;
28
28
 
29
- constructor(private readonly _params: WebsocketRpcServerParams<C, S>) {}
29
+ constructor(private readonly _params: WebsocketRpcServerProps<C, S>) {}
30
30
  handleUpgrade(request: IncomingMessage, socket: Socket, head: Buffer): void {
31
31
  this._server?.handleUpgrade(request, socket, head, (ws: WebSocket) => {
32
32
  this._server?.emit('connection', ws, request);