@toktokhan-dev/cli-plugin-gen-api-react-query 0.0.9 → 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/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ interface GenerateSwaggerApiConfig {
51
51
  /**
52
52
  * infiniteQuery 를 생성할 함수 필터 목록 입니다.
53
53
  * */
54
- paginations: PaginationConfig[];
54
+ paginationSets: PaginationConfig[];
55
55
  }
56
56
  /**
57
57
  * @category Commands
@@ -53,7 +53,7 @@ interface GenerateSwaggerApiConfig {
53
53
  /**
54
54
  * infiniteQuery 를 생성할 함수 필터 목록 입니다.
55
55
  * */
56
- paginations: PaginationConfig[];
56
+ paginationSets: PaginationConfig[];
57
57
  }
58
58
  /**
59
59
  * @category Commands
package/dist/index.js CHANGED
@@ -158,7 +158,7 @@ const genApi = defineCommand({
158
158
  includeReactInfiniteQuery: true,
159
159
  httpClientType: 'axios',
160
160
  instancePath: GENERATE_SWAGGER_DATA.AXIOS_DEFAULT_INSTANCE_PATH,
161
- paginations: [
161
+ paginationSets: [
162
162
  {
163
163
  keywords: ['cursor'],
164
164
  nextKey: 'cursor',
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.9",
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/cli": "0.0.6",
31
- "@toktokhan-dev/node": "0.0.5"
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 paginations = myConfig?.paginations
16
+ const paginationSets = myConfig?.paginationSets
17
17
  const instancePath = myConfig?.instancePath
18
18
 
19
19
  const apiInstanceName =route.moduleName + "Api";
@@ -78,17 +78,17 @@ 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 = paginations.find(d => !!query?.type && hasPaginationKeyword(query?.type.split("\n").join(""), d.keywords));
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";
85
85
  const hasPagination = !!pagination;
86
86
 
87
- const isOptialnalVariabels = _
87
+ const isOptionalVariables = _
88
88
  // Find optional value
89
89
  .filter(rawWrapperArgs, o => o.optional).length === rawWrapperArgs.length;
90
90
 
91
- const conditionalVriablesText = isOptialnalVariabels? "variables?" : "variables";
91
+ const conditionalVriablesText = isOptionalVariables? "variables?" : "variables";
92
92
  const repalceTarget = "${" + conditionalVriablesText + ".";
93
93
 
94
94
 
@@ -97,7 +97,7 @@ const getConfigByRoute = (route) => {
97
97
  hasPagination,
98
98
  isQuery,
99
99
  isMutation,
100
- isOptialnalVariabels,
100
+ isOptionalVariables,
101
101
  },
102
102
  data: {
103
103
  rawWrapperArgs,
@@ -48,11 +48,11 @@ const wrapperArgs = _
48
48
  .map(argToTmpl)
49
49
  .join('; ');
50
50
 
51
- const isOptialnalVariabels = _
51
+ const isOptionalVariables = _
52
52
  // Find optional value
53
53
  .filter(rawWrapperArgs, o => o.optional).length === rawWrapperArgs.length;
54
54
 
55
- const conditionalVriablesText = isOptialnalVariabels? "variables?" : "variables";
55
+ const conditionalVriablesText = isOptionalVariables? "variables?" : "variables";
56
56
  const repalceTarget = "${" + conditionalVriablesText + ".";
57
57
  const pathWithVariables = path.replace(/\$\{/g, repalceTarget);
58
58
 
@@ -80,11 +80,11 @@ const getConfigByRoute = (route) => {
80
80
  const isMutation = hookVariant === "Mutation";
81
81
  const hasPagination = !!pagination;
82
82
 
83
- const isOptialnalVariabels = _
83
+ const isOptionalVariables = _
84
84
  // Find optional value
85
85
  .filter(rawWrapperArgs, o => o.optional).length === rawWrapperArgs.length;
86
86
 
87
- const conditionalVriablesText = isOptialnalVariabels ? "variables?" : "variables";
87
+ const conditionalVriablesText = isOptionalVariables ? "variables?" : "variables";
88
88
  const repalceTarget = "${" + conditionalVriablesText + ".";
89
89
 
90
90
  return {
@@ -92,7 +92,7 @@ const getConfigByRoute = (route) => {
92
92
  hasPagination,
93
93
  isQuery,
94
94
  isMutation,
95
- isOptialnalVariabels,
95
+ isOptionalVariables,
96
96
  },
97
97
  data: {
98
98
  rawWrapperArgs,
@@ -47,11 +47,11 @@ const wrapperArgs = _
47
47
  .map(argToTmpl)
48
48
  .join('; ');
49
49
 
50
- const isOptialnalVariabels = _
50
+ const isOptionalVariables = _
51
51
  // Find optional value
52
52
  .filter(rawWrapperArgs, o => o.optional).length === rawWrapperArgs.length;
53
53
 
54
- const conditionalVriablesText = isOptialnalVariabels? "variables?" : "variables";
54
+ const conditionalVriablesText = isOptionalVariables? "variables?" : "variables";
55
55
  const repalceTarget = "${" + conditionalVriablesText + ".";
56
56
  const pathWithVariables = path.replace(/\$\{/g, repalceTarget);
57
57
 
@@ -10,7 +10,7 @@
10
10
  hasPagination,
11
11
  isQuery,
12
12
  isMutation,
13
- isOptialnalVariabels,
13
+ isOptionalVariables,
14
14
  },
15
15
  data: {
16
16
  rawWrapperArgs,
@@ -33,7 +33,7 @@
33
33
 
34
34
  const { _, classNameCase } = utils;
35
35
 
36
- const conditionalParamsText = isOptialnalVariabels ? "params?" : "params"
36
+ const conditionalParamsText = isOptionalVariables ? "params?" : "params"
37
37
  const conditionCallWithVariabels = isQuery ? `(${conditionalParamsText}.variables)` : "";
38
38
  const conditionParamQueryKey = isQuery ? `,${conditionalParamsText}.variables` : "";
39
39
  const conditionWrapFunc = isQuery ? "() =>" : "";
@@ -20,7 +20,7 @@ export const <%= queryKeyName %> = {
20
20
  hasPagination,
21
21
  isQuery,
22
22
  isMutation,
23
- isOptialnalVariabels,
23
+ isOptionalVariables,
24
24
  },
25
25
  data: {
26
26
  rawWrapperArgs,