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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (22/11/2022-22:57:28)»*/
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 (22/11/2022-22:57:28)»*/
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 (22/11/2022-22:57:28)»*/
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 (22/11/2022-22:57:28)»*/
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
- // UNUSED : (BUT KEEP CODE!!)
14339
- //getServerParams=function(portParam,isSecureParam,certPathParam,keyPathParam){
14340
- //
14341
- // // Node dependencies :
14342
- // // https=require("https");
14343
- // // fs=require("fs");
14344
- //
14345
- // if(!https){
14346
- // // TRACE
14347
- // console.log("WARN : Could not find the nodejs dependency «https», aborting SSL setup.");
14348
- // return null;
14349
- // }
14350
- // if(!fs){
14351
- // // TRACE
14352
- // console.log("WARN : Could not find the nodejs dependency «fs», aborting SSL setup.");
14353
- // return null;
14354
- // }
14355
- //
14356
- // var result={};
14357
- //
14358
- // // We read the command-line arguments if needed :
14359
- // var argCLPort;
14360
- // var argCLCertPath;
14361
- // var argCLKeyPath;
14362
- // process.argv.forEach(function (val, i){
14363
- // if(i<=1) return;
14364
- // else if(i==2) argCLPort=val;
14365
- // else if(i==3) argCLCertPath=val;
14366
- // else if(i==4) argCLKeyPath=val;
14367
- // });
14368
- //
14369
- // // Console, command-line arguments OVERRIDE parameters values :
14370
- //
14371
- // result.port=nonull(argCLPort,portParam);
14372
- // result.certPath=null;
14373
- // result.keyPath=null;
14374
- // result.isSecure=isSecureParam;
14375
- //
14376
- // if(isSecureParam){
14377
- // result.certPath=nonull(argCLCertPath,certPathParam);
14378
- // result.keyPath=nonull(argCLKeyPath,keyPathParam);
14379
- // }
14380
- //
14381
- // // Eventual encryption options :
14382
- // result.sslOptions=null;
14383
- // if(isSecureParam){
14384
- // result.sslOptions={
14385
- // cert: fs.readFileSync(certPath),
14386
- // key: fs.readFileSync(keyPath),
14387
- // };
14388
- // }
14389
- //
14390
- // return result;
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.267",
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)",