Skip to content

Commit a547908

Browse files
chore: Update the axios dependencies (#252)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent cbf55a0 commit a547908

File tree

6 files changed

+48
-47
lines changed

6 files changed

+48
-47
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
v16
1+
v18
22
@doist:registry=https://npm.pkg.github.com/

package-lock.json

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

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"prepare": "npm run build"
2525
},
2626
"dependencies": {
27-
"axios": "^0.27.0",
28-
"axios-case-converter": "^0.11.0",
27+
"axios": "^1.0.0",
28+
"axios-case-converter": "^1.0.0",
2929
"axios-retry": "^3.1.9",
3030
"runtypes": "^6.5.0",
3131
"ts-custom-error": "^3.2.0",
@@ -34,7 +34,6 @@
3434
"devDependencies": {
3535
"@doist/eslint-config": "8.1.3",
3636
"@doist/prettier-config": "3.0.5",
37-
"@types/axios": "0.14.0",
3837
"@types/jest": "29.4.0",
3938
"@types/uuid": "8.3.4",
4039
"@typescript-eslint/eslint-plugin": "5.54.1",

src/restClient.axios.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ describe('axios tests without mocking', () => {
1111
params: {
1212
ids: ['12345', '56789'],
1313
},
14-
paramsSerializer,
14+
paramsSerializer: {
15+
serialize: paramsSerializer,
16+
},
1517
})
1618
expect(requestUri).toEqual('https://api.todoist.com/rest/v2/tasks?ids=12345%2C56789')
1719
})

src/restClient.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-named-as-default
12
import Axios, { AxiosStatic, AxiosResponse, AxiosError } from 'axios'
23
import { request, isSuccess, paramsSerializer } from './restClient'
34
import { TodoistRequestError } from './types/errors'
@@ -120,7 +121,9 @@ describe('restClient', () => {
120121
expect(axiosMock.get).toBeCalledTimes(1)
121122
expect(axiosMock.get).toBeCalledWith(DEFAULT_ENDPOINT, {
122123
params: undefined,
123-
paramsSerializer,
124+
paramsSerializer: {
125+
serialize: paramsSerializer,
126+
},
124127
})
125128
})
126129

@@ -136,7 +139,9 @@ describe('restClient', () => {
136139
expect(axiosMock.get).toBeCalledTimes(1)
137140
expect(axiosMock.get).toBeCalledWith(DEFAULT_ENDPOINT, {
138141
params: DEFAULT_PAYLOAD,
139-
paramsSerializer,
142+
paramsSerializer: {
143+
serialize: paramsSerializer,
144+
},
140145
})
141146
})
142147

src/restClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-named-as-default
12
import Axios, { AxiosResponse, AxiosError } from 'axios'
23
import applyCaseMiddleware from 'axios-case-converter'
34
import { TodoistRequestError } from './types/errors'
@@ -105,7 +106,9 @@ export async function request<T>(
105106
case 'GET':
106107
return await axiosClient.get<T>(relativePath, {
107108
params: payload,
108-
paramsSerializer,
109+
paramsSerializer: {
110+
serialize: paramsSerializer,
111+
},
109112
})
110113
case 'POST':
111114
return await axiosClient.post<T>(relativePath, payload)

0 commit comments

Comments
 (0)