proto: fix proto generation, tsc: fix node imports of compiled code

This commit is contained in:
Rajeh Taher
2025-07-19 23:16:35 +03:00
parent 29f0ac83f8
commit 8dc852ee89
33 changed files with 123 additions and 42 deletions
+4 -2
View File
@@ -1,9 +1,11 @@
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { makeLibSignalRepository } from '../Signal/libsignal'
import type { AuthenticationState, MediaType, SocketConfig, WAVersion } from '../Types'
import { Browsers } from '../Utils'
import logger from '../Utils/logger'
import { version } from './baileys-version.json'
import defaultVersion from './baileys-version.json' assert { type: 'json' }
const { version } = defaultVersion
export const UNAUTHORIZED_CODES = [401, 403, 419]
@@ -1,4 +1,4 @@
import { proto } from '../../../WAProto'
import { proto } from '../../../WAProto/index.js'
import { CiphertextMessage } from './ciphertext-message'
interface SenderKeyDistributionMessageStructure {
+1 -1
View File
@@ -1,6 +1,6 @@
/* @ts-ignore */
import { calculateSignature, verifySignature } from 'libsignal/src/curve'
import { proto } from '../../../WAProto'
import { proto } from '../../../WAProto/index.js'
import { CiphertextMessage } from './ciphertext-message'
interface SenderKeyMessageStructure {
+1 -1
View File
@@ -1,6 +1,6 @@
import NodeCache from '@cacheable/node-cache'
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { DEFAULT_CACHE_TTLS, PROCESSABLE_HISTORY_TYPES } from '../Defaults'
import type {
BotListInfo,
+1 -1
View File
@@ -1,4 +1,4 @@
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { GroupMetadata, GroupParticipant, ParticipantAction, SocketConfig, WAMessageKey } from '../Types'
import { WAMessageStubType } from '../Types'
import { generateMessageIDV2, unixTimestampSeconds } from '../Utils'
+1 -1
View File
@@ -2,7 +2,7 @@ import NodeCache from '@cacheable/node-cache'
import { Boom } from '@hapi/boom'
import { randomBytes } from 'crypto'
import Long from 'long'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { DEFAULT_CACHE_TTLS, KEY_BUNDLE_TYPE, MIN_PREKEY_COUNT } from '../Defaults'
import type {
MessageReceiptType,
+1 -1
View File
@@ -1,6 +1,6 @@
import NodeCache from '@cacheable/node-cache'
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { DEFAULT_CACHE_TTLS, WA_DEFAULT_EPHEMERAL } from '../Defaults'
import type {
AnyMessageContent,
+1 -1
View File
@@ -2,7 +2,7 @@ import { Boom } from '@hapi/boom'
import { randomBytes } from 'crypto'
import { URL } from 'url'
import { promisify } from 'util'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import {
DEF_CALLBACK_PREFIX,
DEF_TAG_PREFIX,
+1 -1
View File
@@ -1,4 +1,4 @@
import type { proto } from '../../WAProto'
import type { proto } from '../../WAProto/index.js'
import type { Contact } from './Contact'
import type { MinimalMessage } from './Message'
+1 -1
View File
@@ -1,4 +1,4 @@
import type { proto } from '../../WAProto'
import type { proto } from '../../WAProto/index.js'
import type { AccountSettings } from './Auth'
import type { BufferedEventData } from './Events'
import type { LabelActionBody } from './Label'
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { AuthenticationCreds } from './Auth'
import type { WACallEvent } from './Call'
import type { Chat, ChatUpdate, PresenceData } from './Chat'
+1 -1
View File
@@ -1,7 +1,7 @@
import type { AxiosRequestConfig } from 'axios'
import type { Readable } from 'stream'
import type { URL } from 'url'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { MEDIA_HKDF_KEY_MAPPING } from '../Defaults'
import type { BinaryNode } from '../WABinary'
import type { GroupMetadata } from './GroupMetadata'
+1 -1
View File
@@ -1,4 +1,4 @@
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
type DecryptGroupSignalOpts = {
group: string
+1 -1
View File
@@ -1,7 +1,7 @@
import type { AxiosRequestConfig } from 'axios'
import type { Agent } from 'https'
import type { URL } from 'url'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { ILogger } from '../Utils/logger'
import type { AuthenticationState, SignalAuthState, TransactionCapabilityOptions } from './Auth'
import type { GroupMetadata } from './GroupMetadata'
+1 -1
View File
@@ -1,6 +1,6 @@
import { Boom } from '@hapi/boom'
import type { AxiosRequestConfig } from 'axios'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type {
BaileysEventEmitter,
Chat,
+1 -1
View File
@@ -1,5 +1,5 @@
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { SignalRepository, WAMessage, WAMessageKey } from '../Types'
import {
areJidsSameUser,
+1 -1
View File
@@ -1,5 +1,5 @@
import EventEmitter from 'events'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type {
BaileysEvent,
BaileysEventEmitter,
+3 -2
View File
@@ -2,8 +2,9 @@ import { Boom } from '@hapi/boom'
import axios, { type AxiosRequestConfig } from 'axios'
import { createHash, randomBytes } from 'crypto'
import { platform, release } from 'os'
import { proto } from '../../WAProto'
import { version as baileysVersion } from '../Defaults/baileys-version.json'
import { proto } from '../../WAProto/index.js'
import version from '../Defaults/baileys-version.json' assert { type: 'json' }
const baileysVersion = version.version
import type {
BaileysEventEmitter,
BaileysEventMap,
+1 -1
View File
@@ -1,7 +1,7 @@
import type { AxiosRequestConfig } from 'axios'
import { promisify } from 'util'
import { inflate } from 'zlib'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { Chat, Contact } from '../Types'
import { WAMessageStubType } from '../Types'
import { isJidUser } from '../WABinary'
+1 -1
View File
@@ -9,7 +9,7 @@ import { tmpdir } from 'os'
import { join } from 'path'
import { Readable, Transform } from 'stream'
import { URL } from 'url'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { DEFAULT_ORIGIN, MEDIA_HKDF_KEY_MAPPING, MEDIA_PATH_MAP } from '../Defaults'
import type {
BaileysEventMap,
+1 -1
View File
@@ -3,7 +3,7 @@ import axios from 'axios'
import { randomBytes } from 'crypto'
import { promises as fs } from 'fs'
import { type Transform } from 'stream'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { MEDIA_KEYS, URL_REGEX, WA_DEFAULT_EPHEMERAL } from '../Defaults'
import type {
AnyMediaMessageContent,
+1 -1
View File
@@ -1,5 +1,5 @@
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { NOISE_MODE, WA_CERT_DETAILS } from '../Defaults'
import type { KeyPair } from '../Types'
import type { BinaryNode } from '../WABinary'
+1 -1
View File
@@ -1,5 +1,5 @@
import type { AxiosRequestConfig } from 'axios'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type {
AuthenticationCreds,
BaileysEventEmitter,
+1 -1
View File
@@ -1,7 +1,7 @@
import { Mutex } from 'async-mutex'
import { mkdir, readFile, stat, unlink, writeFile } from 'fs/promises'
import { join } from 'path'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import type { AuthenticationCreds, AuthenticationState, SignalDataTypeMap } from '../Types'
import { initAuthCreds } from './auth-utils'
import { BufferJSON } from './generics'
+1 -1
View File
@@ -1,6 +1,6 @@
import { Boom } from '@hapi/boom'
import { createHash } from 'crypto'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { KEY_BUNDLE_TYPE } from '../Defaults'
import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'
import { type BinaryNode, getBinaryNodeChild, jidDecode, S_WHATSAPP_NET } from '../WABinary'
+1 -1
View File
@@ -1,5 +1,5 @@
import { Boom } from '@hapi/boom'
import { proto } from '../../WAProto'
import { proto } from '../../WAProto/index.js'
import { type BinaryNode } from './types'
// some extra useful utilities
+1 -1
View File
@@ -1,3 +1,3 @@
export * from './Protocols'
export * from './Protocols/index'
export * from './USyncQuery'
export * from './USyncUser'
+8 -8
View File
@@ -1,12 +1,12 @@
import makeWASocket from './Socket'
import makeWASocket from './Socket/index'
export * from '../WAProto'
export * from './Utils'
export * from './Types'
export * from './Defaults'
export * from './WABinary'
export * from './WAM'
export * from './WAUSync'
export * from '../WAProto/index.js'
export * from './Utils/index'
export * from './Types/index'
export * from './Defaults/index'
export * from './WABinary/index'
export * from './WAM/index'
export * from './WAUSync/index'
export type WASocket = ReturnType<typeof makeWASocket>
export { makeWASocket }