@wppconnect/wa-js 2.3.0 → 2.4.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 +9 -0
- package/dist/chat/functions/index.d.ts +2 -0
- package/dist/chat/functions/list.d.ts +39 -0
- package/dist/chat/functions/sendCreatePollMessage.d.ts +35 -0
- package/dist/chat/functions/sendLocationMessage.d.ts +2 -2
- package/dist/whatsapp/collections/AggReactionsCollection.d.ts +22 -0
- package/dist/whatsapp/collections/ReactionsCollection.d.ts +30 -0
- package/dist/whatsapp/collections/ReactionsSendersCollection.d.ts +22 -0
- package/dist/whatsapp/collections/index.d.ts +3 -0
- package/dist/whatsapp/models/AggReactionsModel.d.ts +39 -0
- package/dist/whatsapp/models/ReactionsModel.d.ts +43 -0
- package/dist/whatsapp/models/ReactionsSendersModel.d.ts +47 -0
- package/dist/whatsapp/models/index.d.ts +3 -0
- package/dist/whatsapp/stores.d.ts +2 -0
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -24,6 +24,7 @@ export { generateMessageID } from './generateMessageID';
|
|
|
24
24
|
export { get } from './get';
|
|
25
25
|
export { getMessageById } from './getMessageById';
|
|
26
26
|
export { getMessages, GetMessagesOptions } from './getMessages';
|
|
27
|
+
export { ChatListOptions, list } from './list';
|
|
27
28
|
export { markIsComposing } from './markIsComposing';
|
|
28
29
|
export { markIsPaused } from './markIsPaused';
|
|
29
30
|
export { markIsRead } from './markIsRead';
|
|
@@ -37,6 +38,7 @@ export { pin, unpin } from './pin';
|
|
|
37
38
|
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
38
39
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
39
40
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
41
|
+
export { PoolMessageOptions, sendCreatePollMessage, } from './sendCreatePollMessage';
|
|
40
42
|
export { AudioMessageOptions, AutoDetectMessageOptions, DocumentMessageOptions, FileMessageOptions, ImageMessageOptions, sendFileMessage, StickerMessageOptions, VideoMessageOptions, } from './sendFileMessage';
|
|
41
43
|
export { ListMessageOptions, sendListMessage } from './sendListMessage';
|
|
42
44
|
export { LocationMessageOptions, sendLocationMessage, } from './sendLocationMessage';
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { ChatModel } from '../../whatsapp';
|
|
17
|
+
export interface ChatListOptions {
|
|
18
|
+
onlyGroups?: boolean;
|
|
19
|
+
onlyUsers?: boolean;
|
|
20
|
+
onlyWithUnreadMessage?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Return a list of chats
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* // All chats
|
|
28
|
+
* const chat = await WPP.chat.list();
|
|
29
|
+
*
|
|
30
|
+
* // Only users chats
|
|
31
|
+
* const chat = await WPP.chat.list({onlyUsers: true});
|
|
32
|
+
*
|
|
33
|
+
* // Only groups chats
|
|
34
|
+
* const chat = await WPP.chat.list({onlyGroups: true});
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @category Chat
|
|
38
|
+
*/
|
|
39
|
+
export declare function list(options: ChatListOptions): Promise<ChatModel[]>;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
export declare type PoolMessageOptions = SendMessageOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Send a create poll message
|
|
20
|
+
*
|
|
21
|
+
* Note: This only works for groups
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* // Single pool
|
|
26
|
+
* WPP.chat.sendCreatePollMessage(
|
|
27
|
+
* '[number]@g.us',
|
|
28
|
+
* 'A poll name',
|
|
29
|
+
* ['Option 1', 'Option 2', 'Option 3']
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @category Message
|
|
34
|
+
*/
|
|
35
|
+
export declare function sendCreatePollMessage(chatId: any, name: string, choices: string[], options?: PoolMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -19,11 +19,11 @@ export interface LocationMessageOptions extends SendMessageOptions, MessageButto
|
|
|
19
19
|
/**
|
|
20
20
|
* latitude in degrees
|
|
21
21
|
*/
|
|
22
|
-
lat: number;
|
|
22
|
+
lat: number | string;
|
|
23
23
|
/**
|
|
24
24
|
* longitude in degrees
|
|
25
25
|
*/
|
|
26
|
-
lng: number;
|
|
26
|
+
lng: number | string;
|
|
27
27
|
/**
|
|
28
28
|
* The full address of place
|
|
29
29
|
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { AggReactionsModel } from '../models';
|
|
17
|
+
import { Collection } from './Collection';
|
|
18
|
+
/** @whatsapp 81130 */
|
|
19
|
+
export declare class AggReactionsCollection extends Collection<AggReactionsModel> {
|
|
20
|
+
static model: AggReactionsModel;
|
|
21
|
+
static comparator(): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { ReactionsModel } from '../models';
|
|
17
|
+
import { BaseCollection } from './BaseCollection';
|
|
18
|
+
/** @whatsapp 57162 */
|
|
19
|
+
export declare class ReactionsCollection extends BaseCollection<ReactionsModel> {
|
|
20
|
+
static model: ReactionsModel;
|
|
21
|
+
static comparator(): any;
|
|
22
|
+
addOrUpdateReaction(e?: any): any;
|
|
23
|
+
removeReaction(e?: any): void;
|
|
24
|
+
getAggregateEmojiAndSender(e?: any, t?: any): any;
|
|
25
|
+
markReactionsAsRead(e?: any): void;
|
|
26
|
+
getExistingSenderModelFromReactionDetails(e?: any): any;
|
|
27
|
+
updateFailedPropsForExistingSentReaction(e?: any): void;
|
|
28
|
+
shouldUpdateAck(e?: any): any;
|
|
29
|
+
deleteReactionsByParentMessageKey(e?: any): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { ReactionsModel, ReactionsSendersModel } from '../models';
|
|
17
|
+
import { Collection } from './Collection';
|
|
18
|
+
/** @whatsapp 81130 */
|
|
19
|
+
export declare class ReactionsSendersCollection extends Collection<ReactionsModel> {
|
|
20
|
+
static model: ReactionsSendersModel;
|
|
21
|
+
static comparator(): number;
|
|
22
|
+
}
|
|
@@ -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 * from './AggReactionsCollection';
|
|
16
17
|
export * from './BaseCollection';
|
|
17
18
|
export * from './BlocklistCollection';
|
|
18
19
|
export * from './BusinessCategoriesResultCollection';
|
|
@@ -46,6 +47,8 @@ export * from './ProductImageCollection';
|
|
|
46
47
|
export * from './ProductMessageListCollection';
|
|
47
48
|
export * from './ProfilePicThumbCollection';
|
|
48
49
|
export * from './QuickReplyCollection';
|
|
50
|
+
export * from './ReactionsCollection';
|
|
51
|
+
export * from './ReactionsSendersCollection';
|
|
49
52
|
export * from './RecentEmojiCollection';
|
|
50
53
|
export * from './RecentStickerCollection';
|
|
51
54
|
export * from './StarredMsgCollection';
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { ReactionsSendersCollection } from '../collections';
|
|
17
|
+
import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
|
|
18
|
+
interface Props {
|
|
19
|
+
id?: any;
|
|
20
|
+
aggregateEmoji?: any;
|
|
21
|
+
hasReactionByMe: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface Session {
|
|
24
|
+
}
|
|
25
|
+
interface Derived {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @whatsapp 81130
|
|
29
|
+
*/
|
|
30
|
+
export declare interface AggReactionsModel extends ModelProxy<Props, Session, Derived> {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @whatsapp 81130
|
|
34
|
+
*/
|
|
35
|
+
export declare class AggReactionsModel extends Model {
|
|
36
|
+
constructor(proterties?: ModelPropertiesContructor<AggReactionsModel>, options?: ModelOptions);
|
|
37
|
+
senders: ReactionsSendersCollection;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { AggReactionsCollection, ReactionsCollection } from '../collections';
|
|
17
|
+
import { MsgKey, Wid } from '../misc';
|
|
18
|
+
import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
|
|
19
|
+
import { ReactionsSendersModel } from './ReactionsSendersModel';
|
|
20
|
+
interface Props {
|
|
21
|
+
id: Wid;
|
|
22
|
+
reactionByMe?: ReactionsSendersModel;
|
|
23
|
+
}
|
|
24
|
+
interface Session {
|
|
25
|
+
}
|
|
26
|
+
interface Derived {
|
|
27
|
+
}
|
|
28
|
+
/** @whatsapp 80666 */
|
|
29
|
+
export declare interface ReactionsModel extends ModelProxy<Props, Session, Derived> {
|
|
30
|
+
}
|
|
31
|
+
/** @whatsapp 80666 */
|
|
32
|
+
export declare class ReactionsModel extends Model {
|
|
33
|
+
constructor(proterties?: ModelPropertiesContructor<ReactionsModel>, options?: ModelOptions);
|
|
34
|
+
reactions: AggReactionsCollection;
|
|
35
|
+
unreadSenders(): {
|
|
36
|
+
msgKey: string;
|
|
37
|
+
parentMsgKey: MsgKey;
|
|
38
|
+
reactionText: string;
|
|
39
|
+
senderUserJid: string;
|
|
40
|
+
}[];
|
|
41
|
+
getCollection(): ReactionsCollection;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
|
|
17
|
+
interface Props {
|
|
18
|
+
id?: any;
|
|
19
|
+
msgKey?: string;
|
|
20
|
+
parentMsgKey?: string;
|
|
21
|
+
reactionText?: string;
|
|
22
|
+
timestamp?: number;
|
|
23
|
+
senderUserJid?: string;
|
|
24
|
+
read?: boolean;
|
|
25
|
+
orphan?: number;
|
|
26
|
+
ack?: number;
|
|
27
|
+
isSendFailure?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface Session {
|
|
30
|
+
senderObj?: any;
|
|
31
|
+
}
|
|
32
|
+
interface Derived {
|
|
33
|
+
isFailed: boolean;
|
|
34
|
+
parentMsg?: any;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @whatsapp 81130
|
|
38
|
+
*/
|
|
39
|
+
export declare interface ReactionsSendersModel extends ModelProxy<Props, Session, Derived> {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @whatsapp 81130
|
|
43
|
+
*/
|
|
44
|
+
export declare class ReactionsSendersModel extends Model {
|
|
45
|
+
constructor(proterties?: ModelPropertiesContructor<ReactionsSendersModel>, options?: ModelOptions);
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -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 * from './AggReactionsModel';
|
|
16
17
|
export * from './AttachMediaModel';
|
|
17
18
|
export * from './BlocklistModel';
|
|
18
19
|
export * from './BusinessCategoriesResultModel';
|
|
@@ -52,6 +53,8 @@ export * from './ProductMessageListModel';
|
|
|
52
53
|
export * from './ProductModel';
|
|
53
54
|
export * from './ProfilePicThumbModel';
|
|
54
55
|
export * from './QuickReplyModel';
|
|
56
|
+
export * from './ReactionsModel';
|
|
57
|
+
export * from './ReactionsSendersModel';
|
|
55
58
|
export * from './RecentEmojiModel';
|
|
56
59
|
export * from './RecentStickerModel';
|
|
57
60
|
export * from './ReplyButtonModel';
|
|
@@ -56,6 +56,8 @@ export declare const ProductMessageListStore: collections.ProductMessageListColl
|
|
|
56
56
|
export declare const ProfilePicThumbStore: collections.ProfilePicThumbCollection;
|
|
57
57
|
/** @whatsapp 99662 */
|
|
58
58
|
export declare const QuickReplyStore: collections.QuickReplyCollection;
|
|
59
|
+
/** @whatsapp 57162 */
|
|
60
|
+
export declare const ReactionsStore: collections.ReactionsCollection;
|
|
59
61
|
/** @whatsapp 92671 */
|
|
60
62
|
export declare const RecentEmojiStore: collections.RecentEmojiCollection;
|
|
61
63
|
/** @whatsapp 49264 */
|