Skip to content

Commit

Permalink
[TECH] Upgrade Axios to latest (#3917)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
flavioislima and flavioislima authored Nov 18, 2024
1 parent 976b489 commit c76365e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@mui/material": "5.11.12",
"@node-steam/vdf": "2.2.0",
"@shockpkg/icon-encoder": "2.1.3",
"axios": "0.26.1",
"axios": "1.7.7",
"classnames": "2.3.1",
"compare-versions": "6.1.0",
"crc": "4.3.2",
Expand Down
29 changes: 18 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions src/backend/online_monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import axios from 'axios'
import EventEmitter from 'node:events'
import { sendFrontendMessage } from './main_window'

//**********FORCE TO USE http adapter (node.js version):*****
axios.defaults.adapter = require('axios/lib/adapters/http.js')
//**********FORCE TO USE http adapter (node.js version):*****

let status: ConnectivityStatus
let abortController: AbortController
let retryTimer: NodeJS.Timeout
Expand Down
8 changes: 4 additions & 4 deletions src/backend/storeManagers/gog/library.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sendFrontendMessage } from '../../main_window'
import axios, { AxiosError, AxiosRequestHeaders, AxiosResponse } from 'axios'
import axios, { AxiosError, AxiosResponse } from 'axios'
import { GOGUser } from './user'
import {
GameInfo,
Expand Down Expand Up @@ -854,7 +854,7 @@ export async function getBuilds(
url.searchParams.set('password', password)
}

const headers: AxiosRequestHeaders = {}
const headers: Record<string, string> = {}
if (access_token) {
headers.Authorization = `Bearer ${access_token}`
}
Expand Down Expand Up @@ -1206,7 +1206,7 @@ export async function getGamesdbData(
logError(
[
`Was not able to get GamesDB data for ${game_id}`,
error.response?.data.error_description
error.response?.data
],
LogPrefix.ExtraGameInfo
)
Expand Down Expand Up @@ -1250,7 +1250,7 @@ export async function getProductApi(
url.searchParams.set('expand', expand.join(','))
}

const headers: AxiosRequestHeaders = {}
const headers: Record<string, string> = {}
if (accessToken) {
headers.Authorization = `Bearer ${accessToken}`
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/wiki_game_info/protondb/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getInfoFromProtonDB(
logError(
[
`Was not able to get ProtonDB data for ${steamID}`,
error.response?.data.error_description
error.response?.data
],
LogPrefix.ExtraGameInfo
)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/wiki_game_info/steamdeck/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function getSteamDeckComp(
logError(
[
`Was not able to get Stem Deck data for ${steamID}`,
error.response?.data.error_description
error.response?.data
],
LogPrefix.ExtraGameInfo
)
Expand Down

0 comments on commit c76365e

Please sign in to comment.