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

egg-ez-ws

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-ez-ws - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

1

lib/ClientManager/Client.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = void 0;
const uuid = require("uuid");

@@ -4,0 +5,0 @@ const Any_1 = require("../contract/Any");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthCommandProcessor = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseCommandProcessor_1 = require("./BaseCommandProcessor");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseCommandProcessor = void 0;
class BaseCommandProcessor {

@@ -4,0 +5,0 @@ constructor(app, manager) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebugCommandProcessor = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseCommandProcessor_1 = require("./BaseCommandProcessor");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageCommandProcessor = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseCommandProcessor_1 = require("./BaseCommandProcessor");

5

lib/ClientManager/Command/RoomCommand.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomInfoCommandProcessor = exports.RoomExitCommandProcessor = exports.RoomJoinCommandProcessor = void 0;
const tslib_1 = require("tslib");

@@ -25,3 +26,3 @@ const BaseCommandProcessor_1 = require("./BaseCommandProcessor");

};
this.manager.broadcast(new W_A_1.JoinRoomEvent({
yield this.manager.broadcast(new W_A_1.JoinRoomEvent({
clientId: client.id,

@@ -58,3 +59,3 @@ roomId: msg.roomId,

};
this.manager.broadcast(new W_A_1.ExitRoomEvent({
yield this.manager.broadcast(new W_A_1.ExitRoomEvent({
clientId: client.id,

@@ -61,0 +62,0 @@ roomId: msg.roomId,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEventHandler = void 0;
const common_1 = require("../../common");

@@ -4,0 +5,0 @@ class BaseEventHandler extends common_1.BaseEventHandler {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientMessageHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("./BaseEventHandler");

@@ -14,3 +14,3 @@ /// <reference types="node" />

onClientDisconnect: EventDelegate<IClientInfo<any>>;
readonly logger: import("_egg-logger@2.4.1@egg-logger").EggLogger;
readonly logger: import("_egg-logger@2.6.1@egg-logger").EggLogger;
readonly checkHeart: NodeJS.Timeout;

@@ -17,0 +17,0 @@ private commandProcessors;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientManager = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const egg_aop_1 = require("egg-aop");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEventHandler = void 0;
const common_1 = require("../../common");

@@ -4,0 +5,0 @@ class BaseEventHandler extends common_1.BaseEventHandler {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientConnectHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientDisconnectHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientInfoHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientMergeInfoHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientMessageHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomExitHandler = void 0;
const tslib_1 = require("tslib");

@@ -13,3 +14,3 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.manager.exitRoom(evt.data.clientId, evt.data.roomId);
yield this.manager.exitRoom(evt.data.clientId, evt.data.roomId);
});

@@ -16,0 +17,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomInfoHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomJoinHandler = void 0;
const tslib_1 = require("tslib");

@@ -13,3 +14,3 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.manager.joinRoom(evt.data.clientId, evt.data.roomId);
yield this.manager.joinRoom(evt.data.clientId, evt.data.roomId);
});

@@ -16,0 +17,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomListHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomMessageHandler = void 0;
const tslib_1 = require("tslib");

@@ -4,0 +5,0 @@ const BaseEventHandler_1 = require("../BaseEventHandler");

@@ -29,3 +29,3 @@ import { Agent } from 'egg';

export declare class ClusterManager extends BaseManager<Agent> {
readonly logger: import("_egg-logger@2.4.1@egg-logger").EggLogger;
readonly logger: import("_egg-logger@2.6.1@egg-logger").EggLogger;
private rooms;

@@ -41,5 +41,5 @@ private clients;

deleteRoom(roomId: string): Promise<void>;
joinRoom(clientId: string, roomId: string): any;
joinRoom(clientId: string, roomId: string): Promise<boolean>;
exitRoom(clientId: string, roomId: string): Promise<void>;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClusterManager = void 0;
const tslib_1 = require("tslib");

@@ -126,2 +127,3 @@ const uuid = require("uuid");

room.clients.set(client.id, client);
return true;
});

@@ -128,0 +130,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEvent = void 0;
const uuid = require("uuid");

@@ -4,0 +5,0 @@ class BaseEvent {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseEventHandler = void 0;
class BaseEventHandler {

@@ -4,0 +5,0 @@ constructor(manager) {

@@ -8,3 +8,3 @@ import { EggApplication } from 'egg';

protected app: T;
protected logger: import("_egg-logger@2.4.1@egg-logger").EggLogger;
protected logger: import("_egg-logger@2.6.1@egg-logger").EggLogger;
readonly onSendTo: EventDelegate<BaseEvent<{}>>;

@@ -11,0 +11,0 @@ protected eventHandlers: Map<string, BaseEventHandler<BaseEvent<{}>, BaseManager<EggApplication>>>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseManager = void 0;
const tslib_1 = require("tslib");

@@ -16,5 +17,4 @@ const EventDelegate_1 = require("../util/EventDelegate");

broadcast(evt, cbType) {
var _a;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.logger.info(`[${this.type}] broadcast evt: ${evt.type} cbType: ${(_a = cbType) === null || _a === void 0 ? void 0 : _a.name}.`);
this.logger.info(`[${this.type}] broadcast evt: ${evt.type} cbType: ${cbType === null || cbType === void 0 ? void 0 : cbType.name}.`);
this.onSendTo.emit(evt);

@@ -21,0 +21,0 @@ if (cbType) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RoomListInfoResponseEvent = exports.RoomInfoResponseEvent = exports.ClientInfoResponseEvent = void 0;
// AGENT TO WORKER

@@ -4,0 +5,0 @@ const BaseEvent_1 = require("../common/BaseEvent");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClientMessageEvent = exports.DebugEvent = void 0;
// ANY TO ANY

@@ -4,0 +5,0 @@ const BaseEvent_1 = require("../common/BaseEvent");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AGENT_TO_WORKER = exports.WORKER_TO_AGENT = exports.ANY = exports.MESSAGE_EVENT = void 0;
const tslib_1 = require("tslib");
exports.MESSAGE_EVENT = 'EZ_WS_MESSAGE_EVENT';

@@ -10,1 +12,2 @@ const ANY = require("./Any");

exports.AGENT_TO_WORKER = AGENT_TO_WORKER;
tslib_1.__exportStar(require("./interface"), exports);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MergeRoomInfoEvent = exports.MergeClientInfoEvent = exports.ClientInfoRequestEvent = exports.RoomInfoRequestEvent = exports.RoomListRequestEvent = exports.RoomMessageEvent = exports.ExitRoomEvent = exports.JoinRoomEvent = exports.ClientDisconnectEvent = exports.ClientConnectEvent = void 0;
// WORKER TO AGENT

@@ -4,0 +5,0 @@ const BaseEvent_1 = require("../common/BaseEvent");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventDelegate = void 0;
class EventDelegate {

@@ -4,0 +5,0 @@ constructor() {

{
"name": "egg-ez-ws",
"version": "0.1.10",
"version": "0.1.11",
"description": "easy websocket for egg.",

@@ -52,3 +52,3 @@ "main": "lib/index.js",

"tslint": "^5.20.1",
"typescript": "^3.7.2"
"typescript": "^4.3.5"
},

@@ -55,0 +55,0 @@ "engines": {

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