@kubb/plugin-ts 5.0.0-alpha.1 → 5.0.0-alpha.3

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,6 +1,6 @@
1
1
  import { t as __name } from "./chunk--u3MIqq1.js";
2
2
  import { n as PluginTs } from "./types-BpeKGgCn.js";
3
- import { AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
3
+ import { Adapter, AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
4
4
  import { Fabric } from "@kubb/react-fabric";
5
5
  import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
6
6
  import { FabricReactNode } from "@kubb/react-fabric/types";
@@ -26,14 +26,14 @@ declare global {
26
26
  *
27
27
  * `originalName` is the original name used(in PascalCase), only used to remove duplicates
28
28
  *
29
- * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
29
+ * `pluginName` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
30
30
  * @example import a type(plugin-ts) for a mock file(swagger-faker)
31
31
  */
32
32
  type Ref = {
33
33
  propertyName: string;
34
34
  originalName: string;
35
35
  path: KubbFile.Path;
36
- pluginKey?: Plugin['key'];
36
+ pluginName?: string;
37
37
  };
38
38
  type Refs = Record<string, Ref>;
39
39
  type OperationSchema = {
@@ -446,7 +446,8 @@ type OperationsV1Props<TOptions extends PluginFactoryOptions> = {
446
446
  };
447
447
  type OperationsV2Props<TOptions extends PluginFactoryOptions> = {
448
448
  config: Config;
449
- plugin: Plugin<TOptions>;
449
+ adapter: Adapter;
450
+ options: Plugin<TOptions>['options'];
450
451
  nodes: Array<OperationNode>;
451
452
  };
452
453
  type OperationV1Props<TOptions extends PluginFactoryOptions> = {
@@ -457,7 +458,8 @@ type OperationV1Props<TOptions extends PluginFactoryOptions> = {
457
458
  };
458
459
  type OperationV2Props<TOptions extends PluginFactoryOptions> = {
459
460
  config: Config;
460
- plugin: Plugin<TOptions>;
461
+ adapter: Adapter;
462
+ options: Plugin<TOptions>['options'];
461
463
  node: OperationNode;
462
464
  };
463
465
  type OperationsProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationsV2Props<TOptions> : OperationsV1Props<TOptions>;
@@ -474,8 +476,9 @@ type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
474
476
  };
475
477
  type SchemaV2Props<TOptions extends PluginFactoryOptions> = {
476
478
  config: Config;
477
- plugin: Plugin<TOptions>;
479
+ options: Plugin<TOptions>['options'];
478
480
  node: SchemaNode;
481
+ adapter: Adapter;
479
482
  };
480
483
  type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
481
484
  type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion>;
@@ -493,5 +496,8 @@ type ReactGenerator<TOptions extends PluginFactoryOptions, TVersion extends Vers
493
496
  //#region src/generators/typeGenerator.d.ts
494
497
  declare const typeGenerator: ReactGenerator<PluginTs, "1">;
495
498
  //#endregion
496
- export { typeGenerator };
499
+ //#region src/generators/v2/typeGenerator.d.ts
500
+ declare const typeGenerator$1: ReactGenerator<PluginTs, "2">;
501
+ //#endregion
502
+ export { typeGenerator, typeGenerator$1 as typeGeneratorV2 };
497
503
  //# sourceMappingURL=generators.d.ts.map
@@ -1,2 +1,2 @@
1
- import { r as typeGenerator } from "./plugin-DnKRpgGK.js";
2
- export { typeGenerator };
1
+ import { i as typeGenerator, r as typeGenerator$1 } from "./plugin-DmwgRHK8.js";
2
+ export { typeGenerator, typeGenerator$1 as typeGeneratorV2 };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_plugin = require("./plugin-BHE4J4aP.cjs");
2
+ const require_plugin = require("./plugin-D5rCK1zO.cjs");
3
3
  exports.pluginTs = require_plugin.pluginTs;
4
4
  exports.pluginTsName = require_plugin.pluginTsName;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as pluginTsName, t as pluginTs } from "./plugin-DnKRpgGK.js";
1
+ import { n as pluginTsName, t as pluginTs } from "./plugin-DmwgRHK8.js";
2
2
  export { pluginTs, pluginTsName };