Skip to content
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
23,164 changes: 0 additions & 23,164 deletions .pnp.cjs

This file was deleted.

2,126 changes: 0 additions & 2,126 deletions .pnp.loader.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ compressionLevel: mixed

enableGlobalCache: false

nodeLinker: pnp
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.10.3.cjs

Expand Down
3 changes: 1 addition & 2 deletions packages/commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@types/parse-path": "^7.0.3",
"axios": "^1.12.2",
"axios": "^1.13.5",
"parse-path": "^7.1.0",
"path-to-regexp": "^8.3.0",
"type-fest": "^4.30.0"
Expand All @@ -52,7 +52,6 @@
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"axios": "^1.12.2",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-json": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/commons/src/core/ApiClientBase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ test("test request will be resolved even when status check fails", async () => {
await expect(response).resolves.toHaveProperty("data.fail", 1);

// check interceptor call
expect(success).toBeCalledTimes(0);
expect(fail).toBeCalledWith("500");
expect(success).toBeCalledWith("500");
expect(fail).not.toHaveBeenCalled();
});

test("test request will rejects on network error", async () => {
Expand Down
13 changes: 13 additions & 0 deletions packages/commons/src/core/Request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ export class Request<TOp extends OpenAPIOperation> {
return response as unknown as ResponsePromise<TOp>;
} catch (e) {
const error = AxiosError.from(e);
/**
* Since Axios 1.13.3 the error object does not contain the response
* anymore, even if the error is an HTTP error. To maintain the previous
* behavior of returning the response even for HTTP errors, the
* validateStatus option is set to always return true, which means that
* HTTP errors will not throw an error.
*/
if (error.isAxiosError && error.response) {
return error.response as unknown as ResponsePromise<TOp>;
}
Expand Down Expand Up @@ -76,6 +83,12 @@ export class Request<TOp extends OpenAPIOperation> {
// Must be a plain object or an URLSearchParams object
params,
data,
/**
* The API client is designed to return all responses, regardless of the
* status code. This allows the caller to handle error responses as
* needed.
*/
validateStatus: () => true,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/prettier": "^3.0.0",
"@types/verror": "^1.10.11",
"@types/yieldable-json": "^2.0.2",
"axios": "^1.12.2",
"axios": "^1.13.5",
"camelcase": "^8.0.0",
"clone-deep": "^4.0.1",
"dot-prop": "^8.0.2",
Expand Down
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ __metadata:
"@types/parse-path": "npm:^7.0.3"
"@typescript-eslint/eslint-plugin": "npm:^7.18.0"
"@typescript-eslint/parser": "npm:^7.18.0"
axios: "npm:^1.12.2"
axios: "npm:^1.13.5"
eslint: "npm:^8.57.1"
eslint-config-prettier: "npm:^9.1.2"
eslint-plugin-json: "npm:^3.1.0"
Expand Down Expand Up @@ -1752,7 +1752,7 @@ __metadata:
"@types/yieldable-json": "npm:^2.0.2"
"@typescript-eslint/eslint-plugin": "npm:^7.18.0"
"@typescript-eslint/parser": "npm:^7.18.0"
axios: "npm:^1.12.2"
axios: "npm:^1.13.5"
camelcase: "npm:^8.0.0"
clone-deep: "npm:^4.0.1"
dot-prop: "npm:^8.0.2"
Expand Down Expand Up @@ -4140,14 +4140,14 @@ __metadata:
languageName: node
linkType: hard

"axios@npm:^1.12.0, axios@npm:^1.12.2":
version: 1.12.2
resolution: "axios@npm:1.12.2"
"axios@npm:^1.12.0, axios@npm:^1.13.5":
version: 1.13.5
resolution: "axios@npm:1.13.5"
dependencies:
follow-redirects: "npm:^1.15.6"
form-data: "npm:^4.0.4"
follow-redirects: "npm:^1.15.11"
form-data: "npm:^4.0.5"
proxy-from-env: "npm:^1.1.0"
checksum: 10/886a79770594eaad76493fecf90344b567bd956240609b5dcd09bd0afe8d3e6f1ad6d3257a93a483b6192b409d4b673d9515a34619e3e3ed1b2c0ec2a83b20ba
checksum: 10/db726d09902565ef9a0632893530028310e2ec2b95b727114eca1b101450b00014133dfc3871cffc87983fb922bca7e4874d7e2826d1550a377a157cdf3f05b6
languageName: node
linkType: hard

Expand Down Expand Up @@ -6265,13 +6265,13 @@ __metadata:
languageName: node
linkType: hard

"follow-redirects@npm:^1.15.6":
version: 1.15.6
resolution: "follow-redirects@npm:1.15.6"
"follow-redirects@npm:^1.15.11":
version: 1.15.11
resolution: "follow-redirects@npm:1.15.11"
peerDependenciesMeta:
debug:
optional: true
checksum: 10/70c7612c4cab18e546e36b991bbf8009a1a41cf85354afe04b113d1117569abf760269409cb3eb842d9f7b03d62826687086b081c566ea7b1e6613cf29030bf7
checksum: 10/07372fd74b98c78cf4d417d68d41fdaa0be4dcacafffb9e67b1e3cf090bc4771515e65020651528faab238f10f9b9c0d9707d6c1574a6c0387c5de1042cde9ba
languageName: node
linkType: hard

Expand Down Expand Up @@ -6306,16 +6306,16 @@ __metadata:
languageName: node
linkType: hard

"form-data@npm:^4.0.4":
version: 4.0.4
resolution: "form-data@npm:4.0.4"
"form-data@npm:^4.0.5":
version: 4.0.5
resolution: "form-data@npm:4.0.5"
dependencies:
asynckit: "npm:^0.4.0"
combined-stream: "npm:^1.0.8"
es-set-tostringtag: "npm:^2.1.0"
hasown: "npm:^2.0.2"
mime-types: "npm:^2.1.12"
checksum: 10/a4b62e21932f48702bc468cc26fb276d186e6b07b557e3dd7cc455872bdbb82db7db066844a64ad3cf40eaf3a753c830538183570462d3649fdfd705601cbcfb
checksum: 10/52ecd6e927c8c4e215e68a7ad5e0f7c1031397439672fd9741654b4a94722c4182e74cc815b225dcb5be3f4180f36428f67c6dd39eaa98af0dcfdd26c00c19cd
languageName: node
linkType: hard

Expand Down