mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-17 04:59:08 +00:00
FIX: Remove logs and add Authenticated
This commit is contained in:
@@ -87,7 +87,6 @@ export class ConnectorClientService implements OnModuleInit {
|
||||
request,
|
||||
),
|
||||
).catch((err) => {
|
||||
console.log(err.details);
|
||||
throw new HttpException(
|
||||
err.details,
|
||||
err.code === 6 ? HttpStatus.CONFLICT : 400,
|
||||
|
||||
@@ -25,6 +25,7 @@ import { RemoveTagDto } from './dtos/remove-tag';
|
||||
import { UpdateDto } from './dtos/update';
|
||||
import { UploadFileDto } from './dtos/upload-file';
|
||||
import { DadosferaLogger } from 'dadosfera-logs';
|
||||
import { Authenticated } from 'src/authentication/authentication.decorator';
|
||||
|
||||
@ApiTags('connectors')
|
||||
@ApiBearerAuth()
|
||||
@@ -40,6 +41,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Authenticated()
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
async uploadConnector(
|
||||
@@ -57,6 +59,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Post('/upload')
|
||||
@Authenticated()
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
async uploadFile(@UploadedFile() file, @Body() { name }: UploadFileDto) {
|
||||
@@ -71,6 +74,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Post('/multiple-connectors-upload')
|
||||
@Authenticated()
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
async uploadConnectorsFile(@UploadedFile() file: UploadConnectorsFileDto) {
|
||||
@@ -84,6 +88,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Get()
|
||||
@Authenticated()
|
||||
async getAllConnectors(
|
||||
@Headers('dadosfera-lang') language,
|
||||
@Query() queries: GetAllDto,
|
||||
@@ -109,11 +114,13 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Get('/tags')
|
||||
@Authenticated()
|
||||
async getConnectorsTags() {
|
||||
return await this.connectorClientService.getConnectorsTags();
|
||||
}
|
||||
|
||||
@Get('/:plugin')
|
||||
@Authenticated()
|
||||
async getConnector(
|
||||
@Headers('dadosfera-lang') language,
|
||||
@Param('plugin') plugin: string,
|
||||
@@ -135,6 +142,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Get('/:plugin/details')
|
||||
@Authenticated()
|
||||
async getConnectorDetails(
|
||||
@Headers('dadosfera-lang') language,
|
||||
@Param('plugin') plugin: string,
|
||||
@@ -156,6 +164,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Put('/:plugin')
|
||||
@Authenticated()
|
||||
@ApiConsumes('multipart/form-data')
|
||||
async updateConnector(
|
||||
@Param('plugin') plugin: string,
|
||||
@@ -177,6 +186,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Put('/:plugin/add-tag')
|
||||
@Authenticated()
|
||||
async addTagOnConnector(
|
||||
@Param('plugin') plugin: string,
|
||||
@Body() body: AddTagDto,
|
||||
@@ -203,6 +213,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Put('/:plugin/remove-tag')
|
||||
@Authenticated()
|
||||
async removeTagOnConnector(
|
||||
@Param('plugin') plugin: string,
|
||||
@Body() body: RemoveTagDto,
|
||||
@@ -230,6 +241,7 @@ export class ConnectorController {
|
||||
}
|
||||
|
||||
@Delete('/:plugin')
|
||||
@Authenticated()
|
||||
async deleteConnector(
|
||||
@Param('plugin') plugin: string,
|
||||
@Body() { version }: DeleteConnectorDto,
|
||||
|
||||
Reference in New Issue
Block a user