@wppconnect/wa-js 3.10.2 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/chat/functions/index.d.ts +1 -0
- package/dist/chat/functions/sendEventMessage.d.ts +64 -0
- package/dist/chat/functions/sendFileMessage.d.ts +2 -1
- package/dist/chat/functions/sendScheduledCallMessage.d.ts +5 -8
- package/dist/contact/functions/getProfilePictureUrl.d.ts +1 -1
- package/dist/contact/functions/getStatus.d.ts +1 -1
- package/dist/contact/functions/index.d.ts +2 -0
- package/dist/contact/functions/queryExists.d.ts +1 -1
- package/dist/contact/functions/subscribePresence.d.ts +27 -0
- package/dist/contact/functions/unsubscribePresence.d.ts +27 -0
- package/dist/profile/functions/getMyProfilePicture.d.ts +27 -0
- package/dist/profile/functions/index.d.ts +1 -0
- package/dist/whatsapp/functions/createEventCallLink.d.ts +18 -0
- package/dist/whatsapp/functions/index.d.ts +3 -0
- package/dist/whatsapp/functions/removeStatusMessage.d.ts +19 -0
- package/dist/whatsapp/functions/subscribePresence.d.ts +20 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# 3.12.0 (2024-10-24)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
* Fixed
|
|
6
|
+
* Fixed 'chat.new_message' event on receive replied [@lid](https://github.com/lid) msgs ([2a40d01](https://github.com/wppconnect-team/wa-js/commit/2a40d0126c6c4f16ae27add91f4fc7d1263073af))
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -57,6 +57,7 @@ export { prepareRawMessage } from './prepareRawMessage';
|
|
|
57
57
|
export { requestPhoneNumber } from './requestPhoneNumber';
|
|
58
58
|
export { OrderItems, OrderMessageOptions, sendChargeMessage, } from './sendChargeMessage';
|
|
59
59
|
export { PoolMessageOptions, sendCreatePollMessage, } from './sendCreatePollMessage';
|
|
60
|
+
export { sendEventMessage } from './sendEventMessage';
|
|
60
61
|
export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
|
|
61
62
|
export { GroupInviteMessage, sendGroupInviteMessage, } from './sendGroupInviteMessage';
|
|
62
63
|
export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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 { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
export interface EventMessageOptions extends SendMessageOptions {
|
|
18
|
+
callType?: 'video' | 'voice';
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
startTime: number;
|
|
22
|
+
endTime?: number;
|
|
23
|
+
location?: {
|
|
24
|
+
degreesLatitude: number;
|
|
25
|
+
degreesLongitude: number;
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Send a Event Message
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```javascript
|
|
34
|
+
* // Simple com start time and end
|
|
35
|
+
* WPP.chat.sendEventMessage('[number]@c.us', {
|
|
36
|
+
* name: "Title of event"
|
|
37
|
+
* description: 'Description of your event',
|
|
38
|
+
* startTime: 1729551600
|
|
39
|
+
* endTime: 1729551900
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Event with location
|
|
43
|
+
* WPP.chat.sendEventMessage('[number]@c.us', {
|
|
44
|
+
* name: "Title of event"
|
|
45
|
+
* description: 'Description of your event',
|
|
46
|
+
* startTime: 1729551600
|
|
47
|
+
* location: {
|
|
48
|
+
* degreesLatitude: -22.9518551,
|
|
49
|
+
* degreesLongitude: -43.2108338,
|
|
50
|
+
* name: 'Cristo Redentor - RJ',
|
|
51
|
+
* }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // Event with link for call (use voice or video)
|
|
55
|
+
* WPP.chat.sendEventMessage('[number]@c.us', {
|
|
56
|
+
* name: "Title of event"
|
|
57
|
+
* callType: 'voice',
|
|
58
|
+
* description: 'Description of your event',
|
|
59
|
+
* startTime: 1729551600
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
* @category Message
|
|
63
|
+
*/
|
|
64
|
+
export declare function sendEventMessage(chatId: any, options: EventMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -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
|
+
import { Wid } from '../../whatsapp';
|
|
16
17
|
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
18
|
import { MessageButtonsOptions } from '.';
|
|
18
19
|
export interface FileMessageOptions extends SendMessageOptions {
|
|
@@ -180,4 +181,4 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
180
181
|
* @category Message
|
|
181
182
|
* @return {SendMessageReturn} The result
|
|
182
183
|
*/
|
|
183
|
-
export declare function sendFileMessage(chatId:
|
|
184
|
+
export declare function sendFileMessage(chatId: string | Wid, content: string | Blob | File, options: AutoDetectMessageOptions | AudioMessageOptions | DocumentMessageOptions | ImageMessageOptions | VideoMessageOptions | StickerMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2024 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.
|
|
@@ -14,15 +14,11 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
-
export declare enum SCHEDULED_CALL_TYPE {
|
|
18
|
-
UNKNOWN = 0,
|
|
19
|
-
VOICE = 1,
|
|
20
|
-
VIDEO = 2
|
|
21
|
-
}
|
|
22
17
|
export interface ScheduledCallMessageOptions extends SendMessageOptions {
|
|
23
18
|
scheduledTimestampMs: number | string;
|
|
24
|
-
callType: 'video' | 'voice'
|
|
19
|
+
callType: 'video' | 'voice';
|
|
25
20
|
title: string;
|
|
21
|
+
description?: string;
|
|
26
22
|
}
|
|
27
23
|
/**
|
|
28
24
|
* Send a scheduled call message
|
|
@@ -30,7 +26,8 @@ export interface ScheduledCallMessageOptions extends SendMessageOptions {
|
|
|
30
26
|
* @example
|
|
31
27
|
* ```javascript
|
|
32
28
|
* WPP.chat.sendScheduledCallMessage('[number]@c.us', {
|
|
33
|
-
* title: "Title of event"
|
|
29
|
+
* title: "Title of event call"
|
|
30
|
+
* description: 'Description for Call",
|
|
34
31
|
* callType: 'voice'
|
|
35
32
|
* scheduledTimestampMs: 1696084222000
|
|
36
33
|
* });
|
|
@@ -22,6 +22,6 @@ import { Wid } from '../../whatsapp';
|
|
|
22
22
|
* const url = await WPP.contact.getProfilePictureUrl('[number]@c.us');
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
|
-
* @category
|
|
25
|
+
* @category Contact
|
|
26
26
|
*/
|
|
27
27
|
export declare function getProfilePictureUrl(contactId: string | Wid, full?: boolean): Promise<string | null | undefined>;
|
|
@@ -20,3 +20,5 @@ export { getProfilePictureUrl } from './getProfilePictureUrl';
|
|
|
20
20
|
export { getStatus } from './getStatus';
|
|
21
21
|
export { ContactListOptions, list } from './list';
|
|
22
22
|
export { queryExists } from './queryExists';
|
|
23
|
+
export { subscribePresence } from './subscribePresence';
|
|
24
|
+
export { unsubscribePresence } from './unsubscribePresence';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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
|
+
* Subscribe presente from a contact
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.contact.subscribePresence('[number]@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Contact
|
|
26
|
+
*/
|
|
27
|
+
export declare function subscribePresence(ids: string | string[]): Promise<Wid[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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
|
+
* Unsubscribe presence of a contact
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.contact.unsubscribePresence('[number]@c.us');
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Contact
|
|
26
|
+
*/
|
|
27
|
+
export declare function unsubscribePresence(ids: string | string[]): Promise<Wid[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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 { ProfilePicThumbModel } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Get your current profile picture
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* await WPP.profile.getMyProfilePicture();
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @category Profile
|
|
26
|
+
*/
|
|
27
|
+
export declare function getMyProfilePicture(): Promise<ProfilePicThumbModel>;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { editBusinessProfile } from './editBusinessProfile';
|
|
17
17
|
export { getMyProfileName } from './getMyProfileName';
|
|
18
|
+
export { getMyProfilePicture } from './getMyProfilePicture';
|
|
18
19
|
export { getMyStatus } from './getMyStatus';
|
|
19
20
|
export { isBusiness } from './isBusiness';
|
|
20
21
|
export { removeMyProfilePicture } from './removeMyProfilePicture';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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
|
+
/** @whatsapp 75887
|
|
17
|
+
*/
|
|
18
|
+
export declare function createEventCallLink(eventStartTime: number, type: 'voice' | 'video'): Promise<string>;
|
|
@@ -26,6 +26,7 @@ export * from './changeOptInStatusForExternalWebBeta';
|
|
|
26
26
|
export * from './collections';
|
|
27
27
|
export * from './colorIndexToHex';
|
|
28
28
|
export * from './contactFunctions';
|
|
29
|
+
export * from './createEventCallLink';
|
|
29
30
|
export * from './createFanoutMsgStanza';
|
|
30
31
|
export * from './createGroup';
|
|
31
32
|
export * from './createMsgProtobuf';
|
|
@@ -109,6 +110,7 @@ export * from './queryNewsletterMetadataByJid';
|
|
|
109
110
|
export * from './queryOrder';
|
|
110
111
|
export * from './randomHex';
|
|
111
112
|
export * from './randomId';
|
|
113
|
+
export * from './removeStatusMessage';
|
|
112
114
|
export * from './resetGroupInviteCode';
|
|
113
115
|
export * from './revokeStatus';
|
|
114
116
|
export * from './sendClear';
|
|
@@ -134,6 +136,7 @@ export * from './setPushname';
|
|
|
134
136
|
export * from './status';
|
|
135
137
|
export * from './STATUS_JID';
|
|
136
138
|
export * from './statusEnable';
|
|
139
|
+
export * from './subscribePresence';
|
|
137
140
|
export * from './syncABPropsTask';
|
|
138
141
|
export * from './typeAttributeFromProtobuf';
|
|
139
142
|
export * from './unixTime';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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 WAWebDBMessageDelete
|
|
18
|
+
*/
|
|
19
|
+
export declare function removeStatusMessage(id: string[]): Promise<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2024 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 '..';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp WAWebContactPresenceBridge
|
|
19
|
+
*/
|
|
20
|
+
export declare function subscribePresence(id: Wid, tcToken?: any): Promise<any>;
|