aotrautils 0.0.109 → 0.0.112

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 (16/07/2022-14:25:52)»*/
3
+ /*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-14:49:15)»*/
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:25:52)»*/
4831
+ /*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-14:49:15)»*/
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:25:52)»*/
11681
+ /*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-14:49:15)»*/
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:25:52)»*/
12887
+ /*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-14:49:15)»*/
12888
12888
  /*-----------------------------------------------------------------------------*/
12889
12889
 
12890
12890
 
@@ -12932,6 +12932,9 @@ const {Socket}=require("socket.io");
12932
12932
  const {WebSocket}=require("ws");
12933
12933
 
12934
12934
 
12935
+ // DBG
12936
+ console.log("Socket!!!!!!>>>>",Socket);
12937
+ console.log("WebSocket!!!!!!>>>>",WebSocket);
12935
12938
 
12936
12939
 
12937
12940
  // =================================================================================
@@ -13103,6 +13106,8 @@ if(typeof(fs)==="undefined"){
13103
13106
  // NODE ONLY SERVER / CLIENTS :
13104
13107
  WebsocketImplementation={
13105
13108
 
13109
+ Socket:Socket,
13110
+ Websocket:WebSocket,
13106
13111
 
13107
13112
  isNodeContext:true,
13108
13113
  useSocketIOImplementation:false,
@@ -13136,8 +13141,8 @@ WebsocketImplementation={
13136
13141
  // *********************************************************************************
13137
13142
 
13138
13143
  // DBG
13139
- console.log("11111 Socket:",JSON.stringify(Socket));
13140
- 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));
13141
13146
 
13142
13147
 
13143
13148
  return WebsocketImplementation;
@@ -13157,17 +13162,17 @@ WebsocketImplementation={
13157
13162
  // NODE SERVER MODE ONLY :
13158
13163
  let serverSocket;
13159
13164
  if(!WebsocketImplementation.useSocketIOImplementation){
13160
- serverSocket=new WebSocket.Server({ "server":listenableServer });
13165
+ serverSocket=new WebsocketImplementation.WebSocket.Server({ "server":listenableServer });
13161
13166
  }else{
13162
13167
 
13163
13168
 
13164
13169
  // DBG
13165
- console.log(">>>>>>>Socket:",JSON.stringify(Socket));
13166
- console.log(">>>>>>>WebSocket:",JSON.stringify(WebSocket));
13170
+ console.log(">>>>>>>WebsocketImplementation.Socket:",JSON.stringify(WebsocketImplementation.Socket));
13171
+ console.log(">>>>>>>WebsocketImplementation.WebSocket:",JSON.stringify(WebsocketImplementation.WebSocket));
13167
13172
 
13168
13173
  // NOW : socket.io :
13169
13174
  // Loading socket.io
13170
- serverSocket=Socket.listen(listenableServer);
13175
+ serverSocket=WebsocketImplementation.Socket.listen(listenableServer);
13171
13176
 
13172
13177
  // Setting up the disctonnect event :
13173
13178
  serverSocket.on("endConnection",()=>{
@@ -13255,7 +13260,7 @@ WebsocketImplementation={
13255
13260
 
13256
13261
 
13257
13262
  // TODO : FIXME : Use one single interface !
13258
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13263
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13259
13264
  else if(clientSocket.connected) return;
13260
13265
 
13261
13266
 
@@ -13279,7 +13284,7 @@ WebsocketImplementation={
13279
13284
 
13280
13285
  // TODO : FIXME : Use one single interface !
13281
13286
  let clientSocket=clientSocketParam;
13282
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13287
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13283
13288
  else if(clientSocket.connected) return;
13284
13289
 
13285
13290
 
@@ -13456,7 +13461,7 @@ WebsocketImplementation={
13456
13461
 
13457
13462
 
13458
13463
  // NEW : ws :
13459
- if(typeof(WebSocket)==="undefined"){
13464
+ if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13460
13465
  // TRACE
13461
13466
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13462
13467
  return null;
@@ -13465,17 +13470,17 @@ WebsocketImplementation={
13465
13470
  // NODE CLIENT MODE ONLY :
13466
13471
  let clientSocket;
13467
13472
  if(!WebsocketImplementation.useSocketIOImplementation){
13468
- clientSocket=new WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13473
+ clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,/*WORKAROUND:*/{ rejectUnauthorized:false, secure: isSecure });
13469
13474
  }else{
13470
13475
  // NOW : socket.io :
13471
13476
  //client on server-side:
13472
13477
 
13473
- if(WebsocketImplementation.isNodeContext && typeof(Socket)!=="undefined"){
13478
+ if(WebsocketImplementation.isNodeContext && typeof(WebsocketImplementation.Socket)!=="undefined"){
13474
13479
  // // Node client :
13475
13480
  // connectToServer=function (serverURL, port, isSecure, timeout=10000){
13476
- // return Socket.connect(serverURL + ":" + port,{timeout: timeout});
13481
+ // return WebsocketImplementation.Socket.connect(serverURL + ":" + port,{timeout: timeout});
13477
13482
  // }
13478
- clientSocket=Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13483
+ clientSocket=WebsocketImplementation.Socket.connect(serverURL + ":" + port,{timeout: timeout, secure: isSecure});
13479
13484
  }
13480
13485
  }
13481
13486
 
@@ -13535,7 +13540,7 @@ WebsocketImplementation={
13535
13540
  // console.log("(NODE CLIENT) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13536
13541
 
13537
13542
  // TODO : FIXME : Use one single interface !
13538
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13543
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13539
13544
  else if(clientSocket.connected) return;
13540
13545
 
13541
13546
 
@@ -13612,7 +13617,7 @@ WebsocketImplementation={
13612
13617
  /*private*/connectToServerFromBrowser:(serverURL, port, isSecure, timeout)=>{
13613
13618
 
13614
13619
  // NEW : ws :
13615
- if(typeof(WebSocket)==="undefined"){
13620
+ if(typeof(WebsocketImplementation.WebSocket)==="undefined"){
13616
13621
  // TRACE
13617
13622
  lognow("ERROR : CLIENT : Could not find websocket client lib, aborting client connection.");
13618
13623
  return null;
@@ -13622,7 +13627,7 @@ WebsocketImplementation={
13622
13627
  // BROWSER CLIENT MODE ONLY :
13623
13628
  let clientSocket;
13624
13629
  if(!WebsocketImplementation.useSocketIOImplementation){
13625
- clientSocket=new WebSocket(serverURL+":"+port,["ws","wss"]);
13630
+ clientSocket=new WebsocketImplementation.WebSocket(serverURL+":"+port,["ws","wss"]);
13626
13631
  }else if(typeof(io)!=="undefined"){
13627
13632
  // NOW : socket.io :
13628
13633
  // // Browser client :
@@ -13688,7 +13693,7 @@ WebsocketImplementation={
13688
13693
  // console.log("(BROWSER) TRYING TO SEND : clientSocket.readyState:",clientSocket.readyState);
13689
13694
 
13690
13695
  // TODO : FIXME : Use one single interface !
13691
- if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebSocket.OPEN) return;
13696
+ if(!WebsocketImplementation.useSocketIOImplementation) if(clientSocket.readyState!==WebsocketImplementation.WebSocket.OPEN) return;
13692
13697
  else if(clientSocket.connected) return;
13693
13698
 
13694
13699
 
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.109",
3
+ "version": "0.0.112",
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)",