axigen 1.1.0 → 1.2.0
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 +50 -43
- package/dist/cli/index.mjs +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,10 @@ module.exports = {
|
|
|
56
56
|
|
|
57
57
|
language: "ts",
|
|
58
58
|
jsdoc: true,
|
|
59
|
+
functionName: {
|
|
60
|
+
transforms: [{ match: "-([a-zA-Z])", flags: "g", replacement: "upper:$1" }],
|
|
61
|
+
appendMethod: ["post", "put", "delete", "patch", "get", "head", "options"],
|
|
62
|
+
},
|
|
59
63
|
};
|
|
60
64
|
```
|
|
61
65
|
|
|
@@ -78,7 +82,8 @@ paths:
|
|
|
78
82
|
/users:
|
|
79
83
|
get:
|
|
80
84
|
operationId: getUsers
|
|
81
|
-
summary:
|
|
85
|
+
summary: Get user list
|
|
86
|
+
tags: [users]
|
|
82
87
|
parameters:
|
|
83
88
|
- name: page
|
|
84
89
|
in: query
|
|
@@ -88,74 +93,76 @@ paths:
|
|
|
88
93
|
in: query
|
|
89
94
|
schema:
|
|
90
95
|
type: integer
|
|
96
|
+
responses:
|
|
97
|
+
"200":
|
|
98
|
+
description: OK
|
|
99
|
+
content:
|
|
100
|
+
application/json:
|
|
101
|
+
schema:
|
|
102
|
+
type: object
|
|
103
|
+
properties:
|
|
104
|
+
data:
|
|
105
|
+
type: array
|
|
106
|
+
items:
|
|
107
|
+
$ref: "#/components/schemas/User"
|
|
108
|
+
total:
|
|
109
|
+
type: integer
|
|
91
110
|
|
|
92
111
|
/users/{userId}:
|
|
93
112
|
get:
|
|
94
113
|
operationId: getUserById
|
|
95
|
-
summary: Get
|
|
96
|
-
|
|
97
|
-
- name: userId
|
|
98
|
-
in: path
|
|
99
|
-
required: true
|
|
100
|
-
schema:
|
|
101
|
-
type: string
|
|
102
|
-
|
|
103
|
-
put:
|
|
104
|
-
operationId: updateUser
|
|
105
|
-
summary: Update a user
|
|
114
|
+
summary: Get user by ID
|
|
115
|
+
tags: [users]
|
|
106
116
|
parameters:
|
|
107
117
|
- name: userId
|
|
108
118
|
in: path
|
|
109
119
|
required: true
|
|
110
120
|
schema:
|
|
111
121
|
type: string
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
responses:
|
|
123
|
+
"200":
|
|
124
|
+
description: OK
|
|
125
|
+
content:
|
|
126
|
+
application/json:
|
|
127
|
+
schema:
|
|
128
|
+
$ref: "#/components/schemas/User"
|
|
118
129
|
```
|
|
119
130
|
|
|
120
131
|
axigen generates:
|
|
121
132
|
|
|
122
133
|
```ts
|
|
123
|
-
//
|
|
134
|
+
// This file is auto-generated by axigen. DO NOT EDIT.
|
|
135
|
+
// Generated at: 2026-06-25T18:37:24.080Z
|
|
124
136
|
|
|
125
|
-
import type { AxiosResponse } from "axios";
|
|
137
|
+
import type { AxiosRequestConfig, AxiosResponse } from "axios";
|
|
126
138
|
import { axiosInstance } from "../lib/axios";
|
|
127
|
-
import type {
|
|
128
|
-
GetUsersQueryParams,
|
|
129
|
-
GetUsersResponse,
|
|
130
|
-
GetUserByIdPathParams,
|
|
131
|
-
GetUserByIdResponse,
|
|
132
|
-
UpdateUserPathParams,
|
|
133
|
-
UpdateUserBody,
|
|
134
|
-
UpdateUserResponse,
|
|
135
|
-
} from "./types";
|
|
139
|
+
import type { GetUserByIdPathParams, GetUserByIdResponse, GetUsersQueryParams, GetUsersResponse } from "./types";
|
|
136
140
|
|
|
137
141
|
/**
|
|
138
|
-
*
|
|
142
|
+
* Get user list
|
|
139
143
|
* `GET /users`
|
|
144
|
+
* @tags users
|
|
140
145
|
*/
|
|
141
|
-
export async function
|
|
142
|
-
|
|
146
|
+
export async function getUsersGet(
|
|
147
|
+
params?: GetUsersQueryParams,
|
|
148
|
+
config?: AxiosRequestConfig,
|
|
149
|
+
options?: AxiosRequestConfig,
|
|
150
|
+
): Promise<AxiosResponse<GetUsersResponse>> {
|
|
151
|
+
const mergedConfig: AxiosRequestConfig = { ...config, params: { ...params, ...config?.params } };
|
|
152
|
+
return axiosInstance({ method: "GET", url: "/users", ...mergedConfig }, options);
|
|
143
153
|
}
|
|
144
154
|
|
|
145
155
|
/**
|
|
146
|
-
* Get
|
|
156
|
+
* Get user by ID
|
|
147
157
|
* `GET /users/{userId}`
|
|
158
|
+
* @tags users
|
|
148
159
|
*/
|
|
149
|
-
export async function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
* `PUT /users/{userId}`
|
|
156
|
-
*/
|
|
157
|
-
export async function updateUser(userId: UpdateUserPathParams["userId"], data: UpdateUserBody): Promise<AxiosResponse<UpdateUserResponse>> {
|
|
158
|
-
return axiosInstance.put(`/users/${userId}`, data);
|
|
160
|
+
export async function getUserByIdGet(
|
|
161
|
+
userId: GetUserByIdPathParams["userId"],
|
|
162
|
+
config?: AxiosRequestConfig,
|
|
163
|
+
options?: AxiosRequestConfig,
|
|
164
|
+
): Promise<AxiosResponse<GetUserByIdResponse>> {
|
|
165
|
+
return axiosInstance({ method: "GET", url: `/users/${userId}`, ...config }, options);
|
|
159
166
|
}
|
|
160
167
|
```
|
|
161
168
|
|
package/dist/cli/index.mjs
CHANGED
|
@@ -623,6 +623,10 @@ module.exports = {
|
|
|
623
623
|
axiosInstancePath: '../lib/axios',
|
|
624
624
|
language: 'ts',
|
|
625
625
|
jsdoc: true,
|
|
626
|
+
functionName: {
|
|
627
|
+
transforms: [{ match: "-([a-zA-Z])", flags: "g", replacement: "upper:$1" }],
|
|
628
|
+
appendMethod: ["post", "put", "delete", "patch", "get", "head", "options"],
|
|
629
|
+
},
|
|
626
630
|
}
|
|
627
631
|
`;
|
|
628
632
|
fs4.writeFileSync(dest, template, "utf-8");
|