@kubb/plugin-oas 4.3.1 → 4.4.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.
Files changed (104) hide show
  1. package/dist/{Oas-DoN76W2_.js → Oas-CHC1IC5D.js} +5 -9
  2. package/dist/Oas-CHC1IC5D.js.map +1 -0
  3. package/dist/{Oas--cvTRMTA.cjs → Oas-CQrRP_NH.cjs} +13 -17
  4. package/dist/Oas-CQrRP_NH.cjs.map +1 -0
  5. package/dist/{OperationGenerator-XkW6FZJh.d.cts → OperationGenerator-CRZpkIpZ.d.ts} +182 -109
  6. package/dist/{OperationGenerator-ki8g970_.d.ts → OperationGenerator-S_1PevQN.d.cts} +182 -109
  7. package/dist/{Schema-CHstINXC.d.ts → Schema-CZsDEhET.d.cts} +7 -6
  8. package/dist/{Schema-BXYfUkqN.d.cts → Schema-DBvtiLS7.d.ts} +7 -6
  9. package/dist/{SchemaGenerator-DsK0wuii.cjs → SchemaGenerator-DWj6buY0.cjs} +22 -5
  10. package/dist/SchemaGenerator-DWj6buY0.cjs.map +1 -0
  11. package/dist/{SchemaGenerator-B07tXh1b.js → SchemaGenerator-b7XixzRv.js} +21 -4
  12. package/dist/SchemaGenerator-b7XixzRv.js.map +1 -0
  13. package/dist/{SchemaMapper-qjB3rBph.d.ts → SchemaMapper-CX7sIIuZ.d.cts} +5 -118
  14. package/dist/{SchemaMapper-MiRB5_Zp.d.cts → SchemaMapper-CtfTw3hq.d.ts} +5 -118
  15. package/dist/{SchemaMapper-CM1eXksi.js → SchemaMapper-Cx4X1al6.js} +1 -1
  16. package/dist/SchemaMapper-Cx4X1al6.js.map +1 -0
  17. package/dist/{SchemaMapper-CpAbmGiH.cjs → SchemaMapper-DoL-a6qq.cjs} +1 -1
  18. package/dist/SchemaMapper-DoL-a6qq.cjs.map +1 -0
  19. package/dist/chunk-BEV-X5tz.js +27 -0
  20. package/dist/components.cjs +1 -1
  21. package/dist/components.d.cts +8 -11
  22. package/dist/components.d.ts +8 -11
  23. package/dist/components.js +1 -1
  24. package/dist/generators-B27La9Vd.cjs +99 -0
  25. package/dist/generators-B27La9Vd.cjs.map +1 -0
  26. package/dist/generators-C61FxVIj.js +80 -0
  27. package/dist/generators-C61FxVIj.js.map +1 -0
  28. package/dist/generators.cjs +9 -3
  29. package/dist/generators.d.cts +3 -8
  30. package/dist/generators.d.ts +3 -8
  31. package/dist/generators.js +5 -4
  32. package/dist/{getFooter-pQXwqM81.cjs → getFooter-CwjCW4h5.cjs} +3 -3
  33. package/dist/{getFooter-pQXwqM81.cjs.map → getFooter-CwjCW4h5.cjs.map} +1 -1
  34. package/dist/{getFooter-CvTKkK7-.js → getFooter-D5MdeUVv.js} +2 -2
  35. package/dist/{getFooter-CvTKkK7-.js.map → getFooter-D5MdeUVv.js.map} +1 -1
  36. package/dist/{getSchemas-CvUX0jWa.js → getSchemas-Bdg6n9Qk.js} +1 -1
  37. package/dist/{getSchemas-CvUX0jWa.js.map → getSchemas-Bdg6n9Qk.js.map} +1 -1
  38. package/dist/{getSchemas-08CU8KWq.cjs → getSchemas-DY8s2CSl.cjs} +1 -1
  39. package/dist/{getSchemas-08CU8KWq.cjs.map → getSchemas-DY8s2CSl.cjs.map} +1 -1
  40. package/dist/hooks.cjs +12 -27
  41. package/dist/hooks.cjs.map +1 -1
  42. package/dist/hooks.d.cts +11 -31
  43. package/dist/hooks.d.ts +11 -31
  44. package/dist/hooks.js +9 -23
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.cjs +37 -9
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +3 -9
  49. package/dist/index.d.ts +3 -9
  50. package/dist/index.js +33 -9
  51. package/dist/index.js.map +1 -1
  52. package/dist/mocks.cjs +1 -1
  53. package/dist/mocks.d.cts +1 -1
  54. package/dist/mocks.d.ts +1 -1
  55. package/dist/mocks.js +1 -1
  56. package/dist/{parseFromConfig-DSI6Meg0.js → parseFromConfig-CqiiLCPe.js} +1 -1
  57. package/dist/{parseFromConfig-DSI6Meg0.js.map → parseFromConfig-CqiiLCPe.js.map} +1 -1
  58. package/dist/{parseFromConfig-o3tU1XJt.cjs → parseFromConfig-RR31a98-.cjs} +1 -1
  59. package/dist/{parseFromConfig-o3tU1XJt.cjs.map → parseFromConfig-RR31a98-.cjs.map} +1 -1
  60. package/dist/utils-DYf-j63H.cjs +115 -0
  61. package/dist/utils-DYf-j63H.cjs.map +1 -0
  62. package/dist/utils-DaV25sy8.js +95 -0
  63. package/dist/utils-DaV25sy8.js.map +1 -0
  64. package/dist/utils.cjs +3 -3
  65. package/dist/utils.cjs.map +1 -1
  66. package/dist/utils.d.cts +4 -3
  67. package/dist/utils.d.ts +4 -3
  68. package/dist/utils.js +3 -3
  69. package/dist/utils.js.map +1 -1
  70. package/package.json +14 -11
  71. package/src/OperationGenerator.ts +36 -7
  72. package/src/SchemaGenerator.ts +26 -2
  73. package/src/SchemaMapper.ts +1 -1
  74. package/src/components/Oas.tsx +5 -12
  75. package/src/components/Operation.tsx +3 -3
  76. package/src/components/Schema.tsx +3 -4
  77. package/src/generators/createGenerator.ts +34 -0
  78. package/src/generators/createReactGenerator.ts +41 -0
  79. package/src/generators/index.ts +4 -0
  80. package/src/generators/jsonGenerator.ts +1 -1
  81. package/src/generators/types.ts +35 -0
  82. package/src/generators/utils.tsx +114 -0
  83. package/src/hooks/index.ts +1 -2
  84. package/src/hooks/useOas.ts +5 -11
  85. package/src/hooks/useOperation.ts +1 -1
  86. package/src/hooks/useOperationManager.ts +2 -2
  87. package/src/hooks/useSchema.ts +1 -1
  88. package/src/hooks/useSchemaManager.ts +1 -1
  89. package/src/index.ts +3 -5
  90. package/src/plugin.ts +2 -0
  91. package/src/types.ts +2 -2
  92. package/src/utils/getParams.ts +1 -1
  93. package/dist/Oas--cvTRMTA.cjs.map +0 -1
  94. package/dist/Oas-DoN76W2_.js.map +0 -1
  95. package/dist/SchemaGenerator-B07tXh1b.js.map +0 -1
  96. package/dist/SchemaGenerator-DsK0wuii.cjs.map +0 -1
  97. package/dist/SchemaMapper-CM1eXksi.js.map +0 -1
  98. package/dist/SchemaMapper-CpAbmGiH.cjs.map +0 -1
  99. package/dist/generators-BUNmB1lx.js +0 -154
  100. package/dist/generators-BUNmB1lx.js.map +0 -1
  101. package/dist/generators-CoiXCnDY.cjs +0 -175
  102. package/dist/generators-CoiXCnDY.cjs.map +0 -1
  103. package/src/generator.tsx +0 -139
  104. package/src/hooks/useOperations.ts +0 -40
@@ -1,5 +1,5 @@
1
- import { createContext } from "@kubb/react";
2
- import { jsx } from "@kubb/react/jsx-runtime";
1
+ import { createContext } from "@kubb/react-fabric";
2
+ import { jsx } from "@kubb/react-fabric/jsx-runtime";
3
3
 
4
4
  //#region src/components/Operation.tsx
5
5
  const OperationContext = createContext({});
@@ -41,13 +41,9 @@ Schema.Context = SchemaContext;
41
41
  //#endregion
42
42
  //#region src/components/Oas.tsx
43
43
  const OasContext = createContext({});
44
- function Oas({ oas, children, operations, generator }) {
44
+ function Oas({ children, generator }) {
45
45
  return /* @__PURE__ */ jsx(OasContext.Provider, {
46
- value: {
47
- oas,
48
- generator,
49
- operations
50
- },
46
+ value: { generator },
51
47
  children
52
48
  });
53
49
  }
@@ -57,4 +53,4 @@ Oas.Schema = Schema;
57
53
 
58
54
  //#endregion
59
55
  export { Schema as n, Operation as r, Oas as t };
60
- //# sourceMappingURL=Oas-DoN76W2_.js.map
56
+ //# sourceMappingURL=Oas-CHC1IC5D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Oas-CHC1IC5D.js","names":[],"sources":["../src/components/Operation.tsx","../src/components/Schema.tsx","../src/components/Oas.tsx"],"sourcesContent":["import type { Operation as OperationType } from '@kubb/oas'\nimport { createContext } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n operation: OperationType\n children?: KubbNode\n}\n\ntype OperationContextProps = {\n operation?: OperationType\n}\n\nconst OperationContext = createContext<OperationContextProps>({})\n\nexport function Operation({ operation, children }: Props): KubbNode {\n return <OperationContext.Provider value={{ operation }}>{children}</OperationContext.Provider>\n}\n\nOperation.Context = OperationContext\n","import type { SchemaObject } from '@kubb/oas'\nimport { createContext } from '@kubb/react-fabric'\nimport type { Key, KubbNode } from '@kubb/react-fabric/types'\nimport type { Schema as SchemaType } from '../SchemaMapper.ts'\n\nexport type SchemaContextProps = {\n name: string\n schemaObject?: SchemaObject\n tree: Array<SchemaType>\n}\n\ntype Props = {\n key?: Key\n name: string\n schemaObject?: SchemaObject\n tree?: Array<SchemaType>\n children?: KubbNode\n}\n\nconst SchemaContext = createContext<SchemaContextProps>({\n name: 'unknown',\n tree: [],\n})\n\n/**\n * Provides schema-related context to descendant components.\n *\n * Wraps its children with a context containing the schema name, optional schema object, and an optional schema type tree.\n *\n * @param name - The name of the schema.\n * @param schemaObject - The schema object to provide in context, if available.\n * @param tree - An array representing the schema type hierarchy.\n */\nexport function Schema({ name, schemaObject, tree = [], children }: Props): KubbNode {\n return <SchemaContext.Provider value={{ name, schemaObject, tree }}>{children}</SchemaContext.Provider>\n}\n\nSchema.Context = SchemaContext\n","import { createContext } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\nimport { Operation } from './Operation.tsx'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n children?: KubbNode\n}\n\ntype OasContextProps = {\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n}\n\nconst OasContext = createContext<OasContextProps>({})\n\nexport function Oas({ children, generator }: Props): KubbNode {\n return <OasContext.Provider value={{ generator }}>{children}</OasContext.Provider>\n}\n\nOas.Context = OasContext\nOas.Operation = Operation\nOas.Schema = Schema\n"],"mappings":";;;;AAaA,MAAM,mBAAmB,cAAqC,EAAE,CAAC;AAEjE,SAAgB,UAAU,EAAE,WAAW,YAA6B;AAClE,QAAO,oBAAC,iBAAiB;EAAS,OAAO,EAAE,WAAW;EAAG;GAAqC;;AAGhG,UAAU,UAAU;;;;ACApB,MAAM,gBAAgB,cAAkC;CACtD,MAAM;CACN,MAAM,EAAE;CACT,CAAC;;;;;;;;;;AAWF,SAAgB,OAAO,EAAE,MAAM,cAAc,OAAO,EAAE,EAAE,YAA6B;AACnF,QAAO,oBAAC,cAAc;EAAS,OAAO;GAAE;GAAM;GAAc;GAAM;EAAG;GAAkC;;AAGzG,OAAO,UAAU;;;;AChBjB,MAAM,aAAa,cAA+B,EAAE,CAAC;AAErD,SAAgB,IAAI,EAAE,UAAU,aAA8B;AAC5D,QAAO,oBAAC,WAAW;EAAS,OAAO,EAAE,WAAW;EAAG;GAA+B;;AAGpF,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,SAAS"}
@@ -1,13 +1,13 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- let __kubb_react = require("@kubb/react");
3
- __kubb_react = require_chunk.__toESM(__kubb_react);
4
- let __kubb_react_jsx_runtime = require("@kubb/react/jsx-runtime");
5
- __kubb_react_jsx_runtime = require_chunk.__toESM(__kubb_react_jsx_runtime);
2
+ let __kubb_react_fabric = require("@kubb/react-fabric");
3
+ __kubb_react_fabric = require_chunk.__toESM(__kubb_react_fabric);
4
+ let __kubb_react_fabric_jsx_runtime = require("@kubb/react-fabric/jsx-runtime");
5
+ __kubb_react_fabric_jsx_runtime = require_chunk.__toESM(__kubb_react_fabric_jsx_runtime);
6
6
 
7
7
  //#region src/components/Operation.tsx
8
- const OperationContext = (0, __kubb_react.createContext)({});
8
+ const OperationContext = (0, __kubb_react_fabric.createContext)({});
9
9
  function Operation({ operation, children }) {
10
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(OperationContext.Provider, {
10
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(OperationContext.Provider, {
11
11
  value: { operation },
12
12
  children
13
13
  });
@@ -16,7 +16,7 @@ Operation.Context = OperationContext;
16
16
 
17
17
  //#endregion
18
18
  //#region src/components/Schema.tsx
19
- const SchemaContext = (0, __kubb_react.createContext)({
19
+ const SchemaContext = (0, __kubb_react_fabric.createContext)({
20
20
  name: "unknown",
21
21
  tree: []
22
22
  });
@@ -30,7 +30,7 @@ const SchemaContext = (0, __kubb_react.createContext)({
30
30
  * @param tree - An array representing the schema type hierarchy.
31
31
  */
32
32
  function Schema({ name, schemaObject, tree = [], children }) {
33
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(SchemaContext.Provider, {
33
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(SchemaContext.Provider, {
34
34
  value: {
35
35
  name,
36
36
  schemaObject,
@@ -43,14 +43,10 @@ Schema.Context = SchemaContext;
43
43
 
44
44
  //#endregion
45
45
  //#region src/components/Oas.tsx
46
- const OasContext = (0, __kubb_react.createContext)({});
47
- function Oas({ oas, children, operations, generator }) {
48
- return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(OasContext.Provider, {
49
- value: {
50
- oas,
51
- generator,
52
- operations
53
- },
46
+ const OasContext = (0, __kubb_react_fabric.createContext)({});
47
+ function Oas({ children, generator }) {
48
+ return /* @__PURE__ */ (0, __kubb_react_fabric_jsx_runtime.jsx)(OasContext.Provider, {
49
+ value: { generator },
54
50
  children
55
51
  });
56
52
  }
@@ -77,4 +73,4 @@ Object.defineProperty(exports, 'Schema', {
77
73
  return Schema;
78
74
  }
79
75
  });
80
- //# sourceMappingURL=Oas--cvTRMTA.cjs.map
76
+ //# sourceMappingURL=Oas-CQrRP_NH.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Oas-CQrRP_NH.cjs","names":[],"sources":["../src/components/Operation.tsx","../src/components/Schema.tsx","../src/components/Oas.tsx"],"sourcesContent":["import type { Operation as OperationType } from '@kubb/oas'\nimport { createContext } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\n\ntype Props = {\n operation: OperationType\n children?: KubbNode\n}\n\ntype OperationContextProps = {\n operation?: OperationType\n}\n\nconst OperationContext = createContext<OperationContextProps>({})\n\nexport function Operation({ operation, children }: Props): KubbNode {\n return <OperationContext.Provider value={{ operation }}>{children}</OperationContext.Provider>\n}\n\nOperation.Context = OperationContext\n","import type { SchemaObject } from '@kubb/oas'\nimport { createContext } from '@kubb/react-fabric'\nimport type { Key, KubbNode } from '@kubb/react-fabric/types'\nimport type { Schema as SchemaType } from '../SchemaMapper.ts'\n\nexport type SchemaContextProps = {\n name: string\n schemaObject?: SchemaObject\n tree: Array<SchemaType>\n}\n\ntype Props = {\n key?: Key\n name: string\n schemaObject?: SchemaObject\n tree?: Array<SchemaType>\n children?: KubbNode\n}\n\nconst SchemaContext = createContext<SchemaContextProps>({\n name: 'unknown',\n tree: [],\n})\n\n/**\n * Provides schema-related context to descendant components.\n *\n * Wraps its children with a context containing the schema name, optional schema object, and an optional schema type tree.\n *\n * @param name - The name of the schema.\n * @param schemaObject - The schema object to provide in context, if available.\n * @param tree - An array representing the schema type hierarchy.\n */\nexport function Schema({ name, schemaObject, tree = [], children }: Props): KubbNode {\n return <SchemaContext.Provider value={{ name, schemaObject, tree }}>{children}</SchemaContext.Provider>\n}\n\nSchema.Context = SchemaContext\n","import { createContext } from '@kubb/react-fabric'\nimport type { KubbNode } from '@kubb/react-fabric/types'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\nimport { Operation } from './Operation.tsx'\nimport { Schema } from './Schema.tsx'\n\ntype Props = {\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n children?: KubbNode\n}\n\ntype OasContextProps = {\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n}\n\nconst OasContext = createContext<OasContextProps>({})\n\nexport function Oas({ children, generator }: Props): KubbNode {\n return <OasContext.Provider value={{ generator }}>{children}</OasContext.Provider>\n}\n\nOas.Context = OasContext\nOas.Operation = Operation\nOas.Schema = Schema\n"],"mappings":";;;;;;;AAaA,MAAM,0DAAwD,EAAE,CAAC;AAEjE,SAAgB,UAAU,EAAE,WAAW,YAA6B;AAClE,QAAO,yDAAC,iBAAiB;EAAS,OAAO,EAAE,WAAW;EAAG;GAAqC;;AAGhG,UAAU,UAAU;;;;ACApB,MAAM,uDAAkD;CACtD,MAAM;CACN,MAAM,EAAE;CACT,CAAC;;;;;;;;;;AAWF,SAAgB,OAAO,EAAE,MAAM,cAAc,OAAO,EAAE,EAAE,YAA6B;AACnF,QAAO,yDAAC,cAAc;EAAS,OAAO;GAAE;GAAM;GAAc;GAAM;EAAG;GAAkC;;AAGzG,OAAO,UAAU;;;;AChBjB,MAAM,oDAA4C,EAAE,CAAC;AAErD,SAAgB,IAAI,EAAE,UAAU,aAA8B;AAC5D,QAAO,yDAAC,WAAW;EAAS,OAAO,EAAE,WAAW;EAAG;GAA+B;;AAGpF,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,SAAS"}