@toktokhan-dev/cli-plugin-gen-api-react-query 0.0.8 → 0.0.10

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.8",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -84,11 +84,11 @@ const getConfigByRoute = (route) => {
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 ? "() =>" : "";
@@ -75,10 +75,7 @@
75
75
 
76
76
  <% if (isQuery) { %>
77
77
  export const use<%~ classNameCase(functionName) %>Query = <
78
- TData = InfiniteData<
79
- RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
80
- Parameter<typeof <%= apiInstanceName %>.<%~ functionName %>>
81
- >,
78
+ TData = RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
82
79
  >(
83
80
  <%~ conditionalParamsText %>: QueryHookParams<typeof <%= apiInstanceName %>.<%~ functionName %>,
84
81
  <% if (isAxiosInstance) { %>
@@ -126,7 +123,10 @@
126
123
 
127
124
  */
128
125
  export const use<%~ classNameCase(functionName) %>InfiniteQuery = <
129
- TData = RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
126
+ TData = InfiniteData<
127
+ RequestFnReturn<typeof <%= apiInstanceName %>.<%~ functionName %>>,
128
+ Parameter<typeof <%= apiInstanceName %>.<%~ functionName %>>
129
+ >,
130
130
  >(
131
131
  <%~ conditionalParamsText %>: InfiniteQueryHookParams<typeof <%= apiInstanceName %>.<%~ functionName %>,
132
132
  <% if (isAxiosInstance) { %>
@@ -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,