@kubb/plugin-vue-query 4.4.1 → 4.5.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/{components-DoPUxAFs.cjs → components-CvorLYVT.cjs} +214 -214
- package/dist/components-CvorLYVT.cjs.map +1 -0
- package/dist/{components-B8p5782n.js → components-kADKAHgd.js} +213 -213
- package/dist/components-kADKAHgd.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +114 -114
- package/dist/components.d.ts +114 -114
- package/dist/components.js +1 -1
- package/dist/{generators-a7s1tUe0.cjs → generators-B7BEw8ZB.cjs} +206 -143
- package/dist/generators-B7BEw8ZB.cjs.map +1 -0
- package/dist/{generators-CxbnV3X_.js → generators-DHkXUh19.js} +203 -141
- package/dist/generators-DHkXUh19.js.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +5 -5
- package/dist/generators.d.ts +5 -5
- package/dist/generators.js +2 -2
- package/dist/index.cjs +18 -3
- 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 +16 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-CGRXTDFW.d.ts → types-BfKwA3Gv.d.cts} +175 -183
- package/dist/{types-PVIn4n6Z.d.cts → types-I09wleY8.d.ts} +175 -183
- package/package.json +9 -9
- package/src/components/QueryOptions.tsx +1 -1
- package/src/components/index.ts +3 -3
- package/src/generators/index.ts +2 -2
- package/src/generators/infiniteQueryGenerator.tsx +35 -11
- package/src/generators/mutationGenerator.tsx +34 -9
- package/src/generators/queryGenerator.tsx +35 -11
- package/src/plugin.ts +24 -1
- package/src/types.ts +4 -3
- package/dist/components-B8p5782n.js.map +0 -1
- package/dist/components-DoPUxAFs.cjs.map +0 -1
- package/dist/generators-CxbnV3X_.js.map +0 -1
- package/dist/generators-a7s1tUe0.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generators-B7BEw8ZB.cjs","names":["pluginClientName","pluginTsName","pluginZodName","File","path","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery","pluginTsName","pluginZodName","pluginClientName","File","path","MutationKey","Client","Mutation","pluginClientName","pluginTsName","pluginZodName","File","path","QueryKey","Client","QueryOptions","Query"],"sources":["../src/generators/infiniteQueryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/queryGenerator.tsx"],"sourcesContent":["import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { InfiniteQuery, InfiniteQueryOptions, QueryKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const infiniteQueryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-infinite-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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 isInfinite = isQuery && !!options.infinite\n const importPath = options.query ? options.query.importPath : '@tanstack/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use', suffix: 'infinite' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use', suffix: 'infinite' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n suffix: 'infinite',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\n }\n\n const queryOptions = {\n name: getName(operation, { type: 'function', suffix: 'InfiniteQueryOptions' }),\n }\n\n const queryKey = {\n name: getName(operation, { type: 'const', suffix: 'InfiniteQueryKey' }),\n typeName: getName(operation, { type: 'type', suffix: 'InfiniteQueryKey' }),\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 || !isInfinite) {\n return null\n }\n\n return (\n <File\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={'fetch'} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.infinite && (\n <>\n <File.Import name={['InfiniteData']} isTypeOnly path={importPath} />\n <File.Import name={['infiniteQueryOptions']} path={importPath} />\n <InfiniteQueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n cursorParam={options.infinite.cursorParam}\n initialPageParam={options.infinite.initialPageParam}\n queryParam={options.infinite.queryParam}\n />\n </>\n )}\n {options.infinite && (\n <>\n <File.Import name={['useInfiniteQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'InfiniteQueryObserverOptions', 'UseInfiniteQueryReturnType']} path={importPath} isTypeOnly />\n <InfiniteQuery\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Mutation, MutationKey } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const mutationGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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/vue-query'\n\n const mutation = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\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 hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\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\n baseName={mutation.file.baseName}\n path={mutation.file.path}\n meta={mutation.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={mutation.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={'fetch'} root={mutation.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={mutation.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\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 <MutationKey\n name={mutationKey.name}\n typeName={mutationKey.typeName}\n operation={operation}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n transformer={options.mutationKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n {options.mutation && (\n <>\n <File.Import name={['useMutation']} path={importPath} />\n <File.Import name={['MutationObserverOptions', 'QueryClient']} 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 || 'data'}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\n />\n </>\n )}\n </File>\n )\n },\n})\n","import path from 'node:path'\nimport { usePluginManager } from '@kubb/core/hooks'\nimport { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas/generators'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { File } from '@kubb/react-fabric'\nimport { difference } from 'remeda'\nimport { Query, QueryKey, QueryOptions } from '../components'\nimport type { PluginVueQuery } from '../types'\n\nexport const queryGenerator = createReactGenerator<PluginVueQuery>({\n name: 'vue-query',\n Operation({ config, operation, generator, plugin }) {\n const {\n options,\n options: { output },\n } = plugin\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager(generator)\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/vue-query'\n\n const query = {\n name: getName(operation, { type: 'function', prefix: 'use' }),\n typeName: getName(operation, { type: 'type' }),\n file: getFile(operation, { prefix: 'use' }),\n }\n\n const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName])\n const client = {\n name: hasClientPlugin\n ? getName(operation, {\n type: 'function',\n pluginKey: [pluginClientName],\n })\n : getName(operation, {\n type: 'function',\n }),\n file: getFile(operation, { pluginKey: [pluginClientName] }),\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\n baseName={query.file.baseName}\n path={query.file.path}\n meta={query.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={query.file.path} path={zod.file.path} />\n )}\n {options.client.importPath ? (\n <>\n <File.Import name={'fetch'} path={options.client.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.client.importPath} isTypeOnly />\n {options.client.dataReturnType === 'full' && <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />}\n </>\n ) : (\n <>\n <File.Import name={'fetch'} root={query.file.path} path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')} />\n <File.Import\n name={['RequestConfig', 'ResponseErrorConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n {options.client.dataReturnType === 'full' && (\n <File.Import\n name={['ResponseConfig']}\n root={query.file.path}\n path={path.resolve(config.root, config.output.path, '.kubb/fetcher.ts')}\n isTypeOnly\n />\n )}\n </>\n )}\n <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <QueryKey\n name={queryKey.name}\n typeName={queryKey.typeName}\n operation={operation}\n paramsCasing={options.paramsCasing}\n pathParamsType={options.pathParamsType}\n typeSchemas={type.schemas}\n transformer={options.queryKey}\n />\n {!hasClientPlugin && (\n <Client\n name={client.name}\n baseURL={options.client.baseURL}\n operation={operation}\n typeSchemas={type.schemas}\n zodSchemas={zod.schemas}\n dataReturnType={options.client.dataReturnType || 'data'}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n parser={options.parser}\n />\n )}\n <File.Import name={['queryOptions']} path={importPath} />\n <QueryOptions\n name={queryOptions.name}\n clientName={client.name}\n queryKeyName={queryKey.name}\n paramsCasing={options.paramsCasing}\n typeSchemas={type.schemas}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n dataReturnType={options.client.dataReturnType || 'data'}\n />\n {options.query && (\n <>\n <File.Import name={['useQuery']} path={importPath} />\n <File.Import name={['QueryKey', 'QueryClient', 'QueryObserverOptions', 'UseQueryReturnType']} path={importPath} isTypeOnly />\n <Query\n name={query.name}\n queryOptionsName={queryOptions.name}\n typeSchemas={type.schemas}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n operation={operation}\n dataReturnType={options.client.dataReturnType || 'data'}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,gFAA8D;CACzE,MAAM;CACN,UAAU,EAAE,QAAQ,WAAW,WAAW,UAAU;EAClD,MAAM,EACJ,SACA,SAAS,EAAE,aACT;EACJ,MAAM,yDAAkC;EAExC,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,6DAAgC,UAAU;EAEvE,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW,OAAO;EAChI,MAAM,oCAAwB,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,CAAC,CAAC,MACzH,WAAW,UAAU,WAAW,OAClC;EACD,MAAM,aAAa,WAAW,CAAC,CAAC,QAAQ;EACxC,MAAM,aAAa,QAAQ,QAAQ,QAAQ,MAAM,aAAa;EAE9D,MAAM,QAAQ;GACZ,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAO,QAAQ;IAAY,CAAC;GACjF,UAAU,QAAQ,WAAW,EAAE,MAAM,QAAQ,CAAC;GAC9C,MAAM,QAAQ,WAAW;IAAE,QAAQ;IAAO,QAAQ;IAAY,CAAC;GAChE;EAED,MAAM,kBAAkB,CAAC,CAAC,cAAc,eAAe,CAACA,sCAAiB,CAAC;EAC1E,MAAM,SAAS;GACb,MAAM,kBACF,QAAQ,WAAW;IACjB,MAAM;IACN,WAAW,CAACA,sCAAiB;IAC9B,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;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,QAAQ,QAAQ;MAChB;IAEJ,yDAACH,yBAAK;KAAO,MAAM,CAAC,eAAe;KAAE,MAAM;MAAc;IACzD,yDAACI;KACC,MAAM,aAAa;KACnB,YAAY,OAAO;KACnB,cAAc,SAAS;KACvB,cAAc,QAAQ;KACtB,aAAa,KAAK;KAClB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD;IACD,QAAQ,SACP;KACE,yDAACJ,yBAAK;MAAO,MAAM,CAAC,WAAW;MAAE,MAAM;OAAc;KACrD,yDAACA,yBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAAwB;OAAqB;MAAE,MAAM;MAAY;OAAa;KAC7H,yDAACK;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO,kBAAkB;MACjD,cAAc,SAAS;MACvB,kBAAkB,SAAS;OAC3B;QACD;;IAEA;;CAGZ,CAAC"}
|
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import
|
|
1
|
+
import { a as InfiniteQuery, i as InfiniteQueryOptions, n as Mutation, o as QueryOptions, r as MutationKey, s as QueryKey, t as Query } from "./components-kADKAHgd.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pluginClientName } from "@kubb/plugin-client";
|
|
3
4
|
import { pluginTsName } from "@kubb/plugin-ts";
|
|
4
5
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
5
|
-
import { Client } from "@kubb/plugin-client/components";
|
|
6
6
|
import { getBanner, getFooter } from "@kubb/plugin-oas/utils";
|
|
7
7
|
import { File } from "@kubb/react-fabric";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Client } from "@kubb/plugin-client/components";
|
|
10
|
+
import { usePluginManager } from "@kubb/core/hooks";
|
|
11
|
+
import { createReactGenerator } from "@kubb/plugin-oas/generators";
|
|
11
12
|
import { useOas, useOperationManager } from "@kubb/plugin-oas/hooks";
|
|
12
13
|
import { difference } from "remeda";
|
|
13
14
|
|
|
14
|
-
//#region src/generators/
|
|
15
|
-
const
|
|
16
|
-
name: "vue-query",
|
|
17
|
-
Operation({
|
|
18
|
-
const { options: { output } } =
|
|
15
|
+
//#region src/generators/infiniteQueryGenerator.tsx
|
|
16
|
+
const infiniteQueryGenerator = createReactGenerator({
|
|
17
|
+
name: "vue-infinite-query",
|
|
18
|
+
Operation({ config, operation, generator, plugin }) {
|
|
19
|
+
const { options, options: { output } } = plugin;
|
|
19
20
|
const pluginManager = usePluginManager();
|
|
20
21
|
const oas = useOas();
|
|
21
|
-
const { getSchemas, getName, getFile } = useOperationManager();
|
|
22
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
22
23
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
23
24
|
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
|
|
25
|
+
const isInfinite = isQuery && !!options.infinite;
|
|
24
26
|
const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
|
|
25
27
|
const query = {
|
|
26
28
|
name: getName(operation, {
|
|
27
29
|
type: "function",
|
|
28
|
-
prefix: "use"
|
|
30
|
+
prefix: "use",
|
|
31
|
+
suffix: "infinite"
|
|
29
32
|
}),
|
|
30
33
|
typeName: getName(operation, { type: "type" }),
|
|
31
|
-
file: getFile(operation, {
|
|
34
|
+
file: getFile(operation, {
|
|
35
|
+
prefix: "use",
|
|
36
|
+
suffix: "infinite"
|
|
37
|
+
})
|
|
32
38
|
};
|
|
33
39
|
const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
|
|
34
40
|
const client = {
|
|
35
41
|
name: hasClientPlugin ? getName(operation, {
|
|
36
42
|
type: "function",
|
|
37
43
|
pluginKey: [pluginClientName]
|
|
38
|
-
}) : getName(operation, {
|
|
44
|
+
}) : getName(operation, {
|
|
45
|
+
type: "function",
|
|
46
|
+
suffix: "infinite"
|
|
47
|
+
}),
|
|
39
48
|
file: getFile(operation, { pluginKey: [pluginClientName] })
|
|
40
49
|
};
|
|
41
50
|
const queryOptions = { name: getName(operation, {
|
|
42
51
|
type: "function",
|
|
43
|
-
suffix: "
|
|
52
|
+
suffix: "InfiniteQueryOptions"
|
|
44
53
|
}) };
|
|
45
54
|
const queryKey = {
|
|
46
55
|
name: getName(operation, {
|
|
47
56
|
type: "const",
|
|
48
|
-
suffix: "
|
|
57
|
+
suffix: "InfiniteQueryKey"
|
|
49
58
|
}),
|
|
50
59
|
typeName: getName(operation, {
|
|
51
60
|
type: "type",
|
|
52
|
-
suffix: "
|
|
61
|
+
suffix: "InfiniteQueryKey"
|
|
53
62
|
})
|
|
54
63
|
};
|
|
55
64
|
const type = {
|
|
@@ -66,7 +75,7 @@ const queryGenerator = createReactGenerator({
|
|
|
66
75
|
type: "function"
|
|
67
76
|
})
|
|
68
77
|
};
|
|
69
|
-
if (!isQuery || isMutation) return null;
|
|
78
|
+
if (!isQuery || isMutation || !isInfinite) return null;
|
|
70
79
|
return /* @__PURE__ */ jsxs(File, {
|
|
71
80
|
baseName: query.file.baseName,
|
|
72
81
|
path: query.file.path,
|
|
@@ -86,6 +95,40 @@ const queryGenerator = createReactGenerator({
|
|
|
86
95
|
root: query.file.path,
|
|
87
96
|
path: zod.file.path
|
|
88
97
|
}),
|
|
98
|
+
options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
100
|
+
name: "fetch",
|
|
101
|
+
path: options.client.importPath
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
104
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
105
|
+
path: options.client.importPath,
|
|
106
|
+
isTypeOnly: true
|
|
107
|
+
}),
|
|
108
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
109
|
+
name: ["ResponseConfig"],
|
|
110
|
+
path: options.client.importPath,
|
|
111
|
+
isTypeOnly: true
|
|
112
|
+
})
|
|
113
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
115
|
+
name: "fetch",
|
|
116
|
+
root: query.file.path,
|
|
117
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts")
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
120
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
121
|
+
root: query.file.path,
|
|
122
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
123
|
+
isTypeOnly: true
|
|
124
|
+
}),
|
|
125
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
126
|
+
name: ["ResponseConfig"],
|
|
127
|
+
root: query.file.path,
|
|
128
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
129
|
+
isTypeOnly: true
|
|
130
|
+
})
|
|
131
|
+
] }),
|
|
89
132
|
/* @__PURE__ */ jsx(File.Import, {
|
|
90
133
|
name: ["toValue"],
|
|
91
134
|
path: "vue"
|
|
@@ -95,25 +138,11 @@ const queryGenerator = createReactGenerator({
|
|
|
95
138
|
path: "vue",
|
|
96
139
|
isTypeOnly: true
|
|
97
140
|
}),
|
|
98
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
99
|
-
name: "fetch",
|
|
100
|
-
path: options.client.importPath
|
|
101
|
-
}),
|
|
102
|
-
!!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
141
|
+
hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
103
142
|
name: [client.name],
|
|
104
143
|
root: query.file.path,
|
|
105
144
|
path: client.file.path
|
|
106
145
|
}),
|
|
107
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
108
|
-
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
109
|
-
path: options.client.importPath,
|
|
110
|
-
isTypeOnly: true
|
|
111
|
-
}),
|
|
112
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
113
|
-
name: ["ResponseConfig"],
|
|
114
|
-
path: options.client.importPath,
|
|
115
|
-
isTypeOnly: true
|
|
116
|
-
}),
|
|
117
146
|
/* @__PURE__ */ jsx(File.Import, {
|
|
118
147
|
name: [
|
|
119
148
|
type.schemas.request?.name,
|
|
@@ -142,42 +171,52 @@ const queryGenerator = createReactGenerator({
|
|
|
142
171
|
operation,
|
|
143
172
|
typeSchemas: type.schemas,
|
|
144
173
|
zodSchemas: zod.schemas,
|
|
145
|
-
dataReturnType: options.client.dataReturnType,
|
|
174
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
146
175
|
paramsCasing: options.paramsCasing,
|
|
147
176
|
paramsType: options.paramsType,
|
|
148
177
|
pathParamsType: options.pathParamsType,
|
|
149
178
|
parser: options.parser
|
|
150
179
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
name: ["queryOptions"],
|
|
153
|
-
path: importPath
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ jsx(QueryOptions, {
|
|
156
|
-
name: queryOptions.name,
|
|
157
|
-
clientName: client.name,
|
|
158
|
-
queryKeyName: queryKey.name,
|
|
159
|
-
paramsCasing: options.paramsCasing,
|
|
160
|
-
typeSchemas: type.schemas,
|
|
161
|
-
paramsType: options.paramsType,
|
|
162
|
-
pathParamsType: options.pathParamsType,
|
|
163
|
-
dataReturnType: options.client.dataReturnType
|
|
164
|
-
}),
|
|
165
|
-
options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
180
|
+
options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
166
181
|
/* @__PURE__ */ jsx(File.Import, {
|
|
167
|
-
name: ["
|
|
182
|
+
name: ["InfiniteData"],
|
|
183
|
+
isTypeOnly: true,
|
|
184
|
+
path: importPath
|
|
185
|
+
}),
|
|
186
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
187
|
+
name: ["infiniteQueryOptions"],
|
|
188
|
+
path: importPath
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ jsx(InfiniteQueryOptions, {
|
|
191
|
+
name: queryOptions.name,
|
|
192
|
+
clientName: client.name,
|
|
193
|
+
queryKeyName: queryKey.name,
|
|
194
|
+
typeSchemas: type.schemas,
|
|
195
|
+
paramsType: options.paramsType,
|
|
196
|
+
paramsCasing: options.paramsCasing,
|
|
197
|
+
pathParamsType: options.pathParamsType,
|
|
198
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
199
|
+
cursorParam: options.infinite.cursorParam,
|
|
200
|
+
initialPageParam: options.infinite.initialPageParam,
|
|
201
|
+
queryParam: options.infinite.queryParam
|
|
202
|
+
})
|
|
203
|
+
] }),
|
|
204
|
+
options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
205
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
206
|
+
name: ["useInfiniteQuery"],
|
|
168
207
|
path: importPath
|
|
169
208
|
}),
|
|
170
209
|
/* @__PURE__ */ jsx(File.Import, {
|
|
171
210
|
name: [
|
|
172
211
|
"QueryKey",
|
|
173
212
|
"QueryClient",
|
|
174
|
-
"
|
|
175
|
-
"
|
|
213
|
+
"InfiniteQueryObserverOptions",
|
|
214
|
+
"UseInfiniteQueryReturnType"
|
|
176
215
|
],
|
|
177
216
|
path: importPath,
|
|
178
217
|
isTypeOnly: true
|
|
179
218
|
}),
|
|
180
|
-
/* @__PURE__ */ jsx(
|
|
219
|
+
/* @__PURE__ */ jsx(InfiniteQuery, {
|
|
181
220
|
name: query.name,
|
|
182
221
|
queryOptionsName: queryOptions.name,
|
|
183
222
|
typeSchemas: type.schemas,
|
|
@@ -185,7 +224,7 @@ const queryGenerator = createReactGenerator({
|
|
|
185
224
|
paramsType: options.paramsType,
|
|
186
225
|
pathParamsType: options.pathParamsType,
|
|
187
226
|
operation,
|
|
188
|
-
dataReturnType: options.client.dataReturnType,
|
|
227
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
189
228
|
queryKeyName: queryKey.name,
|
|
190
229
|
queryKeyTypeName: queryKey.typeName
|
|
191
230
|
})
|
|
@@ -199,11 +238,11 @@ const queryGenerator = createReactGenerator({
|
|
|
199
238
|
//#region src/generators/mutationGenerator.tsx
|
|
200
239
|
const mutationGenerator = createReactGenerator({
|
|
201
240
|
name: "vue-query",
|
|
202
|
-
Operation({
|
|
203
|
-
const { options: { output } } =
|
|
241
|
+
Operation({ config, operation, generator, plugin }) {
|
|
242
|
+
const { options, options: { output } } = plugin;
|
|
204
243
|
const pluginManager = usePluginManager();
|
|
205
244
|
const oas = useOas();
|
|
206
|
-
const { getSchemas, getName, getFile } = useOperationManager();
|
|
245
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
207
246
|
const isMutation = !(!!options.query && options.query?.methods.some((method) => operation.method === method)) && difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
|
|
208
247
|
const importPath = options.mutation ? options.mutation.importPath : "@tanstack/vue-query";
|
|
209
248
|
const mutation = {
|
|
@@ -266,29 +305,50 @@ const mutationGenerator = createReactGenerator({
|
|
|
266
305
|
root: mutation.file.path,
|
|
267
306
|
path: zod.file.path
|
|
268
307
|
}),
|
|
308
|
+
options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
309
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
310
|
+
name: "fetch",
|
|
311
|
+
path: options.client.importPath
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
314
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
315
|
+
path: options.client.importPath,
|
|
316
|
+
isTypeOnly: true
|
|
317
|
+
}),
|
|
318
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
319
|
+
name: ["ResponseConfig"],
|
|
320
|
+
path: options.client.importPath,
|
|
321
|
+
isTypeOnly: true
|
|
322
|
+
})
|
|
323
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
324
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
325
|
+
name: "fetch",
|
|
326
|
+
root: mutation.file.path,
|
|
327
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts")
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
330
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
331
|
+
root: mutation.file.path,
|
|
332
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
333
|
+
isTypeOnly: true
|
|
334
|
+
}),
|
|
335
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
336
|
+
name: ["ResponseConfig"],
|
|
337
|
+
root: mutation.file.path,
|
|
338
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
339
|
+
isTypeOnly: true
|
|
340
|
+
})
|
|
341
|
+
] }),
|
|
269
342
|
/* @__PURE__ */ jsx(File.Import, {
|
|
270
343
|
name: ["MaybeRefOrGetter"],
|
|
271
344
|
path: "vue",
|
|
272
345
|
isTypeOnly: true
|
|
273
346
|
}),
|
|
274
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
275
|
-
name: "fetch",
|
|
276
|
-
path: options.client.importPath
|
|
277
|
-
}),
|
|
278
347
|
!!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
279
348
|
name: [client.name],
|
|
280
349
|
root: mutation.file.path,
|
|
281
350
|
path: client.file.path
|
|
282
351
|
}),
|
|
283
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
284
|
-
name: [
|
|
285
|
-
"RequestConfig",
|
|
286
|
-
"ResponseConfig",
|
|
287
|
-
"ResponseErrorConfig"
|
|
288
|
-
],
|
|
289
|
-
path: options.client.importPath,
|
|
290
|
-
isTypeOnly: true
|
|
291
|
-
}),
|
|
292
352
|
/* @__PURE__ */ jsx(File.Import, {
|
|
293
353
|
name: [
|
|
294
354
|
type.schemas.request?.name,
|
|
@@ -317,7 +377,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
317
377
|
operation,
|
|
318
378
|
typeSchemas: type.schemas,
|
|
319
379
|
zodSchemas: zod.schemas,
|
|
320
|
-
dataReturnType: options.client.dataReturnType,
|
|
380
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
321
381
|
paramsCasing: options.paramsCasing,
|
|
322
382
|
paramsType: options.paramsType,
|
|
323
383
|
pathParamsType: options.pathParamsType,
|
|
@@ -340,7 +400,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
340
400
|
typeSchemas: type.schemas,
|
|
341
401
|
operation,
|
|
342
402
|
paramsCasing: options.paramsCasing,
|
|
343
|
-
dataReturnType: options.client.dataReturnType,
|
|
403
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
344
404
|
paramsType: options.paramsType,
|
|
345
405
|
pathParamsType: options.pathParamsType,
|
|
346
406
|
mutationKeyName: mutationKey.name
|
|
@@ -352,53 +412,45 @@ const mutationGenerator = createReactGenerator({
|
|
|
352
412
|
});
|
|
353
413
|
|
|
354
414
|
//#endregion
|
|
355
|
-
//#region src/generators/
|
|
356
|
-
const
|
|
357
|
-
name: "vue-
|
|
358
|
-
Operation({
|
|
359
|
-
const { options: { output } } =
|
|
415
|
+
//#region src/generators/queryGenerator.tsx
|
|
416
|
+
const queryGenerator = createReactGenerator({
|
|
417
|
+
name: "vue-query",
|
|
418
|
+
Operation({ config, operation, generator, plugin }) {
|
|
419
|
+
const { options, options: { output } } = plugin;
|
|
360
420
|
const pluginManager = usePluginManager();
|
|
361
421
|
const oas = useOas();
|
|
362
|
-
const { getSchemas, getName, getFile } = useOperationManager();
|
|
422
|
+
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
363
423
|
const isQuery = typeof options.query === "boolean" ? true : options.query?.methods.some((method) => operation.method === method);
|
|
364
424
|
const isMutation = difference(options.mutation ? options.mutation.methods : [], options.query ? options.query.methods : []).some((method) => operation.method === method);
|
|
365
|
-
const isInfinite = isQuery && !!options.infinite;
|
|
366
425
|
const importPath = options.query ? options.query.importPath : "@tanstack/vue-query";
|
|
367
426
|
const query = {
|
|
368
427
|
name: getName(operation, {
|
|
369
428
|
type: "function",
|
|
370
|
-
prefix: "use"
|
|
371
|
-
suffix: "infinite"
|
|
429
|
+
prefix: "use"
|
|
372
430
|
}),
|
|
373
431
|
typeName: getName(operation, { type: "type" }),
|
|
374
|
-
file: getFile(operation, {
|
|
375
|
-
prefix: "use",
|
|
376
|
-
suffix: "infinite"
|
|
377
|
-
})
|
|
432
|
+
file: getFile(operation, { prefix: "use" })
|
|
378
433
|
};
|
|
379
434
|
const hasClientPlugin = !!pluginManager.getPluginByKey([pluginClientName]);
|
|
380
435
|
const client = {
|
|
381
436
|
name: hasClientPlugin ? getName(operation, {
|
|
382
437
|
type: "function",
|
|
383
438
|
pluginKey: [pluginClientName]
|
|
384
|
-
}) : getName(operation, {
|
|
385
|
-
type: "function",
|
|
386
|
-
suffix: "infinite"
|
|
387
|
-
}),
|
|
439
|
+
}) : getName(operation, { type: "function" }),
|
|
388
440
|
file: getFile(operation, { pluginKey: [pluginClientName] })
|
|
389
441
|
};
|
|
390
442
|
const queryOptions = { name: getName(operation, {
|
|
391
443
|
type: "function",
|
|
392
|
-
suffix: "
|
|
444
|
+
suffix: "QueryOptions"
|
|
393
445
|
}) };
|
|
394
446
|
const queryKey = {
|
|
395
447
|
name: getName(operation, {
|
|
396
448
|
type: "const",
|
|
397
|
-
suffix: "
|
|
449
|
+
suffix: "QueryKey"
|
|
398
450
|
}),
|
|
399
451
|
typeName: getName(operation, {
|
|
400
452
|
type: "type",
|
|
401
|
-
suffix: "
|
|
453
|
+
suffix: "QueryKey"
|
|
402
454
|
})
|
|
403
455
|
};
|
|
404
456
|
const type = {
|
|
@@ -415,7 +467,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
415
467
|
type: "function"
|
|
416
468
|
})
|
|
417
469
|
};
|
|
418
|
-
if (!isQuery || isMutation
|
|
470
|
+
if (!isQuery || isMutation) return null;
|
|
419
471
|
return /* @__PURE__ */ jsxs(File, {
|
|
420
472
|
baseName: query.file.baseName,
|
|
421
473
|
path: query.file.path,
|
|
@@ -435,6 +487,40 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
435
487
|
root: query.file.path,
|
|
436
488
|
path: zod.file.path
|
|
437
489
|
}),
|
|
490
|
+
options.client.importPath ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
491
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
492
|
+
name: "fetch",
|
|
493
|
+
path: options.client.importPath
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
496
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
497
|
+
path: options.client.importPath,
|
|
498
|
+
isTypeOnly: true
|
|
499
|
+
}),
|
|
500
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
501
|
+
name: ["ResponseConfig"],
|
|
502
|
+
path: options.client.importPath,
|
|
503
|
+
isTypeOnly: true
|
|
504
|
+
})
|
|
505
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
506
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
507
|
+
name: "fetch",
|
|
508
|
+
root: query.file.path,
|
|
509
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts")
|
|
510
|
+
}),
|
|
511
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
512
|
+
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
513
|
+
root: query.file.path,
|
|
514
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
515
|
+
isTypeOnly: true
|
|
516
|
+
}),
|
|
517
|
+
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
518
|
+
name: ["ResponseConfig"],
|
|
519
|
+
root: query.file.path,
|
|
520
|
+
path: path.resolve(config.root, config.output.path, ".kubb/fetcher.ts"),
|
|
521
|
+
isTypeOnly: true
|
|
522
|
+
})
|
|
523
|
+
] }),
|
|
438
524
|
/* @__PURE__ */ jsx(File.Import, {
|
|
439
525
|
name: ["toValue"],
|
|
440
526
|
path: "vue"
|
|
@@ -444,25 +530,11 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
444
530
|
path: "vue",
|
|
445
531
|
isTypeOnly: true
|
|
446
532
|
}),
|
|
447
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
448
|
-
name: "fetch",
|
|
449
|
-
path: options.client.importPath
|
|
450
|
-
}),
|
|
451
|
-
hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
533
|
+
!!hasClientPlugin && /* @__PURE__ */ jsx(File.Import, {
|
|
452
534
|
name: [client.name],
|
|
453
535
|
root: query.file.path,
|
|
454
536
|
path: client.file.path
|
|
455
537
|
}),
|
|
456
|
-
/* @__PURE__ */ jsx(File.Import, {
|
|
457
|
-
name: ["RequestConfig", "ResponseErrorConfig"],
|
|
458
|
-
path: options.client.importPath,
|
|
459
|
-
isTypeOnly: true
|
|
460
|
-
}),
|
|
461
|
-
options.client.dataReturnType === "full" && /* @__PURE__ */ jsx(File.Import, {
|
|
462
|
-
name: ["ResponseConfig"],
|
|
463
|
-
path: options.client.importPath,
|
|
464
|
-
isTypeOnly: true
|
|
465
|
-
}),
|
|
466
538
|
/* @__PURE__ */ jsx(File.Import, {
|
|
467
539
|
name: [
|
|
468
540
|
type.schemas.request?.name,
|
|
@@ -491,52 +563,42 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
491
563
|
operation,
|
|
492
564
|
typeSchemas: type.schemas,
|
|
493
565
|
zodSchemas: zod.schemas,
|
|
494
|
-
dataReturnType: options.client.dataReturnType,
|
|
566
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
495
567
|
paramsCasing: options.paramsCasing,
|
|
496
568
|
paramsType: options.paramsType,
|
|
497
569
|
pathParamsType: options.pathParamsType,
|
|
498
570
|
parser: options.parser
|
|
499
571
|
}),
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
paramsType: options.paramsType,
|
|
516
|
-
paramsCasing: options.paramsCasing,
|
|
517
|
-
pathParamsType: options.pathParamsType,
|
|
518
|
-
dataReturnType: options.client.dataReturnType,
|
|
519
|
-
cursorParam: options.infinite.cursorParam,
|
|
520
|
-
initialPageParam: options.infinite.initialPageParam,
|
|
521
|
-
queryParam: options.infinite.queryParam
|
|
522
|
-
})
|
|
523
|
-
] }),
|
|
524
|
-
options.infinite && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
572
|
+
/* @__PURE__ */ jsx(File.Import, {
|
|
573
|
+
name: ["queryOptions"],
|
|
574
|
+
path: importPath
|
|
575
|
+
}),
|
|
576
|
+
/* @__PURE__ */ jsx(QueryOptions, {
|
|
577
|
+
name: queryOptions.name,
|
|
578
|
+
clientName: client.name,
|
|
579
|
+
queryKeyName: queryKey.name,
|
|
580
|
+
paramsCasing: options.paramsCasing,
|
|
581
|
+
typeSchemas: type.schemas,
|
|
582
|
+
paramsType: options.paramsType,
|
|
583
|
+
pathParamsType: options.pathParamsType,
|
|
584
|
+
dataReturnType: options.client.dataReturnType || "data"
|
|
585
|
+
}),
|
|
586
|
+
options.query && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
525
587
|
/* @__PURE__ */ jsx(File.Import, {
|
|
526
|
-
name: ["
|
|
588
|
+
name: ["useQuery"],
|
|
527
589
|
path: importPath
|
|
528
590
|
}),
|
|
529
591
|
/* @__PURE__ */ jsx(File.Import, {
|
|
530
592
|
name: [
|
|
531
593
|
"QueryKey",
|
|
532
594
|
"QueryClient",
|
|
533
|
-
"
|
|
534
|
-
"
|
|
595
|
+
"QueryObserverOptions",
|
|
596
|
+
"UseQueryReturnType"
|
|
535
597
|
],
|
|
536
598
|
path: importPath,
|
|
537
599
|
isTypeOnly: true
|
|
538
600
|
}),
|
|
539
|
-
/* @__PURE__ */ jsx(
|
|
601
|
+
/* @__PURE__ */ jsx(Query, {
|
|
540
602
|
name: query.name,
|
|
541
603
|
queryOptionsName: queryOptions.name,
|
|
542
604
|
typeSchemas: type.schemas,
|
|
@@ -544,7 +606,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
544
606
|
paramsType: options.paramsType,
|
|
545
607
|
pathParamsType: options.pathParamsType,
|
|
546
608
|
operation,
|
|
547
|
-
dataReturnType: options.client.dataReturnType,
|
|
609
|
+
dataReturnType: options.client.dataReturnType || "data",
|
|
548
610
|
queryKeyName: queryKey.name,
|
|
549
611
|
queryKeyTypeName: queryKey.typeName
|
|
550
612
|
})
|
|
@@ -555,5 +617,5 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
555
617
|
});
|
|
556
618
|
|
|
557
619
|
//#endregion
|
|
558
|
-
export { mutationGenerator as n,
|
|
559
|
-
//# sourceMappingURL=generators-
|
|
620
|
+
export { mutationGenerator as n, infiniteQueryGenerator as r, queryGenerator as t };
|
|
621
|
+
//# sourceMappingURL=generators-DHkXUh19.js.map
|