mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add signal repository + tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { proto } from '../../WAProto'
|
||||
import type { MediaType, SocketConfig } from '../Types'
|
||||
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'
|
||||
@@ -35,7 +36,7 @@ export const PROCESSABLE_HISTORY_TYPES = [
|
||||
]
|
||||
|
||||
export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
version: version as any,
|
||||
version: version as WAVersion,
|
||||
browser: Browsers.baileys('Chrome'),
|
||||
waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat',
|
||||
connectTimeoutMs: 20_000,
|
||||
@@ -47,7 +48,7 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
customUploadHosts: [],
|
||||
retryRequestDelayMs: 250,
|
||||
fireInitQueries: true,
|
||||
auth: undefined as any,
|
||||
auth: undefined as unknown as AuthenticationState,
|
||||
markOnlineOnConnect: true,
|
||||
syncFullHistory: false,
|
||||
patchMessageBeforeSending: msg => msg,
|
||||
@@ -61,7 +62,8 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
patch: false,
|
||||
snapshot: false,
|
||||
},
|
||||
getMessage: async() => undefined
|
||||
getMessage: async() => undefined,
|
||||
makeSignalRepository: makeLibSignalRepository
|
||||
}
|
||||
|
||||
export const MEDIA_PATH_MAP: { [T in MediaType]?: string } = {
|
||||
|
||||
Reference in New Issue
Block a user