@kubb/plugin-solid-query 3.10.10 → 3.10.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/{chunk-P7PP4SS2.js → chunk-6MS45DTW.js} +10 -196
- package/dist/chunk-6MS45DTW.js.map +1 -0
- package/dist/chunk-DX7FN4CR.cjs +161 -0
- package/dist/chunk-DX7FN4CR.cjs.map +1 -0
- package/dist/chunk-EBY2GJUJ.js +159 -0
- package/dist/chunk-EBY2GJUJ.js.map +1 -0
- package/dist/{chunk-NUP5RKX7.cjs → chunk-J4MF3435.cjs} +18 -207
- package/dist/chunk-J4MF3435.cjs.map +1 -0
- package/dist/components.cjs +4 -4
- package/dist/components.d.cts +2 -1
- package/dist/components.d.ts +2 -1
- package/dist/components.js +1 -1
- package/dist/generators.cjs +3 -3
- package/dist/generators.d.cts +2 -1
- package/dist/generators.d.ts +2 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/types-Cx6RgBxP.d.cts +114 -0
- package/dist/types-Cx6RgBxP.d.ts +114 -0
- package/package.json +11 -10
- package/src/types.ts +2 -3
- package/dist/chunk-HBJIQLPC.cjs +0 -447
- package/dist/chunk-HBJIQLPC.cjs.map +0 -1
- package/dist/chunk-NUP5RKX7.cjs.map +0 -1
- package/dist/chunk-P7PP4SS2.js.map +0 -1
- package/dist/chunk-SE5LBLVZ.js +0 -441
- package/dist/chunk-SE5LBLVZ.js.map +0 -1
- package/dist/types-6ZuUeFA7.d.cts +0 -391
- package/dist/types-6ZuUeFA7.d.ts +0 -391
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
import { PluginFactoryOptions, Output, Group, ResolveNameParams } from '@kubb/core';
|
|
2
|
-
import { Oas, contentType, Operation, HttpMethod } from '@kubb/oas';
|
|
3
|
-
import { Exclude, Include, Override, Generator, ResolvePathOptions, OperationSchemas } from '@kubb/plugin-oas';
|
|
4
|
-
|
|
5
|
-
type Options$2 = {
|
|
6
|
-
/**
|
|
7
|
-
* Specify the export location for the files and define the behavior of the output
|
|
8
|
-
* @default { path: 'clients', barrelType: 'named' }
|
|
9
|
-
*/
|
|
10
|
-
output?: Output<Oas>;
|
|
11
|
-
/**
|
|
12
|
-
* Define which contentType should be used.
|
|
13
|
-
* By default, the first JSON valid mediaType will be used
|
|
14
|
-
*/
|
|
15
|
-
contentType?: contentType;
|
|
16
|
-
/**
|
|
17
|
-
* Group the clients based on the provided name.
|
|
18
|
-
*/
|
|
19
|
-
group?: Group;
|
|
20
|
-
/**
|
|
21
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
22
|
-
*/
|
|
23
|
-
exclude?: Array<Exclude>;
|
|
24
|
-
/**
|
|
25
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
26
|
-
*/
|
|
27
|
-
include?: Array<Include>;
|
|
28
|
-
/**
|
|
29
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
30
|
-
*/
|
|
31
|
-
override?: Array<Override<ResolvedOptions$2>>;
|
|
32
|
-
/**
|
|
33
|
-
* Create `operations.ts` file with all operations grouped by methods.
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
operations?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Export urls that are used by operation x
|
|
39
|
-
* `export` will make them part of your barrel file
|
|
40
|
-
* false will not make them exportable
|
|
41
|
-
* @example getGetPetByIdUrl
|
|
42
|
-
*/
|
|
43
|
-
urlType?: 'export' | false;
|
|
44
|
-
/**
|
|
45
|
-
* Path to the client import path that will be used to do the API calls.
|
|
46
|
-
* It will be used as `import client from '${client.importPath}'`.
|
|
47
|
-
* It allows both relative and absolute path but be aware that we will not change the path.
|
|
48
|
-
* @default '@kubb/plugin-client/clients/axios'
|
|
49
|
-
*/
|
|
50
|
-
importPath?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Allows you to set a custom base url for all generated calls.
|
|
53
|
-
*/
|
|
54
|
-
baseURL?: string;
|
|
55
|
-
/**
|
|
56
|
-
* ReturnType that will be used when calling the client.
|
|
57
|
-
* - 'data' will return ResponseConfig[data].
|
|
58
|
-
* - 'full' will return ResponseConfig.
|
|
59
|
-
* @default 'data'
|
|
60
|
-
*/
|
|
61
|
-
dataReturnType?: 'data' | 'full';
|
|
62
|
-
/**
|
|
63
|
-
* How to style your params, by default no casing is applied
|
|
64
|
-
* - 'camelcase' will use camelcase for the params names
|
|
65
|
-
*/
|
|
66
|
-
paramsCasing?: 'camelcase';
|
|
67
|
-
/**
|
|
68
|
-
* How to pass your params
|
|
69
|
-
* - 'object' will return the params and pathParams as an object.
|
|
70
|
-
* - 'inline' will return the params as comma separated params.
|
|
71
|
-
* @default 'inline'
|
|
72
|
-
*/
|
|
73
|
-
paramsType?: 'object' | 'inline';
|
|
74
|
-
/**
|
|
75
|
-
* How to pass your pathParams.
|
|
76
|
-
* - 'object' will return the pathParams as an object.
|
|
77
|
-
* - 'inline' will return the pathParams as comma separated params.
|
|
78
|
-
* @default 'inline'
|
|
79
|
-
*/
|
|
80
|
-
pathParamsType?: 'object' | 'inline';
|
|
81
|
-
/**
|
|
82
|
-
* Which parser can be used before returning the data
|
|
83
|
-
* - 'zod' will use `@kubb/plugin-zod` to parse the data.
|
|
84
|
-
* @default 'client'
|
|
85
|
-
*/
|
|
86
|
-
parser?: 'client' | 'zod';
|
|
87
|
-
/**
|
|
88
|
-
* Which client should be used to do the HTTP calls
|
|
89
|
-
* - 'axios' will use `@kubb/plugin-client/clients/axios` to fetch data.
|
|
90
|
-
* - 'fetch' will use `@kubb/plugin-client/clients/fetch` to fetch data.
|
|
91
|
-
* @default 'axios'
|
|
92
|
-
*/
|
|
93
|
-
client?: 'axios' | 'fetch';
|
|
94
|
-
transformers?: {
|
|
95
|
-
/**
|
|
96
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
97
|
-
*/
|
|
98
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Define some generators next to the client generators
|
|
102
|
-
*/
|
|
103
|
-
generators?: Array<Generator<PluginClient>>;
|
|
104
|
-
};
|
|
105
|
-
type ResolvedOptions$2 = {
|
|
106
|
-
output: Output<Oas>;
|
|
107
|
-
group?: Options$2['group'];
|
|
108
|
-
baseURL: string | undefined;
|
|
109
|
-
parser: NonNullable<Options$2['parser']>;
|
|
110
|
-
urlType: NonNullable<Options$2['urlType']>;
|
|
111
|
-
importPath: NonNullable<Options$2['importPath']>;
|
|
112
|
-
dataReturnType: NonNullable<Options$2['dataReturnType']>;
|
|
113
|
-
pathParamsType: NonNullable<Options$2['pathParamsType']>;
|
|
114
|
-
paramsType: NonNullable<Options$2['paramsType']>;
|
|
115
|
-
paramsCasing: Options$2['paramsCasing'];
|
|
116
|
-
};
|
|
117
|
-
type PluginClient = PluginFactoryOptions<'plugin-client', Options$2, ResolvedOptions$2, never, ResolvePathOptions>;
|
|
118
|
-
|
|
119
|
-
type TransformerProps$1 = {
|
|
120
|
-
operation: Operation;
|
|
121
|
-
schemas: OperationSchemas;
|
|
122
|
-
casing: 'camelcase' | undefined;
|
|
123
|
-
};
|
|
124
|
-
type Transformer$1 = (props: TransformerProps$1) => unknown[];
|
|
125
|
-
type Suspense = object;
|
|
126
|
-
/**
|
|
127
|
-
* Customize the queryKey
|
|
128
|
-
*/
|
|
129
|
-
type QueryKey$1 = Transformer$1;
|
|
130
|
-
/**
|
|
131
|
-
* Customize the mutationKey
|
|
132
|
-
*/
|
|
133
|
-
type MutationKey = Transformer$1;
|
|
134
|
-
type Query$1 = {
|
|
135
|
-
/**
|
|
136
|
-
* Define which HttpMethods can be used for queries
|
|
137
|
-
* @default ['get']
|
|
138
|
-
*/
|
|
139
|
-
methods: Array<HttpMethod>;
|
|
140
|
-
/**
|
|
141
|
-
* Path to the useQuery that will be used to do the useQuery functionality.
|
|
142
|
-
* It will be used as `import { useQuery } from '${importPath}'`.
|
|
143
|
-
* It allows both relative and absolute path.
|
|
144
|
-
* the path will be applied as is, so relative path should be based on the file being generated.
|
|
145
|
-
* @default '@tanstack/react-query'
|
|
146
|
-
*/
|
|
147
|
-
importPath?: string;
|
|
148
|
-
};
|
|
149
|
-
type Mutation = {
|
|
150
|
-
/**
|
|
151
|
-
* Define which HttpMethods can be used for mutations
|
|
152
|
-
* @default ['post', 'put', 'delete']
|
|
153
|
-
*/
|
|
154
|
-
methods: Array<HttpMethod>;
|
|
155
|
-
/**
|
|
156
|
-
* Path to the useQuery that will be used to do the useQuery functionality.
|
|
157
|
-
* It will be used as `import { useQuery } from '${importPath}'`.
|
|
158
|
-
* It allows both relative and absolute path.
|
|
159
|
-
* the path will be applied as is, so relative path should be based on the file being generated.
|
|
160
|
-
* @default '@tanstack/react-query'
|
|
161
|
-
*/
|
|
162
|
-
importPath?: string;
|
|
163
|
-
};
|
|
164
|
-
type Infinite = {
|
|
165
|
-
/**
|
|
166
|
-
* Specify the params key used for `pageParam`.
|
|
167
|
-
* @default 'id'
|
|
168
|
-
*/
|
|
169
|
-
queryParam: string;
|
|
170
|
-
/**
|
|
171
|
-
* Which field of the data will be used, set it to undefined when no cursor is known.
|
|
172
|
-
*/
|
|
173
|
-
cursorParam?: string | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* The initial value, the value of the first page.
|
|
176
|
-
* @default 0
|
|
177
|
-
*/
|
|
178
|
-
initialPageParam: unknown;
|
|
179
|
-
};
|
|
180
|
-
type Options$1 = {
|
|
181
|
-
/**
|
|
182
|
-
* Specify the export location for the files and define the behavior of the output
|
|
183
|
-
* @default { path: 'hooks', barrelType: 'named' }
|
|
184
|
-
*/
|
|
185
|
-
output?: Output<Oas>;
|
|
186
|
-
/**
|
|
187
|
-
* Define which contentType should be used.
|
|
188
|
-
* By default, the first JSON valid mediaType will be used
|
|
189
|
-
*/
|
|
190
|
-
contentType?: contentType;
|
|
191
|
-
/**
|
|
192
|
-
* Group the @tanstack/query hooks based on the provided name.
|
|
193
|
-
*/
|
|
194
|
-
group?: Group;
|
|
195
|
-
client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>;
|
|
196
|
-
/**
|
|
197
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
198
|
-
*/
|
|
199
|
-
exclude?: Array<Exclude>;
|
|
200
|
-
/**
|
|
201
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
202
|
-
*/
|
|
203
|
-
include?: Array<Include>;
|
|
204
|
-
/**
|
|
205
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
206
|
-
*/
|
|
207
|
-
override?: Array<Override<ResolvedOptions$1>>;
|
|
208
|
-
/**
|
|
209
|
-
* How to style your params, by default no casing is applied
|
|
210
|
-
* - 'camelcase' will use camelcase for the params names
|
|
211
|
-
*/
|
|
212
|
-
paramsCasing?: 'camelcase';
|
|
213
|
-
/**
|
|
214
|
-
* How to pass your params
|
|
215
|
-
* - 'object' will return the params and pathParams as an object.
|
|
216
|
-
* - 'inline' will return the params as comma separated params.
|
|
217
|
-
* @default 'inline'
|
|
218
|
-
*/
|
|
219
|
-
paramsType?: 'object' | 'inline';
|
|
220
|
-
/**
|
|
221
|
-
* How to pass your pathParams.
|
|
222
|
-
* - 'object' will return the pathParams as an object.
|
|
223
|
-
* - 'inline' will return the pathParams as comma separated params.
|
|
224
|
-
* @default 'inline'
|
|
225
|
-
*/
|
|
226
|
-
pathParamsType?: PluginClient['options']['pathParamsType'];
|
|
227
|
-
/**
|
|
228
|
-
* When set, an infiniteQuery hooks will be added.
|
|
229
|
-
*/
|
|
230
|
-
infinite?: Partial<Infinite> | false;
|
|
231
|
-
/**
|
|
232
|
-
* When set, a suspenseQuery hooks will be added.
|
|
233
|
-
*/
|
|
234
|
-
suspense?: Partial<Suspense> | false;
|
|
235
|
-
queryKey?: QueryKey$1;
|
|
236
|
-
/**
|
|
237
|
-
* Override some useQuery behaviours.
|
|
238
|
-
*/
|
|
239
|
-
query?: Partial<Query$1> | false;
|
|
240
|
-
mutationKey?: MutationKey;
|
|
241
|
-
/**
|
|
242
|
-
* Override some useMutation behaviours.
|
|
243
|
-
*/
|
|
244
|
-
mutation?: Partial<Mutation> | false;
|
|
245
|
-
/**
|
|
246
|
-
* Which parser should be used before returning the data to `@tanstack/query`.
|
|
247
|
-
* `'zod'` will use `@kubb/plugin-zod` to parse the data.
|
|
248
|
-
*/
|
|
249
|
-
parser?: PluginClient['options']['parser'];
|
|
250
|
-
transformers?: {
|
|
251
|
-
/**
|
|
252
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
253
|
-
*/
|
|
254
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
255
|
-
};
|
|
256
|
-
/**
|
|
257
|
-
* Define some generators next to the react-query generators
|
|
258
|
-
*/
|
|
259
|
-
generators?: Array<Generator<PluginReactQuery>>;
|
|
260
|
-
};
|
|
261
|
-
type ResolvedOptions$1 = {
|
|
262
|
-
output: Output<Oas>;
|
|
263
|
-
group: Options$1['group'];
|
|
264
|
-
client: Required<Omit<NonNullable<PluginReactQuery['options']['client']>, 'baseURL'>> & {
|
|
265
|
-
baseURL?: string;
|
|
266
|
-
};
|
|
267
|
-
parser: Required<NonNullable<Options$1['parser']>>;
|
|
268
|
-
pathParamsType: NonNullable<Options$1['pathParamsType']>;
|
|
269
|
-
paramsCasing: Options$1['paramsCasing'];
|
|
270
|
-
paramsType: NonNullable<Options$1['paramsType']>;
|
|
271
|
-
/**
|
|
272
|
-
* Only used of infinite
|
|
273
|
-
*/
|
|
274
|
-
infinite: NonNullable<Infinite> | false;
|
|
275
|
-
suspense: Suspense | false;
|
|
276
|
-
queryKey: QueryKey$1 | undefined;
|
|
277
|
-
query: NonNullable<Required<Query$1>> | false;
|
|
278
|
-
mutationKey: MutationKey | undefined;
|
|
279
|
-
mutation: NonNullable<Required<Mutation>> | false;
|
|
280
|
-
};
|
|
281
|
-
type PluginReactQuery = PluginFactoryOptions<'plugin-react-query', Options$1, ResolvedOptions$1, never, ResolvePathOptions>;
|
|
282
|
-
|
|
283
|
-
type TransformerProps = {
|
|
284
|
-
operation: Operation;
|
|
285
|
-
schemas: OperationSchemas;
|
|
286
|
-
casing: 'camelcase' | undefined;
|
|
287
|
-
};
|
|
288
|
-
type Transformer = (props: TransformerProps) => unknown[];
|
|
289
|
-
/**
|
|
290
|
-
* Customize the queryKey
|
|
291
|
-
*/
|
|
292
|
-
type QueryKey = Transformer;
|
|
293
|
-
type Query = {
|
|
294
|
-
/**
|
|
295
|
-
* Define which HttpMethods can be used for queries
|
|
296
|
-
* @default ['get']
|
|
297
|
-
*/
|
|
298
|
-
methods: Array<HttpMethod>;
|
|
299
|
-
/**
|
|
300
|
-
* Path to the useQuery that will be used to do the useQuery functionality.
|
|
301
|
-
* It will be used as `import { useQuery } from '${importPath}'`.
|
|
302
|
-
* It allows both relative and absolute path.
|
|
303
|
-
* the path will be applied as is, so relative path should be based on the file being generated.
|
|
304
|
-
* @default '@tanstack/svelte-query'
|
|
305
|
-
*/
|
|
306
|
-
importPath?: string;
|
|
307
|
-
};
|
|
308
|
-
type Options = {
|
|
309
|
-
/**
|
|
310
|
-
* Specify the export location for the files and define the behavior of the output
|
|
311
|
-
* @default { path: 'hooks', barrelType: 'named' }
|
|
312
|
-
*/
|
|
313
|
-
output?: Output<Oas>;
|
|
314
|
-
/**
|
|
315
|
-
* Define which contentType should be used.
|
|
316
|
-
* By default, the first JSON valid mediaType will be used
|
|
317
|
-
*/
|
|
318
|
-
contentType?: contentType;
|
|
319
|
-
/**
|
|
320
|
-
* Group the @tanstack/query hooks based on the provided name.
|
|
321
|
-
*/
|
|
322
|
-
group?: Group;
|
|
323
|
-
client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>;
|
|
324
|
-
/**
|
|
325
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
326
|
-
*/
|
|
327
|
-
exclude?: Array<Exclude>;
|
|
328
|
-
/**
|
|
329
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
330
|
-
*/
|
|
331
|
-
include?: Array<Include>;
|
|
332
|
-
/**
|
|
333
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
334
|
-
*/
|
|
335
|
-
override?: Array<Override<ResolvedOptions>>;
|
|
336
|
-
/**
|
|
337
|
-
* How to style your params, by default no casing is applied
|
|
338
|
-
* - 'camelcase' will use camelcase for the params names
|
|
339
|
-
*/
|
|
340
|
-
paramsCasing?: 'camelcase';
|
|
341
|
-
/**
|
|
342
|
-
* How to pass your params
|
|
343
|
-
* - 'object' will return the params and pathParams as an object.
|
|
344
|
-
* - 'inline' will return the params as comma separated params.
|
|
345
|
-
* @default 'inline'
|
|
346
|
-
*/
|
|
347
|
-
paramsType?: 'object' | 'inline';
|
|
348
|
-
/**
|
|
349
|
-
* How to pass your pathParams.
|
|
350
|
-
* - 'object' will return the pathParams as an object.
|
|
351
|
-
* - 'inline' will return the pathParams as comma separated params.
|
|
352
|
-
* @default 'inline'
|
|
353
|
-
*/
|
|
354
|
-
pathParamsType?: PluginClient['options']['pathParamsType'];
|
|
355
|
-
queryKey?: QueryKey;
|
|
356
|
-
/**
|
|
357
|
-
* Override some useQuery behaviours.
|
|
358
|
-
*/
|
|
359
|
-
query?: Partial<Query> | false;
|
|
360
|
-
/**
|
|
361
|
-
* Which parser should be used before returning the data to `@tanstack/query`.
|
|
362
|
-
* `'zod'` will use `@kubb/plugin-zod` to parse the data.
|
|
363
|
-
*/
|
|
364
|
-
parser?: PluginClient['options']['parser'];
|
|
365
|
-
transformers?: {
|
|
366
|
-
/**
|
|
367
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
368
|
-
*/
|
|
369
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
370
|
-
};
|
|
371
|
-
/**
|
|
372
|
-
* Define some generators next to the solid-query generators
|
|
373
|
-
*/
|
|
374
|
-
generators?: Array<Generator<PluginSolidQuery>>;
|
|
375
|
-
};
|
|
376
|
-
type ResolvedOptions = {
|
|
377
|
-
output: Output<Oas>;
|
|
378
|
-
group: Options['group'];
|
|
379
|
-
client: Required<Omit<NonNullable<PluginReactQuery['options']['client']>, 'baseURL'>> & {
|
|
380
|
-
baseURL?: string;
|
|
381
|
-
};
|
|
382
|
-
parser: Required<NonNullable<Options['parser']>>;
|
|
383
|
-
paramsCasing: Options['paramsCasing'];
|
|
384
|
-
paramsType: NonNullable<Options['paramsType']>;
|
|
385
|
-
pathParamsType: NonNullable<Options['pathParamsType']>;
|
|
386
|
-
queryKey: QueryKey | undefined;
|
|
387
|
-
query: NonNullable<Required<Query>> | false;
|
|
388
|
-
};
|
|
389
|
-
type PluginSolidQuery = PluginFactoryOptions<'plugin-solid-query', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
390
|
-
|
|
391
|
-
export type { Options as O, PluginSolidQuery as P, Transformer as T };
|