@slavmak2486/bx24ts 1.1.4 → 1.1.6

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.
package/base/BX24.ts CHANGED
@@ -58,7 +58,7 @@ export abstract class baseBX24{
58
58
 
59
59
  getHttpString(value:any, prefix=''):string{
60
60
  if (value instanceof Date){
61
- return prefix+'='+value.toISOString();
61
+ return prefix+'='+encodeURIComponent(value.toISOString());
62
62
  }
63
63
  else if (typeof value=='object'){
64
64
  const resultObj=[];
@@ -68,9 +68,9 @@ export abstract class baseBX24{
68
68
  return resultObj.join('&');
69
69
  }
70
70
  else if (prefix!=''){
71
- return prefix+'='+value;
71
+ return prefix+'='+encodeURIComponent(value);
72
72
  }
73
- return value;
73
+ return encodeURIComponent(value);
74
74
  }
75
75
 
76
76
 
@@ -306,7 +306,7 @@ export abstract class baseBX24{
306
306
  if(method)
307
307
  {
308
308
  cnt++;
309
- comands[idx] = `${method}?${encodeURIComponent(this.getHttpString(params))}`;
309
+ comands[idx] = `${method}?${this.getHttpString(params)}`;
310
310
  }
311
311
  }
312
312
 
@@ -417,7 +417,7 @@ export abstract class baseBX24{
417
417
  result[idx]={
418
418
  data:()=>({}),
419
419
  total:()=>0,
420
- error_description:()=>'Incorrect response from bitrix24',
420
+ error_description:()=>JSON.stringify(res),
421
421
  answer:data?.result?.[idx],
422
422
  query: {
423
423
  method:Array.isArray(cmd)?cmd[0]:cmd?.method,
@@ -429,7 +429,7 @@ export abstract class baseBX24{
429
429
  time:()=>({}),
430
430
  status:res.status,
431
431
  more:()=>false,
432
- error:()=>`Incorect response from bitrix24`
432
+ error:()=>JSON.stringify(res)
433
433
  };
434
434
  }
435
435
  }
package/dist/base/BX24.js CHANGED
@@ -97,7 +97,7 @@ class baseBX24 {
97
97
  }
98
98
  getHttpString(value, prefix = '') {
99
99
  if (value instanceof Date) {
100
- return prefix + '=' + value.toISOString();
100
+ return prefix + '=' + encodeURIComponent(value.toISOString());
101
101
  }
102
102
  else if (typeof value == 'object') {
103
103
  const resultObj = [];
@@ -107,9 +107,9 @@ class baseBX24 {
107
107
  return resultObj.join('&');
108
108
  }
109
109
  else if (prefix != '') {
110
- return prefix + '=' + value;
110
+ return prefix + '=' + encodeURIComponent(value);
111
111
  }
112
- return value;
112
+ return encodeURIComponent(value);
113
113
  }
114
114
  isFunction(item) {
115
115
  return item === null ? false : (typeof (item) == "function" || item instanceof Function);
@@ -252,7 +252,7 @@ class baseBX24 {
252
252
  const params = Array.isArray(row) ? row[1] : row.params;
253
253
  if (method) {
254
254
  cnt++;
255
- comands[idx] = `${method}?${encodeURIComponent(this.getHttpString(params))}`;
255
+ comands[idx] = `${method}?${this.getHttpString(params)}`;
256
256
  }
257
257
  }
258
258
  if (cnt > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slavmak2486/bx24ts",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Library for bitrix24",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",