@wppconnect-team/wppconnect 1.37.4 → 1.37.6

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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## <small>1.37.6 (2025-11-11)</small>
2
+
3
+ - [update] version whatsapp web (#2609) ([cf04c5d](https://github.com/wppconnect-team/wppconnect/commit/cf04c5d)), closes [#2609](https://github.com/wppconnect-team/wppconnect/issues/2609)
4
+
5
+ ## <small>1.37.5 (2025-09-16)</small>
6
+
7
+ - chore: update wajs ([9b3f4d5](https://github.com/wppconnect-team/wppconnect/commit/9b3f4d5))
8
+
1
9
  ## <small>1.37.4 (2025-08-29)</small>
2
10
 
3
11
  - fix(deps): update dependency @wppconnect/wa-version to ^1.5.2110 (#2555) ([baad13c](https://github.com/wppconnect-team/wppconnect/commit/baad13c)), closes [#2555](https://github.com/wppconnect-team/wppconnect/issues/2555)
@@ -130,4 +130,10 @@ 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<string>;
133
139
  }
@@ -804,6 +804,23 @@ 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
+ };
807
824
  return HostLayer;
808
825
  }());
809
826
  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, TextMessageOptions, PoolMessageOptions, ForwardMessagesOptions, AllMessageOptions, SendMessageOptions } from '@wppconnect/wa-js/dist/chat';
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);
@@ -169,8 +169,9 @@ 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
177
  sendMsgResult: import("@wppconnect/wa-js/dist/whatsapp/enums").SendMsgResult;
@@ -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
@@ -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
  *
@@ -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 (to, base64, filename, caption, quotedMessageId, messageId) {
575
- return __awaiter(this, void 0, void 0, function () {
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: true,
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 (to, filePath, filename, caption, quotedMessageId, messageId) {
625
- return __awaiter(this, void 0, void 0, function () {
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
  *
@@ -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) { return WPP.chat.openChatAt(chatId, messageId); }, 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.defaultOptions = {
20
20
  waitForLogin: true,
21
21
  logger: logger_1.defaultLogger,
22
22
  tokenStore: 'file',
23
- whatsappVersion: '2.3000.10258x',
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.4",
3
+ "version": "1.37.6",
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.0",
59
- "@babel/eslint-parser": "^7.28.0",
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.0",
62
- "@commitlint/cli": "^19.8.1",
63
- "@commitlint/config-conventional": "^19.8.1",
64
- "@commitlint/cz-commitlint": "^19.8.1",
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": "^2.1.4",
66
+ "@types/mime-types": "^3.0.1",
67
67
  "@types/mocha": "^10.0.10",
68
- "@types/node": "^22.17.1",
68
+ "@types/node": "^24.10.0",
69
69
  "@types/shelljs": "^0.8.17",
70
70
  "@types/tmp": "^0.2.6",
71
71
  "@types/ws": "^8.18.1",
@@ -73,30 +73,30 @@
73
73
  "@typescript-eslint/parser": "^5.62.0",
74
74
  "babel-loader": "^10.0.0",
75
75
  "commitizen": "^4.3.1",
76
- "concurrently": "^9.2.0",
76
+ "concurrently": "^9.2.1",
77
77
  "conventional-changelog-cli": "^5.0.0",
78
78
  "eslint": "^8.57.1",
79
79
  "eslint-config-prettier": "^10.1.8",
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.1",
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.4",
87
+ "release-it": "^19.0.5",
88
88
  "shx": "^0.4.0",
89
89
  "ts-node": "^10.9.2",
90
- "typedoc": "^0.28.10",
91
- "typescript": "^5.9.2",
92
- "webpack": "^5.101.1",
93
- "webpack-cli": "^5.1.4"
90
+ "typedoc": "^0.28.14",
91
+ "typescript": "^5.9.3",
92
+ "webpack": "^5.102.1",
93
+ "webpack-cli": "^6.0.1"
94
94
  },
95
95
  "dependencies": {
96
- "@wppconnect/wa-js": "^3.18.1",
97
- "@wppconnect/wa-version": "^1.5.2110",
96
+ "@wppconnect/wa-js": "^3.18.8",
97
+ "@wppconnect/wa-version": "^1.5.2614",
98
98
  "atob": "^2.1.2",
99
- "axios": "^1.11.0",
99
+ "axios": "^1.13.1",
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": "^2.1.35",
111
- "puppeteer": "^24.16.1",
110
+ "mime-types": "^3.0.1",
111
+ "puppeteer": "^24.27.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,10 +117,10 @@
117
117
  "reflect-metadata": "^0.2.1",
118
118
  "rimraf": "^3.0.2",
119
119
  "sanitize-filename": "^1.6.3",
120
- "sharp": "0.34.3",
120
+ "sharp": "0.34.4",
121
121
  "tmp": "^0.2.5",
122
122
  "tree-kill": "^1.2.2",
123
- "winston": "^3.17.0",
123
+ "winston": "^3.18.3",
124
124
  "ws": "^8.18.3"
125
125
  },
126
126
  "optionalDependencies": {