@nsshunt/stssocketioutils 1.1.39 → 2.0.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/dist/stssocketioutils.mjs +778 -90
- package/dist/stssocketioutils.mjs.map +1 -1
- package/dist/stssocketioutils.umd.js +774 -92
- package/dist/stssocketioutils.umd.js.map +1 -1
- package/package.json +5 -2
- package/types/commonTypes.d.ts +27 -21
- package/types/commonTypes.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/socketIoClient.d.ts +0 -1
- package/types/socketIoClient.d.ts.map +1 -1
- package/types/socketIoClientInstance.d.ts +15 -0
- package/types/socketIoClientInstance.d.ts.map +1 -0
- package/types/socketIoServer.d.ts +34 -10
- package/types/socketIoServer.d.ts.map +1 -1
- package/types/socketIoServerHelper.d.ts +22 -11
- package/types/socketIoServerHelper.d.ts.map +1 -1
- package/types/socketIoServerInstance.d.ts +12 -0
- package/types/socketIoServerInstance.d.ts.map +1 -0
- package/types/wsevents.d.ts +0 -4
- package/types/wsevents.d.ts.map +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("socket.io-client")) : typeof define === "function" && define.amd ? define(["exports", "socket.io-client"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stssocketioutils"] = {}, global.socket["io-client"]));
|
|
3
|
-
})(this, (function(exports2, socket_ioClient) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("socket.io-client"), require("@nsshunt/stsutils"), require("socket.io"), require("ioredis"), require("node:cluster"), require("socket.io-adapter"), require("@socket.io/redis-streams-adapter")) : typeof define === "function" && define.amd ? define(["exports", "socket.io-client", "@nsshunt/stsutils", "socket.io", "ioredis", "node:cluster", "socket.io-adapter", "@socket.io/redis-streams-adapter"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stssocketioutils"] = {}, global.socket["io-client"], global.stsutils, global.socket.io, global.ioredis, global["node:cluster"], global.socket["io-adapter"], global["@socket"]["io/redis-streams-adapter"]));
|
|
3
|
+
})(this, (function(exports2, socket_ioClient, stsutils, socket_io, ioredis, require$$0, require$$1, redisStreamsAdapter) {
|
|
4
4
|
"use strict";
|
|
5
5
|
var STSNamespace = /* @__PURE__ */ ((STSNamespace2) => {
|
|
6
6
|
STSNamespace2["STSMonitor"] = "stsinstrumentmanager/stsmonitor";
|
|
@@ -116,15 +116,6 @@
|
|
|
116
116
|
throw new Error("SocketIoClient:emit(): Error: [socket instance not defined.]");
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
/*
|
|
120
|
-
SetupClientSideSocket(name: string, address: string, socketIoCustomPath: string): SocketIoClient<ServerToClientEvents, ClientToServerEvents> {
|
|
121
|
-
this.#name = name;
|
|
122
|
-
this.#address = address;
|
|
123
|
-
this.#socketIoCustomPath = socketIoCustomPath;
|
|
124
|
-
this.#EstablishSocketConnect(name, socketIoCustomPath);
|
|
125
|
-
return this;
|
|
126
|
-
}
|
|
127
|
-
*/
|
|
128
119
|
#EstablishSocketConnect() {
|
|
129
120
|
if (this.#socket !== void 0) {
|
|
130
121
|
if (this.#socket.connected === true) {
|
|
@@ -236,132 +227,823 @@
|
|
|
236
227
|
});
|
|
237
228
|
}
|
|
238
229
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
230
|
+
var dist = {};
|
|
231
|
+
var browser = { exports: {} };
|
|
232
|
+
var ms;
|
|
233
|
+
var hasRequiredMs;
|
|
234
|
+
function requireMs() {
|
|
235
|
+
if (hasRequiredMs) return ms;
|
|
236
|
+
hasRequiredMs = 1;
|
|
237
|
+
var s = 1e3;
|
|
238
|
+
var m = s * 60;
|
|
239
|
+
var h = m * 60;
|
|
240
|
+
var d = h * 24;
|
|
241
|
+
var w = d * 7;
|
|
242
|
+
var y = d * 365.25;
|
|
243
|
+
ms = function(val, options) {
|
|
244
|
+
options = options || {};
|
|
245
|
+
var type = typeof val;
|
|
246
|
+
if (type === "string" && val.length > 0) {
|
|
247
|
+
return parse(val);
|
|
248
|
+
} else if (type === "number" && isFinite(val)) {
|
|
249
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
250
|
+
}
|
|
251
|
+
throw new Error(
|
|
252
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
function parse(str) {
|
|
256
|
+
str = String(str);
|
|
257
|
+
if (str.length > 100) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
261
|
+
str
|
|
262
|
+
);
|
|
263
|
+
if (!match) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
var n = parseFloat(match[1]);
|
|
267
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
268
|
+
switch (type) {
|
|
269
|
+
case "years":
|
|
270
|
+
case "year":
|
|
271
|
+
case "yrs":
|
|
272
|
+
case "yr":
|
|
273
|
+
case "y":
|
|
274
|
+
return n * y;
|
|
275
|
+
case "weeks":
|
|
276
|
+
case "week":
|
|
277
|
+
case "w":
|
|
278
|
+
return n * w;
|
|
279
|
+
case "days":
|
|
280
|
+
case "day":
|
|
281
|
+
case "d":
|
|
282
|
+
return n * d;
|
|
283
|
+
case "hours":
|
|
284
|
+
case "hour":
|
|
285
|
+
case "hrs":
|
|
286
|
+
case "hr":
|
|
287
|
+
case "h":
|
|
288
|
+
return n * h;
|
|
289
|
+
case "minutes":
|
|
290
|
+
case "minute":
|
|
291
|
+
case "mins":
|
|
292
|
+
case "min":
|
|
293
|
+
case "m":
|
|
294
|
+
return n * m;
|
|
295
|
+
case "seconds":
|
|
296
|
+
case "second":
|
|
297
|
+
case "secs":
|
|
298
|
+
case "sec":
|
|
299
|
+
case "s":
|
|
300
|
+
return n * s;
|
|
301
|
+
case "milliseconds":
|
|
302
|
+
case "millisecond":
|
|
303
|
+
case "msecs":
|
|
304
|
+
case "msec":
|
|
305
|
+
case "ms":
|
|
306
|
+
return n;
|
|
307
|
+
default:
|
|
308
|
+
return void 0;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function fmtShort(ms2) {
|
|
312
|
+
var msAbs = Math.abs(ms2);
|
|
313
|
+
if (msAbs >= d) {
|
|
314
|
+
return Math.round(ms2 / d) + "d";
|
|
315
|
+
}
|
|
316
|
+
if (msAbs >= h) {
|
|
317
|
+
return Math.round(ms2 / h) + "h";
|
|
318
|
+
}
|
|
319
|
+
if (msAbs >= m) {
|
|
320
|
+
return Math.round(ms2 / m) + "m";
|
|
321
|
+
}
|
|
322
|
+
if (msAbs >= s) {
|
|
323
|
+
return Math.round(ms2 / s) + "s";
|
|
324
|
+
}
|
|
325
|
+
return ms2 + "ms";
|
|
326
|
+
}
|
|
327
|
+
function fmtLong(ms2) {
|
|
328
|
+
var msAbs = Math.abs(ms2);
|
|
329
|
+
if (msAbs >= d) {
|
|
330
|
+
return plural(ms2, msAbs, d, "day");
|
|
331
|
+
}
|
|
332
|
+
if (msAbs >= h) {
|
|
333
|
+
return plural(ms2, msAbs, h, "hour");
|
|
334
|
+
}
|
|
335
|
+
if (msAbs >= m) {
|
|
336
|
+
return plural(ms2, msAbs, m, "minute");
|
|
337
|
+
}
|
|
338
|
+
if (msAbs >= s) {
|
|
339
|
+
return plural(ms2, msAbs, s, "second");
|
|
340
|
+
}
|
|
341
|
+
return ms2 + " ms";
|
|
342
|
+
}
|
|
343
|
+
function plural(ms2, msAbs, n, name) {
|
|
344
|
+
var isPlural = msAbs >= n * 1.5;
|
|
345
|
+
return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : "");
|
|
346
|
+
}
|
|
347
|
+
return ms;
|
|
348
|
+
}
|
|
349
|
+
var common;
|
|
350
|
+
var hasRequiredCommon;
|
|
351
|
+
function requireCommon() {
|
|
352
|
+
if (hasRequiredCommon) return common;
|
|
353
|
+
hasRequiredCommon = 1;
|
|
354
|
+
function setup(env) {
|
|
355
|
+
createDebug.debug = createDebug;
|
|
356
|
+
createDebug.default = createDebug;
|
|
357
|
+
createDebug.coerce = coerce;
|
|
358
|
+
createDebug.disable = disable;
|
|
359
|
+
createDebug.enable = enable;
|
|
360
|
+
createDebug.enabled = enabled;
|
|
361
|
+
createDebug.humanize = requireMs();
|
|
362
|
+
createDebug.destroy = destroy;
|
|
363
|
+
Object.keys(env).forEach((key) => {
|
|
364
|
+
createDebug[key] = env[key];
|
|
365
|
+
});
|
|
366
|
+
createDebug.names = [];
|
|
367
|
+
createDebug.skips = [];
|
|
368
|
+
createDebug.formatters = {};
|
|
369
|
+
function selectColor(namespace) {
|
|
370
|
+
let hash = 0;
|
|
371
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
372
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
373
|
+
hash |= 0;
|
|
374
|
+
}
|
|
375
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
376
|
+
}
|
|
377
|
+
createDebug.selectColor = selectColor;
|
|
378
|
+
function createDebug(namespace) {
|
|
379
|
+
let prevTime;
|
|
380
|
+
let enableOverride = null;
|
|
381
|
+
let namespacesCache;
|
|
382
|
+
let enabledCache;
|
|
383
|
+
function debug(...args) {
|
|
384
|
+
if (!debug.enabled) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const self2 = debug;
|
|
388
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
389
|
+
const ms2 = curr - (prevTime || curr);
|
|
390
|
+
self2.diff = ms2;
|
|
391
|
+
self2.prev = prevTime;
|
|
392
|
+
self2.curr = curr;
|
|
393
|
+
prevTime = curr;
|
|
394
|
+
args[0] = createDebug.coerce(args[0]);
|
|
395
|
+
if (typeof args[0] !== "string") {
|
|
396
|
+
args.unshift("%O");
|
|
397
|
+
}
|
|
398
|
+
let index = 0;
|
|
399
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
400
|
+
if (match === "%%") {
|
|
401
|
+
return "%";
|
|
402
|
+
}
|
|
403
|
+
index++;
|
|
404
|
+
const formatter = createDebug.formatters[format];
|
|
405
|
+
if (typeof formatter === "function") {
|
|
406
|
+
const val = args[index];
|
|
407
|
+
match = formatter.call(self2, val);
|
|
408
|
+
args.splice(index, 1);
|
|
409
|
+
index--;
|
|
410
|
+
}
|
|
411
|
+
return match;
|
|
412
|
+
});
|
|
413
|
+
createDebug.formatArgs.call(self2, args);
|
|
414
|
+
const logFn = self2.log || createDebug.log;
|
|
415
|
+
logFn.apply(self2, args);
|
|
416
|
+
}
|
|
417
|
+
debug.namespace = namespace;
|
|
418
|
+
debug.useColors = createDebug.useColors();
|
|
419
|
+
debug.color = createDebug.selectColor(namespace);
|
|
420
|
+
debug.extend = extend;
|
|
421
|
+
debug.destroy = createDebug.destroy;
|
|
422
|
+
Object.defineProperty(debug, "enabled", {
|
|
423
|
+
enumerable: true,
|
|
424
|
+
configurable: false,
|
|
425
|
+
get: () => {
|
|
426
|
+
if (enableOverride !== null) {
|
|
427
|
+
return enableOverride;
|
|
428
|
+
}
|
|
429
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
430
|
+
namespacesCache = createDebug.namespaces;
|
|
431
|
+
enabledCache = createDebug.enabled(namespace);
|
|
432
|
+
}
|
|
433
|
+
return enabledCache;
|
|
434
|
+
},
|
|
435
|
+
set: (v) => {
|
|
436
|
+
enableOverride = v;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
if (typeof createDebug.init === "function") {
|
|
440
|
+
createDebug.init(debug);
|
|
441
|
+
}
|
|
442
|
+
return debug;
|
|
443
|
+
}
|
|
444
|
+
function extend(namespace, delimiter) {
|
|
445
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
446
|
+
newDebug.log = this.log;
|
|
447
|
+
return newDebug;
|
|
448
|
+
}
|
|
449
|
+
function enable(namespaces) {
|
|
450
|
+
createDebug.save(namespaces);
|
|
451
|
+
createDebug.namespaces = namespaces;
|
|
452
|
+
createDebug.names = [];
|
|
453
|
+
createDebug.skips = [];
|
|
454
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
455
|
+
for (const ns of split) {
|
|
456
|
+
if (ns[0] === "-") {
|
|
457
|
+
createDebug.skips.push(ns.slice(1));
|
|
458
|
+
} else {
|
|
459
|
+
createDebug.names.push(ns);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function matchesTemplate(search, template) {
|
|
464
|
+
let searchIndex = 0;
|
|
465
|
+
let templateIndex = 0;
|
|
466
|
+
let starIndex = -1;
|
|
467
|
+
let matchIndex = 0;
|
|
468
|
+
while (searchIndex < search.length) {
|
|
469
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
470
|
+
if (template[templateIndex] === "*") {
|
|
471
|
+
starIndex = templateIndex;
|
|
472
|
+
matchIndex = searchIndex;
|
|
473
|
+
templateIndex++;
|
|
474
|
+
} else {
|
|
475
|
+
searchIndex++;
|
|
476
|
+
templateIndex++;
|
|
477
|
+
}
|
|
478
|
+
} else if (starIndex !== -1) {
|
|
479
|
+
templateIndex = starIndex + 1;
|
|
480
|
+
matchIndex++;
|
|
481
|
+
searchIndex = matchIndex;
|
|
482
|
+
} else {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
487
|
+
templateIndex++;
|
|
488
|
+
}
|
|
489
|
+
return templateIndex === template.length;
|
|
490
|
+
}
|
|
491
|
+
function disable() {
|
|
492
|
+
const namespaces = [
|
|
493
|
+
...createDebug.names,
|
|
494
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
495
|
+
].join(",");
|
|
496
|
+
createDebug.enable("");
|
|
497
|
+
return namespaces;
|
|
498
|
+
}
|
|
499
|
+
function enabled(name) {
|
|
500
|
+
for (const skip of createDebug.skips) {
|
|
501
|
+
if (matchesTemplate(name, skip)) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
for (const ns of createDebug.names) {
|
|
506
|
+
if (matchesTemplate(name, ns)) {
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return false;
|
|
511
|
+
}
|
|
512
|
+
function coerce(val) {
|
|
513
|
+
if (val instanceof Error) {
|
|
514
|
+
return val.stack || val.message;
|
|
515
|
+
}
|
|
516
|
+
return val;
|
|
517
|
+
}
|
|
518
|
+
function destroy() {
|
|
519
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
520
|
+
}
|
|
521
|
+
createDebug.enable(createDebug.load());
|
|
522
|
+
return createDebug;
|
|
523
|
+
}
|
|
524
|
+
common = setup;
|
|
525
|
+
return common;
|
|
526
|
+
}
|
|
527
|
+
var hasRequiredBrowser;
|
|
528
|
+
function requireBrowser() {
|
|
529
|
+
if (hasRequiredBrowser) return browser.exports;
|
|
530
|
+
hasRequiredBrowser = 1;
|
|
531
|
+
(function(module2, exports3) {
|
|
532
|
+
exports3.formatArgs = formatArgs;
|
|
533
|
+
exports3.save = save;
|
|
534
|
+
exports3.load = load;
|
|
535
|
+
exports3.useColors = useColors;
|
|
536
|
+
exports3.storage = localstorage();
|
|
537
|
+
exports3.destroy = /* @__PURE__ */ (() => {
|
|
538
|
+
let warned = false;
|
|
539
|
+
return () => {
|
|
540
|
+
if (!warned) {
|
|
541
|
+
warned = true;
|
|
542
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
})();
|
|
546
|
+
exports3.colors = [
|
|
547
|
+
"#0000CC",
|
|
548
|
+
"#0000FF",
|
|
549
|
+
"#0033CC",
|
|
550
|
+
"#0033FF",
|
|
551
|
+
"#0066CC",
|
|
552
|
+
"#0066FF",
|
|
553
|
+
"#0099CC",
|
|
554
|
+
"#0099FF",
|
|
555
|
+
"#00CC00",
|
|
556
|
+
"#00CC33",
|
|
557
|
+
"#00CC66",
|
|
558
|
+
"#00CC99",
|
|
559
|
+
"#00CCCC",
|
|
560
|
+
"#00CCFF",
|
|
561
|
+
"#3300CC",
|
|
562
|
+
"#3300FF",
|
|
563
|
+
"#3333CC",
|
|
564
|
+
"#3333FF",
|
|
565
|
+
"#3366CC",
|
|
566
|
+
"#3366FF",
|
|
567
|
+
"#3399CC",
|
|
568
|
+
"#3399FF",
|
|
569
|
+
"#33CC00",
|
|
570
|
+
"#33CC33",
|
|
571
|
+
"#33CC66",
|
|
572
|
+
"#33CC99",
|
|
573
|
+
"#33CCCC",
|
|
574
|
+
"#33CCFF",
|
|
575
|
+
"#6600CC",
|
|
576
|
+
"#6600FF",
|
|
577
|
+
"#6633CC",
|
|
578
|
+
"#6633FF",
|
|
579
|
+
"#66CC00",
|
|
580
|
+
"#66CC33",
|
|
581
|
+
"#9900CC",
|
|
582
|
+
"#9900FF",
|
|
583
|
+
"#9933CC",
|
|
584
|
+
"#9933FF",
|
|
585
|
+
"#99CC00",
|
|
586
|
+
"#99CC33",
|
|
587
|
+
"#CC0000",
|
|
588
|
+
"#CC0033",
|
|
589
|
+
"#CC0066",
|
|
590
|
+
"#CC0099",
|
|
591
|
+
"#CC00CC",
|
|
592
|
+
"#CC00FF",
|
|
593
|
+
"#CC3300",
|
|
594
|
+
"#CC3333",
|
|
595
|
+
"#CC3366",
|
|
596
|
+
"#CC3399",
|
|
597
|
+
"#CC33CC",
|
|
598
|
+
"#CC33FF",
|
|
599
|
+
"#CC6600",
|
|
600
|
+
"#CC6633",
|
|
601
|
+
"#CC9900",
|
|
602
|
+
"#CC9933",
|
|
603
|
+
"#CCCC00",
|
|
604
|
+
"#CCCC33",
|
|
605
|
+
"#FF0000",
|
|
606
|
+
"#FF0033",
|
|
607
|
+
"#FF0066",
|
|
608
|
+
"#FF0099",
|
|
609
|
+
"#FF00CC",
|
|
610
|
+
"#FF00FF",
|
|
611
|
+
"#FF3300",
|
|
612
|
+
"#FF3333",
|
|
613
|
+
"#FF3366",
|
|
614
|
+
"#FF3399",
|
|
615
|
+
"#FF33CC",
|
|
616
|
+
"#FF33FF",
|
|
617
|
+
"#FF6600",
|
|
618
|
+
"#FF6633",
|
|
619
|
+
"#FF9900",
|
|
620
|
+
"#FF9933",
|
|
621
|
+
"#FFCC00",
|
|
622
|
+
"#FFCC33"
|
|
623
|
+
];
|
|
624
|
+
function useColors() {
|
|
625
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
626
|
+
return true;
|
|
627
|
+
}
|
|
628
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
let m;
|
|
632
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
633
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
634
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
635
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
636
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
637
|
+
}
|
|
638
|
+
function formatArgs(args) {
|
|
639
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
640
|
+
if (!this.useColors) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const c = "color: " + this.color;
|
|
644
|
+
args.splice(1, 0, c, "color: inherit");
|
|
645
|
+
let index = 0;
|
|
646
|
+
let lastC = 0;
|
|
647
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
648
|
+
if (match === "%%") {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
index++;
|
|
652
|
+
if (match === "%c") {
|
|
653
|
+
lastC = index;
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
args.splice(lastC, 0, c);
|
|
250
657
|
}
|
|
658
|
+
exports3.log = console.debug || console.log || (() => {
|
|
659
|
+
});
|
|
660
|
+
function save(namespaces) {
|
|
661
|
+
try {
|
|
662
|
+
if (namespaces) {
|
|
663
|
+
exports3.storage.setItem("debug", namespaces);
|
|
664
|
+
} else {
|
|
665
|
+
exports3.storage.removeItem("debug");
|
|
666
|
+
}
|
|
667
|
+
} catch (error) {
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function load() {
|
|
671
|
+
let r;
|
|
672
|
+
try {
|
|
673
|
+
r = exports3.storage.getItem("debug") || exports3.storage.getItem("DEBUG");
|
|
674
|
+
} catch (error) {
|
|
675
|
+
}
|
|
676
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
677
|
+
r = process.env.DEBUG;
|
|
678
|
+
}
|
|
679
|
+
return r;
|
|
680
|
+
}
|
|
681
|
+
function localstorage() {
|
|
682
|
+
try {
|
|
683
|
+
return localStorage;
|
|
684
|
+
} catch (error) {
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
module2.exports = requireCommon()(exports3);
|
|
688
|
+
const { formatters } = module2.exports;
|
|
689
|
+
formatters.j = function(v) {
|
|
690
|
+
try {
|
|
691
|
+
return JSON.stringify(v);
|
|
692
|
+
} catch (error) {
|
|
693
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
})(browser, browser.exports);
|
|
697
|
+
return browser.exports;
|
|
698
|
+
}
|
|
699
|
+
var hasRequiredDist;
|
|
700
|
+
function requireDist() {
|
|
701
|
+
if (hasRequiredDist) return dist;
|
|
702
|
+
hasRequiredDist = 1;
|
|
703
|
+
var __importDefault = dist && dist.__importDefault || function(mod) {
|
|
704
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
705
|
+
};
|
|
706
|
+
Object.defineProperty(dist, "__esModule", { value: true });
|
|
707
|
+
dist.NodeClusterAdapter = void 0;
|
|
708
|
+
dist.createAdapter = createAdapter;
|
|
709
|
+
dist.setupPrimary = setupPrimary;
|
|
710
|
+
const node_cluster_1 = __importDefault(require$$0);
|
|
711
|
+
const socket_io_adapter_1 = require$$1;
|
|
712
|
+
const debug_1 = __importDefault(requireBrowser());
|
|
713
|
+
const debug = (0, debug_1.default)("socket.io-cluster-adapter");
|
|
714
|
+
const MESSAGE_SOURCE = "_sio_adapter";
|
|
715
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
716
|
+
function ignoreError() {
|
|
251
717
|
}
|
|
252
|
-
|
|
253
|
-
|
|
718
|
+
function createAdapter(opts = {}) {
|
|
719
|
+
return function(nsp) {
|
|
720
|
+
return new NodeClusterAdapter(nsp, opts);
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
class NodeClusterAdapter extends socket_io_adapter_1.ClusterAdapterWithHeartbeat {
|
|
724
|
+
constructor(nsp, opts = {}) {
|
|
725
|
+
super(nsp, opts);
|
|
726
|
+
process.on("message", (message) => {
|
|
727
|
+
const isValidSource = (message === null || message === void 0 ? void 0 : message.source) === MESSAGE_SOURCE;
|
|
728
|
+
if (!isValidSource) {
|
|
729
|
+
debug("[%s] ignore unknown source", this.uid);
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
if (message.nsp !== this.nsp.name) {
|
|
733
|
+
debug("[%s] ignore other namespace", this.uid);
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
this.onMessage(message);
|
|
737
|
+
});
|
|
738
|
+
this.init();
|
|
739
|
+
}
|
|
740
|
+
doPublish(message) {
|
|
741
|
+
message.source = MESSAGE_SOURCE;
|
|
742
|
+
process.send(message, null, {}, ignoreError);
|
|
743
|
+
return Promise.resolve("");
|
|
744
|
+
}
|
|
745
|
+
doPublishResponse(requesterUid, response) {
|
|
746
|
+
response.source = MESSAGE_SOURCE;
|
|
747
|
+
response.requesterUid = requesterUid;
|
|
748
|
+
process.send(response, null, {}, ignoreError);
|
|
749
|
+
return Promise.resolve();
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
dist.NodeClusterAdapter = NodeClusterAdapter;
|
|
753
|
+
const UIDS = /* @__PURE__ */ Symbol("uids");
|
|
754
|
+
function setupPrimary() {
|
|
755
|
+
node_cluster_1.default.on("message", (worker, message) => {
|
|
756
|
+
var _a;
|
|
757
|
+
const isValidSource = (message === null || message === void 0 ? void 0 : message.source) === MESSAGE_SOURCE;
|
|
758
|
+
if (!isValidSource) {
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
worker[UIDS] = worker[UIDS] || /* @__PURE__ */ new Set();
|
|
762
|
+
worker[UIDS].add(message.uid);
|
|
763
|
+
switch (message.type) {
|
|
764
|
+
case socket_io_adapter_1.MessageType.FETCH_SOCKETS_RESPONSE:
|
|
765
|
+
case socket_io_adapter_1.MessageType.SERVER_SIDE_EMIT_RESPONSE:
|
|
766
|
+
const requesterUid = message.requesterUid;
|
|
767
|
+
for (const workerId in node_cluster_1.default.workers) {
|
|
768
|
+
if (hasOwnProperty.call(node_cluster_1.default.workers, workerId) && ((_a = node_cluster_1.default.workers[workerId][UIDS]) === null || _a === void 0 ? void 0 : _a.has(requesterUid))) {
|
|
769
|
+
node_cluster_1.default.workers[workerId].send(message, null, ignoreError);
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
break;
|
|
774
|
+
default:
|
|
775
|
+
const emitterIdAsString = String(worker.id);
|
|
776
|
+
for (const workerId in node_cluster_1.default.workers) {
|
|
777
|
+
if (hasOwnProperty.call(node_cluster_1.default.workers, workerId) && workerId !== emitterIdAsString) {
|
|
778
|
+
node_cluster_1.default.workers[workerId].send(message, null, ignoreError);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
return dist;
|
|
785
|
+
}
|
|
786
|
+
var distExports = requireDist();
|
|
787
|
+
class SocketIoServer {
|
|
788
|
+
namespace;
|
|
789
|
+
socketionamespace;
|
|
790
|
+
//protected socketionamespace?: Namespace<ClientToServerEvents, ServerToClientEvents, InterServerEvents>
|
|
791
|
+
logger;
|
|
792
|
+
io;
|
|
793
|
+
//#redisClient: RedisClientType | Redis | null = null;
|
|
794
|
+
redisClient;
|
|
795
|
+
constructor(namespace, logger) {
|
|
796
|
+
this.namespace = namespace;
|
|
797
|
+
this.logger = logger;
|
|
798
|
+
}
|
|
799
|
+
LogErrorMessage(message) {
|
|
800
|
+
if (this.logger) {
|
|
801
|
+
this.logger.error(`${this.namespace}: ${message}`);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
LogDebugMessage(message) {
|
|
805
|
+
if (this.logger) {
|
|
806
|
+
this.logger.debug(`${this.namespace}: ${message}`);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
LogInfoMessage(message) {
|
|
810
|
+
if (this.logger) {
|
|
811
|
+
this.logger.info(`${this.namespace}: ${message}`);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
LogWarnMessage(message) {
|
|
815
|
+
if (this.logger) {
|
|
816
|
+
this.logger.warn(`${this.namespace}: ${message}`);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
// https://socket.io/docs/v4/middlewares/
|
|
820
|
+
// https://socket.io/docs/v4/server-socket-instance/#sockethandshake
|
|
821
|
+
// https://socket.io/docs/v4/server-socket-instance/#socket-middlewares
|
|
822
|
+
// Use this middleward to check every incomming connection
|
|
823
|
+
SetupConnectionMiddleware = () => {
|
|
824
|
+
};
|
|
825
|
+
// Use this middleware to check every packet being received
|
|
826
|
+
SetupMessageMiddleware = (socket) => {
|
|
827
|
+
};
|
|
828
|
+
SocketConnectCallBack = (socket) => {
|
|
829
|
+
};
|
|
830
|
+
SocketEventsCallBack = (socket) => {
|
|
831
|
+
};
|
|
832
|
+
GetConfig = (socketIoServeroptions) => {
|
|
833
|
+
const options = {
|
|
834
|
+
transports: ["websocket"]
|
|
835
|
+
// or [ "websocket", "polling" ] (to use long-poolling. Note that the order matters)
|
|
836
|
+
};
|
|
837
|
+
if (socketIoServeroptions.ioRedisMessageProcessorUrl && socketIoServeroptions.ioRedisMessageProcessorUrl !== "") {
|
|
838
|
+
this.redisClient = new ioredis.Redis(socketIoServeroptions.ioRedisMessageProcessorUrl);
|
|
839
|
+
options.adapter = redisStreamsAdapter.createAdapter(this.redisClient);
|
|
840
|
+
} else if (socketIoServeroptions.serverClusterMode && socketIoServeroptions.serverClusterMode === true) {
|
|
841
|
+
options.adapter = distExports.createAdapter();
|
|
842
|
+
}
|
|
843
|
+
if (socketIoServeroptions.wssCustomPath && socketIoServeroptions.wssCustomPath.localeCompare("") !== 0) {
|
|
844
|
+
options.path = socketIoServeroptions.wssCustomPath;
|
|
845
|
+
}
|
|
846
|
+
return options;
|
|
847
|
+
};
|
|
848
|
+
SetEngineEvents = () => {
|
|
849
|
+
if (this.io) {
|
|
850
|
+
this.io.engine.on("connection_error", (err) => {
|
|
851
|
+
this.LogInfoMessage(err.req);
|
|
852
|
+
this.LogInfoMessage(err.code);
|
|
853
|
+
this.LogInfoMessage(err.message);
|
|
854
|
+
this.LogInfoMessage(err.context);
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
StartServer = async (socketIoServeroptions) => {
|
|
859
|
+
if (this.io) {
|
|
860
|
+
throw new Error(`SocketIoServer:StartServer(): Error: [Server already exists]`);
|
|
861
|
+
}
|
|
862
|
+
if (!socketIoServeroptions.listenPort) {
|
|
863
|
+
throw new Error(`SocketIoServer:StartServer(): Error: [listenPort not specified]`);
|
|
864
|
+
}
|
|
865
|
+
this.io = new socket_io.Server(socketIoServeroptions.listenPort, this.GetConfig(socketIoServeroptions));
|
|
866
|
+
this.SetEngineEvents();
|
|
867
|
+
await stsutils.Sleep(500);
|
|
868
|
+
};
|
|
869
|
+
AttachServer = async (server, socketIoServeroptions) => {
|
|
870
|
+
if (this.io) {
|
|
871
|
+
throw new Error(`SocketIoServer:AttachServer(): Error: [Server already attached]`);
|
|
872
|
+
}
|
|
873
|
+
if (socketIoServeroptions.listenPort) {
|
|
874
|
+
this.LogWarnMessage(`SocketIoServer:AttachServer(): Warning: [listenPort: [${socketIoServeroptions.listenPort}] has been specified, but ignored as attaching to existing server]`);
|
|
875
|
+
}
|
|
876
|
+
this.io = new socket_io.Server(server, this.GetConfig(socketIoServeroptions));
|
|
877
|
+
this.SetEngineEvents();
|
|
878
|
+
await stsutils.Sleep(500);
|
|
879
|
+
};
|
|
880
|
+
StopServer = async () => {
|
|
881
|
+
if (this.io) {
|
|
882
|
+
await this.CloseNamespaceAdaptors();
|
|
883
|
+
this.DisconnectNamespaceSockets();
|
|
884
|
+
await this.io.of("/").adapter.close();
|
|
885
|
+
if (this.redisClient) {
|
|
886
|
+
await this.redisClient.disconnect();
|
|
887
|
+
await stsutils.Sleep(50);
|
|
888
|
+
}
|
|
889
|
+
this.io.disconnectSockets();
|
|
890
|
+
this.io = void 0;
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
LeaveRoom = (socket, room) => {
|
|
894
|
+
this.LogDebugMessage(`Leaving room [${room}]`);
|
|
254
895
|
socket.leave(room);
|
|
255
896
|
};
|
|
256
|
-
JoinRoom = (
|
|
257
|
-
this.
|
|
897
|
+
JoinRoom = (socket, room) => {
|
|
898
|
+
this.LogDebugMessage(`Socket joining room [${room}], ID: [${socket.id}]`);
|
|
258
899
|
socket.join(room);
|
|
259
900
|
};
|
|
260
|
-
|
|
901
|
+
SetupStandardEvents = (socket) => {
|
|
261
902
|
socket.on("disconnect", (reason) => {
|
|
262
|
-
this.
|
|
903
|
+
this.LogDebugMessage(`socket disconnect, ID: [${socket.id}] [${reason}]`);
|
|
263
904
|
});
|
|
264
905
|
socket.on("disconnecting", (reason) => {
|
|
265
|
-
this.
|
|
906
|
+
this.LogDebugMessage(`socket disconnecting, ID: [${socket.id}] [${reason}]`);
|
|
266
907
|
});
|
|
267
908
|
socket.on("error", (error) => {
|
|
268
|
-
this.
|
|
909
|
+
this.LogDebugMessage(`socket error, ID: [${socket.id}] [${error}]`);
|
|
269
910
|
});
|
|
270
911
|
socket.on("__STSdisconnect", (reason) => {
|
|
271
|
-
this.
|
|
912
|
+
this.LogDebugMessage(`__STSdisconnect: socket disconnect, ID: [${socket.id}] [${reason}]`);
|
|
272
913
|
});
|
|
273
914
|
socket.on("__STSdisconnecting", (reason, callBackResult) => {
|
|
274
|
-
this.
|
|
915
|
+
this.LogDebugMessage(`__STSdisconnecting: socket disconnecting, ID: [${socket.id}] [${reason}]`);
|
|
275
916
|
callBackResult("__STSdisconnecting accepted by server.");
|
|
276
917
|
});
|
|
277
918
|
socket.on("__STSjoinRoom", (rooms) => {
|
|
278
919
|
rooms.forEach((room) => {
|
|
279
|
-
this.JoinRoom(
|
|
920
|
+
this.JoinRoom(socket, room);
|
|
280
921
|
});
|
|
281
922
|
});
|
|
282
923
|
socket.on("__STSleaveRoom", (rooms) => {
|
|
283
924
|
rooms.forEach((room) => {
|
|
284
|
-
this.LeaveRoom(
|
|
925
|
+
this.LeaveRoom(socket, room);
|
|
285
926
|
});
|
|
286
927
|
});
|
|
287
928
|
socket.on("__STSsendToRoom", (rooms, payload) => {
|
|
288
929
|
rooms.forEach((room) => {
|
|
289
|
-
this.
|
|
290
|
-
|
|
930
|
+
if (this.socketionamespace) {
|
|
931
|
+
this.LogDebugMessage(`socket.on: __STSsendToRoom: Sending to room [${room}], ID: [${socket.id}]`);
|
|
932
|
+
this.socketionamespace.to(room).emit(payload.command, payload);
|
|
933
|
+
}
|
|
291
934
|
});
|
|
292
935
|
});
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
936
|
+
socket.on("__STSsendToRoomWithCallback", (room, timeout, payload, cb) => {
|
|
937
|
+
if (this.socketionamespace) {
|
|
938
|
+
this.socketionamespace.to(room).timeout(timeout).emit(payload.command, payload, (err, dataResponse) => {
|
|
939
|
+
if (err) {
|
|
940
|
+
console.error(err);
|
|
941
|
+
const errorResponse = {
|
|
942
|
+
error: true,
|
|
943
|
+
errorName: err.name,
|
|
944
|
+
errorMessage: err.message
|
|
945
|
+
//errorCause: err.cause,
|
|
946
|
+
//errorStack: err.stack
|
|
947
|
+
};
|
|
948
|
+
this.LogErrorMessage(`__STSsendToRoomWithCallback broadcast (error): [${JSON.stringify(errorResponse)}]`);
|
|
949
|
+
cb(errorResponse);
|
|
950
|
+
} else {
|
|
951
|
+
this.LogDebugMessage(`__STSsendToRoomWithCallback broadcast: [${JSON.stringify(dataResponse)}]`);
|
|
952
|
+
cb(dataResponse);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
302
955
|
}
|
|
303
956
|
});
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
957
|
+
socket.on("__STSsendToRoomsWithCallback", (rooms, timeout, payload, cb) => {
|
|
958
|
+
const responses = [];
|
|
959
|
+
const timeoutForComplete = setTimeout(() => {
|
|
960
|
+
responses.push({
|
|
961
|
+
room: "",
|
|
962
|
+
responses: {
|
|
963
|
+
error: true,
|
|
964
|
+
errorName: "timeout",
|
|
965
|
+
errorMessage: `__STSsendToRoomsWithCallback timeout: [${timeout}] before all responses received`
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
cb(responses);
|
|
969
|
+
}, timeout).unref();
|
|
970
|
+
rooms.forEach((room) => {
|
|
971
|
+
if (this.socketionamespace) {
|
|
972
|
+
this.socketionamespace.to(room).timeout(timeout).emit(payload.command, payload, (err, dataResponse) => {
|
|
973
|
+
if (err) {
|
|
974
|
+
console.error(err);
|
|
975
|
+
const errorResponse = {
|
|
976
|
+
error: true,
|
|
977
|
+
errorName: err.name,
|
|
978
|
+
errorMessage: err.message
|
|
979
|
+
//errorCause: err.cause,
|
|
980
|
+
//errorStack: err.stack
|
|
981
|
+
};
|
|
982
|
+
this.LogErrorMessage(`__STSsendToRoomWithCallback broadcast (error): [${JSON.stringify(errorResponse)}]`);
|
|
983
|
+
responses.push({
|
|
984
|
+
room,
|
|
985
|
+
responses: errorResponse
|
|
986
|
+
});
|
|
987
|
+
} else {
|
|
988
|
+
this.LogDebugMessage(`__STSsendToRoomWithCallback broadcast: [${JSON.stringify(dataResponse)}]`);
|
|
989
|
+
responses.push({
|
|
990
|
+
room,
|
|
991
|
+
responses: dataResponse
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
if (responses.length === rooms.length) {
|
|
995
|
+
clearTimeout(timeoutForComplete);
|
|
996
|
+
cb(responses);
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
309
1001
|
});
|
|
310
1002
|
};
|
|
311
|
-
SetupNamespace = (
|
|
312
|
-
this
|
|
313
|
-
namespace
|
|
314
|
-
|
|
315
|
-
socketionamespace
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
if (socketConnectCallBack) {
|
|
1003
|
+
SetupNamespace = (rooms, autoJoinRooms) => {
|
|
1004
|
+
if (this.io) {
|
|
1005
|
+
this.socketionamespace = this.io.of(`/${this.namespace}/`);
|
|
1006
|
+
this.SetupConnectionMiddleware();
|
|
1007
|
+
this.socketionamespace.on("connection", (socket) => {
|
|
1008
|
+
this.LogDebugMessage(`Socket connected, ID: [${socket.id}]`);
|
|
1009
|
+
this.LogDebugMessage(`Authentication Handshake (auth): [${JSON.stringify(socket.handshake.auth)}]`);
|
|
1010
|
+
this.LogDebugMessage(`Authentication Handshake (host): [${JSON.stringify(socket.handshake.headers.host)}]`);
|
|
1011
|
+
this.LogDebugMessage(`Authentication Handshake (url): [${JSON.stringify(socket.handshake.url)}]`);
|
|
1012
|
+
this.LogDebugMessage(`Authentication Handshake: [${JSON.stringify(socket.handshake)}]`);
|
|
1013
|
+
this.SetupMessageMiddleware(socket);
|
|
1014
|
+
if (autoJoinRooms) {
|
|
1015
|
+
rooms.map((room) => {
|
|
1016
|
+
this.JoinRoom(socket, room);
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
this.SetupStandardEvents(socket);
|
|
329
1020
|
setTimeout(() => {
|
|
330
|
-
|
|
1021
|
+
this.SocketConnectCallBack(socket);
|
|
331
1022
|
}, 0);
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
return this
|
|
338
|
-
};
|
|
339
|
-
GetSTSSocketIONamespace = (namespace) => {
|
|
340
|
-
return this.#namespace[namespace];
|
|
341
|
-
};
|
|
342
|
-
GetSTSSocketIONamespaces = () => {
|
|
343
|
-
return this.#namespace;
|
|
1023
|
+
this.SocketEventsCallBack(socket);
|
|
1024
|
+
});
|
|
1025
|
+
} else {
|
|
1026
|
+
throw new Error("SocketIoServer:SetupNamespace(): Error: [No server attached");
|
|
1027
|
+
}
|
|
1028
|
+
return this;
|
|
344
1029
|
};
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
await
|
|
1030
|
+
CloseNamespaceAdaptors = async () => {
|
|
1031
|
+
if (this.socketionamespace) {
|
|
1032
|
+
await this.socketionamespace.adapter.close();
|
|
348
1033
|
}
|
|
349
1034
|
};
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1035
|
+
DisconnectNamespaceSockets = () => {
|
|
1036
|
+
if (this.socketionamespace) {
|
|
1037
|
+
this.socketionamespace.disconnectSockets();
|
|
1038
|
+
this.socketionamespace = void 0;
|
|
353
1039
|
}
|
|
354
|
-
this.#namespace = {};
|
|
355
1040
|
};
|
|
356
|
-
SetupEvent(event, eventCb) {
|
|
357
|
-
return this;
|
|
358
|
-
}
|
|
359
1041
|
}
|
|
360
1042
|
exports2.STSEvent = STSEvent;
|
|
361
1043
|
exports2.STSNamespace = STSNamespace;
|
|
362
1044
|
exports2.STSRoom = STSRoom;
|
|
363
1045
|
exports2.SocketIoClient = SocketIoClient;
|
|
364
|
-
exports2.
|
|
1046
|
+
exports2.SocketIoServer = SocketIoServer;
|
|
365
1047
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
366
1048
|
}));
|
|
367
1049
|
//# sourceMappingURL=stssocketioutils.umd.js.map
|