@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.
@@ -0,0 +1,114 @@
1
+ import { Output, Group, PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
2
+ import { Oas, contentType, Operation, HttpMethod } from '@kubb/oas';
3
+ import { PluginClient } from '@kubb/plugin-client';
4
+ import { Exclude, Include, Override, ResolvePathOptions, OperationSchemas, Generator } from '@kubb/plugin-oas';
5
+
6
+ type TransformerProps = {
7
+ operation: Operation;
8
+ schemas: OperationSchemas;
9
+ casing: 'camelcase' | undefined;
10
+ };
11
+ type Transformer = (props: TransformerProps) => unknown[];
12
+ /**
13
+ * Customize the queryKey
14
+ */
15
+ type QueryKey = Transformer;
16
+ type Query = {
17
+ /**
18
+ * Define which HttpMethods can be used for queries
19
+ * @default ['get']
20
+ */
21
+ methods: Array<HttpMethod>;
22
+ /**
23
+ * Path to the useQuery that will be used to do the useQuery functionality.
24
+ * It will be used as `import { useQuery } from '${importPath}'`.
25
+ * It allows both relative and absolute path.
26
+ * the path will be applied as is, so relative path should be based on the file being generated.
27
+ * @default '@tanstack/svelte-query'
28
+ */
29
+ importPath?: string;
30
+ };
31
+ type Options = {
32
+ /**
33
+ * Specify the export location for the files and define the behavior of the output
34
+ * @default { path: 'hooks', barrelType: 'named' }
35
+ */
36
+ output?: Output<Oas>;
37
+ /**
38
+ * Define which contentType should be used.
39
+ * By default, the first JSON valid mediaType will be used
40
+ */
41
+ contentType?: contentType;
42
+ /**
43
+ * Group the @tanstack/query hooks based on the provided name.
44
+ */
45
+ group?: Group;
46
+ client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>;
47
+ /**
48
+ * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
49
+ */
50
+ exclude?: Array<Exclude>;
51
+ /**
52
+ * Array containing include parameters to include tags/operations/methods/paths.
53
+ */
54
+ include?: Array<Include>;
55
+ /**
56
+ * Array containing override parameters to override `options` based on tags/operations/methods/paths.
57
+ */
58
+ override?: Array<Override<ResolvedOptions>>;
59
+ /**
60
+ * How to style your params, by default no casing is applied
61
+ * - 'camelcase' will use camelcase for the params names
62
+ */
63
+ paramsCasing?: 'camelcase';
64
+ /**
65
+ * How to pass your params
66
+ * - 'object' will return the params and pathParams as an object.
67
+ * - 'inline' will return the params as comma separated params.
68
+ * @default 'inline'
69
+ */
70
+ paramsType?: 'object' | 'inline';
71
+ /**
72
+ * How to pass your pathParams.
73
+ * - 'object' will return the pathParams as an object.
74
+ * - 'inline' will return the pathParams as comma separated params.
75
+ * @default 'inline'
76
+ */
77
+ pathParamsType?: PluginClient['options']['pathParamsType'];
78
+ queryKey?: QueryKey;
79
+ /**
80
+ * Override some useQuery behaviours.
81
+ */
82
+ query?: Partial<Query> | false;
83
+ /**
84
+ * Which parser should be used before returning the data to `@tanstack/query`.
85
+ * `'zod'` will use `@kubb/plugin-zod` to parse the data.
86
+ */
87
+ parser?: PluginClient['options']['parser'];
88
+ transformers?: {
89
+ /**
90
+ * Customize the names based on the type that is provided by the plugin.
91
+ */
92
+ name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
93
+ };
94
+ /**
95
+ * Define some generators next to the solid-query generators
96
+ */
97
+ generators?: Array<Generator<PluginSolidQuery>>;
98
+ };
99
+ type ResolvedOptions = {
100
+ output: Output<Oas>;
101
+ group: Options['group'];
102
+ client: Required<Omit<NonNullable<PluginSolidQuery['options']['client']>, 'baseURL'>> & {
103
+ baseURL?: string;
104
+ };
105
+ parser: Required<NonNullable<Options['parser']>>;
106
+ paramsCasing: Options['paramsCasing'];
107
+ paramsType: NonNullable<Options['paramsType']>;
108
+ pathParamsType: NonNullable<Options['pathParamsType']>;
109
+ queryKey: QueryKey | undefined;
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, Transformer as T };
@@ -0,0 +1,114 @@
1
+ import { Output, Group, PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
2
+ import { Oas, contentType, Operation, HttpMethod } from '@kubb/oas';
3
+ import { PluginClient } from '@kubb/plugin-client';
4
+ import { Exclude, Include, Override, ResolvePathOptions, OperationSchemas, Generator } from '@kubb/plugin-oas';
5
+
6
+ type TransformerProps = {
7
+ operation: Operation;
8
+ schemas: OperationSchemas;
9
+ casing: 'camelcase' | undefined;
10
+ };
11
+ type Transformer = (props: TransformerProps) => unknown[];
12
+ /**
13
+ * Customize the queryKey
14
+ */
15
+ type QueryKey = Transformer;
16
+ type Query = {
17
+ /**
18
+ * Define which HttpMethods can be used for queries
19
+ * @default ['get']
20
+ */
21
+ methods: Array<HttpMethod>;
22
+ /**
23
+ * Path to the useQuery that will be used to do the useQuery functionality.
24
+ * It will be used as `import { useQuery } from '${importPath}'`.
25
+ * It allows both relative and absolute path.
26
+ * the path will be applied as is, so relative path should be based on the file being generated.
27
+ * @default '@tanstack/svelte-query'
28
+ */
29
+ importPath?: string;
30
+ };
31
+ type Options = {
32
+ /**
33
+ * Specify the export location for the files and define the behavior of the output
34
+ * @default { path: 'hooks', barrelType: 'named' }
35
+ */
36
+ output?: Output<Oas>;
37
+ /**
38
+ * Define which contentType should be used.
39
+ * By default, the first JSON valid mediaType will be used
40
+ */
41
+ contentType?: contentType;
42
+ /**
43
+ * Group the @tanstack/query hooks based on the provided name.
44
+ */
45
+ group?: Group;
46
+ client?: Pick<PluginClient['options'], 'dataReturnType' | 'importPath' | 'baseURL'>;
47
+ /**
48
+ * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
49
+ */
50
+ exclude?: Array<Exclude>;
51
+ /**
52
+ * Array containing include parameters to include tags/operations/methods/paths.
53
+ */
54
+ include?: Array<Include>;
55
+ /**
56
+ * Array containing override parameters to override `options` based on tags/operations/methods/paths.
57
+ */
58
+ override?: Array<Override<ResolvedOptions>>;
59
+ /**
60
+ * How to style your params, by default no casing is applied
61
+ * - 'camelcase' will use camelcase for the params names
62
+ */
63
+ paramsCasing?: 'camelcase';
64
+ /**
65
+ * How to pass your params
66
+ * - 'object' will return the params and pathParams as an object.
67
+ * - 'inline' will return the params as comma separated params.
68
+ * @default 'inline'
69
+ */
70
+ paramsType?: 'object' | 'inline';
71
+ /**
72
+ * How to pass your pathParams.
73
+ * - 'object' will return the pathParams as an object.
74
+ * - 'inline' will return the pathParams as comma separated params.
75
+ * @default 'inline'
76
+ */
77
+ pathParamsType?: PluginClient['options']['pathParamsType'];
78
+ queryKey?: QueryKey;
79
+ /**
80
+ * Override some useQuery behaviours.
81
+ */
82
+ query?: Partial<Query> | false;
83
+ /**
84
+ * Which parser should be used before returning the data to `@tanstack/query`.
85
+ * `'zod'` will use `@kubb/plugin-zod` to parse the data.
86
+ */
87
+ parser?: PluginClient['options']['parser'];
88
+ transformers?: {
89
+ /**
90
+ * Customize the names based on the type that is provided by the plugin.
91
+ */
92
+ name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
93
+ };
94
+ /**
95
+ * Define some generators next to the solid-query generators
96
+ */
97
+ generators?: Array<Generator<PluginSolidQuery>>;
98
+ };
99
+ type ResolvedOptions = {
100
+ output: Output<Oas>;
101
+ group: Options['group'];
102
+ client: Required<Omit<NonNullable<PluginSolidQuery['options']['client']>, 'baseURL'>> & {
103
+ baseURL?: string;
104
+ };
105
+ parser: Required<NonNullable<Options['parser']>>;
106
+ paramsCasing: Options['paramsCasing'];
107
+ paramsType: NonNullable<Options['paramsType']>;
108
+ pathParamsType: NonNullable<Options['pathParamsType']>;
109
+ queryKey: QueryKey | undefined;
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, Transformer as T };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-solid-query",
3
- "version": "3.10.10",
3
+ "version": "3.10.11",
4
4
  "description": "Generator solid-query hooks",
5
5
  "keywords": [
6
6
  "faker",
@@ -62,21 +62,22 @@
62
62
  "!/**/__tests__/**"
63
63
  ],
64
64
  "dependencies": {
65
- "remeda": "^2.21.3",
66
- "@kubb/core": "3.10.10",
67
- "@kubb/oas": "3.10.10",
68
- "@kubb/plugin-oas": "3.10.10",
69
- "@kubb/plugin-ts": "3.10.10",
70
- "@kubb/plugin-zod": "3.10.10",
71
- "@kubb/react": "3.10.10"
65
+ "remeda": "^2.21.4",
66
+ "@kubb/core": "3.10.11",
67
+ "@kubb/oas": "3.10.11",
68
+ "@kubb/plugin-client": "3.10.11",
69
+ "@kubb/plugin-oas": "3.10.11",
70
+ "@kubb/plugin-ts": "3.10.11",
71
+ "@kubb/plugin-zod": "3.10.11",
72
+ "@kubb/react": "3.10.11"
72
73
  },
73
74
  "devDependencies": {
74
75
  "@types/react": "^18.3.21",
75
76
  "react": "^18.3.1",
76
77
  "tsup": "^8.4.0",
77
78
  "typescript": "^5.8.3",
78
- "@kubb/config-ts": "3.10.10",
79
- "@kubb/config-tsup": "3.10.10"
79
+ "@kubb/config-ts": "3.10.11",
80
+ "@kubb/config-tsup": "3.10.11"
80
81
  },
81
82
  "peerDependencies": {
82
83
  "@kubb/react": "^3.0.0"
package/src/types.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import type { Group, Output, PluginFactoryOptions, ResolveNameParams } from '@kubb/core'
2
2
 
3
- import type { HttpMethod, Oas, Operation, contentType } from '@kubb/oas'
3
+ import type { contentType, HttpMethod, Oas, Operation } from '@kubb/oas'
4
4
  import type { PluginClient } from '@kubb/plugin-client'
5
5
  import type { Exclude, Generator, Include, OperationSchemas, Override, ResolvePathOptions } from '@kubb/plugin-oas'
6
- import type { PluginReactQuery } from '@kubb/plugin-react-query'
7
6
 
8
7
  type TransformerProps = {
9
8
  operation: Operation
@@ -107,7 +106,7 @@ export type Options = {
107
106
  type ResolvedOptions = {
108
107
  output: Output<Oas>
109
108
  group: Options['group']
110
- client: Required<Omit<NonNullable<PluginReactQuery['options']['client']>, 'baseURL'>> & { baseURL?: string }
109
+ client: Required<Omit<NonNullable<PluginSolidQuery['options']['client']>, 'baseURL'>> & { baseURL?: string }
111
110
  parser: Required<NonNullable<Options['parser']>>
112
111
  paramsCasing: Options['paramsCasing']
113
112
  paramsType: NonNullable<Options['paramsType']>