@kubb/plugin-solid-query 3.0.0-alpha.31 → 3.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/dist/{chunk-KFG7HL6L.js → chunk-2B3CNYIU.js} +121 -18
  3. package/dist/chunk-2B3CNYIU.js.map +1 -0
  4. package/dist/{chunk-QGUTANLN.cjs → chunk-HUXVNH7U.cjs} +19 -14
  5. package/dist/chunk-HUXVNH7U.cjs.map +1 -0
  6. package/dist/{chunk-P7AOAIRQ.js → chunk-QBNAYIIT.js} +13 -8
  7. package/dist/chunk-QBNAYIIT.js.map +1 -0
  8. package/dist/{chunk-PZTHP4L4.cjs → chunk-SEUXRTS6.cjs} +121 -18
  9. package/dist/chunk-SEUXRTS6.cjs.map +1 -0
  10. package/dist/components.cjs +4 -4
  11. package/dist/components.d.cts +9 -5
  12. package/dist/components.d.ts +9 -5
  13. package/dist/components.js +1 -1
  14. package/dist/generators.cjs +3 -3
  15. package/dist/generators.d.cts +1 -1
  16. package/dist/generators.d.ts +1 -1
  17. package/dist/generators.js +2 -2
  18. package/dist/index.cjs +6 -5
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +5 -4
  23. package/dist/index.js.map +1 -1
  24. package/dist/types-Dkr7mW4t.d.cts +176 -0
  25. package/dist/types-Dkr7mW4t.d.ts +176 -0
  26. package/package.json +14 -14
  27. package/src/components/Query.tsx +62 -6
  28. package/src/components/QueryOptions.tsx +47 -7
  29. package/src/generators/__snapshots__/findByTagsObject.ts +61 -0
  30. package/src/generators/queryGenerator.tsx +3 -1
  31. package/src/plugin.ts +3 -2
  32. package/src/types.ts +18 -40
  33. package/dist/chunk-KFG7HL6L.js.map +0 -1
  34. package/dist/chunk-P7AOAIRQ.js.map +0 -1
  35. package/dist/chunk-PZTHP4L4.cjs.map +0 -1
  36. package/dist/chunk-QGUTANLN.cjs.map +0 -1
  37. package/dist/types-C9PoljlD.d.cts +0 -114
  38. package/dist/types-C9PoljlD.d.ts +0 -114
@@ -1,114 +0,0 @@
1
- import { PluginFactoryOptions, Output, Group, ResolveNameParams } from '@kubb/core';
2
- import { HttpMethod } from '@kubb/oas';
3
- import { ResolvePathOptions, Exclude, Include, Override, Generator } from '@kubb/plugin-oas';
4
-
5
- type Query = {
6
- /**
7
- * Customize the queryKey, here you can specify a suffix.
8
- */
9
- key: (key: unknown[]) => unknown[];
10
- /**
11
- * Define which HttpMethods can be used for queries
12
- * @default ['get']
13
- */
14
- methods: Array<HttpMethod>;
15
- /**
16
- * Path to the useQuery that will be used to do the useQuery functionality.
17
- * It will be used as `import { useQuery } from '${importPath}'`.
18
- * It allows both relative and absolute path.
19
- * the path will be applied as is, so relative path should be based on the file being generated.
20
- * @default '@tanstack/svelte-query'
21
- */
22
- importPath?: string;
23
- };
24
- type Options = {
25
- /**
26
- * @default 'hooks'
27
- */
28
- output?: Output;
29
- /**
30
- * Group the @tanstack/query hooks based on the provided name.
31
- */
32
- group?: Group;
33
- client?: {
34
- /**
35
- * Path to the client that will be used to do the API calls.
36
- * It will be used as `import client from '${client.importPath}'`.
37
- * It allows both relative and absolute path.
38
- * the path will be applied as is, so relative path should be based on the file being generated.
39
- * @default '@kubb/plugin-client/client'
40
- */
41
- importPath?: string;
42
- /**
43
- * ReturnType that needs to be used when calling client().
44
- *
45
- * `Data` will return ResponseConfig[data].
46
- *
47
- * `Full` will return ResponseConfig.
48
- * @default `'data'`
49
- * @private
50
- */
51
- dataReturnType?: 'data' | 'full';
52
- };
53
- /**
54
- * ReturnType that needs to be used when calling client().
55
- *
56
- * `Data` will return ResponseConfig[data].
57
- *
58
- * `Full` will return ResponseConfig.
59
- * @default `'data'`
60
- * @private
61
- */
62
- /**
63
- * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
64
- */
65
- exclude?: Array<Exclude>;
66
- /**
67
- * Array containing include parameters to include tags/operations/methods/paths.
68
- */
69
- include?: Array<Include>;
70
- /**
71
- * Array containing override parameters to override `options` based on tags/operations/methods/paths.
72
- */
73
- override?: Array<Override<ResolvedOptions>>;
74
- /**
75
- * How to pass your pathParams.
76
- *
77
- * `object` will return the pathParams as an object.
78
- *
79
- * `inline` will return the pathParams as comma separated params.
80
- * @default `'inline'`
81
- * @private
82
- */
83
- pathParamsType?: 'object' | 'inline';
84
- /**
85
- * Override some useQuery behaviours.
86
- */
87
- query?: Partial<Query> | false;
88
- /**
89
- * Which parser can be used before returning the data to `@tanstack/query`.
90
- * `'zod'` will use `@kubb/plugin-zod` to parse the data.
91
- */
92
- parser?: 'client' | 'zod';
93
- transformers?: {
94
- /**
95
- * Customize the names based on the type that is provided by the plugin.
96
- */
97
- name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
98
- };
99
- /**
100
- * Define some generators next to the solid-query generators
101
- */
102
- generators?: Array<Generator<PluginSolidQuery>>;
103
- };
104
- type ResolvedOptions = {
105
- output: Output;
106
- baseURL: string | undefined;
107
- client: Required<NonNullable<PluginSolidQuery['options']['client']>>;
108
- parser: Required<NonNullable<Options['parser']>>;
109
- pathParamsType: NonNullable<Options['pathParamsType']>;
110
- query: NonNullable<Required<Query>> | false;
111
- };
112
- type PluginSolidQuery = PluginFactoryOptions<'plugin-solid-query', Options, ResolvedOptions, never, ResolvePathOptions>;
113
-
114
- export type { Options as O, PluginSolidQuery as P };