@wppconnect/wa-js 2.9.0 → 2.10.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 -0
- package/dist/chat/functions/sendTextMessage.d.ts +31 -0
- package/dist/chat/functions/sendVCardContactMessage.d.ts +20 -0
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/patch.d.ts +16 -0
- package/dist/conn/functions/getPlatform.d.ts +25 -0
- package/dist/conn/functions/index.d.ts +2 -0
- package/dist/profile/functions/index.d.ts +1 -0
- package/dist/profile/functions/isBusiness.d.ts +24 -0
- package/dist/whatsapp/functions/mediaTypeFromProtobuf.d.ts +1 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,37 @@ export declare type TextMessageOptions = SendMessageOptions & MessageButtonsOpti
|
|
|
18
18
|
/**
|
|
19
19
|
* Send a text message
|
|
20
20
|
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```javascript
|
|
23
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello new contact', {
|
|
24
|
+
* createChat: true
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // With Buttons
|
|
28
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello', {
|
|
29
|
+
* useTemplateButtons: true, // False for legacy
|
|
30
|
+
* buttons: [
|
|
31
|
+
* {
|
|
32
|
+
* url: 'https://wppconnect.io/',
|
|
33
|
+
* text: 'WPPConnect Site'
|
|
34
|
+
* },
|
|
35
|
+
* {
|
|
36
|
+
* phoneNumber: '+55 11 22334455',
|
|
37
|
+
* text: 'Call me'
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* id: 'your custom id 1',
|
|
41
|
+
* text: 'Some text'
|
|
42
|
+
* },
|
|
43
|
+
* {
|
|
44
|
+
* id: 'another id 2',
|
|
45
|
+
* text: 'Another text'
|
|
46
|
+
* }
|
|
47
|
+
* ],
|
|
48
|
+
* title: 'Title text', // Optional
|
|
49
|
+
* footer: 'Footer text' // Optional
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
21
52
|
* @category Message
|
|
22
53
|
*/
|
|
23
54
|
export declare function sendTextMessage(chatId: any, content: any, options?: TextMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -21,7 +21,27 @@ export interface VCardContact {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Send a VCard as message
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // single contact
|
|
27
|
+
* WPP.chat.sendVCardContactMessage('[number]@c.us', {
|
|
28
|
+
* id: '123456@c.us',
|
|
29
|
+
* name: 'The Contact Name'
|
|
30
|
+
* });
|
|
24
31
|
*
|
|
32
|
+
* // multiple contacts
|
|
33
|
+
* WPP.chat.sendVCardContactMessage('[number]@c.us', [
|
|
34
|
+
* {
|
|
35
|
+
* id: '123456@c.us',
|
|
36
|
+
* name: 'The Contact Name'
|
|
37
|
+
* },
|
|
38
|
+
* {
|
|
39
|
+
* id: '456789@c.us',
|
|
40
|
+
* name: 'Another Contact'
|
|
41
|
+
* },
|
|
42
|
+
* ]);
|
|
43
|
+
*
|
|
44
|
+
* ```
|
|
25
45
|
* @category Message
|
|
26
46
|
*/
|
|
27
47
|
export declare function sendVCardContactMessage(chatId: any, contacts: string | Wid | VCardContact | (string | Wid | VCardContact)[], options?: SendMessageOptions): Promise<SendMessageReturn>;
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 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 {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 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
|
+
* Check what's device platform is connected
|
|
18
|
+
* @returns android | iphone | wp
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const getPlatform = WPP.conn.getPlatform();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getPlatform(): any;
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
export { getAuthCode } from './getAuthCode';
|
|
17
17
|
export { getMyDeviceId } from './getMyDeviceId';
|
|
18
18
|
export { getMyUserId } from './getMyUserId';
|
|
19
|
+
export { getPlatform } from './getPlatform';
|
|
19
20
|
export { isAuthenticated } from './isAuthenticated';
|
|
20
21
|
export { isIdle } from './isIdle';
|
|
21
22
|
export { isMainLoaded } from './isMainLoaded';
|
|
23
|
+
export { isMainReady } from './isMainReady';
|
|
22
24
|
export { isMultiDevice } from './isMultiDevice';
|
|
23
25
|
export { logout } from './logout';
|
|
24
26
|
export { refreshQR } from './refreshQR';
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Return the current logged user is Bussiness or not
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* WPP.profile.isBusiness();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function isBusiness(): boolean | undefined;
|