@nsshunt/stsuxvue 1.0.53 → 1.0.55
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/stsuxvue.mjs +753 -127
- package/dist/stsuxvue.mjs.map +1 -1
- package/dist/stsuxvue.umd.js +750 -129
- package/dist/stsuxvue.umd.js.map +1 -1
- package/package.json +3 -3
- package/types/plugins/observabilitySubscriberManager.d.ts +6 -1
- package/types/plugins/observabilitySubscriberManager.d.ts.map +1 -1
package/dist/stsuxvue.mjs
CHANGED
|
@@ -4,6 +4,11 @@ import { defineComponent, defineAsyncComponent, ref, createElementBlock, openBlo
|
|
|
4
4
|
import { Gauge, ObservabilitySocketIOSubscriber, ObservabilityRESTAPISubscriber, ObservabilitySubscriptionManager, SubscriptionTopic } from "@nsshunt/stsobservability";
|
|
5
5
|
import { defaultLogger } from "@nsshunt/stsutils";
|
|
6
6
|
import { io } from "socket.io-client";
|
|
7
|
+
import "socket.io";
|
|
8
|
+
import "ioredis";
|
|
9
|
+
import require$$0$2 from "node:cluster";
|
|
10
|
+
import require$$1$2 from "socket.io-adapter";
|
|
11
|
+
import "@socket.io/redis-streams-adapter";
|
|
7
12
|
var _estate = /* @__PURE__ */ ((_estate2) => {
|
|
8
13
|
_estate2["IDLE"] = "idle";
|
|
9
14
|
_estate2["STARTING"] = "starting";
|
|
@@ -311,7 +316,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
311
316
|
legend: {
|
|
312
317
|
show: false
|
|
313
318
|
}
|
|
314
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
315
319
|
};
|
|
316
320
|
__expose({
|
|
317
321
|
UpdateGraph
|
|
@@ -6009,9 +6013,9 @@ function createDOMPurify() {
|
|
|
6009
6013
|
return DOMPurify;
|
|
6010
6014
|
}
|
|
6011
6015
|
let {
|
|
6012
|
-
document
|
|
6016
|
+
document: document2
|
|
6013
6017
|
} = window2;
|
|
6014
|
-
const originalDocument =
|
|
6018
|
+
const originalDocument = document2;
|
|
6015
6019
|
const currentScript = originalDocument.currentScript;
|
|
6016
6020
|
const {
|
|
6017
6021
|
DocumentFragment,
|
|
@@ -6031,9 +6035,9 @@ function createDOMPurify() {
|
|
|
6031
6035
|
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
|
|
6032
6036
|
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
|
|
6033
6037
|
if (typeof HTMLTemplateElement === "function") {
|
|
6034
|
-
const template =
|
|
6038
|
+
const template = document2.createElement("template");
|
|
6035
6039
|
if (template.content && template.content.ownerDocument) {
|
|
6036
|
-
|
|
6040
|
+
document2 = template.content.ownerDocument;
|
|
6037
6041
|
}
|
|
6038
6042
|
}
|
|
6039
6043
|
let trustedTypesPolicy;
|
|
@@ -6043,7 +6047,7 @@ function createDOMPurify() {
|
|
|
6043
6047
|
createNodeIterator,
|
|
6044
6048
|
createDocumentFragment,
|
|
6045
6049
|
getElementsByTagName
|
|
6046
|
-
} =
|
|
6050
|
+
} = document2;
|
|
6047
6051
|
const {
|
|
6048
6052
|
importNode
|
|
6049
6053
|
} = originalDocument;
|
|
@@ -6141,7 +6145,7 @@ function createDOMPurify() {
|
|
|
6141
6145
|
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
|
6142
6146
|
let transformCaseFunc = null;
|
|
6143
6147
|
let CONFIG = null;
|
|
6144
|
-
const formElement =
|
|
6148
|
+
const formElement = document2.createElement("form");
|
|
6145
6149
|
const isRegexOrFunction = function isRegexOrFunction2(testValue) {
|
|
6146
6150
|
return testValue instanceof RegExp || testValue instanceof Function;
|
|
6147
6151
|
};
|
|
@@ -6403,7 +6407,7 @@ function createDOMPurify() {
|
|
|
6403
6407
|
}
|
|
6404
6408
|
const body = doc.body || doc.documentElement;
|
|
6405
6409
|
if (dirty && leadingWhitespace) {
|
|
6406
|
-
body.insertBefore(
|
|
6410
|
+
body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
6407
6411
|
}
|
|
6408
6412
|
if (NAMESPACE === HTML_NAMESPACE) {
|
|
6409
6413
|
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
|
|
@@ -6502,7 +6506,7 @@ function createDOMPurify() {
|
|
|
6502
6506
|
return false;
|
|
6503
6507
|
};
|
|
6504
6508
|
const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
|
|
6505
|
-
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in
|
|
6509
|
+
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
|
|
6506
6510
|
return false;
|
|
6507
6511
|
}
|
|
6508
6512
|
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR2, lcName)) ;
|
|
@@ -6891,8 +6895,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6891
6895
|
return retVal;
|
|
6892
6896
|
}, "") + "]";
|
|
6893
6897
|
};
|
|
6894
|
-
const convertMS = function(
|
|
6895
|
-
let s = Math.floor(
|
|
6898
|
+
const convertMS = function(ms2) {
|
|
6899
|
+
let s = Math.floor(ms2 / 1e3);
|
|
6896
6900
|
let m = Math.floor(s / 60);
|
|
6897
6901
|
s = s % 60;
|
|
6898
6902
|
let h = Math.floor(m / 60);
|
|
@@ -8338,16 +8342,16 @@ function requireAnsiStyles() {
|
|
|
8338
8342
|
})(ansiStyles);
|
|
8339
8343
|
return ansiStyles.exports;
|
|
8340
8344
|
}
|
|
8341
|
-
var browser;
|
|
8342
|
-
var hasRequiredBrowser;
|
|
8343
|
-
function requireBrowser() {
|
|
8344
|
-
if (hasRequiredBrowser) return browser;
|
|
8345
|
-
hasRequiredBrowser = 1;
|
|
8346
|
-
browser = {
|
|
8345
|
+
var browser$1;
|
|
8346
|
+
var hasRequiredBrowser$1;
|
|
8347
|
+
function requireBrowser$1() {
|
|
8348
|
+
if (hasRequiredBrowser$1) return browser$1;
|
|
8349
|
+
hasRequiredBrowser$1 = 1;
|
|
8350
|
+
browser$1 = {
|
|
8347
8351
|
stdout: false,
|
|
8348
8352
|
stderr: false
|
|
8349
8353
|
};
|
|
8350
|
-
return browser;
|
|
8354
|
+
return browser$1;
|
|
8351
8355
|
}
|
|
8352
8356
|
var util;
|
|
8353
8357
|
var hasRequiredUtil;
|
|
@@ -8508,7 +8512,7 @@ function requireSource() {
|
|
|
8508
8512
|
if (hasRequiredSource) return source;
|
|
8509
8513
|
hasRequiredSource = 1;
|
|
8510
8514
|
const ansiStyles2 = requireAnsiStyles();
|
|
8511
|
-
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
|
|
8515
|
+
const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser$1();
|
|
8512
8516
|
const {
|
|
8513
8517
|
stringReplaceAll,
|
|
8514
8518
|
stringEncaseCRLFWithFirstIndex
|
|
@@ -8819,8 +8823,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
8819
8823
|
return "";
|
|
8820
8824
|
}
|
|
8821
8825
|
};
|
|
8822
|
-
const convertMS = function(
|
|
8823
|
-
let s = Math.floor(
|
|
8826
|
+
const convertMS = function(ms2) {
|
|
8827
|
+
let s = Math.floor(ms2 / 1e3);
|
|
8824
8828
|
let m = Math.floor(s / 60);
|
|
8825
8829
|
s = s % 60;
|
|
8826
8830
|
let h = Math.floor(m / 60);
|
|
@@ -9992,50 +9996,99 @@ function v4(options, buf, offset) {
|
|
|
9992
9996
|
return _v4(options);
|
|
9993
9997
|
}
|
|
9994
9998
|
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
9995
|
-
class
|
|
9996
|
-
#
|
|
9997
|
-
#
|
|
9998
|
-
|
|
9999
|
-
|
|
9999
|
+
class SocketIoClient {
|
|
10000
|
+
#agentManager;
|
|
10001
|
+
#logger;
|
|
10002
|
+
#name;
|
|
10003
|
+
#address;
|
|
10004
|
+
#socketIoCustomPath;
|
|
10005
|
+
#authToken;
|
|
10006
|
+
#socket;
|
|
10007
|
+
constructor(name) {
|
|
10008
|
+
this.#name = name;
|
|
10000
10009
|
}
|
|
10001
10010
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10002
|
-
|
|
10003
|
-
if (this.#
|
|
10011
|
+
LogDebugMessage(message) {
|
|
10012
|
+
if (this.#logger) this.#logger.debug(message);
|
|
10004
10013
|
}
|
|
10005
10014
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10006
|
-
|
|
10007
|
-
if (this.#
|
|
10015
|
+
LogErrorMessage(message) {
|
|
10016
|
+
if (this.#logger) this.#logger.error(message);
|
|
10008
10017
|
}
|
|
10009
|
-
get
|
|
10010
|
-
return this.#
|
|
10018
|
+
get name() {
|
|
10019
|
+
return this.#name;
|
|
10011
10020
|
}
|
|
10012
|
-
|
|
10013
|
-
this
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
this.#
|
|
10020
|
-
|
|
10021
|
+
get agentManager() {
|
|
10022
|
+
return this.#agentManager;
|
|
10023
|
+
}
|
|
10024
|
+
get logger() {
|
|
10025
|
+
return this.#logger;
|
|
10026
|
+
}
|
|
10027
|
+
get address() {
|
|
10028
|
+
return this.#address;
|
|
10029
|
+
}
|
|
10030
|
+
get authToken() {
|
|
10031
|
+
return this.#authToken;
|
|
10032
|
+
}
|
|
10033
|
+
get socketIoCustomPath() {
|
|
10034
|
+
return this.#socketIoCustomPath;
|
|
10035
|
+
}
|
|
10036
|
+
get socket() {
|
|
10037
|
+
return this.#socket;
|
|
10038
|
+
}
|
|
10039
|
+
WithAddress(address) {
|
|
10040
|
+
this.#address = address;
|
|
10041
|
+
return this;
|
|
10042
|
+
}
|
|
10043
|
+
WithAuthToken(authToken) {
|
|
10044
|
+
this.#authToken = authToken;
|
|
10045
|
+
return this;
|
|
10046
|
+
}
|
|
10047
|
+
WithSocketIoCustomPath(socketIoCustomPath) {
|
|
10048
|
+
this.#socketIoCustomPath = socketIoCustomPath;
|
|
10049
|
+
return this;
|
|
10050
|
+
}
|
|
10051
|
+
WithLogger(logger) {
|
|
10052
|
+
this.#logger = logger;
|
|
10053
|
+
return this;
|
|
10054
|
+
}
|
|
10055
|
+
WithAgentManager(agentManager) {
|
|
10056
|
+
this.#agentManager = agentManager;
|
|
10057
|
+
return this;
|
|
10058
|
+
}
|
|
10059
|
+
SetupSocket() {
|
|
10060
|
+
if (!this.#address) {
|
|
10061
|
+
throw new Error(`SocketIoClientHelper:SetupSocket(): Error: [address not provided]`);
|
|
10062
|
+
}
|
|
10063
|
+
this.#EstablishSocketConnect();
|
|
10064
|
+
return this;
|
|
10021
10065
|
}
|
|
10022
|
-
|
|
10023
|
-
|
|
10066
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10067
|
+
ConnectCallBack(socket) {
|
|
10024
10068
|
}
|
|
10025
|
-
|
|
10026
|
-
|
|
10069
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10070
|
+
SocketEventsCallBack(socket) {
|
|
10027
10071
|
}
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10072
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10073
|
+
ErrorCallBack(error) {
|
|
10074
|
+
}
|
|
10075
|
+
emit(ev, ...args) {
|
|
10076
|
+
if (this.#socket) {
|
|
10077
|
+
return this.#socket.emit(ev, ...args);
|
|
10078
|
+
} else {
|
|
10079
|
+
throw new Error("SocketIoClient:emit(): Error: [socket instance not defined.]");
|
|
10080
|
+
}
|
|
10081
|
+
}
|
|
10082
|
+
#EstablishSocketConnect() {
|
|
10083
|
+
if (this.#socket !== void 0) {
|
|
10084
|
+
if (this.#socket.connected === true) {
|
|
10085
|
+
this.#socket.disconnect();
|
|
10033
10086
|
}
|
|
10034
|
-
|
|
10087
|
+
this.#socket = void 0;
|
|
10035
10088
|
if (isNode) {
|
|
10036
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10089
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100).unref();
|
|
10037
10090
|
} else {
|
|
10038
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10091
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100);
|
|
10039
10092
|
}
|
|
10040
10093
|
return;
|
|
10041
10094
|
}
|
|
@@ -10044,91 +10097,92 @@ class SocketIoClientHelper {
|
|
|
10044
10097
|
socketOptions = {
|
|
10045
10098
|
transports: ["websocket"]
|
|
10046
10099
|
};
|
|
10047
|
-
if (this.#
|
|
10048
|
-
|
|
10100
|
+
if (this.#agentManager) {
|
|
10101
|
+
if (!this.#address) {
|
|
10102
|
+
throw new Error(`SocketIoClientHelper:SetupSocket(): Error: [address not provided when using agentManager]`);
|
|
10103
|
+
}
|
|
10104
|
+
socketOptions.agent = this.#agentManager.GetAgent(this.#address);
|
|
10049
10105
|
}
|
|
10050
10106
|
} else {
|
|
10051
10107
|
socketOptions = {
|
|
10052
10108
|
transports: ["websocket"]
|
|
10053
10109
|
};
|
|
10054
10110
|
}
|
|
10055
|
-
if (
|
|
10056
|
-
socketOptions.
|
|
10111
|
+
if (this.#authToken) {
|
|
10112
|
+
socketOptions.auth = (cb) => {
|
|
10113
|
+
cb({
|
|
10114
|
+
token: this.#authToken
|
|
10115
|
+
});
|
|
10116
|
+
};
|
|
10057
10117
|
}
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
this
|
|
10118
|
+
if (this.#socketIoCustomPath && this.#socketIoCustomPath.localeCompare("") !== 0) {
|
|
10119
|
+
socketOptions.path = this.#socketIoCustomPath;
|
|
10120
|
+
}
|
|
10121
|
+
this.#socket = io(this.#address, socketOptions);
|
|
10122
|
+
this.#socket.io.on("error", (err) => {
|
|
10123
|
+
this.LogErrorMessage(`SocketIoClientHelper(): socketDetail.socket.io.on('error'): [${err}] Address: [${this.#address}]`);
|
|
10064
10124
|
});
|
|
10065
|
-
|
|
10066
|
-
this
|
|
10125
|
+
this.#socket.io.on("reconnect_error", (err) => {
|
|
10126
|
+
this.LogErrorMessage(`SocketIoClientHelper(): socketDetail.socket.io.on('reconnect_error'): [${err}] Address: [${this.#address}]`);
|
|
10067
10127
|
});
|
|
10068
|
-
|
|
10069
|
-
this
|
|
10128
|
+
this.#socket.on("connect_error", (err) => {
|
|
10129
|
+
this.LogErrorMessage(`SocketIoClientHelper(): socketDetail.socket.on('connect_error'): [${err}] Address: [${this.#address}]`);
|
|
10070
10130
|
});
|
|
10071
|
-
|
|
10072
|
-
this
|
|
10131
|
+
this.#socket.io.on("reconnect", (attempt) => {
|
|
10132
|
+
this.LogErrorMessage(`SocketIoClientHelper(): socketDetail.socket.io.on('reconnect'): Number: [${attempt}] Address: [${this.#address}]`);
|
|
10073
10133
|
});
|
|
10074
|
-
|
|
10075
|
-
if (
|
|
10076
|
-
this
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
}
|
|
10082
|
-
if (socketEventsCallBack) {
|
|
10083
|
-
socketEventsCallBack(socketDetail.socket);
|
|
10084
|
-
}
|
|
10134
|
+
this.#socket.on("connect", () => {
|
|
10135
|
+
if (this.#socket) {
|
|
10136
|
+
this.LogDebugMessage(`SocketIoClientHelper(): Socket: [${this.#socket.id}]: connected, Address: [${this.#address}]`);
|
|
10137
|
+
setTimeout(() => {
|
|
10138
|
+
this.ConnectCallBack(this.#socket);
|
|
10139
|
+
}, 0);
|
|
10140
|
+
this.SocketEventsCallBack(this.#socket);
|
|
10085
10141
|
} else {
|
|
10086
10142
|
const errorMessage = "SocketIoClientHelper(): Could not get socket object from socket.io, Address: [${socketDetail.address}]";
|
|
10087
|
-
this
|
|
10088
|
-
|
|
10143
|
+
this.LogErrorMessage(errorMessage);
|
|
10144
|
+
this.ErrorCallBack(new Error(errorMessage));
|
|
10089
10145
|
}
|
|
10090
10146
|
});
|
|
10091
|
-
|
|
10092
|
-
this
|
|
10147
|
+
this.#socket.on("disconnect", (reason) => {
|
|
10148
|
+
this.LogDebugMessage("SocketIoClientHelper(): socket disconnect: " + reason);
|
|
10093
10149
|
switch (reason) {
|
|
10094
10150
|
case "io server disconnect":
|
|
10095
10151
|
{
|
|
10096
|
-
this
|
|
10097
|
-
this
|
|
10098
|
-
|
|
10099
|
-
socketDetail2.socket = null;
|
|
10152
|
+
this.LogDebugMessage("SocketIoClientHelper(): The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
10153
|
+
this.LogDebugMessage("SocketIoClientHelper(): The connection will be re-established when the server becomes available.");
|
|
10154
|
+
this.#socket = void 0;
|
|
10100
10155
|
if (isNode) {
|
|
10101
|
-
if (this.#
|
|
10102
|
-
this.#
|
|
10156
|
+
if (this.#agentManager) {
|
|
10157
|
+
this.#agentManager.ResetAgent();
|
|
10103
10158
|
}
|
|
10104
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10159
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100).unref();
|
|
10105
10160
|
} else {
|
|
10106
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10161
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100);
|
|
10107
10162
|
}
|
|
10108
10163
|
}
|
|
10109
10164
|
break;
|
|
10110
10165
|
case "io client disconnect":
|
|
10111
|
-
this
|
|
10112
|
-
this
|
|
10166
|
+
this.LogDebugMessage("SocketIoClientHelper(): The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
|
|
10167
|
+
this.LogDebugMessage("SocketIoClientHelper(): The connection will not be re-established automatically.");
|
|
10113
10168
|
break;
|
|
10114
10169
|
case "transport close":
|
|
10115
10170
|
case "ping timeout":
|
|
10116
10171
|
case "transport error":
|
|
10117
10172
|
{
|
|
10118
|
-
this
|
|
10119
|
-
this
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
socketDetail2.socket.disconnect();
|
|
10173
|
+
this.LogDebugMessage(`SocketIoClientHelper(): Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
10174
|
+
this.LogDebugMessage("SocketIoClientHelper(): The connection will be re-established when the server becomes available.");
|
|
10175
|
+
if (this.#socket) {
|
|
10176
|
+
this.#socket.disconnect();
|
|
10123
10177
|
}
|
|
10124
|
-
|
|
10178
|
+
this.#socket = void 0;
|
|
10125
10179
|
if (isNode) {
|
|
10126
|
-
if (this.#
|
|
10127
|
-
this.#
|
|
10180
|
+
if (this.#agentManager) {
|
|
10181
|
+
this.#agentManager?.ResetAgent();
|
|
10128
10182
|
}
|
|
10129
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10183
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100).unref();
|
|
10130
10184
|
} else {
|
|
10131
|
-
setTimeout(() => this.#EstablishSocketConnect(
|
|
10185
|
+
setTimeout(() => this.#EstablishSocketConnect(), 100);
|
|
10132
10186
|
}
|
|
10133
10187
|
}
|
|
10134
10188
|
break;
|
|
@@ -10136,6 +10190,563 @@ class SocketIoClientHelper {
|
|
|
10136
10190
|
});
|
|
10137
10191
|
}
|
|
10138
10192
|
}
|
|
10193
|
+
var dist = {};
|
|
10194
|
+
var browser = { exports: {} };
|
|
10195
|
+
var ms;
|
|
10196
|
+
var hasRequiredMs;
|
|
10197
|
+
function requireMs() {
|
|
10198
|
+
if (hasRequiredMs) return ms;
|
|
10199
|
+
hasRequiredMs = 1;
|
|
10200
|
+
var s = 1e3;
|
|
10201
|
+
var m = s * 60;
|
|
10202
|
+
var h = m * 60;
|
|
10203
|
+
var d = h * 24;
|
|
10204
|
+
var w = d * 7;
|
|
10205
|
+
var y = d * 365.25;
|
|
10206
|
+
ms = function(val, options) {
|
|
10207
|
+
options = options || {};
|
|
10208
|
+
var type = typeof val;
|
|
10209
|
+
if (type === "string" && val.length > 0) {
|
|
10210
|
+
return parse(val);
|
|
10211
|
+
} else if (type === "number" && isFinite(val)) {
|
|
10212
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
10213
|
+
}
|
|
10214
|
+
throw new Error(
|
|
10215
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
10216
|
+
);
|
|
10217
|
+
};
|
|
10218
|
+
function parse(str) {
|
|
10219
|
+
str = String(str);
|
|
10220
|
+
if (str.length > 100) {
|
|
10221
|
+
return;
|
|
10222
|
+
}
|
|
10223
|
+
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(
|
|
10224
|
+
str
|
|
10225
|
+
);
|
|
10226
|
+
if (!match) {
|
|
10227
|
+
return;
|
|
10228
|
+
}
|
|
10229
|
+
var n = parseFloat(match[1]);
|
|
10230
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
10231
|
+
switch (type) {
|
|
10232
|
+
case "years":
|
|
10233
|
+
case "year":
|
|
10234
|
+
case "yrs":
|
|
10235
|
+
case "yr":
|
|
10236
|
+
case "y":
|
|
10237
|
+
return n * y;
|
|
10238
|
+
case "weeks":
|
|
10239
|
+
case "week":
|
|
10240
|
+
case "w":
|
|
10241
|
+
return n * w;
|
|
10242
|
+
case "days":
|
|
10243
|
+
case "day":
|
|
10244
|
+
case "d":
|
|
10245
|
+
return n * d;
|
|
10246
|
+
case "hours":
|
|
10247
|
+
case "hour":
|
|
10248
|
+
case "hrs":
|
|
10249
|
+
case "hr":
|
|
10250
|
+
case "h":
|
|
10251
|
+
return n * h;
|
|
10252
|
+
case "minutes":
|
|
10253
|
+
case "minute":
|
|
10254
|
+
case "mins":
|
|
10255
|
+
case "min":
|
|
10256
|
+
case "m":
|
|
10257
|
+
return n * m;
|
|
10258
|
+
case "seconds":
|
|
10259
|
+
case "second":
|
|
10260
|
+
case "secs":
|
|
10261
|
+
case "sec":
|
|
10262
|
+
case "s":
|
|
10263
|
+
return n * s;
|
|
10264
|
+
case "milliseconds":
|
|
10265
|
+
case "millisecond":
|
|
10266
|
+
case "msecs":
|
|
10267
|
+
case "msec":
|
|
10268
|
+
case "ms":
|
|
10269
|
+
return n;
|
|
10270
|
+
default:
|
|
10271
|
+
return void 0;
|
|
10272
|
+
}
|
|
10273
|
+
}
|
|
10274
|
+
function fmtShort(ms2) {
|
|
10275
|
+
var msAbs = Math.abs(ms2);
|
|
10276
|
+
if (msAbs >= d) {
|
|
10277
|
+
return Math.round(ms2 / d) + "d";
|
|
10278
|
+
}
|
|
10279
|
+
if (msAbs >= h) {
|
|
10280
|
+
return Math.round(ms2 / h) + "h";
|
|
10281
|
+
}
|
|
10282
|
+
if (msAbs >= m) {
|
|
10283
|
+
return Math.round(ms2 / m) + "m";
|
|
10284
|
+
}
|
|
10285
|
+
if (msAbs >= s) {
|
|
10286
|
+
return Math.round(ms2 / s) + "s";
|
|
10287
|
+
}
|
|
10288
|
+
return ms2 + "ms";
|
|
10289
|
+
}
|
|
10290
|
+
function fmtLong(ms2) {
|
|
10291
|
+
var msAbs = Math.abs(ms2);
|
|
10292
|
+
if (msAbs >= d) {
|
|
10293
|
+
return plural(ms2, msAbs, d, "day");
|
|
10294
|
+
}
|
|
10295
|
+
if (msAbs >= h) {
|
|
10296
|
+
return plural(ms2, msAbs, h, "hour");
|
|
10297
|
+
}
|
|
10298
|
+
if (msAbs >= m) {
|
|
10299
|
+
return plural(ms2, msAbs, m, "minute");
|
|
10300
|
+
}
|
|
10301
|
+
if (msAbs >= s) {
|
|
10302
|
+
return plural(ms2, msAbs, s, "second");
|
|
10303
|
+
}
|
|
10304
|
+
return ms2 + " ms";
|
|
10305
|
+
}
|
|
10306
|
+
function plural(ms2, msAbs, n, name) {
|
|
10307
|
+
var isPlural = msAbs >= n * 1.5;
|
|
10308
|
+
return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : "");
|
|
10309
|
+
}
|
|
10310
|
+
return ms;
|
|
10311
|
+
}
|
|
10312
|
+
var common;
|
|
10313
|
+
var hasRequiredCommon;
|
|
10314
|
+
function requireCommon() {
|
|
10315
|
+
if (hasRequiredCommon) return common;
|
|
10316
|
+
hasRequiredCommon = 1;
|
|
10317
|
+
function setup(env) {
|
|
10318
|
+
createDebug.debug = createDebug;
|
|
10319
|
+
createDebug.default = createDebug;
|
|
10320
|
+
createDebug.coerce = coerce;
|
|
10321
|
+
createDebug.disable = disable;
|
|
10322
|
+
createDebug.enable = enable;
|
|
10323
|
+
createDebug.enabled = enabled;
|
|
10324
|
+
createDebug.humanize = requireMs();
|
|
10325
|
+
createDebug.destroy = destroy;
|
|
10326
|
+
Object.keys(env).forEach((key) => {
|
|
10327
|
+
createDebug[key] = env[key];
|
|
10328
|
+
});
|
|
10329
|
+
createDebug.names = [];
|
|
10330
|
+
createDebug.skips = [];
|
|
10331
|
+
createDebug.formatters = {};
|
|
10332
|
+
function selectColor(namespace) {
|
|
10333
|
+
let hash = 0;
|
|
10334
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
10335
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
10336
|
+
hash |= 0;
|
|
10337
|
+
}
|
|
10338
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
10339
|
+
}
|
|
10340
|
+
createDebug.selectColor = selectColor;
|
|
10341
|
+
function createDebug(namespace) {
|
|
10342
|
+
let prevTime;
|
|
10343
|
+
let enableOverride = null;
|
|
10344
|
+
let namespacesCache;
|
|
10345
|
+
let enabledCache;
|
|
10346
|
+
function debug(...args) {
|
|
10347
|
+
if (!debug.enabled) {
|
|
10348
|
+
return;
|
|
10349
|
+
}
|
|
10350
|
+
const self = debug;
|
|
10351
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
10352
|
+
const ms2 = curr - (prevTime || curr);
|
|
10353
|
+
self.diff = ms2;
|
|
10354
|
+
self.prev = prevTime;
|
|
10355
|
+
self.curr = curr;
|
|
10356
|
+
prevTime = curr;
|
|
10357
|
+
args[0] = createDebug.coerce(args[0]);
|
|
10358
|
+
if (typeof args[0] !== "string") {
|
|
10359
|
+
args.unshift("%O");
|
|
10360
|
+
}
|
|
10361
|
+
let index = 0;
|
|
10362
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
10363
|
+
if (match === "%%") {
|
|
10364
|
+
return "%";
|
|
10365
|
+
}
|
|
10366
|
+
index++;
|
|
10367
|
+
const formatter = createDebug.formatters[format];
|
|
10368
|
+
if (typeof formatter === "function") {
|
|
10369
|
+
const val = args[index];
|
|
10370
|
+
match = formatter.call(self, val);
|
|
10371
|
+
args.splice(index, 1);
|
|
10372
|
+
index--;
|
|
10373
|
+
}
|
|
10374
|
+
return match;
|
|
10375
|
+
});
|
|
10376
|
+
createDebug.formatArgs.call(self, args);
|
|
10377
|
+
const logFn = self.log || createDebug.log;
|
|
10378
|
+
logFn.apply(self, args);
|
|
10379
|
+
}
|
|
10380
|
+
debug.namespace = namespace;
|
|
10381
|
+
debug.useColors = createDebug.useColors();
|
|
10382
|
+
debug.color = createDebug.selectColor(namespace);
|
|
10383
|
+
debug.extend = extend;
|
|
10384
|
+
debug.destroy = createDebug.destroy;
|
|
10385
|
+
Object.defineProperty(debug, "enabled", {
|
|
10386
|
+
enumerable: true,
|
|
10387
|
+
configurable: false,
|
|
10388
|
+
get: () => {
|
|
10389
|
+
if (enableOverride !== null) {
|
|
10390
|
+
return enableOverride;
|
|
10391
|
+
}
|
|
10392
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
10393
|
+
namespacesCache = createDebug.namespaces;
|
|
10394
|
+
enabledCache = createDebug.enabled(namespace);
|
|
10395
|
+
}
|
|
10396
|
+
return enabledCache;
|
|
10397
|
+
},
|
|
10398
|
+
set: (v) => {
|
|
10399
|
+
enableOverride = v;
|
|
10400
|
+
}
|
|
10401
|
+
});
|
|
10402
|
+
if (typeof createDebug.init === "function") {
|
|
10403
|
+
createDebug.init(debug);
|
|
10404
|
+
}
|
|
10405
|
+
return debug;
|
|
10406
|
+
}
|
|
10407
|
+
function extend(namespace, delimiter) {
|
|
10408
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
10409
|
+
newDebug.log = this.log;
|
|
10410
|
+
return newDebug;
|
|
10411
|
+
}
|
|
10412
|
+
function enable(namespaces) {
|
|
10413
|
+
createDebug.save(namespaces);
|
|
10414
|
+
createDebug.namespaces = namespaces;
|
|
10415
|
+
createDebug.names = [];
|
|
10416
|
+
createDebug.skips = [];
|
|
10417
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
10418
|
+
for (const ns of split) {
|
|
10419
|
+
if (ns[0] === "-") {
|
|
10420
|
+
createDebug.skips.push(ns.slice(1));
|
|
10421
|
+
} else {
|
|
10422
|
+
createDebug.names.push(ns);
|
|
10423
|
+
}
|
|
10424
|
+
}
|
|
10425
|
+
}
|
|
10426
|
+
function matchesTemplate(search, template) {
|
|
10427
|
+
let searchIndex = 0;
|
|
10428
|
+
let templateIndex = 0;
|
|
10429
|
+
let starIndex = -1;
|
|
10430
|
+
let matchIndex = 0;
|
|
10431
|
+
while (searchIndex < search.length) {
|
|
10432
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
10433
|
+
if (template[templateIndex] === "*") {
|
|
10434
|
+
starIndex = templateIndex;
|
|
10435
|
+
matchIndex = searchIndex;
|
|
10436
|
+
templateIndex++;
|
|
10437
|
+
} else {
|
|
10438
|
+
searchIndex++;
|
|
10439
|
+
templateIndex++;
|
|
10440
|
+
}
|
|
10441
|
+
} else if (starIndex !== -1) {
|
|
10442
|
+
templateIndex = starIndex + 1;
|
|
10443
|
+
matchIndex++;
|
|
10444
|
+
searchIndex = matchIndex;
|
|
10445
|
+
} else {
|
|
10446
|
+
return false;
|
|
10447
|
+
}
|
|
10448
|
+
}
|
|
10449
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
10450
|
+
templateIndex++;
|
|
10451
|
+
}
|
|
10452
|
+
return templateIndex === template.length;
|
|
10453
|
+
}
|
|
10454
|
+
function disable() {
|
|
10455
|
+
const namespaces = [
|
|
10456
|
+
...createDebug.names,
|
|
10457
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
10458
|
+
].join(",");
|
|
10459
|
+
createDebug.enable("");
|
|
10460
|
+
return namespaces;
|
|
10461
|
+
}
|
|
10462
|
+
function enabled(name) {
|
|
10463
|
+
for (const skip of createDebug.skips) {
|
|
10464
|
+
if (matchesTemplate(name, skip)) {
|
|
10465
|
+
return false;
|
|
10466
|
+
}
|
|
10467
|
+
}
|
|
10468
|
+
for (const ns of createDebug.names) {
|
|
10469
|
+
if (matchesTemplate(name, ns)) {
|
|
10470
|
+
return true;
|
|
10471
|
+
}
|
|
10472
|
+
}
|
|
10473
|
+
return false;
|
|
10474
|
+
}
|
|
10475
|
+
function coerce(val) {
|
|
10476
|
+
if (val instanceof Error) {
|
|
10477
|
+
return val.stack || val.message;
|
|
10478
|
+
}
|
|
10479
|
+
return val;
|
|
10480
|
+
}
|
|
10481
|
+
function destroy() {
|
|
10482
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
10483
|
+
}
|
|
10484
|
+
createDebug.enable(createDebug.load());
|
|
10485
|
+
return createDebug;
|
|
10486
|
+
}
|
|
10487
|
+
common = setup;
|
|
10488
|
+
return common;
|
|
10489
|
+
}
|
|
10490
|
+
var hasRequiredBrowser;
|
|
10491
|
+
function requireBrowser() {
|
|
10492
|
+
if (hasRequiredBrowser) return browser.exports;
|
|
10493
|
+
hasRequiredBrowser = 1;
|
|
10494
|
+
(function(module, exports) {
|
|
10495
|
+
exports.formatArgs = formatArgs;
|
|
10496
|
+
exports.save = save;
|
|
10497
|
+
exports.load = load;
|
|
10498
|
+
exports.useColors = useColors;
|
|
10499
|
+
exports.storage = localstorage();
|
|
10500
|
+
exports.destroy = /* @__PURE__ */ (() => {
|
|
10501
|
+
let warned = false;
|
|
10502
|
+
return () => {
|
|
10503
|
+
if (!warned) {
|
|
10504
|
+
warned = true;
|
|
10505
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
10506
|
+
}
|
|
10507
|
+
};
|
|
10508
|
+
})();
|
|
10509
|
+
exports.colors = [
|
|
10510
|
+
"#0000CC",
|
|
10511
|
+
"#0000FF",
|
|
10512
|
+
"#0033CC",
|
|
10513
|
+
"#0033FF",
|
|
10514
|
+
"#0066CC",
|
|
10515
|
+
"#0066FF",
|
|
10516
|
+
"#0099CC",
|
|
10517
|
+
"#0099FF",
|
|
10518
|
+
"#00CC00",
|
|
10519
|
+
"#00CC33",
|
|
10520
|
+
"#00CC66",
|
|
10521
|
+
"#00CC99",
|
|
10522
|
+
"#00CCCC",
|
|
10523
|
+
"#00CCFF",
|
|
10524
|
+
"#3300CC",
|
|
10525
|
+
"#3300FF",
|
|
10526
|
+
"#3333CC",
|
|
10527
|
+
"#3333FF",
|
|
10528
|
+
"#3366CC",
|
|
10529
|
+
"#3366FF",
|
|
10530
|
+
"#3399CC",
|
|
10531
|
+
"#3399FF",
|
|
10532
|
+
"#33CC00",
|
|
10533
|
+
"#33CC33",
|
|
10534
|
+
"#33CC66",
|
|
10535
|
+
"#33CC99",
|
|
10536
|
+
"#33CCCC",
|
|
10537
|
+
"#33CCFF",
|
|
10538
|
+
"#6600CC",
|
|
10539
|
+
"#6600FF",
|
|
10540
|
+
"#6633CC",
|
|
10541
|
+
"#6633FF",
|
|
10542
|
+
"#66CC00",
|
|
10543
|
+
"#66CC33",
|
|
10544
|
+
"#9900CC",
|
|
10545
|
+
"#9900FF",
|
|
10546
|
+
"#9933CC",
|
|
10547
|
+
"#9933FF",
|
|
10548
|
+
"#99CC00",
|
|
10549
|
+
"#99CC33",
|
|
10550
|
+
"#CC0000",
|
|
10551
|
+
"#CC0033",
|
|
10552
|
+
"#CC0066",
|
|
10553
|
+
"#CC0099",
|
|
10554
|
+
"#CC00CC",
|
|
10555
|
+
"#CC00FF",
|
|
10556
|
+
"#CC3300",
|
|
10557
|
+
"#CC3333",
|
|
10558
|
+
"#CC3366",
|
|
10559
|
+
"#CC3399",
|
|
10560
|
+
"#CC33CC",
|
|
10561
|
+
"#CC33FF",
|
|
10562
|
+
"#CC6600",
|
|
10563
|
+
"#CC6633",
|
|
10564
|
+
"#CC9900",
|
|
10565
|
+
"#CC9933",
|
|
10566
|
+
"#CCCC00",
|
|
10567
|
+
"#CCCC33",
|
|
10568
|
+
"#FF0000",
|
|
10569
|
+
"#FF0033",
|
|
10570
|
+
"#FF0066",
|
|
10571
|
+
"#FF0099",
|
|
10572
|
+
"#FF00CC",
|
|
10573
|
+
"#FF00FF",
|
|
10574
|
+
"#FF3300",
|
|
10575
|
+
"#FF3333",
|
|
10576
|
+
"#FF3366",
|
|
10577
|
+
"#FF3399",
|
|
10578
|
+
"#FF33CC",
|
|
10579
|
+
"#FF33FF",
|
|
10580
|
+
"#FF6600",
|
|
10581
|
+
"#FF6633",
|
|
10582
|
+
"#FF9900",
|
|
10583
|
+
"#FF9933",
|
|
10584
|
+
"#FFCC00",
|
|
10585
|
+
"#FFCC33"
|
|
10586
|
+
];
|
|
10587
|
+
function useColors() {
|
|
10588
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
10589
|
+
return true;
|
|
10590
|
+
}
|
|
10591
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
10592
|
+
return false;
|
|
10593
|
+
}
|
|
10594
|
+
let m;
|
|
10595
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
10596
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
10597
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
10598
|
+
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
|
|
10599
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
10600
|
+
}
|
|
10601
|
+
function formatArgs(args) {
|
|
10602
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
10603
|
+
if (!this.useColors) {
|
|
10604
|
+
return;
|
|
10605
|
+
}
|
|
10606
|
+
const c = "color: " + this.color;
|
|
10607
|
+
args.splice(1, 0, c, "color: inherit");
|
|
10608
|
+
let index = 0;
|
|
10609
|
+
let lastC = 0;
|
|
10610
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
10611
|
+
if (match === "%%") {
|
|
10612
|
+
return;
|
|
10613
|
+
}
|
|
10614
|
+
index++;
|
|
10615
|
+
if (match === "%c") {
|
|
10616
|
+
lastC = index;
|
|
10617
|
+
}
|
|
10618
|
+
});
|
|
10619
|
+
args.splice(lastC, 0, c);
|
|
10620
|
+
}
|
|
10621
|
+
exports.log = console.debug || console.log || (() => {
|
|
10622
|
+
});
|
|
10623
|
+
function save(namespaces) {
|
|
10624
|
+
try {
|
|
10625
|
+
if (namespaces) {
|
|
10626
|
+
exports.storage.setItem("debug", namespaces);
|
|
10627
|
+
} else {
|
|
10628
|
+
exports.storage.removeItem("debug");
|
|
10629
|
+
}
|
|
10630
|
+
} catch (error) {
|
|
10631
|
+
}
|
|
10632
|
+
}
|
|
10633
|
+
function load() {
|
|
10634
|
+
let r;
|
|
10635
|
+
try {
|
|
10636
|
+
r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
|
|
10637
|
+
} catch (error) {
|
|
10638
|
+
}
|
|
10639
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
10640
|
+
r = process.env.DEBUG;
|
|
10641
|
+
}
|
|
10642
|
+
return r;
|
|
10643
|
+
}
|
|
10644
|
+
function localstorage() {
|
|
10645
|
+
try {
|
|
10646
|
+
return localStorage;
|
|
10647
|
+
} catch (error) {
|
|
10648
|
+
}
|
|
10649
|
+
}
|
|
10650
|
+
module.exports = requireCommon()(exports);
|
|
10651
|
+
const { formatters } = module.exports;
|
|
10652
|
+
formatters.j = function(v) {
|
|
10653
|
+
try {
|
|
10654
|
+
return JSON.stringify(v);
|
|
10655
|
+
} catch (error) {
|
|
10656
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
10657
|
+
}
|
|
10658
|
+
};
|
|
10659
|
+
})(browser, browser.exports);
|
|
10660
|
+
return browser.exports;
|
|
10661
|
+
}
|
|
10662
|
+
var hasRequiredDist;
|
|
10663
|
+
function requireDist() {
|
|
10664
|
+
if (hasRequiredDist) return dist;
|
|
10665
|
+
hasRequiredDist = 1;
|
|
10666
|
+
var __importDefault = dist && dist.__importDefault || function(mod) {
|
|
10667
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
10668
|
+
};
|
|
10669
|
+
Object.defineProperty(dist, "__esModule", { value: true });
|
|
10670
|
+
dist.NodeClusterAdapter = void 0;
|
|
10671
|
+
dist.createAdapter = createAdapter2;
|
|
10672
|
+
dist.setupPrimary = setupPrimary;
|
|
10673
|
+
const node_cluster_1 = __importDefault(require$$0$2);
|
|
10674
|
+
const socket_io_adapter_1 = require$$1$2;
|
|
10675
|
+
const debug_1 = __importDefault(requireBrowser());
|
|
10676
|
+
const debug = (0, debug_1.default)("socket.io-cluster-adapter");
|
|
10677
|
+
const MESSAGE_SOURCE = "_sio_adapter";
|
|
10678
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
10679
|
+
function ignoreError() {
|
|
10680
|
+
}
|
|
10681
|
+
function createAdapter2(opts = {}) {
|
|
10682
|
+
return function(nsp) {
|
|
10683
|
+
return new NodeClusterAdapter(nsp, opts);
|
|
10684
|
+
};
|
|
10685
|
+
}
|
|
10686
|
+
class NodeClusterAdapter extends socket_io_adapter_1.ClusterAdapterWithHeartbeat {
|
|
10687
|
+
constructor(nsp, opts = {}) {
|
|
10688
|
+
super(nsp, opts);
|
|
10689
|
+
process.on("message", (message) => {
|
|
10690
|
+
const isValidSource = (message === null || message === void 0 ? void 0 : message.source) === MESSAGE_SOURCE;
|
|
10691
|
+
if (!isValidSource) {
|
|
10692
|
+
debug("[%s] ignore unknown source", this.uid);
|
|
10693
|
+
return;
|
|
10694
|
+
}
|
|
10695
|
+
if (message.nsp !== this.nsp.name) {
|
|
10696
|
+
debug("[%s] ignore other namespace", this.uid);
|
|
10697
|
+
return;
|
|
10698
|
+
}
|
|
10699
|
+
this.onMessage(message);
|
|
10700
|
+
});
|
|
10701
|
+
this.init();
|
|
10702
|
+
}
|
|
10703
|
+
doPublish(message) {
|
|
10704
|
+
message.source = MESSAGE_SOURCE;
|
|
10705
|
+
process.send(message, null, {}, ignoreError);
|
|
10706
|
+
return Promise.resolve("");
|
|
10707
|
+
}
|
|
10708
|
+
doPublishResponse(requesterUid, response) {
|
|
10709
|
+
response.source = MESSAGE_SOURCE;
|
|
10710
|
+
response.requesterUid = requesterUid;
|
|
10711
|
+
process.send(response, null, {}, ignoreError);
|
|
10712
|
+
return Promise.resolve();
|
|
10713
|
+
}
|
|
10714
|
+
}
|
|
10715
|
+
dist.NodeClusterAdapter = NodeClusterAdapter;
|
|
10716
|
+
const UIDS = /* @__PURE__ */ Symbol("uids");
|
|
10717
|
+
function setupPrimary() {
|
|
10718
|
+
node_cluster_1.default.on("message", (worker, message) => {
|
|
10719
|
+
var _a;
|
|
10720
|
+
const isValidSource = (message === null || message === void 0 ? void 0 : message.source) === MESSAGE_SOURCE;
|
|
10721
|
+
if (!isValidSource) {
|
|
10722
|
+
return;
|
|
10723
|
+
}
|
|
10724
|
+
worker[UIDS] = worker[UIDS] || /* @__PURE__ */ new Set();
|
|
10725
|
+
worker[UIDS].add(message.uid);
|
|
10726
|
+
switch (message.type) {
|
|
10727
|
+
case socket_io_adapter_1.MessageType.FETCH_SOCKETS_RESPONSE:
|
|
10728
|
+
case socket_io_adapter_1.MessageType.SERVER_SIDE_EMIT_RESPONSE:
|
|
10729
|
+
const requesterUid = message.requesterUid;
|
|
10730
|
+
for (const workerId in node_cluster_1.default.workers) {
|
|
10731
|
+
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))) {
|
|
10732
|
+
node_cluster_1.default.workers[workerId].send(message, null, ignoreError);
|
|
10733
|
+
break;
|
|
10734
|
+
}
|
|
10735
|
+
}
|
|
10736
|
+
break;
|
|
10737
|
+
default:
|
|
10738
|
+
const emitterIdAsString = String(worker.id);
|
|
10739
|
+
for (const workerId in node_cluster_1.default.workers) {
|
|
10740
|
+
if (hasOwnProperty.call(node_cluster_1.default.workers, workerId) && workerId !== emitterIdAsString) {
|
|
10741
|
+
node_cluster_1.default.workers[workerId].send(message, null, ignoreError);
|
|
10742
|
+
}
|
|
10743
|
+
}
|
|
10744
|
+
}
|
|
10745
|
+
});
|
|
10746
|
+
}
|
|
10747
|
+
return dist;
|
|
10748
|
+
}
|
|
10749
|
+
requireDist();
|
|
10139
10750
|
var tinyEmitter = { exports: {} };
|
|
10140
10751
|
var hasRequiredTinyEmitter;
|
|
10141
10752
|
function requireTinyEmitter() {
|
|
@@ -10191,7 +10802,7 @@ function requireTinyEmitter() {
|
|
|
10191
10802
|
}
|
|
10192
10803
|
var tinyEmitterExports = requireTinyEmitter();
|
|
10193
10804
|
const SOCKET_NAMESPACE = "stsinstrumentmanager/stsmonitor";
|
|
10194
|
-
class ObservabilitySubscriberManager {
|
|
10805
|
+
class ObservabilitySubscriberManager extends SocketIoClient {
|
|
10195
10806
|
#socket = null;
|
|
10196
10807
|
#observabilitySocketIOSubscriber = null;
|
|
10197
10808
|
#logger;
|
|
@@ -10203,6 +10814,7 @@ class ObservabilitySubscriberManager {
|
|
|
10203
10814
|
#tinyEmitter;
|
|
10204
10815
|
#id;
|
|
10205
10816
|
constructor(options) {
|
|
10817
|
+
super("STSVueTilsTester");
|
|
10206
10818
|
this.#id = v4();
|
|
10207
10819
|
this.#options = options;
|
|
10208
10820
|
this.#modelId = options.modelId;
|
|
@@ -10350,40 +10962,54 @@ class ObservabilitySubscriberManager {
|
|
|
10350
10962
|
resolve(true);
|
|
10351
10963
|
};
|
|
10352
10964
|
this.#tinyEmitter.on("connected", onConnected);
|
|
10353
|
-
this.#
|
|
10965
|
+
this.WithAddress(`${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE}/`).WithLogger(this.#logger).SetupSocket();
|
|
10354
10966
|
} else {
|
|
10355
10967
|
this.#SetupObservabilitySubscriber();
|
|
10356
10968
|
resolve(true);
|
|
10357
10969
|
}
|
|
10358
10970
|
});
|
|
10359
10971
|
};
|
|
10360
|
-
|
|
10361
|
-
const socketUtils = new SocketIoClientHelper({});
|
|
10362
|
-
this.#socket = socketUtils.SetupClientSideSocket(
|
|
10363
|
-
"STSVueTilsTester",
|
|
10364
|
-
`${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE}/`,
|
|
10365
|
-
"",
|
|
10366
|
-
// use default /socket.io/ path
|
|
10367
|
-
this.#SocketConnect,
|
|
10368
|
-
// Connected call back
|
|
10369
|
-
this.#ProcessSocketEvents,
|
|
10370
|
-
// Custom Events
|
|
10371
|
-
this.#ProcessSocketError
|
|
10372
|
-
// Handle socket errors
|
|
10373
|
-
);
|
|
10374
|
-
};
|
|
10375
|
-
#SocketConnect = (socket) => {
|
|
10972
|
+
ConnectCallBack(socket) {
|
|
10376
10973
|
defaultLogger.debug(chalk.magenta(`SocketIOConnect(): Socket ID: [${socket.id}]`));
|
|
10377
10974
|
if (this.#observabilitySubscriptionManager === null) {
|
|
10378
10975
|
this.#SetupObservabilitySubscriber();
|
|
10379
10976
|
}
|
|
10380
10977
|
this.#SocketIOConnect(socket);
|
|
10381
|
-
}
|
|
10382
|
-
|
|
10978
|
+
}
|
|
10979
|
+
ErrorCallBack(error) {
|
|
10383
10980
|
defaultLogger.error(chalk.red(`SetupClientSideSocket error callback: [${error}]`));
|
|
10384
|
-
}
|
|
10385
|
-
|
|
10386
|
-
}
|
|
10981
|
+
}
|
|
10982
|
+
SocketEventsCallBack(socket) {
|
|
10983
|
+
}
|
|
10984
|
+
/*
|
|
10985
|
+
#SetupSocketIO = () => {
|
|
10986
|
+
const socketUtils = new SocketIoClientHelper({});
|
|
10987
|
+
|
|
10988
|
+
this.#socket = socketUtils.SetupClientSideSocket('STSVueTilsTester',
|
|
10989
|
+
`${this.#options.instrumentManagerEndpoint}:${this.#options.instrumentManagerPort}/${SOCKET_NAMESPACE}/`,
|
|
10990
|
+
'', // use default /socket.io/ path
|
|
10991
|
+
this.#SocketConnect as any, // Connected call back
|
|
10992
|
+
this.#ProcessSocketEvents as any, // Custom Events
|
|
10993
|
+
this.#ProcessSocketError // Handle socket errors
|
|
10994
|
+
) as any;
|
|
10995
|
+
}
|
|
10996
|
+
|
|
10997
|
+
#SocketConnect = (socket: Socket) => {
|
|
10998
|
+
defaultLogger.debug(chalk.magenta(`SocketIOConnect(): Socket ID: [${socket.id}]`));
|
|
10999
|
+
if (this.#observabilitySubscriptionManager === null) {
|
|
11000
|
+
this.#SetupObservabilitySubscriber();
|
|
11001
|
+
}
|
|
11002
|
+
this.#SocketIOConnect(socket);
|
|
11003
|
+
}
|
|
11004
|
+
|
|
11005
|
+
#ProcessSocketError = (error: any) => {
|
|
11006
|
+
defaultLogger.error(chalk.red(`SetupClientSideSocket error callback: [${error}]`))
|
|
11007
|
+
}
|
|
11008
|
+
|
|
11009
|
+
#ProcessSocketEvents = (socket: Socket) => {
|
|
11010
|
+
|
|
11011
|
+
}
|
|
11012
|
+
*/
|
|
10387
11013
|
}
|
|
10388
11014
|
const _hoisted_1$1 = { class: "d-flex flex-wrap justify-space-between" };
|
|
10389
11015
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|