@jayfong/x-server 1.27.1 → 1.27.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/CHANGELOG.md +7 -0
- package/lib/_cjs/cli/api_generator.js +20 -1
- package/lib/cli/api_generator.js +20 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.27.2](https://github.com/jfWorks/x-server/compare/v1.27.1...v1.27.2) (2022-05-11)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* api gen GET ([601d94a](https://github.com/jfWorks/x-server/commit/601d94a9abd4a33a91f805dae74a0a471ba2cd59))
|
|
11
|
+
|
|
5
12
|
### [1.27.1](https://github.com/jfWorks/x-server/compare/v1.27.0...v1.27.1) (2022-05-08)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -186,7 +186,25 @@ class ApiGenerator {
|
|
|
186
186
|
|
|
187
187
|
for (const handle of handles) {
|
|
188
188
|
data[handle.category] = data[handle.category] || [];
|
|
189
|
-
data[handle.category].push(handle.handlerMethod === '
|
|
189
|
+
data[handle.category].push(handle.handlerMethod === 'GET' ? {
|
|
190
|
+
method: handle.method.toUpperCase(),
|
|
191
|
+
title: handle.name,
|
|
192
|
+
path: handle.path,
|
|
193
|
+
req_body_type: 'query',
|
|
194
|
+
res_body_type: 'json',
|
|
195
|
+
req_body_is_json_schema: false,
|
|
196
|
+
res_body_is_json_schema: true,
|
|
197
|
+
req_params: [],
|
|
198
|
+
req_query: handle.requestData.children.map(item => ({
|
|
199
|
+
required: item.required ? 1 : 0,
|
|
200
|
+
name: item.name,
|
|
201
|
+
desc: item.desc,
|
|
202
|
+
type: 'string'
|
|
203
|
+
})),
|
|
204
|
+
req_headers: [],
|
|
205
|
+
req_body_form: [],
|
|
206
|
+
res_body: JSON.stringify(handle.responseDataJsonSchema)
|
|
207
|
+
} : handle.handlerMethod === 'FILE' ? {
|
|
190
208
|
method: handle.method.toUpperCase(),
|
|
191
209
|
title: handle.name,
|
|
192
210
|
path: handle.path,
|
|
@@ -200,6 +218,7 @@ class ApiGenerator {
|
|
|
200
218
|
req_body_form: handle.requestData.children.map(item => ({
|
|
201
219
|
required: item.required ? 1 : 0,
|
|
202
220
|
name: item.name,
|
|
221
|
+
desc: item.desc,
|
|
203
222
|
type: item.type === 'file' ? 'file' : 'text'
|
|
204
223
|
})),
|
|
205
224
|
res_body: JSON.stringify(handle.responseDataJsonSchema)
|
package/lib/cli/api_generator.js
CHANGED
|
@@ -170,7 +170,25 @@ export class ApiGenerator {
|
|
|
170
170
|
|
|
171
171
|
for (const handle of handles) {
|
|
172
172
|
data[handle.category] = data[handle.category] || [];
|
|
173
|
-
data[handle.category].push(handle.handlerMethod === '
|
|
173
|
+
data[handle.category].push(handle.handlerMethod === 'GET' ? {
|
|
174
|
+
method: handle.method.toUpperCase(),
|
|
175
|
+
title: handle.name,
|
|
176
|
+
path: handle.path,
|
|
177
|
+
req_body_type: 'query',
|
|
178
|
+
res_body_type: 'json',
|
|
179
|
+
req_body_is_json_schema: false,
|
|
180
|
+
res_body_is_json_schema: true,
|
|
181
|
+
req_params: [],
|
|
182
|
+
req_query: handle.requestData.children.map(item => ({
|
|
183
|
+
required: item.required ? 1 : 0,
|
|
184
|
+
name: item.name,
|
|
185
|
+
desc: item.desc,
|
|
186
|
+
type: 'string'
|
|
187
|
+
})),
|
|
188
|
+
req_headers: [],
|
|
189
|
+
req_body_form: [],
|
|
190
|
+
res_body: JSON.stringify(handle.responseDataJsonSchema)
|
|
191
|
+
} : handle.handlerMethod === 'FILE' ? {
|
|
174
192
|
method: handle.method.toUpperCase(),
|
|
175
193
|
title: handle.name,
|
|
176
194
|
path: handle.path,
|
|
@@ -184,6 +202,7 @@ export class ApiGenerator {
|
|
|
184
202
|
req_body_form: handle.requestData.children.map(item => ({
|
|
185
203
|
required: item.required ? 1 : 0,
|
|
186
204
|
name: item.name,
|
|
205
|
+
desc: item.desc,
|
|
187
206
|
type: item.type === 'file' ? 'file' : 'text'
|
|
188
207
|
})),
|
|
189
208
|
res_body: JSON.stringify(handle.responseDataJsonSchema)
|