@rexeus/typeweaver-clients 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/ApiClient.ts +3 -5
- package/package.json +6 -6
package/dist/lib/ApiClient.ts
CHANGED
|
@@ -70,8 +70,6 @@ export abstract class ApiClient {
|
|
|
70
70
|
"Base URL must be provided either in axios instance or in constructor"
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
this.axiosInstance.defaults.baseURL = undefined;
|
|
74
|
-
|
|
75
73
|
this.unknownResponseHandling = props.unknownResponseHandling ?? "throw";
|
|
76
74
|
this.isSuccessStatusCode =
|
|
77
75
|
props.isSuccessStatusCode ??
|
|
@@ -119,6 +117,7 @@ export abstract class ApiClient {
|
|
|
119
117
|
url,
|
|
120
118
|
data: body,
|
|
121
119
|
headers,
|
|
120
|
+
baseURL: this.baseUrl,
|
|
122
121
|
});
|
|
123
122
|
|
|
124
123
|
return this.createResponse(response);
|
|
@@ -183,12 +182,11 @@ export abstract class ApiClient {
|
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
private createUrl(path: string, query?: IHttpQuery): string {
|
|
186
|
-
const base = this.baseUrl.replace(/\/+$/, "");
|
|
187
185
|
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
188
186
|
const queryString = this.buildQueryString(query);
|
|
189
187
|
return queryString
|
|
190
|
-
? `${
|
|
191
|
-
:
|
|
188
|
+
? `${normalizedPath}?${queryString}`
|
|
189
|
+
: normalizedPath;
|
|
192
190
|
}
|
|
193
191
|
|
|
194
192
|
private buildQueryString(query?: IHttpQuery): string {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexeus/typeweaver-clients",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Generates HTTP clients directly from your API definitions. Powered by Typeweaver 🧵✨",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"axios": "^1.13.0",
|
|
51
51
|
"zod": "^4.3.0",
|
|
52
|
-
"@rexeus/typeweaver-core": "^0.4.
|
|
53
|
-
"@rexeus/typeweaver-gen": "^0.4.
|
|
52
|
+
"@rexeus/typeweaver-core": "^0.4.2",
|
|
53
|
+
"@rexeus/typeweaver-gen": "^0.4.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@hono/node-server": "^1.19.7",
|
|
57
57
|
"axios": "^1.13.2",
|
|
58
58
|
"test-utils": "file:../test-utils",
|
|
59
59
|
"zod": "^4.3.6",
|
|
60
|
-
"@rexeus/typeweaver-core": "^0.4.
|
|
61
|
-
"@rexeus/typeweaver-gen": "^0.4.
|
|
60
|
+
"@rexeus/typeweaver-core": "^0.4.2",
|
|
61
|
+
"@rexeus/typeweaver-gen": "^0.4.2"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"case": "^1.6.3",
|
|
65
|
-
"@rexeus/typeweaver-zod-to-ts": "^0.4.
|
|
65
|
+
"@rexeus/typeweaver-zod-to-ts": "^0.4.2"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"typecheck": "tsc --noEmit",
|