Skip to content

Commit c76365e

Browse files
authored
[TECH] Upgrade Axios to latest (#3917)
* [TECH] Upgrade Axios to latest * fix: types and imports * tech: axios to v1.7.7 * fir: types * fix: lint --------- Co-authored-by: Flavio F Lima <[email protected]>
1 parent 976b489 commit c76365e

File tree

6 files changed

+25
-22
lines changed

6 files changed

+25
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@mui/material": "5.11.12",
6565
"@node-steam/vdf": "2.2.0",
6666
"@shockpkg/icon-encoder": "2.1.3",
67-
"axios": "0.26.1",
67+
"axios": "1.7.7",
6868
"classnames": "2.3.1",
6969
"compare-versions": "6.1.0",
7070
"crc": "4.3.2",

pnpm-lock.yaml

Lines changed: 18 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backend/online_monitor.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import axios from 'axios'
55
import EventEmitter from 'node:events'
66
import { sendFrontendMessage } from './main_window'
77

8-
//**********FORCE TO USE http adapter (node.js version):*****
9-
axios.defaults.adapter = require('axios/lib/adapters/http.js')
10-
//**********FORCE TO USE http adapter (node.js version):*****
11-
128
let status: ConnectivityStatus
139
let abortController: AbortController
1410
let retryTimer: NodeJS.Timeout

src/backend/storeManagers/gog/library.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { sendFrontendMessage } from '../../main_window'
2-
import axios, { AxiosError, AxiosRequestHeaders, AxiosResponse } from 'axios'
2+
import axios, { AxiosError, AxiosResponse } from 'axios'
33
import { GOGUser } from './user'
44
import {
55
GameInfo,
@@ -854,7 +854,7 @@ export async function getBuilds(
854854
url.searchParams.set('password', password)
855855
}
856856

857-
const headers: AxiosRequestHeaders = {}
857+
const headers: Record<string, string> = {}
858858
if (access_token) {
859859
headers.Authorization = `Bearer ${access_token}`
860860
}
@@ -1206,7 +1206,7 @@ export async function getGamesdbData(
12061206
logError(
12071207
[
12081208
`Was not able to get GamesDB data for ${game_id}`,
1209-
error.response?.data.error_description
1209+
error.response?.data
12101210
],
12111211
LogPrefix.ExtraGameInfo
12121212
)
@@ -1250,7 +1250,7 @@ export async function getProductApi(
12501250
url.searchParams.set('expand', expand.join(','))
12511251
}
12521252

1253-
const headers: AxiosRequestHeaders = {}
1253+
const headers: Record<string, string> = {}
12541254
if (accessToken) {
12551255
headers.Authorization = `Bearer ${accessToken}`
12561256
}

src/backend/wiki_game_info/protondb/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function getInfoFromProtonDB(
1919
logError(
2020
[
2121
`Was not able to get ProtonDB data for ${steamID}`,
22-
error.response?.data.error_description
22+
error.response?.data
2323
],
2424
LogPrefix.ExtraGameInfo
2525
)

src/backend/wiki_game_info/steamdeck/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function getSteamDeckComp(
1818
logError(
1919
[
2020
`Was not able to get Stem Deck data for ${steamID}`,
21-
error.response?.data.error_description
21+
error.response?.data
2222
],
2323
LogPrefix.ExtraGameInfo
2424
)

0 commit comments

Comments
 (0)