chore: update configuration and improve schema imports

- Updated biome.json to include "graphql.d.ts" in the ignored files list.
- Updated subproject commit reference in epess-database to the latest version.
- Removed unused script from package.json and streamlined module file extensions in tsconfig.json.
- Consolidated exclude patterns in tsconfig.build.json for clarity.
- Refactored imports across multiple schema files for consistency and improved readability.
- Enhanced various schema files by ensuring proper import order and removing redundant code.
- Improved error handling and data integrity checks in several service and schema files.
This commit is contained in:
2024-12-08 20:49:52 +07:00
parent 9e6d62e4be
commit 10e20092ab
82 changed files with 1697 additions and 2259 deletions

View File

@@ -1,6 +1,6 @@
import { Module, Global } from '@nestjs/common'
import { MinioService } from './minio.service'
import { Global, Module } from '@nestjs/common'
import { NestMinioModule } from 'nestjs-minio'
import { MinioService } from './minio.service'
@Global()
@Module({
imports: [

View File

@@ -2,11 +2,11 @@ import { Inject, Injectable, Logger } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
// @ts-expect-error
import { FileUpload } from 'graphql-upload/processRequest.mjs'
import { Client, BucketItem } from 'minio'
import { BucketItem, Client } from 'minio'
import { MINIO_CONNECTION } from 'nestjs-minio'
import Delta from 'quill-delta'
import { DateTimeUtils } from 'src/common/utils/datetime.utils'
import { v4 as uuidv4 } from 'uuid'
import Delta from 'quill-delta'
@Injectable()
export class MinioService {
constructor(
@@ -141,7 +141,11 @@ export class MinioService {
// get the record url from minio by searching for the file starting with roomId and ending with .mp4 and returning the presigned url
async getRoomRecordUrl(roomId: string) {
return await new Promise<string | null>(async (resolve, reject) => {
const stream = this.minioClient.listObjects(this.configService.get('BUCKET_NAME') ?? 'epess', `records/${roomId}`, true)
const stream = this.minioClient.listObjects(
this.configService.get('BUCKET_NAME') ?? 'epess',
`records/${roomId}`,
true,
)
const items: BucketItem[] = []
stream.on('data', (item) => {
@@ -149,7 +153,15 @@ export class MinioService {
})
stream.on('end', async () => {
const record = items.find((item) => item.name?.endsWith('.mp4'))
resolve(record ? await this.minioClient.presignedUrl('GET', this.configService.get('BUCKET_NAME') ?? 'epess', record.name ?? '') : null)
resolve(
record
? await this.minioClient.presignedUrl(
'GET',
this.configService.get('BUCKET_NAME') ?? 'epess',
record.name ?? '',
)
: null,
)
})
stream.on('error', (err) => {
reject(err)