Skip to content

Commit

Permalink
Bump axios from 1.5.0 to 1.6.0 (#2435)
Browse files Browse the repository at this point in the history
* Bump axios from 1.5.0 to 1.6.0

Bumps [axios](https://github.com/axios/axios) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Solving problems with types

* Solving lint errors

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Montse Ortega <[email protected]>
  • Loading branch information
dependabot[bot] and ammont82 authored Nov 21, 2023
1 parent d4f82f2 commit 75f7b73
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 17 deletions.
2 changes: 1 addition & 1 deletion apps/assisted-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@patternfly/react-tokens": "^4.94.3",
"@reduxjs/toolkit": "^1.9.1",
"@sentry/browser": "^5.9 || ^6",
"axios": ">=0.22.0 <1.0.0",
"axios": ">=0.22.0 <2.0.0",
"i18next": "^20.4.0",
"i18next-browser-languagedetector": "^6.1.2",
"lodash": "^4",
Expand Down
2 changes: 1 addition & 1 deletion libs/sdks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
},
"dependencies": {
"axios": "^1.5.0"
"axios": "^1.6.0"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Cluster } from '@openshift-assisted/types/assisted-installer-service';
import { isInOcm } from '../../api/axiosClient';
import { getApiErrorMessage, handleApiError } from '../../api/utils';
import ClustersAPI from '../../api/assisted-service/ClustersAPI';
import { AxiosResponseHeaders } from 'axios';
import { AxiosHeaderValue, AxiosHeaders, AxiosResponseHeaders } from 'axios';
import { useTranslation } from '../../hooks/use-translation-wrapper';
import { TFunction } from 'i18next';

Expand All @@ -22,10 +22,20 @@ type KubeconfigDownloadProps = {
const getKubeconfigFileName = (
headers:
| AxiosResponseHeaders
| Partial<Record<string, string> & { 'set-cookie'?: string[] | undefined }>,
| Partial<Record<string, string> & { 'set-cookie'?: string[] | undefined }>
| Partial<
AxiosHeaders & {
Server: AxiosHeaderValue;
'Content-Type': AxiosHeaderValue;
'Content-Length': AxiosHeaderValue;
'Cache-Control': AxiosHeaderValue;
'Content-Encoding': AxiosHeaderValue;
}
>,
) => {
const fileNameMatch =
headers['content-disposition'] && headers['content-disposition'].match(/filename=".*"/);
(headers['content-disposition'] as string) &&
(headers['content-disposition'] as string).match(/filename=".*"/);
return fileNameMatch ? fileNameMatch[0].slice(10, -1) : 'kubeconfig';
};

Expand Down
16 changes: 14 additions & 2 deletions libs/ui-lib/lib/ocm/components/fetching/fetchEvents.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import { AxiosError, AxiosResponseHeaders } from 'axios';
import { AxiosError, AxiosHeaderValue, AxiosHeaders, AxiosResponseHeaders } from 'axios';
import { EVENT_SEVERITIES, EventListFetchProps } from '../../../common';
import { handleApiError } from '../../../common/api';
import { EventsAPI } from '../../services/apis';
import { SeverityCountsType } from '../../../common/components/ui/ClusterEventsToolbar';
import { Event } from '@openshift-assisted/types/assisted-installer-service';
const parseHeaders = (headers: AxiosResponseHeaders) => {
const parseHeaders = (
headers:
| AxiosResponseHeaders
| Partial<
AxiosHeaders & {
Server: AxiosHeaderValue;
'Content-Type': AxiosHeaderValue;
'Content-Length': AxiosHeaderValue;
'Cache-Control': AxiosHeaderValue;
'Content-Encoding': AxiosHeaderValue;
}
>,
) => {
const severities: Record<Event['severity'], number> = {
error: 0,
info: 0,
Expand Down
12 changes: 9 additions & 3 deletions libs/ui-lib/lib/ocm/services/ClustersService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ const ClustersService = {
await ClustersAPI.deregister(clusterId);
},

async downloadLogs(clusterId: Cluster['id'], hostId?: Host['id']) {
async downloadLogs(
clusterId: Cluster['id'],
hostId?: Host['id'],
): Promise<{
data: Blob;
fileName: string | undefined;
}> {
const { data, headers } = await ClustersAPI.downloadLogs(clusterId, hostId);
const contentHeader = headers['content-disposition'];
const fileName = contentHeader?.match(/filename="(.+)"/)?.[1];
const contentHeader: string | undefined = headers['content-disposition'] as string | undefined;
const fileName: string | undefined = contentHeader?.match(/filename="(.+)"/)?.[1];
return { data, fileName };
},

Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ __metadata:
"@types/react-dom": <17.0.30
"@types/react-router-dom": ^5.3.3
"@vitejs/plugin-react-swc": ^3.0.1
axios: ">=0.22.0 <1.0.0"
axios: ">=0.22.0 <2.0.0"
i18next: ^20.4.0
i18next-browser-languagedetector: ^6.1.2
lodash: ^4
Expand Down Expand Up @@ -780,7 +780,7 @@ __metadata:
resolution: "@openshift-assisted/sdks@workspace:libs/sdks"
dependencies:
"@openapitools/openapi-generator-cli": ^2.7.0
axios: ^1.5.0
axios: ^1.6.0
typescript: ^5.2.2
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -2324,7 +2324,7 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:0.27.2, axios@npm:>=0.22.0 <1.0.0, axios@npm:^0.27.2":
"axios@npm:0.27.2, axios@npm:^0.27.2":
version: 0.27.2
resolution: "axios@npm:0.27.2"
dependencies:
Expand All @@ -2334,14 +2334,14 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^1.5.0":
version: 1.5.0
resolution: "axios@npm:1.5.0"
"axios@npm:>=0.22.0 <2.0.0, axios@npm:^1.6.0":
version: 1.6.1
resolution: "axios@npm:1.6.1"
dependencies:
follow-redirects: ^1.15.0
form-data: ^4.0.0
proxy-from-env: ^1.1.0
checksum: e7405a5dbbea97760d0e6cd58fecba311b0401ddb4a8efbc4108f5537da9b3f278bde566deb777935a960beec4fa18e7b8353881f2f465e4f2c0e949fead35be
checksum: 573f03f59b7487d54551b16f5e155d1d130ad4864ed32d1da93d522b78a57123b34e3bde37f822a65ee297e79f1db840f9ad6514addff50d3cbf5caeed39e8dc
languageName: node
linkType: hard

Expand Down

0 comments on commit 75f7b73

Please sign in to comment.