mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add option to specify limit for custom upload host
This commit is contained in:
@@ -28,7 +28,7 @@ export type DownloadableMessage = { mediaKey?: Uint8Array, directPath?: string,
|
||||
export type MediaConnInfo = {
|
||||
auth: string
|
||||
ttl: number
|
||||
hosts: { hostname: string }[]
|
||||
hosts: { hostname: string, maxContentLengthBytes: number }[]
|
||||
fetchDate: Date
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { Agent } from "https"
|
||||
import type { Logger } from "pino"
|
||||
import type { URL } from "url"
|
||||
import type NodeCache from 'node-cache'
|
||||
import { MediaConnInfo } from "./Message"
|
||||
|
||||
export type WAVersion = [number, number, number]
|
||||
export type WABrowserDescription = [string, string, string]
|
||||
@@ -35,5 +36,5 @@ export type CommonSocketConfig<T> = {
|
||||
/** provide a cache to store media, so does not have to be re-uploaded */
|
||||
mediaCache?: NodeCache
|
||||
|
||||
customUploadHosts: string[]
|
||||
customUploadHosts: MediaConnInfo['hosts']
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ export type SocketConfig = CommonSocketConfig<AuthenticationState> & {
|
||||
userDevicesCache?: NodeCache
|
||||
/** map to store the retry counts for failed messages */
|
||||
msgRetryCounterMap?: { [msgId: string]: number }
|
||||
/** custom domains to push media via */
|
||||
customUploadHosts: string[]
|
||||
/**
|
||||
* fetch a message from your store
|
||||
* implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried
|
||||
|
||||
Reference in New Issue
Block a user