Adding pre-commit

This commit is contained in:
alexsanderp
2022-02-04 10:03:55 -03:00
parent 7de6d5c14d
commit b8492c6840
46 changed files with 140 additions and 138 deletions
-1
View File
@@ -1 +0,0 @@
TEST=test
+2 -1
View File
@@ -34,4 +34,5 @@ lerna-debug.log*
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
.env # Ignore .env files
*.env
+6
View File
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
+1 -1
View File
@@ -1,4 +1,4 @@
{ {
"singleQuote": true, "singleQuote": true,
"trailingComma": "all" "trailingComma": "all"
} }
+1 -1
View File
@@ -9,4 +9,4 @@ COPY . /app/
COPY --from=packages /packages/node_modules /app/node_modules COPY --from=packages /packages/node_modules /app/node_modules
RUN npm run build RUN npm run build
EXPOSE 3333 EXPOSE 3333
ENTRYPOINT npm run start ENTRYPOINT npm run start
+6 -6
View File
@@ -21,12 +21,12 @@ import { RestEnrichmentsController } from './rest/rest-enrichments/rest-enrichme
import { RestFactoryController } from './rest/rest-factory/rest-factory.controller'; import { RestFactoryController } from './rest/rest-factory/rest-factory.controller';
import { HealthModule } from './health/health.module'; import { HealthModule } from './health/health.module';
@Module({ @Module({
imports: [ imports: [
RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule, HealthModule, RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule, HealthModule,
// InputGrpcClientModule, // InputGrpcClientModule,
//OutputsModule, //OutputsModule,
//EnrichmentModule, //EnrichmentModule,
//TransformationsModule, //TransformationsModule,
//PipelinesModule //PipelinesModule
], ],
controllers: [], controllers: [],
@@ -39,6 +39,6 @@ export class AppModule implements NestModule{
.apply(LoggerMiddleware) .apply(LoggerMiddleware)
.forRoutes(RestInputsController,RestOutputsController,RestTransformationsController,RestPipelinesController,RestEnrichmentsController,RestFactoryController) .forRoutes(RestInputsController,RestOutputsController,RestTransformationsController,RestPipelinesController,RestEnrichmentsController,RestFactoryController)
} }
} }
+1 -1
View File
@@ -1,5 +1,5 @@
export class CreateEnrichmentDto { export class CreateEnrichmentDto {
type:string; type:string;
columns:string[] columns:string[]
+1 -1
View File
@@ -9,7 +9,7 @@ import { GrpcClientConfiguration } from './config/grpc-client';
@ApiTags('enrichments') @ApiTags('enrichments')
@Controller('enrichment') @Controller('enrichment')
export class EnrichmentController implements OnModuleInit { export class EnrichmentController implements OnModuleInit {
@Client(GrpcClientConfiguration) @Client(GrpcClientConfiguration)
-1
View File
@@ -41,4 +41,3 @@ message CreateEnrichmentRequest {
message ListResponse { message ListResponse {
repeated Enrichment enrichments = 2; repeated Enrichment enrichments = 2;
} }
@@ -2,12 +2,12 @@
export class CreateInputGrpcClientDto { export class CreateInputGrpcClientDto {
cron:string; cron:string;
name:string; name:string;
plugin:string; plugin:string;
values:string; values:string;
operation:string; operation:string;
} }
@@ -3,4 +3,3 @@ export class TestConnectionDTO{
values:string; values:string;
plugin:string; plugin:string;
} }
@@ -1,14 +1,14 @@
export class InputGrpcClient { export class InputGrpcClient {
id:string; id:string;
cron:string; cron:string;
name:string; name:string;
plugin:string; plugin:string;
values:string; values:string;
operation:string; operation:string;
} }
+1 -1
View File
@@ -5,7 +5,7 @@ import { InputGrpcClientController } from './input-grpc-client.controller';
@Module({ @Module({
controllers: [ controllers: [
InputGrpcClientController, InputGrpcClientController,
// InputRestClientController // InputRestClientController
], ],
providers: [InputGrpcClientService], providers: [InputGrpcClientService],
+6 -6
View File
@@ -8,7 +8,7 @@ import { UpdateInputGrpcClientDto } from './dto/update-input-grpc-client.dto';
@Controller('input') @Controller('input')
export class InputRestClientController { export class InputRestClientController {
@Get('/test-connection/') @Get('/test-connection/')
async testConnection(){ async testConnection(){
console.log(process.env.DEV_URL+`/test-connection`, "ON TEST CONNECTION ROUTE") console.log(process.env.DEV_URL+`/test-connection`, "ON TEST CONNECTION ROUTE")
@@ -16,17 +16,17 @@ export class InputRestClientController {
return response return response
}) })
} }
@Post() @Post()
async create(@Body() createInputDto: CreateInputGrpcClientDto){ async create(@Body() createInputDto: CreateInputGrpcClientDto){
console.log(createInputDto) console.log(createInputDto)
console.log(process.env.DEV_URL+`/input`, "ON CREATE ROUTE") console.log(process.env.DEV_URL+`/input`, "ON CREATE ROUTE")
await axios.post(process.env.DEV_URL+'/input',createInputDto).then( (response) => { await axios.post(process.env.DEV_URL+'/input',createInputDto).then( (response) => {
return response return response
}) })
} }
@Get() @Get()
async list(){ async list(){
console.log(process.env.DEV_URL+`/input`, "ON GET ROUTE") console.log(process.env.DEV_URL+`/input`, "ON GET ROUTE")
@@ -43,7 +43,7 @@ export class InputRestClientController {
return response return response
}) })
} }
@Put(':id') @Put(':id')
async update( async update(
@@ -60,7 +60,7 @@ export class InputRestClientController {
@Delete(':id') @Delete(':id')
async delete(@Param() id: string){ async delete(@Param() id: string){
console.log(process.env.DEV_URL+`/input/${id}`, "ON DELETE ROUTE") console.log(process.env.DEV_URL+`/input/${id}`, "ON DELETE ROUTE")
await axios.delete(process.env.DEV_URL+`/input/${id}`).then( (response) => { await axios.delete(process.env.DEV_URL+`/input/${id}`).then( (response) => {
return response return response
}) })
+2 -2
View File
@@ -58,8 +58,8 @@ message TestConnectionRequest{
} }
message TestConnectionResponse{ message TestConnectionResponse{
// nao sei como vai ser a resposta // nao sei como vai ser a resposta
bool respose = 1; bool respose = 1;
} }
+2 -2
View File
@@ -3,7 +3,7 @@ import axios from 'axios';
import { NestMiddleware } from '@nestjs/common'; import { NestMiddleware } from '@nestjs/common';
export class LoggerMiddleware implements NestMiddleware{ export class LoggerMiddleware implements NestMiddleware{
use = async ( use = async (
request: Request, request: Request,
@@ -27,4 +27,4 @@ export class LoggerMiddleware implements NestMiddleware{
} }
}; };
} }
-1
View File
@@ -5,4 +5,3 @@ export class CreateOutputDto {
values:string; values:string;
operation:string; operation:string;
} }
+1 -1
View File
@@ -2,5 +2,5 @@ import { PartialType } from '@nestjs/mapped-types';
import { CreateOutputDto } from './create-output.dto'; import { CreateOutputDto } from './create-output.dto';
export class UpdateOutputDto extends PartialType(CreateOutputDto) { export class UpdateOutputDto extends PartialType(CreateOutputDto) {
} }
+1 -1
View File
@@ -7,7 +7,7 @@ import { GrpcClientConfiguration } from './config/grpc-client';
@Controller('pipeline') @Controller('pipeline')
export class PipelinesController implements OnModuleInit{ export class PipelinesController implements OnModuleInit{
@Client(GrpcClientConfiguration) @Client(GrpcClientConfiguration)
private pipelineServiceClient: ClientGrpc; private pipelineServiceClient: ClientGrpc;
+4 -4
View File
@@ -37,7 +37,7 @@ message Input {
string values = 5; string values = 5;
string operation = 6; string operation = 6;
} }
message Output { message Output {
string id = 1; string id = 1;
string name = 2; string name = 2;
@@ -80,12 +80,12 @@ message ListResponse {
message getPipelineLogsMessagesRequest{ message getPipelineLogsMessagesRequest{
string id = 1; string id = 1;
string details = 2; string details = 2;
} }
message getPipelineLogsMessagesResponseItem{ message getPipelineLogsMessagesResponseItem{
string date = 1; string date = 1;
string log = 2; string log = 2;
} }
message getPipelineLogsMessagesResponse{ message getPipelineLogsMessagesResponse{
@@ -94,4 +94,4 @@ message getPipelineLogsMessagesResponse{
message getPipelineStatusResponse{ message getPipelineStatusResponse{
string status = 1; string status = 1;
} }
@@ -1,5 +1,5 @@
export class CreateRestEnrichmentDto { export class CreateRestEnrichmentDto {
type:string; type:string;
columns columns
@@ -59,7 +59,7 @@ export class RestEnrichmentsController {
@Put(':id') @Put(':id')
async update(@Param('id') id: string,@Headers() headers, @Body() body: UpdateRestEnrichmentDto) { async update(@Param('id') id: string,@Headers() headers, @Body() body: UpdateRestEnrichmentDto) {
const connectionResponse = await axios.put( const connectionResponse = await axios.put(
`${process.env.DEV_URL}/enrichment/${id}`, `${process.env.DEV_URL}/enrichment/${id}`,
body, body,
@@ -2,16 +2,16 @@ import { ApiProperty } from "@nestjs/swagger";
export class HTTPInputValues{ export class HTTPInputValues{
@ApiProperty({ @ApiProperty({
description:"Choosen url", description:"Choosen url",
example:"http://testroute/dadosfera/inputs/values" example:"http://testroute/dadosfera/inputs/values"
}) })
urls:string; urls:string;
@ApiProperty({ @ApiProperty({
description:"Schedule name", description:"Schedule name",
example:"Test_Schedule" example:"Test_Schedule"
}) })
schedule:string schedule:string
} }
@@ -2,52 +2,52 @@ import { ApiProperty } from "@nestjs/swagger";
export class JDBCInputvalues{ export class JDBCInputvalues{
@ApiProperty({ @ApiProperty({
description:"JDBC user", description:"JDBC user",
example:"airflow" example:"airflow"
}) })
jdbc_user: string; jdbc_user: string;
@ApiProperty({ @ApiProperty({
description:"JDBC password", description:"JDBC password",
example:"password123" example:"password123"
}) })
jdbc_password: string; jdbc_password: string;
@ApiProperty({ @ApiProperty({
description:"Database", description:"Database",
example:"airflow" example:"airflow"
}) })
database: string; database: string;
@ApiProperty({ @ApiProperty({
description:"Connection endpoint", description:"Connection endpoint",
example:"dadosfera-postgres-db.test123.us-east" example:"dadosfera-postgres-db.test123.us-east"
}) })
endpoint: string; endpoint: string;
@ApiProperty({ @ApiProperty({
description:"Schema name", description:"Schema name",
example:"cadastros" example:"cadastros"
}) })
schema?:string; schema?:string;
@ApiProperty({ @ApiProperty({
description:"Tables names", description:"Tables names",
example:["pessoas", "clients"] example:["pessoas", "clients"]
}) })
table: string[]; table: string[];
@ApiProperty({ @ApiProperty({
description:"Port", description:"Port",
example:"5432" example:"5432"
}) })
port: string; port: string;
@ApiProperty({ @ApiProperty({
description:"Engine name", description:"Engine name",
example:"postgres" example:"postgres"
}) })
engine: string; engine: string;
} }
@@ -29,19 +29,19 @@ export class CreateRestInputDto {
} }
}) })
cron:CronDTO; cron:CronDTO;
@ApiProperty({ @ApiProperty({
description:"Name of the input", description:"Name of the input",
example:"Test_Input" example:"Test_Input"
}) })
name:string; name:string;
@ApiProperty({ @ApiProperty({
description:"Plugin", description:"Plugin",
example:"s3" example:"s3"
}) })
plugin:string; plugin:string;
@ApiProperty({ @ApiProperty({
description:"Values for choosen input", description:"Values for choosen input",
example:{ example:{
@@ -55,7 +55,7 @@ export class CreateRestInputDto {
} }
}) })
values: SalesforceInputValuesDTO|HTTPInputValues|S3InputValues|JDBCInputvalues; values: SalesforceInputValuesDTO|HTTPInputValues|S3InputValues|JDBCInputvalues;
@ApiProperty({ @ApiProperty({
description:"Operation name", description:"Operation name",
example:"input" example:"input"
+15 -15
View File
@@ -14,89 +14,89 @@ export class CronDTO{
example:true example:true
}) })
hour_interval: boolean; hour_interval: boolean;
@ApiProperty({ @ApiProperty({
description:"Boolean for hour resourse", description:"Boolean for hour resourse",
example:true example:true
}) })
hour_resourse: boolean; hour_resourse: boolean;
@ApiProperty({ @ApiProperty({
description:"Value for hour resourse", description:"Value for hour resourse",
example:3 example:3
}) })
hour_resourse_value: number; hour_resourse_value: number;
@ApiProperty({ @ApiProperty({
description:"Month day to the cron", description:"Month day to the cron",
example:["3"] example:["3"]
}) })
month_day: string[]; month_day: string[];
@ApiProperty({ @ApiProperty({
description:"Boolean for month day interval", description:"Boolean for month day interval",
example:true example:true
}) })
month_day_interval: boolean; month_day_interval: boolean;
@ApiProperty({ @ApiProperty({
description:"Boolean for month day resourse", description:"Boolean for month day resourse",
example:false example:false
}) })
month_day_resourse: boolean; month_day_resourse: boolean;
@ApiProperty({ @ApiProperty({
description:"Value for month day resourse", description:"Value for month day resourse",
example:null example:null
}) })
month_day_resourse_value:number|null; month_day_resourse_value:number|null;
@ApiProperty({ @ApiProperty({
description:"Month to the cron", description:"Month to the cron",
example:["3"] example:["3"]
}) })
month: string[]; month: string[];
@ApiProperty({ @ApiProperty({
description:"Boolean from month interval", description:"Boolean from month interval",
example:false example:false
}) })
month_interval: boolean; month_interval: boolean;
@ApiProperty({ @ApiProperty({
description:"Boolean from month resourse", description:"Boolean from month resourse",
example:false example:false
}) })
month_resourse: boolean; month_resourse: boolean;
@ApiProperty({ @ApiProperty({
description:"Value to month resourse", description:"Value to month resourse",
example:null example:null
}) })
month_resourse_value:number|null; month_resourse_value:number|null;
@ApiProperty({ @ApiProperty({
description:"Week days to the cron", description:"Week days to the cron",
example:[] example:[]
}) })
week_days: string[]; week_days: string[];
@ApiProperty({ @ApiProperty({
description:"Boolean for the week days", description:"Boolean for the week days",
example:false example:false
}) })
week_days_interval: boolean; week_days_interval: boolean;
@ApiProperty({ @ApiProperty({
description:"Boolean for week day resourse", description:"Boolean for week day resourse",
example:false example:false
}) })
week_days_resourse: boolean; week_days_resourse: boolean;
@ApiProperty({ @ApiProperty({
description:"Hours to the cron", description:"Hours to the cron",
example:null example:null
}) })
week_days_resourse_value:number|null week_days_resourse_value:number|null
} }
@@ -14,37 +14,37 @@ export class S3InputValues{
example:"dadosfera-test" example:"dadosfera-test"
}) })
target_bucket?: string; target_bucket?: string;
@ApiProperty({ @ApiProperty({
description:"client bucket path", description:"client bucket path",
example:"dadosfera-test" example:"dadosfera-test"
}) })
client_bucket: string; client_bucket: string;
@ApiProperty({ @ApiProperty({
description:"Format to the file", description:"Format to the file",
example:"csv" example:"csv"
}) })
format_file: string; format_file: string;
@ApiProperty({ @ApiProperty({
description:"Clients AWS Access Key Id", description:"Clients AWS Access Key Id",
example:"AKIBN5B19D3NGZI" example:"AKIBN5B19D3NGZI"
}) })
client_aws_access_key_id: string; client_aws_access_key_id: string;
@ApiProperty({ @ApiProperty({
description:"Clients AWS Secret Access Key Id", description:"Clients AWS Secret Access Key Id",
example:"ct5R1EjrVC78bvaJ636gG90O5NqOrOUoq4Ri" example:"ct5R1EjrVC78bvaJ636gG90O5NqOrOUoq4Ri"
}) })
client_aws_secret_access_key : string; client_aws_secret_access_key : string;
@ApiProperty({ @ApiProperty({
description:"file params format", description:"file params format",
example:{sep: "," , header: "true"} example:{sep: "," , header: "true"}
}) })
format_file_params?: { format_file_params?: {
sep: string, sep: string,
header: string header: string
} }
} }
@@ -8,20 +8,20 @@ export class SalesforceInputValuesDTO{
example:"dadosfera@devs.com" example:"dadosfera@devs.com"
}) })
username_salesforce: string; username_salesforce: string;
@ApiProperty({ @ApiProperty({
description:"Salesforce password", description:"Salesforce password",
example:"Salesforce@test123" example:"Salesforce@test123"
})password_salesforce: string; })password_salesforce: string;
@ApiProperty({ @ApiProperty({
description:"Salesforce Security Token", description:"Salesforce Security Token",
example:"A67Tdg7qHUvhZDOFjWwtPMjmQ" example:"A67Tdg7qHUvhZDOFjWwtPMjmQ"
})security_token_salesforce: string; })security_token_salesforce: string;
@ApiProperty({ @ApiProperty({
description:"Salesforce Query", description:"Salesforce Query",
example:"SELECT * FROM Users" example:"SELECT * FROM Users"
})query_salesforce: string; })query_salesforce: string;
} }
@@ -18,7 +18,7 @@ export class testConnectionDTO{
description:"Plugin name", description:"Plugin name",
example:{ example:{
plugin: "mysql", plugin: "mysql",
values: { values: {
jdbc_user: "test", jdbc_user: "test",
jdbc_password: "test1234", jdbc_password: "test1234",
database: "users", database: "users",
@@ -29,6 +29,6 @@ export class testConnectionDTO{
} }
} }
}) })
values:HTTPInputValues|SalesforceInputValuesDTO|S3InputValues|JDBCInputvalues values:HTTPInputValues|SalesforceInputValuesDTO|S3InputValues|JDBCInputvalues
} }
@@ -1,14 +1,14 @@
export class RestInput { export class RestInput {
id:string; id:string;
cron:string; cron:string;
name:string; name:string;
plugin:string; plugin:string;
values:string; values:string;
operation:string; operation:string;
} }
@@ -28,7 +28,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -46,7 +46,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -62,7 +62,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -78,7 +78,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -100,7 +100,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -116,7 +116,7 @@ export class RestInputsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -7,13 +7,13 @@ export class CreateRestOutputDto {
example:"Test Output" example:"Test Output"
}) })
name:string; name:string;
@ApiProperty({ @ApiProperty({
description:"Plugin name", description:"Plugin name",
example:"Test Plugin" example:"Test Plugin"
}) })
plugin:string; plugin:string;
@ApiProperty({ @ApiProperty({
description:"Plugin values", description:"Plugin values",
example:{ example:{
@@ -23,7 +23,7 @@ export class CreateRestOutputDto {
values:{ values:{
prefix:string prefix:string
}; };
@ApiProperty({ @ApiProperty({
description:"Operation name", description:"Operation name",
example:"output" example:"output"
@@ -76,7 +76,7 @@ export class RestOutputsController {
@Delete(':id') @Delete(':id')
async remove(@Param('id') id: string,@Headers() headers) { async remove(@Param('id') id: string,@Headers() headers) {
const connectionResponse = await axios.delete( const connectionResponse = await axios.delete(
`${process.env.DEV_URL}/output/${id}`, `${process.env.DEV_URL}/output/${id}`,
{ {
@@ -25,7 +25,7 @@ export class RestTransformationsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -41,7 +41,7 @@ export class RestTransformationsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -57,7 +57,7 @@ export class RestTransformationsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -75,7 +75,7 @@ export class RestTransformationsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
@@ -91,7 +91,7 @@ export class RestTransformationsController {
} }
) )
return connectionResponse.data return connectionResponse.data
} }
} }
@@ -1,37 +1,37 @@
import { ApiProperty } from "@nestjs/swagger"; import { ApiProperty } from "@nestjs/swagger";
export class CreateRestUserDto { export class CreateRestUserDto {
@ApiProperty({ @ApiProperty({
description:"User Email", description:"User Email",
example:"dev@dadosfera.ai" example:"dev@dadosfera.ai"
}) })
email: string; email: string;
@ApiProperty({ @ApiProperty({
description:"User Password", description:"User Password",
example:"dadospassword123" example:"dadospassword123"
}) })
password: string; password: string;
@ApiProperty({ @ApiProperty({
description:"User Username", description:"User Username",
example:"dev_fera" example:"dev_fera"
}) })
username: string; username: string;
@ApiProperty({ @ApiProperty({
description:"User name", description:"User name",
example:"Fulano da Silva" example:"Fulano da Silva"
}) })
name: string; name: string;
@ApiProperty({ @ApiProperty({
description:"Customer id", description:"Customer id",
example:"dadosfera" example:"dadosfera"
}) })
customer_id: string; customer_id: string;
@ApiProperty({ @ApiProperty({
description:"User rules", description:"User rules",
example:"['admin']" example:"['admin']"
+1 -1
View File
@@ -7,4 +7,4 @@ export class ResendCodeDTO{
example:"dev_fera" example:"dev_fera"
}) })
username:string username:string
} }
+1 -1
View File
@@ -15,4 +15,4 @@ export class UserAuthDTO{
example:"dadospassword123" example:"dadospassword123"
}) })
password:string; password:string;
} }
@@ -8,10 +8,10 @@ export class UserConfirmationDTO{
}) })
username:string; username:string;
@ApiProperty({ @ApiProperty({
description:"Received Confirmation Code", description:"Received Confirmation Code",
example:"315246" example:"315246"
}) })
confirmationCode:string; confirmationCode:string;
} }
+3 -3
View File
@@ -33,7 +33,7 @@ export class RestUserController {
@Post('/auth') @Post('/auth')
async auth(@Body() body: UserAuthDTO) { async auth(@Body() body: UserAuthDTO) {
const connectionResponse = await axios.post( const connectionResponse = await axios.post(
`${process.env.DEV_URL}/user/auth`, `${process.env.DEV_URL}/user/auth`,
body, body,
@@ -50,7 +50,7 @@ export class RestUserController {
@Post('/confirm') @Post('/confirm')
async confirm(@Body() body: UserConfirmationDTO) { async confirm(@Body() body: UserConfirmationDTO) {
const connectionResponse = await axios.post( const connectionResponse = await axios.post(
`${process.env.DEV_URL}/user/confirm`, `${process.env.DEV_URL}/user/confirm`,
body, body,
@@ -81,5 +81,5 @@ export class RestUserController {
return connectionResponse.data return connectionResponse.data
} }
} }
@@ -2,10 +2,10 @@
export class CreateTransformationDto { export class CreateTransformationDto {
inputSource:string; inputSource:string;
table:string; table:string;
type:string; type:string;
params:string; params:string;
} }
@@ -1,14 +1,14 @@
export class Transformation { export class Transformation {
id:string; id:string;
inputSource:string; inputSource:string;
table:string; table:string;
type:string; type:string;
params:string; params:string;
} }
@@ -47,4 +47,3 @@ message CreateTransformationRequest {
message ListResponse { message ListResponse {
repeated Transformation transformations = 2; repeated Transformation transformations = 2;
} }
@@ -8,7 +8,7 @@ import { GrpcClientConfiguration } from './config/grpc-client';
@Controller('transformation') @Controller('transformation')
export class TransformationsController implements OnModuleInit { export class TransformationsController implements OnModuleInit {
@Client(GrpcClientConfiguration) @Client(GrpcClientConfiguration)
private transformationServiceClient: ClientGrpc; private transformationServiceClient: ClientGrpc;
@@ -21,7 +21,7 @@ export class TransformationsController implements OnModuleInit {
@Post() @Post()
create(@Payload() createTransformationDto: CreateTransformationDto[]) { create(@Payload() createTransformationDto: CreateTransformationDto[]) {
return createTransformationDto.map( transf => this.transformationService.create(transf)) return createTransformationDto.map( transf => this.transformationService.create(transf))
} }
+1 -1
View File
@@ -34,4 +34,4 @@ message UserResponse {
message ShowResponse { message ShowResponse {
repeated UserResponse users = 1; repeated UserResponse users = 1;
} }
+4 -4
View File
@@ -5,16 +5,16 @@ export class AuthenticateController{
private username:string; private username:string;
private password:string; private password:string;
constructor(){ constructor(){
this.username = process.env.AUTH_USERNAME this.username = process.env.AUTH_USERNAME
this.password = process.env.AUTH_PASSWORD this.password = process.env.AUTH_PASSWORD
} }
async authenticate():Promise<string>{ async authenticate():Promise<string>{
const response = await axios.post(process.env.AUTH_ROUTE, const response = await axios.post(process.env.AUTH_ROUTE,
{ {
username:this.username, username:this.username,
@@ -26,4 +26,4 @@ export class AuthenticateController{
} }
} }
+1 -1
View File
File diff suppressed because one or more lines are too long