@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,665 @@
1
+ import { t as __name } from "./chunk--u3MIqq1.js";
2
+ import { isAllOptional, isOptional } from "@kubb/oas";
3
+ import { Client } from "@kubb/plugin-client/components";
4
+ import { getComments, getPathParams } from "@kubb/plugin-oas/utils";
5
+ import { File, Function as Function$1, FunctionParams, Type } from "@kubb/react-fabric";
6
+ import { Fragment, jsx, jsxs } from "@kubb/react-fabric/jsx-runtime";
7
+ //#region ../../internals/utils/src/casing.ts
8
+ /**
9
+ * Shared implementation for camelCase and PascalCase conversion.
10
+ * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
11
+ * and capitalizes each word according to `pascal`.
12
+ *
13
+ * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
14
+ */
15
+ function toCamelOrPascal(text, pascal) {
16
+ return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
17
+ if (word.length > 1 && word === word.toUpperCase()) return word;
18
+ if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
19
+ return word.charAt(0).toUpperCase() + word.slice(1);
20
+ }).join("").replace(/[^a-zA-Z0-9]/g, "");
21
+ }
22
+ /**
23
+ * Splits `text` on `.` and applies `transformPart` to each segment.
24
+ * The last segment receives `isLast = true`, all earlier segments receive `false`.
25
+ * Segments are joined with `/` to form a file path.
26
+ */
27
+ function applyToFileParts(text, transformPart) {
28
+ const parts = text.split(".");
29
+ return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
30
+ }
31
+ /**
32
+ * Converts `text` to camelCase.
33
+ * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
34
+ *
35
+ * @example
36
+ * camelCase('hello-world') // 'helloWorld'
37
+ * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
38
+ */
39
+ function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
40
+ if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
41
+ prefix,
42
+ suffix
43
+ } : {}));
44
+ return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
45
+ }
46
+ /**
47
+ * Converts `text` to PascalCase.
48
+ * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.
49
+ *
50
+ * @example
51
+ * pascalCase('hello-world') // 'HelloWorld'
52
+ * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'
53
+ */
54
+ function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
55
+ if (isFile) return applyToFileParts(text, (part, isLast) => isLast ? pascalCase(part, {
56
+ prefix,
57
+ suffix
58
+ }) : camelCase(part));
59
+ return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
60
+ }
61
+ //#endregion
62
+ //#region ../../internals/utils/src/reserved.ts
63
+ /**
64
+ * Returns `true` when `name` is a syntactically valid JavaScript variable name.
65
+ */
66
+ function isValidVarName(name) {
67
+ try {
68
+ new Function(`var ${name}`);
69
+ } catch {
70
+ return false;
71
+ }
72
+ return true;
73
+ }
74
+ //#endregion
75
+ //#region ../../internals/utils/src/urlPath.ts
76
+ /**
77
+ * Parses and transforms an OpenAPI/Swagger path string into various URL formats.
78
+ *
79
+ * @example
80
+ * const p = new URLPath('/pet/{petId}')
81
+ * p.URL // '/pet/:petId'
82
+ * p.template // '`/pet/${petId}`'
83
+ */
84
+ var URLPath = class {
85
+ /** The raw OpenAPI/Swagger path string, e.g. `/pet/{petId}`. */
86
+ path;
87
+ #options;
88
+ constructor(path, options = {}) {
89
+ this.path = path;
90
+ this.#options = options;
91
+ }
92
+ /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
93
+ get URL() {
94
+ return this.toURLPath();
95
+ }
96
+ /** Returns `true` when `path` is a fully-qualified URL (e.g. starts with `https://`). */
97
+ get isURL() {
98
+ try {
99
+ return !!new URL(this.path).href;
100
+ } catch {
101
+ return false;
102
+ }
103
+ }
104
+ /**
105
+ * Converts the OpenAPI path to a TypeScript template literal string.
106
+ *
107
+ * @example
108
+ * new URLPath('/pet/{petId}').template // '`/pet/${petId}`'
109
+ * new URLPath('/account/monetary-accountID').template // '`/account/${monetaryAccountId}`'
110
+ */
111
+ get template() {
112
+ return this.toTemplateString();
113
+ }
114
+ /** Returns the path and its extracted params as a structured `URLObject`, or as a stringified expression when `stringify` is set. */
115
+ get object() {
116
+ return this.toObject();
117
+ }
118
+ /** Returns a map of path parameter names, or `undefined` when the path has no parameters. */
119
+ get params() {
120
+ return this.getParams();
121
+ }
122
+ #transformParam(raw) {
123
+ const param = isValidVarName(raw) ? raw : camelCase(raw);
124
+ return this.#options.casing === "camelcase" ? camelCase(param) : param;
125
+ }
126
+ /** Iterates over every `{param}` token in `path`, calling `fn` with the raw token and transformed name. */
127
+ #eachParam(fn) {
128
+ for (const match of this.path.matchAll(/\{([^}]+)\}/g)) {
129
+ const raw = match[1];
130
+ fn(raw, this.#transformParam(raw));
131
+ }
132
+ }
133
+ toObject({ type = "path", replacer, stringify } = {}) {
134
+ const object = {
135
+ url: type === "path" ? this.toURLPath() : this.toTemplateString({ replacer }),
136
+ params: this.getParams()
137
+ };
138
+ if (stringify) {
139
+ if (type === "template") return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
140
+ if (object.params) return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
141
+ return `{ url: '${object.url}' }`;
142
+ }
143
+ return object;
144
+ }
145
+ /**
146
+ * Converts the OpenAPI path to a TypeScript template literal string.
147
+ * An optional `replacer` can transform each extracted parameter name before interpolation.
148
+ *
149
+ * @example
150
+ * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
151
+ */
152
+ toTemplateString({ prefix = "", replacer } = {}) {
153
+ return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
154
+ if (i % 2 === 0) return part;
155
+ const param = this.#transformParam(part);
156
+ return `\${${replacer ? replacer(param) : param}}`;
157
+ }).join("")}\``;
158
+ }
159
+ /**
160
+ * Extracts all `{param}` segments from the path and returns them as a key-value map.
161
+ * An optional `replacer` transforms each parameter name in both key and value positions.
162
+ * Returns `undefined` when no path parameters are found.
163
+ */
164
+ getParams(replacer) {
165
+ const params = {};
166
+ this.#eachParam((_raw, param) => {
167
+ const key = replacer ? replacer(param) : param;
168
+ params[key] = key;
169
+ });
170
+ return Object.keys(params).length > 0 ? params : void 0;
171
+ }
172
+ /** Converts the OpenAPI path to Express-style colon syntax, e.g. `/pet/{petId}` → `/pet/:petId`. */
173
+ toURLPath() {
174
+ return this.path.replace(/\{([^}]+)\}/g, ":$1");
175
+ }
176
+ };
177
+ //#endregion
178
+ //#region ../../internals/tanstack-query/src/components/MutationKey.tsx
179
+ function getParams$4({}) {
180
+ return FunctionParams.factory({});
181
+ }
182
+ __name(getParams$4, "getParams");
183
+ const getTransformer$1 = /* @__PURE__ */ __name(({ operation, casing }) => {
184
+ return [`{ url: '${new URLPath(operation.path, { casing }).toURLPath()}' }`];
185
+ }, "getTransformer");
186
+ function MutationKey({ name, typeSchemas, pathParamsType, paramsCasing, operation, typeName, transformer = getTransformer$1 }) {
187
+ const params = getParams$4({
188
+ pathParamsType,
189
+ typeSchemas
190
+ });
191
+ const keys = transformer({
192
+ operation,
193
+ schemas: typeSchemas,
194
+ casing: paramsCasing
195
+ });
196
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(File.Source, {
197
+ name,
198
+ isExportable: true,
199
+ isIndexable: true,
200
+ children: /* @__PURE__ */ jsx(Function$1.Arrow, {
201
+ name,
202
+ export: true,
203
+ params: params.toConstructor(),
204
+ singleLine: true,
205
+ children: `[${keys.join(", ")}] as const`
206
+ })
207
+ }), /* @__PURE__ */ jsx(File.Source, {
208
+ name: typeName,
209
+ isExportable: true,
210
+ isIndexable: true,
211
+ isTypeOnly: true,
212
+ children: /* @__PURE__ */ jsx(Type, {
213
+ name: typeName,
214
+ export: true,
215
+ children: `ReturnType<typeof ${name}>`
216
+ })
217
+ })] });
218
+ }
219
+ MutationKey.getParams = getParams$4;
220
+ MutationKey.getTransformer = getTransformer$1;
221
+ //#endregion
222
+ //#region ../../internals/tanstack-query/src/components/QueryKey.tsx
223
+ function getParams$3({ pathParamsType, paramsCasing, typeSchemas }) {
224
+ return FunctionParams.factory({
225
+ pathParams: typeSchemas.pathParams?.name ? {
226
+ mode: pathParamsType === "object" ? "object" : "inlineSpread",
227
+ children: getPathParams(typeSchemas.pathParams, {
228
+ typed: true,
229
+ casing: paramsCasing
230
+ })
231
+ } : void 0,
232
+ data: typeSchemas.request?.name ? {
233
+ type: typeSchemas.request?.name,
234
+ optional: isOptional(typeSchemas.request?.schema)
235
+ } : void 0,
236
+ params: typeSchemas.queryParams?.name ? {
237
+ type: typeSchemas.queryParams?.name,
238
+ optional: isOptional(typeSchemas.queryParams?.schema)
239
+ } : void 0
240
+ });
241
+ }
242
+ __name(getParams$3, "getParams");
243
+ const getTransformer = ({ operation, schemas, casing }) => {
244
+ return [
245
+ new URLPath(operation.path, { casing }).toObject({
246
+ type: "path",
247
+ stringify: true
248
+ }),
249
+ schemas.queryParams?.name ? "...(params ? [params] : [])" : void 0,
250
+ schemas.request?.name ? "...(data ? [data] : [])" : void 0
251
+ ].filter(Boolean);
252
+ };
253
+ function QueryKey({ name, typeSchemas, paramsCasing, pathParamsType, operation, typeName, transformer = getTransformer }) {
254
+ const params = getParams$3({
255
+ pathParamsType,
256
+ typeSchemas,
257
+ paramsCasing
258
+ });
259
+ const keys = transformer({
260
+ operation,
261
+ schemas: typeSchemas,
262
+ casing: paramsCasing
263
+ });
264
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(File.Source, {
265
+ name,
266
+ isExportable: true,
267
+ isIndexable: true,
268
+ children: /* @__PURE__ */ jsx(Function$1.Arrow, {
269
+ name,
270
+ export: true,
271
+ params: params.toConstructor(),
272
+ singleLine: true,
273
+ children: `[${keys.join(", ")}] as const`
274
+ })
275
+ }), /* @__PURE__ */ jsx(File.Source, {
276
+ name: typeName,
277
+ isExportable: true,
278
+ isIndexable: true,
279
+ isTypeOnly: true,
280
+ children: /* @__PURE__ */ jsx(Type, {
281
+ name: typeName,
282
+ export: true,
283
+ children: `ReturnType<typeof ${name}>`
284
+ })
285
+ })] });
286
+ }
287
+ QueryKey.getParams = getParams$3;
288
+ QueryKey.getTransformer = getTransformer;
289
+ //#endregion
290
+ //#region src/components/Mutation.tsx
291
+ function getParams$2({ paramsCasing, dataReturnType, typeSchemas }) {
292
+ const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
293
+ const pathParams = getPathParams(typeSchemas.pathParams, {
294
+ typed: true,
295
+ casing: paramsCasing
296
+ });
297
+ const TRequest = FunctionParams.factory({
298
+ ...pathParams,
299
+ data: typeSchemas.request?.name ? {
300
+ type: typeSchemas.request?.name,
301
+ optional: isOptional(typeSchemas.request?.schema)
302
+ } : void 0,
303
+ params: typeSchemas.queryParams?.name ? {
304
+ type: typeSchemas.queryParams?.name,
305
+ optional: isOptional(typeSchemas.queryParams?.schema)
306
+ } : void 0,
307
+ headers: typeSchemas.headerParams?.name ? {
308
+ type: typeSchemas.headerParams?.name,
309
+ optional: isOptional(typeSchemas.headerParams?.schema)
310
+ } : void 0
311
+ }).toConstructor();
312
+ const generics = [
313
+ TData,
314
+ `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`,
315
+ TRequest ? `{${TRequest}}` : "void",
316
+ "TContext"
317
+ ].join(", ");
318
+ return FunctionParams.factory({ options: {
319
+ type: `
320
+ {
321
+ mutation?: ReturnType<UseMutationOptions<${generics}>> & { client?: QueryClient },
322
+ client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : "Partial<RequestConfig> & { client?: Client }"},
323
+ }
324
+ `,
325
+ default: "{}"
326
+ } });
327
+ }
328
+ __name(getParams$2, "getParams");
329
+ function Mutation({ name, clientName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation, mutationKeyName }) {
330
+ const mutationKeyParams = MutationKey.getParams({
331
+ pathParamsType,
332
+ typeSchemas
333
+ });
334
+ const params = getParams$2({
335
+ paramsCasing,
336
+ pathParamsType,
337
+ dataReturnType,
338
+ typeSchemas
339
+ });
340
+ const clientParams = Client.getParams({
341
+ paramsCasing,
342
+ paramsType,
343
+ typeSchemas,
344
+ pathParamsType,
345
+ isConfigurable: true
346
+ });
347
+ const mutationParams = FunctionParams.factory({
348
+ ...getPathParams(typeSchemas.pathParams, {
349
+ typed: true,
350
+ casing: paramsCasing
351
+ }),
352
+ data: typeSchemas.request?.name ? {
353
+ type: typeSchemas.request?.name,
354
+ optional: isOptional(typeSchemas.request?.schema)
355
+ } : void 0,
356
+ params: typeSchemas.queryParams?.name ? {
357
+ type: typeSchemas.queryParams?.name,
358
+ optional: isOptional(typeSchemas.queryParams?.schema)
359
+ } : void 0,
360
+ headers: typeSchemas.headerParams?.name ? {
361
+ type: typeSchemas.headerParams?.name,
362
+ optional: isOptional(typeSchemas.headerParams?.schema)
363
+ } : void 0
364
+ });
365
+ const dataParams = FunctionParams.factory({ data: {
366
+ mode: "object",
367
+ children: Object.entries(mutationParams.params).reduce((acc, [key, value]) => {
368
+ if (value) acc[key] = {
369
+ ...value,
370
+ type: void 0
371
+ };
372
+ return acc;
373
+ }, {})
374
+ } });
375
+ const TRequest = mutationParams.toConstructor();
376
+ const generics = [
377
+ dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`,
378
+ `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`,
379
+ TRequest ? `{${TRequest}}` : "void",
380
+ "TContext"
381
+ ].join(", ");
382
+ return /* @__PURE__ */ jsx(File.Source, {
383
+ name,
384
+ isExportable: true,
385
+ isIndexable: true,
386
+ children: /* @__PURE__ */ jsx(Function$1, {
387
+ name,
388
+ export: true,
389
+ params: params.toConstructor(),
390
+ JSDoc: { comments: getComments(operation) },
391
+ generics: ["TContext"],
392
+ children: `
393
+ const { mutation = {}, client: config = {} } = options ?? {}
394
+ const { client: queryClient, ...mutationOptions } = mutation;
395
+ const mutationKey = mutationOptions.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})
396
+
397
+ return useMutation<${generics}>(()=> ({
398
+ mutationFn: async(${dataParams.toConstructor()}) => {
399
+ return ${clientName}(${clientParams.toCall()})
400
+ },
401
+ mutationKey,
402
+ ...mutationOptions
403
+ }), queryClient? () => queryClient: undefined)
404
+ `
405
+ })
406
+ });
407
+ }
408
+ //#endregion
409
+ //#region src/components/QueryOptions.tsx
410
+ function getParams$1({ paramsType, paramsCasing, pathParamsType, typeSchemas }) {
411
+ if (paramsType === "object") {
412
+ const children = {
413
+ ...getPathParams(typeSchemas.pathParams, {
414
+ typed: true,
415
+ casing: paramsCasing
416
+ }),
417
+ data: typeSchemas.request?.name ? {
418
+ type: typeSchemas.request?.name,
419
+ optional: isOptional(typeSchemas.request?.schema)
420
+ } : void 0,
421
+ params: typeSchemas.queryParams?.name ? {
422
+ type: typeSchemas.queryParams?.name,
423
+ optional: isOptional(typeSchemas.queryParams?.schema)
424
+ } : void 0,
425
+ headers: typeSchemas.headerParams?.name ? {
426
+ type: typeSchemas.headerParams?.name,
427
+ optional: isOptional(typeSchemas.headerParams?.schema)
428
+ } : void 0
429
+ };
430
+ const allChildrenAreOptional = Object.values(children).every((child) => !child || child.optional);
431
+ return FunctionParams.factory({
432
+ data: {
433
+ mode: "object",
434
+ children,
435
+ default: allChildrenAreOptional ? "{}" : void 0
436
+ },
437
+ config: {
438
+ type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : "Partial<RequestConfig> & { client?: Client }",
439
+ default: "{}"
440
+ }
441
+ });
442
+ }
443
+ return FunctionParams.factory({
444
+ pathParams: typeSchemas.pathParams?.name ? {
445
+ mode: pathParamsType === "object" ? "object" : "inlineSpread",
446
+ children: getPathParams(typeSchemas.pathParams, {
447
+ typed: true,
448
+ casing: paramsCasing
449
+ }),
450
+ default: isAllOptional(typeSchemas.pathParams?.schema) ? "{}" : void 0
451
+ } : void 0,
452
+ data: typeSchemas.request?.name ? {
453
+ type: typeSchemas.request?.name,
454
+ optional: isOptional(typeSchemas.request?.schema)
455
+ } : void 0,
456
+ params: typeSchemas.queryParams?.name ? {
457
+ type: typeSchemas.queryParams?.name,
458
+ optional: isOptional(typeSchemas.queryParams?.schema)
459
+ } : void 0,
460
+ headers: typeSchemas.headerParams?.name ? {
461
+ type: typeSchemas.headerParams?.name,
462
+ optional: isOptional(typeSchemas.headerParams?.schema)
463
+ } : void 0,
464
+ config: {
465
+ type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : "Partial<RequestConfig> & { client?: Client }",
466
+ default: "{}"
467
+ }
468
+ });
469
+ }
470
+ __name(getParams$1, "getParams");
471
+ function QueryOptions({ name, clientName, typeSchemas, paramsCasing, paramsType, dataReturnType, pathParamsType, queryKeyName }) {
472
+ const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
473
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
474
+ const params = getParams$1({
475
+ paramsType,
476
+ paramsCasing,
477
+ pathParamsType,
478
+ typeSchemas
479
+ });
480
+ const clientParams = Client.getParams({
481
+ paramsCasing,
482
+ typeSchemas,
483
+ paramsType,
484
+ pathParamsType,
485
+ isConfigurable: true
486
+ });
487
+ const queryKeyParams = QueryKey.getParams({
488
+ pathParamsType,
489
+ paramsCasing,
490
+ typeSchemas
491
+ });
492
+ const enabled = Object.entries(queryKeyParams.flatParams).map(([key, item]) => {
493
+ return item && !item.optional && !item.default ? key : void 0;
494
+ }).filter(Boolean).join("&& ");
495
+ const enabledText = enabled ? `enabled: !!(${enabled}),` : "";
496
+ return /* @__PURE__ */ jsx(File.Source, {
497
+ name,
498
+ isExportable: true,
499
+ isIndexable: true,
500
+ children: /* @__PURE__ */ jsx(Function$1, {
501
+ name,
502
+ export: true,
503
+ params: params.toConstructor(),
504
+ children: `
505
+ const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
506
+ return queryOptions<${TData}, ${TError}, ${TData}, typeof queryKey>({
507
+ ${enabledText}
508
+ queryKey,
509
+ queryFn: async ({ signal }) => {
510
+ return ${clientName}(${clientParams.toCall({ transformName(name) {
511
+ if (name === "config") return "{ ...config, signal: config.signal ?? signal }";
512
+ return name;
513
+ } })})
514
+ },
515
+ })
516
+ `
517
+ })
518
+ });
519
+ }
520
+ QueryOptions.getParams = getParams$1;
521
+ //#endregion
522
+ //#region src/components/Query.tsx
523
+ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, typeSchemas }) {
524
+ const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
525
+ const TError = `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`;
526
+ if (paramsType === "object") {
527
+ const children = {
528
+ ...getPathParams(typeSchemas.pathParams, {
529
+ typed: true,
530
+ casing: paramsCasing
531
+ }),
532
+ data: typeSchemas.request?.name ? {
533
+ type: typeSchemas.request?.name,
534
+ optional: isOptional(typeSchemas.request?.schema)
535
+ } : void 0,
536
+ params: typeSchemas.queryParams?.name ? {
537
+ type: typeSchemas.queryParams?.name,
538
+ optional: isOptional(typeSchemas.queryParams?.schema)
539
+ } : void 0,
540
+ headers: typeSchemas.headerParams?.name ? {
541
+ type: typeSchemas.headerParams?.name,
542
+ optional: isOptional(typeSchemas.headerParams?.schema)
543
+ } : void 0
544
+ };
545
+ const allChildrenAreOptional = Object.values(children).every((child) => !child || child.optional);
546
+ return FunctionParams.factory({
547
+ data: {
548
+ mode: "object",
549
+ children,
550
+ default: allChildrenAreOptional ? "{}" : void 0
551
+ },
552
+ options: {
553
+ type: `
554
+ {
555
+ query?: Partial<UseBaseQueryOptions<${[
556
+ TData,
557
+ TError,
558
+ "TData",
559
+ "TQueryData",
560
+ "TQueryKey"
561
+ ].join(", ")}>> & { client?: QueryClient },
562
+ client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : "Partial<RequestConfig> & { client?: Client }"}
563
+ }
564
+ `,
565
+ default: "{}"
566
+ }
567
+ });
568
+ }
569
+ return FunctionParams.factory({
570
+ pathParams: typeSchemas.pathParams?.name ? {
571
+ mode: pathParamsType === "object" ? "object" : "inlineSpread",
572
+ children: getPathParams(typeSchemas.pathParams, {
573
+ typed: true,
574
+ casing: paramsCasing
575
+ }),
576
+ default: isAllOptional(typeSchemas.pathParams?.schema) ? "{}" : void 0
577
+ } : void 0,
578
+ data: typeSchemas.request?.name ? {
579
+ type: typeSchemas.request?.name,
580
+ optional: isOptional(typeSchemas.request?.schema)
581
+ } : void 0,
582
+ params: typeSchemas.queryParams?.name ? {
583
+ type: typeSchemas.queryParams?.name,
584
+ optional: isOptional(typeSchemas.queryParams?.schema)
585
+ } : void 0,
586
+ headers: typeSchemas.headerParams?.name ? {
587
+ type: typeSchemas.headerParams?.name,
588
+ optional: isOptional(typeSchemas.headerParams?.schema)
589
+ } : void 0,
590
+ options: {
591
+ type: `
592
+ {
593
+ query?: Partial<UseBaseQueryOptions<${[
594
+ TData,
595
+ TError,
596
+ "TData",
597
+ "TQueryData",
598
+ "TQueryKey"
599
+ ].join(", ")}>> & { client?: QueryClient },
600
+ client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : "Partial<RequestConfig> & { client?: Client }"}
601
+ }
602
+ `,
603
+ default: "{}"
604
+ }
605
+ });
606
+ }
607
+ function Query({ name, queryKeyTypeName, queryOptionsName, queryKeyName, paramsCasing, paramsType, pathParamsType, dataReturnType, typeSchemas, operation }) {
608
+ const TData = dataReturnType === "data" ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`;
609
+ const returnType = `UseQueryResult<${["TData", `ResponseErrorConfig<${typeSchemas.errors?.map((item) => item.name).join(" | ") || "Error"}>`].join(", ")}> & { queryKey: TQueryKey }`;
610
+ const generics = [
611
+ `TData = ${TData}`,
612
+ `TQueryData = ${TData}`,
613
+ `TQueryKey extends QueryKey = ${queryKeyTypeName}`
614
+ ];
615
+ const queryKeyParams = QueryKey.getParams({
616
+ pathParamsType,
617
+ typeSchemas,
618
+ paramsCasing
619
+ });
620
+ const queryOptionsParams = QueryOptions.getParams({
621
+ paramsType,
622
+ paramsCasing,
623
+ pathParamsType,
624
+ typeSchemas
625
+ });
626
+ const params = getParams({
627
+ paramsCasing,
628
+ paramsType,
629
+ pathParamsType,
630
+ dataReturnType,
631
+ typeSchemas
632
+ });
633
+ const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()}) as unknown as UseBaseQueryOptions`;
634
+ return /* @__PURE__ */ jsx(File.Source, {
635
+ name,
636
+ isExportable: true,
637
+ isIndexable: true,
638
+ children: /* @__PURE__ */ jsx(Function$1, {
639
+ name,
640
+ export: true,
641
+ generics: generics.join(", "),
642
+ params: params.toConstructor(),
643
+ JSDoc: { comments: getComments(operation) },
644
+ children: `
645
+ const { query: queryConfig = {}, client: config = {} } = options ?? {}
646
+ const { client: queryClient, ...resolvedOptions } = queryConfig
647
+ const queryKey = resolvedOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
648
+
649
+ const query = useQuery(() => ({
650
+ ...${queryOptions},
651
+ queryKey,
652
+ initialData: null,
653
+ ...resolvedOptions as unknown as Omit<UseBaseQueryOptions, "queryKey">
654
+ }), queryClient? () => queryClient: undefined) as ${returnType}
655
+
656
+ return query
657
+ `
658
+ })
659
+ });
660
+ }
661
+ Query.getParams = getParams;
662
+ //#endregion
663
+ export { MutationKey as a, QueryKey as i, QueryOptions as n, camelCase as o, Mutation as r, pascalCase as s, Query as t };
664
+
665
+ //# sourceMappingURL=components-BhStIi1M.js.map