@toktokhan-dev/cli-plugin-gen-api-react-query 0.0.5 → 0.0.7
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/dist/index.d.ts
CHANGED
package/dist/index.doc.d.ts
CHANGED
|
@@ -59,5 +59,4 @@ interface GenerateSwaggerApiConfig {
|
|
|
59
59
|
* @category Commands
|
|
60
60
|
*/
|
|
61
61
|
declare const genApi: _toktokhan_dev_cli.MyCommand<GenerateSwaggerApiConfig, "gen:api">;
|
|
62
|
-
export { type GenerateFn, type GenerateSwaggerApiConfig, type PaginationConfig, genApi };
|
|
63
|
-
//# sourceMappingURL=index.d.ts.map
|
|
62
|
+
export { type GenerateFn, type GenerateSwaggerApiConfig, type PaginationConfig, genApi };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toktokhan-dev/cli-plugin-gen-api-react-query",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"prettier-plugin-organize-imports": "^3.2.4",
|
|
29
29
|
"swagger-typescript-api": "^13.0.3",
|
|
30
|
-
"@toktokhan-dev/
|
|
31
|
-
"@toktokhan-dev/
|
|
30
|
+
"@toktokhan-dev/cli": "0.0.5",
|
|
31
|
+
"@toktokhan-dev/node": "0.0.4"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rollup -c",
|
|
@@ -131,7 +131,7 @@ const dataForReactHookTemplate = {
|
|
|
131
131
|
<% if (config.httpClientType === config.constants.HTTP_CLIENT.AXIOS) { %> import { AxiosRequestConfig, AxiosResponse } from "axios"; <% } %>
|
|
132
132
|
|
|
133
133
|
import { AxiosError } from 'axios';
|
|
134
|
-
import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
|
|
134
|
+
import { useQuery, useMutation, useInfiniteQuery, InfiniteData } from '@tanstack/react-query';
|
|
135
135
|
import { QueryHookParams, InfiniteQueryHookParams, MutationHookParams, Parameter, RequestFnReturn } from "../@types/react-query-type";
|
|
136
136
|
import { paramsSerializerBy } "../@utils/param-serializer-by"
|
|
137
137
|
|
|
@@ -122,7 +122,7 @@ const dataForReactHookTemplate = {
|
|
|
122
122
|
};
|
|
123
123
|
%>
|
|
124
124
|
|
|
125
|
-
import { useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
|
|
125
|
+
import { useQuery, useMutation, useInfiniteQuery, InfiniteData } from '@tanstack/react-query';
|
|
126
126
|
import { QueryHookParams, InfiniteQueryHookParams, MutationHookParams, Parameter, RequestFnReturn } from "../@types/react-query-type";
|
|
127
127
|
import { paramsSerializerBy } from "../@utils/param-serializer-by";
|
|
128
128
|
import fetchExtended from "<%= instancePath %>";
|
|
@@ -75,7 +75,10 @@
|
|
|
75
75
|
|
|
76
76
|
<% if (isQuery) { %>
|
|
77
77
|
export const use<%~ classNameCase(functionName) %>Query = <
|
|
78
|
-
|
|
78
|
+
TData = InfiniteData<
|
|
79
|
+
RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
|
|
80
|
+
Parameter<typeof <%= apiInstanceName %>.<%~ functionName %>>
|
|
81
|
+
>,
|
|
79
82
|
>(
|
|
80
83
|
<%~ conditionalParamsText %>: QueryHookParams<typeof <%= apiInstanceName %>.<%~ functionName %>,
|
|
81
84
|
<% if (isAxiosInstance) { %>
|