@andrey4emk/npm-app-back-b24 0.5.28 → 0.5.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrey4emk/npm-app-back-b24",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "Bitrix24 OAuth helpers for Node.js projects",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -39,15 +39,13 @@ export class Wappi {
39
39
  if (messangerType === "max") {
40
40
  url = `https://wappi.pro/maxapi/sync/message/send`;
41
41
  }
42
- let res = await fetch(url, {
42
+ let res = await fetch(url + `?profile_id=${this.profile_id}`, {
43
43
  method: "POST",
44
44
  headers: {
45
45
  "Content-Type": "application/json",
46
46
  Authorization: this.token,
47
47
  },
48
- params: {
49
- profile_id: this.profile_id,
50
- },
48
+
51
49
  body: JSON.stringify({
52
50
  recipient: phone,
53
51
  body: message,
@@ -82,15 +80,13 @@ export class Wappi {
82
80
  if (messangerType === "max") {
83
81
  url = `https://wappi.pro/maxapi/async/message/file/url/send`;
84
82
  }
85
- let res = await fetch(url, {
83
+ let res = await fetch(url + `?profile_id=${this.profile_id}`, {
86
84
  method: "POST",
87
85
  headers: {
88
86
  "Content-Type": "application/json",
89
87
  Authorization: this.token,
90
88
  },
91
- params: {
92
- profile_id: this.profile_id,
93
- },
89
+
94
90
  body: JSON.stringify({
95
91
  recipient: phone,
96
92
  url: fileUrl,
@@ -123,16 +119,12 @@ export class Wappi {
123
119
  if (messangerType === "max") {
124
120
  url = `https://wappi.pro/maxapi/sync/contact/check`;
125
121
  }
126
- let res = await fetch(url, {
122
+ let res = await fetch(url + `?profile_id=${this.profile_id}&phone=${phone}`, {
127
123
  method: "get",
128
124
  headers: {
129
125
  "Content-Type": "application/json",
130
126
  Authorization: this.token,
131
127
  },
132
- params: {
133
- profile_id: this.profile_id,
134
- phone: phone,
135
- },
136
128
  });
137
129
  let data = await res.json();
138
130
  if (data.status != "done") {