/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
apps/api/src/app/inbound-parse/inbound-parse.controller.ts
40 строк
2 KB
Adam Chmara
chore(root): apply biome formatter & linter fixes NV-6436 (#8838)
31 июл 2025, 14:59
Не верифицирован
31 июл 2025, 14:59
855fb8f
Код
Авторство
О чём код?
import { ClassSerializerInterceptor, Controller, Get, UseInterceptors } from '@nestjs/common'; import { ApiExcludeController, ApiOperation, ApiTags } from '@nestjs/swagger'; import { PinoLogger } from '@novu/application-generic'; import { UserSessionData } from '@novu/shared'; import { RequireAuthentication } from '../auth/framework/auth.decorator'; import { ExternalApiAccessible } from '../auth/framework/external-api.decorator'; import { ApiCommonResponses, ApiResponse } from '../shared/framework/response.decorator'; import { UserSession } from '../shared/framework/user.decorator'; import { GetMxRecordResponseDto } from './dtos/get-mx-record.dto'; import { GetMxRecordCommand } from './usecases/get-mx-record/get-mx-record.command'; import { GetMxRecord } from './usecases/get-mx-record/get-mx-record.usecase'; @ApiCommonResponses() @Controller('/inbound-parse') @UseInterceptors(ClassSerializerInterceptor) @RequireAuthentication() @ApiTags('Inbound Parse') @ApiExcludeController() export class InboundParseController { constructor( private getMxRecordUsecase: GetMxRecord, private logger: PinoLogger ) { this.logger.setContext(this.constructor.name); } @Get('/mx/status') @ApiOperation({ summary: 'Validate the mx record setup for the inbound parse functionality', }) @ApiResponse(GetMxRecordResponseDto) @ExternalApiAccessible() async getMxRecordStatus(@UserSession() user: UserSessionData): Promise<GetMxRecordResponseDto> { this.logger.info('Getting MX Record Status'); return await this.getMxRecordUsecase.execute( GetMxRecordCommand.create({ environmentId: user.environmentId, organizationId: user.organizationId }) ); } }