@kubb/plugin-oas 4.19.2 → 4.20.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/{createGenerator-cYz-kExA.d.cts → createGenerator-1nstUihJ.d.cts} +8 -8
- package/dist/{createGenerator-3zJdjpOn.d.ts → createGenerator-b8YXprrE.d.ts} +8 -8
- package/dist/generators-DoPBikIW.js.map +1 -1
- package/dist/generators-OR75jnZv.cjs.map +1 -1
- package/dist/generators.d.cts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/hooks.d.cts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/utils.cjs +3 -2
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +4 -2
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/src/generators/createReactGenerator.ts +7 -7
- package/src/utils/getComments.ts +5 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as __name, C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
2
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
|
-
import {
|
|
4
|
+
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
5
5
|
|
|
6
6
|
//#region ../core/src/utils/FunctionParams.d.ts
|
|
7
7
|
type FunctionParamsASTWithoutType = {
|
|
@@ -325,16 +325,16 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
325
325
|
//#region src/generators/createReactGenerator.d.ts
|
|
326
326
|
type UserGenerator$1<TOptions extends PluginFactoryOptions> = {
|
|
327
327
|
name: string;
|
|
328
|
-
Operations?: (props: OperationsProps<TOptions>) =>
|
|
329
|
-
Operation?: (props: OperationProps<TOptions>) =>
|
|
330
|
-
Schema?: (props: SchemaProps<TOptions>) =>
|
|
328
|
+
Operations?: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
329
|
+
Operation?: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
330
|
+
Schema?: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
331
331
|
};
|
|
332
332
|
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
333
333
|
name: string;
|
|
334
334
|
type: 'react';
|
|
335
|
-
Operations: (props: OperationsProps<TOptions>) =>
|
|
336
|
-
Operation: (props: OperationProps<TOptions>) =>
|
|
337
|
-
Schema: (props: SchemaProps<TOptions>) =>
|
|
335
|
+
Operations: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
336
|
+
Operation: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
337
|
+
Schema: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
338
338
|
};
|
|
339
339
|
/****
|
|
340
340
|
* Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.
|
|
@@ -387,4 +387,4 @@ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
|
387
387
|
declare function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions>;
|
|
388
388
|
//#endregion
|
|
389
389
|
export { Resolver as C, ResolvePathOptions as S, Options as _, createReactGenerator as a, Ref as b, SchemaGeneratorBuildOptions as c, OperationGenerator as d, OperationMethodResult as f, OperationSchemas as g, OperationSchema as h, ReactGenerator as i, SchemaGeneratorOptions as l, Include as m, createGenerator as n, GetSchemaGeneratorOptions as o, Exclude as p, Generator as r, SchemaGenerator as s, CoreGenerator as t, SchemaMethodResult as u, Override as v, FunctionParamsAST as w, Refs as x, PluginOas as y };
|
|
390
|
-
//# sourceMappingURL=createGenerator-
|
|
390
|
+
//# sourceMappingURL=createGenerator-1nstUihJ.d.cts.map
|
|
@@ -2,7 +2,7 @@ import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
|
2
2
|
import { C as Plugin, D as AsyncEventEmitter, O as KubbEvents, S as Output, T as ResolveNameParams, _ as contentType, b as Config, d as HttpMethod, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, k as BaseGenerator, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions, x as Group, y as PluginManager } from "./SchemaMapper-DI2vHHE0.js";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
4
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
5
|
-
import {
|
|
5
|
+
import { FabricReactNode } from "@kubb/react-fabric/types";
|
|
6
6
|
|
|
7
7
|
//#region ../core/src/utils/FunctionParams.d.ts
|
|
8
8
|
type FunctionParamsASTWithoutType = {
|
|
@@ -326,16 +326,16 @@ declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGe
|
|
|
326
326
|
//#region src/generators/createReactGenerator.d.ts
|
|
327
327
|
type UserGenerator$1<TOptions extends PluginFactoryOptions> = {
|
|
328
328
|
name: string;
|
|
329
|
-
Operations?: (props: OperationsProps<TOptions>) =>
|
|
330
|
-
Operation?: (props: OperationProps<TOptions>) =>
|
|
331
|
-
Schema?: (props: SchemaProps<TOptions>) =>
|
|
329
|
+
Operations?: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
330
|
+
Operation?: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
331
|
+
Schema?: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
332
332
|
};
|
|
333
333
|
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
334
334
|
name: string;
|
|
335
335
|
type: 'react';
|
|
336
|
-
Operations: (props: OperationsProps<TOptions>) =>
|
|
337
|
-
Operation: (props: OperationProps<TOptions>) =>
|
|
338
|
-
Schema: (props: SchemaProps<TOptions>) =>
|
|
336
|
+
Operations: (props: OperationsProps<TOptions>) => FabricReactNode;
|
|
337
|
+
Operation: (props: OperationProps<TOptions>) => FabricReactNode;
|
|
338
|
+
Schema: (props: SchemaProps<TOptions>) => FabricReactNode;
|
|
339
339
|
};
|
|
340
340
|
/****
|
|
341
341
|
* Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.
|
|
@@ -388,4 +388,4 @@ type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
|
388
388
|
declare function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions>;
|
|
389
389
|
//#endregion
|
|
390
390
|
export { Resolver as C, ResolvePathOptions as S, Options as _, createReactGenerator as a, Ref as b, SchemaGeneratorBuildOptions as c, OperationGenerator as d, OperationMethodResult as f, OperationSchemas as g, OperationSchema as h, ReactGenerator as i, SchemaGeneratorOptions as l, Include as m, createGenerator as n, GetSchemaGeneratorOptions as o, Exclude as p, Generator as r, SchemaGenerator as s, CoreGenerator as t, SchemaMethodResult as u, Override as v, FunctionParamsAST as w, Refs as x, PluginOas as y };
|
|
391
|
-
//# sourceMappingURL=createGenerator-
|
|
391
|
+
//# sourceMappingURL=createGenerator-b8YXprrE.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-DoPBikIW.js","names":[],"sources":["../src/generators/createGenerator.ts","../src/generators/createReactGenerator.ts","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type CoreGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'core'\n operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions> {\n return {\n type: 'core',\n async operations() {\n return []\n },\n async operation() {\n return []\n },\n async schema() {\n return []\n },\n ...generator,\n }\n}\n","import type { PluginFactoryOptions } from '@kubb/core'\nimport type {
|
|
1
|
+
{"version":3,"file":"generators-DoPBikIW.js","names":[],"sources":["../src/generators/createGenerator.ts","../src/generators/createReactGenerator.ts","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type CoreGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'core'\n operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions> {\n return {\n type: 'core',\n async operations() {\n return []\n },\n async operation() {\n return []\n },\n async schema() {\n return []\n },\n ...generator,\n }\n}\n","import type { PluginFactoryOptions } from '@kubb/core'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n Operations?: (props: OperationsProps<TOptions>) => FabricReactNode\n Operation?: (props: OperationProps<TOptions>) => FabricReactNode\n Schema?: (props: SchemaProps<TOptions>) => FabricReactNode\n}\n\nexport type ReactGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'react'\n Operations: (props: OperationsProps<TOptions>) => FabricReactNode\n Operation: (props: OperationProps<TOptions>) => FabricReactNode\n Schema: (props: SchemaProps<TOptions>) => FabricReactNode\n}\n\n/****\n * Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.\n *\n * The returned generator exposes async methods for generating files from operations, a single operation, or a schema, using the corresponding React components if provided. If a component is not defined, the method returns an empty array.\n *\n * @returns A generator object with async methods for operations, operation, and schema file generation.\n */\nexport function createReactGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): ReactGenerator<TOptions> {\n return {\n type: 'react',\n Operations() {\n return null\n },\n Operation() {\n return null\n },\n Schema() {\n return null\n },\n ...generator,\n }\n}\n","import { camelCase } from '@kubb/core/transformers'\nimport type { PluginOas } from '../types.ts'\nimport { getBanner } from '../utils/getBanner.ts'\nimport { getFooter } from '../utils/getFooter.ts'\nimport { createGenerator } from './createGenerator.ts'\n\nexport const jsonGenerator = createGenerator<PluginOas>({\n name: 'plugin-oas',\n async schema({ schema, generator }) {\n const { pluginManager, plugin } = generator.context\n const file = pluginManager.getFile({\n name: camelCase(schema.name),\n extname: '.json',\n mode: 'split',\n pluginKey: plugin.key,\n })\n\n return [\n {\n ...file,\n sources: [\n {\n name: camelCase(schema.name),\n isExportable: false,\n isIndexable: false,\n value: JSON.stringify(schema.value),\n },\n ],\n banner: getBanner({\n oas: generator.context.oas,\n output: plugin.options.output,\n config: pluginManager.config,\n }),\n format: getFooter({ oas: generator.context.oas, output: plugin.options.output }),\n },\n ]\n },\n})\n"],"mappings":";;;;;AAmBA,SAAgB,gBAAuD,WAA6D;AAClI,QAAO;EACL,MAAM;EACN,MAAM,aAAa;AACjB,UAAO,EAAE;;EAEX,MAAM,YAAY;AAChB,UAAO,EAAE;;EAEX,MAAM,SAAS;AACb,UAAO,EAAE;;EAEX,GAAG;EACJ;;;;;;;;;;;;ACNH,SAAgB,qBAA4D,WAA8D;AACxI,QAAO;EACL,MAAM;EACN,aAAa;AACX,UAAO;;EAET,YAAY;AACV,UAAO;;EAET,SAAS;AACP,UAAO;;EAET,GAAG;EACJ;;;;;ACjCH,MAAa,gBAAgB,gBAA2B;CACtD,MAAM;CACN,MAAM,OAAO,EAAE,QAAQ,aAAa;EAClC,MAAM,EAAE,eAAe,WAAW,UAAU;AAQ5C,SAAO,CACL;GACE,GATS,cAAc,QAAQ;IACjC,MAAM,UAAU,OAAO,KAAK;IAC5B,SAAS;IACT,MAAM;IACN,WAAW,OAAO;IACnB,CAAC;GAKE,SAAS,CACP;IACE,MAAM,UAAU,OAAO,KAAK;IAC5B,cAAc;IACd,aAAa;IACb,OAAO,KAAK,UAAU,OAAO,MAAM;IACpC,CACF;GACD,QAAQ,UAAU;IAChB,KAAK,UAAU,QAAQ;IACvB,QAAQ,OAAO,QAAQ;IACvB,QAAQ,cAAc;IACvB,CAAC;GACF,QAAQ,UAAU;IAAE,KAAK,UAAU,QAAQ;IAAK,QAAQ,OAAO,QAAQ;IAAQ,CAAC;GACjF,CACF;;CAEJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators-OR75jnZv.cjs","names":["getBanner","getFooter"],"sources":["../src/generators/createGenerator.ts","../src/generators/createReactGenerator.ts","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type CoreGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'core'\n operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions> {\n return {\n type: 'core',\n async operations() {\n return []\n },\n async operation() {\n return []\n },\n async schema() {\n return []\n },\n ...generator,\n }\n}\n","import type { PluginFactoryOptions } from '@kubb/core'\nimport type {
|
|
1
|
+
{"version":3,"file":"generators-OR75jnZv.cjs","names":["getBanner","getFooter"],"sources":["../src/generators/createGenerator.ts","../src/generators/createReactGenerator.ts","../src/generators/jsonGenerator.ts"],"sourcesContent":["import type { PluginFactoryOptions } from '@kubb/core'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n operations?: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation?: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema?: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport type CoreGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'core'\n operations: (props: OperationsProps<TOptions>) => Promise<KubbFile.File[]>\n operation: (props: OperationProps<TOptions>) => Promise<KubbFile.File[]>\n schema: (props: SchemaProps<TOptions>) => Promise<KubbFile.File[]>\n}\n\nexport function createGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): CoreGenerator<TOptions> {\n return {\n type: 'core',\n async operations() {\n return []\n },\n async operation() {\n return []\n },\n async schema() {\n return []\n },\n ...generator,\n }\n}\n","import type { PluginFactoryOptions } from '@kubb/core'\nimport type { FabricReactNode } from '@kubb/react-fabric/types'\nimport type { OperationProps, OperationsProps, SchemaProps } from './types.ts'\n\ntype UserGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n Operations?: (props: OperationsProps<TOptions>) => FabricReactNode\n Operation?: (props: OperationProps<TOptions>) => FabricReactNode\n Schema?: (props: SchemaProps<TOptions>) => FabricReactNode\n}\n\nexport type ReactGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'react'\n Operations: (props: OperationsProps<TOptions>) => FabricReactNode\n Operation: (props: OperationProps<TOptions>) => FabricReactNode\n Schema: (props: SchemaProps<TOptions>) => FabricReactNode\n}\n\n/****\n * Creates a generator that uses React component functions to generate files for OpenAPI operations and schemas.\n *\n * The returned generator exposes async methods for generating files from operations, a single operation, or a schema, using the corresponding React components if provided. If a component is not defined, the method returns an empty array.\n *\n * @returns A generator object with async methods for operations, operation, and schema file generation.\n */\nexport function createReactGenerator<TOptions extends PluginFactoryOptions>(generator: UserGenerator<TOptions>): ReactGenerator<TOptions> {\n return {\n type: 'react',\n Operations() {\n return null\n },\n Operation() {\n return null\n },\n Schema() {\n return null\n },\n ...generator,\n }\n}\n","import { camelCase } from '@kubb/core/transformers'\nimport type { PluginOas } from '../types.ts'\nimport { getBanner } from '../utils/getBanner.ts'\nimport { getFooter } from '../utils/getFooter.ts'\nimport { createGenerator } from './createGenerator.ts'\n\nexport const jsonGenerator = createGenerator<PluginOas>({\n name: 'plugin-oas',\n async schema({ schema, generator }) {\n const { pluginManager, plugin } = generator.context\n const file = pluginManager.getFile({\n name: camelCase(schema.name),\n extname: '.json',\n mode: 'split',\n pluginKey: plugin.key,\n })\n\n return [\n {\n ...file,\n sources: [\n {\n name: camelCase(schema.name),\n isExportable: false,\n isIndexable: false,\n value: JSON.stringify(schema.value),\n },\n ],\n banner: getBanner({\n oas: generator.context.oas,\n output: plugin.options.output,\n config: pluginManager.config,\n }),\n format: getFooter({ oas: generator.context.oas, output: plugin.options.output }),\n },\n ]\n },\n})\n"],"mappings":";;;;;AAmBA,SAAgB,gBAAuD,WAA6D;AAClI,QAAO;EACL,MAAM;EACN,MAAM,aAAa;AACjB,UAAO,EAAE;;EAEX,MAAM,YAAY;AAChB,UAAO,EAAE;;EAEX,MAAM,SAAS;AACb,UAAO,EAAE;;EAEX,GAAG;EACJ;;;;;;;;;;;;ACNH,SAAgB,qBAA4D,WAA8D;AACxI,QAAO;EACL,MAAM;EACN,aAAa;AACX,UAAO;;EAET,YAAY;AACV,UAAO;;EAET,SAAS;AACP,UAAO;;EAET,GAAG;EACJ;;;;;ACjCH,MAAa,gBAAgB,gBAA2B;CACtD,MAAM;CACN,MAAM,OAAO,EAAE,QAAQ,aAAa;EAClC,MAAM,EAAE,eAAe,WAAW,UAAU;AAQ5C,SAAO,CACL;GACE,GATS,cAAc,QAAQ;IACjC,6CAAgB,OAAO,KAAK;IAC5B,SAAS;IACT,MAAM;IACN,WAAW,OAAO;IACnB,CAAC;GAKE,SAAS,CACP;IACE,6CAAgB,OAAO,KAAK;IAC5B,cAAc;IACd,aAAa;IACb,OAAO,KAAK,UAAU,OAAO,MAAM;IACpC,CACF;GACD,QAAQA,4BAAU;IAChB,KAAK,UAAU,QAAQ;IACvB,QAAQ,OAAO,QAAQ;IACvB,QAAQ,cAAc;IACvB,CAAC;GACF,QAAQC,4BAAU;IAAE,KAAK,UAAU,QAAQ;IAAK,QAAQ,OAAO,QAAQ;IAAQ,CAAC;GACjF,CACF;;CAEJ,CAAC"}
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as __name } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
|
-
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-
|
|
2
|
+
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-1nstUihJ.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/jsonGenerator.d.ts
|
|
5
5
|
declare const jsonGenerator: CoreGenerator<PluginOas>;
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
2
|
import "./SchemaMapper-DI2vHHE0.js";
|
|
3
|
-
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-
|
|
3
|
+
import { a as createReactGenerator, n as createGenerator, r as Generator, t as CoreGenerator, y as PluginOas } from "./createGenerator-b8YXprrE.js";
|
|
4
4
|
|
|
5
5
|
//#region src/generators/jsonGenerator.d.ts
|
|
6
6
|
declare const jsonGenerator: CoreGenerator<PluginOas>;
|
package/dist/hooks.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as __name, C as Plugin, T as ResolveNameParams, h as Operation, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
|
-
import { d as OperationGenerator, g as OperationSchemas } from "./createGenerator-
|
|
2
|
+
import { d as OperationGenerator, g as OperationSchemas } from "./createGenerator-1nstUihJ.cjs";
|
|
3
3
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
4
4
|
|
|
5
5
|
//#region src/hooks/useOas.d.ts
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
2
|
import { C as Plugin, T as ResolveNameParams, h as Operation, t as Schema, u as Oas, v as FileMetaBase, w as PluginFactoryOptions } from "./SchemaMapper-DI2vHHE0.js";
|
|
3
|
-
import { d as OperationGenerator, g as OperationSchemas } from "./createGenerator-
|
|
3
|
+
import { d as OperationGenerator, g as OperationSchemas } from "./createGenerator-b8YXprrE.js";
|
|
4
4
|
import { KubbFile } from "@kubb/fabric-core/types";
|
|
5
5
|
|
|
6
6
|
//#region src/hooks/useOas.d.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as __name, C as Plugin, E as UserPluginWithLifeCycle, a as SchemaMapper, b as Config, c as schemaKeywords, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema, w as PluginFactoryOptions } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
|
-
import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-
|
|
2
|
+
import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-1nstUihJ.cjs";
|
|
3
3
|
import { Fabric } from "@kubb/react-fabric";
|
|
4
4
|
|
|
5
5
|
//#region src/createParser.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
2
|
import { C as Plugin, E as UserPluginWithLifeCycle, a as SchemaMapper, b as Config, c as schemaKeywords, g as SchemaObject, h as Operation, i as SchemaKeywordMapper, n as SchemaKeyword, o as SchemaTree, r as SchemaKeywordBase, s as isKeyword, t as Schema, w as PluginFactoryOptions } from "./SchemaMapper-DI2vHHE0.js";
|
|
3
|
-
import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-
|
|
3
|
+
import { C as Resolver, S as ResolvePathOptions, _ as Options, a as createReactGenerator$1, b as Ref, c as SchemaGeneratorBuildOptions, d as OperationGenerator, f as OperationMethodResult, g as OperationSchemas, h as OperationSchema, i as ReactGenerator, l as SchemaGeneratorOptions, m as Include, n as createGenerator$1, o as GetSchemaGeneratorOptions, p as Exclude, r as Generator$1, s as SchemaGenerator, u as SchemaMethodResult, v as Override, x as Refs, y as PluginOas } from "./createGenerator-b8YXprrE.js";
|
|
4
4
|
import { Fabric } from "@kubb/react-fabric";
|
|
5
5
|
|
|
6
6
|
//#region src/createParser.d.ts
|
package/dist/utils.cjs
CHANGED
|
@@ -2,7 +2,6 @@ const require_chunk = require('./chunk-C1_xRkKa.cjs');
|
|
|
2
2
|
const require_getSchemaFactory = require('./getSchemaFactory-CBp1me72.cjs');
|
|
3
3
|
const require_getFooter = require('./getFooter-BvLkEWpc.cjs');
|
|
4
4
|
let _kubb_core_transformers = require("@kubb/core/transformers");
|
|
5
|
-
_kubb_core_transformers = require_chunk.__toESM(_kubb_core_transformers);
|
|
6
5
|
let _kubb_core_utils = require("@kubb/core/utils");
|
|
7
6
|
let _kubb_oas = require("@kubb/oas");
|
|
8
7
|
|
|
@@ -13,7 +12,9 @@ function getComments(operation) {
|
|
|
13
12
|
operation.getSummary() && `@summary ${operation.getSummary()}`,
|
|
14
13
|
operation.path && `{@link ${new _kubb_core_utils.URLPath(operation.path).URL}}`,
|
|
15
14
|
operation.isDeprecated() && "@deprecated"
|
|
16
|
-
].filter(Boolean).
|
|
15
|
+
].filter(Boolean).flatMap((text) => {
|
|
16
|
+
return text.split(/\r?\n/).map((line) => line.trim());
|
|
17
|
+
}).filter(Boolean);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
//#endregion
|
package/dist/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","names":["URLPath"
|
|
1
|
+
{"version":3,"file":"utils.cjs","names":["URLPath"],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/getSchemas.ts"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .flatMap((text) => {\n // Split by newlines to preserve line breaks in JSDoc\n // Trim each line individually to remove leading/trailing whitespace\n return text.split(/\\r?\\n/).map((line) => line.trim())\n })\n .filter(Boolean)\n}\n","import { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react-fabric/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n const requiredFields = Array.isArray(operationSchema.schema.required) ? operationSchema.schema.required : []\n\n return Object.entries(operationSchema.schema.properties).map(([name]: [string, OasTypes.SchemaObject]) => {\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: requiredFields.includes(name),\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n","import type { contentType, Oas, OasTypes } from '@kubb/oas'\n\nexport type GetSchemasResult = {\n schemas: Record<string, OasTypes.SchemaObject>\n /**\n * Mapping from original component name to resolved name after collision handling\n * e.g., { 'Order': 'OrderSchema', 'variant': 'variant2' }\n */\n nameMapping: Map<string, string>\n}\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\ntype GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n /**\n * Whether to resolve name collisions with suffixes.\n * If not provided, uses oas.options.collisionDetection\n * @default false (from oas.options or fallback)\n */\n collisionDetection?: boolean\n}\n\n/**\n * Collect schemas from OpenAPI components (schemas, responses, requestBodies)\n * and return them in dependency order along with name mapping for collision resolution.\n *\n * This function is a wrapper around the oas.getSchemas() method for backward compatibility.\n * New code should use oas.getSchemas() directly.\n *\n * @deprecated Use oas.getSchemas() instead\n */\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'], collisionDetection }: GetSchemasProps): GetSchemasResult {\n return oas.getSchemas({\n contentType,\n includes,\n collisionDetection,\n })\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,gBAAgB,IAAI,gBAAgB,UAAU,gBAAgB;EACxE,UAAU,YAAY,IAAI,YAAY,UAAU,YAAY;EAC5D,UAAU,QAAQ,UAAU,IAAIA,yBAAQ,UAAU,KAAK,CAAC,IAAI;EAC5D,UAAU,cAAc,IAAI;EAC7B,CACE,OAAO,QAAQ,CACf,SAAS,SAAS;AAGjB,SAAO,KAAK,MAAM,QAAQ,CAAC,KAAK,SAAS,KAAK,MAAM,CAAC;GACrD,CACD,OAAO,QAAQ;;;;;;;;;;ACPpB,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,EAAE,EACe;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO,EAAE;CAGX,MAAM,iBAAiB,MAAM,QAAQ,gBAAgB,OAAO,SAAS,GAAG,gBAAgB,OAAO,WAAW,EAAE;AAE5G,QAAO,OAAO,QAAQ,gBAAgB,OAAO,WAAW,CAAC,KAAK,CAAC,UAA2C;EACxG,MAAM,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,eAAe,SAAS,KAAK;GACvC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;GACtD;AAED,SAAO,WAAW,SAAS,KAAK,GAAG;GACnC;;AAGJ,SAAgB,cACd,iBACA,UAII,EAAE,EACN;AACA,QAAO,aAAa,iBAAiB,QAAQ,CAAC,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,mDAAsB,KAAK,KAAK,GAAG,KAAK,8CAAiB,KAAK,KAAK;AAEvE,OAAI,QAAQ,WAAW,YACrB,+CAAiB,KAAK;AAGxB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;IACjB;;AAGH,SAAO;IACN,EAAE,CAAW;;;;;;;;;;;;;;AC5BlB,SAAgB,WAAW,EAAE,KAAK,aAAa,WAAW;CAAC;CAAW;CAAiB;CAAY,EAAE,sBAAyD;AAC5J,QAAO,IAAI,WAAW;EACpB;EACA;EACA;EACD,CAAC"}
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as __name, S as Output, _ as contentType, b as Config, f as OasTypes, g as SchemaObject, h as Operation, l as isOptional, m as OpenAPIV3_1, p as OpenAPIV3, u as Oas } from "./SchemaMapper-DmB5NyNo.cjs";
|
|
2
|
-
import { h as OperationSchema, w as FunctionParamsAST } from "./createGenerator-
|
|
2
|
+
import { h as OperationSchema, w as FunctionParamsAST } from "./createGenerator-1nstUihJ.cjs";
|
|
3
3
|
import { Params } from "@kubb/react-fabric/types";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/getBanner.d.ts
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
2
|
import { S as Output, _ as contentType, b as Config, f as OasTypes, g as SchemaObject, h as Operation, l as isOptional, m as OpenAPIV3_1, p as OpenAPIV3, u as Oas } from "./SchemaMapper-DI2vHHE0.js";
|
|
3
|
-
import { h as OperationSchema, w as FunctionParamsAST } from "./createGenerator-
|
|
3
|
+
import { h as OperationSchema, w as FunctionParamsAST } from "./createGenerator-b8YXprrE.js";
|
|
4
4
|
import { Params } from "@kubb/react-fabric/types";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/getBanner.d.ts
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __name } from "./chunk-iVr_oF3V.js";
|
|
2
2
|
import { t as getSchemaFactory } from "./getSchemaFactory-DsoVRgxV.js";
|
|
3
3
|
import { n as getBanner, t as getFooter } from "./getFooter-PYWvz29J.js";
|
|
4
|
-
import
|
|
4
|
+
import { camelCase, isValidVarName } from "@kubb/core/transformers";
|
|
5
5
|
import { URLPath } from "@kubb/core/utils";
|
|
6
6
|
import { isOptional } from "@kubb/oas";
|
|
7
7
|
|
|
@@ -12,7 +12,9 @@ function getComments(operation) {
|
|
|
12
12
|
operation.getSummary() && `@summary ${operation.getSummary()}`,
|
|
13
13
|
operation.path && `{@link ${new URLPath(operation.path).URL}}`,
|
|
14
14
|
operation.isDeprecated() && "@deprecated"
|
|
15
|
-
].filter(Boolean).
|
|
15
|
+
].filter(Boolean).flatMap((text) => {
|
|
16
|
+
return text.split(/\r?\n/).map((line) => line.trim());
|
|
17
|
+
}).filter(Boolean);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
//#endregion
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/getSchemas.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils/getComments.ts","../src/utils/getParams.ts","../src/utils/getSchemas.ts"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport type { Operation } from '@kubb/oas'\n\nexport function getComments(operation: Operation): string[] {\n return [\n operation.getDescription() && `@description ${operation.getDescription()}`,\n operation.getSummary() && `@summary ${operation.getSummary()}`,\n operation.path && `{@link ${new URLPath(operation.path).URL}}`,\n operation.isDeprecated() && '@deprecated',\n ]\n .filter(Boolean)\n .flatMap((text) => {\n // Split by newlines to preserve line breaks in JSDoc\n // Trim each line individually to remove leading/trailing whitespace\n return text.split(/\\r?\\n/).map((line) => line.trim())\n })\n .filter(Boolean)\n}\n","import { camelCase, isValidVarName } from '@kubb/core/transformers'\nimport type { FunctionParamsAST } from '@kubb/core/utils'\nimport type { OasTypes } from '@kubb/oas'\nimport type { Params } from '@kubb/react-fabric/types'\nimport type { OperationSchema } from '../types.ts'\n/**\n *\n * @deprecated\n * TODO move to operationManager hook\n */\nexport function getASTParams(\n operationSchema: OperationSchema | undefined,\n {\n typed = false,\n override,\n }: {\n typed?: boolean\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n): FunctionParamsAST[] {\n if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) {\n return []\n }\n\n const requiredFields = Array.isArray(operationSchema.schema.required) ? operationSchema.schema.required : []\n\n return Object.entries(operationSchema.schema.properties).map(([name]: [string, OasTypes.SchemaObject]) => {\n const data: FunctionParamsAST = {\n name,\n enabled: !!name,\n required: requiredFields.includes(name),\n type: typed ? `${operationSchema.name}[\"${name}\"]` : undefined,\n }\n\n return override ? override(data) : data\n })\n}\n\nexport function getPathParams(\n operationSchema: OperationSchema | undefined,\n options: {\n typed?: boolean\n casing?: 'camelcase'\n override?: (data: FunctionParamsAST) => FunctionParamsAST\n } = {},\n) {\n return getASTParams(operationSchema, options).reduce((acc, curr) => {\n if (curr.name && curr.enabled) {\n let name = isValidVarName(curr.name) ? curr.name : camelCase(curr.name)\n\n if (options.casing === 'camelcase') {\n name = camelCase(name)\n }\n\n acc[name] = {\n default: curr.default,\n type: curr.type,\n optional: !curr.required,\n }\n }\n\n return acc\n }, {} as Params)\n}\n","import type { contentType, Oas, OasTypes } from '@kubb/oas'\n\nexport type GetSchemasResult = {\n schemas: Record<string, OasTypes.SchemaObject>\n /**\n * Mapping from original component name to resolved name after collision handling\n * e.g., { 'Order': 'OrderSchema', 'variant': 'variant2' }\n */\n nameMapping: Map<string, string>\n}\n\ntype Mode = 'schemas' | 'responses' | 'requestBodies'\n\ntype GetSchemasProps = {\n oas: Oas\n contentType?: contentType\n includes?: Mode[]\n /**\n * Whether to resolve name collisions with suffixes.\n * If not provided, uses oas.options.collisionDetection\n * @default false (from oas.options or fallback)\n */\n collisionDetection?: boolean\n}\n\n/**\n * Collect schemas from OpenAPI components (schemas, responses, requestBodies)\n * and return them in dependency order along with name mapping for collision resolution.\n *\n * This function is a wrapper around the oas.getSchemas() method for backward compatibility.\n * New code should use oas.getSchemas() directly.\n *\n * @deprecated Use oas.getSchemas() instead\n */\nexport function getSchemas({ oas, contentType, includes = ['schemas', 'requestBodies', 'responses'], collisionDetection }: GetSchemasProps): GetSchemasResult {\n return oas.getSchemas({\n contentType,\n includes,\n collisionDetection,\n })\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,YAAY,WAAgC;AAC1D,QAAO;EACL,UAAU,gBAAgB,IAAI,gBAAgB,UAAU,gBAAgB;EACxE,UAAU,YAAY,IAAI,YAAY,UAAU,YAAY;EAC5D,UAAU,QAAQ,UAAU,IAAI,QAAQ,UAAU,KAAK,CAAC,IAAI;EAC5D,UAAU,cAAc,IAAI;EAC7B,CACE,OAAO,QAAQ,CACf,SAAS,SAAS;AAGjB,SAAO,KAAK,MAAM,QAAQ,CAAC,KAAK,SAAS,KAAK,MAAM,CAAC;GACrD,CACD,OAAO,QAAQ;;;;;;;;;;ACPpB,SAAgB,aACd,iBACA,EACE,QAAQ,OACR,aAIE,EAAE,EACe;AACrB,KAAI,CAAC,mBAAmB,CAAC,gBAAgB,OAAO,cAAc,CAAC,gBAAgB,KAC7E,QAAO,EAAE;CAGX,MAAM,iBAAiB,MAAM,QAAQ,gBAAgB,OAAO,SAAS,GAAG,gBAAgB,OAAO,WAAW,EAAE;AAE5G,QAAO,OAAO,QAAQ,gBAAgB,OAAO,WAAW,CAAC,KAAK,CAAC,UAA2C;EACxG,MAAM,OAA0B;GAC9B;GACA,SAAS,CAAC,CAAC;GACX,UAAU,eAAe,SAAS,KAAK;GACvC,MAAM,QAAQ,GAAG,gBAAgB,KAAK,IAAI,KAAK,MAAM;GACtD;AAED,SAAO,WAAW,SAAS,KAAK,GAAG;GACnC;;AAGJ,SAAgB,cACd,iBACA,UAII,EAAE,EACN;AACA,QAAO,aAAa,iBAAiB,QAAQ,CAAC,QAAQ,KAAK,SAAS;AAClE,MAAI,KAAK,QAAQ,KAAK,SAAS;GAC7B,IAAI,OAAO,eAAe,KAAK,KAAK,GAAG,KAAK,OAAO,UAAU,KAAK,KAAK;AAEvE,OAAI,QAAQ,WAAW,YACrB,QAAO,UAAU,KAAK;AAGxB,OAAI,QAAQ;IACV,SAAS,KAAK;IACd,MAAM,KAAK;IACX,UAAU,CAAC,KAAK;IACjB;;AAGH,SAAO;IACN,EAAE,CAAW;;;;;;;;;;;;;;AC5BlB,SAAgB,WAAW,EAAE,KAAK,aAAa,WAAW;CAAC;CAAW;CAAiB;CAAY,EAAE,sBAAyD;AAC5J,QAAO,IAAI,WAAW;EACpB;EACA;EACA;EACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-oas",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.1",
|
|
4
4
|
"description": "OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openapi",
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
}
|
|
80
80
|
],
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@kubb/react-fabric": "0.12.
|
|
82
|
+
"@kubb/react-fabric": "0.12.7",
|
|
83
83
|
"p-limit": "^7.2.0",
|
|
84
84
|
"remeda": "^2.33.4",
|
|
85
|
-
"@kubb/core": "4.
|
|
86
|
-
"@kubb/oas": "4.
|
|
85
|
+
"@kubb/core": "4.20.1",
|
|
86
|
+
"@kubb/oas": "4.20.1"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@kubb/react-fabric": "0.12.
|
|
89
|
+
"@kubb/react-fabric": "0.12.7"
|
|
90
90
|
},
|
|
91
91
|
"engines": {
|
|
92
92
|
"node": ">=20"
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { PluginFactoryOptions } from '@kubb/core'
|
|
2
|
-
import type {
|
|
2
|
+
import type { FabricReactNode } from '@kubb/react-fabric/types'
|
|
3
3
|
import type { OperationProps, OperationsProps, SchemaProps } from './types.ts'
|
|
4
4
|
|
|
5
5
|
type UserGenerator<TOptions extends PluginFactoryOptions> = {
|
|
6
6
|
name: string
|
|
7
|
-
Operations?: (props: OperationsProps<TOptions>) =>
|
|
8
|
-
Operation?: (props: OperationProps<TOptions>) =>
|
|
9
|
-
Schema?: (props: SchemaProps<TOptions>) =>
|
|
7
|
+
Operations?: (props: OperationsProps<TOptions>) => FabricReactNode
|
|
8
|
+
Operation?: (props: OperationProps<TOptions>) => FabricReactNode
|
|
9
|
+
Schema?: (props: SchemaProps<TOptions>) => FabricReactNode
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
13
13
|
name: string
|
|
14
14
|
type: 'react'
|
|
15
|
-
Operations: (props: OperationsProps<TOptions>) =>
|
|
16
|
-
Operation: (props: OperationProps<TOptions>) =>
|
|
17
|
-
Schema: (props: SchemaProps<TOptions>) =>
|
|
15
|
+
Operations: (props: OperationsProps<TOptions>) => FabricReactNode
|
|
16
|
+
Operation: (props: OperationProps<TOptions>) => FabricReactNode
|
|
17
|
+
Schema: (props: SchemaProps<TOptions>) => FabricReactNode
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/****
|
package/src/utils/getComments.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import transformers from '@kubb/core/transformers'
|
|
2
1
|
import { URLPath } from '@kubb/core/utils'
|
|
3
2
|
|
|
4
3
|
import type { Operation } from '@kubb/oas'
|
|
@@ -11,6 +10,10 @@ export function getComments(operation: Operation): string[] {
|
|
|
11
10
|
operation.isDeprecated() && '@deprecated',
|
|
12
11
|
]
|
|
13
12
|
.filter(Boolean)
|
|
14
|
-
.
|
|
13
|
+
.flatMap((text) => {
|
|
14
|
+
// Split by newlines to preserve line breaks in JSDoc
|
|
15
|
+
// Trim each line individually to remove leading/trailing whitespace
|
|
16
|
+
return text.split(/\r?\n/).map((line) => line.trim())
|
|
17
|
+
})
|
|
15
18
|
.filter(Boolean)
|
|
16
19
|
}
|