@kubb/plugin-vue-query 3.17.0 → 3.18.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-D8lYnxao.js → components-CjXLvfg0.js} +6 -4
- package/dist/components-CjXLvfg0.js.map +1 -0
- package/dist/{components-ClNrCCre.cjs → components-DjyfUelG.cjs} +6 -4
- package/dist/components-DjyfUelG.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +1 -1
- package/dist/{generators-DIB6YtRr.js → generators-D-wddt80.js} +2 -2
- package/dist/{generators-DIB6YtRr.js.map → generators-D-wddt80.js.map} +1 -1
- package/dist/{generators-DIZQUvkg.cjs → generators-K05iynPb.cjs} +2 -2
- package/dist/{generators-DIZQUvkg.cjs.map → generators-K05iynPb.cjs.map} +1 -1
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{types-DPDni0p-.d.ts → types-Ba0XUWGA.d.cts} +22 -1
- package/dist/{types-UcJcIqHK.d.cts → types-CAd2kUB1.d.ts} +22 -1
- package/package.json +9 -9
- package/src/components/InfiniteQuery.tsx +2 -1
- package/src/components/MutationKey.tsx +2 -3
- package/src/components/Query.tsx +2 -1
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +2 -1
- package/src/generators/__snapshots__/clientGetImportPath.ts +2 -1
- package/src/generators/__snapshots__/clientPostImportPath.ts +1 -1
- package/src/generators/__snapshots__/findByTags.ts +2 -1
- package/src/generators/__snapshots__/findByTagsObject.ts +2 -1
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +2 -1
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +2 -1
- package/src/generators/__snapshots__/findByTagsWithZod.ts +2 -1
- package/src/generators/__snapshots__/findInfiniteByTags.ts +2 -1
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +2 -1
- package/src/generators/__snapshots__/postAsQuery.ts +2 -1
- package/src/generators/__snapshots__/updatePetById.ts +1 -1
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +1 -1
- package/dist/components-ClNrCCre.cjs.map +0 -1
- package/dist/components-D8lYnxao.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-DIZQUvkg.cjs","names":["pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","Query","pluginTsName","pluginZodName","pluginClientName","File","MutationKey","Client","Mutation","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery"],"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx"],"sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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/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 <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <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}\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}\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}\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 { 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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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/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 <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} 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 <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}\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}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\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 { 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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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 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 <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <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}\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}\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}\n queryKeyName={queryKey.name}\n queryKeyTypeName={queryKey.typeName}\n />\n </>\n )}\n </File>\n )\n },\n})\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAa,6DAAsD;CACjE,MAAM;CACN,UAAU,EAAE,SAAS,WAAW,EAAE;EAChC,MAAM,EACJ,QAAQ,EACN,SAAS,EAAE,QAAQ,EACpB,EACD,eACD;EACD,MAAM;EACN,MAAM,EAAE,YAAY,SAAS,SAAS;EAEtC,MAAM,UAAU,OAAO,QAAQ,UAAU,YAAY,OAAO,QAAQ,OAAO,QAAQ,MAAM,WAAW,UAAU,WAAW;EACzH,MAAM,oCAAwB,QAAQ,WAAW,QAAQ,SAAS,UAAU,EAAE,EAAE,QAAQ,QAAQ,QAAQ,MAAM,UAAU,EAAE,EAAE,MACzH,WAAW,UAAU,WAAW;EAEnC,MAAM,aAAa,QAAQ,QAAQ,QAAQ,MAAM,aAAa;EAE9D,MAAM,QAAQ;GACZ,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAO;GAC5D,UAAU,QAAQ,WAAW,EAAE,MAAM,QAAQ;GAC7C,MAAM,QAAQ,WAAW,EAAE,QAAQ,OAAO;GAC3C;EAED,MAAM,kBAAkB,CAAC,CAAC,cAAc,eAAe,CAACA,sC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c,QAAQ;KACtB,gBAAgB,QAAQ;KACxB,aAAa,KAAK;KAClB,aAAa,QAAQ;;IAEtB,CAAC,mBACA,kDAACC;KACC,MAAM,OAAO;KACb,SAAS,QAAQ,OAAO;KACb;KACX,aAAa,KAAK;KAClB,YAAY,IAAI;KAChB,gBAAgB,QAAQ,OAAO;KAC/B,cAAc,QAAQ;KACtB,YAAY,QAAQ;KACpB,gBAAgB,QAAQ;KACxB,QAAQ,QAAQ;;IAGnB,QAAQ,YACP;KACE,kDAACF,kBAAK;MAAO,MAAM,CAAC,eAAe;MAAE;MAAW,MAAM;;KACtD,kDAACA,kBAAK;MAAO,MAAM,CAAC,uBAAuB;MAAE,MAAM;;KACnD,kDAACG;MACC,MAAM,aAAa;MACnB,YAAY,OAAO;MACnB,cAAc,SAAS;MACvB,aAAa,KAAK;MAClB,YAAY,QAAQ;MACpB,cAAc,QAAQ;MACtB,gBAAgB,QAAQ;MACxB,gBAAgB,QAAQ,OAAO;MAC/B,aAAa,QAAQ,SAAS;MAC9B,kBAAkB,QAAQ,SAAS;MACnC,YAAY,QAAQ,SAAS;;;IAIlC,QAAQ,YACP;KACE,kDAACH,kBAAK;MAAO,MAAM,CAAC,mBAAmB;MAAE,MAAM;;KAC/C,kDAACA,kBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAAgC;OAA6B;MAAE,MAAM;MAAY;;KAChI,kDAACI;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO;MAC/B,cAAc,SAAS;MACvB,kBAAkB,SAAS;;;;;CAMtC;CACF"}
|
|
1
|
+
{"version":3,"file":"generators-K05iynPb.cjs","names":["pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","QueryOptions","Query","pluginTsName","pluginZodName","pluginClientName","File","MutationKey","Client","Mutation","pluginClientName","pluginTsName","pluginZodName","File","QueryKey","Client","InfiniteQueryOptions","InfiniteQuery"],"sources":["../src/generators/queryGenerator.tsx","../src/generators/mutationGenerator.tsx","../src/generators/infiniteQueryGenerator.tsx"],"sourcesContent":["import { pluginClientName } from '@kubb/plugin-client'\nimport { Client } from '@kubb/plugin-client/components'\nimport { createReactGenerator } from '@kubb/plugin-oas'\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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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/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 <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <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}\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}\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}\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 { 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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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/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 <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {!!hasClientPlugin && <File.Import name={[client.name]} root={mutation.file.path} path={client.file.path} />}\n <File.Import name={['RequestConfig', 'ResponseConfig', 'ResponseErrorConfig']} 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 <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}\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}\n paramsType={options.paramsType}\n pathParamsType={options.pathParamsType}\n mutationKeyName={mutationKey.name}\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 { 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, useApp } from '@kubb/react'\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({ options, operation }) {\n const {\n plugin: {\n options: { output },\n },\n pluginManager,\n } = useApp<PluginVueQuery>()\n const oas = useOas()\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 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 <File.Import name={['toValue']} path=\"vue\" />\n <File.Import name={['MaybeRefOrGetter']} path=\"vue\" isTypeOnly />\n <File.Import name={'fetch'} path={options.client.importPath} />\n {hasClientPlugin && <File.Import name={[client.name]} root={query.file.path} path={client.file.path} />}\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 <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}\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}\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}\n queryKeyName={queryKey.name}\n queryKeyTyp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AAO;MACnB,cAAc,SAAS;MACvB,aAAa,KAAK;MAClB,YAAY,QAAQ;MACpB,cAAc,QAAQ;MACtB,gBAAgB,QAAQ;MACxB,gBAAgB,QAAQ,OAAO;MAC/B,aAAa,QAAQ,SAAS;MAC9B,kBAAkB,QAAQ,SAAS;MACnC,YAAY,QAAQ,SAAS;;;IAIlC,QAAQ,YACP;KACE,kDAACH,kBAAK;MAAO,MAAM,CAAC,mBAAmB;MAAE,MAAM;;KAC/C,kDAACA,kBAAK;MAAO,MAAM;OAAC;OAAY;OAAe;OAAgC;OAA6B;MAAE,MAAM;MAAY;;KAChI,kDAACI;MACC,MAAM,MAAM;MACZ,kBAAkB,aAAa;MAC/B,aAAa,KAAK;MAClB,cAAc,QAAQ;MACtB,YAAY,QAAQ;MACpB,gBAAgB,QAAQ;MACb;MACX,gBAAgB,QAAQ,OAAO;MAC/B,cAAc,SAAS;MACvB,kBAAkB,SAAS;;;;;CAMtC;CACF"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('./components-
|
|
2
|
-
const require_generators = require('./generators-
|
|
1
|
+
require('./components-DjyfUelG.cjs');
|
|
2
|
+
const require_generators = require('./generators-K05iynPb.cjs');
|
|
3
3
|
|
|
4
4
|
exports.infiniteQueryGenerator = require_generators.infiniteQueryGenerator;
|
|
5
5
|
exports.mutationGenerator = require_generators.mutationGenerator;
|
package/dist/generators.d.cts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./components-
|
|
2
|
-
import { infiniteQueryGenerator, mutationGenerator, queryGenerator } from "./generators-
|
|
1
|
+
import "./components-CjXLvfg0.js";
|
|
2
|
+
import { infiniteQueryGenerator, mutationGenerator, queryGenerator } from "./generators-D-wddt80.js";
|
|
3
3
|
|
|
4
4
|
export { infiniteQueryGenerator, mutationGenerator, queryGenerator };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_components = require('./components-
|
|
2
|
-
const require_generators = require('./generators-
|
|
1
|
+
const require_components = require('./components-DjyfUelG.cjs');
|
|
2
|
+
const require_generators = require('./generators-K05iynPb.cjs');
|
|
3
3
|
const node_path = require_components.__toESM(require("node:path"));
|
|
4
4
|
const __kubb_core = require_components.__toESM(require("@kubb/core"));
|
|
5
5
|
const __kubb_core_transformers = require_components.__toESM(require("@kubb/core/transformers"));
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MutationKey, QueryKey } from "./components-
|
|
2
|
-
import { infiniteQueryGenerator, mutationGenerator, queryGenerator } from "./generators-
|
|
1
|
+
import { MutationKey, QueryKey } from "./components-CjXLvfg0.js";
|
|
2
|
+
import { infiniteQueryGenerator, mutationGenerator, queryGenerator } from "./generators-D-wddt80.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { FileManager, PluginManager, createPlugin } from "@kubb/core";
|
|
5
5
|
import { camelCase, pascalCase } from "@kubb/core/transformers";
|
|
@@ -270,6 +270,27 @@ type Config<TInput = Input> = {
|
|
|
270
270
|
* @default true
|
|
271
271
|
*/
|
|
272
272
|
write?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Specifies the formatting tool to be used.
|
|
275
|
+
* @default prettier
|
|
276
|
+
*
|
|
277
|
+
* Possible values:
|
|
278
|
+
* - 'prettier': Uses Prettier for code formatting.
|
|
279
|
+
* - 'biome': Uses Biome for code formatting.
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
282
|
+
format?: 'prettier' | 'biome' | false;
|
|
283
|
+
/**
|
|
284
|
+
* Specifies the linter that should be used to analyze the code.
|
|
285
|
+
* The accepted values indicate different linting tools.
|
|
286
|
+
*
|
|
287
|
+
* Possible values:
|
|
288
|
+
* - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
|
|
289
|
+
* - 'biome': Represents the Biome linter, a modern tool for code scanning.
|
|
290
|
+
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
293
|
+
lint?: 'eslint' | 'biome' | 'oxlint' | false;
|
|
273
294
|
/**
|
|
274
295
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
275
296
|
* @default { '.ts': '.ts'}
|
|
@@ -1382,4 +1403,4 @@ type ResolvedOptions = {
|
|
|
1382
1403
|
type PluginVueQuery = PluginFactoryOptions<'plugin-vue-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1383
1404
|
//#endregion
|
|
1384
1405
|
export { Generator, Infinite, type Operation$1 as Operation, OperationSchemas, Options$1 as Options, PluginVueQuery, Transformer, UserPluginWithLifeCycle };
|
|
1385
|
-
//# sourceMappingURL=types-
|
|
1406
|
+
//# sourceMappingURL=types-Ba0XUWGA.d.cts.map
|
|
@@ -270,6 +270,27 @@ type Config<TInput = Input> = {
|
|
|
270
270
|
* @default true
|
|
271
271
|
*/
|
|
272
272
|
write?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Specifies the formatting tool to be used.
|
|
275
|
+
* @default prettier
|
|
276
|
+
*
|
|
277
|
+
* Possible values:
|
|
278
|
+
* - 'prettier': Uses Prettier for code formatting.
|
|
279
|
+
* - 'biome': Uses Biome for code formatting.
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
282
|
+
format?: 'prettier' | 'biome' | false;
|
|
283
|
+
/**
|
|
284
|
+
* Specifies the linter that should be used to analyze the code.
|
|
285
|
+
* The accepted values indicate different linting tools.
|
|
286
|
+
*
|
|
287
|
+
* Possible values:
|
|
288
|
+
* - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.
|
|
289
|
+
* - 'biome': Represents the Biome linter, a modern tool for code scanning.
|
|
290
|
+
* - 'oxlint': Represents the Oxlint tool for linting purposes.
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
293
|
+
lint?: 'eslint' | 'biome' | 'oxlint' | false;
|
|
273
294
|
/**
|
|
274
295
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
275
296
|
* @default { '.ts': '.ts'}
|
|
@@ -1382,4 +1403,4 @@ type ResolvedOptions = {
|
|
|
1382
1403
|
type PluginVueQuery = PluginFactoryOptions<'plugin-vue-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1383
1404
|
//#endregion
|
|
1384
1405
|
export { Generator, Infinite, type Operation$1 as Operation, OperationSchemas, Options$1 as Options, PluginVueQuery, Transformer, UserPluginWithLifeCycle };
|
|
1385
|
-
//# sourceMappingURL=types-
|
|
1406
|
+
//# sourceMappingURL=types-CAd2kUB1.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-vue-query",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "Vue Query hooks generator plugin for Kubb, creating type-safe API client hooks from OpenAPI specifications for Vue.js applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue-query",
|
|
@@ -62,20 +62,20 @@
|
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"remeda": "^2.30.0",
|
|
65
|
-
"@kubb/core": "3.
|
|
66
|
-
"@kubb/oas": "3.
|
|
67
|
-
"@kubb/plugin-client": "3.
|
|
68
|
-
"@kubb/plugin-oas": "3.
|
|
69
|
-
"@kubb/plugin-ts": "3.
|
|
70
|
-
"@kubb/plugin-zod": "3.
|
|
71
|
-
"@kubb/react": "3.
|
|
65
|
+
"@kubb/core": "3.18.0",
|
|
66
|
+
"@kubb/oas": "3.18.0",
|
|
67
|
+
"@kubb/plugin-client": "3.18.0",
|
|
68
|
+
"@kubb/plugin-oas": "3.18.0",
|
|
69
|
+
"@kubb/plugin-ts": "3.18.0",
|
|
70
|
+
"@kubb/plugin-zod": "3.18.0",
|
|
71
|
+
"@kubb/react": "3.18.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/react": "^18.3.23",
|
|
75
75
|
"react": "^18.3.1",
|
|
76
76
|
"tsdown": "^0.14.1",
|
|
77
77
|
"typescript": "^5.9.2",
|
|
78
|
-
"@kubb/config-ts": "3.
|
|
78
|
+
"@kubb/config-ts": "3.18.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@kubb/react": "^3.0.0"
|
|
@@ -177,7 +177,8 @@ export function InfiniteQuery({
|
|
|
177
177
|
}}
|
|
178
178
|
>
|
|
179
179
|
{`
|
|
180
|
-
const { query:
|
|
180
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
181
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
181
182
|
const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
|
|
182
183
|
|
|
183
184
|
const query = useInfiniteQuery({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { URLPath } from '@kubb/core/utils'
|
|
2
|
-
import { File, Function, FunctionParams, Type } from '@kubb/react'
|
|
3
|
-
|
|
4
2
|
import type { Operation } from '@kubb/oas'
|
|
5
3
|
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
4
|
+
import { File, Function, FunctionParams, Type } from '@kubb/react'
|
|
6
5
|
import type { ReactNode } from 'react'
|
|
7
6
|
import type { PluginVueQuery, Transformer } from '../types'
|
|
8
7
|
|
|
@@ -28,7 +27,7 @@ function getParams({}: GetParamsProps) {
|
|
|
28
27
|
const getTransformer: Transformer = ({ operation, casing }) => {
|
|
29
28
|
const path = new URLPath(operation.path, { casing })
|
|
30
29
|
|
|
31
|
-
return [JSON.stringify({ url: path.
|
|
30
|
+
return [JSON.stringify({ url: path.toURLPath() })].filter(Boolean)
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export function MutationKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }: Props): ReactNode {
|
package/src/components/Query.tsx
CHANGED
|
@@ -177,7 +177,8 @@ export function Query({
|
|
|
177
177
|
}}
|
|
178
178
|
>
|
|
179
179
|
{`
|
|
180
|
-
const { query:
|
|
180
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
181
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
181
182
|
const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
|
|
182
183
|
|
|
183
184
|
const query = useQuery({
|
|
@@ -75,7 +75,8 @@ export function useFindPetsByTags<
|
|
|
75
75
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
76
76
|
} = {},
|
|
77
77
|
) {
|
|
78
|
-
const { query:
|
|
78
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
79
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
79
80
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
80
81
|
|
|
81
82
|
const query = useQuery(
|
|
@@ -70,7 +70,8 @@ export function useFindPetsByTags<
|
|
|
70
70
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
71
71
|
} = {},
|
|
72
72
|
) {
|
|
73
|
-
const { query:
|
|
73
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
74
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
74
75
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
75
76
|
|
|
76
77
|
const query = useQuery(
|
|
@@ -8,7 +8,7 @@ import type { RequestConfig, ResponseErrorConfig } from 'axios'
|
|
|
8
8
|
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { useMutation } from '@tanstack/vue-query'
|
|
10
10
|
|
|
11
|
-
export const updatePetWithFormMutationKey = () => [{ url: '/pet
|
|
11
|
+
export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
|
|
12
12
|
|
|
13
13
|
export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
|
|
14
14
|
|
|
@@ -70,7 +70,8 @@ export function useFindPetsByTags<
|
|
|
70
70
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
71
71
|
} = {},
|
|
72
72
|
) {
|
|
73
|
-
const { query:
|
|
73
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
74
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
74
75
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
75
76
|
|
|
76
77
|
const query = useQuery(
|
|
@@ -67,7 +67,8 @@ export function useFindPetsByTags<
|
|
|
67
67
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
68
68
|
} = {},
|
|
69
69
|
) {
|
|
70
|
-
const { query:
|
|
70
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
71
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
71
72
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
72
73
|
|
|
73
74
|
const query = useQuery(
|
|
@@ -70,7 +70,8 @@ export function useFindPetsByTags<
|
|
|
70
70
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
71
71
|
} = {},
|
|
72
72
|
) {
|
|
73
|
-
const { query:
|
|
73
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
74
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
74
75
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
75
76
|
|
|
76
77
|
const query = useQuery(
|
|
@@ -70,7 +70,8 @@ export function useFindPetsByTags<
|
|
|
70
70
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
71
71
|
} = {},
|
|
72
72
|
) {
|
|
73
|
-
const { query:
|
|
73
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
74
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
74
75
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
75
76
|
|
|
76
77
|
const query = useQuery(
|
|
@@ -70,7 +70,8 @@ export function useFindPetsByTags<
|
|
|
70
70
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
71
71
|
} = {},
|
|
72
72
|
) {
|
|
73
|
-
const { query:
|
|
73
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
74
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
74
75
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
|
|
75
76
|
|
|
76
77
|
const query = useQuery(
|
|
@@ -76,7 +76,8 @@ export function useFindPetsByTagsInfinite<
|
|
|
76
76
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
77
77
|
} = {},
|
|
78
78
|
) {
|
|
79
|
-
const { query:
|
|
79
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
80
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
80
81
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params)
|
|
81
82
|
|
|
82
83
|
const query = useInfiniteQuery(
|
|
@@ -76,7 +76,8 @@ export function useFindPetsByTagsInfinite<
|
|
|
76
76
|
client?: Partial<RequestConfig> & { client?: typeof fetch }
|
|
77
77
|
} = {},
|
|
78
78
|
) {
|
|
79
|
-
const { query:
|
|
79
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
80
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
80
81
|
const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params)
|
|
81
82
|
|
|
82
83
|
const query = useInfiniteQuery(
|
|
@@ -76,7 +76,8 @@ export function useUpdatePetWithForm<
|
|
|
76
76
|
client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof fetch }
|
|
77
77
|
} = {},
|
|
78
78
|
) {
|
|
79
|
-
const { query:
|
|
79
|
+
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
80
|
+
const { client: queryClient, ...queryOptions } = queryConfig
|
|
80
81
|
const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, data, params)
|
|
81
82
|
|
|
82
83
|
const query = useQuery(
|
|
@@ -8,7 +8,7 @@ import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
|
8
8
|
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { useMutation } from '@tanstack/vue-query'
|
|
10
10
|
|
|
11
|
-
export const updatePetWithFormMutationKey = () => [{ url: '/pet
|
|
11
|
+
export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
|
|
12
12
|
|
|
13
13
|
export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
|
|
|
8
8
|
import type { MaybeRefOrGetter } from 'vue'
|
|
9
9
|
import { useMutation } from '@tanstack/vue-query'
|
|
10
10
|
|
|
11
|
-
export const updatePetWithFormMutationKey = () => [{ url: '/pet
|
|
11
|
+
export const updatePetWithFormMutationKey = () => [{ url: '/pet/:petId' }] as const
|
|
12
12
|
|
|
13
13
|
export type UpdatePetWithFormMutationKey = ReturnType<typeof updatePetWithFormMutationKey>
|
|
14
14
|
|