zudoku 0.0.0-fa903e7 → 0.0.0-fabd0c1

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