@open-wa/wa-automate 4.53.0 → 4.54.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/api/Client.js
CHANGED
@@ -1262,8 +1262,8 @@ class Client {
|
|
1262
1262
|
if (this._currentlyBeingKilled)
|
1263
1263
|
return;
|
1264
1264
|
this._currentlyBeingKilled = true;
|
1265
|
-
console.log(
|
1266
|
-
logging_1.log.info(
|
1265
|
+
console.log(`Killing client. Shutting Down: ${reason}`);
|
1266
|
+
logging_1.log.info(`Killing client. Shutting Down: ${reason}`);
|
1267
1267
|
const browser = yield ((_a = this === null || this === void 0 ? void 0 : this._page) === null || _a === void 0 ? void 0 : _a.browser());
|
1268
1268
|
const pid = (browser === null || browser === void 0 ? void 0 : browser.process()) ? (_b = browser === null || browser === void 0 ? void 0 : browser.process()) === null || _b === void 0 ? void 0 : _b.pid : null;
|
1269
1269
|
try {
|
@@ -1676,6 +1676,7 @@ class Client {
|
|
1676
1676
|
}))(),
|
1677
1677
|
(0, tools_1.assertFile)(file, filename, tools_1.FileOutputTypes.TEMP_FILE_PATH, requestConfig || {})
|
1678
1678
|
]);
|
1679
|
+
//@ts-ignore
|
1679
1680
|
yield inputElement.uploadFile(fileAsLocalTemp);
|
1680
1681
|
file = inputElementId;
|
1681
1682
|
/**
|
@@ -2246,7 +2247,8 @@ class Client {
|
|
2246
2247
|
*/
|
2247
2248
|
getTunnelCode() {
|
2248
2249
|
return __awaiter(this, void 0, void 0, function* () {
|
2249
|
-
|
2250
|
+
const sessionId = this.getSessionId();
|
2251
|
+
return yield this.pup(sessionId => WAPI.getTunnelCode(sessionId), sessionId);
|
2250
2252
|
});
|
2251
2253
|
}
|
2252
2254
|
/**
|
package/dist/cli/index.js
CHANGED
@@ -42,6 +42,8 @@ function start() {
|
|
42
42
|
const { cliConfig, createConfig, PORT, spinner } = yield (0, setup_1.cli)();
|
43
43
|
process.env.OWA_CLI = "true";
|
44
44
|
spinner.start("Launching EASY API");
|
45
|
+
if (cliConfig.verbose)
|
46
|
+
index_1.log.info(`config: `, { cliConfig, createConfig, PORT });
|
45
47
|
(0, server_1.setUpExpressApp)();
|
46
48
|
if (cliConfig.cors)
|
47
49
|
yield (0, server_1.enableCORSRequests)(cliConfig);
|
@@ -201,7 +203,7 @@ function start() {
|
|
201
203
|
spinner.info(`\n• Setting up external tunnel`);
|
202
204
|
const tunnel = yield (0, localtunnel_1.default)({
|
203
205
|
port: PORT,
|
204
|
-
host: "https://public.openwa.cloud",
|
206
|
+
host: process.env.WA_TUNNEL_SERVER || "https://public.openwa.cloud",
|
205
207
|
subdomain: yield client.getTunnelCode()
|
206
208
|
});
|
207
209
|
cliConfig.apiHost = cliConfig.tunnel = tunnel.url;
|
@@ -311,6 +311,7 @@ const setupChatwootOutgoingMessageHandler = (cliConfig, client) => __awaiter(voi
|
|
311
311
|
}
|
312
312
|
});
|
313
313
|
const sendConversationMessage = (content, contactId, message) => __awaiter(void 0, void 0, void 0, function* () {
|
314
|
+
__1.log.info(`INCOMING MESSAGE ${contactId}: ${content} ${message.id}`);
|
314
315
|
try {
|
315
316
|
const { data } = yield cwReq('post', `conversations/${convoReg[contactId]}/messages`, {
|
316
317
|
content,
|
@@ -326,6 +327,7 @@ const setupChatwootOutgoingMessageHandler = (cliConfig, client) => __awaiter(voi
|
|
326
327
|
const sendAttachmentMessage = (content, contactId, message) => __awaiter(void 0, void 0, void 0, function* () {
|
327
328
|
// decrypt message
|
328
329
|
const file = yield client.decryptMedia(message);
|
330
|
+
__1.log.info(`INCOMING MESSAGE ATTACHMENT ${contactId}: ${content} ${message.id}`);
|
329
331
|
let formData = new form_data_1.default();
|
330
332
|
formData.append('attachments[]', Buffer.from(file.split(',')[1], 'base64'), {
|
331
333
|
knownLength: 1,
|
package/dist/controllers/auth.js
CHANGED
@@ -231,7 +231,7 @@ class QRManager {
|
|
231
231
|
}
|
232
232
|
if (!gotResult && (qrData === 'QR_CODE_SUCCESS' || qrData === md)) {
|
233
233
|
gotResult = true;
|
234
|
-
spinner === null || spinner === void 0 ? void 0 : spinner.succeed(
|
234
|
+
spinner === null || spinner === void 0 ? void 0 : spinner.succeed("QR code scanned. Loading session...");
|
235
235
|
return resolve(yield isInsideChat(waPage).toPromise());
|
236
236
|
}
|
237
237
|
if (!gotResult)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@open-wa/wa-automate",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.54.0",
|
4
4
|
"licenseCheckUrl": "https://funcs.openwa.dev/license-check",
|
5
5
|
"brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
|
6
6
|
"patches": "https://cdn.openwa.dev/patches.json",
|
@@ -76,7 +76,7 @@
|
|
76
76
|
"@types/marked": "^4.0.2",
|
77
77
|
"@types/mime": "^3.0.1",
|
78
78
|
"@types/node": "^18.7.6",
|
79
|
-
"@types/puppeteer": "^
|
79
|
+
"@types/puppeteer": "^7.0.4",
|
80
80
|
"@types/shelljs": "^0.8.5",
|
81
81
|
"@types/winston-syslog": "^2.4.0",
|
82
82
|
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
@@ -154,17 +154,17 @@
|
|
154
154
|
"pidtree": "^0.6.0",
|
155
155
|
"pidusage": "^3.0.0",
|
156
156
|
"postman-2-swagger": "^0.5.0",
|
157
|
-
"puppeteer": "
|
158
|
-
"puppeteer-extra": "^3.
|
159
|
-
"puppeteer-extra-plugin-block-resources": "^2.4.
|
160
|
-
"puppeteer-extra-plugin-devtools": "^2.4.
|
161
|
-
"puppeteer-extra-plugin-stealth": "^2.
|
157
|
+
"puppeteer": "^19.4.1",
|
158
|
+
"puppeteer-extra": "^3.3.4",
|
159
|
+
"puppeteer-extra-plugin-block-resources": "^2.4.2",
|
160
|
+
"puppeteer-extra-plugin-devtools": "^2.4.4",
|
161
|
+
"puppeteer-extra-plugin-stealth": "^2.11.1",
|
162
162
|
"qrcode-terminal": "^0.12.0",
|
163
163
|
"qs": "^6.10.1",
|
164
164
|
"rxjs": "^7.0.0",
|
165
165
|
"smashah-puppeteer-page-proxy": "^1.2.8",
|
166
|
-
"socket.io": "^4.4
|
167
|
-
"socket.io-client": "^4.
|
166
|
+
"socket.io": "^4.5.4",
|
167
|
+
"socket.io-client": "^4.5.4",
|
168
168
|
"spinnies": "^0.5.1",
|
169
169
|
"swagger-stats": "^0.99.1",
|
170
170
|
"swagger-ui-dist": "^4.1.3",
|