@wppconnect/wa-js 3.8.4 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## 3.8.4 (2024-08-24)
1
+ # 3.9.0 (2024-08-27)
2
2
 
3
3
 
4
4
 
@@ -43,7 +43,7 @@ export interface MessageButtonsOptions {
43
43
  * Set to use interactive message instead of reply buttons.
44
44
  * @default: undefined - auto detect
45
45
  */
46
- useInteractiveMesssage?: boolean | null;
46
+ useInteractiveMessage?: boolean | null;
47
47
  /**
48
48
  * Footer text for buttons
49
49
  */
@@ -27,6 +27,12 @@ export interface OrderMessageOptions extends SendMessageOptions {
27
27
  tax?: number;
28
28
  shipping?: number;
29
29
  offset?: number;
30
+ pix?: {
31
+ keyType: 'CNPJ' | 'CPF' | 'PHONE' | 'EMAIL' | 'EVP';
32
+ name: string;
33
+ key: string;
34
+ };
35
+ payment_instruction?: string;
30
36
  }
31
37
  /**
32
38
  * Send a order message
@@ -51,6 +57,21 @@ export interface OrderMessageOptions extends SendMessageOptions {
51
57
  * { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
52
58
  * ],
53
59
  * { tax: 10000, shipping: 4000, discount: 10000 }
60
+ *
61
+ * // Send charge with Pix data (auto generate copy-paste pix code)
62
+ * WPP.chat.sendChargeMessage('[number]@c.us', [
63
+ * { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
64
+ * ],
65
+ * {
66
+ * tax: 10000,
67
+ * shipping: 4000,
68
+ * discount: 10000,
69
+ * pix: {
70
+ * keyType: 'CPF',
71
+ * key: '00555095999',
72
+ * name: 'Name of seller',
73
+ * },
74
+ * });
54
75
  * ```
55
76
  * @category Message
56
77
  */
@@ -35,6 +35,20 @@ export interface GroupInviteMessage extends SendMessageOptions {
35
35
  * groupId: '789@g.us'
36
36
  * }
37
37
  * );
38
+ *
39
+ * // After a invite
40
+ * const result = await WPP.group.addParticipants('789@g.us', '123@c.us');
41
+ * const participant = result['123@c.us'];
42
+ * if (participant.invite_code) {
43
+ * WPP.chat.sendGroupInviteMessage(
44
+ * '123@c.us',
45
+ * {
46
+ * inviteCode: participant.invite_code,
47
+ * inviteCodeExpiration: participant.invite_code_exp,
48
+ * groupId: '789@g.us'
49
+ * }
50
+ * );
51
+ * }
38
52
  * ```
39
53
  *
40
54
  * @category Message
@@ -26,7 +26,7 @@ export type TextMessageOptions = SendMessageOptions & MessageButtonsOptions & Li
26
26
  *
27
27
  * // With Buttons
28
28
  * WPP.chat.sendTextMessage('[number]@c.us', 'Hello', {
29
- * useTemplateButtons: true, // False for legacy
29
+ * useInteractiveMessage: true, // False for legacy
30
30
  * buttons: [
31
31
  * {
32
32
  * url: 'https://wppconnect.io/',