zudoku 0.3.0-dev.7 → 0.3.0-dev.70

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 (559) hide show
  1. package/dist/app/App.d.ts +1 -2
  2. package/dist/app/App.js +1 -29
  3. package/dist/app/App.js.map +1 -1
  4. package/dist/app/demo.d.ts +2 -0
  5. package/dist/app/demo.js +32 -0
  6. package/dist/app/demo.js.map +1 -0
  7. package/dist/app/entry.client.d.ts +2 -0
  8. package/dist/app/entry.client.js +35 -0
  9. package/dist/app/entry.client.js.map +1 -0
  10. package/dist/app/entry.server.d.ts +14 -0
  11. package/dist/app/entry.server.js +105 -0
  12. package/dist/app/entry.server.js.map +1 -0
  13. package/dist/app/main.d.ts +6 -1
  14. package/dist/app/main.js +68 -12
  15. package/dist/app/main.js.map +1 -1
  16. package/dist/app/standalone.d.ts +2 -0
  17. package/dist/app/standalone.js +37 -0
  18. package/dist/app/standalone.js.map +1 -0
  19. package/dist/app/tailwind.d.ts +1 -1
  20. package/dist/app/tailwind.js +0 -4
  21. package/dist/app/tailwind.js.map +1 -1
  22. package/dist/cli/cmds/dev.js +5 -0
  23. package/dist/cli/cmds/dev.js.map +1 -1
  24. package/dist/cli/dev/handler.d.ts +1 -0
  25. package/dist/cli/dev/handler.js +3 -1
  26. package/dist/cli/dev/handler.js.map +1 -1
  27. package/dist/config/config.d.ts +19 -45
  28. package/dist/config/validators/validate.d.ts +911 -2
  29. package/dist/config/validators/validate.js +151 -1
  30. package/dist/config/validators/validate.js.map +1 -1
  31. package/dist/internal.d.ts +1 -0
  32. package/dist/internal.js +2 -0
  33. package/dist/internal.js.map +1 -0
  34. package/dist/lib/authentication/AuthenticationPlugin.d.ts +13 -0
  35. package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
  36. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
  37. package/dist/lib/authentication/Callback.d.ts +1 -1
  38. package/dist/lib/authentication/Callback.js +3 -3
  39. package/dist/lib/authentication/Callback.js.map +1 -1
  40. package/dist/lib/authentication/authentication.d.ts +6 -9
  41. package/dist/lib/authentication/components/SignIn.d.ts +1 -0
  42. package/dist/lib/authentication/components/SignIn.js +10 -0
  43. package/dist/lib/authentication/components/SignIn.js.map +1 -0
  44. package/dist/lib/authentication/components/SignOut.d.ts +1 -0
  45. package/dist/lib/authentication/components/SignOut.js +10 -0
  46. package/dist/lib/authentication/components/SignOut.js.map +1 -0
  47. package/dist/lib/authentication/components/SignUp.d.ts +1 -0
  48. package/dist/lib/authentication/components/SignUp.js +10 -0
  49. package/dist/lib/authentication/components/SignUp.js.map +1 -0
  50. package/dist/lib/authentication/hook.js +2 -2
  51. package/dist/lib/authentication/hook.js.map +1 -1
  52. package/dist/lib/authentication/providers/auth0.js +4 -5
  53. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  54. package/dist/lib/authentication/providers/clerk.js +59 -30
  55. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  56. package/dist/lib/authentication/providers/openid.d.ts +20 -7
  57. package/dist/lib/authentication/providers/openid.js +58 -17
  58. package/dist/lib/authentication/providers/openid.js.map +1 -1
  59. package/dist/lib/components/Bootstrap.d.ts +13 -0
  60. package/dist/lib/components/Bootstrap.js +12 -0
  61. package/dist/lib/components/Bootstrap.js.map +1 -0
  62. package/dist/lib/components/DevPortal.d.ts +5 -19
  63. package/dist/lib/components/DevPortal.js +32 -12
  64. package/dist/lib/components/DevPortal.js.map +1 -1
  65. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  66. package/dist/lib/components/DeveloperHint.js +10 -0
  67. package/dist/lib/components/DeveloperHint.js.map +1 -0
  68. package/dist/lib/components/ErrorPage.d.ts +6 -0
  69. package/dist/lib/components/ErrorPage.js +9 -0
  70. package/dist/lib/components/ErrorPage.js.map +1 -0
  71. package/dist/lib/components/Header.js +17 -3
  72. package/dist/lib/components/Header.js.map +1 -1
  73. package/dist/lib/components/Heading.d.ts +9 -4
  74. package/dist/lib/components/Heading.js +17 -2
  75. package/dist/lib/components/Heading.js.map +1 -1
  76. package/dist/lib/components/InlineCode.d.ts +5 -0
  77. package/dist/lib/components/InlineCode.js +4 -0
  78. package/dist/lib/components/InlineCode.js.map +1 -0
  79. package/dist/lib/components/Layout.js +4 -2
  80. package/dist/lib/components/Layout.js.map +1 -1
  81. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  82. package/dist/lib/components/NotFoundPage.js +12 -0
  83. package/dist/lib/components/NotFoundPage.js.map +1 -0
  84. package/dist/lib/components/SlotletProvider.d.ts +9 -0
  85. package/dist/lib/components/SlotletProvider.js +11 -0
  86. package/dist/lib/components/SlotletProvider.js.map +1 -0
  87. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  88. package/dist/lib/components/SyntaxHighlight.js +24 -22
  89. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  90. package/dist/lib/components/TopNavigation.d.ts +1 -1
  91. package/dist/lib/components/TopNavigation.js +5 -1
  92. package/dist/lib/components/TopNavigation.js.map +1 -1
  93. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  94. package/dist/lib/components/context/DevPortalProvider.js +20 -3
  95. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  96. package/dist/lib/components/index.d.ts +32 -3
  97. package/dist/lib/components/index.js +21 -3
  98. package/dist/lib/components/index.js.map +1 -1
  99. package/dist/lib/components/navigation/SideNavigation.js +3 -2
  100. package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
  101. package/dist/lib/components/navigation/SideNavigationCategory.js +3 -3
  102. package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
  103. package/dist/lib/components/navigation/SideNavigationItem.d.ts +0 -4
  104. package/dist/lib/components/navigation/SideNavigationItem.js +4 -4
  105. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  106. package/dist/lib/components/navigation/useNavigationCollapsibleState.d.ts +4 -1
  107. package/dist/lib/components/navigation/useNavigationCollapsibleState.js +17 -5
  108. package/dist/lib/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  109. package/dist/lib/core/DevPortalContext.d.ts +48 -12
  110. package/dist/lib/core/DevPortalContext.js +7 -9
  111. package/dist/lib/core/DevPortalContext.js.map +1 -1
  112. package/dist/lib/core/plugins.d.ts +16 -4
  113. package/dist/lib/core/plugins.js +2 -0
  114. package/dist/lib/core/plugins.js.map +1 -1
  115. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  116. package/dist/lib/errors/ErrorAlert.js +8 -0
  117. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  118. package/dist/lib/errors/RouterError.d.ts +1 -0
  119. package/dist/lib/errors/RouterError.js +12 -0
  120. package/dist/lib/errors/RouterError.js.map +1 -0
  121. package/dist/lib/errors/ServerError.d.ts +3 -0
  122. package/dist/lib/errors/ServerError.js +6 -0
  123. package/dist/lib/errors/ServerError.js.map +1 -0
  124. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  125. package/dist/lib/errors/TopLevelError.js +7 -0
  126. package/dist/lib/errors/TopLevelError.js.map +1 -0
  127. package/dist/lib/oas/graphql/index.js +6 -4
  128. package/dist/lib/oas/graphql/index.js.map +1 -1
  129. package/dist/lib/oas/parser/index.d.ts +1 -1
  130. package/dist/lib/oas/parser/index.js +38 -12
  131. package/dist/lib/oas/parser/index.js.map +1 -1
  132. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +2 -2
  133. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  134. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  135. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  136. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  137. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +40 -0
  138. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  139. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
  140. package/dist/lib/plugins/{api-key → api-keys}/index.js +12 -20
  141. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  142. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  143. package/dist/lib/plugins/custom-page/index.js +12 -0
  144. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  145. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  146. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  147. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  148. package/dist/lib/plugins/markdown/Toc.js +17 -9
  149. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  150. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  151. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  152. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  153. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  154. package/dist/lib/plugins/markdown/index.js +3 -7
  155. package/dist/lib/plugins/markdown/index.js.map +1 -1
  156. package/dist/lib/plugins/openapi/ColorizedParam.d.ts +2 -1
  157. package/dist/lib/plugins/openapi/ColorizedParam.js +14 -9
  158. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  159. package/dist/lib/plugins/openapi/OperationList.js +17 -5
  160. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  161. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  162. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  163. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  164. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  165. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  166. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  167. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  168. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -16
  169. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  170. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  171. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  172. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  173. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  174. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  175. package/dist/lib/plugins/openapi/Route.js +8 -0
  176. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  177. package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
  178. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  179. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  180. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  181. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  182. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  183. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  184. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  185. package/dist/lib/plugins/openapi/Sidecar.js +26 -19
  186. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  187. package/dist/lib/plugins/openapi/SidecarBox.d.ts +1 -0
  188. package/dist/lib/plugins/openapi/SidecarBox.js +3 -2
  189. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  190. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  191. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  192. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  193. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
  194. package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
  195. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
  196. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  197. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  198. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  199. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  200. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  201. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  202. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  203. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  204. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  205. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  206. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  207. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  208. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  209. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  210. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  211. package/dist/lib/plugins/openapi/context.js +11 -0
  212. package/dist/lib/plugins/openapi/context.js.map +1 -0
  213. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  214. package/dist/lib/plugins/openapi/index.js +35 -20
  215. package/dist/lib/plugins/openapi/index.js.map +1 -1
  216. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  217. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  218. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  219. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +2 -2
  220. package/dist/lib/plugins/openapi/playground/PathParams.js +9 -12
  221. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  222. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -5
  223. package/dist/lib/plugins/openapi/playground/Playground.js +31 -15
  224. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  225. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  226. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
  227. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  228. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +2 -2
  229. package/dist/lib/plugins/openapi/playground/QueryParams.js +13 -9
  230. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  231. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  232. package/dist/lib/plugins/openapi/playground/createUrl.js +5 -9
  233. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -1
  234. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  235. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  236. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  237. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  238. package/dist/lib/plugins/openapi-worker.js +1 -1
  239. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  240. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  241. package/dist/lib/plugins/redirect/index.js +3 -4
  242. package/dist/lib/plugins/redirect/index.js.map +1 -1
  243. package/dist/lib/ui/Callout.js +2 -2
  244. package/dist/lib/ui/Callout.js.map +1 -1
  245. package/dist/lib/ui/Card.js +1 -1
  246. package/dist/lib/ui/Card.js.map +1 -1
  247. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  248. package/dist/lib/ui/DropdownMenu.js +36 -0
  249. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  250. package/dist/lib/ui/Input.js.map +1 -0
  251. package/dist/lib/ui/button-variants.d.ts +2 -2
  252. package/dist/lib/ui/button-variants.js +1 -0
  253. package/dist/lib/ui/button-variants.js.map +1 -1
  254. package/dist/lib/util/MdxComponents.d.ts +2 -2
  255. package/dist/lib/util/MdxComponents.js +7 -5
  256. package/dist/lib/util/MdxComponents.js.map +1 -1
  257. package/dist/lib/util/groupBy.d.ts +1 -6
  258. package/dist/lib/util/groupBy.js +10 -8
  259. package/dist/lib/util/groupBy.js.map +1 -1
  260. package/dist/lib/util/invariant.d.ts +6 -0
  261. package/dist/lib/util/invariant.js +21 -0
  262. package/dist/lib/util/invariant.js.map +1 -0
  263. package/dist/lib/util/joinPath.js +2 -1
  264. package/dist/lib/util/joinPath.js.map +1 -1
  265. package/dist/lib/util/logInit.d.ts +1 -0
  266. package/dist/lib/util/logInit.js +9 -0
  267. package/dist/lib/util/logInit.js.map +1 -0
  268. package/dist/lib/util/objectEntries.d.ts +4 -0
  269. package/dist/lib/util/objectEntries.js +2 -0
  270. package/dist/lib/util/objectEntries.js.map +1 -0
  271. package/dist/lib/util/renderIf.d.ts +1 -0
  272. package/dist/lib/util/renderIf.js +2 -0
  273. package/dist/lib/util/renderIf.js.map +1 -0
  274. package/dist/lib/util/requestIdleCallbackPolyfill.d.ts +1 -0
  275. package/dist/lib/util/requestIdleCallbackPolyfill.js +7 -0
  276. package/dist/lib/util/requestIdleCallbackPolyfill.js.map +1 -0
  277. package/dist/vite/build.js +30 -7
  278. package/dist/vite/build.js.map +1 -1
  279. package/dist/vite/config.d.ts +21 -12
  280. package/dist/vite/config.js +107 -55
  281. package/dist/vite/config.js.map +1 -1
  282. package/dist/vite/config.test.js +6 -3
  283. package/dist/vite/config.test.js.map +1 -1
  284. package/dist/vite/dev-server.d.ts +2 -1
  285. package/dist/vite/dev-server.js +44 -15
  286. package/dist/vite/dev-server.js.map +1 -1
  287. package/dist/vite/html.js +18 -5
  288. package/dist/vite/html.js.map +1 -1
  289. package/dist/vite/plugin-api-keys.js +7 -8
  290. package/dist/vite/plugin-api-keys.js.map +1 -1
  291. package/dist/vite/plugin-api.js +9 -20
  292. package/dist/vite/plugin-api.js.map +1 -1
  293. package/dist/vite/plugin-auth.js +5 -6
  294. package/dist/vite/plugin-auth.js.map +1 -1
  295. package/dist/vite/plugin-component.js +5 -2
  296. package/dist/vite/plugin-component.js.map +1 -1
  297. package/dist/vite/plugin-config.d.ts +0 -2
  298. package/dist/vite/plugin-config.js +2 -13
  299. package/dist/vite/plugin-config.js.map +1 -1
  300. package/dist/vite/plugin-custom-css.d.ts +6 -0
  301. package/dist/vite/plugin-custom-css.js +54 -0
  302. package/dist/vite/plugin-custom-css.js.map +1 -0
  303. package/dist/vite/plugin-docs.js +15 -5
  304. package/dist/vite/plugin-docs.js.map +1 -1
  305. package/dist/vite/plugin-mdx.d.ts +3 -1
  306. package/dist/vite/plugin-mdx.js +5 -5
  307. package/dist/vite/plugin-mdx.js.map +1 -1
  308. package/dist/vite/plugin-metadata.js +1 -1
  309. package/dist/vite/plugin-metadata.js.map +1 -1
  310. package/dist/vite/plugin-redirect.js +10 -10
  311. package/dist/vite/plugin-redirect.js.map +1 -1
  312. package/dist/vite/plugin.js +3 -5
  313. package/dist/vite/plugin.js.map +1 -1
  314. package/dist/vite/prerender.d.ts +17 -0
  315. package/dist/vite/prerender.js +79 -0
  316. package/dist/vite/prerender.js.map +1 -0
  317. package/lib/AnchorLink-C_pYhuZi.js +705 -0
  318. package/lib/AnchorLink-C_pYhuZi.js.map +1 -0
  319. package/lib/AuthenticationPlugin-RvXALgvS.js +52 -0
  320. package/lib/AuthenticationPlugin-RvXALgvS.js.map +1 -0
  321. package/lib/CategoryHeading-D5Q-X6lE.js +10 -0
  322. package/lib/CategoryHeading-D5Q-X6lE.js.map +1 -0
  323. package/lib/Combination-Cq0UkOXq.js +2774 -0
  324. package/lib/Combination-Cq0UkOXq.js.map +1 -0
  325. package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
  326. package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
  327. package/lib/Input-DdAxw3vC.js +2239 -0
  328. package/lib/Input-DdAxw3vC.js.map +1 -0
  329. package/lib/Markdown-DsCvZnhw.js +15035 -0
  330. package/lib/Markdown-DsCvZnhw.js.map +1 -0
  331. package/lib/MdxPage-B_7x36CA.js +200 -0
  332. package/lib/MdxPage-B_7x36CA.js.map +1 -0
  333. package/lib/OperationList-i6FGZUu4.js +5467 -0
  334. package/lib/OperationList-i6FGZUu4.js.map +1 -0
  335. package/lib/Route-Bsrd0acQ.js +13 -0
  336. package/lib/Route-Bsrd0acQ.js.map +1 -0
  337. package/lib/SlotletProvider-CpNYmq6S.js +102 -0
  338. package/lib/SlotletProvider-CpNYmq6S.js.map +1 -0
  339. package/lib/Spinner-BBPlEab_.js +359 -0
  340. package/lib/Spinner-BBPlEab_.js.map +1 -0
  341. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  342. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  343. package/lib/assets/index-BPdJm2ty.js +1 -0
  344. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  345. package/lib/assets/{worker-BCcpCNJ7.js → worker-BWwCA-wk.js} +10727 -10300
  346. package/lib/assets/worker-BWwCA-wk.js.map +1 -0
  347. package/lib/context-_fYfJFgk.js +14 -0
  348. package/lib/context-_fYfJFgk.js.map +1 -0
  349. package/lib/index-DT-cf5tv.js +726 -0
  350. package/lib/index-DT-cf5tv.js.map +1 -0
  351. package/lib/index-pI9JkN46.js +4765 -0
  352. package/lib/index-pI9JkN46.js.map +1 -0
  353. package/lib/jsx-runtime-BIr0WBt_.js +1526 -0
  354. package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
  355. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  356. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  357. package/lib/prism-csharp.min-Yizuc34Y.js +1 -0
  358. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  359. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  360. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  361. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  362. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  363. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  364. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  365. package/lib/prism-objectivec.min-BXSWqpJJ.js +1 -0
  366. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  367. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  368. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  369. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  370. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  371. package/lib/router-BiRCp01d.js +2971 -0
  372. package/lib/router-BiRCp01d.js.map +1 -0
  373. package/lib/slugify-CiPVjteN.js +28 -0
  374. package/lib/slugify-CiPVjteN.js.map +1 -0
  375. package/lib/state-DKdaQzvh.js +288 -0
  376. package/lib/state-DKdaQzvh.js.map +1 -0
  377. package/lib/urql-DMlBWUKL.js +1 -0
  378. package/lib/urql-DMlBWUKL.js.map +1 -0
  379. package/lib/zudoku.auth-auth0.js +15 -13
  380. package/lib/zudoku.auth-auth0.js.map +1 -0
  381. package/lib/zudoku.auth-clerk.js +59 -29
  382. package/lib/zudoku.auth-clerk.js.map +1 -0
  383. package/lib/zudoku.auth-openid.js +715 -539
  384. package/lib/zudoku.auth-openid.js.map +1 -0
  385. package/lib/zudoku.components.js +1835 -550
  386. package/lib/zudoku.components.js.map +1 -0
  387. package/lib/zudoku.openapi-worker.js +15035 -146
  388. package/lib/zudoku.openapi-worker.js.map +1 -0
  389. package/lib/zudoku.plugin-api-keys.js +300 -0
  390. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  391. package/lib/zudoku.plugin-custom-page.js +13 -0
  392. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  393. package/lib/zudoku.plugin-markdown.js +48 -0
  394. package/lib/zudoku.plugin-markdown.js.map +1 -0
  395. package/lib/zudoku.plugin-openapi.js +10 -0
  396. package/lib/zudoku.plugin-openapi.js.map +1 -0
  397. package/lib/zudoku.plugin-redirect.js +11 -0
  398. package/lib/zudoku.plugin-redirect.js.map +1 -0
  399. package/package.json +60 -25
  400. package/src/app/App.tsx +0 -41
  401. package/src/app/demo-cdn.html +26 -0
  402. package/src/app/demo.html +18 -0
  403. package/src/app/demo.tsx +45 -0
  404. package/src/app/entry.client.tsx +47 -0
  405. package/src/app/entry.server.tsx +160 -0
  406. package/src/app/main.css +84 -4
  407. package/src/app/main.tsx +87 -15
  408. package/src/app/standalone.html +20 -0
  409. package/src/app/standalone.tsx +51 -0
  410. package/src/app/tailwind.ts +2 -6
  411. package/src/lib/authentication/AuthenticationPlugin.tsx +38 -0
  412. package/src/lib/authentication/Callback.tsx +4 -4
  413. package/src/lib/authentication/authentication.ts +6 -12
  414. package/src/lib/authentication/components/SignIn.tsx +11 -0
  415. package/src/lib/authentication/components/SignOut.tsx +11 -0
  416. package/src/lib/authentication/components/SignUp.tsx +11 -0
  417. package/src/lib/authentication/hook.ts +2 -2
  418. package/src/lib/authentication/providers/auth0.tsx +6 -5
  419. package/src/lib/authentication/providers/clerk.tsx +63 -31
  420. package/src/lib/authentication/providers/openid.tsx +69 -18
  421. package/src/lib/components/Bootstrap.tsx +44 -0
  422. package/src/lib/components/DevPortal.tsx +59 -49
  423. package/src/lib/components/DeveloperHint.tsx +25 -0
  424. package/src/lib/components/ErrorPage.tsx +28 -0
  425. package/src/lib/components/Header.tsx +97 -32
  426. package/src/lib/components/Heading.tsx +26 -7
  427. package/src/lib/components/InlineCode.tsx +19 -0
  428. package/src/lib/components/Layout.tsx +12 -7
  429. package/src/lib/components/NotFoundPage.tsx +33 -0
  430. package/src/lib/components/SlotletProvider.tsx +25 -0
  431. package/src/lib/components/SyntaxHighlight.tsx +53 -44
  432. package/src/lib/components/TopNavigation.tsx +6 -1
  433. package/src/lib/components/context/DevPortalProvider.ts +24 -4
  434. package/src/lib/components/index.ts +25 -3
  435. package/src/lib/components/navigation/SideNavigation.tsx +3 -0
  436. package/src/lib/components/navigation/SideNavigationCategory.tsx +5 -9
  437. package/src/lib/components/navigation/SideNavigationItem.tsx +5 -9
  438. package/src/lib/components/navigation/useNavigationCollapsibleState.ts +21 -6
  439. package/src/lib/core/DevPortalContext.ts +56 -25
  440. package/src/lib/core/plugins.ts +26 -5
  441. package/src/lib/errors/ErrorAlert.tsx +21 -0
  442. package/src/lib/errors/RouterError.tsx +13 -0
  443. package/src/lib/errors/ServerError.tsx +5 -0
  444. package/src/lib/errors/TopLevelError.tsx +8 -0
  445. package/src/lib/oas/graphql/index.ts +9 -5
  446. package/src/lib/oas/parser/index.ts +41 -20
  447. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -2
  448. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  449. package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +19 -9
  450. package/src/lib/plugins/{api-key → api-keys}/index.tsx +17 -41
  451. package/src/lib/plugins/custom-page/index.tsx +22 -0
  452. package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
  453. package/src/lib/plugins/markdown/Toc.tsx +53 -40
  454. package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
  455. package/src/lib/plugins/markdown/index.tsx +10 -7
  456. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -16
  457. package/src/lib/plugins/openapi/OperationList.tsx +46 -10
  458. package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
  459. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  460. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  461. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -19
  462. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  463. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -2
  464. package/src/lib/plugins/openapi/Route.tsx +21 -0
  465. package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
  466. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  467. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  468. package/src/lib/plugins/openapi/Sidecar.tsx +40 -28
  469. package/src/lib/plugins/openapi/SidecarBox.tsx +13 -2
  470. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  471. package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
  472. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  473. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  474. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  475. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  476. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  477. package/src/lib/plugins/openapi/context.tsx +16 -0
  478. package/src/lib/plugins/openapi/index.tsx +59 -52
  479. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  480. package/src/lib/plugins/openapi/playground/PathParams.tsx +80 -48
  481. package/src/lib/plugins/openapi/playground/Playground.tsx +200 -210
  482. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
  483. package/src/lib/plugins/openapi/playground/QueryParams.tsx +92 -65
  484. package/src/lib/plugins/openapi/playground/createUrl.ts +12 -15
  485. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  486. package/src/lib/plugins/openapi-worker.ts +1 -1
  487. package/src/lib/plugins/redirect/index.tsx +3 -4
  488. package/src/lib/ui/Callout.tsx +4 -4
  489. package/src/lib/ui/Card.tsx +1 -1
  490. package/src/lib/ui/DropdownMenu.tsx +199 -0
  491. package/src/lib/ui/button-variants.ts +1 -0
  492. package/src/lib/util/MdxComponents.tsx +7 -15
  493. package/src/lib/util/groupBy.ts +7 -12
  494. package/src/lib/util/invariant.ts +26 -0
  495. package/src/lib/util/joinPath.tsx +2 -1
  496. package/src/lib/util/logInit.ts +9 -0
  497. package/src/lib/util/objectEntries.ts +5 -0
  498. package/src/lib/util/renderIf.ts +4 -0
  499. package/src/lib/util/requestIdleCallbackPolyfill.ts +6 -0
  500. package/dist/lib/components/Input.js.map +0 -1
  501. package/dist/lib/components/Link.d.ts +0 -1
  502. package/dist/lib/components/Link.js +0 -2
  503. package/dist/lib/components/Link.js.map +0 -1
  504. package/dist/lib/components/Router.d.ts +0 -4
  505. package/dist/lib/components/Router.js +0 -20
  506. package/dist/lib/components/Router.js.map +0 -1
  507. package/dist/lib/core/helmet.d.ts +0 -4
  508. package/dist/lib/core/helmet.js +0 -5
  509. package/dist/lib/core/helmet.js.map +0 -1
  510. package/dist/lib/core/icons.d.ts +0 -1
  511. package/dist/lib/core/icons.js +0 -2
  512. package/dist/lib/core/icons.js.map +0 -1
  513. package/dist/lib/core/router.d.ts +0 -1
  514. package/dist/lib/core/router.js +0 -2
  515. package/dist/lib/core/router.js.map +0 -1
  516. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  517. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  518. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  519. package/dist/lib/plugins/api-key/index.js.map +0 -1
  520. package/dist/lib/plugins/index.d.ts +0 -4
  521. package/dist/lib/plugins/index.js +0 -5
  522. package/dist/lib/plugins/index.js.map +0 -1
  523. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  524. package/dist/lib/plugins/openapi/Select.js +0 -5
  525. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  526. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  527. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  528. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  529. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  530. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  531. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  532. package/dist/vite/common.d.ts +0 -1
  533. package/dist/vite/common.js +0 -5
  534. package/dist/vite/common.js.map +0 -1
  535. package/dist/vite/plugin-html.d.ts +0 -3
  536. package/dist/vite/plugin-html.js +0 -47
  537. package/dist/vite/plugin-html.js.map +0 -1
  538. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  539. package/dist/vite/plugin-openapi-worker.js +0 -28
  540. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  541. package/lib/Spinner-BewqqUU-.js +0 -8413
  542. package/lib/clerk-Wslx_mPo.js +0 -19685
  543. package/lib/index-PyGcnQFX.js +0 -3462
  544. package/lib/loglevel-CoH7VSwE.js +0 -152
  545. package/lib/state-2Hu1renZ.js +0 -313
  546. package/lib/zudoku.plugins.js +0 -19902
  547. package/src/lib/components/Link.tsx +0 -1
  548. package/src/lib/components/Router.tsx +0 -28
  549. package/src/lib/core/helmet.ts +0 -5
  550. package/src/lib/core/icons.tsx +0 -1
  551. package/src/lib/core/router.tsx +0 -1
  552. package/src/lib/plugins/index.ts +0 -4
  553. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  554. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  555. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  556. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
  557. /package/dist/lib/{components → ui}/Input.d.ts +0 -0
  558. /package/dist/lib/{components → ui}/Input.js +0 -0
  559. /package/src/lib/{components → ui}/Input.tsx +0 -0
@@ -1,3 +1,4 @@
1
+ import { type ReactElement } from "react";
1
2
  import { type RouteObject } from "react-router-dom";
2
3
  import {
3
4
  DevPortalContext,
@@ -10,9 +11,10 @@ export type PluginNavigationCategory = {
10
11
  } & NavigationCategory;
11
12
 
12
13
  export type DevPortalPlugin =
14
+ | CommonPlugin
15
+ | ProfileMenuPlugin
13
16
  | NavigationPlugin
14
- | ApiIdentityPlugin
15
- | InitializationPlugin;
17
+ | ApiIdentityPlugin;
16
18
 
17
19
  export interface NavigationPlugin {
18
20
  getRoutes: () => RouteObject[];
@@ -23,10 +25,26 @@ export interface ApiIdentityPlugin {
23
25
  getIdentities: (context: DevPortalContext) => Promise<ApiIdentity[]>;
24
26
  }
25
27
 
26
- export interface InitializationPlugin {
27
- initialize: (context: DevPortalContext) => Promise<void> | void;
28
+ export interface ProfileMenuPlugin {
29
+ getProfileMenuItems: (context: DevPortalContext) => NavigationItem[];
28
30
  }
29
31
 
32
+ export type NavigationItem = {
33
+ label: string;
34
+ path?: string;
35
+ children?: NavigationItem[];
36
+ };
37
+
38
+ export interface CommonPlugin {
39
+ initialize?: (context: DevPortalContext) => Promise<void> | void;
40
+ getHead?: () => ReactElement | undefined;
41
+ }
42
+
43
+ export const isProfileMenuPlugin = (
44
+ obj: DevPortalPlugin,
45
+ ): obj is ProfileMenuPlugin =>
46
+ "getProfileMenuItems" in obj && typeof obj.getProfileMenuItems === "function";
47
+
30
48
  export const isNavigationPlugin = (
31
49
  obj: DevPortalPlugin,
32
50
  ): obj is NavigationPlugin =>
@@ -34,9 +52,12 @@ export const isNavigationPlugin = (
34
52
 
35
53
  export const needsInitialization = (
36
54
  obj: DevPortalPlugin,
37
- ): obj is InitializationPlugin =>
55
+ ): obj is CommonPlugin =>
38
56
  "initialize" in obj && typeof obj.initialize === "function";
39
57
 
58
+ export const hasHead = (obj: DevPortalPlugin): obj is CommonPlugin =>
59
+ "getHead" in obj && typeof obj.getHead === "function";
60
+
40
61
  export const isApiIdentityPlugin = (
41
62
  obj: DevPortalPlugin,
42
63
  ): obj is ApiIdentityPlugin =>
@@ -0,0 +1,21 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ export function ErrorAlert({ error }: { error: any }) {
3
+ const message = error?.message ?? "Something went wrong";
4
+ const stack = error?.stack;
5
+
6
+ return (
7
+ <div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
8
+ <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
9
+ <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
10
+ Something went wrong
11
+ </h1>
12
+ <p className="mt-5 text-h1-text">{message}</p>
13
+ {stack ? (
14
+ <pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
15
+ {stack}
16
+ </pre>
17
+ ) : null}
18
+ </div>
19
+ </div>
20
+ );
21
+ }
@@ -0,0 +1,13 @@
1
+ import { isRouteErrorResponse, useRouteError } from "react-router-dom";
2
+ import { NotFoundPage } from "../components/NotFoundPage.js";
3
+ import { ErrorAlert } from "./ErrorAlert.js";
4
+
5
+ export function RouterError() {
6
+ const error = useRouteError();
7
+
8
+ if (isRouteErrorResponse(error) && error.status === 404) {
9
+ return <NotFoundPage />;
10
+ }
11
+
12
+ return <ErrorAlert error={error} />;
13
+ }
@@ -0,0 +1,5 @@
1
+ import { ErrorAlert } from "./ErrorAlert.js";
2
+
3
+ export function ServerError({ error }: { error: unknown }) {
4
+ return <ErrorAlert error={error} />;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { FallbackProps } from "react-error-boundary";
2
+ import { ErrorAlert } from "./ErrorAlert.js";
3
+
4
+ export function TopLevelError({ error, resetErrorBoundary }: FallbackProps) {
5
+ // Call resetErrorBoundary() to reset the error boundary and retry the render.
6
+
7
+ return <ErrorAlert error={error} />;
8
+ }
@@ -36,16 +36,20 @@ type OperationLike = {
36
36
  method: string;
37
37
  };
38
38
  export const slugifyOperation = (operation: OperationLike, tag?: string) => {
39
+ const summary =
40
+ operation.summary +
41
+ (operation.operationId
42
+ ? "-" + operation.operationId.slice(0, operation.summary ? 4 : 12)
43
+ : "");
44
+
39
45
  return slugify(
40
46
  (tag ? tag + "-" : "") +
41
- (operation.summary ??
42
- operation.operationId ??
43
- `${operation.method}-${operation.path}`),
47
+ (summary || `${operation.method}-${operation.path}`),
44
48
  { lower: true, trim: true },
45
49
  );
46
50
  };
47
51
 
48
- const cache = new LRUCache<string, OpenAPIDocument>({
52
+ const cache = new LRUCache<string, Promise<OpenAPIDocument>>({
49
53
  ttl: 60 * 10 * 1000,
50
54
  ttlAutopurge: true,
51
55
  });
@@ -384,7 +388,7 @@ const loadOpenAPISchema = async (input: NonNullable<unknown>) => {
384
388
  return cache.get(hash)!;
385
389
  }
386
390
 
387
- const schema = await validate(input);
391
+ const schema = validate(input);
388
392
 
389
393
  cache.set(hash, schema);
390
394
 
@@ -1,3 +1,4 @@
1
+ import { GraphQLError } from "graphql/error/index.js";
1
2
  import { OpenAPIV3, type OpenAPIV3_1 } from "openapi-types";
2
3
  import { dereference, type JSONSchema } from "./dereference/index.js";
3
4
  import { upgradeSchema } from "./upgrade/index.js";
@@ -9,10 +10,6 @@ type DeepOmitReference<T> = T extends ReferenceObject
9
10
  ? { [K in keyof T]: DeepOmitReference<T[K]> }
10
11
  : T;
11
12
 
12
- // type Prettify<T> = {
13
- // [K in keyof T]: T[K];
14
- // } & {};
15
-
16
13
  export type OpenAPIDocument = DeepOmitReference<OpenAPIV3_1.Document>;
17
14
  export type ResponseObject = DeepOmitReference<OpenAPIV3_1.ResponseObject>;
18
15
  export type OperationObject = DeepOmitReference<OpenAPIV3_1.OperationObject>;
@@ -46,35 +43,63 @@ export const HttpMethods = Object.values(OpenAPIV3.HttpMethods);
46
43
  // };
47
44
 
48
45
  const parseSchemaInput = async (
49
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- schemaInput: any,
46
+ schemaInput: unknown,
51
47
  ): Promise<JSONSchema & { openapi?: string }> => {
52
48
  if (typeof schemaInput === "string") {
53
49
  if (schemaInput.trim().startsWith("{")) {
54
- return JSON.parse(schemaInput);
50
+ try {
51
+ return JSON.parse(schemaInput);
52
+ } catch (err) {
53
+ throw new GraphQLError("Invalid JSON schema", {
54
+ originalError: err,
55
+ });
56
+ }
55
57
  }
56
58
  if (schemaInput.includes("://")) {
57
- const response = await fetch(schemaInput);
58
- return (await response.json()) as JSONSchema;
59
+ let response;
60
+ try {
61
+ response = await fetch(schemaInput, {
62
+ cache: "force-cache",
63
+ });
64
+ } catch (err) {
65
+ throw new GraphQLError("Failed to fetch schema", {
66
+ originalError: err,
67
+ });
68
+ }
69
+
70
+ if (!response.ok) {
71
+ throw new GraphQLError(
72
+ `Failed to fetch schema: ${response.statusText}`,
73
+ );
74
+ }
75
+
76
+ try {
77
+ return (await response.json()) as JSONSchema;
78
+ } catch (err) {
79
+ throw new GraphQLError("Fetched invalid JSON schema", {
80
+ originalError: err,
81
+ });
82
+ }
59
83
  }
60
84
  const yaml = await import("yaml");
61
- return yaml.parse(schemaInput);
85
+ const parsed = yaml.parse(schemaInput);
86
+
87
+ if (typeof parsed === "object") return parsed;
62
88
  }
63
89
 
64
- if (typeof schemaInput === "object") return schemaInput;
90
+ if (typeof schemaInput === "object") return schemaInput as JSONSchema;
65
91
 
66
- throw new Error("Unsupported schema input");
92
+ throw new GraphQLError("Unsupported schema input: " + schemaInput);
67
93
  };
68
94
 
69
95
  /**
70
96
  * Validates, dereferences and upgrades the OpenAPI schema (to v3.1) if necessary.
71
97
  */
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
- export const validate = async (schemaInput: any) => {
98
+ export const validate = async (schemaInput: unknown) => {
74
99
  const schema = await parseSchemaInput(schemaInput);
75
100
 
76
101
  if (!schema.openapi) {
77
- throw new Error("OpenAPI version is not defined");
102
+ throw new GraphQLError("OpenAPI version is not defined");
78
103
  }
79
104
 
80
105
  // const validator = await getValidator(schema.openapi);
@@ -86,9 +111,5 @@ export const validate = async (schemaInput: any) => {
86
111
 
87
112
  const dereferenced = await dereference(schema);
88
113
 
89
- const upgraded = upgradeSchema(
90
- dereferenced as OpenAPIV3_1.Document | OpenAPIV3.Document,
91
- );
92
-
93
- return upgraded;
114
+ return upgradeSchema(dereferenced);
94
115
  };
@@ -2,7 +2,6 @@ import { useMutation } from "@tanstack/react-query";
2
2
  import { useForm } from "react-hook-form";
3
3
  import { Link, useNavigate } from "react-router-dom";
4
4
  import { useDevPortal } from "../../components/context/DevPortalProvider.js";
5
- import { Input } from "../../components/Input.js";
6
5
  import {
7
6
  Select,
8
7
  SelectContent,
@@ -12,6 +11,7 @@ import {
12
11
  SelectValue,
13
12
  } from "../../components/Select.js";
14
13
  import { Button } from "../../ui/Button.js";
14
+ import { Input } from "../../ui/Input.js";
15
15
  import { ApiKeyService } from "./index.js";
16
16
 
17
17
  type CreateApiKey = { description: string; expiresOn?: string };
@@ -47,7 +47,7 @@ export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
47
47
 
48
48
  return (
49
49
  <div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
50
- <div className="flex justify-between mb-4 border-b border-border pb-1">
50
+ <div className="flex justify-between mb-4 border-b pb-1">
51
51
  <h1 className="font-medium text-2xl">New API Key</h1>
52
52
  </div>
53
53
  <form
@@ -0,0 +1,29 @@
1
+ import { Outlet } from "react-router-dom";
2
+ import { useAuth } from "../../authentication/hook.js";
3
+ import { DeveloperHint } from "../../components/DeveloperHint.js";
4
+ import { Button } from "../../ui/Button.js";
5
+
6
+ export const ProtectedRoute = () => {
7
+ const auth = useAuth();
8
+
9
+ // TODO: should we suspend here somehow?
10
+ if (auth.isAuthEnabled && auth.isPending) {
11
+ return null;
12
+ }
13
+
14
+ return auth.isAuthenticated ? (
15
+ <Outlet />
16
+ ) : !auth.isAuthEnabled ? (
17
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2">
18
+ <DeveloperHint className="max-w-[600px]">
19
+ Authentication needs to be enabled for API keys to work. Enable it in
20
+ your Zudoku configuration under <code>authentication</code>.
21
+ </DeveloperHint>
22
+ </div>
23
+ ) : (
24
+ <div className="flex flex-col justify-center gap-2 items-center h-1/2">
25
+ Please login first to view this page
26
+ <Button onClick={() => auth.login()}>Login</Button>
27
+ </div>
28
+ );
29
+ };
@@ -7,7 +7,9 @@ import { EyeIcon, EyeOffIcon, RotateCwIcon, TrashIcon } from "lucide-react";
7
7
  import { useState } from "react";
8
8
  import { Link } from "react-router-dom";
9
9
  import { useDevPortal } from "../../components/context/DevPortalProvider.js";
10
+ import { Slotlet } from "../../components/SlotletProvider.js";
10
11
  import { Button } from "../../ui/Button.js";
12
+ import { cn } from "../../util/cn.js";
11
13
  import { ApiKeyService } from "./index.js";
12
14
 
13
15
  export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
@@ -34,7 +36,7 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
34
36
 
35
37
  return (
36
38
  <div className="max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]">
37
- <div className="flex justify-between mb-4 border-b border-border pb-3">
39
+ <div className="flex justify-between mb-4 border-b pb-3">
38
40
  <h1 className="font-medium text-2xl">API Keys</h1>
39
41
  {service.createKey && (
40
42
  <Button asChild>
@@ -43,6 +45,8 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
43
45
  )}
44
46
  </div>
45
47
 
48
+ <Slotlet name="api-keys-list-page-before-keys" />
49
+
46
50
  {data.length === 0 ? (
47
51
  <div className="flex flex-col justify-center gap-4 items-center h-1/2 my-8">
48
52
  <div className="text-center">
@@ -57,10 +61,15 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
57
61
  )}
58
62
  </div>
59
63
  ) : (
60
- <ul className="grid grid-cols-[minmax(250px,min-content)_1fr_min-content] ">
61
- {data.map((key: any) => (
64
+ <ul
65
+ className={cn(
66
+ "grid grid-cols-1 rounded border",
67
+ "lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]",
68
+ )}
69
+ >
70
+ {data.map((key) => (
62
71
  <li
63
- className="border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
72
+ className="border-b p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
64
73
  key={key.id}
65
74
  >
66
75
  <div className="flex flex-col gap-1 text-sm">
@@ -78,7 +87,7 @@ export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
78
87
  )}
79
88
  </div>
80
89
  </div>
81
- <div className="items-center flex justify-center">
90
+ <div className="items-center flex lg:justify-center">
82
91
  <RevealApiKey apiKey={key.key} />
83
92
  </div>
84
93
  <div className="flex gap-2">
@@ -116,10 +125,11 @@ const RevealApiKey = ({ apiKey }: { apiKey: string }) => {
116
125
  const [revealed, setRevealed] = useState(false);
117
126
 
118
127
  return (
119
- <div className="flex gap-2 items-center text-sm">
120
- <code className="border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono">
121
- {revealed ? apiKey : "•".repeat(apiKey.length)}
122
- </code>
128
+ <div className="flex gap-2 items-center text-sm w-full">
129
+ <input
130
+ className="border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min"
131
+ value={revealed ? apiKey : "•".repeat(apiKey.length)}
132
+ />
123
133
  <Button
124
134
  variant="outline"
125
135
  onClick={() => setRevealed((prev) => !prev)}
@@ -1,26 +1,25 @@
1
- import logger from "loglevel";
2
- import { Outlet, useRouteError } from "react-router-dom";
3
- import invariant from "tiny-invariant";
4
- import { useAuth } from "../../authentication/hook.js";
1
+ import { type RouteObject } from "react-router-dom";
5
2
  import { DevPortalContext } from "../../core/DevPortalContext.js";
6
3
  import {
7
4
  type ApiIdentityPlugin,
8
5
  type DevPortalPlugin,
6
+ ProfileMenuPlugin,
9
7
  } from "../../core/plugins.js";
10
- import { Button } from "../../ui/Button.js";
8
+ import { RouterError } from "../../errors/RouterError.js";
9
+ import invariant from "../../util/invariant.js";
11
10
  import { CreateApiKey } from "./CreateApiKey.js";
11
+ import { ProtectedRoute } from "./ProtectedRoute.js";
12
12
  import { SettingsApiKeys } from "./SettingsApiKeys.js";
13
13
 
14
- export type ApiKeyResults = Promise<ApiKey[]>;
15
14
  const DEFAULT_API_KEY_ENDPOINT =
16
15
  "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev";
17
16
 
18
17
  export type ApiKeyService = {
19
- getKeys: (context: DevPortalContext) => ApiKeyResults;
18
+ getKeys: (context: DevPortalContext) => Promise<ApiKey[]>;
20
19
  rollKey?: (id: string, context: DevPortalContext) => Promise<void>;
21
20
  deleteKey?: (id: string, context: DevPortalContext) => Promise<void>;
22
21
  updateKeyDescription?: (
23
- apiKey: { jd: string; description: string },
22
+ apiKey: { id: string; description: string },
24
23
  context: DevPortalContext,
25
24
  ) => Promise<void>;
26
25
  getUsage?: (apiKeys: string[], context: DevPortalContext) => Promise<void>;
@@ -82,39 +81,9 @@ const createDefaultHandler = (endpoint: string): ApiKeyService => {
82
81
  };
83
82
  };
84
83
 
85
- const ProtectedRoute = () => {
86
- const auth = useAuth();
87
-
88
- // TODO: should we suspend here somehow?
89
- if (auth.isPending) {
90
- return null;
91
- }
92
-
93
- return auth.isAuthenticated ? (
94
- <Outlet />
95
- ) : (
96
- <div className="flex flex-col justify-center gap-2 items-center h-1/2 my-12">
97
- Please login first to view this page
98
- <Button onClick={() => auth.login()}>Login</Button>
99
- </div>
100
- );
101
- };
102
-
103
- const SettingsErrorBoundary = () => {
104
- const error = useRouteError();
105
- logger.error(String(error));
106
-
107
- return (
108
- <div className="flex flex-col justify-center gap-2 items-center h-1/2 my-12">
109
- <h1>Something went wrong</h1>
110
- {error instanceof Error && <p>{error.message}</p>}
111
- </div>
112
- );
113
- };
114
-
115
84
  export const apiKeyPlugin = (
116
85
  options: ApiKeyPluginOptions,
117
- ): DevPortalPlugin & ApiIdentityPlugin => {
86
+ ): DevPortalPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {
118
87
  const endpoint =
119
88
  "endpoint" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;
120
89
 
@@ -122,6 +91,12 @@ export const apiKeyPlugin = (
122
91
  "getKeys" in options ? options : createDefaultHandler(endpoint);
123
92
 
124
93
  return {
94
+ getProfileMenuItems: () => [
95
+ {
96
+ label: "API Keys",
97
+ path: "/settings/api-keys",
98
+ },
99
+ ],
125
100
  getIdentities: async (context) => {
126
101
  try {
127
102
  const keys = await service.getKeys(context);
@@ -138,11 +113,12 @@ export const apiKeyPlugin = (
138
113
  return [];
139
114
  }
140
115
  },
141
- getRoutes: () => {
116
+ getRoutes: (): RouteObject[] => {
117
+ // TODO: Make lazy
142
118
  return [
143
119
  {
144
120
  element: <ProtectedRoute />,
145
- errorElement: <SettingsErrorBoundary />,
121
+ errorElement: <RouterError />,
146
122
  children: [
147
123
  {
148
124
  path: "/settings/api-keys",
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ import type { RouteObject } from "react-router-dom";
3
+ import { ProseClasses } from "../../components/Markdown.js";
4
+ import type { DevPortalPlugin, NavigationPlugin } from "../../core/plugins.js";
5
+
6
+ type CustomPageConfig = Array<{
7
+ path: string;
8
+ element: ReactNode;
9
+ }>;
10
+
11
+ export const customPagePlugin = (
12
+ config: CustomPageConfig,
13
+ ): DevPortalPlugin & NavigationPlugin => {
14
+ return {
15
+ getRoutes: (): RouteObject[] =>
16
+ config.map(({ path, element }) => ({
17
+ path,
18
+ // TODO: we should componentize prose pages
19
+ element: <div className={ProseClasses + " max-w-full"}>{element}</div>,
20
+ })),
21
+ };
22
+ };
@@ -1,18 +1,18 @@
1
1
  import { useMDXComponents } from "@mdx-js/react";
2
+ import { Helmet } from "@zudoku/react-helmet-async";
2
3
  import { useMemo, type PropsWithChildren, type ReactNode } from "react";
4
+ import { Link, useLocation } from "react-router-dom";
3
5
  import { CategoryHeading } from "../../components/CategoryHeading.js";
4
6
  import { Heading } from "../../components/Heading.js";
5
7
  import { ProseClasses } from "../../components/Markdown.js";
6
8
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
7
9
  import { isPathItem } from "../../components/navigation/util.js";
8
- import { Helmet } from "../../core/helmet.js";
9
- import { Link, useLocation } from "../../core/router.js";
10
10
  import type { MdxComponentsType } from "../../util/MdxComponents.js";
11
11
  import { cn } from "../../util/cn.js";
12
12
  import slugify from "../../util/slugify.js";
13
13
  import { traverseNavigation } from "../../util/traverseNavigation.js";
14
14
  import { Toc } from "./Toc.js";
15
- import type { MDXImport } from "./index.js";
15
+ import { MarkdownPluginDefaultOptions, MDXImport } from "./index.js";
16
16
 
17
17
  const MarkdownHeadings = {
18
18
  h2: ({ children, id }) => (
@@ -31,10 +31,12 @@ const MarkdownHeadings = {
31
31
  export const MdxPage = ({
32
32
  mdxComponent: MdxComponent,
33
33
  frontmatter = {},
34
+ defaultOptions,
34
35
  tableOfContents,
35
36
  }: PropsWithChildren<
36
37
  Omit<MDXImport, "default"> & {
37
38
  mdxComponent: MDXImport["default"];
39
+ defaultOptions?: MarkdownPluginDefaultOptions;
38
40
  }
39
41
  >) => {
40
42
  const navItem = useTopNavigationItem();
@@ -50,10 +52,11 @@ export const MdxPage = ({
50
52
 
51
53
  const title = frontmatter.title;
52
54
  const category = frontmatter.category ?? categoryTitle;
53
- const hideToc = frontmatter.toc === false;
54
-
55
+ const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;
55
56
  const pageTitle =
56
57
  tableOfContents.find((item) => item.depth === 1)?.value ?? title;
58
+ const hidePager =
59
+ frontmatter.disablePager ?? defaultOptions?.disablePager ?? false;
57
60
 
58
61
  const tocEntries =
59
62
  tableOfContents.find((item) => item.depth === 1)?.children ??
@@ -112,35 +115,49 @@ export const MdxPage = ({
112
115
  <MdxComponent
113
116
  components={{ ...useMDXComponents(), ...MarkdownHeadings }}
114
117
  />
115
- <hr />
116
- <div className="not-prose flex items-center justify-between gap-8">
117
- {prev.path ? (
118
- <Link
119
- to={prev.path}
120
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
121
- title={typeof prev.label === "string" ? prev.label : undefined}
122
- >
123
- <div className="text-sm text-muted-foreground">
124
- Previous page
125
- </div>
126
- <div className="text-lg text-primary truncate">{prev.label}</div>
127
- </Link>
128
- ) : (
129
- <div className="flex-1" />
130
- )}
131
- {next.path ? (
132
- <Link
133
- to={next.path}
134
- className="flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
135
- title={typeof next.label === "string" ? next.label : undefined}
136
- >
137
- <div className="text-sm text-muted-foreground">Next page →</div>
138
- <div className="text-lg text-primary truncate">{next.label}</div>
139
- </Link>
140
- ) : (
141
- <div className="flex-1" />
142
- )}
143
- </div>
118
+ {!hidePager && (
119
+ <>
120
+ <hr />
121
+ <div className="not-prose flex items-center justify-between gap-8">
122
+ {prev.path ? (
123
+ <Link
124
+ to={prev.path}
125
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md"
126
+ title={
127
+ typeof prev.label === "string" ? prev.label : undefined
128
+ }
129
+ >
130
+ <div className="text-sm text-muted-foreground">
131
+ Previous page
132
+ </div>
133
+ <div className="text-lg text-primary truncate">
134
+ {prev.label}
135
+ </div>
136
+ </Link>
137
+ ) : (
138
+ <div className="flex-1" />
139
+ )}
140
+ {next.path ? (
141
+ <Link
142
+ to={next.path}
143
+ className="flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md"
144
+ title={
145
+ typeof next.label === "string" ? next.label : undefined
146
+ }
147
+ >
148
+ <div className="text-sm text-muted-foreground">
149
+ Next page →
150
+ </div>
151
+ <div className="text-lg text-primary truncate">
152
+ {next.label}
153
+ </div>
154
+ </Link>
155
+ ) : (
156
+ <div className="flex-1" />
157
+ )}
158
+ </div>
159
+ </>
160
+ )}
144
161
  </div>
145
162
  <div className="hidden xl:block">
146
163
  {showToc && <Toc entries={tocEntries} />}