aotrautils 0.0.110 → 0.0.111
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.
- aotrautils/aotrautils.build.js +25 -23
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-14:
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-14:41:37)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-14:
|
|
4831
|
+
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-14:41:37)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4834
4834
|
*
|
|
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
|
|
|
11678
11678
|
|
|
11679
11679
|
|
|
11680
11680
|
|
|
11681
|
-
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-14:
|
|
11681
|
+
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-14:41:37)»*/
|
|
11682
11682
|
/*-----------------------------------------------------------------------------*/
|
|
11683
11683
|
|
|
11684
11684
|
|
|
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
12884
12884
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
12885
12885
|
|
|
12886
12886
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
12887
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-14:
|
|
12887
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-14:41:37)»*/
|
|
12888
12888
|
/*-----------------------------------------------------------------------------*/
|
|
12889
12889
|
|
|
12890
12890
|
|
|
@@ -12933,8 +12933,8 @@ const {WebSocket}=require("ws");
|
|
|
12933
12933
|
|
|
12934
12934
|
|
|
12935
12935
|
// DBG
|
|
12936
|
-
console.log("Socket
|
|
12937
|
-
console.log("WebSocket
|
|
12936
|
+
console.log("Socket!!!!!!>>>>",Socket);
|
|
12937
|
+
console.log("WebSocket!!!!!!>>>>",WebSocket);
|
|
12938
12938
|
|
|
12939
12939
|
|
|
12940
12940
|
// =================================================================================
|
|
@@ -13106,6 +13106,8 @@ if(typeof(fs)==="undefined"){
|
|
|
13106
13106
|
// NODE ONLY SERVER / CLIENTS :
|
|
13107
13107
|
WebsocketImplementation={
|
|
13108
13108
|
|
|
13109
|
+
Socket:Socket,
|
|
13110
|
+
Websocket:WebSocket,
|
|
13109
13111
|
|
|
13110
13112
|
isNodeContext:true,
|
|
13111
13113
|
useSocketIOImplementation:false,
|
|
@@ -13139,8 +13141,8 @@ WebsocketImplementation={
|
|
|
13139
13141
|
// *********************************************************************************
|
|
13140
13142
|
|
|
13141
13143
|
// DBG
|
|
13142
|
-
console.log("11111 Socket:",JSON.stringify(Socket));
|
|
13143
|
-
console.log("11111 WebSocket:",JSON.stringify(WebSocket));
|
|
13144
|
+
console.log("11111 WebsocketImplementation.Socket:",JSON.stringify(WebsocketImplementation.Socket));
|
|
13145
|
+
console.log("11111 WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
|
|
13144
13146
|
|
|
13145
13147
|
|
|
13146
13148
|
return WebsocketImplementation;
|
|
@@ -13160,17 +13162,17 @@ WebsocketImplementation={
|
|
|
13160
13162
|
// NODE SERVER MODE ONLY :
|
|
13161
13163
|
let serverSocket;
|
|
13162
13164
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13163
|
-
serverSocket=new WebSocket.Server({ "server":listenableServer });
|
|
13165
|
+
serverSocket=new WebsocketImplementation.WebSocket.Server({ "server":listenableServer });
|
|
13164
13166
|
}else{
|
|
13165
13167
|
|
|
13166
13168
|
|
|
13167
13169
|
// DBG
|
|
13168
|
-
console.log(">>>>>>>Socket:",JSON.stringify(Socket));
|
|
13169
|
-
console.log(">>>>>>>WebSocket:",JSON.stringify(WebSocket));
|
|
13170
|
+
console.log(">>>>>>>WebsocketImplementation.Socket:",JSON.stringify(WebsocketImplementation.Socket));
|
|
13171
|
+
console.log(">>>>>>>WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
|
|
13170
13172
|
|
|
13171
13173
|
// NOW : socket.io :
|
|
13172
13174
|
// Loading socket.io
|
|
13173
|
-
serverSocket=Socket.listen(listenableServer);
|
|
13175
|
+
serverSocket=WebsocketImplementation.Socket.listen(listenableServer);
|
|
13174
13176
|
|
|
13175
13177
|
// Setting up the disctonnect event :
|
|
13176
13178
|
serverSocket.on("endConnection",()=>{
|
|
@@ -13258,7 +13260,7 @@ WebsocketImplementation={
|
|
|
13258
13260
|
|
|
13259
13261
|
|
|
13260
13262
|
// TODO : FIXME : Use one single interface !
|
|
13261
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13263
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
|
|
13262
13264
|
else if(clientSocket.connected) return;
|
|
13263
13265
|
|
|
13264
13266
|
|
|
@@ -13282,7 +13284,7 @@ WebsocketImplementation={
|
|
|
13282
13284
|
|
|
13283
13285
|
// TODO : FIXME : Use one single interface !
|
|
13284
13286
|
let clientSocket=clientSocketParam;
|
|
13285
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13287
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
|
|
13286
13288
|
else if(clientSocket.connected) return;
|
|
13287
13289
|
|
|
13288
13290
|
|
|
@@ -13459,7 +13461,7 @@ WebsocketImplementation={
|
|
|
13459
13461
|
|
|
13460
13462
|
|
|
13461
13463
|
// NEW : ws :
|
|
13462
|
-
if(typeof(WebSocket)==="undefined"){
|
|
13464
|
+
if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
|
|
13463
13465
|
// TRACE
|
|
13464
13466
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13465
13467
|
return null;
|
|
@@ -13468,17 +13470,17 @@ WebsocketImplementation={
|
|
|
13468
13470
|
// NODE CLIENT MODE ONLY :
|
|
13469
13471
|
let clientSocket;
|
|
13470
13472
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13471
|
-
clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
|
|
13473
|
+
clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
|
|
13472
13474
|
}else{
|
|
13473
13475
|
// NOW : socket.io :
|
|
13474
13476
|
//client on server-side:
|
|
13475
13477
|
|
|
13476
|
-
if(WebsocketImplementation.isNodeContext && typeof(Socket)!=="undefined"){
|
|
13478
|
+
if(WebsocketImplementation.isNodeContext && typeof(WebsocketImplementation.Socket)!=="undefined"){
|
|
13477
13479
|
// // Node client :
|
|
13478
13480
|
// connectToServer=function (serverURL, port, isSecure, timeout=10000){
|
|
13479
|
-
// return Socket.connect(serverURL + ":" + port,{timeout: timeout});
|
|
13481
|
+
// return WebsocketImplementation.Socket.connect(serverURL + ":" + port,{timeout: timeout});
|
|
13480
13482
|
// }
|
|
13481
|
-
clientSocket=Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
|
|
13483
|
+
clientSocket=WebsocketImplementation.Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
|
|
13482
13484
|
}
|
|
13483
13485
|
}
|
|
13484
13486
|
|
|
@@ -13538,7 +13540,7 @@ WebsocketImplementation={
|
|
|
13538
13540
|
// console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13539
13541
|
|
|
13540
13542
|
// TODO : FIXME : Use one single interface !
|
|
13541
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13543
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
|
|
13542
13544
|
else if(clientSocket.connected) return;
|
|
13543
13545
|
|
|
13544
13546
|
|
|
@@ -13615,7 +13617,7 @@ WebsocketImplementation={
|
|
|
13615
13617
|
/*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
|
|
13616
13618
|
|
|
13617
13619
|
// NEW : ws :
|
|
13618
|
-
if(typeof(WebSocket)==="undefined"){
|
|
13620
|
+
if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
|
|
13619
13621
|
// TRACE
|
|
13620
13622
|
lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
|
|
13621
13623
|
return null;
|
|
@@ -13625,7 +13627,7 @@ WebsocketImplementation={
|
|
|
13625
13627
|
// BROWSER CLIENT MODE ONLY :
|
|
13626
13628
|
let clientSocket;
|
|
13627
13629
|
if(!WebsocketImplementation.useSocketIOImplementation){
|
|
13628
|
-
clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
|
|
13630
|
+
clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,["ws","wss"]);
|
|
13629
13631
|
}else if(typeof(io)!=="undefined"){
|
|
13630
13632
|
// NOW : socket.io :
|
|
13631
13633
|
// // Browser client :
|
|
@@ -13691,7 +13693,7 @@ WebsocketImplementation={
|
|
|
13691
13693
|
// console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
|
|
13692
13694
|
|
|
13693
13695
|
// TODO : FIXME : Use one single interface !
|
|
13694
|
-
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
|
|
13696
|
+
if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
|
|
13695
13697
|
else if(clientSocket.connected) return;
|
|
13696
13698
|
|
|
13697
13699
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.111",
|
|
4
4
|
"main": "aotrautils.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|