aotrautils-srv 0.0.1585 → 0.0.1587

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 (11/05/2025-14:04:02)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (11/05/2025-14:15:54)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4895,7 +4895,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4895
4895
 
4896
4896
 
4897
4897
 
4898
- /*utils AI library associated with aotra version : «1_29072022-2359 (11/05/2025-14:04:02)»*/
4898
+ /*utils AI library associated with aotra version : «1_29072022-2359 (11/05/2025-14:15:54)»*/
4899
4899
  /*-----------------------------------------------------------------------------*/
4900
4900
 
4901
4901
 
@@ -5041,7 +5041,7 @@ getOpenAIAPIClient=(modelName, apiURL, agentRole, defaultPrompt)=>{
5041
5041
 
5042
5042
 
5043
5043
 
5044
- /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (11/05/2025-14:04:02)»*/
5044
+ /*utils CONSOLE library associated with aotra version : «1_29072022-2359 (11/05/2025-14:15:54)»*/
5045
5045
  /*-----------------------------------------------------------------------------*/
5046
5046
 
5047
5047
 
@@ -6070,16 +6070,19 @@ performHTTPRequest=function(completeURL, httpMethod="GET", headers={}, requestBo
6070
6070
 
6071
6071
  let body=null;
6072
6072
  // Not the same way to send parameters, with POST/PUT http method :
6073
- if(contains(["POST","PUT"],httpMethod) && requestBodyOrNamedArgs && forceStringifyBody){
6074
- // CAUTION : IF POST/PUT METHOD THEN WE MUST NOT PASS A STRING, BUT A PLAIN OBJECT ! ELSE IT WILL CAUSE STRANGE BUGS !!!
6075
- body=requestBodyOrNamedArgsStr;
6073
+ if(contains(["POST","PUT"],httpMethod) && requestBodyOrNamedArgs){
6074
+ if(forceStringifyBody){
6075
+ body=requestBodyOrNamedArgsStr;
6076
+ }else{
6077
+ body=requestBodyOrNamedArgs;
6078
+ }
6076
6079
  }
6077
6080
 
6078
6081
  // Headers
6079
6082
  if(contains(["POST","PUT"],httpMethod)){
6080
6083
  headers["Content-Type"]="application/json";
6081
6084
 
6082
- if(requestBodyOrNamedArgsStr && forceStringifyBody){
6085
+ if(requestBodyOrNamedArgsStr && isString(body)){
6083
6086
  headers["Content-Length"]=Buffer.byteLength(requestBodyOrNamedArgsStr);
6084
6087
  }
6085
6088
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils-srv",
3
- "version": "0.0.1585",
3
+ "version": "0.0.1587",
4
4
  "main": "aotrautils-srv.build.js",
5
5
  "description": "A library for vanilla javascript utils (server-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",