@wppconnect-team/wppconnect 1.32.3 → 1.32.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 +4 -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/group.layer.d.ts +7 -7
- package/dist/api/layers/host.layer.d.ts +0 -1
- package/dist/api/layers/sender.layer.d.ts +7 -2
- package/dist/api/layers/sender.layer.js +7 -2
- 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/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 +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## <small>1.32.4 (2024-07-16)</small>
|
|
2
|
+
|
|
3
|
+
- fix(deps): update dependency @wppconnect/wa-js to ^3.6.0 (#2275) ([4d56011](https://github.com/wppconnect-team/wppconnect/commit/4d56011)), closes [#2275](https://github.com/wppconnect-team/wppconnect/issues/2275)
|
|
4
|
+
|
|
1
5
|
## <small>1.32.3 (2024-06-24)</small>
|
|
2
6
|
|
|
3
7
|
- chore: upgrade @wppconnect/wa-js ([50775a8](https://github.com/wppconnect-team/wppconnect/commit/50775a8))
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.base64MimeType =
|
|
19
|
+
exports.base64MimeType = base64MimeType;
|
|
20
20
|
function base64MimeType(encoded) {
|
|
21
21
|
var result = null;
|
|
22
22
|
if (typeof encoded !== 'string') {
|
|
@@ -28,4 +28,3 @@ function base64MimeType(encoded) {
|
|
|
28
28
|
}
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
31
|
-
exports.base64MimeType = base64MimeType;
|
|
@@ -55,7 +55,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
55
55
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
56
|
};
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.downloadFileToBase64 =
|
|
58
|
+
exports.downloadFileToBase64 = downloadFileToBase64;
|
|
59
59
|
var axios_1 = __importDefault(require("axios"));
|
|
60
60
|
function downloadFileToBase64(_path_1) {
|
|
61
61
|
return __awaiter(this, arguments, void 0, function (_path, _mines) {
|
|
@@ -103,4 +103,3 @@ function downloadFileToBase64(_path_1) {
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
exports.downloadFileToBase64 = downloadFileToBase64;
|
|
@@ -61,7 +61,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
61
61
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
62
|
};
|
|
63
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
-
exports.evaluateAndReturn =
|
|
64
|
+
exports.evaluateAndReturn = evaluateAndReturn;
|
|
65
65
|
//EvaluateFn, EvaluateFnReturnType, SerializableOrJSHandle //
|
|
66
66
|
function evaluateAndReturn(page, pageFunction) {
|
|
67
67
|
var args = [];
|
|
@@ -115,4 +115,3 @@ function evaluateAndReturn(page, pageFunction) {
|
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
exports.evaluateAndReturn = evaluateAndReturn;
|
|
@@ -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.fileToBase64 = fileToBase64;
|
|
79
|
+
exports.Mine = Mine;
|
|
79
80
|
var mimeTypes = __importStar(require("mime-types"));
|
|
80
81
|
var fileType = __importStar(require("file-type"));
|
|
81
82
|
var fs = __importStar(require("fs"));
|
|
@@ -112,7 +113,6 @@ function fileToBase64(path, mime) {
|
|
|
112
113
|
});
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
|
-
exports.fileToBase64 = fileToBase64;
|
|
116
116
|
function Mine(path) {
|
|
117
117
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
118
|
var mime;
|
|
@@ -129,4 +129,3 @@ function Mine(path) {
|
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
exports.Mine = Mine;
|
|
@@ -39,7 +39,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
39
|
return result;
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.filenameFromMimeType =
|
|
42
|
+
exports.filenameFromMimeType = filenameFromMimeType;
|
|
43
43
|
var path = __importStar(require("path"));
|
|
44
44
|
var mime = __importStar(require("mime-types"));
|
|
45
45
|
function filenameFromMimeType(filename, mimeType) {
|
|
@@ -50,4 +50,3 @@ function filenameFromMimeType(filename, mimeType) {
|
|
|
50
50
|
}
|
|
51
51
|
return path.basename(filename, filenameExtension) + '.' + mimeExtension;
|
|
52
52
|
}
|
|
53
|
-
exports.filenameFromMimeType = filenameFromMimeType;
|
|
@@ -52,7 +52,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.scrapeImg =
|
|
55
|
+
exports.scrapeImg = scrapeImg;
|
|
56
56
|
function scrapeImg(page) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
58
58
|
var click, result;
|
|
@@ -105,4 +105,3 @@ function scrapeImg(page) {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
exports.scrapeImg = scrapeImg;
|
|
@@ -52,7 +52,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.scrapeLogin =
|
|
55
|
+
exports.scrapeLogin = scrapeLogin;
|
|
56
56
|
function scrapeLogin(page) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
58
58
|
var result;
|
|
@@ -77,4 +77,3 @@ function scrapeLogin(page) {
|
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
exports.scrapeLogin = scrapeLogin;
|
|
@@ -55,7 +55,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
55
55
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
56
56
|
};
|
|
57
57
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.
|
|
58
|
+
exports.stickerSelect = stickerSelect;
|
|
59
|
+
exports.resizeImg = resizeImg;
|
|
59
60
|
var sharp_1 = __importDefault(require("sharp"));
|
|
60
61
|
function stickerSelect(_B, _t) {
|
|
61
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -104,7 +105,6 @@ function stickerSelect(_B, _t) {
|
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
exports.stickerSelect = stickerSelect;
|
|
108
108
|
function resizeImg(buff, size) {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
110
|
var _ins, _w, _webb64;
|
|
@@ -123,4 +123,3 @@ function resizeImg(buff, size) {
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
exports.resizeImg = resizeImg;
|
|
@@ -45,15 +45,15 @@ export declare class GroupLayer extends RetrieverLayer {
|
|
|
45
45
|
* @returns Invite code from group link. Example: CMJYfPFqRyE2GxrnkldYED
|
|
46
46
|
*/
|
|
47
47
|
getGroupInfoFromInviteLink(inviteCode: string): Promise<{
|
|
48
|
-
descOwner: string;
|
|
48
|
+
descOwner: string | undefined;
|
|
49
49
|
id: string;
|
|
50
|
-
owner: string;
|
|
50
|
+
owner: string | undefined;
|
|
51
51
|
participants: {
|
|
52
52
|
id: string;
|
|
53
53
|
isAdmin: boolean;
|
|
54
54
|
isSuperAdmin: boolean;
|
|
55
55
|
}[];
|
|
56
|
-
subjectOwner: string;
|
|
56
|
+
subjectOwner: string | undefined;
|
|
57
57
|
announce: boolean;
|
|
58
58
|
creation: number;
|
|
59
59
|
desc: string;
|
|
@@ -82,8 +82,8 @@ export declare class GroupLayer extends RetrieverLayer {
|
|
|
82
82
|
[key: `${number}@c.us`]: {
|
|
83
83
|
wid: string;
|
|
84
84
|
code: number;
|
|
85
|
-
invite_code: string;
|
|
86
|
-
invite_code_exp: number;
|
|
85
|
+
invite_code: string | null;
|
|
86
|
+
invite_code_exp: number | null;
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
89
|
}>;
|
|
@@ -105,8 +105,8 @@ export declare class GroupLayer extends RetrieverLayer {
|
|
|
105
105
|
wid: string;
|
|
106
106
|
code: number;
|
|
107
107
|
message: string;
|
|
108
|
-
invite_code: string;
|
|
109
|
-
invite_code_exp: number;
|
|
108
|
+
invite_code: string | null;
|
|
109
|
+
invite_code_exp: number | null;
|
|
110
110
|
};
|
|
111
111
|
}>;
|
|
112
112
|
/**
|
|
@@ -90,13 +90,18 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
90
90
|
/**
|
|
91
91
|
* Sends image message
|
|
92
92
|
* @category Chat
|
|
93
|
-
* @param to
|
|
94
|
-
* @param base64 File path,
|
|
93
|
+
* @param to ID of the chat to send the image to
|
|
94
|
+
* @param base64 File path, HTTP link, or a base64-encoded data URI (with mime type)
|
|
95
95
|
* @param filename
|
|
96
96
|
* @param caption
|
|
97
97
|
* @param quotedMessageId Quoted message id
|
|
98
98
|
* @param isViewOnce Enable single view
|
|
99
99
|
* @param mentionedList
|
|
100
|
+
* @example
|
|
101
|
+
* ```javascript
|
|
102
|
+
* const base64picture = "/9j/4AA[...]VZoCn9Lp//Z"
|
|
103
|
+
* await client.sendImageFromBase64("120[...]381@g.us'", "data:image/png;base64," + base64picture, "picture.png")
|
|
104
|
+
* ```
|
|
100
105
|
*/
|
|
101
106
|
sendImageFromBase64(to: string, base64: string, filename: string, caption?: string, quotedMessageId?: string, isViewOnce?: boolean, mentionedList?: any): Promise<{
|
|
102
107
|
ack: number;
|
|
@@ -298,13 +298,18 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
298
298
|
/**
|
|
299
299
|
* Sends image message
|
|
300
300
|
* @category Chat
|
|
301
|
-
* @param to
|
|
302
|
-
* @param base64 File path,
|
|
301
|
+
* @param to ID of the chat to send the image to
|
|
302
|
+
* @param base64 File path, HTTP link, or a base64-encoded data URI (with mime type)
|
|
303
303
|
* @param filename
|
|
304
304
|
* @param caption
|
|
305
305
|
* @param quotedMessageId Quoted message id
|
|
306
306
|
* @param isViewOnce Enable single view
|
|
307
307
|
* @param mentionedList
|
|
308
|
+
* @example
|
|
309
|
+
* ```javascript
|
|
310
|
+
* const base64picture = "/9j/4AA[...]VZoCn9Lp//Z"
|
|
311
|
+
* await client.sendImageFromBase64("120[...]381@g.us'", "data:image/png;base64," + base64picture, "picture.png")
|
|
312
|
+
* ```
|
|
308
313
|
*/
|
|
309
314
|
SenderLayer.prototype.sendImageFromBase64 = function (to, base64, filename, caption, quotedMessageId, isViewOnce, mentionedList) {
|
|
310
315
|
return __awaiter(this, void 0, void 0, function () {
|
package/dist/api/whatsapp.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Page } from 'puppeteer';
|
|
3
2
|
import { CreateConfig } from '../config/create-config';
|
|
4
3
|
import { BusinessLayer } from './layers/business.layer';
|
|
@@ -27,18 +26,18 @@ export declare class Whatsapp extends BusinessLayer {
|
|
|
27
26
|
get waPage(): Page;
|
|
28
27
|
/**
|
|
29
28
|
* Get the puppeteer page screenshot
|
|
30
|
-
* @returns The Whatsapp page screenshot encoded in base64
|
|
29
|
+
* @returns The Whatsapp page screenshot as a PNG encoded in base64 (not the full data URI, just the base64 section)
|
|
31
30
|
*/
|
|
32
31
|
takeScreenshot(): Promise<string>;
|
|
33
32
|
/**
|
|
34
|
-
* Clicks on 'use here' button (When it
|
|
33
|
+
* Clicks on 'use here' button (When it gets unlaunched)
|
|
35
34
|
* This method tracks the class of the button
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* WhatsApp Web might change this class name over time
|
|
36
|
+
* Don't rely on this method
|
|
38
37
|
*/
|
|
39
38
|
useHere(): Promise<boolean>;
|
|
40
39
|
/**
|
|
41
|
-
* Logout
|
|
40
|
+
* Logout WhatsApp
|
|
42
41
|
* @returns boolean
|
|
43
42
|
*/
|
|
44
43
|
logout(): Promise<boolean>;
|
|
@@ -59,9 +58,9 @@ export declare class Whatsapp extends BusinessLayer {
|
|
|
59
58
|
*/
|
|
60
59
|
getMessageById(messageId: string): Promise<Message>;
|
|
61
60
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @param chatId string ID
|
|
64
|
-
* @param params GetMessagesParam
|
|
61
|
+
* Returns a list of messages from a chat
|
|
62
|
+
* @param chatId string ID of the conversation or group
|
|
63
|
+
* @param params GetMessagesParam Result filtering options (count, id, direction) see {@link GetMessagesParam}.
|
|
65
64
|
* @returns Message object
|
|
66
65
|
*/
|
|
67
66
|
getMessages(chatId: string, params?: GetMessagesParam): Promise<Message[]>;
|
|
@@ -72,9 +71,9 @@ export declare class Whatsapp extends BusinessLayer {
|
|
|
72
71
|
*/
|
|
73
72
|
decryptFile(message: Message): Promise<Buffer>;
|
|
74
73
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @param callId string ID
|
|
77
|
-
* @returns
|
|
74
|
+
* Rejects a call received via WhatsApp
|
|
75
|
+
* @param callId string Call ID, if not passed, all calls will be rejected
|
|
76
|
+
* @returns Number of rejected calls
|
|
78
77
|
*/
|
|
79
78
|
rejectCall(callId?: string): Promise<boolean>;
|
|
80
79
|
}
|
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.10147x',
|
|
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
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidSessionToken =
|
|
3
|
+
exports.isValidSessionToken = isValidSessionToken;
|
|
4
4
|
/**
|
|
5
5
|
* Validate the object to check is a valid token
|
|
6
6
|
* @param token Token to validate
|
|
@@ -16,4 +16,3 @@ function isValidSessionToken(token) {
|
|
|
16
16
|
return (token &&
|
|
17
17
|
requiredAttribbutes.every(function (attr) { return typeof token[attr] === 'string' && token[attr].length > 0; }));
|
|
18
18
|
}
|
|
19
|
-
exports.isValidSessionToken = isValidSessionToken;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidTokenStore =
|
|
3
|
+
exports.isValidTokenStore = isValidTokenStore;
|
|
4
4
|
var keys = ['getToken', 'setToken', 'removeToken', 'listTokens'];
|
|
5
5
|
/**
|
|
6
6
|
* Check and validate if the object implements the TokenStore interface
|
|
@@ -10,4 +10,3 @@ var keys = ['getToken', 'setToken', 'removeToken', 'listTokens'];
|
|
|
10
10
|
function isValidTokenStore(object) {
|
|
11
11
|
return keys.every(function (k) { return k in object && typeof object[k] === 'function'; });
|
|
12
12
|
}
|
|
13
|
-
exports.isValidTokenStore = isValidTokenStore;
|
package/dist/utils/ffmpeg.js
CHANGED
|
@@ -62,7 +62,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
62
62
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
63
|
};
|
|
64
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.
|
|
65
|
+
exports.getFfmpegPath = getFfmpegPath;
|
|
66
|
+
exports.convertToMP4GIF = convertToMP4GIF;
|
|
66
67
|
/*
|
|
67
68
|
* This file is part of WPPConnect.
|
|
68
69
|
*
|
|
@@ -137,7 +138,6 @@ function getFfmpegPath() {
|
|
|
137
138
|
});
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
|
-
exports.getFfmpegPath = getFfmpegPath;
|
|
141
141
|
/**
|
|
142
142
|
* Convert a file to a compatible MP4-GIF for WhatsApp
|
|
143
143
|
* @param inputBase64 Gif in base64 format
|
|
@@ -190,4 +190,3 @@ function convertToMP4GIF(inputBase64) {
|
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
exports.convertToMP4GIF = convertToMP4GIF;
|
package/dist/utils/semver.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.upToDate =
|
|
19
|
+
exports.upToDate = upToDate;
|
|
20
20
|
var VPAT = /^\d+(\.\d+){0,2}$/;
|
|
21
21
|
/**
|
|
22
22
|
* Compares two versions
|
|
@@ -49,4 +49,3 @@ function upToDate(local, remote) {
|
|
|
49
49
|
return local >= remote;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.upToDate = upToDate;
|
package/dist/utils/sleep.js
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.sleep =
|
|
19
|
+
exports.sleep = sleep;
|
|
20
20
|
function sleep(time) {
|
|
21
21
|
return new Promise(function (resolve) { return setTimeout(resolve, time); });
|
|
22
22
|
}
|
|
23
|
-
exports.sleep = sleep;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.4",
|
|
4
4
|
"description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,20 +54,20 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/wppconnect-team/wppconnect#readme",
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@babel/core": "^7.24.
|
|
58
|
-
"@babel/eslint-parser": "^7.24.
|
|
57
|
+
"@babel/core": "^7.24.8",
|
|
58
|
+
"@babel/eslint-parser": "^7.24.8",
|
|
59
59
|
"@babel/eslint-plugin": "^7.24.7",
|
|
60
|
-
"@babel/preset-env": "^7.24.
|
|
60
|
+
"@babel/preset-env": "^7.24.8",
|
|
61
61
|
"@commitlint/cli": "^19.3.0",
|
|
62
62
|
"@commitlint/config-conventional": "^19.2.2",
|
|
63
63
|
"@commitlint/cz-commitlint": "^19.2.0",
|
|
64
64
|
"@types/atob": "^2.1.4",
|
|
65
65
|
"@types/mime-types": "^2.1.4",
|
|
66
|
-
"@types/mocha": "^10.0.
|
|
67
|
-
"@types/node": "^18.19.
|
|
66
|
+
"@types/mocha": "^10.0.7",
|
|
67
|
+
"@types/node": "^18.19.39",
|
|
68
68
|
"@types/shelljs": "^0.8.15",
|
|
69
69
|
"@types/tmp": "^0.2.6",
|
|
70
|
-
"@types/ws": "^8.5.
|
|
70
|
+
"@types/ws": "^8.5.11",
|
|
71
71
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
72
72
|
"@typescript-eslint/parser": "^5.62.0",
|
|
73
73
|
"babel-loader": "^9.1.3",
|
|
@@ -79,21 +79,21 @@
|
|
|
79
79
|
"eslint-plugin-header": "^3.1.1",
|
|
80
80
|
"eslint-plugin-prettier": "^4.2.1",
|
|
81
81
|
"husky": "^9.0.11",
|
|
82
|
-
"mocha": "^10.
|
|
82
|
+
"mocha": "^10.5.2",
|
|
83
83
|
"prettier": "^2.8.8",
|
|
84
84
|
"pretty-quick": "^4.0.0",
|
|
85
85
|
"regenerator-runtime": "^0.14.1",
|
|
86
|
-
"release-it": "^17.
|
|
86
|
+
"release-it": "^17.6.0",
|
|
87
87
|
"shx": "^0.3.4",
|
|
88
88
|
"ts-node": "^10.9.2",
|
|
89
89
|
"typedoc": "^0.25.13",
|
|
90
|
-
"typescript": "^5.
|
|
91
|
-
"webpack": "^5.
|
|
90
|
+
"typescript": "^5.5.3",
|
|
91
|
+
"webpack": "^5.93.0",
|
|
92
92
|
"webpack-cli": "^5.1.4"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@wppconnect/wa-js": "^3.
|
|
96
|
-
"@wppconnect/wa-version": "^1.5.
|
|
95
|
+
"@wppconnect/wa-js": "^3.6.0",
|
|
96
|
+
"@wppconnect/wa-version": "^1.5.87",
|
|
97
97
|
"atob": "^2.1.2",
|
|
98
98
|
"axios": "^1.7.2",
|
|
99
99
|
"boxen": "^5.1.2",
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
"file-type": "~16.5.4",
|
|
105
105
|
"futoin-hkdf": "^1.5.3",
|
|
106
106
|
"latest-version": "^5.1.0",
|
|
107
|
-
"logform": "^2.6.
|
|
107
|
+
"logform": "^2.6.1",
|
|
108
108
|
"lookpath": "^1.2.2",
|
|
109
109
|
"mime-types": "^2.1.35",
|
|
110
|
-
"puppeteer": "^22.
|
|
110
|
+
"puppeteer": "^22.13.0",
|
|
111
111
|
"puppeteer-extra": "^3.3.6",
|
|
112
112
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
113
113
|
"puppeteer-extra-plugin-user-data-dir": "^2.4.1",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"sharp": "0.33.4",
|
|
120
120
|
"tmp": "^0.2.3",
|
|
121
121
|
"tree-kill": "^1.2.2",
|
|
122
|
-
"winston": "^3.13.
|
|
123
|
-
"ws": "^8.
|
|
122
|
+
"winston": "^3.13.1",
|
|
123
|
+
"ws": "^8.18.0"
|
|
124
124
|
},
|
|
125
125
|
"optionalDependencies": {
|
|
126
126
|
"@img/sharp-win32-x64": "^0.33.4",
|