aotrautils-srv 0.0.1905 → 0.0.1907

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-02:51:50)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2026-03:20:23)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4098,7 +4098,7 @@ window.setByDottedPath=(obj, path, value)=>{
4098
4098
 
4099
4099
 
4100
4100
 
4101
- getUUID=function(mode=null){
4101
+ window.getUUID=function(mode=null){
4102
4102
 
4103
4103
  let uuid="";
4104
4104
  if(!mode){
@@ -4799,7 +4799,7 @@ function flattenGraph(root, UUID_ATTR_NAME, CLASSNAME_ATTR_NAME, POINTER_TO_ATTR
4799
4799
  if(typeof(obj)==="undefined" || obj === null || isPrimitive(obj)) return obj; // Primitives stay unchanged
4800
4800
  if(visitedObjects.has(obj)) return { [POINTER_TO_ATTR_NAME] : visitedObjects.get(obj) }; // Return if already processed
4801
4801
 
4802
- const id = (isRoot?ROOT_UUID:getUUID());
4802
+ const id = (isRoot?ROOT_UUID:window.getUUID());
4803
4803
  visitedObjects.set(obj, id); // Mark object as processed
4804
4804
 
4805
4805
  const serialized = {
@@ -5464,13 +5464,13 @@ window.getMonoThreadedGoToGoal=function(actuator,actualValue,goalValue,refreshMi
5464
5464
 
5465
5465
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
5466
5466
 
5467
- AOTRAUTILS_LIB_IS_LOADED=true;
5467
+ window.AOTRAUTILS_LIB_IS_LOADED=true;
5468
5468
 
5469
5469
 
5470
5470
 
5471
5471
 
5472
5472
 
5473
- /*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-02:51:50)»*/
5473
+ /*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-03:20:23)»*/
5474
5474
  /*-----------------------------------------------------------------------------*/
5475
5475
 
5476
5476
 
@@ -5573,7 +5573,7 @@ window.LLMAPIClient=class LLMAPIClient{
5573
5573
  const parameters=getAPIRequestParameters(messages);
5574
5574
 
5575
5575
  return new Promise((resolve,reject)=>{
5576
- performHTTPRequest(this.apiURL, "POST", headers, parameters, true).then((responseObj)=>{
5576
+ window.performHTTPRequest(this.apiURL, "POST", headers, parameters, true).then((responseObj)=>{
5577
5577
  const responseData=responseObj.responseData;
5578
5578
  const data=responseData;
5579
5579
 
@@ -5730,7 +5730,7 @@ getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProviderName=DE
5730
5730
 
5731
5731
 
5732
5732
 
5733
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-02:51:50)»*/
5733
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-03:20:23)»*/
5734
5734
  /*-----------------------------------------------------------------------------*/
5735
5735
 
5736
5736
 
@@ -5775,7 +5775,7 @@ class AORTACClientCell{
5775
5775
 
5776
5776
  constructor(serverCellOrigin, model, view, isNodeContext=true){
5777
5777
 
5778
- this.clientId=getUUID();
5778
+ this.clientId=window.getUUID();
5779
5779
 
5780
5780
  this.model=model;
5781
5781
  this.view=view;
@@ -5816,7 +5816,7 @@ class AORTACClientCell{
5816
5816
 
5817
5817
 
5818
5818
  // 1) Initial connection
5819
- self.initialClientInstance=initClient(self.isNodeContext
5819
+ self.initialClientInstance=window.initClient(self.isNodeContext
5820
5820
  // ,false
5821
5821
  ,(socketToServerClientInstance, initialClientInstanceLocal)=>{
5822
5822
 
@@ -5912,7 +5912,7 @@ class AORTACClientCell{
5912
5912
  const host=nonull(infos.host,"localhost");
5913
5913
  const port=nonull(infos.port,"30000");
5914
5914
 
5915
- const reconnectedClientInstance=initClient(self.isNodeContext
5915
+ const reconnectedClientInstance=window.initClient(self.isNodeContext
5916
5916
  // ,false
5917
5917
  ,(socketToServerClientInstance, reconnectedClientInstanceLocal)=>{
5918
5918
 
@@ -6223,7 +6223,7 @@ class AORTACServerCell{
6223
6223
  /*private*/launchServerForIncomingConnections(){
6224
6224
  const self=this;
6225
6225
 
6226
- const serverWrapper=initNodeServerInfrastructureWrapper(
6226
+ const serverWrapper=window.initNodeServerInfrastructureWrapper(
6227
6227
  // On each client connection :
6228
6228
  null,
6229
6229
  // On client finalization :
@@ -6311,7 +6311,7 @@ class AORTACServerCell{
6311
6311
  const outcomingCellHost=nonull(infos.host,"localhost");
6312
6312
  const outcomingCellPort=nonull(infos.port,"40000");
6313
6313
 
6314
- const clientInstance=initClient(true
6314
+ const clientInstance=window.initClient(true
6315
6315
  // ,false
6316
6316
  ,(socketToServerClientInstance)=>{
6317
6317
 
@@ -7029,7 +7029,7 @@ class AORTACServerCell{
7029
7029
  // if(isClassObject(attr)){
7030
7030
  // let aortacId=attr.aortacId;
7031
7031
  // if(!aortacId){
7032
- // aortacId=getUUID();
7032
+ // aortacId=window.getUUID();
7033
7033
  // attr.aortacId=aortacId;
7034
7034
  // }
7035
7035
  // if(!contains(linkedObjects,attr)){
@@ -7138,7 +7138,7 @@ class ServerCellLobule{
7138
7138
 
7139
7139
 
7140
7140
  window.getAORTACServerCell=function(quorumNumber=1, selfOrigin="ws://127.0.0.1:40000", outcomingCellsOrigins=[], model, controller){
7141
- //return new AORTACServerNode("node_"+getUUID("short"), selfOrigin, outcomingCellsOrigins, model, controller);
7141
+ //return new AORTACServerNode("node_"+window.getUUID("short"), selfOrigin, outcomingCellsOrigins, model, controller);
7142
7142
  if(window.aortacCServerCellInstance){
7143
7143
  // TRACE
7144
7144
  throw new Error("ERROR : The aortacCServerCellInstance singleton instance already exists. It cannot be instantiated again in the same process. Aborting.");
@@ -7465,7 +7465,7 @@ window.i18n=(languagesAndStrings, langParam=null)=>{
7465
7465
  // let declarable={};
7466
7466
  let maxLength=Math.min(result.length, MAX_CHARACTERS_FOR_TRANSLATION_KEY);
7467
7467
  let key=toConvention("camel", result.substring(0,maxLength).toLowerCase() );
7468
- // let calculatedKey=radicalKey+"_"+getUUID("short");
7468
+ // let calculatedKey=radicalKey+"_"+window.getUUID("short");
7469
7469
  // declarable[calculatedKey]=languagesAndStrings;
7470
7470
  i18n.declareSingleEntry(key, languagesAndStrings);
7471
7471
  }
@@ -7865,7 +7865,7 @@ window.getURLOrConsoleParameter=(parameterName)=>{
7865
7865
 
7866
7866
  // Server-side :
7867
7867
 
7868
- getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam=null, ignoreConsoleArgs=false, argsOffset=0){
7868
+ window.getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam=null, ignoreConsoleArgs=false, argsOffset=0){
7869
7869
 
7870
7870
  if(typeof(window.https)==="undefined"){
7871
7871
  // TRACE
@@ -7909,7 +7909,7 @@ getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam
7909
7909
  return result;
7910
7910
  }
7911
7911
 
7912
- getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» and arg 1 is the js file*/){
7912
+ window.getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» and arg 1 is the js file*/){
7913
7913
  if(!process){
7914
7914
  throw new Error("ERROR : Cannot extract console parameter in this context !");
7915
7915
  }
@@ -8170,7 +8170,7 @@ WebsocketImplementation={
8170
8170
  return nodeServerInstance;
8171
8171
  },
8172
8172
 
8173
- // DO NOT USE DIRECTLY, USE INSTEAD initClient(...) (this function uses connectToServer(...)) !
8173
+ // DO NOT USE DIRECTLY, USE INSTEAD window.initClient(...) (this function uses connectToServer(...)) !
8174
8174
  // NODE / BROWSER CLIENT CONNECTS TO SERVER MAIN ENTRYPOINT:
8175
8175
  connectToServer:(serverURL, port, isSecure=false, timeout)=>{
8176
8176
 
@@ -8297,7 +8297,7 @@ WebsocketImplementation={
8297
8297
 
8298
8298
 
8299
8299
 
8300
- launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
8300
+ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
8301
8301
 
8302
8302
  const EXCLUDED_FILENAMES_PARTS=[".keyHash.",".pem"];
8303
8303
 
@@ -8435,7 +8435,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, d
8435
8435
  }
8436
8436
 
8437
8437
 
8438
- initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFinalizeServer=null, doOnConnectionLost=null,
8438
+ window.window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFinalizeServer=null, doOnConnectionLost=null,
8439
8439
  /*OPTIONAL*/portParam,
8440
8440
  /*OPTIONAL*/certPathParam,
8441
8441
  /*OPTIONAL*/keyPathParam){
@@ -8506,7 +8506,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
8506
8506
  if(!globalKeyHashObject || !globalKeyHashObject.keyHash){
8507
8507
  // TRACE
8508
8508
  console.log("WARN : No key hash found. Generating one now.");
8509
- globalKeyHashObject={keyHash:getUUID(), hashes:[]};
8509
+ globalKeyHashObject={keyHash:window.getUUID(), hashes:[]};
8510
8510
  persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,globalKeyHashObject,false,()=>{
8511
8511
  // TRACE
8512
8512
  console.log("INFO : Key hash generated and saved successfully.");
@@ -8575,7 +8575,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
8575
8575
  }
8576
8576
  }
8577
8577
 
8578
- aotraNodeServer.server=launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
8578
+ aotraNodeServer.server=window.launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
8579
8579
 
8580
8580
 
8581
8581
  return aotraNodeServer;
@@ -8608,7 +8608,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
8608
8608
  // const REFRESH_SCREENSHOTS_MILLIS=500;
8609
8609
  //
8610
8610
  //
8611
- // const server=initNodeServerInfrastructureWrapper(
8611
+ // const server=window.initNodeServerInfrastructureWrapper(
8612
8612
  // // On each client connection :
8613
8613
  // // (serverParam, clientSocketParam)=>{},
8614
8614
  // null,
@@ -8653,7 +8653,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
8653
8653
  // // };
8654
8654
  // // const server={};
8655
8655
  // // server.start=(port=4000)=>{
8656
- // // server.httpServer=launchNodeHTTPServer(port, doOnConnect, doOnFinalizeServer, sslOptions);
8656
+ // // server.httpServer=window.launchNodeHTTPServer(port, doOnConnect, doOnFinalizeServer, sslOptions);
8657
8657
  // // };
8658
8658
  //
8659
8659
  // return server;
@@ -8832,7 +8832,7 @@ getListManager=function(config){
8832
8832
  // NO : IN A NODE CONTEXT WITH require("...") WILL RESULT IN AN UNDEFINED FUNCTION ERROR !!!
8833
8833
  // function performHTTPRequest(...){...
8834
8834
  // USE THIS INSTEAD :
8835
- performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, requestBodyOrNamedArgs=null, isNodeContext=false, addCORSHeader=ADD_CORS_HEADER){
8835
+ window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, requestBodyOrNamedArgs=null, isNodeContext=false, addCORSHeader=ADD_CORS_HEADER){
8836
8836
 
8837
8837
  // Body
8838
8838
  let requestBodyOrNamedArgsStr=null;
@@ -9136,7 +9136,7 @@ if(typeof(window)==="undefined") window=global;
9136
9136
  // -Client :
9137
9137
 
9138
9138
  // TODO : Use everywhere it's applicable !
9139
- initClient=function(isNodeContext=true
9139
+ window.initClient=function(isNodeContext=true
9140
9140
  // ,useSocketIOImplementation=/*DEBUG*/false
9141
9141
  ,doOnServerConnection=null, url, /*OPTIONAL*/port=25000, /*OPTIONAL*/timeout=10000, /*OPTIONAL*/selfParam=null){
9142
9142
 
@@ -9321,7 +9321,7 @@ class ClientInstance{
9321
9321
  lognow(">>>>>>sendChainable CLIENT ("+channelNameParam+"):data:",data);
9322
9322
 
9323
9323
  // We add a message id :
9324
- const messageId=getUUID();
9324
+ const messageId=window.getUUID();
9325
9325
  data.messageId=messageId;
9326
9326
 
9327
9327
  // 1) We prepare the reception :
@@ -9739,7 +9739,7 @@ class NodeServerInstance{
9739
9739
  // DBG
9740
9740
  console.log("SERVER : ON CONNECTION !");
9741
9741
 
9742
- const clientId="autogeneratedid_"+getUUID();
9742
+ const clientId="autogeneratedid_"+window.getUUID();
9743
9743
 
9744
9744
  clientSocket.clientId=clientId;
9745
9745
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1905",
3
+ "version": "0.0.1907",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "aotrautils-srv",
9
- "version": "0.0.1905",
9
+ "version": "0.0.1907",
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.1905",
3
+ "version": "0.0.1907",
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)",