talkyzap-wapp-api 1.0.4 → 1.0.5
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 +1 -6
- package/dist/cart/functions/add.d.ts +20 -0
- package/dist/{whatsapp/functions/isLegitErrorStack.d.ts → cart/functions/clear.d.ts} +1 -4
- package/dist/cart/functions/get.d.ts +27 -0
- package/dist/cart/functions/getThumbFromCart.d.ts +16 -0
- package/dist/cart/functions/index.d.ts +22 -0
- package/dist/cart/functions/remove.d.ts +17 -0
- package/dist/cart/functions/submit.d.ts +33 -0
- package/dist/cart/functions/update.d.ts +19 -0
- package/dist/cart/index.d.ts +16 -0
- package/dist/catalog/functions/getProductById.d.ts +24 -2
- package/dist/chat/events/eventTypes.d.ts +1 -1
- package/dist/chat/functions/closeChat.d.ts +26 -0
- package/dist/chat/functions/index.d.ts +3 -1
- package/dist/chat/functions/prepareMessageButtons.d.ts +1 -1
- package/dist/chat/functions/{sendOrderMessage.d.ts → sendChargeMessage.d.ts} +28 -7
- package/dist/chat/functions/sendGroupInviteMessage.d.ts +14 -0
- package/dist/chat/functions/sendTextMessage.d.ts +1 -1
- package/dist/chat/functions/setInputText.d.ts +20 -0
- package/dist/enums.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/privacy/functions/get.d.ts +25 -0
- package/dist/privacy/functions/getDisallowedList.d.ts +38 -0
- package/dist/privacy/functions/index.d.ts +24 -0
- package/dist/privacy/functions/prepareDisallowedList.d.ts +29 -0
- package/dist/privacy/functions/setAbout.d.ts +25 -0
- package/dist/privacy/functions/setAddGroup.d.ts +24 -0
- package/dist/privacy/functions/setLastSeen.d.ts +25 -0
- package/dist/privacy/functions/setOnline.d.ts +20 -0
- package/dist/privacy/functions/setProfilePic.d.ts +25 -0
- package/dist/privacy/functions/setReadReceipts.d.ts +20 -0
- package/dist/privacy/functions/setStatus.d.ts +22 -0
- package/dist/privacy/index.d.ts +16 -0
- package/dist/whatsapp/functions/addProductToCart.d.ts +23 -0
- package/dist/whatsapp/functions/createOrder.d.ts +24 -0
- package/dist/whatsapp/functions/getPrivacyDisallowedListTable.d.ts +27 -0
- package/dist/whatsapp/functions/getPushname.d.ts +10 -0
- package/dist/whatsapp/functions/getStatusList.d.ts +28 -0
- package/dist/whatsapp/functions/index.d.ts +6 -1
- package/dist/whatsapp/functions/setPrivacyForOneCategory.d.ts +48 -0
- package/dist/whatsapp/functions/updateCart.d.ts +20 -0
- package/dist/whatsapp/misc/ComposeBoxActions.d.ts +34 -0
- package/dist/whatsapp/misc/IsOfficialClient.d.ts +1 -0
- package/dist/whatsapp/misc/MsgKey.d.ts +1 -1
- package/dist/whatsapp/misc/index.d.ts +1 -0
- package/dist/whatsapp/models/CartItemModel.d.ts +1 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Features
|
|
5
|
-
|
|
6
|
-
* Added 'conn.logout_reason' event (close [#1899](https://github.com/wppconnect-team/wa-js/issues/1899)) ([2466c30](https://github.com/wppconnect-team/wa-js/commit/2466c30cad19eaa14c2119e476d44b2e2e61d265))
|
|
1
|
+
## 3.9.1 (2024-09-05)
|
|
7
2
|
|
|
8
3
|
|
|
9
4
|
|
|
@@ -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 { CartModel } from '../../whatsapp';
|
|
17
|
+
export declare function add(chatId: string, products: {
|
|
18
|
+
id: string;
|
|
19
|
+
qnt: number;
|
|
20
|
+
}[]): Promise<CartModel | undefined>;
|
|
@@ -13,7 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
* @whatsapp 525438
|
|
18
|
-
*/
|
|
19
|
-
export declare function isLegitErrorStack(): boolean;
|
|
16
|
+
export declare function clear(wid: string): Promise<void>;
|
|
@@ -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
|
+
/**
|
|
17
|
+
* Get products in cart chat
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const cart = WPP.cart.get('[number]@c.us');
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Cart
|
|
25
|
+
*/
|
|
26
|
+
import { CartModel } from '../../whatsapp';
|
|
27
|
+
export declare function get(wid: string): CartModel | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export declare function getThumbFromCart(wid: string): Promise<string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
export { add } from './add';
|
|
17
|
+
export { clear } from './clear';
|
|
18
|
+
export { get } from './get';
|
|
19
|
+
export { getThumbFromCart } from './getThumbFromCart';
|
|
20
|
+
export { remove } from './remove';
|
|
21
|
+
export { submit } from './submit';
|
|
22
|
+
export { update } from './update';
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { CartModel } from '../../whatsapp';
|
|
17
|
+
export declare function remove(chatId: string, productId: string): Promise<CartModel | undefined>;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
* Send a request order to business chat
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const cart = WPP.cart.submit('[number]@c.us');
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```javascript
|
|
26
|
+
* // Send cart with a custom message
|
|
27
|
+
* const cart = WPP.cart.submit('[number]@c.us', 'Custom message here');
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @category Cart
|
|
31
|
+
*/
|
|
32
|
+
import { SendMessageOptions } from '../../chat';
|
|
33
|
+
export declare function submit(wid: string, msg?: string, options?: SendMessageOptions): Promise<any>;
|
|
@@ -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
|
+
import { CartModel } from '../../whatsapp';
|
|
17
|
+
export declare function update(chatId: string, productId: string, options: {
|
|
18
|
+
quantity: number;
|
|
19
|
+
}): Promise<CartModel | undefined>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export * from './functions';
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ProductModel } from '../../whatsapp';
|
|
17
16
|
/**
|
|
18
17
|
* Retrieves product by id
|
|
19
18
|
*
|
|
@@ -25,4 +24,27 @@ import { ProductModel } from '../../whatsapp';
|
|
|
25
24
|
*
|
|
26
25
|
* @category Catalog
|
|
27
26
|
*/
|
|
28
|
-
export declare function getProductById(chatId: string, productId: number): Promise<
|
|
27
|
+
export declare function getProductById(chatId: string, productId: number): Promise<{
|
|
28
|
+
id: string;
|
|
29
|
+
retailer_id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
url: string;
|
|
33
|
+
currency: string;
|
|
34
|
+
price: string;
|
|
35
|
+
is_hidden: boolean;
|
|
36
|
+
max_available: number;
|
|
37
|
+
availability: string;
|
|
38
|
+
checkmark: boolean;
|
|
39
|
+
image_hashes_for_whatsapp: string[];
|
|
40
|
+
image_cdn_urls: {
|
|
41
|
+
key: 'requested' | 'full';
|
|
42
|
+
value: string;
|
|
43
|
+
}[];
|
|
44
|
+
additional_image_cdn_urls: any[];
|
|
45
|
+
whatsapp_product_can_appeal: boolean;
|
|
46
|
+
capability_to_review_status: {
|
|
47
|
+
key: 'WHATSAPP';
|
|
48
|
+
value: 'APPROVED';
|
|
49
|
+
}[];
|
|
50
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
* Close the chat tab
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* await WPP.chat.closeChat();
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Chat
|
|
25
|
+
*/
|
|
26
|
+
export declare function closeChat(): Promise<boolean>;
|
|
@@ -18,6 +18,7 @@ export { canMarkPlayed } from './canMarkPlayed';
|
|
|
18
18
|
export { canMute } from './canMute';
|
|
19
19
|
export { canReply } from './canReply';
|
|
20
20
|
export { clear } from './clear';
|
|
21
|
+
export { closeChat } from './closeChat';
|
|
21
22
|
export { delete } from './delete';
|
|
22
23
|
export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
|
|
23
24
|
export { downloadMedia } from './downloadMedia';
|
|
@@ -54,17 +55,18 @@ export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
|
54
55
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
55
56
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
56
57
|
export { requestPhoneNumber } from './requestPhoneNumber';
|
|
58
|
+
export { OrderItems, OrderMessageOptions, sendChargeMessage, } from './sendChargeMessage';
|
|
57
59
|
export { PoolMessageOptions, sendCreatePollMessage, } from './sendCreatePollMessage';
|
|
58
60
|
export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
|
|
59
61
|
export { GroupInviteMessage, sendGroupInviteMessage, } from './sendGroupInviteMessage';
|
|
60
62
|
export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
61
63
|
export { LocationMessageOptions, sendLocationMessage, } from './sendLocationMessage';
|
|
62
|
-
export { OrderItems, OrderMessageOptions, sendOrderMessage, } from './sendOrderMessage';
|
|
63
64
|
export { sendPixKeyMessage } from './sendPixKeyMessage';
|
|
64
65
|
export { sendRawMessage } from './sendRawMessage';
|
|
65
66
|
export { sendReactionToMessage } from './sendReactionToMessage';
|
|
66
67
|
export { ScheduledCallMessageOptions, sendScheduledCallMessage, } from './sendScheduledCallMessage';
|
|
67
68
|
export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
|
|
68
69
|
export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
|
|
70
|
+
export { setInputText } from './setInputText';
|
|
69
71
|
export { starMessage, StarMessageReturn } from './starMessage';
|
|
70
72
|
export { unmute } from './unmute';
|
|
@@ -43,7 +43,7 @@ export interface MessageButtonsOptions {
|
|
|
43
43
|
* Set to use interactive message instead of reply buttons.
|
|
44
44
|
* @default: undefined - auto detect
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
useInteractiveMessage?: boolean | null;
|
|
47
47
|
/**
|
|
48
48
|
* Footer text for buttons
|
|
49
49
|
*/
|
|
@@ -27,6 +27,12 @@ export interface OrderMessageOptions extends SendMessageOptions {
|
|
|
27
27
|
tax?: number;
|
|
28
28
|
shipping?: number;
|
|
29
29
|
offset?: number;
|
|
30
|
+
pix?: {
|
|
31
|
+
keyType: 'CNPJ' | 'CPF' | 'PHONE' | 'EMAIL' | 'EVP';
|
|
32
|
+
name: string;
|
|
33
|
+
key: string;
|
|
34
|
+
};
|
|
35
|
+
payment_instruction?: string;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Send a order message
|
|
@@ -34,24 +40,39 @@ export interface OrderMessageOptions extends SendMessageOptions {
|
|
|
34
40
|
*
|
|
35
41
|
* @example
|
|
36
42
|
* ```javascript
|
|
37
|
-
* // Send
|
|
38
|
-
* WPP.chat.
|
|
43
|
+
* // Send charge with a product
|
|
44
|
+
* WPP.chat.sendChargeMessage('[number]@c.us', [
|
|
39
45
|
* { type: 'product', id: '67689897878', qnt: 2 },
|
|
40
46
|
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
41
47
|
* ]
|
|
42
48
|
*
|
|
43
|
-
* // Send
|
|
44
|
-
* WPP.chat.
|
|
49
|
+
* // Send charge with a custom item
|
|
50
|
+
* WPP.chat.sendChargeMessage('[number]@c.us', [
|
|
45
51
|
* { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
|
|
46
52
|
* ]
|
|
47
53
|
*
|
|
48
|
-
* // Send
|
|
49
|
-
* WPP.chat.
|
|
54
|
+
* // Send charge with custom options
|
|
55
|
+
* WPP.chat.sendChargeMessage('[number]@c.us', [
|
|
50
56
|
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
51
57
|
* { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
|
|
52
58
|
* ],
|
|
53
59
|
* { tax: 10000, shipping: 4000, discount: 10000 }
|
|
60
|
+
*
|
|
61
|
+
* // Send charge with Pix data (auto generate copy-paste pix code)
|
|
62
|
+
* WPP.chat.sendChargeMessage('[number]@c.us', [
|
|
63
|
+
* { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
|
|
64
|
+
* ],
|
|
65
|
+
* {
|
|
66
|
+
* tax: 10000,
|
|
67
|
+
* shipping: 4000,
|
|
68
|
+
* discount: 10000,
|
|
69
|
+
* pix: {
|
|
70
|
+
* keyType: 'CPF',
|
|
71
|
+
* key: '00555095999',
|
|
72
|
+
* name: 'Name of seller',
|
|
73
|
+
* },
|
|
74
|
+
* });
|
|
54
75
|
* ```
|
|
55
76
|
* @category Message
|
|
56
77
|
*/
|
|
57
|
-
export declare function
|
|
78
|
+
export declare function sendChargeMessage(chatId: any, items: OrderItems[], options?: OrderMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -35,6 +35,20 @@ export interface GroupInviteMessage extends SendMessageOptions {
|
|
|
35
35
|
* groupId: '789@g.us'
|
|
36
36
|
* }
|
|
37
37
|
* );
|
|
38
|
+
*
|
|
39
|
+
* // After a invite
|
|
40
|
+
* const result = await WPP.group.addParticipants('789@g.us', '123@c.us');
|
|
41
|
+
* const participant = result['123@c.us'];
|
|
42
|
+
* if (participant.invite_code) {
|
|
43
|
+
* WPP.chat.sendGroupInviteMessage(
|
|
44
|
+
* '123@c.us',
|
|
45
|
+
* {
|
|
46
|
+
* inviteCode: participant.invite_code,
|
|
47
|
+
* inviteCodeExpiration: participant.invite_code_exp,
|
|
48
|
+
* groupId: '789@g.us'
|
|
49
|
+
* }
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
38
52
|
* ```
|
|
39
53
|
*
|
|
40
54
|
* @category Message
|
|
@@ -26,7 +26,7 @@ export type TextMessageOptions = SendMessageOptions & MessageButtonsOptions & Li
|
|
|
26
26
|
*
|
|
27
27
|
* // With Buttons
|
|
28
28
|
* WPP.chat.sendTextMessage('[number]@c.us', 'Hello', {
|
|
29
|
-
*
|
|
29
|
+
* useInteractiveMessage: true, // False for legacy
|
|
30
30
|
* buttons: [
|
|
31
31
|
* {
|
|
32
32
|
* url: 'https://wppconnect.io/',
|
|
@@ -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 '../../whatsapp';
|
|
17
|
+
export declare function setInputText(text: string, chatId?: string | Wid): Promise<{
|
|
18
|
+
text: string;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
}>;
|
package/dist/enums.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export { isInjected, isReady, isFullReady } from './webpack';
|
|
|
22
22
|
export { config, Config } from './config';
|
|
23
23
|
export * as blocklist from './blocklist';
|
|
24
24
|
export * as call from './call';
|
|
25
|
+
export * as cart from './cart';
|
|
26
|
+
export * as privacy from './privacy';
|
|
25
27
|
export * as catalog from './catalog';
|
|
26
28
|
export * as chat from './chat';
|
|
27
29
|
export * as conn from './conn';
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
export declare function get(): Promise<{
|
|
17
|
+
about: string;
|
|
18
|
+
callAdd: string;
|
|
19
|
+
groupAdd: string;
|
|
20
|
+
lastSeen: string;
|
|
21
|
+
online: string;
|
|
22
|
+
profilePicture: string;
|
|
23
|
+
readReceipts: string;
|
|
24
|
+
status: string;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
* Get the disallowed list to get the contacts who cannot see your privacy (this applies when enabled: my contacts, except...).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // get disalowed list for group Last seen
|
|
22
|
+
* const disalowed = WPP.privacy.getDisalowedList('last');
|
|
23
|
+
*
|
|
24
|
+
* // get disalowed list for profile
|
|
25
|
+
* const disalowed = WPP.privacy.getDisalowedList('profile');
|
|
26
|
+
*
|
|
27
|
+
* // get disalowed list for status
|
|
28
|
+
* const disalowed = WPP.privacy.getDisalowedList('status');
|
|
29
|
+
*
|
|
30
|
+
* // get disalowed list for group add
|
|
31
|
+
* const disalowed = WPP.privacy.getDisalowedList('groupadd');
|
|
32
|
+
*
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @category Privacy
|
|
36
|
+
*/
|
|
37
|
+
import { PrivacyDisallowedListType } from '../../enums';
|
|
38
|
+
export declare function getDisallowedList(type: PrivacyDisallowedListType): Promise<string[] | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { get } from './get';
|
|
17
|
+
export { getDisallowedList } from './getDisallowedList';
|
|
18
|
+
export { setAbout } from './setAbout';
|
|
19
|
+
export { setAddGroup } from './setAddGroup';
|
|
20
|
+
export { setLastSeen } from './setLastSeen';
|
|
21
|
+
export { setOnline } from './setOnline';
|
|
22
|
+
export { setProfilePic } from './setProfilePic';
|
|
23
|
+
export { setReadReceipts } from './setReadReceipts';
|
|
24
|
+
export { setStatus } from './setStatus';
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { PrivacyDisallowedListType } from '../../enums';
|
|
17
|
+
import { Wid } from '../../whatsapp';
|
|
18
|
+
export declare function prepareDisallowedList(type: PrivacyDisallowedListType, value: any, list?: {
|
|
19
|
+
id: string;
|
|
20
|
+
action: 'add' | 'remove';
|
|
21
|
+
}[]): Promise<{
|
|
22
|
+
ids: Wid[];
|
|
23
|
+
dhash: number | null;
|
|
24
|
+
idsFormatted: {
|
|
25
|
+
wid: Wid;
|
|
26
|
+
action: 'add' | 'remove';
|
|
27
|
+
}[];
|
|
28
|
+
allUsers: Wid[];
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
export declare enum setAboutTypes {
|
|
17
|
+
all = "all",
|
|
18
|
+
contacts = "contacts",
|
|
19
|
+
none = "none",
|
|
20
|
+
contact_blacklist = "contact_blacklist"
|
|
21
|
+
}
|
|
22
|
+
export declare function setAbout(value: setAboutTypes, disallowedList?: {
|
|
23
|
+
id: string;
|
|
24
|
+
action: 'add' | 'remove';
|
|
25
|
+
}[]): Promise<setAboutTypes>;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
export declare enum setAddGroupTypes {
|
|
17
|
+
all = "all",
|
|
18
|
+
contacts = "contacts",
|
|
19
|
+
contact_blacklist = "contact_blacklist"
|
|
20
|
+
}
|
|
21
|
+
export declare function setAddGroup(value: setAddGroupTypes, disallowedList?: {
|
|
22
|
+
id: string;
|
|
23
|
+
action: 'add' | 'remove';
|
|
24
|
+
}[]): Promise<setAddGroupTypes>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
export declare enum setLastSeenTypes {
|
|
17
|
+
all = "all",
|
|
18
|
+
contacts = "contacts",
|
|
19
|
+
none = "none",
|
|
20
|
+
contact_blacklist = "contact_blacklist"
|
|
21
|
+
}
|
|
22
|
+
export declare function setLastSeen(value: setLastSeenTypes, disallowedList?: {
|
|
23
|
+
id: string;
|
|
24
|
+
action: 'add' | 'remove';
|
|
25
|
+
}[]): Promise<setLastSeenTypes>;
|