@wppconnect-team/wppconnect 1.10.2 → 1.12.0
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 +31 -0
- package/dist/api/helpers/decrypt.js +1 -1
- package/dist/api/helpers/download-file.js +3 -3
- package/dist/api/helpers/evaluate-and-return.js +1 -1
- package/dist/api/helpers/file-to-base64.js +1 -1
- package/dist/api/helpers/index.d.ts +0 -1
- package/dist/api/helpers/index.js +1 -3
- package/dist/api/helpers/select-sticker.js +1 -1
- package/dist/api/layers/controls.layer.js +6 -1
- package/dist/api/layers/host.layer.js +6 -7
- package/dist/api/layers/listener.layer.js +2 -3
- package/dist/api/layers/retriever.layer.d.ts +4 -1
- package/dist/api/layers/retriever.layer.js +6 -1
- package/dist/api/layers/sender.layer.d.ts +46 -7
- package/dist/api/layers/sender.layer.js +134 -31
- package/dist/api/whatsapp.d.ts +1 -1
- package/dist/api/whatsapp.js +10 -12
- package/dist/config/create-config.d.ts +1 -1
- package/dist/config/create-config.js +1 -1
- package/dist/controllers/browser.js +2 -2
- package/dist/controllers/initializer.js +1 -1
- package/dist/controllers/welcome.js +3 -3
- package/dist/lib/wapi/wapi.js +1 -1
- package/dist/utils/ffmpeg.js +2 -2
- package/dist/utils/logger.js +1 -1
- package/package.json +30 -31
- package/dist/api/helpers/scrape-desconnect.d.ts +0 -7
- package/dist/api/helpers/scrape-desconnect.js +0 -78
package/dist/api/whatsapp.js
CHANGED
|
@@ -198,24 +198,22 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
198
198
|
*/
|
|
199
199
|
Whatsapp.prototype.downloadMedia = function (messageId) {
|
|
200
200
|
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var
|
|
201
|
+
var _this = this;
|
|
202
202
|
return __generator(this, function (_a) {
|
|
203
203
|
switch (_a.label) {
|
|
204
204
|
case 0:
|
|
205
205
|
if (typeof messageId !== 'string') {
|
|
206
206
|
messageId = messageId.id;
|
|
207
207
|
}
|
|
208
|
-
return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (messageId) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}
|
|
218
|
-
return [2 /*return*/, result];
|
|
208
|
+
return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (messageId) { return __awaiter(_this, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) {
|
|
209
|
+
switch (_c.label) {
|
|
210
|
+
case 0:
|
|
211
|
+
_b = (_a = WPP.util).blobToBase64;
|
|
212
|
+
return [4 /*yield*/, WPP.chat.downloadMedia(messageId)];
|
|
213
|
+
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
214
|
+
}
|
|
215
|
+
}); }); }, messageId)];
|
|
216
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
219
217
|
}
|
|
220
218
|
});
|
|
221
219
|
});
|
|
@@ -233,8 +233,9 @@ function injectApi(page) {
|
|
|
233
233
|
_a.sent();
|
|
234
234
|
return [4 /*yield*/, page
|
|
235
235
|
.waitForFunction(function () {
|
|
236
|
-
// @ts-ignore
|
|
237
236
|
return typeof window.WPP !== 'undefined' && window.WPP.isReady;
|
|
237
|
+
}, {
|
|
238
|
+
timeout: 60000,
|
|
238
239
|
})
|
|
239
240
|
.catch(function () { return false; })];
|
|
240
241
|
case 3:
|
|
@@ -253,7 +254,6 @@ function injectApi(page) {
|
|
|
253
254
|
_a.sent();
|
|
254
255
|
return [4 /*yield*/, page
|
|
255
256
|
.waitForFunction(function () {
|
|
256
|
-
// @ts-ignore
|
|
257
257
|
return (typeof window.WAPI !== 'undefined' &&
|
|
258
258
|
typeof window.Store !== 'undefined');
|
|
259
259
|
})
|
|
@@ -124,7 +124,7 @@ function create(sessionOrOption, catchQR, statusFind, options, browserSessionTok
|
|
|
124
124
|
logger.info('Initializing browser...', { session: session, type: 'browser' });
|
|
125
125
|
return [4 /*yield*/, (0, browser_1.initBrowser)(session, mergedOptions, logger).catch(function (e) {
|
|
126
126
|
if (mergedOptions.browserWS && mergedOptions.browserWS != '') {
|
|
127
|
-
logger.error("Error when try to connect "
|
|
127
|
+
logger.error("Error when try to connect ".concat(mergedOptions.browserWS), {
|
|
128
128
|
session: session,
|
|
129
129
|
type: 'browser',
|
|
130
130
|
});
|
|
@@ -126,9 +126,9 @@ function checkWPPConnectVersion() {
|
|
|
126
126
|
*/
|
|
127
127
|
function logUpdateAvailable(current, latest) {
|
|
128
128
|
// prettier-ignore
|
|
129
|
-
var newVersionLog = "There is a new version of "
|
|
129
|
+
var newVersionLog = "There is a new version of ".concat(chalk_1.default.bold("Wppconnect"), " ").concat(chalk_1.default.gray(current), " \u279C ").concat(chalk_1.default.bold.green(latest), "\n") +
|
|
130
130
|
"Update your package by running:\n\n" +
|
|
131
|
-
(chalk_1.default.bold('\>')
|
|
131
|
+
"".concat(chalk_1.default.bold('\>'), " ").concat(chalk_1.default.blueBright('npm update @wppconnect-team/wppconnect'));
|
|
132
132
|
logger_1.defaultLogger.info((0, boxen_1.default)(newVersionLog, { padding: 1 }));
|
|
133
|
-
logger_1.defaultLogger.info("For more info visit: "
|
|
133
|
+
logger_1.defaultLogger.info("For more info visit: ".concat(chalk_1.default.underline('https://github.com/wppconnect-team/wppconnect/blob/master/Update.md'), "\n"));
|
|
134
134
|
}
|