@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.
Files changed (51) hide show
  1. package/WAProto/WAProto.proto +58 -24
  2. package/WAProto/index.d.ts +649 -410
  3. package/WAProto/index.js +1632 -985
  4. package/lib/Defaults/baileys-version.json +1 -1
  5. package/lib/Defaults/index.js +1 -1
  6. package/lib/Socket/Client/abstract-socket-client.d.ts +1 -0
  7. package/lib/Socket/business.d.ts +4 -3
  8. package/lib/Socket/chats.d.ts +6 -5
  9. package/lib/Socket/groups.d.ts +3 -2
  10. package/lib/Socket/index.d.ts +9 -8
  11. package/lib/Socket/messages-recv.d.ts +5 -3
  12. package/lib/Socket/messages-recv.js +75 -2
  13. package/lib/Socket/messages-send.d.ts +3 -2
  14. package/lib/Socket/messages-send.js +13 -8
  15. package/lib/Socket/registration.d.ts +5 -4
  16. package/lib/Socket/socket.d.ts +4 -3
  17. package/lib/Socket/socket.js +69 -9
  18. package/lib/Store/make-in-memory-store.d.ts +2 -2
  19. package/lib/Types/Auth.d.ts +19 -17
  20. package/lib/Types/Call.d.ts +2 -2
  21. package/lib/Types/Chat.d.ts +13 -13
  22. package/lib/Types/Events.d.ts +3 -3
  23. package/lib/Types/GroupMetadata.d.ts +2 -2
  24. package/lib/Types/LabelAssociation.d.ts +2 -2
  25. package/lib/Types/Message.d.ts +57 -45
  26. package/lib/Types/Product.d.ts +14 -14
  27. package/lib/Types/Signal.d.ts +10 -10
  28. package/lib/Types/Socket.d.ts +5 -4
  29. package/lib/Types/State.d.ts +2 -2
  30. package/lib/Types/index.d.ts +5 -5
  31. package/lib/Utils/auth-utils.js +3 -1
  32. package/lib/Utils/chat-utils.d.ts +4 -4
  33. package/lib/Utils/crypto.d.ts +3 -0
  34. package/lib/Utils/crypto.js +15 -1
  35. package/lib/Utils/event-buffer.d.ts +2 -2
  36. package/lib/Utils/event-buffer.js +3 -3
  37. package/lib/Utils/generics.d.ts +7 -6
  38. package/lib/Utils/generics.js +25 -27
  39. package/lib/Utils/link-preview.d.ts +1 -1
  40. package/lib/Utils/link-preview.js +1 -24
  41. package/lib/Utils/make-mutex.d.ts +1 -1
  42. package/lib/Utils/messages-media.d.ts +9 -3
  43. package/lib/Utils/messages-media.js +54 -6
  44. package/lib/Utils/messages.d.ts +6 -5
  45. package/lib/Utils/messages.js +35 -1
  46. package/lib/Utils/process-message.d.ts +2 -2
  47. package/lib/Utils/validate-connection.js +1 -2
  48. package/lib/WABinary/jid-utils.d.ts +4 -4
  49. package/lib/WABinary/types.d.ts +4 -4
  50. package/lib/index.d.ts +1 -1
  51. 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
- declare type ProcessMessageContext = {
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
- declare type PollContext = {
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
- const accountEnc = WAProto_1.proto.ADVSignedDeviceIdentity
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 declare type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call';
7
- export declare type JidWithDevice = {
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 declare type FullJid = JidWithDevice & {
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 | undefined, agent?: number | undefined) => string;
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;
@@ -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 declare type BinaryNode = {
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 declare type BinaryNodeAttributes = BinaryNode['attrs'];
17
- export declare type BinaryNodeData = BinaryNode['content'];
18
- export declare type BinaryNodeCodingOptions = typeof constants;
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 declare type WASocket = ReturnType<typeof makeWASocket>;
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.1",
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 . --ext .js,.ts,.jsx,.tsx",
38
- "lint:fix": "eslint . --fix --ext .js,.ts,.jsx,.tsx",
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": "https://github.com/adiwajshing/eslint-config.git",
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.0.0"
78
+ "typescript": "^4.6.4"
78
79
  },
79
80
  "peerDependencies": {
80
81
  "jimp": "^0.16.1",