aotrautils 0.0.2044 → 0.0.2046

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 (17/10/2026-02:53:29)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -457,6 +457,30 @@ if(!window.aotestAllTestsManager){
457
457
  // Utility methods for aotest framework :
458
458
 
459
459
  // UI/CLI ONLY :
460
+
461
+ window.aotestMethods.getTestsMapForScenarii=(testsArray, scenariiNames=null/*(OPTIONAL)*/)=>{
462
+ const testsMap={};
463
+
464
+ if(!scenariiNames || scenariiNames=="" || scenariiNames=="*"){// Case we want all tests from all scenarii:
465
+ foreach(testsArray, (test, testName)=>{
466
+ // (to avoid doing this treatment several times unecessarily)
467
+ if(testsMap[testName]) return "continue";
468
+ testsMap[testName]=test;
469
+ });
470
+ }else{
471
+ foreach(scenariiNames,scenarioName=>{
472
+ foreach(testsArray,(test,testName)=>{
473
+ // (to avoid doing this treatment several times unecessarily)
474
+ if(testsMap[testName]) return "continue";
475
+ testsMap[testName]=test;
476
+ },(test, testName)=>(contains(Object.keys(test),scenarioName)));
477
+ });
478
+ }
479
+
480
+ return testsMap;
481
+ };
482
+
483
+
460
484
  window.aotestMethods.getParentTestByScenarioNameInTestsArray=function(testsArray, scenarioName){
461
485
  return foreach(testsArray,test=>{
462
486
  return window.aotestMethods.iterateOverScenariiInSingleTest(test, (parentTest, scenario)=>{
@@ -560,7 +584,7 @@ window.aotestMethods.getScenarioInSingleTest=function(test, scenarioName=null){
560
584
  window.aotestMethods.getScenariiInSingleTest=function(test, scenariiNames=null){
561
585
  let results={};
562
586
  window.aotestMethods.iterateOverScenariiInSingleTest(test,(t,s,sName)=>{
563
- if(!scenariiNames || contains(scenariiNames, sName)){
587
+ if(!scenariiNames || scenariiNames=="" || scenariiNames=="*" || contains(scenariiNames, sName)){
564
588
  results[sName]=s;
565
589
  }
566
590
  });
@@ -578,6 +602,7 @@ window.aotestMethods.iterateOverScenariiInSingleTest=function(test, doOnEachIter
578
602
 
579
603
 
580
604
 
605
+
581
606
  /*public*/window.aotestMethods.iterateOverValuesOnClonedObject=function(scenarioParam, doOnIterationForValue, visited=[], valuePath="", isValueFunction=null){
582
607
 
583
608
  // CAUTION : We ABSOLUTELY need to iterate over a deep copy, or else it will create weird incomprehensible bugs
@@ -5485,7 +5510,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
5485
5510
 
5486
5511
 
5487
5512
 
5488
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
5513
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
5489
5514
  /*-----------------------------------------------------------------------------*/
5490
5515
  /* ## Utility global methods in a browser (htmljs) client environment.
5491
5516
  *
@@ -13053,7 +13078,7 @@ window.createOritaMicroClient=function(url, port, isNode=false, staticMicroClien
13053
13078
 
13054
13079
 
13055
13080
 
13056
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
13081
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
13057
13082
  /*-----------------------------------------------------------------------------*/
13058
13083
 
13059
13084
 
@@ -14142,10 +14167,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
14142
14167
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14143
14168
 
14144
14169
  window.AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14145
- /*utils 3D library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
14170
+ /*utils 3D library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
14146
14171
  /*-----------------------------------------------------------------------------*/
14147
14172
 
14148
- /*utils AI library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
14173
+ /*utils AI library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
14149
14174
  /*-----------------------------------------------------------------------------*/
14150
14175
 
14151
14176
 
@@ -14409,7 +14434,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
14409
14434
 
14410
14435
 
14411
14436
 
14412
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
14437
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (18/10/2026-02:46:26)»*/
14413
14438
  /*-----------------------------------------------------------------------------*/
14414
14439
 
14415
14440
 
@@ -17283,8 +17308,8 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
17283
17308
 
17284
17309
 
17285
17310
  }catch(error) {
17286
- response.writeHead(erreur.error || 500, { "Content-Type": "application/json" });
17287
- response.end(JSON.stringify({ error: erreur.error || "ERROR : HTTPO Endpoints encountered an error" }));
17311
+ response.writeHead(error.error || 500, { "Content-Type": "application/json" });
17312
+ response.end(JSON.stringify({ error: error.error || "ERROR : HTTP Endpoints encountered an error" }));
17288
17313
  }
17289
17314
  }
17290
17315
 
@@ -17956,9 +17981,9 @@ window.isURLLocalhost=(url)=>{
17956
17981
 
17957
17982
 
17958
17983
  window.assert={};
17959
- window.assert.notNull=(value, errorMessage=null)=>{
17984
+ window.assert.notNull=(value, variableName=null, errorMessage=null)=>{
17960
17985
  if(typeof(value)=="undefined" || value==null)
17961
- throw new Error(nonull(errorMessage, "ERROR : Value is null."));
17986
+ throw new Error(nonull(errorMessage, (variableName?"ERROR : "+variableName+" is null.":"ERROR : Value is null.")));
17962
17987
  };
17963
17988
 
17964
17989
 
@@ -18509,14 +18534,14 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
18509
18534
  // DBG
18510
18535
  lognow("(SERVER) (ServerReceptionEntryPointsBag) Registering receive (NEW API) for message type «"+messageType+"»...");
18511
18536
 
18512
- const channelNameParam=this.channelNameParam;
18537
+ const channelName=this.channelName;
18513
18538
  const clientsRoomsTag=this.clientsRoomsTag;
18514
18539
  const messageTypes=(!messageType || empty(messageType) ? [] :
18515
18540
  (isArray(messageType) ? messageType : [messageType])
18516
18541
  );
18517
18542
  const listenerConfig={listenerMessageTypes:messageTypes, httpEndpointDefinition:httpEndpointDefinition};
18518
18543
  const serverReceptionEntryPoint=
18519
- new window.ServerReceptionEntryPoint(channelNameParam, clientsRoomsTag, listenerConfig, asyncDoOnIncomingMessage, this);
18544
+ new window.ServerReceptionEntryPoint(channelName, clientsRoomsTag, listenerConfig, asyncDoOnIncomingMessage, this);
18520
18545
  this.serverReceptionEntryPoints.push(serverReceptionEntryPoint);
18521
18546
 
18522
18547
  if(httpEndpointDefinition){
@@ -18529,6 +18554,22 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
18529
18554
 
18530
18555
  return this;
18531
18556
  }
18557
+
18558
+ addAPIEndpointsExposition(){
18559
+ const self=this;
18560
+ this.addReceiveListener("endpoints", async (message, clientSocket=null)=>{// (Also handles backupUUID tests executions)
18561
+ const results=[];
18562
+ foreach(self.serverReceptionEntryPoints, serverReceptionEntryPoint=>{
18563
+ const conf=serverReceptionEntryPoint.listenerConfig;
18564
+ if(!conf || !conf.httpEndpointDefinition)
18565
+ return "continue";
18566
+ const httpEndpoint=conf.httpEndpointDefinition;
18567
+ results.push({httpMethod:httpEndpoint.httpMethod,urlPath:httpEndpoint.urlPath});
18568
+ });
18569
+ return {endpoints:results};
18570
+ },{urlPath:"/endpoints", httpMethod:"GET"})
18571
+ return this;
18572
+ }
18532
18573
 
18533
18574
  }
18534
18575
 
@@ -18536,7 +18577,7 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
18536
18577
 
18537
18578
  window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
18538
18579
 
18539
- constructor(channelNameParam, clientsRoomsTag, listenerConfig=null, asyncDoOnIncomingMessage, parentServerReceptionEntryPointsBag=null){
18580
+ constructor(channelNameParam, clientsRoomsTag, listenerConfig=null, asyncDoOnIncomingMessage=null, parentServerReceptionEntryPointsBag=null){
18540
18581
  this.channelName=channelNameParam;
18541
18582
  this.clientsRoomsTag=clientsRoomsTag;
18542
18583
  this.listenerConfig=listenerConfig;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.2044",
3
+ "version": "0.0.2046",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils",
9
- "version": "0.0.2044",
9
+ "version": "0.0.2046",
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.2044",
3
+ "version": "0.0.2046",
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)",