Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nestjs/websockets

Package Overview
Dependencies
Maintainers
1
Versions
331
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/websockets - npm Package Compare versions

Comparing version 9.4.3 to 10.0.0

1

context/ws-context-creator.d.ts

@@ -35,2 +35,3 @@ import { ContextType, Controller, PipeTransform } from '@nestjs/common/interfaces';

reflectCallbackParamtypes(instance: Controller, callback: (...args: any[]) => any): any[];
reflectCallbackPattern(callback: (...args: any[]) => any): string;
createGuardsFn<TContext extends string = ContextType>(guards: any[], instance: Controller, callback: (...args: unknown[]) => any, contextType?: TContext): Function | null;

@@ -37,0 +38,0 @@ getMetadata<TMetadata, TContext extends ContextType = ContextType>(instance: Controller, methodName: string, contextType: TContext): WsHandlerMetadata;

@@ -48,2 +48,3 @@ "use strict";

return this.wsProxy.create(async (...args) => {
args.push(this.reflectCallbackPattern(callback));
const initialArgs = this.contextUtils.createNullArray(argsLength);

@@ -57,2 +58,5 @@ fnCanActivate && (await fnCanActivate(args));

}
reflectCallbackPattern(callback) {
return Reflect.getMetadata(constants_3.MESSAGE_METADATA, callback);
}
createGuardsFn(guards, instance, callback, contextType) {

@@ -59,0 +63,0 @@ const canActivateFn = async (args) => {

2

enums/ws-paramtype.enum.js

@@ -8,2 +8,2 @@ "use strict";

WsParamtype[WsParamtype["PAYLOAD"] = 3] = "PAYLOAD";
})(WsParamtype = exports.WsParamtype || (exports.WsParamtype = {}));
})(WsParamtype || (exports.WsParamtype = WsParamtype = {}));

@@ -45,3 +45,3 @@ "use strict";

}
exports.BaseWsExceptionFilter = BaseWsExceptionFilter;
BaseWsExceptionFilter.logger = new common_1.Logger('WsExceptionsHandler');
exports.BaseWsExceptionFilter = BaseWsExceptionFilter;

@@ -5,2 +5,3 @@ "use strict";

const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
const select_exception_filter_metadata_util_1 = require("@nestjs/common/utils/select-exception-filter-metadata.util");
const invalid_exception_filter_exception_1 = require("@nestjs/core/errors/exceptions/invalid-exception-filter.exception");

@@ -32,7 +33,3 @@ const base_ws_exception_filter_1 = require("./base-ws-exception-filter");

return false;
const filter = this.filters.find(({ exceptionMetatypes }) => {
const hasMetatype = !exceptionMetatypes.length ||
exceptionMetatypes.some(ExceptionMetatype => exception instanceof ExceptionMetatype);
return hasMetatype;
});
const filter = (0, select_exception_filter_metadata_util_1.selectExceptionFilterMetadata)(this.filters, exception);
filter && filter.func(exception, args);

@@ -39,0 +36,0 @@ return !!filter;

@@ -7,3 +7,2 @@ "use strict";

exchangeKeyForValue(type, data, args) {
var _a;
if (!args) {

@@ -16,3 +15,3 @@ return null;

case ws_paramtype_enum_1.WsParamtype.PAYLOAD:
return data ? (_a = args[1]) === null || _a === void 0 ? void 0 : _a[data] : args[1];
return data ? args[1]?.[data] : args[1];
default:

@@ -19,0 +18,0 @@ return null;

{
"name": "@nestjs/websockets",
"version": "9.4.3",
"version": "10.0.0",
"description": "Nest - modern, fast, powerful node.js web framework (@websockets)",

@@ -21,9 +21,9 @@ "author": "Kamil Mysliwiec",

"devDependencies": {
"@nestjs/common": "9.4.3",
"@nestjs/core": "9.4.3"
"@nestjs/common": "10.0.0",
"@nestjs/core": "10.0.0"
},
"peerDependencies": {
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-socket.io": "^9.0.0",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-socket.io": "^10.0.0",
"reflect-metadata": "^0.1.12",

@@ -30,0 +30,0 @@ "rxjs": "^7.1.0"

@@ -0,1 +1,2 @@

import { InjectionToken } from '@nestjs/common/interfaces';
import { Injectable } from '@nestjs/common/interfaces/injectable.interface';

@@ -6,3 +7,2 @@ import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface';

import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
import { InstanceToken } from '@nestjs/core/injector/module';
import { GraphInspector } from '@nestjs/core/inspector/graph-inspector';

@@ -17,3 +17,3 @@ export declare class SocketModule<THttpServer = any, TAppOptions extends NestApplicationContextOptions = NestApplicationContextOptions> {

register(container: NestContainer, applicationConfig: ApplicationConfig, graphInspector: GraphInspector, appOptions: TAppOptions, httpServer?: THttpServer): void;
connectAllGateways(providers: Map<InstanceToken, InstanceWrapper<Injectable>>, moduleName: string): void;
connectAllGateways(providers: Map<InjectionToken, InstanceWrapper<Injectable>>, moduleName: string): void;
connectGatewayToServer(wrapper: InstanceWrapper<Injectable>, moduleName: string): void;

@@ -20,0 +20,0 @@ close(): Promise<any>;

@@ -61,3 +61,3 @@ "use strict";

.map(async ({ server }) => adapter.close(server)));
await (adapter === null || adapter === void 0 ? void 0 : adapter.dispose());
await adapter?.dispose();
this.socketsContainer.clear();

@@ -64,0 +64,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SocketServerProvider = void 0;
const tslib_1 = require("tslib");
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");

@@ -26,3 +25,3 @@ const server_and_event_streams_factory_1 = require("./factories/server-and-event-streams-factory");

const adapter = this.applicationConfig.getIoAdapter();
const _a = options, { namespace, server } = _a, partialOptions = tslib_1.__rest(_a, ["namespace", "server"]);
const { namespace, server, ...partialOptions } = options;
const ioServer = adapter.create(port, partialOptions);

@@ -44,3 +43,7 @@ const serverAndEventStreamsHost = server_and_event_streams_factory_1.ServerAndEventStreamsFactory.create(ioServer);

const adapter = this.applicationConfig.getIoAdapter();
return adapter.create(port, Object.assign(Object.assign({}, options), { namespace: this.validateNamespace(options.namespace || ''), server }));
return adapter.create(port, {
...options,
namespace: this.validateNamespace(options.namespace || ''),
server,
});
}

@@ -47,0 +50,0 @@ validateNamespace(namespace) {

@@ -107,7 +107,6 @@ "use strict";

messageHandlers.forEach(handler => {
var _a;
this.graphInspector.insertEntrypointDefinition({
type: 'websocket',
methodName: handler.methodName,
className: (_a = instance.constructor) === null || _a === void 0 ? void 0 : _a.name,
className: instance.constructor?.name,
classNodeId: instanceWrapperId,

@@ -128,4 +127,3 @@ metadata: {

printSubscriptionLogs(instance, subscribersMap) {
var _a;
const gatewayClassName = (_a = instance === null || instance === void 0 ? void 0 : instance.constructor) === null || _a === void 0 ? void 0 : _a.name;
const gatewayClassName = instance?.constructor?.name;
if (!gatewayClassName) {

@@ -132,0 +130,0 @@ return;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc