Robert Schäfer 3b2b3f0014
refactor(backend): remove obsolete code (#8752)
We kept this code for backwards compatibility but since we already deployed S3 to our kubernetes cluster and we're using it locally, let's remove this code. It will also make it easier to implement the image resize service as it reduces the total amount of code to maintain.

Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
2025-07-14 07:28:07 +00:00

54 lines
1.3 KiB
TypeScript

import type { Context } from '@src/context'
import type { FileDeleteCallback, FileUploadCallback } from '@src/uploads/types'
import { images as imagesS3 } from './imagesS3'
import type { FileUpload } from 'graphql-upload'
import type { Transaction } from 'neo4j-driver'
export interface DeleteImageOpts {
transaction?: Transaction
deleteCallback?: FileDeleteCallback
}
export interface MergeImageOpts {
transaction?: Transaction
uploadCallback?: FileUploadCallback
deleteCallback?: FileDeleteCallback
}
export interface ImageInput {
upload?: Promise<FileUpload>
alt?: string
sensitive?: boolean
aspectRatio?: number
type?: string
}
export interface Image {
url: string
alt?: string
sensitive?: boolean
aspectRatio?: number
type?: string
}
export interface Images {
deleteImage: (
resource: { id: string },
relationshipType: 'HERO_IMAGE' | 'AVATAR_IMAGE',
opts?: DeleteImageOpts,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) => Promise<any>
mergeImage: (
resource: { id: string },
relationshipType: 'HERO_IMAGE' | 'AVATAR_IMAGE',
imageInput: ImageInput | null | undefined,
opts?: MergeImageOpts,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) => Promise<any>
}
export const images = (config: Context['config']) => imagesS3(config)