@kubb/plugin-swr 4.31.0 → 4.31.1
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/components.d.ts +4 -3
- package/dist/generators.d.ts +4 -3
- package/dist/index.d.ts +2 -1
- package/package.json +9 -9
- package/dist/types-wR9RZTnh.d.ts +0 -144
package/dist/components.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as __name } from "./chunk-DKWOrOAv.js";
|
|
2
|
+
import { n as PluginSwr, r as Transformer } from "./types-CuBoU7mG.js";
|
|
3
3
|
import { OperationSchemas } from "@kubb/plugin-oas";
|
|
4
|
-
import {
|
|
4
|
+
import { Operation } from "@kubb/oas";
|
|
5
5
|
import { FunctionParams } from "@kubb/react-fabric";
|
|
6
|
+
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
6
7
|
|
|
7
8
|
//#region src/components/Mutation.d.ts
|
|
8
9
|
type Props$4 = {
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
1
|
+
import { t as __name } from "./chunk-DKWOrOAv.js";
|
|
2
|
+
import { n as PluginSwr } from "./types-CuBoU7mG.js";
|
|
4
3
|
import { BaseGenerator, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
|
|
4
|
+
import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
|
|
5
5
|
import { Fabric } from "@kubb/react-fabric";
|
|
6
6
|
import { AsyncEventEmitter } from "@kubb/core/utils";
|
|
7
|
+
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
7
8
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
8
9
|
|
|
9
10
|
//#region ../plugin-oas/src/types.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __name } from "./chunk-DKWOrOAv.js";
|
|
2
|
+
import { n as PluginSwr, t as Options } from "./types-CuBoU7mG.js";
|
|
2
3
|
import * as _kubb_core0 from "@kubb/core";
|
|
3
4
|
|
|
4
5
|
//#region src/plugin.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-swr",
|
|
3
|
-
"version": "4.31.
|
|
3
|
+
"version": "4.31.1",
|
|
4
4
|
"description": "SWR hooks generator plugin for Kubb, creating type-safe data fetching hooks from OpenAPI specifications for React and Next.js applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"swr",
|
|
@@ -74,17 +74,17 @@
|
|
|
74
74
|
}
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@kubb/react-fabric": "0.13.
|
|
77
|
+
"@kubb/react-fabric": "0.13.3",
|
|
78
78
|
"remeda": "^2.33.6",
|
|
79
|
-
"@kubb/
|
|
80
|
-
"@kubb/
|
|
81
|
-
"@kubb/plugin-
|
|
82
|
-
"@kubb/plugin-
|
|
83
|
-
"@kubb/plugin-
|
|
84
|
-
"@kubb/plugin-
|
|
79
|
+
"@kubb/oas": "4.31.1",
|
|
80
|
+
"@kubb/core": "4.31.1",
|
|
81
|
+
"@kubb/plugin-oas": "4.31.1",
|
|
82
|
+
"@kubb/plugin-client": "4.31.1",
|
|
83
|
+
"@kubb/plugin-zod": "4.31.1",
|
|
84
|
+
"@kubb/plugin-ts": "4.31.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@kubb/react-fabric": "0.13.
|
|
87
|
+
"@kubb/react-fabric": "0.13.3"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": ">=20"
|
package/dist/types-wR9RZTnh.d.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { HttpMethod, Oas, Operation, contentType } from "@kubb/oas";
|
|
2
|
-
import { Exclude, Include, OperationSchemas, Override, ResolvePathOptions } from "@kubb/plugin-oas";
|
|
3
|
-
import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
|
|
4
|
-
import { ClientImportPath, PluginClient } from "@kubb/plugin-client";
|
|
5
|
-
import { Generator } from "@kubb/plugin-oas/generators";
|
|
6
|
-
|
|
7
|
-
//#region \0rolldown/runtime.js
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/types.d.ts
|
|
10
|
-
type TransformerProps = {
|
|
11
|
-
operation: Operation;
|
|
12
|
-
schemas: OperationSchemas;
|
|
13
|
-
casing: 'camelcase' | undefined;
|
|
14
|
-
};
|
|
15
|
-
type Transformer = (props: TransformerProps) => unknown[];
|
|
16
|
-
/**
|
|
17
|
-
* Customize the queryKey
|
|
18
|
-
*/
|
|
19
|
-
type QueryKey = Transformer;
|
|
20
|
-
/**
|
|
21
|
-
* Customize the mutationKey
|
|
22
|
-
*/
|
|
23
|
-
type MutationKey = Transformer;
|
|
24
|
-
type Query = {
|
|
25
|
-
/**
|
|
26
|
-
* Define which HttpMethods can be used for queries
|
|
27
|
-
* @default ['get']
|
|
28
|
-
*/
|
|
29
|
-
methods?: Array<HttpMethod>;
|
|
30
|
-
/**
|
|
31
|
-
* Path to the useQuery hook for useQuery functionality.
|
|
32
|
-
* Used as `import { useQuery } from '${importPath}'`.
|
|
33
|
-
* Accepts relative and absolute paths.
|
|
34
|
-
* Path is used as-is; relative paths are based on the generated file location.
|
|
35
|
-
* @default 'swr'
|
|
36
|
-
*/
|
|
37
|
-
importPath?: string;
|
|
38
|
-
};
|
|
39
|
-
type Mutation = {
|
|
40
|
-
/**
|
|
41
|
-
* Define which HttpMethods can be used for queries
|
|
42
|
-
* @default ['post', 'put', 'delete', 'patch']
|
|
43
|
-
*/
|
|
44
|
-
methods?: Array<HttpMethod>;
|
|
45
|
-
/**
|
|
46
|
-
* Path to the useQuery hook for useQuery functionality.
|
|
47
|
-
* Used as `import { useQuery } from '${importPath}'`.
|
|
48
|
-
* Accepts relative and absolute paths.
|
|
49
|
-
* Path is used as-is; relative paths are based on the generated file location.
|
|
50
|
-
* @default 'swr/mutation'
|
|
51
|
-
*/
|
|
52
|
-
importPath?: string;
|
|
53
|
-
/**
|
|
54
|
-
* When true, mutation parameters (path params, query params, headers, body) is passed via `trigger()` instead of as hook arguments.
|
|
55
|
-
* This aligns with React Query's mutation pattern where variables are passed when triggering the mutation.
|
|
56
|
-
* @default false
|
|
57
|
-
* @deprecated This will become the default behavior in v5. Set to `true` to opt-in early.
|
|
58
|
-
*/
|
|
59
|
-
paramsToTrigger?: boolean;
|
|
60
|
-
};
|
|
61
|
-
type Options = {
|
|
62
|
-
/**
|
|
63
|
-
* Specify the export location for the files and define the behavior of the output
|
|
64
|
-
* @default { path: 'hooks', barrelType: 'named' }
|
|
65
|
-
*/
|
|
66
|
-
output?: Output<Oas>;
|
|
67
|
-
/**
|
|
68
|
-
* Define which contentType should be used.
|
|
69
|
-
* By default, the first JSON valid mediaType is used
|
|
70
|
-
*/
|
|
71
|
-
contentType?: contentType;
|
|
72
|
-
/**
|
|
73
|
-
* Group the SWR hooks based on the provided name.
|
|
74
|
-
*/
|
|
75
|
-
group?: Group;
|
|
76
|
-
/**
|
|
77
|
-
* Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
|
|
78
|
-
*/
|
|
79
|
-
exclude?: Array<Exclude>;
|
|
80
|
-
/**
|
|
81
|
-
* Array containing include parameters to include tags/operations/methods/paths.
|
|
82
|
-
*/
|
|
83
|
-
include?: Array<Include>;
|
|
84
|
-
/**
|
|
85
|
-
* Array containing override parameters to override `options` based on tags/operations/methods/paths.
|
|
86
|
-
*/
|
|
87
|
-
override?: Array<Override<ResolvedOptions>>;
|
|
88
|
-
client?: ClientImportPath & Pick<PluginClient['options'], 'clientType' | 'dataReturnType' | 'baseURL' | 'bundle' | 'paramsCasing'>;
|
|
89
|
-
queryKey?: QueryKey;
|
|
90
|
-
query?: Query | false;
|
|
91
|
-
mutationKey?: MutationKey;
|
|
92
|
-
mutation?: Mutation | false;
|
|
93
|
-
/**
|
|
94
|
-
* How to style your params, by default no casing is applied
|
|
95
|
-
* - 'camelcase' uses camelcase for the params names
|
|
96
|
-
*/
|
|
97
|
-
paramsCasing?: 'camelcase';
|
|
98
|
-
/**
|
|
99
|
-
* How to pass your params
|
|
100
|
-
* - 'object' returns the params and pathParams as an object.
|
|
101
|
-
* - 'inline' returns the params as comma separated params.
|
|
102
|
-
* @default 'inline'
|
|
103
|
-
*/
|
|
104
|
-
paramsType?: 'object' | 'inline';
|
|
105
|
-
/**
|
|
106
|
-
* How to pass your pathParams.
|
|
107
|
-
* - 'object' returns the pathParams as an object.
|
|
108
|
-
* - 'inline': returns the pathParams as comma separated params.
|
|
109
|
-
* @default 'inline'
|
|
110
|
-
*/
|
|
111
|
-
pathParamsType?: PluginClient['options']['pathParamsType'];
|
|
112
|
-
/**
|
|
113
|
-
* Which parser should be used before returning the data to `swr`.
|
|
114
|
-
* `'zod'` uses `@kubb/plugin-zod` to parse the data.
|
|
115
|
-
*/
|
|
116
|
-
parser?: PluginClient['options']['parser'];
|
|
117
|
-
transformers?: {
|
|
118
|
-
/**
|
|
119
|
-
* Customize the names based on the type that is provided by the plugin.
|
|
120
|
-
*/
|
|
121
|
-
name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Define some generators next to the swr generators
|
|
125
|
-
*/
|
|
126
|
-
generators?: Array<Generator<PluginSwr>>;
|
|
127
|
-
};
|
|
128
|
-
type ResolvedOptions = {
|
|
129
|
-
output: Output<Oas>;
|
|
130
|
-
client: Pick<PluginClient['options'], 'client' | 'clientType' | 'dataReturnType' | 'importPath' | 'baseURL' | 'bundle' | 'paramsCasing'>;
|
|
131
|
-
parser: Required<NonNullable<Options['parser']>>;
|
|
132
|
-
queryKey: QueryKey | undefined;
|
|
133
|
-
query: NonNullable<Required<Query>> | false;
|
|
134
|
-
mutationKey: MutationKey | undefined;
|
|
135
|
-
mutation: (Required<Pick<Mutation, 'methods' | 'importPath'>> & Pick<Mutation, 'paramsToTrigger'>) | false;
|
|
136
|
-
paramsCasing: Options['paramsCasing'];
|
|
137
|
-
paramsType: NonNullable<Options['paramsType']>;
|
|
138
|
-
pathParamsType: NonNullable<Options['pathParamsType']>;
|
|
139
|
-
group: Options['group'];
|
|
140
|
-
};
|
|
141
|
-
type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
142
|
-
//#endregion
|
|
143
|
-
export { __name as i, PluginSwr as n, Transformer as r, Options as t };
|
|
144
|
-
//# sourceMappingURL=types-wR9RZTnh.d.ts.map
|