@kubb/plugin-swr 3.0.0-alpha.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-swr/dist/chunk-H4LHXYRJ.cjs","../src/components/Mutation.tsx","../src/components/SchemaType.tsx","../src/components/Query.tsx","../src/components/QueryOptions.tsx"],"names":["useOperation","Template","jsx","jsxs","Parser","transformers","Function","defaultTemplates","FunctionParams","URLPath","Fragment","pluginZodName"],"mappings":"AAAA;ACAA,mHAAyB;AACzB,yCAAwC;AACxC,oCAA+C;AAC/C,2CAA6B;AAC7B,+CAAkD;AAClD,gDAA0C;ADE1C;AACA;AERA;AAEA;AAGA;AAgCI,qDAAA;AAxBG,SAAS,UAAA,CAAW,EAAE,QAAQ,CAAA,EAAqB;AACxD,EAAA,MAAM;AAAA,IACJ,MAAA,EAAQ;AAAA,MACN,OAAA,EAAS,EAAE,eAAe;AAAA,IAC5B;AAAA,EACF,EAAA,EAAI,2BAAA,CAAkB;AACtB,EAAA,MAAM,EAAE,WAAW,EAAA,EAAI,wCAAA,CAAoB;AAC3C,EAAA,MAAM,UAAA,EAAY,iCAAA,CAAa;AAE/B,EAAA,MAAM,QAAA,EAAU,UAAA,CAAW,SAAA,EAAW,EAAE,SAAA,EAAW,CAAC,sBAAY,CAAA,EAAG,IAAA,EAAM,OAAO,CAAC,CAAA;AAEjF,EAAA,MAAM,CAAC,KAAA,EAAO,MAAA,EAAQ,QAAA,EAAU,WAAA,EAAa,YAAA,EAAc,aAAA,EAAe,SAAS,EAAA,EAAI;AAAA,IACrF,OAAA,CAAQ,QAAA,CAAS,IAAA;AAAA,oBACjB,OAAA,mBAAQ,MAAA,6BAAQ,GAAA,mBAAI,CAAC,IAAA,EAAA,GAAS,IAAA,CAAK,IAAI,CAAA,qBAAE,IAAA,mBAAK,KAAK,IAAA,GAAK,OAAA;AAAA,oBACxD,OAA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AA;AACD,QAAA;AACT,QAAA;AACA,QAAA;AACQ,QAAA;AACI,QAAA;AAAwC,MAAA;AACtD,IAAA;AACF,EAAA;AAEJ;AAYuB;AACf,EAAA;AACJ,IAAA;AACQ,IAAA;AACG,MAAA;AACP,QAAA;AACU,QAAA;AACV,QAAA;AACF,MAAA;AACF,IAAA;AACoB,EAAA;AACF,EAAA;AACFD,EAAAA;AAEL,EAAA;AACG,EAAA;AACG,EAAA;AACF,EAAA;AACX,EAAA;AACQW,IAAAA;AACb,EAAA;AAEmB,EAAA;AAEH,EAAA;AACX,EAAA;AACU,EAAA;AACR,IAAA;AACR,EAAA;AAGE,EAAA;AAEgB,IAAA;AACZT,oBAAAA;AACAA,oBAAAA;AACAA,oBAAAA;AACAA,oBAAAA;AACAA,oBAAAA;AAAM,MAAA;AAAL,MAAA;AACC,QAAA;AACM,QAAA;AACI,0BAAA;AACA,UAAA;AACA,0BAAA;AACA,0BAAA;AACA,0BAAA;AACI,UAAA;AACL,QAAA;AACE,QAAA;AACL,QAAA;AACI,QAAA;AAAA,MAAA;AACZ,IAAA;AAEAC,oBAAAA;AACED,sBAAAA;AACAA,sBAAAA;AACF,IAAA;AAEJ,EAAA;AAEJ;AAEkBK;AHsPI;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/kubb/kubb/packages/plugin-swr/dist/chunk-H4LHXYRJ.cjs","sourcesContent":[null,"import transformers from '@kubb/core/transformers'\nimport { FunctionParams, URLPath } from '@kubb/core/utils'\nimport { Parser, File, Function, useApp } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getASTParams, getComments } from '@kubb/plugin-oas/utils'\n\nimport { SchemaType } from './SchemaType.tsx'\n\nimport type { HttpMethod } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginSwr } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n /**\n * Parameters/options/props that need to be used\n */\n params: string\n /**\n * Generics that needs to be added for TypeScript\n */\n generics?: string\n /**\n * ReturnType(see async for adding Promise type)\n */\n returnType?: string\n /**\n * Options for JSdocs\n */\n JSDoc?: {\n comments: string[]\n }\n hook: {\n name: string\n generics?: string\n }\n client: {\n method: HttpMethod\n generics: string\n withQueryParams: boolean\n withPathParams: boolean\n withData: boolean\n withHeaders: boolean\n path: URLPath\n }\n dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>\n}\n\nfunction Template({ name, generics, returnType, params, JSDoc, client, hook, dataReturnType }: TemplateProps): ReactNode {\n const clientOptions = [\n `method: \"${client.method}\"`,\n 'url',\n client.withQueryParams ? 'params' : undefined,\n client.withData ? 'data' : undefined,\n client.withHeaders ? 'headers: { ...headers, ...clientOptions.headers }' : undefined,\n '...clientOptions',\n ].filter(Boolean)\n\n const resolvedClientOptions = `${transformers.createIndent(4)}${clientOptions.join(`,\\n${transformers.createIndent(4)}`)}`\n if (client.withQueryParams) {\n return (\n <Function export name={name} generics={generics} returnType={returnType} params={params} JSDoc={JSDoc}>\n {`\n const { mutation: mutationOptions, client: clientOptions = {}, shouldFetch = true } = options ?? {}\n\n const url = ${client.path.template} as const\n return ${hook.name}<${hook.generics}>(\n shouldFetch ? [url, params]: null,\n async (_url${client.withData ? ', { arg: data }' : ''}) => {\n const res = await client<${client.generics}>({\n ${resolvedClientOptions}\n })\n\n return ${dataReturnType === 'data' ? 'res.data' : 'res'}\n },\n mutationOptions\n )\n `}\n </Function>\n )\n }\n return (\n <Function export name={name} generics={generics} returnType={returnType} params={params} JSDoc={JSDoc}>\n {`\n const { mutation: mutationOptions, client: clientOptions = {}, shouldFetch = true } = options ?? {}\n\n const url = ${client.path.template} as const\n return ${hook.name}<${hook.generics}>(\n shouldFetch ? url : null,\n async (_url${client.withData ? ', { arg: data }' : ''}) => {\n const res = await client<${client.generics}>({\n ${resolvedClientOptions}\n })\n\n return ${dataReturnType === 'data' ? 'res.data' : 'res'}\n },\n mutationOptions\n )\n `}\n </Function>\n )\n}\n\nconst defaultTemplates = {\n default: Template,\n} as const\n\ntype Props = {\n factory: {\n name: string\n }\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<TemplateProps>\n}\n\nexport function Mutation({ factory, Template = defaultTemplates.default }: Props): ReactNode {\n const {\n plugin: {\n options: { dataReturnType },\n },\n } = useApp<PluginSwr>()\n const { getSchemas, getName } = useOperationManager()\n const operation = useOperation()\n\n const name = getName(operation, { type: 'function' })\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n\n const params = new FunctionParams()\n const client = {\n method: operation.method,\n path: new URLPath(operation.path),\n generics: [`${factory.name}[\"data\"]`, `${factory.name}[\"error\"]`, schemas.request?.name ? `${factory.name}[\"request\"]` : ''].filter(Boolean).join(', '),\n withQueryParams: !!schemas.queryParams?.name,\n withData: !!schemas.request?.name,\n withPathParams: !!schemas.pathParams?.name,\n withHeaders: !!schemas.headerParams?.name,\n }\n\n const resultGenerics = [`${factory.name}[\"response\"]`, `${factory.name}[\"error\"]`]\n\n params.add([\n ...getASTParams(schemas.pathParams, { typed: true }),\n {\n name: 'params',\n type: `${factory.name}['queryParams']`,\n enabled: client.withQueryParams,\n required: false,\n },\n {\n name: 'headers',\n type: `${factory.name}['headerParams']`,\n enabled: client.withHeaders,\n required: false,\n },\n {\n name: 'options',\n required: false,\n type: `{\n mutation?: SWRMutationConfiguration<${resultGenerics.join(', ')}>,\n client?: ${factory.name}['client']['parameters'],\n shouldFetch?: boolean,\n }`,\n default: '{}',\n },\n ])\n\n const hook = {\n name: 'useSWRMutation',\n generics: [...resultGenerics, client.withQueryParams ? '[typeof url, typeof params] | null' : 'typeof url | null'].join(', '),\n }\n\n return (\n <Template\n name={name}\n JSDoc={{ comments: getComments(operation) }}\n client={client}\n hook={hook}\n params={params.toString()}\n returnType={`SWRMutationResponse<${resultGenerics.join(', ')}>`}\n dataReturnType={dataReturnType}\n />\n )\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: typeof defaultTemplates\n}\n\nMutation.File = function ({ templates = defaultTemplates }: FileProps): ReactNode {\n const {\n plugin: {\n options: {\n extName,\n client: { importPath },\n },\n },\n } = useApp<PluginSwr>()\n\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const file = getFile(operation)\n const fileType = getFile(operation, { pluginKey: [pluginTsName] })\n const factoryName = getName(operation, { type: 'type' })\n\n const Template = templates.default\n const factory = {\n name: factoryName,\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name=\"useSWRMutation\" path=\"swr/mutation\" />\n <File.Import name={['SWRMutationConfiguration', 'SWRMutationResponse']} path=\"swr/mutation\" isTypeOnly />\n <File.Import name={'client'} path={importPath} />\n <File.Import name={['ResponseConfig']} path={importPath} isTypeOnly />\n <File.Import\n extName={extName}\n name={[\n schemas.request?.name,\n schemas.response.name,\n schemas.pathParams?.name,\n schemas.queryParams?.name,\n schemas.headerParams?.name,\n ...(schemas.errors?.map((error) => error.name) || []),\n ].filter(Boolean)}\n root={file.path}\n path={fileType.path}\n isTypeOnly\n />\n\n <File.Source>\n <SchemaType factory={factory} />\n <Mutation Template={Template} factory={factory} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nMutation.templates = defaultTemplates\n","import { Type, useApp } from '@kubb/react'\n\nimport { useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr } from '../types.ts'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\ntype Props = {\n factory: {\n name: string\n }\n}\n\nexport function SchemaType({ factory }: Props): ReactNode {\n const {\n plugin: {\n options: { dataReturnType },\n },\n } = useApp<PluginSwr>()\n const { getSchemas } = useOperationManager()\n const operation = useOperation()\n\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n\n const [TData, TError, TRequest, TPathParams, TQueryParams, THeaderParams, TResponse] = [\n schemas.response.name,\n schemas.errors?.map((item) => item.name).join(' | ') || 'never',\n schemas.request?.name || 'never',\n schemas.pathParams?.name || 'never',\n schemas.queryParams?.name || 'never',\n schemas.headerParams?.name || 'never',\n schemas.response.name,\n ]\n\n const clientType = `${factory.name}Client`\n\n return (\n <>\n <Type name={clientType}>{`typeof client<${TResponse}, ${TError}, ${TRequest}>`}</Type>\n <Type name={factory.name}>\n {`\n {\n data: ${TData}\n error: ${TError}\n request: ${TRequest}\n pathParams: ${TPathParams}\n queryParams: ${TQueryParams}\n headerParams: ${THeaderParams}\n response: ${dataReturnType === 'data' ? TData : `Awaited<ReturnType<${clientType}>>`}\n client: {\n parameters: Partial<Parameters<${clientType}>[0]>\n return: Awaited<ReturnType<${clientType}>>\n }\n }\n `}\n </Type>\n </>\n )\n}\n","import { FunctionParams, URLPath } from '@kubb/core/utils'\nimport { Parser, File, Function, useApp } from '@kubb/react'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getASTParams, getComments } from '@kubb/plugin-oas/utils'\nimport { pluginZodName } from '@kubb/plugin-zod'\n\nimport { QueryOptions } from './QueryOptions.tsx'\nimport { SchemaType } from './SchemaType.tsx'\n\nimport type { ReactNode } from 'react'\nimport type { FileMeta, PluginSwr } from '../types.ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n /**\n * Parameters/options/props that need to be used\n */\n params: string\n /**\n * Generics that needs to be added for TypeScript\n */\n generics?: string\n /**\n * ReturnType(see async for adding Promise type)\n */\n returnType?: string\n /**\n * Options for JSdocs\n */\n JSDoc?: {\n comments: string[]\n }\n hook: {\n name: string\n generics?: string\n queryOptions: string\n }\n client: {\n path: URLPath\n withQueryParams: boolean\n }\n}\n\nfunction Template({ name, generics, returnType, params, JSDoc, hook, client }: TemplateProps): ReactNode {\n if (client.withQueryParams) {\n return (\n <>\n <Function name={name} export generics={generics} returnType={returnType} params={params} JSDoc={JSDoc}>\n {`\n const { query: queryOptions, client: clientOptions = {}, shouldFetch = true } = options ?? {}\n\n const url = ${client.path.template}\n const query = ${hook.name}<${hook.generics}>(\n shouldFetch ? [url, params]: null,\n {\n ...${hook.queryOptions},\n ...queryOptions\n }\n )\n\n return query\n `}\n </Function>\n </>\n )\n }\n\n return (\n <>\n <Function name={name} export generics={generics} returnType={returnType} params={params} JSDoc={JSDoc}>\n {`\n const { query: queryOptions, client: clientOptions = {}, shouldFetch = true } = options ?? {}\n\n const url = ${client.path.template}\n const query = ${hook.name}<${hook.generics}>(\n shouldFetch ? url : null,\n {\n ...${hook.queryOptions},\n ...queryOptions\n }\n )\n\n return query\n `}\n </Function>\n </>\n )\n}\n\nconst defaultTemplates = {\n default: Template,\n} as const\n\ntype Props = {\n factory: {\n name: string\n }\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<TemplateProps>\n /**\n * This will make it possible to override the default behaviour.\n */\n QueryOptionsTemplate?: React.ComponentType<React.ComponentProps<typeof QueryOptions.templates.default>>\n}\n\nexport function Query({ factory, Template = defaultTemplates.default, QueryOptionsTemplate = QueryOptions.templates.default }: Props): ReactNode {\n const {\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { dataReturnType },\n },\n } = useApp<PluginSwr>()\n\n const operation = useOperation()\n const { getSchemas, getName } = useOperationManager()\n\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const zodSchemas = getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' })\n\n const name = getName(operation, { type: 'function' })\n\n const queryOptionsName = pluginManager.resolveName({\n name: `${factory.name}QueryOptions`,\n pluginKey,\n })\n const generics = new FunctionParams()\n const params = new FunctionParams()\n const queryParams = new FunctionParams()\n const client = {\n method: operation.method,\n path: new URLPath(operation.path),\n withQueryParams: !!schemas.queryParams?.name,\n withData: !!schemas.request?.name,\n withPathParams: !!schemas.pathParams?.name,\n withHeaders: !!schemas.headerParams?.name,\n }\n\n const resultGenerics = ['TData', `${factory.name}[\"error\"]`]\n\n generics.add([{ type: 'TData', default: `${factory.name}[\"response\"]` }])\n\n const queryOptionsGenerics = ['TData']\n\n params.add([\n ...getASTParams(schemas.pathParams, { typed: true }),\n {\n name: 'params',\n type: `${factory.name}['queryParams']`,\n enabled: client.withQueryParams,\n required: false,\n },\n {\n name: 'headers',\n type: `${factory.name}['headerParams']`,\n enabled: client.withHeaders,\n required: false,\n },\n {\n name: 'options',\n required: false,\n type: `{\n query?: SWRConfiguration<${resultGenerics.join(', ')}>,\n client?: ${factory.name}['client']['parameters'],\n shouldFetch?: boolean,\n }`,\n default: '{}',\n },\n ])\n\n queryParams.add([\n ...getASTParams(schemas.pathParams, { typed: false }),\n {\n name: 'params',\n enabled: client.withQueryParams,\n required: false,\n },\n {\n name: 'headers',\n enabled: client.withHeaders,\n required: false,\n },\n {\n name: 'clientOptions',\n required: false,\n },\n ])\n\n const hook = {\n name: 'useSWR',\n generics: [...resultGenerics, client.withQueryParams ? '[typeof url, typeof params] | null' : 'typeof url | null'].join(', '),\n queryOptions: `${queryOptionsName}<${queryOptionsGenerics.join(', ')}>(${queryParams.toString()})`,\n }\n\n return (\n <>\n <QueryOptions factory={factory} Template={QueryOptionsTemplate} dataReturnType={dataReturnType} />\n\n <Template\n name={name}\n generics={generics.toString()}\n JSDoc={{ comments: getComments(operation) }}\n client={client}\n hook={hook}\n params={params.toString()}\n returnType={`SWRResponse<${resultGenerics.join(', ')}>`}\n />\n </>\n )\n}\n\ntype FileProps = {\n /**\n * This will make it possible to override the default behaviour.\n */\n templates?: {\n query: typeof defaultTemplates\n queryOptions: typeof QueryOptions.templates\n }\n}\n\nQuery.File = function ({ templates }: FileProps): ReactNode {\n const {\n pluginManager,\n plugin: {\n options: {\n extName,\n client: { importPath },\n parser,\n },\n },\n } = useApp<PluginSwr>()\n const { getSchemas, getFile, getName } = useOperationManager()\n const operation = useOperation()\n\n const file = getFile(operation)\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const zodSchemas = getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' })\n const fileType = getFile(operation, { pluginKey: [pluginTsName] })\n const fileZodSchemas = getFile(operation, {\n pluginKey: [pluginZodName],\n })\n\n const factoryName = getName(operation, { type: 'type' })\n\n const Template = templates?.query.default || defaultTemplates.default\n const QueryOptionsTemplate = templates?.queryOptions.default || QueryOptions.templates.default\n const factory = {\n name: factoryName,\n }\n\n return (\n <Parser language=\"typescript\">\n <File<FileMeta> baseName={file.baseName} path={file.path} meta={file.meta}>\n {parser === 'zod' && <File.Import extName={extName} name={[zodSchemas.response.name]} root={file.path} path={fileZodSchemas.path} />}\n <File.Import name=\"useSWR\" path=\"swr\" />\n <File.Import name={['SWRConfiguration', 'SWRResponse']} path=\"swr\" isTypeOnly />\n <File.Import name={'client'} path={importPath} />\n <File.Import name={['ResponseConfig']} path={importPath} isTypeOnly />\n <File.Import\n extName={extName}\n name={[\n schemas.request?.name,\n schemas.response.name,\n schemas.pathParams?.name,\n schemas.queryParams?.name,\n schemas.headerParams?.name,\n ...(schemas.statusCodes?.map((item) => item.name) || []),\n ].filter(Boolean)}\n root={file.path}\n path={fileType.path}\n isTypeOnly\n />\n\n <File.Source>\n <SchemaType factory={factory} />\n <Query factory={factory} Template={Template} QueryOptionsTemplate={QueryOptionsTemplate} />\n </File.Source>\n </File>\n </Parser>\n )\n}\n\nQuery.templates = defaultTemplates\n","import transformers from '@kubb/core/transformers'\nimport { FunctionParams, URLPath } from '@kubb/core/utils'\nimport { useOperation, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getASTParams } from '@kubb/plugin-oas/utils'\nimport { Function, useApp } from '@kubb/react'\nimport { pluginZodName } from '@kubb/plugin-zod'\n\nimport type { HttpMethod } from '@kubb/oas'\nimport type { ReactNode } from 'react'\nimport type { PluginSwr } from '../types.ts'\nimport { pluginTsName } from '@kubb/plugin-ts'\n\ntype TemplateProps = {\n /**\n * Name of the function\n */\n name: string\n /**\n * Parameters/options/props that need to be used\n */\n params: string\n /**\n * Generics that needs to be added for TypeScript\n */\n generics?: string\n /**\n * ReturnType(see async for adding Promise type)\n */\n returnType?: string\n /**\n * Options for JSdocs\n */\n JSDoc?: {\n comments: string[]\n }\n client: {\n generics: string\n method: HttpMethod\n path: URLPath\n withQueryParams: boolean\n withPathParams: boolean\n withData: boolean\n withHeaders: boolean\n contentType: string\n }\n dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>\n parser: string | undefined\n}\n\nfunction Template({ name, params, generics, returnType, JSDoc, client, dataReturnType, parser }: TemplateProps): ReactNode {\n const isFormData = client.contentType === 'multipart/form-data'\n const headers = [\n client.contentType !== 'application/json' ? `'Content-Type': '${client.contentType}'` : undefined,\n client.withHeaders ? '...headers' : undefined,\n ]\n .filter(Boolean)\n .join(', ')\n\n const clientOptions = [\n `method: \"${client.method}\"`,\n `url: ${client.path.template}`,\n client.withQueryParams ? 'params' : undefined,\n client.withData && !isFormData ? 'data' : undefined,\n client.withData && isFormData ? 'data: formData' : undefined,\n headers.length ? `headers: { ${headers}, ...options.headers }` : undefined,\n '...options',\n ].filter(Boolean)\n\n const resolvedClientOptions = `${transformers.createIndent(4)}${clientOptions.join(`,\\n${transformers.createIndent(4)}`)}`\n\n let returnRes = parser ? `return ${parser}(res.data)` : 'return res.data'\n\n if (dataReturnType === 'full') {\n returnRes = parser ? `return {...res, data: ${parser}(res.data)}` : 'return res'\n }\n\n const formData = isFormData\n ? `\n const formData = new FormData()\n if(data) {\n Object.keys(data).forEach((key) => {\n const value = data[key];\n if (typeof key === \"string\" && (typeof value === \"string\" || value instanceof Blob)) {\n formData.append(key, value);\n }\n })\n }\n `\n : undefined\n\n return (\n <Function name={name} export generics={generics} returnType={returnType} params={params} JSDoc={JSDoc}>\n {`\n return {\n fetcher: async () => {\n ${formData || ''}\n const res = await client<${client.generics}>({\n ${resolvedClientOptions}\n })\n\n ${returnRes}\n },\n }\n\n `}\n </Function>\n )\n}\n\nconst defaultTemplates = {\n default: Template,\n} as const\n\ntype Props = {\n factory: {\n name: string\n }\n dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>\n /**\n * This will make it possible to override the default behaviour.\n */\n Template?: React.ComponentType<TemplateProps>\n}\n\nexport function QueryOptions({ factory, dataReturnType, Template = defaultTemplates.default }: Props): ReactNode {\n const {\n pluginManager,\n plugin: {\n key: pluginKey,\n options: { parser },\n },\n } = useApp<PluginSwr>()\n const { getSchemas } = useOperationManager()\n const operation = useOperation()\n\n const schemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const zodSchemas = getSchemas(operation, { pluginKey: [pluginZodName], type: 'function' })\n const name = pluginManager.resolveName({\n name: `${factory.name}QueryOptions`,\n pluginKey,\n })\n const contentType = operation.getContentType()\n\n const generics = new FunctionParams()\n const params = new FunctionParams()\n\n const clientGenerics = ['TData', `${factory.name}['error']`]\n const resultGenerics = ['TData', `${factory.name}['error']`]\n\n generics.add([{ type: 'TData', default: `${factory.name}['response']` }])\n\n params.add([\n ...getASTParams(schemas.pathParams, { typed: true }),\n {\n name: 'params',\n type: `${factory.name}['queryParams']`,\n enabled: !!schemas.queryParams?.name,\n required: false,\n },\n {\n name: 'headers',\n type: `${factory.name}['headerParams']`,\n enabled: !!schemas.headerParams?.name,\n required: false,\n },\n {\n name: 'options',\n type: `${factory.name}['client']['parameters']`,\n default: '{}',\n },\n ])\n\n const client = {\n withQueryParams: !!schemas.queryParams?.name,\n withData: !!schemas.request?.name,\n withPathParams: !!schemas.pathParams?.name,\n withHeaders: !!schemas.headerParams?.name,\n method: operation.method,\n path: new URLPath(operation.path),\n generics: clientGenerics.join(', '),\n contentType,\n }\n\n return (\n <Template\n name={name}\n params={params.toString()}\n generics={generics.toString()}\n returnType={`SWRConfiguration<${resultGenerics.join(', ')}>`}\n client={client}\n dataReturnType={dataReturnType}\n parser={parser === 'zod' ? `${zodSchemas.response.name}.parse` : undefined}\n />\n )\n}\n\nQueryOptions.templates = defaultTemplates\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkH4LHXYRJcjs = require('./chunk-H4LHXYRJ.cjs');
6
+
7
+
8
+
9
+
10
+ exports.Mutation = _chunkH4LHXYRJcjs.Mutation; exports.Query = _chunkH4LHXYRJcjs.Query; exports.QueryOptions = _chunkH4LHXYRJcjs.QueryOptions;
11
+ //# sourceMappingURL=components.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-swr/dist/components.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,8IAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-swr/dist/components.cjs"}
@@ -0,0 +1,7 @@
1
+ export { M as Mutation, Q as Query, a as QueryOptions } from './index-Ca8KyrCA.cjs';
2
+ import '@kubb/core/utils';
3
+ import '@kubb/oas';
4
+ import 'react';
5
+ import '@kubb/core';
6
+ import '@kubb/fs/types';
7
+ import '@kubb/plugin-oas';
@@ -0,0 +1,7 @@
1
+ export { M as Mutation, Q as Query, a as QueryOptions } from './index-Ca8KyrCA.js';
2
+ import '@kubb/core/utils';
3
+ import '@kubb/oas';
4
+ import 'react';
5
+ import '@kubb/core';
6
+ import '@kubb/fs/types';
7
+ import '@kubb/plugin-oas';
@@ -0,0 +1,11 @@
1
+ import {
2
+ Mutation,
3
+ Query,
4
+ QueryOptions
5
+ } from "./chunk-ECJ346AA.js";
6
+ export {
7
+ Mutation,
8
+ Query,
9
+ QueryOptions
10
+ };
11
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,304 @@
1
+ import { URLPath } from '@kubb/core/utils';
2
+ import { HttpMethod } from '@kubb/oas';
3
+ import { ReactNode } from 'react';
4
+ import { PluginFactoryOptions, ResolveNameParams } from '@kubb/core';
5
+ import * as KubbFile from '@kubb/fs/types';
6
+ import { ResolvePathOptions, Exclude, Include, Override } from '@kubb/plugin-oas';
7
+
8
+ type TemplateProps$2 = {
9
+ /**
10
+ * Name of the function
11
+ */
12
+ name: string;
13
+ /**
14
+ * Parameters/options/props that need to be used
15
+ */
16
+ params: string;
17
+ /**
18
+ * Generics that needs to be added for TypeScript
19
+ */
20
+ generics?: string;
21
+ /**
22
+ * ReturnType(see async for adding Promise type)
23
+ */
24
+ returnType?: string;
25
+ /**
26
+ * Options for JSdocs
27
+ */
28
+ JSDoc?: {
29
+ comments: string[];
30
+ };
31
+ hook: {
32
+ name: string;
33
+ generics?: string;
34
+ };
35
+ client: {
36
+ method: HttpMethod;
37
+ generics: string;
38
+ withQueryParams: boolean;
39
+ withPathParams: boolean;
40
+ withData: boolean;
41
+ withHeaders: boolean;
42
+ path: URLPath;
43
+ };
44
+ dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>;
45
+ };
46
+ declare function Template$2({ name, generics, returnType, params, JSDoc, client, hook, dataReturnType }: TemplateProps$2): ReactNode;
47
+ declare const defaultTemplates$1: {
48
+ readonly default: typeof Template$2;
49
+ };
50
+ type Props$2 = {
51
+ factory: {
52
+ name: string;
53
+ };
54
+ /**
55
+ * This will make it possible to override the default behaviour.
56
+ */
57
+ Template?: React.ComponentType<TemplateProps$2>;
58
+ };
59
+ declare function Mutation({ factory, Template }: Props$2): ReactNode;
60
+ declare namespace Mutation {
61
+ var File: ({ templates }: FileProps$1) => ReactNode;
62
+ var templates: {
63
+ readonly default: typeof Template$2;
64
+ };
65
+ }
66
+ type FileProps$1 = {
67
+ /**
68
+ * This will make it possible to override the default behaviour.
69
+ */
70
+ templates?: typeof defaultTemplates$1;
71
+ };
72
+
73
+ type TemplateProps$1 = {
74
+ /**
75
+ * Name of the function
76
+ */
77
+ name: string;
78
+ /**
79
+ * Parameters/options/props that need to be used
80
+ */
81
+ params: string;
82
+ /**
83
+ * Generics that needs to be added for TypeScript
84
+ */
85
+ generics?: string;
86
+ /**
87
+ * ReturnType(see async for adding Promise type)
88
+ */
89
+ returnType?: string;
90
+ /**
91
+ * Options for JSdocs
92
+ */
93
+ JSDoc?: {
94
+ comments: string[];
95
+ };
96
+ client: {
97
+ generics: string;
98
+ method: HttpMethod;
99
+ path: URLPath;
100
+ withQueryParams: boolean;
101
+ withPathParams: boolean;
102
+ withData: boolean;
103
+ withHeaders: boolean;
104
+ contentType: string;
105
+ };
106
+ dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>;
107
+ parser: string | undefined;
108
+ };
109
+ declare function Template$1({ name, params, generics, returnType, JSDoc, client, dataReturnType, parser }: TemplateProps$1): ReactNode;
110
+ type Props$1 = {
111
+ factory: {
112
+ name: string;
113
+ };
114
+ dataReturnType: NonNullable<PluginSwr['options']['dataReturnType']>;
115
+ /**
116
+ * This will make it possible to override the default behaviour.
117
+ */
118
+ Template?: React.ComponentType<TemplateProps$1>;
119
+ };
120
+ declare function QueryOptions({ factory, dataReturnType, Template }: Props$1): ReactNode;
121
+ declare namespace QueryOptions {
122
+ var templates: {
123
+ readonly default: typeof Template$1;
124
+ };
125
+ }
126
+
127
+ type TemplateProps = {
128
+ /**
129
+ * Name of the function
130
+ */
131
+ name: string;
132
+ /**
133
+ * Parameters/options/props that need to be used
134
+ */
135
+ params: string;
136
+ /**
137
+ * Generics that needs to be added for TypeScript
138
+ */
139
+ generics?: string;
140
+ /**
141
+ * ReturnType(see async for adding Promise type)
142
+ */
143
+ returnType?: string;
144
+ /**
145
+ * Options for JSdocs
146
+ */
147
+ JSDoc?: {
148
+ comments: string[];
149
+ };
150
+ hook: {
151
+ name: string;
152
+ generics?: string;
153
+ queryOptions: string;
154
+ };
155
+ client: {
156
+ path: URLPath;
157
+ withQueryParams: boolean;
158
+ };
159
+ };
160
+ declare function Template({ name, generics, returnType, params, JSDoc, hook, client }: TemplateProps): ReactNode;
161
+ declare const defaultTemplates: {
162
+ readonly default: typeof Template;
163
+ };
164
+ type Props = {
165
+ factory: {
166
+ name: string;
167
+ };
168
+ /**
169
+ * This will make it possible to override the default behaviour.
170
+ */
171
+ Template?: React.ComponentType<TemplateProps>;
172
+ /**
173
+ * This will make it possible to override the default behaviour.
174
+ */
175
+ QueryOptionsTemplate?: React.ComponentType<React.ComponentProps<typeof QueryOptions.templates.default>>;
176
+ };
177
+ declare function Query({ factory, Template, QueryOptionsTemplate }: Props): ReactNode;
178
+ declare namespace Query {
179
+ var File: ({ templates }: FileProps) => ReactNode;
180
+ var templates: {
181
+ readonly default: typeof Template;
182
+ };
183
+ }
184
+ type FileProps = {
185
+ /**
186
+ * This will make it possible to override the default behaviour.
187
+ */
188
+ templates?: {
189
+ query: typeof defaultTemplates;
190
+ queryOptions: typeof QueryOptions.templates;
191
+ };
192
+ };
193
+
194
+ type Templates = {
195
+ mutation?: typeof Mutation.templates | false;
196
+ query?: typeof Query.templates | false;
197
+ queryOptions?: typeof QueryOptions.templates | false;
198
+ };
199
+ type Options = {
200
+ output?: {
201
+ /**
202
+ * Output to save the SWR hooks.
203
+ * @default `"hooks"`
204
+ */
205
+ path: string;
206
+ /**
207
+ * Name to be used for the `export * as {{exportAs}} from './'`
208
+ */
209
+ exportAs?: string;
210
+ /**
211
+ * Add an extension to the generated imports and exports, default it will not use an extension
212
+ */
213
+ extName?: KubbFile.Extname;
214
+ /**
215
+ * Define what needs to exported, here you can also disable the export of barrel files
216
+ * @default `'barrel'`
217
+ */
218
+ exportType?: 'barrel' | 'barrelNamed' | false;
219
+ };
220
+ /**
221
+ * Group the SWR hooks based on the provided name.
222
+ */
223
+ group?: {
224
+ /**
225
+ * Tag will group based on the operation tag inside the Swagger file
226
+ */
227
+ type: 'tag';
228
+ /**
229
+ * Relative path to save the grouped SWR hooks.
230
+ *
231
+ * `{{tag}}` will be replaced by the current tagName.
232
+ * @example `${output}/{{tag}}Controller` => `hooks/PetController`
233
+ * @default `${output}/{{tag}}Controller`
234
+ */
235
+ output?: string;
236
+ /**
237
+ * Name to be used for the `export * as {{exportAs}} from './`
238
+ * @default `"{{tag}}SWRHooks"`
239
+ */
240
+ exportAs?: string;
241
+ };
242
+ /**
243
+ * Array containing exclude parameters to exclude/skip tags/operations/methods/paths.
244
+ */
245
+ exclude?: Array<Exclude>;
246
+ /**
247
+ * Array containing include parameters to include tags/operations/methods/paths.
248
+ */
249
+ include?: Array<Include>;
250
+ /**
251
+ * Array containing override parameters to override `options` based on tags/operations/methods/paths.
252
+ */
253
+ override?: Array<Override<ResolvedOptions>>;
254
+ client?: {
255
+ /**
256
+ * Path to the client import path that will be used to do the API calls.
257
+ * It will be used as `import client from '${client.importPath}'`.
258
+ * It allow both relative and absolute path.
259
+ * the path will be applied as is, so relative path shoule be based on the file being generated.
260
+ * @default '@kubb/plugin-client/client'
261
+ */
262
+ importPath?: string;
263
+ };
264
+ /**
265
+ * ReturnType that needs to be used when calling client().
266
+ *
267
+ * `Data` will return ResponseConfig[data].
268
+ *
269
+ * `Full` will return ResponseConfig.
270
+ * @default `'data'`
271
+ * @private
272
+ */
273
+ dataReturnType?: 'data' | 'full';
274
+ transformers?: {
275
+ /**
276
+ * Customize the names based on the type that is provided by the plugin.
277
+ */
278
+ name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
279
+ };
280
+ /**
281
+ * Which parser can be used before returning the data to `@tanstack/query`.
282
+ * `'zod'` will use `@kubb/plugin-zod` to parse the data.
283
+ */
284
+ parser?: 'zod';
285
+ /**
286
+ * Make it possible to override one of the templates
287
+ */
288
+ templates?: Partial<Templates>;
289
+ };
290
+ type ResolvedOptions = {
291
+ extName: KubbFile.Extname | undefined;
292
+ client: Required<NonNullable<Options['client']>>;
293
+ dataReturnType: NonNullable<Options['dataReturnType']>;
294
+ templates: NonNullable<Templates>;
295
+ parser: Options['parser'];
296
+ };
297
+ type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
298
+ declare module '@kubb/core' {
299
+ interface _Register {
300
+ ['@kubb/plugin-swr']: PluginSwr;
301
+ }
302
+ }
303
+
304
+ export { Mutation as M, type Options as O, type PluginSwr as P, Query as Q, QueryOptions as a };