aotrautils 0.0.267 → 0.0.269
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 +66 -59
- 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 (23/11/2022-18:38:46)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4827,7 +4827,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4827
4827
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
|
-
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (
|
|
4830
|
+
/*utils CLIENT library associated with aotra version : «1_29072022-2359 (23/11/2022-18:38:46)»*/
|
|
4831
4831
|
/*-----------------------------------------------------------------------------*/
|
|
4832
4832
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4833
4833
|
*
|
|
@@ -12948,7 +12948,7 @@ createOritaMicroClient=function(url, port, isNode=false){
|
|
|
12948
12948
|
};
|
|
12949
12949
|
|
|
12950
12950
|
|
|
12951
|
-
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (
|
|
12951
|
+
/*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (23/11/2022-18:38:46)»*/
|
|
12952
12952
|
/*-----------------------------------------------------------------------------*/
|
|
12953
12953
|
|
|
12954
12954
|
|
|
@@ -14176,7 +14176,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
14176
14176
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
14177
14177
|
|
|
14178
14178
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
14179
|
-
/*utils SERVER library associated with aotra version : «1_29072022-2359 (
|
|
14179
|
+
/*utils SERVER library associated with aotra version : «1_29072022-2359 (23/11/2022-18:38:46)»*/
|
|
14180
14180
|
/*-----------------------------------------------------------------------------*/
|
|
14181
14181
|
|
|
14182
14182
|
|
|
@@ -14335,60 +14335,62 @@ if(typeof(fs)==="undefined"){
|
|
|
14335
14335
|
|
|
14336
14336
|
// -Server :
|
|
14337
14337
|
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
//
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
//
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
|
|
14350
|
-
//
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
//
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
//
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
//
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14338
|
+
getServerParams=function(portParam=null,certPathParam=null,keyPathParam=null){
|
|
14339
|
+
|
|
14340
|
+
// Node dependencies :
|
|
14341
|
+
// https=require("https");
|
|
14342
|
+
// fs=require("fs");
|
|
14343
|
+
|
|
14344
|
+
if(!https){
|
|
14345
|
+
// TRACE
|
|
14346
|
+
console.log("WARN : Could not find the nodejs dependency «https», aborting SSL setup.");
|
|
14347
|
+
return null;
|
|
14348
|
+
}
|
|
14349
|
+
if(!fs){
|
|
14350
|
+
// TRACE
|
|
14351
|
+
console.log("WARN : Could not find the nodejs dependency «fs», aborting SSL setup.");
|
|
14352
|
+
return null;
|
|
14353
|
+
}
|
|
14354
|
+
|
|
14355
|
+
const result={};
|
|
14356
|
+
|
|
14357
|
+
// We read the command-line arguments if needed :
|
|
14358
|
+
let argCLPort;
|
|
14359
|
+
let argCLCertPath;
|
|
14360
|
+
let argCLKeyPath;
|
|
14361
|
+
process.argv.forEach(function (val, i){
|
|
14362
|
+
if(i<=1) return;
|
|
14363
|
+
else if(i==2) argCLPort=val;
|
|
14364
|
+
else if(i==3) argCLCertPath=val;
|
|
14365
|
+
else if(i==4) argCLKeyPath=val;
|
|
14366
|
+
});
|
|
14367
|
+
|
|
14368
|
+
// Console, command-line arguments OVERRIDE parameters values :
|
|
14369
|
+
|
|
14370
|
+
result.port=nonull(argCLPort,portParam);
|
|
14371
|
+
result.certPath=null;
|
|
14372
|
+
result.keyPath=null;
|
|
14373
|
+
result.isSecure=(certPathParam || keyPathParam);
|
|
14374
|
+
|
|
14375
|
+
if(result.isSecure){
|
|
14376
|
+
result.certPath=nonull(argCLCertPath,certPathParam);
|
|
14377
|
+
result.keyPath=nonull(argCLKeyPath,keyPathParam);
|
|
14378
|
+
}
|
|
14379
|
+
|
|
14380
|
+
// Eventual encryption options :
|
|
14381
|
+
result.sslOptions=null;
|
|
14382
|
+
if(result.isSecure){
|
|
14383
|
+
result.sslOptions={
|
|
14384
|
+
cert: fs.readFileSync(certPath),
|
|
14385
|
+
key: fs.readFileSync(keyPath),
|
|
14386
|
+
};
|
|
14387
|
+
}
|
|
14388
|
+
|
|
14389
|
+
return result;
|
|
14390
|
+
}
|
|
14391
|
+
|
|
14392
|
+
|
|
14393
|
+
|
|
14392
14394
|
|
|
14393
14395
|
|
|
14394
14396
|
// NODE ONLY SERVER / CLIENTS :
|
|
@@ -15294,11 +15296,13 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
15294
15296
|
// EXAMPLE : node orita-srv.js hash orita.global@keyHash 1234567890
|
|
15295
15297
|
console.log("Server launched.");
|
|
15296
15298
|
|
|
15299
|
+
|
|
15297
15300
|
// We read the command-line arguments if needed :
|
|
15298
15301
|
|
|
15299
15302
|
let argCLPort;
|
|
15300
15303
|
let argCLCertPath;
|
|
15301
15304
|
let argCLKeyPath;
|
|
15305
|
+
|
|
15302
15306
|
let serverConfig={};
|
|
15303
15307
|
let isForceUnsecure;
|
|
15304
15308
|
|
|
@@ -15331,7 +15335,10 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
15331
15335
|
});
|
|
15332
15336
|
isForceUnsecure=(argCLCertPath==="unsecure");
|
|
15333
15337
|
|
|
15334
|
-
|
|
15338
|
+
|
|
15339
|
+
|
|
15340
|
+
|
|
15341
|
+
|
|
15335
15342
|
const aotraNodeServer={config:serverConfig};
|
|
15336
15343
|
aotraNodeServer.serverManager={ start:()=>{/*DEFAULT START FUNCTION, WILL BE OVERRIDEN LATER*/}};
|
|
15337
15344
|
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.269",
|
|
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)",
|