@wppconnect/wa-js 1.1.2 → 1.1.6
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/canMute.d.ts +27 -0
- package/dist/chat/functions/downloadMedia.d.ts +1 -1
- package/dist/chat/functions/index.d.ts +3 -0
- package/dist/chat/functions/mute.d.ts +45 -0
- package/dist/chat/functions/unmute.d.ts +27 -0
- package/dist/contact/functions/getStatus.d.ts +27 -0
- package/dist/contact/functions/index.d.ts +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/profile/eventEmitter.d.ts +48 -0
- package/dist/profile/functions/index.d.ts +16 -0
- package/dist/profile/functions/queryExists.d.ts +20 -0
- package/dist/profile/functions/setMyStatus.d.ts +26 -0
- package/dist/profile/index.d.ts +17 -0
- package/dist/util/blobToBase64.d.ts +16 -0
- package/dist/util/index.d.ts +2 -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 +3 -4
- 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/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/functions/addAndSendMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/blockContact.d.ts +2 -2
- 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 +2 -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 +21 -0
- package/dist/whatsapp/functions/randomId.d.ts +2 -2
- 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/sendQueryExists.d.ts +14 -1
- package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +1 -1
- package/dist/whatsapp/functions/status.d.ts +25 -0
- 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 +2 -2
- 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 +2 -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 +3 -3
- 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/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 -4
- 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 +2 -2
- 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 +5 -5
- 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 +16 -13
- package/playwright.config.ts +39 -0
- package/storageState.json +4 -0
- package/tests/check-auth.ts +39 -0
- package/tests/global.d.ts +24 -0
- package/tests/prepare.ts +40 -0
- package/tests/tsconfig.json +7 -0
- package/tests/wpp-test.ts +78 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
## 1.1.6 (2022-01-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Ignore markIsRead error while is sending message ([17d4ca5](https://github.com/wppconnect-team/wa-js/commit/17d4ca540897a0610016fac34e85d1292297461e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.1.5 (2022-01-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Allow WPP.contact.queryExists to throw exception (wppconnect-team/wppconnect[#793](https://github.com/wppconnect-team/wa-js/issues/793)) ([7331aad](https://github.com/wppconnect-team/wa-js/commit/7331aadb06b77550ba0c959d29ba6118bb5fa0f2))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## 1.1.4 (2022-01-14)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* Fixed WPP.chat.markIsRead and markIsUnread functions (fix wppconnect-team/wppconnect[#786](https://github.com/wppconnect-team/wa-js/issues/786)) ([a1158f6](https://github.com/wppconnect-team/wa-js/commit/a1158f6780bbe343121849ab235cd97823637505))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.1.3 (2022-01-08)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* Fixed WPP.chat.downloadMedia for Videos in Chromium ([ba07dfc](https://github.com/wppconnect-team/wa-js/commit/ba07dfcf7d11dda6d379766932bdd43adc9cd319))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
1
37
|
## 1.1.2 (2022-01-08)
|
|
2
38
|
|
|
3
39
|
|
|
@@ -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
|
+
* Check if is possible to mute this chat
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const canMute = WPP.chat.canMute('<number>@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function canMute(chatId: string | Wid): boolean;
|
|
@@ -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 { canMute } from './canMute';
|
|
16
17
|
export { clear } from './clear';
|
|
17
18
|
export { delete } from './delete';
|
|
18
19
|
export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
|
|
@@ -27,6 +28,7 @@ export { markIsPaused } from './markIsPaused';
|
|
|
27
28
|
export { markIsRead } from './markIsRead';
|
|
28
29
|
export { markIsRecording } from './markIsRecording';
|
|
29
30
|
export { markIsUnread } from './markIsUnread';
|
|
31
|
+
export { mute } from './mute';
|
|
30
32
|
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
31
33
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
32
34
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
@@ -35,3 +37,4 @@ export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
|
35
37
|
export { sendRawMessage } from './sendRawMessage';
|
|
36
38
|
export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
|
|
37
39
|
export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
|
|
40
|
+
export { unmute } from './unmute';
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
* Mute a chat, you can use duration or expiration
|
|
19
|
+
* For expiration, use unix timestamp (seconds only)
|
|
20
|
+
* For duration, use seconds
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```javascript
|
|
24
|
+
* // Mute for 60 seconds
|
|
25
|
+
* WPP.chat.mute('<number>@c.us', {duration: 60});
|
|
26
|
+
*
|
|
27
|
+
* // Mute util 2021-01-01
|
|
28
|
+
* WPP.chat.mute('<number>@c.us', {expiration: 1641006000});
|
|
29
|
+
*
|
|
30
|
+
* // or using date
|
|
31
|
+
* const expiration = new Date('2022-01-01 00:00:00');
|
|
32
|
+
* WPP.chat.mute('<number>@c.us', {expiration: expiration});
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @category Chat
|
|
36
|
+
*/
|
|
37
|
+
export declare function mute(chatId: string | Wid, time: {
|
|
38
|
+
expiration: number | Date;
|
|
39
|
+
} | {
|
|
40
|
+
duration: number;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
wid: Wid;
|
|
43
|
+
expiration: number;
|
|
44
|
+
isMuted: boolean;
|
|
45
|
+
}>;
|
|
@@ -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
|
+
* Unmute a chat
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* WPP.chat.unmute('<number>@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function unmute(chatId: string | Wid): Promise<void>;
|
|
@@ -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
|
+
* Get the current text status
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.contact.getStatus('<number>@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Chat
|
|
26
|
+
*/
|
|
27
|
+
export declare function getStatus(contactId: string | Wid): Promise<import("../../whatsapp").StatusModel>;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,9 @@ export * as chat from './chat';
|
|
|
26
26
|
export * as contact from './contact';
|
|
27
27
|
export * as group from './group';
|
|
28
28
|
export * as labels from './labels';
|
|
29
|
+
export * as profile from './profile';
|
|
29
30
|
export * as status from './status';
|
|
31
|
+
export * as util from './util';
|
|
30
32
|
export * as whatsapp from './whatsapp';
|
|
31
33
|
export declare const version: string;
|
|
32
34
|
export declare const license = "Apache-2.0";
|
|
@@ -0,0 +1,48 @@
|
|
|
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 Emittery from 'emittery';
|
|
17
|
+
export declare type UnsubscribeFn = () => void;
|
|
18
|
+
export interface EventTypes {
|
|
19
|
+
}
|
|
20
|
+
export declare const eventEmitter: Emittery<EventTypes, EventTypes, never>;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribe to one event.
|
|
23
|
+
* @event
|
|
24
|
+
* @returns An unsubscribe method.
|
|
25
|
+
*/
|
|
26
|
+
export declare function on<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): UnsubscribeFn;
|
|
27
|
+
/**
|
|
28
|
+
* Subscribe to one or more events only once. It will be unsubscribed after the first event.
|
|
29
|
+
* @event
|
|
30
|
+
*/
|
|
31
|
+
export declare function once<Name extends keyof EventTypes>(eventName: Name): Promise<EventTypes[Name]>;
|
|
32
|
+
/**
|
|
33
|
+
* @event
|
|
34
|
+
*/
|
|
35
|
+
export declare function off<Name extends keyof EventTypes>(eventName: Name, listener: (eventData: EventTypes[Name]) => void | Promise<void>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clear all event listeners on the instance.
|
|
38
|
+
*
|
|
39
|
+
* If `eventName` is given, only the listeners for that event are cleared.
|
|
40
|
+
*
|
|
41
|
+
* @event
|
|
42
|
+
*/
|
|
43
|
+
export declare function clearListeners<Name extends keyof EventTypes>(eventName?: Name | Name[]): void;
|
|
44
|
+
/**
|
|
45
|
+
* The number of listeners for the `eventName` or all events if not specified.
|
|
46
|
+
* @event
|
|
47
|
+
*/
|
|
48
|
+
export declare function listenerCount<Name extends keyof EventTypes>(eventName?: Name | Name[]): number;
|
|
@@ -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 { setMyStatus } from './setMyStatus';
|
|
@@ -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 { Wid } from '../../whatsapp';
|
|
17
|
+
export declare function queryExists(contactId: string | Wid): Promise<{
|
|
18
|
+
wid: Wid;
|
|
19
|
+
biz: boolean;
|
|
20
|
+
} | null | undefined>;
|
|
@@ -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
|
+
/**
|
|
17
|
+
* Update your current text status
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* await WPP.profile.setMyStatus('Example text');
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Chat
|
|
25
|
+
*/
|
|
26
|
+
export declare function setMyStatus(statusText: string): Promise<boolean>;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { clearListeners, EventTypes, listenerCount, off, on, once, UnsubscribeFn, } from './eventEmitter';
|
|
17
|
+
export * from './functions';
|
|
@@ -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 blobToBase64(blob: Blob): Promise<string>;
|
package/dist/util/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export * from './blobToBase64';
|
|
17
|
+
export * from './convertToFile';
|
|
16
18
|
export * from './createWid';
|
|
17
19
|
export * from './errors';
|
|
18
20
|
export * from './types';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Stringable } from '../../types';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 36513 */
|
|
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 15701 */
|
|
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 54100 */
|
|
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 8581 */
|
|
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 84142 */
|
|
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 15971 */
|
|
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 25523 */
|
|
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 29844 */
|
|
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 60028 */
|
|
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 84758 */
|
|
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 42165 */
|
|
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 85392 */
|
|
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 85392 */
|
|
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 17025 */
|
|
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 41098 */
|
|
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 75798 */
|
|
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 59606 */
|
|
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 42745 */
|
|
19
19
|
export declare class LabelItemCollection extends Collection<LabelItemModel> {
|
|
20
20
|
static model: LabelItemModel;
|
|
21
21
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { LiveLocationModel } from '../models';
|
|
17
17
|
import { BaseCollection } from '.';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 31104 */
|
|
19
19
|
export declare class LiveLocationCollection extends BaseCollection<LiveLocationModel> {
|
|
20
20
|
static model: LiveLocationModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { Wid } from '..';
|
|
17
17
|
import { ModelPropertiesContructor, MsgModel } from '../models';
|
|
18
18
|
import { BaseCollection } from './BaseCollection';
|
|
19
|
-
/** @whatsapp
|
|
19
|
+
/** @whatsapp 45472 */
|
|
20
20
|
export declare class MsgCollection extends BaseCollection<MsgModel> {
|
|
21
21
|
static model: MsgModel;
|
|
22
22
|
lastReceivedReceipt?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { MsgInfoModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 57636 */
|
|
19
19
|
export declare class MsgInfoCollection extends Collection<MsgInfoModel> {
|
|
20
20
|
static model: MsgInfoModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { MuteModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 80959 */
|
|
19
19
|
export declare class MuteCollection extends Collection<MuteModel> {
|
|
20
20
|
static model: MuteModel;
|
|
21
21
|
static cachePolicy?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { OrderModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 98052 */
|
|
19
19
|
export declare class OrderCollection extends Collection<OrderModel> {
|
|
20
20
|
static model: OrderModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { OrderItemModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 2414 */
|
|
19
19
|
export declare class OrderItemCollection extends Collection<OrderItemModel> {
|
|
20
20
|
static model: OrderItemModel;
|
|
21
21
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ParticipantModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 16748 */
|
|
19
19
|
export declare class ParticipantCollection extends Collection<ParticipantModel> {
|
|
20
20
|
static model: ParticipantModel;
|
|
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 48327 */
|
|
19
19
|
export declare class PresenceCollection extends Collection<ChatstateModel> {
|
|
20
20
|
static model: ChatstateModel;
|
|
21
21
|
static staleCollection?: any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ProductCollModel } from '../models';
|
|
17
17
|
import { Collection } from './Collection';
|
|
18
|
-
/** @whatsapp
|
|
18
|
+
/** @whatsapp 63875 */
|
|
19
19
|
export declare class ProductCollCollection extends Collection<ProductCollModel> {
|
|
20
20
|
static model: ProductCollModel;
|
|
21
21
|
static staleCollection?: any;
|