Skip to content

Commit

Permalink
fix: ajust in url to download csv log and params name in create log
Browse files Browse the repository at this point in the history
  • Loading branch information
kayqueGovetri committed Nov 16, 2023
1 parent 898ec27 commit 315f592
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/botcity/maestro/sdk.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -152,8 +152,7 @@ export class BotMaestroSdk {
@catchError
async createLog (activityLabel: string, columns: Column[]): Promise<Log> {
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) => {
Expand Down Expand Up @@ -196,7 +195,7 @@ export class BotMaestroSdk {
@ensureAccessToken
@catchError
async downloadCsvLog (idLog: string, filepath: string, days: number = 7): Promise<Buffer> {
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) => {
Expand Down

0 comments on commit 315f592

Please sign in to comment.