@kubb/plugin-vue-query 3.1.0 → 3.3.0
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/{chunk-HWT3VLRR.js → chunk-FPSHQREX.js} +69 -32
- package/dist/chunk-FPSHQREX.js.map +1 -0
- package/dist/{chunk-YWUOBXLY.js → chunk-GNUJZEZD.js} +14 -3
- package/dist/chunk-GNUJZEZD.js.map +1 -0
- package/dist/{chunk-63EIV54R.cjs → chunk-M7ME77VI.cjs} +25 -14
- package/dist/chunk-M7ME77VI.cjs.map +1 -0
- package/dist/{chunk-JYBDVID2.cjs → chunk-X3AYO2AG.cjs} +69 -32
- package/dist/chunk-X3AYO2AG.cjs.map +1 -0
- package/dist/components.cjs +8 -8
- package/dist/components.d.cts +25 -13
- package/dist/components.d.ts +25 -13
- package/dist/components.js +1 -1
- package/dist/generators.cjs +5 -5
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-DAqaLrlX.d.cts → types-B6HlLDzG.d.cts} +30 -3
- package/dist/{types-DAqaLrlX.d.ts → types-B6HlLDzG.d.ts} +30 -3
- package/package.json +11 -11
- package/src/components/InfiniteQuery.tsx +9 -1
- package/src/components/InfiniteQueryOptions.tsx +9 -2
- package/src/components/Mutation.tsx +18 -3
- package/src/components/MutationKey.tsx +5 -4
- package/src/components/Query.tsx +9 -1
- package/src/components/QueryKey.tsx +9 -5
- package/src/components/QueryOptions.tsx +9 -3
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +55 -36
- package/src/generators/__snapshots__/clientGetImportPath.ts +55 -36
- package/src/generators/__snapshots__/clientPostImportPath.ts +51 -33
- package/src/generators/__snapshots__/findByTags.ts +55 -36
- package/src/generators/__snapshots__/findByTagsObject.ts +57 -46
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +55 -36
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +56 -36
- package/src/generators/__snapshots__/findByTagsWithZod.ts +55 -36
- package/src/generators/__snapshots__/findInfiniteByTags.ts +62 -41
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +62 -41
- package/src/generators/__snapshots__/postAsQuery.ts +68 -38
- package/src/generators/__snapshots__/updatePetById.ts +51 -33
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +51 -35
- package/src/generators/infiniteQueryGenerator.tsx +4 -0
- package/src/generators/mutationGenerator.tsx +3 -0
- package/src/generators/queryGenerator.tsx +4 -0
- package/src/plugin.ts +3 -1
- package/src/types.ts +7 -0
- package/dist/chunk-63EIV54R.cjs.map +0 -1
- package/dist/chunk-HWT3VLRR.js.map +0 -1
- package/dist/chunk-JYBDVID2.cjs.map +0 -1
- package/dist/chunk-YWUOBXLY.js.map +0 -1
package/dist/components.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Operation } from '@kubb/oas';
|
|
2
2
|
import { OperationSchemas } from '@kubb/plugin-oas';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { P as PluginVueQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-B6HlLDzG.cjs';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
|
@@ -15,11 +15,12 @@ type Props$6 = {
|
|
|
15
15
|
mutationKeyName: string;
|
|
16
16
|
typeSchemas: OperationSchemas;
|
|
17
17
|
operation: Operation;
|
|
18
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
18
19
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
19
20
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
20
21
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
21
22
|
};
|
|
22
|
-
declare function Mutation({ name, clientName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }: Props$6): ReactNode;
|
|
23
|
+
declare function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName, }: Props$6): ReactNode;
|
|
23
24
|
|
|
24
25
|
type Props$5 = {
|
|
25
26
|
/**
|
|
@@ -31,19 +32,21 @@ type Props$5 = {
|
|
|
31
32
|
queryKeyTypeName: string;
|
|
32
33
|
typeSchemas: OperationSchemas;
|
|
33
34
|
operation: Operation;
|
|
35
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
34
36
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
35
37
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
36
38
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
37
39
|
};
|
|
38
40
|
type GetParamsProps$5 = {
|
|
41
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
39
42
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
40
43
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
41
44
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
42
45
|
typeSchemas: OperationSchemas;
|
|
43
46
|
};
|
|
44
|
-
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$5): ReactNode;
|
|
47
|
+
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$5): ReactNode;
|
|
45
48
|
declare namespace Query {
|
|
46
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
49
|
+
var getParams: ({ paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
type Props$4 = {
|
|
@@ -51,16 +54,18 @@ type Props$4 = {
|
|
|
51
54
|
typeName: string;
|
|
52
55
|
typeSchemas: OperationSchemas;
|
|
53
56
|
operation: Operation;
|
|
57
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
54
58
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
55
59
|
transformer: Transformer | undefined;
|
|
56
60
|
};
|
|
57
61
|
type GetParamsProps$4 = {
|
|
62
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
58
63
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
59
64
|
typeSchemas: OperationSchemas;
|
|
60
65
|
};
|
|
61
|
-
declare function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
66
|
+
declare function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
62
67
|
declare namespace QueryKey {
|
|
63
|
-
var getParams: ({ pathParamsType, typeSchemas }: GetParamsProps$4) => FunctionParams;
|
|
68
|
+
var getParams: ({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps$4) => FunctionParams;
|
|
64
69
|
var getTransformer: Transformer;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -69,17 +74,19 @@ type Props$3 = {
|
|
|
69
74
|
clientName: string;
|
|
70
75
|
queryKeyName: string;
|
|
71
76
|
typeSchemas: OperationSchemas;
|
|
77
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
72
78
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
73
79
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
74
80
|
};
|
|
75
81
|
type GetParamsProps$3 = {
|
|
82
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
76
83
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
77
84
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
78
85
|
typeSchemas: OperationSchemas;
|
|
79
86
|
};
|
|
80
|
-
declare function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
87
|
+
declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
81
88
|
declare namespace QueryOptions {
|
|
82
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
89
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
type Props$2 = {
|
|
@@ -87,6 +94,7 @@ type Props$2 = {
|
|
|
87
94
|
clientName: string;
|
|
88
95
|
queryKeyName: string;
|
|
89
96
|
typeSchemas: OperationSchemas;
|
|
97
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
90
98
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
91
99
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
92
100
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
@@ -95,13 +103,14 @@ type Props$2 = {
|
|
|
95
103
|
queryParam: Infinite['queryParam'];
|
|
96
104
|
};
|
|
97
105
|
type GetParamsProps$2 = {
|
|
106
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
98
107
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
99
108
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
100
109
|
typeSchemas: OperationSchemas;
|
|
101
110
|
};
|
|
102
|
-
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
111
|
+
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, paramsCasing, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
103
112
|
declare namespace InfiniteQueryOptions {
|
|
104
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
113
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
type Props$1 = {
|
|
@@ -114,19 +123,21 @@ type Props$1 = {
|
|
|
114
123
|
queryKeyTypeName: string;
|
|
115
124
|
typeSchemas: OperationSchemas;
|
|
116
125
|
operation: Operation;
|
|
126
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
117
127
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
118
128
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
119
129
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
120
130
|
};
|
|
121
131
|
type GetParamsProps$1 = {
|
|
132
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
122
133
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
123
134
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
124
135
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
125
136
|
typeSchemas: OperationSchemas;
|
|
126
137
|
};
|
|
127
|
-
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
138
|
+
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, paramsCasing, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
128
139
|
declare namespace InfiniteQuery {
|
|
129
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
140
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
130
141
|
}
|
|
131
142
|
|
|
132
143
|
type Props = {
|
|
@@ -134,6 +145,7 @@ type Props = {
|
|
|
134
145
|
typeName: string;
|
|
135
146
|
typeSchemas: OperationSchemas;
|
|
136
147
|
operation: Operation;
|
|
148
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
137
149
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
138
150
|
transformer: Transformer | undefined;
|
|
139
151
|
};
|
|
@@ -141,7 +153,7 @@ type GetParamsProps = {
|
|
|
141
153
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
142
154
|
typeSchemas: OperationSchemas;
|
|
143
155
|
};
|
|
144
|
-
declare function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props): ReactNode;
|
|
156
|
+
declare function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props): ReactNode;
|
|
145
157
|
declare namespace MutationKey {
|
|
146
158
|
var getParams: ({}: GetParamsProps) => FunctionParams;
|
|
147
159
|
var getTransformer: Transformer;
|
package/dist/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Operation } from '@kubb/oas';
|
|
2
2
|
import { OperationSchemas } from '@kubb/plugin-oas';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { P as PluginVueQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginVueQuery, a as PluginReactQuery, T as Transformer, I as Infinite } from './types-B6HlLDzG.js';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
|
@@ -15,11 +15,12 @@ type Props$6 = {
|
|
|
15
15
|
mutationKeyName: string;
|
|
16
16
|
typeSchemas: OperationSchemas;
|
|
17
17
|
operation: Operation;
|
|
18
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
18
19
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
19
20
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
20
21
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
21
22
|
};
|
|
22
|
-
declare function Mutation({ name, clientName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }: Props$6): ReactNode;
|
|
23
|
+
declare function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName, }: Props$6): ReactNode;
|
|
23
24
|
|
|
24
25
|
type Props$5 = {
|
|
25
26
|
/**
|
|
@@ -31,19 +32,21 @@ type Props$5 = {
|
|
|
31
32
|
queryKeyTypeName: string;
|
|
32
33
|
typeSchemas: OperationSchemas;
|
|
33
34
|
operation: Operation;
|
|
35
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
34
36
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
35
37
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
36
38
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
37
39
|
};
|
|
38
40
|
type GetParamsProps$5 = {
|
|
41
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
39
42
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
40
43
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
41
44
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
42
45
|
typeSchemas: OperationSchemas;
|
|
43
46
|
};
|
|
44
|
-
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$5): ReactNode;
|
|
47
|
+
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$5): ReactNode;
|
|
45
48
|
declare namespace Query {
|
|
46
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
49
|
+
var getParams: ({ paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
type Props$4 = {
|
|
@@ -51,16 +54,18 @@ type Props$4 = {
|
|
|
51
54
|
typeName: string;
|
|
52
55
|
typeSchemas: OperationSchemas;
|
|
53
56
|
operation: Operation;
|
|
57
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
54
58
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
55
59
|
transformer: Transformer | undefined;
|
|
56
60
|
};
|
|
57
61
|
type GetParamsProps$4 = {
|
|
62
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
58
63
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
59
64
|
typeSchemas: OperationSchemas;
|
|
60
65
|
};
|
|
61
|
-
declare function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
66
|
+
declare function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
62
67
|
declare namespace QueryKey {
|
|
63
|
-
var getParams: ({ pathParamsType, typeSchemas }: GetParamsProps$4) => FunctionParams;
|
|
68
|
+
var getParams: ({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps$4) => FunctionParams;
|
|
64
69
|
var getTransformer: Transformer;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -69,17 +74,19 @@ type Props$3 = {
|
|
|
69
74
|
clientName: string;
|
|
70
75
|
queryKeyName: string;
|
|
71
76
|
typeSchemas: OperationSchemas;
|
|
77
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
72
78
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
73
79
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
74
80
|
};
|
|
75
81
|
type GetParamsProps$3 = {
|
|
82
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
76
83
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
77
84
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
78
85
|
typeSchemas: OperationSchemas;
|
|
79
86
|
};
|
|
80
|
-
declare function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
87
|
+
declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
81
88
|
declare namespace QueryOptions {
|
|
82
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
89
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
type Props$2 = {
|
|
@@ -87,6 +94,7 @@ type Props$2 = {
|
|
|
87
94
|
clientName: string;
|
|
88
95
|
queryKeyName: string;
|
|
89
96
|
typeSchemas: OperationSchemas;
|
|
97
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
90
98
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
91
99
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
92
100
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
@@ -95,13 +103,14 @@ type Props$2 = {
|
|
|
95
103
|
queryParam: Infinite['queryParam'];
|
|
96
104
|
};
|
|
97
105
|
type GetParamsProps$2 = {
|
|
106
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
98
107
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
99
108
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
100
109
|
typeSchemas: OperationSchemas;
|
|
101
110
|
};
|
|
102
|
-
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
111
|
+
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, paramsCasing, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
103
112
|
declare namespace InfiniteQueryOptions {
|
|
104
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
113
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
type Props$1 = {
|
|
@@ -114,19 +123,21 @@ type Props$1 = {
|
|
|
114
123
|
queryKeyTypeName: string;
|
|
115
124
|
typeSchemas: OperationSchemas;
|
|
116
125
|
operation: Operation;
|
|
126
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
117
127
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
118
128
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
119
129
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
120
130
|
};
|
|
121
131
|
type GetParamsProps$1 = {
|
|
132
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
122
133
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType'];
|
|
123
134
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
124
135
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType'];
|
|
125
136
|
typeSchemas: OperationSchemas;
|
|
126
137
|
};
|
|
127
|
-
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
138
|
+
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, paramsCasing, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
128
139
|
declare namespace InfiniteQuery {
|
|
129
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
140
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
130
141
|
}
|
|
131
142
|
|
|
132
143
|
type Props = {
|
|
@@ -134,6 +145,7 @@ type Props = {
|
|
|
134
145
|
typeName: string;
|
|
135
146
|
typeSchemas: OperationSchemas;
|
|
136
147
|
operation: Operation;
|
|
148
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing'];
|
|
137
149
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
138
150
|
transformer: Transformer | undefined;
|
|
139
151
|
};
|
|
@@ -141,7 +153,7 @@ type GetParamsProps = {
|
|
|
141
153
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType'];
|
|
142
154
|
typeSchemas: OperationSchemas;
|
|
143
155
|
};
|
|
144
|
-
declare function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props): ReactNode;
|
|
156
|
+
declare function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props): ReactNode;
|
|
145
157
|
declare namespace MutationKey {
|
|
146
158
|
var getParams: ({}: GetParamsProps) => FunctionParams;
|
|
147
159
|
var getTransformer: Transformer;
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions } from './chunk-
|
|
1
|
+
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions } from './chunk-FPSHQREX.js';
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
3
3
|
//# sourceMappingURL=components.js.map
|
package/dist/generators.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkM7ME77VI_cjs = require('./chunk-M7ME77VI.cjs');
|
|
4
|
+
require('./chunk-X3AYO2AG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "infiniteQueryGenerator", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkM7ME77VI_cjs.infiniteQueryGenerator; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "mutationGenerator", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkM7ME77VI_cjs.mutationGenerator; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "queryGenerator", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkM7ME77VI_cjs.queryGenerator; }
|
|
19
19
|
});
|
|
20
20
|
//# sourceMappingURL=generators.cjs.map
|
|
21
21
|
//# sourceMappingURL=generators.cjs.map
|
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './chunk-GNUJZEZD.js';
|
|
2
|
+
import './chunk-FPSHQREX.js';
|
|
3
3
|
//# sourceMappingURL=generators.js.map
|
|
4
4
|
//# sourceMappingURL=generators.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkM7ME77VI_cjs = require('./chunk-M7ME77VI.cjs');
|
|
4
|
+
var chunkX3AYO2AG_cjs = require('./chunk-X3AYO2AG.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var core = require('@kubb/core');
|
|
7
7
|
var transformers = require('@kubb/core/transformers');
|
|
@@ -28,16 +28,17 @@ var pluginVueQuery = core.createPlugin((options) => {
|
|
|
28
28
|
pathParamsType = "inline",
|
|
29
29
|
mutation = {},
|
|
30
30
|
query = {},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
paramsCasing,
|
|
32
|
+
mutationKey = chunkX3AYO2AG_cjs.MutationKey.getTransformer,
|
|
33
|
+
queryKey = chunkX3AYO2AG_cjs.QueryKey.getTransformer,
|
|
34
|
+
generators = [chunkM7ME77VI_cjs.queryGenerator, chunkM7ME77VI_cjs.infiniteQueryGenerator, chunkM7ME77VI_cjs.mutationGenerator].filter(Boolean)
|
|
34
35
|
} = options;
|
|
35
36
|
return {
|
|
36
37
|
name: pluginVueQueryName,
|
|
37
38
|
options: {
|
|
38
39
|
output,
|
|
39
40
|
client: {
|
|
40
|
-
importPath: "@kubb/plugin-client/
|
|
41
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
41
42
|
dataReturnType: "data",
|
|
42
43
|
pathParamsType: "inline",
|
|
43
44
|
...options.client
|
|
@@ -63,6 +64,7 @@ var pluginVueQuery = core.createPlugin((options) => {
|
|
|
63
64
|
paramsType,
|
|
64
65
|
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
65
66
|
parser,
|
|
67
|
+
paramsCasing,
|
|
66
68
|
group
|
|
67
69
|
},
|
|
68
70
|
pre: [pluginOas.pluginOasName, pluginTs.pluginTsName, parser === "zod" ? pluginZod.pluginZodName : void 0].filter(Boolean),
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts"],"names":["createPlugin","transformers","MutationKey","QueryKey","queryGenerator","infiniteQueryGenerator","mutationGenerator","pluginOasName","pluginTsName","pluginZodName","options","path","FileManager","camelCase","pascalCase","PluginManager","OperationGenerator"],"mappings":";;;;;;;;;;;;;;;AAeO,IAAM,kBAAqB,GAAA;AAErB,IAAA,cAAA,GAAiBA,iBAA6B,CAAA,CAAC,OAAY,KAAA;AACtE,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,MAAS,GAAA,QAAA;AAAA,IACT,QAAA;AAAA,kBACAC,iBAAe,EAAC;AAAA,IAChB,UAAa,GAAA,QAAA;AAAA,IACb,cAAiB,GAAA,QAAA;AAAA,IACjB,WAAW,EAAC;AAAA,IACZ,QAAQ,EAAC;AAAA,IACT,cAAcC,6BAAY,CAAA,cAAA;AAAA,IAC1B,WAAWC,0BAAS,CAAA,cAAA;AAAA,IACpB,aAAa,CAACC,gCAAA,EAAgBC,0CAAwBC,mCAAiB,CAAA,CAAE,OAAO,OAAO;AAAA,GACrF,GAAA,OAAA;AAEJ,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,OAAS,EAAA;AAAA,MACP,MAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,UAAY,EAAA,
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":["createPlugin","transformers","MutationKey","QueryKey","queryGenerator","infiniteQueryGenerator","mutationGenerator","pluginOasName","pluginTsName","pluginZodName","options","path","FileManager","camelCase","pascalCase","PluginManager","OperationGenerator"],"mappings":";;;;;;;;;;;;;;;AAeO,IAAM,kBAAqB,GAAA;AAErB,IAAA,cAAA,GAAiBA,iBAA6B,CAAA,CAAC,OAAY,KAAA;AACtE,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,MAAS,GAAA,QAAA;AAAA,IACT,QAAA;AAAA,kBACAC,iBAAe,EAAC;AAAA,IAChB,UAAa,GAAA,QAAA;AAAA,IACb,cAAiB,GAAA,QAAA;AAAA,IACjB,WAAW,EAAC;AAAA,IACZ,QAAQ,EAAC;AAAA,IACT,YAAA;AAAA,IACA,cAAcC,6BAAY,CAAA,cAAA;AAAA,IAC1B,WAAWC,0BAAS,CAAA,cAAA;AAAA,IACpB,aAAa,CAACC,gCAAA,EAAgBC,0CAAwBC,mCAAiB,CAAA,CAAE,OAAO,OAAO;AAAA,GACrF,GAAA,OAAA;AAEJ,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,OAAS,EAAA;AAAA,MACP,MAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,UAAY,EAAA,mCAAA;AAAA,QACZ,cAAgB,EAAA,MAAA;AAAA,QAChB,cAAgB,EAAA,QAAA;AAAA,QAChB,GAAG,OAAQ,CAAA;AAAA,OACb;AAAA,MACA,UAAU,QACN,GAA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B,IAAM,EAAA;AAAA,UACJ,SAAA,EAAW,KAAK,MAAO,CAAA;AAAA,SACzB;AAAA,QACA,QAAQ,IAAK,CAAA;AAAA,OACd,CAAA;AAED,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,WAAW,CAAA;AAAA;AACnC,GACF;AACF,CAAC","file":"index.cjs","sourcesContent":["import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas } from '@kubb/plugin-oas'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = createPlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n } = options\n\n return {\n name: pluginVueQueryName,\n options: {\n output,\n client: {\n importPath: '@kubb/plugin-client/clients/axios',\n dataReturnType: 'data',\n pathParamsType: 'inline',\n ...options.client,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.group && group) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(root, output.path, groupName({ group: options.group }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<PluginOas>] = PluginManager.getDependedPlugins<PluginOas>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const baseURL = await swaggerPlugin.context.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"]}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
2
|
-
import { MutationKey, QueryKey } from './chunk-
|
|
1
|
+
import { queryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-GNUJZEZD.js';
|
|
2
|
+
import { MutationKey, QueryKey } from './chunk-FPSHQREX.js';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
5
5
|
import { camelCase, pascalCase } from '@kubb/core/transformers';
|
|
@@ -22,6 +22,7 @@ var pluginVueQuery = createPlugin((options) => {
|
|
|
22
22
|
pathParamsType = "inline",
|
|
23
23
|
mutation = {},
|
|
24
24
|
query = {},
|
|
25
|
+
paramsCasing,
|
|
25
26
|
mutationKey = MutationKey.getTransformer,
|
|
26
27
|
queryKey = QueryKey.getTransformer,
|
|
27
28
|
generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean)
|
|
@@ -31,7 +32,7 @@ var pluginVueQuery = createPlugin((options) => {
|
|
|
31
32
|
options: {
|
|
32
33
|
output,
|
|
33
34
|
client: {
|
|
34
|
-
importPath: "@kubb/plugin-client/
|
|
35
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
35
36
|
dataReturnType: "data",
|
|
36
37
|
pathParamsType: "inline",
|
|
37
38
|
...options.client
|
|
@@ -57,6 +58,7 @@ var pluginVueQuery = createPlugin((options) => {
|
|
|
57
58
|
paramsType,
|
|
58
59
|
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
59
60
|
parser,
|
|
61
|
+
paramsCasing,
|
|
60
62
|
group
|
|
61
63
|
},
|
|
62
64
|
pre: [pluginOasName, pluginTsName, parser === "zod" ? pluginZodName : void 0].filter(Boolean),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts"],"names":["options"],"mappings":";;;;;;;;;AAeO,IAAM,kBAAqB,GAAA;AAErB,IAAA,cAAA,GAAiB,YAA6B,CAAA,CAAC,OAAY,KAAA;AACtE,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AAAA,IACZ,MAAS,GAAA,QAAA;AAAA,IACT,QAAA;AAAA,IACA,eAAe,EAAC;AAAA,IAChB,UAAa,GAAA,QAAA;AAAA,IACb,cAAiB,GAAA,QAAA;AAAA,IACjB,WAAW,EAAC;AAAA,IACZ,QAAQ,EAAC;AAAA,IACT,cAAc,WAAY,CAAA,cAAA;AAAA,IAC1B,WAAW,QAAS,CAAA,cAAA;AAAA,IACpB,aAAa,CAAC,cAAA,EAAgB,wBAAwB,iBAAiB,CAAA,CAAE,OAAO,OAAO;AAAA,GACrF,GAAA,OAAA;AAEJ,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,OAAS,EAAA;AAAA,MACP,MAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,UAAY,EAAA,
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":["options"],"mappings":";;;;;;;;;AAeO,IAAM,kBAAqB,GAAA;AAErB,IAAA,cAAA,GAAiB,YAA6B,CAAA,CAAC,OAAY,KAAA;AACtE,EAAM,MAAA;AAAA,IACJ,MAAS,GAAA,EAAE,IAAM,EAAA,OAAA,EAAS,YAAY,OAAQ,EAAA;AAAA,IAC9C,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OA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AAA,IAAI,kBAAmB,CAAA,IAAA,CAAK,OAAO,OAAS,EAAA;AAAA,QACrE,GAAA;AAAA,QACA,eAAe,IAAK,CAAA,aAAA;AAAA,QACpB,QAAQ,IAAK,CAAA,MAAA;AAAA,QACb,WAAA,EAAa,cAAc,OAAQ,CAAA,WAAA;AAAA,QACnC,OAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA;AAAA,OACD,CAAA;AAED,MAAA,MAAM,KAAQ,GAAA,MAAM,kBAAmB,CAAA,KAAA,CAAM,GAAG,UAAU,CAAA;AAC1D,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,KAAK,CAAA;AAE3B,MAAA,MAAM,WAAc,GAAA,MAAM,IAAK,CAAA,WAAA,CAAY,cAAe,CAAA;AAAA,QACxD,IAAA,EAAM,OAAO,UAAc,IAAA,OAAA;AAAA,QAC3B,IAAA;AAAA,QACA,MAAA;AAAA,QACA,KAAA,EAAO,KAAK,WAAY,CAAA,KAAA;AAAA,QACxB,IAAM,EAAA;AAAA,UACJ,SAAA,EAAW,KAAK,MAAO,CAAA;AAAA,SACzB;AAAA,QACA,QAAQ,IAAK,CAAA;AAAA,OACd,CAAA;AAED,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,WAAW,CAAA;AAAA;AACnC,GACF;AACF,CAAC","file":"index.js","sourcesContent":["import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas } from '@kubb/plugin-oas'\nimport { MutationKey, QueryKey } from './components'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator } from './generators'\nimport type { PluginVueQuery } from './types.ts'\n\nexport const pluginVueQueryName = 'plugin-vue-query' satisfies PluginVueQuery['name']\n\nexport const pluginVueQuery = createPlugin<PluginVueQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n infinite,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = 'inline',\n mutation = {},\n query = {},\n paramsCasing,\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n } = options\n\n return {\n name: pluginVueQueryName,\n options: {\n output,\n client: {\n importPath: '@kubb/plugin-client/clients/axios',\n dataReturnType: 'data',\n pathParamsType: 'inline',\n ...options.client,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/vue-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/vue-query',\n ...mutation,\n },\n paramsType,\n pathParamsType: paramsType === 'object' ? 'object' : pathParamsType,\n parser,\n paramsCasing,\n group,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (options?.group && group) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(root, output.path, groupName({ group: options.group }), baseName)\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<PluginOas>] = PluginManager.getDependedPlugins<PluginOas>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const baseURL = await swaggerPlugin.context.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.context.contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"]}
|