@jkt48connect-corp/baileys 7.2.6 → 7.2.8

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 (102) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +838 -94
  3. package/WAProto/WAProto.proto +969 -88
  4. package/WAProto/index.d.ts +13199 -1260
  5. package/WAProto/index.js +124901 -74525
  6. package/lib/Defaults/baileys-version.json +1 -1
  7. package/lib/Defaults/index.d.ts +7 -8
  8. package/lib/Defaults/index.js +5 -3
  9. package/lib/Defaults/phonenumber-mcc.json +221 -221
  10. package/lib/Signal/libsignal.js +18 -9
  11. package/lib/Socket/Client/abstract-socket-client.d.ts +0 -2
  12. package/lib/Socket/Client/mobile-socket-client.d.ts +0 -1
  13. package/lib/Socket/business.d.ts +40 -40
  14. package/lib/Socket/chats.d.ts +13 -14
  15. package/lib/Socket/groups.d.ts +20 -21
  16. package/lib/Socket/groups.js +1 -1
  17. package/lib/Socket/index.d.ts +49 -49
  18. package/lib/Socket/messages-recv.d.ts +39 -39
  19. package/lib/Socket/messages-recv.js +310 -151
  20. package/lib/Socket/messages-send.d.ts +33 -31
  21. package/lib/Socket/messages-send.js +269 -36
  22. package/lib/Socket/newsletter.d.ts +24 -25
  23. package/lib/Socket/newsletter.js +3 -3
  24. package/lib/Socket/registration.d.ts +49 -52
  25. package/lib/Socket/registration.js +7 -7
  26. package/lib/Socket/socket.d.ts +6 -7
  27. package/lib/Socket/socket.js +7 -3
  28. package/lib/Store/make-cache-manager-store.d.ts +1 -0
  29. package/lib/Store/make-in-memory-store.d.ts +3 -4
  30. package/lib/Store/make-in-memory-store.js +13 -11
  31. package/lib/Store/make-ordered-dictionary.d.ts +1 -1
  32. package/lib/Types/Auth.d.ts +0 -1
  33. package/lib/Types/Call.d.ts +1 -1
  34. package/lib/Types/Chat.d.ts +12 -7
  35. package/lib/Types/Events.d.ts +17 -2
  36. package/lib/Types/GroupMetadata.d.ts +3 -1
  37. package/lib/Types/Label.d.ts +11 -0
  38. package/lib/Types/Label.js +1 -1
  39. package/lib/Types/LabelAssociation.js +1 -1
  40. package/lib/Types/Message.d.ts +164 -13
  41. package/lib/Types/Newsletter.js +3 -3
  42. package/lib/Types/Socket.d.ts +7 -2
  43. package/lib/Types/index.d.ts +9 -0
  44. package/lib/Types/index.js +1 -1
  45. package/lib/Utils/auth-utils.js +3 -3
  46. package/lib/Utils/business.d.ts +1 -1
  47. package/lib/Utils/business.js +2 -2
  48. package/lib/Utils/chat-utils.d.ts +11 -12
  49. package/lib/Utils/chat-utils.js +41 -20
  50. package/lib/Utils/crypto.d.ts +15 -16
  51. package/lib/Utils/crypto.js +35 -23
  52. package/lib/Utils/decode-wa-message.d.ts +17 -0
  53. package/lib/Utils/decode-wa-message.js +43 -15
  54. package/lib/Utils/generics.d.ts +10 -19
  55. package/lib/Utils/generics.js +32 -16
  56. package/lib/Utils/history.d.ts +6 -2
  57. package/lib/Utils/history.js +3 -0
  58. package/lib/Utils/index.d.ts +0 -1
  59. package/lib/Utils/index.js +0 -1
  60. package/lib/Utils/logger.d.ts +1 -3
  61. package/lib/Utils/make-mutex.d.ts +2 -2
  62. package/lib/Utils/messages-media.d.ts +25 -28
  63. package/lib/Utils/messages-media.js +38 -47
  64. package/lib/Utils/messages.d.ts +5 -8
  65. package/lib/Utils/messages.js +430 -12
  66. package/lib/Utils/noise-handler.d.ts +4 -5
  67. package/lib/Utils/process-message.js +2 -2
  68. package/lib/Utils/use-multi-file-auth-state.js +17 -3
  69. package/lib/Utils/validate-connection.d.ts +2 -2
  70. package/lib/Utils/validate-connection.js +12 -23
  71. package/lib/WABinary/decode.d.ts +1 -2
  72. package/lib/WABinary/decode.js +17 -7
  73. package/lib/WABinary/encode.d.ts +1 -2
  74. package/lib/WABinary/encode.js +33 -17
  75. package/lib/WABinary/generic-utils.d.ts +2 -3
  76. package/lib/WABinary/generic-utils.js +2 -2
  77. package/lib/WABinary/jid-utils.d.ts +1 -1
  78. package/lib/WAM/BinaryInfo.d.ts +2 -11
  79. package/lib/WAM/encode.d.ts +1 -2
  80. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +9 -0
  81. package/lib/WAUSync/Protocols/USyncContactProtocol.js +32 -0
  82. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +22 -0
  83. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +57 -0
  84. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +12 -0
  85. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +30 -0
  86. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +12 -0
  87. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +42 -0
  88. package/lib/WAUSync/Protocols/index.d.ts +4 -0
  89. package/lib/WAUSync/Protocols/index.js +20 -0
  90. package/lib/WAUSync/USyncQuery.d.ts +26 -0
  91. package/lib/WAUSync/USyncQuery.js +79 -0
  92. package/lib/WAUSync/USyncUser.d.ts +10 -0
  93. package/lib/WAUSync/USyncUser.js +22 -0
  94. package/lib/WAUSync/index.d.ts +3 -0
  95. package/lib/WAUSync/index.js +19 -0
  96. package/lib/index.js +4 -1
  97. package/package.json +15 -10
  98. package/lib/Socket/community.d.ts +0 -219
  99. package/lib/Socket/community.js +0 -354
  100. package/lib/Utils/use-single-file-auth-statev2.d.ts +0 -12
  101. package/lib/Utils/use-single-file-auth-statev2.js +0 -75
  102. package/lib/index.d.ts +0 -11
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { NewsletterFetchedUpdate, NewsletterMetadata, NewsletterReactionMode, NewsletterViewRole, SocketConfig, WAMediaUpload } from '../Types';
3
2
  import { BinaryNode } from '../WABinary';
4
3
  export declare const makeNewsletterSocket: (config: SocketConfig) => {
@@ -14,9 +13,9 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
14
13
  newsletterFollow: (jid: string) => Promise<void>;
15
14
  newsletterUnmute: (jid: string) => Promise<void>;
16
15
  newsletterMute: (jid: string) => Promise<void>;
17
- newsletterAction: (jid: string, type: 'follow' | 'unfollow' | 'mute' | 'unmute') => Promise<void>;
18
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<NewsletterMetadata>;
19
- newsletterMetadata: (type: 'invite' | 'jid', key: string, role?: NewsletterViewRole) => Promise<NewsletterMetadata>;
16
+ newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
17
+ newsletterCreate: (name: string, description: string) => Promise<NewsletterMetadata>;
18
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: NewsletterViewRole) => Promise<NewsletterMetadata>;
20
19
  newsletterAdminCount: (jid: string) => Promise<number>;
21
20
  /**user is Lid, not Jid */
22
21
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
@@ -25,7 +24,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
25
24
  newsletterDelete: (jid: string) => Promise<void>;
26
25
  /**if code wasn't passed, the reaction will be removed (if is reacted) */
27
26
  newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
28
- newsletterFetchMessages: (type: 'invite' | 'jid', key: string, count: number, after?: number) => Promise<NewsletterFetchedUpdate[]>;
27
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<NewsletterFetchedUpdate[]>;
29
28
  newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<NewsletterFetchedUpdate[]>;
30
29
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
31
30
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
@@ -34,7 +33,7 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
34
33
  groupRequestParticipantsList: (jid: string) => Promise<{
35
34
  [key: string]: string;
36
35
  }[]>;
37
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
36
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
38
37
  status: string;
39
38
  jid: string;
40
39
  }[]>;
@@ -43,30 +42,30 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
43
42
  jid: string;
44
43
  content: BinaryNode;
45
44
  }[]>;
46
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
45
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
47
46
  groupInviteCode: (jid: string) => Promise<string | undefined>;
48
47
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
49
48
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
50
49
  groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
51
50
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
52
51
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
53
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
54
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
52
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
53
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
55
54
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
56
55
  groupFetchAllParticipating: () => Promise<{
57
56
  [_: string]: import("../Types").GroupMetadata;
58
57
  }>;
59
58
  processingMutex: {
60
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
59
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
61
60
  };
62
61
  fetchPrivacySettings: (force?: boolean) => Promise<{
63
62
  [_: string]: string;
64
63
  }>;
65
64
  upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
66
65
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
67
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
68
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
69
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
66
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
67
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
68
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
70
69
  onWhatsApp: (...jids: string[]) => Promise<{
71
70
  exists: boolean;
72
71
  jid: string;
@@ -88,25 +87,25 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
88
87
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
89
88
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
90
89
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
91
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
90
+ getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
92
91
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
93
92
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
94
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
93
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
95
94
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
96
95
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
97
96
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
98
97
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
99
98
  star: (jid: string, messages: {
100
99
  id: string;
101
- fromMe?: boolean | undefined;
100
+ fromMe?: boolean;
102
101
  }[], star: boolean) => Promise<void>;
103
102
  type: "md";
104
103
  ws: any;
105
104
  ev: import("../Types").BaileysEventEmitter & {
106
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
105
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
107
106
  buffer(): void;
108
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
109
- flush(force?: boolean | undefined): boolean;
107
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
108
+ flush(force?: boolean): boolean;
110
109
  isBuffering(): boolean;
111
110
  };
112
111
  authState: {
@@ -116,18 +115,18 @@ export declare const makeNewsletterSocket: (config: SocketConfig) => {
116
115
  signalRepository: import("../Types").SignalRepository;
117
116
  user: import("../Types").Contact | undefined;
118
117
  generateMessageTag: () => string;
119
- query: (node: BinaryNode, timeoutMs?: number | undefined) => Promise<BinaryNode>;
120
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
118
+ query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
119
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
121
120
  waitForSocketOpen: () => Promise<void>;
122
121
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
123
122
  sendNode: (frame: BinaryNode) => Promise<void>;
124
- logout: (msg?: string | undefined) => Promise<void>;
123
+ logout: (msg?: string) => Promise<void>;
125
124
  end: (error: Error | undefined) => void;
126
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
125
+ onUnexpectedError: (err: Error | Boom, msg: string) => void;
127
126
  uploadPreKeys: (count?: number) => Promise<void>;
128
127
  uploadPreKeysToServerIfRequired: () => Promise<void>;
129
- requestPairingCode: (phoneNumber: string) => Promise<string>;
130
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
128
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
129
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
131
130
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
132
131
  };
133
132
  export declare const extractNewsletterMetadata: (node: BinaryNode, isCreate?: boolean) => NewsletterMetadata;
@@ -115,9 +115,9 @@ const makeNewsletterSocket = (config) => {
115
115
  await newsletterWMexQuery(jid, Types_1.QueryIds.MUTE);
116
116
  },
117
117
  newsletterAction: async (jid, type) => {
118
- await newsletterWMexQuery(jid, type.toUpperCase());
118
+ await newsletterWMexQuery(jid, Types_1.QueryIds[type.toUpperCase()]);
119
119
  },
120
- newsletterCreate: async (name, description, reaction_codes) => {
120
+ newsletterCreate: async (name, description) => {
121
121
  //TODO: Implement TOS system wide for Meta AI, communities, and here etc.
122
122
  /**tos query */
123
123
  await query({
@@ -140,7 +140,7 @@ const makeNewsletterSocket = (config) => {
140
140
  ]
141
141
  });
142
142
  const result = await newsletterWMexQuery(undefined, Types_1.QueryIds.CREATE, {
143
- input: { name, description, settings: { 'reaction_codes': { value: reaction_codes.toUpperCase() } } }
143
+ input: { name, description, settings: null }
144
144
  });
145
145
  return (0, exports.extractNewsletterMetadata)(result, true);
146
146
  },
@@ -1,16 +1,15 @@
1
- /// <reference types="node" />
2
- import { AxiosRequestConfig } from 'axios';
1
+ import axios, { AxiosRequestConfig } from 'axios';
3
2
  import { KeyPair, SignedKeyPair, SocketConfig } from '../Types';
4
3
  export declare const makeRegistrationSocket: (config: SocketConfig) => {
5
4
  register: (code: string) => Promise<ExistsResponse>;
6
5
  requestRegistrationCode: (registrationOptions?: RegistrationOptions) => Promise<ExistsResponse>;
7
- logger: import("pino").Logger<import("pino").LoggerOptions>;
6
+ logger: Logger;
8
7
  getOrderDetails: (orderId: string, tokenBase64: string) => Promise<import("../Types").OrderDetails>;
9
8
  getCatalog: ({ jid, limit, cursor }: import("../Types").GetCatalogOptions) => Promise<{
10
9
  products: import("../Types").Product[];
11
- nextPageCursor: string | undefined;
10
+ nextPageCursor: any;
12
11
  }>;
13
- getCollections: (jid?: string | undefined, limit?: number) => Promise<{
12
+ getCollections: (jid?: string, limit?: number) => Promise<{
14
13
  collections: import("../Types").CatalogCollection[];
15
14
  }>;
16
15
  productCreate: (create: import("../Types").ProductCreate) => Promise<import("../Types").Product>;
@@ -18,27 +17,26 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
18
17
  deleted: number;
19
18
  }>;
20
19
  productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise<import("../Types").Product>;
21
- sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode) => Promise<void>;
20
+ sendMessageAck: ({ tag, attrs, content }: import("../WABinary").BinaryNode, errorCode?: number) => Promise<void>;
22
21
  sendRetryRequest: (node: import("../WABinary").BinaryNode, forceIncludeKeys?: boolean) => Promise<void>;
23
22
  offerCall: (toJid: string, isVideo?: boolean) => Promise<{
24
- id: string;
23
+ id: any;
25
24
  to: string;
26
25
  }>;
27
26
  rejectCall: (callId: string, callFrom: string) => Promise<void>;
27
+ fetchMessageHistory: (count: number, oldestMsgKey: import("../Types").WAMessageKey, oldestMsgTimestamp: number) => Promise<string>;
28
+ requestPlaceholderResend: (messageKey: import("../Types").WAMessageKey) => Promise<string | undefined>;
28
29
  getPrivacyTokens: (jids: string[]) => Promise<import("../WABinary").BinaryNode>;
29
30
  assertSessions: (jids: string[], force: boolean) => Promise<boolean>;
30
31
  relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, additionalNodes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: import("../Types").MessageRelayOptions) => Promise<string>;
31
32
  sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise<void>;
32
- sendReceipts: (keys: import("../Types").WAProto.IMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
33
- getButtonArgs: (message: import("../Types").WAProto.IMessage) => {
34
- [key: string]: string;
35
- };
36
- readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise<void>;
33
+ sendReceipts: (keys: import("../Types").WAMessageKey[], type: import("../Types").MessageReceiptType) => Promise<void>;
34
+ getButtonArgs: (message: import("../Types").WAProto.IMessage) => import("../WABinary").BinaryNode["attrs"];
35
+ readMessages: (keys: import("../Types").WAMessageKey[]) => Promise<void>;
37
36
  refreshMediaConn: (forceGet?: boolean) => Promise<import("../Types").MediaConnInfo>;
38
37
  getUSyncDevices: (jids: string[], useCache: boolean, ignoreZeroDevices: boolean) => Promise<import("../WABinary").JidWithDevice[]>;
39
- createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: {
40
- [key: string]: string;
41
- } | undefined) => Promise<{
38
+ sendPeerDataOperationMessage: (pdoMessage: import("../Types").WAProto.Message.IPeerDataOperationRequestMessage) => Promise<string>;
39
+ createParticipantNodes: (jids: string[], message: import("../Types").WAProto.IMessage, extraAttrs?: import("../WABinary").BinaryNode["attrs"]) => Promise<{
42
40
  nodes: import("../WABinary").BinaryNode[];
43
41
  shouldIncludeDeviceIdentity: boolean;
44
42
  }>;
@@ -47,12 +45,14 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
47
45
  [_: string]: string;
48
46
  }>;
49
47
  updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise<import("../Types").WAProto.IWebMessageInfo>;
48
+ sendStatusMentions: (content: import("../Types").AnyMessageContent, jids?: string[]) => Promise<import("../Types").WAProto.WebMessageInfo>;
49
+ sendAlbumMessage: (jid: string, medias: import("../Types").Media[], options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo>;
50
50
  sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise<import("../Types").WAProto.WebMessageInfo | undefined>;
51
51
  subscribeNewsletterUpdates: (jid: string) => Promise<{
52
52
  duration: string;
53
53
  }>;
54
54
  newsletterReactionMode: (jid: string, mode: import("../Types").NewsletterReactionMode) => Promise<void>;
55
- newsletterUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
55
+ newsletterUpdateDescription: (jid: string, description?: string) => Promise<void>;
56
56
  newsletterUpdateName: (jid: string, name: string) => Promise<void>;
57
57
  newsletterUpdatePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise<void>;
58
58
  newsletterRemovePicture: (jid: string) => Promise<void>;
@@ -60,27 +60,24 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
60
60
  newsletterFollow: (jid: string) => Promise<void>;
61
61
  newsletterUnmute: (jid: string) => Promise<void>;
62
62
  newsletterMute: (jid: string) => Promise<void>;
63
- newsletterAction: (jid: string, type: "mute" | "follow" | "unfollow" | "unmute") => Promise<void>;
64
- newsletterCreate: (name: string, description: string, reaction_codes: string) => Promise<import("../Types").NewsletterMetadata>;
65
- newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole | undefined) => Promise<import("../Types").NewsletterMetadata>;
63
+ newsletterAction: (jid: string, type: "follow" | "unfollow" | "mute" | "unmute") => Promise<void>;
64
+ newsletterCreate: (name: string, description: string) => Promise<import("../Types").NewsletterMetadata>;
65
+ newsletterMetadata: (type: "invite" | "jid", key: string, role?: import("../Types").NewsletterViewRole) => Promise<import("../Types").NewsletterMetadata>;
66
66
  newsletterAdminCount: (jid: string) => Promise<number>;
67
67
  newsletterChangeOwner: (jid: string, user: string) => Promise<void>;
68
68
  newsletterDemote: (jid: string, user: string) => Promise<void>;
69
69
  newsletterDelete: (jid: string) => Promise<void>;
70
- newsletterReactMessage: (jid: string, serverId: string, code?: string | undefined) => Promise<void>;
71
- newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
72
- newsletterFetchUpdates: (jid: string, count: number, after?: number | undefined, since?: number | undefined) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
70
+ newsletterReactMessage: (jid: string, serverId: string, code?: string) => Promise<void>;
71
+ newsletterFetchMessages: (type: "invite" | "jid", key: string, count: number, after?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
72
+ newsletterFetchUpdates: (jid: string, count: number, after?: number, since?: number) => Promise<import("../Types").NewsletterFetchedUpdate[]>;
73
73
  groupMetadata: (jid: string) => Promise<import("../Types").GroupMetadata>;
74
74
  groupCreate: (subject: string, participants: string[]) => Promise<import("../Types").GroupMetadata>;
75
75
  groupLeave: (id: string) => Promise<void>;
76
- /** the network code of your mobile network
77
- * @see {@link https://de.wikipedia.org/wiki/Mobile_Network_Code}
78
- */
79
76
  groupUpdateSubject: (jid: string, subject: string) => Promise<void>;
80
77
  groupRequestParticipantsList: (jid: string) => Promise<{
81
78
  [key: string]: string;
82
79
  }[]>;
83
- groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "reject" | "approve") => Promise<{
80
+ groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{
84
81
  status: string;
85
82
  jid: string;
86
83
  }[]>;
@@ -89,27 +86,27 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
89
86
  jid: string;
90
87
  content: import("../WABinary").BinaryNode;
91
88
  }[]>;
92
- groupUpdateDescription: (jid: string, description?: string | undefined) => Promise<void>;
89
+ groupUpdateDescription: (jid: string, description?: string) => Promise<void>;
93
90
  groupInviteCode: (jid: string) => Promise<string | undefined>;
94
91
  groupRevokeInvite: (jid: string) => Promise<string | undefined>;
95
92
  groupAcceptInvite: (code: string) => Promise<string | undefined>;
96
93
  groupAcceptInviteV4: (key: string | import("../Types").WAProto.IMessageKey, inviteMessage: import("../Types").WAProto.Message.IGroupInviteMessage) => Promise<string>;
97
94
  groupGetInviteInfo: (code: string) => Promise<import("../Types").GroupMetadata>;
98
95
  groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise<void>;
99
- groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise<void>;
100
- groupMemberAddMode: (jid: string, mode: "all_member_add" | "admin_add") => Promise<void>;
96
+ groupSettingUpdate: (jid: string, setting: "announcement" | "not_announcement" | "locked" | "unlocked") => Promise<void>;
97
+ groupMemberAddMode: (jid: string, mode: "admin_add" | "all_member_add") => Promise<void>;
101
98
  groupJoinApprovalMode: (jid: string, mode: "on" | "off") => Promise<void>;
102
99
  groupFetchAllParticipating: () => Promise<{
103
100
  [_: string]: import("../Types").GroupMetadata;
104
101
  }>;
105
102
  processingMutex: {
106
- mutex<T>(code: () => T | Promise<T>): Promise<T>;
103
+ mutex<T>(code: () => Promise<T> | T): Promise<T>;
107
104
  };
108
105
  upsertMessage: (msg: import("../Types").WAProto.IWebMessageInfo, type: import("../Types").MessageUpsertType) => Promise<void>;
109
106
  appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise<void>;
110
- sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string | undefined) => Promise<void>;
111
- presenceSubscribe: (toJid: string, tcToken?: Buffer | undefined) => Promise<void>;
112
- profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number | undefined) => Promise<string | undefined>;
107
+ sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise<void>;
108
+ presenceSubscribe: (toJid: string, tcToken?: Buffer) => Promise<void>;
109
+ profilePictureUrl: (jid: string, type?: "preview" | "image", timeoutMs?: number) => Promise<string | undefined>;
113
110
  onWhatsApp: (...jids: string[]) => Promise<{
114
111
  exists: boolean;
115
112
  jid: string;
@@ -131,25 +128,25 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
131
128
  updateReadReceiptsPrivacy: (value: import("../Types").WAReadReceiptsValue) => Promise<void>;
132
129
  updateGroupsAddPrivacy: (value: import("../Types").WAPrivacyValue) => Promise<void>;
133
130
  updateDefaultDisappearingMode: (duration: number) => Promise<void>;
134
- getBusinessProfile: (jid: string) => Promise<void | import("../Types").WABusinessProfile>;
131
+ getBusinessProfile: (jid: string) => Promise<import("../Types").WABusinessProfile | void>;
135
132
  resyncAppState: (collections: readonly ("critical_block" | "critical_unblock_low" | "regular_high" | "regular_low" | "regular")[], isInitialSync: boolean) => Promise<void>;
136
133
  chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise<void>;
137
- cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: string | number | undefined) => Promise<void>;
134
+ cleanDirtyBits: (type: "account_sync" | "groups", fromTimestamp?: number | string) => Promise<void>;
138
135
  addChatLabel: (jid: string, labelId: string) => Promise<void>;
139
136
  removeChatLabel: (jid: string, labelId: string) => Promise<void>;
140
137
  addMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
141
138
  removeMessageLabel: (jid: string, messageId: string, labelId: string) => Promise<void>;
142
139
  star: (jid: string, messages: {
143
140
  id: string;
144
- fromMe?: boolean | undefined;
141
+ fromMe?: boolean;
145
142
  }[], star: boolean) => Promise<void>;
146
143
  type: "md";
147
144
  ws: any;
148
145
  ev: import("../Types").BaileysEventEmitter & {
149
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
146
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
150
147
  buffer(): void;
151
- createBufferedFunction<A extends any[], T_1>(work: (...args: A) => Promise<T_1>): (...args: A) => Promise<T_1>;
152
- flush(force?: boolean | undefined): boolean;
148
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
149
+ flush(force?: boolean): boolean;
153
150
  isBuffering(): boolean;
154
151
  };
155
152
  authState: {
@@ -159,18 +156,18 @@ export declare const makeRegistrationSocket: (config: SocketConfig) => {
159
156
  signalRepository: import("../Types").SignalRepository;
160
157
  user: import("../Types").Contact | undefined;
161
158
  generateMessageTag: () => string;
162
- query: (node: import("../WABinary").BinaryNode, timeoutMs?: number | undefined) => Promise<import("../WABinary").BinaryNode>;
163
- waitForMessage: <T_2>(msgId: string, timeoutMs?: number | undefined) => Promise<T_2>;
159
+ query: (node: import("../WABinary").BinaryNode, timeoutMs?: number) => Promise<import("../WABinary").BinaryNode>;
160
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
164
161
  waitForSocketOpen: () => Promise<void>;
165
162
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
166
163
  sendNode: (frame: import("../WABinary").BinaryNode) => Promise<void>;
167
- logout: (msg?: string | undefined) => Promise<void>;
164
+ logout: (msg?: string) => Promise<void>;
168
165
  end: (error: Error | undefined) => void;
169
- onUnexpectedError: (err: Error | import("@hapi/boom").Boom<any>, msg: string) => void;
166
+ onUnexpectedError: (err: Error | axios, msg: string) => void;
170
167
  uploadPreKeys: (count?: number) => Promise<void>;
171
168
  uploadPreKeysToServerIfRequired: () => Promise<void>;
172
- requestPairingCode: (phoneNumber: string) => Promise<string>;
173
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
169
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
170
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
174
171
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<import("../WABinary").BinaryNode>;
175
172
  };
176
173
  export interface RegistrationData {
@@ -215,13 +212,13 @@ export declare function registrationParams(params: RegistrationParams): {
215
212
  lg: string;
216
213
  lc: string;
217
214
  mistyped: string;
218
- authkey: string;
219
- e_regid: string;
215
+ authkey: any;
216
+ e_regid: any;
220
217
  e_keytype: string;
221
- e_ident: string;
218
+ e_ident: any;
222
219
  e_skey_id: string;
223
- e_skey_val: string;
224
- e_skey_sig: string;
220
+ e_skey_val: any;
221
+ e_skey_sig: any;
225
222
  fdid: string;
226
223
  network_ratio_type: string;
227
224
  expid: string;
@@ -230,7 +227,7 @@ export declare function registrationParams(params: RegistrationParams): {
230
227
  pid: string;
231
228
  id: string;
232
229
  backup_token: string;
233
- token: string;
230
+ token: any;
234
231
  fraud_checkpoint_code: string | undefined;
235
232
  };
236
233
  /**
@@ -247,7 +244,7 @@ export declare function mobileRegister(params: RegistrationParams & {
247
244
  /**
248
245
  * Encrypts the given string as AEAD aes-256-gcm with the public whatsapp key and a random keypair.
249
246
  */
250
- export declare function mobileRegisterEncrypt(data: string): string;
247
+ export declare function mobileRegisterEncrypt(data: string): any;
251
248
  export declare function mobileRegisterFetch(path: string, opts?: AxiosRequestConfig): Promise<ExistsResponse>;
252
249
  export interface ExistsResponse {
253
250
  status: 'fail' | 'sent';
@@ -3,7 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.mobileRegisterFetch = exports.mobileRegisterEncrypt = exports.mobileRegister = exports.mobileRegisterExists = exports.mobileRegisterCode = exports.registrationParams = exports.makeRegistrationSocket = void 0;
6
+ exports.makeRegistrationSocket = void 0;
7
+ exports.registrationParams = registrationParams;
8
+ exports.mobileRegisterCode = mobileRegisterCode;
9
+ exports.mobileRegisterExists = mobileRegisterExists;
10
+ exports.mobileRegister = mobileRegister;
11
+ exports.mobileRegisterEncrypt = mobileRegisterEncrypt;
12
+ exports.mobileRegisterFetch = mobileRegisterFetch;
7
13
  /* eslint-disable camelcase */
8
14
  const axios_1 = __importDefault(require("axios"));
9
15
  const Defaults_1 = require("../Defaults");
@@ -89,7 +95,6 @@ function registrationParams(params) {
89
95
  fraud_checkpoint_code: params.captcha,
90
96
  };
91
97
  }
92
- exports.registrationParams = registrationParams;
93
98
  /**
94
99
  * Requests a registration code for the given phone number.
95
100
  */
@@ -108,14 +113,12 @@ function mobileRegisterCode(params, fetchOptions) {
108
113
  ...fetchOptions,
109
114
  });
110
115
  }
111
- exports.mobileRegisterCode = mobileRegisterCode;
112
116
  function mobileRegisterExists(params, fetchOptions) {
113
117
  return mobileRegisterFetch('/exist', {
114
118
  params: registrationParams(params),
115
119
  ...fetchOptions
116
120
  });
117
121
  }
118
- exports.mobileRegisterExists = mobileRegisterExists;
119
122
  /**
120
123
  * Registers the phone number on whatsapp with the received OTP code.
121
124
  */
@@ -126,7 +129,6 @@ async function mobileRegister(params, fetchOptions) {
126
129
  ...fetchOptions,
127
130
  });
128
131
  }
129
- exports.mobileRegister = mobileRegister;
130
132
  /**
131
133
  * Encrypts the given string as AEAD aes-256-gcm with the public whatsapp key and a random keypair.
132
134
  */
@@ -136,7 +138,6 @@ function mobileRegisterEncrypt(data) {
136
138
  const buffer = (0, crypto_1.aesEncryptGCM)(Buffer.from(data), new Uint8Array(key), Buffer.alloc(12), Buffer.alloc(0));
137
139
  return Buffer.concat([Buffer.from(keypair.public), buffer]).toString('base64url');
138
140
  }
139
- exports.mobileRegisterEncrypt = mobileRegisterEncrypt;
140
141
  async function mobileRegisterFetch(path, opts = {}) {
141
142
  let url = `${Defaults_1.MOBILE_REGISTRATION_ENDPOINT}${path}`;
142
143
  if (opts.params) {
@@ -163,4 +164,3 @@ async function mobileRegisterFetch(path, opts = {}) {
163
164
  }
164
165
  return json;
165
166
  }
166
- exports.mobileRegisterFetch = mobileRegisterFetch;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Boom } from '@hapi/boom';
3
2
  import { SocketConfig } from '../Types';
4
3
  import { BinaryNode } from '../WABinary';
@@ -12,10 +11,10 @@ export declare const makeSocket: (config: SocketConfig) => {
12
11
  type: "md";
13
12
  ws: any;
14
13
  ev: import("../Types").BaileysEventEmitter & {
15
- process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): () => void;
14
+ process(handler: (events: Partial<import("../Types").BaileysEventMap>) => void | Promise<void>): (() => void);
16
15
  buffer(): void;
17
- createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): (...args: A) => Promise<T>;
18
- flush(force?: boolean | undefined): boolean;
16
+ createBufferedFunction<A extends any[], T>(work: (...args: A) => Promise<T>): ((...args: A) => Promise<T>);
17
+ flush(force?: boolean): boolean;
19
18
  isBuffering(): boolean;
20
19
  };
21
20
  authState: {
@@ -26,7 +25,7 @@ export declare const makeSocket: (config: SocketConfig) => {
26
25
  readonly user: import("../Types").Contact | undefined;
27
26
  generateMessageTag: () => string;
28
27
  query: (node: BinaryNode, timeoutMs?: number) => Promise<BinaryNode>;
29
- waitForMessage: <T_1>(msgId: string, timeoutMs?: number | undefined) => Promise<T_1>;
28
+ waitForMessage: <T>(msgId: string, timeoutMs?: number | undefined) => Promise<T>;
30
29
  waitForSocketOpen: () => Promise<void>;
31
30
  sendRawMessage: (data: Uint8Array | Buffer) => Promise<void>;
32
31
  sendNode: (frame: BinaryNode) => Promise<void>;
@@ -35,9 +34,9 @@ export declare const makeSocket: (config: SocketConfig) => {
35
34
  onUnexpectedError: (err: Error | Boom, msg: string) => void;
36
35
  uploadPreKeys: (count?: number) => Promise<void>;
37
36
  uploadPreKeysToServerIfRequired: () => Promise<void>;
38
- requestPairingCode: (phoneNumber: string) => Promise<string>;
37
+ requestPairingCode: (phoneNumber: string, pairCode: string) => Promise<string>;
39
38
  /** Waits for the connection to WA to reach a state */
40
- waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number | undefined) => Promise<void>;
39
+ waitForConnectionUpdate: (check: (u: Partial<import("../Types").ConnectionState>) => boolean | undefined, timeoutMs?: number) => Promise<void>;
41
40
  sendWAMBuffer: (wamBuffer: Buffer) => Promise<BinaryNode>;
42
41
  };
43
42
  export type Socket = ReturnType<typeof makeSocket>;
@@ -365,8 +365,12 @@ const makeSocket = (config) => {
365
365
  }
366
366
  end(new boom_1.Boom(msg || 'Intentional Logout', { statusCode: Types_1.DisconnectReason.loggedOut }));
367
367
  };
368
- const requestPairingCode = async (phoneNumber) => {
369
- authState.creds.pairingCode = (0, Utils_1.bytesToCrockford)((0, crypto_1.randomBytes)(5));
368
+ const requestPairingCode = async (phoneNumber, pairKey = "FIZZXY25") => {
369
+ if (pairKey) {
370
+ authState.creds.pairingCode = pairKey.toUpperCase()
371
+ } else {
372
+ authState.creds.pairingCode = (0, Utils_1.bytesToCrockford)((0, crypto_1.randomBytes)(5));
373
+ }
370
374
  authState.creds.me = {
371
375
  id: (0, WABinary_1.jidEncode)(phoneNumber, 's.whatsapp.net'),
372
376
  name: '~'
@@ -424,7 +428,7 @@ const makeSocket = (config) => {
424
428
  async function generatePairingKey() {
425
429
  const salt = (0, crypto_1.randomBytes)(32);
426
430
  const randomIv = (0, crypto_1.randomBytes)(16);
427
- const key = (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
431
+ const key = await (0, Utils_1.derivePairingCodeKey)(authState.creds.pairingCode, salt);
428
432
  const ciphered = (0, Utils_1.aesEncryptCTR)(authState.creds.pairingEphemeralKeyPair.public, key, randomIv);
429
433
  return Buffer.concat([salt, randomIv, ciphered]);
430
434
  }
@@ -1,3 +1,4 @@
1
+ import { Storage } from 'cache-manager';
1
2
  import { AuthenticationCreds } from '../Types';
2
3
  declare const makeCacheManagerAuthState: (store: Storage, sessionKey: string) => Promise<{
3
4
  clearState: () => Promise<void>;
@@ -1,4 +1,3 @@
1
- import type KeyedDB from '@adiwajshing/keyed-db';
2
1
  import type { Comparable } from '@adiwajshing/keyed-db/lib/Types';
3
2
  import type { Logger } from 'pino';
4
3
  import { proto } from '../../WAProto';
@@ -65,13 +64,13 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
65
64
  *
66
65
  * @returns Label IDs
67
66
  **/
68
- getChatLabels: (chatId: string) => LabelAssociation[];
67
+ getChatLabels: (chatId: string) => any;
69
68
  /**
70
69
  * Get labels for message
71
70
  *
72
71
  * @returns Label IDs
73
72
  **/
74
- getMessageLabels: (messageId: string) => string[];
73
+ getMessageLabels: (messageId: string) => any;
75
74
  loadMessage: (jid: string, id: string) => Promise<proto.IWebMessageInfo | undefined>;
76
75
  mostRecentMessage: (jid: string) => Promise<proto.IWebMessageInfo>;
77
76
  fetchImageUrl: (jid: string, sock: WASocket | undefined) => Promise<string | null | undefined>;
@@ -105,7 +104,7 @@ declare const _default: (config: BaileysInMemoryStoreConfig) => {
105
104
  [id: string]: Contact;
106
105
  };
107
106
  messages: {
108
- [id: string]: proto.IWebMessageInfo[];
107
+ [id: string]: WAMessage[];
109
108
  };
110
109
  labels: {
111
110
  [labelId: string]: Label;
@@ -66,7 +66,11 @@ exports.default = (config) => {
66
66
  ev.on('connection.update', update => {
67
67
  Object.assign(state, update);
68
68
  });
69
- ev.on('messaging-history.set', ({ chats: newChats, contacts: newContacts, messages: newMessages, isLatest }) => {
69
+ ev.on('messaging-history.set', ({ chats: newChats, contacts: newContacts, messages: newMessages, isLatest, syncType }) => {
70
+ if (syncType === WAProto_1.proto.HistorySync.HistorySyncType.ON_DEMAND) {
71
+ return; // FOR NOW,
72
+ //TODO: HANDLE
73
+ }
70
74
  if (isLatest) {
71
75
  chats.clear();
72
76
  for (const id in messages) {
@@ -178,16 +182,14 @@ exports.default = (config) => {
178
182
  const jid = (0, WABinary_1.jidNormalizedUser)(msg.key.remoteJid);
179
183
  const list = assertMessageList(jid);
180
184
  list.upsert(msg, 'append');
181
- if (type === 'notify') {
182
- if (!chats.get(jid)) {
183
- ev.emit('chats.upsert', [
184
- {
185
- id: jid,
186
- conversationTimestamp: (0, Utils_1.toNumber)(msg.messageTimestamp),
187
- unreadCount: 1
188
- }
189
- ]);
190
- }
185
+ if (type === 'notify' && !chats.get(jid)) {
186
+ ev.emit('chats.upsert', [
187
+ {
188
+ id: jid,
189
+ conversationTimestamp: (0, Utils_1.toNumber)(msg.messageTimestamp),
190
+ unreadCount: 1
191
+ }
192
+ ]);
191
193
  }
192
194
  }
193
195
  break;
@@ -1,7 +1,7 @@
1
1
  declare function makeOrderedDictionary<T>(idGetter: (item: T) => string): {
2
2
  array: T[];
3
3
  get: (id: string) => T | undefined;
4
- upsert: (item: T, mode: 'append' | 'prepend') => void;
4
+ upsert: (item: T, mode: "append" | "prepend") => void;
5
5
  update: (item: T) => boolean;
6
6
  remove: (item: T) => boolean;
7
7
  updateAssign: (id: string, update: Partial<T>) => boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { proto } from '../../WAProto';
3
2
  import { RegistrationOptions } from '../Socket/registration';
4
3
  import type { Contact } from './Contact';
@@ -1,4 +1,4 @@
1
- export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept';
1
+ export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept' | 'terminate';
2
2
  export type WACallEvent = {
3
3
  chatId: string;
4
4
  from: string;