diff --git a/apps/core/src/common/adapters/fastify.adapter.ts b/apps/core/src/common/adapters/fastify.adapter.ts index a3cbaad0..d3254635 100644 --- a/apps/core/src/common/adapters/fastify.adapter.ts +++ b/apps/core/src/common/adapters/fastify.adapter.ts @@ -66,7 +66,7 @@ app.register(fastifyCookie, { const logWarn = (desc: string, req: FastifyRequest, _context: string) => { const ua = req.raw.headers['user-agent'] - Logger.warn( + Logger.log( // prettier-ignore `${desc}\n` + `Path: ${req.url}\n` + diff --git a/apps/core/src/main.ts b/apps/core/src/main.ts index 153fc77b..1fd17d9c 100644 --- a/apps/core/src/main.ts +++ b/apps/core/src/main.ts @@ -40,7 +40,7 @@ async function main() { } logger.debug('encrypt key: ', ENCRYPT.key) - logger.warn( + logger.log( `Encrypt is enabled, please remember encrypt key. Your key is starts with ${ENCRYPT.key.slice( 0, 3, diff --git a/apps/core/src/processors/helper/helper.image.service.ts b/apps/core/src/processors/helper/helper.image.service.ts index f7a24a6f..7fec169a 100644 --- a/apps/core/src/processors/helper/helper.image.service.ts +++ b/apps/core/src/processors/helper/helper.image.service.ts @@ -1,6 +1,6 @@ import { encode } from 'blurhash' -import sharpTypes from 'sharp' import type { ImageModel } from '~/shared/model/image.model' +import type { Sharp } from 'sharp' import { Injectable, Logger } from '@nestjs/common' @@ -119,8 +119,8 @@ export class ImageService { const imageType = headers['content-type']! const buffer = Buffer.from(data) - const sharp = (await requireDepsWithInstall('sharp')) as typeof sharpTypes - const sharped = sharp(buffer) + const sharp = await requireDepsWithInstall('sharp') + const sharped = sharp(buffer) as Sharp const metadata = await sharped.metadata() const size = { height: metadata.height, @@ -139,7 +139,7 @@ export class ImageService { } } -const encodeImageToBlurhash = (sharped: sharpTypes.Sharp) => +const encodeImageToBlurhash = (sharped: Sharp) => new Promise((resolve, reject) => { sharped .raw()