@kubb/plugin-react-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-PBJIUPCN.cjs → chunk-4I6UYXEA.cjs} +33 -18
- package/dist/chunk-4I6UYXEA.cjs.map +1 -0
- package/dist/{chunk-YGWYQQ6H.js → chunk-JICGDXHM.js} +86 -55
- package/dist/chunk-JICGDXHM.js.map +1 -0
- package/dist/{chunk-GMONUHPD.js → chunk-QFITPKDT.js} +18 -3
- package/dist/chunk-QFITPKDT.js.map +1 -0
- package/dist/{chunk-WOYQTGDC.cjs → chunk-YNY2PBUX.cjs} +86 -55
- package/dist/chunk-YNY2PBUX.cjs.map +1 -0
- package/dist/components.cjs +9 -9
- package/dist/components.d.cts +29 -15
- package/dist/components.d.ts +29 -15
- package/dist/components.js +1 -1
- package/dist/generators.cjs +6 -6
- 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 +6 -4
- package/dist/index.js.map +1 -1
- package/dist/{types-BBt81Oun.d.cts → types-DbdPn2MA.d.cts} +22 -2
- package/dist/{types-BBt81Oun.d.ts → types-DbdPn2MA.d.ts} +22 -2
- package/package.json +11 -11
- package/src/components/InfiniteQuery.tsx +9 -3
- package/src/components/InfiniteQueryOptions.tsx +25 -13
- package/src/components/Mutation.tsx +18 -4
- package/src/components/MutationKey.tsx +5 -4
- package/src/components/Query.tsx +9 -3
- package/src/components/QueryKey.tsx +9 -6
- package/src/components/QueryOptions.tsx +9 -5
- package/src/components/SuspenseQuery.tsx +9 -3
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +49 -34
- package/src/generators/__snapshots__/clientGetImportPath.ts +49 -34
- package/src/generators/__snapshots__/clientPostImportPath.ts +48 -34
- package/src/generators/__snapshots__/findByTags.ts +49 -34
- package/src/generators/__snapshots__/findByTagsObject.ts +55 -44
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +49 -34
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +49 -34
- package/src/generators/__snapshots__/findByTagsWithZod.ts +49 -34
- package/src/generators/__snapshots__/findInfiniteByTags.ts +60 -40
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +60 -40
- package/src/generators/__snapshots__/getAsMutation.ts +2 -2
- package/src/generators/__snapshots__/getPetIdCamelCase.ts +56 -0
- package/src/generators/__snapshots__/postAsQuery.ts +68 -38
- package/src/generators/__snapshots__/updatePetById.ts +48 -34
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +48 -36
- package/src/generators/infiniteQueryGenerator.tsx +4 -1
- package/src/generators/mutationGenerator.tsx +3 -0
- package/src/generators/queryGenerator.tsx +4 -0
- package/src/generators/suspenseQueryGenerator.tsx +4 -0
- package/src/plugin.ts +3 -1
- package/src/types.ts +7 -0
- package/dist/chunk-GMONUHPD.js.map +0 -1
- package/dist/chunk-PBJIUPCN.cjs.map +0 -1
- package/dist/chunk-WOYQTGDC.cjs.map +0 -1
- package/dist/chunk-YGWYQQ6H.js.map +0 -1
package/dist/components.cjs
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYNY2PBUX_cjs = require('./chunk-YNY2PBUX.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "InfiniteQuery", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkYNY2PBUX_cjs.InfiniteQuery; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "InfiniteQueryOptions", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkYNY2PBUX_cjs.InfiniteQueryOptions; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "Mutation", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkYNY2PBUX_cjs.Mutation; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "MutationKey", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkYNY2PBUX_cjs.MutationKey; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "Query", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkYNY2PBUX_cjs.Query; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "QueryKey", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkYNY2PBUX_cjs.QueryKey; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "QueryOptions", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkYNY2PBUX_cjs.QueryOptions; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "SuspenseQuery", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkYNY2PBUX_cjs.SuspenseQuery; }
|
|
38
38
|
});
|
|
39
39
|
//# sourceMappingURL=components.cjs.map
|
|
40
40
|
//# sourceMappingURL=components.cjs.map
|
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 PluginReactQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginReactQuery, T as Transformer, I as Infinite } from './types-DbdPn2MA.cjs';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
|
@@ -16,10 +16,11 @@ type Props$7 = {
|
|
|
16
16
|
typeSchemas: OperationSchemas;
|
|
17
17
|
operation: Operation;
|
|
18
18
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
19
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
19
20
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
20
21
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
21
22
|
};
|
|
22
|
-
declare function Mutation({ name, clientName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }: Props$7): ReactNode;
|
|
23
|
+
declare function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName, }: Props$7): ReactNode;
|
|
23
24
|
|
|
24
25
|
type Props$6 = {
|
|
25
26
|
/**
|
|
@@ -31,19 +32,21 @@ type Props$6 = {
|
|
|
31
32
|
queryKeyTypeName: string;
|
|
32
33
|
typeSchemas: OperationSchemas;
|
|
33
34
|
operation: Operation;
|
|
35
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
34
36
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
35
37
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
36
38
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
37
39
|
};
|
|
38
40
|
type GetParamsProps$6 = {
|
|
41
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
39
42
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
40
43
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
41
44
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
42
45
|
typeSchemas: OperationSchemas;
|
|
43
46
|
};
|
|
44
|
-
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$6): ReactNode;
|
|
47
|
+
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$6): ReactNode;
|
|
45
48
|
declare namespace Query {
|
|
46
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$6) => FunctionParams;
|
|
49
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$6) => FunctionParams;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
type Props$5 = {
|
|
@@ -51,16 +54,18 @@ type Props$5 = {
|
|
|
51
54
|
typeName: string;
|
|
52
55
|
typeSchemas: OperationSchemas;
|
|
53
56
|
operation: Operation;
|
|
57
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
54
58
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
55
59
|
transformer: Transformer | undefined;
|
|
56
60
|
};
|
|
57
61
|
type GetParamsProps$5 = {
|
|
62
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
58
63
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
59
64
|
typeSchemas: OperationSchemas;
|
|
60
65
|
};
|
|
61
|
-
declare function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$5): ReactNode;
|
|
66
|
+
declare function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$5): ReactNode;
|
|
62
67
|
declare namespace QueryKey {
|
|
63
|
-
var getParams: ({ pathParamsType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
68
|
+
var getParams: ({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
64
69
|
var getTransformer: Transformer;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -69,6 +74,7 @@ type Props$4 = {
|
|
|
69
74
|
typeName: string;
|
|
70
75
|
typeSchemas: OperationSchemas;
|
|
71
76
|
operation: Operation;
|
|
77
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
72
78
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
73
79
|
transformer: Transformer | undefined;
|
|
74
80
|
};
|
|
@@ -76,7 +82,7 @@ type GetParamsProps$4 = {
|
|
|
76
82
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
77
83
|
typeSchemas: OperationSchemas;
|
|
78
84
|
};
|
|
79
|
-
declare function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
85
|
+
declare function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer }: Props$4): ReactNode;
|
|
80
86
|
declare namespace MutationKey {
|
|
81
87
|
var getParams: ({}: GetParamsProps$4) => FunctionParams;
|
|
82
88
|
var getTransformer: Transformer;
|
|
@@ -87,17 +93,19 @@ type Props$3 = {
|
|
|
87
93
|
clientName: string;
|
|
88
94
|
queryKeyName: string;
|
|
89
95
|
typeSchemas: OperationSchemas;
|
|
96
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
90
97
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
91
98
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
92
99
|
};
|
|
93
100
|
type GetParamsProps$3 = {
|
|
101
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
94
102
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
95
103
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
96
104
|
typeSchemas: OperationSchemas;
|
|
97
105
|
};
|
|
98
|
-
declare function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
106
|
+
declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
99
107
|
declare namespace QueryOptions {
|
|
100
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
108
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
type Props$2 = {
|
|
@@ -105,6 +113,7 @@ type Props$2 = {
|
|
|
105
113
|
clientName: string;
|
|
106
114
|
queryKeyName: string;
|
|
107
115
|
typeSchemas: OperationSchemas;
|
|
116
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
108
117
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
109
118
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
110
119
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
@@ -113,13 +122,14 @@ type Props$2 = {
|
|
|
113
122
|
queryParam: Infinite['queryParam'];
|
|
114
123
|
};
|
|
115
124
|
type GetParamsProps$2 = {
|
|
125
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
116
126
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
117
127
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
118
128
|
typeSchemas: OperationSchemas;
|
|
119
129
|
};
|
|
120
|
-
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
130
|
+
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
121
131
|
declare namespace InfiniteQueryOptions {
|
|
122
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
132
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
type Props$1 = {
|
|
@@ -132,19 +142,21 @@ type Props$1 = {
|
|
|
132
142
|
queryKeyTypeName: string;
|
|
133
143
|
typeSchemas: OperationSchemas;
|
|
134
144
|
operation: Operation;
|
|
145
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
135
146
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
136
147
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
137
148
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
138
149
|
};
|
|
139
150
|
type GetParamsProps$1 = {
|
|
140
151
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
152
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
141
153
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
142
154
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
143
155
|
typeSchemas: OperationSchemas;
|
|
144
156
|
};
|
|
145
|
-
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
157
|
+
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
146
158
|
declare namespace InfiniteQuery {
|
|
147
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
159
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
148
160
|
}
|
|
149
161
|
|
|
150
162
|
type Props = {
|
|
@@ -157,19 +169,21 @@ type Props = {
|
|
|
157
169
|
queryKeyTypeName: string;
|
|
158
170
|
typeSchemas: OperationSchemas;
|
|
159
171
|
operation: Operation;
|
|
172
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
160
173
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
161
174
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
162
175
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
163
176
|
};
|
|
164
177
|
type GetParamsProps = {
|
|
178
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
165
179
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
166
180
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
167
181
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
168
182
|
typeSchemas: OperationSchemas;
|
|
169
183
|
};
|
|
170
|
-
declare function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props): ReactNode;
|
|
184
|
+
declare function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props): ReactNode;
|
|
171
185
|
declare namespace SuspenseQuery {
|
|
172
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) => FunctionParams;
|
|
186
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) => FunctionParams;
|
|
173
187
|
}
|
|
174
188
|
|
|
175
189
|
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery };
|
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 PluginReactQuery, T as Transformer, I as Infinite } from './types-
|
|
4
|
+
import { P as PluginReactQuery, T as Transformer, I as Infinite } from './types-DbdPn2MA.js';
|
|
5
5
|
import { FunctionParams } from '@kubb/react';
|
|
6
6
|
import '@kubb/core';
|
|
7
7
|
|
|
@@ -16,10 +16,11 @@ type Props$7 = {
|
|
|
16
16
|
typeSchemas: OperationSchemas;
|
|
17
17
|
operation: Operation;
|
|
18
18
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
19
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
19
20
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
20
21
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
21
22
|
};
|
|
22
|
-
declare function Mutation({ name, clientName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }: Props$7): ReactNode;
|
|
23
|
+
declare function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName, }: Props$7): ReactNode;
|
|
23
24
|
|
|
24
25
|
type Props$6 = {
|
|
25
26
|
/**
|
|
@@ -31,19 +32,21 @@ type Props$6 = {
|
|
|
31
32
|
queryKeyTypeName: string;
|
|
32
33
|
typeSchemas: OperationSchemas;
|
|
33
34
|
operation: Operation;
|
|
35
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
34
36
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
35
37
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
36
38
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
37
39
|
};
|
|
38
40
|
type GetParamsProps$6 = {
|
|
41
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
39
42
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
40
43
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
41
44
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
42
45
|
typeSchemas: OperationSchemas;
|
|
43
46
|
};
|
|
44
|
-
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$6): ReactNode;
|
|
47
|
+
declare function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$6): ReactNode;
|
|
45
48
|
declare namespace Query {
|
|
46
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$6) => FunctionParams;
|
|
49
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$6) => FunctionParams;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
type Props$5 = {
|
|
@@ -51,16 +54,18 @@ type Props$5 = {
|
|
|
51
54
|
typeName: string;
|
|
52
55
|
typeSchemas: OperationSchemas;
|
|
53
56
|
operation: Operation;
|
|
57
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
54
58
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
55
59
|
transformer: Transformer | undefined;
|
|
56
60
|
};
|
|
57
61
|
type GetParamsProps$5 = {
|
|
62
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
58
63
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
59
64
|
typeSchemas: OperationSchemas;
|
|
60
65
|
};
|
|
61
|
-
declare function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$5): ReactNode;
|
|
66
|
+
declare function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer }: Props$5): ReactNode;
|
|
62
67
|
declare namespace QueryKey {
|
|
63
|
-
var getParams: ({ pathParamsType, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
68
|
+
var getParams: ({ pathParamsType, paramsCasing, typeSchemas }: GetParamsProps$5) => FunctionParams;
|
|
64
69
|
var getTransformer: Transformer;
|
|
65
70
|
}
|
|
66
71
|
|
|
@@ -69,6 +74,7 @@ type Props$4 = {
|
|
|
69
74
|
typeName: string;
|
|
70
75
|
typeSchemas: OperationSchemas;
|
|
71
76
|
operation: Operation;
|
|
77
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
72
78
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
73
79
|
transformer: Transformer | undefined;
|
|
74
80
|
};
|
|
@@ -76,7 +82,7 @@ type GetParamsProps$4 = {
|
|
|
76
82
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
77
83
|
typeSchemas: OperationSchemas;
|
|
78
84
|
};
|
|
79
|
-
declare function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer }: Props$4): ReactNode;
|
|
85
|
+
declare function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer }: Props$4): ReactNode;
|
|
80
86
|
declare namespace MutationKey {
|
|
81
87
|
var getParams: ({}: GetParamsProps$4) => FunctionParams;
|
|
82
88
|
var getTransformer: Transformer;
|
|
@@ -87,17 +93,19 @@ type Props$3 = {
|
|
|
87
93
|
clientName: string;
|
|
88
94
|
queryKeyName: string;
|
|
89
95
|
typeSchemas: OperationSchemas;
|
|
96
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
90
97
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
91
98
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
92
99
|
};
|
|
93
100
|
type GetParamsProps$3 = {
|
|
101
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
94
102
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
95
103
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
96
104
|
typeSchemas: OperationSchemas;
|
|
97
105
|
};
|
|
98
|
-
declare function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
106
|
+
declare function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }: Props$3): ReactNode;
|
|
99
107
|
declare namespace QueryOptions {
|
|
100
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
108
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$3) => FunctionParams;
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
type Props$2 = {
|
|
@@ -105,6 +113,7 @@ type Props$2 = {
|
|
|
105
113
|
clientName: string;
|
|
106
114
|
queryKeyName: string;
|
|
107
115
|
typeSchemas: OperationSchemas;
|
|
116
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
108
117
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
109
118
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
110
119
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
@@ -113,13 +122,14 @@ type Props$2 = {
|
|
|
113
122
|
queryParam: Infinite['queryParam'];
|
|
114
123
|
};
|
|
115
124
|
type GetParamsProps$2 = {
|
|
125
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
116
126
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
117
127
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
118
128
|
typeSchemas: OperationSchemas;
|
|
119
129
|
};
|
|
120
|
-
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
130
|
+
declare function InfiniteQueryOptions({ name, clientName, initialPageParam, cursorParam, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryParam, queryKeyName, }: Props$2): ReactNode;
|
|
121
131
|
declare namespace InfiniteQueryOptions {
|
|
122
|
-
var getParams: ({ paramsType, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
132
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, typeSchemas }: GetParamsProps$2) => FunctionParams;
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
type Props$1 = {
|
|
@@ -132,19 +142,21 @@ type Props$1 = {
|
|
|
132
142
|
queryKeyTypeName: string;
|
|
133
143
|
typeSchemas: OperationSchemas;
|
|
134
144
|
operation: Operation;
|
|
145
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
135
146
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
136
147
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
137
148
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
138
149
|
};
|
|
139
150
|
type GetParamsProps$1 = {
|
|
140
151
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
152
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
141
153
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
142
154
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
143
155
|
typeSchemas: OperationSchemas;
|
|
144
156
|
};
|
|
145
|
-
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
157
|
+
declare function InfiniteQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props$1): ReactNode;
|
|
146
158
|
declare namespace InfiniteQuery {
|
|
147
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
159
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps$1) => FunctionParams;
|
|
148
160
|
}
|
|
149
161
|
|
|
150
162
|
type Props = {
|
|
@@ -157,19 +169,21 @@ type Props = {
|
|
|
157
169
|
queryKeyTypeName: string;
|
|
158
170
|
typeSchemas: OperationSchemas;
|
|
159
171
|
operation: Operation;
|
|
172
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
160
173
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
161
174
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
162
175
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
163
176
|
};
|
|
164
177
|
type GetParamsProps = {
|
|
178
|
+
paramsCasing: PluginReactQuery['resolvedOptions']['paramsCasing'];
|
|
165
179
|
paramsType: PluginReactQuery['resolvedOptions']['paramsType'];
|
|
166
180
|
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType'];
|
|
167
181
|
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType'];
|
|
168
182
|
typeSchemas: OperationSchemas;
|
|
169
183
|
};
|
|
170
|
-
declare function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, }: Props): ReactNode;
|
|
184
|
+
declare function SuspenseQuery({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas, operation, }: Props): ReactNode;
|
|
171
185
|
declare namespace SuspenseQuery {
|
|
172
|
-
var getParams: ({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) => FunctionParams;
|
|
186
|
+
var getParams: ({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) => FunctionParams;
|
|
173
187
|
}
|
|
174
188
|
|
|
175
189
|
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery };
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery } from './chunk-
|
|
1
|
+
export { InfiniteQuery, InfiniteQueryOptions, Mutation, MutationKey, Query, QueryKey, QueryOptions, SuspenseQuery } from './chunk-JICGDXHM.js';
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
3
3
|
//# sourceMappingURL=components.js.map
|
package/dist/generators.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk4I6UYXEA_cjs = require('./chunk-4I6UYXEA.cjs');
|
|
4
|
+
require('./chunk-YNY2PBUX.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 chunk4I6UYXEA_cjs.infiniteQueryGenerator; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "mutationGenerator", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk4I6UYXEA_cjs.mutationGenerator; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "queryGenerator", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk4I6UYXEA_cjs.queryGenerator; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "suspenseQueryGenerator", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk4I6UYXEA_cjs.suspenseQueryGenerator; }
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=generators.cjs.map
|
|
25
25
|
//# 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, suspenseQueryGenerator } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator } from './chunk-QFITPKDT.js';
|
|
2
|
+
import './chunk-JICGDXHM.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 chunk4I6UYXEA_cjs = require('./chunk-4I6UYXEA.cjs');
|
|
4
|
+
var chunkYNY2PBUX_cjs = require('./chunk-YNY2PBUX.cjs');
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var core = require('@kubb/core');
|
|
7
7
|
var transformers = require('@kubb/core/transformers');
|
|
@@ -27,18 +27,19 @@ var pluginReactQuery = core.createPlugin((options) => {
|
|
|
27
27
|
transformers: transformers$1 = {},
|
|
28
28
|
paramsType = "inline",
|
|
29
29
|
pathParamsType = "inline",
|
|
30
|
-
generators = [
|
|
30
|
+
generators = [chunk4I6UYXEA_cjs.queryGenerator, chunk4I6UYXEA_cjs.suspenseQueryGenerator, chunk4I6UYXEA_cjs.infiniteQueryGenerator, chunk4I6UYXEA_cjs.mutationGenerator].filter(Boolean),
|
|
31
31
|
mutation = {},
|
|
32
32
|
query = {},
|
|
33
|
-
mutationKey =
|
|
34
|
-
queryKey =
|
|
33
|
+
mutationKey = chunkYNY2PBUX_cjs.MutationKey.getTransformer,
|
|
34
|
+
queryKey = chunkYNY2PBUX_cjs.QueryKey.getTransformer,
|
|
35
|
+
paramsCasing
|
|
35
36
|
} = options;
|
|
36
37
|
return {
|
|
37
38
|
name: pluginReactQueryName,
|
|
38
39
|
options: {
|
|
39
40
|
output,
|
|
40
41
|
client: {
|
|
41
|
-
importPath: "@kubb/plugin-client/
|
|
42
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
42
43
|
dataReturnType: "data",
|
|
43
44
|
...options.client
|
|
44
45
|
},
|
|
@@ -64,6 +65,7 @@ var pluginReactQuery = core.createPlugin((options) => {
|
|
|
64
65
|
paramsType,
|
|
65
66
|
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
66
67
|
parser,
|
|
68
|
+
paramsCasing,
|
|
67
69
|
group
|
|
68
70
|
},
|
|
69
71
|
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","queryGenerator","suspenseQueryGenerator","infiniteQueryGenerator","mutationGenerator","MutationKey","QueryKey","pluginOasName","pluginTsName","pluginZodName","options","path","FileManager","camelCase","pascalCase","PluginManager","OperationGenerator"],"mappings":";;;;;;;;;;;;;;;AAgBO,IAAM,oBAAuB,GAAA;AAEvB,IAAA,gBAAA,GAAmBA,iBAA+B,CAAA,CAAC,OAAY,KAAA;AAC1E,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,WAAW,EAAC;AAAA,IACZ,QAAW,GAAA,KAAA;AAAA,kBACXC,iBAAe,EAAC;AAAA,IAChB,UAAa,GAAA,QAAA;AAAA,IACb,cAAiB,GAAA,QAAA;AAAA,IACjB,UAAA,GAAa,CAACC,gCAAgB,EAAAC,wCAAA,EAAwBC,0CAAwBC,mCAAiB,CAAA,CAAE,OAAO,OAAO,CAAA;AAAA,IAC/G,WAAW,EAAC;AAAA,IACZ,QAAQ,EAAC;AAAA,IACT,cAAcC,6BAAY,CAAA,cAAA;AAAA,IAC1B,WAAWC,0BAAS,CAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":["createPlugin","transformers","queryGenerator","suspenseQueryGenerator","infiniteQueryGenerator","mutationGenerator","MutationKey","QueryKey","pluginOasName","pluginTsName","pluginZodName","options","path","FileManager","camelCase","pascalCase","PluginManager","OperationGenerator"],"mappings":";;;;;;;;;;;;;;;AAgBO,IAAM,oBAAuB,GAAA;AAEvB,IAAA,gBAAA,GAAmBA,iBAA+B,CAAA,CAAC,OAAY,KAAA;AAC1E,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,WAAW,EAAC;AAAA,IACZ,QAAW,GAAA,KAAA;AAAA,kBACXC,iBAAe,EAAC;AAAA,IAChB,UAAa,GAAA,QAAA;AAAA,IACb,cAAiB,GAAA,QAAA;AAAA,IACjB,UAAA,GAAa,CAACC,gCAAgB,EAAAC,wCAAA,EAAwBC,0CAAwBC,mCAAiB,CAAA,CAAE,OAAO,OAAO,CAAA;AAAA,IAC/G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,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.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 } from './components'\nimport { QueryKey } from './components/QueryKey.tsx'\nimport { infiniteQueryGenerator, mutationGenerator, queryGenerator, suspenseQueryGenerator } from './generators'\nimport type { PluginReactQuery } from './types.ts'\n\nexport const pluginReactQueryName = 'plugin-react-query' satisfies PluginReactQuery['name']\n\nexport const pluginReactQuery = createPlugin<PluginReactQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n suspense = {},\n infinite = false,\n transformers = {},\n paramsType = 'inline',\n pathParamsType = 'inline',\n generators = [queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator].filter(Boolean),\n mutation = {},\n query = {},\n mutationKey = MutationKey.getTransformer,\n queryKey = QueryKey.getTransformer,\n paramsCasing,\n } = options\n\n return {\n name: pluginReactQueryName,\n options: {\n output,\n client: {\n importPath: '@kubb/plugin-client/clients/axios',\n dataReturnType: 'data',\n ...options.client,\n },\n infinite: infinite\n ? {\n queryParam: 'id',\n initialPageParam: 0,\n cursorParam: undefined,\n ...infinite,\n }\n : false,\n suspense,\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/react-query',\n ...query,\n },\n mutationKey,\n mutation: {\n methods: ['post', 'put', 'patch', 'delete'],\n importPath: '@tanstack/react-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\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, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-
|
|
2
|
-
import { MutationKey, QueryKey } from './chunk-
|
|
1
|
+
import { queryGenerator, suspenseQueryGenerator, infiniteQueryGenerator, mutationGenerator } from './chunk-QFITPKDT.js';
|
|
2
|
+
import { MutationKey, QueryKey } from './chunk-JICGDXHM.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';
|
|
@@ -25,14 +25,15 @@ var pluginReactQuery = createPlugin((options) => {
|
|
|
25
25
|
mutation = {},
|
|
26
26
|
query = {},
|
|
27
27
|
mutationKey = MutationKey.getTransformer,
|
|
28
|
-
queryKey = QueryKey.getTransformer
|
|
28
|
+
queryKey = QueryKey.getTransformer,
|
|
29
|
+
paramsCasing
|
|
29
30
|
} = options;
|
|
30
31
|
return {
|
|
31
32
|
name: pluginReactQueryName,
|
|
32
33
|
options: {
|
|
33
34
|
output,
|
|
34
35
|
client: {
|
|
35
|
-
importPath: "@kubb/plugin-client/
|
|
36
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
36
37
|
dataReturnType: "data",
|
|
37
38
|
...options.client
|
|
38
39
|
},
|
|
@@ -58,6 +59,7 @@ var pluginReactQuery = createPlugin((options) => {
|
|
|
58
59
|
paramsType,
|
|
59
60
|
pathParamsType: paramsType === "object" ? "object" : pathParamsType,
|
|
60
61
|
parser,
|
|
62
|
+
paramsCasing,
|
|
61
63
|
group
|
|
62
64
|
},
|
|
63
65
|
pre: [pluginOasName, pluginTsName, parser === "zod" ? pluginZodName : void 0].filter(Boolean),
|