@kubb/plugin-client 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/generators-0Sc5zPfx.js.map +1 -1
- package/dist/generators-C_ySk_ES.cjs.map +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{types-CMiGIvE1.d.cts → types-DJmtgGu4.d.ts} +22 -136
- package/dist/{types-BtM-bA4L.d.ts → types-DuPfvza5.d.cts} +22 -136
- package/package.json +17 -12
- package/src/generators/groupedClientGenerator.tsx +1 -1
package/dist/components.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PluginClient, o as Operation, r as OperationSchemas } from "./types-
|
|
1
|
+
import { n as PluginClient, o as Operation, r as OperationSchemas } from "./types-DuPfvza5.cjs";
|
|
2
2
|
import { FunctionParams } from "@kubb/react-fabric";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
|
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PluginClient, o as Operation, r as OperationSchemas } from "./types-
|
|
1
|
+
import { n as PluginClient, o as Operation, r as OperationSchemas } from "./types-DJmtgGu4.js";
|
|
2
2
|
import { FunctionParams } from "@kubb/react-fabric";
|
|
3
3
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-0Sc5zPfx.js","names":[],"sources":["../src/generators/clientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/groupedClientGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\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 } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const pluginManager = usePluginManager()\n const {\n options: { output, urlType },\n } = usePlugin<PluginClient>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\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 return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\n )}\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={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n key: pluginKey,\n options: { output },\n } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import type { KubbFile } from '@kubb/core/fs'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const { options, key: pluginKey } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,kBAAkB,qBAAmC;CAChE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,gBAAgB,kBAAkB;EACxC,MAAM,EACJ,SAAS,EAAE,QAAQ,cACjB,WAAyB;EAC7B,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,qBAAqB;EAE9D,MAAM,SAAS;GACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,MAAM;GACV,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAO,QAAQ;IAAO,CAAC;GAC5E,MAAM,QAAQ,UAA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E,CAAC,GAAG;AAEnF,QAAI,CAAC,OAAO,OAAO,CAAC,KAClB,QAAO;IAGT,MAAM,OAAO,cAAc,QAAQ;KACjC;KACA,SAAS;KACT;KACA,SAAS,EAAE,OAAO;KACnB,CAAC;IAEF,MAAM,SAAS;KACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;KAC9C,MAAM,QAAQ,UAAU;KACzB;IAED,MAAM,eAAe,IAAI,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK;AAErE,QAAI,aACF,cAAa,QAAQ,KAAK,OAAO;QAEjC,KAAI,KAAK;KAAE;KAAM;KAAM,SAAS,CAAC,OAAO;KAAE,CAAC;;AAI/C,UAAO;KAET,EAAE,CACH,CAEkB,KAAK,EAAE,MAAM,MAAM,cAAc;AAClD,UACE,qBAAC;IAEC,UAAU,KAAK;IACf,MAAM,KAAK;IACX,MAAM,KAAK;IACX,QAAQ,UAAU;KAAE;KAAK,QAAQ,QAAQ;KAAQ,QAAQ,cAAc;KAAQ,CAAC;IAChF,QAAQ,UAAU;KAAE;KAAK,QAAQ,QAAQ;KAAQ,CAAC;eAEjD,QAAQ,KAAK,WACZ,oBAAC,KAAK;KAAyB,MAAM,CAAC,OAAO,KAAK;KAAE,MAAM,KAAK;KAAM,MAAM,OAAO,KAAK;OAArE,OAAO,KAAsE,CAC/F,EAEF,oBAAC,KAAK;KAAa;KAAM;KAAa;eACpC,oBAAC;MAAS;MAAa;gBACpB,YAAY,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,KAAK,KAAK,CAAC;OACpD;MACC;MAfT,KAAK,KAgBL;IAET;;CAEL,CAAC"}
|
|
1
|
+
{"version":3,"file":"generators-0Sc5zPfx.js","names":[],"sources":["../src/generators/clientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/groupedClientGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\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 } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const pluginManager = usePluginManager()\n const {\n options: { output, urlType },\n } = usePlugin<PluginClient>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\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 return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\n )}\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={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n key: pluginKey,\n options: { output },\n } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const { options, key: pluginKey } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,kBAAkB,qBAAmC;CAChE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,gBAAgB,kBAAkB;EACxC,MAAM,EACJ,SAAS,EAAE,QAAQ,cACjB,WAAyB;EAC7B,MAAM,MAAM,QAAQ;EACpB,MAAM,EAAE,YAAY,SAAS,YAAY,qBAAqB;EAE9D,MAAM,SAAS;GACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,MAAM;GACV,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;IAAO,QAAQ;IAAO,CAAC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AO,UAAU,MAAM,IAAI,EAAE,CAAC,GAAG;AAEnF,QAAI,CAAC,OAAO,OAAO,CAAC,KAClB,QAAO;IAGT,MAAM,OAAO,cAAc,QAAQ;KACjC;KACA,SAAS;KACT;KACA,SAAS,EAAE,OAAO;KACnB,CAAC;IAEF,MAAM,SAAS;KACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;KAC9C,MAAM,QAAQ,UAAU;KACzB;IAED,MAAM,eAAe,IAAI,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK;AAErE,QAAI,aACF,cAAa,QAAQ,KAAK,OAAO;QAEjC,KAAI,KAAK;KAAE;KAAM;KAAM,SAAS,CAAC,OAAO;KAAE,CAAC;;AAI/C,UAAO;KAET,EAAE,CACH,CAEkB,KAAK,EAAE,MAAM,MAAM,cAAc;AAClD,UACE,qBAAC;IAEC,UAAU,KAAK;IACf,MAAM,KAAK;IACX,MAAM,KAAK;IACX,QAAQ,UAAU;KAAE;KAAK,QAAQ,QAAQ;KAAQ,QAAQ,cAAc;KAAQ,CAAC;IAChF,QAAQ,UAAU;KAAE;KAAK,QAAQ,QAAQ;KAAQ,CAAC;eAEjD,QAAQ,KAAK,WACZ,oBAAC,KAAK;KAAyB,MAAM,CAAC,OAAO,KAAK;KAAE,MAAM,KAAK;KAAM,MAAM,OAAO,KAAK;OAArE,OAAO,KAAsE,CAC/F,EAEF,oBAAC,KAAK;KAAa;KAAM;KAAa;eACpC,oBAAC;MAAS;MAAa;gBACpB,YAAY,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,KAAK,KAAK,CAAC;OACpD;MACC;MAfT,KAAK,KAgBL;IAET;;CAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-C_ySk_ES.cjs","names":["pluginTsName","pluginZodName","File","Url","Client","File","Operations","File","Function"],"sources":["../src/generators/clientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/groupedClientGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\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 } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const pluginManager = usePluginManager()\n const {\n options: { output, urlType },\n } = usePlugin<PluginClient>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\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 return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\n )}\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={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n key: pluginKey,\n options: { output },\n } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import type { KubbFile } from '@kubb/core/fs'\nimport { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const { options, key: pluginKey } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,8DAAqD;CAChE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,yDAAkC;EACxC,MAAM,EACJ,SAAS,EAAE,QAAQ,gDACQ;EAC7B,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,SAAS;GACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,MAAM;GACV,MAAM,Q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M,IAAI,EAAE,CAAC,GAAG;AAEnF,QAAI,CAAC,OAAO,OAAO,CAAC,KAClB,QAAO;IAGT,MAAM,OAAO,cAAc,QAAQ;KACjC;KACA,SAAS;KACT;KACA,SAAS,EAAE,OAAO;KACnB,CAAC;IAEF,MAAM,SAAS;KACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;KAC9C,MAAM,QAAQ,UAAU;KACzB;IAED,MAAM,eAAe,IAAI,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK;AAErE,QAAI,aACF,cAAa,QAAQ,KAAK,OAAO;QAEjC,KAAI,KAAK;KAAE;KAAM;KAAM,SAAS,CAAC,OAAO;KAAE,CAAC;;AAI/C,UAAO;KAET,EAAE,CACH,CAEkB,KAAK,EAAE,MAAM,MAAM,cAAc;AAClD,UACE,0DAACC;IAEC,UAAU,KAAK;IACf,MAAM,KAAK;IACX,MAAM,KAAK;IACX,+CAAkB;KAAE;KAAK,QAAQ,QAAQ;KAAQ,QAAQ,cAAc;KAAQ,CAAC;IAChF,+CAAkB;KAAE;KAAK,QAAQ,QAAQ;KAAQ,CAAC;eAEjD,QAAQ,KAAK,WACZ,yDAACA,yBAAK;KAAyB,MAAM,CAAC,OAAO,KAAK;KAAE,MAAM,KAAK;KAAM,MAAM,OAAO,KAAK;OAArE,OAAO,KAAsE,CAC/F,EAEF,yDAACA,yBAAK;KAAa;KAAM;KAAa;eACpC,yDAACC;MAAS;MAAa;gBACpB,YAAY,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,KAAK,KAAK,CAAC;OACpD;MACC;MAfT,KAAK,KAgBL;IAET;;CAEL,CAAC"}
|
|
1
|
+
{"version":3,"file":"generators-C_ySk_ES.cjs","names":["pluginTsName","pluginZodName","File","Url","Client","File","Operations","File","Function"],"sources":["../src/generators/clientGenerator.tsx","../src/generators/operationsGenerator.tsx","../src/generators/groupedClientGenerator.tsx"],"sourcesContent":["import { usePlugin, usePluginManager } from '@kubb/core/hooks'\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 } from '@kubb/react-fabric'\nimport { Client } from '../components/Client'\nimport { Url } from '../components/Url.tsx'\nimport type { PluginClient } from '../types'\n\nexport const clientGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operation({ options, operation }) {\n const pluginManager = usePluginManager()\n const {\n options: { output, urlType },\n } = usePlugin<PluginClient>()\n const oas = useOas()\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const url = {\n name: getName(operation, { type: 'function', suffix: 'url', prefix: 'get' }),\n file: getFile(operation),\n }\n\n const type = {\n file: getFile(operation, { pluginKey: [pluginTsName] }),\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 return (\n <File\n baseName={client.file.baseName}\n path={client.file.path}\n meta={client.file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <File.Import name={'fetch'} path={options.importPath} />\n <File.Import name={['RequestConfig', 'ResponseErrorConfig']} path={options.importPath} isTypeOnly />\n {options.parser === 'zod' && (\n <File.Import name={[zod.schemas.response.name, zod.schemas.request?.name].filter(Boolean)} root={client.file.path} path={zod.file.path} />\n )}\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={client.file.path}\n path={type.file.path}\n isTypeOnly\n />\n\n <Url\n name={url.name}\n baseURL={options.baseURL}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n isIndexable={urlType === 'export'}\n isExportable={urlType === 'export'}\n />\n\n <Client\n name={client.name}\n urlName={url.name}\n baseURL={options.baseURL}\n dataReturnType={options.dataReturnType}\n pathParamsType={options.pathParamsType}\n paramsCasing={options.paramsCasing}\n paramsType={options.paramsType}\n typeSchemas={type.schemas}\n operation={operation}\n parser={options.parser}\n zodSchemas={zod.schemas}\n />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File } from '@kubb/react-fabric'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const operationsGenerator = createReactGenerator<PluginClient>({\n name: 'client',\n Operations({ operations }) {\n const {\n key: pluginKey,\n options: { output },\n } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n\n const name = 'operations'\n const file = pluginManager.getFile({ name, extname: '.ts', pluginKey })\n\n return (\n <File\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output, config: pluginManager.config })}\n footer={getFooter({ oas, output })}\n >\n <Operations name={name} operations={operations} />\n </File>\n )\n },\n})\n","import { usePlugin, usePluginManager } from '@kubb/core/hooks'\nimport { camelCase } from '@kubb/core/transformers'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { getBanner, getFooter } from '@kubb/plugin-oas/utils'\nimport { File, Function } from '@kubb/react-fabric'\nimport type { PluginClient } from '../types'\n\nexport const groupedClientGenerator = createReactGenerator<PluginClient>({\n name: 'groupedClient',\n Operations({ operations }) {\n const { options, key: pluginKey } = usePlugin<PluginClient>()\n const pluginManager = usePluginManager()\n\n const oas = useOas()\n const { getName, getFile, getGroup } = useOperationManager()\n\n const controllers = operations.reduce(\n (acc, operation) => {\n if (options.group?.type === 'tag') {\n const group = getGroup(operation)\n const name = group?.tag ? options.group?.name?.({ group: camelCase(group.tag) }) : undefined\n\n if (!group?.tag || !name) {\n return acc\n }\n\n const file = pluginManager.getFile({\n name,\n extname: '.ts',\n pluginKey,\n options: { group },\n })\n\n const client = {\n name: getName(operation, { type: 'function' }),\n file: getFile(operation),\n }\n\n const previousFile = acc.find((item) => item.file.path === file.path)\n\n if (previousFile) {\n previousFile.clients.push(client)\n } else {\n acc.push({ name, file, clients: [client] })\n }\n }\n\n return acc\n },\n [] as Array<{ name: string; file: KubbFile.File; clients: Array<{ name: string; file: KubbFile.File }> }>,\n )\n\n return controllers.map(({ name, file, clients }) => {\n return (\n <File\n key={file.path}\n baseName={file.baseName}\n path={file.path}\n meta={file.meta}\n banner={getBanner({ oas, output: options.output, config: pluginManager.config })}\n footer={getFooter({ oas, output: options.output })}\n >\n {clients.map((client) => (\n <File.Import key={client.name} name={[client.name]} root={file.path} path={client.file.path} />\n ))}\n\n <File.Source name={name} isExportable isIndexable>\n <Function export name={name}>\n {`return { ${clients.map((client) => client.name).join(', ')} }`}\n </Function>\n </File.Source>\n </File>\n )\n })\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,8DAAqD;CAChE,MAAM;CACN,UAAU,EAAE,SAAS,aAAa;EAChC,MAAM,yDAAkC;EACxC,MAAM,EACJ,SAAS,EAAE,QAAQ,gDACQ;EAC7B,MAAM,2CAAc;EACpB,MAAM,EAAE,YAAY,SAAS,8DAAiC;EAE9D,MAAM,SAAS;GACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;GAC9C,MAAM,QAAQ,UAAU;GACzB;EAED,MAAM,MAAM;GACV,MAAM,QAAQ,WAAW;IAAE,MAAM;IAAY,QAAQ;I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,CAAC,OAAO,OAAO,CAAC,KAClB,QAAO;IAGT,MAAM,OAAO,cAAc,QAAQ;KACjC;KACA,SAAS;KACT;KACA,SAAS,EAAE,OAAO;KACnB,CAAC;IAEF,MAAM,SAAS;KACb,MAAM,QAAQ,WAAW,EAAE,MAAM,YAAY,CAAC;KAC9C,MAAM,QAAQ,UAAU;KACzB;IAED,MAAM,eAAe,IAAI,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK;AAErE,QAAI,aACF,cAAa,QAAQ,KAAK,OAAO;QAEjC,KAAI,KAAK;KAAE;KAAM;KAAM,SAAS,CAAC,OAAO;KAAE,CAAC;;AAI/C,UAAO;KAET,EAAE,CACH,CAEkB,KAAK,EAAE,MAAM,MAAM,cAAc;AAClD,UACE,0DAACC;IAEC,UAAU,KAAK;IACf,MAAM,KAAK;IACX,MAAM,KAAK;IACX,+CAAkB;KAAE;KAAK,QAAQ,QAAQ;KAAQ,QAAQ,cAAc;KAAQ,CAAC;IAChF,+CAAkB;KAAE;KAAK,QAAQ,QAAQ;KAAQ,CAAC;eAEjD,QAAQ,KAAK,WACZ,yDAACA,yBAAK;KAAyB,MAAM,CAAC,OAAO,KAAK;KAAE,MAAM,KAAK;KAAM,MAAM,OAAO,KAAK;OAArE,OAAO,KAAsE,CAC/F,EAEF,yDAACA,yBAAK;KAAa;KAAM;KAAa;eACpC,yDAACC;MAAS;MAAa;gBACpB,YAAY,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,KAAK,KAAK,CAAC;OACpD;MACC;MAfT,KAAK,KAgBL;IAET;;CAEL,CAAC"}
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ReactGenerator, n as PluginClient } from "./types-
|
|
1
|
+
import { i as ReactGenerator, n as PluginClient } from "./types-DuPfvza5.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/generators/clientGenerator.d.ts
|
|
4
4
|
declare const clientGenerator: ReactGenerator<PluginClient>;
|
package/dist/generators.d.ts
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-
|
|
1
|
+
import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-DuPfvza5.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const pluginClientName = "plugin-client";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-
|
|
1
|
+
import { a as UserPluginWithLifeCycle, n as PluginClient, t as Options } from "./types-DJmtgGu4.js";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin.d.ts
|
|
4
4
|
declare const pluginClientName = "plugin-client";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Fabric, FileManager } from "@kubb/react-fabric";
|
|
1
2
|
import * as OasTypes from "oas/types";
|
|
2
3
|
import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
|
|
3
4
|
import { Operation, Operation as Operation$1 } from "oas/operation";
|
|
4
5
|
import { OpenAPIV3 } from "openapi-types";
|
|
5
6
|
import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
|
|
6
7
|
import BaseOas from "oas";
|
|
7
|
-
import {
|
|
8
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
8
9
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
9
10
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
10
11
|
|
|
@@ -57,121 +58,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
|
57
58
|
abstract build(...params: unknown[]): unknown;
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
|
-
//#region ../core/src/fs/types.d.ts
|
|
61
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
62
|
-
type Import = {
|
|
63
|
-
/**
|
|
64
|
-
* Import name to be used
|
|
65
|
-
* @example ["useState"]
|
|
66
|
-
* @example "React"
|
|
67
|
-
*/
|
|
68
|
-
name: string | Array<string | {
|
|
69
|
-
propertyName: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Path for the import
|
|
74
|
-
* @example '@kubb/core'
|
|
75
|
-
*/
|
|
76
|
-
path: string;
|
|
77
|
-
/**
|
|
78
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
79
|
-
*/
|
|
80
|
-
isTypeOnly?: boolean;
|
|
81
|
-
isNameSpace?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
84
|
-
*/
|
|
85
|
-
root?: string;
|
|
86
|
-
};
|
|
87
|
-
type Source = {
|
|
88
|
-
name?: string;
|
|
89
|
-
value?: string;
|
|
90
|
-
isTypeOnly?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Has const or type 'export'
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
isExportable?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* When set, barrel generation will add this
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
isIndexable?: boolean;
|
|
101
|
-
};
|
|
102
|
-
type Export = {
|
|
103
|
-
/**
|
|
104
|
-
* Export name to be used.
|
|
105
|
-
* @example ["useState"]
|
|
106
|
-
* @example "React"
|
|
107
|
-
*/
|
|
108
|
-
name?: string | Array<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Path for the import.
|
|
111
|
-
* @example '@kubb/core'
|
|
112
|
-
*/
|
|
113
|
-
path: string;
|
|
114
|
-
/**
|
|
115
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
116
|
-
*/
|
|
117
|
-
isTypeOnly?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
120
|
-
*/
|
|
121
|
-
asAlias?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
124
|
-
type Mode = 'single' | 'split';
|
|
125
|
-
/**
|
|
126
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
127
|
-
* Based on UNIX basename
|
|
128
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
129
|
-
*/
|
|
130
|
-
type BaseName = `${string}.${string}`;
|
|
131
|
-
/**
|
|
132
|
-
* Path will be full qualified path to a specified file
|
|
133
|
-
*/
|
|
134
|
-
type Path = string;
|
|
135
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
136
|
-
type OptionalPath = Path | undefined | null;
|
|
137
|
-
type File<TMeta extends object = object> = {
|
|
138
|
-
/**
|
|
139
|
-
* Name to be used to create the path
|
|
140
|
-
* Based on UNIX basename, `${name}.extname`
|
|
141
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
142
|
-
*/
|
|
143
|
-
baseName: BaseName;
|
|
144
|
-
/**
|
|
145
|
-
* Path will be full qualified path to a specified file
|
|
146
|
-
*/
|
|
147
|
-
path: AdvancedPath<BaseName> | Path;
|
|
148
|
-
sources: Array<Source>;
|
|
149
|
-
imports?: Array<Import>;
|
|
150
|
-
exports?: Array<Export>;
|
|
151
|
-
/**
|
|
152
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
153
|
-
*/
|
|
154
|
-
meta?: TMeta;
|
|
155
|
-
banner?: string;
|
|
156
|
-
footer?: string;
|
|
157
|
-
};
|
|
158
|
-
type ResolvedImport = Import;
|
|
159
|
-
type ResolvedExport = Export;
|
|
160
|
-
type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
161
|
-
/**
|
|
162
|
-
* @default object-hash
|
|
163
|
-
*/
|
|
164
|
-
id: string;
|
|
165
|
-
/**
|
|
166
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
167
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
168
|
-
*/
|
|
169
|
-
name: string;
|
|
170
|
-
extname: Extname;
|
|
171
|
-
imports: Array<ResolvedImport>;
|
|
172
|
-
exports: Array<ResolvedExport>;
|
|
173
|
-
};
|
|
174
|
-
//#endregion
|
|
175
61
|
//#region ../core/src/utils/EventEmitter.d.ts
|
|
176
62
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
177
63
|
#private;
|
|
@@ -295,7 +181,7 @@ type Config<TInput = Input> = {
|
|
|
295
181
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
296
182
|
* @default { '.ts': '.ts'}
|
|
297
183
|
*/
|
|
298
|
-
extension?: Record<Extname, Extname | ''>;
|
|
184
|
+
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
299
185
|
/**
|
|
300
186
|
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
301
187
|
* @default 'named'
|
|
@@ -426,7 +312,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
|
|
|
426
312
|
* @type hookFirst
|
|
427
313
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
428
314
|
*/
|
|
429
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
315
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
|
|
430
316
|
/**
|
|
431
317
|
* Resolve to a name based on a string.
|
|
432
318
|
* Useful when converting to PascalCase or camelCase.
|
|
@@ -444,8 +330,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
|
444
330
|
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
331
|
type ResolvePathParams<TOptions = object> = {
|
|
446
332
|
pluginKey?: Plugin['key'];
|
|
447
|
-
baseName: BaseName;
|
|
448
|
-
mode?: Mode;
|
|
333
|
+
baseName: KubbFile.BaseName;
|
|
334
|
+
mode?: KubbFile.Mode;
|
|
449
335
|
/**
|
|
450
336
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
451
337
|
*/
|
|
@@ -470,8 +356,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
470
356
|
*/
|
|
471
357
|
fileManager: FileManager;
|
|
472
358
|
pluginManager: PluginManager;
|
|
473
|
-
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
474
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
359
|
+
addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
|
|
360
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
|
|
475
361
|
resolveName: (params: ResolveNameParams) => string;
|
|
476
362
|
logger: Logger;
|
|
477
363
|
/**
|
|
@@ -550,8 +436,8 @@ type Events = {
|
|
|
550
436
|
};
|
|
551
437
|
type GetFileProps<TOptions = object> = {
|
|
552
438
|
name: string;
|
|
553
|
-
mode?: Mode;
|
|
554
|
-
extname: Extname;
|
|
439
|
+
mode?: KubbFile.Mode;
|
|
440
|
+
extname: KubbFile.Extname;
|
|
555
441
|
pluginKey: Plugin['key'];
|
|
556
442
|
options?: TOptions;
|
|
557
443
|
};
|
|
@@ -570,10 +456,10 @@ declare class PluginManager {
|
|
|
570
456
|
extname,
|
|
571
457
|
pluginKey,
|
|
572
458
|
options
|
|
573
|
-
}: GetFileProps<TOptions>): File<{
|
|
459
|
+
}: GetFileProps<TOptions>): KubbFile.File<{
|
|
574
460
|
pluginKey: Plugin['key'];
|
|
575
461
|
}>;
|
|
576
|
-
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
|
|
462
|
+
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
577
463
|
resolveName: (params: ResolveNameParams) => string;
|
|
578
464
|
/**
|
|
579
465
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -711,9 +597,9 @@ type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions>
|
|
|
711
597
|
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
712
598
|
name: string;
|
|
713
599
|
type: 'core';
|
|
714
|
-
operations: (props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
715
|
-
operation: (props: OperationProps<TOptions>) => Promise<File[]>;
|
|
716
|
-
schema: (props: SchemaProps$1<TOptions>) => Promise<File[]>;
|
|
600
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
601
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
602
|
+
schema: (props: SchemaProps$1<TOptions>) => Promise<KubbFile.File[]>;
|
|
717
603
|
};
|
|
718
604
|
//#endregion
|
|
719
605
|
//#region ../plugin-oas/src/types.d.ts
|
|
@@ -737,7 +623,7 @@ type ResolvePathOptions = {
|
|
|
737
623
|
type Ref = {
|
|
738
624
|
propertyName: string;
|
|
739
625
|
originalName: string;
|
|
740
|
-
path: OptionalPath;
|
|
626
|
+
path: KubbFile.OptionalPath;
|
|
741
627
|
pluginKey?: Plugin['key'];
|
|
742
628
|
};
|
|
743
629
|
type Refs = Record<string, Ref>;
|
|
@@ -817,7 +703,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
817
703
|
* Current plugin
|
|
818
704
|
*/
|
|
819
705
|
plugin: Plugin<TPluginOptions>;
|
|
820
|
-
mode: Mode;
|
|
706
|
+
mode: KubbFile.Mode;
|
|
821
707
|
};
|
|
822
708
|
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
823
709
|
#private;
|
|
@@ -831,7 +717,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
831
717
|
method: HttpMethod;
|
|
832
718
|
operation: Operation$1;
|
|
833
719
|
}>>;
|
|
834
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
720
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
835
721
|
}
|
|
836
722
|
//#endregion
|
|
837
723
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
@@ -947,7 +833,7 @@ type SchemaKeywordMapper = {
|
|
|
947
833
|
/**
|
|
948
834
|
* Full qualified path.
|
|
949
835
|
*/
|
|
950
|
-
path: OptionalPath;
|
|
836
|
+
path: KubbFile.OptionalPath;
|
|
951
837
|
/**
|
|
952
838
|
* When true `File.Import` will be used.
|
|
953
839
|
* When false a reference will be used inside the current file.
|
|
@@ -1060,7 +946,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
1060
946
|
* Current plugin
|
|
1061
947
|
*/
|
|
1062
948
|
plugin: Plugin<TPluginOptions>;
|
|
1063
|
-
mode: Mode;
|
|
949
|
+
mode: KubbFile.Mode;
|
|
1064
950
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
1065
951
|
override: Array<Override<TOptions>> | undefined;
|
|
1066
952
|
contentType?: contentType;
|
|
@@ -1108,7 +994,7 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1108
994
|
static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1109
995
|
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1110
996
|
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
1111
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
997
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1112
998
|
}
|
|
1113
999
|
//#endregion
|
|
1114
1000
|
//#region src/types.d.ts
|
|
@@ -1227,4 +1113,4 @@ type ResolvedOptions = {
|
|
|
1227
1113
|
type PluginClient = PluginFactoryOptions<'plugin-client', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1228
1114
|
//#endregion
|
|
1229
1115
|
export { UserPluginWithLifeCycle as a, ReactGenerator as i, PluginClient as n, Operation$1 as o, OperationSchemas as r, Options$1 as t };
|
|
1230
|
-
//# sourceMappingURL=types-
|
|
1116
|
+
//# sourceMappingURL=types-DJmtgGu4.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Fabric, FileManager } from "@kubb/react-fabric";
|
|
2
1
|
import * as OasTypes from "oas/types";
|
|
3
2
|
import { HttpMethods as HttpMethod, OASDocument, SchemaObject, User } from "oas/types";
|
|
4
3
|
import { Operation, Operation as Operation$1 } from "oas/operation";
|
|
5
4
|
import { OpenAPIV3 } from "openapi-types";
|
|
6
5
|
import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
|
|
7
6
|
import BaseOas from "oas";
|
|
7
|
+
import { KubbFile } from "@kubb/fabric-core/types";
|
|
8
|
+
import { Fabric, FileManager } from "@kubb/react-fabric";
|
|
8
9
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
9
10
|
import { KubbNode } from "@kubb/react-fabric/types";
|
|
10
11
|
|
|
@@ -57,121 +58,6 @@ declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
|
57
58
|
abstract build(...params: unknown[]): unknown;
|
|
58
59
|
}
|
|
59
60
|
//#endregion
|
|
60
|
-
//#region ../core/src/fs/types.d.ts
|
|
61
|
-
type BasePath<T extends string = string> = `${T}/`;
|
|
62
|
-
type Import = {
|
|
63
|
-
/**
|
|
64
|
-
* Import name to be used
|
|
65
|
-
* @example ["useState"]
|
|
66
|
-
* @example "React"
|
|
67
|
-
*/
|
|
68
|
-
name: string | Array<string | {
|
|
69
|
-
propertyName: string;
|
|
70
|
-
name?: string;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* Path for the import
|
|
74
|
-
* @example '@kubb/core'
|
|
75
|
-
*/
|
|
76
|
-
path: string;
|
|
77
|
-
/**
|
|
78
|
-
* Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.
|
|
79
|
-
*/
|
|
80
|
-
isTypeOnly?: boolean;
|
|
81
|
-
isNameSpace?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
84
|
-
*/
|
|
85
|
-
root?: string;
|
|
86
|
-
};
|
|
87
|
-
type Source = {
|
|
88
|
-
name?: string;
|
|
89
|
-
value?: string;
|
|
90
|
-
isTypeOnly?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Has const or type 'export'
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
isExportable?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* When set, barrel generation will add this
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
isIndexable?: boolean;
|
|
101
|
-
};
|
|
102
|
-
type Export = {
|
|
103
|
-
/**
|
|
104
|
-
* Export name to be used.
|
|
105
|
-
* @example ["useState"]
|
|
106
|
-
* @example "React"
|
|
107
|
-
*/
|
|
108
|
-
name?: string | Array<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Path for the import.
|
|
111
|
-
* @example '@kubb/core'
|
|
112
|
-
*/
|
|
113
|
-
path: string;
|
|
114
|
-
/**
|
|
115
|
-
* Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.
|
|
116
|
-
*/
|
|
117
|
-
isTypeOnly?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Make it possible to override the name, this will result in: `export * as aliasName from './path'`.
|
|
120
|
-
*/
|
|
121
|
-
asAlias?: boolean;
|
|
122
|
-
};
|
|
123
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
124
|
-
type Mode = 'single' | 'split';
|
|
125
|
-
/**
|
|
126
|
-
* Name to be used to dynamicly create the baseName(based on input.path)
|
|
127
|
-
* Based on UNIX basename
|
|
128
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
129
|
-
*/
|
|
130
|
-
type BaseName = `${string}.${string}`;
|
|
131
|
-
/**
|
|
132
|
-
* Path will be full qualified path to a specified file
|
|
133
|
-
*/
|
|
134
|
-
type Path = string;
|
|
135
|
-
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
136
|
-
type OptionalPath = Path | undefined | null;
|
|
137
|
-
type File$1<TMeta extends object = object> = {
|
|
138
|
-
/**
|
|
139
|
-
* Name to be used to create the path
|
|
140
|
-
* Based on UNIX basename, `${name}.extname`
|
|
141
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
142
|
-
*/
|
|
143
|
-
baseName: BaseName;
|
|
144
|
-
/**
|
|
145
|
-
* Path will be full qualified path to a specified file
|
|
146
|
-
*/
|
|
147
|
-
path: AdvancedPath<BaseName> | Path;
|
|
148
|
-
sources: Array<Source>;
|
|
149
|
-
imports?: Array<Import>;
|
|
150
|
-
exports?: Array<Export>;
|
|
151
|
-
/**
|
|
152
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
153
|
-
*/
|
|
154
|
-
meta?: TMeta;
|
|
155
|
-
banner?: string;
|
|
156
|
-
footer?: string;
|
|
157
|
-
};
|
|
158
|
-
type ResolvedImport = Import;
|
|
159
|
-
type ResolvedExport = Export;
|
|
160
|
-
type ResolvedFile<TMeta extends object = object> = File$1<TMeta> & {
|
|
161
|
-
/**
|
|
162
|
-
* @default object-hash
|
|
163
|
-
*/
|
|
164
|
-
id: string;
|
|
165
|
-
/**
|
|
166
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
167
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
168
|
-
*/
|
|
169
|
-
name: string;
|
|
170
|
-
extname: Extname;
|
|
171
|
-
imports: Array<ResolvedImport>;
|
|
172
|
-
exports: Array<ResolvedExport>;
|
|
173
|
-
};
|
|
174
|
-
//#endregion
|
|
175
61
|
//#region ../core/src/utils/EventEmitter.d.ts
|
|
176
62
|
declare class EventEmitter<TEvents extends Record<string, any>> {
|
|
177
63
|
#private;
|
|
@@ -295,7 +181,7 @@ type Config<TInput = Input> = {
|
|
|
295
181
|
* Override the extension to the generated imports and exports, by default each plugin will add an extension
|
|
296
182
|
* @default { '.ts': '.ts'}
|
|
297
183
|
*/
|
|
298
|
-
extension?: Record<Extname, Extname | ''>;
|
|
184
|
+
extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>;
|
|
299
185
|
/**
|
|
300
186
|
* Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.
|
|
301
187
|
* @default 'named'
|
|
@@ -426,7 +312,7 @@ type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOption
|
|
|
426
312
|
* @type hookFirst
|
|
427
313
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
428
314
|
*/
|
|
429
|
-
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
315
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.OptionalPath;
|
|
430
316
|
/**
|
|
431
317
|
* Resolve to a name based on a string.
|
|
432
318
|
* Useful when converting to PascalCase or camelCase.
|
|
@@ -444,8 +330,8 @@ type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
|
444
330
|
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
331
|
type ResolvePathParams<TOptions = object> = {
|
|
446
332
|
pluginKey?: Plugin['key'];
|
|
447
|
-
baseName: BaseName;
|
|
448
|
-
mode?: Mode;
|
|
333
|
+
baseName: KubbFile.BaseName;
|
|
334
|
+
mode?: KubbFile.Mode;
|
|
449
335
|
/**
|
|
450
336
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
451
337
|
*/
|
|
@@ -470,8 +356,8 @@ type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
470
356
|
*/
|
|
471
357
|
fileManager: FileManager;
|
|
472
358
|
pluginManager: PluginManager;
|
|
473
|
-
addFile: (...file: Array<File
|
|
474
|
-
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
359
|
+
addFile: (...file: Array<KubbFile.File>) => Promise<Array<KubbFile.ResolvedFile>>;
|
|
360
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => KubbFile.OptionalPath;
|
|
475
361
|
resolveName: (params: ResolveNameParams) => string;
|
|
476
362
|
logger: Logger;
|
|
477
363
|
/**
|
|
@@ -550,8 +436,8 @@ type Events = {
|
|
|
550
436
|
};
|
|
551
437
|
type GetFileProps<TOptions = object> = {
|
|
552
438
|
name: string;
|
|
553
|
-
mode?: Mode;
|
|
554
|
-
extname: Extname;
|
|
439
|
+
mode?: KubbFile.Mode;
|
|
440
|
+
extname: KubbFile.Extname;
|
|
555
441
|
pluginKey: Plugin['key'];
|
|
556
442
|
options?: TOptions;
|
|
557
443
|
};
|
|
@@ -570,10 +456,10 @@ declare class PluginManager {
|
|
|
570
456
|
extname,
|
|
571
457
|
pluginKey,
|
|
572
458
|
options
|
|
573
|
-
}: GetFileProps<TOptions>): File
|
|
459
|
+
}: GetFileProps<TOptions>): KubbFile.File<{
|
|
574
460
|
pluginKey: Plugin['key'];
|
|
575
461
|
}>;
|
|
576
|
-
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => OptionalPath;
|
|
462
|
+
resolvePath: <TOptions = object>(params: ResolvePathParams<TOptions>) => KubbFile.OptionalPath;
|
|
577
463
|
resolveName: (params: ResolveNameParams) => string;
|
|
578
464
|
/**
|
|
579
465
|
* Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
|
|
@@ -711,9 +597,9 @@ type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions>
|
|
|
711
597
|
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
712
598
|
name: string;
|
|
713
599
|
type: 'core';
|
|
714
|
-
operations: (props: OperationsProps<TOptions>) => Promise<File
|
|
715
|
-
operation: (props: OperationProps<TOptions>) => Promise<File
|
|
716
|
-
schema: (props: SchemaProps$1<TOptions>) => Promise<File
|
|
600
|
+
operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
601
|
+
operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>;
|
|
602
|
+
schema: (props: SchemaProps$1<TOptions>) => Promise<KubbFile.File[]>;
|
|
717
603
|
};
|
|
718
604
|
//#endregion
|
|
719
605
|
//#region ../plugin-oas/src/types.d.ts
|
|
@@ -737,7 +623,7 @@ type ResolvePathOptions = {
|
|
|
737
623
|
type Ref = {
|
|
738
624
|
propertyName: string;
|
|
739
625
|
originalName: string;
|
|
740
|
-
path: OptionalPath;
|
|
626
|
+
path: KubbFile.OptionalPath;
|
|
741
627
|
pluginKey?: Plugin['key'];
|
|
742
628
|
};
|
|
743
629
|
type Refs = Record<string, Ref>;
|
|
@@ -817,7 +703,7 @@ type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
817
703
|
* Current plugin
|
|
818
704
|
*/
|
|
819
705
|
plugin: Plugin<TPluginOptions>;
|
|
820
|
-
mode: Mode;
|
|
706
|
+
mode: KubbFile.Mode;
|
|
821
707
|
};
|
|
822
708
|
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
823
709
|
#private;
|
|
@@ -831,7 +717,7 @@ declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = P
|
|
|
831
717
|
method: HttpMethod;
|
|
832
718
|
operation: Operation$1;
|
|
833
719
|
}>>;
|
|
834
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File
|
|
720
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
835
721
|
}
|
|
836
722
|
//#endregion
|
|
837
723
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
@@ -947,7 +833,7 @@ type SchemaKeywordMapper = {
|
|
|
947
833
|
/**
|
|
948
834
|
* Full qualified path.
|
|
949
835
|
*/
|
|
950
|
-
path: OptionalPath;
|
|
836
|
+
path: KubbFile.OptionalPath;
|
|
951
837
|
/**
|
|
952
838
|
* When true `File.Import` will be used.
|
|
953
839
|
* When false a reference will be used inside the current file.
|
|
@@ -1060,7 +946,7 @@ type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
1060
946
|
* Current plugin
|
|
1061
947
|
*/
|
|
1062
948
|
plugin: Plugin<TPluginOptions>;
|
|
1063
|
-
mode: Mode;
|
|
949
|
+
mode: KubbFile.Mode;
|
|
1064
950
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
1065
951
|
override: Array<Override<TOptions>> | undefined;
|
|
1066
952
|
contentType?: contentType;
|
|
@@ -1108,7 +994,7 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
1108
994
|
static findInObject<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1109
995
|
static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1110
996
|
static combineObjects(tree: Schema[] | undefined): Schema[];
|
|
1111
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File
|
|
997
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<KubbFile.File<TFileMeta>>>;
|
|
1112
998
|
}
|
|
1113
999
|
//#endregion
|
|
1114
1000
|
//#region src/types.d.ts
|
|
@@ -1227,4 +1113,4 @@ type ResolvedOptions = {
|
|
|
1227
1113
|
type PluginClient = PluginFactoryOptions<'plugin-client', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1228
1114
|
//#endregion
|
|
1229
1115
|
export { UserPluginWithLifeCycle as a, ReactGenerator as i, PluginClient as n, Operation$1 as o, OperationSchemas as r, Options$1 as t };
|
|
1230
|
-
//# sourceMappingURL=types-
|
|
1116
|
+
//# sourceMappingURL=types-DuPfvza5.d.cts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -76,21 +76,26 @@
|
|
|
76
76
|
"!/**/**.test.**",
|
|
77
77
|
"!/**/__tests__/**"
|
|
78
78
|
],
|
|
79
|
+
"size-limit": [
|
|
80
|
+
{
|
|
81
|
+
"path": "./dist/*.js",
|
|
82
|
+
"limit": "510 KiB",
|
|
83
|
+
"gzip": true
|
|
84
|
+
}
|
|
85
|
+
],
|
|
79
86
|
"dependencies": {
|
|
80
|
-
"@kubb/react-fabric": "0.2.
|
|
81
|
-
"@kubb/core": "4.4.
|
|
82
|
-
"@kubb/oas": "4.4.
|
|
83
|
-
"@kubb/plugin-oas": "4.4.
|
|
84
|
-
"@kubb/plugin-ts": "4.4.
|
|
85
|
-
"@kubb/plugin-zod": "4.4.
|
|
87
|
+
"@kubb/react-fabric": "0.2.10",
|
|
88
|
+
"@kubb/core": "4.4.1",
|
|
89
|
+
"@kubb/oas": "4.4.1",
|
|
90
|
+
"@kubb/plugin-oas": "4.4.1",
|
|
91
|
+
"@kubb/plugin-ts": "4.4.1",
|
|
92
|
+
"@kubb/plugin-zod": "4.4.1"
|
|
86
93
|
},
|
|
87
94
|
"devDependencies": {
|
|
88
|
-
"axios": "^1.13.0"
|
|
89
|
-
"tsdown": "^0.15.11",
|
|
90
|
-
"typescript": "^5.9.3"
|
|
95
|
+
"axios": "^1.13.0"
|
|
91
96
|
},
|
|
92
97
|
"peerDependencies": {
|
|
93
|
-
"@kubb/react-fabric": "0.2.
|
|
98
|
+
"@kubb/react-fabric": "0.2.10",
|
|
94
99
|
"axios": "^1.7.2"
|
|
95
100
|
},
|
|
96
101
|
"peerDependenciesMeta": {
|
|
@@ -106,7 +111,7 @@
|
|
|
106
111
|
"registry": "https://registry.npmjs.org/"
|
|
107
112
|
},
|
|
108
113
|
"scripts": {
|
|
109
|
-
"build": "tsdown",
|
|
114
|
+
"build": "tsdown && size-limit",
|
|
110
115
|
"clean": "npx rimraf ./dist",
|
|
111
116
|
"lint": "bun biome lint .",
|
|
112
117
|
"lint:fix": "bun biome lint --fix --unsafe .",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { KubbFile } from '@kubb/core/fs'
|
|
2
1
|
import { usePlugin, usePluginManager } from '@kubb/core/hooks'
|
|
3
2
|
import { camelCase } from '@kubb/core/transformers'
|
|
3
|
+
import type { KubbFile } from '@kubb/fabric-core/types'
|
|
4
4
|
import { createReactGenerator } from '@kubb/plugin-oas'
|
|
5
5
|
import { useOas, useOperationManager } from '@kubb/plugin-oas/hooks'
|
|
6
6
|
import { getBanner, getFooter } from '@kubb/plugin-oas/utils'
|