aotrautils 0.0.98 → 0.0.101

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:36:02)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (14/07/2022-00:02:32)»*/
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:36:02)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (14/07/2022-00:02:32)»*/
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:36:02)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (14/07/2022-00:02:32)»*/
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:36:02)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (14/07/2022-00:02:32)»*/
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,14 +13167,14 @@ 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
 
13179
13174
 
13180
13175
  // DBG
13181
- console.log("IIIII WebsocketImplementation.socketIO:",JSON.stringify(WebsocketImplementation.socketIO));
13182
- console.log("IIIII WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
13176
+ console.log("IIIII socketIO:",JSON.stringify(socketIO));
13177
+ console.log("IIIII WebSocket:",JSON.stringify(WebSocket));
13183
13178
 
13184
13179
 
13185
13180
 
@@ -13200,18 +13195,18 @@ WebsocketImplementation={
13200
13195
  // NODE SERVER MODE ONLY :
13201
13196
  let serverSocket;
13202
13197
  if(!WebsocketImplementation.useSocketIOImplementation){
13203
- serverSocket=new WebsocketImplementation.WebSocket.Server({ "server":listenableServer });
13198
+ serverSocket=new WebSocket.Server({ "server":listenableServer });
13204
13199
  }else{
13205
13200
 
13206
13201
 
13207
13202
  // DBG
13208
13203
  // console.log(">>>>>>>require(socket.io):",JSON.stringify(require("socket.io")));
13209
- console.log(">>>>>>>WebsocketImplementation.socketIO:",JSON.stringify(WebsocketImplementation.socketIO));
13210
- console.log(">>>>>>>WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
13204
+ console.log(">>>>>>>socketIO:",JSON.stringify(socketIO));
13205
+ console.log(">>>>>>>WebSocket:",JSON.stringify(WebSocket));
13211
13206
 
13212
13207
  // NOW : socket.io :
13213
13208
  // Loading socket.io
13214
- serverSocket=WebsocketImplementation.socketIO.listen(listenableServer);
13209
+ serverSocket=socketIO.listen(listenableServer);
13215
13210
 
13216
13211
  // Setting up the disctonnect event :
13217
13212
  serverSocket.on("endConnection",()=>{
@@ -13299,7 +13294,7 @@ WebsocketImplementation={
13299
13294
 
13300
13295
 
13301
13296
  // TODO : FIXME : Use one single interface !
13302
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13297
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13303
13298
  else if(clientSocket.connected) return;
13304
13299
 
13305
13300
 
@@ -13323,7 +13318,7 @@ WebsocketImplementation={
13323
13318
 
13324
13319
  // TODO : FIXME : Use one single interface !
13325
13320
  let clientSocket=clientSocketParam;
13326
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13321
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13327
13322
  else if(clientSocket.connected) return;
13328
13323
 
13329
13324
 
@@ -13500,7 +13495,7 @@ WebsocketImplementation={
13500
13495
 
13501
13496
 
13502
13497
  // NEW : ws :
13503
- if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13498
+ if(typeof(WebSocket)==="undefined"){
13504
13499
  // TRACE
13505
13500
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13506
13501
  return null;
@@ -13509,18 +13504,18 @@ WebsocketImplementation={
13509
13504
  // NODE CLIENT MODE ONLY :
13510
13505
  let clientSocket;
13511
13506
  if(!WebsocketImplementation.useSocketIOImplementation){
13512
- clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13507
+ clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13513
13508
  }else{
13514
13509
  // NOW : socket.io :
13515
13510
  //client on server-side:
13516
13511
 
13517
13512
 
13518
- if(WebsocketImplementation.isNodeContext && typeof(WebsocketImplementation.socketIO)!=="undefined"){
13513
+ if(WebsocketImplementation.isNodeContext && typeof(socketIO)!=="undefined"){
13519
13514
  // // Node client :
13520
13515
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
13521
- // return WebsocketImplementation.socketIO.connect(serverURL + ":" + port,{timeout: timeout});
13516
+ // return socketIO.connect(serverURL + ":" + port,{timeout: timeout});
13522
13517
  // }
13523
- clientSocket=WebsocketImplementation.socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13518
+ clientSocket=socketIO.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13524
13519
  }
13525
13520
  }
13526
13521
 
@@ -13580,7 +13575,7 @@ WebsocketImplementation={
13580
13575
  // console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13581
13576
 
13582
13577
  // TODO : FIXME : Use one single interface !
13583
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13578
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13584
13579
  else if(clientSocket.connected) return;
13585
13580
 
13586
13581
 
@@ -13657,7 +13652,7 @@ WebsocketImplementation={
13657
13652
  /*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
13658
13653
 
13659
13654
  // NEW : ws :
13660
- if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13655
+ if(typeof(WebSocket)==="undefined"){
13661
13656
  // TRACE
13662
13657
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13663
13658
  return null;
@@ -13667,7 +13662,7 @@ WebsocketImplementation={
13667
13662
  // BROWSER CLIENT MODE ONLY :
13668
13663
  let clientSocket;
13669
13664
  if(!WebsocketImplementation.useSocketIOImplementation){
13670
- clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,["ws","wss"]);
13665
+ clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
13671
13666
  }else if(typeof(io)!=="undefined"){
13672
13667
  // NOW : socket.io :
13673
13668
  // // Browser client :
@@ -13733,7 +13728,7 @@ WebsocketImplementation={
13733
13728
  // console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13734
13729
 
13735
13730
  // TODO : FIXME : Use one single interface !
13736
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13731
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13737
13732
  else if(clientSocket.connected) return;
13738
13733
 
13739
13734
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.98",
3
+ "version": "0.0.101",
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)",