aotrautils 0.0.1413 → 0.0.1415

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 (19/04/2025-22:17:09)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (19/04/2025-22:21:46)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4894,7 +4894,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4894
4894
 
4895
4895
 
4896
4896
 
4897
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (19/04/2025-22:17:09)»*/
4897
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (19/04/2025-22:21:46)»*/
4898
4898
  /*-----------------------------------------------------------------------------*/
4899
4899
  /* ## Utility global methods in a browser (htmljs) client environment.
4900
4900
  *
@@ -13466,7 +13466,7 @@ getAORTACClient=function(clientId=getUUID(), serverNodeOrigin="ws://127.0.0.1:40
13466
13466
 
13467
13467
 
13468
13468
 
13469
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (19/04/2025-22:17:09)»*/
13469
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (19/04/2025-22:21:46)»*/
13470
13470
  /*-----------------------------------------------------------------------------*/
13471
13471
 
13472
13472
 
@@ -14705,7 +14705,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14705
14705
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14706
14706
 
14707
14707
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14708
- /*utils AI library associated with aotra version : «1_29072022-2359 (19/04/2025-22:17:09)»*/
14708
+ /*utils AI library associated with aotra version : «1_29072022-2359 (19/04/2025-22:21:46)»*/
14709
14709
  /*-----------------------------------------------------------------------------*/
14710
14710
 
14711
14711
 
@@ -14851,7 +14851,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
14851
14851
 
14852
14852
 
14853
14853
 
14854
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (19/04/2025-22:17:09)»*/
14854
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (19/04/2025-22:21:46)»*/
14855
14855
  /*-----------------------------------------------------------------------------*/
14856
14856
 
14857
14857
 
@@ -16587,17 +16587,19 @@ getListManager=function(config){
16587
16587
  // USE THIS INSTEAD :
16588
16588
  performHTTPRequest=function(completeURL,httpMethod="GET",headers={},requestBodyOrNamedArgs=null,isNodeContext=false,addCORSHeader=ADD_CORS_HEADER){
16589
16589
 
16590
- let requestBodyOrNamedArgsStr;
16591
- try{
16592
- requestBodyOrNamedArgsStr=stringifyObject(requestBodyOrNamedArgs);
16593
- }catch(parseErr){
16594
- requestBodyOrNamedArgsStr=""+requestBodyOrNamedArgs;
16590
+ let requestBodyOrNamedArgsStr=null;
16591
+ if(requestBodyOrNamedArgs){
16592
+ try{
16593
+ requestBodyOrNamedArgsStr=stringifyObject(requestBodyOrNamedArgs);
16594
+ }catch(parseErr){
16595
+ requestBodyOrNamedArgsStr=""+requestBodyOrNamedArgs;
16596
+ }
16595
16597
  }
16596
-
16597
16598
 
16598
16599
  if(contains(["POST","PUT"],httpMethod)){
16599
16600
  headers["Content-Type"]="application/json";
16600
- headers["Content-Length"]=Buffer.byteLength(requestBodyOrNamedArgsStr);
16601
+ if(requestBodyOrNamedArgsStr)
16602
+ headers["Content-Length"]=Buffer.byteLength(requestBodyOrNamedArgsStr);
16601
16603
 
16602
16604
  // To remove the CORS error message (cf. https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9)
16603
16605
  if(addCORSHeader) headers["Access-Control-Allow-Origin"]="*";
@@ -16746,9 +16748,8 @@ performHTTPRequest=function(completeURL,httpMethod="GET",headers={},requestBodyO
16746
16748
  // Not the same way to send parameters in POST http method :
16747
16749
  if(contains(["POST","PUT"],httpMethod)){
16748
16750
  // (We need to stringify parameters or else we'll have an error :)
16749
- if(!empty(requestBodyOrNamedArgs)){
16751
+ if(requestBodyOrNamedArgs)
16750
16752
  request.write(requestBodyOrNamedArgsStr);
16751
- }
16752
16753
  }
16753
16754
 
16754
16755
  // End the request
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.1413",
3
+ "version": "0.0.1415",
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)",