@mescius/js-collaboration 18.0.7 → 18.1.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/dist/index.d.ts +120 -119
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/wrapper.mjs +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,107 +1,90 @@
|
|
|
1
|
-
import { Server as HTTPServer } from
|
|
2
|
-
import { Server as HTTPSServer } from
|
|
3
|
-
import { Http2SecureServer, Http2Server } from
|
|
1
|
+
import { Server as HTTPServer } from 'http';
|
|
2
|
+
import { Server as HTTPSServer } from 'https';
|
|
3
|
+
import { Http2SecureServer, Http2Server } from 'http2';
|
|
4
|
+
|
|
5
|
+
export type MessageData = unknown;
|
|
6
|
+
|
|
7
|
+
export type MessageType = string | null;
|
|
8
|
+
|
|
9
|
+
export interface IMiddleware<T> {
|
|
10
|
+
(context: T, next: INext): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IHook<T> {
|
|
14
|
+
(context: T): Promise<void> | void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface INext {
|
|
18
|
+
(error?: Error | string): Promise<void>;
|
|
19
|
+
}
|
|
4
20
|
|
|
5
21
|
/**
|
|
6
|
-
*
|
|
22
|
+
* Represents a collaboration connection on the server.
|
|
7
23
|
*/
|
|
8
|
-
export
|
|
9
|
-
constructor(config?: IServerConfig);
|
|
10
|
-
|
|
24
|
+
export class Connection {
|
|
11
25
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
26
|
+
* Retrieves the unique identifier of the connection.
|
|
27
|
+
* @returns {string} The connection's ID.
|
|
14
28
|
*/
|
|
15
|
-
|
|
29
|
+
get id(): string;
|
|
16
30
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
* @param middleware - middleware to register
|
|
31
|
+
* Retrieves the room identifier of the connection.
|
|
32
|
+
* @returns {string} The room ID associated with the connection.
|
|
20
33
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
get roomId(): string;
|
|
23
35
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
36
|
+
* Retrieves the query parameters of the connection.
|
|
37
|
+
* @returns {Record<string, unknown>} The query parameters of the connection.
|
|
26
38
|
*/
|
|
27
|
-
|
|
39
|
+
get query(): Record<string, unknown>;
|
|
28
40
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @
|
|
31
|
-
* @param hook - hook to register
|
|
41
|
+
* Retrieves the authentication data of the connection.
|
|
42
|
+
* @returns {{ [key: string]: any }} The authentication data associated with the connection.
|
|
32
43
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
get auth(): { [key: string]: any };
|
|
35
45
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @
|
|
46
|
+
* Retrieves the custom data saved for the connection.
|
|
47
|
+
* @returns {Map<string, unknown>} A map of custom tags for the connection.
|
|
38
48
|
*/
|
|
39
|
-
|
|
40
|
-
}
|
|
49
|
+
get tags(): Map<string, unknown>;
|
|
41
50
|
|
|
42
|
-
export interface IServerConfig {
|
|
43
|
-
httpServer?: HTTPServer | HTTPSServer | Http2SecureServer | Http2Server;
|
|
44
|
-
port?: number;
|
|
45
51
|
/**
|
|
46
|
-
*
|
|
52
|
+
* Sends a message to the client.
|
|
53
|
+
* @param {MessageData} data - The message data to send.
|
|
54
|
+
* @param {MessageType} [type] - The type of the message (optional).
|
|
47
55
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export interface IMiddlewareContext {
|
|
61
|
-
connect: IConnectMiddlewareContext,
|
|
62
|
-
message: IMessageMiddlewareContext
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface IConnectMiddlewareContext {
|
|
66
|
-
connection: Connection;
|
|
67
|
-
roomId: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface IMessageMiddlewareContext {
|
|
71
|
-
roomId: string;
|
|
72
|
-
connection: Connection;
|
|
73
|
-
type: MessageType;
|
|
74
|
-
data: MessageData;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type MessageType = string | null;
|
|
78
|
-
export type MessageData = unknown;
|
|
79
|
-
|
|
80
|
-
export interface INext {
|
|
81
|
-
(error?: Error | string): Promise<void>;
|
|
56
|
+
send(data: MessageData, type?: MessageType): void;
|
|
57
|
+
/**
|
|
58
|
+
* Closes the connection.
|
|
59
|
+
*/
|
|
60
|
+
close(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Broadcasts a message to all connections in the room.
|
|
63
|
+
* @param {MessageData} data - The message data to broadcast.
|
|
64
|
+
* @param {MessageType} [type] - The type of the message (optional).
|
|
65
|
+
* @param {boolean} [includeSelf] - Whether to include the sender in the broadcast (optional).
|
|
66
|
+
*/
|
|
67
|
+
broadcast(data: MessageData, type?: MessageType, includeSelf?: boolean): void;
|
|
82
68
|
}
|
|
83
69
|
|
|
84
|
-
export interface IHook<T> {
|
|
85
|
-
(context: T): void;
|
|
86
|
-
}
|
|
87
70
|
export interface IHooks {
|
|
88
|
-
connect?: IHook<IConnectContext
|
|
89
|
-
message?: IHook<IMessageContext
|
|
90
|
-
createRoom?: IHook<ICreateRoomContext
|
|
91
|
-
disconnect?: IHook<IDisconnectContext
|
|
92
|
-
enterRoom?: IHook<IEnterRoomContext
|
|
93
|
-
leaveRoom?: IHook<ILeaveRoomContext
|
|
94
|
-
destroyRoom?: IHook<IDestroyRoomContext
|
|
71
|
+
connect?: IHook<IConnectContext>;
|
|
72
|
+
message?: IHook<IMessageContext>;
|
|
73
|
+
createRoom?: IHook<ICreateRoomContext>;
|
|
74
|
+
disconnect?: IHook<IDisconnectContext>;
|
|
75
|
+
enterRoom?: IHook<IEnterRoomContext>;
|
|
76
|
+
leaveRoom?: IHook<ILeaveRoomContext>;
|
|
77
|
+
destroyRoom?: IHook<IDestroyRoomContext>;
|
|
95
78
|
}
|
|
96
79
|
|
|
97
80
|
export interface IHookContext {
|
|
98
|
-
connect: IConnectContext
|
|
99
|
-
createRoom: ICreateRoomContext
|
|
100
|
-
enterRoom: IEnterRoomContext
|
|
101
|
-
message: IMessageContext
|
|
102
|
-
disconnect: IDisconnectContext
|
|
103
|
-
leaveRoom: ILeaveRoomContext
|
|
104
|
-
destroyRoom: IDestroyRoomContext
|
|
81
|
+
connect: IConnectContext;
|
|
82
|
+
createRoom: ICreateRoomContext;
|
|
83
|
+
enterRoom: IEnterRoomContext;
|
|
84
|
+
message: IMessageContext;
|
|
85
|
+
disconnect: IDisconnectContext;
|
|
86
|
+
leaveRoom: ILeaveRoomContext;
|
|
87
|
+
destroyRoom: IDestroyRoomContext;
|
|
105
88
|
}
|
|
106
89
|
|
|
107
90
|
export interface IConnectContext {
|
|
@@ -139,57 +122,75 @@ export interface IDestroyRoomContext {
|
|
|
139
122
|
roomId: string;
|
|
140
123
|
}
|
|
141
124
|
|
|
125
|
+
export interface IMiddlewares {
|
|
126
|
+
connect?: IMiddleware<IConnectMiddlewareContext>;
|
|
127
|
+
message?: IMiddleware<IMessageMiddlewareContext>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface IMiddlewareContext {
|
|
131
|
+
connect: IConnectMiddlewareContext;
|
|
132
|
+
message: IMessageMiddlewareContext;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface IConnectMiddlewareContext {
|
|
136
|
+
connection: Connection;
|
|
137
|
+
roomId: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface IMessageMiddlewareContext {
|
|
141
|
+
roomId: string;
|
|
142
|
+
connection: Connection;
|
|
143
|
+
type: MessageType;
|
|
144
|
+
data: MessageData;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface IServerConfig {
|
|
148
|
+
httpServer?: HTTPServer | HTTPSServer | Http2SecureServer | Http2Server;
|
|
149
|
+
port?: number;
|
|
150
|
+
/**
|
|
151
|
+
* The request path for the server. Defaults to '/collaboration/'.
|
|
152
|
+
*/
|
|
153
|
+
path?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
142
156
|
export interface IFeature {
|
|
143
157
|
middlewares?: IMiddlewares;
|
|
144
158
|
hooks?: IHooks;
|
|
145
159
|
}
|
|
146
160
|
|
|
147
161
|
/**
|
|
148
|
-
*
|
|
162
|
+
* Represents a collaboration server, provides bidirectional communication, middleware and hooks mechanism.
|
|
149
163
|
*/
|
|
150
|
-
export declare class
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*/
|
|
154
|
-
tags: Map<string, unknown>;
|
|
155
|
-
/**
|
|
156
|
-
* Get the id of the connection.
|
|
157
|
-
* @returns {string} Returns the id of the connection.
|
|
158
|
-
*/
|
|
159
|
-
get id(): string;
|
|
160
|
-
/**
|
|
161
|
-
* The room id of the connection.
|
|
162
|
-
* @returns {string} Returns the room id of the connection.
|
|
163
|
-
*/
|
|
164
|
-
get roomId(): string;
|
|
164
|
+
export declare class Server {
|
|
165
|
+
constructor(config?: IServerConfig);
|
|
166
|
+
|
|
165
167
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @
|
|
168
|
+
* Registers multiple middlewares to the server in a batch.
|
|
169
|
+
* @param {IMiddlewares} middlewares - The middlewares to register.
|
|
168
170
|
*/
|
|
169
|
-
|
|
171
|
+
use(middlewares: IMiddlewares): void;
|
|
170
172
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @
|
|
173
|
+
* Registers a single middleware for a specific action on the server.
|
|
174
|
+
* @template K - Type of the action name, extending keyof IMiddlewareContext.
|
|
175
|
+
* @param {K} action - The name of the action to associate with the middleware.
|
|
176
|
+
* @param {IMiddleware<IMiddlewareContext[K]>} middleware - The middleware to register for the specified action.
|
|
173
177
|
*/
|
|
174
|
-
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
176
|
-
[key: string]: any;
|
|
177
|
-
};
|
|
178
|
+
use<K extends keyof IMiddlewareContext>(action: K, middleware: IMiddleware<IMiddlewareContext[K]>): void;
|
|
178
179
|
/**
|
|
179
|
-
*
|
|
180
|
-
* @param
|
|
181
|
-
* @param type - message type
|
|
180
|
+
* Registers multiple hooks to the server in a batch.
|
|
181
|
+
* @param hooks - The hooks to register.
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
on(hooks: IHooks): void;
|
|
184
184
|
/**
|
|
185
|
-
*
|
|
186
|
-
* @
|
|
187
|
-
* @param
|
|
188
|
-
* @param
|
|
185
|
+
* Registers a single hook for a specific action on the server.
|
|
186
|
+
* @template K - Type of the action name, extending keyof IHookContext.
|
|
187
|
+
* @param {K} action - he name of the action to associate with the hook
|
|
188
|
+
* @param {IHook<IHookContext<K>>} hook - The hook to register for the specified action.
|
|
189
189
|
*/
|
|
190
|
-
|
|
190
|
+
on<K extends keyof IHookContext>(action: K, hook: IHook<IHookContext[K]>): void;
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* Register feature to the server.
|
|
193
|
+
* @param {IFeature} feature - The feature to register.
|
|
193
194
|
*/
|
|
194
|
-
|
|
195
|
-
}
|
|
195
|
+
useFeature(feature: IFeature): void;
|
|
196
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(()=>(()=>{"use strict";var e={42:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0,t.getConnection=function(e){return e.__conn__};const r=o(884);class n extends r.Observable{constructor(e){super(),this.
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(()=>(()=>{"use strict";var e={42:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0,t.getConnection=function(e){return e.__conn__};const r=o(884);class n extends r.Observable{constructor(e){super(),this._tags=new Map;const t=e.handshake.query;this._roomId=t.roomId,this._query=t,this._socket=e,this._socket.__conn__=this,this._socket.on(r.SOCKET_IO_MESSAGE_EVENT,this.onmessage.bind(this))}get id(){return this._socket.id}get roomId(){return this._roomId}get query(){return this._query}get auth(){return this._socket.handshake.auth}get tags(){return this._tags}get socket(){return this._socket}send(e,t){this._socket.emit(r.SOCKET_IO_MESSAGE_EVENT,(0,r.encodeMessage)(e,t))}close(){this._socket.disconnect()}broadcast(e,t,o=!1){const n=(0,r.encodeMessage)(e,t);o&&this._socket.emit(r.SOCKET_IO_MESSAGE_EVENT,n),this._socket.to(this.roomId).emit(r.SOCKET_IO_MESSAGE_EVENT,n)}onmessage(e){this.emit("message",(0,r.decodeMessage)(e))}}t.Connection=n},273:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},897:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},271:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Server=void 0;const i=s(o(952)),a=o(884),c=o(42);class d extends a.Middleware{constructor(e){var t;super(),this.rooms=new Set,e=null!=e?e:{port:3e3},this.io=new i.Server(e.httpServer||e.port,{path:null!==(t=e.path)&&void 0!==t?t:a.DEFAULT_REQUEST_PATH,maxHttpBufferSize:1e10,perMessageDeflate:{threshold:1024}}),this.io.use(((e,t)=>{const o=new c.Connection(e),r={connection:o,roomId:o.roomId};this.trigger("connect",r,(async e=>{return e?t((o=e)instanceof Error?o:new Error(o)):t();var o}))}));const o=this.io.of("/").adapter;this.io.on("connection",(e=>{const t=(0,c.getConnection)(e);this.emit("connect",{connection:t,roomId:t.roomId}),this.rooms.add(t.roomId),t.socket.join(t.roomId),t.on("message",((e,o)=>{this.trigger("message",{connection:t,data:e,type:o,roomId:t.roomId},(async r=>{r?t.socket.emit("message_error",r instanceof Error?r.message:r):await this.emit("message",{connection:t,data:e,type:o,roomId:t.roomId})}))})),t.socket.on("disconnect",(()=>{this.emit("disconnect",{connection:t,roomId:t.roomId})}))})),o.on("create-room",(e=>{this.rooms.has(e)&&this.emit("createRoom",{roomId:e})})),o.on("join-room",((e,t)=>{if(!this.rooms.has(e))return;const o=this.io.sockets.sockets.get(t);this.emit("enterRoom",{roomId:e,connection:(0,c.getConnection)(o)})})),o.on("leave-room",((e,t)=>{if(!this.rooms.has(e))return;const o=this.io.sockets.sockets.get(t);this.emit("leaveRoom",{roomId:e,connection:(0,c.getConnection)(o)})})),o.on("delete-room",(e=>{this.rooms.has(e)&&(this.rooms.delete(e),this.emit("destroyRoom",{roomId:e}))}))}use(e,t){if("string"==typeof e){const o=e;super.use(o,t)}else{const t=e;t.connect&&super.use("connect",t.connect),t.message&&super.use("message",t.message)}}on(e,t){if("string"==typeof e){const o=e;super.on(o,t)}else{const t=e;t.connect&&super.on("connect",t.connect),t.createRoom&&super.on("createRoom",t.createRoom),t.enterRoom&&super.on("enterRoom",t.enterRoom),t.message&&super.on("message",t.message),t.disconnect&&super.on("disconnect",t.disconnect),t.leaveRoom&&super.on("leaveRoom",t.leaveRoom),t.destroyRoom&&super.on("destroyRoom",t.destroyRoom)}}useFeature(e){e.middlewares&&this.use(e.middlewares),e.hooks&&this.on(e.hooks)}}t.Server=d},871:e=>{e.exports=require("buffer")},331:e=>{e.exports=require("pako")},952:e=>{e.exports=require("socket.io")},884:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_REQUEST_PATH=void 0,n(o(589),t),n(o(735),t),n(o(31),t),n(o(76),t),n(o(959),t),t.DEFAULT_REQUEST_PATH="/collaboration/"},31:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerManager=void 0;class o{debug(...e){}info(e){}warn(...e){}error(...e){}}class r{constructor(e){this.namespace=e}debug(...e){this.isEnabled&&this.logger.debug(`[${this.namespace}]`,...e)}info(...e){this.isEnabled&&this.logger.info(`[${this.namespace}]`,...e)}warn(...e){this.isEnabled&&this.logger.warn(`[${this.namespace}]`,...e)}error(...e){this.isEnabled&&this.logger.error(`[${this.namespace}]`,...e)}get isEnabled(){return n._isEnabledNamespace(this.namespace)}get logger(){return n.getInstance()}}class n{static getInstance(){return n._instance||(n._instance=new o),n._instance}static createLogger(e){return new r(e)}static setLogger(e){n._instance=e}static enableNamespace(e){n._enabledNamespace.push(...e)}static disableNamespace(e){n._enabledNamespace=n._enabledNamespace.filter((t=>!e.includes(t)))}static _isEnabledNamespace(e){return n._enabledNamespace.includes(e)||n._enabledNamespace.includes("*")}}t.LoggerManager=n,n._enabledNamespace=[]},735:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SOCKET_IO_MESSAGE_EVENT=void 0,t.encodeMessage=function(e,t=null){return[t,"string"==typeof e?c(e):e]},t.decodeMessage=function(e){return["string"==typeof e[1]?d(e[1]):e[1],e[0]]};const i=s(o(331)),a=o(871);function c(e){const t=(new TextEncoder).encode(e),o=i.deflate(t);return a.Buffer.from(o).toString("base64")}function d(e){const t=a.Buffer.from(e,"base64"),o=i.inflate(new Uint8Array(t));return(new TextDecoder).decode(o)}t.SOCKET_IO_MESSAGE_EVENT="m"},589:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Middleware=void 0,t.Middleware=class{constructor(){this.middlewares=new Map,this.hooks=new Map}use(e,t){this.middlewares.has(e)||this.middlewares.set(e,[]),this.middlewares.get(e).push(t)}on(e,t){this.hooks.has(e)||this.hooks.set(e,[]),this.hooks.get(e).push(t)}async trigger(e,t,o){let r=this.middlewares.get(e);if(!r||0===r.length)return o();r=r.slice();const n=async e=>{if(e)return await o(e);const s=r.shift();if(!s)return await o();await s(t,n)};await n()}async emit(e,t){const o=this.hooks.get(e);if(o)for(const e of o)await e(t)}}},959:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0,t.Observable=class{constructor(){this._observers=new Map}on(e,t){return o(this._observers,e,(()=>new Set)).add(t),t}once(e,t){const o=(...r)=>{this.off(e,o),t(...r)};this.on(e,o)}off(e,t){const o=this._observers.get(e);void 0!==o&&(o.delete(t),0===o.size&&this._observers.delete(e))}emit(e,t){return Array.from((this._observers.get(e)||new Map).values()).forEach((e=>e(...t)))}destroy(){this._observers=new Map}};const o=(e,t,o)=>{let r=e.get(t);return void 0===r&&(r=o(),e.set(t,r)),r}},76:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNullOrUndefined=function(e){return null==e}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,o),s.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Middleware=e.LoggerManager=e.Connection=e.Server=void 0,o(897),o(273);const t=o(271);Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return t.Server}});const n=o(42);Object.defineProperty(e,"Connection",{enumerable:!0,get:function(){return n.Connection}});const s=o(884);Object.defineProperty(e,"LoggerManager",{enumerable:!0,get:function(){return s.LoggerManager}}),Object.defineProperty(e,"Middleware",{enumerable:!0,get:function(){return s.Middleware}})})(),r})()));
|
package/package.json
CHANGED
package/wrapper.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as collaborationModule from './dist/index.js';
|
|
2
2
|
import collaboration from './dist/index.js';
|
|
3
|
-
const { Server, Connection,
|
|
3
|
+
const { Server, Connection, LoggerManager, Middleware } = { ...(collaboration ?? {}), ...collaborationModule };
|
|
4
4
|
|
|
5
|
-
export { collaboration as default, Server, Connection,
|
|
5
|
+
export { collaboration as default, Server, Connection, LoggerManager, Middleware };
|