@awangxcode/qiro-baileys 7.0.0-rc26.2 → 7.0.0-rc26.3

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 (151) hide show
  1. package/lib/Defaults/index.d.ts +1 -1
  2. package/lib/Defaults/index.js +3 -3
  3. package/lib/Extensions/advanced.d.ts +1 -1
  4. package/lib/Extensions/experimental.d.ts +1 -1
  5. package/lib/MessageBuilder/index.d.ts +5 -5
  6. package/lib/MessageBuilder/index.js +2 -2
  7. package/lib/Signal/Group/group-session-builder.d.ts +3 -3
  8. package/lib/Signal/Group/group-session-builder.js +4 -4
  9. package/lib/Signal/Group/group_cipher.d.ts +2 -2
  10. package/lib/Signal/Group/group_cipher.js +4 -4
  11. package/lib/Signal/Group/index.d.ts +11 -11
  12. package/lib/Signal/Group/index.js +11 -11
  13. package/lib/Signal/Group/sender-chain-key.d.ts +1 -1
  14. package/lib/Signal/Group/sender-chain-key.js +1 -1
  15. package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -1
  16. package/lib/Signal/Group/sender-key-distribution-message.js +1 -1
  17. package/lib/Signal/Group/sender-key-message.d.ts +1 -1
  18. package/lib/Signal/Group/sender-key-message.js +1 -1
  19. package/lib/Signal/Group/sender-key-record.d.ts +1 -1
  20. package/lib/Signal/Group/sender-key-record.js +2 -2
  21. package/lib/Signal/Group/sender-key-state.d.ts +2 -2
  22. package/lib/Signal/Group/sender-key-state.js +2 -2
  23. package/lib/Signal/libsignal.d.ts +3 -3
  24. package/lib/Signal/libsignal.js +6 -6
  25. package/lib/Signal/lid-mapping.d.ts +2 -2
  26. package/lib/Signal/lid-mapping.js +1 -1
  27. package/lib/Socket/Client/index.d.ts +2 -2
  28. package/lib/Socket/Client/index.js +2 -2
  29. package/lib/Socket/Client/types.d.ts +1 -1
  30. package/lib/Socket/Client/websocket.d.ts +1 -1
  31. package/lib/Socket/Client/websocket.js +2 -2
  32. package/lib/Socket/business.d.ts +77 -77
  33. package/lib/Socket/business.js +5 -5
  34. package/lib/Socket/chats.d.ts +16 -16
  35. package/lib/Socket/chats.js +9 -9
  36. package/lib/Socket/communities.d.ts +56 -56
  37. package/lib/Socket/communities.js +5 -5
  38. package/lib/Socket/groups.d.ts +28 -28
  39. package/lib/Socket/groups.js +4 -4
  40. package/lib/Socket/index.d.ts +97 -97
  41. package/lib/Socket/index.js +4 -4
  42. package/lib/Socket/messages-recv.d.ts +42 -42
  43. package/lib/Socket/messages-recv.js +10 -10
  44. package/lib/Socket/messages-send.d.ts +45 -45
  45. package/lib/Socket/messages-send.js +9 -9
  46. package/lib/Socket/mex.d.ts +1 -1
  47. package/lib/Socket/mex.js +1 -1
  48. package/lib/Socket/newsletter.d.ts +34 -34
  49. package/lib/Socket/newsletter.js +5 -5
  50. package/lib/Socket/socket.d.ts +11 -11
  51. package/lib/Socket/socket.js +7 -7
  52. package/lib/Types/Auth.d.ts +2 -2
  53. package/lib/Types/Chat.d.ts +6 -6
  54. package/lib/Types/Events.d.ts +9 -9
  55. package/lib/Types/GroupMetadata.d.ts +2 -2
  56. package/lib/Types/Message.d.ts +5 -5
  57. package/lib/Types/Product.d.ts +1 -1
  58. package/lib/Types/Signal.d.ts +1 -1
  59. package/lib/Types/Socket.d.ts +5 -5
  60. package/lib/Types/Socket.js +1 -1
  61. package/lib/Types/State.d.ts +1 -1
  62. package/lib/Types/USync.d.ts +2 -2
  63. package/lib/Types/USync.js +1 -1
  64. package/lib/Types/index.d.ts +14 -14
  65. package/lib/Types/index.js +12 -12
  66. package/lib/Utils/auth-utils.d.ts +2 -2
  67. package/lib/Utils/auth-utils.js +4 -4
  68. package/lib/Utils/browser-utils.d.ts +1 -1
  69. package/lib/Utils/business.d.ts +2 -2
  70. package/lib/Utils/business.js +3 -3
  71. package/lib/Utils/chat-utils.d.ts +3 -3
  72. package/lib/Utils/chat-utils.js +7 -7
  73. package/lib/Utils/companion-reg-client-utils.d.ts +3 -3
  74. package/lib/Utils/companion-reg-client-utils.js +1 -1
  75. package/lib/Utils/crypto.d.ts +1 -1
  76. package/lib/Utils/crypto.js +1 -1
  77. package/lib/Utils/decode-wa-message.d.ts +4 -4
  78. package/lib/Utils/decode-wa-message.js +2 -2
  79. package/lib/Utils/event-buffer.d.ts +2 -2
  80. package/lib/Utils/event-buffer.js +4 -4
  81. package/lib/Utils/generics.d.ts +2 -2
  82. package/lib/Utils/generics.js +3 -3
  83. package/lib/Utils/history.d.ts +1 -1
  84. package/lib/Utils/history.js +5 -5
  85. package/lib/Utils/identity-change-handler.d.ts +2 -2
  86. package/lib/Utils/identity-change-handler.js +2 -2
  87. package/lib/Utils/index.d.ts +21 -21
  88. package/lib/Utils/index.js +21 -21
  89. package/lib/Utils/link-preview.d.ts +2 -2
  90. package/lib/Utils/link-preview.js +2 -2
  91. package/lib/Utils/message-retry-manager.d.ts +1 -1
  92. package/lib/Utils/messages-media.d.ts +4 -4
  93. package/lib/Utils/messages-media.js +4 -4
  94. package/lib/Utils/messages.d.ts +4 -4
  95. package/lib/Utils/messages.js +7 -7
  96. package/lib/Utils/noise-handler.d.ts +3 -3
  97. package/lib/Utils/noise-handler.js +3 -3
  98. package/lib/Utils/offline-node-processor.d.ts +1 -1
  99. package/lib/Utils/pre-key-manager.d.ts +2 -2
  100. package/lib/Utils/process-message.d.ts +2 -2
  101. package/lib/Utils/process-message.js +7 -7
  102. package/lib/Utils/reporting-utils.d.ts +2 -2
  103. package/lib/Utils/reporting-utils.js +1 -1
  104. package/lib/Utils/signal.d.ts +4 -4
  105. package/lib/Utils/signal.js +4 -4
  106. package/lib/Utils/stanza-ack.d.ts +1 -1
  107. package/lib/Utils/sync-action-utils.d.ts +2 -2
  108. package/lib/Utils/sync-action-utils.js +1 -1
  109. package/lib/Utils/tc-token-utils.d.ts +2 -2
  110. package/lib/Utils/tc-token-utils.js +1 -1
  111. package/lib/Utils/use-multi-file-auth-state.d.ts +1 -1
  112. package/lib/Utils/use-multi-file-auth-state.js +2 -2
  113. package/lib/Utils/validate-connection.d.ts +2 -2
  114. package/lib/Utils/validate-connection.js +5 -5
  115. package/lib/WABinary/decode.d.ts +1 -1
  116. package/lib/WABinary/decode.js +2 -2
  117. package/lib/WABinary/encode.d.ts +1 -1
  118. package/lib/WABinary/encode.js +2 -2
  119. package/lib/WABinary/generic-utils.d.ts +1 -1
  120. package/lib/WABinary/generic-utils.js +1 -1
  121. package/lib/WABinary/index.d.ts +5 -5
  122. package/lib/WABinary/index.js +5 -5
  123. package/lib/WABinary/types.d.ts +1 -1
  124. package/lib/WABinary/types.js +1 -1
  125. package/lib/WAM/BinaryInfo.d.ts +1 -1
  126. package/lib/WAM/encode.d.ts +1 -1
  127. package/lib/WAM/encode.js +2 -2
  128. package/lib/WAM/index.d.ts +3 -3
  129. package/lib/WAM/index.js +3 -3
  130. package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +3 -3
  131. package/lib/WAUSync/Protocols/USyncContactProtocol.js +2 -2
  132. package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +2 -2
  133. package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -1
  134. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +2 -2
  135. package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -1
  136. package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +2 -2
  137. package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -1
  138. package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +3 -3
  139. package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +2 -2
  140. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +3 -3
  141. package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +2 -2
  142. package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +3 -3
  143. package/lib/WAUSync/Protocols/index.d.ts +5 -5
  144. package/lib/WAUSync/Protocols/index.js +5 -5
  145. package/lib/WAUSync/USyncQuery.d.ts +3 -3
  146. package/lib/WAUSync/USyncQuery.js +5 -5
  147. package/lib/WAUSync/index.d.ts +3 -3
  148. package/lib/WAUSync/index.js +3 -3
  149. package/lib/index.d.ts +10 -10
  150. package/lib/index.js +11 -11
  151. package/package.json +2 -2
@@ -2,8 +2,8 @@ import { Boom } from '@hapi/boom';
2
2
  import { proto } from '../../WAProto/index.js';
3
3
  import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidGroup, isJidMetaAI, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser
4
4
  // transferDevice
5
- } from '../WABinary';
6
- import { unpadRandomMax16 } from './generics';
5
+ } from '../WABinary/index.js';
6
+ import { unpadRandomMax16 } from './generics.js';
7
7
  export const getDecryptionJid = async (sender, repository) => {
8
8
  if (isLidUser(sender) || isHostedLidUser(sender)) {
9
9
  return sender;
@@ -1,5 +1,5 @@
1
- import type { BaileysEventEmitter, BaileysEventMap } from '../Types';
2
- import type { ILogger } from './logger';
1
+ import type { BaileysEventEmitter, BaileysEventMap } from '../Types/index.js';
2
+ import type { ILogger } from './logger.js';
3
3
  /**
4
4
  * A map that contains a list of all events that have been triggered
5
5
  *
@@ -1,8 +1,8 @@
1
1
  import EventEmitter from 'events';
2
- import { WAMessageStatus } from '../Types';
3
- import { trimUndefined } from './generics';
4
- import { updateMessageWithReaction, updateMessageWithReceipt } from './messages';
5
- import { isRealMessage, shouldIncrementChatUnread } from './process-message';
2
+ import { WAMessageStatus } from '../Types/index.js';
3
+ import { trimUndefined } from './generics.js';
4
+ import { updateMessageWithReaction, updateMessageWithReceipt } from './messages.js';
5
+ import { isRealMessage, shouldIncrementChatUnread } from './process-message.js';
6
6
  const BUFFERABLE_EVENT = [
7
7
  'messaging-history.set',
8
8
  'chats.upsert',
@@ -1,7 +1,7 @@
1
1
  import type Long from 'long';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types';
4
- import { type BinaryNode } from '../WABinary';
3
+ import type { BaileysEventEmitter, BaileysEventMap, ConnectionState, WACallUpdateType, WAMessageKey, WAVersion } from '../Types/index.js';
4
+ import { type BinaryNode } from '../WABinary/index.js';
5
5
  export declare const BufferJSON: {
6
6
  replacer: (k: any, value: any) => any;
7
7
  reviver: (_: any, value: any) => any;
@@ -2,9 +2,9 @@ import { Boom } from '@hapi/boom';
2
2
  import { createHash, randomBytes } from 'crypto';
3
3
  import { proto } from '../../WAProto/index.js';
4
4
  const baileysVersion = [2, 3000, 1043857760];
5
- import { DisconnectReason } from '../Types';
6
- import { getAllBinaryNodeChildren, jidDecode } from '../WABinary';
7
- import { sha256 } from './crypto';
5
+ import { DisconnectReason } from '../Types/index.js';
6
+ import { getAllBinaryNodeChildren, jidDecode } from '../WABinary/index.js';
7
+ import { sha256 } from './crypto.js';
8
8
  export const BufferJSON = {
9
9
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
10
  replacer: (k, value) => {
@@ -1,5 +1,5 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { Chat, Contact, LIDMapping, WAMessage } from '../Types';
2
+ import type { Chat, Contact, LIDMapping, WAMessage } from '../Types/index.js';
3
3
  import type { ILogger } from './logger.js';
4
4
  export declare const downloadHistory: (msg: proto.Message.IHistorySyncNotification, options: RequestInit) => Promise<proto.HistorySync>;
5
5
  export declare const processHistoryMessage: (item: proto.IHistorySync, logger?: ILogger) => {
@@ -2,11 +2,11 @@ import { pipeline } from 'stream/promises';
2
2
  import { promisify } from 'util';
3
3
  import { createInflate, inflate } from 'zlib';
4
4
  import { proto } from '../../WAProto/index.js';
5
- import { WAMessageStubType } from '../Types';
6
- import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary';
7
- import { toNumber } from './generics';
8
- import { normalizeMessageContent } from './messages';
9
- import { downloadContentFromMessage } from './messages-media';
5
+ import { WAMessageStubType } from '../Types/index.js';
6
+ import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from '../WABinary/index.js';
7
+ import { toNumber } from './generics.js';
8
+ import { normalizeMessageContent } from './messages.js';
9
+ import { downloadContentFromMessage } from './messages-media.js';
10
10
  const inflatePromise = promisify(inflate);
11
11
  const extractPnFromMessages = (messages) => {
12
12
  for (const msgItem of messages) {
@@ -1,6 +1,6 @@
1
1
  import NodeCache from '@cacheable/node-cache';
2
- import { type BinaryNode } from '../WABinary';
3
- import type { ILogger } from './logger';
2
+ import { type BinaryNode } from '../WABinary/index.js';
3
+ import type { ILogger } from './logger.js';
4
4
  export type IdentityChangeResult = {
5
5
  action: 'no_identity_node';
6
6
  } | {
@@ -1,6 +1,6 @@
1
1
  import NodeCache from '@cacheable/node-cache';
2
- import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary';
3
- import { isStringNullOrEmpty } from './generics';
2
+ import { areJidsSameUser, getBinaryNodeChild, jidDecode } from '../WABinary/index.js';
3
+ import { isStringNullOrEmpty } from './generics.js';
4
4
  export async function handleIdentityChange(node, ctx) {
5
5
  const from = node.attrs.from;
6
6
  if (!from) {
@@ -1,24 +1,24 @@
1
- export * from './generics';
2
- export * from './decode-wa-message';
3
- export * from './messages';
4
- export * from './messages-media';
5
- export * from './validate-connection';
6
- export * from './crypto';
7
- export * from './signal';
8
- export * from './noise-handler';
9
- export * from './history';
10
- export * from './chat-utils';
11
- export * from './lt-hash';
12
- export * from './auth-utils';
13
- export * from './use-multi-file-auth-state';
14
- export * from './link-preview';
15
- export * from './event-buffer';
16
- export * from './process-message';
17
- export * from './message-retry-manager';
18
- export * from './browser-utils';
19
- export * from './companion-reg-client-utils';
20
- export * from './identity-change-handler';
21
- export * from './stanza-ack';
1
+ export * from './generics.js';
2
+ export * from './decode-wa-message.js';
3
+ export * from './messages.js';
4
+ export * from './messages-media.js';
5
+ export * from './validate-connection.js';
6
+ export * from './crypto.js';
7
+ export * from './signal.js';
8
+ export * from './noise-handler.js';
9
+ export * from './history.js';
10
+ export * from './chat-utils.js';
11
+ export * from './lt-hash.js';
12
+ export * from './auth-utils.js';
13
+ export * from './use-multi-file-auth-state.js';
14
+ export * from './link-preview.js';
15
+ export * from './event-buffer.js';
16
+ export * from './process-message.js';
17
+ export * from './message-retry-manager.js';
18
+ export * from './browser-utils.js';
19
+ export * from './companion-reg-client-utils.js';
20
+ export * from './identity-change-handler.js';
21
+ export * from './stanza-ack.js';
22
22
  export * as audioSticker from './audio-sticker.js';
23
23
  export * as authStore from './auth-store.js';
24
24
  export * as chatTheme from './chat-theme.js';
@@ -1,24 +1,24 @@
1
- export * from './generics';
2
- export * from './decode-wa-message';
3
- export * from './messages';
4
- export * from './messages-media';
5
- export * from './validate-connection';
6
- export * from './crypto';
7
- export * from './signal';
8
- export * from './noise-handler';
9
- export * from './history';
10
- export * from './chat-utils';
11
- export * from './lt-hash';
12
- export * from './auth-utils';
13
- export * from './use-multi-file-auth-state';
14
- export * from './link-preview';
15
- export * from './event-buffer';
16
- export * from './process-message';
17
- export * from './message-retry-manager';
18
- export * from './browser-utils';
19
- export * from './companion-reg-client-utils';
20
- export * from './identity-change-handler';
21
- export * from './stanza-ack';
1
+ export * from './generics.js';
2
+ export * from './decode-wa-message.js';
3
+ export * from './messages.js';
4
+ export * from './messages-media.js';
5
+ export * from './validate-connection.js';
6
+ export * from './crypto.js';
7
+ export * from './signal.js';
8
+ export * from './noise-handler.js';
9
+ export * from './history.js';
10
+ export * from './chat-utils.js';
11
+ export * from './lt-hash.js';
12
+ export * from './auth-utils.js';
13
+ export * from './use-multi-file-auth-state.js';
14
+ export * from './link-preview.js';
15
+ export * from './event-buffer.js';
16
+ export * from './process-message.js';
17
+ export * from './message-retry-manager.js';
18
+ export * from './browser-utils.js';
19
+ export * from './companion-reg-client-utils.js';
20
+ export * from './identity-change-handler.js';
21
+ export * from './stanza-ack.js';
22
22
  // QIRO modern extension utilities are exported as namespaces to avoid
23
23
  // colliding with the pre-existing QIRO Extension and MessageBuilder APIs.
24
24
  export * as audioSticker from './audio-sticker.js';
@@ -1,5 +1,5 @@
1
- import type { WAMediaUploadFunction, WAUrlInfo } from '../Types';
2
- import type { ILogger } from './logger';
1
+ import type { WAMediaUploadFunction, WAUrlInfo } from '../Types/index.js';
2
+ import type { ILogger } from './logger.js';
3
3
  export type URLGenerationOptions = {
4
4
  thumbnailWidth: number;
5
5
  fetchOpts: {
@@ -1,5 +1,5 @@
1
- import { prepareWAMessageMedia } from './messages';
2
- import { extractImageThumb, getHttpStream } from './messages-media';
1
+ import { prepareWAMessageMedia } from './messages.js';
2
+ import { extractImageThumb, getHttpStream } from './messages-media.js';
3
3
  const THUMBNAIL_WIDTH_PX = 192;
4
4
  /** Fetches an image and generates a thumbnail for it */
5
5
  const getCompressedJpegThumbnail = async (url, { thumbnailWidth, fetchOpts }) => {
@@ -1,5 +1,5 @@
1
1
  import type { proto } from '../../WAProto/index.js';
2
- import type { ILogger } from './logger';
2
+ import type { ILogger } from './logger.js';
3
3
  export interface RecentMessageKey {
4
4
  to: string;
5
5
  id: string;
@@ -3,10 +3,10 @@ import type { Agent } from 'https';
3
3
  import { Readable, Transform } from 'stream';
4
4
  import { URL } from 'url';
5
5
  import { proto } from '../../WAProto/index.js';
6
- import { type MediaType } from '../Defaults';
7
- import type { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent, WAMessageKey } from '../Types';
8
- import { type BinaryNode } from '../WABinary';
9
- import type { ILogger } from './logger';
6
+ import { type MediaType } from '../Defaults/index.js';
7
+ import type { DownloadableMessage, MediaConnInfo, MediaDecryptionKeyInfo, SocketConfig, WAMediaUpload, WAMediaUploadFunction, WAMessageContent, WAMessageKey } from '../Types/index.js';
8
+ import { type BinaryNode } from '../WABinary/index.js';
9
+ import type { ILogger } from './logger.js';
10
10
  export declare const getImageProcessingLibrary: () => Promise<{
11
11
  sharp: any;
12
12
  jimp?: undefined;
@@ -8,10 +8,10 @@ import { join } from 'path';
8
8
  import { Readable, Transform } from 'stream';
9
9
  import { URL } from 'url';
10
10
  import { proto } from '../../WAProto/index.js';
11
- import { DEFAULT_ORIGIN, MEDIA_HKDF_KEY_MAPPING, MEDIA_PATH_MAP, NEWSLETTER_MEDIA_PATH_MAP } from '../Defaults';
12
- import { getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary';
13
- import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto';
14
- import { generateMessageIDV2 } from './generics';
11
+ import { DEFAULT_ORIGIN, MEDIA_HKDF_KEY_MAPPING, MEDIA_PATH_MAP, NEWSLETTER_MEDIA_PATH_MAP } from '../Defaults/index.js';
12
+ import { getBinaryNodeChild, getBinaryNodeChildBuffer, jidNormalizedUser } from '../WABinary/index.js';
13
+ import { aesDecryptGCM, aesEncryptGCM, hkdf } from './crypto.js';
14
+ import { generateMessageIDV2 } from './generics.js';
15
15
  const getTmpFilesDirectory = () => tmpdir();
16
16
  export const getImageProcessingLibrary = async () => {
17
17
  const loadOptional = async (name) => {
@@ -1,8 +1,8 @@
1
1
  import { type Transform } from 'stream';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import type { AnyMediaMessageContent, AnyMessageContent, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMediaUpload, WAMessage, WAMessageContent, WAMessageKey } from '../Types';
4
- import type { ILogger } from './logger';
5
- import { type MediaDownloadOptions } from './messages-media';
3
+ import type { AnyMediaMessageContent, AnyMessageContent, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMediaUpload, WAMessage, WAMessageContent, WAMessageKey } from '../Types/index.js';
4
+ import type { ILogger } from './logger.js';
5
+ import { type MediaDownloadOptions } from './messages-media.js';
6
6
  type ExtractByKey<T, K extends PropertyKey> = T extends Record<K, any> ? T : never;
7
7
  type RequireKey<T, K extends keyof T> = T & {
8
8
  [P in K]-?: Exclude<T[P], null | undefined>;
@@ -14,7 +14,7 @@ type WithKey<T, K extends PropertyKey> = T extends unknown ? (K extends keyof T
14
14
  * @returns the URL, eg. https://google.com
15
15
  */
16
16
  export declare const extractUrlFromText: (text: string) => string | undefined;
17
- export declare const generateLinkPreviewIfRequired: (text: string, getUrlInfo: MessageGenerationOptions["getUrlInfo"], logger: MessageGenerationOptions["logger"]) => Promise<import("../Types").WAUrlInfo | undefined>;
17
+ export declare const generateLinkPreviewIfRequired: (text: string, getUrlInfo: MessageGenerationOptions["getUrlInfo"], logger: MessageGenerationOptions["logger"]) => Promise<import("../Types/index.js").WAUrlInfo | undefined>;
18
18
  export declare const prepareWAMessageMedia: (message: AnyMediaMessageContent, options: MessageContentGenerationOptions) => Promise<proto.Message>;
19
19
  export declare const prepareDisappearingMessageSettingContent: (ephemeralExpiration?: number) => proto.Message;
20
20
  /**
@@ -3,13 +3,13 @@ import { createHash, randomBytes } from 'crypto';
3
3
  import { promises as fs } from 'fs';
4
4
  import {} from 'stream';
5
5
  import { proto } from '../../WAProto/index.js';
6
- import { CALL_AUDIO_PREFIX, CALL_VIDEO_PREFIX, MEDIA_KEYS, URL_REGEX, WA_DEFAULT_EPHEMERAL } from '../Defaults';
7
- import { WAMessageStatus, WAProto } from '../Types';
8
- import { isJidGroup, isJidNewsletter, isJidStatusBroadcast, jidNormalizedUser } from '../WABinary';
9
- import { sha256 } from './crypto';
10
- import { generateMessageIDV2, getKeyAuthor, unixTimestampSeconds } from './generics';
11
- import { downloadContentFromMessage, encryptedStream, generateThumbnail, getAudioDuration, getAudioWaveform, getRawMediaUploadData, extractImageThumb, getStream, toBuffer } from './messages-media';
12
- import { shouldIncludeReportingToken } from './reporting-utils';
6
+ import { CALL_AUDIO_PREFIX, CALL_VIDEO_PREFIX, MEDIA_KEYS, URL_REGEX, WA_DEFAULT_EPHEMERAL } from '../Defaults/index.js';
7
+ import { WAMessageStatus, WAProto } from '../Types/index.js';
8
+ import { isJidGroup, isJidNewsletter, isJidStatusBroadcast, jidNormalizedUser } from '../WABinary/index.js';
9
+ import { sha256 } from './crypto.js';
10
+ import { generateMessageIDV2, getKeyAuthor, unixTimestampSeconds } from './generics.js';
11
+ import { downloadContentFromMessage, encryptedStream, generateThumbnail, getAudioDuration, getAudioWaveform, getRawMediaUploadData, extractImageThumb, getStream, toBuffer } from './messages-media.js';
12
+ import { shouldIncludeReportingToken } from './reporting-utils.js';
13
13
  import { buildPaymentReminder, buildSplitPayment } from './payment-messages.js';
14
14
  import { checkNativeFlowButtons } from './native-flow.js';
15
15
  const MIMETYPE_MAP = {
@@ -1,7 +1,7 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { KeyPair } from '../Types';
3
- import type { BinaryNode } from '../WABinary';
4
- import type { ILogger } from './logger';
2
+ import type { KeyPair } from '../Types/index.js';
3
+ import type { BinaryNode } from '../WABinary/index.js';
4
+ import type { ILogger } from './logger.js';
5
5
  export declare const makeNoiseHandler: ({ keyPair: { private: privateKey, public: publicKey }, NOISE_HEADER, logger, routingInfo }: {
6
6
  keyPair: KeyPair;
7
7
  NOISE_HEADER: Uint8Array;
@@ -1,8 +1,8 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults';
4
- import { decodeBinaryNode } from '../WABinary';
5
- import { aesDecryptGCM, aesEncryptGCM, Curve, hkdf, sha256 } from './crypto';
3
+ import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults/index.js';
4
+ import { decodeBinaryNode } from '../WABinary/index.js';
5
+ import { aesDecryptGCM, aesEncryptGCM, Curve, hkdf, sha256 } from './crypto.js';
6
6
  const IV_LENGTH = 12;
7
7
  const EMPTY_BUFFER = Buffer.alloc(0);
8
8
  const generateIV = (counter) => {
@@ -1,4 +1,4 @@
1
- import type { BinaryNode } from '../WABinary';
1
+ import type { BinaryNode } from '../WABinary/index.js';
2
2
  export type MessageType = 'message' | 'call' | 'receipt' | 'notification';
3
3
  export type OfflineNodeProcessorDeps = {
4
4
  isWsOpen: () => boolean;
@@ -1,5 +1,5 @@
1
- import type { SignalDataSet, SignalDataTypeMap, SignalKeyStore } from '../Types';
2
- import type { ILogger } from './logger';
1
+ import type { SignalDataSet, SignalDataTypeMap, SignalKeyStore } from '../Types/index.js';
2
+ import type { ILogger } from './logger.js';
3
3
  /**
4
4
  * Manages pre-key operations with proper concurrency control
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { AuthenticationCreds, BaileysEventEmitter, CacheStore, SignalKeyStoreWithTransaction, SignalRepositoryWithLIDStore, SocketConfig, WAMessage, WAMessageKey } from '../Types';
3
- import type { ILogger } from './logger';
2
+ import type { AuthenticationCreds, BaileysEventEmitter, CacheStore, SignalKeyStoreWithTransaction, SignalRepositoryWithLIDStore, SocketConfig, WAMessage, WAMessageKey } from '../Types/index.js';
3
+ import type { ILogger } from './logger.js';
4
4
  type ProcessMessageContext = {
5
5
  shouldProcessHistoryMsg: boolean;
6
6
  placeholderResendCache?: CacheStore;
@@ -1,12 +1,12 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import { WAMessageStubType } from '../Types';
4
- import { getContentType, normalizeMessageContent } from '../Utils/messages';
5
- import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidStatusBroadcast, isLidUser, jidDecode, jidEncode, jidNormalizedUser } from '../WABinary';
6
- import { aesDecryptGCM, hmacSign } from './crypto';
7
- import { getKeyAuthor, toNumber } from './generics';
8
- import { downloadAndProcessHistorySyncNotification } from './history';
9
- import { buildMergedTcTokenIndexWrite, resolveTcTokenJid } from './tc-token-utils';
3
+ import { WAMessageStubType } from '../Types/index.js';
4
+ import { getContentType, normalizeMessageContent } from '../Utils/messages.js';
5
+ import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidStatusBroadcast, isLidUser, jidDecode, jidEncode, jidNormalizedUser } from '../WABinary/index.js';
6
+ import { aesDecryptGCM, hmacSign } from './crypto.js';
7
+ import { getKeyAuthor, toNumber } from './generics.js';
8
+ import { downloadAndProcessHistorySyncNotification } from './history.js';
9
+ import { buildMergedTcTokenIndexWrite, resolveTcTokenJid } from './tc-token-utils.js';
10
10
  const REAL_MSG_STUB_TYPES = new Set([
11
11
  WAMessageStubType.CALL_MISSED_GROUP_VIDEO,
12
12
  WAMessageStubType.CALL_MISSED_GROUP_VOICE,
@@ -1,6 +1,6 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { WAMessageContent, WAMessageKey } from '../Types';
3
- import type { BinaryNode } from '../WABinary';
2
+ import type { WAMessageContent, WAMessageKey } from '../Types/index.js';
3
+ import type { BinaryNode } from '../WABinary/index.js';
4
4
  export type ReportingField = {
5
5
  f: number;
6
6
  m?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { createHmac } from 'crypto';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import { hkdf } from './crypto';
3
+ import { hkdf } from './crypto.js';
4
4
  const reportingFields = [
5
5
  { f: 1 },
6
6
  {
@@ -1,7 +1,7 @@
1
- import type { SignalRepositoryWithLIDStore } from '../Types';
2
- import type { AuthenticationCreds, AuthenticationState, KeyPair, SignalIdentity, SignalKeyStore, SignedKeyPair } from '../Types/Auth';
3
- import { type BinaryNode, type FullJid } from '../WABinary';
4
- import type { USyncQueryResultList } from '../WAUSync';
1
+ import type { SignalRepositoryWithLIDStore } from '../Types/index.js';
2
+ import type { AuthenticationCreds, AuthenticationState, KeyPair, SignalIdentity, SignalKeyStore, SignedKeyPair } from '../Types/Auth.js';
3
+ import { type BinaryNode, type FullJid } from '../WABinary/index.js';
4
+ import type { USyncQueryResultList } from '../WAUSync/index.js';
5
5
  export declare const createSignalIdentity: (wid: string, accountSignatureKey: Uint8Array) => SignalIdentity;
6
6
  export declare const getPreKeys: ({ get }: SignalKeyStore, min: number, limit: number) => Promise<{
7
7
  [id: string]: KeyPair;
@@ -1,7 +1,7 @@
1
- import { KEY_BUNDLE_TYPE } from '../Defaults';
2
- import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildUInt, getServerFromDomainType, jidDecode, S_WHATSAPP_NET, WAJIDDomains } from '../WABinary';
3
- import { Curve, generateSignalPubKey } from './crypto';
4
- import { encodeBigEndian } from './generics';
1
+ import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
2
+ import { assertNodeErrorFree, getBinaryNodeChild, getBinaryNodeChildBuffer, getBinaryNodeChildren, getBinaryNodeChildUInt, getServerFromDomainType, jidDecode, S_WHATSAPP_NET, WAJIDDomains } from '../WABinary/index.js';
3
+ import { Curve, generateSignalPubKey } from './crypto.js';
4
+ import { encodeBigEndian } from './generics.js';
5
5
  function chunk(array, size) {
6
6
  const chunks = [];
7
7
  for (let i = 0; i < array.length; i += size) {
@@ -1,4 +1,4 @@
1
- import type { BinaryNode } from '../WABinary';
1
+ import type { BinaryNode } from '../WABinary/index.js';
2
2
  /**
3
3
  * Builds an ACK stanza for a received node.
4
4
  * Pure function -- no I/O, no side effects.
@@ -1,6 +1,6 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { BaileysEventEmitter, BaileysEventMap, Contact } from '../Types';
3
- import type { ILogger } from './logger';
2
+ import type { BaileysEventEmitter, BaileysEventMap, Contact } from '../Types/index.js';
3
+ import type { ILogger } from './logger.js';
4
4
  export type ContactsUpsertResult = {
5
5
  event: 'contacts.upsert';
6
6
  data: Contact[];
@@ -1,5 +1,5 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import { isLidUser, isPnUser } from '../WABinary';
2
+ import { isLidUser, isPnUser } from '../WABinary/index.js';
3
3
  /**
4
4
  * Process contactAction and return events to emit.
5
5
  * Pure function - no side effects.
@@ -1,5 +1,5 @@
1
- import type { SignalKeyStoreWithTransaction } from '../Types';
2
- import type { BinaryNode } from '../WABinary';
1
+ import type { SignalKeyStoreWithTransaction } from '../Types/index.js';
2
+ import type { BinaryNode } from '../WABinary/index.js';
3
3
  /** Sentinel key under `tctoken` store holding a JSON array of tracked storage JIDs for cross-session pruning. */
4
4
  export declare const TC_TOKEN_INDEX_KEY = "__index";
5
5
  /** Read the persisted tctoken JID index and return its entries (never contains the sentinel key itself). */
@@ -1,4 +1,4 @@
1
- import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isJidMetaAI, isLidUser, isPnUser, jidNormalizedUser } from '../WABinary';
1
+ import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isJidMetaAI, isLidUser, isPnUser, jidNormalizedUser } from '../WABinary/index.js';
2
2
  // Same phone-number pattern as WABinary's isJidBot, applied against the user
3
3
  // part so the check is invariant to @c.us ↔ @s.whatsapp.net normalization.
4
4
  const BOT_PHONE_REGEX = /^1313555\d{4}$|^131655500\d{2}$/;
@@ -1,4 +1,4 @@
1
- import type { AuthenticationState } from '../Types';
1
+ import type { AuthenticationState } from '../Types/index.js';
2
2
  export declare const countAuthFileLocks: () => number;
3
3
  /**
4
4
  * stores the full authentication state in a single folder.
@@ -2,8 +2,8 @@ import { Mutex } from 'async-mutex';
2
2
  import { mkdir, readFile, stat, unlink, writeFile } from 'fs/promises';
3
3
  import { join } from 'path';
4
4
  import { proto } from '../../WAProto/index.js';
5
- import { initAuthCreds } from './auth-utils';
6
- import { BufferJSON } from './generics';
5
+ import { initAuthCreds } from './auth-utils.js';
6
+ import { BufferJSON } from './generics.js';
7
7
  // We need to lock files due to the fact that we are using async functions to read and write files
8
8
  // Atomic credential-file writes are covered by the QIRO auth-state implementation.
9
9
  // https://github.com/nodejs/node/issues/26338
@@ -1,6 +1,6 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types';
3
- import { type BinaryNode } from '../WABinary';
2
+ import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types/index.js';
3
+ import { type BinaryNode } from '../WABinary/index.js';
4
4
  export declare const generateLoginNode: (userJid: string, config: SocketConfig) => proto.IClientPayload;
5
5
  export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: SocketConfig) => proto.ClientPayload;
6
6
  export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick<AuthenticationCreds, "advSecretKey" | "signedIdentityKey" | "signalIdentities">) => {
@@ -1,11 +1,11 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { createHash } from 'crypto';
3
3
  import { proto } from '../../WAProto/index.js';
4
- import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults';
5
- import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary';
6
- import { Curve, hmacSign } from './crypto';
7
- import { encodeBigEndian } from './generics';
8
- import { createSignalIdentity } from './signal';
4
+ import { KEY_BUNDLE_TYPE, WA_ADV_ACCOUNT_SIG_PREFIX, WA_ADV_DEVICE_SIG_PREFIX, WA_ADV_HOSTED_ACCOUNT_SIG_PREFIX } from '../Defaults/index.js';
5
+ import { getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary/index.js';
6
+ import { Curve, hmacSign } from './crypto.js';
7
+ import { encodeBigEndian } from './generics.js';
8
+ import { createSignalIdentity } from './signal.js';
9
9
  const getUserAgent = (config) => {
10
10
  return {
11
11
  appVersion: {
@@ -1,4 +1,4 @@
1
- import type { BinaryNode, BinaryNodeCodingOptions } from './types';
1
+ import type { BinaryNode, BinaryNodeCodingOptions } from './types.js';
2
2
  export declare const decompressingIfRequired: (buffer: Buffer) => Promise<Buffer<ArrayBufferLike>>;
3
3
  export declare const decodeDecompressedBinaryNode: (buffer: Buffer, opts: Pick<BinaryNodeCodingOptions, "DOUBLE_BYTE_TOKENS" | "SINGLE_BYTE_TOKENS" | "TAGS">, indexRef?: {
4
4
  index: number;
@@ -1,7 +1,7 @@
1
1
  import { promisify } from 'util';
2
2
  import { inflate } from 'zlib';
3
- import * as constants from './constants';
4
- import { jidEncode, WAJIDDomains } from './jid-utils';
3
+ import * as constants from './constants.js';
4
+ import { jidEncode, WAJIDDomains } from './jid-utils.js';
5
5
  const inflatePromise = promisify(inflate);
6
6
  export const decompressingIfRequired = async (buffer) => {
7
7
  if (2 & buffer.readUInt8()) {
@@ -1,3 +1,3 @@
1
- import type { BinaryNode, BinaryNodeCodingOptions } from './types';
1
+ import type { BinaryNode, BinaryNodeCodingOptions } from './types.js';
2
2
  export declare const encodeBinaryNode: (node: BinaryNode, opts?: Pick<BinaryNodeCodingOptions, "TAGS" | "TOKEN_MAP">, buffer?: number[]) => Buffer;
3
3
  //# sourceMappingURL=encode.d.ts.map
@@ -1,5 +1,5 @@
1
- import * as constants from './constants';
2
- import { jidDecode } from './jid-utils';
1
+ import * as constants from './constants.js';
2
+ import { jidDecode } from './jid-utils.js';
3
3
  export const encodeBinaryNode = (node, opts = constants, buffer = [0]) => {
4
4
  const encoded = encodeBinaryNodeInner(node, opts, buffer);
5
5
  return Buffer.from(encoded);
@@ -1,5 +1,5 @@
1
1
  import { proto } from '../../WAProto/index.js';
2
- import { type BinaryNode } from './types';
2
+ import { type BinaryNode } from './types.js';
3
3
  export declare const getBinaryNodeChildren: (node: BinaryNode | undefined, childTag: string) => BinaryNode[];
4
4
  export declare const getBinaryNodeChild: (node: BinaryNode | undefined, childTag: string) => BinaryNode | undefined;
5
5
  export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[];
@@ -1,6 +1,6 @@
1
1
  import { Boom } from '@hapi/boom';
2
2
  import { proto } from '../../WAProto/index.js';
3
- import {} from './types';
3
+ import {} from './types.js';
4
4
  // some extra useful utilities
5
5
  const indexCache = new WeakMap();
6
6
  export const getBinaryNodeChildren = (node, childTag) => {
@@ -1,6 +1,6 @@
1
- export * from './encode';
2
- export * from './decode';
3
- export * from './generic-utils';
4
- export * from './jid-utils';
5
- export * from './types';
1
+ export * from './encode.js';
2
+ export * from './decode.js';
3
+ export * from './generic-utils.js';
4
+ export * from './jid-utils.js';
5
+ export * from './types.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- export * from './encode';
2
- export * from './decode';
3
- export * from './generic-utils';
4
- export * from './jid-utils';
5
- export * from './types';
1
+ export * from './encode.js';
2
+ export * from './decode.js';
3
+ export * from './generic-utils.js';
4
+ export * from './jid-utils.js';
5
+ export * from './types.js';
6
6
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import * as constants from './constants';
1
+ import * as constants from './constants.js';
2
2
  /**
3
3
  * the binary node WA uses internally for communication
4
4
  *
@@ -1,2 +1,2 @@
1
- import * as constants from './constants';
1
+ import * as constants from './constants.js';
2
2
  //# sourceMappingURL=types.js.map