@kubb/plugin-swr 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 { a as OperationSchemas, c as __name, n as PluginSwr, r as Transformer, s as Operation } from "./types-Ctt2W0Br.cjs";
1
+ import { a as OperationSchemas, c as __name, n as PluginSwr, r as Transformer, s as Operation } from "./types-hlBlVD9o.cjs";
2
2
  import { FunctionParams } from "@kubb/react-fabric";
3
3
  import { KubbNode } from "@kubb/react-fabric/types";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { a as OperationSchemas, n as PluginSwr, r as Transformer, s as Operation } from "./types-kbiflGdh.js";
2
+ import { a as OperationSchemas, n as PluginSwr, r as Transformer, s as Operation } from "./types-BgG6kacf.js";
3
3
  import { FunctionParams } from "@kubb/react-fabric";
4
4
  import { KubbNode } from "@kubb/react-fabric/types";
5
5
 
@@ -1,4 +1,4 @@
1
- import { c as __name, i as ReactGenerator, n as PluginSwr } from "./types-Ctt2W0Br.cjs";
1
+ import { c as __name, i as ReactGenerator, n as PluginSwr } from "./types-hlBlVD9o.cjs";
2
2
 
3
3
  //#region src/generators/mutationGenerator.d.ts
4
4
  declare const mutationGenerator: ReactGenerator<PluginSwr>;
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { i as ReactGenerator, n as PluginSwr } from "./types-kbiflGdh.js";
2
+ import { i as ReactGenerator, n as PluginSwr } from "./types-BgG6kacf.js";
3
3
 
4
4
  //#region src/generators/mutationGenerator.d.ts
5
5
  declare const mutationGenerator: ReactGenerator<PluginSwr>;
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { c as __name, n as PluginSwr, o as UserPluginWithLifeCycle, t as Options } from "./types-Ctt2W0Br.cjs";
1
+ import { c as __name, n as PluginSwr, o as UserPluginWithLifeCycle, t as Options } from "./types-hlBlVD9o.cjs";
2
2
 
3
3
  //#region src/plugin.d.ts
4
4
  declare const pluginSwrName = "plugin-swr";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "./chunk-eQyhnF5A.js";
2
- import { n as PluginSwr, o as UserPluginWithLifeCycle, t as Options } from "./types-kbiflGdh.js";
2
+ import { n as PluginSwr, o as UserPluginWithLifeCycle, t as Options } from "./types-BgG6kacf.js";
3
3
 
4
4
  //#region src/plugin.d.ts
5
5
  declare const pluginSwrName = "plugin-swr";
@@ -19,16 +19,21 @@ type Operation$1 = Operation;
19
19
  type DiscriminatorObject$1 = DiscriminatorObject;
20
20
  //#endregion
21
21
  //#region ../oas/src/Oas.d.ts
22
- type Options$3 = {
22
+ type OasOptions = {
23
23
  contentType?: contentType;
24
24
  discriminator?: 'strict' | 'inherit';
25
+ /**
26
+ * Resolve name collisions when schemas from different components share the same name (case-insensitive).
27
+ * @default false
28
+ */
29
+ collisionDetection?: boolean;
25
30
  };
26
31
  declare class Oas extends BaseOas {
27
32
  #private;
28
33
  document: Document;
29
34
  constructor(document: Document);
30
- setOptions(options: Options$3): void;
31
- get options(): Options$3;
35
+ setOptions(options: OasOptions): void;
36
+ get options(): OasOptions;
32
37
  get<T = unknown>($ref: string): T | null;
33
38
  getKey($ref: string): string | undefined;
34
39
  set($ref: string, value: unknown): false | undefined;
@@ -39,6 +44,18 @@ declare class Oas extends BaseOas {
39
44
  getParametersSchema(operation: Operation$1, inKey: 'path' | 'query' | 'header'): SchemaObject$1 | null;
40
45
  validate(): Promise<oas_normalize_lib_types0.ValidationResult>;
41
46
  flattenSchema(schema: SchemaObject$1 | null): SchemaObject$1 | null;
47
+ /**
48
+ * Get schemas from OpenAPI components (schemas, responses, requestBodies).
49
+ * Returns schemas in dependency order along with name mapping for collision resolution.
50
+ */
51
+ getSchemas(options?: {
52
+ contentType?: contentType;
53
+ includes?: Array<'schemas' | 'responses' | 'requestBodies'>;
54
+ collisionDetection?: boolean;
55
+ }): {
56
+ schemas: Record<string, SchemaObject$1>;
57
+ nameMapping: Map<string, string>;
58
+ };
42
59
  }
43
60
  //#endregion
44
61
  //#region ../core/src/BaseGenerator.d.ts
@@ -1449,4 +1466,4 @@ type ResolvedOptions = {
1449
1466
  type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
1450
1467
  //#endregion
1451
1468
  export { OperationSchemas as a, ReactGenerator as i, PluginSwr as n, UserPluginWithLifeCycle as o, Transformer as r, Operation$1 as s, Options as t };
1452
- //# sourceMappingURL=types-kbiflGdh.d.ts.map
1469
+ //# sourceMappingURL=types-BgG6kacf.d.ts.map
@@ -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$3 = {
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$3): void;
32
- get options(): Options$3;
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
@@ -1450,4 +1467,4 @@ type ResolvedOptions = {
1450
1467
  type PluginSwr = PluginFactoryOptions<'plugin-swr', Options, ResolvedOptions, never, ResolvePathOptions>;
1451
1468
  //#endregion
1452
1469
  export { OperationSchemas as a, __name as c, ReactGenerator as i, PluginSwr as n, UserPluginWithLifeCycle as o, Transformer as r, Operation$1 as s, Options as t };
1453
- //# sourceMappingURL=types-Ctt2W0Br.d.cts.map
1470
+ //# sourceMappingURL=types-hlBlVD9o.d.cts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-swr",
3
- "version": "4.18.5",
3
+ "version": "4.19.0",
4
4
  "description": "SWR hooks generator plugin for Kubb, creating type-safe data fetching hooks from OpenAPI specifications for React and Next.js applications.",
5
5
  "keywords": [
6
6
  "swr",
@@ -72,12 +72,12 @@
72
72
  "dependencies": {
73
73
  "@kubb/react-fabric": "0.12.4",
74
74
  "remeda": "^2.33.4",
75
- "@kubb/core": "4.18.5",
76
- "@kubb/oas": "4.18.5",
77
- "@kubb/plugin-client": "4.18.5",
78
- "@kubb/plugin-oas": "4.18.5",
79
- "@kubb/plugin-ts": "4.18.5",
80
- "@kubb/plugin-zod": "4.18.5"
75
+ "@kubb/core": "4.19.0",
76
+ "@kubb/oas": "4.19.0",
77
+ "@kubb/plugin-client": "4.19.0",
78
+ "@kubb/plugin-oas": "4.19.0",
79
+ "@kubb/plugin-ts": "4.19.0",
80
+ "@kubb/plugin-zod": "4.19.0"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@kubb/react-fabric": "0.12.4"