From 315f5928f0a65259425179c62fe7e8a5741ab690 Mon Sep 17 00:00:00 2001 From: kayqueGovetri Date: Thu, 16 Nov 2023 02:58:20 -0300 Subject: [PATCH] fix: ajust in url to download csv log and params name in create log --- src/botcity/maestro/sdk.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/botcity/maestro/sdk.ts b/src/botcity/maestro/sdk.ts index a063694..0adf32d 100644 --- a/src/botcity/maestro/sdk.ts +++ b/src/botcity/maestro/sdk.ts @@ -1,6 +1,6 @@ import axios, { AxiosResponse } from 'axios' import { ensureAccessToken, catchError, getMessageInError, getStackInError, getTypeInError, getDefaultTags, createNpmList, verifyUrlServer } from './utils' -import { Alert, DataLog, Log, Logs, Task, Artifact, Artifacts, IColumn } from './interfaces' +import { Alert, DataLog, Log, Logs, Task, Artifact, Artifacts } from './interfaces' import fs from 'fs' import FormData from 'form-data' import { Column } from './columns' @@ -152,8 +152,7 @@ export class BotMaestroSdk { @catchError async createLog (activityLabel: string, columns: Column[]): Promise { const url = `${this.server}/api/v2/log` - const valueColumns: IColumn[] = columns.map(column => column.object) - const data = { activityLabel, valueColumns, organizationLabel: this._login } + const data = { activityLabel, columns, organizationLabel: this._login } const response: AxiosResponse = await axios .post(url, data, this.headers) .catch((error: any) => { @@ -196,7 +195,7 @@ export class BotMaestroSdk { @ensureAccessToken @catchError async downloadCsvLog (idLog: string, filepath: string, days: number = 7): Promise { - const url = `${this.server}/api/v2/log/${idLog}/csv?days=${days}` + const url = `${this.server}/api/v2/log/${idLog}/export?days=${days}&format=csv` const response: AxiosResponse = await axios .get(url, { ...this.headers, responseType: 'arraybuffer' }) .catch((error: any) => {