@toktokhan-dev/cli-plugin-gen-api-react-query 0.0.10 → 0.0.11
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/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.11",
|
|
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/node": "0.0.5",
|
|
31
|
+
"@toktokhan-dev/cli": "0.0.6"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rollup -c",
|
|
@@ -13,7 +13,7 @@ const reactQueryTemplatePath = `${myTemeplatePath}/react-query-hook.eta`
|
|
|
13
13
|
const reactQuerKeyTemplatePath = `${myTemeplatePath}/react-query-key.eta`
|
|
14
14
|
|
|
15
15
|
const apiClassName = classNameCase(route.moduleName) + 'Api';
|
|
16
|
-
const
|
|
16
|
+
const paginationSets = myConfig?.paginationSets
|
|
17
17
|
const instancePath = myConfig?.instancePath
|
|
18
18
|
|
|
19
19
|
const apiInstanceName =route.moduleName + "Api";
|
|
@@ -78,7 +78,7 @@ const getConfigByRoute = (route) => {
|
|
|
78
78
|
const hookVariant = _.upperCase(method) === "GET" ? "Query" : "Mutation"
|
|
79
79
|
const key = upperSnakeCase(functionName);
|
|
80
80
|
const methodKey = upperSnakeCase(removeModuleName(functionName));
|
|
81
|
-
const pagination =
|
|
81
|
+
const pagination = paginationSets.find(d => !!query?.type && hasPaginationKeyword(query?.type.split("\n").join(""), d.keywords));
|
|
82
82
|
|
|
83
83
|
const isQuery = hookVariant === "Query";
|
|
84
84
|
const isMutation = hookVariant === "Mutation";
|