aotrautils 0.0.2042 → 0.0.2044
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.
- aotrautils/aotrautils.build.js +57 -21
- aotrautils/package-lock.json +2 -2
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -5485,7 +5485,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5485
5485
|
|
|
5486
5486
|
|
|
5487
5487
|
|
|
5488
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (
|
|
5488
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
5489
5489
|
/*-----------------------------------------------------------------------------*/
|
|
5490
5490
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
5491
5491
|
*
|
|
@@ -13053,7 +13053,7 @@ window.createOritaMicroClient=function(url, port, isNode=false, staticMicroClien
|
|
|
13053
13053
|
|
|
13054
13054
|
|
|
13055
13055
|
|
|
13056
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (
|
|
13056
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
13057
13057
|
/*-----------------------------------------------------------------------------*/
|
|
13058
13058
|
|
|
13059
13059
|
|
|
@@ -14142,10 +14142,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14142
14142
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14143
14143
|
|
|
14144
14144
|
window.AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14145
|
-
/*utils 3D library associated with aotra version : «1_29072022-2359 (
|
|
14145
|
+
/*utils 3D library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
14146
14146
|
/*-----------------------------------------------------------------------------*/
|
|
14147
14147
|
|
|
14148
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (
|
|
14148
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
14149
14149
|
/*-----------------------------------------------------------------------------*/
|
|
14150
14150
|
|
|
14151
14151
|
|
|
@@ -14409,7 +14409,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
|
|
|
14409
14409
|
|
|
14410
14410
|
|
|
14411
14411
|
|
|
14412
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (
|
|
14412
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (17/10/2026-02:53:29)»*/
|
|
14413
14413
|
/*-----------------------------------------------------------------------------*/
|
|
14414
14414
|
|
|
14415
14415
|
|
|
@@ -17263,7 +17263,7 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
|
|
|
17263
17263
|
|
|
17264
17264
|
// (we bypass the channel and message types filters !)
|
|
17265
17265
|
try{
|
|
17266
|
-
httpEndpointResultObject.body=await serverReceptionEntryPoint.
|
|
17266
|
+
httpEndpointResultObject.body=await serverReceptionEntryPoint.executeWithAllPrerequisites(dataWrapped, eventOrMessage, null);
|
|
17267
17267
|
}catch(treatmentsChannelError){
|
|
17268
17268
|
// TODO : FIXME : DUPLICATED CODE !!!
|
|
17269
17269
|
const errorMessage="ERROR : An error has occured during the processing of a client message on channel treatments.";
|
|
@@ -18034,7 +18034,7 @@ if(typeof(window)==="undefined") window=global;
|
|
|
18034
18034
|
// clientSocket.isConnectionAlive=true;
|
|
18035
18035
|
//});
|
|
18036
18036
|
|
|
18037
|
-
|
|
18037
|
+
const ERRORS_CHANNEL_NAME="errors";
|
|
18038
18038
|
|
|
18039
18039
|
|
|
18040
18040
|
// ==================================================================================================================
|
|
@@ -18429,11 +18429,12 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18429
18429
|
this.clientsRoomsTag=clientsRoomsTag;
|
|
18430
18430
|
|
|
18431
18431
|
this.serverReceptionEntryPoints=[];
|
|
18432
|
-
this.asyncPrerequisiteMethods=
|
|
18432
|
+
this.asyncPrerequisiteMethods=new Set();
|
|
18433
18433
|
}
|
|
18434
18434
|
|
|
18435
18435
|
// Executed whenever any message is received on any channel :
|
|
18436
18436
|
executeAll(eventOrMessage, clientSocket=null){ // FOR REAL-TIME ONLY :
|
|
18437
|
+
const self=this;
|
|
18437
18438
|
|
|
18438
18439
|
const clientsRoomsTag=this.clientsRoomsTag;
|
|
18439
18440
|
if(!window.WebsocketImplementation.isInRoom(clientSocket, clientsRoomsTag)) return;
|
|
@@ -18461,7 +18462,7 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18461
18462
|
// TRACE
|
|
18462
18463
|
lognow(errorMessage, treatmentsChannelError);
|
|
18463
18464
|
const errorDataWrapped={errorMessage:errorMessage, cause:treatmentsChannelError};
|
|
18464
|
-
self.sendError(errorDataWrapped, clientSocket);
|
|
18465
|
+
self.server.sendError(errorDataWrapped, clientSocket);
|
|
18465
18466
|
});
|
|
18466
18467
|
|
|
18467
18468
|
});
|
|
@@ -18471,13 +18472,14 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18471
18472
|
// TRACE
|
|
18472
18473
|
lognow(errorMessage, error);
|
|
18473
18474
|
const errorDataWrapped={errorMessage:errorMessage, cause:error};
|
|
18474
|
-
self.sendError(errorDataWrapped, clientSocket);
|
|
18475
|
+
self.server.sendError(errorDataWrapped, clientSocket);
|
|
18475
18476
|
});
|
|
18476
18477
|
|
|
18477
18478
|
}
|
|
18478
18479
|
|
|
18480
|
+
|
|
18479
18481
|
addReceiveListenerPrerequisite(asyncPrerequisiteMethod){
|
|
18480
|
-
this.asyncPrerequisiteMethods.
|
|
18482
|
+
this.asyncPrerequisiteMethods.add(asyncPrerequisiteMethod);
|
|
18481
18483
|
// TRACE
|
|
18482
18484
|
lognow("INFO : Added prerequisite: asyncPrerequisiteMethods:",asyncPrerequisiteMethod);
|
|
18483
18485
|
return this;
|
|
@@ -18503,6 +18505,10 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18503
18505
|
// I-
|
|
18504
18506
|
// ASYNC
|
|
18505
18507
|
addReceiveListener(messageType, asyncDoOnIncomingMessage, httpEndpointDefinition=null){
|
|
18508
|
+
|
|
18509
|
+
// DBG
|
|
18510
|
+
lognow("(SERVER) (ServerReceptionEntryPointsBag) Registering receive (NEW API) for message type «"+messageType+"»...");
|
|
18511
|
+
|
|
18506
18512
|
const channelNameParam=this.channelNameParam;
|
|
18507
18513
|
const clientsRoomsTag=this.clientsRoomsTag;
|
|
18508
18514
|
const messageTypes=(!messageType || empty(messageType) ? [] :
|
|
@@ -18510,7 +18516,7 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18510
18516
|
);
|
|
18511
18517
|
const listenerConfig={listenerMessageTypes:messageTypes, httpEndpointDefinition:httpEndpointDefinition};
|
|
18512
18518
|
const serverReceptionEntryPoint=
|
|
18513
|
-
new window.ServerReceptionEntryPoint(channelNameParam, clientsRoomsTag, listenerConfig, asyncDoOnIncomingMessage);
|
|
18519
|
+
new window.ServerReceptionEntryPoint(channelNameParam, clientsRoomsTag, listenerConfig, asyncDoOnIncomingMessage, this);
|
|
18514
18520
|
this.serverReceptionEntryPoints.push(serverReceptionEntryPoint);
|
|
18515
18521
|
|
|
18516
18522
|
if(httpEndpointDefinition){
|
|
@@ -18530,11 +18536,12 @@ window.ServerReceptionEntryPointsBag=class ServerReceptionEntryPointsBag{
|
|
|
18530
18536
|
|
|
18531
18537
|
window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
|
|
18532
18538
|
|
|
18533
|
-
constructor(channelNameParam, clientsRoomsTag, listenerConfig=null, asyncDoOnIncomingMessage){
|
|
18539
|
+
constructor(channelNameParam, clientsRoomsTag, listenerConfig=null, asyncDoOnIncomingMessage, parentServerReceptionEntryPointsBag=null){
|
|
18534
18540
|
this.channelName=channelNameParam;
|
|
18535
18541
|
this.clientsRoomsTag=clientsRoomsTag;
|
|
18536
18542
|
this.listenerConfig=listenerConfig;
|
|
18537
18543
|
this.asyncDoOnIncomingMessage=asyncDoOnIncomingMessage;
|
|
18544
|
+
this.parentServerReceptionEntryPointsBag=parentServerReceptionEntryPointsBag;
|
|
18538
18545
|
}
|
|
18539
18546
|
|
|
18540
18547
|
async execute(eventOrMessage, clientSocketParam=null){
|
|
@@ -18542,7 +18549,7 @@ window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
|
|
|
18542
18549
|
if(!eventOrMessage){
|
|
18543
18550
|
// TRACE
|
|
18544
18551
|
lognow("ERROR : No message received.");
|
|
18545
|
-
return;
|
|
18552
|
+
return null;
|
|
18546
18553
|
}
|
|
18547
18554
|
|
|
18548
18555
|
// OLD :
|
|
@@ -18561,7 +18568,7 @@ window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
|
|
|
18561
18568
|
|
|
18562
18569
|
// Room information is stored in client socket object :
|
|
18563
18570
|
const isClientInRoom=window.WebsocketImplementation.isInRoom(clientSocketParam, this.clientsRoomsTag);
|
|
18564
|
-
if(!isClientInRoom) return;
|
|
18571
|
+
if(!isClientInRoom) return null;
|
|
18565
18572
|
|
|
18566
18573
|
|
|
18567
18574
|
if(this.listenerConfig){
|
|
@@ -18570,7 +18577,7 @@ window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
|
|
|
18570
18577
|
// Else we check if the message matches the required message types :
|
|
18571
18578
|
if( dataWrapped.data && dataWrapped.data.type
|
|
18572
18579
|
&& !contains(this.listenerConfig.listenerMessageTypes, dataWrapped.data.type))
|
|
18573
|
-
return;
|
|
18580
|
+
return null;
|
|
18574
18581
|
}
|
|
18575
18582
|
}
|
|
18576
18583
|
|
|
@@ -18587,6 +18594,13 @@ window.ServerReceptionEntryPoint=class ServerReceptionEntryPoint{
|
|
|
18587
18594
|
}
|
|
18588
18595
|
|
|
18589
18596
|
}
|
|
18597
|
+
|
|
18598
|
+
async executeWithAllPrerequisites(dataWrapped, originalEventOrMessage, clientSocket){
|
|
18599
|
+
if(this.parentServerReceptionEntryPointsBag)
|
|
18600
|
+
await this.parentServerReceptionEntryPointsBag.executeAllPrerequisites(dataWrapped, originalEventOrMessage, clientSocket);
|
|
18601
|
+
return await this.execute(originalEventOrMessage, clientSocket);
|
|
18602
|
+
}
|
|
18603
|
+
|
|
18590
18604
|
}
|
|
18591
18605
|
|
|
18592
18606
|
|
|
@@ -18640,10 +18654,10 @@ window.NodeServerInstance=class NodeServerInstance{
|
|
|
18640
18654
|
receive(channelNameParam, doOnIncomingMessage, listenerConfig=null, clientsRoomsTag=null){
|
|
18641
18655
|
|
|
18642
18656
|
// DBG
|
|
18643
|
-
lognow("(SERVER) Registering receive (OLD API) for channel «"+channelNameParam+"»...");
|
|
18657
|
+
lognow("(SERVER) (NodeServerInstance) Registering receive (OLD API) for channel «"+channelNameParam+"»...");
|
|
18644
18658
|
|
|
18645
18659
|
const serverReceptionEntryPoint=
|
|
18646
|
-
new window.ServerReceptionEntryPoint(channelNameParam, clientsRoomsTag, listenerConfig, doOnIncomingMessage);
|
|
18660
|
+
new window.ServerReceptionEntryPoint(channelNameParam, clientsRoomsTag, listenerConfig, doOnIncomingMessage, null);
|
|
18647
18661
|
this.serverReceptionEntryPoints.push(serverReceptionEntryPoint);
|
|
18648
18662
|
|
|
18649
18663
|
//OLD: // SPECIAL FOR THE SOCKETIO IMPLEMENTATION :
|
|
@@ -18762,7 +18776,29 @@ window.NodeServerInstance=class NodeServerInstance{
|
|
|
18762
18776
|
|
|
18763
18777
|
return dataWrapped;
|
|
18764
18778
|
}
|
|
18765
|
-
|
|
18779
|
+
|
|
18780
|
+
|
|
18781
|
+
/*private*/sendError(error, clientSocketParam=null){
|
|
18782
|
+
// CAUTION ! NEVER DO THIS : clientSocketParam.send(...) ! (because it directly calls a single socket implementation !)
|
|
18783
|
+
|
|
18784
|
+
let errorMessageToSend=error;
|
|
18785
|
+
if(contains(typeof(error),"Error")){
|
|
18786
|
+
errorMessageToSend={
|
|
18787
|
+
type: error.type,
|
|
18788
|
+
httpStatus:error.httpStatus,
|
|
18789
|
+
error:(isString(error) ?
|
|
18790
|
+
{errorMessage:error}
|
|
18791
|
+
: {errorMessage:error.errorMessage, cause:(error.cause?{message:error.cause.message}:null)})
|
|
18792
|
+
};
|
|
18793
|
+
}
|
|
18794
|
+
|
|
18795
|
+
if(clientSocketParam){
|
|
18796
|
+
return this.send(ERRORS_CHANNEL_NAME, errorMessageToSend, null, clientSocketParam);
|
|
18797
|
+
}
|
|
18798
|
+
return errorMessageToSend;
|
|
18799
|
+
}
|
|
18800
|
+
|
|
18801
|
+
|
|
18766
18802
|
|
|
18767
18803
|
onConnectionToClient(doOnConnection, doOnConnectionLost=null){
|
|
18768
18804
|
const self=this;
|
|
@@ -18802,7 +18838,7 @@ window.NodeServerInstance=class NodeServerInstance{
|
|
|
18802
18838
|
// We execute the events registration listeners entry points:
|
|
18803
18839
|
// DEPRECATED : OLD API :
|
|
18804
18840
|
foreach(self.serverReceptionEntryPoints, (serverReceptionEntryPoint,i)=>{
|
|
18805
|
-
serverReceptionEntryPoint.execute(eventOrMessage, clientSocket
|
|
18841
|
+
serverReceptionEntryPoint.execute(eventOrMessage, clientSocket).then(()=>{
|
|
18806
18842
|
/*DO NOTHING*/
|
|
18807
18843
|
}).catch(treatmentsChannelError=>{
|
|
18808
18844
|
// TODO : FIXME : DUPLICATED CODE !!!
|
aotrautils/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2044",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "aotrautils",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.2044",
|
|
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.
|
|
3
|
+
"version": "0.0.2044",
|
|
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)",
|