@wppconnect-team/wppconnect 1.37.5 → 1.37.7
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/layers/host.layer.d.ts +12 -0
- package/dist/api/layers/host.layer.js +32 -0
- package/dist/api/layers/retriever.layer.d.ts +14 -0
- package/dist/api/layers/retriever.layer.js +23 -0
- package/dist/api/layers/sender.layer.d.ts +43 -19
- package/dist/api/layers/sender.layer.js +61 -15
- package/dist/api/layers/ui.layer.d.ts +3 -2
- package/dist/api/layers/ui.layer.js +4 -2
- package/dist/api/model/enum/group-notification-type.d.ts +1 -1
- package/dist/api/model/enum/group-notification-type.js +1 -1
- package/dist/api/model/enum/status-find.d.ts +2 -2
- package/dist/api/model/enum/status-find.js +2 -2
- package/dist/api/model/message.d.ts +18 -1
- package/dist/api/whatsapp.js +1 -1
- package/dist/config/create-config.js +1 -1
- package/package.json +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## <small>1.37.7 (2025-11-25)</small>
|
|
2
|
+
|
|
3
|
+
- Merge pull request #2624 from wppconnect-team/manfe/bump-wa-js-versions ([eb652cf](https://github.com/wppconnect-team/wppconnect/commit/eb652cf)), closes [#2624](https://github.com/wppconnect-team/wppconnect/issues/2624)
|
|
4
|
+
|
|
5
|
+
## <small>1.37.6 (2025-11-11)</small>
|
|
6
|
+
|
|
7
|
+
- [update] version whatsapp web (#2609) ([cf04c5d](https://github.com/wppconnect-team/wppconnect/commit/cf04c5d)), closes [#2609](https://github.com/wppconnect-team/wppconnect/issues/2609)
|
|
8
|
+
|
|
1
9
|
## <small>1.37.5 (2025-09-16)</small>
|
|
2
10
|
|
|
3
11
|
- chore: update wajs ([9b3f4d5](https://github.com/wppconnect-team/wppconnect/commit/9b3f4d5))
|
|
@@ -130,4 +130,16 @@ export declare class HostLayer {
|
|
|
130
130
|
* @category Host
|
|
131
131
|
*/
|
|
132
132
|
joinWebBeta(value: boolean): Promise<boolean>;
|
|
133
|
+
/**
|
|
134
|
+
* Get WhatsApp build constants
|
|
135
|
+
* @category Host
|
|
136
|
+
* @returns Build constants information
|
|
137
|
+
*/
|
|
138
|
+
getBuildConstants(): Promise<import("@wppconnect/wa-js/dist/conn").BuildConstants>;
|
|
139
|
+
/**
|
|
140
|
+
* Check if the account has been migrated to LID
|
|
141
|
+
* @category Host
|
|
142
|
+
* @returns true if the account has been migrated to LID, false otherwise
|
|
143
|
+
*/
|
|
144
|
+
isLidMigrated(): Promise<boolean>;
|
|
133
145
|
}
|
|
@@ -804,6 +804,38 @@ var HostLayer = /** @class */ (function () {
|
|
|
804
804
|
});
|
|
805
805
|
});
|
|
806
806
|
};
|
|
807
|
+
/**
|
|
808
|
+
* Get WhatsApp build constants
|
|
809
|
+
* @category Host
|
|
810
|
+
* @returns Build constants information
|
|
811
|
+
*/
|
|
812
|
+
HostLayer.prototype.getBuildConstants = function () {
|
|
813
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
814
|
+
return __generator(this, function (_a) {
|
|
815
|
+
switch (_a.label) {
|
|
816
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () {
|
|
817
|
+
return WPP.conn.getBuildConstants();
|
|
818
|
+
})];
|
|
819
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
});
|
|
823
|
+
};
|
|
824
|
+
/**
|
|
825
|
+
* Check if the account has been migrated to LID
|
|
826
|
+
* @category Host
|
|
827
|
+
* @returns true if the account has been migrated to LID, false otherwise
|
|
828
|
+
*/
|
|
829
|
+
HostLayer.prototype.isLidMigrated = function () {
|
|
830
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
831
|
+
return __generator(this, function (_a) {
|
|
832
|
+
switch (_a.label) {
|
|
833
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function () { return WPP.whatsapp.functions.isLidMigrated(); })];
|
|
834
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
};
|
|
807
839
|
return HostLayer;
|
|
808
840
|
}());
|
|
809
841
|
exports.HostLayer = HostLayer;
|
|
@@ -311,4 +311,18 @@ export declare class RetrieverLayer extends SenderLayer {
|
|
|
311
311
|
* @returns Promise
|
|
312
312
|
*/
|
|
313
313
|
getCommonGroups(wid: string): Promise<import("@wppconnect/wa-js/dist/whatsapp").Wid[]>;
|
|
314
|
+
/**
|
|
315
|
+
* Get LID/PhoneNumber mapping and Contact information
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```javascript
|
|
319
|
+
* const info = await client.getPnLidEntry('[number]@c.us');
|
|
320
|
+
* const info = await client.getPnLidEntry('[number]@lid');
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @category Contact
|
|
324
|
+
* @param phoneOrLid Contact ID (phone number or LID)
|
|
325
|
+
* @returns Promise with lid, phoneNumber and contact information
|
|
326
|
+
*/
|
|
327
|
+
getPnLidEntry(phoneOrLid: string): Promise<import("@wppconnect/wa-js/dist/contact").PnLidEntryResult>;
|
|
314
328
|
}
|
|
@@ -718,6 +718,29 @@ var RetrieverLayer = /** @class */ (function (_super) {
|
|
|
718
718
|
});
|
|
719
719
|
});
|
|
720
720
|
};
|
|
721
|
+
/**
|
|
722
|
+
* Get LID/PhoneNumber mapping and Contact information
|
|
723
|
+
*
|
|
724
|
+
* @example
|
|
725
|
+
* ```javascript
|
|
726
|
+
* const info = await client.getPnLidEntry('[number]@c.us');
|
|
727
|
+
* const info = await client.getPnLidEntry('[number]@lid');
|
|
728
|
+
* ```
|
|
729
|
+
*
|
|
730
|
+
* @category Contact
|
|
731
|
+
* @param phoneOrLid Contact ID (phone number or LID)
|
|
732
|
+
* @returns Promise with lid, phoneNumber and contact information
|
|
733
|
+
*/
|
|
734
|
+
RetrieverLayer.prototype.getPnLidEntry = function (phoneOrLid) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
736
|
+
return __generator(this, function (_a) {
|
|
737
|
+
switch (_a.label) {
|
|
738
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (phoneOrLid) { return WPP.contact.getPnLidEntry(phoneOrLid); }, phoneOrLid)];
|
|
739
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
});
|
|
743
|
+
};
|
|
721
744
|
return RetrieverLayer;
|
|
722
745
|
}(sender_layer_1.SenderLayer));
|
|
723
746
|
exports.RetrieverLayer = RetrieverLayer;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { FileMessageOptions, ListMessageOptions, LocationMessageOptions,
|
|
1
|
+
import type { AllMessageOptions, FileMessageOptions, ForwardMessagesOptions, ListMessageOptions, LocationMessageOptions, PoolMessageOptions, SendMessageOptions, TextMessageOptions } from '@wppconnect/wa-js/dist/chat';
|
|
2
|
+
import { OrderItems, OrderMessageOptions } from '@wppconnect/wa-js/dist/chat/functions/sendChargeMessage';
|
|
2
3
|
import { Page } from 'puppeteer';
|
|
3
4
|
import { CreateConfig } from '../../config/create-config';
|
|
5
|
+
import { PixParams } from '../../types/WAPI';
|
|
4
6
|
import { Message, Wid } from '../model';
|
|
5
7
|
import { ChatState } from '../model/enum';
|
|
6
8
|
import { ListenerLayer } from './listener.layer';
|
|
7
|
-
import { OrderItems, OrderMessageOptions } from '@wppconnect/wa-js/dist/chat/functions/sendChargeMessage';
|
|
8
|
-
import { PixParams } from '../../types/WAPI';
|
|
9
9
|
export declare class SenderLayer extends ListenerLayer {
|
|
10
10
|
page: Page;
|
|
11
11
|
constructor(page: Page, session?: string, options?: CreateConfig);
|
|
@@ -107,7 +107,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
107
107
|
}): Promise<{
|
|
108
108
|
ack: number;
|
|
109
109
|
id: string;
|
|
110
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
110
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
111
111
|
}>;
|
|
112
112
|
/**
|
|
113
113
|
* Sends image message
|
|
@@ -130,7 +130,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
130
130
|
}): Promise<{
|
|
131
131
|
ack: number;
|
|
132
132
|
id: string;
|
|
133
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
133
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
134
134
|
}>;
|
|
135
135
|
/**
|
|
136
136
|
* Sends message with thumbnail
|
|
@@ -169,11 +169,12 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
169
169
|
* @param caption
|
|
170
170
|
* @param quotedMessageId Quoted message id
|
|
171
171
|
* @param messageId Set the id for this message
|
|
172
|
+
* @param isPtt Set as ptt audio
|
|
172
173
|
*/
|
|
173
|
-
sendPttFromBase64(to: string, base64: string, filename: string, caption?: string, quotedMessageId?: string, messageId?: string): Promise<{
|
|
174
|
+
sendPttFromBase64(to: string, base64: string, filename: string, caption?: string, quotedMessageId?: string, messageId?: string, isPtt?: boolean): Promise<{
|
|
174
175
|
ack: number;
|
|
175
176
|
id: string;
|
|
176
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
177
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
177
178
|
}>;
|
|
178
179
|
/**
|
|
179
180
|
* Sends ptt audio from path
|
|
@@ -184,8 +185,9 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
184
185
|
* @param caption
|
|
185
186
|
* @param quotedMessageId Quoted message id
|
|
186
187
|
* @param messageId Set the id for this message
|
|
188
|
+
* @param isPtt Set as ptt audio
|
|
187
189
|
*/
|
|
188
|
-
sendPtt(to: string, filePath: string, filename?: string, caption?: string, quotedMessageId?: string, messageId?: string): Promise<unknown>;
|
|
190
|
+
sendPtt(to: string, filePath: string, filename?: string, caption?: string, quotedMessageId?: string, messageId?: string, isPtt?: boolean): Promise<unknown>;
|
|
189
191
|
/**
|
|
190
192
|
* Sends file
|
|
191
193
|
* base64 parameter should have mime type already defined
|
|
@@ -269,7 +271,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
269
271
|
sendVideoAsGif(to: string, filePath: string, filename?: string, caption?: string): Promise<{
|
|
270
272
|
ack: number;
|
|
271
273
|
id: string;
|
|
272
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
274
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
273
275
|
}>;
|
|
274
276
|
/**
|
|
275
277
|
* Sends a video to given chat as a gif, with caption or not, using base64
|
|
@@ -282,7 +284,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
282
284
|
sendVideoAsGifFromBase64(to: string, base64: string, filename: string, caption?: string, quotedMessageId?: string): Promise<{
|
|
283
285
|
ack: number;
|
|
284
286
|
id: string;
|
|
285
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
287
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
286
288
|
}>;
|
|
287
289
|
/**
|
|
288
290
|
* Sends a video to given chat as a gif, with caption or not, using base64
|
|
@@ -295,7 +297,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
295
297
|
sendGif(to: string, filePath: string, filename?: string, caption?: string): Promise<{
|
|
296
298
|
ack: number;
|
|
297
299
|
id: string;
|
|
298
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
300
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
299
301
|
}>;
|
|
300
302
|
/**
|
|
301
303
|
* Sends a video to given chat as a gif, with caption or not, using base64
|
|
@@ -308,7 +310,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
308
310
|
sendGifFromBase64(to: string, base64: string, filename: string, caption?: string): Promise<{
|
|
309
311
|
ack: number;
|
|
310
312
|
id: string;
|
|
311
|
-
sendMsgResult: import("@wppconnect/wa-js/dist/
|
|
313
|
+
sendMsgResult: import("@wppconnect/wa-js/dist/chat").SendMsgResultObject;
|
|
312
314
|
}>;
|
|
313
315
|
/**
|
|
314
316
|
* Sends contact card to iven chat id
|
|
@@ -329,6 +331,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
329
331
|
})[]): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
|
|
330
332
|
/**
|
|
331
333
|
* Forwards array of messages (could be ids or message objects)
|
|
334
|
+
* @deprecated please use {@link forwardMessagesV2}
|
|
332
335
|
* @category Chat
|
|
333
336
|
* @param to Chat id
|
|
334
337
|
* @param messages Array of messages ids to be forwarded
|
|
@@ -336,6 +339,20 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
336
339
|
* @returns array of messages ID
|
|
337
340
|
*/
|
|
338
341
|
forwardMessage(toChatId: string, msgId: string | string[], options?: ForwardMessagesOptions): Promise<boolean>;
|
|
342
|
+
/**
|
|
343
|
+
* Forwards array of messages (could be ids or message objects)
|
|
344
|
+
* What is the difference between forwardMessage and forwardMessagesV2?
|
|
345
|
+
* forwardMessage was used to forward a single message
|
|
346
|
+
* forwardMessagesV2 is used to forward multiple messages
|
|
347
|
+
* Also, it fixes how we pass the arguments to the whatsapp original function
|
|
348
|
+
* From positional args to named args (object)
|
|
349
|
+
* @category Chat
|
|
350
|
+
* @param to Chat id
|
|
351
|
+
* @param messages Array of messages ids to be forwarded
|
|
352
|
+
* @param options
|
|
353
|
+
* @returns array of messages ID
|
|
354
|
+
*/
|
|
355
|
+
forwardMessagesV2(toChatId: string, messages: string | string[], options?: ForwardMessagesOptions): Promise<Array<any>>;
|
|
339
356
|
/**
|
|
340
357
|
* Generates sticker from the provided animated gif image and sends it (Send image as animated sticker)
|
|
341
358
|
*
|
|
@@ -403,7 +420,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
403
420
|
unreadCount: number;
|
|
404
421
|
}>;
|
|
405
422
|
/**
|
|
406
|
-
* Sets
|
|
423
|
+
* Sets an audio or image view once. Marks message as played
|
|
407
424
|
* @category Chat
|
|
408
425
|
* @param msgId Message id: xxxxx@us.c
|
|
409
426
|
*/
|
|
@@ -421,7 +438,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
421
438
|
* ```
|
|
422
439
|
* @category Chat
|
|
423
440
|
* @param to Chat Id
|
|
424
|
-
* @param duration Duration
|
|
441
|
+
* @param duration Duration in milliseconds
|
|
425
442
|
*/
|
|
426
443
|
startTyping(to: string, duration?: number): Promise<void>;
|
|
427
444
|
/**
|
|
@@ -434,7 +451,7 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
434
451
|
* Starts recording ('Recording...' state)
|
|
435
452
|
* @example
|
|
436
453
|
* ```javascript
|
|
437
|
-
* // Keep sending recording state, use
|
|
454
|
+
* // Keep sending recording state, use `stopRecording` to finish
|
|
438
455
|
* await client.startRecording('[number]@c.us');
|
|
439
456
|
*
|
|
440
457
|
* // Keep sending typing state for 5 seconds
|
|
@@ -442,15 +459,22 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
442
459
|
* ```
|
|
443
460
|
* @category Chat
|
|
444
461
|
* @param to Chat Id
|
|
445
|
-
* @param duration Duration
|
|
462
|
+
* @param duration Duration in milliseconds
|
|
446
463
|
*/
|
|
447
464
|
startRecording(to: string, duration?: number): Promise<void>;
|
|
448
465
|
/**
|
|
449
466
|
* Stops recording ('Recording...' state)
|
|
467
|
+
* @deprecated please use {@link stopRecording} this function will be removed in future releases
|
|
450
468
|
* @category Chat
|
|
451
469
|
* @param to Chat Id
|
|
452
470
|
*/
|
|
453
471
|
stopRecoring(to: string): Promise<void>;
|
|
472
|
+
/**
|
|
473
|
+
* Stops recording ('Recording...' state)
|
|
474
|
+
* @category Chat
|
|
475
|
+
* @param to Chat Id
|
|
476
|
+
*/
|
|
477
|
+
stopRecording(to: string): Promise<void>;
|
|
454
478
|
/**
|
|
455
479
|
* Update your online presence
|
|
456
480
|
* @category Chat
|
|
@@ -542,18 +566,18 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
542
566
|
* ```
|
|
543
567
|
* @category Chat
|
|
544
568
|
* @param to Chat Id
|
|
545
|
-
* @param duration Duration
|
|
569
|
+
* @param duration Duration in milliseconds
|
|
546
570
|
*/
|
|
547
571
|
sendReactionToMessage(msgId: string, reaction: string | false): Promise<{
|
|
548
572
|
sendMsgResult: string;
|
|
549
573
|
}>;
|
|
550
574
|
/**
|
|
551
|
-
* Send
|
|
575
|
+
* Send an order message
|
|
552
576
|
* To send (prices, tax, shipping or discount), for example: USD 12.90, send them without dots or commas, like: 12900
|
|
553
577
|
*
|
|
554
578
|
* @example
|
|
555
579
|
* ```javascript
|
|
556
|
-
* // Send
|
|
580
|
+
* // Send an order with a product
|
|
557
581
|
* client.sendOrderMessage('[number]@c.us', [
|
|
558
582
|
* { type: 'product', id: '67689897878', qnt: 2 },
|
|
559
583
|
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
@@ -570,22 +570,24 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
570
570
|
* @param caption
|
|
571
571
|
* @param quotedMessageId Quoted message id
|
|
572
572
|
* @param messageId Set the id for this message
|
|
573
|
+
* @param isPtt Set as ptt audio
|
|
573
574
|
*/
|
|
574
|
-
SenderLayer.prototype.sendPttFromBase64 = function (
|
|
575
|
-
return __awaiter(this,
|
|
575
|
+
SenderLayer.prototype.sendPttFromBase64 = function (to_1, base64_1, filename_1, caption_1, quotedMessageId_1, messageId_1) {
|
|
576
|
+
return __awaiter(this, arguments, void 0, function (to, base64, filename, caption, quotedMessageId, messageId, isPtt) {
|
|
576
577
|
var result;
|
|
577
578
|
var _this = this;
|
|
579
|
+
if (isPtt === void 0) { isPtt = true; }
|
|
578
580
|
return __generator(this, function (_a) {
|
|
579
581
|
switch (_a.label) {
|
|
580
582
|
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
581
583
|
var result;
|
|
582
584
|
var _c;
|
|
583
|
-
var to = _b.to, base64 = _b.base64, filename = _b.filename, caption = _b.caption, quotedMessageId = _b.quotedMessageId, messageId = _b.messageId;
|
|
585
|
+
var to = _b.to, base64 = _b.base64, filename = _b.filename, caption = _b.caption, quotedMessageId = _b.quotedMessageId, messageId = _b.messageId, isPtt = _b.isPtt;
|
|
584
586
|
return __generator(this, function (_d) {
|
|
585
587
|
switch (_d.label) {
|
|
586
588
|
case 0: return [4 /*yield*/, WPP.chat.sendFileMessage(to, base64, {
|
|
587
589
|
type: 'audio',
|
|
588
|
-
isPtt:
|
|
590
|
+
isPtt: isPtt,
|
|
589
591
|
filename: filename,
|
|
590
592
|
caption: caption,
|
|
591
593
|
quotedMsg: quotedMessageId,
|
|
@@ -603,7 +605,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
603
605
|
_c)];
|
|
604
606
|
}
|
|
605
607
|
});
|
|
606
|
-
}); }, { to: to, base64: base64, filename: filename, caption: caption, quotedMessageId: quotedMessageId, messageId: messageId })];
|
|
608
|
+
}); }, { to: to, base64: base64, filename: filename, caption: caption, quotedMessageId: quotedMessageId, messageId: messageId, isPtt: isPtt })];
|
|
607
609
|
case 1:
|
|
608
610
|
result = _a.sent();
|
|
609
611
|
return [2 /*return*/, result];
|
|
@@ -620,10 +622,12 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
620
622
|
* @param caption
|
|
621
623
|
* @param quotedMessageId Quoted message id
|
|
622
624
|
* @param messageId Set the id for this message
|
|
625
|
+
* @param isPtt Set as ptt audio
|
|
623
626
|
*/
|
|
624
|
-
SenderLayer.prototype.sendPtt = function (
|
|
625
|
-
return __awaiter(this,
|
|
627
|
+
SenderLayer.prototype.sendPtt = function (to_1, filePath_1, filename_1, caption_1, quotedMessageId_1, messageId_1) {
|
|
628
|
+
return __awaiter(this, arguments, void 0, function (to, filePath, filename, caption, quotedMessageId, messageId, isPtt) {
|
|
626
629
|
var _this = this;
|
|
630
|
+
if (isPtt === void 0) { isPtt = true; }
|
|
627
631
|
return __generator(this, function (_a) {
|
|
628
632
|
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
629
633
|
var base64, obj;
|
|
@@ -649,7 +653,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
649
653
|
if (!filename) {
|
|
650
654
|
filename = path.basename(filePath);
|
|
651
655
|
}
|
|
652
|
-
return [2 /*return*/, this.sendPttFromBase64(to, base64, filename, caption, quotedMessageId, messageId)
|
|
656
|
+
return [2 /*return*/, this.sendPttFromBase64(to, base64, filename, caption, quotedMessageId, messageId, isPtt)
|
|
653
657
|
.then(resolve)
|
|
654
658
|
.catch(reject)];
|
|
655
659
|
}
|
|
@@ -938,6 +942,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
938
942
|
};
|
|
939
943
|
/**
|
|
940
944
|
* Forwards array of messages (could be ids or message objects)
|
|
945
|
+
* @deprecated please use {@link forwardMessagesV2}
|
|
941
946
|
* @category Chat
|
|
942
947
|
* @param to Chat id
|
|
943
948
|
* @param messages Array of messages ids to be forwarded
|
|
@@ -954,6 +959,29 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
954
959
|
});
|
|
955
960
|
});
|
|
956
961
|
};
|
|
962
|
+
/**
|
|
963
|
+
* Forwards array of messages (could be ids or message objects)
|
|
964
|
+
* What is the difference between forwardMessage and forwardMessagesV2?
|
|
965
|
+
* forwardMessage was used to forward a single message
|
|
966
|
+
* forwardMessagesV2 is used to forward multiple messages
|
|
967
|
+
* Also, it fixes how we pass the arguments to the whatsapp original function
|
|
968
|
+
* From positional args to named args (object)
|
|
969
|
+
* @category Chat
|
|
970
|
+
* @param to Chat id
|
|
971
|
+
* @param messages Array of messages ids to be forwarded
|
|
972
|
+
* @param options
|
|
973
|
+
* @returns array of messages ID
|
|
974
|
+
*/
|
|
975
|
+
SenderLayer.prototype.forwardMessagesV2 = function (toChatId, messages, options) {
|
|
976
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
977
|
+
return __generator(this, function (_a) {
|
|
978
|
+
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
|
|
979
|
+
var toChatId = _a.toChatId, messages = _a.messages, options = _a.options;
|
|
980
|
+
return WPP.chat.forwardMessages(toChatId, messages, options);
|
|
981
|
+
}, { toChatId: toChatId, messages: messages, options: options })];
|
|
982
|
+
});
|
|
983
|
+
});
|
|
984
|
+
};
|
|
957
985
|
/**
|
|
958
986
|
* Generates sticker from the provided animated gif image and sends it (Send image as animated sticker)
|
|
959
987
|
*
|
|
@@ -1173,7 +1201,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1173
1201
|
});
|
|
1174
1202
|
};
|
|
1175
1203
|
/**
|
|
1176
|
-
* Sets
|
|
1204
|
+
* Sets an audio or image view once. Marks message as played
|
|
1177
1205
|
* @category Chat
|
|
1178
1206
|
* @param msgId Message id: xxxxx@us.c
|
|
1179
1207
|
*/
|
|
@@ -1197,7 +1225,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1197
1225
|
* ```
|
|
1198
1226
|
* @category Chat
|
|
1199
1227
|
* @param to Chat Id
|
|
1200
|
-
* @param duration Duration
|
|
1228
|
+
* @param duration Duration in milliseconds
|
|
1201
1229
|
*/
|
|
1202
1230
|
SenderLayer.prototype.startTyping = function (to, duration) {
|
|
1203
1231
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1233,7 +1261,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1233
1261
|
* Starts recording ('Recording...' state)
|
|
1234
1262
|
* @example
|
|
1235
1263
|
* ```javascript
|
|
1236
|
-
* // Keep sending recording state, use
|
|
1264
|
+
* // Keep sending recording state, use `stopRecording` to finish
|
|
1237
1265
|
* await client.startRecording('[number]@c.us');
|
|
1238
1266
|
*
|
|
1239
1267
|
* // Keep sending typing state for 5 seconds
|
|
@@ -1241,7 +1269,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1241
1269
|
* ```
|
|
1242
1270
|
* @category Chat
|
|
1243
1271
|
* @param to Chat Id
|
|
1244
|
-
* @param duration Duration
|
|
1272
|
+
* @param duration Duration in milliseconds
|
|
1245
1273
|
*/
|
|
1246
1274
|
SenderLayer.prototype.startRecording = function (to, duration) {
|
|
1247
1275
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1258,6 +1286,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1258
1286
|
};
|
|
1259
1287
|
/**
|
|
1260
1288
|
* Stops recording ('Recording...' state)
|
|
1289
|
+
* @deprecated please use {@link stopRecording} this function will be removed in future releases
|
|
1261
1290
|
* @category Chat
|
|
1262
1291
|
* @param to Chat Id
|
|
1263
1292
|
*/
|
|
@@ -1273,6 +1302,23 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1273
1302
|
});
|
|
1274
1303
|
});
|
|
1275
1304
|
};
|
|
1305
|
+
/**
|
|
1306
|
+
* Stops recording ('Recording...' state)
|
|
1307
|
+
* @category Chat
|
|
1308
|
+
* @param to Chat Id
|
|
1309
|
+
*/
|
|
1310
|
+
SenderLayer.prototype.stopRecording = function (to) {
|
|
1311
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1312
|
+
return __generator(this, function (_a) {
|
|
1313
|
+
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
|
|
1314
|
+
var to = _a.to;
|
|
1315
|
+
return WPP.chat.markIsPaused(to);
|
|
1316
|
+
}, {
|
|
1317
|
+
to: to,
|
|
1318
|
+
})];
|
|
1319
|
+
});
|
|
1320
|
+
});
|
|
1321
|
+
};
|
|
1276
1322
|
/**
|
|
1277
1323
|
* Update your online presence
|
|
1278
1324
|
* @category Chat
|
|
@@ -1479,7 +1525,7 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1479
1525
|
* ```
|
|
1480
1526
|
* @category Chat
|
|
1481
1527
|
* @param to Chat Id
|
|
1482
|
-
* @param duration Duration
|
|
1528
|
+
* @param duration Duration in milliseconds
|
|
1483
1529
|
*/
|
|
1484
1530
|
SenderLayer.prototype.sendReactionToMessage = function (msgId, reaction) {
|
|
1485
1531
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1495,12 +1541,12 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
1495
1541
|
});
|
|
1496
1542
|
};
|
|
1497
1543
|
/**
|
|
1498
|
-
* Send
|
|
1544
|
+
* Send an order message
|
|
1499
1545
|
* To send (prices, tax, shipping or discount), for example: USD 12.90, send them without dots or commas, like: 12900
|
|
1500
1546
|
*
|
|
1501
1547
|
* @example
|
|
1502
1548
|
* ```javascript
|
|
1503
|
-
* // Send
|
|
1549
|
+
* // Send an order with a product
|
|
1504
1550
|
* client.sendOrderMessage('[number]@c.us', [
|
|
1505
1551
|
* { type: 'product', id: '67689897878', qnt: 2 },
|
|
1506
1552
|
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Page } from 'puppeteer';
|
|
2
2
|
import { CreateConfig } from '../../config/create-config';
|
|
3
|
+
import { Wid } from '../model';
|
|
3
4
|
import { GroupLayer } from './group.layer';
|
|
4
5
|
export declare class UILayer extends GroupLayer {
|
|
5
6
|
page: Page;
|
|
@@ -10,14 +11,14 @@ export declare class UILayer extends GroupLayer {
|
|
|
10
11
|
* @category UI
|
|
11
12
|
* @param chatId
|
|
12
13
|
*/
|
|
13
|
-
openChat(chatId: string): Promise<boolean>;
|
|
14
|
+
openChat(chatId: string | Wid): Promise<boolean>;
|
|
14
15
|
/**
|
|
15
16
|
* Opens chat at given message position
|
|
16
17
|
* @category UI
|
|
17
18
|
* @param chatId Chat id
|
|
18
19
|
* @param messageId Message id (For example: '06D3AB3D0EEB9D077A3F9A3EFF4DD030')
|
|
19
20
|
*/
|
|
20
|
-
openChatAt(chatId: string, messageId: string): Promise<boolean>;
|
|
21
|
+
openChatAt(chatId: string | Wid, messageId: string): Promise<boolean>;
|
|
21
22
|
/**
|
|
22
23
|
* Closes the currently opened chat (if any).
|
|
23
24
|
* The boolean result reflects if there was any chat that got closed.
|
|
@@ -86,7 +86,7 @@ var UILayer = /** @class */ (function (_super) {
|
|
|
86
86
|
UILayer.prototype.openChat = function (chatId) {
|
|
87
87
|
return __awaiter(this, void 0, void 0, function () {
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
|
-
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.chat.openChatBottom(chatId); }, chatId)];
|
|
89
|
+
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId) { return WPP.chat.openChatBottom(chatId, undefined); }, chatId)];
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
92
|
};
|
|
@@ -99,7 +99,9 @@ var UILayer = /** @class */ (function (_super) {
|
|
|
99
99
|
UILayer.prototype.openChatAt = function (chatId, messageId) {
|
|
100
100
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
101
|
return __generator(this, function (_a) {
|
|
102
|
-
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId, messageId) {
|
|
102
|
+
return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (chatId, messageId) {
|
|
103
|
+
return WPP.chat.openChatAt(chatId, messageId, undefined);
|
|
104
|
+
}, chatId, messageId)];
|
|
103
105
|
});
|
|
104
106
|
});
|
|
105
107
|
};
|
|
@@ -20,7 +20,7 @@ exports.GroupNotificationType = void 0;
|
|
|
20
20
|
var GroupNotificationType;
|
|
21
21
|
(function (GroupNotificationType) {
|
|
22
22
|
GroupNotificationType["Add"] = "add";
|
|
23
|
-
GroupNotificationType["
|
|
23
|
+
GroupNotificationType["Invite"] = "invite";
|
|
24
24
|
GroupNotificationType["Remove"] = "remove";
|
|
25
25
|
GroupNotificationType["Leave"] = "leave";
|
|
26
26
|
GroupNotificationType["Subject"] = "subject";
|
|
@@ -11,9 +11,9 @@ export declare enum StatusFind {
|
|
|
11
11
|
*/
|
|
12
12
|
browserClose = "browserClose",
|
|
13
13
|
/**
|
|
14
|
-
* Client has disconnected
|
|
14
|
+
* Client has disconnected to the mobile device.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
disconnectedMobile = "disconnectedMobile",
|
|
17
17
|
/**
|
|
18
18
|
* Client is ready to send and receive messages.
|
|
19
19
|
*/
|
|
@@ -31,9 +31,9 @@ var StatusFind;
|
|
|
31
31
|
*/
|
|
32
32
|
StatusFind["browserClose"] = "browserClose";
|
|
33
33
|
/**
|
|
34
|
-
* Client has disconnected
|
|
34
|
+
* Client has disconnected to the mobile device.
|
|
35
35
|
*/
|
|
36
|
-
StatusFind["
|
|
36
|
+
StatusFind["disconnectedMobile"] = "disconnectedMobile";
|
|
37
37
|
/**
|
|
38
38
|
* Client is ready to send and receive messages.
|
|
39
39
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Wid } from './wid';
|
|
2
1
|
import { Chat } from './chat';
|
|
3
2
|
import { Contact } from './contact';
|
|
4
3
|
import { MessageType } from './enum';
|
|
4
|
+
import { Wid } from './wid';
|
|
5
5
|
/** available during the `onMessage` event */
|
|
6
6
|
export interface Message {
|
|
7
7
|
id: string;
|
|
@@ -98,6 +98,23 @@ export interface Message {
|
|
|
98
98
|
recipients?: string[];
|
|
99
99
|
/** exists for image and video types {@link GroupNotificationType} */
|
|
100
100
|
caption?: string;
|
|
101
|
+
ctwaContext?: {
|
|
102
|
+
conversionSource?: string;
|
|
103
|
+
conversionData?: object;
|
|
104
|
+
sourceUrl?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
title?: string;
|
|
107
|
+
thumbnail?: string;
|
|
108
|
+
thumbnailUrl?: string;
|
|
109
|
+
mediaType?: number;
|
|
110
|
+
adContextPreviewDismissed?: boolean;
|
|
111
|
+
sourceApp?: string;
|
|
112
|
+
greetingMessageBody?: string;
|
|
113
|
+
automatedGreetingMessageShown?: boolean;
|
|
114
|
+
sourceId?: string;
|
|
115
|
+
originalImageUrl?: string;
|
|
116
|
+
mediaUrl?: string;
|
|
117
|
+
};
|
|
101
118
|
}
|
|
102
119
|
export interface MediaData {
|
|
103
120
|
type: string;
|
package/dist/api/whatsapp.js
CHANGED
|
@@ -219,7 +219,7 @@ var Whatsapp = /** @class */ (function (_super) {
|
|
|
219
219
|
return __generator(this, function (_a) {
|
|
220
220
|
if (this.statusFind) {
|
|
221
221
|
try {
|
|
222
|
-
this.statusFind('
|
|
222
|
+
this.statusFind('disconnectedMobile', session);
|
|
223
223
|
}
|
|
224
224
|
catch (error) { }
|
|
225
225
|
}
|
|
@@ -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.10294x',
|
|
24
24
|
deviceName: false,
|
|
25
25
|
linkPreviewApiServers: null,
|
|
26
26
|
disableGoogleAnalytics: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.7",
|
|
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",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://github.com/wppconnect-team/wppconnect#readme",
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@babel/core": "^7.28.
|
|
59
|
-
"@babel/eslint-parser": "^7.28.
|
|
58
|
+
"@babel/core": "^7.28.5",
|
|
59
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
60
60
|
"@babel/eslint-plugin": "^7.27.1",
|
|
61
|
-
"@babel/preset-env": "^7.28.
|
|
62
|
-
"@commitlint/cli": "^
|
|
63
|
-
"@commitlint/config-conventional": "^
|
|
64
|
-
"@commitlint/cz-commitlint": "^
|
|
61
|
+
"@babel/preset-env": "^7.28.5",
|
|
62
|
+
"@commitlint/cli": "^20.1.0",
|
|
63
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
64
|
+
"@commitlint/cz-commitlint": "^20.1.0",
|
|
65
65
|
"@types/atob": "^2.1.4",
|
|
66
|
-
"@types/mime-types": "^
|
|
66
|
+
"@types/mime-types": "^3.0.1",
|
|
67
67
|
"@types/mocha": "^10.0.10",
|
|
68
|
-
"@types/node": "^
|
|
68
|
+
"@types/node": "^24.10.1",
|
|
69
69
|
"@types/shelljs": "^0.8.17",
|
|
70
70
|
"@types/tmp": "^0.2.6",
|
|
71
71
|
"@types/ws": "^8.18.1",
|
|
@@ -80,23 +80,23 @@
|
|
|
80
80
|
"eslint-plugin-header": "^3.1.1",
|
|
81
81
|
"eslint-plugin-prettier": "^4.2.5",
|
|
82
82
|
"husky": "^9.1.7",
|
|
83
|
-
"mocha": "^11.7.
|
|
83
|
+
"mocha": "^11.7.5",
|
|
84
84
|
"prettier": "^2.8.8",
|
|
85
85
|
"pretty-quick": "^4.2.2",
|
|
86
86
|
"regenerator-runtime": "^0.14.1",
|
|
87
|
-
"release-it": "^19.0.
|
|
87
|
+
"release-it": "^19.0.6",
|
|
88
88
|
"shx": "^0.4.0",
|
|
89
89
|
"ts-node": "^10.9.2",
|
|
90
|
-
"typedoc": "^0.28.
|
|
91
|
-
"typescript": "^5.9.
|
|
92
|
-
"webpack": "^5.
|
|
93
|
-
"webpack-cli": "^
|
|
90
|
+
"typedoc": "^0.28.14",
|
|
91
|
+
"typescript": "^5.9.3",
|
|
92
|
+
"webpack": "^5.103.0",
|
|
93
|
+
"webpack-cli": "^6.0.1"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@wppconnect/wa-js": "^3.
|
|
97
|
-
"@wppconnect/wa-version": "^1.5.
|
|
96
|
+
"@wppconnect/wa-js": "^3.19.2",
|
|
97
|
+
"@wppconnect/wa-version": "^1.5.2714",
|
|
98
98
|
"atob": "^2.1.2",
|
|
99
|
-
"axios": "^1.
|
|
99
|
+
"axios": "^1.13.2",
|
|
100
100
|
"boxen": "^5.1.2",
|
|
101
101
|
"catch-exit": "^2.0.0",
|
|
102
102
|
"chalk": "~4.1.2",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"latest-version": "^5.1.0",
|
|
108
108
|
"logform": "^2.7.0",
|
|
109
109
|
"lookpath": "^1.2.3",
|
|
110
|
-
"mime-types": "^
|
|
111
|
-
"puppeteer": "^24.
|
|
110
|
+
"mime-types": "^3.0.2",
|
|
111
|
+
"puppeteer": "^24.31.0",
|
|
112
112
|
"puppeteer-extra": "^3.3.6",
|
|
113
113
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
114
114
|
"puppeteer-extra-plugin-user-data-dir": "^2.4.1",
|
|
@@ -117,14 +117,14 @@
|
|
|
117
117
|
"reflect-metadata": "^0.2.1",
|
|
118
118
|
"rimraf": "^3.0.2",
|
|
119
119
|
"sanitize-filename": "^1.6.3",
|
|
120
|
-
"sharp": "0.34.
|
|
120
|
+
"sharp": "0.34.5",
|
|
121
121
|
"tmp": "^0.2.5",
|
|
122
122
|
"tree-kill": "^1.2.2",
|
|
123
|
-
"winston": "^3.
|
|
123
|
+
"winston": "^3.18.3",
|
|
124
124
|
"ws": "^8.18.3"
|
|
125
125
|
},
|
|
126
126
|
"optionalDependencies": {
|
|
127
|
-
"@img/sharp-win32-x64": "^0.34.
|
|
127
|
+
"@img/sharp-win32-x64": "^0.34.5",
|
|
128
128
|
"fsevents": "^2.3.3"
|
|
129
129
|
},
|
|
130
130
|
"directories": {
|