aotrautils-srv 0.0.1956 → 0.0.1958

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 (03/08/2026-20:20:42)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:42)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5473,7 +5473,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5473
5473
 
5474
5474
 
5475
5475
 
5476
- /*utils AI library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:42)»*/
5476
+ /*utils AI library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:42)»*/
5477
5477
  /*-----------------------------------------------------------------------------*/
5478
5478
 
5479
5479
 
@@ -5733,7 +5733,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
5733
5733
 
5734
5734
 
5735
5735
 
5736
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:42)»*/
5736
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:42)»*/
5737
5737
  /*-----------------------------------------------------------------------------*/
5738
5738
 
5739
5739
 
@@ -7743,6 +7743,19 @@ if(typeof(require)!=="undefined" && typeof(window.fs)==="undefined" ){
7743
7743
 
7744
7744
 
7745
7745
 
7746
+
7747
+ // Nodejs filesystem utils :
7748
+ if(typeof(window.fs)==="undefined"){
7749
+ // TRACE
7750
+ console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
7751
+ window.getPersister=()=>{ return null; };
7752
+ }else{
7753
+ window.getPersister=function(dataDirPath, prefix="", createDirectoryIfNotExists=false){
7754
+ return new Persister(dataDirPath, prefix, createDirectoryIfNotExists);
7755
+ };
7756
+ }
7757
+
7758
+
7746
7759
  window.Persister=class Persister{
7747
7760
 
7748
7761
  constructor(dataDirPath="./", prefix="", createDirectoryIfNotExists=false){
@@ -7752,11 +7765,6 @@ window.Persister=class Persister{
7752
7765
 
7753
7766
  // Initial setup :
7754
7767
 
7755
- // DBG
7756
- lognow("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
7757
- lognow("DEBUG : >>>>>>>>>>>>>>>>>>> CREATING Persister !!!");
7758
- lognow("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
7759
-
7760
7768
  this.createDirectoryIfNecessary(this.dataDirPath+"."+this.prefix);
7761
7769
 
7762
7770
  }
@@ -7778,14 +7786,8 @@ window.Persister=class Persister{
7778
7786
  // TRACE
7779
7787
  lognow(`WARN : Directory «${path}» does not exist. We will create it.`);
7780
7788
 
7781
- // DBG
7782
- lognow(`DEBUG : Create started.`);
7783
-
7784
7789
  createDirectory(path);
7785
7790
 
7786
- // DBG
7787
- lognow(`DEBUG : Create done.`);
7788
-
7789
7791
  }
7790
7792
  }
7791
7793
 
@@ -7855,23 +7857,6 @@ window.Persister=class Persister{
7855
7857
  }
7856
7858
 
7857
7859
 
7858
- // Nodejs filesystem utils :
7859
- if(typeof(window.fs)==="undefined"){
7860
- // TRACE
7861
- console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
7862
- window.getPersister=()=>{ return null; };
7863
- }else{
7864
- window.getPersister=function(dataDirPath, prefix="", createDirectoryIfNotExists=false){
7865
-
7866
- //DBG
7867
- lognow("DEBUG : ***********************");
7868
- lognow("DEBUG : INSTANCIATING PERSISTER");
7869
- lognow("DEBUG : ***********************");
7870
-
7871
- return new Persister(dataDirPath, prefix, createDirectoryIfNotExists);
7872
- };
7873
- }
7874
-
7875
7860
  // Also handles directories !
7876
7861
  window.fileExists=(filePath)=>{
7877
7862
  if(typeof(window.fs)=="undefined"){
@@ -8459,9 +8444,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
8459
8444
  }, doOnConnectionLost);
8460
8445
 
8461
8446
  server.onFinalize((serverParam)=>{
8462
- // DBG
8463
- lognow("onFinalize() server");
8464
-
8465
8447
  if(doOnFinalizeServer) doOnFinalizeServer(serverParam);
8466
8448
  });
8467
8449
 
@@ -8715,11 +8697,6 @@ window.ListManager=class ListManager{
8715
8697
  }
8716
8698
  const numberOfItemsCurrently=getArraySize(this.itemsInfos);
8717
8699
 
8718
- // DBG
8719
- lognow(">>>>>>>>>numberOfItemsCurrently:",numberOfItemsCurrently);
8720
- lognow(">>>>>>>>>Object.keys(arrayOfValues):",Object.keys(this.itemsInfos));
8721
-
8722
-
8723
8700
  if(this.maxItemsNumber<=numberOfItemsCurrently){
8724
8701
  // TRACE
8725
8702
  lognow("ERROR : Cannot add item with id «"+id+"», list already full.");
@@ -8728,10 +8705,6 @@ window.ListManager=class ListManager{
8728
8705
 
8729
8706
 
8730
8707
  if(numberOfItemsCurrently==0 && this.mode==="startAtConnexion"){
8731
-
8732
- // DBG
8733
- lognow(">>>>>>>>>START SESSION !!!!");
8734
-
8735
8708
  this.startSession();
8736
8709
  }
8737
8710
  this.itemsInfos[id]={
@@ -8751,27 +8724,15 @@ window.ListManager=class ListManager{
8751
8724
 
8752
8725
  isSessionActive(){
8753
8726
 
8754
- // DBG
8755
- lognow(" !!! this.sessionDurationSeconds : "+this.sessionDurationSeconds);
8756
- lognow(" !!! this.started : "+this.started);
8757
- lognow(" !!! this.time : "+this.time);
8758
-
8759
-
8760
8727
  if(!this.sessionDurationSeconds) return true;
8761
8728
  if(!this.started) return false;
8762
8729
  const result=!hasDelayPassed(this.time, this.sessionDurationSeconds*1000);
8763
8730
 
8764
- // DBG
8765
- lognow(" !!! HAS DELAY PASSED : "+result);
8766
-
8767
8731
  return result;
8768
8732
  }
8769
8733
 
8770
8734
  isClientActive(clientId){
8771
8735
 
8772
- // DBG
8773
- lognow(" this.isSessionActive()"+this.isSessionActive());
8774
-
8775
8736
  if(!this.isSessionActive()) return false;
8776
8737
  const clientPosition=this.getItemPosition(clientId);
8777
8738
  //CAUTION : Client position starts at 1 !
@@ -8895,13 +8856,9 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
8895
8856
 
8896
8857
  } else if(httpMethod==="GET" && requestBodyOrNamedArgs){
8897
8858
  // Not the same way to send parameters in GET http method :
8898
- // DBG
8899
- lognow("unformatted API URL : "+completeURL);
8900
8859
 
8901
8860
  completeURL=appendGetParameters(completeURL, requestBodyOrNamedArgs);
8902
8861
 
8903
- // DBG
8904
- lognow("formatted API URL : "+completeURL);
8905
8862
  }
8906
8863
 
8907
8864
  // CASE BROWSER CONTEXT :
@@ -8928,9 +8885,6 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
8928
8885
  // STRANGE : DOES WORK :
8929
8886
  .then(response => {
8930
8887
 
8931
- // DBG
8932
- console.log("~~~~~~~~~~~response :",response);
8933
-
8934
8888
  return response.json();
8935
8889
  }).then(data => {
8936
8890
 
@@ -8945,9 +8899,6 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
8945
8899
  // return;
8946
8900
  // }
8947
8901
 
8948
- // DBG
8949
- console.log("~~~~~~~~~~~data :",data);
8950
-
8951
8902
  data.httpStatus=status;
8952
8903
  resolve(data);
8953
8904
  }).catch(error => {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1956",
3
+ "version": "0.0.1958",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils-srv",
9
- "version": "0.0.1956",
9
+ "version": "0.0.1958",
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.1956",
3
+ "version": "0.0.1958",
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)",