2024-01-30 08:02:10 +01:00
|
|
|
import { env } from '@typebot.io/env'
|
2024-09-02 11:23:01 +02:00
|
|
|
import { initClient } from './initClient'
|
2024-01-30 08:02:10 +01:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
key: string
|
|
|
|
|
expires?: number
|
|
|
|
|
}
|
|
|
|
|
export const getFileTempUrl = async ({
|
|
|
|
|
key,
|
|
|
|
|
expires,
|
|
|
|
|
}: Props): Promise<string> => {
|
2024-09-02 11:23:01 +02:00
|
|
|
const minioClient = initClient()
|
2024-01-30 08:02:10 +01:00
|
|
|
return minioClient.presignedGetObject(env.S3_BUCKET, key, expires ?? 3600)
|
|
|
|
|
}
|