aotrautils 0.0.1924 → 0.0.1925
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 +17 -69
- 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 (26/07/2026-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -5470,7 +5470,7 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5470
5470
|
|
|
5471
5471
|
|
|
5472
5472
|
|
|
5473
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
5473
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
5474
5474
|
/*-----------------------------------------------------------------------------*/
|
|
5475
5475
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
5476
5476
|
*
|
|
@@ -5491,7 +5491,6 @@ window.AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
5491
5491
|
|
|
5492
5492
|
|
|
5493
5493
|
|
|
5494
|
-
|
|
5495
5494
|
// COMPATIBILITY browser javascript / nodejs environment :
|
|
5496
5495
|
if(typeof(window)==="undefined") window=global;
|
|
5497
5496
|
|
|
@@ -5504,7 +5503,7 @@ const APOSTROPHE="’";
|
|
|
5504
5503
|
window.PERFORM_TESTS_ON_LIBRARY=false;
|
|
5505
5504
|
|
|
5506
5505
|
// CAUTION ! Apparently nodejs ECMAscript does not do lazy evaluation when it's for throwing declaraion exceptions (it's logical, when you think a second about it..)
|
|
5507
|
-
function
|
|
5506
|
+
window.isUserMediaAvailable=function(){
|
|
5508
5507
|
if(typeof(navigator)==="undefined") return false;
|
|
5509
5508
|
return !!(navigator.mediaDevices && navigator.mediaDevices.getUserMedia && navigator.mediaDevices.enumerateDevices);
|
|
5510
5509
|
}
|
|
@@ -6526,6 +6525,7 @@ window.createCookie=function(name, value, days=null){
|
|
|
6526
6525
|
}
|
|
6527
6526
|
return value;
|
|
6528
6527
|
}
|
|
6528
|
+
|
|
6529
6529
|
/*private*/window.storeSingleString=function(name, value, forceUseCookie=false){
|
|
6530
6530
|
if((!window.isHTML5StorageSupported("local") || forceUseCookie ) && (typeof jQuery === "undefined" || !jQuery )){
|
|
6531
6531
|
// TRACE
|
|
@@ -8127,7 +8127,7 @@ window.getTargetPoints=function(rawData, width, height
|
|
|
8127
8127
|
/*OPTIONAL*//*DEPRECATED : USE PROMISE then() INSTEAD*/doFinallyWhenMultipleDevices=null
|
|
8128
8128
|
){
|
|
8129
8129
|
|
|
8130
|
-
if(!isUserMediaAvailable()){
|
|
8130
|
+
if(!window.isUserMediaAvailable()){
|
|
8131
8131
|
// TRACE
|
|
8132
8132
|
log("ERROR : User medias is not supported in your browser, or you are running in a non-https context, or you are running in a nodejs context. Aborting");
|
|
8133
8133
|
return Promise.resolve();
|
|
@@ -8257,7 +8257,7 @@ window.getTargetPoints=function(rawData, width, height
|
|
|
8257
8257
|
|
|
8258
8258
|
|
|
8259
8259
|
|
|
8260
|
-
if(!isUserMediaAvailable()){
|
|
8260
|
+
if(!window.isUserMediaAvailable()){
|
|
8261
8261
|
// TRACE
|
|
8262
8262
|
log("ERROR : User medias is not supported in your browser (or are you running in a non-https context ?). Aborting");
|
|
8263
8263
|
return null;
|
|
@@ -12985,7 +12985,7 @@ window.createOritaMicroClient=function(url, port, isNode=false, staticMicroClien
|
|
|
12985
12985
|
|
|
12986
12986
|
|
|
12987
12987
|
|
|
12988
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
12988
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
12989
12989
|
/*-----------------------------------------------------------------------------*/
|
|
12990
12990
|
|
|
12991
12991
|
|
|
@@ -13461,8 +13461,9 @@ Math.polygonsCollide=function(p1,p2){
|
|
|
13461
13461
|
// none of the sides intersect
|
|
13462
13462
|
return false;
|
|
13463
13463
|
}
|
|
13464
|
+
|
|
13464
13465
|
// helper: turn vertices into line points
|
|
13465
|
-
|
|
13466
|
+
/*private*/const verticesToLinePoints=function(polygon, isLineKeptFunction=null){
|
|
13466
13467
|
// make sure polys are self-closing
|
|
13467
13468
|
const firstPoint=polygon[0];
|
|
13468
13469
|
if(!(firstPoint.x==polygon[polygon.length-1].x && firstPoint.y==polygon[polygon.length-1].y)){
|
|
@@ -13550,10 +13551,6 @@ Math.getRotatedPolygon=function(points, angleRadians, rotationCenter={x:0,y:0}){
|
|
|
13550
13551
|
};
|
|
13551
13552
|
|
|
13552
13553
|
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
13554
|
window.isOriented=function(orientation, width, height){
|
|
13558
13555
|
if(orientation == "portrait"){
|
|
13559
13556
|
return width <= height;
|
|
@@ -13566,8 +13563,6 @@ window.isOriented=function(orientation, width, height){
|
|
|
13566
13563
|
}
|
|
13567
13564
|
|
|
13568
13565
|
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
13566
|
// Lines
|
|
13572
13567
|
|
|
13573
13568
|
// helper: test line intersections
|
|
@@ -13575,7 +13570,7 @@ window.isOriented=function(orientation, width, height){
|
|
|
13575
13570
|
// p0 & p1 form one segment, p2 & p3 form the second segment
|
|
13576
13571
|
// Get interseting point of 2 line segments (if any)
|
|
13577
13572
|
// Attribution: http://paulbourke.net/geometry/pointlineplane/
|
|
13578
|
-
|
|
13573
|
+
/*private*/const lineSegmentsCollide=function(segment1Point1,segment1Point2,segment2Point1,segment2Point2) {
|
|
13579
13574
|
|
|
13580
13575
|
// ORIGINAL :
|
|
13581
13576
|
// var unknownA = (p3.x-p2.x) * (p0.y-p2.y) - (p3.y-p2.y) * (p0.x-p2.x);
|
|
@@ -14048,32 +14043,14 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14048
14043
|
*/
|
|
14049
14044
|
|
|
14050
14045
|
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
14046
|
|
|
14070
14047
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14071
14048
|
|
|
14072
|
-
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14073
|
-
/*utils 3D library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14049
|
+
window.AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14050
|
+
/*utils 3D library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
14074
14051
|
/*-----------------------------------------------------------------------------*/
|
|
14075
14052
|
|
|
14076
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14053
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
14077
14054
|
/*-----------------------------------------------------------------------------*/
|
|
14078
14055
|
|
|
14079
14056
|
|
|
@@ -14333,7 +14310,7 @@ window.getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProvider
|
|
|
14333
14310
|
|
|
14334
14311
|
|
|
14335
14312
|
|
|
14336
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14313
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-15:21:19)»*/
|
|
14337
14314
|
/*-----------------------------------------------------------------------------*/
|
|
14338
14315
|
|
|
14339
14316
|
|
|
@@ -16451,7 +16428,7 @@ window.fileExists=(filePath)=>{
|
|
|
16451
16428
|
//Networking management :
|
|
16452
16429
|
//- WEBSOCKETS AND NODEJS :
|
|
16453
16430
|
|
|
16454
|
-
function
|
|
16431
|
+
window.isConnected=function(clientSocket){
|
|
16455
16432
|
// if(!window.WebsocketImplementation.useSocketIOImplementation)
|
|
16456
16433
|
if(!window.WebsocketImplementation.implementationToUse)
|
|
16457
16434
|
return (clientSocket.readyState===WebSocket.OPEN)
|
|
@@ -16542,7 +16519,6 @@ window.getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» a
|
|
|
16542
16519
|
}
|
|
16543
16520
|
|
|
16544
16521
|
|
|
16545
|
-
|
|
16546
16522
|
window.getConsoleCLI=(doOnCommands={"makeSandiwch":()=>{}}, promptText="Enter command> ")=>{
|
|
16547
16523
|
|
|
16548
16524
|
const readline = require("node:readline");
|
|
@@ -16580,14 +16556,9 @@ window.getConsoleCLI=(doOnCommands={"makeSandiwch":()=>{}}, promptText="Enter co
|
|
|
16580
16556
|
return cliInterface
|
|
16581
16557
|
};
|
|
16582
16558
|
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
16559
|
// NODE ONLY SERVER / CLIENTS :
|
|
16588
16560
|
window.WebsocketImplementation={
|
|
16589
16561
|
|
|
16590
|
-
|
|
16591
16562
|
isNodeContext:true,
|
|
16592
16563
|
// useSocketIOImplementation:false,
|
|
16593
16564
|
implementationToUse:null,// null is default (WebSocket)
|
|
@@ -16899,7 +16870,6 @@ window.WebsocketImplementation={
|
|
|
16899
16870
|
};
|
|
16900
16871
|
|
|
16901
16872
|
|
|
16902
|
-
|
|
16903
16873
|
window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
|
|
16904
16874
|
|
|
16905
16875
|
const EXCLUDED_FILENAMES_PARTS=[".keyHash.",".pem"];
|
|
@@ -16939,8 +16909,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
|
|
|
16939
16909
|
return;
|
|
16940
16910
|
}
|
|
16941
16911
|
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
16912
|
const urlFile="." + url;
|
|
16945
16913
|
|
|
16946
16914
|
let filePath=urlFile.indexOf("?")!==-1?urlFile.split("?")[0]:urlFile;
|
|
@@ -17010,7 +16978,6 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
|
|
|
17010
16978
|
listenableServer=httpServer;
|
|
17011
16979
|
}
|
|
17012
16980
|
|
|
17013
|
-
|
|
17014
16981
|
const server=window.WebsocketImplementation.getStatic(true).getServer(listenableServer);
|
|
17015
16982
|
|
|
17016
16983
|
// When a client connects, we execute the callback :
|
|
@@ -17019,20 +16986,15 @@ window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=
|
|
|
17019
16986
|
if(doOnConnect) doOnConnect(serverParam, clientSocketParam);
|
|
17020
16987
|
}, doOnConnectionLost);
|
|
17021
16988
|
|
|
17022
|
-
|
|
17023
16989
|
server.onFinalize((serverParam)=>{
|
|
17024
|
-
|
|
17025
16990
|
// DBG
|
|
17026
16991
|
lognow("onFinalize() server");
|
|
17027
16992
|
|
|
17028
16993
|
if(doOnFinalizeServer) doOnFinalizeServer(serverParam);
|
|
17029
16994
|
});
|
|
17030
16995
|
|
|
17031
|
-
|
|
17032
16996
|
// TRACE
|
|
17033
16997
|
console.log("INFO : SERVER : Generic Nodejs server launched and listening on port:" + port + "!");
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
16998
|
|
|
17037
16999
|
return server;
|
|
17038
17000
|
}
|
|
@@ -17050,9 +17012,7 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17050
17012
|
// EXAMPLE : node orita-srv.js hash orita.global@keyHash 1234567890
|
|
17051
17013
|
console.log("Server launched.");
|
|
17052
17014
|
|
|
17053
|
-
|
|
17054
17015
|
// We read the command-line arguments if needed :
|
|
17055
|
-
|
|
17056
17016
|
let argCLPort;
|
|
17057
17017
|
let argCLCertPath;
|
|
17058
17018
|
let argCLKeyPath;
|
|
@@ -17064,7 +17024,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17064
17024
|
let clearTextParam=null;
|
|
17065
17025
|
let persisterId=null;
|
|
17066
17026
|
|
|
17067
|
-
|
|
17068
17027
|
process.argv.forEach(function (val, i){
|
|
17069
17028
|
if(!val) return;
|
|
17070
17029
|
// 0 corresponds to «node / nodejs»
|
|
@@ -17089,8 +17048,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17089
17048
|
});
|
|
17090
17049
|
isForceUnsecure=(argCLCertPath==="unsecure");
|
|
17091
17050
|
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
17051
|
const aotraNodeServer={config:serverConfig};
|
|
17095
17052
|
aotraNodeServer.serverManager={ start:()=>{/*DEFAULT START FUNCTION, WILL BE OVERRIDEN LATER*/}};
|
|
17096
17053
|
|
|
@@ -17134,12 +17091,10 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17134
17091
|
return aotraNodeServer;
|
|
17135
17092
|
}
|
|
17136
17093
|
|
|
17137
|
-
|
|
17138
17094
|
const DEFAULT_PORT=nonull(argCLPort,25000);
|
|
17139
17095
|
const DEFAULT_CERT_PATH=nonull(argCLCertPath,"cert.pem");
|
|
17140
17096
|
const DEFAULT_KEY_PATH=nonull(argCLKeyPath,"key.key");
|
|
17141
17097
|
|
|
17142
|
-
|
|
17143
17098
|
let port=portParam ? portParam : DEFAULT_PORT;
|
|
17144
17099
|
let certPath=null;
|
|
17145
17100
|
let keyPath=null;
|
|
@@ -17149,9 +17104,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17149
17104
|
keyPath=keyPathParam?keyPathParam:DEFAULT_KEY_PATH;
|
|
17150
17105
|
}
|
|
17151
17106
|
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
17107
|
// UNUSEFUL :
|
|
17156
17108
|
//aotraNodeServer.serverManager.microClientsSockets=[];
|
|
17157
17109
|
// UNUSEFUL :
|
|
@@ -17180,7 +17132,6 @@ window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, d
|
|
|
17180
17132
|
|
|
17181
17133
|
aotraNodeServer.server=window.launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
|
|
17182
17134
|
|
|
17183
|
-
|
|
17184
17135
|
return aotraNodeServer;
|
|
17185
17136
|
};
|
|
17186
17137
|
|
|
@@ -17993,7 +17944,7 @@ class ClientInstance{
|
|
|
17993
17944
|
|
|
17994
17945
|
const clientSocket=this.clientSocket;
|
|
17995
17946
|
|
|
17996
|
-
if(!isConnected(clientSocket)) return;
|
|
17947
|
+
if(!window.isConnected(clientSocket)) return;
|
|
17997
17948
|
|
|
17998
17949
|
// Room information is stored in client socket object :
|
|
17999
17950
|
if(!window.WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
|
|
@@ -18261,12 +18212,9 @@ class NodeServerInstance{
|
|
|
18261
18212
|
// serverClients=this.serverSocket.sockets.sockets;
|
|
18262
18213
|
}
|
|
18263
18214
|
|
|
18264
|
-
|
|
18265
18215
|
serverClients.forEach((clientSocket)=>{
|
|
18266
18216
|
|
|
18267
|
-
|
|
18268
|
-
if(!isConnected(clientSocket)) return;
|
|
18269
|
-
|
|
18217
|
+
if(!window.isConnected(clientSocket)) return;
|
|
18270
18218
|
|
|
18271
18219
|
// Room information is stored in client socket object :
|
|
18272
18220
|
if(!window.WebsocketImplementation.isInRoom(clientSocket,clientsRoomsTag)) return;
|
aotrautils/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1925",
|
|
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.1925",
|
|
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.1925",
|
|
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)",
|