aotrautils 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.
- aotrautils/aotrautils.build.js +70 -70
- 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-03:15:58)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -3982,8 +3982,8 @@ Math.makeMultipleOf=function(bruteValue, multiple,/*OPTIONAL*/roundingMode){
|
|
|
3982
3982
|
|
|
3983
3983
|
|
|
3984
3984
|
|
|
3985
|
-
getTimer=function(callback, delay){
|
|
3986
|
-
return new SimpleTimer(callback, delay);
|
|
3985
|
+
window.getTimer=function(callback, delay){
|
|
3986
|
+
return new window.SimpleTimer(callback, delay);
|
|
3987
3987
|
// let self={
|
|
3988
3988
|
// timerId:null,
|
|
3989
3989
|
// start:null,
|
|
@@ -4008,14 +4008,14 @@ getTimer=function(callback, delay){
|
|
|
4008
4008
|
|
|
4009
4009
|
|
|
4010
4010
|
//Usage :
|
|
4011
|
-
//var timer=new SimpleTimer(function(){
|
|
4011
|
+
//var timer=new window.SimpleTimer(function(){
|
|
4012
4012
|
//alert("Done!");
|
|
4013
4013
|
//}, 1000);
|
|
4014
4014
|
//
|
|
4015
4015
|
//timer.pause();
|
|
4016
4016
|
////Do some stuff...
|
|
4017
4017
|
//timer.resume();
|
|
4018
|
-
|
|
4018
|
+
window.SimpleTimer=function(callback, delay){
|
|
4019
4019
|
var timerId, start, remaining=delay;
|
|
4020
4020
|
|
|
4021
4021
|
this.pause=function(){
|
|
@@ -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 = {
|
|
@@ -5470,7 +5470,7 @@ 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-03:15:58)»*/
|
|
5474
5474
|
/*-----------------------------------------------------------------------------*/
|
|
5475
5475
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
5476
5476
|
*
|
|
@@ -6936,21 +6936,22 @@ window.numberToAsciiString=(num, originalStringSize)=>{
|
|
|
6936
6936
|
|
|
6937
6937
|
|
|
6938
6938
|
|
|
6939
|
-
/*private*/
|
|
6939
|
+
/*private*/const componentToHex=function(c){
|
|
6940
6940
|
var hex=c.toString(16);
|
|
6941
6941
|
return hex.length==1 ? "0" + hex : hex;
|
|
6942
6942
|
}
|
|
6943
|
-
|
|
6943
|
+
|
|
6944
|
+
/*public*/window.rgb2Hex=function(r, g, b){
|
|
6944
6945
|
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
|
|
6945
6946
|
}
|
|
6946
6947
|
|
|
6947
|
-
|
|
6948
|
-
changeLuminosity=function(htmlHexStr,amount){
|
|
6948
|
+
// UNUSED
|
|
6949
|
+
window.changeLuminosity=function(htmlHexStr,amount){
|
|
6949
6950
|
let rgb=htmlColorCodeToDecimalArray(htmlHexStr);
|
|
6950
6951
|
let r=Math.coerceInRange(rgb[0]+amount,0,255);
|
|
6951
6952
|
let g=Math.coerceInRange(rgb[1]+amount,0,255);
|
|
6952
6953
|
let b=Math.coerceInRange(rgb[2]+amount,0,255);
|
|
6953
|
-
return rgb2Hex(r,g,b);
|
|
6954
|
+
return window.rgb2Hex(r,g,b);
|
|
6954
6955
|
}
|
|
6955
6956
|
|
|
6956
6957
|
|
|
@@ -7013,8 +7014,8 @@ if(typeof(window)!=="undefined") window.URL=window.URL || window.webkitURL;
|
|
|
7013
7014
|
//}
|
|
7014
7015
|
|
|
7015
7016
|
|
|
7016
|
-
|
|
7017
|
-
function
|
|
7017
|
+
// UNUSED
|
|
7018
|
+
window.doWithChunks=function(chunksNumber,dataArray,doFunction,/*OPTIONAL*/refreshingRateMillis,/*OPTIONAL*/modeParam){
|
|
7018
7019
|
|
|
7019
7020
|
if(chunksNumber<1){
|
|
7020
7021
|
log("ERROR : Chunks number is too small. chunksNumber:"+chunksNumber);
|
|
@@ -7072,8 +7073,7 @@ function doWithChunks(chunksNumber,dataArray,doFunction,/*OPTIONAL*/refreshingRa
|
|
|
7072
7073
|
|
|
7073
7074
|
}
|
|
7074
7075
|
|
|
7075
|
-
|
|
7076
|
-
removeAlpha=function(videoRawData){
|
|
7076
|
+
/*private*/const removeAlpha=function(videoRawData){
|
|
7077
7077
|
var newVideoRawData=[];
|
|
7078
7078
|
for(var i=0;i<videoRawData.length;i++){
|
|
7079
7079
|
var val=videoRawData[i];
|
|
@@ -7083,8 +7083,8 @@ removeAlpha=function(videoRawData){
|
|
|
7083
7083
|
return newVideoRawData;
|
|
7084
7084
|
}
|
|
7085
7085
|
|
|
7086
|
-
//convertDataURIToBinary=function(dataURI) {
|
|
7087
|
-
base64StringToIntArray=function(dataURI){
|
|
7086
|
+
//window.convertDataURIToBinary=function(dataURI) {
|
|
7087
|
+
window.base64StringToIntArray=function(dataURI){
|
|
7088
7088
|
const BASE64_MARKER=';base64,';
|
|
7089
7089
|
|
|
7090
7090
|
const base64Index=dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
|
|
@@ -7104,7 +7104,7 @@ base64StringToIntArray=function(dataURI){
|
|
|
7104
7104
|
};
|
|
7105
7105
|
|
|
7106
7106
|
// DOES NOT SEEM TO WORK (for images src for instance)
|
|
7107
|
-
intArrayToBase64String=function(intArray, addAlphaCharacter=false){
|
|
7107
|
+
window.intArrayToBase64String=function(intArray, addAlphaCharacter=false){
|
|
7108
7108
|
let result="";
|
|
7109
7109
|
if(!intArray || !isArray(intArray)){
|
|
7110
7110
|
// TRACE
|
|
@@ -8171,7 +8171,7 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
8171
8171
|
|
|
8172
8172
|
|
|
8173
8173
|
//Deprecated : use getMediaHandler directly
|
|
8174
|
-
/*public*/getWebcamHandler=function(
|
|
8174
|
+
/*public*/window.getWebcamHandler=function(
|
|
8175
8175
|
// videoTagId
|
|
8176
8176
|
){
|
|
8177
8177
|
return getMediaHandlerIMPL({video:1,audio:1}
|
|
@@ -8180,7 +8180,7 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
8180
8180
|
};
|
|
8181
8181
|
|
|
8182
8182
|
// CAUTION : Returns nothing if we use a webcamIndex in the videoConfigParam config parameter object !
|
|
8183
|
-
/*public*/getMediaHandler=function(videoConfigParam=null,audioConfigParam=null,
|
|
8183
|
+
/*public*/window.getMediaHandler=function(videoConfigParam=null,audioConfigParam=null,
|
|
8184
8184
|
// sourcesIndexes,
|
|
8185
8185
|
/*OPTIONAL*/size=null,
|
|
8186
8186
|
/*OPTIONAL*/tagConfig={},
|
|
@@ -8389,7 +8389,7 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
8389
8389
|
|
|
8390
8390
|
// This temporary, off-screen video is always needed to get the image data for further use :
|
|
8391
8391
|
videoTag=document.createElement("video");
|
|
8392
|
-
videoTag.id="tmpVideoElement"+getUUID("short");
|
|
8392
|
+
videoTag.id="tmpVideoElement"+window.getUUID("short");
|
|
8393
8393
|
videoTag.autoplay=true;
|
|
8394
8394
|
videoTag.width=canvasTag.width;
|
|
8395
8395
|
videoTag.height=canvasTag.height;
|
|
@@ -8719,7 +8719,7 @@ function filterPoints(allPoints ,ctx/*DBG*/){
|
|
|
8719
8719
|
|
|
8720
8720
|
|
|
8721
8721
|
// CAUTION : uses a temporary canvas !
|
|
8722
|
-
drawVideoImage=function(canvas,videoImage,
|
|
8722
|
+
window.drawVideoImage=function(canvas,videoImage,
|
|
8723
8723
|
/*OPTIONAL*/xParam,/*OPTIONAL*/yParam,/*OPTIONAL*/zoomsParam,
|
|
8724
8724
|
/*OPTIONAL*/newWidthParam,/*OPTIONAL*/newHeightParam,
|
|
8725
8725
|
/*OPTIONAL*/isMessWithAlpha){
|
|
@@ -9103,7 +9103,7 @@ class SoundsLoop{
|
|
|
9103
9103
|
if(!this.hasLoopStarted || !this.pauseMillis){
|
|
9104
9104
|
this.startChainedLoop();
|
|
9105
9105
|
}else{
|
|
9106
|
-
this.mainLoopSound=getTimer(this.startChainedLoop,this.pauseMillis);
|
|
9106
|
+
this.mainLoopSound=window.getTimer(this.startChainedLoop,this.pauseMillis);
|
|
9107
9107
|
}
|
|
9108
9108
|
|
|
9109
9109
|
return this;
|
|
@@ -9279,7 +9279,7 @@ class Sound{
|
|
|
9279
9279
|
if(!this.hasLoopStarted || !this.pauseMillis){
|
|
9280
9280
|
this.startChainedLoop();
|
|
9281
9281
|
}else{
|
|
9282
|
-
this.mainLoopSound=getTimer(this.startChainedLoop, this.pauseMillis);
|
|
9282
|
+
this.mainLoopSound=window.getTimer(this.startChainedLoop, this.pauseMillis);
|
|
9283
9283
|
}
|
|
9284
9284
|
|
|
9285
9285
|
return this;
|
|
@@ -9347,7 +9347,7 @@ class Sound{
|
|
|
9347
9347
|
jumpOut(doOnEndJump=null){
|
|
9348
9348
|
|
|
9349
9349
|
const self=this;
|
|
9350
|
-
this.mainLoopSound=getTimer(()=>{
|
|
9350
|
+
this.mainLoopSound=window.getTimer(()=>{
|
|
9351
9351
|
self.pause();
|
|
9352
9352
|
if(doOnEndJump) doOnEndJump(self);
|
|
9353
9353
|
},this.nativeAudioElement.duration*1000);
|
|
@@ -9375,7 +9375,7 @@ class Sound{
|
|
|
9375
9375
|
|
|
9376
9376
|
},(this.nativeAudioElement.duration*1000-durationMillis));
|
|
9377
9377
|
|
|
9378
|
-
this.mainLoopSound=getTimer(()=>{
|
|
9378
|
+
this.mainLoopSound=window.getTimer(()=>{
|
|
9379
9379
|
clearInterval(self.fadeRoutine);
|
|
9380
9380
|
self.pause();
|
|
9381
9381
|
if(doOnEndFade) doOnEndFade(self);
|
|
@@ -9740,7 +9740,7 @@ function arrayFromString(strParam,compressResult=true,precisionFraction=null,isS
|
|
|
9740
9740
|
|
|
9741
9741
|
|
|
9742
9742
|
//OLD CODE :
|
|
9743
|
-
//function getWebcamHandler(videoTagId){
|
|
9743
|
+
//function window.getWebcamHandler(videoTagId){
|
|
9744
9744
|
//
|
|
9745
9745
|
//var b=hasGetUserMedia();
|
|
9746
9746
|
//if (!b){
|
|
@@ -11635,7 +11635,7 @@ class VNCFrame2D{
|
|
|
11635
11635
|
start(){
|
|
11636
11636
|
|
|
11637
11637
|
const self=this;
|
|
11638
|
-
this.fusrodaClient=createFusrodaClient(
|
|
11638
|
+
this.fusrodaClient=window.createFusrodaClient(
|
|
11639
11639
|
// doOnClientReady:
|
|
11640
11640
|
(messageConfig)=>{
|
|
11641
11641
|
|
|
@@ -11685,7 +11685,7 @@ class VNCFrame2D{
|
|
|
11685
11685
|
|
|
11686
11686
|
},
|
|
11687
11687
|
"sound":(soundDataStr)=>{
|
|
11688
|
-
const soundData=getDecodedArrayFromSoundDataString(soundDataStr);
|
|
11688
|
+
const soundData=window.getDecodedArrayFromSoundDataString(soundDataStr);
|
|
11689
11689
|
playAudioData(soundData,self.audioCtx,self.screenAndAudioConfig.audioBufferSize,1,self.screenAndAudioConfig.sampleRate,()=>{
|
|
11690
11690
|
self.fusrodaClient.client.socketToServerClientInstance.send("soundSampleRequest", {});
|
|
11691
11691
|
});
|
|
@@ -11781,7 +11781,7 @@ class VNCFrame2D{
|
|
|
11781
11781
|
|
|
11782
11782
|
|
|
11783
11783
|
|
|
11784
|
-
|
|
11784
|
+
window.getDecodedArrayFromSoundDataString=function(soundDataStr){
|
|
11785
11785
|
const decodedIntsArray=[];
|
|
11786
11786
|
|
|
11787
11787
|
const decodedString=atob(soundDataStr);
|
|
@@ -11828,10 +11828,10 @@ window.base64ToUint8ClampedArray=(base64String)=>{
|
|
|
11828
11828
|
|
|
11829
11829
|
// FUSRODA :
|
|
11830
11830
|
|
|
11831
|
-
createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null, portParam=4000){
|
|
11831
|
+
window.createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null, portParam=4000){
|
|
11832
11832
|
// CAUTION : WORKS BETTER WHEN UNSECURE, BUT 'NEEDS CLIENT BROWSER TO ALLOW MIXED (SECURE/UNSECURE) CONTENT !
|
|
11833
11833
|
|
|
11834
|
-
const fusrodaClient=initClient(false,
|
|
11834
|
+
const fusrodaClient=window.initClient(false,
|
|
11835
11835
|
// TODO : FIXME : REFACTOR THE FUSRODA SERVER TO USE THE WEBSOCKET IMPLEMENTATION !!!
|
|
11836
11836
|
// /*CAUTION : Fusroda Java server requires the Socket IO websocket implementation !!*/true
|
|
11837
11837
|
/*doOnServerConnection:*/(socketToServerClientInstance)=>{
|
|
@@ -12066,7 +12066,7 @@ window.createOritaMainClient=function(
|
|
|
12066
12066
|
|
|
12067
12067
|
|
|
12068
12068
|
|
|
12069
|
-
const oritaClient=initClient(false,
|
|
12069
|
+
const oritaClient=window.initClient(false,
|
|
12070
12070
|
// false,
|
|
12071
12071
|
/*doOnServerConnection*/(socketToServerClientInstance)=>{
|
|
12072
12072
|
|
|
@@ -12460,7 +12460,7 @@ const HALF_STEP_STEPPER_SEQUENCE = [
|
|
|
12460
12460
|
|
|
12461
12461
|
|
|
12462
12462
|
|
|
12463
|
-
createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdParam=null, videoDataHook=null){
|
|
12463
|
+
window.createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdParam=null, videoDataHook=null){
|
|
12464
12464
|
|
|
12465
12465
|
|
|
12466
12466
|
let audioBufferSize = ORITA_CONSTANTS.AUDIO_BUFFER_SIZE;
|
|
@@ -12541,8 +12541,8 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
12541
12541
|
|
|
12542
12542
|
|
|
12543
12543
|
|
|
12544
|
-
// TODO : FIXME : Utiliser initClient(...) au lieu de directement getStatic(...) avec le paramètre isNode transmis dans l'appel)
|
|
12545
|
-
//oritaClient=initClient(isNode,false,doOnServerConnection=null, url, port);
|
|
12544
|
+
// TODO : FIXME : Utiliser window.initClient(...) au lieu de directement getStatic(...) avec le paramètre isNode transmis dans l'appel)
|
|
12545
|
+
//oritaClient=window.initClient(isNode,false,doOnServerConnection=null, url, port);
|
|
12546
12546
|
oritaClient.client={};
|
|
12547
12547
|
oritaClient.client.socketToServerClientInstance=WebsocketImplementation.getStatic(isNode).connectToServer(url, port);
|
|
12548
12548
|
oritaClient.client.socketToServerClientInstance.onConnectionToServer(() => {
|
|
@@ -12553,7 +12553,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
12553
12553
|
|
|
12554
12554
|
// Only micro client determines its own id ! (to avoid multi-registration protocol bug !)
|
|
12555
12555
|
|
|
12556
|
-
const microClientId = nonull(oritaClient.staticMicroClientId, getUUID("short"));
|
|
12556
|
+
const microClientId = nonull(oritaClient.staticMicroClientId, window.getUUID("short"));
|
|
12557
12557
|
|
|
12558
12558
|
oritaClient.microClientId = microClientId;
|
|
12559
12559
|
|
|
@@ -12773,7 +12773,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
12773
12773
|
if (!isNode) {
|
|
12774
12774
|
|
|
12775
12775
|
// OLD : if(webcamIndex) videoConstraints={deviceId: { exact: cameras[webcamIndex].deviceId }};
|
|
12776
|
-
getMediaHandler(
|
|
12776
|
+
window.getMediaHandler(
|
|
12777
12777
|
medias === "video" ? { webcamIndex: webcamIndex } : null,
|
|
12778
12778
|
medias === "audio" ? { microphoneIndex: microphoneIndex } : null,
|
|
12779
12779
|
// CHANNELS_CONFIG,
|
|
@@ -12805,7 +12805,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
12805
12805
|
console.log("audioConfigLocal", audioConfigLocal);
|
|
12806
12806
|
|
|
12807
12807
|
|
|
12808
|
-
mediaHandlerLocal
|
|
12808
|
+
mediaHandlerLocal=window.getMediaHandler(
|
|
12809
12809
|
videoConfigLocal,
|
|
12810
12810
|
audioConfigLocal,
|
|
12811
12811
|
// CHANNELS_CONFIG,
|
|
@@ -13291,7 +13291,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
|
|
|
13291
13291
|
|
|
13292
13292
|
|
|
13293
13293
|
|
|
13294
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
13294
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2026-03:15:58)»*/
|
|
13295
13295
|
/*-----------------------------------------------------------------------------*/
|
|
13296
13296
|
|
|
13297
13297
|
|
|
@@ -13817,7 +13817,7 @@ Math.isPointInPolygon=function(point,polygon){
|
|
|
13817
13817
|
};
|
|
13818
13818
|
|
|
13819
13819
|
|
|
13820
|
-
getScaledPolygon=function(points, scaleFactorX, scaleFactorY){
|
|
13820
|
+
Math.getScaledPolygon=function(points, scaleFactorX, scaleFactorY){
|
|
13821
13821
|
const results=[];
|
|
13822
13822
|
foreach(points,(p)=>{
|
|
13823
13823
|
if(p.x!=null && p.y!=null){
|
|
@@ -13829,7 +13829,7 @@ getScaledPolygon=function(points, scaleFactorX, scaleFactorY){
|
|
|
13829
13829
|
return results;
|
|
13830
13830
|
};
|
|
13831
13831
|
|
|
13832
|
-
getTranslatedPolygon=function(points, deltaX, deltaY){
|
|
13832
|
+
Math.getTranslatedPolygon=function(points, deltaX, deltaY){
|
|
13833
13833
|
const results=[];
|
|
13834
13834
|
foreach(points,(p)=>{
|
|
13835
13835
|
if(p.x!=null && p.y!=null){
|
|
@@ -13841,7 +13841,7 @@ getTranslatedPolygon=function(points, deltaX, deltaY){
|
|
|
13841
13841
|
return results;
|
|
13842
13842
|
};
|
|
13843
13843
|
|
|
13844
|
-
getRotatedPolygon=function(points, angleRadians, rotationCenter={x:0,y:0}){
|
|
13844
|
+
Math.getRotatedPolygon=function(points, angleRadians, rotationCenter={x:0,y:0}){
|
|
13845
13845
|
const results=[];
|
|
13846
13846
|
foreach(points,(p)=>{
|
|
13847
13847
|
if(p.x!=null && p.y!=null){
|
|
@@ -14376,10 +14376,10 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14376
14376
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14377
14377
|
|
|
14378
14378
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14379
|
-
/*utils 3D library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14379
|
+
/*utils 3D library associated with aotra version : «1_29072022-2359 (26/07/2026-03:15:58)»*/
|
|
14380
14380
|
/*-----------------------------------------------------------------------------*/
|
|
14381
14381
|
|
|
14382
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14382
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-03:15:58)»*/
|
|
14383
14383
|
/*-----------------------------------------------------------------------------*/
|
|
14384
14384
|
|
|
14385
14385
|
|
|
@@ -14482,7 +14482,7 @@ window.LLMAPIClient=class LLMAPIClient{
|
|
|
14482
14482
|
const parameters=getAPIRequestParameters(messages);
|
|
14483
14483
|
|
|
14484
14484
|
return new Promise((resolve,reject)=>{
|
|
14485
|
-
performHTTPRequest(this.apiURL, "POST", headers, parameters, true).then((responseObj)=>{
|
|
14485
|
+
window.performHTTPRequest(this.apiURL, "POST", headers, parameters, true).then((responseObj)=>{
|
|
14486
14486
|
const responseData=responseObj.responseData;
|
|
14487
14487
|
const data=responseData;
|
|
14488
14488
|
|
|
@@ -14639,7 +14639,7 @@ getLLMAPIClient=(modelName, apiURL, agentRole, defaultPrompt, llmProviderName=DE
|
|
|
14639
14639
|
|
|
14640
14640
|
|
|
14641
14641
|
|
|
14642
|
-
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-
|
|
14642
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-03:15:58)»*/
|
|
14643
14643
|
/*-----------------------------------------------------------------------------*/
|
|
14644
14644
|
|
|
14645
14645
|
|
|
@@ -14684,7 +14684,7 @@ class AORTACClientCell{
|
|
|
14684
14684
|
|
|
14685
14685
|
constructor(serverCellOrigin, model, view, isNodeContext=true){
|
|
14686
14686
|
|
|
14687
|
-
this.clientId=getUUID();
|
|
14687
|
+
this.clientId=window.getUUID();
|
|
14688
14688
|
|
|
14689
14689
|
this.model=model;
|
|
14690
14690
|
this.view=view;
|
|
@@ -14725,7 +14725,7 @@ class AORTACClientCell{
|
|
|
14725
14725
|
|
|
14726
14726
|
|
|
14727
14727
|
// 1) Initial connection
|
|
14728
|
-
self.initialClientInstance=initClient(self.isNodeContext
|
|
14728
|
+
self.initialClientInstance=window.initClient(self.isNodeContext
|
|
14729
14729
|
// ,false
|
|
14730
14730
|
,(socketToServerClientInstance, initialClientInstanceLocal)=>{
|
|
14731
14731
|
|
|
@@ -14821,7 +14821,7 @@ class AORTACClientCell{
|
|
|
14821
14821
|
const host=nonull(infos.host,"localhost");
|
|
14822
14822
|
const port=nonull(infos.port,"30000");
|
|
14823
14823
|
|
|
14824
|
-
const reconnectedClientInstance=initClient(self.isNodeContext
|
|
14824
|
+
const reconnectedClientInstance=window.initClient(self.isNodeContext
|
|
14825
14825
|
// ,false
|
|
14826
14826
|
,(socketToServerClientInstance, reconnectedClientInstanceLocal)=>{
|
|
14827
14827
|
|
|
@@ -15132,7 +15132,7 @@ class AORTACServerCell{
|
|
|
15132
15132
|
/*private*/launchServerForIncomingConnections(){
|
|
15133
15133
|
const self=this;
|
|
15134
15134
|
|
|
15135
|
-
const serverWrapper=initNodeServerInfrastructureWrapper(
|
|
15135
|
+
const serverWrapper=window.initNodeServerInfrastructureWrapper(
|
|
15136
15136
|
// On each client connection :
|
|
15137
15137
|
null,
|
|
15138
15138
|
// On client finalization :
|
|
@@ -15220,7 +15220,7 @@ class AORTACServerCell{
|
|
|
15220
15220
|
const outcomingCellHost=nonull(infos.host,"localhost");
|
|
15221
15221
|
const outcomingCellPort=nonull(infos.port,"40000");
|
|
15222
15222
|
|
|
15223
|
-
const clientInstance=initClient(true
|
|
15223
|
+
const clientInstance=window.initClient(true
|
|
15224
15224
|
// ,false
|
|
15225
15225
|
,(socketToServerClientInstance)=>{
|
|
15226
15226
|
|
|
@@ -15938,7 +15938,7 @@ class AORTACServerCell{
|
|
|
15938
15938
|
// if(isClassObject(attr)){
|
|
15939
15939
|
// let aortacId=attr.aortacId;
|
|
15940
15940
|
// if(!aortacId){
|
|
15941
|
-
// aortacId=getUUID();
|
|
15941
|
+
// aortacId=window.getUUID();
|
|
15942
15942
|
// attr.aortacId=aortacId;
|
|
15943
15943
|
// }
|
|
15944
15944
|
// if(!contains(linkedObjects,attr)){
|
|
@@ -16047,7 +16047,7 @@ class ServerCellLobule{
|
|
|
16047
16047
|
|
|
16048
16048
|
|
|
16049
16049
|
window.getAORTACServerCell=function(quorumNumber=1, selfOrigin="ws://127.0.0.1:40000", outcomingCellsOrigins=[], model, controller){
|
|
16050
|
-
//return new AORTACServerNode("node_"+getUUID("short"), selfOrigin, outcomingCellsOrigins, model, controller);
|
|
16050
|
+
//return new AORTACServerNode("node_"+window.getUUID("short"), selfOrigin, outcomingCellsOrigins, model, controller);
|
|
16051
16051
|
if(window.aortacCServerCellInstance){
|
|
16052
16052
|
// TRACE
|
|
16053
16053
|
throw new Error("ERROR : The aortacCServerCellInstance singleton instance already exists. It cannot be instantiated again in the same process. Aborting.");
|
|
@@ -16374,7 +16374,7 @@ window.i18n=(languagesAndStrings, langParam=null)=>{
|
|
|
16374
16374
|
// let declarable={};
|
|
16375
16375
|
let maxLength=Math.min(result.length, MAX_CHARACTERS_FOR_TRANSLATION_KEY);
|
|
16376
16376
|
let key=toConvention("camel", result.substring(0,maxLength).toLowerCase() );
|
|
16377
|
-
// let calculatedKey=radicalKey+"_"+getUUID("short");
|
|
16377
|
+
// let calculatedKey=radicalKey+"_"+window.getUUID("short");
|
|
16378
16378
|
// declarable[calculatedKey]=languagesAndStrings;
|
|
16379
16379
|
i18n.declareSingleEntry(key, languagesAndStrings);
|
|
16380
16380
|
}
|
|
@@ -16774,7 +16774,7 @@ window.getURLOrConsoleParameter=(parameterName)=>{
|
|
|
16774
16774
|
|
|
16775
16775
|
// Server-side :
|
|
16776
16776
|
|
|
16777
|
-
getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam=null, ignoreConsoleArgs=false, argsOffset=0){
|
|
16777
|
+
window.getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam=null, ignoreConsoleArgs=false, argsOffset=0){
|
|
16778
16778
|
|
|
16779
16779
|
if(typeof(window.https)==="undefined"){
|
|
16780
16780
|
// TRACE
|
|
@@ -16818,7 +16818,7 @@ getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam
|
|
|
16818
16818
|
return result;
|
|
16819
16819
|
}
|
|
16820
16820
|
|
|
16821
|
-
getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» and arg 1 is the js file*/){
|
|
16821
|
+
window.getConsoleParam=function(indexOrName=0, argsOffset=2/*arg 0 is «node» and arg 1 is the js file*/){
|
|
16822
16822
|
if(!process){
|
|
16823
16823
|
throw new Error("ERROR : Cannot extract console parameter in this context !");
|
|
16824
16824
|
}
|
|
@@ -17079,7 +17079,7 @@ WebsocketImplementation={
|
|
|
17079
17079
|
return nodeServerInstance;
|
|
17080
17080
|
},
|
|
17081
17081
|
|
|
17082
|
-
// DO NOT USE DIRECTLY, USE INSTEAD initClient(...) (this function uses connectToServer(...)) !
|
|
17082
|
+
// DO NOT USE DIRECTLY, USE INSTEAD window.initClient(...) (this function uses connectToServer(...)) !
|
|
17083
17083
|
// NODE / BROWSER CLIENT CONNECTS TO SERVER MAIN ENTRYPOINT:
|
|
17084
17084
|
connectToServer:(serverURL, port, isSecure=false, timeout)=>{
|
|
17085
17085
|
|
|
@@ -17206,7 +17206,7 @@ WebsocketImplementation={
|
|
|
17206
17206
|
|
|
17207
17207
|
|
|
17208
17208
|
|
|
17209
|
-
launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
|
|
17209
|
+
window.launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, doOnConnectionLost=null, /*OPTIONAL*/sslOptions=null, httpHandlerParam=null, addCORSHeader=ADD_CORS_HEADER){
|
|
17210
17210
|
|
|
17211
17211
|
const EXCLUDED_FILENAMES_PARTS=[".keyHash.",".pem"];
|
|
17212
17212
|
|
|
@@ -17344,7 +17344,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, d
|
|
|
17344
17344
|
}
|
|
17345
17345
|
|
|
17346
17346
|
|
|
17347
|
-
initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFinalizeServer=null, doOnConnectionLost=null,
|
|
17347
|
+
window.window.initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFinalizeServer=null, doOnConnectionLost=null,
|
|
17348
17348
|
/*OPTIONAL*/portParam,
|
|
17349
17349
|
/*OPTIONAL*/certPathParam,
|
|
17350
17350
|
/*OPTIONAL*/keyPathParam){
|
|
@@ -17415,7 +17415,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
|
|
|
17415
17415
|
if(!globalKeyHashObject || !globalKeyHashObject.keyHash){
|
|
17416
17416
|
// TRACE
|
|
17417
17417
|
console.log("WARN : No key hash found. Generating one now.");
|
|
17418
|
-
globalKeyHashObject={keyHash:getUUID(), hashes:[]};
|
|
17418
|
+
globalKeyHashObject={keyHash:window.getUUID(), hashes:[]};
|
|
17419
17419
|
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,globalKeyHashObject,false,()=>{
|
|
17420
17420
|
// TRACE
|
|
17421
17421
|
console.log("INFO : Key hash generated and saved successfully.");
|
|
@@ -17484,7 +17484,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
|
|
|
17484
17484
|
}
|
|
17485
17485
|
}
|
|
17486
17486
|
|
|
17487
|
-
aotraNodeServer.server=launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
|
|
17487
|
+
aotraNodeServer.server=window.launchNodeHTTPServer(port, doOnClientConnection, doOnFinalizeServer, doOnConnectionLost, sslOptions);
|
|
17488
17488
|
|
|
17489
17489
|
|
|
17490
17490
|
return aotraNodeServer;
|
|
@@ -17517,7 +17517,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
|
|
|
17517
17517
|
// const REFRESH_SCREENSHOTS_MILLIS=500;
|
|
17518
17518
|
//
|
|
17519
17519
|
//
|
|
17520
|
-
// const server=initNodeServerInfrastructureWrapper(
|
|
17520
|
+
// const server=window.initNodeServerInfrastructureWrapper(
|
|
17521
17521
|
// // On each client connection :
|
|
17522
17522
|
// // (serverParam, clientSocketParam)=>{},
|
|
17523
17523
|
// null,
|
|
@@ -17562,7 +17562,7 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
|
|
|
17562
17562
|
// // };
|
|
17563
17563
|
// // const server={};
|
|
17564
17564
|
// // server.start=(port=4000)=>{
|
|
17565
|
-
// // server.httpServer=launchNodeHTTPServer(port, doOnConnect, doOnFinalizeServer, sslOptions);
|
|
17565
|
+
// // server.httpServer=window.launchNodeHTTPServer(port, doOnConnect, doOnFinalizeServer, sslOptions);
|
|
17566
17566
|
// // };
|
|
17567
17567
|
//
|
|
17568
17568
|
// return server;
|
|
@@ -17741,7 +17741,7 @@ getListManager=function(config){
|
|
|
17741
17741
|
// NO : IN A NODE CONTEXT WITH require("...") WILL RESULT IN AN UNDEFINED FUNCTION ERROR !!!
|
|
17742
17742
|
// function performHTTPRequest(...){...
|
|
17743
17743
|
// USE THIS INSTEAD :
|
|
17744
|
-
performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, requestBodyOrNamedArgs=null, isNodeContext=false, addCORSHeader=ADD_CORS_HEADER){
|
|
17744
|
+
window.performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, requestBodyOrNamedArgs=null, isNodeContext=false, addCORSHeader=ADD_CORS_HEADER){
|
|
17745
17745
|
|
|
17746
17746
|
// Body
|
|
17747
17747
|
let requestBodyOrNamedArgsStr=null;
|
|
@@ -18045,7 +18045,7 @@ if(typeof(window)==="undefined") window=global;
|
|
|
18045
18045
|
// -Client :
|
|
18046
18046
|
|
|
18047
18047
|
// TODO : Use everywhere it's applicable !
|
|
18048
|
-
initClient=function(isNodeContext=true
|
|
18048
|
+
window.initClient=function(isNodeContext=true
|
|
18049
18049
|
// ,useSocketIOImplementation=/*DEBUG*/false
|
|
18050
18050
|
,doOnServerConnection=null, url, /*OPTIONAL*/port=25000, /*OPTIONAL*/timeout=10000, /*OPTIONAL*/selfParam=null){
|
|
18051
18051
|
|
|
@@ -18230,7 +18230,7 @@ class ClientInstance{
|
|
|
18230
18230
|
lognow(">>>>>>sendChainable CLIENT ("+channelNameParam+"):data:",data);
|
|
18231
18231
|
|
|
18232
18232
|
// We add a message id :
|
|
18233
|
-
const messageId=getUUID();
|
|
18233
|
+
const messageId=window.getUUID();
|
|
18234
18234
|
data.messageId=messageId;
|
|
18235
18235
|
|
|
18236
18236
|
// 1) We prepare the reception :
|
|
@@ -18648,7 +18648,7 @@ class NodeServerInstance{
|
|
|
18648
18648
|
// DBG
|
|
18649
18649
|
console.log("SERVER : ON CONNECTION !");
|
|
18650
18650
|
|
|
18651
|
-
const clientId="autogeneratedid_"+getUUID();
|
|
18651
|
+
const clientId="autogeneratedid_"+window.getUUID();
|
|
18652
18652
|
|
|
18653
18653
|
clientSocket.clientId=clientId;
|
|
18654
18654
|
|
aotrautils/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1907",
|
|
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.1907",
|
|
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.1907",
|
|
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)",
|