zudoku 0.25.3 → 0.26.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 (278) hide show
  1. package/dist/cli/dev/handler.js +2 -2
  2. package/dist/cli/dev/handler.js.map +1 -1
  3. package/dist/config/config.d.ts +1 -0
  4. package/dist/config/loader.js +1 -1
  5. package/dist/config/loader.js.map +1 -1
  6. package/dist/config/validators/common.d.ts +39 -28
  7. package/dist/config/validators/common.js +1 -0
  8. package/dist/config/validators/common.js.map +1 -1
  9. package/dist/config/validators/icon-types.d.ts +1 -1
  10. package/dist/config/validators/validate.d.ts +17 -12
  11. package/dist/lib/authentication/providers/auth0.js +1 -1
  12. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  13. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  14. package/dist/lib/authentication/providers/openid.js +10 -6
  15. package/dist/lib/authentication/providers/openid.js.map +1 -1
  16. package/dist/lib/components/Autocomplete.d.ts +12 -0
  17. package/dist/lib/components/Autocomplete.js +47 -0
  18. package/dist/lib/components/Autocomplete.js.map +1 -0
  19. package/dist/lib/components/Header.js +3 -3
  20. package/dist/lib/components/Header.js.map +1 -1
  21. package/dist/lib/components/index.js +2 -2
  22. package/dist/lib/components/index.js.map +1 -1
  23. package/dist/lib/components/navigation/SidebarCategory.js +1 -1
  24. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  25. package/dist/lib/plugins/markdown/MdxPage.js +8 -2
  26. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  27. package/dist/lib/plugins/openapi/OperationList.js +3 -0
  28. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  29. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  30. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  31. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
  32. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
  33. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  34. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +2 -1
  35. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -2
  36. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  37. package/dist/lib/plugins/openapi/Sidecar.js +9 -6
  38. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  39. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  40. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  41. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +2 -1
  42. package/dist/lib/plugins/openapi/SidecarExamples.js +7 -4
  43. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  44. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
  45. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
  46. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
  47. package/dist/lib/plugins/openapi/playground/Headers.js +66 -4
  48. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  49. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -1
  50. package/dist/lib/plugins/openapi/playground/Playground.js +36 -11
  51. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  52. package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -30
  53. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  54. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
  55. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
  56. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
  57. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
  58. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
  59. package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
  60. package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
  61. package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
  62. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
  63. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
  64. package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
  65. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
  66. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  67. package/dist/lib/ui/Badge.d.ts +1 -1
  68. package/dist/lib/ui/Badge.js +1 -0
  69. package/dist/lib/ui/Badge.js.map +1 -1
  70. package/dist/lib/ui/Command.d.ts +9 -1
  71. package/dist/lib/ui/Command.js +5 -1
  72. package/dist/lib/ui/Command.js.map +1 -1
  73. package/dist/lib/util/joinUrl.d.ts +1 -0
  74. package/dist/lib/util/joinUrl.js +40 -0
  75. package/dist/lib/util/joinUrl.js.map +1 -0
  76. package/dist/vite/build.js +10 -10
  77. package/dist/vite/build.js.map +1 -1
  78. package/dist/vite/config.js +4 -1
  79. package/dist/vite/config.js.map +1 -1
  80. package/dist/vite/config.test.js +5 -1
  81. package/dist/vite/config.test.js.map +1 -1
  82. package/dist/vite/dev-server.js +4 -1
  83. package/dist/vite/dev-server.js.map +1 -1
  84. package/dist/vite/plugin-api.d.ts +1 -1
  85. package/dist/vite/plugin-api.js +23 -5
  86. package/dist/vite/plugin-api.js.map +1 -1
  87. package/dist/vite/plugin-auth.js +4 -1
  88. package/dist/vite/plugin-auth.js.map +1 -1
  89. package/dist/vite/plugin-mdx.js +9 -4
  90. package/dist/vite/plugin-mdx.js.map +1 -1
  91. package/dist/vite/prerender.d.ts +2 -2
  92. package/dist/vite/prerender.js +4 -4
  93. package/dist/vite/prerender.js.map +1 -1
  94. package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
  95. package/dist/zuplo/enrich-with-zuplo.js +184 -0
  96. package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
  97. package/dist/zuplo/env.d.ts +1 -0
  98. package/dist/zuplo/env.js +3 -0
  99. package/dist/zuplo/env.js.map +1 -1
  100. package/dist/zuplo/policy-types.d.ts +33 -0
  101. package/dist/zuplo/policy-types.js +8 -0
  102. package/dist/zuplo/policy-types.js.map +1 -0
  103. package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
  104. package/dist/zuplo/with-zuplo-processors.js +26 -0
  105. package/dist/zuplo/with-zuplo-processors.js.map +1 -0
  106. package/dist/zuplo/with-zuplo.d.ts +1 -2
  107. package/dist/zuplo/with-zuplo.js +6 -27
  108. package/dist/zuplo/with-zuplo.js.map +1 -1
  109. package/lib/{AnchorLink-DFZZbmvr.js → AnchorLink-bObQitZv.js} +3 -3
  110. package/lib/{AnchorLink-DFZZbmvr.js.map → AnchorLink-bObQitZv.js.map} +1 -1
  111. package/lib/{AuthenticationPlugin-D7G3me8L.js → AuthenticationPlugin-C9SwOxkc.js} +4 -4
  112. package/lib/{AuthenticationPlugin-D7G3me8L.js.map → AuthenticationPlugin-C9SwOxkc.js.map} +1 -1
  113. package/lib/{CategoryHeading-CBconmtI.js → CategoryHeading-MYL1u_6K.js} +3 -3
  114. package/lib/{CategoryHeading-CBconmtI.js.map → CategoryHeading-MYL1u_6K.js.map} +1 -1
  115. package/lib/{Markdown-CZDLNOFc.js → Markdown-DFN6p0J-.js} +1041 -1041
  116. package/lib/{Markdown-CZDLNOFc.js.map → Markdown-DFN6p0J-.js.map} +1 -1
  117. package/lib/{MdxPage-DKMbBROv.js → MdxPage-D9c4z09Q.js} +61 -56
  118. package/lib/MdxPage-D9c4z09Q.js.map +1 -0
  119. package/lib/{OperationList-B8bHMKme.js → OperationList-DGJWDx1G.js} +1264 -1244
  120. package/lib/OperationList-DGJWDx1G.js.map +1 -0
  121. package/lib/{Route-DYwKZ_c_.js → Route-VdmEyOD0.js} +5 -5
  122. package/lib/{Route-DYwKZ_c_.js.map → Route-VdmEyOD0.js.map} +1 -1
  123. package/lib/{Select-B_IxRUUC.js → Select-D3O7wISy.js} +36 -36
  124. package/lib/{Select-B_IxRUUC.js.map → Select-D3O7wISy.js.map} +1 -1
  125. package/lib/{SlotletProvider-pfc9oejW.js → SlotletProvider-_3zzX_g_.js} +53 -53
  126. package/lib/{SlotletProvider-pfc9oejW.js.map → SlotletProvider-_3zzX_g_.js.map} +1 -1
  127. package/lib/{Button-DeAoTouo.js → Spinner-BlzrEEk1.js} +16 -13
  128. package/lib/Spinner-BlzrEEk1.js.map +1 -0
  129. package/lib/{SyntaxHighlight-Bz-lOJtH.js → SyntaxHighlight-CJCSPG1F.js} +297 -301
  130. package/lib/{SyntaxHighlight-Bz-lOJtH.js.map → SyntaxHighlight-CJCSPG1F.js.map} +1 -1
  131. package/lib/{ZudokuContext-hmLMUdf2.js → ZudokuContext-DeQZEp-x.js} +357 -356
  132. package/lib/ZudokuContext-DeQZEp-x.js.map +1 -0
  133. package/lib/{chunk-D52XG6IA-Dl7HLe6j.js → chunk-SYFQ2XB5-BF5IDYrB.js} +410 -412
  134. package/lib/chunk-SYFQ2XB5-BF5IDYrB.js.map +1 -0
  135. package/lib/context-rwLGh-6_.js +22 -0
  136. package/lib/{context-h_UkBLvr.js.map → context-rwLGh-6_.js.map} +1 -1
  137. package/lib/{createServer-BznDkeSA.js → createServer-BcaswoFO.js} +1274 -1286
  138. package/lib/createServer-BcaswoFO.js.map +1 -0
  139. package/lib/{hook-CHq7pFyz.js → hook-BRQEDRbn.js} +17 -17
  140. package/lib/{hook-CHq7pFyz.js.map → hook-BRQEDRbn.js.map} +1 -1
  141. package/lib/index-B7mqiOei.js +509 -0
  142. package/lib/index-B7mqiOei.js.map +1 -0
  143. package/lib/index-CXRrqOIl.js +1750 -0
  144. package/lib/index-CXRrqOIl.js.map +1 -0
  145. package/lib/index-Djenk2Hj.js +36 -0
  146. package/lib/{index-CPNSgwSb.js.map → index-Djenk2Hj.js.map} +1 -1
  147. package/lib/{index-CBXSgjaE.js → index-Dl3Yl0yb.js} +65 -69
  148. package/lib/index-Dl3Yl0yb.js.map +1 -0
  149. package/lib/{index.esm-BSV1C092.js → index.esm-9-TF9KQB.js} +52 -52
  150. package/lib/{index.esm-BSV1C092.js.map → index.esm-9-TF9KQB.js.map} +1 -1
  151. package/lib/index.esm-CrSoEshU.js +1207 -0
  152. package/lib/index.esm-CrSoEshU.js.map +1 -0
  153. package/lib/joinUrl-BTy9bvoK.js +20 -0
  154. package/lib/joinUrl-BTy9bvoK.js.map +1 -0
  155. package/lib/{jsx-runtime-Dx-03ztt.js → jsx-runtime-Bdg6XQ1m.js} +135 -135
  156. package/lib/{jsx-runtime-Dx-03ztt.js.map → jsx-runtime-Bdg6XQ1m.js.map} +1 -1
  157. package/lib/post-processors/removeExtensions.js +7 -7
  158. package/lib/post-processors/removeExtensions.js.map +1 -1
  159. package/lib/post-processors/removeParameters.js +48 -0
  160. package/lib/post-processors/removeParameters.js.map +1 -0
  161. package/lib/{prism-bash.min-DadFsM4Z.js → prism-bash.min-HHIMdNJ_.js} +4 -4
  162. package/lib/{prism-bash.min-DadFsM4Z.js.map → prism-bash.min-HHIMdNJ_.js.map} +1 -1
  163. package/lib/{prism-csharp.min-DUwvItt4.js → prism-csharp.min-bQAo2pmx.js} +33 -33
  164. package/lib/{prism-csharp.min-DUwvItt4.js.map → prism-csharp.min-bQAo2pmx.js.map} +1 -1
  165. package/lib/{prism-java.min-BtgBR4yd.js → prism-java.min-BpvsOuIa.js} +12 -12
  166. package/lib/{prism-java.min-BtgBR4yd.js.map → prism-java.min-BpvsOuIa.js.map} +1 -1
  167. package/lib/{prism-markdown.min-F3U-vPBi.js → prism-markdown.min-C0Qn0m-5.js} +30 -30
  168. package/lib/{prism-markdown.min-F3U-vPBi.js.map → prism-markdown.min-C0Qn0m-5.js.map} +1 -1
  169. package/lib/{prism-ruby.min-DeDXCp1r.js → prism-ruby.min-Dx9KO9ds.js} +16 -16
  170. package/lib/{prism-ruby.min-DeDXCp1r.js.map → prism-ruby.min-Dx9KO9ds.js.map} +1 -1
  171. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  172. package/lib/state-mM7uaXTW.js +202 -0
  173. package/lib/state-mM7uaXTW.js.map +1 -0
  174. package/lib/ui/Accordion.js +1 -1
  175. package/lib/ui/ActionButton.js +10 -11
  176. package/lib/ui/ActionButton.js.map +1 -1
  177. package/lib/ui/Alert.js +2 -2
  178. package/lib/ui/AlertDialog.js +1 -1
  179. package/lib/ui/Badge.js +3 -2
  180. package/lib/ui/Badge.js.map +1 -1
  181. package/lib/ui/Breadcrumb.js +1 -1
  182. package/lib/ui/Button.js +2 -2
  183. package/lib/ui/Callout.js +1 -1
  184. package/lib/ui/Card.js +1 -1
  185. package/lib/ui/Carousel.js +3 -3
  186. package/lib/ui/Carousel.js.map +1 -1
  187. package/lib/ui/Checkbox.js +2 -2
  188. package/lib/ui/Command.js +125 -13
  189. package/lib/ui/Command.js.map +1 -1
  190. package/lib/ui/Dialog.js +1 -1
  191. package/lib/ui/Drawer.js +520 -519
  192. package/lib/ui/Drawer.js.map +1 -1
  193. package/lib/ui/DropdownMenu.js +1 -1
  194. package/lib/ui/Form.js +2 -2
  195. package/lib/ui/HoverCard.js +1 -1
  196. package/lib/ui/Input.js +1 -1
  197. package/lib/ui/Label.js +2 -2
  198. package/lib/ui/Pagination.js +7 -7
  199. package/lib/ui/Popover.js +1 -1
  200. package/lib/ui/Progress.js +1 -1
  201. package/lib/ui/RadioGroup.js +1 -1
  202. package/lib/ui/ScrollArea.js +1 -1
  203. package/lib/ui/Select.js +1 -1
  204. package/lib/ui/Skeleton.js +1 -1
  205. package/lib/ui/Slider.js +1 -1
  206. package/lib/ui/Switch.js +1 -1
  207. package/lib/ui/Tabs.js +1 -1
  208. package/lib/ui/Textarea.js +1 -1
  209. package/lib/ui/Toggle.js +2 -2
  210. package/lib/ui/ToggleGroup.js +1 -1
  211. package/lib/ui/Tooltip.js +1 -1
  212. package/lib/{useExposedProps-DE9lR6MF.js → useExposedProps-CetwhZpP.js} +2 -2
  213. package/lib/{useExposedProps-DE9lR6MF.js.map → useExposedProps-CetwhZpP.js.map} +1 -1
  214. package/lib/zudoku.auth-auth0.js +8 -10
  215. package/lib/zudoku.auth-auth0.js.map +1 -1
  216. package/lib/zudoku.auth-clerk.js +18 -18
  217. package/lib/zudoku.auth-openid.js +225 -221
  218. package/lib/zudoku.auth-openid.js.map +1 -1
  219. package/lib/zudoku.components.js +476 -461
  220. package/lib/zudoku.components.js.map +1 -1
  221. package/lib/zudoku.plugin-api-catalog.js +5 -5
  222. package/lib/zudoku.plugin-api-keys.js +7 -7
  223. package/lib/zudoku.plugin-custom-pages.js +3 -3
  224. package/lib/zudoku.plugin-markdown.js +2 -2
  225. package/lib/zudoku.plugin-openapi.js +5 -5
  226. package/lib/zudoku.plugin-redirect.js +1 -1
  227. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  228. package/package.json +48 -48
  229. package/src/app/main.css +50 -50
  230. package/src/lib/authentication/providers/auth0.tsx +1 -4
  231. package/src/lib/authentication/providers/openid.tsx +12 -5
  232. package/src/lib/components/Autocomplete.tsx +111 -0
  233. package/src/lib/components/Header.tsx +3 -3
  234. package/src/lib/components/index.ts +2 -2
  235. package/src/lib/components/navigation/SidebarCategory.tsx +2 -2
  236. package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
  237. package/src/lib/plugins/openapi/OperationList.tsx +4 -0
  238. package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -5
  239. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
  240. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +8 -2
  241. package/src/lib/plugins/openapi/Sidecar.tsx +15 -7
  242. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  243. package/src/lib/plugins/openapi/SidecarExamples.tsx +14 -6
  244. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +51 -0
  245. package/src/lib/plugins/openapi/playground/Headers.tsx +138 -41
  246. package/src/lib/plugins/openapi/playground/Playground.tsx +156 -62
  247. package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -122
  248. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
  249. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
  250. package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
  251. package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
  252. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
  253. package/src/lib/ui/Badge.tsx +1 -0
  254. package/src/lib/ui/Command.tsx +20 -0
  255. package/src/lib/util/joinUrl.ts +57 -0
  256. package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
  257. package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
  258. package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
  259. package/lib/Button-DeAoTouo.js.map +0 -1
  260. package/lib/Command-9x_kZHr4.js +0 -611
  261. package/lib/Command-9x_kZHr4.js.map +0 -1
  262. package/lib/MdxPage-DKMbBROv.js.map +0 -1
  263. package/lib/OperationList-B8bHMKme.js.map +0 -1
  264. package/lib/Spinner-DuxJLLNE.js +0 -7
  265. package/lib/Spinner-DuxJLLNE.js.map +0 -1
  266. package/lib/ZudokuContext-hmLMUdf2.js.map +0 -1
  267. package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +0 -1
  268. package/lib/context-h_UkBLvr.js +0 -22
  269. package/lib/createServer-BznDkeSA.js.map +0 -1
  270. package/lib/index-CBXSgjaE.js.map +0 -1
  271. package/lib/index-CPNSgwSb.js +0 -36
  272. package/lib/index-sD8L1_Dl.js +0 -1292
  273. package/lib/index-sD8L1_Dl.js.map +0 -1
  274. package/lib/index.esm-BnnBRKJX.js +0 -1214
  275. package/lib/index.esm-BnnBRKJX.js.map +0 -1
  276. package/lib/state-CFQsUZUP.js +0 -202
  277. package/lib/state-CFQsUZUP.js.map +0 -1
  278. package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
@@ -1,1292 +0,0 @@
1
- var Se = Object.defineProperty;
2
- var oe = (t) => {
3
- throw TypeError(t);
4
- };
5
- var $e = (t, a, n) => a in t ? Se(t, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[a] = n;
6
- var H = (t, a, n) => $e(t, typeof a != "symbol" ? a + "" : a, n), Te = (t, a, n) => a.has(t) || oe("Cannot " + n);
7
- var J = (t, a, n) => (Te(t, a, "read from private field"), n ? n.call(t) : a.get(t)), Q = (t, a, n) => a.has(t) ? oe("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, n);
8
- import { j as e } from "./jsx-runtime-Dx-03ztt.js";
9
- import { m as Pe } from "./chunk-D52XG6IA-Dl7HLe6j.js";
10
- import { i as ke, j as le, k as Oe } from "./ZudokuContext-hmLMUdf2.js";
11
- import { XIcon as qe, EraserIcon as ye, Check as Ie, ChevronsUpDownIcon as Ee, LogInIcon as Ve, CirclePlayIcon as Re } from "lucide-react";
12
- import { u as ze } from "./hook-CHq7pFyz.js";
13
- import { Button as C } from "./ui/Button.js";
14
- import { Z as Ae } from "./invariant-Caa8-XvF.js";
15
- import { VisuallyHidden as _e } from "@radix-ui/react-visually-hidden";
16
- import * as v from "react";
17
- import { useRef as ge, useEffect as ve, useState as _, useTransition as Fe, Fragment as U } from "react";
18
- import { C as Le, a as De, b as Me, c as He, d as Je, D as Qe, e as Ue, f as Be, g as Ge } from "./Command-9x_kZHr4.js";
19
- import { u as We, S as ie, a as ce, b as de, c as me, e as B } from "./Select-B_IxRUUC.js";
20
- import { b as ee, C as w, u as Ze, a as Ke, F as Xe } from "./index.esm-BnnBRKJX.js";
21
- import { a as Ye } from "./state-CFQsUZUP.js";
22
- import { S as ue } from "./Spinner-DuxJLLNE.js";
23
- import { Callout as et } from "./ui/Callout.js";
24
- import { Card as X, CardHeader as tt, CardTitle as at, CardContent as nt } from "./ui/Card.js";
25
- import { Tabs as pe, TabsList as he, TabsTrigger as q, TabsContent as I } from "./ui/Tabs.js";
26
- import { z as st, S as rt } from "./SyntaxHighlight-Bz-lOJtH.js";
27
- import { c as h } from "./cn-qaFjX9_3.js";
28
- import { Input as F } from "./ui/Input.js";
29
- import * as Y from "@radix-ui/react-checkbox";
30
- import { c as ot } from "./index-CPNSgwSb.js";
31
- import { Popover as lt, PopoverTrigger as it, PopoverContent as ct } from "./ui/Popover.js";
32
- import { Slot as dt } from "@radix-ui/react-slot";
33
- class E extends String {
34
- constructor(n, r) {
35
- super(n);
36
- H(this, "__apiType");
37
- this.value = n, this.__meta__ = r;
38
- }
39
- toString() {
40
- return this.value;
41
- }
42
- }
43
- const mt = new E(
44
- `
45
- fragment OperationsFragment on OperationItem {
46
- slug
47
- summary
48
- method
49
- description
50
- operationId
51
- contentTypes
52
- path
53
- parameters {
54
- name
55
- in
56
- description
57
- required
58
- schema
59
- style
60
- examples {
61
- name
62
- description
63
- externalValue
64
- value
65
- summary
66
- }
67
- }
68
- requestBody {
69
- content {
70
- mediaType
71
- encoding {
72
- name
73
- }
74
- examples {
75
- name
76
- description
77
- externalValue
78
- value
79
- summary
80
- }
81
- schema
82
- }
83
- description
84
- required
85
- }
86
- responses {
87
- statusCode
88
- links
89
- description
90
- content {
91
- examples {
92
- name
93
- description
94
- externalValue
95
- value
96
- summary
97
- }
98
- mediaType
99
- encoding {
100
- name
101
- }
102
- schema
103
- }
104
- }
105
- }
106
- `,
107
- { fragmentName: "OperationsFragment" }
108
- ), ut = new E(`
109
- query ServersQuery($input: JSON!, $type: SchemaType!) {
110
- schema(input: $input, type: $type) {
111
- url
112
- servers {
113
- url
114
- }
115
- }
116
- }
117
- `), pt = new E(`
118
- query AllOperations($input: JSON!, $type: SchemaType!) {
119
- schema(input: $input, type: $type) {
120
- description
121
- summary
122
- title
123
- url
124
- version
125
- tags {
126
- name
127
- description
128
- operations {
129
- slug
130
- ...OperationsFragment
131
- }
132
- }
133
- }
134
- }
135
- fragment OperationsFragment on OperationItem {
136
- slug
137
- summary
138
- method
139
- description
140
- operationId
141
- contentTypes
142
- path
143
- parameters {
144
- name
145
- in
146
- description
147
- required
148
- schema
149
- style
150
- examples {
151
- name
152
- description
153
- externalValue
154
- value
155
- summary
156
- }
157
- }
158
- requestBody {
159
- content {
160
- mediaType
161
- encoding {
162
- name
163
- }
164
- examples {
165
- name
166
- description
167
- externalValue
168
- value
169
- summary
170
- }
171
- schema
172
- }
173
- description
174
- required
175
- }
176
- responses {
177
- statusCode
178
- links
179
- description
180
- content {
181
- examples {
182
- name
183
- description
184
- externalValue
185
- value
186
- summary
187
- }
188
- mediaType
189
- encoding {
190
- name
191
- }
192
- schema
193
- }
194
- }
195
- }`), ht = new E(`
196
- query getServerQuery($input: JSON!, $type: SchemaType!) {
197
- schema(input: $input, type: $type) {
198
- url
199
- servers {
200
- url
201
- }
202
- }
203
- }
204
- `), xt = new E(`
205
- query GetCategories($input: JSON!, $type: SchemaType!) {
206
- schema(input: $input, type: $type) {
207
- url
208
- tags {
209
- __typename
210
- name
211
- operations {
212
- __typename
213
- slug
214
- deprecated
215
- method
216
- summary
217
- operationId
218
- path
219
- }
220
- }
221
- }
222
- }
223
- `), ft = {
224
- "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ut,
225
- "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n": mt,
226
- "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n": pt,
227
- "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n": ht,
228
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n": xt
229
- };
230
- function yt(t) {
231
- return ft[t] ?? {};
232
- }
233
- let G;
234
- const gt = (t) => {
235
- var a;
236
- if ((a = t.errors) != null && a[0])
237
- throw new Ae(t.errors[0].message, {
238
- developerHint: "Check your configuration value `apis.type` and `apis.input` in the Zudoku config."
239
- });
240
- };
241
- var L, D;
242
- class vt {
243
- constructor(a) {
244
- Q(this, L, async () => (G || (G = import("./createServer-BznDkeSA.js").then(
245
- (a) => a.createServer(this.config)
246
- )), G));
247
- Q(this, D, async (a) => this.config.server ? fetch(this.config.server, a) : (await J(this, L).call(this)).fetch("http://localhost/graphql", a));
248
- H(this, "fetch", async (a, ...[n]) => {
249
- var c;
250
- const r = (c = a.match(/query (\w+)/)) == null ? void 0 : c[1], l = await J(this, D).call(this, {
251
- method: "POST",
252
- body: JSON.stringify({ query: a, variables: n, operationName: r }),
253
- headers: { "Content-Type": "application/json" }
254
- });
255
- if (!l.ok)
256
- throw new Error("Network response was not ok");
257
- const o = await l.json();
258
- return gt(o), o.data;
259
- });
260
- this.config = a;
261
- }
262
- }
263
- L = new WeakMap(), D = new WeakMap();
264
- const W = (t) => Math.abs(
265
- isNaN(parseInt(t)) ? t.toLowerCase().charCodeAt(0) - 96 : isNaN(parseInt(t)) ? 0 : parseInt(t)
266
- ), Z = (t) => t.length > 1 ? parseInt(t.split("").reduce((a, n) => `${W(a) + W(n)}`)) : W(t), xe = (t, a = {}) => {
267
- const n = (3 * Z(t) + 2 * Z(t) + Z(t)) % 360, { saturation: r = 75, lightness: l = 60 } = a;
268
- return `${n}deg ${r}% ${l}%`;
269
- }, K = "data-linked-param", je = (t) => {
270
- const { resolvedTheme: a } = st();
271
- return {
272
- text: xe(
273
- t,
274
- a === "light" ? { saturation: 95, lightness: 38 } : {}
275
- ),
276
- background: xe(
277
- t,
278
- a === "light" ? { saturation: 85, lightness: 40 } : {}
279
- )
280
- };
281
- }, jt = (t) => {
282
- const a = t.replace(/[{}]/g, "");
283
- return je(a);
284
- }, be = ({
285
- name: t,
286
- className: a,
287
- slug: n,
288
- title: r,
289
- children: l,
290
- onClick: o
291
- }) => {
292
- const c = ge(null), d = n == null ? void 0 : n.replace(/[{}]/g, ""), i = t.replace(/[{}]/g, ""), { text: m, background: u } = je(i), g = `hsl(${m} / 100%)`, j = `hsl(${u} / 10%)`, b = `hsl(${u} / 50%)`;
293
- return ve(() => {
294
- if (!d || !c.current) return;
295
- const T = () => {
296
- document.querySelectorAll(`[${K}="${d}"]`).forEach((x) => {
297
- x instanceof HTMLElement && (x.dataset.active = "true");
298
- });
299
- }, N = () => {
300
- document.querySelectorAll(`[${K}="${d}"]`).forEach((x) => {
301
- x instanceof HTMLElement && (x.dataset.active = "false");
302
- });
303
- }, S = c.current;
304
- return S.addEventListener("mouseenter", T), S.addEventListener("mouseleave", N), () => {
305
- S.removeEventListener("mouseenter", T), S.removeEventListener("mouseleave", N);
306
- };
307
- }, [d]), /* @__PURE__ */ e.jsx(
308
- "span",
309
- {
310
- [K]: d,
311
- className: h(
312
- "relative inline-block rounded transition-all duration-100",
313
- "rounded-lg",
314
- "border border-[--border-color] p-0.5 text-[--param-color] bg-[--background-color]",
315
- "data-[active=true]:border-[--param-color] data-[active=true]:shadow data-[active=true]:-translate-y-px",
316
- a
317
- ),
318
- title: r,
319
- suppressHydrationWarning: !0,
320
- ref: c,
321
- onClick: o,
322
- style: {
323
- "--param-color": g,
324
- "--border-color": b,
325
- "--background-color": j
326
- },
327
- children: l ?? t
328
- }
329
- );
330
- }, bt = (t, a, n) => {
331
- const r = a.replace(/(:\w+|\{\w+})/g, (o) => {
332
- var i;
333
- const c = o.replace(/[:{}]/g, "");
334
- return ((i = n.pathParams.find((m) => m.name === c)) == null ? void 0 : i.value) ?? o;
335
- }), l = new URL(
336
- r.replace(/^\//, ""),
337
- t.endsWith("/") ? t : `${t}/`
338
- );
339
- return n.queryParams.filter((o) => o.active).forEach((o) => {
340
- l.searchParams.set(o.name, o.value);
341
- }), l;
342
- }, Nt = ({
343
- control: t,
344
- register: a
345
- }) => {
346
- const { fields: n, append: r, remove: l } = ee({
347
- control: t,
348
- name: "headers"
349
- });
350
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
351
- /* @__PURE__ */ e.jsx("table", { className: "w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2", children: /* @__PURE__ */ e.jsx("tbody", { children: n.map((o, c) => /* @__PURE__ */ e.jsxs(
352
- "tr",
353
- {
354
- className: "group has-[:focus]:bg-muted/50 hover:bg-muted/50",
355
- children: [
356
- /* @__PURE__ */ e.jsx("td", { className: "flex gap-2 items-center", children: /* @__PURE__ */ e.jsx(
357
- F,
358
- {
359
- ...a(`headers.${c}.name`),
360
- placeholder: "Name",
361
- className: "border-0 shadow-none text-xs font-mono",
362
- autoComplete: "off"
363
- }
364
- ) }),
365
- /* @__PURE__ */ e.jsx("td", { children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
366
- /* @__PURE__ */ e.jsx(
367
- F,
368
- {
369
- placeholder: "Value",
370
- className: "border-0 shadow-none text-xs font-mono",
371
- ...a(`headers.${c}.value`),
372
- autoComplete: "off"
373
- }
374
- ),
375
- /* @__PURE__ */ e.jsx(
376
- C,
377
- {
378
- size: "icon",
379
- variant: "ghost",
380
- className: "text-muted-foreground opacity-0 group-hover:opacity-100",
381
- onClick: () => {
382
- l(c);
383
- },
384
- type: "button",
385
- children: /* @__PURE__ */ e.jsx(qe, { size: 16 })
386
- }
387
- )
388
- ] }) })
389
- ]
390
- },
391
- o.id
392
- )) }) }),
393
- /* @__PURE__ */ e.jsx("div", { className: "text-end", children: /* @__PURE__ */ e.jsx(
394
- C,
395
- {
396
- className: "",
397
- onClick: () => r({ name: "", value: "" }),
398
- type: "button",
399
- variant: "secondary",
400
- children: "Add header"
401
- }
402
- ) })
403
- ] });
404
- }, te = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx(
405
- "div",
406
- {
407
- ref: n,
408
- className: h(
409
- "rounded-xl border bg-card text-card-foreground shadow-sm",
410
- t
411
- ),
412
- ...a
413
- }
414
- ));
415
- te.displayName = "Card";
416
- const wt = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx(
417
- "div",
418
- {
419
- ref: n,
420
- className: h("flex flex-col space-y-1.5 p-6", t),
421
- ...a
422
- }
423
- ));
424
- wt.displayName = "CardHeader";
425
- const Ct = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx(
426
- "h3",
427
- {
428
- ref: n,
429
- className: h("font-semibold leading-none tracking-tight", t),
430
- ...a
431
- }
432
- ));
433
- Ct.displayName = "CardTitle";
434
- const St = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx(
435
- "p",
436
- {
437
- ref: n,
438
- className: h("text-sm text-muted-foreground", t),
439
- ...a
440
- }
441
- ));
442
- St.displayName = "CardDescription";
443
- const $t = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx("div", { ref: n, className: h("p-6 pt-0", t), ...a }));
444
- $t.displayName = "CardContent";
445
- const Tt = v.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e.jsx(
446
- "div",
447
- {
448
- ref: n,
449
- className: h("flex items-center p-6 pt-0", t),
450
- ...a
451
- }
452
- ));
453
- Tt.displayName = "CardFooter";
454
- const Pt = ({ name: t }) => {
455
- const a = jt(t);
456
- return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
457
- /* @__PURE__ */ e.jsx(
458
- "div",
459
- {
460
- className: "w-2 h-2 rounded-full",
461
- style: { backgroundColor: `hsl(${a})` }
462
- }
463
- ),
464
- /* @__PURE__ */ e.jsx(
465
- be,
466
- {
467
- slug: t,
468
- name: t,
469
- className: "font-mono text-xs m-2 px-1"
470
- }
471
- )
472
- ] });
473
- }, kt = ({
474
- control: t
475
- }) => {
476
- const { fields: a } = ee({
477
- control: t,
478
- name: "pathParams"
479
- });
480
- return /* @__PURE__ */ e.jsx(te, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx("table", { className: "w-full", children: /* @__PURE__ */ e.jsx("tbody", { children: a.map((n, r) => /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
481
- /* @__PURE__ */ e.jsx("td", { className: "w-5/12", children: /* @__PURE__ */ e.jsx(
482
- w,
483
- {
484
- control: t,
485
- name: `pathParams.${r}.value`,
486
- render: () => /* @__PURE__ */ e.jsx(Pt, { name: n.name })
487
- }
488
- ) }),
489
- /* @__PURE__ */ e.jsx("td", { className: "w-7/12", children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
490
- /* @__PURE__ */ e.jsx(
491
- w,
492
- {
493
- control: t,
494
- name: `pathParams.${r}.value`,
495
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
496
- F,
497
- {
498
- ...l,
499
- required: !0,
500
- placeholder: "Enter value",
501
- className: "w-full border-0 shadow-none text-xs font-mono hover:bg-accent"
502
- }
503
- )
504
- }
505
- ),
506
- /* @__PURE__ */ e.jsx(
507
- w,
508
- {
509
- control: t,
510
- name: `pathParams.${r}.value`,
511
- render: ({ field: l }) => /* @__PURE__ */ e.jsx(
512
- C,
513
- {
514
- size: "icon",
515
- type: "button",
516
- variant: "ghost",
517
- "aria-label": "Clear value",
518
- className: h(
519
- "ms-2 mr-1",
520
- l.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
521
- ),
522
- title: "Clear value",
523
- onClick: () => l.onChange(""),
524
- children: /* @__PURE__ */ e.jsx(ye, { size: 16 })
525
- }
526
- )
527
- }
528
- )
529
- ] }) })
530
- ] }, n.id)) }) }) });
531
- }, Ot = ot(
532
- "peer h-4 w-4 shrink-0 rounded-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary",
533
- {
534
- variants: {
535
- variant: {
536
- default: "border border-primary data-[state=checked]:bg-primary",
537
- outline: "border border-input data-[state=checked]:bg-accent"
538
- }
539
- },
540
- defaultVariants: {
541
- variant: "default"
542
- }
543
- }
544
- ), Ne = v.forwardRef(({ className: t, variant: a, ...n }, r) => /* @__PURE__ */ e.jsx(
545
- Y.Root,
546
- {
547
- ref: r,
548
- className: h(Ot({ variant: a, className: t })),
549
- ...n,
550
- children: /* @__PURE__ */ e.jsx(
551
- Y.Indicator,
552
- {
553
- className: h("flex items-center justify-center text-current"),
554
- children: /* @__PURE__ */ e.jsx(Ie, { className: "h-4 w-4" })
555
- }
556
- )
557
- }
558
- ));
559
- Ne.displayName = Y.Root.displayName;
560
- const qt = ({
561
- value: t,
562
- enumValues: a,
563
- onChange: n,
564
- onValueSelected: r
565
- }) => {
566
- const [l, o] = _(""), [c, d] = _(!1);
567
- return /* @__PURE__ */ e.jsxs(lt, { open: c, onOpenChange: d, children: [
568
- /* @__PURE__ */ e.jsx(it, { asChild: !0, children: /* @__PURE__ */ e.jsx(
569
- "button",
570
- {
571
- type: "button",
572
- role: "combobox",
573
- className: h(
574
- "px-3 py-2 w-full border-0 shadow-none text-xs font-mono text-start hover:bg-accent/40 rounded border-transparent hover:bg-accent",
575
- !t && "text-muted-foreground"
576
- ),
577
- children: t || "Select value"
578
- }
579
- ) }),
580
- /* @__PURE__ */ e.jsx(
581
- ct,
582
- {
583
- className: "p-0 w-[--radix-popover-trigger-width] ",
584
- align: "start",
585
- sideOffset: 3,
586
- alignOffset: -3,
587
- side: "bottom",
588
- children: /* @__PURE__ */ e.jsxs(Le, { className: "max-h-[180px]", children: [
589
- /* @__PURE__ */ e.jsx(
590
- De,
591
- {
592
- placeholder: "Enter value",
593
- className: "h-9 bg-transparent ",
594
- onValueChange: o,
595
- onKeyDown: (i) => {
596
- i.key === "Enter" && (n(l), r(), d(!1));
597
- }
598
- }
599
- ),
600
- /* @__PURE__ */ e.jsxs(Me, { children: [
601
- /* @__PURE__ */ e.jsxs(He, { children: [
602
- 'Use "',
603
- l,
604
- '"'
605
- ] }),
606
- a.map((i) => /* @__PURE__ */ e.jsx(
607
- Je,
608
- {
609
- value: i,
610
- onSelect: (m) => {
611
- n(m), r(), d(!1);
612
- },
613
- children: i
614
- },
615
- i
616
- ))
617
- ] })
618
- ] })
619
- }
620
- )
621
- ] });
622
- }, It = (t, a) => {
623
- const n = v.forwardRef(({ className: r, asChild: l, ...o }, c) => {
624
- const d = l ? dt : t;
625
- return v.createElement(d, {
626
- ...o,
627
- ref: c,
628
- className: h(a, r)
629
- });
630
- });
631
- return n.displayName = `VariantComponent(${t})`, n;
632
- }, Et = It(
633
- "input",
634
- "px-2 bg-transparent h-6 font-mono text-xs m-2"
635
- ), Vt = ({
636
- control: t,
637
- queryParams: a
638
- }) => {
639
- const { fields: n } = ee({
640
- control: t,
641
- name: "queryParams"
642
- }), r = Ze(), l = a.map((d) => !!d.isRequired), c = r.watch("identity") !== A;
643
- return /* @__PURE__ */ e.jsx(te, { className: "rounded-lg", children: /* @__PURE__ */ e.jsx("table", { className: "w-full", children: /* @__PURE__ */ e.jsx("tbody", { children: n.filter(
644
- // TODO remove this hack for Accu or make it more generic
645
- (d) => !(c && d.name === "apikey")
646
- ).map((d, i) => {
647
- const m = a.find(
648
- (u) => u.name === d.name
649
- );
650
- return /* @__PURE__ */ e.jsxs("tr", { className: "hover:bg-accent/40", children: [
651
- /* @__PURE__ */ e.jsxs("td", { className: "w-5/12 flex items-center ps-3", children: [
652
- /* @__PURE__ */ e.jsx(
653
- w,
654
- {
655
- control: t,
656
- name: `queryParams.${i}.active`,
657
- render: ({ field: u }) => /* @__PURE__ */ e.jsx(
658
- Ne,
659
- {
660
- variant: "outline",
661
- id: `queryParams.${i}.active`,
662
- checked: u.value,
663
- onCheckedChange: u.onChange
664
- }
665
- )
666
- }
667
- ),
668
- /* @__PURE__ */ e.jsx(
669
- w,
670
- {
671
- control: t,
672
- render: ({ field: u }) => /* @__PURE__ */ e.jsx(Et, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
673
- "label",
674
- {
675
- className: "flex items-center cursor-pointer gap-1",
676
- htmlFor: `queryParams.${i}.active`,
677
- title: l[i] ? "Required field" : void 0,
678
- children: [
679
- u.value,
680
- l[i] && /* @__PURE__ */ e.jsx("sup", { children: " *" })
681
- ]
682
- }
683
- ) }),
684
- name: `queryParams.${i}.name`
685
- }
686
- )
687
- ] }),
688
- /* @__PURE__ */ e.jsx("td", { className: "w-7/12", children: /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
689
- /* @__PURE__ */ e.jsx(
690
- w,
691
- {
692
- control: t,
693
- render: ({ field: u }) => {
694
- if (!((m == null ? void 0 : m.enum) && m.enum.length > 0))
695
- return /* @__PURE__ */ e.jsx(
696
- F,
697
- {
698
- ...u,
699
- onChange: (b) => {
700
- u.onChange(b.target.value), b.target.value.length > 0 && r.setValue(
701
- `queryParams.${i}.active`,
702
- !0
703
- );
704
- },
705
- placeholder: "Enter value",
706
- className: "w-full border-0 shadow-none text-xs font-mono hover:bg-accent"
707
- }
708
- );
709
- const j = m.enum ?? [];
710
- return /* @__PURE__ */ e.jsx(
711
- qt,
712
- {
713
- value: u.value,
714
- enumValues: j,
715
- onChange: u.onChange,
716
- onValueSelected: () => {
717
- r.setValue(`queryParams.${i}.active`, !0);
718
- }
719
- }
720
- );
721
- },
722
- name: `queryParams.${i}.value`
723
- }
724
- ),
725
- /* @__PURE__ */ e.jsx(
726
- w,
727
- {
728
- control: t,
729
- render: ({ field: u }) => /* @__PURE__ */ e.jsx(
730
- C,
731
- {
732
- size: "icon",
733
- type: "button",
734
- variant: "ghost",
735
- "aria-label": "Clear value",
736
- className: h(
737
- "ms-2 mr-1",
738
- u.value.length === 0 ? "opacity-0 pointer-events-none" : "opacity-100"
739
- ),
740
- title: "Clear value",
741
- onClick: () => u.onChange(""),
742
- children: /* @__PURE__ */ e.jsx(ye, { size: 16 })
743
- }
744
- ),
745
- name: `queryParams.${i}.value`
746
- }
747
- )
748
- ] }) })
749
- ] }, d.id);
750
- }) }) }) });
751
- }, Rt = ({
752
- value: t,
753
- onChange: a,
754
- className: n,
755
- options: r,
756
- showChevrons: l = !0
757
- }) => /* @__PURE__ */ e.jsxs("div", { className: "grid", children: [
758
- /* @__PURE__ */ e.jsx(
759
- "select",
760
- {
761
- className: h(
762
- "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
763
- "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
764
- n
765
- ),
766
- value: t,
767
- onChange: a,
768
- children: r.map((o) => /* @__PURE__ */ e.jsx("option", { value: o.value, children: o.label }, o.value))
769
- }
770
- ),
771
- /* @__PURE__ */ e.jsx(
772
- "div",
773
- {
774
- className: h(
775
- !l && "hidden",
776
- "row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none"
777
- ),
778
- children: /* @__PURE__ */ e.jsx(Ee, { size: 14 })
779
- }
780
- )
781
- ] }), zt = (t) => {
782
- var n;
783
- return (n = Object.entries({
784
- "application/json": "json",
785
- "text/json": "json",
786
- "text/html": "html",
787
- "text/css": "css",
788
- "text/javascript": "javascript",
789
- "application/xml": "xml",
790
- "application/xhtml+xml": "xhtml"
791
- }).find(
792
- ([r]) => t.includes(r)
793
- )) == null ? void 0 : n[1];
794
- }, At = (t) => {
795
- const a = t.get("Content-Type") || "";
796
- return zt(a);
797
- }, _t = (t) => {
798
- try {
799
- return JSON.stringify(JSON.parse(t), null, 2);
800
- } catch {
801
- return null;
802
- }
803
- }, Ft = ({
804
- body: t = "",
805
- headers: a
806
- }) => {
807
- const n = At(a), r = _t(t), l = r || t, [o, c] = _(
808
- r ? "formatted" : "raw"
809
- );
810
- return /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
811
- /* @__PURE__ */ e.jsx(X, { className: "shadow-none", children: /* @__PURE__ */ e.jsx(
812
- rt,
813
- {
814
- language: o === "raw" ? r ? "plain" : n : "json",
815
- noBackground: !0,
816
- className: "overflow-x-auto p-4 text-xs max-h-[calc(83.333vh-180px)]",
817
- code: o === "raw" ? t : l
818
- }
819
- ) }),
820
- r && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ e.jsx(
821
- Rt,
822
- {
823
- value: o,
824
- onChange: (d) => c(d.target.value),
825
- options: [
826
- { value: "formatted", label: "Formatted" },
827
- { value: "raw", label: "Raw" }
828
- ]
829
- }
830
- ) })
831
- ] });
832
- }, A = "__none", Lt = {
833
- 200: "OK",
834
- 201: "Created",
835
- 202: "Accepted",
836
- 204: "No Content",
837
- 400: "Bad Request",
838
- 401: "Unauthorized",
839
- 403: "Forbidden",
840
- 404: "Not Found",
841
- 405: "Method Not Allowed",
842
- 500: "Internal Server Error"
843
- }, Dt = ({
844
- server: t,
845
- servers: a,
846
- url: n,
847
- method: r,
848
- headers: l = [],
849
- queryParams: o = [],
850
- pathParams: c = [],
851
- defaultBody: d = ""
852
- }) => {
853
- var se, re;
854
- const { selectedServer: i, setSelectedServer: m } = Ye(), [, u] = Fe(), { register: g, control: j, handleSubmit: b, watch: T, setValue: N, ...S } = Ke({
855
- defaultValues: {
856
- body: d,
857
- queryParams: o.map((s) => ({
858
- name: s.name,
859
- value: s.defaultValue ?? "",
860
- active: s.defaultActive ?? !1,
861
- enum: s.enum ?? []
862
- })),
863
- pathParams: c.map((s) => ({
864
- name: s.name,
865
- value: s.defaultValue ?? ""
866
- })),
867
- headers: l.map((s) => ({
868
- name: s.name,
869
- value: s.defaultValue ?? ""
870
- })),
871
- identity: A
872
- }
873
- }), x = T(), P = ke(), ae = ge(!1);
874
- ve(() => {
875
- var y;
876
- if (ae.current) return;
877
- const s = (y = P.data) == null ? void 0 : y.at(0);
878
- s && (N("identity", s.id), ae.current = !0);
879
- }, [N, P.data]);
880
- const f = We({
881
- mutationFn: async (s) => {
882
- var O, $;
883
- const y = bt(i ?? t, n, s), k = performance.now(), V = new Request(y, {
884
- method: r.toUpperCase(),
885
- headers: Object.fromEntries(
886
- s.headers.filter((p) => p.name).map((p) => [p.name, p.value])
887
- ),
888
- body: s.body ? s.body : void 0
889
- });
890
- s.identity !== A && (($ = (O = P.data) == null ? void 0 : O.find((p) => p.id === s.identity)) == null || $.authorizeRequest(V));
891
- try {
892
- const p = await fetch(V, {
893
- signal: AbortSignal.timeout(5e3)
894
- }), R = performance.now() - k, z = await p.text();
895
- return {
896
- status: p.status,
897
- headers: p.headers,
898
- size: z.length,
899
- body: z,
900
- time: R
901
- };
902
- } catch (p) {
903
- throw p instanceof TypeError ? new Error(
904
- "The request failed, possibly due to network issues or CORS policy."
905
- ) : p;
906
- }
907
- }
908
- }), we = n.split("/").map((s, y, k) => {
909
- var R;
910
- const V = s.startsWith("{") && s.endsWith("}") || s.startsWith(":"), O = s.replace(/[:{}]/g, ""), $ = (R = x.pathParams.find((z) => z.name === O)) == null ? void 0 : R.value, p = /* @__PURE__ */ e.jsx(
911
- be,
912
- {
913
- backgroundOpacity: "25%",
914
- name: s,
915
- slug: s,
916
- title: $ ? void 0 : `Missing value for path parameter \`${O}\``,
917
- children: $ ? encodeURIComponent($) : s
918
- }
919
- );
920
- return (
921
- // eslint-disable-next-line react/no-array-index-key
922
- /* @__PURE__ */ e.jsxs(U, { children: [
923
- V ? p : s,
924
- y < k.length - 1 && "/",
925
- /* @__PURE__ */ e.jsx("wbr", {})
926
- ] }, s + y)
927
- );
928
- }), M = Array.from(((se = f.data) == null ? void 0 : se.headers.entries()) ?? []), ne = x.queryParams.filter((s) => s.active).map((s, y, k) => /* @__PURE__ */ e.jsxs(U, { children: [
929
- s.name,
930
- "=",
931
- encodeURIComponent(s.value).replaceAll("%20", "+"),
932
- y < k.length - 1 && "&",
933
- /* @__PURE__ */ e.jsx("wbr", {})
934
- ] }, s.name)), Ce = /* @__PURE__ */ e.jsx("div", { className: "inline-block opacity-50 hover:opacity-100 transition", children: a && a.length > 1 ? /* @__PURE__ */ e.jsxs(
935
- ie,
936
- {
937
- onValueChange: (s) => {
938
- u(() => {
939
- m(s);
940
- });
941
- },
942
- value: i,
943
- children: [
944
- /* @__PURE__ */ e.jsx(ce, { className: "p-0 border-none flex-row-reverse bg-transparent text-xs gap-0.5 h-auto", children: /* @__PURE__ */ e.jsx(de, {}) }),
945
- /* @__PURE__ */ e.jsx(me, { children: a.map((s) => /* @__PURE__ */ e.jsx(B, { value: s, children: s.replace(/^https?:\/\//, "") }, s)) })
946
- ]
947
- }
948
- ) : /* @__PURE__ */ e.jsx("span", { children: t.replace(/^https?:\/\//, "") }) });
949
- return /* @__PURE__ */ e.jsx(
950
- Xe,
951
- {
952
- register: g,
953
- control: j,
954
- handleSubmit: b,
955
- watch: T,
956
- setValue: N,
957
- ...S,
958
- children: /* @__PURE__ */ e.jsx("form", { onSubmit: b((s) => f.mutateAsync(s)), children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-[8fr_7fr] text-sm h-full", children: [
959
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 p-4 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto", children: [
960
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-stretch", children: [
961
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 items-center w-full border rounded-md", children: [
962
- /* @__PURE__ */ e.jsx("div", { className: "border-r p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono", children: r.toUpperCase() }),
963
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap p-2 font-mono text-xs", children: [
964
- Ce,
965
- we,
966
- ne.length > 0 ? "?" : "",
967
- ne
968
- ] })
969
- ] }),
970
- /* @__PURE__ */ e.jsx(C, { type: "submit", className: "h-auto flex gap-1", children: "Send" })
971
- ] }),
972
- /* @__PURE__ */ e.jsxs(
973
- pe,
974
- {
975
- defaultValue: o.length + c.length > 0 ? "parameters" : "headers",
976
- children: [
977
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1 justify-between", children: [
978
- /* @__PURE__ */ e.jsxs(he, { children: [
979
- o.length + c.length > 0 && /* @__PURE__ */ e.jsx(q, { value: "parameters", children: "Parameters" }),
980
- /* @__PURE__ */ e.jsxs(q, { value: "headers", children: [
981
- "Headers",
982
- " ",
983
- x.headers.length > 0 && `(${x.headers.length})`
984
- ] }),
985
- /* @__PURE__ */ e.jsx(
986
- q,
987
- {
988
- value: "body",
989
- disabled: !["POST", "PUT", "PATCH", "DELETE"].includes(
990
- r.toUpperCase()
991
- ),
992
- children: "Body"
993
- }
994
- )
995
- ] }),
996
- /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center", children: [
997
- "Auth:",
998
- /* @__PURE__ */ e.jsxs(
999
- ie,
1000
- {
1001
- onValueChange: (s) => N("identity", s),
1002
- value: x.identity,
1003
- defaultValue: x.identity,
1004
- children: [
1005
- /* @__PURE__ */ e.jsx(ce, { className: "w-[180px] flex", children: P.isPending ? /* @__PURE__ */ e.jsx(ue, {}) : /* @__PURE__ */ e.jsx(de, {}) }),
1006
- /* @__PURE__ */ e.jsxs(me, { align: "center", children: [
1007
- /* @__PURE__ */ e.jsx(B, { value: A, children: "None" }),
1008
- (re = P.data) == null ? void 0 : re.map((s) => /* @__PURE__ */ e.jsx(B, { value: s.id, children: s.label }, s.id))
1009
- ] })
1010
- ]
1011
- }
1012
- )
1013
- ] })
1014
- ] }),
1015
- /* @__PURE__ */ e.jsx(I, { value: "headers", children: /* @__PURE__ */ e.jsx(Nt, { control: j, register: g }) }),
1016
- /* @__PURE__ */ e.jsxs(I, { value: "parameters", children: [
1017
- c.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1018
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Path Parameters" }),
1019
- /* @__PURE__ */ e.jsx(kt, { control: j })
1020
- ] }),
1021
- o.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 my-4", children: [
1022
- /* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: "Query Parameters" }),
1023
- /* @__PURE__ */ e.jsx(Vt, { control: j, queryParams: o })
1024
- ] })
1025
- ] }),
1026
- /* @__PURE__ */ e.jsx(I, { value: "body", children: /* @__PURE__ */ e.jsx(
1027
- "textarea",
1028
- {
1029
- ...g("body"),
1030
- className: "border w-full rounded p-2 bg-muted h-40"
1031
- }
1032
- ) })
1033
- ]
1034
- }
1035
- )
1036
- ] }),
1037
- /* @__PURE__ */ e.jsx("div", { className: "min-w-0 p-8 bg-muted/70", children: f.error ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1038
- x.pathParams.some((s) => s.value === "") && /* @__PURE__ */ e.jsx(et, { type: "caution", children: "Some path parameters are missing values. Please fill them in to ensure the request is sent correctly." }),
1039
- /* @__PURE__ */ e.jsxs(X, { children: [
1040
- /* @__PURE__ */ e.jsx(tt, { children: /* @__PURE__ */ e.jsx(at, { children: "Request failed" }) }),
1041
- /* @__PURE__ */ e.jsxs(nt, { children: [
1042
- "Error:",
1043
- " ",
1044
- f.error.message || String(f.error) || "Unexpected error"
1045
- ] })
1046
- ] })
1047
- ] }) : f.data ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
1048
- /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex text-xs gap-6", children: [
1049
- /* @__PURE__ */ e.jsxs("div", { children: [
1050
- "Status: ",
1051
- f.data.status,
1052
- " ",
1053
- Lt[f.data.status] ?? ""
1054
- ] }),
1055
- /* @__PURE__ */ e.jsxs("div", { children: [
1056
- "Time: ",
1057
- f.data.time.toFixed(0),
1058
- "ms"
1059
- ] }),
1060
- /* @__PURE__ */ e.jsxs("div", { children: [
1061
- "Size: ",
1062
- f.data.size,
1063
- " B"
1064
- ] })
1065
- ] }) }),
1066
- /* @__PURE__ */ e.jsxs(pe, { defaultValue: "response", children: [
1067
- /* @__PURE__ */ e.jsxs(he, { children: [
1068
- /* @__PURE__ */ e.jsx(q, { value: "response", children: "Response" }),
1069
- /* @__PURE__ */ e.jsx(q, { value: "headers", children: M.length ? `Headers (${M.length})` : "No headers" })
1070
- ] }),
1071
- /* @__PURE__ */ e.jsx(I, { value: "response", children: /* @__PURE__ */ e.jsx(
1072
- Ft,
1073
- {
1074
- headers: f.data.headers,
1075
- body: f.data.body
1076
- }
1077
- ) }),
1078
- /* @__PURE__ */ e.jsx(I, { value: "headers", children: /* @__PURE__ */ e.jsxs(
1079
- X,
1080
- {
1081
- className: "max-h-[calc(83.333vh-140px)] overflow-y-auto grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4",
1082
- children: [
1083
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Key" }),
1084
- /* @__PURE__ */ e.jsx("div", { className: "font-semibold", children: "Value" }),
1085
- M.map(([s, y]) => /* @__PURE__ */ e.jsxs(U, { children: [
1086
- /* @__PURE__ */ e.jsx("div", { children: s }),
1087
- /* @__PURE__ */ e.jsx("div", { className: "break-words", children: y })
1088
- ] }, s))
1089
- ]
1090
- }
1091
- ) })
1092
- ] })
1093
- ] }) : /* @__PURE__ */ e.jsx("div", { className: "grid place-items-center h-full", children: /* @__PURE__ */ e.jsx("span", { className: "text-[16px] font-semibold text-muted-foreground", children: f.isPending ? /* @__PURE__ */ e.jsx(ue, {}) : "Send a request first to see the response here" }) }) })
1094
- ] }) })
1095
- }
1096
- );
1097
- }, Mt = ({
1098
- className: t,
1099
- size: a = 16
1100
- }) => /* @__PURE__ */ e.jsx(
1101
- "svg",
1102
- {
1103
- xmlns: "http://www.w3.org/2000/svg",
1104
- viewBox: "0 0 24 24",
1105
- fill: "currentColor",
1106
- className: t,
1107
- width: a,
1108
- height: a,
1109
- children: /* @__PURE__ */ e.jsx(
1110
- "path",
1111
- {
1112
- fillRule: "evenodd",
1113
- d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm14.024-.983a1.125 1.125 0 0 1 0 1.966l-5.603 3.113A1.125 1.125 0 0 1 9 15.113V8.887c0-.857.921-1.4 1.671-.983l5.603 3.113Z",
1114
- clipRule: "evenodd"
1115
- }
1116
- )
1117
- }
1118
- ), Ht = (t) => {
1119
- const [a, n] = _(!1);
1120
- return /* @__PURE__ */ e.jsxs(Qe, { onOpenChange: (r) => n(r), children: [
1121
- /* @__PURE__ */ e.jsx(Ue, { asChild: !0, children: t.children ?? /* @__PURE__ */ e.jsxs("button", { className: "flex gap-1 items-center px-2 py-1 rounded-md transition text-xs bg-primary text-primary-foreground shadow-sm hover:bg-primary/80", children: [
1122
- "Test",
1123
- /* @__PURE__ */ e.jsx(Mt, { className: "", size: 14 })
1124
- ] }) }),
1125
- /* @__PURE__ */ e.jsxs(
1126
- Be,
1127
- {
1128
- className: "max-w-screen-xl w-full h-5/6 overflow-auto p-0",
1129
- "aria-describedby": void 0,
1130
- children: [
1131
- /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(Ge, { children: "Playground" }) }),
1132
- a && /* @__PURE__ */ e.jsx(Dt, { ...t })
1133
- ]
1134
- }
1135
- )
1136
- ] });
1137
- }, fe = yt(`
1138
- query GetCategories($input: JSON!, $type: SchemaType!) {
1139
- schema(input: $input, type: $type) {
1140
- url
1141
- tags {
1142
- __typename
1143
- name
1144
- operations {
1145
- __typename
1146
- slug
1147
- deprecated
1148
- method
1149
- summary
1150
- operationId
1151
- path
1152
- }
1153
- }
1154
- }
1155
- }
1156
- `), Jt = {
1157
- get: "green",
1158
- post: "blue",
1159
- put: "yellow",
1160
- delete: "red",
1161
- patch: "purple",
1162
- options: "gray",
1163
- head: "gray"
1164
- }, xa = (t) => {
1165
- const a = le(t.navigationId ?? "/reference"), n = t.type === "file" ? Object.keys(t.input) : [], r = new vt(t);
1166
- return {
1167
- getHead: () => {
1168
- if (t.type === "url" && !t.skipPreload)
1169
- return /* @__PURE__ */ e.jsx(
1170
- "link",
1171
- {
1172
- rel: "preload",
1173
- href: t.input,
1174
- as: "fetch",
1175
- crossOrigin: "anonymous"
1176
- }
1177
- );
1178
- if (t.server)
1179
- return /* @__PURE__ */ e.jsx("link", { rel: "preconnect", href: t.server });
1180
- },
1181
- getMdxComponents: () => ({
1182
- OpenPlaygroundButton: ({
1183
- requireAuth: l,
1184
- server: o,
1185
- method: c,
1186
- url: d,
1187
- ...i
1188
- }) => {
1189
- var g;
1190
- const m = ze(), u = Oe({
1191
- queryFn: () => r.fetch(fe, {
1192
- type: t.type,
1193
- input: t.input
1194
- }),
1195
- enabled: !o,
1196
- queryKey: ["playground-server"]
1197
- });
1198
- return l && !m.isAuthenticated ? /* @__PURE__ */ e.jsxs(
1199
- C,
1200
- {
1201
- className: "gap-2 items-center",
1202
- variant: "outline",
1203
- onClick: m.login,
1204
- children: [
1205
- "Login to open in Playground ",
1206
- /* @__PURE__ */ e.jsx(Ve, { size: 16 })
1207
- ]
1208
- }
1209
- ) : /* @__PURE__ */ e.jsx(
1210
- Ht,
1211
- {
1212
- url: d ?? "/",
1213
- method: c ?? "get",
1214
- server: o ?? ((g = u.data) == null ? void 0 : g.schema.url) ?? "https://example.com",
1215
- ...i,
1216
- children: /* @__PURE__ */ e.jsxs(C, { className: "gap-2 items-center", variant: "outline", children: [
1217
- "Open in Playground ",
1218
- /* @__PURE__ */ e.jsx(Re, { size: 16 })
1219
- ] })
1220
- }
1221
- );
1222
- }
1223
- }),
1224
- getSidebar: async (l) => {
1225
- if (!Pe({ path: a, end: !1 }, l))
1226
- return [];
1227
- try {
1228
- const o = n.find((i) => l === le(a, i)) ?? Object.keys(t.input).at(0), d = (await r.fetch(fe, {
1229
- type: t.type,
1230
- input: t.type === "file" ? t.input[o] : t.input,
1231
- version: o
1232
- })).schema.tags.filter((i) => i.operations.length > 0).map((i) => ({
1233
- type: "category",
1234
- label: i.name || "Other endpoints",
1235
- collapsible: !0,
1236
- collapsed: !1,
1237
- items: i.operations.map((m) => ({
1238
- type: "link",
1239
- label: m.summary ?? m.path,
1240
- href: `#${m.slug}`,
1241
- badge: {
1242
- label: m.method,
1243
- color: Jt[m.method.toLowerCase()],
1244
- invert: !0
1245
- }
1246
- }))
1247
- }));
1248
- return d.unshift({
1249
- type: "link",
1250
- label: "Overview",
1251
- href: "#description"
1252
- }), d;
1253
- } catch {
1254
- return [];
1255
- }
1256
- },
1257
- getRoutes: () => [null, ...n].map((o) => ({
1258
- path: a + (o ? `/${o}` : ""),
1259
- async lazy() {
1260
- const { OpenApiRoute: c } = await import("./Route-DYwKZ_c_.js");
1261
- return {
1262
- element: /* @__PURE__ */ e.jsx(
1263
- c,
1264
- {
1265
- basePath: a,
1266
- versions: n,
1267
- client: r,
1268
- config: t
1269
- }
1270
- )
1271
- };
1272
- },
1273
- children: [
1274
- {
1275
- index: !0,
1276
- async lazy() {
1277
- const { OperationList: c } = await import("./OperationList-B8bHMKme.js");
1278
- return { element: /* @__PURE__ */ e.jsx(c, {}) };
1279
- }
1280
- }
1281
- ]
1282
- }))
1283
- };
1284
- };
1285
- export {
1286
- be as C,
1287
- Ht as P,
1288
- Rt as S,
1289
- yt as g,
1290
- xa as o
1291
- };
1292
- //# sourceMappingURL=index-sD8L1_Dl.js.map