Skip to content

[LW-10266] Upgrade Axios version to 0.28.0 #1207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cardano-services-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"dependencies": {
"@cardano-sdk/core": "workspace:~",
"@cardano-sdk/util": "workspace:~",
"axios": "^0.27.2",
"axios": "^0.28.0",
"class-validator": "^0.14.0",
"json-bigint": "~1.0.0",
"ts-log": "^2.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/cardano-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@cardano-sdk/util": "workspace:~",
"@cardano-sdk/util-rxjs": "workspace:~",
"@hapi/topo": "^6.0.2",
"axios": "^0.27.2",
"axios": "^0.28.0",
"backoff-rxjs": "^7.0.0",
"bignumber.js": "^9.1.0",
"body-parser": "^1.19.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ describe('CardanoTokenRegistry', () => {
it('internal server error', async () => {
const failedMetadata = null;
const succeededMetadata = { assetId: validAssetId, name: 'test' };
const innerError = 'AxiosError: Request failed with status code 500';

let alreadyCalled = false;
const record = async () => {
Expand All @@ -204,14 +205,15 @@ describe('CardanoTokenRegistry', () => {
await expect(tokenRegistry.getTokenMetadata([invalidAssetId, validAssetId])).rejects.toThrow(
new ProviderError(
ProviderFailure.Unhealthy,
null,
innerError,
'CardanoTokenRegistry failed to fetch asset metadata from the token registry server due to: Request failed with status code 500'
)
);
});

it('timeout server error', async () => {
const exceededTimeout = defaultTimeout + 1000;
const innerError = `AxiosError: timeout of ${defaultTimeout}ms exceeded`;
const record = async () => {
await sleep(exceededTimeout);

Expand All @@ -231,7 +233,7 @@ describe('CardanoTokenRegistry', () => {
await expect(tokenRegistry.getTokenMetadata([validAssetId])).rejects.toThrow(
new ProviderError(
ProviderFailure.Unhealthy,
null,
innerError,
`CardanoTokenRegistry failed to fetch asset metadata from the token registry server due to: timeout of ${defaultTimeout}ms exceeded`
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ describe('HandleHttpService', () => {

const { message, response } = error;

if (!response) return { message, statusText: error.status };
if (!response)
return {
message,
statusText: `${typeof error.status === 'string' ? error.status : JSON.stringify(error.status)}`
};

const { data, status, statusText } = response;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ describe('StakePoolMetadataService', () => {
await closeMock();
});

const innerError500 = 'AxiosError: Request failed with status code 500';
const innerError404 = 'AxiosError: Request failed with status code 404';

describe('getStakePoolMetadata', () => {
it('fetch stake pool JSON metadata without extended data', async () => {
({ closeMock, serverUrl } = await mockPoolExtMetadataServer(async () => ({
Expand Down Expand Up @@ -116,7 +119,7 @@ describe('StakePoolMetadataService', () => {
expect(result).toEqual(
new StakePoolMetadataServiceError(
StakePoolMetadataServiceFailure.FailedToFetchMetadata,
null,
innerError500,
`StakePoolMetadataService failed to fetch metadata JSON from ${serverUrl} due to Request failed with status code 500`
)
);
Expand Down Expand Up @@ -205,7 +208,7 @@ describe('StakePoolMetadataService', () => {
expect(result).toEqual(
new StakePoolMetadataServiceError(
StakePoolMetadataServiceFailure.FailedToFetchExtendedSignature,
null,
innerError404,
`StakePoolMetadataService failed to fetch extended signature from ${metadata.extSigUrl} due to connection error`
)
);
Expand Down Expand Up @@ -372,7 +375,7 @@ describe('StakePoolMetadataService', () => {
await expect(metadataService.getStakePoolExtendedMetadata(extMetadata)).rejects.toThrow(
new StakePoolMetadataServiceError(
StakePoolMetadataServiceFailure.FailedToFetchExtendedMetadata,
null,
innerError500,
`StakePoolMetadataService failed to fetch extended metadata from ${serverUrl}/${ExtMetadataFormat.CIP6} due to connection error`
)
);
Expand Down Expand Up @@ -402,7 +405,7 @@ describe('StakePoolMetadataService', () => {
await expect(metadataService.getStakePoolExtendedMetadata(extMetadata)).rejects.toThrow(
new StakePoolMetadataServiceError(
StakePoolMetadataServiceFailure.FailedToFetchExtendedMetadata,
null,
innerError404,
`StakePoolMetadataService failed to fetch extended metadata from ${serverUrl}/${ExtMetadataFormat.CIP6} due to resource not found`
)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"@cardano-sdk/wallet": "workspace:~",
"@dcspark/cardano-multiplatform-lib-nodejs": "^3.1.1",
"@vespaiach/axios-fetch-adapter": "^0.3.0",
"axios": "^0.27.2",
"axios": "^0.28.0",
"bunyan": "^1.8.15",
"chalk": "4.1.2",
"cli-spinners": "^2.9.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/util-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@cardano-sdk/key-management": "workspace:~",
"@cardano-sdk/util": "workspace:~",
"@types/dockerode": "^3.3.8",
"axios": "^0.27.2",
"axios": "^0.28.0",
"delay": "^5.0.0",
"dockerode": "^3.3.1",
"dockerode-utils": "^0.0.7",
Expand Down
1 change: 1 addition & 0 deletions yarn-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ cacheEntries = {
"axios-mock-adapter@npm:1.21.2" = { filename = "axios-mock-adapter-npm-1.21.2-67858a7fb9-0d334838a8.zip"; sha512 = "0d334838a819597f49fd5bf807e2a46cd846397cbea734fd53dcb425dee914e2d3e57cff65eb36af70cdbba848416c48979b75223afbfc1ab49789fd12011618"; };
"axios@npm:0.25.0" = { filename = "axios-npm-0.25.0-a1c287d287-2a8a3787c0.zip"; sha512 = "2a8a3787c05f2a0c9c3878f49782357e2a9f38945b93018fb0c4fd788171c43dceefbb577988628e09fea53952744d1ecebde234b561f1e703aa43e0a598a3ad"; };
"axios@npm:0.27.2" = { filename = "axios-npm-0.27.2-dbe3a48aea-38cb754046.zip"; sha512 = "38cb7540465fe8c4102850c4368053c21683af85c5fdf0ea619f9628abbcb59415d1e22ebc8a6390d2bbc9b58a9806c874f139767389c862ec9b772235f06854"; };
"axios@npm:0.28.1" = { filename = "axios-npm-0.28.1-84ca28650b-5115a38d79.zip"; sha512 = "5115a38d79064d07437c5a28f15841e3607634040e3120ec06a2c4367a7d07cf213b16496eab53b6f58ebc5fb377a440ba9ed4782529b14449a1e285734bfb54"; };
"axios@npm:1.6.2" = { filename = "axios-npm-1.6.2-2334cb6eee-4a7429e2b7.zip"; sha512 = "4a7429e2b784be0f2902ca2680964391eae7236faa3967715f30ea45464b98ae3f1c6f631303b13dfe721b17126b01f486c7644b9ef276bfc63112db9fd379f8"; };
"b4a@npm:1.6.1" = { filename = "b4a-npm-1.6.1-11ac2fd316-9d085922d4.zip"; sha512 = "9d085922d4a6bcaac69e68520681cd60da0e2dca8ea80a89cd27a3a3037058d4669a2904aa9925c7f567d84f62f64beafaf0c831771bd4eb86ca5ecbbca402d8"; };
"babel-eslint@npm:10.0.3" = { filename = "babel-eslint-npm-10.0.3-ba50cae6ec-d3bf355c20.zip"; sha512 = "d3bf355c20d1a2f0667ace6c43263eecb0d09342a833129c67cc9f554a5dbc335bd6a73cbd3001ee6074570ca2184366ddff6c58afccf8fd55e249c02ff54288"; };
Expand Down
21 changes: 16 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3108,7 +3108,7 @@ __metadata:
"@cardano-sdk/util-dev": "workspace:~"
"@koralabs/handles-public-api-interfaces": 2.4.3
"@types/validator": ^13.7.1
axios: ^0.27.2
axios: ^0.28.0
axios-mock-adapter: ^1.20.0
class-validator: ^0.14.0
eslint: ^7.32.0
Expand Down Expand Up @@ -3149,7 +3149,7 @@ __metadata:
"@types/lodash": ^4.14.182
"@types/pg": ^8.6.5
"@types/wait-on": ^5.3.1
axios: ^0.27.2
axios: ^0.28.0
axios-mock-adapter: ^1.20.0
backoff-rxjs: ^7.0.0
bignumber.js: ^9.1.0
Expand Down Expand Up @@ -3341,7 +3341,7 @@ __metadata:
"@wdio/spec-reporter": ^7.19.5
"@wdio/static-server-service": ^7.19.5
artillery: ^2.0.0-35
axios: ^0.27.2
axios: ^0.28.0
babel-loader: ^8.2.5
blake2b-no-wasm: 2.1.4
buffer: ^6.0.3
Expand Down Expand Up @@ -3670,7 +3670,7 @@ __metadata:
"@cardano-sdk/util": "workspace:~"
"@types/dockerode": ^3.3.8
"@types/jest": ^26.0.24
axios: ^0.27.2
axios: ^0.28.0
delay: ^5.0.0
dockerode: ^3.3.1
dockerode-utils: ^0.0.7
Expand Down Expand Up @@ -9097,7 +9097,7 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.27.0, axios@npm:^0.27.2":
"axios@npm:^0.27.0":
version: 0.27.2
resolution: "axios@npm:0.27.2"
dependencies:
Expand All @@ -9107,6 +9107,17 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^0.28.0":
version: 0.28.1
resolution: "axios@npm:0.28.1"
dependencies:
follow-redirects: ^1.15.0
form-data: ^4.0.0
proxy-from-env: ^1.1.0
checksum: 5115a38d79064d07437c5a28f15841e3607634040e3120ec06a2c4367a7d07cf213b16496eab53b6f58ebc5fb377a440ba9ed4782529b14449a1e285734bfb54
languageName: node
linkType: hard

"axios@npm:^1.6.0":
version: 1.6.2
resolution: "axios@npm:1.6.2"
Expand Down
Loading