@kubb/plugin-svelte-query 3.0.14 → 3.2.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-TOBORUCM.js → chunk-BB5SCJJT.js} +10 -3
- package/dist/chunk-BB5SCJJT.js.map +1 -0
- package/dist/{chunk-F6TRULM6.cjs → chunk-DJNDGHXY.cjs} +17 -10
- package/dist/chunk-DJNDGHXY.cjs.map +1 -0
- package/dist/{chunk-SP3FM442.js → chunk-EZRBBWGF.js} +50 -30
- package/dist/chunk-EZRBBWGF.js.map +1 -0
- package/dist/{chunk-PHEQCKJY.cjs → chunk-YSVAGB5Y.cjs} +50 -30
- package/dist/chunk-YSVAGB5Y.cjs.map +1 -0
- package/dist/components.cjs +6 -6
- package/dist/components.d.cts +17 -9
- package/dist/components.d.ts +17 -9
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +18 -10
- 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 +15 -7
- package/dist/index.js.map +1 -1
- package/dist/{types-B9W9aYra.d.ts → types-CRc4pNA-.d.cts} +22 -0
- package/dist/{types-B9W9aYra.d.cts → types-CRc4pNA-.d.ts} +22 -0
- package/package.json +11 -11
- 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/generators/mutationGenerator.tsx +3 -0
- package/src/generators/queryGenerator.tsx +4 -0
- package/src/plugin.ts +16 -6
- package/src/types.ts +8 -0
- package/dist/chunk-F6TRULM6.cjs.map +0 -1
- package/dist/chunk-PHEQCKJY.cjs.map +0 -1
- package/dist/chunk-SP3FM442.js.map +0 -1
- package/dist/chunk-TOBORUCM.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QueryKey, Client, QueryOptions, Query, MutationKey, Mutation } from './chunk-
|
|
1
|
+
import { QueryKey, Client, QueryOptions, Query, MutationKey, Mutation } from './chunk-EZRBBWGF.js';
|
|
2
2
|
import { createReactGenerator } from '@kubb/plugin-oas';
|
|
3
3
|
import { useOperationManager } from '@kubb/plugin-oas/hooks';
|
|
4
4
|
import { pluginTsName } from '@kubb/plugin-ts';
|
|
@@ -77,6 +77,7 @@ var queryGenerator = createReactGenerator({
|
|
|
77
77
|
operation,
|
|
78
78
|
pathParamsType: options.pathParamsType,
|
|
79
79
|
typeSchemas: type.schemas,
|
|
80
|
+
paramsCasing: options.paramsCasing,
|
|
80
81
|
transformer: options.queryKey
|
|
81
82
|
}
|
|
82
83
|
),
|
|
@@ -91,6 +92,7 @@ var queryGenerator = createReactGenerator({
|
|
|
91
92
|
typeSchemas: type.schemas,
|
|
92
93
|
zodSchemas: zod.schemas,
|
|
93
94
|
dataReturnType: options.client.dataReturnType,
|
|
95
|
+
paramsCasing: options.paramsCasing,
|
|
94
96
|
paramsType: options.paramsType,
|
|
95
97
|
pathParamsType: options.pathParamsType,
|
|
96
98
|
parser: options.parser
|
|
@@ -104,6 +106,7 @@ var queryGenerator = createReactGenerator({
|
|
|
104
106
|
clientName: client.name,
|
|
105
107
|
queryKeyName: queryKey.name,
|
|
106
108
|
typeSchemas: type.schemas,
|
|
109
|
+
paramsCasing: options.paramsCasing,
|
|
107
110
|
paramsType: options.paramsType,
|
|
108
111
|
pathParamsType: options.pathParamsType
|
|
109
112
|
}
|
|
@@ -119,6 +122,7 @@ var queryGenerator = createReactGenerator({
|
|
|
119
122
|
typeSchemas: type.schemas,
|
|
120
123
|
pathParamsType: options.pathParamsType,
|
|
121
124
|
operation,
|
|
125
|
+
paramsCasing: options.paramsCasing,
|
|
122
126
|
paramsType: options.paramsType,
|
|
123
127
|
dataReturnType: options.client.dataReturnType,
|
|
124
128
|
queryKeyName: queryKey.name,
|
|
@@ -191,6 +195,7 @@ var mutationGenerator = createReactGenerator({
|
|
|
191
195
|
name: mutationKey.name,
|
|
192
196
|
typeName: mutationKey.typeName,
|
|
193
197
|
operation,
|
|
198
|
+
paramsCasing: options.paramsCasing,
|
|
194
199
|
pathParamsType: options.pathParamsType,
|
|
195
200
|
typeSchemas: type.schemas,
|
|
196
201
|
transformer: options.mutationKey
|
|
@@ -207,6 +212,7 @@ var mutationGenerator = createReactGenerator({
|
|
|
207
212
|
typeSchemas: type.schemas,
|
|
208
213
|
zodSchemas: zod.schemas,
|
|
209
214
|
dataReturnType: options.client.dataReturnType,
|
|
215
|
+
paramsCasing: options.paramsCasing,
|
|
210
216
|
paramsType: options.paramsType,
|
|
211
217
|
pathParamsType: options.pathParamsType,
|
|
212
218
|
parser: options.parser
|
|
@@ -223,6 +229,7 @@ var mutationGenerator = createReactGenerator({
|
|
|
223
229
|
typeName: mutation.typeName,
|
|
224
230
|
typeSchemas: type.schemas,
|
|
225
231
|
operation,
|
|
232
|
+
paramsCasing: options.paramsCasing,
|
|
226
233
|
dataReturnType: options.client.dataReturnType,
|
|
227
234
|
paramsType: options.paramsType,
|
|
228
235
|
pathParamsType: options.pathParamsType,
|
|
@@ -235,5 +242,5 @@ var mutationGenerator = createReactGenerator({
|
|
|
235
242
|
});
|
|
236
243
|
|
|
237
244
|
export { mutationGenerator, queryGenerator };
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
239
|
-
//# sourceMappingURL=chunk-
|
|
245
|
+
//# sourceMappingURL=chunk-BB5SCJJT.js.map
|
|
246
|
+
//# sourceMappingURL=chunk-BB5SCJJT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx"],"names":["createReactGenerator","useApp","useOperationManager","difference","pluginTsName","pluginZodName","jsxs","File","jsx","Fragment"],"mappings":";;;;;;;;;AAWO,IAAM,iBAAiB,oBAAwC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AAQ,CAAA,UAAA;AAAA,UACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,UACxB,QAAQ,OAAQ,CAAA;AAAA;AAAA,OAClB;AAAA,MACC,OAAQ,CAAA,QAAA,oBACPF,IAAAA,CAAAG,UAAA,EACE,QAAA,EAAA;AAAA,wBAAAD,GAAAA,CAACD,KAAK,MAAL,EAAA,EAAY,MAAM,CAAC,gBAAgB,CAAG,EAAA,IAAA,EAAM,UAAY,EAAA,CAAA;AAAA,wBACzDC,GAAAA,CAACD,IAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,uBAAA,EAAyB,sBAAsB,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,wBACnGC,GAAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,MAAM,QAAS,CAAA,IAAA;AAAA,YACf,YAAY,MAAO,CAAA,IAAA;AAAA,YACnB,UAAU,QAAS,CAAA,QAAA;AAAA,YACnB,aAAa,IAAK,CAAA,OAAA;AAAA,YAClB,SAAA;AAAA,YACA,cAAc,OAAQ,CAAA,YAAA;AAAA,YACtB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,YAC/B,YAAY,OAAQ,CAAA,UAAA;AAAA,YACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,YACxB,iBAAiB,WAAY,CAAA;AAAA;AAAA;AAC/B,OACF,EAAA;AAAA,KAEJ,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-BB5SCJJT.js","sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginSvelteQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/svelte-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function' }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'CreateBaseQueryOptions', 'CreateQueryResult']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n operation={operation}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginSvelteQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/svelte-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function' }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File baseName={mutation.file.baseName} path={mutation.file.path} meta={mutation.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}\n\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n {options.mutation && (\n <>\n <File.Import name={['createMutation']} path={importPath} />\n <File.Import name={['CreateMutationOptions', 'CreateMutationResult']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYSVAGB5Y_cjs = require('./chunk-YSVAGB5Y.cjs');
|
|
4
4
|
var pluginOas = require('@kubb/plugin-oas');
|
|
5
5
|
var hooks = require('@kubb/plugin-oas/hooks');
|
|
6
6
|
var pluginTs = require('@kubb/plugin-ts');
|
|
@@ -72,18 +72,19 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
74
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
-
|
|
75
|
+
chunkYSVAGB5Y_cjs.QueryKey,
|
|
76
76
|
{
|
|
77
77
|
name: queryKey.name,
|
|
78
78
|
typeName: queryKey.typeName,
|
|
79
79
|
operation,
|
|
80
80
|
pathParamsType: options.pathParamsType,
|
|
81
81
|
typeSchemas: type.schemas,
|
|
82
|
+
paramsCasing: options.paramsCasing,
|
|
82
83
|
transformer: options.queryKey
|
|
83
84
|
}
|
|
84
85
|
),
|
|
85
86
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
|
|
87
|
+
chunkYSVAGB5Y_cjs.Client,
|
|
87
88
|
{
|
|
88
89
|
name: client.name,
|
|
89
90
|
isExportable: false,
|
|
@@ -93,6 +94,7 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
93
94
|
typeSchemas: type.schemas,
|
|
94
95
|
zodSchemas: zod.schemas,
|
|
95
96
|
dataReturnType: options.client.dataReturnType,
|
|
97
|
+
paramsCasing: options.paramsCasing,
|
|
96
98
|
paramsType: options.paramsType,
|
|
97
99
|
pathParamsType: options.pathParamsType,
|
|
98
100
|
parser: options.parser
|
|
@@ -100,12 +102,13 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
100
102
|
),
|
|
101
103
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["queryOptions"], path: importPath }),
|
|
102
104
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
|
|
105
|
+
chunkYSVAGB5Y_cjs.QueryOptions,
|
|
104
106
|
{
|
|
105
107
|
name: queryOptions.name,
|
|
106
108
|
clientName: client.name,
|
|
107
109
|
queryKeyName: queryKey.name,
|
|
108
110
|
typeSchemas: type.schemas,
|
|
111
|
+
paramsCasing: options.paramsCasing,
|
|
109
112
|
paramsType: options.paramsType,
|
|
110
113
|
pathParamsType: options.pathParamsType
|
|
111
114
|
}
|
|
@@ -114,13 +117,14 @@ var queryGenerator = pluginOas.createReactGenerator({
|
|
|
114
117
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createQuery"], path: importPath }),
|
|
115
118
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["QueryKey", "CreateBaseQueryOptions", "CreateQueryResult"], path: importPath, isTypeOnly: true }),
|
|
116
119
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
117
|
-
|
|
120
|
+
chunkYSVAGB5Y_cjs.Query,
|
|
118
121
|
{
|
|
119
122
|
name: query.name,
|
|
120
123
|
queryOptionsName: queryOptions.name,
|
|
121
124
|
typeSchemas: type.schemas,
|
|
122
125
|
pathParamsType: options.pathParamsType,
|
|
123
126
|
operation,
|
|
127
|
+
paramsCasing: options.paramsCasing,
|
|
124
128
|
paramsType: options.paramsType,
|
|
125
129
|
dataReturnType: options.client.dataReturnType,
|
|
126
130
|
queryKeyName: queryKey.name,
|
|
@@ -188,18 +192,19 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
188
192
|
}
|
|
189
193
|
),
|
|
190
194
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
191
|
-
|
|
195
|
+
chunkYSVAGB5Y_cjs.MutationKey,
|
|
192
196
|
{
|
|
193
197
|
name: mutationKey.name,
|
|
194
198
|
typeName: mutationKey.typeName,
|
|
195
199
|
operation,
|
|
200
|
+
paramsCasing: options.paramsCasing,
|
|
196
201
|
pathParamsType: options.pathParamsType,
|
|
197
202
|
typeSchemas: type.schemas,
|
|
198
203
|
transformer: options.mutationKey
|
|
199
204
|
}
|
|
200
205
|
),
|
|
201
206
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
202
|
-
|
|
207
|
+
chunkYSVAGB5Y_cjs.Client,
|
|
203
208
|
{
|
|
204
209
|
name: client.name,
|
|
205
210
|
isExportable: false,
|
|
@@ -209,6 +214,7 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
209
214
|
typeSchemas: type.schemas,
|
|
210
215
|
zodSchemas: zod.schemas,
|
|
211
216
|
dataReturnType: options.client.dataReturnType,
|
|
217
|
+
paramsCasing: options.paramsCasing,
|
|
212
218
|
paramsType: options.paramsType,
|
|
213
219
|
pathParamsType: options.pathParamsType,
|
|
214
220
|
parser: options.parser
|
|
@@ -218,13 +224,14 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
218
224
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["createMutation"], path: importPath }),
|
|
219
225
|
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["CreateMutationOptions", "CreateMutationResult"], path: importPath, isTypeOnly: true }),
|
|
220
226
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
-
|
|
227
|
+
chunkYSVAGB5Y_cjs.Mutation,
|
|
222
228
|
{
|
|
223
229
|
name: mutation.name,
|
|
224
230
|
clientName: client.name,
|
|
225
231
|
typeName: mutation.typeName,
|
|
226
232
|
typeSchemas: type.schemas,
|
|
227
233
|
operation,
|
|
234
|
+
paramsCasing: options.paramsCasing,
|
|
228
235
|
dataReturnType: options.client.dataReturnType,
|
|
229
236
|
paramsType: options.paramsType,
|
|
230
237
|
pathParamsType: options.pathParamsType,
|
|
@@ -238,5 +245,5 @@ var mutationGenerator = pluginOas.createReactGenerator({
|
|
|
238
245
|
|
|
239
246
|
exports.mutationGenerator = mutationGenerator;
|
|
240
247
|
exports.queryGenerator = queryGenerator;
|
|
241
|
-
//# sourceMappingURL=chunk-
|
|
242
|
-
//# sourceMappingURL=chunk-
|
|
248
|
+
//# sourceMappingURL=chunk-DJNDGHXY.cjs.map
|
|
249
|
+
//# sourceMappingURL=chunk-DJNDGHXY.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx"],"names":["createReactGenerator","useApp","useOperationManager","difference","pluginTsName","pluginZodName","File","jsx","QueryKey","Client","QueryOptions","jsxs","Fragment","Query","MutationKey","Mutation"],"mappings":";;;;;;;;;;;AAWO,IAAM,iBAAiBA,8BAAwC,CAAA;AAAA,EACpE,IAAM,EAAA,cAAA;AAAA,EACN,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA;AAAA,QACN,OAAA,EAAS,EAAE,MAAO;AAAA;AACpB,QACEC,YAA0B,EAAA;AAC9B,IAAA,MAAM,EAAE,UAAA,E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AAAL,cAAAA,CAACD,WAAK,MAAL,EAAA,EAAY,MAAM,CAAC,gBAAgB,CAAG,EAAA,IAAA,EAAM,UAAY,EAAA,CAAA;AAAA,wBACzDC,cAAAA,CAACD,UAAK,CAAA,MAAA,EAAL,EAAY,IAAA,EAAM,CAAC,uBAAA,EAAyB,sBAAsB,CAAA,EAAG,IAAM,EAAA,UAAA,EAAY,YAAU,IAAC,EAAA,CAAA;AAAA,wBACnGC,cAAAA;AAAA,UAACQ,0BAAA;AAAA,UAAA;AAAA,YACC,MAAM,QAAS,CAAA,IAAA;AAAA,YACf,YAAY,MAAO,CAAA,IAAA;AAAA,YACnB,UAAU,QAAS,CAAA,QAAA;AAAA,YACnB,aAAa,IAAK,CAAA,OAAA;AAAA,YAClB,SAAA;AAAA,YACA,cAAc,OAAQ,CAAA,YAAA;AAAA,YACtB,cAAA,EAAgB,QAAQ,MAAO,CAAA,cAAA;AAAA,YAC/B,YAAY,OAAQ,CAAA,UAAA;AAAA,YACpB,gBAAgB,OAAQ,CAAA,cAAA;AAAA,YACxB,iBAAiB,WAAY,CAAA;AAAA;AAAA;AAC/B,OACF,EAAA;AAAA,KAEJ,EAAA,CAAA;AAAA;AAGN,CAAC","file":"chunk-DJNDGHXY.cjs","sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginSvelteQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = typeof options.query === 'boolean' ? true : options.query?.methods.some((method) => operation.method === method)\n const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some(\n (method) => operation.method === method,\n )\n const importPath = options.query ? options.query.importPath : '@tanstack/svelte-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function' }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'QueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'QueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'QueryKey' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n if (!isQuery || isMutation) {\n return null\n }\n\n return (\n <File baseName={query.file.baseName} path={query.file.path} meta={query.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={query.file.path} path={zod.file.path} />}\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={query.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n transformer={options.queryKey}\n />\n\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n />\n {options.query && (\n <>\n <File.Import name={['createQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'CreateBaseQueryOptions', 'CreateQueryResult']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n pathParamsType={options.pathParamsType}\n operation={operation}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n dataReturnType={options.client.dataReturnType}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File, useApp } from '@kubb/react'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginSvelteQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginSvelteQuery>({\n name: 'svelte-query',\n Operation({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n } = useApp<PluginSvelteQuery>()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const isQuery = !!options.query && options.query?.methods.some((method) => operation.method === method)\n const isMutation =\n !isQuery &&\n difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method)\n\n const importPath = options.mutation ? options.mutation.importPath : '@tanstack/svelte-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'create' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'create' }),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\n //todo remove type?\n schemas: getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' }),\n }\n\n const zod = {\n file: getFile(operation, { pluginKey: [pluginZodName] }),\n schemas: getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' }),\n }\n\n const client = {\n name: getName(operation, { type: 'function' }),\n }\n\n const mutationKey = {\n name: getName(operation, { type: 'const', suffix: 'MutationKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'MutationKey' }),\n }\n\n if (!isMutation) {\n return null\n }\n\n return (\n <File baseName={mutation.file.baseName} path={mutation.file.path} meta={mutation.file.meta} banner={output?.banner} footer={output?.footer}>\n {options.parser === 'zod' && <File.Import name={[zod.schemas.response.name]} root={mutation.file.path} path={zod.file.path} />}\n\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n name={[\n type.schemas.request?.name,\n type.schemas.response.name,\n type.schemas.pathParams?.name,\n type.schemas.queryParams?.name,\n type.schemas.headerParams?.name,\n ...(type.schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={mutation.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n <Client\n name={client.name}\n isExportable={false}\n isIndexable={false}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n {options.mutation && (\n <>\n <File.Import name={['createMutation']} path={importPath} />\n <File.Import name={['CreateMutationOptions', 'CreateMutationResult']} path={importPath} isTypeOnly />\n <Mutation\n name={mutation.name}\n clientName={client.name}\n typeName={mutation.typeName}\n typeSchemas={type.schemas}\n operation={operation}\n paramsCasing={options.paramsCasing}\n dataReturnType={options.client.dataReturnType}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n"]}
|
|
@@ -5,13 +5,13 @@ import { getComments, getPathParams } from '@kubb/plugin-oas/utils';
|
|
|
5
5
|
import { jsx, jsxs, Fragment } from '@kubb/react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
// src/components/Mutation.tsx
|
|
8
|
-
function getParams({ paramsType, pathParamsType, typeSchemas }) {
|
|
8
|
+
function getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
9
9
|
if (paramsType === "object") {
|
|
10
10
|
return FunctionParams.factory({
|
|
11
11
|
data: {
|
|
12
12
|
mode: "object",
|
|
13
13
|
children: {
|
|
14
|
-
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
14
|
+
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
15
15
|
data: typeSchemas.request?.name ? {
|
|
16
16
|
type: typeSchemas.request?.name,
|
|
17
17
|
optional: isOptional(typeSchemas.request?.schema)
|
|
@@ -35,7 +35,7 @@ function getParams({ paramsType, pathParamsType, typeSchemas }) {
|
|
|
35
35
|
return FunctionParams.factory({
|
|
36
36
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
37
37
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
38
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
38
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
39
39
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
40
40
|
} : void 0,
|
|
41
41
|
data: typeSchemas.request?.name ? {
|
|
@@ -66,10 +66,11 @@ function Client({
|
|
|
66
66
|
parser,
|
|
67
67
|
zodSchemas,
|
|
68
68
|
paramsType,
|
|
69
|
+
paramsCasing,
|
|
69
70
|
pathParamsType,
|
|
70
71
|
operation
|
|
71
72
|
}) {
|
|
72
|
-
const path = new URLPath(operation.path);
|
|
73
|
+
const path = new URLPath(operation.path, { casing: paramsCasing });
|
|
73
74
|
const contentType = operation.getContentType();
|
|
74
75
|
const isFormData = contentType === "multipart/form-data";
|
|
75
76
|
const headers = [
|
|
@@ -81,7 +82,7 @@ function Client({
|
|
|
81
82
|
typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error",
|
|
82
83
|
typeSchemas.request?.name || "unknown"
|
|
83
84
|
].filter(Boolean);
|
|
84
|
-
const params = getParams({ paramsType, pathParamsType, typeSchemas });
|
|
85
|
+
const params = getParams({ paramsType, paramsCasing, pathParamsType, typeSchemas });
|
|
85
86
|
const clientParams = FunctionParams.factory({
|
|
86
87
|
config: {
|
|
87
88
|
mode: "object",
|
|
@@ -145,13 +146,13 @@ Client.getParams = getParams;
|
|
|
145
146
|
function getParams2({}) {
|
|
146
147
|
return FunctionParams.factory({});
|
|
147
148
|
}
|
|
148
|
-
var getTransformer = ({ operation }) => {
|
|
149
|
-
const path = new URLPath(operation.path);
|
|
149
|
+
var getTransformer = ({ operation, casing }) => {
|
|
150
|
+
const path = new URLPath(operation.path, { casing });
|
|
150
151
|
return [JSON.stringify({ url: path.path })].filter(Boolean);
|
|
151
152
|
};
|
|
152
|
-
function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer = getTransformer }) {
|
|
153
|
+
function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }) {
|
|
153
154
|
const params = getParams2({ pathParamsType, typeSchemas });
|
|
154
|
-
const keys = transformer({ operation, schemas: typeSchemas });
|
|
155
|
+
const keys = transformer({ operation, schemas: typeSchemas, casing: paramsCasing });
|
|
155
156
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
157
|
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
157
158
|
/* @__PURE__ */ jsx(File.Source, { name: typeName, isExportable: true, isIndexable: true, isTypeOnly: true, children: /* @__PURE__ */ jsx(Type, { name: typeName, export: true, children: `ReturnType<typeof ${name}>` }) })
|
|
@@ -159,10 +160,10 @@ function MutationKey({ name, typeSchemas, pathParamsType, operation, typeName, t
|
|
|
159
160
|
}
|
|
160
161
|
MutationKey.getParams = getParams2;
|
|
161
162
|
MutationKey.getTransformer = getTransformer;
|
|
162
|
-
function getParams3({ dataReturnType, typeSchemas }) {
|
|
163
|
+
function getParams3({ paramsCasing, dataReturnType, typeSchemas }) {
|
|
163
164
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
164
165
|
const mutationParams = FunctionParams.factory({
|
|
165
|
-
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
166
|
+
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
166
167
|
data: typeSchemas.request?.name ? {
|
|
167
168
|
type: typeSchemas.request?.name,
|
|
168
169
|
optional: isOptional(typeSchemas.request?.schema)
|
|
@@ -189,23 +190,35 @@ function getParams3({ dataReturnType, typeSchemas }) {
|
|
|
189
190
|
}
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
|
-
function Mutation({
|
|
193
|
+
function Mutation({
|
|
194
|
+
name,
|
|
195
|
+
clientName,
|
|
196
|
+
paramsCasing,
|
|
197
|
+
paramsType,
|
|
198
|
+
pathParamsType,
|
|
199
|
+
dataReturnType,
|
|
200
|
+
typeSchemas,
|
|
201
|
+
operation,
|
|
202
|
+
mutationKeyName
|
|
203
|
+
}) {
|
|
193
204
|
const mutationKeyParams = MutationKey.getParams({
|
|
194
205
|
pathParamsType,
|
|
195
206
|
typeSchemas
|
|
196
207
|
});
|
|
197
208
|
const params = getParams3({
|
|
209
|
+
paramsCasing,
|
|
198
210
|
pathParamsType,
|
|
199
211
|
dataReturnType,
|
|
200
212
|
typeSchemas
|
|
201
213
|
});
|
|
202
214
|
const clientParams = Client.getParams({
|
|
215
|
+
paramsCasing,
|
|
203
216
|
paramsType,
|
|
204
217
|
typeSchemas,
|
|
205
218
|
pathParamsType
|
|
206
219
|
});
|
|
207
220
|
const mutationParams = FunctionParams.factory({
|
|
208
|
-
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
221
|
+
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
209
222
|
data: typeSchemas.request?.name ? {
|
|
210
223
|
type: typeSchemas.request?.name,
|
|
211
224
|
optional: isOptional(typeSchemas.request?.schema)
|
|
@@ -262,11 +275,11 @@ function Mutation({ name, clientName, paramsType, pathParamsType, dataReturnType
|
|
|
262
275
|
}
|
|
263
276
|
) });
|
|
264
277
|
}
|
|
265
|
-
function getParams4({ pathParamsType, typeSchemas }) {
|
|
278
|
+
function getParams4({ pathParamsType, paramsCasing, typeSchemas }) {
|
|
266
279
|
return FunctionParams.factory({
|
|
267
280
|
pathParams: {
|
|
268
281
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
269
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true })
|
|
282
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing })
|
|
270
283
|
},
|
|
271
284
|
data: typeSchemas.request?.name ? {
|
|
272
285
|
type: typeSchemas.request?.name,
|
|
@@ -278,8 +291,8 @@ function getParams4({ pathParamsType, typeSchemas }) {
|
|
|
278
291
|
} : void 0
|
|
279
292
|
});
|
|
280
293
|
}
|
|
281
|
-
var getTransformer2 = ({ operation, schemas }) => {
|
|
282
|
-
const path = new URLPath(operation.path);
|
|
294
|
+
var getTransformer2 = ({ operation, schemas, casing }) => {
|
|
295
|
+
const path = new URLPath(operation.path, { casing });
|
|
283
296
|
const keys = [
|
|
284
297
|
path.toObject({
|
|
285
298
|
type: "path",
|
|
@@ -290,11 +303,12 @@ var getTransformer2 = ({ operation, schemas }) => {
|
|
|
290
303
|
].filter(Boolean);
|
|
291
304
|
return keys;
|
|
292
305
|
};
|
|
293
|
-
function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, transformer = getTransformer2 }) {
|
|
294
|
-
const params = getParams4({ pathParamsType, typeSchemas });
|
|
306
|
+
function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer2 }) {
|
|
307
|
+
const params = getParams4({ pathParamsType, paramsCasing, typeSchemas });
|
|
295
308
|
const keys = transformer({
|
|
296
309
|
operation,
|
|
297
|
-
schemas: typeSchemas
|
|
310
|
+
schemas: typeSchemas,
|
|
311
|
+
casing: paramsCasing
|
|
298
312
|
});
|
|
299
313
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
300
314
|
/* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Function.Arrow, { name, export: true, params: params.toConstructor(), singleLine: true, children: `[${keys.join(", ")}] as const` }) }),
|
|
@@ -303,13 +317,13 @@ function QueryKey({ name, typeSchemas, pathParamsType, operation, typeName, tran
|
|
|
303
317
|
}
|
|
304
318
|
QueryKey.getParams = getParams4;
|
|
305
319
|
QueryKey.getTransformer = getTransformer2;
|
|
306
|
-
function getParams5({ paramsType, pathParamsType, typeSchemas }) {
|
|
320
|
+
function getParams5({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
|
|
307
321
|
if (paramsType === "object") {
|
|
308
322
|
return FunctionParams.factory({
|
|
309
323
|
data: {
|
|
310
324
|
mode: "object",
|
|
311
325
|
children: {
|
|
312
|
-
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
326
|
+
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
313
327
|
data: typeSchemas.request?.name ? {
|
|
314
328
|
type: typeSchemas.request?.name,
|
|
315
329
|
optional: isOptional(typeSchemas.request?.schema)
|
|
@@ -333,7 +347,7 @@ function getParams5({ paramsType, pathParamsType, typeSchemas }) {
|
|
|
333
347
|
return FunctionParams.factory({
|
|
334
348
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
335
349
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
336
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
350
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
337
351
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
338
352
|
} : void 0,
|
|
339
353
|
data: typeSchemas.request?.name ? {
|
|
@@ -354,15 +368,17 @@ function getParams5({ paramsType, pathParamsType, typeSchemas }) {
|
|
|
354
368
|
}
|
|
355
369
|
});
|
|
356
370
|
}
|
|
357
|
-
function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsType, queryKeyName }) {
|
|
358
|
-
const params = getParams5({ paramsType, pathParamsType, typeSchemas });
|
|
371
|
+
function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, pathParamsType, queryKeyName }) {
|
|
372
|
+
const params = getParams5({ paramsType, paramsCasing, pathParamsType, typeSchemas });
|
|
359
373
|
const clientParams = Client.getParams({
|
|
360
374
|
paramsType,
|
|
375
|
+
paramsCasing,
|
|
361
376
|
typeSchemas,
|
|
362
377
|
pathParamsType
|
|
363
378
|
});
|
|
364
379
|
const queryKeyParams = QueryKey.getParams({
|
|
365
380
|
pathParamsType,
|
|
381
|
+
paramsCasing,
|
|
366
382
|
typeSchemas
|
|
367
383
|
});
|
|
368
384
|
const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => item && !item.optional ? key : void 0).filter(Boolean).join("&& ");
|
|
@@ -380,14 +396,14 @@ function QueryOptions({ name, clientName, typeSchemas, paramsType, pathParamsTyp
|
|
|
380
396
|
` }) });
|
|
381
397
|
}
|
|
382
398
|
QueryOptions.getParams = getParams5;
|
|
383
|
-
function getParams6({ paramsType, pathParamsType, dataReturnType, typeSchemas }) {
|
|
399
|
+
function getParams6({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }) {
|
|
384
400
|
const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
|
|
385
401
|
if (paramsType === "object") {
|
|
386
402
|
return FunctionParams.factory({
|
|
387
403
|
data: {
|
|
388
404
|
mode: "object",
|
|
389
405
|
children: {
|
|
390
|
-
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
406
|
+
...getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
391
407
|
data: typeSchemas.request?.name ? {
|
|
392
408
|
type: typeSchemas.request?.name,
|
|
393
409
|
optional: isOptional(typeSchemas.request?.schema)
|
|
@@ -416,7 +432,7 @@ function getParams6({ paramsType, pathParamsType, dataReturnType, typeSchemas })
|
|
|
416
432
|
return FunctionParams.factory({
|
|
417
433
|
pathParams: typeSchemas.pathParams?.name ? {
|
|
418
434
|
mode: pathParamsType === "object" ? "object" : "inlineSpread",
|
|
419
|
-
children: getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
435
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true, casing: paramsCasing }),
|
|
420
436
|
optional: isOptional(typeSchemas.pathParams?.schema)
|
|
421
437
|
} : void 0,
|
|
422
438
|
data: typeSchemas.request?.name ? {
|
|
@@ -448,6 +464,7 @@ function Query({
|
|
|
448
464
|
queryOptionsName,
|
|
449
465
|
queryKeyName,
|
|
450
466
|
paramsType,
|
|
467
|
+
paramsCasing,
|
|
451
468
|
pathParamsType,
|
|
452
469
|
dataReturnType,
|
|
453
470
|
typeSchemas,
|
|
@@ -458,15 +475,18 @@ function Query({
|
|
|
458
475
|
const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`];
|
|
459
476
|
const queryKeyParams = QueryKey.getParams({
|
|
460
477
|
pathParamsType,
|
|
478
|
+
paramsCasing,
|
|
461
479
|
typeSchemas
|
|
462
480
|
});
|
|
463
481
|
const queryOptionsParams = QueryOptions.getParams({
|
|
464
482
|
paramsType,
|
|
483
|
+
paramsCasing,
|
|
465
484
|
pathParamsType,
|
|
466
485
|
typeSchemas
|
|
467
486
|
});
|
|
468
487
|
const params = getParams6({
|
|
469
488
|
paramsType,
|
|
489
|
+
paramsCasing,
|
|
470
490
|
pathParamsType,
|
|
471
491
|
dataReturnType,
|
|
472
492
|
typeSchemas
|
|
@@ -502,5 +522,5 @@ function Query({
|
|
|
502
522
|
Query.getParams = getParams6;
|
|
503
523
|
|
|
504
524
|
export { Client, Mutation, MutationKey, Query, QueryKey, QueryOptions };
|
|
505
|
-
//# sourceMappingURL=chunk-
|
|
506
|
-
//# sourceMappingURL=chunk-
|
|
525
|
+
//# sourceMappingURL=chunk-EZRBBWGF.js.map
|
|
526
|
+
//# sourceMappingURL=chunk-EZRBBWGF.js.map
|