@wppconnect/wa-js 1.1.11 → 1.1.15
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 +36 -0
- package/dist/chat/functions/index.d.ts +3 -0
- package/dist/chat/functions/openChatAt.d.ts +27 -0
- package/dist/chat/functions/openChatBottom.d.ts +27 -0
- package/dist/chat/functions/openChatFromUnread.d.ts +27 -0
- package/dist/contact/functions/queryExists.d.ts +13 -0
- package/dist/group/functions/ensureGroup.d.ts +1 -1
- package/dist/group/functions/getGroupInfoFromInviteCode.d.ts +51 -0
- package/dist/group/functions/getInviteCode.d.ts +26 -0
- package/dist/group/functions/index.d.ts +7 -0
- package/dist/group/functions/join.d.ts +28 -0
- package/dist/group/functions/leave.d.ts +27 -0
- package/dist/group/functions/revokeInviteCode.d.ts +28 -0
- package/dist/group/functions/setDescription.d.ts +27 -0
- package/dist/group/functions/setProperty.d.ts +54 -0
- package/dist/group/functions/setSubject.d.ts +27 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/isBase64.d.ts +16 -0
- package/dist/whatsapp/collections/BaseCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BlocklistCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BusinessCategoriesResultCollection.d.ts +1 -1
- package/dist/whatsapp/collections/BusinessProfileCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ButtonCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CallCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CartCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CartItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/CatalogCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ChatCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ChatstateCollection.d.ts +1 -1
- package/dist/whatsapp/collections/Collection.d.ts +2 -2
- package/dist/whatsapp/collections/ContactCollection.d.ts +1 -1
- package/dist/whatsapp/collections/EmojiVariantCollection.d.ts +1 -1
- package/dist/whatsapp/collections/GroupMetadataCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LabelCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LabelItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/LiveLocationCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MsgCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MsgInfoCollection.d.ts +1 -1
- package/dist/whatsapp/collections/MuteCollection.d.ts +1 -1
- package/dist/whatsapp/collections/OrderCollection.d.ts +1 -1
- package/dist/whatsapp/collections/OrderItemCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ParticipantCollection.d.ts +1 -1
- package/dist/whatsapp/collections/PresenceCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductCollCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductImageCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProductMessageListCollection.d.ts +1 -1
- package/dist/whatsapp/collections/ProfilePicThumbCollection.d.ts +1 -1
- package/dist/whatsapp/collections/QuickReplyCollection.d.ts +1 -1
- package/dist/whatsapp/collections/RecentEmojiCollection.d.ts +1 -1
- package/dist/whatsapp/collections/RecentStickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StarredMsgCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StarredStickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StatusCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StatusV3Collection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerPackCollection.d.ts +1 -1
- package/dist/whatsapp/collections/StickerSearchCollection.d.ts +1 -1
- package/dist/whatsapp/collections/TemplateButtonCollection.d.ts +1 -1
- package/dist/whatsapp/enums/GROUP_SETTING_TYPE.d.ts +22 -0
- package/dist/whatsapp/enums/LogoutReason.d.ts +1 -1
- package/dist/whatsapp/enums/OUTWARD_TYPES.d.ts +1 -1
- package/dist/whatsapp/enums/SendMsgResult.d.ts +1 -1
- package/dist/whatsapp/enums/index.d.ts +1 -0
- package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/blockContact.d.ts +2 -2
- package/dist/whatsapp/functions/createMsgProtobuf.d.ts +20 -0
- package/dist/whatsapp/functions/fetchLinkPreview.d.ts +1 -1
- package/dist/whatsapp/functions/findChat.d.ts +1 -1
- package/dist/whatsapp/functions/findFirstWebLink.d.ts +1 -1
- package/dist/whatsapp/functions/getOrGenerate.d.ts +1 -1
- package/dist/whatsapp/functions/groupParticipants.d.ts +4 -4
- package/dist/whatsapp/functions/handleAck.d.ts +3 -3
- package/dist/whatsapp/functions/index.d.ts +7 -0
- package/dist/whatsapp/functions/isAuthenticated.d.ts +1 -1
- package/dist/whatsapp/functions/markSeen.d.ts +3 -3
- package/dist/whatsapp/functions/msgFindQuery.d.ts +1 -1
- package/dist/whatsapp/functions/products.d.ts +4 -4
- package/dist/whatsapp/functions/profilePic.d.ts +1 -1
- package/dist/whatsapp/functions/randomId.d.ts +2 -2
- package/dist/whatsapp/functions/sendCallSignalingMsg.d.ts +34 -0
- package/dist/whatsapp/functions/sendClear.d.ts +1 -1
- package/dist/whatsapp/functions/sendCreateGroup.d.ts +1 -1
- package/dist/whatsapp/functions/sendDelete.d.ts +1 -1
- package/dist/whatsapp/functions/sendExitGroup.d.ts +18 -0
- package/dist/whatsapp/functions/sendJoinGroupViaInvite.d.ts +18 -0
- package/dist/whatsapp/functions/sendQueryExists.d.ts +1 -1
- package/dist/whatsapp/functions/sendQueryGroupInvite.d.ts +44 -0
- package/dist/whatsapp/functions/sendQueryGroupInviteCode.d.ts +18 -0
- package/dist/whatsapp/functions/sendRevokeGroupInviteCode.d.ts +18 -0
- package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/setGroup.d.ts +23 -0
- package/dist/whatsapp/functions/status.d.ts +2 -2
- package/dist/whatsapp/functions/uploadProductImage.d.ts +1 -1
- package/dist/whatsapp/misc/Base64.d.ts +1 -1
- package/dist/whatsapp/misc/Browser.d.ts +1 -1
- package/dist/whatsapp/misc/ChatPresence.d.ts +1 -1
- package/dist/whatsapp/misc/Clock.d.ts +2 -2
- package/dist/whatsapp/misc/Cmd.d.ts +6 -5
- package/dist/whatsapp/misc/Conn.d.ts +1 -1
- package/dist/whatsapp/misc/Constants.d.ts +1 -1
- package/dist/whatsapp/misc/EventEmitter.d.ts +1 -1
- package/dist/whatsapp/misc/Features.d.ts +1 -1
- package/dist/whatsapp/misc/ImageUtils.d.ts +1 -1
- package/dist/whatsapp/misc/Locale.d.ts +1 -1
- package/dist/whatsapp/misc/MediaBlobCache.d.ts +2 -2
- package/dist/whatsapp/misc/MediaObject.d.ts +1 -1
- package/dist/whatsapp/misc/MediaObjectUtil.d.ts +1 -1
- package/dist/whatsapp/misc/MediaPrep.d.ts +1 -1
- package/dist/whatsapp/misc/MediaUtils.d.ts +1 -1
- package/dist/whatsapp/misc/MsgKey.d.ts +1 -1
- package/dist/whatsapp/misc/MsgLoadState.d.ts +2 -2
- package/dist/whatsapp/misc/OpaqueData.d.ts +2 -2
- package/dist/whatsapp/misc/State.d.ts +1 -1
- package/dist/whatsapp/misc/UserPrefs.d.ts +1 -1
- package/dist/whatsapp/misc/VCard.d.ts +1 -1
- package/dist/whatsapp/misc/Wap.d.ts +2 -2
- package/dist/whatsapp/misc/Wid.d.ts +1 -1
- package/dist/whatsapp/misc/WidFactory.d.ts +1 -1
- package/dist/whatsapp/models/AttachMediaModel.d.ts +2 -2
- package/dist/whatsapp/models/BlocklistModel.d.ts +2 -2
- package/dist/whatsapp/models/BusinessCategoriesResultModel.d.ts +2 -2
- package/dist/whatsapp/models/BusinessProfileModel.d.ts +2 -2
- package/dist/whatsapp/models/CallModel.d.ts +2 -2
- package/dist/whatsapp/models/CallParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/CartItemModel.d.ts +2 -2
- package/dist/whatsapp/models/CartModel.d.ts +2 -2
- package/dist/whatsapp/models/CatalogModel.d.ts +2 -2
- package/dist/whatsapp/models/ChatModel.d.ts +4 -3
- package/dist/whatsapp/models/ChatPreferenceModel.d.ts +2 -2
- package/dist/whatsapp/models/ChatstateModel.d.ts +2 -2
- package/dist/whatsapp/models/ConnModel.d.ts +2 -2
- package/dist/whatsapp/models/ContactModel.d.ts +2 -2
- package/dist/whatsapp/models/ConversionTupleModel.d.ts +2 -2
- package/dist/whatsapp/models/EmojiVariantModel.d.ts +2 -2
- package/dist/whatsapp/models/GroupMetadataModel.d.ts +4 -4
- package/dist/whatsapp/models/LabelItemModel.d.ts +2 -2
- package/dist/whatsapp/models/LabelModel.d.ts +2 -2
- package/dist/whatsapp/models/LiveLocationModel.d.ts +2 -2
- package/dist/whatsapp/models/LiveLocationParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/MediaDataModel.d.ts +2 -2
- package/dist/whatsapp/models/Model.d.ts +1 -1
- package/dist/whatsapp/models/ModelChatBase.d.ts +1 -1
- package/dist/whatsapp/models/MsgButtonReplyMsgModel.d.ts +2 -2
- package/dist/whatsapp/models/MsgInfoModel.d.ts +2 -2
- package/dist/whatsapp/models/MsgModel.d.ts +2 -2
- package/dist/whatsapp/models/MuteModel.d.ts +2 -2
- package/dist/whatsapp/models/OrderItemModel.d.ts +2 -2
- package/dist/whatsapp/models/OrderModel.d.ts +2 -2
- package/dist/whatsapp/models/ParticipantModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductCollModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductImageModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductMessageListModel.d.ts +2 -2
- package/dist/whatsapp/models/ProductModel.d.ts +2 -2
- package/dist/whatsapp/models/ProfilePicThumbModel.d.ts +2 -2
- package/dist/whatsapp/models/QuickReplyModel.d.ts +2 -2
- package/dist/whatsapp/models/RecentEmojiModel.d.ts +2 -2
- package/dist/whatsapp/models/RecentStickerModel.d.ts +2 -2
- package/dist/whatsapp/models/ReplyButtonModel.d.ts +2 -2
- package/dist/whatsapp/models/StateModel.d.ts +2 -2
- package/dist/whatsapp/models/StatusModel.d.ts +2 -2
- package/dist/whatsapp/models/StatusV3Model.d.ts +2 -2
- package/dist/whatsapp/models/StickerModel.d.ts +2 -2
- package/dist/whatsapp/models/StickerPackModel.d.ts +2 -2
- package/dist/whatsapp/models/TemplateButtonModel.d.ts +2 -2
- package/dist/whatsapp/models/UnreadMentionModel.d.ts +2 -2
- package/dist/whatsapp/models/WebCallModel.d.ts +2 -2
- package/dist/whatsapp/multidevice/adv.d.ts +1 -1
- package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +1 -1
- package/dist/whatsapp/multidevice/waSignalStore.d.ts +1 -1
- package/dist/whatsapp/stores.d.ts +29 -29
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +15 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
## 1.1.15 (2022-02-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Fixed permission check for set group subject/description ([0ff6d58](https://github.com/wppconnect-team/wa-js/commit/0ff6d5892252150524f0595d711ff42338bdb29c))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.1.14 (2022-01-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Fixed WPP.contact.queryExists to avoid stuck in MD ([53ef3b4](https://github.com/wppconnect-team/wa-js/commit/53ef3b4ce2ad779509e08d5eec89ee53e193ba7a))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 1.1.13 (2022-01-28)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* Fixed WPP.contact.queryExists to avoid stuck in MD ([a7761e5](https://github.com/wppconnect-team/wa-js/commit/a7761e5a8d7dea66c5f0522eb294cbe763e6ebaa))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.1.12 (2022-01-26)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* Improved file mimetype detection ([df98559](https://github.com/wppconnect-team/wa-js/commit/df98559ef9be4356b9bd73944259c4e171ef7cc4))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
1
37
|
## 1.1.11 (2022-01-22)
|
|
2
38
|
|
|
3
39
|
|
|
@@ -29,6 +29,9 @@ export { markIsRead } from './markIsRead';
|
|
|
29
29
|
export { markIsRecording } from './markIsRecording';
|
|
30
30
|
export { markIsUnread } from './markIsUnread';
|
|
31
31
|
export { mute } from './mute';
|
|
32
|
+
export { openChatAt } from './openChatAt';
|
|
33
|
+
export { openChatBottom } from './openChatBottom';
|
|
34
|
+
export { openChatFromUnread } from './openChatFromUnread';
|
|
32
35
|
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
33
36
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
34
37
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Open the chat in the WhatsApp interface in a specific message
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.chat.openChatAt('<number>@c.us', <message_id>);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function openChatAt(chatId: string | Wid, messageId: string): Promise<boolean>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Open the chat in the WhatsApp interface in bottom position
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.chat.openChatBottom('<number>@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function openChatBottom(chatId: string | Wid): Promise<boolean>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Open the chat in the WhatsApp interface from first unread message
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.chat.openChatFromUnread('<number>@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function openChatFromUnread(chatId: string | Wid): Promise<boolean>;
|
|
@@ -31,4 +31,17 @@ export interface QueryExistsResult {
|
|
|
31
31
|
settingTimestamp: number;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if the number exists and what is correct ID
|
|
36
|
+
*
|
|
37
|
+
* This help to identify numbers with nine digit in Brazil
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* const result = await WPP.contact.queryExists('<number>@c.us');
|
|
42
|
+
* console.log(result.wid); // Correct ID
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @category Chat
|
|
46
|
+
*/
|
|
34
47
|
export declare function queryExists(contactId: string | Wid): Promise<QueryExistsResult | null>;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Wid } from '../../whatsapp';
|
|
17
|
-
export declare function ensureGroup(groupId: string | Wid): import("../../whatsapp").ChatModel;
|
|
17
|
+
export declare function ensureGroup(groupId: string | Wid, checkIsAdmin?: boolean): import("../../whatsapp").ChatModel;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Get group info from an inviteCode
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* await WPP.group.getGroupInfoFromInviteCode('<inviteCode>');
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Group
|
|
25
|
+
*/
|
|
26
|
+
export declare function getGroupInfoFromInviteCode(inviteCode: string): Promise<{
|
|
27
|
+
descOwner: string;
|
|
28
|
+
id: string;
|
|
29
|
+
owner: string;
|
|
30
|
+
participants: {
|
|
31
|
+
id: string;
|
|
32
|
+
isAdmin: boolean;
|
|
33
|
+
isSuperAdmin: boolean;
|
|
34
|
+
}[];
|
|
35
|
+
subjectOwner: string;
|
|
36
|
+
announce: boolean;
|
|
37
|
+
creation: number;
|
|
38
|
+
desc: string;
|
|
39
|
+
descId: string;
|
|
40
|
+
descTime: number;
|
|
41
|
+
noFrequentlyForwarded: boolean;
|
|
42
|
+
parent: boolean;
|
|
43
|
+
pvId?: string | undefined;
|
|
44
|
+
restrict: boolean;
|
|
45
|
+
size: number;
|
|
46
|
+
status: number;
|
|
47
|
+
subject: string;
|
|
48
|
+
subjectTime: number;
|
|
49
|
+
support: boolean;
|
|
50
|
+
suspended: boolean;
|
|
51
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Get the currend invite code of the group
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const code = WPP.group.getInviteCode('<group-id>@g.us');
|
|
23
|
+
* const link = 'https://chat.whatsapp.com/' + code;
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function getInviteCode(groupId: string | Wid): Promise<string>;
|
|
@@ -22,10 +22,17 @@ export { create } from './create';
|
|
|
22
22
|
export { demoteParticipants } from './demoteParticipants';
|
|
23
23
|
export { ensureGroup } from './ensureGroup';
|
|
24
24
|
export { ensureGroupAndParticipants } from './ensureGroupAndParticipants';
|
|
25
|
+
export { getInviteCode } from './getInviteCode';
|
|
25
26
|
export { getParticipants } from './getParticipants';
|
|
26
27
|
export { iAmAdmin } from './iAmAdmin';
|
|
27
28
|
export { iAmMember } from './iAmMember';
|
|
28
29
|
export { iAmRestrictedMember } from './iAmRestrictedMember';
|
|
29
30
|
export { iAmSuperAdmin } from './iAmSuperAdmin';
|
|
31
|
+
export { join } from './join';
|
|
32
|
+
export { leave } from './leave';
|
|
30
33
|
export { promoteParticipants } from './promoteParticipants';
|
|
31
34
|
export { removeParticipants } from './removeParticipants';
|
|
35
|
+
export { revokeInviteCode } from './revokeInviteCode';
|
|
36
|
+
export { setDescription } from './setDescription';
|
|
37
|
+
export { GroupProperty, setProperty } from './setProperty';
|
|
38
|
+
export { setSubject } from './setSubject';
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Join in a group from an invite code.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* await WPP.group.join('abcde....');
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Group
|
|
25
|
+
*/
|
|
26
|
+
export declare function join(inviteCode: string): Promise<{
|
|
27
|
+
id: string;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Leave from a group.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.group.leave('<number>@g.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Group
|
|
26
|
+
*/
|
|
27
|
+
export declare function leave(groupId: string | Wid): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Revoke the current invite code and generate new one.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const code = WPP.group.revokeInviteCode('<group-id>@g.us');
|
|
23
|
+
* const link = 'https://chat.whatsapp.com/' + code;
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @category Group
|
|
27
|
+
*/
|
|
28
|
+
export declare function revokeInviteCode(groupId: string | Wid): Promise<string>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Define the group description
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.group.setDescription('<group-id>@g.us', 'new group description');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Group
|
|
26
|
+
*/
|
|
27
|
+
export declare function setDescription(groupId: string | Wid, description: string): Promise<boolean>;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
export declare enum GroupProperty {
|
|
18
|
+
ANNOUNCEMENT = "announcement",
|
|
19
|
+
EPHEMERAL = "ephemeral",
|
|
20
|
+
RESTRICT = "restrict"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Set the group property
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* // Only admins can send message
|
|
28
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'announcement', true);
|
|
29
|
+
*
|
|
30
|
+
* // All can send message
|
|
31
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'announcement', false);
|
|
32
|
+
*
|
|
33
|
+
* // Disatble temporary messages
|
|
34
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'ephemeral', 0);
|
|
35
|
+
*
|
|
36
|
+
* // Enable temporary messages for 24 hours
|
|
37
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'ephemeral', 86400);
|
|
38
|
+
*
|
|
39
|
+
* // Enable temporary messages for 7 days
|
|
40
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'ephemeral', 604800);
|
|
41
|
+
*
|
|
42
|
+
* // Enable temporary messages for 90 days
|
|
43
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'ephemeral', 7776000);
|
|
44
|
+
*
|
|
45
|
+
* // Only admins can edit group properties
|
|
46
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'restrict', true);
|
|
47
|
+
*
|
|
48
|
+
* // All can edit group properties
|
|
49
|
+
* await WPP.group.setProperty('<group-id>@g.us', 'restrict', false);
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @category Group
|
|
53
|
+
*/
|
|
54
|
+
export declare function setProperty(groupId: string | Wid, property: GroupProperty, value: 0 | 1 | 86400 | 604800 | 7776000 | boolean): Promise<boolean>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Define the group subject
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.group.setSubject('<group-id>@g.us', 'new group subject');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Group
|
|
26
|
+
*/
|
|
27
|
+
export declare function setSubject(groupId: string | Wid, subject: string): Promise<boolean>;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare function isBase64(data: string): boolean;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Stringable } from '../../types';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 30765 */
|
|
19
19
|
export declare class BaseCollection<C, A = C | C[]> extends Collection<C> {
|
|
20
20
|
static cachePolicy: {
|
|
21
21
|
id: string;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { BlocklistModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 48192 */
|
|
19
19
|
export declare class BlocklistCollection extends Collection<BlocklistModel> {
|
|
20
20
|
static model: BlocklistModel;
|
|
21
21
|
blockContact(e?: any): any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { BusinessCategoriesResultModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 23420 */
|
|
19
19
|
export declare class BusinessCategoriesResultCollection extends Collection<BusinessCategoriesResultModel> {
|
|
20
20
|
static model: BusinessCategoriesResultModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { BusinessProfileModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 45209 */
|
|
19
19
|
export declare class BusinessProfileCollection extends Collection<BusinessProfileModel> {
|
|
20
20
|
static model: BusinessProfileModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ReplyButtonModel } from '../models';
|
|
17
17
|
import { BaseCollection } from './BaseCollection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 6136 */
|
|
19
19
|
export declare class ButtonCollection extends BaseCollection<ReplyButtonModel> {
|
|
20
20
|
static model: ReplyButtonModel;
|
|
21
21
|
static comparator(): any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { CallModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 78230 */
|
|
19
19
|
export declare class CallCollection extends Collection<CallModel> {
|
|
20
20
|
static model: CallModel;
|
|
21
21
|
pendingOffers?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { CartModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 93987 */
|
|
19
19
|
export declare class CartCollection extends Collection<CartModel> {
|
|
20
20
|
static model: CartModel;
|
|
21
21
|
static cachePolicy?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { CartItemModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 51317 */
|
|
19
19
|
export declare class CartItemCollection extends Collection<CartItemModel> {
|
|
20
20
|
static model: CartItemModel;
|
|
21
21
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { CatalogModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 39985 */
|
|
19
19
|
export declare class CatalogCollection extends Collection<CatalogModel> {
|
|
20
20
|
static model: CatalogModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ChatModel } from '../models';
|
|
17
17
|
import { BaseCollection } from './BaseCollection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 91129 */
|
|
19
19
|
export declare class ChatCollection extends BaseCollection<ChatModel> {
|
|
20
20
|
static model: ChatModel;
|
|
21
21
|
static comparator(): any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ChatstateModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 74378 */
|
|
19
19
|
export declare class ChatstateCollection extends Collection<ChatstateModel> {
|
|
20
20
|
static model: ChatstateModel;
|
|
21
21
|
}
|
|
@@ -21,10 +21,10 @@ interface Option {
|
|
|
21
21
|
merge: boolean;
|
|
22
22
|
remove: boolean;
|
|
23
23
|
}
|
|
24
|
-
/** @whatsapp
|
|
24
|
+
/** @whatsapp 93458 */
|
|
25
25
|
export declare interface Collection<M> extends EventEmitter, Pick<Array<M>, 'indexOf' | 'lastIndexOf' | 'every' | 'some' | 'forEach' | 'map' | 'filter' | 'reduce' | 'slice'> {
|
|
26
26
|
}
|
|
27
|
-
/** @whatsapp
|
|
27
|
+
/** @whatsapp 93458 */
|
|
28
28
|
export declare class Collection<M, A = M | M[]> extends EventEmitter {
|
|
29
29
|
static model: any;
|
|
30
30
|
static comparator: (a: any, b: any) => number;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ContactModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 49798 */
|
|
19
19
|
export declare class ContactCollection extends Collection<ContactModel> {
|
|
20
20
|
static model: ContactModel;
|
|
21
21
|
static cachePolicy?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { EmojiVariantModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 96539 */
|
|
19
19
|
export declare class EmojiVariantCollection extends Collection<EmojiVariantModel> {
|
|
20
20
|
static model: EmojiVariantModel;
|
|
21
21
|
static cachePolicy?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { GroupMetadataModel } from '../models';
|
|
17
17
|
import { BaseCollection } from '.';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 20029 */
|
|
19
19
|
export declare class GroupMetadataCollection extends BaseCollection<GroupMetadataModel> {
|
|
20
20
|
static model: GroupMetadataModel;
|
|
21
21
|
handlePendingInvite(): any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ChatModel, LabelModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 79491 */
|
|
19
19
|
export declare class LabelCollection extends Collection<LabelModel> {
|
|
20
20
|
static model: LabelModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { LabelItemModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 62004 */
|
|
19
19
|
export declare class LabelItemCollection extends Collection<LabelItemModel> {
|
|
20
20
|
static model: LabelItemModel;
|
|
21
21
|
}
|