@kubb/plugin-ts 4.18.5 → 4.19.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,4 +1,4 @@
1
- import { i as Schema, n as PluginTs, o as SchemaObject, s as __name } from "./types-BMfQRWAb.cjs";
1
+ import { i as Schema, n as PluginTs, o as SchemaObject, s as __name } from "./types-DQ-FqXlZ.cjs";
2
2
  import { KubbNode } from "@kubb/react-fabric/types";
3
3
 
4
4
  //#region src/components/Type.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { i as Schema, n as PluginTs, o as SchemaObject } from "./types-DpL83O8r.js";
2
+ import { i as Schema, n as PluginTs, o as SchemaObject } from "./types-C6zMTrNH.js";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
5
5
  //#region src/components/Type.d.ts
@@ -1,4 +1,4 @@
1
- import { n as PluginTs, r as ReactGenerator, s as __name } from "./types-BMfQRWAb.cjs";
1
+ import { n as PluginTs, r as ReactGenerator, s as __name } from "./types-DQ-FqXlZ.cjs";
2
2
 
3
3
  //#region src/generators/typeGenerator.d.ts
4
4
  declare const typeGenerator: ReactGenerator<PluginTs>;
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { n as PluginTs, r as ReactGenerator } from "./types-DpL83O8r.js";
2
+ import { n as PluginTs, r as ReactGenerator } from "./types-C6zMTrNH.js";
3
3
 
4
4
  //#region src/generators/typeGenerator.d.ts
5
5
  declare const typeGenerator: ReactGenerator<PluginTs>;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as UserPluginWithLifeCycle, n as PluginTs, s as __name, t as Options } from "./types-BMfQRWAb.cjs";
1
+ import { a as UserPluginWithLifeCycle, n as PluginTs, s as __name, t as Options } from "./types-DQ-FqXlZ.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginTsName = "plugin-ts";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-DpL83O8r.js";
2
+ import { a as UserPluginWithLifeCycle, n as PluginTs, t as Options } from "./types-C6zMTrNH.js";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginTsName = "plugin-ts";
@@ -20,16 +20,21 @@ type Operation$1 = Operation;
20
20
  type DiscriminatorObject$1 = DiscriminatorObject;
21
21
  //#endregion
22
22
  //#region ../oas/src/Oas.d.ts
23
- type Options$2 = {
23
+ type OasOptions = {
24
24
  contentType?: contentType;
25
25
  discriminator?: 'strict' | 'inherit';
26
+ /**
27
+ * Resolve name collisions when schemas from different components share the same name (case-insensitive).
28
+ * @default false
29
+ */
30
+ collisionDetection?: boolean;
26
31
  };
27
32
  declare class Oas extends BaseOas {
28
33
  #private;
29
34
  document: Document;
30
35
  constructor(document: Document);
31
- setOptions(options: Options$2): void;
32
- get options(): Options$2;
36
+ setOptions(options: OasOptions): void;
37
+ get options(): OasOptions;
33
38
  get<T = unknown>($ref: string): T | null;
34
39
  getKey($ref: string): string | undefined;
35
40
  set($ref: string, value: unknown): false | undefined;
@@ -40,6 +45,18 @@ declare class Oas extends BaseOas {
40
45
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
41
46
  validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
42
47
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
48
+ /**
49
+ * Get schemas from OpenAPI components (schemas, responses, requestBodies).
50
+ * Returns schemas in dependency order along with name mapping for collision resolution.
51
+ */
52
+ getSchemas(options?: {
53
+ contentType?: contentType;
54
+ includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
55
+ collisionDetection?: boolean;
56
+ }): {
57
+ schemas: Record<string, SchemaObject$1>;
58
+ nameMapping: Map<string, string>;
59
+ };
43
60
  }
44
61
  //#endregion
45
62
  //#region ../core/src/BaseGenerator.d.ts
@@ -1326,4 +1343,4 @@ type ResolvedOptions = {
1326
1343
  type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
1327
1344
  //#endregion
1328
1345
  export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, SchemaObject$1 as o, ReactGenerator as r, Options as t };
1329
- //# sourceMappingURL=types-DpL83O8r.d.ts.map
1346
+ //# sourceMappingURL=types-C6zMTrNH.d.ts.map
@@ -21,16 +21,21 @@ type Operation$1 = Operation;
21
21
  type DiscriminatorObject$1 = DiscriminatorObject;
22
22
  //#endregion
23
23
  //#region ../oas/src/Oas.d.ts
24
- type Options$2 = {
24
+ type OasOptions = {
25
25
  contentType?: contentType;
26
26
  discriminator?: 'strict' | 'inherit';
27
+ /**
28
+ * Resolve name collisions when schemas from different components share the same name (case-insensitive).
29
+ * @default false
30
+ */
31
+ collisionDetection?: boolean;
27
32
  };
28
33
  declare class Oas extends BaseOas {
29
34
  #private;
30
35
  document: Document;
31
36
  constructor(document: Document);
32
- setOptions(options: Options$2): void;
33
- get options(): Options$2;
37
+ setOptions(options: OasOptions): void;
38
+ get options(): OasOptions;
34
39
  get<T = unknown>($ref: string): T | null;
35
40
  getKey($ref: string): string | undefined;
36
41
  set($ref: string, value: unknown): false | undefined;
@@ -41,6 +46,18 @@ declare class Oas extends BaseOas {
41
46
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
42
47
  validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
43
48
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
49
+ /**
50
+ * Get schemas from OpenAPI components (schemas, responses, requestBodies).
51
+ * Returns schemas in dependency order along with name mapping for collision resolution.
52
+ */
53
+ getSchemas(options?: {
54
+ contentType?: contentType;
55
+ includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
56
+ collisionDetection?: boolean;
57
+ }): {
58
+ schemas: Record<string, SchemaObject$1>;
59
+ nameMapping: Map<string, string>;
60
+ };
44
61
  }
45
62
  //#endregion
46
63
  //#region ../core/src/BaseGenerator.d.ts
@@ -1327,4 +1344,4 @@ type ResolvedOptions = {
1327
1344
  type PluginTs = PluginFactoryOptions<'plugin-ts', Options, ResolvedOptions, never, ResolvePathOptions>;
1328
1345
  //#endregion
1329
1346
  export { UserPluginWithLifeCycle as a, Schema as i, PluginTs as n, SchemaObject$1 as o, ReactGenerator as r, __name as s, Options as t };
1330
- //# sourceMappingURL=types-BMfQRWAb.d.cts.map
1347
+ //# sourceMappingURL=types-DQ-FqXlZ.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-ts",
3
- "version": "4.18.5",
3
+ "version": "4.19.0",
4
4
  "description": "TypeScript code generation plugin for Kubb, transforming OpenAPI schemas into TypeScript interfaces, types, and utility functions.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -69,9 +69,9 @@
69
69
  "natural-orderby": "^5.0.0",
70
70
  "remeda": "^2.33.4",
71
71
  "typescript": "5.9.3",
72
- "@kubb/core": "4.18.5",
73
- "@kubb/oas": "4.18.5",
74
- "@kubb/plugin-oas": "4.18.5"
72
+ "@kubb/core": "4.19.0",
73
+ "@kubb/oas": "4.19.0",
74
+ "@kubb/plugin-oas": "4.19.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "@kubb/react-fabric": "0.12.4",