@d0v3riz/baileys 6.3.1 → 6.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/WAProto/WAProto.proto +58 -24
- package/WAProto/index.d.ts +649 -410
- package/WAProto/index.js +1632 -985
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +1 -1
- package/lib/Socket/Client/abstract-socket-client.d.ts +1 -0
- package/lib/Socket/business.d.ts +4 -3
- package/lib/Socket/chats.d.ts +6 -5
- package/lib/Socket/groups.d.ts +3 -2
- package/lib/Socket/index.d.ts +9 -8
- package/lib/Socket/messages-recv.d.ts +5 -3
- package/lib/Socket/messages-recv.js +75 -2
- package/lib/Socket/messages-send.d.ts +3 -2
- package/lib/Socket/messages-send.js +13 -8
- package/lib/Socket/registration.d.ts +5 -4
- package/lib/Socket/socket.d.ts +4 -3
- package/lib/Socket/socket.js +69 -9
- package/lib/Store/make-in-memory-store.d.ts +2 -2
- package/lib/Types/Auth.d.ts +19 -17
- package/lib/Types/Call.d.ts +2 -2
- package/lib/Types/Chat.d.ts +13 -13
- package/lib/Types/Events.d.ts +3 -3
- package/lib/Types/GroupMetadata.d.ts +2 -2
- package/lib/Types/LabelAssociation.d.ts +2 -2
- package/lib/Types/Message.d.ts +57 -45
- package/lib/Types/Product.d.ts +14 -14
- package/lib/Types/Signal.d.ts +10 -10
- package/lib/Types/Socket.d.ts +5 -4
- package/lib/Types/State.d.ts +2 -2
- package/lib/Types/index.d.ts +5 -5
- package/lib/Utils/auth-utils.js +3 -1
- package/lib/Utils/chat-utils.d.ts +4 -4
- package/lib/Utils/crypto.d.ts +3 -0
- package/lib/Utils/crypto.js +15 -1
- package/lib/Utils/event-buffer.d.ts +2 -2
- package/lib/Utils/event-buffer.js +3 -3
- package/lib/Utils/generics.d.ts +7 -6
- package/lib/Utils/generics.js +25 -27
- package/lib/Utils/link-preview.d.ts +1 -1
- package/lib/Utils/link-preview.js +1 -24
- package/lib/Utils/make-mutex.d.ts +1 -1
- package/lib/Utils/messages-media.d.ts +9 -3
- package/lib/Utils/messages-media.js +54 -6
- package/lib/Utils/messages.d.ts +6 -5
- package/lib/Utils/messages.js +35 -1
- package/lib/Utils/process-message.d.ts +2 -2
- package/lib/Utils/validate-connection.js +1 -2
- package/lib/WABinary/jid-utils.d.ts +4 -4
- package/lib/WABinary/types.d.ts +4 -4
- package/lib/index.d.ts +1 -1
- package/package.json +6 -5
|
@@ -2,7 +2,7 @@ import { AxiosRequestConfig } from 'axios';
|
|
|
2
2
|
import type { Logger } from 'pino';
|
|
3
3
|
import { proto } from '../../WAProto';
|
|
4
4
|
import { AuthenticationCreds, BaileysEventEmitter, SignalKeyStoreWithTransaction, SocketConfig } from '../Types';
|
|
5
|
-
|
|
5
|
+
type ProcessMessageContext = {
|
|
6
6
|
shouldProcessHistoryMsg: boolean;
|
|
7
7
|
creds: AuthenticationCreds;
|
|
8
8
|
keyStore: SignalKeyStoreWithTransaction;
|
|
@@ -20,7 +20,7 @@ export declare const shouldIncrementChatUnread: (message: proto.IWebMessageInfo)
|
|
|
20
20
|
* Typically -- that'll be the remoteJid, but for broadcasts, it'll be the participant
|
|
21
21
|
*/
|
|
22
22
|
export declare const getChatId: ({ remoteJid, participant, fromMe }: proto.IMessageKey) => string;
|
|
23
|
-
|
|
23
|
+
type PollContext = {
|
|
24
24
|
/** normalised jid of the person that created the poll */
|
|
25
25
|
pollCreatorJid: string;
|
|
26
26
|
/** ID of the poll creation message */
|
|
@@ -180,9 +180,8 @@ const encodeSignedDeviceIdentity = (account, includeSignatureKey) => {
|
|
|
180
180
|
if (!includeSignatureKey || !((_a = account.accountSignatureKey) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
181
181
|
account.accountSignatureKey = null;
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
return WAProto_1.proto.ADVSignedDeviceIdentity
|
|
184
184
|
.encode(account)
|
|
185
185
|
.finish();
|
|
186
|
-
return accountEnc;
|
|
187
186
|
};
|
|
188
187
|
exports.encodeSignedDeviceIdentity = encodeSignedDeviceIdentity;
|
|
@@ -3,16 +3,16 @@ export declare const OFFICIAL_BIZ_JID = "16505361212@c.us";
|
|
|
3
3
|
export declare const SERVER_JID = "server@c.us";
|
|
4
4
|
export declare const PSA_WID = "0@c.us";
|
|
5
5
|
export declare const STORIES_JID = "status@broadcast";
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call';
|
|
7
|
+
export type JidWithDevice = {
|
|
8
8
|
user: string;
|
|
9
9
|
device?: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type FullJid = JidWithDevice & {
|
|
12
12
|
server: JidServer | string;
|
|
13
13
|
agent?: number;
|
|
14
14
|
};
|
|
15
|
-
export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number
|
|
15
|
+
export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string;
|
|
16
16
|
export declare const jidDecode: (jid: string | undefined) => FullJid | undefined;
|
|
17
17
|
/** is the jid a user */
|
|
18
18
|
export declare const areJidsSameUser: (jid1: string | undefined, jid2: string | undefined) => boolean;
|
package/lib/WABinary/types.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ import * as constants from './constants';
|
|
|
6
6
|
* This is done for easy serialization, to prevent running into issues with prototypes &
|
|
7
7
|
* to maintain functional code structure
|
|
8
8
|
* */
|
|
9
|
-
export
|
|
9
|
+
export type BinaryNode = {
|
|
10
10
|
tag: string;
|
|
11
11
|
attrs: {
|
|
12
12
|
[key: string]: string;
|
|
13
13
|
};
|
|
14
14
|
content?: BinaryNode[] | string | Uint8Array;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type BinaryNodeAttributes = BinaryNode['attrs'];
|
|
17
|
+
export type BinaryNodeData = BinaryNode['content'];
|
|
18
|
+
export type BinaryNodeCodingOptions = typeof constants;
|
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export * from './Types';
|
|
|
5
5
|
export * from './Store';
|
|
6
6
|
export * from './Defaults';
|
|
7
7
|
export * from './WABinary';
|
|
8
|
-
export
|
|
8
|
+
export type WASocket = ReturnType<typeof makeWASocket>;
|
|
9
9
|
export { makeWASocket };
|
|
10
10
|
export default makeWASocket;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d0v3riz/baileys",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "WhatsApp API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"whatsapp",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"changelog:update": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
|
|
35
35
|
"example": "node --inspect -r ts-node/register Example/example.ts",
|
|
36
36
|
"gen:protobuf": "sh WAProto/GenerateStatics.sh",
|
|
37
|
-
"lint": "eslint
|
|
38
|
-
"lint:fix": "eslint
|
|
37
|
+
"lint": "eslint src --ext .js,.ts,.jsx,.tsx",
|
|
38
|
+
"lint:fix": "eslint src --fix --ext .js,.ts,.jsx,.tsx",
|
|
39
39
|
"prepack": "tsc",
|
|
40
40
|
"prepare": "tsc",
|
|
41
41
|
"release": "release-it",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@adiwajshing/keyed-db": "^0.2.4",
|
|
46
46
|
"@hapi/boom": "^9.1.3",
|
|
47
|
+
"audio-decode": "^2.1.3",
|
|
47
48
|
"axios": "^1.3.3",
|
|
48
49
|
"cache-manager": "^5.2.2",
|
|
49
50
|
"futoin-hkdf": "^1.5.1",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"ws": "^8.13.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
|
-
"@adiwajshing/eslint-config": "
|
|
61
|
+
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
|
|
61
62
|
"@types/got": "^9.6.11",
|
|
62
63
|
"@types/jest": "^27.5.1",
|
|
63
64
|
"@types/node": "^16.0.0",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"ts-jest": "^27.0.3",
|
|
75
76
|
"ts-node": "^10.8.1",
|
|
76
77
|
"typedoc": "^0.24.7",
|
|
77
|
-
"typescript": "^4.
|
|
78
|
+
"typescript": "^4.6.4"
|
|
78
79
|
},
|
|
79
80
|
"peerDependencies": {
|
|
80
81
|
"jimp": "^0.16.1",
|