axigen 1.2.2 → 1.2.4
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/README.md +4 -3
- package/dist/cli/index.mjs +11 -6
- package/dist/index.js +10 -6
- package/dist/index.mjs +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ module.exports = {
|
|
|
53
53
|
|
|
54
54
|
// Import path to your Axios instance inside your project
|
|
55
55
|
axiosInstancePath: "../lib/axios",
|
|
56
|
+
axiosInstanceExport: "axiosInstance",
|
|
56
57
|
|
|
57
58
|
language: "ts",
|
|
58
59
|
jsdoc: true,
|
|
@@ -132,7 +133,7 @@ axigen generates:
|
|
|
132
133
|
|
|
133
134
|
```ts
|
|
134
135
|
// This file is auto-generated by axigen. DO NOT EDIT.
|
|
135
|
-
// Generated at: 2026-06-
|
|
136
|
+
// Generated at: 2026-06-26T11:56:19.002Z
|
|
136
137
|
|
|
137
138
|
import type { AxiosRequestConfig, AxiosResponse } from "axios";
|
|
138
139
|
import { axiosInstance } from "../lib/axios";
|
|
@@ -143,7 +144,7 @@ import type { GetUserByIdPathParams, GetUserByIdResponse, GetUsersQueryParams, G
|
|
|
143
144
|
* `GET /users`
|
|
144
145
|
* @tags users
|
|
145
146
|
*/
|
|
146
|
-
export async function
|
|
147
|
+
export async function getGetUsers(
|
|
147
148
|
params?: GetUsersQueryParams,
|
|
148
149
|
config?: AxiosRequestConfig,
|
|
149
150
|
options?: AxiosRequestConfig,
|
|
@@ -157,7 +158,7 @@ export async function getUsersGet(
|
|
|
157
158
|
* `GET /users/{userId}`
|
|
158
159
|
* @tags users
|
|
159
160
|
*/
|
|
160
|
-
export async function
|
|
161
|
+
export async function getGetUserById(
|
|
161
162
|
userId: GetUserByIdPathParams["userId"],
|
|
162
163
|
config?: AxiosRequestConfig,
|
|
163
164
|
options?: AxiosRequestConfig,
|
package/dist/cli/index.mjs
CHANGED
|
@@ -208,14 +208,17 @@ function normalizeParam(p) {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
function buildOperationId(method, urlPath) {
|
|
211
|
-
const parts = urlPath.split("/").filter(Boolean).
|
|
211
|
+
const parts = urlPath.split("/").filter(Boolean).flatMap((segment) => {
|
|
212
212
|
if (segment.startsWith("{") && segment.endsWith("}")) {
|
|
213
213
|
const name = segment.slice(1, -1);
|
|
214
|
-
return "By"
|
|
214
|
+
return ["By", ...splitSegment(name)];
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return splitSegment(segment);
|
|
217
217
|
});
|
|
218
|
-
return
|
|
218
|
+
return parts.map(capitalize).join("");
|
|
219
|
+
}
|
|
220
|
+
function splitSegment(segment) {
|
|
221
|
+
return segment.split(/[-_]/);
|
|
219
222
|
}
|
|
220
223
|
function capitalize(s) {
|
|
221
224
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
@@ -374,8 +377,9 @@ function resolveFunctionName(operationId, method, config) {
|
|
|
374
377
|
}
|
|
375
378
|
}
|
|
376
379
|
if (shouldAppendMethod(method, config.appendMethod)) {
|
|
377
|
-
|
|
378
|
-
|
|
380
|
+
name = method.toLowerCase() + name.charAt(0).toUpperCase() + name.slice(1);
|
|
381
|
+
} else {
|
|
382
|
+
name = name.charAt(0).toLowerCase() + name.slice(1);
|
|
379
383
|
}
|
|
380
384
|
return name;
|
|
381
385
|
}
|
|
@@ -621,6 +625,7 @@ module.exports = {
|
|
|
621
625
|
types: './src/api/types.ts',
|
|
622
626
|
},
|
|
623
627
|
axiosInstancePath: '../lib/axios',
|
|
628
|
+
axiosInstanceExport: "axiosInstance",
|
|
624
629
|
language: 'ts',
|
|
625
630
|
jsdoc: true,
|
|
626
631
|
functionName: {
|
package/dist/index.js
CHANGED
|
@@ -134,14 +134,17 @@ function normalizeParam(p) {
|
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
136
|
function buildOperationId(method, urlPath) {
|
|
137
|
-
const parts = urlPath.split("/").filter(Boolean).
|
|
137
|
+
const parts = urlPath.split("/").filter(Boolean).flatMap((segment) => {
|
|
138
138
|
if (segment.startsWith("{") && segment.endsWith("}")) {
|
|
139
139
|
const name = segment.slice(1, -1);
|
|
140
|
-
return "By"
|
|
140
|
+
return ["By", ...splitSegment(name)];
|
|
141
141
|
}
|
|
142
|
-
return
|
|
142
|
+
return splitSegment(segment);
|
|
143
143
|
});
|
|
144
|
-
return
|
|
144
|
+
return parts.map(capitalize).join("");
|
|
145
|
+
}
|
|
146
|
+
function splitSegment(segment) {
|
|
147
|
+
return segment.split(/[-_]/);
|
|
145
148
|
}
|
|
146
149
|
function capitalize(s) {
|
|
147
150
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
@@ -300,8 +303,9 @@ function resolveFunctionName(operationId, method, config) {
|
|
|
300
303
|
}
|
|
301
304
|
}
|
|
302
305
|
if (shouldAppendMethod(method, config.appendMethod)) {
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
name = method.toLowerCase() + name.charAt(0).toUpperCase() + name.slice(1);
|
|
307
|
+
} else {
|
|
308
|
+
name = name.charAt(0).toLowerCase() + name.slice(1);
|
|
305
309
|
}
|
|
306
310
|
return name;
|
|
307
311
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -93,14 +93,17 @@ function normalizeParam(p) {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
function buildOperationId(method, urlPath) {
|
|
96
|
-
const parts = urlPath.split("/").filter(Boolean).
|
|
96
|
+
const parts = urlPath.split("/").filter(Boolean).flatMap((segment) => {
|
|
97
97
|
if (segment.startsWith("{") && segment.endsWith("}")) {
|
|
98
98
|
const name = segment.slice(1, -1);
|
|
99
|
-
return "By"
|
|
99
|
+
return ["By", ...splitSegment(name)];
|
|
100
100
|
}
|
|
101
|
-
return
|
|
101
|
+
return splitSegment(segment);
|
|
102
102
|
});
|
|
103
|
-
return
|
|
103
|
+
return parts.map(capitalize).join("");
|
|
104
|
+
}
|
|
105
|
+
function splitSegment(segment) {
|
|
106
|
+
return segment.split(/[-_]/);
|
|
104
107
|
}
|
|
105
108
|
function capitalize(s) {
|
|
106
109
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
@@ -259,8 +262,9 @@ function resolveFunctionName(operationId, method, config) {
|
|
|
259
262
|
}
|
|
260
263
|
}
|
|
261
264
|
if (shouldAppendMethod(method, config.appendMethod)) {
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
name = method.toLowerCase() + name.charAt(0).toUpperCase() + name.slice(1);
|
|
266
|
+
} else {
|
|
267
|
+
name = name.charAt(0).toLowerCase() + name.slice(1);
|
|
264
268
|
}
|
|
265
269
|
return name;
|
|
266
270
|
}
|