@wppconnect/wa-js 2.2.2 → 2.3.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/archive.d.ts +54 -0
- package/dist/chat/functions/index.d.ts +2 -0
- package/dist/chat/functions/pin.d.ts +54 -0
- package/dist/chat/functions/sendFileMessage.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/whatsapp/enums/LogoutReason.d.ts +3 -1
- package/dist/whatsapp/functions/encryptAndSendGroupMsg.d.ts +20 -0
- package/dist/whatsapp/functions/encryptAndSendMsg.d.ts +20 -0
- package/dist/whatsapp/functions/getFanOutList.d.ts +22 -0
- package/dist/whatsapp/functions/getGroupSenderKeyList.d.ts +24 -0
- package/dist/whatsapp/functions/getOrGenerate.d.ts +1 -0
- package/dist/whatsapp/functions/index.d.ts +6 -0
- package/dist/whatsapp/functions/mediaTypeFromProtobuf.d.ts +3 -1
- package/dist/whatsapp/functions/setArchive.d.ts +20 -0
- package/dist/whatsapp/functions/setPin.d.ts +20 -0
- package/dist/whatsapp/misc/Cmd.d.ts +6 -2
- package/dist/whatsapp/misc/Features.d.ts +3 -1
- package/dist/whatsapp/misc/UserPrefs.d.ts +1 -0
- package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +1 -0
- package/dist/whatsapp/multidevice/waSignalStore.d.ts +3 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Archive a chat
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Archive a chat
|
|
23
|
+
* WPP.chat.archive('[number]@c.us');
|
|
24
|
+
*
|
|
25
|
+
* // Unarchive a chat
|
|
26
|
+
* WPP.chat.archive('[number]@c.us', false);
|
|
27
|
+
* // or
|
|
28
|
+
* WPP.chat.unarchive('[number]@c.us');
|
|
29
|
+
* ```
|
|
30
|
+
* @category Chat
|
|
31
|
+
*/
|
|
32
|
+
export declare function archive(chatId: string | Wid, archive?: boolean): Promise<{
|
|
33
|
+
wid: Wid;
|
|
34
|
+
archive: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Unarchive a chat
|
|
38
|
+
*
|
|
39
|
+
* @alias archive
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```javascript
|
|
43
|
+
* // Unarchive a chat
|
|
44
|
+
* WPP.chat.unarchive('[number]@c.us');
|
|
45
|
+
*
|
|
46
|
+
* // Alias for
|
|
47
|
+
* WPP.chat.archive('[number]@c.us', false);
|
|
48
|
+
* ```
|
|
49
|
+
* @category Chat
|
|
50
|
+
*/
|
|
51
|
+
export declare function unarchive(chatId: string | Wid): Promise<{
|
|
52
|
+
wid: Wid;
|
|
53
|
+
archive: boolean;
|
|
54
|
+
}>;
|
|
@@ -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 { archive, unarchive } from './archive';
|
|
16
17
|
export { canMute } from './canMute';
|
|
17
18
|
export { clear } from './clear';
|
|
18
19
|
export { delete } from './delete';
|
|
@@ -32,6 +33,7 @@ export { mute } from './mute';
|
|
|
32
33
|
export { openChatAt } from './openChatAt';
|
|
33
34
|
export { openChatBottom } from './openChatBottom';
|
|
34
35
|
export { openChatFromUnread } from './openChatFromUnread';
|
|
36
|
+
export { pin, unpin } from './pin';
|
|
35
37
|
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
36
38
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
37
39
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { Wid } from '../../whatsapp';
|
|
17
|
+
/**
|
|
18
|
+
* Pin a chat
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Pin a chat
|
|
23
|
+
* WPP.chat.pin('[number]@c.us');
|
|
24
|
+
*
|
|
25
|
+
* // Unpin a chat
|
|
26
|
+
* WPP.chat.pin('[number]@c.us', false);
|
|
27
|
+
* // or
|
|
28
|
+
* WPP.chat.unpin('[number]@c.us');
|
|
29
|
+
* ```
|
|
30
|
+
* @category Chat
|
|
31
|
+
*/
|
|
32
|
+
export declare function pin(chatId: string | Wid, pin?: boolean): Promise<{
|
|
33
|
+
wid: Wid;
|
|
34
|
+
pin: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Unpin a chat
|
|
38
|
+
*
|
|
39
|
+
* @alias pin
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```javascript
|
|
43
|
+
* // Unpin a chat
|
|
44
|
+
* WPP.chat.unpin('[number]@c.us');
|
|
45
|
+
*
|
|
46
|
+
* // Alias for
|
|
47
|
+
* WPP.chat.pin('[number]@c.us', false);
|
|
48
|
+
* ```
|
|
49
|
+
* @category Chat
|
|
50
|
+
*/
|
|
51
|
+
export declare function unpin(chatId: string | Wid): Promise<{
|
|
52
|
+
wid: Wid;
|
|
53
|
+
pin: boolean;
|
|
54
|
+
}>;
|
|
@@ -51,7 +51,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
|
|
|
51
51
|
* // Single document
|
|
52
52
|
* WPP.chat.sendFileMessage(
|
|
53
53
|
* '[number]@c.us',
|
|
54
|
-
* 'data:
|
|
54
|
+
* 'data:application/msword;base64,<a long base64 file...>',
|
|
55
55
|
* {
|
|
56
56
|
* type: 'document',
|
|
57
57
|
* caption: 'My document', // Optional
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import './deviceName';
|
|
|
18
18
|
import * as webpack from './webpack';
|
|
19
19
|
export { webpack };
|
|
20
20
|
export { isInjected, isReady } from './webpack';
|
|
21
|
-
export
|
|
21
|
+
export { config } from './config';
|
|
22
22
|
export * as blocklist from './blocklist';
|
|
23
23
|
export * as chat from './chat';
|
|
24
24
|
export * as conn from './conn';
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
/** @whatsapp 83578
|
|
16
|
+
/** @whatsapp 83578
|
|
17
|
+
* @whatsapp 88950 >= 2.2218.4
|
|
18
|
+
*/
|
|
17
19
|
export declare enum LogoutReason {
|
|
18
20
|
USER_INITIATED = "user_initiated",
|
|
19
21
|
SYNCD_FAILURE = "syncd_failure",
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { MsgModel } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 51974
|
|
19
|
+
*/
|
|
20
|
+
export declare function encryptAndSendGroupMsg(message: MsgModel, protobuf: any): Promise<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { MsgModel } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 95547
|
|
19
|
+
*/
|
|
20
|
+
export declare function encryptAndSendMsg(message: MsgModel): Promise<any>;
|
|
@@ -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 { Wid } from '../misc';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 16104
|
|
19
|
+
*/
|
|
20
|
+
export declare function getFanOutList(param: {
|
|
21
|
+
wids: Wid[];
|
|
22
|
+
}): Promise<Wid[]>;
|
|
@@ -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
|
+
import { Wid } from '../misc';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 43201
|
|
19
|
+
*/
|
|
20
|
+
export declare function getGroupSenderKeyList(wid: Wid): Promise<{
|
|
21
|
+
skList: Wid[];
|
|
22
|
+
skDistribList: Wid[];
|
|
23
|
+
rotateKey: boolean;
|
|
24
|
+
}>;
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
export * from './addAndSendMsgToChat';
|
|
17
17
|
export * from './blockContact';
|
|
18
18
|
export * from './createMsgProtobuf';
|
|
19
|
+
export * from './encryptAndSendGroupMsg';
|
|
20
|
+
export * from './encryptAndSendMsg';
|
|
19
21
|
export * from './fetchLinkPreview';
|
|
20
22
|
export * from './findChat';
|
|
21
23
|
export * from './findFirstWebLink';
|
|
22
24
|
export * from './generateVideoThumbsAndDuration';
|
|
23
25
|
export * from './genMinimalLinkPreview';
|
|
26
|
+
export * from './getFanOutList';
|
|
27
|
+
export * from './getGroupSenderKeyList';
|
|
24
28
|
export * from './getOrGenerate';
|
|
25
29
|
export * from './groupParticipants';
|
|
26
30
|
export * from './handleAck';
|
|
@@ -43,7 +47,9 @@ export * from './sendQueryGroupInvite';
|
|
|
43
47
|
export * from './sendReactionToMsg';
|
|
44
48
|
export * from './sendRevokeGroupInviteCode';
|
|
45
49
|
export * from './sendTextMsgToChat';
|
|
50
|
+
export * from './setArchive';
|
|
46
51
|
export * from './setGroup';
|
|
52
|
+
export * from './setPin';
|
|
47
53
|
export * from './status';
|
|
48
54
|
export * from './typeAttributeFromProtobuf';
|
|
49
55
|
export * from './uploadProductImage';
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
/** @whatsapp 95318
|
|
16
|
+
/** @whatsapp 95318
|
|
17
|
+
* @whatsapp 58853 >= 2.2218.4
|
|
18
|
+
*/
|
|
17
19
|
export declare function mediaTypeFromProtobuf(protoMessage: {
|
|
18
20
|
[key: string]: any;
|
|
19
21
|
}): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 '../models';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 59992
|
|
19
|
+
*/
|
|
20
|
+
export declare function setArchive(chat: ChatModel, archive: boolean, id?: string): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 '../models';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 10236
|
|
19
|
+
*/
|
|
20
|
+
export declare function setPin(chat: ChatModel, pin: boolean): Promise<void>;
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { ChatModel } from '..';
|
|
17
17
|
import { EventEmitter } from '.';
|
|
18
|
-
/** @whatsapp 88102
|
|
18
|
+
/** @whatsapp 88102
|
|
19
|
+
* @whatsapp 81572 >= 2.2218.4
|
|
20
|
+
*/
|
|
19
21
|
export declare class CmdClass extends EventEmitter {
|
|
20
22
|
isMainLoaded: boolean;
|
|
21
23
|
uiBusy: number;
|
|
@@ -144,5 +146,7 @@ export declare class CmdClass extends EventEmitter {
|
|
|
144
146
|
showCountrySelector(e?: any, t?: any, r?: any): void;
|
|
145
147
|
toggleStickerMaker(): void;
|
|
146
148
|
}
|
|
147
|
-
/** @whatsapp 88102
|
|
149
|
+
/** @whatsapp 88102
|
|
150
|
+
* @whatsapp 81572 >= 2.2218.4
|
|
151
|
+
*/
|
|
148
152
|
export declare const Cmd: CmdClass;
|
|
@@ -60,6 +60,8 @@ declare class FeatureClass extends EventEmitter {
|
|
|
60
60
|
isGroupCatchUpEnabled(): boolean;
|
|
61
61
|
isInAppSupportEnabled(): boolean;
|
|
62
62
|
}
|
|
63
|
-
/** @whatsapp 7293
|
|
63
|
+
/** @whatsapp 7293
|
|
64
|
+
* @whatsapp 38184 >= 2.2218.4
|
|
65
|
+
*/
|
|
64
66
|
export declare const Features: FeatureClass;
|
|
65
67
|
export {};
|
|
@@ -68,6 +68,8 @@ declare class SignalStore {
|
|
|
68
68
|
markKeyAsUploaded(e?: any): any;
|
|
69
69
|
rotateSignedPreKey(e?: any, t?: any): any;
|
|
70
70
|
}
|
|
71
|
-
/** @whatsapp 11849
|
|
71
|
+
/** @whatsapp 11849
|
|
72
|
+
* @whatsapp 40623 >= 2.2218.4
|
|
73
|
+
*/
|
|
72
74
|
export declare const waSignalStore: SignalStore;
|
|
73
75
|
export {};
|