@wppconnect/wa-js 1.2.1 → 1.2.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 CHANGED
@@ -1,3 +1,25 @@
1
+ ## 1.2.4 (2022-03-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * Working on template buttons support ([ecf0a81](https://github.com/wppconnect-team/wa-js/commit/ecf0a813da0a3c3c811e3d6cf6611ea98ed1f18c))
7
+
8
+
9
+
10
+ ## 1.2.3 (2022-03-16)
11
+
12
+
13
+
14
+ ## 1.2.2 (2022-03-12)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * Fixed WPP.chat.deleteMessage for old versions (fix wppconnect-team/wppconnect[#937](https://github.com/wppconnect-team/wa-js/issues/937)) ([a53ec55](https://github.com/wppconnect-team/wa-js/commit/a53ec55a04d3efa117dfd31ec4f1b2131ba85622))
20
+
21
+
22
+
1
23
  ## 1.2.1 (2022-03-09)
2
24
 
3
25
 
@@ -32,6 +32,10 @@ export interface EventTypes {
32
32
  */
33
33
  refId: MsgKey;
34
34
  to: Wid;
35
+ /**
36
+ * Type of revoke
37
+ */
38
+ type: 'revoke' | 'sender_revoke' | 'admin_revoke';
35
39
  };
36
40
  msg_ack_change: {
37
41
  ack: number;
@@ -14,18 +14,30 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { RawMessage } from '..';
17
+ export declare type MessageButtonsTypes = {
18
+ id: string;
19
+ text: string;
20
+ } | {
21
+ phoneNumber: string;
22
+ text: string;
23
+ } | {
24
+ url: string;
25
+ text: string;
26
+ };
17
27
  export interface MessageButtonsOptions {
18
28
  /**
19
29
  * List of buttons, with at least 1 option and a maximum of 3
20
30
  */
21
- buttons?: Array<{
22
- id: string;
23
- text: string;
24
- }>;
31
+ buttons?: Array<MessageButtonsTypes>;
25
32
  /**
26
33
  * Title for buttons, only for text message
27
34
  */
28
35
  title?: string;
36
+ /**
37
+ * Set to use template buttons instead of reply buttons.
38
+ * @default: undefined - auto detect
39
+ */
40
+ useTemplateButtons?: boolean;
29
41
  /**
30
42
  * Footer text for buttons
31
43
  */
@@ -15,3 +15,8 @@
15
15
  */
16
16
  /** @whatsapp 13194 */
17
17
  export declare function isAuthenticated(): boolean;
18
+ /**
19
+ * @whatsapp 13194
20
+ * whatsapp >= 2.2208.11
21
+ */
22
+ export declare function isLoggedIn(): boolean;
@@ -141,6 +141,7 @@ export declare class ChatModel extends ModelChatBase {
141
141
  };
142
142
  sendStarMsgs(msgs: MsgModel[], star: boolean): any;
143
143
  sendRevokeMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
144
+ sendRevokeMsgs(messages: MsgModel[], sender: string, deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
144
145
  sendDeleteMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
145
146
  deleteMsgs(e?: any, t?: any): any;
146
147
  deleteMsgsOlderThan(e?: any, t?: any, r?: any): any;
@@ -195,5 +196,6 @@ export declare class ChatModel extends ModelChatBase {
195
196
  replaceMsgsCollection(e?: any): any;
196
197
  removeMsgsCollection(e?: any): any;
197
198
  notifyMsgCollectionMerge(e?: any, t?: any, r?: any, a?: any): any;
199
+ canSenderRevoke(): boolean;
198
200
  }
199
201
  export {};
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { TextFontStyle } from '../../enums';
17
- import { ButtonCollection, MsgCollection } from '../collections';
17
+ import { ButtonCollection, MsgCollection, TemplateButtonCollection } from '../collections';
18
18
  import { MediaObject, MsgKey, Wid } from '../misc';
19
19
  import { ChatModel, MediaDataModel } from '.';
20
20
  import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
@@ -115,8 +115,22 @@ interface Props {
115
115
  quotedParticipant?: any;
116
116
  mentionedJidList?: Wid[];
117
117
  footer?: string;
118
- hydratedButtons?: any;
119
- buttons?: any;
118
+ hydratedButtons?: Array<{
119
+ index?: number;
120
+ quickReplyButton?: {
121
+ displayText: string;
122
+ id: string;
123
+ };
124
+ urlButton?: {
125
+ displayText: string;
126
+ url: string;
127
+ };
128
+ callButton?: {
129
+ displayText: string;
130
+ phoneNumber: string;
131
+ };
132
+ }>;
133
+ buttons?: TemplateButtonCollection;
120
134
  selectedId?: any;
121
135
  selectedIndex?: any;
122
136
  multicast?: any;