aotrautils 0.0.1900 → 0.0.1901
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/.gitignore +1 -0
- aotrautils/aotrautils.build.js +40 -46
- aotrautils/package-lock.json +2 -2
- aotrautils/package.json +1 -1
aotrautils/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/node_modules/
|
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 (26/07/2026-02:12:38)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -2873,7 +2873,7 @@ window.hex2dec=function(h){
|
|
|
2873
2873
|
|
|
2874
2874
|
|
|
2875
2875
|
window.hashSafe=function(str){
|
|
2876
|
-
if(typeof(crypto)==="undefined" || typeof(crypto.createHash)==="undefined"){
|
|
2876
|
+
if(typeof(window.crypto)==="undefined" || typeof(window.crypto.createHash)==="undefined"){
|
|
2877
2877
|
|
|
2878
2878
|
// // TRACE
|
|
2879
2879
|
// console.log("ERROR : NodeJS installation does not include «crypto» node module dependency. Trying to use client-side hashing infrastructure.");
|
|
@@ -2898,7 +2898,7 @@ window.hashSafe=function(str){
|
|
|
2898
2898
|
}
|
|
2899
2899
|
return getHashedString(str);
|
|
2900
2900
|
}
|
|
2901
|
-
return crypto.createHash("md5").update(str).digest("hex");
|
|
2901
|
+
return window.crypto.createHash("md5").update(str).digest("hex");
|
|
2902
2902
|
}
|
|
2903
2903
|
|
|
2904
2904
|
|
|
@@ -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 (
|
|
5473
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (26/07/2026-02:12:38)»*/
|
|
5474
5474
|
/*-----------------------------------------------------------------------------*/
|
|
5475
5475
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
5476
5476
|
*
|
|
@@ -12296,7 +12296,7 @@ window.gpioUtils = {
|
|
|
12296
12296
|
|
|
12297
12297
|
const gpioFilePath = GPIO_BASE_PATH + "/gpio" + gpioNumber;
|
|
12298
12298
|
const setDirection = () => {
|
|
12299
|
-
fs.writeFile(gpioFilePath + "/direction", mode + "", (error) => {
|
|
12299
|
+
window.fs.writeFile(gpioFilePath + "/direction", mode + "", (error) => {
|
|
12300
12300
|
if (error) {
|
|
12301
12301
|
// TRACE
|
|
12302
12302
|
lognow("ERROR : Could not set mode «" + mode + "» on pin «" + gpioNumber + "». Abording setup.", error);
|
|
@@ -12306,11 +12306,11 @@ window.gpioUtils = {
|
|
|
12306
12306
|
});
|
|
12307
12307
|
};
|
|
12308
12308
|
|
|
12309
|
-
fs.access(gpioFilePath, fs.constants.F_OK, (error) => {
|
|
12309
|
+
window.fs.access(gpioFilePath, window.fs.constants.F_OK, (error) => {
|
|
12310
12310
|
if (error) {
|
|
12311
12311
|
// Case export file does not exists
|
|
12312
12312
|
// In this case we export the gpio pin :
|
|
12313
|
-
fs.writeFile(GPIO_BASE_PATH + "/export", gpioNumber + "", (error) => {
|
|
12313
|
+
window.fs.writeFile(GPIO_BASE_PATH + "/export", gpioNumber + "", (error) => {
|
|
12314
12314
|
if (error) {
|
|
12315
12315
|
// TRACE
|
|
12316
12316
|
lognow("ERROR : Could not export pin «" + gpioNumber + "». Abording setup.", error);
|
|
@@ -12333,7 +12333,7 @@ window.gpioUtils = {
|
|
|
12333
12333
|
}
|
|
12334
12334
|
|
|
12335
12335
|
const gpioFilePath = GPIO_BASE_PATH + "/gpio" + gpioNumber;
|
|
12336
|
-
fs.access(gpioFilePath, fs.constants.F_OK, (error) => {
|
|
12336
|
+
window.fs.access(gpioFilePath, window.fs.constants.F_OK, (error) => {
|
|
12337
12337
|
if (error) {
|
|
12338
12338
|
// Case export file does not exists
|
|
12339
12339
|
// TRACE
|
|
@@ -12342,7 +12342,7 @@ window.gpioUtils = {
|
|
|
12342
12342
|
}
|
|
12343
12343
|
// Case export file already exists
|
|
12344
12344
|
// In this case we export the gpio pin :
|
|
12345
|
-
fs.writeFile(GPIO_BASE_PATH + "/unexport", gpioNumber + "", (error) => {
|
|
12345
|
+
window.fs.writeFile(GPIO_BASE_PATH + "/unexport", gpioNumber + "", (error) => {
|
|
12346
12346
|
if (error) {
|
|
12347
12347
|
// TRACE
|
|
12348
12348
|
lognow("ERROR : Could not unexport pin «" + gpioNumber + "».", error);
|
|
@@ -12363,7 +12363,7 @@ window.gpioUtils = {
|
|
|
12363
12363
|
|
|
12364
12364
|
|
|
12365
12365
|
const gpioFilePath = GPIO_BASE_PATH + "/gpio" + gpioNumber;
|
|
12366
|
-
fs.access(gpioFilePath, fs.constants.F_OK, (error) => {
|
|
12366
|
+
window.fs.access(gpioFilePath, window.fs.constants.F_OK, (error) => {
|
|
12367
12367
|
if (error) {
|
|
12368
12368
|
// Case export file does not exists
|
|
12369
12369
|
// TRACE
|
|
@@ -12376,7 +12376,7 @@ window.gpioUtils = {
|
|
|
12376
12376
|
|
|
12377
12377
|
// Case export file already exists
|
|
12378
12378
|
// In this case we export the gpio pin :
|
|
12379
|
-
fs.writeFile(gpioFilePath + "/value", stateNumber + "", (error) => {
|
|
12379
|
+
window.fs.writeFile(gpioFilePath + "/value", stateNumber + "", (error) => {
|
|
12380
12380
|
if (error) {
|
|
12381
12381
|
// TRACE
|
|
12382
12382
|
lognow("ERROR : Could not write «" + stateNumber + "» on pin «" + gpioNumber + "».", error);
|
|
@@ -12396,7 +12396,7 @@ window.gpioUtils = {
|
|
|
12396
12396
|
}
|
|
12397
12397
|
|
|
12398
12398
|
const gpioFilePath = GPIO_BASE_PATH + "/gpio" + gpioNumber;
|
|
12399
|
-
fs.access(gpioFilePath, fs.constants.F_OK, (error) => {
|
|
12399
|
+
window.fs.access(gpioFilePath, window.fs.constants.F_OK, (error) => {
|
|
12400
12400
|
if (error) {
|
|
12401
12401
|
// Case export file does not exists
|
|
12402
12402
|
// TRACE
|
|
@@ -12406,7 +12406,7 @@ window.gpioUtils = {
|
|
|
12406
12406
|
|
|
12407
12407
|
// Case export file already exists
|
|
12408
12408
|
// In this case we export the gpio pin :
|
|
12409
|
-
fs.readFile(gpioFilePath + "/value", "utf-8", (error, data) => {
|
|
12409
|
+
window.fs.readFile(gpioFilePath + "/value", "utf-8", (error, data) => {
|
|
12410
12410
|
|
|
12411
12411
|
// // DBG
|
|
12412
12412
|
// lognow("DEBUG : read value:"+data);
|
|
@@ -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 (
|
|
13294
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (26/07/2026-02:12:38)»*/
|
|
13295
13295
|
/*-----------------------------------------------------------------------------*/
|
|
13296
13296
|
|
|
13297
13297
|
|
|
@@ -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 (
|
|
14379
|
+
/*utils 3D library associated with aotra version : «1_29072022-2359 (26/07/2026-02:12:38)»*/
|
|
14380
14380
|
/*-----------------------------------------------------------------------------*/
|
|
14381
14381
|
|
|
14382
|
-
/*utils AI library associated with aotra version : «1_29072022-2359 (
|
|
14382
|
+
/*utils AI library associated with aotra version : «1_29072022-2359 (26/07/2026-02:12:38)»*/
|
|
14383
14383
|
/*-----------------------------------------------------------------------------*/
|
|
14384
14384
|
|
|
14385
14385
|
|
|
@@ -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 (
|
|
14642
|
+
/*utils CONSOLE library associated with aotra version : «1_29072022-2359 (26/07/2026-02:12:38)»*/
|
|
14643
14643
|
/*-----------------------------------------------------------------------------*/
|
|
14644
14644
|
|
|
14645
14645
|
|
|
@@ -16614,7 +16614,8 @@ function capitalize(str){
|
|
|
16614
16614
|
// COMPATIBILITY browser javascript / nodejs environment :
|
|
16615
16615
|
if(typeof(window)==="undefined") window=global;
|
|
16616
16616
|
|
|
16617
|
-
|
|
16617
|
+
// Cryptography hashing utils :
|
|
16618
|
+
window.crypto=require("node:crypto");
|
|
16618
16619
|
|
|
16619
16620
|
// OLD : socket.io :
|
|
16620
16621
|
// https://stackoverflow.com/questions/31156884/how-to-use-https-on-node-js-using-express-socket-io
|
|
@@ -16643,16 +16644,13 @@ const ADD_CORS_HEADER=true;
|
|
|
16643
16644
|
console.log("DEBUG : Importing «fs» dependency.");
|
|
16644
16645
|
|
|
16645
16646
|
|
|
16646
|
-
if(typeof(require)!=="undefined" && typeof(fs)==="undefined" ){
|
|
16647
|
+
if(typeof(require)!=="undefined" && typeof(window.fs)==="undefined" ){
|
|
16647
16648
|
window.fs=require("fs");
|
|
16648
16649
|
}
|
|
16649
16650
|
|
|
16650
|
-
// For debug (WORKAROUND):
|
|
16651
|
-
fs=window.fs;
|
|
16652
|
-
|
|
16653
16651
|
|
|
16654
16652
|
// Nodejs filesystem utils :
|
|
16655
|
-
if(typeof(fs)==="undefined"){
|
|
16653
|
+
if(typeof(window.fs)==="undefined"){
|
|
16656
16654
|
// TRACE
|
|
16657
16655
|
console.log("WARN : Could not find the nodejs dependency «fs», aborting persister setup.");
|
|
16658
16656
|
window.getPersister=()=>{ return null; };
|
|
@@ -16683,7 +16681,7 @@ if(typeof(fs)==="undefined"){
|
|
|
16683
16681
|
|
|
16684
16682
|
try{
|
|
16685
16683
|
|
|
16686
|
-
resultFlat=fs.readFileSync(path, FILE_ENCODING);
|
|
16684
|
+
resultFlat=window.fs.readFileSync(path, FILE_ENCODING);
|
|
16687
16685
|
|
|
16688
16686
|
}catch(error){
|
|
16689
16687
|
// TRACE
|
|
@@ -16725,7 +16723,7 @@ if(typeof(fs)==="undefined"){
|
|
|
16725
16723
|
|
|
16726
16724
|
|
|
16727
16725
|
let path=self.getPath(clientId,repositoryName);
|
|
16728
|
-
fs.writeFile(path, dataFlatStr, FILE_ENCODING, (error) => {
|
|
16726
|
+
window.fs.writeFile(path, dataFlatStr, FILE_ENCODING, (error) => {
|
|
16729
16727
|
if(error){
|
|
16730
16728
|
// TRACE
|
|
16731
16729
|
console.log("ERROR : Could not write file «"+path+"»:",error);
|
|
@@ -16745,12 +16743,12 @@ if(typeof(fs)==="undefined"){
|
|
|
16745
16743
|
|
|
16746
16744
|
|
|
16747
16745
|
window.fileExists=(filePath)=>{
|
|
16748
|
-
if(typeof(fs)=="undefined"){
|
|
16746
|
+
if(typeof(window.fs)=="undefined"){
|
|
16749
16747
|
// TRACE
|
|
16750
16748
|
lognow("ERROR : «fs» node dependency is not available ! Cannot test if file exists.");
|
|
16751
16749
|
return null;
|
|
16752
16750
|
}
|
|
16753
|
-
return fs.existsSync(filePath);
|
|
16751
|
+
return window.fs.existsSync(filePath);
|
|
16754
16752
|
};
|
|
16755
16753
|
|
|
16756
16754
|
|
|
@@ -16778,16 +16776,12 @@ window.getURLOrConsoleParameter=(parameterName)=>{
|
|
|
16778
16776
|
|
|
16779
16777
|
getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam=null, ignoreConsoleArgs=false, argsOffset=0){
|
|
16780
16778
|
|
|
16781
|
-
|
|
16782
|
-
// https=require("https");
|
|
16783
|
-
// fs=require("fs");
|
|
16784
|
-
|
|
16785
|
-
if(typeof(https)==="undefined"){
|
|
16779
|
+
if(typeof(window.https)==="undefined"){
|
|
16786
16780
|
// TRACE
|
|
16787
16781
|
console.log("WARN : Could not find the nodejs dependency «https», aborting SSL setup.");
|
|
16788
16782
|
return null;
|
|
16789
16783
|
}
|
|
16790
|
-
if(typeof(fs)==="undefined"){
|
|
16784
|
+
if(typeof(window.fs)==="undefined"){
|
|
16791
16785
|
// TRACE
|
|
16792
16786
|
console.log("WARN : Could not find the nodejs dependency «fs», aborting SSL setup.");
|
|
16793
16787
|
return null;
|
|
@@ -16816,8 +16810,8 @@ getConsoleServerParams=function(portParam=null, certPathParam=null, keyPathParam
|
|
|
16816
16810
|
result.sslOptions=null;
|
|
16817
16811
|
if(result.isSecure){
|
|
16818
16812
|
result.sslOptions={
|
|
16819
|
-
cert:
|
|
16820
|
-
key:
|
|
16813
|
+
cert:window.fs.readFileSync(result.certPath),
|
|
16814
|
+
key:window.fs.readFileSync(result.keyPath),
|
|
16821
16815
|
};
|
|
16822
16816
|
}
|
|
16823
16817
|
|
|
@@ -17217,15 +17211,15 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, d
|
|
|
17217
17211
|
const EXCLUDED_FILENAMES_PARTS=[".keyHash.",".pem"];
|
|
17218
17212
|
|
|
17219
17213
|
|
|
17220
|
-
if(typeof(https)==="undefined"){
|
|
17214
|
+
if(typeof(window.https)==="undefined"){
|
|
17221
17215
|
// TRACE
|
|
17222
17216
|
console.log("«https» SERVER library not called yet, calling it now.");
|
|
17223
|
-
https=require("https");
|
|
17217
|
+
window.https=require("https");
|
|
17224
17218
|
}
|
|
17225
|
-
if(typeof(http)==="undefined"){
|
|
17219
|
+
if(typeof(window.http)==="undefined"){
|
|
17226
17220
|
// TRACE
|
|
17227
17221
|
console.log("«http» SERVER library not called yet, calling it now.");
|
|
17228
|
-
http=require("http");
|
|
17222
|
+
window.http=require("http");
|
|
17229
17223
|
}
|
|
17230
17224
|
|
|
17231
17225
|
|
|
@@ -17266,13 +17260,13 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, d
|
|
|
17266
17260
|
if(addCORSHeader) headers["Access-Control-Allow-Origin"]="*";
|
|
17267
17261
|
|
|
17268
17262
|
|
|
17269
|
-
fs.readFile(filePath, function(error, fileContent){
|
|
17263
|
+
window.fs.readFile(filePath, function(error, fileContent){
|
|
17270
17264
|
if(error){
|
|
17271
17265
|
if(error.code=="ENOENT"){
|
|
17272
17266
|
// TRACE
|
|
17273
17267
|
console.log("ERROR 404 file not found :"+filePath);
|
|
17274
17268
|
|
|
17275
|
-
fs.readFile("./404.html", function(error, fileContent){
|
|
17269
|
+
window.fs.readFile("./404.html", function(error, fileContent){
|
|
17276
17270
|
response.writeHead(200, headers);
|
|
17277
17271
|
response.end(fileContent, "utf-8");
|
|
17278
17272
|
});
|
|
@@ -17311,12 +17305,12 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, d
|
|
|
17311
17305
|
|
|
17312
17306
|
let listenableServer;
|
|
17313
17307
|
if(sslOptions){
|
|
17314
|
-
let httpsServer=https.createServer(sslOptions, handler).listen(port);
|
|
17308
|
+
let httpsServer=window.https.createServer(sslOptions, handler).listen(port);
|
|
17315
17309
|
// TRACE
|
|
17316
17310
|
console.log("INFO : SERVER : HTTPS Server launched and listening on port " + port + "!");
|
|
17317
17311
|
listenableServer=httpsServer;
|
|
17318
17312
|
}else{
|
|
17319
|
-
let httpServer=http.createServer(handler).listen(port);
|
|
17313
|
+
let httpServer=window.http.createServer(handler).listen(port);
|
|
17320
17314
|
// TRACE
|
|
17321
17315
|
console.log("INFO : SERVER : HTTP Server launched and listening on port " + port + "!");
|
|
17322
17316
|
listenableServer=httpServer;
|
|
@@ -17474,14 +17468,14 @@ initNodeServerInfrastructureWrapper=function(doOnClientConnection=null, doOnFina
|
|
|
17474
17468
|
// Eventual encryption options :
|
|
17475
17469
|
let sslOptions=null;
|
|
17476
17470
|
if(!isForceUnsecure){
|
|
17477
|
-
if(typeof(fs)==="undefined"){
|
|
17471
|
+
if(typeof(window.fs)==="undefined"){
|
|
17478
17472
|
// TRACE
|
|
17479
17473
|
lognow("ERROR : «fs» node subsystem not present, cannot access files. Aborting SSL configuration of server.");
|
|
17480
17474
|
}else{
|
|
17481
17475
|
try{
|
|
17482
17476
|
sslOptions={
|
|
17483
|
-
cert:
|
|
17484
|
-
key:
|
|
17477
|
+
cert:window.fs.readFileSync(certPath, {encoding: "utf8"}),
|
|
17478
|
+
key:window.fs.readFileSync(keyPath, {encoding: "utf8"}),
|
|
17485
17479
|
};
|
|
17486
17480
|
}catch(exception){
|
|
17487
17481
|
// TRACE
|
aotrautils/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1901",
|
|
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.1901",
|
|
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.1901",
|
|
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)",
|