@wppconnect-team/wppconnect 1.36.4 → 1.37.1

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.1 (2025-05-01)</small>
2
+
3
+ - fix(deps): update dependency @wppconnect/wa-js to ^3.17.2 (#2490) ([95a6d9e](https://github.com/wppconnect-team/wppconnect/commit/95a6d9e)), closes [#2490](https://github.com/wppconnect-team/wppconnect/issues/2490)
4
+
5
+ ## 1.37.0 (2025-04-15)
6
+
7
+ - build(deps-dev): update dependency @types/node to ^20.17.30 (#2481) ([dcd6088](https://github.com/wppconnect-team/wppconnect/commit/dcd6088)), closes [#2481](https://github.com/wppconnect-team/wppconnect/issues/2481)
8
+
1
9
  ## <small>1.36.4 (2025-03-29)</small>
2
10
 
3
11
  - fix(deps): update dependency @wppconnect/wa-js to ^3.17.0 (#2473) ([597a6ac](https://github.com/wppconnect-team/wppconnect/commit/597a6ac)), closes [#2473](https://github.com/wppconnect-team/wppconnect/issues/2473)
@@ -1,10 +1,11 @@
1
- import type { FileMessageOptions, ListMessageOptions, LocationMessageOptions, SendMessageReturn, TextMessageOptions, PoolMessageOptions, ForwardMessagesOptions, AllMessageOptions } from '@wppconnect/wa-js/dist/chat';
1
+ import type { FileMessageOptions, ListMessageOptions, LocationMessageOptions, TextMessageOptions, PoolMessageOptions, ForwardMessagesOptions, AllMessageOptions, SendMessageOptions } from '@wppconnect/wa-js/dist/chat';
2
2
  import { Page } from 'puppeteer';
3
3
  import { CreateConfig } from '../../config/create-config';
4
4
  import { Message, Wid } from '../model';
5
5
  import { ChatState } from '../model/enum';
6
6
  import { ListenerLayer } from './listener.layer';
7
7
  import { OrderItems, OrderMessageOptions } from '@wppconnect/wa-js/dist/chat/functions/sendChargeMessage';
8
+ import { PixParams } from '../../types/WAPI';
8
9
  export declare class SenderLayer extends ListenerLayer {
9
10
  page: Page;
10
11
  constructor(page: Page, session?: string, options?: CreateConfig);
@@ -19,7 +20,7 @@ export declare class SenderLayer extends ListenerLayer {
19
20
  * @param url string A link, for example for youtube. e.g https://www.youtube.com/watch?v=Zi_XLOBDo_Y&list=RDEMe12_MlgO8mGFdeeftZ2nOQ&start_radio=1
20
21
  * @param text custom text as the message body, this includes the link or will be attached after the link
21
22
  */
22
- sendLinkPreview(chatId: string, url: string, text?: string): Promise<SendMessageReturn>;
23
+ sendLinkPreview(chatId: string, url: string, text?: string): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
23
24
  /**
24
25
  * Sends a text message to given chat
25
26
  * @category Chat
@@ -63,6 +64,24 @@ export declare class SenderLayer extends ListenerLayer {
63
64
  * ```
64
65
  */
65
66
  sendText(to: string, content: string, options?: TextMessageOptions): Promise<Message>;
67
+ /**
68
+ * Sends a pix message to given chat
69
+ * @category Chat
70
+ * @param to chat id: xxxxx@us.c
71
+ * @param content pix message
72
+ *
73
+ * @example
74
+ * ```javascript
75
+ * // Simple message
76
+ * client.sendPix('<number>@c.us', {
77
+ keyType: 'PHONE',
78
+ name: 'WPPCONNECT-TEAM',
79
+ key: '+5567123456789',
80
+ instructions: 'teste',
81
+ });
82
+ * ```
83
+ */
84
+ sendPixKey(to: string, params: PixParams, options?: SendMessageOptions): Promise<Message>;
66
85
  /**
67
86
  *
68
87
  * @category Chat
@@ -126,7 +145,7 @@ export declare class SenderLayer extends ListenerLayer {
126
145
  * @param description
127
146
  * @param chatId
128
147
  */
129
- sendMessageWithThumb(pathOrBase64: string, url: string, title: string, description: string, chatId: string): Promise<SendMessageReturn>;
148
+ sendMessageWithThumb(pathOrBase64: string, url: string, title: string, description: string, chatId: string): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
130
149
  /**
131
150
  * Replies to given mesage id of given chat id
132
151
  *
@@ -297,7 +316,7 @@ export declare class SenderLayer extends ListenerLayer {
297
316
  * @param to Chat id
298
317
  * @param contactsId Example: 0000@c.us | [000@c.us, 1111@c.us]
299
318
  */
300
- sendContactVcard(to: string, contactsId: string, name?: string): Promise<SendMessageReturn>;
319
+ sendContactVcard(to: string, contactsId: string, name?: string): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
301
320
  /**
302
321
  * Send a list of contact cards
303
322
  * @category Chat
@@ -307,7 +326,7 @@ export declare class SenderLayer extends ListenerLayer {
307
326
  sendContactVcardList(to: string, contacts: (string | {
308
327
  id: string;
309
328
  name: string;
310
- })[]): Promise<SendMessageReturn>;
329
+ })[]): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
311
330
  /**
312
331
  * Forwards array of messages (could be ids or message objects)
313
332
  * @category Chat
@@ -336,7 +355,7 @@ export declare class SenderLayer extends ListenerLayer {
336
355
  * @param pathOrBase64 image path imageBase64 A valid gif image is required. You can also send via http/https (http://www.website.com/img.gif)
337
356
  * @param to chatId '000000000000@c.us'
338
357
  */
339
- sendImageAsStickerGif(to: string, pathOrBase64: string, options?: AllMessageOptions): Promise<SendMessageReturn>;
358
+ sendImageAsStickerGif(to: string, pathOrBase64: string, options?: AllMessageOptions): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
340
359
  /**
341
360
  * Generates sticker from given image and sends it (Send Image As Sticker)
342
361
  *
@@ -357,7 +376,7 @@ export declare class SenderLayer extends ListenerLayer {
357
376
  * @param pathOrBase64 image path imageBase64 A valid png, jpg and webp image is required. You can also send via http/https (http://www.website.com/img.gif)
358
377
  * @param to chatId '000000000000@c.us'
359
378
  */
360
- sendImageAsSticker(to: string, pathOrBase64: string, options?: AllMessageOptions): Promise<SendMessageReturn>;
379
+ sendImageAsSticker(to: string, pathOrBase64: string, options?: AllMessageOptions): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
361
380
  /**
362
381
  * Sends location to given chat id
363
382
  * @category Chat
@@ -442,7 +461,7 @@ export declare class SenderLayer extends ListenerLayer {
442
461
  * Sends text with tags
443
462
  * @category Chat
444
463
  */
445
- sendMentioned(to: string, message: string, mentioned: string[]): Promise<SendMessageReturn>;
464
+ sendMentioned(to: string, message: string, mentioned: string[]): Promise<import("@wppconnect/wa-js/dist/chat").SendMessageReturn>;
446
465
  /**
447
466
  * Sends a list message
448
467
  *
@@ -231,6 +231,58 @@ var SenderLayer = /** @class */ (function (_super) {
231
231
  });
232
232
  });
233
233
  };
234
+ /**
235
+ * Sends a pix message to given chat
236
+ * @category Chat
237
+ * @param to chat id: xxxxx@us.c
238
+ * @param content pix message
239
+ *
240
+ * @example
241
+ * ```javascript
242
+ * // Simple message
243
+ * client.sendPix('<number>@c.us', {
244
+ keyType: 'PHONE',
245
+ name: 'WPPCONNECT-TEAM',
246
+ key: '+5567123456789',
247
+ instructions: 'teste',
248
+ });
249
+ * ```
250
+ */
251
+ SenderLayer.prototype.sendPixKey = function (to, params, options) {
252
+ return __awaiter(this, void 0, void 0, function () {
253
+ var sendResult, result;
254
+ var _this = this;
255
+ return __generator(this, function (_a) {
256
+ switch (_a.label) {
257
+ case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
258
+ var to = _a.to, params = _a.params, options = _a.options;
259
+ return WPP.chat.sendPixKeyMessage(to, params, __assign(__assign({}, options), { waitForAck: true }));
260
+ }, { to: to, params: params, options: options })];
261
+ case 1:
262
+ sendResult = _a.sent();
263
+ return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
264
+ var _c, _d, _e, _f;
265
+ var messageId = _b.messageId;
266
+ return __generator(this, function (_g) {
267
+ switch (_g.label) {
268
+ case 0:
269
+ _d = (_c = JSON).parse;
270
+ _f = (_e = JSON).stringify;
271
+ return [4 /*yield*/, WAPI.getMessageById(messageId)];
272
+ case 1: return [2 /*return*/, _d.apply(_c, [_f.apply(_e, [_g.sent()])])];
273
+ }
274
+ });
275
+ }); }, { messageId: sendResult.id })];
276
+ case 2:
277
+ result = (_a.sent());
278
+ if (result['erro'] == true) {
279
+ throw result;
280
+ }
281
+ return [2 /*return*/, result];
282
+ }
283
+ });
284
+ });
285
+ };
234
286
  /**
235
287
  *
236
288
  * @category Chat
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect-team/wppconnect",
3
- "version": "1.36.4",
3
+ "version": "1.37.1",
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",
@@ -65,7 +65,7 @@
65
65
  "@types/atob": "^2.1.4",
66
66
  "@types/mime-types": "^2.1.4",
67
67
  "@types/mocha": "^10.0.9",
68
- "@types/node": "^20.17.24",
68
+ "@types/node": "^20.17.30",
69
69
  "@types/shelljs": "^0.8.15",
70
70
  "@types/tmp": "^0.2.6",
71
71
  "@types/ws": "^8.18.0",
@@ -88,15 +88,15 @@
88
88
  "shx": "^0.3.4",
89
89
  "ts-node": "^10.9.2",
90
90
  "typedoc": "^0.28.1",
91
- "typescript": "^5.8.2",
91
+ "typescript": "^5.8.3",
92
92
  "webpack": "^5.98.0",
93
93
  "webpack-cli": "^5.1.4"
94
94
  },
95
95
  "dependencies": {
96
- "@wppconnect/wa-js": "^3.17.0",
97
- "@wppconnect/wa-version": "^1.5.1261",
96
+ "@wppconnect/wa-js": "^3.17.2",
97
+ "@wppconnect/wa-version": "^1.5.1433",
98
98
  "atob": "^2.1.2",
99
- "axios": "^1.8.4",
99
+ "axios": "^1.9.0",
100
100
  "boxen": "^5.1.2",
101
101
  "catch-exit": "^1.2.2",
102
102
  "chalk": "~4.1.2",