@kubb/plugin-oas 3.16.2 → 3.16.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.
Files changed (110) hide show
  1. package/dist/Oas-CuqAnIw-.js +60 -0
  2. package/dist/Oas-CuqAnIw-.js.map +1 -0
  3. package/dist/Oas-Cv_pyXRM.cjs +78 -0
  4. package/dist/Oas-Cv_pyXRM.cjs.map +1 -0
  5. package/dist/OperationGenerator-CgbXErhW.d.cts +900 -0
  6. package/dist/OperationGenerator-OtLcGk2y.d.ts +900 -0
  7. package/dist/Schema-DJshqHto.d.cts +38 -0
  8. package/dist/Schema-DOXGUW1m.d.ts +38 -0
  9. package/dist/SchemaGenerator-8205BXCp.cjs +942 -0
  10. package/dist/SchemaGenerator-8205BXCp.cjs.map +1 -0
  11. package/dist/SchemaGenerator-B8Io6kky.js +930 -0
  12. package/dist/SchemaGenerator-B8Io6kky.js.map +1 -0
  13. package/dist/SchemaMapper-BaZQKrQB.js +54 -0
  14. package/dist/SchemaMapper-BaZQKrQB.js.map +1 -0
  15. package/dist/SchemaMapper-BiagBQN4.d.cts +388 -0
  16. package/dist/SchemaMapper-C2J2d3o4.d.ts +388 -0
  17. package/dist/SchemaMapper-D8J0V9Pj.cjs +66 -0
  18. package/dist/SchemaMapper-D8J0V9Pj.cjs.map +1 -0
  19. package/dist/chunk-CUT6urMc.cjs +30 -0
  20. package/dist/components.cjs +4 -19
  21. package/dist/components.d.cts +42 -35
  22. package/dist/components.d.ts +42 -35
  23. package/dist/components.js +3 -3
  24. package/dist/generators-BhLMlRNk.js +137 -0
  25. package/dist/generators-BhLMlRNk.js.map +1 -0
  26. package/dist/generators-DLH2kvlh.cjs +155 -0
  27. package/dist/generators-DLH2kvlh.cjs.map +1 -0
  28. package/dist/generators.cjs +4 -13
  29. package/dist/generators.d.cts +5 -7
  30. package/dist/generators.d.ts +5 -7
  31. package/dist/generators.js +5 -5
  32. package/dist/getFooter-BChY2kC1.cjs +43 -0
  33. package/dist/getFooter-BChY2kC1.cjs.map +1 -0
  34. package/dist/getFooter-T7_pZ6f8.js +31 -0
  35. package/dist/getFooter-T7_pZ6f8.js.map +1 -0
  36. package/dist/getSchemas-D8mP129c.cjs +67 -0
  37. package/dist/getSchemas-D8mP129c.cjs.map +1 -0
  38. package/dist/getSchemas-WoSBIxG8.js +55 -0
  39. package/dist/getSchemas-WoSBIxG8.js.map +1 -0
  40. package/dist/hooks.cjs +213 -195
  41. package/dist/hooks.cjs.map +1 -1
  42. package/dist/hooks.d.cts +91 -86
  43. package/dist/hooks.d.ts +91 -86
  44. package/dist/hooks.js +212 -193
  45. package/dist/hooks.js.map +1 -1
  46. package/dist/index.cjs +280 -342
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +7 -10
  49. package/dist/index.d.ts +7 -10
  50. package/dist/index.js +274 -318
  51. package/dist/index.js.map +1 -1
  52. package/dist/mocks.cjs +802 -737
  53. package/dist/mocks.cjs.map +1 -1
  54. package/dist/mocks.d.cts +12 -11
  55. package/dist/mocks.d.ts +12 -11
  56. package/dist/mocks.js +802 -735
  57. package/dist/mocks.js.map +1 -1
  58. package/dist/parseFromConfig-CMNGsef2.cjs +33 -0
  59. package/dist/parseFromConfig-CMNGsef2.cjs.map +1 -0
  60. package/dist/parseFromConfig-yAiFK03V.js +27 -0
  61. package/dist/parseFromConfig-yAiFK03V.js.map +1 -0
  62. package/dist/utils.cjs +58 -74
  63. package/dist/utils.cjs.map +1 -1
  64. package/dist/utils.d.cts +96 -42
  65. package/dist/utils.d.ts +96 -42
  66. package/dist/utils.js +47 -46
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +26 -34
  69. package/src/components/Operation.tsx +1 -2
  70. package/src/mocks/schemas.ts +39 -0
  71. package/src/utils/getBanner.ts +5 -5
  72. package/src/utils/getFooter.ts +4 -4
  73. package/dist/OperationGenerator-C7NPZtOM.d.ts +0 -288
  74. package/dist/OperationGenerator-DJE2XQ83.d.cts +0 -288
  75. package/dist/Schema-AjebpeVY.d.ts +0 -32
  76. package/dist/Schema-M6983FL1.d.cts +0 -32
  77. package/dist/SchemaMapper-B21ZmWag.d.cts +0 -275
  78. package/dist/SchemaMapper-B21ZmWag.d.ts +0 -275
  79. package/dist/chunk-6S7YFY6F.js +0 -33
  80. package/dist/chunk-6S7YFY6F.js.map +0 -1
  81. package/dist/chunk-76E35IZ2.js +0 -56
  82. package/dist/chunk-76E35IZ2.js.map +0 -1
  83. package/dist/chunk-7RFNM43R.cjs +0 -41
  84. package/dist/chunk-7RFNM43R.cjs.map +0 -1
  85. package/dist/chunk-DTD4ZUDA.cjs +0 -36
  86. package/dist/chunk-DTD4ZUDA.cjs.map +0 -1
  87. package/dist/chunk-G3FDK7YW.js +0 -35
  88. package/dist/chunk-G3FDK7YW.js.map +0 -1
  89. package/dist/chunk-JNN4JPWK.js +0 -28
  90. package/dist/chunk-JNN4JPWK.js.map +0 -1
  91. package/dist/chunk-MBX66JAT.js +0 -93
  92. package/dist/chunk-MBX66JAT.js.map +0 -1
  93. package/dist/chunk-NC5PWNEF.js +0 -866
  94. package/dist/chunk-NC5PWNEF.js.map +0 -1
  95. package/dist/chunk-PORSNYI5.js +0 -47
  96. package/dist/chunk-PORSNYI5.js.map +0 -1
  97. package/dist/chunk-QJMOOF2A.cjs +0 -97
  98. package/dist/chunk-QJMOOF2A.cjs.map +0 -1
  99. package/dist/chunk-RKHCI3WI.cjs +0 -1002
  100. package/dist/chunk-RKHCI3WI.cjs.map +0 -1
  101. package/dist/chunk-YWMMI3MO.cjs +0 -59
  102. package/dist/chunk-YWMMI3MO.cjs.map +0 -1
  103. package/dist/chunk-Z2NREI4X.cjs +0 -32
  104. package/dist/chunk-Z2NREI4X.cjs.map +0 -1
  105. package/dist/chunk-ZVFL3NXX.cjs +0 -50
  106. package/dist/chunk-ZVFL3NXX.cjs.map +0 -1
  107. package/dist/components.cjs.map +0 -1
  108. package/dist/components.js.map +0 -1
  109. package/dist/generators.cjs.map +0 -1
  110. package/dist/generators.js.map +0 -1
@@ -0,0 +1,60 @@
1
+ import { createContext } from "@kubb/react";
2
+ import { jsx } from "@kubb/react/jsx-runtime";
3
+
4
+ //#region src/components/Operation.tsx
5
+ const OperationContext = createContext({});
6
+ function Operation({ operation, children }) {
7
+ return /* @__PURE__ */ jsx(OperationContext.Provider, {
8
+ value: { operation },
9
+ children
10
+ });
11
+ }
12
+ Operation.Context = OperationContext;
13
+
14
+ //#endregion
15
+ //#region src/components/Schema.tsx
16
+ const SchemaContext = createContext({
17
+ name: "unknown",
18
+ tree: []
19
+ });
20
+ /**
21
+ * Provides schema-related context to descendant components.
22
+ *
23
+ * Wraps its children with a context containing the schema name, optional schema object, and an optional schema type tree.
24
+ *
25
+ * @param name - The name of the schema.
26
+ * @param schemaObject - The schema object to provide in context, if available.
27
+ * @param tree - An array representing the schema type hierarchy.
28
+ */
29
+ function Schema({ name, schemaObject, tree = [], children }) {
30
+ return /* @__PURE__ */ jsx(SchemaContext.Provider, {
31
+ value: {
32
+ name,
33
+ schemaObject,
34
+ tree
35
+ },
36
+ children
37
+ });
38
+ }
39
+ Schema.Context = SchemaContext;
40
+
41
+ //#endregion
42
+ //#region src/components/Oas.tsx
43
+ const OasContext = createContext({});
44
+ function Oas({ oas, children, operations, generator }) {
45
+ return /* @__PURE__ */ jsx(OasContext.Provider, {
46
+ value: {
47
+ oas,
48
+ generator,
49
+ operations
50
+ },
51
+ children
52
+ });
53
+ }
54
+ Oas.Context = OasContext;
55
+ Oas.Operation = Operation;
56
+ Oas.Schema = Schema;
57
+
58
+ //#endregion
59
+ export { Oas, Operation, Schema };
60
+ //# sourceMappingURL=Oas-CuqAnIw-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Oas-CuqAnIw-.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'\nimport type { KubbNode } from '@kubb/react/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) {\n return <OperationContext.Provider value={{ operation }}>{children}</OperationContext.Provider>\n}\n\nOperation.Context = OperationContext\n","import { createContext } from '@kubb/react'\n\nimport type { SchemaObject } from '@kubb/oas'\nimport type { Key, KubbNode } from '@kubb/react/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) {\n return <SchemaContext.Provider value={{ name, schemaObject, tree }}>{children}</SchemaContext.Provider>\n}\n\nSchema.Context = SchemaContext\n","import { createContext } from '@kubb/react'\n\nimport { Operation } from './Operation.tsx'\nimport { Schema } from './Schema.tsx'\n\nimport type { Oas as OasType, Operation as OperationType } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/types'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\n\ntype Props = {\n oas: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n children?: KubbNode\n}\n\ntype OasContextProps = {\n oas?: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n}\n\nconst OasContext = createContext<OasContextProps>({})\n\nexport function Oas({ oas, children, operations, generator }: Props) {\n return <OasContext.Provider value={{ oas, generator, operations }}>{children}</OasContext.Provider>\n}\n\nOas.Context = OasContext\nOas.Operation = Operation\nOas.Schema = Schema\n"],"mappings":";;;;AAaA,MAAM,mBAAmB,cAAqC,CAAE,EAAC;AAEjE,SAAgB,UAAU,EAAE,WAAW,UAAiB,EAAE;AACxD,4BAAQ,iBAAiB;EAAS,OAAO,EAAE,UAAW;EAAG;GAAqC;AAC/F;AAED,UAAU,UAAU;;;;ACCpB,MAAM,gBAAgB,cAAkC;CACtD,MAAM;CACN,MAAM,CAAE;AACT,EAAC;;;;;;;;;;AAWF,SAAgB,OAAO,EAAE,MAAM,cAAc,OAAO,CAAE,GAAE,UAAiB,EAAE;AACzE,4BAAQ,cAAc;EAAS,OAAO;GAAE;GAAM;GAAc;EAAM;EAAG;GAAkC;AACxG;AAED,OAAO,UAAU;;;;ACVjB,MAAM,aAAa,cAA+B,CAAE,EAAC;AAErD,SAAgB,IAAI,EAAE,KAAK,UAAU,YAAY,WAAkB,EAAE;AACnE,4BAAQ,WAAW;EAAS,OAAO;GAAE;GAAK;GAAW;EAAY;EAAG;GAA+B;AACpG;AAED,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,SAAS"}
@@ -0,0 +1,78 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const __kubb_react = require_chunk.__toESM(require("@kubb/react"));
3
+ const __kubb_react_jsx_runtime = require_chunk.__toESM(require("@kubb/react/jsx-runtime"));
4
+
5
+ //#region src/components/Operation.tsx
6
+ const OperationContext = (0, __kubb_react.createContext)({});
7
+ function Operation({ operation, children }) {
8
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(OperationContext.Provider, {
9
+ value: { operation },
10
+ children
11
+ });
12
+ }
13
+ Operation.Context = OperationContext;
14
+
15
+ //#endregion
16
+ //#region src/components/Schema.tsx
17
+ const SchemaContext = (0, __kubb_react.createContext)({
18
+ name: "unknown",
19
+ tree: []
20
+ });
21
+ /**
22
+ * Provides schema-related context to descendant components.
23
+ *
24
+ * Wraps its children with a context containing the schema name, optional schema object, and an optional schema type tree.
25
+ *
26
+ * @param name - The name of the schema.
27
+ * @param schemaObject - The schema object to provide in context, if available.
28
+ * @param tree - An array representing the schema type hierarchy.
29
+ */
30
+ function Schema({ name, schemaObject, tree = [], children }) {
31
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(SchemaContext.Provider, {
32
+ value: {
33
+ name,
34
+ schemaObject,
35
+ tree
36
+ },
37
+ children
38
+ });
39
+ }
40
+ Schema.Context = SchemaContext;
41
+
42
+ //#endregion
43
+ //#region src/components/Oas.tsx
44
+ const OasContext = (0, __kubb_react.createContext)({});
45
+ function Oas({ oas, children, operations, generator }) {
46
+ return /* @__PURE__ */ (0, __kubb_react_jsx_runtime.jsx)(OasContext.Provider, {
47
+ value: {
48
+ oas,
49
+ generator,
50
+ operations
51
+ },
52
+ children
53
+ });
54
+ }
55
+ Oas.Context = OasContext;
56
+ Oas.Operation = Operation;
57
+ Oas.Schema = Schema;
58
+
59
+ //#endregion
60
+ Object.defineProperty(exports, 'Oas', {
61
+ enumerable: true,
62
+ get: function () {
63
+ return Oas;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, 'Operation', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return Operation;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, 'Schema', {
73
+ enumerable: true,
74
+ get: function () {
75
+ return Schema;
76
+ }
77
+ });
78
+ //# sourceMappingURL=Oas-Cv_pyXRM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Oas-Cv_pyXRM.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'\nimport type { KubbNode } from '@kubb/react/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) {\n return <OperationContext.Provider value={{ operation }}>{children}</OperationContext.Provider>\n}\n\nOperation.Context = OperationContext\n","import { createContext } from '@kubb/react'\n\nimport type { SchemaObject } from '@kubb/oas'\nimport type { Key, KubbNode } from '@kubb/react/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) {\n return <SchemaContext.Provider value={{ name, schemaObject, tree }}>{children}</SchemaContext.Provider>\n}\n\nSchema.Context = SchemaContext\n","import { createContext } from '@kubb/react'\n\nimport { Operation } from './Operation.tsx'\nimport { Schema } from './Schema.tsx'\n\nimport type { Oas as OasType, Operation as OperationType } from '@kubb/oas'\nimport type { KubbNode } from '@kubb/react/types'\nimport type { OperationGenerator } from '../OperationGenerator.ts'\n\ntype Props = {\n oas: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n children?: KubbNode\n}\n\ntype OasContextProps = {\n oas?: OasType\n operations?: OperationType[]\n /**\n * @deprecated\n */\n generator?: Omit<OperationGenerator, 'build'>\n}\n\nconst OasContext = createContext<OasContextProps>({})\n\nexport function Oas({ oas, children, operations, generator }: Props) {\n return <OasContext.Provider value={{ oas, generator, operations }}>{children}</OasContext.Provider>\n}\n\nOas.Context = OasContext\nOas.Operation = Operation\nOas.Schema = Schema\n"],"mappings":";;;;;AAaA,MAAM,mDAAwD,CAAE,EAAC;AAEjE,SAAgB,UAAU,EAAE,WAAW,UAAiB,EAAE;AACxD,0DAAQ,iBAAiB;EAAS,OAAO,EAAE,UAAW;EAAG;GAAqC;AAC/F;AAED,UAAU,UAAU;;;;ACCpB,MAAM,gDAAkD;CACtD,MAAM;CACN,MAAM,CAAE;AACT,EAAC;;;;;;;;;;AAWF,SAAgB,OAAO,EAAE,MAAM,cAAc,OAAO,CAAE,GAAE,UAAiB,EAAE;AACzE,0DAAQ,cAAc;EAAS,OAAO;GAAE;GAAM;GAAc;EAAM;EAAG;GAAkC;AACxG;AAED,OAAO,UAAU;;;;ACVjB,MAAM,6CAA4C,CAAE,EAAC;AAErD,SAAgB,IAAI,EAAE,KAAK,UAAU,YAAY,WAAkB,EAAE;AACnE,0DAAQ,WAAW;EAAS,OAAO;GAAE;GAAK;GAAW;EAAY;EAAG;GAA+B;AACpG;AAED,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,SAAS"}