mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-24 15:59:08 +00:00
get entities
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { OnModuleInit, Inject, HttpException } from '@nestjs/common';
|
||||
import {
|
||||
OnModuleInit,
|
||||
Inject,
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { ClientGrpc } from '@nestjs/microservices';
|
||||
import {
|
||||
DecodeGrpcStruct,
|
||||
@@ -268,4 +273,20 @@ export class InputsClientService implements OnModuleInit {
|
||||
// getOauthTokens(input){
|
||||
|
||||
// }
|
||||
|
||||
async getAvailableEntities(data) {
|
||||
console.log('InputClientService', 'GetAvailableEntities');
|
||||
objectSnakeToCamel(data);
|
||||
const response = await lastValueFrom(
|
||||
this.inputService.GetAvailableEntities(data),
|
||||
).catch((err) => {
|
||||
console.log(err);
|
||||
if (err.details && err.details.includes('400'))
|
||||
throw new HttpException('Plugin inválido', HttpStatus.BAD_REQUEST);
|
||||
throw new HttpException(err.details, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
});
|
||||
objectCamelToSnake(response);
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user