@nestjs/platform-ws 9.3.12 → 9.4.1

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/Readme.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
2
+ <a href="https://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
3
  </p>
4
4
 
5
5
  [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6
6
  [circleci-url]: https://circleci.com/gh/nestjs/nest
7
7
 
8
- <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
8
+ <p align="center">A progressive <a href="https://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11
11
  <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
@@ -132,7 +132,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
132
132
  <td align="center" valign="middle"><a href="https://klqc.de" target="_blank"><img src="https://nestjs.com/img/klcqcl-logo.png" width="120" valign="middle" /></a></td>
133
133
  <td align="center" valign="middle"><a href="https://thecasinowizard.com/bonuses/no-deposit-bonuses/" target="_blank"><img src="https://nestjs.com/img/casinowizard-logo.png" width="120" valign="middle" /></a></td></tr><tr>
134
134
  <td align="center" valign="middle"><a href="https://polygon-software.ch/" target="_blank"><img src="https://nestjs.com/img/polygon-logo.svg" width="120" valign="middle" /></a></td>
135
- <td align="center" valign="middle"><a href="https://mobilereality.pl/" target="_blank"><img src="https://nestjs.com/img/mobile-reality-logo.png" width="45" valign="middle" /></a></td>
135
+ <td align="center" valign="middle"><a href="https://themobilereality.com/" target="_blank"><img src="https://nestjs.com/img/mobile-reality-logo.png" width="45" valign="middle" /></a></td>
136
136
  <td align="center" valign="middle"><a href="https://boringowl.io/" target="_blank"><img src="https://nestjs.com/img/boringowl-logo.svg" width="120" valign="middle" /></a></td>
137
137
  <td align="center" valign="middle"><a href="https://www.mobilefactory.jp/" target="_blank"><img src="https://nestjs.com/img/mobilefactory-logo.png" width="100" valign="middle" /></a></td>
138
138
  <td align="center" valign="middle"><a href="https://nordbot.app/" target="_blank"><img src="https://nestjs.com/img/nordbot-logo.png" width="120" valign="middle" /></a></td>
@@ -16,6 +16,7 @@ export declare class WsAdapter extends AbstractWsAdapter {
16
16
  create(port: number, options?: Record<string, any> & {
17
17
  namespace?: string;
18
18
  server?: any;
19
+ path?: string;
19
20
  }): any;
20
21
  bindMessageHandlers(client: any, handlers: MessageMappingProperties[], transform: (data: any) => Observable<any>): void;
21
22
  bindMessageHandler(buffer: any, handlers: MessageMappingProperties[], transform: (data: any) => Observable<any>): Observable<any>;
@@ -31,7 +31,7 @@ class WsAdapter extends websockets_1.AbstractWsAdapter {
31
31
  wsPackage = (0, load_package_util_1.loadPackage)('ws', 'WsAdapter', () => require('ws'));
32
32
  }
33
33
  create(port, options) {
34
- const { server } = options, wsOptions = tslib_1.__rest(options, ["server"]);
34
+ const { server, path } = options, wsOptions = tslib_1.__rest(options, ["server", "path"]);
35
35
  if (wsOptions === null || wsOptions === void 0 ? void 0 : wsOptions.namespace) {
36
36
  const error = new Error('"WsAdapter" does not support namespaces. If you need namespaces in your project, consider using the "@nestjs/platform-socket.io" package instead.');
37
37
  this.logger.error(error);
@@ -40,23 +40,24 @@ class WsAdapter extends websockets_1.AbstractWsAdapter {
40
40
  if (port === UNDERLYING_HTTP_SERVER_PORT && this.httpServer) {
41
41
  this.ensureHttpServerExists(port, this.httpServer);
42
42
  const wsServer = this.bindErrorHandler(new wsPackage.Server(Object.assign({ noServer: true }, wsOptions)));
43
- this.addWsServerToRegistry(wsServer, port, options.path || '/');
43
+ this.addWsServerToRegistry(wsServer, port, path);
44
44
  return wsServer;
45
45
  }
46
46
  if (server) {
47
47
  return server;
48
48
  }
49
- if (options.path && port !== UNDERLYING_HTTP_SERVER_PORT) {
49
+ if (path && port !== UNDERLYING_HTTP_SERVER_PORT) {
50
50
  // Multiple servers with different paths
51
51
  // sharing a single HTTP/S server running on different port
52
52
  // than a regular HTTP application
53
53
  const httpServer = this.ensureHttpServerExists(port);
54
54
  httpServer === null || httpServer === void 0 ? void 0 : httpServer.listen(port);
55
55
  const wsServer = this.bindErrorHandler(new wsPackage.Server(Object.assign({ noServer: true }, wsOptions)));
56
- this.addWsServerToRegistry(wsServer, port, options.path);
56
+ this.addWsServerToRegistry(wsServer, port, path);
57
57
  return wsServer;
58
58
  }
59
- const wsServer = this.bindErrorHandler(new wsPackage.Server(Object.assign({ port }, wsOptions)));
59
+ const wsServer = this.bindErrorHandler(new wsPackage.Server(Object.assign({ port,
60
+ path }, wsOptions)));
60
61
  return wsServer;
61
62
  }
62
63
  bindMessageHandlers(client, handlers, transform) {
@@ -126,7 +127,7 @@ class WsAdapter extends websockets_1.AbstractWsAdapter {
126
127
  var _a;
127
128
  const entries = (_a = this.wsServersRegistry.get(port)) !== null && _a !== void 0 ? _a : [];
128
129
  entries.push(wsServer);
129
- wsServer.path = path;
130
+ wsServer.path = (0, shared_utils_1.normalizePath)(path);
130
131
  this.wsServersRegistry.set(port, entries);
131
132
  }
132
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-ws",
3
- "version": "9.3.12",
3
+ "version": "9.4.1",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-ws)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "https://github.com/nestjs/nest"
14
+ "url": "https://github.com/nestjs/nest.git",
15
+ "directory": "packages/platform-ws"
15
16
  },
16
17
  "publishConfig": {
17
18
  "access": "public"