aotrautils 0.0.1959 → 0.0.1961

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:37)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5473,7 +5473,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5473
5473
 
5474
5474
 
5475
5475
 
5476
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:37)»*/
5476
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
5477
5477
  /*-----------------------------------------------------------------------------*/
5478
5478
  /* ## Utility global methods in a browser (htmljs) client environment.
5479
5479
  *
@@ -12988,7 +12988,7 @@ window.createOritaMicroClient=function(url, port, isNode=false, staticMicroClien
12988
12988
 
12989
12989
 
12990
12990
 
12991
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:37)»*/
12991
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
12992
12992
  /*-----------------------------------------------------------------------------*/
12993
12993
 
12994
12994
 
@@ -14050,10 +14050,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
14050
14050
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14051
14051
 
14052
14052
  window.AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14053
- /*utils 3D library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:37)»*/
14053
+ /*utils 3D library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
14054
14054
  /*-----------------------------------------------------------------------------*/
14055
14055
 
14056
- /*utils AI library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:37)»*/
14056
+ /*utils AI library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
14057
14057
  /*-----------------------------------------------------------------------------*/
14058
14058
 
14059
14059
 
@@ -14313,7 +14313,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
14313
14313
 
14314
14314
 
14315
14315
 
14316
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (03/08/2026-20:20:37)»*/
14316
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (03/08/2026-23:47:38)»*/
14317
14317
  /*-----------------------------------------------------------------------------*/
14318
14318
 
14319
14319
 
@@ -16323,6 +16323,19 @@ if(typeof(require)!=="undefined" && typeof(window.fs)==="undefined" ){
16323
16323
 
16324
16324
 
16325
16325
 
16326
+
16327
+ // Nodejs filesystem utils :
16328
+ if(typeof(window.fs)==="undefined"){
16329
+ // TRACE
16330
+ console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
16331
+ window.getPersister=()=>{ return null; };
16332
+ }else{
16333
+ window.getPersister=function(dataDirPath, prefix="", createDirectoryIfNotExists=false){
16334
+ return new Persister(dataDirPath, prefix, createDirectoryIfNotExists);
16335
+ };
16336
+ }
16337
+
16338
+
16326
16339
  window.Persister=class Persister{
16327
16340
 
16328
16341
  constructor(dataDirPath="./", prefix="", createDirectoryIfNotExists=false){
@@ -16332,11 +16345,6 @@ window.Persister=class Persister{
16332
16345
 
16333
16346
  // Initial setup :
16334
16347
 
16335
- // DBG
16336
- lognow("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
16337
- lognow("DEBUG : >>>>>>>>>>>>>>>>>>> CREATING Persister !!!");
16338
- lognow("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
16339
-
16340
16348
  this.createDirectoryIfNecessary(this.dataDirPath+"."+this.prefix);
16341
16349
 
16342
16350
  }
@@ -16358,14 +16366,8 @@ window.Persister=class Persister{
16358
16366
  // TRACE
16359
16367
  lognow(`WARN : Directory «${path}» does not exist. We will create it.`);
16360
16368
 
16361
- // DBG
16362
- lognow(`DEBUG : Create started.`);
16363
-
16364
16369
  createDirectory(path);
16365
16370
 
16366
- // DBG
16367
- lognow(`DEBUG : Create done.`);
16368
-
16369
16371
  }
16370
16372
  }
16371
16373
 
@@ -16435,23 +16437,6 @@ window.Persister=class Persister{
16435
16437
  }
16436
16438
 
16437
16439
 
16438
- // Nodejs filesystem utils :
16439
- if(typeof(window.fs)==="undefined"){
16440
- // TRACE
16441
- console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
16442
- window.getPersister=()=>{ return null; };
16443
- }else{
16444
- window.getPersister=function(dataDirPath, prefix="", createDirectoryIfNotExists=false){
16445
-
16446
- //DBG
16447
- lognow("DEBUG : ***********************");
16448
- lognow("DEBUG : INSTANCIATING PERSISTER");
16449
- lognow("DEBUG : ***********************");
16450
-
16451
- return new Persister(dataDirPath, prefix, createDirectoryIfNotExists);
16452
- };
16453
- }
16454
-
16455
16440
  // Also handles directories !
16456
16441
  window.fileExists=(filePath)=>{
16457
16442
  if(typeof(window.fs)=="undefined"){
@@ -17039,9 +17024,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
17039
17024
  }, doOnConnectionLost);
17040
17025
 
17041
17026
  server.onFinalize((serverParam)=>{
17042
- // DBG
17043
- lognow("onFinalize() server");
17044
-
17045
17027
  if(doOnFinalizeServer) doOnFinalizeServer(serverParam);
17046
17028
  });
17047
17029
 
@@ -17295,11 +17277,6 @@ window.ListManager=class ListManager{
17295
17277
  }
17296
17278
  const numberOfItemsCurrently=getArraySize(this.itemsInfos);
17297
17279
 
17298
- // DBG
17299
- lognow(">>>>>>>>>numberOfItemsCurrently:",numberOfItemsCurrently);
17300
- lognow(">>>>>>>>>Object.keys(arrayOfValues):",Object.keys(this.itemsInfos));
17301
-
17302
-
17303
17280
  if(this.maxItemsNumber<=numberOfItemsCurrently){
17304
17281
  // TRACE
17305
17282
  lognow("ERROR : Cannot add item with id «"+id+"», list already full.");
@@ -17308,10 +17285,6 @@ window.ListManager=class ListManager{
17308
17285
 
17309
17286
 
17310
17287
  if(numberOfItemsCurrently==0 && this.mode==="startAtConnexion"){
17311
-
17312
- // DBG
17313
- lognow(">>>>>>>>>START SESSION !!!!");
17314
-
17315
17288
  this.startSession();
17316
17289
  }
17317
17290
  this.itemsInfos[id]={
@@ -17331,27 +17304,15 @@ window.ListManager=class ListManager{
17331
17304
 
17332
17305
  isSessionActive(){
17333
17306
 
17334
- // DBG
17335
- lognow(" !!! this.sessionDurationSeconds : "+this.sessionDurationSeconds);
17336
- lognow(" !!! this.started : "+this.started);
17337
- lognow(" !!! this.time : "+this.time);
17338
-
17339
-
17340
17307
  if(!this.sessionDurationSeconds) return true;
17341
17308
  if(!this.started) return false;
17342
17309
  const result=!hasDelayPassed(this.time, this.sessionDurationSeconds*1000);
17343
17310
 
17344
- // DBG
17345
- lognow(" !!! HAS DELAY PASSED : "+result);
17346
-
17347
17311
  return result;
17348
17312
  }
17349
17313
 
17350
17314
  isClientActive(clientId){
17351
17315
 
17352
- // DBG
17353
- lognow(" this.isSessionActive()"+this.isSessionActive());
17354
-
17355
17316
  if(!this.isSessionActive()) return false;
17356
17317
  const clientPosition=this.getItemPosition(clientId);
17357
17318
  //CAUTION : Client position starts at 1 !
@@ -17475,13 +17436,9 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
17475
17436
 
17476
17437
  } else if(httpMethod==="GET" && requestBodyOrNamedArgs){
17477
17438
  // Not the same way to send parameters in GET http method :
17478
- // DBG
17479
- lognow("unformatted API URL : "+completeURL);
17480
17439
 
17481
17440
  completeURL=appendGetParameters(completeURL, requestBodyOrNamedArgs);
17482
17441
 
17483
- // DBG
17484
- lognow("formatted API URL : "+completeURL);
17485
17442
  }
17486
17443
 
17487
17444
  // CASE BROWSER CONTEXT :
@@ -17508,9 +17465,6 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
17508
17465
  // STRANGE : DOES WORK :
17509
17466
  .then(response => {
17510
17467
 
17511
- // DBG
17512
- console.log("~~~~~~~~~~~response :",response);
17513
-
17514
17468
  return response.json();
17515
17469
  }).then(data => {
17516
17470
 
@@ -17525,9 +17479,6 @@ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, re
17525
17479
  // return;
17526
17480
  // }
17527
17481
 
17528
- // DBG
17529
- console.log("~~~~~~~~~~~data :",data);
17530
-
17531
17482
  data.httpStatus=status;
17532
17483
  resolve(data);
17533
17484
  }).catch(error => {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1959",
3
+ "version": "0.0.1961",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils",
9
- "version": "0.0.1959",
9
+ "version": "0.0.1961",
10
10
  "license": "HGPL-1.0",
11
11
  "dependencies": {
12
12
  "atob": "^2.1.2",
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1959",
3
+ "version": "0.0.1961",
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)",