aotrautils 0.0.96 → 0.0.99

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 (13/07/2022-23:32:41)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (13/07/2022-23:48:03)»*/
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 (13/07/2022-23:32:41)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (13/07/2022-23:48:03)»*/
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 (13/07/2022-23:32:41)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (13/07/2022-23:48:03)»*/
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 (13/07/2022-23:32:41)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (13/07/2022-23:48:03)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -13131,11 +13131,6 @@ if(typeof(fs)==="undefined"){
13131
13131
  // NODE ONLY SERVER / CLIENTS :
13132
13132
  WebsocketImplementation={
13133
13133
 
13134
- ////
13135
-
13136
- socketIO:null,
13137
- WebSocket:null,
13138
-
13139
13134
 
13140
13135
  isNodeContext:true,
13141
13136
  useSocketIOImplementation:false,
@@ -13172,10 +13167,15 @@ WebsocketImplementation={
13172
13167
 
13173
13168
  // *********************************************************************************
13174
13169
 
13175
- WebsocketImplementation.socketIO=require("socket.io");
13176
- WebsocketImplementation.WebSocket=require("ws");
13170
+ socketIO=require("socket.io");
13171
+ WebSocket=require("ws");
13177
13172
 
13178
13173
 
13174
+
13175
+ // DBG
13176
+ console.log("IIIII socketIO:",JSON.stringify(socketIO));
13177
+ console.log("IIIII WebSocket:",JSON.stringify(WebSocket));
13178
+
13179
13179
 
13180
13180
 
13181
13181
  return WebsocketImplementation;
@@ -13195,18 +13195,18 @@ WebsocketImplementation={
13195
13195
  // NODE SERVER MODE ONLY :
13196
13196
  let serverSocket;
13197
13197
  if(!WebsocketImplementation.useSocketIOImplementation){
13198
- serverSocket=new WebsocketImplementation.WebSocket.Server({ "server":listenableServer });
13198
+ serverSocket=new WebSocket.Server({ "server":listenableServer });
13199
13199
  }else{
13200
13200
 
13201
13201
 
13202
13202
  // DBG
13203
- console.log(">>>>>>>require(socket.io):",JSON.stringify(require("socket.io")));
13204
- console.log(">>>>>>>WebsocketImplementation.socketIO:",JSON.stringify(WebsocketImplementation.socketIO));
13205
- console.log(">>>>>>>WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
13203
+ // console.log(">>>>>>>require(socket.io):",JSON.stringify(require("socket.io")));
13204
+ console.log(">>>>>>>socketIO:",JSON.stringify(socketIO));
13205
+ console.log(">>>>>>>WebSocket:",JSON.stringify(WebSocket));
13206
13206
 
13207
13207
  // NOW : socket.io :
13208
13208
  // Loading socket.io
13209
- serverSocket=WebsocketImplementation.socketIO.listen(listenableServer);
13209
+ serverSocket=socketIO.listen(listenableServer);
13210
13210
 
13211
13211
  // Setting up the disctonnect event :
13212
13212
  serverSocket.on("endConnection",()=>{
@@ -13294,7 +13294,7 @@ WebsocketImplementation={
13294
13294
 
13295
13295
 
13296
13296
  // TODO : FIXME : Use one single interface !
13297
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13297
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13298
13298
  else if(clientSocket.connected) return;
13299
13299
 
13300
13300
 
@@ -13318,7 +13318,7 @@ WebsocketImplementation={
13318
13318
 
13319
13319
  // TODO : FIXME : Use one single interface !
13320
13320
  let clientSocket=clientSocketParam;
13321
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13321
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13322
13322
  else if(clientSocket.connected) return;
13323
13323
 
13324
13324
 
@@ -13495,7 +13495,7 @@ WebsocketImplementation={
13495
13495
 
13496
13496
 
13497
13497
  // NEW : ws :
13498
- if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13498
+ if(typeof(WebSocket)==="undefined"){
13499
13499
  // TRACE
13500
13500
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13501
13501
  return null;
@@ -13504,18 +13504,18 @@ WebsocketImplementation={
13504
13504
  // NODE CLIENT MODE ONLY :
13505
13505
  let clientSocket;
13506
13506
  if(!WebsocketImplementation.useSocketIOImplementation){
13507
- clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13507
+ clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13508
13508
  }else{
13509
13509
  // NOW : socket.io :
13510
13510
  //client on server-side:
13511
13511
 
13512
13512
 
13513
- if(WebsocketImplementation.isNodeContext && typeof(WebsocketImplementation.socketIO)!=="undefined"){
13513
+ if(WebsocketImplementation.isNodeContext && typeof(socketIO)!=="undefined"){
13514
13514
  // // Node client :
13515
13515
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
13516
- // return WebsocketImplementation.socketIO.connect(serverURL + ":" + port,{timeout: timeout});
13516
+ // return socketIO.connect(serverURL + ":" + port,{timeout: timeout});
13517
13517
  // }
13518
- clientSocket=WebsocketImplementation.socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13518
+ clientSocket=socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13519
13519
  }
13520
13520
  }
13521
13521
 
@@ -13575,7 +13575,7 @@ WebsocketImplementation={
13575
13575
  // console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13576
13576
 
13577
13577
  // TODO : FIXME : Use one single interface !
13578
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13578
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13579
13579
  else if(clientSocket.connected) return;
13580
13580
 
13581
13581
 
@@ -13652,7 +13652,7 @@ WebsocketImplementation={
13652
13652
  /*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
13653
13653
 
13654
13654
  // NEW : ws :
13655
- if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13655
+ if(typeof(WebSocket)==="undefined"){
13656
13656
  // TRACE
13657
13657
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13658
13658
  return null;
@@ -13662,7 +13662,7 @@ WebsocketImplementation={
13662
13662
  // BROWSER CLIENT MODE ONLY :
13663
13663
  let clientSocket;
13664
13664
  if(!WebsocketImplementation.useSocketIOImplementation){
13665
- clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,["ws","wss"]);
13665
+ clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
13666
13666
  }else if(typeof(io)!=="undefined"){
13667
13667
  // NOW : socket.io :
13668
13668
  // // Browser client :
@@ -13728,7 +13728,7 @@ WebsocketImplementation={
13728
13728
  // console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13729
13729
 
13730
13730
  // TODO : FIXME : Use one single interface !
13731
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13731
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13732
13732
  else if(clientSocket.connected) return;
13733
13733
 
13734
13734
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.96",
3
+ "version": "0.0.99",
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)",