@kubb/agent 5.0.0-alpha.34 → 5.0.0-alpha.36

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 (183) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/server/chunks/nitro/nitro.mjs +1790 -20812
  3. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  4. package/.output/server/chunks/routes/api/health.get.mjs +16 -14
  5. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  6. package/.output/server/index.mjs +16 -14
  7. package/.output/server/index.mjs.map +1 -1
  8. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/constants.js +18 -0
  9. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/permessage-deflate.js +514 -0
  10. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/sender.js +602 -0
  11. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/stream.js +159 -0
  12. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket-server.js +540 -0
  13. package/.output/server/node_modules/.nitro/ws@8.18.0/lib/websocket.js +1388 -0
  14. package/.output/server/node_modules/.nitro/ws@8.18.0/package.json +69 -0
  15. package/.output/server/node_modules/.nitro/ws@8.18.0/wrapper.mjs +8 -0
  16. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/buffer-util.js +131 -0
  17. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/event-target.js +292 -0
  18. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/extension.js +203 -0
  19. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/limiter.js +55 -0
  20. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/receiver.js +706 -0
  21. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/subprotocol.js +62 -0
  22. package/.output/server/node_modules/.nitro/ws@8.20.0/lib/validation.js +152 -0
  23. package/.output/server/node_modules/@clack/core/dist/index.mjs +11 -0
  24. package/.output/server/node_modules/@clack/core/package.json +60 -0
  25. package/.output/server/node_modules/@clack/prompts/dist/index.mjs +137 -0
  26. package/.output/server/node_modules/@clack/prompts/package.json +65 -0
  27. package/.output/server/node_modules/@kubb/ast/dist/chunk--u3MIqq1.js +8 -0
  28. package/.output/server/node_modules/@kubb/ast/dist/index.js +423 -0
  29. package/.output/server/node_modules/@kubb/ast/package.json +70 -0
  30. package/.output/server/node_modules/@kubb/core/dist/chunk--u3MIqq1.js +8 -0
  31. package/.output/server/node_modules/@kubb/core/dist/hooks.js +23 -0
  32. package/.output/server/node_modules/@kubb/core/dist/index.js +2311 -0
  33. package/.output/server/node_modules/@kubb/core/package.json +109 -0
  34. package/.output/server/node_modules/@kubb/fabric-core/dist/chunk-O_arW02_.js +17 -0
  35. package/.output/server/node_modules/@kubb/fabric-core/dist/defaultParser-iCpMSYCp.js +15 -0
  36. package/.output/server/node_modules/@kubb/fabric-core/dist/getRelativePath-NAm_Y-vp.js +55 -0
  37. package/.output/server/node_modules/@kubb/fabric-core/dist/index.js +653 -0
  38. package/.output/server/node_modules/@kubb/fabric-core/dist/onProcessExit-Cput7j2c.js +742 -0
  39. package/.output/server/node_modules/@kubb/fabric-core/dist/parsers/typescript.js +101 -0
  40. package/.output/server/node_modules/@kubb/fabric-core/dist/parsers.js +17 -0
  41. package/.output/server/node_modules/@kubb/fabric-core/dist/plugins.js +375 -0
  42. package/.output/server/node_modules/@kubb/fabric-core/package.json +111 -0
  43. package/.output/server/node_modules/@kubb/oas/dist/chunk--u3MIqq1.js +8 -0
  44. package/.output/server/node_modules/@kubb/oas/dist/index.js +918 -0
  45. package/.output/server/node_modules/@kubb/oas/package.json +94 -0
  46. package/.output/server/node_modules/@kubb/plugin-client/dist/StaticClassClient-bCe7RG_w.js +636 -0
  47. package/.output/server/node_modules/@kubb/plugin-client/dist/chunk--u3MIqq1.js +8 -0
  48. package/.output/server/node_modules/@kubb/plugin-client/dist/components.js +2 -0
  49. package/.output/server/node_modules/@kubb/plugin-client/dist/generators-BffddRNu.js +723 -0
  50. package/.output/server/node_modules/@kubb/plugin-client/dist/index.js +124 -0
  51. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/axios.source.js +6 -0
  52. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/clients/fetch.source.js +6 -0
  53. package/.output/server/node_modules/@kubb/plugin-client/dist/templates/config.source.js +6 -0
  54. package/.output/server/node_modules/@kubb/plugin-client/package.json +153 -0
  55. package/.output/server/node_modules/@kubb/plugin-cypress/dist/chunk--u3MIqq1.js +8 -0
  56. package/.output/server/node_modules/@kubb/plugin-cypress/dist/components-BK_6GU4v.js +257 -0
  57. package/.output/server/node_modules/@kubb/plugin-cypress/dist/generators-D5YFtyyC.js +71 -0
  58. package/.output/server/node_modules/@kubb/plugin-cypress/dist/index.js +79 -0
  59. package/.output/server/node_modules/@kubb/plugin-cypress/package.json +108 -0
  60. package/.output/server/node_modules/@kubb/plugin-faker/dist/chunk--u3MIqq1.js +8 -0
  61. package/.output/server/node_modules/@kubb/plugin-faker/dist/components-BkBIov4R.js +419 -0
  62. package/.output/server/node_modules/@kubb/plugin-faker/dist/fakerGenerator-BztogaeO.js +200 -0
  63. package/.output/server/node_modules/@kubb/plugin-faker/dist/index.js +141 -0
  64. package/.output/server/node_modules/@kubb/plugin-faker/package.json +103 -0
  65. package/.output/server/node_modules/@kubb/plugin-mcp/dist/Server-H3SwqhwF.js +178 -0
  66. package/.output/server/node_modules/@kubb/plugin-mcp/dist/chunk--u3MIqq1.js +8 -0
  67. package/.output/server/node_modules/@kubb/plugin-mcp/dist/generators-BqkMrcs9.js +274 -0
  68. package/.output/server/node_modules/@kubb/plugin-mcp/dist/index.js +122 -0
  69. package/.output/server/node_modules/@kubb/plugin-mcp/package.json +107 -0
  70. package/.output/server/node_modules/@kubb/plugin-msw/dist/chunk--u3MIqq1.js +8 -0
  71. package/.output/server/node_modules/@kubb/plugin-msw/dist/components-DgtTZkWX.js +277 -0
  72. package/.output/server/node_modules/@kubb/plugin-msw/dist/generators-C34kqa1L.js +161 -0
  73. package/.output/server/node_modules/@kubb/plugin-msw/dist/index.js +84 -0
  74. package/.output/server/node_modules/@kubb/plugin-msw/package.json +109 -0
  75. package/.output/server/node_modules/@kubb/plugin-oas/dist/SchemaMapper-CqMkO2T1.js +58 -0
  76. package/.output/server/node_modules/@kubb/plugin-oas/dist/chunk--u3MIqq1.js +8 -0
  77. package/.output/server/node_modules/@kubb/plugin-oas/dist/generators-D7C3CXsN.js +79 -0
  78. package/.output/server/node_modules/@kubb/plugin-oas/dist/generators.js +2 -0
  79. package/.output/server/node_modules/@kubb/plugin-oas/dist/getFooter-Pw3tLCiV.js +112 -0
  80. package/.output/server/node_modules/@kubb/plugin-oas/dist/hooks.js +200 -0
  81. package/.output/server/node_modules/@kubb/plugin-oas/dist/index.js +408 -0
  82. package/.output/server/node_modules/@kubb/plugin-oas/dist/requestBody-pRavthCw.js +1336 -0
  83. package/.output/server/node_modules/@kubb/plugin-oas/dist/utils.js +268 -0
  84. package/.output/server/node_modules/@kubb/plugin-oas/package.json +122 -0
  85. package/.output/server/node_modules/@kubb/plugin-react-query/dist/chunk--u3MIqq1.js +8 -0
  86. package/.output/server/node_modules/@kubb/plugin-react-query/dist/components-CpyHYGOw.js +1520 -0
  87. package/.output/server/node_modules/@kubb/plugin-react-query/dist/generators-CpiBv5eE.js +1427 -0
  88. package/.output/server/node_modules/@kubb/plugin-react-query/dist/index.js +166 -0
  89. package/.output/server/node_modules/@kubb/plugin-react-query/package.json +112 -0
  90. package/.output/server/node_modules/@kubb/plugin-redoc/dist/chunk--u3MIqq1.js +8 -0
  91. package/.output/server/node_modules/@kubb/plugin-redoc/dist/index.js +65 -0
  92. package/.output/server/node_modules/@kubb/plugin-redoc/package.json +85 -0
  93. package/.output/server/node_modules/@kubb/plugin-redoc/static/redoc.hbs +22 -0
  94. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/chunk--u3MIqq1.js +8 -0
  95. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/components-BhStIi1M.js +665 -0
  96. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/generators-CQClzsST.js +415 -0
  97. package/.output/server/node_modules/@kubb/plugin-solid-query/dist/index.js +145 -0
  98. package/.output/server/node_modules/@kubb/plugin-solid-query/package.json +113 -0
  99. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/chunk--u3MIqq1.js +8 -0
  100. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/components-DntKBsnB.js +666 -0
  101. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/generators-BtTsGGrM.js +414 -0
  102. package/.output/server/node_modules/@kubb/plugin-svelte-query/dist/index.js +145 -0
  103. package/.output/server/node_modules/@kubb/plugin-svelte-query/package.json +113 -0
  104. package/.output/server/node_modules/@kubb/plugin-swr/dist/chunk--u3MIqq1.js +8 -0
  105. package/.output/server/node_modules/@kubb/plugin-swr/dist/components-DRDGvgXG.js +702 -0
  106. package/.output/server/node_modules/@kubb/plugin-swr/dist/generators-ClWZJ-YG.js +399 -0
  107. package/.output/server/node_modules/@kubb/plugin-swr/dist/index.js +144 -0
  108. package/.output/server/node_modules/@kubb/plugin-swr/package.json +115 -0
  109. package/.output/server/node_modules/@kubb/plugin-ts/dist/chunk--u3MIqq1.js +8 -0
  110. package/.output/server/node_modules/@kubb/plugin-ts/dist/components-C7fu-sK1.js +723 -0
  111. package/.output/server/node_modules/@kubb/plugin-ts/dist/index.js +2 -0
  112. package/.output/server/node_modules/@kubb/plugin-ts/dist/plugin-CYC-FGXe.js +479 -0
  113. package/.output/server/node_modules/@kubb/plugin-ts/package.json +105 -0
  114. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/chunk--u3MIqq1.js +8 -0
  115. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/components-_AMBl0g-.js +1029 -0
  116. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/generators-Zb1s5Wmb.js +661 -0
  117. package/.output/server/node_modules/@kubb/plugin-vue-query/dist/index.js +157 -0
  118. package/.output/server/node_modules/@kubb/plugin-vue-query/package.json +114 -0
  119. package/.output/server/node_modules/@kubb/plugin-zod/dist/chunk--u3MIqq1.js +8 -0
  120. package/.output/server/node_modules/@kubb/plugin-zod/dist/components-eECfXVou.js +842 -0
  121. package/.output/server/node_modules/@kubb/plugin-zod/dist/generators-D1R6NNf2.js +290 -0
  122. package/.output/server/node_modules/@kubb/plugin-zod/dist/index.js +175 -0
  123. package/.output/server/node_modules/@kubb/plugin-zod/dist/templates/ToZod.source.js +6 -0
  124. package/.output/server/node_modules/@kubb/plugin-zod/package.json +112 -0
  125. package/.output/server/node_modules/@kubb/react-fabric/dist/chunk-BGCRLu6H.js +38 -0
  126. package/.output/server/node_modules/@kubb/react-fabric/dist/index.js +525 -0
  127. package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime-Bl0DfUmV.js +1448 -0
  128. package/.output/server/node_modules/@kubb/react-fabric/dist/jsx-runtime.js +12 -0
  129. package/.output/server/node_modules/@kubb/react-fabric/dist/parsers.js +2 -0
  130. package/.output/server/node_modules/@kubb/react-fabric/dist/plugins.js +4 -0
  131. package/.output/server/node_modules/@kubb/react-fabric/dist/reactPlugin-QQPrjNuQ.js +17813 -0
  132. package/.output/server/node_modules/@kubb/react-fabric/package.json +143 -0
  133. package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +11 -1
  134. package/.output/server/node_modules/@redocly/config/package.json +1 -1
  135. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +25 -10
  136. package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +32 -29
  137. package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +5 -0
  138. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
  139. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +47 -38
  140. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
  141. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +45 -41
  142. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +3 -1
  143. package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +41 -55
  144. package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +28 -16
  145. package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
  146. package/.output/server/node_modules/buffer-from/index.js +72 -0
  147. package/.output/server/node_modules/buffer-from/package.json +19 -0
  148. package/.output/server/node_modules/fast-string-truncated-width/dist/index.js +171 -0
  149. package/.output/server/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
  150. package/.output/server/node_modules/fast-string-truncated-width/package.json +35 -0
  151. package/.output/server/node_modules/fast-string-width/dist/index.js +14 -0
  152. package/.output/server/node_modules/fast-string-width/package.json +34 -0
  153. package/.output/server/node_modules/fast-wrap-ansi/lib/main.js +216 -0
  154. package/.output/server/node_modules/fast-wrap-ansi/package.json +51 -0
  155. package/.output/server/node_modules/p-limit/index.js +127 -0
  156. package/.output/server/node_modules/p-limit/package.json +58 -0
  157. package/.output/server/node_modules/react-devtools-core/dist/backend.js +18302 -0
  158. package/.output/server/node_modules/react-devtools-core/package.json +38 -0
  159. package/.output/server/node_modules/sisteransi/package.json +34 -0
  160. package/.output/server/node_modules/sisteransi/src/index.js +58 -0
  161. package/.output/server/node_modules/source-map-support/package.json +31 -0
  162. package/.output/server/node_modules/source-map-support/source-map-support.js +625 -0
  163. package/.output/server/node_modules/typescript/lib/typescript.js +200276 -0
  164. package/.output/server/node_modules/typescript/package.json +120 -0
  165. package/.output/server/node_modules/yocto-queue/index.js +90 -0
  166. package/.output/server/node_modules/yocto-queue/package.json +48 -0
  167. package/.output/server/package.json +35 -4
  168. package/package.json +20 -20
  169. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/buffer-util.js +0 -0
  170. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/event-target.js +0 -0
  171. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/extension.js +0 -0
  172. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/limiter.js +0 -0
  173. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/receiver.js +0 -0
  174. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/subprotocol.js +0 -0
  175. /package/.output/server/node_modules/{ws → .nitro/ws@8.18.0}/lib/validation.js +0 -0
  176. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/constants.js +0 -0
  177. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/permessage-deflate.js +0 -0
  178. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/sender.js +0 -0
  179. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/stream.js +0 -0
  180. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket-server.js +0 -0
  181. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/lib/websocket.js +0 -0
  182. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/package.json +0 -0
  183. /package/.output/server/node_modules/{ws → .nitro/ws@8.20.0}/wrapper.mjs +0 -0
@@ -0,0 +1,268 @@
1
+ import "./chunk--u3MIqq1.js";
2
+ import { n as getBanner, r as camelCase, t as getFooter } from "./getFooter-Pw3tLCiV.js";
3
+ import { n as withRequiredRequestBodySchema, r as SchemaGenerator, s as getSchemaFactory, t as isRequestBodyRequired } from "./requestBody-pRavthCw.js";
4
+ import { n as schemaKeywords } from "./SchemaMapper-CqMkO2T1.js";
5
+ import { isOptional } from "@kubb/oas";
6
+ //#region ../../internals/utils/src/reserved.ts
7
+ /**
8
+ * Returns `true` when `name` is a syntactically valid JavaScript variable name.
9
+ */
10
+ function isValidVarName(name) {
11
+ try {
12
+ new Function(`var ${name}`);
13
+ } catch {
14
+ return false;
15
+ }
16
+ return true;
17
+ }
18
+ //#endregion
19
+ //#region ../../internals/utils/src/urlPath.ts
20
+ /**
21
+ * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
22
+ *
23
+ * @example
24
+ * const p = new URLPath('/pet/{petId}')
25
+ * p.URL // '/pet/:petId'
26
+ * p.template // '`/pet/${petId}`'
27
+ */
28
+ var URLPath = class {
29
+ /** The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`. */
30
+ path;
31
+ #options;
32
+ constructor(path, options = {}) {
33
+ this.path = path;
34
+ this.#options = options;
35
+ }
36
+ /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
37
+ get URL() {
38
+ return this.toURLPath();
39
+ }
40
+ /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`). */
41
+ get isURL() {
42
+ try {
43
+ return !!new URL(this.path).href;
44
+ } catch {
45
+ return false;
46
+ }
47
+ }
48
+ /**
49
+ * Converts the OpenAPI path to a TypeScript template literal string.
50
+ *
51
+ * @example
52
+ * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
53
+ * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
54
+ */
55
+ get template() {
56
+ return this.toTemplateString();
57
+ }
58
+ /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set. */
59
+ get object() {
60
+ return this.toObject();
61
+ }
62
+ /** Returns a map of path parameter names, or `undefined` when the path has no parameters. */
63
+ get params() {
64
+ return this.getParams();
65
+ }
66
+ #transformParam(raw) {
67
+ const param = isValidVarName(raw) ? raw : camelCase(raw);
68
+ return this.#options.casing === "camelcase" ? camelCase(param) : param;
69
+ }
70
+ /** Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name. */
71
+ #eachParam(fn) {
72
+ for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
73
+ const raw = match[1];
74
+ fn(raw, this.#transformParam(raw));
75
+ }
76
+ }
77
+ toObject({ type = "path", replacer, stringify } = {}) {
78
+ const object = {
79
+ url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
80
+ params: this.getParams()
81
+ };
82
+ if (stringify) {
83
+ if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
84
+ if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
85
+ return `{ url: '${object.url}' }`;
86
+ }
87
+ return object;
88
+ }
89
+ /**
90
+ * Converts the OpenAPI path to a TypeScript template literal string.
91
+ * An optional `replacer` can transform each extracted parameter name before interpolation.
92
+ *
93
+ * @example
94
+ * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
95
+ */
96
+ toTemplateString({ prefix = "", replacer } = {}) {
97
+ return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
98
+ if (i % 2 === 0) return part;
99
+ const param = this.#transformParam(part);
100
+ return `\${${replacer ? replacer(param) : param}}`;
101
+ }).join("")}\``;
102
+ }
103
+ /**
104
+ * Extracts all `{param}` segments from the path and returns them as a key-value map.
105
+ * An optional `replacer` transforms each parameter name in both key and value positions.
106
+ * Returns `undefined` when no path parameters are found.
107
+ */
108
+ getParams(replacer) {
109
+ const params = {};
110
+ this.#eachParam((_raw, param) => {
111
+ const key = replacer ? replacer(param) : param;
112
+ params[key] = key;
113
+ });
114
+ return Object.keys(params).length > 0 ? params : void 0;
115
+ }
116
+ /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
117
+ toURLPath() {
118
+ return this.path.replace(/\{([^}]+)\}/g, ":$1");
119
+ }
120
+ };
121
+ //#endregion
122
+ //#region src/utils/getComments.ts
123
+ function getComments(operation) {
124
+ return [
125
+ operation.getDescription() && `@description ${operation.getDescription()}`,
126
+ operation.getSummary() && `@summary ${operation.getSummary()}`,
127
+ operation.path && `{@link ${new URLPath(operation.path).URL}}`,
128
+ operation.isDeprecated() && "@deprecated"
129
+ ].filter((x) => Boolean(x)).flatMap((text) => {
130
+ return text.split(/\r?\n/).map((line) => line.trim());
131
+ }).filter((x) => Boolean(x));
132
+ }
133
+ //#endregion
134
+ //#region src/utils/getImports.ts
135
+ /**
136
+ * Get imports from a schema tree by extracting all ref schemas that are importable
137
+ */
138
+ function getImports(tree) {
139
+ const refs = SchemaGenerator.deepSearch(tree, schemaKeywords.ref);
140
+ if (!refs) return [];
141
+ return refs.map((item) => {
142
+ if (!item.args.path || !item.args.isImportable) return;
143
+ return {
144
+ name: [item.args.name],
145
+ path: item.args.path
146
+ };
147
+ }).filter((x) => x !== void 0);
148
+ }
149
+ //#endregion
150
+ //#region src/utils/getParams.ts
151
+ /**
152
+ *
153
+ * @deprecated
154
+ * TODO move to operationManager hook
155
+ */
156
+ function getASTParams(operationSchema, { typed = false, casing, override } = {}) {
157
+ if (!operationSchema || !operationSchema.schema.properties || !operationSchema.name) return [];
158
+ const requiredFields = Array.isArray(operationSchema.schema.required) ? operationSchema.schema.required : [];
159
+ return Object.entries(operationSchema.schema.properties).map(([name]) => {
160
+ const accessName = casing === "camelcase" ? camelCase(name) : name;
161
+ const data = {
162
+ name,
163
+ enabled: !!name,
164
+ required: requiredFields.includes(name),
165
+ type: typed ? `${operationSchema.name}["${accessName}"]` : void 0
166
+ };
167
+ return override ? override(data) : data;
168
+ });
169
+ }
170
+ function getPathParams(operationSchema, options = {}) {
171
+ return getASTParams(operationSchema, options).reduce((acc, curr) => {
172
+ if (curr.name && curr.enabled) {
173
+ let name = curr.name;
174
+ if (options.casing === "camelcase") name = camelCase(name);
175
+ else if (!isValidVarName(name)) name = camelCase(name);
176
+ acc[name] = {
177
+ default: curr.default,
178
+ type: curr.type,
179
+ optional: !curr.required
180
+ };
181
+ }
182
+ return acc;
183
+ }, {});
184
+ }
185
+ /**
186
+ * Get a mapping of camelCase parameter names to their original names
187
+ * Used for mapping function parameters to backend parameter names
188
+ */
189
+ function getParamsMapping(operationSchema, options = {}) {
190
+ if (!operationSchema || !operationSchema.schema.properties) return;
191
+ const allEntries = [];
192
+ let hasTransformation = false;
193
+ Object.entries(operationSchema.schema.properties).forEach(([originalName]) => {
194
+ let transformedName = originalName;
195
+ if (options.casing === "camelcase") transformedName = camelCase(originalName);
196
+ else if (!isValidVarName(originalName)) transformedName = camelCase(originalName);
197
+ allEntries.push([originalName, transformedName]);
198
+ if (transformedName !== originalName) hasTransformation = true;
199
+ });
200
+ if (options.casing === "camelcase" && hasTransformation) return Object.fromEntries(allEntries);
201
+ const mapping = {};
202
+ allEntries.forEach(([originalName, transformedName]) => {
203
+ if (transformedName !== originalName) mapping[originalName] = transformedName;
204
+ });
205
+ return Object.keys(mapping).length > 0 ? mapping : void 0;
206
+ }
207
+ //#endregion
208
+ //#region src/utils/getSchemas.ts
209
+ /**
210
+ * Collect schemas from OpenAPI components (schemas, responses, requestBodies)
211
+ * and return them in dependency order along with name mapping for collision resolution.
212
+ *
213
+ * This function is a wrapper around the oas.getSchemas() method for backward compatibility.
214
+ * New code should use oas.getSchemas() directly.
215
+ *
216
+ * @deprecated Use oas.getSchemas() instead
217
+ */
218
+ function getSchemas({ oas, contentType, includes = [
219
+ "schemas",
220
+ "requestBodies",
221
+ "responses"
222
+ ], collisionDetection }) {
223
+ return oas.getSchemas({
224
+ contentType,
225
+ includes,
226
+ collisionDetection
227
+ });
228
+ }
229
+ //#endregion
230
+ //#region src/utils/paramsCasing.ts
231
+ /**
232
+ * Apply casing transformation to schema properties
233
+ * Only transforms property names, not nested schemas
234
+ */
235
+ function applyParamsCasing(schema, casing) {
236
+ if (!casing || !schema.properties) return schema;
237
+ const transformedProperties = {};
238
+ const transformedRequired = [];
239
+ Object.entries(schema.properties).forEach(([originalName, propertySchema]) => {
240
+ let transformedName = originalName;
241
+ if (casing === "camelcase") transformedName = camelCase(originalName);
242
+ else if (!isValidVarName(originalName)) transformedName = camelCase(originalName);
243
+ transformedProperties[transformedName] = propertySchema;
244
+ });
245
+ if (Array.isArray(schema.required)) schema.required.forEach((originalName) => {
246
+ let transformedName = originalName;
247
+ if (casing === "camelcase") transformedName = camelCase(originalName);
248
+ else if (!isValidVarName(originalName)) transformedName = camelCase(originalName);
249
+ transformedRequired.push(transformedName);
250
+ });
251
+ return {
252
+ ...schema,
253
+ properties: transformedProperties,
254
+ ...transformedRequired.length > 0 && { required: transformedRequired }
255
+ };
256
+ }
257
+ /**
258
+ * Check if this schema is a parameter schema (pathParams, queryParams, or headerParams)
259
+ * Only these should be transformed, not response/data/body
260
+ */
261
+ function isParameterSchema(schemaName) {
262
+ const lowerName = schemaName.toLowerCase();
263
+ return lowerName.includes("pathparams") || lowerName.includes("queryparams") || lowerName.includes("headerparams");
264
+ }
265
+ //#endregion
266
+ export { applyParamsCasing, getBanner, getComments, getFooter, getImports, getParamsMapping, getPathParams, getSchemaFactory, getSchemas, isOptional, isParameterSchema, isRequestBodyRequired, withRequiredRequestBodySchema };
267
+
268
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,122 @@
1
+ {
2
+ "name": "@kubb/plugin-oas",
3
+ "version": "4.37.2",
4
+ "description": "OpenAPI Specification (OAS) plugin for Kubb, providing core functionality for parsing and processing OpenAPI/Swagger schemas for code generation.",
5
+ "keywords": [
6
+ "openapi",
7
+ "swagger",
8
+ "oas",
9
+ "openapi-v3",
10
+ "api-specification",
11
+ "schema-processing",
12
+ "schema-parser",
13
+ "rest-api",
14
+ "typescript",
15
+ "code-generator",
16
+ "codegen",
17
+ "plugins",
18
+ "kubb"
19
+ ],
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/kubb-labs/kubb.git",
23
+ "directory": "packages/plugin-oas"
24
+ },
25
+ "license": "MIT",
26
+ "author": "stijnvanhulle",
27
+ "sideEffects": false,
28
+ "type": "module",
29
+ "exports": {
30
+ ".": {
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./generators": {
35
+ "import": "./dist/generators.js",
36
+ "require": "./dist/generators.cjs"
37
+ },
38
+ "./hooks": {
39
+ "import": "./dist/hooks.js",
40
+ "require": "./dist/hooks.cjs"
41
+ },
42
+ "./mocks": {
43
+ "import": "./dist/mocks.js",
44
+ "require": "./dist/mocks.cjs"
45
+ },
46
+ "./utils": {
47
+ "import": "./dist/utils.js",
48
+ "require": "./dist/utils.cjs"
49
+ },
50
+ "./package.json": "./package.json"
51
+ },
52
+ "types": "./dist/index.d.ts",
53
+ "typesVersions": {
54
+ "*": {
55
+ "utils": [
56
+ "./dist/utils.d.ts"
57
+ ],
58
+ "hooks": [
59
+ "./dist/hooks.d.ts"
60
+ ],
61
+ "mocks": [
62
+ "./dist/mocks.d.ts"
63
+ ],
64
+ "generators": [
65
+ "./dist/generators.d.ts"
66
+ ]
67
+ }
68
+ },
69
+ "files": [
70
+ "src",
71
+ "dist",
72
+ "!/**/**.test.**",
73
+ "!/**/__tests__/**",
74
+ "!/**/__snapshots__/**"
75
+ ],
76
+ "size-limit": [
77
+ {
78
+ "path": "./dist/*.js",
79
+ "limit": "510 KiB",
80
+ "gzip": true
81
+ }
82
+ ],
83
+ "dependencies": {
84
+ "@kubb/fabric-core": "0.14.0",
85
+ "@kubb/react-fabric": "0.14.0",
86
+ "remeda": "^2.33.6",
87
+ "@kubb/core": "4.37.2",
88
+ "@kubb/oas": "4.37.2"
89
+ },
90
+ "peerDependencies": {
91
+ "@kubb/fabric-core": "0.14.0",
92
+ "@kubb/react-fabric": "0.14.0"
93
+ },
94
+ "engines": {
95
+ "node": ">=20"
96
+ },
97
+ "publishConfig": {
98
+ "access": "public",
99
+ "registry": "https://registry.npmjs.org/"
100
+ },
101
+ "devDependencies": {
102
+ "p-limit": "^7.3.0",
103
+ "@internals/utils": "0.0.0"
104
+ },
105
+ "main": "./dist/index.cjs",
106
+ "module": "./dist/index.js",
107
+ "inlinedDependencies": {
108
+ "p-limit": "7.3.0",
109
+ "yocto-queue": "1.2.2"
110
+ },
111
+ "scripts": {
112
+ "build": "tsdown && size-limit",
113
+ "clean": "npx rimraf ./dist",
114
+ "lint": "bun biome lint .",
115
+ "lint:fix": "bun biome lint --fix --unsafe .",
116
+ "release": "pnpm publish --no-git-check",
117
+ "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
118
+ "start": "tsdown --watch",
119
+ "test": "vitest --passWithNoTests",
120
+ "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
121
+ }
122
+ }
@@ -0,0 +1,8 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", {
4
+ value,
5
+ configurable: true
6
+ });
7
+ //#endregion
8
+ export { __name as t };