@hazeljs/websocket 0.2.0-beta.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.
Files changed (45) hide show
  1. package/README.md +530 -0
  2. package/dist/decorators/realtime.decorator.d.ts +113 -0
  3. package/dist/decorators/realtime.decorator.d.ts.map +1 -0
  4. package/dist/decorators/realtime.decorator.js +202 -0
  5. package/dist/index.d.ts +10 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +32 -0
  8. package/dist/room/room.manager.d.ts +81 -0
  9. package/dist/room/room.manager.d.ts.map +1 -0
  10. package/dist/room/room.manager.js +209 -0
  11. package/dist/src/decorators/realtime.decorator.d.ts +113 -0
  12. package/dist/src/decorators/realtime.decorator.d.ts.map +1 -0
  13. package/dist/src/decorators/realtime.decorator.js +202 -0
  14. package/dist/src/index.d.ts +10 -0
  15. package/dist/src/index.d.ts.map +1 -0
  16. package/dist/src/index.js +32 -0
  17. package/dist/src/room/room.manager.d.ts +81 -0
  18. package/dist/src/room/room.manager.d.ts.map +1 -0
  19. package/dist/src/room/room.manager.js +209 -0
  20. package/dist/src/sse/sse.handler.d.ts +61 -0
  21. package/dist/src/sse/sse.handler.d.ts.map +1 -0
  22. package/dist/src/sse/sse.handler.js +209 -0
  23. package/dist/src/websocket.gateway.d.ts +94 -0
  24. package/dist/src/websocket.gateway.d.ts.map +1 -0
  25. package/dist/src/websocket.gateway.js +309 -0
  26. package/dist/src/websocket.module.d.ts +57 -0
  27. package/dist/src/websocket.module.d.ts.map +1 -0
  28. package/dist/src/websocket.module.js +88 -0
  29. package/dist/src/websocket.types.d.ts +258 -0
  30. package/dist/src/websocket.types.d.ts.map +1 -0
  31. package/dist/src/websocket.types.js +2 -0
  32. package/dist/sse/sse.handler.d.ts +61 -0
  33. package/dist/sse/sse.handler.d.ts.map +1 -0
  34. package/dist/sse/sse.handler.js +209 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -0
  36. package/dist/websocket.gateway.d.ts +79 -0
  37. package/dist/websocket.gateway.d.ts.map +1 -0
  38. package/dist/websocket.gateway.js +214 -0
  39. package/dist/websocket.module.d.ts +57 -0
  40. package/dist/websocket.module.d.ts.map +1 -0
  41. package/dist/websocket.module.js +88 -0
  42. package/dist/websocket.types.d.ts +258 -0
  43. package/dist/websocket.types.d.ts.map +1 -0
  44. package/dist/websocket.types.js +2 -0
  45. package/package.json +48 -0
@@ -0,0 +1,57 @@
1
+ import { WebSocketServerOptions } from './websocket.types';
2
+ import { SSEHandler } from './sse/sse.handler';
3
+ import { RoomManager } from './room/room.manager';
4
+ /**
5
+ * WebSocket module options
6
+ */
7
+ export interface WebSocketModuleOptions extends WebSocketServerOptions {
8
+ /**
9
+ * Whether this is a global module
10
+ * @default true
11
+ */
12
+ isGlobal?: boolean;
13
+ /**
14
+ * Enable SSE support
15
+ * @default true
16
+ */
17
+ enableSSE?: boolean;
18
+ /**
19
+ * Enable room management
20
+ * @default true
21
+ */
22
+ enableRooms?: boolean;
23
+ }
24
+ /**
25
+ * WebSocket module for HazelJS
26
+ */
27
+ export declare class WebSocketModule {
28
+ /**
29
+ * Configure WebSocket module
30
+ */
31
+ static forRoot(options?: WebSocketModuleOptions): {
32
+ module: typeof WebSocketModule;
33
+ providers: Array<{
34
+ provide: typeof SSEHandler | typeof RoomManager;
35
+ useValue: SSEHandler | RoomManager;
36
+ }>;
37
+ exports: Array<typeof SSEHandler | typeof RoomManager>;
38
+ global: boolean;
39
+ };
40
+ /**
41
+ * Configure WebSocket module asynchronously
42
+ */
43
+ static forRootAsync(options: {
44
+ useFactory: (...args: unknown[]) => Promise<WebSocketModuleOptions> | WebSocketModuleOptions;
45
+ inject?: unknown[];
46
+ }): {
47
+ module: typeof WebSocketModule;
48
+ providers: Array<{
49
+ provide: string | typeof SSEHandler | typeof RoomManager;
50
+ useFactory: unknown;
51
+ inject?: unknown[];
52
+ }>;
53
+ exports: Array<typeof SSEHandler | typeof RoomManager>;
54
+ global: boolean;
55
+ };
56
+ }
57
+ //# sourceMappingURL=websocket.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.module.d.ts","sourceRoot":"","sources":["../src/websocket.module.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,qBAIa,eAAe;IAC1B;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG;QACpD,MAAM,EAAE,OAAO,eAAe,CAAC;QAC/B,SAAS,EAAE,KAAK,CAAC;YACf,OAAO,EAAE,OAAO,UAAU,GAAG,OAAO,WAAW,CAAC;YAChD,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAC;SACpC,CAAC,CAAC;QACH,OAAO,EAAE,KAAK,CAAC,OAAO,UAAU,GAAG,OAAO,WAAW,CAAC,CAAC;QACvD,MAAM,EAAE,OAAO,CAAC;KACjB;IAkCD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE;QAC3B,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;QAC7F,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;KACpB,GAAG;QACF,MAAM,EAAE,OAAO,eAAe,CAAC;QAC/B,SAAS,EAAE,KAAK,CAAC;YACf,OAAO,EAAE,MAAM,GAAG,OAAO,UAAU,GAAG,OAAO,WAAW,CAAC;YACzD,UAAU,EAAE,OAAO,CAAC;YACpB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;SACpB,CAAC,CAAC;QACH,OAAO,EAAE,KAAK,CAAC,OAAO,UAAU,GAAG,OAAO,WAAW,CAAC,CAAC;QACvD,MAAM,EAAE,OAAO,CAAC;KACjB;CA4BF"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ var WebSocketModule_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.WebSocketModule = void 0;
14
+ const core_1 = require("@hazeljs/core");
15
+ const sse_handler_1 = require("./sse/sse.handler");
16
+ const room_manager_1 = require("./room/room.manager");
17
+ const core_2 = __importDefault(require("@hazeljs/core"));
18
+ /**
19
+ * WebSocket module for HazelJS
20
+ */
21
+ let WebSocketModule = WebSocketModule_1 = class WebSocketModule {
22
+ /**
23
+ * Configure WebSocket module
24
+ */
25
+ static forRoot(options = {}) {
26
+ const { isGlobal = true, enableSSE = true, enableRooms = true } = options;
27
+ core_2.default.info('Configuring WebSocket module...');
28
+ const providers = [];
29
+ // Add SSE handler if enabled
30
+ if (enableSSE) {
31
+ providers.push({
32
+ provide: sse_handler_1.SSEHandler,
33
+ useValue: new sse_handler_1.SSEHandler(),
34
+ });
35
+ }
36
+ // Add room manager if enabled
37
+ if (enableRooms) {
38
+ providers.push({
39
+ provide: room_manager_1.RoomManager,
40
+ useValue: new room_manager_1.RoomManager(),
41
+ });
42
+ }
43
+ return {
44
+ module: WebSocketModule_1,
45
+ providers,
46
+ exports: providers.map((p) => p.provide),
47
+ global: isGlobal,
48
+ };
49
+ }
50
+ /**
51
+ * Configure WebSocket module asynchronously
52
+ */
53
+ static forRootAsync(options) {
54
+ return {
55
+ module: WebSocketModule_1,
56
+ providers: [
57
+ {
58
+ provide: 'WEBSOCKET_OPTIONS',
59
+ useFactory: options.useFactory,
60
+ inject: options.inject || [],
61
+ },
62
+ {
63
+ provide: sse_handler_1.SSEHandler,
64
+ useFactory: (wsOptions) => {
65
+ return wsOptions.enableSSE !== false ? new sse_handler_1.SSEHandler() : null;
66
+ },
67
+ inject: ['WEBSOCKET_OPTIONS'],
68
+ },
69
+ {
70
+ provide: room_manager_1.RoomManager,
71
+ useFactory: (wsOptions) => {
72
+ return wsOptions.enableRooms !== false ? new room_manager_1.RoomManager() : null;
73
+ },
74
+ inject: ['WEBSOCKET_OPTIONS'],
75
+ },
76
+ ],
77
+ exports: [sse_handler_1.SSEHandler, room_manager_1.RoomManager],
78
+ global: true,
79
+ };
80
+ }
81
+ };
82
+ exports.WebSocketModule = WebSocketModule;
83
+ exports.WebSocketModule = WebSocketModule = WebSocketModule_1 = __decorate([
84
+ (0, core_1.HazelModule)({
85
+ providers: [],
86
+ exports: [],
87
+ })
88
+ ], WebSocketModule);
@@ -0,0 +1,258 @@
1
+ import { IncomingMessage } from 'http';
2
+ /**
3
+ * WebSocket client interface
4
+ */
5
+ export interface WebSocketClient {
6
+ /**
7
+ * Unique client ID
8
+ */
9
+ id: string;
10
+ /**
11
+ * Client socket
12
+ */
13
+ socket: unknown;
14
+ /**
15
+ * Client metadata
16
+ */
17
+ metadata: Map<string, unknown>;
18
+ /**
19
+ * Rooms the client is in
20
+ */
21
+ rooms: Set<string>;
22
+ /**
23
+ * Send message to client
24
+ */
25
+ send(event: string, data: unknown): void;
26
+ /**
27
+ * Disconnect client
28
+ */
29
+ disconnect(): void;
30
+ /**
31
+ * Join a room
32
+ */
33
+ join(room: string): void;
34
+ /**
35
+ * Leave a room
36
+ */
37
+ leave(room: string): void;
38
+ /**
39
+ * Check if client is in a room
40
+ */
41
+ inRoom(room: string): boolean;
42
+ }
43
+ /**
44
+ * WebSocket message
45
+ */
46
+ export interface WebSocketMessage {
47
+ /**
48
+ * Event name
49
+ */
50
+ event: string;
51
+ /**
52
+ * Message data
53
+ */
54
+ data: unknown;
55
+ /**
56
+ * Timestamp
57
+ */
58
+ timestamp: number;
59
+ /**
60
+ * Client ID
61
+ */
62
+ clientId?: string;
63
+ }
64
+ /**
65
+ * WebSocket gateway options
66
+ */
67
+ export interface WebSocketGatewayOptions {
68
+ /**
69
+ * Gateway path
70
+ */
71
+ path?: string;
72
+ /**
73
+ * Namespace
74
+ */
75
+ namespace?: string;
76
+ /**
77
+ * CORS options
78
+ */
79
+ cors?: {
80
+ origin?: string | string[];
81
+ credentials?: boolean;
82
+ };
83
+ /**
84
+ * Authentication required
85
+ */
86
+ auth?: boolean;
87
+ /**
88
+ * Ping interval in milliseconds
89
+ */
90
+ pingInterval?: number;
91
+ /**
92
+ * Ping timeout in milliseconds
93
+ */
94
+ pingTimeout?: number;
95
+ /**
96
+ * Maximum payload size in bytes
97
+ */
98
+ maxPayload?: number;
99
+ }
100
+ /**
101
+ * Room interface
102
+ */
103
+ export interface Room {
104
+ /**
105
+ * Room name
106
+ */
107
+ name: string;
108
+ /**
109
+ * Clients in the room
110
+ */
111
+ clients: Set<string>;
112
+ /**
113
+ * Room metadata
114
+ */
115
+ metadata: Map<string, unknown>;
116
+ /**
117
+ * Created timestamp
118
+ */
119
+ createdAt: number;
120
+ }
121
+ /**
122
+ * WebSocket event handler
123
+ */
124
+ export type WebSocketEventHandler = (client: WebSocketClient, data: unknown) => void | Promise<void>;
125
+ /**
126
+ * Connection handler
127
+ */
128
+ export type ConnectionHandler = (client: WebSocketClient, request: IncomingMessage) => void | Promise<void>;
129
+ /**
130
+ * Disconnection handler
131
+ */
132
+ export type DisconnectionHandler = (client: WebSocketClient, reason?: string) => void | Promise<void>;
133
+ /**
134
+ * WebSocket server options
135
+ */
136
+ export interface WebSocketServerOptions {
137
+ /**
138
+ * Port to listen on
139
+ */
140
+ port?: number;
141
+ /**
142
+ * Host to bind to
143
+ */
144
+ host?: string;
145
+ /**
146
+ * Path for WebSocket endpoint
147
+ */
148
+ path?: string;
149
+ /**
150
+ * Enable per-message deflate
151
+ */
152
+ perMessageDeflate?: boolean;
153
+ /**
154
+ * Maximum payload size
155
+ */
156
+ maxPayload?: number;
157
+ /**
158
+ * Client tracking
159
+ */
160
+ clientTracking?: boolean;
161
+ }
162
+ /**
163
+ * SSE (Server-Sent Events) options
164
+ */
165
+ export interface SSEOptions {
166
+ /**
167
+ * Retry interval in milliseconds
168
+ */
169
+ retry?: number;
170
+ /**
171
+ * Keep-alive interval in milliseconds
172
+ */
173
+ keepAlive?: number;
174
+ /**
175
+ * Event ID
176
+ */
177
+ id?: string;
178
+ }
179
+ /**
180
+ * SSE message
181
+ */
182
+ export interface SSEMessage {
183
+ /**
184
+ * Event type
185
+ */
186
+ event?: string;
187
+ /**
188
+ * Message data
189
+ */
190
+ data: unknown;
191
+ /**
192
+ * Event ID
193
+ */
194
+ id?: string;
195
+ /**
196
+ * Retry interval
197
+ */
198
+ retry?: number;
199
+ }
200
+ /**
201
+ * Subscription options
202
+ */
203
+ export interface SubscriptionOptions {
204
+ /**
205
+ * Topic pattern
206
+ */
207
+ topic: string;
208
+ /**
209
+ * Filter function
210
+ */
211
+ filter?: (data: unknown) => boolean;
212
+ /**
213
+ * Transform function
214
+ */
215
+ transform?: (data: unknown) => unknown;
216
+ /**
217
+ * Batch size
218
+ */
219
+ batchSize?: number;
220
+ /**
221
+ * Batch interval in milliseconds
222
+ */
223
+ batchInterval?: number;
224
+ }
225
+ /**
226
+ * WebSocket statistics
227
+ */
228
+ export interface WebSocketStats {
229
+ /**
230
+ * Total connected clients
231
+ */
232
+ connectedClients: number;
233
+ /**
234
+ * Total rooms
235
+ */
236
+ totalRooms: number;
237
+ /**
238
+ * Messages sent
239
+ */
240
+ messagesSent: number;
241
+ /**
242
+ * Messages received
243
+ */
244
+ messagesReceived: number;
245
+ /**
246
+ * Bytes sent
247
+ */
248
+ bytesSent: number;
249
+ /**
250
+ * Bytes received
251
+ */
252
+ bytesReceived: number;
253
+ /**
254
+ * Uptime in milliseconds
255
+ */
256
+ uptime: number;
257
+ }
258
+ //# sourceMappingURL=websocket.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websocket.types.d.ts","sourceRoot":"","sources":["../src/websocket.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B;;OAEG;IACH,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,SA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B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@hazeljs/websocket",
3
+ "version": "0.2.0-beta.1",
4
+ "description": "WebSocket and Server-Sent Events module for HazelJS framework",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "test": "jest --coverage --maxWorkers=1 --detectOpenHandles=false",
13
+ "lint": "eslint \"src/**/*.ts\"",
14
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
15
+ "clean": "rm -rf dist"
16
+ },
17
+ "dependencies": {
18
+ "@hazeljs/core": "file:../core",
19
+ "ws": "^8.18.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^20.17.50",
23
+ "@types/ws": "^8.5.13",
24
+ "@typescript-eslint/eslint-plugin": "^8.18.2",
25
+ "@typescript-eslint/parser": "^8.18.2",
26
+ "eslint": "^8.56.0",
27
+ "jest": "^29.7.0",
28
+ "ts-jest": "^29.1.2",
29
+ "typescript": "^5.3.3"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/hazel-js/hazeljs.git",
37
+ "directory": "packages/websocket"
38
+ },
39
+ "keywords": [
40
+ "hazeljs",
41
+ "websocket",
42
+ "sse",
43
+ "realtime",
44
+ "socket"
45
+ ],
46
+ "author": "Muhammad Arslan <marslan@hazeljs.com>",
47
+ "license": "MIT"
48
+ }