@wppconnect-team/wppconnect 1.32.3 → 1.33.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 +8 -0
- package/dist/api/helpers/base64-mimetype.js +1 -2
- package/dist/api/helpers/decrypt.d.ts +0 -1
- package/dist/api/helpers/download-file.js +1 -2
- package/dist/api/helpers/evaluate-and-return.js +1 -2
- package/dist/api/helpers/file-to-base64.js +2 -3
- package/dist/api/helpers/filename-from-mimetype.js +1 -2
- package/dist/api/helpers/scrape-img-qr.js +1 -2
- package/dist/api/helpers/scrape-login.js +1 -2
- package/dist/api/helpers/select-sticker.d.ts +0 -1
- package/dist/api/helpers/select-sticker.js +2 -3
- package/dist/api/layers/catalog.layer.d.ts +24 -1
- package/dist/api/layers/group.layer.d.ts +15 -11
- package/dist/api/layers/group.layer.js +8 -4
- package/dist/api/layers/host.layer.d.ts +0 -1
- package/dist/api/layers/profile.layer.d.ts +5 -0
- package/dist/api/layers/profile.layer.js +7 -0
- package/dist/api/layers/sender.layer.d.ts +8 -3
- package/dist/api/layers/sender.layer.js +8 -3
- package/dist/api/layers/ui.layer.d.ts +6 -0
- package/dist/api/layers/ui.layer.js +12 -0
- package/dist/api/model/contact.d.ts +1 -2
- package/dist/api/model/group-metadata.d.ts +25 -0
- package/dist/api/model/message.d.ts +40 -3
- package/dist/api/whatsapp.d.ts +11 -12
- package/dist/api/whatsapp.js +11 -11
- package/dist/config/create-config.js +1 -1
- package/dist/controllers/auth.js +2 -2
- package/dist/controllers/browser.js +7 -8
- package/dist/controllers/initializer.js +1 -2
- package/dist/controllers/welcome.js +2 -3
- package/dist/lib/wapi/wapi.js +1 -1
- package/dist/token-store/fileTokenStore.d.ts +0 -1
- package/dist/token-store/isValidSessionToken.js +1 -2
- package/dist/token-store/isValidTokenStore.js +1 -2
- package/dist/utils/ffmpeg.js +2 -3
- package/dist/utils/semver.js +1 -2
- package/dist/utils/sleep.js +1 -2
- package/package.json +20 -20
package/dist/api/whatsapp.js
CHANGED
|
@@ -199,7 +199,7 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
199
199
|
});
|
|
200
200
|
/**
|
|
201
201
|
* Get the puppeteer page screenshot
|
|
202
|
-
* @returns The Whatsapp page screenshot encoded in base64
|
|
202
|
+
* @returns The Whatsapp page screenshot as a PNG encoded in base64 (not the full data URI, just the base64 section)
|
|
203
203
|
*/
|
|
204
204
|
Whatsapp.prototype.takeScreenshot = function () {
|
|
205
205
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -215,10 +215,10 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
215
215
|
});
|
|
216
216
|
};
|
|
217
217
|
/**
|
|
218
|
-
* Clicks on 'use here' button (When it
|
|
218
|
+
* Clicks on 'use here' button (When it gets unlaunched)
|
|
219
219
|
* This method tracks the class of the button
|
|
220
|
-
*
|
|
221
|
-
*
|
|
220
|
+
* WhatsApp Web might change this class name over time
|
|
221
|
+
* Don't rely on this method
|
|
222
222
|
*/
|
|
223
223
|
Whatsapp.prototype.useHere = function () {
|
|
224
224
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -231,7 +231,7 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
231
231
|
});
|
|
232
232
|
};
|
|
233
233
|
/**
|
|
234
|
-
* Logout
|
|
234
|
+
* Logout WhatsApp
|
|
235
235
|
* @returns boolean
|
|
236
236
|
*/
|
|
237
237
|
Whatsapp.prototype.logout = function () {
|
|
@@ -293,9 +293,9 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
293
293
|
});
|
|
294
294
|
};
|
|
295
295
|
/**
|
|
296
|
-
*
|
|
297
|
-
* @param chatId string ID
|
|
298
|
-
* @param params GetMessagesParam
|
|
296
|
+
* Returns a list of messages from a chat
|
|
297
|
+
* @param chatId string ID of the conversation or group
|
|
298
|
+
* @param params GetMessagesParam Result filtering options (count, id, direction) see {@link GetMessagesParam}.
|
|
299
299
|
* @returns Message object
|
|
300
300
|
*/
|
|
301
301
|
Whatsapp.prototype.getMessages = function (chatId_1) {
|
|
@@ -357,9 +357,9 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
357
357
|
});
|
|
358
358
|
};
|
|
359
359
|
/**
|
|
360
|
-
*
|
|
361
|
-
* @param callId string ID
|
|
362
|
-
* @returns
|
|
360
|
+
* Rejects a call received via WhatsApp
|
|
361
|
+
* @param callId string Call ID, if not passed, all calls will be rejected
|
|
362
|
+
* @returns Number of rejected calls
|
|
363
363
|
*/
|
|
364
364
|
Whatsapp.prototype.rejectCall = function (callId) {
|
|
365
365
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -20,7 +20,7 @@ exports.defaultOptions = {
|
|
|
20
20
|
waitForLogin: true,
|
|
21
21
|
logger: logger_1.defaultLogger,
|
|
22
22
|
tokenStore: 'file',
|
|
23
|
-
whatsappVersion: '2.3000.
|
|
23
|
+
whatsappVersion: '2.3000.10152x',
|
|
24
24
|
deviceName: false,
|
|
25
25
|
linkPreviewApiServers: null,
|
|
26
26
|
disableGoogleAnalytics: true,
|
package/dist/controllers/auth.js
CHANGED
|
@@ -75,7 +75,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
-
exports.
|
|
78
|
+
exports.isConnectingToPhone = exports.isInsideChat = exports.needsToScan = exports.isAuthenticated = exports.getInterfaceStatus = void 0;
|
|
79
|
+
exports.asciiQr = asciiQr;
|
|
79
80
|
var qrcode = __importStar(require("qrcode-terminal"));
|
|
80
81
|
var getInterfaceStatus = function (waPage) { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
82
|
return __generator(this, function (_a) {
|
|
@@ -165,4 +166,3 @@ function asciiQr(code) {
|
|
|
165
166
|
});
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
exports.asciiQr = asciiQr;
|
|
@@ -98,7 +98,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
98
98
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
99
99
|
};
|
|
100
100
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101
|
-
exports.
|
|
101
|
+
exports.unregisterServiceWorker = unregisterServiceWorker;
|
|
102
|
+
exports.setWhatsappVersion = setWhatsappVersion;
|
|
103
|
+
exports.initWhatsapp = initWhatsapp;
|
|
104
|
+
exports.onLoadingScreen = onLoadingScreen;
|
|
105
|
+
exports.injectApi = injectApi;
|
|
106
|
+
exports.initBrowser = initBrowser;
|
|
107
|
+
exports.getOrCreatePage = getOrCreatePage;
|
|
102
108
|
var ChromeLauncher = __importStar(require("chrome-launcher"));
|
|
103
109
|
var os = __importStar(require("os"));
|
|
104
110
|
var path = __importStar(require("path"));
|
|
@@ -140,7 +146,6 @@ function unregisterServiceWorker(page) {
|
|
|
140
146
|
});
|
|
141
147
|
});
|
|
142
148
|
}
|
|
143
|
-
exports.unregisterServiceWorker = unregisterServiceWorker;
|
|
144
149
|
/**
|
|
145
150
|
* Força o carregamento de uma versão específica do WhatsApp WEB
|
|
146
151
|
* @param page Página a ser injetada
|
|
@@ -184,7 +189,6 @@ function setWhatsappVersion(page, version, log) {
|
|
|
184
189
|
});
|
|
185
190
|
});
|
|
186
191
|
}
|
|
187
|
-
exports.setWhatsappVersion = setWhatsappVersion;
|
|
188
192
|
function initWhatsapp(page_1, token_1) {
|
|
189
193
|
return __awaiter(this, arguments, void 0, function (page, token, clear, version, log) {
|
|
190
194
|
if (clear === void 0) { clear = true; }
|
|
@@ -231,7 +235,6 @@ function initWhatsapp(page_1, token_1) {
|
|
|
231
235
|
});
|
|
232
236
|
});
|
|
233
237
|
}
|
|
234
|
-
exports.initWhatsapp = initWhatsapp;
|
|
235
238
|
var lastPercent = null;
|
|
236
239
|
var lastPercentMessage = null;
|
|
237
240
|
function onLoadingScreen(page, onLoadingScreenCallBack) {
|
|
@@ -287,7 +290,6 @@ function onLoadingScreen(page, onLoadingScreenCallBack) {
|
|
|
287
290
|
});
|
|
288
291
|
});
|
|
289
292
|
}
|
|
290
|
-
exports.onLoadingScreen = onLoadingScreen;
|
|
291
293
|
function injectApi(page, onLoadingScreenCallBack) {
|
|
292
294
|
return __awaiter(this, void 0, void 0, function () {
|
|
293
295
|
var injected;
|
|
@@ -340,7 +342,6 @@ function injectApi(page, onLoadingScreenCallBack) {
|
|
|
340
342
|
});
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
|
-
exports.injectApi = injectApi;
|
|
344
345
|
/**
|
|
345
346
|
* Initializes browser, will try to use chrome as default
|
|
346
347
|
* @param session
|
|
@@ -412,7 +413,6 @@ function initBrowser(session, options, logger) {
|
|
|
412
413
|
});
|
|
413
414
|
});
|
|
414
415
|
}
|
|
415
|
-
exports.initBrowser = initBrowser;
|
|
416
416
|
function getOrCreatePage(browser) {
|
|
417
417
|
return __awaiter(this, void 0, void 0, function () {
|
|
418
418
|
var pages;
|
|
@@ -430,7 +430,6 @@ function getOrCreatePage(browser) {
|
|
|
430
430
|
});
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
exports.getOrCreatePage = getOrCreatePage;
|
|
434
433
|
/**
|
|
435
434
|
* Retrieves chrome instance path
|
|
436
435
|
*/
|
|
@@ -89,7 +89,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
89
89
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
90
90
|
};
|
|
91
91
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
92
|
-
exports.create =
|
|
92
|
+
exports.create = create;
|
|
93
93
|
var whatsapp_1 = require("../api/whatsapp");
|
|
94
94
|
var create_config_1 = require("../config/create-config");
|
|
95
95
|
var browser_1 = require("./browser");
|
|
@@ -318,4 +318,3 @@ function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, catchLink
|
|
|
318
318
|
});
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
exports.create = create;
|
|
@@ -39,7 +39,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
42
|
+
exports.welcomeScreen = welcomeScreen;
|
|
43
|
+
exports.checkUpdates = checkUpdates;
|
|
43
44
|
/*
|
|
44
45
|
* This file is part of WPPConnect.
|
|
45
46
|
*
|
|
@@ -72,7 +73,6 @@ function welcomeScreen() {
|
|
|
72
73
|
welcomeShown = true;
|
|
73
74
|
logger_1.defaultLogger.info("\n _ ______ ____ ______ __ \n | | / / __ \\/ __ \\/ ____/___ ____ ____ ___ _____/ /_\n | | /| / / /_/ / /_/ / / / __ \\/ __ \\/ __ \\/ _ \\/ ___/ __/\n | |/ |/ / ____/ ____/ /___/ /_/ / / / / / / / __/ /__/ /_ \n |__/|__/_/ /_/ \\____/\\____/_/ /_/_/ /_/\\___/\\___/\\__/");
|
|
74
75
|
}
|
|
75
|
-
exports.welcomeScreen = welcomeScreen;
|
|
76
76
|
function checkUpdates() {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function () {
|
|
78
78
|
return __generator(this, function (_a) {
|
|
@@ -89,7 +89,6 @@ function checkUpdates() {
|
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
exports.checkUpdates = checkUpdates;
|
|
93
92
|
/**
|
|
94
93
|
* Checks for a new version of WPPConnect and logs the result
|
|
95
94
|
*/
|