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 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: List all users
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 a user by ID
96
- parameters:
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
- requestBody:
113
- required: true
114
- content:
115
- application/json:
116
- schema:
117
- $ref: "#/components/schemas/UpdateUserBody"
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
- // src/api/client.ts auto-generated by axigen, do not edit
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
- * List all users
142
+ * Get user list
139
143
  * `GET /users`
144
+ * @tags users
140
145
  */
141
- export async function getUsers(params?: GetUsersQueryParams): Promise<AxiosResponse<GetUsersResponse>> {
142
- return axiosInstance.get("/users", { params });
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 a user by ID
156
+ * Get user by ID
147
157
  * `GET /users/{userId}`
158
+ * @tags users
148
159
  */
149
- export async function getUserById(userId: GetUserByIdPathParams["userId"]): Promise<AxiosResponse<GetUserByIdResponse>> {
150
- return axiosInstance.get(`/users/${userId}`);
151
- }
152
-
153
- /**
154
- * Update a user
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
 
@@ -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");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axigen",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Generate typed Axios client functions from OpenAPI / Swagger specs",
5
5
  "keywords": [
6
6
  "openapi",