api-farmer 0.0.15 → 0.0.16

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
@@ -51,7 +51,6 @@ npx af
51
51
 
52
52
  > [!TIP]
53
53
  > The generated content does not include the integration of the request client.
54
- > If you allow ts code output, you will see a custom type called `Res`. This type needs to be defined in `global.d.ts` for use.
55
54
 
56
55
  #### Some Examples
57
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-farmer",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "API module generation tool based on Openapi3/Swagger2.",
5
5
  "keywords": [
6
6
  "cli",
@@ -4,7 +4,7 @@ import { request } from '@/request'
4
4
 
5
5
  <% apiModule.payloads.forEach(payload => { %> -%>
6
6
  export const <%- payload.fn %> = (config<% if (ts) { %>: AxiosRequestConfig<<%- payload.typeRequestBody %>> <% } %>)
7
- => request<% if (ts) { %><any, Res<<%- payload.typeResponseBody %>>><% } %>({
7
+ => request<% if (ts) { %><any, <%- payload.typeResponseBody %>><% } %>({
8
8
  url: '<%- payload.url %>',
9
9
  method: '<%- payload.method %>',
10
10
  ...config
@@ -4,7 +4,7 @@ import { api } from '@/request'
4
4
  <% apiModule.payloads.forEach(payload => { %> -%>
5
5
  export const <%- payload.fn %> = api
6
6
  <% if (ts) { %>
7
- <Res<<%- payload.typeResponseBody %>>,
7
+ <<%- payload.typeResponseBody %>,
8
8
  <% if (['get', 'delete', 'head', 'options'].includes(payload.method)) { %>
9
9
  <%- payload.typeQuery %>
10
10
  <% } else { %>