@nsshunt/ststestrunner 1.0.79 → 1.0.80
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/ststestrunner.cjs +76 -44
- package/dist/ststestrunner.cjs.map +1 -1
- package/dist/ststestrunner.mjs +76 -44
- package/dist/ststestrunner.mjs.map +1 -1
- package/package.json +5 -5
package/dist/ststestrunner.cjs
CHANGED
|
@@ -11754,21 +11754,33 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11754
11754
|
#socketIoCustomPath;
|
|
11755
11755
|
#authToken;
|
|
11756
11756
|
#socket;
|
|
11757
|
+
#reconnectTimeout = 2e3;
|
|
11758
|
+
// default
|
|
11757
11759
|
constructor(name) {
|
|
11758
11760
|
super();
|
|
11759
11761
|
this.#name = name;
|
|
11760
11762
|
}
|
|
11763
|
+
get logPrefix() {
|
|
11764
|
+
return `SocketIoClient[${this.#name}]:`;
|
|
11765
|
+
}
|
|
11761
11766
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11762
11767
|
LogDebugMessage(message) {
|
|
11763
|
-
if (this.#logger) this.#logger.debug(message);
|
|
11768
|
+
if (this.#logger) this.#logger.debug(`${this.logPrefix}${message}`);
|
|
11764
11769
|
}
|
|
11765
11770
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11766
11771
|
LogErrorMessage(message) {
|
|
11767
|
-
if (this.#logger) this.#logger.error(message);
|
|
11772
|
+
if (this.#logger) this.#logger.error(`${this.logPrefix}${message}`);
|
|
11773
|
+
}
|
|
11774
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11775
|
+
LogWarningMessage(message) {
|
|
11776
|
+
if (this.#logger) this.#logger.warn(`${this.logPrefix}${message}`);
|
|
11768
11777
|
}
|
|
11769
11778
|
get name() {
|
|
11770
11779
|
return this.#name;
|
|
11771
11780
|
}
|
|
11781
|
+
get reconnectTimeout() {
|
|
11782
|
+
return this.#reconnectTimeout;
|
|
11783
|
+
}
|
|
11772
11784
|
get agentManager() {
|
|
11773
11785
|
return this.#agentManager;
|
|
11774
11786
|
}
|
|
@@ -11807,6 +11819,10 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11807
11819
|
this.#agentManager = agentManager;
|
|
11808
11820
|
return this;
|
|
11809
11821
|
}
|
|
11822
|
+
WithReconnectTimeout(reconnectTimeout) {
|
|
11823
|
+
this.#reconnectTimeout = reconnectTimeout;
|
|
11824
|
+
return this;
|
|
11825
|
+
}
|
|
11810
11826
|
SetupSocket() {
|
|
11811
11827
|
if (!this.#address) {
|
|
11812
11828
|
throw new Error(`SocketIoClientHelper:SetupSocket(): Error: [address not provided]`);
|
|
@@ -11839,9 +11855,9 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11839
11855
|
}
|
|
11840
11856
|
this.#socket = void 0;
|
|
11841
11857
|
if (isNode$2) {
|
|
11842
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11858
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
11843
11859
|
} else {
|
|
11844
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11860
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
11845
11861
|
}
|
|
11846
11862
|
return;
|
|
11847
11863
|
}
|
|
@@ -11852,7 +11868,7 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11852
11868
|
};
|
|
11853
11869
|
if (this.#agentManager) {
|
|
11854
11870
|
if (!this.#address) {
|
|
11855
|
-
throw new Error(`
|
|
11871
|
+
throw new Error(`SocketIoClient:SetupSocket(): Error: [address not provided when using agentManager]`);
|
|
11856
11872
|
}
|
|
11857
11873
|
socketOptions.agent = this.#agentManager.GetAgent(this.#address);
|
|
11858
11874
|
}
|
|
@@ -11873,58 +11889,58 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11873
11889
|
}
|
|
11874
11890
|
this.#socket = lookup$2(this.#address, socketOptions);
|
|
11875
11891
|
this.#socket.io.on("error", (err) => {
|
|
11876
|
-
this.LogErrorMessage(`
|
|
11892
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('error'): [${err}] Address: [${this.#address}]`);
|
|
11877
11893
|
});
|
|
11878
11894
|
this.#socket.io.on("reconnect_error", (err) => {
|
|
11879
|
-
this.LogErrorMessage(`
|
|
11895
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('reconnect_error'): [${err}] Address: [${this.#address}]`);
|
|
11880
11896
|
});
|
|
11881
11897
|
this.#socket.on("connect_error", (err) => {
|
|
11882
|
-
this.LogErrorMessage(`
|
|
11898
|
+
this.LogErrorMessage(`socketDetail.socket.on('connect_error'): [${err}] Address: [${this.#address}]`);
|
|
11883
11899
|
});
|
|
11884
11900
|
this.#socket.io.on("reconnect", (attempt) => {
|
|
11885
|
-
this.LogErrorMessage(`
|
|
11901
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('reconnect'): Number: [${attempt}] Address: [${this.#address}]`);
|
|
11886
11902
|
});
|
|
11887
11903
|
this.#socket.on("connect", () => {
|
|
11888
11904
|
if (this.#socket) {
|
|
11889
|
-
this.LogDebugMessage(`
|
|
11905
|
+
this.LogDebugMessage(`Socket: [${this.#socket.id}]: connected, Address: [${this.#address}]`);
|
|
11890
11906
|
setTimeout(() => {
|
|
11891
11907
|
this.ConnectCallBack(this.#socket);
|
|
11892
11908
|
}, 0);
|
|
11893
11909
|
this.SocketEventsCallBack(this.#socket);
|
|
11894
11910
|
} else {
|
|
11895
|
-
const errorMessage = "
|
|
11911
|
+
const errorMessage = "Could not get socket object from socket.io, Address: [${socketDetail.address}]";
|
|
11896
11912
|
this.LogErrorMessage(errorMessage);
|
|
11897
11913
|
this.ErrorCallBack(new Error(errorMessage));
|
|
11898
11914
|
}
|
|
11899
11915
|
});
|
|
11900
11916
|
this.#socket.on("disconnect", (reason) => {
|
|
11901
|
-
this.LogDebugMessage("
|
|
11917
|
+
this.LogDebugMessage("socket disconnect: " + reason);
|
|
11902
11918
|
switch (reason) {
|
|
11903
11919
|
case "io server disconnect":
|
|
11904
11920
|
{
|
|
11905
|
-
this.LogDebugMessage("
|
|
11906
|
-
this.LogDebugMessage("
|
|
11921
|
+
this.LogDebugMessage("The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
11922
|
+
this.LogDebugMessage("The connection will be re-established when the server becomes available.");
|
|
11907
11923
|
this.#socket = void 0;
|
|
11908
11924
|
if (isNode$2) {
|
|
11909
11925
|
if (this.#agentManager) {
|
|
11910
11926
|
this.#agentManager.ResetAgent();
|
|
11911
11927
|
}
|
|
11912
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11928
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
11913
11929
|
} else {
|
|
11914
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11930
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
11915
11931
|
}
|
|
11916
11932
|
}
|
|
11917
11933
|
break;
|
|
11918
11934
|
case "io client disconnect":
|
|
11919
|
-
this.LogDebugMessage("
|
|
11920
|
-
this.LogDebugMessage("
|
|
11935
|
+
this.LogDebugMessage("The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
|
|
11936
|
+
this.LogDebugMessage("The connection will not be re-established automatically.");
|
|
11921
11937
|
break;
|
|
11922
11938
|
case "transport close":
|
|
11923
11939
|
case "ping timeout":
|
|
11924
11940
|
case "transport error":
|
|
11925
11941
|
{
|
|
11926
|
-
this.LogDebugMessage(`
|
|
11927
|
-
this.LogDebugMessage("
|
|
11942
|
+
this.LogDebugMessage(`Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
11943
|
+
this.LogDebugMessage("The connection will be re-established when the server becomes available.");
|
|
11928
11944
|
if (this.#socket) {
|
|
11929
11945
|
this.#socket.disconnect();
|
|
11930
11946
|
}
|
|
@@ -11933,9 +11949,9 @@ let SocketIoClient$1 = class SocketIoClient extends tinyEmitterExports$1.TinyEmi
|
|
|
11933
11949
|
if (this.#agentManager) {
|
|
11934
11950
|
this.#agentManager?.ResetAgent();
|
|
11935
11951
|
}
|
|
11936
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11952
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
11937
11953
|
} else {
|
|
11938
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
11954
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
11939
11955
|
}
|
|
11940
11956
|
}
|
|
11941
11957
|
break;
|
|
@@ -25577,21 +25593,33 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25577
25593
|
#socketIoCustomPath;
|
|
25578
25594
|
#authToken;
|
|
25579
25595
|
#socket;
|
|
25596
|
+
#reconnectTimeout = 2e3;
|
|
25597
|
+
// default
|
|
25580
25598
|
constructor(name) {
|
|
25581
25599
|
super();
|
|
25582
25600
|
this.#name = name;
|
|
25583
25601
|
}
|
|
25602
|
+
get logPrefix() {
|
|
25603
|
+
return `SocketIoClient[${this.#name}]:`;
|
|
25604
|
+
}
|
|
25584
25605
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25585
25606
|
LogDebugMessage(message) {
|
|
25586
|
-
if (this.#logger) this.#logger.debug(message);
|
|
25607
|
+
if (this.#logger) this.#logger.debug(`${this.logPrefix}${message}`);
|
|
25587
25608
|
}
|
|
25588
25609
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25589
25610
|
LogErrorMessage(message) {
|
|
25590
|
-
if (this.#logger) this.#logger.error(message);
|
|
25611
|
+
if (this.#logger) this.#logger.error(`${this.logPrefix}${message}`);
|
|
25612
|
+
}
|
|
25613
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25614
|
+
LogWarningMessage(message) {
|
|
25615
|
+
if (this.#logger) this.#logger.warn(`${this.logPrefix}${message}`);
|
|
25591
25616
|
}
|
|
25592
25617
|
get name() {
|
|
25593
25618
|
return this.#name;
|
|
25594
25619
|
}
|
|
25620
|
+
get reconnectTimeout() {
|
|
25621
|
+
return this.#reconnectTimeout;
|
|
25622
|
+
}
|
|
25595
25623
|
get agentManager() {
|
|
25596
25624
|
return this.#agentManager;
|
|
25597
25625
|
}
|
|
@@ -25630,6 +25658,10 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25630
25658
|
this.#agentManager = agentManager;
|
|
25631
25659
|
return this;
|
|
25632
25660
|
}
|
|
25661
|
+
WithReconnectTimeout(reconnectTimeout) {
|
|
25662
|
+
this.#reconnectTimeout = reconnectTimeout;
|
|
25663
|
+
return this;
|
|
25664
|
+
}
|
|
25633
25665
|
SetupSocket() {
|
|
25634
25666
|
if (!this.#address) {
|
|
25635
25667
|
throw new Error(`SocketIoClientHelper:SetupSocket(): Error: [address not provided]`);
|
|
@@ -25662,9 +25694,9 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25662
25694
|
}
|
|
25663
25695
|
this.#socket = void 0;
|
|
25664
25696
|
if (isNode) {
|
|
25665
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25697
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
25666
25698
|
} else {
|
|
25667
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25699
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
25668
25700
|
}
|
|
25669
25701
|
return;
|
|
25670
25702
|
}
|
|
@@ -25675,7 +25707,7 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25675
25707
|
};
|
|
25676
25708
|
if (this.#agentManager) {
|
|
25677
25709
|
if (!this.#address) {
|
|
25678
|
-
throw new Error(`
|
|
25710
|
+
throw new Error(`SocketIoClient:SetupSocket(): Error: [address not provided when using agentManager]`);
|
|
25679
25711
|
}
|
|
25680
25712
|
socketOptions.agent = this.#agentManager.GetAgent(this.#address);
|
|
25681
25713
|
}
|
|
@@ -25696,58 +25728,58 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25696
25728
|
}
|
|
25697
25729
|
this.#socket = lookup(this.#address, socketOptions);
|
|
25698
25730
|
this.#socket.io.on("error", (err) => {
|
|
25699
|
-
this.LogErrorMessage(`
|
|
25731
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('error'): [${err}] Address: [${this.#address}]`);
|
|
25700
25732
|
});
|
|
25701
25733
|
this.#socket.io.on("reconnect_error", (err) => {
|
|
25702
|
-
this.LogErrorMessage(`
|
|
25734
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('reconnect_error'): [${err}] Address: [${this.#address}]`);
|
|
25703
25735
|
});
|
|
25704
25736
|
this.#socket.on("connect_error", (err) => {
|
|
25705
|
-
this.LogErrorMessage(`
|
|
25737
|
+
this.LogErrorMessage(`socketDetail.socket.on('connect_error'): [${err}] Address: [${this.#address}]`);
|
|
25706
25738
|
});
|
|
25707
25739
|
this.#socket.io.on("reconnect", (attempt) => {
|
|
25708
|
-
this.LogErrorMessage(`
|
|
25740
|
+
this.LogErrorMessage(`socketDetail.socket.io.on('reconnect'): Number: [${attempt}] Address: [${this.#address}]`);
|
|
25709
25741
|
});
|
|
25710
25742
|
this.#socket.on("connect", () => {
|
|
25711
25743
|
if (this.#socket) {
|
|
25712
|
-
this.LogDebugMessage(`
|
|
25744
|
+
this.LogDebugMessage(`Socket: [${this.#socket.id}]: connected, Address: [${this.#address}]`);
|
|
25713
25745
|
setTimeout(() => {
|
|
25714
25746
|
this.ConnectCallBack(this.#socket);
|
|
25715
25747
|
}, 0);
|
|
25716
25748
|
this.SocketEventsCallBack(this.#socket);
|
|
25717
25749
|
} else {
|
|
25718
|
-
const errorMessage = "
|
|
25750
|
+
const errorMessage = "Could not get socket object from socket.io, Address: [${socketDetail.address}]";
|
|
25719
25751
|
this.LogErrorMessage(errorMessage);
|
|
25720
25752
|
this.ErrorCallBack(new Error(errorMessage));
|
|
25721
25753
|
}
|
|
25722
25754
|
});
|
|
25723
25755
|
this.#socket.on("disconnect", (reason) => {
|
|
25724
|
-
this.LogDebugMessage("
|
|
25756
|
+
this.LogDebugMessage("socket disconnect: " + reason);
|
|
25725
25757
|
switch (reason) {
|
|
25726
25758
|
case "io server disconnect":
|
|
25727
25759
|
{
|
|
25728
|
-
this.LogDebugMessage("
|
|
25729
|
-
this.LogDebugMessage("
|
|
25760
|
+
this.LogDebugMessage("The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
25761
|
+
this.LogDebugMessage("The connection will be re-established when the server becomes available.");
|
|
25730
25762
|
this.#socket = void 0;
|
|
25731
25763
|
if (isNode) {
|
|
25732
25764
|
if (this.#agentManager) {
|
|
25733
25765
|
this.#agentManager.ResetAgent();
|
|
25734
25766
|
}
|
|
25735
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25767
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
25736
25768
|
} else {
|
|
25737
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25769
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
25738
25770
|
}
|
|
25739
25771
|
}
|
|
25740
25772
|
break;
|
|
25741
25773
|
case "io client disconnect":
|
|
25742
|
-
this.LogDebugMessage("
|
|
25743
|
-
this.LogDebugMessage("
|
|
25774
|
+
this.LogDebugMessage("The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
|
|
25775
|
+
this.LogDebugMessage("The connection will not be re-established automatically.");
|
|
25744
25776
|
break;
|
|
25745
25777
|
case "transport close":
|
|
25746
25778
|
case "ping timeout":
|
|
25747
25779
|
case "transport error":
|
|
25748
25780
|
{
|
|
25749
|
-
this.LogDebugMessage(`
|
|
25750
|
-
this.LogDebugMessage("
|
|
25781
|
+
this.LogDebugMessage(`Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
25782
|
+
this.LogDebugMessage("The connection will be re-established when the server becomes available.");
|
|
25751
25783
|
if (this.#socket) {
|
|
25752
25784
|
this.#socket.disconnect();
|
|
25753
25785
|
}
|
|
@@ -25756,9 +25788,9 @@ class SocketIoClient2 extends tinyEmitterExports.TinyEmitter {
|
|
|
25756
25788
|
if (this.#agentManager) {
|
|
25757
25789
|
this.#agentManager?.ResetAgent();
|
|
25758
25790
|
}
|
|
25759
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25791
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout).unref();
|
|
25760
25792
|
} else {
|
|
25761
|
-
setTimeout(() => this.#EstablishSocketConnect(),
|
|
25793
|
+
setTimeout(() => this.#EstablishSocketConnect(), this.#reconnectTimeout);
|
|
25762
25794
|
}
|
|
25763
25795
|
}
|
|
25764
25796
|
break;
|