@wppconnect/wa-js 2.27.0 → 2.28.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,9 +1,4 @@
1
- # 2.27.0 (2023-10-08)
2
-
3
-
4
- ### Features
5
-
6
- * Added newsletter functions (close [#1365](https://github.com/wppconnect-team/wa-js/issues/1365)) ([#1386](https://github.com/wppconnect-team/wa-js/issues/1386)) ([b0bab71](https://github.com/wppconnect-team/wa-js/commit/b0bab717f9370a0be9767c6500df697cce083415))
1
+ ## 2.28.1 (2023-12-20)
7
2
 
8
3
 
9
4
 
@@ -28,13 +28,13 @@ export interface DeleteMessageReturn {
28
28
  * @example
29
29
  * ```javascript
30
30
  * // Delete a message
31
- * WPP.chat.deleteMessage('[number]@callback.us', 'msgid');
31
+ * WPP.chat.deleteMessage('[number]@c.us', 'msgid');
32
32
  * // Delete a list of messages
33
- * WPP.chat.deleteMessage('[number]@callback.us', ['msgid1', 'msgid2]);
33
+ * WPP.chat.deleteMessage('[number]@c.us', ['msgid1', 'msgid2]);
34
34
  * // Delete a message and delete media
35
- * WPP.chat.deleteMessage('[number]@callback.us', 'msgid', true);
35
+ * WPP.chat.deleteMessage('[number]@c.us', 'msgid', true);
36
36
  * // Revoke a message
37
- * WPP.chat.deleteMessage('[number]@callback.us', 'msgid', true, true);
37
+ * WPP.chat.deleteMessage('[number]@c.us', 'msgid', true, true);
38
38
  * ```
39
39
  *
40
40
  * @category Message
@@ -36,6 +36,7 @@ export { getQuotedMsg } from './getQuotedMsg';
36
36
  export { getQuotedMsgKey } from './getQuotedMsgKey';
37
37
  export { getReactions } from './getReactions';
38
38
  export { getVotes } from './getVotes';
39
+ export { keepMessage } from './keepMessage';
39
40
  export { ChatListOptions, list } from './list';
40
41
  export { markIsComposing } from './markIsComposing';
41
42
  export { markIsPaused } from './markIsPaused';
@@ -56,10 +57,10 @@ export { PoolMessageOptions, sendCreatePollMessage, } from './sendCreatePollMess
56
57
  export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
57
58
  export { ListMessageOptions, sendListMessage } from './sendListMessage';
58
59
  export { LocationMessageOptions, sendLocationMessage, } from './sendLocationMessage';
59
- export { sendOrderMessage } from './sendOrderMessage';
60
+ export { OrderItems, OrderMessageOptions, sendOrderMessage, } from './sendOrderMessage';
60
61
  export { sendRawMessage } from './sendRawMessage';
61
62
  export { sendReactionToMessage } from './sendReactionToMessage';
62
- export { sendScheduledCallMessage } from './sendScheduledCallMessage';
63
+ export { ScheduledCallMessageOptions, sendScheduledCallMessage, } from './sendScheduledCallMessage';
63
64
  export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
64
65
  export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
65
66
  export { starMessage, StarMessageReturn } from './starMessage';
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { MsgKey, MsgModel } from '../../whatsapp';
17
+ /**
18
+ * Keep or unkeep a message in a group chat with expiration
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // To keep a message in chat
23
+ * WPP.chat.keepMessage('true_[number]@c.us_ABCDEF', true);
24
+ *
25
+ * // To unkeep a message in chat
26
+ * WPP.chat.keepMessage('true_[number]@c.us_ABCDEF', false);
27
+ * ```
28
+ * @category Chat
29
+ */
30
+ export declare function keepMessage(msgId: string | MsgKey, value?: boolean): Promise<MsgModel>;
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Alternative login method using code
18
+ * Get the Link Device Code for Authentication using the phone number
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * const code = await WPP.conn.genLinkDeviceCodeForPhoneNumber('[number]');
23
+ *
24
+ * // Disable push notification
25
+ * const code = await WPP.conn.genLinkDeviceCodeForPhoneNumber('[number]', false);
26
+ * ```
27
+ *
28
+ * @category Conn
29
+ */
30
+ export declare function genLinkDeviceCodeForPhoneNumber(phone: string, sendPushNotification?: boolean): Promise<string>;
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { genLinkDeviceCodeForPhoneNumber } from './genLinkDeviceCodeForPhoneNumber';
16
17
  export { getAuthCode } from './getAuthCode';
17
18
  export { getHistorySyncProgress, HistorySyncProgress, } from './getHistorySyncProgress';
18
19
  export { getMyDeviceId } from './getMyDeviceId';
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ContactModel, Wid } from '../../whatsapp';
17
+ /**
18
+ * Get a contact by id
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.contact.get('[number]@c.us');
23
+ * ```
24
+ *
25
+ * @category Contact
26
+ */
27
+ export declare function get(contactId: string | Wid): Promise<ContactModel | undefined>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Get all commons groups for the contact
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * const groups_ids = await WPP.contact.getCommonGroups('[number]@c.us');
23
+ * ```
24
+ *
25
+ * @category Contact
26
+ */
27
+ export declare function getCommonGroups(wid: Wid | string): Promise<Wid[]>;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2023 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { get } from './get';
16
17
  export { getBusinessProfile } from './getBusinessProfile';
18
+ export { getCommonGroups } from './getCommonGroups';
17
19
  export { getProfilePictureUrl } from './getProfilePictureUrl';
18
20
  export { getStatus } from './getStatus';
19
21
  export { ContactListOptions, list } from './list';
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * @whatsapp 982015
18
+ */
19
+ export declare enum KIC_ENTRY_POINT_TYPE {
20
+ CHAT_INFO = 1,
21
+ SEARCH = 2,
22
+ CHAT = 3,
23
+ MEDIA = 4,
24
+ DOCS = 5,
25
+ LINKS = 6
26
+ }
@@ -16,6 +16,7 @@
16
16
  export * from './ACK';
17
17
  export * from './CALL_STATES';
18
18
  export * from './GROUP_SETTING_TYPE';
19
+ export * from './KIC_ENTRY_POINT_TYP';
19
20
  export * from './LogoutReason';
20
21
  export * from './MSG_TYPE';
21
22
  export * from './OUTWARD_TYPES';
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../misc';
17
+ /**
18
+ * @whatsapp 355813
19
+ */
20
+ export declare function GROUP_JID(jid: Wid): any;
21
+ export declare function CHAT_JID(jid: Wid): any;
@@ -17,7 +17,7 @@ import { MsgModel, websocket, Wid } from '..';
17
17
  /**
18
18
  *
19
19
  */
20
- export declare function createFanoutMsgStanza(msg: MsgModel, proto: {
20
+ export declare function createFanoutMsgStanza(msg: MsgModel, data: any, proto: {
21
21
  [key: string]: any;
22
22
  }, devices: Wid[], options: {
23
23
  [key: string]: any;
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { BaseCollection } from '../collections';
17
+ import { ChatModel, ContactModel } from '../models';
18
+ /**
19
+ * @whatsapp 714574
20
+ */
21
+ export declare function findCommonGroups(wid: ContactModel): Promise<BaseCollection<ChatModel>>;
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { ChatModel, MsgModel } from '../models';
17
+ /** @whatsapp 69951
18
+ * @whatsapp 450192 >= 2.2353.0
19
+ */
20
+ export declare function forwardMessagesToChats(msgs: MsgModel[], chats: ChatModel[], displayCaptionText?: boolean): Promise<boolean>;
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * @whatsapp 61777
18
+ */
19
+ export declare function genLinkDeviceCodeForPhoneNumber(phone: string, pushNotification: boolean): Promise<string>;
@@ -39,9 +39,12 @@ export * from './encryptAndSendSenderKeyMsg';
39
39
  export * from './encryptMsgProtobuf';
40
40
  export * from './fetchLinkPreview';
41
41
  export * from './findChat';
42
+ export * from './findCommonGroups';
42
43
  export * from './findFirstWebLink';
44
+ export * from './forwardMessagesToChats';
43
45
  export * from './frontendFireAndForget';
44
46
  export * from './generateVideoThumbsAndDuration';
47
+ export * from './genLinkDeviceCodeForPhoneNumber';
45
48
  export * from './genMinimalLinkPreview';
46
49
  export * from './getABPropConfigValue';
47
50
  export * from './getAsMms';
@@ -62,14 +65,17 @@ export * from './getReactions';
62
65
  export * from './getSearchContext';
63
66
  export * from './getVotes';
64
67
  export * from './getWhatsAppWebExternalBetaJoinedIdb';
68
+ export * from './GROUP_JID';
65
69
  export * from './groupParticipants';
66
70
  export * from './handleAck';
67
71
  export * from './handleSingleMsg';
72
+ export * from './initializeAltDeviceLinking';
68
73
  export * from './isAnimatedWebp';
69
74
  export * from './isAuthenticated';
70
75
  export * from './isRegistered';
71
76
  export * from './isUnreadTypeMsg';
72
77
  export * from './joinGroupViaInvite';
78
+ export * from './keepMessage';
73
79
  export * from './markSeen';
74
80
  export * from './mediaTypeFromProtobuf';
75
81
  export * from './membershipApprovalRequestAction';
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * @whatsapp 518043
18
+ */
19
+ export declare function initializeAltDeviceLinking(): Promise<void>;
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * Copyright 2023 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { MsgModel } from '..';
17
+ /**
18
+ * @whatsapp 170235
19
+ */
20
+ export declare function keepMessage(msg: MsgModel, t: number): Promise<any>;
21
+ export declare function undoKeepMessage(msg: MsgModel, options: {
22
+ deleteExpired: boolean;
23
+ }, n: number): Promise<any>;