aotrautils-srv 0.0.1922 → 0.0.1924

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_29072022-2359 (26/07/2026-14:28:34)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:46)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5470,7 +5470,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5470
5470
 
5471
5471
 
5472
5472
 
5473
- /*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-14:28:34)»*/
5473
+ /*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:46)»*/
5474
5474
  /*-----------------------------------------------------------------------------*/
5475
5475
 
5476
5476
 
@@ -5730,7 +5730,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
5730
5730
 
5731
5731
 
5732
5732
 
5733
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-14:28:34)»*/
5733
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:46)»*/
5734
5734
  /*-----------------------------------------------------------------------------*/
5735
5735
 
5736
5736
 
@@ -7848,7 +7848,7 @@ window.fileExists=(filePath)=>{
7848
7848
  //Networking management :
7849
7849
  //- WEBSOCKETS AND NODEJS :
7850
7850
 
7851
- function isConnected(clientSocket){
7851
+ window.isConnected=function(clientSocket){
7852
7852
  // if(!window.WebsocketImplementation.useSocketIOImplementation)
7853
7853
  if(!window.WebsocketImplementation.implementationToUse)
7854
7854
  return (clientSocket.readyState===WebSocket.OPEN)
@@ -7939,7 +7939,6 @@ window.getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» a
7939
7939
  }
7940
7940
 
7941
7941
 
7942
-
7943
7942
  window.getConsoleCLI=(doOnCommands={"makeSandiwch":()=>{}}, promptText="Enter command> ")=>{
7944
7943
 
7945
7944
  const readline = require("node:readline");
@@ -7977,14 +7976,9 @@ window.getConsoleCLI=(doOnCommands={"makeSandiwch":()=>{}}, promptText="Enter co
7977
7976
  return cliInterface
7978
7977
  };
7979
7978
 
7980
-
7981
-
7982
-
7983
-
7984
7979
  // NODE ONLY SERVER / CLIENTS :
7985
7980
  window.WebsocketImplementation={
7986
7981
 
7987
-
7988
7982
  isNodeContext:true,
7989
7983
  // useSocketIOImplementation:false,
7990
7984
  implementationToUse:null,// null is default (WebSocket)
@@ -8296,7 +8290,6 @@ window.WebsocketImplementation={
8296
8290
  };
8297
8291
 
8298
8292
 
8299
-
8300
8293
  window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
8301
8294
 
8302
8295
  const EXCLUDED_FILENAMES_PARTS=[".keyHash.",".pem"];
@@ -8336,8 +8329,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
8336
8329
  return;
8337
8330
  }
8338
8331
 
8339
-
8340
-
8341
8332
  const urlFile="." + url;
8342
8333
 
8343
8334
  let filePath=urlFile.indexOf("?")!==-1?urlFile.split("?")[0]:urlFile;
@@ -8407,7 +8398,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
8407
8398
  listenableServer=httpServer;
8408
8399
  }
8409
8400
 
8410
-
8411
8401
  const server=window.WebsocketImplementation.getStatic(true).getServer(listenableServer);
8412
8402
 
8413
8403
  // When a client connects, we execute the callback :
@@ -8416,20 +8406,15 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
8416
8406
  if(doOnConnect) doOnConnect(serverParam, clientSocketParam);
8417
8407
  }, doOnConnectionLost);
8418
8408
 
8419
-
8420
8409
  server.onFinalize((serverParam)=>{
8421
-
8422
8410
  // DBG
8423
8411
  lognow("onFinalize() server");
8424
8412
 
8425
8413
  if(doOnFinalizeServer) doOnFinalizeServer(serverParam);
8426
8414
  });
8427
8415
 
8428
-
8429
8416
  // TRACE
8430
8417
  console.log("INFO : SERVER : Generic Nodejs server launched and listening on port:" + port + "!");
8431
-
8432
-
8433
8418
 
8434
8419
  return server;
8435
8420
  }
@@ -8447,9 +8432,7 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8447
8432
  // EXAMPLE : node orita-srv.js hash orita.global@keyHash 1234567890
8448
8433
  console.log("Server launched.");
8449
8434
 
8450
-
8451
8435
  // We read the command-line arguments if needed :
8452
-
8453
8436
  let argCLPort;
8454
8437
  let argCLCertPath;
8455
8438
  let argCLKeyPath;
@@ -8461,7 +8444,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8461
8444
  let clearTextParam=null;
8462
8445
  let persisterId=null;
8463
8446
 
8464
-
8465
8447
  process.argv.forEach(function (val, i){
8466
8448
  if(!val) return;
8467
8449
  // 0 corresponds to «node / nodejs»
@@ -8486,8 +8468,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8486
8468
  });
8487
8469
  isForceUnsecure=(argCLCertPath==="unsecure");
8488
8470
 
8489
-
8490
-
8491
8471
  const aotraNodeServer={config:serverConfig};
8492
8472
  aotraNodeServer.serverManager={ start:()=>{/*DEFAULT START FUNCTION, WILL BE OVERRIDEN LATER*/}};
8493
8473
 
@@ -8531,12 +8511,10 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8531
8511
  return aotraNodeServer;
8532
8512
  }
8533
8513
 
8534
-
8535
8514
  const DEFAULT_PORT=nonull(argCLPort,25000);
8536
8515
  const DEFAULT_CERT_PATH=nonull(argCLCertPath,"cert.pem");
8537
8516
  const DEFAULT_KEY_PATH=nonull(argCLKeyPath,"key.key");
8538
8517
 
8539
-
8540
8518
  let port=portParam ? portParam : DEFAULT_PORT;
8541
8519
  let certPath=null;
8542
8520
  let keyPath=null;
@@ -8546,9 +8524,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8546
8524
  keyPath=keyPathParam?keyPathParam:DEFAULT_KEY_PATH;
8547
8525
  }
8548
8526
 
8549
-
8550
-
8551
-
8552
8527
  // UNUSEFUL :
8553
8528
  //aotraNodeServer.serverManager.microClientsSockets=[];
8554
8529
  // UNUSEFUL :
@@ -8577,7 +8552,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
8577
8552
 
8578
8553
  aotraNodeServer.server=window.launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
8579
8554
 
8580
-
8581
8555
  return aotraNodeServer;
8582
8556
  };
8583
8557
 
@@ -9390,7 +9364,7 @@ class ClientInstance{
9390
9364
 
9391
9365
  const clientSocket=this.clientSocket;
9392
9366
 
9393
- if(!isConnected(clientSocket)) return;
9367
+ if(!window.isConnected(clientSocket)) return;
9394
9368
 
9395
9369
  // Room information is stored in client socket object :
9396
9370
  if(!window.WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
@@ -9658,12 +9632,9 @@ class NodeServerInstance{
9658
9632
  // serverClients=this.serverSocket.sockets.sockets;
9659
9633
  }
9660
9634
 
9661
-
9662
9635
  serverClients.forEach((clientSocket)=>{
9663
9636
 
9664
-
9665
- if(!isConnected(clientSocket)) return;
9666
-
9637
+ if(!window.isConnected(clientSocket)) return;
9667
9638
 
9668
9639
  // Room information is stored in client socket object :
9669
9640
  if(!window.WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1922",
3
+ "version": "0.0.1924",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils-srv",
9
- "version": "0.0.1922",
9
+ "version": "0.0.1924",
10
10
  "license": "HGPL-1.0",
11
11
  "dependencies": {
12
12
  "atob": "^2.1.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1922",
3
+ "version": "0.0.1924",
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)",