@wppconnect/server 1.6.3 → 1.6.4
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
|
@@ -29,7 +29,7 @@ var _functions = require("../util/functions"); /*
|
|
|
29
29
|
* See the License for the specific language governing permissions and
|
|
30
30
|
* limitations under the License.
|
|
31
31
|
*/async function statusConnection(req, res, next) {try {if (req.client && req.client.isConnected) {await req.client.isConnected();let localArr = (0, _functions.contactToArray)(req.body.phone || [], req.body.isGroup);let index = 0;for (const contact of localArr) {if (req.body.isGroup) {localArr[index] = contact;} else if (numbers.indexOf(contact) < 0) {let profile = await req.client.checkNumberStatus(contact).catch((error) => console.log(error));
|
|
32
|
-
if (!profile
|
|
32
|
+
if (!profile?.numberExists) {
|
|
33
33
|
const num = contact.split('@')[0];
|
|
34
34
|
return res.status(400).json({
|
|
35
35
|
response: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusConnection.js","names":["statusConnection","req","res","next","client","isConnected","localArr","contactToArray","body","phone","isGroup","index","contact","numbers","indexOf","profile","checkNumberStatus","catch","error","console","log","numberExists","num","split","status","json","response","message","id","_serialized","push","logger"],"sources":["../../src/middleware/statusConnection.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 */\n\nimport { contactToArray } from '../util/functions';\n\nexport default async function statusConnection(req, res, next) {\n try {\n if (req.client && req.client.isConnected) {\n await req.client.isConnected();\n\n let localArr = contactToArray(req.body.phone || [], req.body.isGroup);\n\n let index = 0;\n for (const contact of localArr) {\n if (req.body.isGroup) {\n localArr[index] = contact;\n } else if (numbers.indexOf(contact) < 0) {\n let profile = await req.client.checkNumberStatus(contact).catch((error) => console.log(error));\n if (!profile
|
|
1
|
+
{"version":3,"file":"statusConnection.js","names":["statusConnection","req","res","next","client","isConnected","localArr","contactToArray","body","phone","isGroup","index","contact","numbers","indexOf","profile","checkNumberStatus","catch","error","console","log","numberExists","num","split","status","json","response","message","id","_serialized","push","logger"],"sources":["../../src/middleware/statusConnection.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 */\n\nimport { contactToArray } from '../util/functions';\n\nexport default async function statusConnection(req, res, next) {\n try {\n if (req.client && req.client.isConnected) {\n await req.client.isConnected();\n\n let localArr = contactToArray(req.body.phone || [], req.body.isGroup);\n\n let index = 0;\n for (const contact of localArr) {\n if (req.body.isGroup) {\n localArr[index] = contact;\n } else if (numbers.indexOf(contact) < 0) {\n let profile = await req.client.checkNumberStatus(contact).catch((error) => console.log(error));\n if (!profile?.numberExists) {\n const num = contact.split('@')[0];\n return res.status(400).json({\n response: null,\n status: 'Connected',\n message: `O número ${num} não existe.`,\n });\n } else {\n if (numbers.indexOf(profile.id._serialized) < 0) {\n numbers.push(profile.id._serialized);\n }\n localArr[index] = profile.id._serialized;\n }\n }\n index++;\n }\n req.body.phone = localArr;\n } else {\n return res.status(404).json({\n response: null,\n status: 'Disconnected',\n message: 'A sessão do WhatsApp não está ativa.',\n });\n }\n next();\n } catch (error) {\n req.logger.error(error);\n return res.status(404).json({\n response: null,\n status: 'Disconnected',\n message: 'A sessão do WhatsAp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CAAP;;UAKD,CAPD,MAOO;YACL,IAAIT,OAAO,CAACC,OAAR,CAAgBC,OAAO,CAACa,EAAR,CAAWC,WAA3B,IAA0C,CAA9C,EAAiD;cAC/ChB,OAAO,CAACiB,IAAR,CAAaf,OAAO,CAACa,EAAR,CAAWC,WAAxB;YACD;YACDvB,QAAQ,CAACK,KAAD,CAAR,GAAkBI,OAAO,CAACa,EAAR,CAAWC,WAA7B;UACD;QACF;QACDlB,KAAK;MACN;MACDV,GAAG,CAACO,IAAJ,CAASC,KAAT,GAAiBH,QAAjB;IACD,CA5BD,MA4BO;MACL,OAAOJ,GAAG,CAACsB,MAAJ,CAAW,GAAX,EAAgBC,IAAhB,CAAqB;QAC1BC,QAAQ,EAAE,IADgB;QAE1BF,MAAM,EAAE,cAFkB;QAG1BG,OAAO,EAAE,sCAHiB,EAArB,CAAP;;IAKD;IACDxB,IAAI;EACL,CArCD,CAqCE,OAAOe,KAAP,EAAc;IACdjB,GAAG,CAAC8B,MAAJ,CAAWb,KAAX,CAAiBA,KAAjB;IACA,OAAOhB,GAAG,CAACsB,MAAJ,CAAW,GAAX,EAAgBC,IAAhB,CAAqB;MAC1BC,QAAQ,EAAE,IADgB;MAE1BF,MAAM,EAAE,cAFkB;MAG1BG,OAAO,EAAE,sCAHiB,EAArB,CAAP;;EAKD;AACF;AACD,IAAId,OAAO,GAAG,EAAd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect/server",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4",
|
|
4
4
|
"description": "Projeto feito para autenticar a automomacao do WhatsappWeb com multi-clientes de forma dinamica. Backend feito em Nodejs(express, socketio), FrontEnd (ReactJS)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": "kingaspx",
|
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@wppconnect-team/wppconnect": "^1.
|
|
32
|
+
"@wppconnect-team/wppconnect": "^1.18.1",
|
|
33
33
|
"axios": "^0.27.0",
|
|
34
34
|
"bcrypt": "^5.1.0",
|
|
35
35
|
"buffer-to-stream": "1.0.0",
|
|
36
36
|
"cors": "^2.8.5",
|
|
37
37
|
"dotenv": "^16.0.3",
|
|
38
|
-
"express": "^4.18.
|
|
38
|
+
"express": "^4.18.2",
|
|
39
39
|
"express-query-boolean": "^2.0.0",
|
|
40
40
|
"form-data": "^4.0.0",
|
|
41
41
|
"json-mapper-json": "^1.3.3",
|
|
42
42
|
"merge-deep": "^3.0.3",
|
|
43
43
|
"moment": "^2.29.4",
|
|
44
44
|
"multer": "^1.4.4",
|
|
45
|
-
"socket.io": "^4.5.
|
|
45
|
+
"socket.io": "^4.5.3",
|
|
46
46
|
"swagger-ui-express": "^4.5.0",
|
|
47
47
|
"winston": "^3.8.2"
|
|
48
48
|
},
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"@babel/eslint-plugin": "^7.19.1",
|
|
54
54
|
"@babel/node": "^7.19.1",
|
|
55
55
|
"@babel/plugin-transform-runtime": "^7.19.1",
|
|
56
|
-
"@babel/preset-env": "^7.19.
|
|
56
|
+
"@babel/preset-env": "^7.19.4",
|
|
57
57
|
"@commitlint/cli": "^17.1.2",
|
|
58
58
|
"@commitlint/config-conventional": "^17.1.0",
|
|
59
59
|
"@commitlint/cz-commitlint": "^17.1.2",
|
|
60
|
-
"aws-sdk": "^2.
|
|
60
|
+
"aws-sdk": "^2.1236.0",
|
|
61
61
|
"commitizen": "^4.2.5",
|
|
62
62
|
"conventional-changelog-cli": "^2.2.2",
|
|
63
63
|
"crypto-js": "^4.1.1",
|
|
64
|
-
"eslint": "^8.
|
|
64
|
+
"eslint": "^8.25.0",
|
|
65
65
|
"eslint-config-prettier": "^8.5.0",
|
|
66
66
|
"eslint-plugin-prettier": "^4.2.1",
|
|
67
67
|
"husky": "^8.0.1",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"release-it": "^15.5.0",
|
|
75
75
|
"rimraf": "^3.0.2",
|
|
76
76
|
"shx": "^0.3.4",
|
|
77
|
-
"swagger-ui-dist": "^4.14.
|
|
77
|
+
"swagger-ui-dist": "^4.14.3",
|
|
78
78
|
"webpack-cli": "^4.10.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"aws-sdk": "^2.
|
|
81
|
+
"aws-sdk": "^2.1236.0",
|
|
82
82
|
"crypto-js": "^4.1.1",
|
|
83
83
|
"mongoose": "^6.6.5",
|
|
84
84
|
"redis": "^4.3.1"
|