aotrautils-srv 0.0.152 → 0.0.155
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-04:01:32)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
4831
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-04:01:32)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
|
|
4834
4834
|
|
|
@@ -5177,7 +5177,15 @@ WebsocketImplementation={
|
|
|
5177
5177
|
|
|
5178
5178
|
// dataWrapped=JSON.parse(dataWrapped);
|
|
5179
5179
|
// dataWrapped=getAt(dataWrapped,0);// We get the root element
|
|
5180
|
-
|
|
5180
|
+
|
|
5181
|
+
let dataWrapped=message;
|
|
5182
|
+
try{
|
|
5183
|
+
dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
|
|
5184
|
+
}catch(error1){
|
|
5185
|
+
// TRACE
|
|
5186
|
+
lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
|
|
5187
|
+
dataWrapped=(isString(message)?message:JSON.stringify(message));
|
|
5188
|
+
}
|
|
5181
5189
|
|
|
5182
5190
|
|
|
5183
5191
|
// DBG
|
|
@@ -5221,16 +5229,9 @@ WebsocketImplementation={
|
|
|
5221
5229
|
|
|
5222
5230
|
|
|
5223
5231
|
if(!WebsocketImplementation.useSocketIOImplementation) clientSocketParam.addEventListener("message", doOnMessage);
|
|
5224
|
-
else
|
|
5225
|
-
|
|
5226
|
-
// DBG
|
|
5227
|
-
clientSocketParam.onAny((event,args) => { console.log(`MAIS PUTAIN : ${event}:`,args); });
|
|
5228
|
-
clientSocketParam.on(channelName,(args, clientSocket) => { console.log(`MAIS OSKOUR :${args} ${clientSocket}`); });
|
|
5229
|
-
|
|
5232
|
+
else clientSocketParam.on(channelName, doOnMessage);
|
|
5230
5233
|
|
|
5231
5234
|
|
|
5232
|
-
clientSocketParam.on(channelName, doOnMessage);
|
|
5233
|
-
}
|
|
5234
5235
|
|
|
5235
5236
|
|
|
5236
5237
|
|
|
@@ -5257,7 +5258,8 @@ WebsocketImplementation={
|
|
|
5257
5258
|
// TODO : FIXME : Use one single interface !
|
|
5258
5259
|
let serverClients;
|
|
5259
5260
|
if(!WebsocketImplementation.useSocketIOImplementation) serverClients=nodeServerInstance.serverSocket.clients;
|
|
5260
|
-
|
|
5261
|
+
// OLD: else serverClients=nodeServerInstance.serverSocket.sockets.clients();
|
|
5262
|
+
else serverClients=nodeServerInstance.serverSocket.sockets;
|
|
5261
5263
|
|
|
5262
5264
|
serverClients.forEach((clientSocket)=>{
|
|
5263
5265
|
|
|
@@ -5438,7 +5440,8 @@ WebsocketImplementation={
|
|
|
5438
5440
|
|
|
5439
5441
|
// TODO : FIXME : Use one single interface !
|
|
5440
5442
|
if(!WebsocketImplementation.useSocketIOImplementation) serverClients=nodeServerInstance.serverSocket.clients;
|
|
5441
|
-
else
|
|
5443
|
+
// OLD : else serverClients=nodeServerInstance.serverSocket.sockets.clients();
|
|
5444
|
+
else serverClients=nodeServerInstance.serverSocket.sockets;
|
|
5442
5445
|
|
|
5443
5446
|
serverClients.forEach((clientSocket)=>{
|
|
5444
5447
|
clearInterval(clientSocket.stateCheckInterval);
|
|
@@ -5677,7 +5680,17 @@ WebsocketImplementation={
|
|
|
5677
5680
|
// const dataWrapped=JSON.parse(message);
|
|
5678
5681
|
// dataWrapped=getAt(dataWrapped,0);// We get the root element
|
|
5679
5682
|
|
|
5680
|
-
|
|
5683
|
+
|
|
5684
|
+
let dataWrapped=message;
|
|
5685
|
+
try{
|
|
5686
|
+
dataWrapped=(WebsocketImplementation.useFlatStrings || isString(message)?JSON.parse(message):message);
|
|
5687
|
+
}catch(error1){
|
|
5688
|
+
// TRACE
|
|
5689
|
+
lognow(`ERROR : Failed to parse JSON for string «${dataWrapped}»`,error1);
|
|
5690
|
+
dataWrapped=(isString(message)?message:JSON.stringify(message));
|
|
5691
|
+
}
|
|
5692
|
+
|
|
5693
|
+
|
|
5681
5694
|
|
|
5682
5695
|
|
|
5683
5696
|
// Channel information is stored in exchanged data :
|
aotrautils-srv/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils-srv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.155",
|
|
4
4
|
"main": "aotrautils-srv.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|