@wppconnect/server 1.8.0 → 1.8.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 1.8.2 (2023-01-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fixed send message to groups (close [#1049](https://github.com/wppconnect-team/wppconnect-server/issues/1049)) ([f8bc6e4](https://github.com/wppconnect-team/wppconnect-server/commit/f8bc6e4ee14b36e266b86bcf9998acf96629019f))
7
+
8
+
9
+
10
+ ## 1.8.1 (2022-12-28)
11
+
12
+
13
+
1
14
  # 1.8.0 (2022-12-15)
2
15
 
3
16
 
package/dist/config.json CHANGED
@@ -18,7 +18,8 @@
18
18
  "onPresenceChanged": true,
19
19
  "onParticipantsChanged": true,
20
20
  "onReactionMessage": true,
21
- "onPollResponse": true
21
+ "onPollResponse": true,
22
+ "onRevokedMessage": true
22
23
  },
23
24
  "archive": {
24
25
  "enable": false,
@@ -24,7 +24,7 @@ async function getProducts(req, res) {
24
24
  const result = await req.client.getProducts(phone, qnt);
25
25
  res.status(201).json({ status: 'success', response: result });
26
26
  } catch (error) {
27
- res.status(500).json({ status: 'Error', message: 'Error on get products' });
27
+ res.status(500).json({ status: 'Error', message: 'Error on get products', error: error });
28
28
  }
29
29
  }
30
30
 
@@ -39,7 +39,7 @@ async function getProductById(req, res) {
39
39
  const result = await req.client.getProductById(phone, id);
40
40
  res.status(201).json({ status: 'success', response: result });
41
41
  } catch (error) {
42
- res.status(500).json({ status: 'Error', message: 'Error on get product' });
42
+ res.status(500).json({ status: 'Error', message: 'Error on get product', error: error });
43
43
  }
44
44
  }
45
45
  async function editProduct(req, res) {
@@ -53,7 +53,7 @@ async function editProduct(req, res) {
53
53
  const result = await req.client.editProduct(id, options);
54
54
  res.status(201).json({ status: 'success', response: result });
55
55
  } catch (error) {
56
- res.status(500).json({ status: 'Error', message: 'Error on edit product.' });
56
+ res.status(500).json({ status: 'Error', message: 'Error on edit product.', error: error });
57
57
  }
58
58
  }
59
59
 
@@ -68,7 +68,7 @@ async function delProducts(req, res) {
68
68
  const result = await req.client.delProducts(id);
69
69
  res.status(201).json({ status: 'success', response: result });
70
70
  } catch (error) {
71
- res.status(500).json({ status: 'Error', message: 'Error on delete product.' });
71
+ res.status(500).json({ status: 'Error', message: 'Error on delete product.', error: error });
72
72
  }
73
73
  }
74
74
 
@@ -83,7 +83,7 @@ async function changeProductImage(req, res) {
83
83
  const result = await req.client.changeProductImage(id, base64);
84
84
  res.status(201).json({ status: 'success', response: result });
85
85
  } catch (error) {
86
- res.status(500).json({ status: 'Error', message: 'Error on change product image.' });
86
+ res.status(500).json({ status: 'Error', message: 'Error on change product image.', error: error });
87
87
  }
88
88
  }
89
89
 
@@ -98,7 +98,7 @@ async function addProductImage(req, res) {
98
98
  const result = await req.client.addProductImage(id, base64);
99
99
  res.status(201).json({ status: 'success', response: result });
100
100
  } catch (error) {
101
- res.status(500).json({ status: 'Error', message: 'Error on add product image.' });
101
+ res.status(500).json({ status: 'Error', message: 'Error on add product image.', error: error });
102
102
  }
103
103
  }
104
104
 
@@ -113,7 +113,7 @@ async function removeProductImage(req, res) {
113
113
  const result = await req.client.addProductImage(id, index);
114
114
  res.status(201).json({ status: 'success', response: result });
115
115
  } catch (error) {
116
- res.status(500).json({ status: 'Error', message: 'Error on remove product image.' });
116
+ res.status(500).json({ status: 'Error', message: 'Error on remove product image.', error: error });
117
117
  }
118
118
  }
119
119
 
@@ -128,7 +128,7 @@ async function getCollections(req, res) {
128
128
  const result = await req.client.getCollections(phone, qnt, max);
129
129
  res.status(201).json({ status: 'success', response: result });
130
130
  } catch (error) {
131
- res.status(500).json({ status: 'Error', message: 'Error on get collections.' });
131
+ res.status(500).json({ status: 'Error', message: 'Error on get collections.', error: error });
132
132
  }
133
133
  }
134
134
 
@@ -143,7 +143,7 @@ async function createCollection(req, res) {
143
143
  const result = await req.client.createCollection(name, products);
144
144
  res.status(201).json({ status: 'success', response: result });
145
145
  } catch (error) {
146
- res.status(500).json({ status: 'Error', message: 'Error on create collection.' });
146
+ res.status(500).json({ status: 'Error', message: 'Error on create collection.', error: error });
147
147
  }
148
148
  }
149
149
 
@@ -158,7 +158,7 @@ async function editCollection(req, res) {
158
158
  const result = await req.client.createCollection(id, options);
159
159
  res.status(201).json({ status: 'success', response: result });
160
160
  } catch (error) {
161
- res.status(500).json({ status: 'Error', message: 'Error on edit collection.' });
161
+ res.status(500).json({ status: 'Error', message: 'Error on edit collection.', error: error });
162
162
  }
163
163
  }
164
164
 
@@ -173,7 +173,7 @@ async function deleteCollection(req, res) {
173
173
  const result = await req.client.deleteCollection(id);
174
174
  res.status(201).json({ status: 'success', response: result });
175
175
  } catch (error) {
176
- res.status(500).json({ status: 'Error', message: 'Error on delete collection.' });
176
+ res.status(500).json({ status: 'Error', message: 'Error on delete collection.', error: error });
177
177
  }
178
178
  }
179
179
 
@@ -188,7 +188,7 @@ async function setProductVisibility(req, res) {
188
188
  const result = await req.client.setProductVisibility(id, value);
189
189
  res.status(201).json({ status: 'success', response: result });
190
190
  } catch (error) {
191
- res.status(500).json({ status: 'Error', message: 'Error on set product visibility.' });
191
+ res.status(500).json({ status: 'Error', message: 'Error on set product visibility.', error: error });
192
192
  }
193
193
  }
194
194
 
@@ -203,7 +203,7 @@ async function updateCartEnabled(req, res) {
203
203
  const result = await req.client.setProductVisibility(enabled);
204
204
  res.status(201).json({ status: 'success', response: result });
205
205
  } catch (error) {
206
- res.status(500).json({ status: 'Error', message: 'Error on set enabled cart.' });
206
+ res.status(500).json({ status: 'Error', message: 'Error on set enabled cart.', error: error });
207
207
  }
208
208
  }
209
209
  //# sourceMappingURL=catalogController.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalogController.js","names":["getProducts","req","res","phone","qnt","query","status","send","message","result","client","json","response","error","getProductById","id","editProduct","options","body","delProducts","changeProductImage","base64","addProductImage","removeProductImage","index","getCollections","max","createCollection","name","products","editCollection","deleteCollection","setProductVisibility","value","updateCartEnabled","enabled"],"sources":["../../src/controller/catalogController.js"],"sourcesContent":["/*\n * Copyright 2021 WPPConnect Team\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport async function getProducts(req, res) {\n const { phone, qnt } = req.query;\n if (!phone)\n return res.status(401).send({\n message: 'Please send the contact number you wish to return the products.',\n });\n\n try {\n const result = await req.client.getProducts(phone, qnt);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get products' });\n }\n}\n\nexport async function getProductById(req, res) {\n const { phone, id } = req.query;\n if (!phone || !id)\n return res.status(401).send({\n message: 'Please send the contact number and productId.',\n });\n\n try {\n const result = await req.client.getProductById(phone, id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get product' });\n }\n}\nexport async function editProduct(req, res) {\n const { id, options } = req.body;\n if (!id || !options)\n return res.status(401).send({\n message: 'productId or options was not informed',\n });\n\n try {\n const result = await req.client.editProduct(id, options);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on edit product.' });\n }\n}\n\nexport async function delProducts(req, res) {\n const { id } = req.body;\n if (!id)\n return res.status(401).send({\n message: 'products Id was not informed',\n });\n\n try {\n const result = await req.client.delProducts(id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on delete product.' });\n }\n}\n\nexport async function changeProductImage(req, res) {\n const { id, base64 } = req.body;\n if (!id || !base64)\n return res.status(401).send({\n message: 'productId and base64 was not informed',\n });\n\n try {\n const result = await req.client.changeProductImage(id, base64);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on change product image.' });\n }\n}\n\nexport async function addProductImage(req, res) {\n const { id, base64 } = req.body;\n if (!id || !base64)\n return res.status(401).send({\n message: 'productId and base64 was not informed',\n });\n\n try {\n const result = await req.client.addProductImage(id, base64);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on add product image.' });\n }\n}\n\nexport async function removeProductImage(req, res) {\n const { id, index } = req.body;\n if (!id || !index)\n return res.status(401).send({\n message: 'productId and index image was not informed',\n });\n\n try {\n const result = await req.client.addProductImage(id, index);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on remove product image.' });\n }\n}\n\nexport async function getCollections(req, res) {\n const { phone, qnt, max } = req.query;\n if (!phone)\n return res.status(401).send({\n message: 'phone was not informed',\n });\n\n try {\n const result = await req.client.getCollections(phone, qnt, max);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get collections.' });\n }\n}\n\nexport async function createCollection(req, res) {\n const { name, products } = req.body;\n if (!name || !products)\n return res.status(401).send({\n message: 'name or products was not informed',\n });\n\n try {\n const result = await req.client.createCollection(name, products);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on create collection.' });\n }\n}\n\nexport async function editCollection(req, res) {\n const { id, options } = req.body;\n if (!id || !options)\n return res.status(401).send({\n message: 'id or options was not informed',\n });\n\n try {\n const result = await req.client.createCollection(id, options);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on edit collection.' });\n }\n}\n\nexport async function deleteCollection(req, res) {\n const { id } = req.body;\n if (!id)\n return res.status(401).send({\n message: 'id was not informed',\n });\n\n try {\n const result = await req.client.deleteCollection(id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on delete collection.' });\n }\n}\n\nexport async function setProductVisibility(req, res) {\n const { id, value } = req.body;\n if (!id || !value)\n return res.status(401).send({\n message: 'product id or value (false, true) was not informed',\n });\n\n try {\n const result = await req.client.setProductVisibility(id, value);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on set product visibility.' });\n }\n}\n\nexport async function updateCartEnabled(req, res) {\n const { enabled } = req.body;\n if (!enabled)\n return res.status(401).send({\n message: 'enabled (false, true) was not informed',\n });\n\n try {\n const result = await req.client.setProductVisibility(enabled);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on set enabled cart.' });\n }\n}\n"],"mappings":"8mBAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,WAAW,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC1C,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,CAAC,GAAGH,GAAG,CAACI,KAAK;EAChC,IAAI,CAACF,KAAK;EACR,OAAOD,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC;IAC1BC,OAAO,EAAE;EACX,CAAC,CAAC;;EAEJ,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMR,GAAG,CAACS,MAAM,CAACV,WAAW,CAACG,KAAK,EAAEC,GAAG,CAAC;IACvDF,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,SAAS,EAAEM,QAAQ,EAAEH,MAAM,CAAC,CAAC,CAAC;EAC/D,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdX,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,OAAO,EAAEE,OAAO,EAAE,uBAAuB,CAAC,CAAC,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MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,SAAS,EAAEM,QAAQ,EAAEH,MAAM,CAAC,CAAC,CAAC;EAC/D,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdX,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,OAAO,EAAEE,OAAO,EAAE,kCAAkC,CAAC,CAAC,CAAC;EACxF;AACF;;AAEO,eAAe0B,iBAAiB,CAACjC,GAAG,EAAEC,GAAG,EAAE;EAChD,MAAM,EAAEiC,OAAO,CAAC,CAAC,GAAGlC,GAAG,CAACiB,IAAI;EAC5B,IAAI,CAACiB,OAAO;EACV,OAAOjC,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC;IAC1BC,OAAO,EAAE;EACX,CAAC,CAAC;;EAEJ,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMR,GAAG,CAACS,MAAM,CAACsB,oBAAoB,CAACG,OAAO,CAAC;IAC7DjC,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,SAAS,EAAEM,QAAQ,EAAEH,MAAM,CAAC,CAAC,CAAC;EAC/D,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdX,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,OAAO,EAAEE,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;EAClF;AACF"}
1
+ {"version":3,"file":"catalogController.js","names":["getProducts","req","res","phone","qnt","query","status","send","message","result","client","json","response","error","getProductById","id","editProduct","options","body","delProducts","changeProductImage","base64","addProductImage","removeProductImage","index","getCollections","max","createCollection","name","products","editCollection","deleteCollection","setProductVisibility","value","updateCartEnabled","enabled"],"sources":["../../src/controller/catalogController.js"],"sourcesContent":["/*\n * Copyright 2021 WPPConnect Team\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport async function getProducts(req, res) {\n const { phone, qnt } = req.query;\n if (!phone)\n return res.status(401).send({\n message: 'Please send the contact number you wish to return the products.',\n });\n\n try {\n const result = await req.client.getProducts(phone, qnt);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get products', error: error });\n }\n}\n\nexport async function getProductById(req, res) {\n const { phone, id } = req.query;\n if (!phone || !id)\n return res.status(401).send({\n message: 'Please send the contact number and productId.',\n });\n\n try {\n const result = await req.client.getProductById(phone, id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get product', error: error });\n }\n}\nexport async function editProduct(req, res) {\n const { id, options } = req.body;\n if (!id || !options)\n return res.status(401).send({\n message: 'productId or options was not informed',\n });\n\n try {\n const result = await req.client.editProduct(id, options);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on edit product.', error: error });\n }\n}\n\nexport async function delProducts(req, res) {\n const { id } = req.body;\n if (!id)\n return res.status(401).send({\n message: 'products Id was not informed',\n });\n\n try {\n const result = await req.client.delProducts(id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on delete product.', error: error });\n }\n}\n\nexport async function changeProductImage(req, res) {\n const { id, base64 } = req.body;\n if (!id || !base64)\n return res.status(401).send({\n message: 'productId and base64 was not informed',\n });\n\n try {\n const result = await req.client.changeProductImage(id, base64);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on change product image.', error: error });\n }\n}\n\nexport async function addProductImage(req, res) {\n const { id, base64 } = req.body;\n if (!id || !base64)\n return res.status(401).send({\n message: 'productId and base64 was not informed',\n });\n\n try {\n const result = await req.client.addProductImage(id, base64);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on add product image.', error: error });\n }\n}\n\nexport async function removeProductImage(req, res) {\n const { id, index } = req.body;\n if (!id || !index)\n return res.status(401).send({\n message: 'productId and index image was not informed',\n });\n\n try {\n const result = await req.client.addProductImage(id, index);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on remove product image.', error: error });\n }\n}\n\nexport async function getCollections(req, res) {\n const { phone, qnt, max } = req.query;\n if (!phone)\n return res.status(401).send({\n message: 'phone was not informed',\n });\n\n try {\n const result = await req.client.getCollections(phone, qnt, max);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on get collections.', error: error });\n }\n}\n\nexport async function createCollection(req, res) {\n const { name, products } = req.body;\n if (!name || !products)\n return res.status(401).send({\n message: 'name or products was not informed',\n });\n\n try {\n const result = await req.client.createCollection(name, products);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on create collection.', error: error });\n }\n}\n\nexport async function editCollection(req, res) {\n const { id, options } = req.body;\n if (!id || !options)\n return res.status(401).send({\n message: 'id or options was not informed',\n });\n\n try {\n const result = await req.client.createCollection(id, options);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on edit collection.', error: error });\n }\n}\n\nexport async function deleteCollection(req, res) {\n const { id } = req.body;\n if (!id)\n return res.status(401).send({\n message: 'id was not informed',\n });\n\n try {\n const result = await req.client.deleteCollection(id);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on delete collection.', error: error });\n }\n}\n\nexport async function setProductVisibility(req, res) {\n const { id, value } = req.body;\n if (!id || !value)\n return res.status(401).send({\n message: 'product id or value (false, true) was not informed',\n });\n\n try {\n const result = await req.client.setProductVisibility(id, value);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on set product visibility.', error: error });\n }\n}\n\nexport async function updateCartEnabled(req, res) {\n const { enabled } = req.body;\n if (!enabled)\n return res.status(401).send({\n message: 'enabled (false, true) was not informed',\n });\n\n try {\n const result = await req.client.setProductVisibility(enabled);\n res.status(201).json({ status: 'success', response: result });\n } catch (error) {\n res.status(500).json({ status: 'Error', message: 'Error on set enabled cart.', error: error });\n }\n}\n"],"mappings":"8mBAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeA,WAAW,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC1C,MAAM,EAAEC,KAAK,EAAEC,GAAG,CAAC,CAAC,GAAGH,GAAG,CAACI,KAAK;EAChC,IAAI,CAACF,KAAK;EACR,OAAOD,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC;IAC1BC,OAAO,EAAE;EACX,CAAC,CAAC;;EAEJ,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMR,GAAG,CAACS,MAAM,CAACV,WAAW,CAACG,KAAK,EAAEC,GAAG,CAAC;IACvDF,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,SAAS,EAAEM,QAAQ,EAAEH,MAAM,CAAC,CAAC,CAAC;EAC/D,CAAC,CAAC,OAAOI,KAAK,EAAE;IACdX,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACK,IAAI,CAAC,EAAEL,MAAM,EAAE,OAAO,EAAEE,OAAO,EAAE,uBAAuB,EAAEK,KAAK,EAAEA,KAAK,CAAC,CAAC,CAAC;EAC3F;AACF;;AAEO,eAAeC,cAAc,CAACb,GA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"}
@@ -53,7 +53,7 @@ async function setProfileName(req, res) {
53
53
  return res.status(200).json({ status: 'success', response: result });
54
54
  } catch (error) {
55
55
  req.logger.error(error);
56
- res.status(500).json({ status: 'error', message: 'Error on set profile name.' });
56
+ res.status(500).json({ status: 'error', message: 'Error on set profile name.', error: error });
57
57
  }
58
58
  }
59
59
 
@@ -63,7 +63,7 @@ async function showAllContacts(req, res) {
63
63
  res.status(200).json({ status: 'success', response: contacts });
64
64
  } catch (error) {
65
65
  req.logger.error(error);
66
- res.status(500).json({ status: 'error', message: 'Error fetching contacts' });
66
+ res.status(500).json({ status: 'error', message: 'Error fetching contacts', error: error });
67
67
  }
68
68
  }
69
69
 
@@ -83,7 +83,7 @@ async function getAllChatsWithMessages(req, res) {
83
83
  return res.status(200).json({ status: 'success', response: response });
84
84
  } catch (e) {
85
85
  req.logger.error(e);
86
- return res.status(500).json({ status: 'error', message: 'Error on get all chats whit messages' });
86
+ return res.status(500).json({ status: 'error', message: 'Error on get all chats whit messages', error: e });
87
87
  }
88
88
  }
89
89
  /**
@@ -102,7 +102,7 @@ async function getAllMessagesInChat(req, res) {
102
102
  return res.status(200).json({ status: 'success', response: response });
103
103
  } catch (e) {
104
104
  req.logger.error(e);
105
- return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat' });
105
+ return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat', error: e });
106
106
  }
107
107
  }
108
108
 
@@ -112,7 +112,7 @@ async function getAllNewMessages(req, res) {
112
112
  return res.status(200).json({ status: 'success', response: response });
113
113
  } catch (e) {
114
114
  req.logger.error(e);
115
- return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat' });
115
+ return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat', error: e });
116
116
  }
117
117
  }
118
118
 
@@ -122,7 +122,7 @@ async function getAllUnreadMessages(req, res) {
122
122
  return res.status(200).json({ status: 'success', response: response });
123
123
  } catch (e) {
124
124
  req.logger.error(e);
125
- return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat' });
125
+ return res.status(500).json({ status: 'error', message: 'Error on get all messages in chat', error: e });
126
126
  }
127
127
  }
128
128
 
@@ -156,7 +156,7 @@ async function getChatById(req, res) {
156
156
  return res.status(200).json({ status: 'success', response: allMessages });
157
157
  } catch (e) {
158
158
  req.logger.error(e);
159
- return res.status(500).json({ status: 'error', message: 'Error changing chat by Id' });
159
+ return res.status(500).json({ status: 'error', message: 'Error changing chat by Id', error: e });
160
160
  }
161
161
  }
162
162
 
@@ -181,7 +181,7 @@ async function getBatteryLevel(req, res) {
181
181
  return res.status(200).json({ status: 'Success', response: response });
182
182
  } catch (e) {
183
183
  req.logger.error(e);
184
- return res.status(500).json({ status: 'error', message: 'Error retrieving battery status' });
184
+ return res.status(500).json({ status: 'error', message: 'Error retrieving battery status', error: e });
185
185
  }
186
186
  }
187
187
 
@@ -192,7 +192,7 @@ async function getHostDevice(req, res) {
192
192
  return res.status(200).json({ status: 'success', response: { ...response, phoneNumber }, mapper: 'device' });
193
193
  } catch (e) {
194
194
  req.logger.error(e);
195
- return res.status(500).json({ status: 'error', message: 'Erro ao recuperar dados do telefone' });
195
+ return res.status(500).json({ status: 'error', message: 'Erro ao recuperar dados do telefone', error: e });
196
196
  }
197
197
  }
198
198
 
@@ -202,7 +202,7 @@ async function getPhoneNumber(req, res) {
202
202
  return res.status(200).json({ status: 'success', response: phoneNumber, mapper: 'device' });
203
203
  } catch (e) {
204
204
  req.logger.error(e);
205
- return res.status(500).json({ status: 'error', message: 'Error retrieving phone number' });
205
+ return res.status(500).json({ status: 'error', message: 'Error retrieving phone number', error: e });
206
206
  }
207
207
  }
208
208
 
@@ -217,7 +217,7 @@ async function getBlockList(req, res) {
217
217
  return res.status(200).json({ status: 'success', response: blocked });
218
218
  } catch (e) {
219
219
  req.logger.error(e);
220
- return res.status(500).json({ status: 'error', message: 'Error retrieving blocked contact list' });
220
+ return res.status(500).json({ status: 'error', message: 'Error retrieving blocked contact list', error: e });
221
221
  }
222
222
  }
223
223
 
@@ -244,7 +244,7 @@ async function deleteAllChats(req, res) {
244
244
  return res.status(200).json({ status: 'success' });
245
245
  } catch (error) {
246
246
  req.logger.error(error);
247
- return res.status(500).json({ status: 'error', message: 'Error on delete all chats' });
247
+ return res.status(500).json({ status: 'error', message: 'Error on delete all chats', error: error });
248
248
  }
249
249
  }
250
250
 
@@ -272,7 +272,7 @@ async function clearAllChats(req, res) {
272
272
  return res.status(201).json({ status: 'success' });
273
273
  } catch (e) {
274
274
  req.logger.error(e);
275
- return res.status(500).json({ status: 'error', message: 'Error on clear all chats' });
275
+ return res.status(500).json({ status: 'error', message: 'Error on clear all chats', error: e });
276
276
  }
277
277
  }
278
278
 
@@ -285,7 +285,7 @@ async function archiveChat(req, res) {
285
285
  return res.status(201).json({ status: 'success', response: response });
286
286
  } catch (e) {
287
287
  req.logger.error(e);
288
- return res.status(500).json({ status: 'error', message: 'Error on archive chat' });
288
+ return res.status(500).json({ status: 'error', message: 'Error on archive chat', error: e });
289
289
  }
290
290
  }
291
291
 
@@ -298,7 +298,7 @@ async function archiveAllChats(req, res) {
298
298
  return res.status(201).json({ status: 'success' });
299
299
  } catch (e) {
300
300
  req.logger.error(e);
301
- return res.status(500).json({ status: 'error', message: 'Error on archive all chats' });
301
+ return res.status(500).json({ status: 'error', message: 'Error on archive all chats', error: e });
302
302
  }
303
303
  }
304
304
 
@@ -311,7 +311,7 @@ async function deleteMessage(req, res) {
311
311
  return res.status(200).json({ status: 'success', response: { message: 'Message deleted' } });
312
312
  } catch (e) {
313
313
  req.logger.error(e);
314
- return res.status(500).json({ status: 'error', message: 'Error on delete message' });
314
+ return res.status(500).json({ status: 'error', message: 'Error on delete message', error: e });
315
315
  }
316
316
  }
317
317
  async function reactMessage(req, res) {
@@ -323,7 +323,7 @@ async function reactMessage(req, res) {
323
323
  return res.status(200).json({ status: 'success', response: { message: 'Reaction sended' } });
324
324
  } catch (e) {
325
325
  req.logger.error(e);
326
- return res.status(500).json({ status: 'error', message: 'Error on send reaction to message' });
326
+ return res.status(500).json({ status: 'error', message: 'Error on send reaction to message', error: e });
327
327
  }
328
328
  }
329
329
 
@@ -335,7 +335,7 @@ async function reply(req, res) {
335
335
  return res.status(200).json({ status: 'success', response: response });
336
336
  } catch (e) {
337
337
  req.logger.error(e);
338
- return res.status(500).json({ status: 'error', message: 'Error replying message' });
338
+ return res.status(500).json({ status: 'error', message: 'Error replying message', error: e });
339
339
  }
340
340
  }
341
341
 
@@ -354,7 +354,7 @@ async function forwardMessages(req, res) {
354
354
  return res.status(201).json({ status: 'success', response: response });
355
355
  } catch (e) {
356
356
  req.logger.error(e);
357
- return res.status(500).json({ status: 'error', message: 'Error forwarding message' });
357
+ return res.status(500).json({ status: 'error', message: 'Error forwarding message', error: e });
358
358
  }
359
359
  }
360
360
 
@@ -366,7 +366,7 @@ async function markUnseenMessage(req, res) {
366
366
  return res.status(200).json({ status: 'success', response: { message: 'unseen checked' } });
367
367
  } catch (e) {
368
368
  req.logger.error(e);
369
- return res.status(500).json({ status: 'error', message: 'Error on mark unseen' });
369
+ return res.status(500).json({ status: 'error', message: 'Error on mark unseen', error: e });
370
370
  }
371
371
  }
372
372
 
@@ -378,7 +378,7 @@ async function blockContact(req, res) {
378
378
  return res.status(200).json({ status: 'success', response: { message: 'Contact blocked' } });
379
379
  } catch (e) {
380
380
  req.logger.error(e);
381
- return res.status(500).json({ status: 'error', message: 'Error on block contact' });
381
+ return res.status(500).json({ status: 'error', message: 'Error on block contact', error: e });
382
382
  }
383
383
  }
384
384
 
@@ -390,7 +390,7 @@ async function unblockContact(req, res) {
390
390
  return res.status(200).json({ status: 'success', response: { message: 'Contact UnBlocked' } });
391
391
  } catch (e) {
392
392
  req.logger.error(e);
393
- return res.status(500).json({ status: 'error', message: 'Error on unlock contact' });
393
+ return res.status(500).json({ status: 'error', message: 'Error on unlock contact', error: e });
394
394
  }
395
395
  }
396
396
 
@@ -405,7 +405,7 @@ async function pinChat(req, res) {
405
405
  return res.status(200).json({ status: 'success', response: { message: 'Chat fixed' } });
406
406
  } catch (e) {
407
407
  req.logger.error(e);
408
- return res.status(500).json({ status: 'error', message: e.text || 'Error on pin chat' });
408
+ return res.status(500).json({ status: 'error', message: e.text || 'Error on pin chat', error: e });
409
409
  }
410
410
  }
411
411
 
@@ -421,7 +421,7 @@ async function setProfilePic(req, res) {
421
421
  return res.status(200).json({ status: 'success', response: { message: 'Profile photo successfully changed' } });
422
422
  } catch (e) {
423
423
  req.logger.error(e);
424
- return res.status(500).json({ status: 'error', message: 'Error changing profile photo' });
424
+ return res.status(500).json({ status: 'error', message: 'Error changing profile photo', error: e });
425
425
  }
426
426
  }
427
427
 
@@ -431,7 +431,7 @@ async function getUnreadMessages(req, res) {
431
431
  return res.status(200).json({ status: 'success', response: response });
432
432
  } catch (e) {
433
433
  req.logger.error(e);
434
- return res.status(500).json({ status: 'error', response: 'Error on open list' });
434
+ return res.status(500).json({ status: 'error', response: 'Error on open list', error: e });
435
435
  }
436
436
  }
437
437
 
@@ -442,7 +442,7 @@ async function getChatIsOnline(req, res) {
442
442
  return res.status(200).json({ status: 'success', response: response });
443
443
  } catch (e) {
444
444
  req.logger.error(e);
445
- return res.status(500).json({ status: 'error', response: 'Error on get chat is online' });
445
+ return res.status(500).json({ status: 'error', response: 'Error on get chat is online', error: e });
446
446
  }
447
447
  }
448
448
 
@@ -454,7 +454,7 @@ async function getLastSeen(req, res) {
454
454
  return res.status(200).json({ status: 'success', response: response });
455
455
  } catch (error) {
456
456
  req.logger.error(error);
457
- return res.status(500).json({ status: 'error', response: 'Error on get chat last seen' });
457
+ return res.status(500).json({ status: 'error', response: 'Error on get chat last seen', error: error });
458
458
  }
459
459
  }
460
460
 
@@ -466,7 +466,7 @@ async function getListMutes(req, res) {
466
466
  return res.status(200).json({ status: 'success', response: response });
467
467
  } catch (error) {
468
468
  req.logger.error(error);
469
- return res.status(500).json({ status: 'error', response: 'Error on get list mutes' });
469
+ return res.status(500).json({ status: 'error', response: 'Error on get list mutes', error: error });
470
470
  }
471
471
  }
472
472
 
@@ -478,7 +478,7 @@ async function loadAndGetAllMessagesInChat(req, res) {
478
478
  return res.status(200).json({ status: 'success', response: response });
479
479
  } catch (error) {
480
480
  req.logger.error(error);
481
- return res.status(500).json({ status: 'error', response: 'Error on open list' });
481
+ return res.status(500).json({ status: 'error', response: 'Error on open list', error: error });
482
482
  }
483
483
  }
484
484
  async function getMessages(req, res) {
@@ -493,7 +493,7 @@ async function getMessages(req, res) {
493
493
  return res.status(200).json({ status: 'success', response: response });
494
494
  } catch (e) {
495
495
  req.logger.error(e);
496
- return res.status(401).json({ status: 'error', response: 'Error on open list' });
496
+ return res.status(401).json({ status: 'error', response: 'Error on open list', error: e });
497
497
  }
498
498
  }
499
499
 
@@ -508,7 +508,7 @@ async function sendContactVcard(req, res) {
508
508
  return res.status(200).json({ status: 'success', response: response });
509
509
  } catch (error) {
510
510
  req.logger.error(error);
511
- return res.status(500).json({ status: 'error', message: 'Error on send contact vcard' });
511
+ return res.status(500).json({ status: 'error', message: 'Error on send contact vcard', error: error });
512
512
  }
513
513
  }
514
514
 
@@ -524,7 +524,7 @@ async function sendMute(req, res) {
524
524
  return res.status(200).json({ status: 'success', response: response });
525
525
  } catch (error) {
526
526
  req.logger.error(error);
527
- return res.status(500).json({ status: 'error', message: 'Error on send mute' });
527
+ return res.status(500).json({ status: 'error', message: 'Error on send mute', error: error });
528
528
  }
529
529
  }
530
530
 
@@ -555,7 +555,7 @@ async function setChatState(req, res) {
555
555
  return res.status(200).json({ status: 'success', response: response });
556
556
  } catch (error) {
557
557
  req.logger.error(error);
558
- return res.status(500).json({ status: 'error', message: 'Error on send chat state' });
558
+ return res.status(500).json({ status: 'error', message: 'Error on send chat state', error: error });
559
559
  }
560
560
  }
561
561
 
@@ -571,7 +571,7 @@ async function setTemporaryMessages(req, res) {
571
571
  return res.status(200).json({ status: 'success', response: response });
572
572
  } catch (error) {
573
573
  req.logger.error(error);
574
- return res.status(500).json({ status: 'error', message: 'Error on set temporary messages' });
574
+ return res.status(500).json({ status: 'error', message: 'Error on set temporary messages', error: error });
575
575
  }
576
576
  }
577
577
 
@@ -587,7 +587,7 @@ async function setTyping(req, res) {
587
587
  return res.status(200).json({ status: 'success', response: response });
588
588
  } catch (error) {
589
589
  req.logger.error(error);
590
- return res.status(500).json({ status: 'error', message: 'Error on set typing' });
590
+ return res.status(500).json({ status: 'error', message: 'Error on set typing', error: error });
591
591
  }
592
592
  }
593
593
 
@@ -603,7 +603,7 @@ async function setRecording(req, res) {
603
603
  return res.status(200).json({ status: 'success', response: response });
604
604
  } catch (error) {
605
605
  req.logger.error(error);
606
- return res.status(500).json({ status: 'error', message: 'Error on set recording' });
606
+ return res.status(500).json({ status: 'error', message: 'Error on set recording', error: error });
607
607
  }
608
608
  }
609
609
 
@@ -618,7 +618,7 @@ async function checkNumberStatus(req, res) {
618
618
  return res.status(200).json({ status: 'success', response: response });
619
619
  } catch (error) {
620
620
  req.logger.error(error);
621
- return res.status(500).json({ status: 'error', message: 'Error on check number status' });
621
+ return res.status(500).json({ status: 'error', message: 'Error on check number status', error: error });
622
622
  }
623
623
  }
624
624
 
@@ -633,7 +633,7 @@ async function getContact(req, res) {
633
633
  return res.status(200).json({ status: 'success', response: response });
634
634
  } catch (error) {
635
635
  req.logger.error(error);
636
- return res.status(500).json({ status: 'error', message: 'Error on get contact' });
636
+ return res.status(500).json({ status: 'error', message: 'Error on get contact', error: error });
637
637
  }
638
638
  }
639
639
 
@@ -644,7 +644,7 @@ async function getAllContacts(req, res) {
644
644
  return res.status(200).json({ status: 'success', response: response });
645
645
  } catch (error) {
646
646
  req.logger.error(error);
647
- return res.status(500).json({ status: 'error', message: 'Error on get all constacts' });
647
+ return res.status(500).json({ status: 'error', message: 'Error on get all constacts', error: error });
648
648
  }
649
649
  }
650
650
 
@@ -659,7 +659,7 @@ async function getNumberProfile(req, res) {
659
659
  return res.status(200).json({ status: 'success', response: response });
660
660
  } catch (error) {
661
661
  req.logger.error(error);
662
- return res.status(500).json({ status: 'error', message: 'Error on get number profile' });
662
+ return res.status(500).json({ status: 'error', message: 'Error on get number profile', error: error });
663
663
  }
664
664
  }
665
665
 
@@ -674,7 +674,7 @@ async function getProfilePicFromServer(req, res) {
674
674
  return res.status(200).json({ status: 'success', response: response });
675
675
  } catch (error) {
676
676
  req.logger.error(error);
677
- return res.status(500).json({ status: 'error', message: 'Error on get profile pic' });
677
+ return res.status(500).json({ status: 'error', message: 'Error on get profile pic', error: error });
678
678
  }
679
679
  }
680
680
 
@@ -688,7 +688,7 @@ async function getStatus(req, res) {
688
688
  return res.status(200).json({ status: 'success', response: response });
689
689
  } catch (error) {
690
690
  req.logger.error(error);
691
- return res.status(500).json({ status: 'error', message: 'Error on get status' });
691
+ return res.status(500).json({ status: 'error', message: 'Error on get status', error: error });
692
692
  }
693
693
  }
694
694
 
@@ -711,7 +711,7 @@ async function rejectCall(req, res) {
711
711
  return res.status(200).json({ status: 'success', response: response });
712
712
  } catch (e) {
713
713
  req.logger.error(e);
714
- return res.status(500).json({ status: 'error', message: 'Error on rejectCall' });
714
+ return res.status(500).json({ status: 'error', message: 'Error on rejectCall', error: e });
715
715
  }
716
716
  }
717
717
 
@@ -723,7 +723,7 @@ async function starMessage(req, res) {
723
723
  return res.status(200).json({ status: 'success', response: response });
724
724
  } catch (error) {
725
725
  req.logger.error(error);
726
- return res.status(500).json({ status: 'error', message: 'Error on start message' });
726
+ return res.status(500).json({ status: 'error', message: 'Error on start message', error: error });
727
727
  }
728
728
  }
729
729
 
@@ -735,7 +735,7 @@ async function getReactions(req, res) {
735
735
  return res.status(200).json({ status: 'success', response: response });
736
736
  } catch (error) {
737
737
  req.logger.error(error);
738
- return res.status(500).json({ status: 'error', message: 'Error on get reactions' });
738
+ return res.status(500).json({ status: 'error', message: 'Error on get reactions', error: error });
739
739
  }
740
740
  }
741
741
 
@@ -747,7 +747,7 @@ async function getVotes(req, res) {
747
747
  return res.status(200).json({ status: 'success', response: response });
748
748
  } catch (error) {
749
749
  req.logger.error(error);
750
- return res.status(500).json({ status: 'error', message: 'Error on get votes' });
750
+ return res.status(500).json({ status: 'error', message: 'Error on get votes', error: error });
751
751
  }
752
752
  }
753
753
  async function chatWoot(req, res) {
@@ -785,7 +785,7 @@ async function chatWoot(req, res) {
785
785
  }
786
786
  } catch (e) {
787
787
  console.log(e);
788
- return res.status(400).json({ status: 'error', message: 'Error on receive chatwoot' });
788
+ return res.status(400).json({ status: 'error', message: 'Error on receive chatwoot', error: e });
789
789
  }
790
790
  }
791
791
  //# sourceMappingURL=deviceController.js.map