Skip to content

Commit

Permalink
Merge pull request #21 from botcity-dev/FIX/update-axios-version
Browse files Browse the repository at this point in the history
fix: Update axios version to 1.6.0
  • Loading branch information
kayqueGovetri authored Nov 16, 2023
2 parents bdfdeaf + 315f592 commit 61d6f17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botcity/botcity-maestro-sdk",
"version": "1.2.1",
"version": "1.2.2",
"description": "Botcity Maestro SDK",
"author": "botcity",
"main": "dist/index.js",
Expand Down Expand Up @@ -64,7 +64,7 @@
"typescript": "^4.8.2"
},
"dependencies": {
"axios": "^0.27.2",
"axios": "^1.6.0",
"form-data": "^4.0.0"
},
"engines": {
Expand Down
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 61d6f17

Please sign in to comment.