@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 CHANGED
@@ -1,3 +1,5 @@
1
+ # 2.10.0 (2022-08-04)
2
+
1
3
  # 2.9.0 (2022-07-31)
2
4
 
3
5
  ## 2.8.2 (2022-07-12)
@@ -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>;
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import './events';
17
+ import './patch';
17
18
  export * from './defaultSendMessageOptions';
18
19
  export * from './functions';
19
20
  export * from './types';
@@ -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';
@@ -14,5 +14,6 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export { getMyStatus } from './getMyStatus';
17
+ export { isBusiness } from './isBusiness';
17
18
  export { setMyProfilePicture } from './setMyProfilePicture';
18
19
  export { setMyStatus } from './setMyStatus';
@@ -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;
@@ -19,4 +19,4 @@
19
19
  */
20
20
  export declare function mediaTypeFromProtobuf(protoMessage: {
21
21
  [key: string]: any;
22
- }): string;
22
+ }): string | null;