aotrautils 0.0.127 → 0.0.130
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 +36 -27
- 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.0.0.000 (16/07/2022-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (16/07/2022-17:13:09)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-
|
|
4831
|
+
/*utils CLIENT library associated with aotra version : «1.0.0.000 (16/07/2022-17:13:09)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4834
4834
|
*
|
|
@@ -11331,7 +11331,7 @@ function getPointsFromSVGDString(str){
|
|
|
11331
11331
|
// -Client :
|
|
11332
11332
|
|
|
11333
11333
|
// TODO : Use everywhere it's applicable !
|
|
11334
|
-
initClient=function(isNodeContext=true, useSocketIOImplementation
|
|
11334
|
+
initClient=function(isNodeContext=true, useSocketIOImplementation=/*DEBUG*/false, doOnServerConnection=null, url, /*OPTIONAL*/port=25000, isSecure=true, /*OPTIONAL*/timeout=10000, /*OPTIONAL*/selfParam=null){
|
|
11335
11335
|
let aotraClient={};
|
|
11336
11336
|
|
|
11337
11337
|
aotraClient.client={};
|
|
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
|
|
|
11678
11678
|
|
|
11679
11679
|
|
|
11680
11680
|
|
|
11681
|
-
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-
|
|
11681
|
+
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (16/07/2022-17:13:09)»*/
|
|
11682
11682
|
/*-----------------------------------------------------------------------------*/
|
|
11683
11683
|
|
|
11684
11684
|
|
|
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
12884
12884
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
12885
12885
|
|
|
12886
12886
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
12887
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-
|
|
12887
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (16/07/2022-17:13:09)»*/
|
|
12888
12888
|
/*-----------------------------------------------------------------------------*/
|
|
12889
12889
|
|
|
12890
12890
|
|
|
@@ -13117,7 +13117,7 @@ WebsocketImplementation={
|
|
|
13117
13117
|
//
|
|
13118
13118
|
// NODE SERVER/CLIENT
|
|
13119
13119
|
//
|
|
13120
|
-
getStatic:(isNodeContext=true, useSocketIOImplementation
|
|
13120
|
+
getStatic:(isNodeContext=true, useSocketIOImplementation=/*DEBUG*/false)=>{
|
|
13121
13121
|
|
|
13122
13122
|
WebsocketImplementation.isNodeContext=isNodeContext;
|
|
13123
13123
|
WebsocketImplementation.useSocketIOImplementation=useSocketIOImplementation;
|
|
@@ -13126,16 +13126,18 @@ WebsocketImplementation={
|
|
|
13126
13126
|
// TRACE
|
|
13127
13127
|
lognow("INFO : (SERVER/CLIENT) Using socket.io websocket implementation.");
|
|
13128
13128
|
|
|
13129
|
-
if(isNodeContext
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13129
|
+
if(isNodeContext){
|
|
13130
|
+
if(typeof(Socket)==="undefined"){
|
|
13131
|
+
// TRACE
|
|
13132
|
+
console.log("«socket.io» SERVER library not called yet, calling it now.");
|
|
13133
|
+
Socket=require("socket.io");
|
|
13134
|
+
return WebsocketImplementation;
|
|
13135
|
+
}
|
|
13136
|
+
if(typeof(Socket)==="undefined"){
|
|
13137
|
+
// TRACE
|
|
13138
|
+
console.log("ERROR : «socket.io» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
13139
|
+
return WebsocketImplementation;
|
|
13140
|
+
}
|
|
13139
13141
|
}
|
|
13140
13142
|
|
|
13141
13143
|
}else{
|
|
@@ -13143,17 +13145,19 @@ WebsocketImplementation={
|
|
|
13143
13145
|
lognow("INFO : (SERVER/CLIENT) Using native WebSocket implementation.");
|
|
13144
13146
|
|
|
13145
13147
|
// https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
|
|
13146
|
-
if(isNodeContext
|
|
13147
|
-
WebSocket
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13148
|
+
if(isNodeContext){
|
|
13149
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13150
|
+
WebSocket=require("ws");
|
|
13151
|
+
// TRACE
|
|
13152
|
+
console.log("«ws» SERVER library not called yet, calling it now.");
|
|
13153
|
+
return WebsocketImplementation;
|
|
13154
|
+
}
|
|
13155
|
+
if(typeof(WebSocket)==="undefined"){
|
|
13156
|
+
// TRACE
|
|
13157
|
+
console.log("ERROR : «ws» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
13158
|
+
return WebsocketImplementation;
|
|
13159
|
+
}
|
|
13151
13160
|
}
|
|
13152
|
-
if(typeof(WebSocket)==="undefined"){
|
|
13153
|
-
// TRACE
|
|
13154
|
-
console.log("ERROR : «ws» CONSOLE/BROWSER CLIENT/SERVER library not found. Cannot launch nodejs server. Aborting.");
|
|
13155
|
-
return WebsocketImplementation;
|
|
13156
|
-
}
|
|
13157
13161
|
|
|
13158
13162
|
}
|
|
13159
13163
|
|
|
@@ -13882,7 +13886,7 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
|
|
|
13882
13886
|
}
|
|
13883
13887
|
|
|
13884
13888
|
|
|
13885
|
-
const server=WebsocketImplementation.getStatic(true
|
|
13889
|
+
const server=WebsocketImplementation.getStatic(true).getServer(listenableServer, port);
|
|
13886
13890
|
|
|
13887
13891
|
// When a client connects, we execute the callback :
|
|
13888
13892
|
// CAUTION : MUST BE CALLED ONLY ONCE !
|
|
@@ -13892,6 +13896,10 @@ launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /
|
|
|
13892
13896
|
|
|
13893
13897
|
|
|
13894
13898
|
server.onFinalize((serverParam)=>{
|
|
13899
|
+
|
|
13900
|
+
// DBG
|
|
13901
|
+
lognow("onFinalize!!!!!");
|
|
13902
|
+
|
|
13895
13903
|
if(doOnFinalizeServer) doOnFinalizeServer(serverParam);
|
|
13896
13904
|
});
|
|
13897
13905
|
|
|
@@ -14014,6 +14022,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
14014
14022
|
//aotraNodeServer.serverManager.microClientsSockets=[];
|
|
14015
14023
|
// UNUSEFUL :
|
|
14016
14024
|
//aotraNodeServer.serverManager.mainClientsSockets=[];
|
|
14025
|
+
|
|
14017
14026
|
aotraNodeServer.serverManager.start=function(){
|
|
14018
14027
|
|
|
14019
14028
|
// Eventual encryption options :
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.130",
|
|
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)",
|