mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Dependency Inversion for Logger (#1153)
* feat: interface "ILogger" created feat: interface "ILogger" used instead of pino logger feat: "PinoLoggerAdapter" created to implement "ILogger" interface * feat: PinoLoggerAdapter removed feat: ILogger mapping the features we're using from pino * fix: sort imports --------- Co-authored-by: Mateus Franchini de Freitas <contato.mateusfr@outlook.com> Co-authored-by: Mateus Franchini de Freitas <mfranchini@domtec.com.br> Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
committed by
GitHub
parent
447e648958
commit
21f8431e61
@@ -1,5 +1,4 @@
|
||||
import { AxiosRequestConfig } from 'axios'
|
||||
import type { Logger } from 'pino'
|
||||
import type { Readable } from 'stream'
|
||||
import type { URL } from 'url'
|
||||
import { proto } from '../../WAProto'
|
||||
@@ -23,6 +22,7 @@ export type WAGenericMediaMessage = proto.Message.IVideoMessage | proto.Message.
|
||||
export import WAMessageStubType = proto.WebMessageInfo.StubType
|
||||
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
||||
export import WAMessageStatus = proto.WebMessageInfo.Status
|
||||
import { ILogger } from '../Utils/logger'
|
||||
export type WAMediaPayloadURL = { url: URL | string }
|
||||
export type WAMediaPayloadStream = { stream: Readable }
|
||||
export type WAMediaUpload = Buffer | WAMediaPayloadStream | WAMediaPayloadURL
|
||||
@@ -241,7 +241,7 @@ export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions &
|
||||
export type WAMediaUploadFunction = (readStream: Readable, opts: { fileEncSha256B64: string, mediaType: MediaType, timeoutMs?: number }) => Promise<{ mediaUrl: string, directPath: string }>
|
||||
|
||||
export type MediaGenerationOptions = {
|
||||
logger?: Logger
|
||||
logger?: ILogger
|
||||
mediaTypeOverride?: MediaType
|
||||
upload: WAMediaUploadFunction
|
||||
/** cache media so it does not have to be uploaded again */
|
||||
|
||||
Reference in New Issue
Block a user