refactor: replace axios with fetch API and update related types (#1666)

This commit is contained in:
João Lucas de Oliveira Lopes
2025-09-27 23:52:43 -03:00
committed by GitHub
parent cfe7a2b2b3
commit fb12f6d9d3
13 changed files with 97 additions and 124 deletions
+2 -3
View File
@@ -1,4 +1,3 @@
import type { AxiosRequestConfig } from 'axios'
import type { WAMediaUploadFunction, WAUrlInfo } from '../Types'
import type { ILogger } from './logger'
import { prepareWAMessageMedia } from './messages'
@@ -19,7 +18,7 @@ export type URLGenerationOptions = {
/** Timeout in ms */
timeout: number
proxyUrl?: string
headers?: AxiosRequestConfig<{}>['headers']
headers?: HeadersInit
}
uploadImage?: WAMediaUploadFunction
logger?: ILogger
@@ -70,7 +69,7 @@ export const getUrlInfo = async (
return false
}
},
headers: opts.fetchOpts as {}
headers: opts.fetchOpts?.headers as {}
})
if (info && 'title' in info && info.title) {
const [image] = info.images