@kubb/plugin-oas 4.19.2 → 4.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 { KubbNode } from "@kubb/react-fabric/types";
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>) => KubbNode;
329
- Operation?: (props: OperationProps<TOptions>) => KubbNode;
330
- Schema?: (props: SchemaProps<TOptions>) => KubbNode;
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>) => KubbNode;
336
- Operation: (props: OperationProps<TOptions>) => KubbNode;
337
- Schema: (props: SchemaProps<TOptions>) => KubbNode;
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-cYz-kExA.d.cts.map
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 { KubbNode } from "@kubb/react-fabric/types";
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>) => KubbNode;
330
- Operation?: (props: OperationProps<TOptions>) => KubbNode;
331
- Schema?: (props: SchemaProps<TOptions>) => KubbNode;
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>) => KubbNode;
337
- Operation: (props: OperationProps<TOptions>) => KubbNode;
338
- Schema: (props: SchemaProps<TOptions>) => KubbNode;
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-3zJdjpOn.d.ts.map
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 { KubbNode } 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>) => KubbNode\n Operation?: (props: OperationProps<TOptions>) => KubbNode\n Schema?: (props: SchemaProps<TOptions>) => KubbNode\n}\n\nexport type ReactGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'react'\n Operations: (props: OperationsProps<TOptions>) => KubbNode\n Operation: (props: OperationProps<TOptions>) => KubbNode\n Schema: (props: SchemaProps<TOptions>) => KubbNode\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
+ {"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 { KubbNode } 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>) => KubbNode\n Operation?: (props: OperationProps<TOptions>) => KubbNode\n Schema?: (props: SchemaProps<TOptions>) => KubbNode\n}\n\nexport type ReactGenerator<TOptions extends PluginFactoryOptions> = {\n name: string\n type: 'react'\n Operations: (props: OperationsProps<TOptions>) => KubbNode\n Operation: (props: OperationProps<TOptions>) => KubbNode\n Schema: (props: SchemaProps<TOptions>) => KubbNode\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"}
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"}
@@ -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-cYz-kExA.cjs";
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>;
@@ -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-3zJdjpOn.js";
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-cYz-kExA.cjs";
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-3zJdjpOn.js";
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-cYz-kExA.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-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-3zJdjpOn.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-b8YXprrE.js";
4
4
  import { Fabric } from "@kubb/react-fabric";
5
5
 
6
6
  //#region src/createParser.d.ts
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-cYz-kExA.cjs";
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-3zJdjpOn.js";
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-oas",
3
- "version": "4.19.2",
3
+ "version": "4.20.0",
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.4",
82
+ "@kubb/react-fabric": "0.12.7",
83
83
  "p-limit": "^7.2.0",
84
84
  "remeda": "^2.33.4",
85
- "@kubb/core": "4.19.2",
86
- "@kubb/oas": "4.19.2"
85
+ "@kubb/core": "4.20.0",
86
+ "@kubb/oas": "4.20.0"
87
87
  },
88
88
  "peerDependencies": {
89
- "@kubb/react-fabric": "0.12.4"
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 { KubbNode } from '@kubb/react-fabric/types'
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>) => KubbNode
8
- Operation?: (props: OperationProps<TOptions>) => KubbNode
9
- Schema?: (props: SchemaProps<TOptions>) => KubbNode
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>) => KubbNode
16
- Operation: (props: OperationProps<TOptions>) => KubbNode
17
- Schema: (props: SchemaProps<TOptions>) => KubbNode
15
+ Operations: (props: OperationsProps<TOptions>) => FabricReactNode
16
+ Operation: (props: OperationProps<TOptions>) => FabricReactNode
17
+ Schema: (props: SchemaProps<TOptions>) => FabricReactNode
18
18
  }
19
19
 
20
20
  /****