@nestjs/websockets 11.1.16 → 12.0.0-alpha.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/adapters/index.d.ts +1 -1
- package/adapters/index.js +1 -4
- package/adapters/ws-adapter.d.ts +2 -2
- package/adapters/ws-adapter.js +10 -12
- package/constants.js +13 -16
- package/context/exception-filters-context.d.ts +3 -3
- package/context/exception-filters-context.js +7 -12
- package/context/ws-context-creator.d.ts +7 -16
- package/context/ws-context-creator.js +38 -30
- package/context/ws-metadata-constants.js +5 -8
- package/context/ws-proxy.d.ts +1 -1
- package/context/ws-proxy.js +8 -12
- package/decorators/ack.decorator.js +4 -7
- package/decorators/connected-socket.decorator.js +3 -6
- package/decorators/gateway-server.decorator.js +3 -7
- package/decorators/index.d.ts +6 -6
- package/decorators/index.js +6 -9
- package/decorators/message-body.decorator.d.ts +27 -1
- package/decorators/message-body.decorator.js +4 -7
- package/decorators/socket-gateway.decorator.d.ts +1 -1
- package/decorators/socket-gateway.decorator.js +5 -8
- package/decorators/subscribe-message.decorator.js +4 -8
- package/enums/ws-paramtype.enum.js +2 -5
- package/errors/index.d.ts +1 -1
- package/errors/index.js +1 -4
- package/errors/invalid-socket-port.exception.d.ts +1 -1
- package/errors/invalid-socket-port.exception.js +2 -6
- package/errors/ws-exception.js +6 -9
- package/exceptions/base-ws-exception-filter.d.ts +1 -1
- package/exceptions/base-ws-exception-filter.js +12 -15
- package/exceptions/index.d.ts +1 -1
- package/exceptions/index.js +1 -4
- package/exceptions/ws-exceptions-handler.d.ts +4 -4
- package/exceptions/ws-exceptions-handler.js +8 -16
- package/factories/server-and-event-streams-factory.d.ts +1 -1
- package/factories/server-and-event-streams-factory.js +5 -9
- package/factories/ws-params-factory.js +7 -11
- package/gateway-metadata-explorer.d.ts +2 -2
- package/gateway-metadata-explorer.js +15 -18
- package/index.d.ts +6 -6
- package/index.js +6 -9
- package/interfaces/gateway-metadata.interface.d.ts +1 -1
- package/interfaces/gateway-metadata.interface.js +1 -2
- package/interfaces/hooks/index.d.ts +3 -3
- package/interfaces/hooks/index.js +3 -6
- package/interfaces/hooks/on-gateway-connection.interface.js +1 -2
- package/interfaces/hooks/on-gateway-disconnect.interface.d.ts +1 -1
- package/interfaces/hooks/on-gateway-disconnect.interface.js +1 -2
- package/interfaces/hooks/on-gateway-init.interface.js +1 -2
- package/interfaces/index.d.ts +5 -5
- package/interfaces/index.js +5 -8
- package/interfaces/nest-gateway.interface.d.ts +1 -1
- package/interfaces/nest-gateway.interface.js +1 -2
- package/interfaces/server-and-event-streams-host.interface.js +1 -2
- package/interfaces/web-socket-server.interface.js +1 -2
- package/interfaces/websockets-entrypoint-metadata.interface.js +1 -2
- package/interfaces/ws-response.interface.js +1 -2
- package/internal.d.ts +8 -0
- package/internal.js +8 -0
- package/package.json +18 -4
- package/socket-module.d.ts +5 -8
- package/socket-module.js +26 -33
- package/socket-server-provider.d.ts +4 -4
- package/socket-server-provider.js +9 -11
- package/sockets-container.d.ts +1 -1
- package/sockets-container.js +3 -9
- package/tsconfig.build.json +1 -7
- package/utils/compare-element.util.js +1 -4
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -4
- package/utils/param.utils.d.ts +3 -3
- package/utils/param.utils.js +40 -17
- package/web-sockets-controller.d.ts +9 -10
- package/web-sockets-controller.js +41 -28
package/errors/ws-exception.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
|
-
class WsException extends Error {
|
|
1
|
+
import { isObject, isString } from '@nestjs/common/internal';
|
|
2
|
+
export class WsException extends Error {
|
|
3
|
+
error;
|
|
6
4
|
constructor(error) {
|
|
7
5
|
super();
|
|
8
6
|
this.error = error;
|
|
9
7
|
this.initMessage();
|
|
10
8
|
}
|
|
11
9
|
initMessage() {
|
|
12
|
-
if (
|
|
10
|
+
if (isString(this.error)) {
|
|
13
11
|
this.message = this.error;
|
|
14
12
|
}
|
|
15
|
-
else if (
|
|
16
|
-
|
|
13
|
+
else if (isObject(this.error) &&
|
|
14
|
+
isString(this.error.message)) {
|
|
17
15
|
this.message = this.error.message;
|
|
18
16
|
}
|
|
19
17
|
else if (this.constructor) {
|
|
@@ -26,4 +24,3 @@ class WsException extends Error {
|
|
|
26
24
|
return this.error;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
exports.WsException = WsException;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
6
|
-
const constants_1 = require("@nestjs/core/constants");
|
|
7
|
-
const ws_exception_1 = require("../errors/ws-exception");
|
|
1
|
+
import { IntrinsicException, Logger, } from '@nestjs/common';
|
|
2
|
+
import { WsException } from '../errors/ws-exception.js';
|
|
3
|
+
import { isObject } from '@nestjs/common/internal';
|
|
4
|
+
import { MESSAGES } from '@nestjs/core/internal';
|
|
8
5
|
/**
|
|
9
6
|
* @publicApi
|
|
10
7
|
*/
|
|
11
|
-
class BaseWsExceptionFilter {
|
|
8
|
+
export class BaseWsExceptionFilter {
|
|
9
|
+
options;
|
|
10
|
+
static logger = new Logger('WsExceptionsHandler');
|
|
12
11
|
constructor(options = {}) {
|
|
13
12
|
this.options = options;
|
|
14
13
|
this.options.includeCause = this.options.includeCause ?? true;
|
|
@@ -25,12 +24,12 @@ class BaseWsExceptionFilter {
|
|
|
25
24
|
});
|
|
26
25
|
}
|
|
27
26
|
handleError(client, exception, cause) {
|
|
28
|
-
if (!(exception instanceof
|
|
27
|
+
if (!(exception instanceof WsException)) {
|
|
29
28
|
return this.handleUnknownError(exception, client, cause);
|
|
30
29
|
}
|
|
31
30
|
const status = 'error';
|
|
32
31
|
const result = exception.getError();
|
|
33
|
-
if (
|
|
32
|
+
if (isObject(result)) {
|
|
34
33
|
return client.emit('exception', result);
|
|
35
34
|
}
|
|
36
35
|
const payload = {
|
|
@@ -46,20 +45,18 @@ class BaseWsExceptionFilter {
|
|
|
46
45
|
const status = 'error';
|
|
47
46
|
const payload = {
|
|
48
47
|
status,
|
|
49
|
-
message:
|
|
48
|
+
message: MESSAGES.UNKNOWN_EXCEPTION_MESSAGE,
|
|
50
49
|
};
|
|
51
50
|
if (this.options?.includeCause && data) {
|
|
52
51
|
payload.cause = this.options.causeFactory(data.pattern, data.data);
|
|
53
52
|
}
|
|
54
53
|
client.emit('exception', payload);
|
|
55
|
-
if (!(exception instanceof
|
|
54
|
+
if (!(exception instanceof IntrinsicException)) {
|
|
56
55
|
const logger = BaseWsExceptionFilter.logger;
|
|
57
56
|
logger.error(exception);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
isExceptionObject(err) {
|
|
61
|
-
return
|
|
60
|
+
return isObject(err) && !!err.message;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
exports.BaseWsExceptionFilter = BaseWsExceptionFilter;
|
|
65
|
-
BaseWsExceptionFilter.logger = new common_1.Logger('WsExceptionsHandler');
|
package/exceptions/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './base-ws-exception-filter';
|
|
1
|
+
export * from './base-ws-exception-filter.js';
|
package/exceptions/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ArgumentsHost } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ArgumentsHost } from '@nestjs/common';
|
|
2
|
+
import { WsException } from '../errors/ws-exception.js';
|
|
3
|
+
import { BaseWsExceptionFilter } from './base-ws-exception-filter.js';
|
|
4
|
+
import { type ExceptionFilterMetadata } from '@nestjs/common/internal';
|
|
5
5
|
/**
|
|
6
6
|
* @publicApi
|
|
7
7
|
*/
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const select_exception_filter_metadata_util_1 = require("@nestjs/common/utils/select-exception-filter-metadata.util");
|
|
5
|
-
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
6
|
-
const invalid_exception_filter_exception_1 = require("@nestjs/core/errors/exceptions/invalid-exception-filter.exception");
|
|
7
|
-
const base_ws_exception_filter_1 = require("./base-ws-exception-filter");
|
|
1
|
+
import { BaseWsExceptionFilter } from './base-ws-exception-filter.js';
|
|
2
|
+
import { selectExceptionFilterMetadata, isEmptyArray, } from '@nestjs/common/internal';
|
|
3
|
+
import { InvalidExceptionFilterException } from '@nestjs/core/internal';
|
|
8
4
|
/**
|
|
9
5
|
* @publicApi
|
|
10
6
|
*/
|
|
11
|
-
class WsExceptionsHandler extends
|
|
12
|
-
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.filters = [];
|
|
15
|
-
}
|
|
7
|
+
export class WsExceptionsHandler extends BaseWsExceptionFilter {
|
|
8
|
+
filters = [];
|
|
16
9
|
handle(exception, host) {
|
|
17
10
|
const client = host.switchToWs().getClient();
|
|
18
11
|
if (this.invokeCustomFilters(exception, host) || !client.emit) {
|
|
@@ -22,16 +15,15 @@ class WsExceptionsHandler extends base_ws_exception_filter_1.BaseWsExceptionFilt
|
|
|
22
15
|
}
|
|
23
16
|
setCustomFilters(filters) {
|
|
24
17
|
if (!Array.isArray(filters)) {
|
|
25
|
-
throw new
|
|
18
|
+
throw new InvalidExceptionFilterException();
|
|
26
19
|
}
|
|
27
20
|
this.filters = filters;
|
|
28
21
|
}
|
|
29
22
|
invokeCustomFilters(exception, args) {
|
|
30
|
-
if ((
|
|
23
|
+
if (isEmptyArray(this.filters))
|
|
31
24
|
return false;
|
|
32
|
-
const filter =
|
|
25
|
+
const filter = selectExceptionFilterMetadata(this.filters, exception);
|
|
33
26
|
filter && filter.func(exception, args);
|
|
34
27
|
return !!filter;
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
|
-
exports.WsExceptionsHandler = WsExceptionsHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServerAndEventStreamsHost } from '../interfaces/server-and-event-streams-host.interface';
|
|
1
|
+
import { ServerAndEventStreamsHost } from '../interfaces/server-and-event-streams-host.interface.js';
|
|
2
2
|
export declare class ServerAndEventStreamsFactory {
|
|
3
3
|
static create<T = any>(server: T): ServerAndEventStreamsHost<T>;
|
|
4
4
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ServerAndEventStreamsFactory = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
class ServerAndEventStreamsFactory {
|
|
1
|
+
import { ReplaySubject, Subject } from 'rxjs';
|
|
2
|
+
export class ServerAndEventStreamsFactory {
|
|
6
3
|
static create(server) {
|
|
7
|
-
const init = new
|
|
4
|
+
const init = new ReplaySubject();
|
|
8
5
|
init.next(server);
|
|
9
|
-
const connection = new
|
|
10
|
-
const disconnect = new
|
|
6
|
+
const connection = new Subject();
|
|
7
|
+
const disconnect = new Subject();
|
|
11
8
|
return {
|
|
12
9
|
init,
|
|
13
10
|
connection,
|
|
@@ -16,4 +13,3 @@ class ServerAndEventStreamsFactory {
|
|
|
16
13
|
};
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.ServerAndEventStreamsFactory = ServerAndEventStreamsFactory;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
|
-
const ws_paramtype_enum_1 = require("../enums/ws-paramtype.enum");
|
|
6
|
-
class WsParamsFactory {
|
|
1
|
+
import { WsParamtype } from '../enums/ws-paramtype.enum.js';
|
|
2
|
+
import { isFunction } from '@nestjs/common/internal';
|
|
3
|
+
export class WsParamsFactory {
|
|
7
4
|
exchangeKeyForValue(type, data, args) {
|
|
8
5
|
if (!args) {
|
|
9
6
|
return null;
|
|
10
7
|
}
|
|
11
8
|
switch (type) {
|
|
12
|
-
case
|
|
9
|
+
case WsParamtype.SOCKET:
|
|
13
10
|
return args[0];
|
|
14
|
-
case
|
|
11
|
+
case WsParamtype.PAYLOAD:
|
|
15
12
|
return data ? args[1]?.[data] : args[1];
|
|
16
|
-
case
|
|
17
|
-
return args.find(arg =>
|
|
13
|
+
case WsParamtype.ACK: {
|
|
14
|
+
return args.find(arg => isFunction(arg));
|
|
18
15
|
}
|
|
19
16
|
default:
|
|
20
17
|
return null;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
|
-
exports.WsParamsFactory = WsParamsFactory;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MetadataScanner } from '@nestjs/core/metadata-scanner';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { NestGateway } from './interfaces/nest-gateway.interface';
|
|
2
|
+
import { NestGateway } from './interfaces/nest-gateway.interface.js';
|
|
3
|
+
import type { MetadataScanner } from '@nestjs/core';
|
|
4
4
|
export interface MessageMappingProperties {
|
|
5
5
|
message: any;
|
|
6
6
|
methodName: string;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class GatewayMetadataExplorer {
|
|
1
|
+
import { GATEWAY_SERVER_METADATA, MESSAGE_MAPPING_METADATA, MESSAGE_METADATA, PARAM_ARGS_METADATA, } from './constants.js';
|
|
2
|
+
import { WsParamtype } from './enums/ws-paramtype.enum.js';
|
|
3
|
+
import { isFunction, isUndefined } from '@nestjs/common/internal';
|
|
4
|
+
import { ContextUtils } from '@nestjs/core/internal';
|
|
5
|
+
export class GatewayMetadataExplorer {
|
|
6
|
+
metadataScanner;
|
|
7
|
+
contextUtils = new ContextUtils();
|
|
9
8
|
constructor(metadataScanner) {
|
|
10
9
|
this.metadataScanner = metadataScanner;
|
|
11
|
-
this.contextUtils = new context_utils_1.ContextUtils();
|
|
12
10
|
}
|
|
13
11
|
explore(instance) {
|
|
14
12
|
const instancePrototype = Object.getPrototypeOf(instance);
|
|
@@ -19,11 +17,11 @@ class GatewayMetadataExplorer {
|
|
|
19
17
|
}
|
|
20
18
|
exploreMethodMetadata(instancePrototype, methodName) {
|
|
21
19
|
const callback = instancePrototype[methodName];
|
|
22
|
-
const isMessageMapping = Reflect.getMetadata(
|
|
23
|
-
if (
|
|
20
|
+
const isMessageMapping = Reflect.getMetadata(MESSAGE_MAPPING_METADATA, callback);
|
|
21
|
+
if (isUndefined(isMessageMapping)) {
|
|
24
22
|
return null;
|
|
25
23
|
}
|
|
26
|
-
const message = Reflect.getMetadata(
|
|
24
|
+
const message = Reflect.getMetadata(MESSAGE_METADATA, callback);
|
|
27
25
|
const isAckHandledManually = this.hasAckDecorator(instancePrototype, methodName);
|
|
28
26
|
return {
|
|
29
27
|
callback,
|
|
@@ -33,27 +31,26 @@ class GatewayMetadataExplorer {
|
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
33
|
hasAckDecorator(instancePrototype, methodName) {
|
|
36
|
-
const paramsMetadata = Reflect.getMetadata(
|
|
34
|
+
const paramsMetadata = Reflect.getMetadata(PARAM_ARGS_METADATA, instancePrototype.constructor, methodName);
|
|
37
35
|
if (!paramsMetadata) {
|
|
38
36
|
return false;
|
|
39
37
|
}
|
|
40
38
|
const metadataKeys = Object.keys(paramsMetadata);
|
|
41
39
|
return metadataKeys.some(key => {
|
|
42
40
|
const type = this.contextUtils.mapParamType(key);
|
|
43
|
-
return Number(type) ===
|
|
41
|
+
return Number(type) === WsParamtype.ACK;
|
|
44
42
|
});
|
|
45
43
|
}
|
|
46
44
|
*scanForServerHooks(instance) {
|
|
47
45
|
for (const propertyKey in instance) {
|
|
48
|
-
if (
|
|
46
|
+
if (isFunction(propertyKey)) {
|
|
49
47
|
continue;
|
|
50
48
|
}
|
|
51
49
|
const property = String(propertyKey);
|
|
52
|
-
const isServer = Reflect.getMetadata(
|
|
53
|
-
if (!
|
|
50
|
+
const isServer = Reflect.getMetadata(GATEWAY_SERVER_METADATA, instance, property);
|
|
51
|
+
if (!isUndefined(isServer)) {
|
|
54
52
|
yield property;
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
|
-
exports.GatewayMetadataExplorer = GatewayMetadataExplorer;
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
export * from './adapters';
|
|
3
|
-
export * from './decorators';
|
|
4
|
-
export * from './errors';
|
|
5
|
-
export * from './exceptions';
|
|
6
|
-
export { MessageMappingProperties } from './gateway-metadata-explorer';
|
|
7
|
-
export * from './interfaces';
|
|
2
|
+
export * from './adapters/index.js';
|
|
3
|
+
export * from './decorators/index.js';
|
|
4
|
+
export * from './errors/index.js';
|
|
5
|
+
export * from './exceptions/index.js';
|
|
6
|
+
export { MessageMappingProperties } from './gateway-metadata-explorer.js';
|
|
7
|
+
export * from './interfaces/index.js';
|
package/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
1
|
/*
|
|
5
2
|
* Nest @websockets
|
|
6
3
|
* Copyright(c) 2017 - 2025 Kamil Mysliwiec
|
|
7
4
|
* https://nestjs.com
|
|
8
5
|
* MIT Licensed
|
|
9
6
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
export * from './adapters/index.js';
|
|
9
|
+
export * from './decorators/index.js';
|
|
10
|
+
export * from './errors/index.js';
|
|
11
|
+
export * from './exceptions/index.js';
|
|
12
|
+
export * from './interfaces/index.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './on-gateway-connection.interface';
|
|
2
|
-
export * from './on-gateway-disconnect.interface';
|
|
3
|
-
export * from './on-gateway-init.interface';
|
|
1
|
+
export * from './on-gateway-connection.interface.js';
|
|
2
|
+
export * from './on-gateway-disconnect.interface.js';
|
|
3
|
+
export * from './on-gateway-init.interface.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./on-gateway-connection.interface"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./on-gateway-disconnect.interface"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./on-gateway-init.interface"), exports);
|
|
1
|
+
export * from './on-gateway-connection.interface.js';
|
|
2
|
+
export * from './on-gateway-disconnect.interface.js';
|
|
3
|
+
export * from './on-gateway-init.interface.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/interfaces/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './gateway-metadata.interface';
|
|
2
|
-
export * from './hooks';
|
|
3
|
-
export * from './server-and-event-streams-host.interface';
|
|
4
|
-
export * from './web-socket-server.interface';
|
|
5
|
-
export * from './ws-response.interface';
|
|
1
|
+
export * from './gateway-metadata.interface.js';
|
|
2
|
+
export * from './hooks/index.js';
|
|
3
|
+
export * from './server-and-event-streams-host.interface.js';
|
|
4
|
+
export * from './web-socket-server.interface.js';
|
|
5
|
+
export * from './ws-response.interface.js';
|
package/interfaces/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tslib_1.__exportStar(require("./server-and-event-streams-host.interface"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./web-socket-server.interface"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./ws-response.interface"), exports);
|
|
1
|
+
export * from './gateway-metadata.interface.js';
|
|
2
|
+
export * from './hooks/index.js';
|
|
3
|
+
export * from './server-and-event-streams-host.interface.js';
|
|
4
|
+
export * from './web-socket-server.interface.js';
|
|
5
|
+
export * from './ws-response.interface.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/internal.d.ts
ADDED
package/internal.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/websockets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0-alpha.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./index.js",
|
|
11
|
+
"./*.js": "./*.js",
|
|
12
|
+
"./*": "./*.js",
|
|
13
|
+
"./adapters": "./adapters/index.js",
|
|
14
|
+
"./decorators": "./decorators/index.js",
|
|
15
|
+
"./errors": "./errors/index.js",
|
|
16
|
+
"./exceptions": "./exceptions/index.js",
|
|
17
|
+
"./interfaces": "./interfaces/index.js",
|
|
18
|
+
"./interfaces/hooks": "./interfaces/hooks/index.js",
|
|
19
|
+
"./utils": "./utils/index.js"
|
|
20
|
+
},
|
|
7
21
|
"repository": {
|
|
8
22
|
"type": "git",
|
|
9
23
|
"url": "https://github.com/nestjs/nest.git",
|
|
@@ -18,8 +32,8 @@
|
|
|
18
32
|
"tslib": "2.8.1"
|
|
19
33
|
},
|
|
20
34
|
"devDependencies": {
|
|
21
|
-
"@nestjs/common": "
|
|
22
|
-
"@nestjs/core": "
|
|
35
|
+
"@nestjs/common": "^12.0.0-alpha.0",
|
|
36
|
+
"@nestjs/core": "^12.0.0-alpha.0"
|
|
23
37
|
},
|
|
24
38
|
"peerDependencies": {
|
|
25
39
|
"@nestjs/common": "^11.0.0",
|
|
@@ -33,5 +47,5 @@
|
|
|
33
47
|
"optional": true
|
|
34
48
|
}
|
|
35
49
|
},
|
|
36
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "7035ecc828a2a9f752aad188871b1171663a20c2"
|
|
37
51
|
}
|
package/socket-module.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { InjectionToken } from '@nestjs/common
|
|
2
|
-
import { Injectable } from '@nestjs/common/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { NestContainer } from '@nestjs/core/injector/container';
|
|
6
|
-
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
|
|
7
|
-
import { GraphInspector } from '@nestjs/core/inspector/graph-inspector';
|
|
1
|
+
import type { InjectionToken } from '@nestjs/common';
|
|
2
|
+
import type { Injectable, NestApplicationContextOptions } from '@nestjs/common/internal';
|
|
3
|
+
import type { ApplicationConfig, NestContainer, GraphInspector } from '@nestjs/core';
|
|
4
|
+
import { type InstanceWrapper } from '@nestjs/core/internal';
|
|
8
5
|
export declare class SocketModule<THttpServer = any, TAppOptions extends NestApplicationContextOptions = NestApplicationContextOptions> {
|
|
9
6
|
private readonly socketsContainer;
|
|
10
7
|
private applicationConfig;
|
|
@@ -14,7 +11,7 @@ export declare class SocketModule<THttpServer = any, TAppOptions extends NestApp
|
|
|
14
11
|
private appOptions;
|
|
15
12
|
register(container: NestContainer, applicationConfig: ApplicationConfig, graphInspector: GraphInspector, appOptions: TAppOptions, httpServer?: THttpServer): void;
|
|
16
13
|
connectAllGateways(providers: Map<InjectionToken, InstanceWrapper<Injectable>>, moduleName: string): void;
|
|
17
|
-
connectGatewayToServer(wrapper: InstanceWrapper<Injectable>, moduleName: string): void
|
|
14
|
+
connectGatewayToServer(wrapper: InstanceWrapper<Injectable>, moduleName: string): Promise<void>;
|
|
18
15
|
close(): Promise<any>;
|
|
19
16
|
private initializeAdapter;
|
|
20
17
|
private getContextCreator;
|