zudoku 0.3.0-dev.6 → 0.3.0-dev.60

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 (523) 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 +67 -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 +5 -39
  28. package/dist/config/validators/validate.d.ts +878 -2
  29. package/dist/config/validators/validate.js +144 -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 +16 -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.js +1 -1
  38. package/dist/lib/authentication/Callback.js.map +1 -1
  39. package/dist/lib/authentication/authentication.d.ts +3 -4
  40. package/dist/lib/authentication/components/Login.d.ts +1 -0
  41. package/dist/lib/authentication/components/Login.js +10 -0
  42. package/dist/lib/authentication/components/Login.js.map +1 -0
  43. package/dist/lib/authentication/components/Logout.d.ts +1 -0
  44. package/dist/lib/authentication/components/Logout.js +10 -0
  45. package/dist/lib/authentication/components/Logout.js.map +1 -0
  46. package/dist/lib/authentication/providers/clerk.js +45 -27
  47. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  48. package/dist/lib/authentication/providers/openid.d.ts +11 -3
  49. package/dist/lib/authentication/providers/openid.js +22 -11
  50. package/dist/lib/authentication/providers/openid.js.map +1 -1
  51. package/dist/lib/authentication/routes.d.ts +5 -0
  52. package/dist/lib/authentication/routes.js +12 -0
  53. package/dist/lib/authentication/routes.js.map +1 -0
  54. package/dist/lib/components/Bootstrap.d.ts +13 -0
  55. package/dist/lib/components/Bootstrap.js +12 -0
  56. package/dist/lib/components/Bootstrap.js.map +1 -0
  57. package/dist/lib/components/DevPortal.d.ts +4 -19
  58. package/dist/lib/components/DevPortal.js +30 -12
  59. package/dist/lib/components/DevPortal.js.map +1 -1
  60. package/dist/lib/components/DeveloperHint.d.ts +5 -0
  61. package/dist/lib/components/DeveloperHint.js +10 -0
  62. package/dist/lib/components/DeveloperHint.js.map +1 -0
  63. package/dist/lib/components/ErrorPage.d.ts +6 -0
  64. package/dist/lib/components/ErrorPage.js +9 -0
  65. package/dist/lib/components/ErrorPage.js.map +1 -0
  66. package/dist/lib/components/Header.js +17 -3
  67. package/dist/lib/components/Header.js.map +1 -1
  68. package/dist/lib/components/Heading.d.ts +9 -4
  69. package/dist/lib/components/Heading.js +17 -2
  70. package/dist/lib/components/Heading.js.map +1 -1
  71. package/dist/lib/components/InlineCode.d.ts +5 -0
  72. package/dist/lib/components/InlineCode.js +4 -0
  73. package/dist/lib/components/InlineCode.js.map +1 -0
  74. package/dist/lib/components/Layout.js +3 -2
  75. package/dist/lib/components/Layout.js.map +1 -1
  76. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  77. package/dist/lib/components/NotFoundPage.js +12 -0
  78. package/dist/lib/components/NotFoundPage.js.map +1 -0
  79. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  80. package/dist/lib/components/SyntaxHighlight.js +20 -18
  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 +5 -1
  84. package/dist/lib/components/TopNavigation.js.map +1 -1
  85. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  86. package/dist/lib/components/context/DevPortalProvider.js +20 -3
  87. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  88. package/dist/lib/components/index.d.ts +32 -3
  89. package/dist/lib/components/index.js +21 -3
  90. package/dist/lib/components/index.js.map +1 -1
  91. package/dist/lib/components/navigation/SideNavigationCategory.js +2 -2
  92. package/dist/lib/components/navigation/SideNavigationCategory.js.map +1 -1
  93. package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
  94. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
  95. package/dist/lib/core/DevPortalContext.d.ts +46 -12
  96. package/dist/lib/core/DevPortalContext.js +7 -9
  97. package/dist/lib/core/DevPortalContext.js.map +1 -1
  98. package/dist/lib/core/plugins.d.ts +16 -4
  99. package/dist/lib/core/plugins.js +2 -0
  100. package/dist/lib/core/plugins.js.map +1 -1
  101. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  102. package/dist/lib/errors/ErrorAlert.js +8 -0
  103. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  104. package/dist/lib/errors/RouterError.d.ts +1 -0
  105. package/dist/lib/errors/RouterError.js +12 -0
  106. package/dist/lib/errors/RouterError.js.map +1 -0
  107. package/dist/lib/errors/ServerError.d.ts +3 -0
  108. package/dist/lib/errors/ServerError.js +6 -0
  109. package/dist/lib/errors/ServerError.js.map +1 -0
  110. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  111. package/dist/lib/errors/TopLevelError.js +7 -0
  112. package/dist/lib/errors/TopLevelError.js.map +1 -0
  113. package/dist/lib/oas/graphql/index.js +6 -4
  114. package/dist/lib/oas/graphql/index.js.map +1 -1
  115. package/dist/lib/oas/parser/index.d.ts +1 -1
  116. package/dist/lib/oas/parser/index.js +38 -12
  117. package/dist/lib/oas/parser/index.js.map +1 -1
  118. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
  119. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  120. package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
  121. package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
  122. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
  123. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +39 -0
  124. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  125. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +4 -5
  126. package/dist/lib/plugins/{api-key → api-keys}/index.js +11 -19
  127. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  128. package/dist/lib/plugins/custom-page/index.d.ts +8 -0
  129. package/dist/lib/plugins/custom-page/index.js +12 -0
  130. package/dist/lib/plugins/custom-page/index.js.map +1 -0
  131. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  132. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  133. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  134. package/dist/lib/plugins/markdown/Toc.js +1 -1
  135. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  136. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  137. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  138. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  139. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  140. package/dist/lib/plugins/markdown/index.js +3 -7
  141. package/dist/lib/plugins/markdown/index.js.map +1 -1
  142. package/dist/lib/plugins/openapi/OperationList.js +17 -5
  143. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  144. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  145. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  146. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  147. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  148. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  149. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  150. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  151. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +4 -16
  152. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  153. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  154. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  155. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  156. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  157. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  158. package/dist/lib/plugins/openapi/Route.js +8 -0
  159. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  160. package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
  161. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  162. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  163. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  164. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  165. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  166. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  167. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  168. package/dist/lib/plugins/openapi/Sidecar.js +10 -8
  169. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  170. package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
  171. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  172. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  173. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  174. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  175. package/dist/lib/plugins/openapi/StaggeredRender.d.ts +8 -0
  176. package/dist/lib/plugins/openapi/StaggeredRender.js +18 -0
  177. package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -0
  178. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  179. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  180. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  181. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  182. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  183. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  184. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  185. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  186. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  187. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  188. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  189. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  190. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  191. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  192. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  193. package/dist/lib/plugins/openapi/context.js +11 -0
  194. package/dist/lib/plugins/openapi/context.js.map +1 -0
  195. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  196. package/dist/lib/plugins/openapi/index.js +35 -20
  197. package/dist/lib/plugins/openapi/index.js.map +1 -1
  198. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  199. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  200. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  201. package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
  202. package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
  203. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  204. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
  205. package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -4
  206. package/dist/lib/plugins/openapi/playground/Playground.js +22 -13
  207. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  208. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  209. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +12 -0
  210. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  211. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
  212. package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -1
  213. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  214. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  215. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  216. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  217. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  218. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  219. package/dist/lib/plugins/openapi-worker.js +1 -1
  220. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  221. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  222. package/dist/lib/plugins/redirect/index.js +3 -4
  223. package/dist/lib/plugins/redirect/index.js.map +1 -1
  224. package/dist/lib/ui/Callout.js +2 -2
  225. package/dist/lib/ui/Callout.js.map +1 -1
  226. package/dist/lib/ui/Card.js +1 -1
  227. package/dist/lib/ui/Card.js.map +1 -1
  228. package/dist/lib/ui/DropdownMenu.d.ts +27 -0
  229. package/dist/lib/ui/DropdownMenu.js +36 -0
  230. package/dist/lib/ui/DropdownMenu.js.map +1 -0
  231. package/dist/lib/ui/button-variants.d.ts +2 -2
  232. package/dist/lib/ui/button-variants.js +1 -0
  233. package/dist/lib/ui/button-variants.js.map +1 -1
  234. package/dist/lib/util/MdxComponents.d.ts +2 -2
  235. package/dist/lib/util/MdxComponents.js +7 -5
  236. package/dist/lib/util/MdxComponents.js.map +1 -1
  237. package/dist/lib/util/groupBy.d.ts +1 -6
  238. package/dist/lib/util/groupBy.js +10 -8
  239. package/dist/lib/util/groupBy.js.map +1 -1
  240. package/dist/lib/util/joinPath.js +2 -1
  241. package/dist/lib/util/joinPath.js.map +1 -1
  242. package/dist/lib/util/logInit.d.ts +1 -0
  243. package/dist/lib/util/logInit.js +9 -0
  244. package/dist/lib/util/logInit.js.map +1 -0
  245. package/dist/lib/util/objectEntries.d.ts +4 -0
  246. package/dist/lib/util/objectEntries.js +2 -0
  247. package/dist/lib/util/objectEntries.js.map +1 -0
  248. package/dist/lib/util/renderIf.d.ts +1 -0
  249. package/dist/lib/util/renderIf.js +2 -0
  250. package/dist/lib/util/renderIf.js.map +1 -0
  251. package/dist/vite/build.js +30 -7
  252. package/dist/vite/build.js.map +1 -1
  253. package/dist/vite/config.d.ts +21 -12
  254. package/dist/vite/config.js +107 -55
  255. package/dist/vite/config.js.map +1 -1
  256. package/dist/vite/config.test.js +6 -3
  257. package/dist/vite/config.test.js.map +1 -1
  258. package/dist/vite/dev-server.d.ts +2 -1
  259. package/dist/vite/dev-server.js +44 -15
  260. package/dist/vite/dev-server.js.map +1 -1
  261. package/dist/vite/html.js +18 -5
  262. package/dist/vite/html.js.map +1 -1
  263. package/dist/vite/plugin-api-keys.js +7 -8
  264. package/dist/vite/plugin-api-keys.js.map +1 -1
  265. package/dist/vite/plugin-api.js +9 -20
  266. package/dist/vite/plugin-api.js.map +1 -1
  267. package/dist/vite/plugin-auth.js +5 -6
  268. package/dist/vite/plugin-auth.js.map +1 -1
  269. package/dist/vite/plugin-component.js +5 -2
  270. package/dist/vite/plugin-component.js.map +1 -1
  271. package/dist/vite/plugin-config.d.ts +0 -2
  272. package/dist/vite/plugin-config.js +2 -13
  273. package/dist/vite/plugin-config.js.map +1 -1
  274. package/dist/vite/plugin-custom-css.d.ts +6 -0
  275. package/dist/vite/plugin-custom-css.js +54 -0
  276. package/dist/vite/plugin-custom-css.js.map +1 -0
  277. package/dist/vite/plugin-docs.js +15 -5
  278. package/dist/vite/plugin-docs.js.map +1 -1
  279. package/dist/vite/plugin-mdx.d.ts +3 -1
  280. package/dist/vite/plugin-mdx.js +5 -5
  281. package/dist/vite/plugin-mdx.js.map +1 -1
  282. package/dist/vite/plugin-metadata.js +1 -1
  283. package/dist/vite/plugin-metadata.js.map +1 -1
  284. package/dist/vite/plugin-redirect.js +10 -10
  285. package/dist/vite/plugin-redirect.js.map +1 -1
  286. package/dist/vite/plugin.js +3 -5
  287. package/dist/vite/plugin.js.map +1 -1
  288. package/dist/vite/prerender.d.ts +17 -0
  289. package/dist/vite/prerender.js +79 -0
  290. package/dist/vite/prerender.js.map +1 -0
  291. package/lib/AnchorLink-Bj1hwDuD.js +705 -0
  292. package/lib/AnchorLink-Bj1hwDuD.js.map +1 -0
  293. package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
  294. package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
  295. package/lib/CategoryHeading-DMkTmmBh.js +10 -0
  296. package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
  297. package/lib/Combination-lAFQBd6U.js +2774 -0
  298. package/lib/Combination-lAFQBd6U.js.map +1 -0
  299. package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
  300. package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
  301. package/lib/Markdown-BjRJKl_E.js +15028 -0
  302. package/lib/Markdown-BjRJKl_E.js.map +1 -0
  303. package/lib/MdxPage-DJTFOCbZ.js +190 -0
  304. package/lib/MdxPage-DJTFOCbZ.js.map +1 -0
  305. package/lib/OperationList-DDTtK3I7.js +5403 -0
  306. package/lib/OperationList-DDTtK3I7.js.map +1 -0
  307. package/lib/Route-Bsrd0acQ.js +13 -0
  308. package/lib/Route-Bsrd0acQ.js.map +1 -0
  309. package/lib/Select-CEnkyfyn.js +2223 -0
  310. package/lib/Select-CEnkyfyn.js.map +1 -0
  311. package/lib/Spinner-Ciq_pWU7.js +359 -0
  312. package/lib/Spinner-Ciq_pWU7.js.map +1 -0
  313. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  314. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  315. package/lib/assets/index-BPdJm2ty.js +1 -0
  316. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  317. package/lib/assets/{worker-BCcpCNJ7.js → worker-BWwCA-wk.js} +10727 -10300
  318. package/lib/assets/worker-BWwCA-wk.js.map +1 -0
  319. package/lib/context-_fYfJFgk.js +14 -0
  320. package/lib/context-_fYfJFgk.js.map +1 -0
  321. package/lib/hook-Q_gAL2NZ.js +93 -0
  322. package/lib/hook-Q_gAL2NZ.js.map +1 -0
  323. package/lib/index-BE2a6gGC.js +726 -0
  324. package/lib/index-BE2a6gGC.js.map +1 -0
  325. package/lib/index-pI9JkN46.js +4765 -0
  326. package/lib/index-pI9JkN46.js.map +1 -0
  327. package/lib/jsx-runtime-BIr0WBt_.js +1526 -0
  328. package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
  329. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  330. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  331. package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
  332. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  333. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  334. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  335. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  336. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  337. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  338. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  339. package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
  340. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  341. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  342. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  343. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  344. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  345. package/lib/router-BiRCp01d.js +2971 -0
  346. package/lib/router-BiRCp01d.js.map +1 -0
  347. package/lib/slugify-CiPVjteN.js +28 -0
  348. package/lib/slugify-CiPVjteN.js.map +1 -0
  349. package/lib/state-DKdaQzvh.js +288 -0
  350. package/lib/state-DKdaQzvh.js.map +1 -0
  351. package/lib/urql-DMlBWUKL.js +1 -0
  352. package/lib/urql-DMlBWUKL.js.map +1 -0
  353. package/lib/zudoku.auth-auth0.js +2 -1
  354. package/lib/zudoku.auth-auth0.js.map +1 -0
  355. package/lib/zudoku.auth-clerk.js +48 -31
  356. package/lib/zudoku.auth-clerk.js.map +1 -0
  357. package/lib/zudoku.auth-openid.js +608 -448
  358. package/lib/zudoku.auth-openid.js.map +1 -0
  359. package/lib/zudoku.components.js +1793 -512
  360. package/lib/zudoku.components.js.map +1 -0
  361. package/lib/zudoku.openapi-worker.js +15035 -146
  362. package/lib/zudoku.openapi-worker.js.map +1 -0
  363. package/lib/zudoku.plugin-api-keys.js +313 -0
  364. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  365. package/lib/zudoku.plugin-custom-page.js +13 -0
  366. package/lib/zudoku.plugin-custom-page.js.map +1 -0
  367. package/lib/zudoku.plugin-markdown.js +48 -0
  368. package/lib/zudoku.plugin-markdown.js.map +1 -0
  369. package/lib/zudoku.plugin-openapi.js +10 -0
  370. package/lib/zudoku.plugin-openapi.js.map +1 -0
  371. package/lib/zudoku.plugin-redirect.js +11 -0
  372. package/lib/zudoku.plugin-redirect.js.map +1 -0
  373. package/package.json +60 -24
  374. package/src/app/App.tsx +0 -41
  375. package/src/app/demo-cdn.html +26 -0
  376. package/src/app/demo.html +18 -0
  377. package/src/app/demo.tsx +45 -0
  378. package/src/app/entry.client.tsx +47 -0
  379. package/src/app/entry.server.tsx +160 -0
  380. package/src/app/main.css +80 -0
  381. package/src/app/main.tsx +86 -15
  382. package/src/app/standalone.html +20 -0
  383. package/src/app/standalone.tsx +51 -0
  384. package/src/app/tailwind.ts +2 -6
  385. package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
  386. package/src/lib/authentication/Callback.tsx +1 -1
  387. package/src/lib/authentication/authentication.ts +3 -7
  388. package/src/lib/authentication/components/Login.tsx +11 -0
  389. package/src/lib/authentication/components/Logout.tsx +11 -0
  390. package/src/lib/authentication/providers/clerk.tsx +44 -27
  391. package/src/lib/authentication/providers/openid.tsx +25 -13
  392. package/src/lib/authentication/routes.tsx +10 -0
  393. package/src/lib/components/Bootstrap.tsx +44 -0
  394. package/src/lib/components/DevPortal.tsx +55 -49
  395. package/src/lib/components/DeveloperHint.tsx +25 -0
  396. package/src/lib/components/ErrorPage.tsx +28 -0
  397. package/src/lib/components/Header.tsx +89 -28
  398. package/src/lib/components/Heading.tsx +26 -7
  399. package/src/lib/components/InlineCode.tsx +19 -0
  400. package/src/lib/components/Layout.tsx +9 -7
  401. package/src/lib/components/NotFoundPage.tsx +33 -0
  402. package/src/lib/components/SyntaxHighlight.tsx +26 -18
  403. package/src/lib/components/TopNavigation.tsx +6 -1
  404. package/src/lib/components/context/DevPortalProvider.ts +24 -4
  405. package/src/lib/components/index.ts +25 -3
  406. package/src/lib/components/navigation/SideNavigationCategory.tsx +3 -3
  407. package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
  408. package/src/lib/core/DevPortalContext.ts +52 -25
  409. package/src/lib/core/plugins.ts +26 -5
  410. package/src/lib/errors/ErrorAlert.tsx +21 -0
  411. package/src/lib/errors/RouterError.tsx +13 -0
  412. package/src/lib/errors/ServerError.tsx +5 -0
  413. package/src/lib/errors/TopLevelError.tsx +8 -0
  414. package/src/lib/oas/graphql/index.ts +9 -5
  415. package/src/lib/oas/parser/index.ts +41 -20
  416. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +1 -1
  417. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
  418. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +139 -0
  419. package/src/lib/plugins/{api-key → api-keys}/index.tsx +16 -40
  420. package/src/lib/plugins/custom-page/index.tsx +22 -0
  421. package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
  422. package/src/lib/plugins/markdown/Toc.tsx +1 -1
  423. package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
  424. package/src/lib/plugins/markdown/index.tsx +10 -7
  425. package/src/lib/plugins/openapi/OperationList.tsx +46 -10
  426. package/src/lib/plugins/openapi/OperationListItem.tsx +68 -42
  427. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  428. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  429. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +3 -19
  430. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  431. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
  432. package/src/lib/plugins/openapi/Route.tsx +21 -0
  433. package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
  434. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  435. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  436. package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
  437. package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
  438. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  439. package/src/lib/plugins/openapi/StaggeredRender.tsx +31 -0
  440. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  441. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  442. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  443. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  444. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  445. package/src/lib/plugins/openapi/context.tsx +16 -0
  446. package/src/lib/plugins/openapi/index.tsx +59 -52
  447. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  448. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
  449. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  450. package/src/lib/plugins/openapi/playground/Playground.tsx +172 -193
  451. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +36 -0
  452. package/src/lib/plugins/openapi/playground/QueryParams.tsx +7 -2
  453. package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
  454. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  455. package/src/lib/plugins/openapi-worker.ts +1 -1
  456. package/src/lib/plugins/redirect/index.tsx +3 -4
  457. package/src/lib/ui/Callout.tsx +4 -4
  458. package/src/lib/ui/Card.tsx +1 -1
  459. package/src/lib/ui/DropdownMenu.tsx +199 -0
  460. package/src/lib/ui/button-variants.ts +1 -0
  461. package/src/lib/util/MdxComponents.tsx +7 -15
  462. package/src/lib/util/groupBy.ts +7 -12
  463. package/src/lib/util/joinPath.tsx +2 -1
  464. package/src/lib/util/logInit.ts +9 -0
  465. package/src/lib/util/objectEntries.ts +5 -0
  466. package/src/lib/util/renderIf.ts +4 -0
  467. package/dist/lib/components/Link.d.ts +0 -1
  468. package/dist/lib/components/Link.js +0 -2
  469. package/dist/lib/components/Link.js.map +0 -1
  470. package/dist/lib/components/Router.d.ts +0 -4
  471. package/dist/lib/components/Router.js +0 -20
  472. package/dist/lib/components/Router.js.map +0 -1
  473. package/dist/lib/core/helmet.d.ts +0 -4
  474. package/dist/lib/core/helmet.js +0 -5
  475. package/dist/lib/core/helmet.js.map +0 -1
  476. package/dist/lib/core/icons.d.ts +0 -1
  477. package/dist/lib/core/icons.js +0 -2
  478. package/dist/lib/core/icons.js.map +0 -1
  479. package/dist/lib/core/router.d.ts +0 -1
  480. package/dist/lib/core/router.js +0 -2
  481. package/dist/lib/core/router.js.map +0 -1
  482. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  483. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
  484. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  485. package/dist/lib/plugins/api-key/index.js.map +0 -1
  486. package/dist/lib/plugins/index.d.ts +0 -4
  487. package/dist/lib/plugins/index.js +0 -5
  488. package/dist/lib/plugins/index.js.map +0 -1
  489. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  490. package/dist/lib/plugins/openapi/Select.js +0 -5
  491. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  492. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  493. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  494. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  495. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  496. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  497. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  498. package/dist/vite/common.d.ts +0 -1
  499. package/dist/vite/common.js +0 -5
  500. package/dist/vite/common.js.map +0 -1
  501. package/dist/vite/plugin-html.d.ts +0 -3
  502. package/dist/vite/plugin-html.js +0 -47
  503. package/dist/vite/plugin-html.js.map +0 -1
  504. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  505. package/dist/vite/plugin-openapi-worker.js +0 -28
  506. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  507. package/lib/Spinner-BINYpvLB.js +0 -8412
  508. package/lib/clerk-Wslx_mPo.js +0 -19685
  509. package/lib/index-PyGcnQFX.js +0 -3462
  510. package/lib/loglevel-CoH7VSwE.js +0 -152
  511. package/lib/state-2Hu1renZ.js +0 -313
  512. package/lib/zudoku.plugins.js +0 -19892
  513. package/src/lib/components/Link.tsx +0 -1
  514. package/src/lib/components/Router.tsx +0 -28
  515. package/src/lib/core/helmet.ts +0 -5
  516. package/src/lib/core/icons.tsx +0 -1
  517. package/src/lib/core/router.tsx +0 -1
  518. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +0 -117
  519. package/src/lib/plugins/index.ts +0 -4
  520. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  521. /package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.d.ts +0 -0
  522. /package/dist/lib/plugins/{api-key → api-keys}/SettingsApiKeys.d.ts +0 -0
  523. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
@@ -0,0 +1,313 @@
1
+ import { j as e, b as j, O as v } from "./jsx-runtime-BIr0WBt_.js";
2
+ import { u as w, R as b } from "./hook-Q_gAL2NZ.js";
3
+ import { u as k, a as h, S as N, b as K, c as E, d as A, e as P, f as p } from "./Select-CEnkyfyn.js";
4
+ import { c, a as m, L as x } from "./Markdown-BjRJKl_E.js";
5
+ import { u as y, x as S, y as I } from "./DevPortalProvider-BBhQ8kgI.js";
6
+ import * as C from "react";
7
+ import { useState as D } from "react";
8
+ import { B as o, p as R } from "./Combination-lAFQBd6U.js";
9
+ /**
10
+ * @license lucide-react v0.378.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ const O = c("EyeOff", [
16
+ ["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
17
+ [
18
+ "path",
19
+ {
20
+ d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",
21
+ key: "9wicm4"
22
+ }
23
+ ],
24
+ [
25
+ "path",
26
+ { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61", key: "1jreej" }
27
+ ],
28
+ ["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
29
+ ]);
30
+ /**
31
+ * @license lucide-react v0.378.0 - ISC
32
+ *
33
+ * This source code is licensed under the ISC license.
34
+ * See the LICENSE file in the root directory of this source tree.
35
+ */
36
+ const q = c("Eye", [
37
+ ["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
38
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
39
+ ]);
40
+ /**
41
+ * @license lucide-react v0.378.0 - ISC
42
+ *
43
+ * This source code is licensed under the ISC license.
44
+ * See the LICENSE file in the root directory of this source tree.
45
+ */
46
+ const z = c("RotateCw", [
47
+ ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
48
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }]
49
+ ]);
50
+ /**
51
+ * @license lucide-react v0.378.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */
56
+ const M = c("Trash", [
57
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
58
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
59
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
60
+ ]);
61
+ var L = process.env.NODE_ENV === "production", d = "Invariant failed";
62
+ function u(t, n) {
63
+ if (!t) {
64
+ if (L)
65
+ throw new Error(d);
66
+ var a = typeof n == "function" ? n() : n, r = a ? "".concat(d, ": ").concat(a) : d;
67
+ throw new Error(r);
68
+ }
69
+ }
70
+ const f = C.forwardRef(
71
+ ({ className: t, type: n, ...a }, r) => /* @__PURE__ */ e.jsx(
72
+ "input",
73
+ {
74
+ type: n,
75
+ className: m(
76
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
77
+ t
78
+ ),
79
+ ref: r,
80
+ ...a
81
+ }
82
+ )
83
+ );
84
+ f.displayName = "Input";
85
+ const T = ({ service: t }) => {
86
+ const n = y(), a = j(), r = k({
87
+ defaultValues: {
88
+ expiresOn: "30"
89
+ }
90
+ }), i = h({
91
+ mutationFn: ({ description: s, expiresOn: l }) => {
92
+ if (!t.createKey)
93
+ throw new Error("deleteKey not implemented");
94
+ const g = l !== "never" ? V(Number(l)) : void 0;
95
+ return t.createKey(
96
+ { description: s, expiresOn: g },
97
+ n
98
+ );
99
+ },
100
+ onSuccess: () => a("/settings/api-keys/")
101
+ });
102
+ return t.createKey ? /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
103
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-between mb-4 border-b pb-1", children: /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "New API Key" }) }),
104
+ /* @__PURE__ */ e.jsx(
105
+ "form",
106
+ {
107
+ onSubmit: r.handleSubmit((s) => i.mutate(s)),
108
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col", children: [
109
+ "Note",
110
+ /* @__PURE__ */ e.jsx(f, { ...r.register("description") }),
111
+ "Expiration",
112
+ /* @__PURE__ */ e.jsxs(
113
+ N,
114
+ {
115
+ onValueChange: (s) => r.setValue("expiresOn", s),
116
+ defaultValue: r.getValues("expiresOn"),
117
+ children: [
118
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(E, {}) }),
119
+ /* @__PURE__ */ e.jsx(A, { children: /* @__PURE__ */ e.jsxs(P, { children: [
120
+ [7, 30, 60, 90].map((s) => /* @__PURE__ */ e.jsxs(p, { value: String(s), children: [
121
+ s,
122
+ " days"
123
+ ] }, s)),
124
+ /* @__PURE__ */ e.jsx(p, { value: "never", children: "Never" })
125
+ ] }) })
126
+ ]
127
+ }
128
+ ),
129
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
130
+ /* @__PURE__ */ e.jsx(o, { children: "Generate Key" }),
131
+ /* @__PURE__ */ e.jsx(o, { variant: "outline", asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/", children: "Cancel" }) })
132
+ ] })
133
+ ] })
134
+ }
135
+ )
136
+ ] }) : null;
137
+ }, V = (t) => {
138
+ const n = /* @__PURE__ */ new Date();
139
+ return n.setDate(n.getDate() + t), n.toISOString();
140
+ }, F = () => {
141
+ const t = w();
142
+ return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(v, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
143
+ "Please login first to view this page",
144
+ /* @__PURE__ */ e.jsx(o, { onClick: () => t.login(), children: "Login" })
145
+ ] }) : /* @__PURE__ */ e.jsx("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: /* @__PURE__ */ e.jsxs(R, { className: "max-w-[600px]", children: [
146
+ "Authentication needs to be enabled for API keys to work. Enable it in your Zudoku configuration under ",
147
+ /* @__PURE__ */ e.jsx("code", { children: "authentication" }),
148
+ "."
149
+ ] }) });
150
+ }, _ = ({ service: t }) => {
151
+ const n = y(), a = S(), { data: r } = I({
152
+ queryFn: () => t.getKeys(n),
153
+ queryKey: ["api-keys"],
154
+ retry: !1
155
+ }), i = h({
156
+ mutationFn: (s) => {
157
+ if (!t.deleteKey)
158
+ throw new Error("deleteKey not implemented");
159
+ return t.deleteKey(s, n);
160
+ },
161
+ onSuccess: () => {
162
+ a.invalidateQueries({ queryKey: ["api-keys"] });
163
+ }
164
+ });
165
+ return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
166
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-4 border-b pb-3", children: [
167
+ /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
168
+ t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
169
+ ] }),
170
+ r.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-4 items-center h-1/2 my-8", children: [
171
+ /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
172
+ "No API keys created yet.",
173
+ /* @__PURE__ */ e.jsx("br", {}),
174
+ "Get started and create the first one now"
175
+ ] }),
176
+ t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
177
+ ] }) : /* @__PURE__ */ e.jsx(
178
+ "ul",
179
+ {
180
+ className: m(
181
+ "grid grid-cols-1 rounded border",
182
+ "lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]"
183
+ ),
184
+ children: r.map((s) => /* @__PURE__ */ e.jsxs(
185
+ "li",
186
+ {
187
+ className: "border-b p-5 grid grid-cols-subgrid col-span-full gap-2 items-center",
188
+ children: [
189
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [
190
+ s.description ?? s.id,
191
+ /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
192
+ s.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
193
+ "Created on ",
194
+ new Date(s.createdOn).toLocaleDateString()
195
+ ] }),
196
+ s.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
197
+ "Expires on ",
198
+ new Date(s.expiresOn).toLocaleDateString()
199
+ ] })
200
+ ] })
201
+ ] }),
202
+ /* @__PURE__ */ e.jsx("div", { className: "items-center flex lg:justify-center", children: /* @__PURE__ */ e.jsx(B, { apiKey: s.key }) }),
203
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
204
+ t.rollKey && /* @__PURE__ */ e.jsx(o, { size: "icon", children: /* @__PURE__ */ e.jsx(z, { size: 16 }) }),
205
+ t.deleteKey && /* @__PURE__ */ e.jsx(
206
+ o,
207
+ {
208
+ variant: "ghost",
209
+ size: "icon",
210
+ onClick: () => {
211
+ confirm("Do you want to delete this key?") && i.mutate(s.id);
212
+ },
213
+ disabled: i.isPending,
214
+ children: /* @__PURE__ */ e.jsx(M, { size: 16 })
215
+ }
216
+ )
217
+ ] })
218
+ ]
219
+ },
220
+ s.id
221
+ ))
222
+ }
223
+ )
224
+ ] });
225
+ }, B = ({ apiKey: t }) => {
226
+ const [n, a] = D(!1);
227
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm w-full", children: [
228
+ /* @__PURE__ */ e.jsx(
229
+ "input",
230
+ {
231
+ className: "border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min",
232
+ value: n ? t : "•".repeat(t.length)
233
+ }
234
+ ),
235
+ /* @__PURE__ */ e.jsx(
236
+ o,
237
+ {
238
+ variant: "outline",
239
+ onClick: () => a((r) => !r),
240
+ size: "icon",
241
+ children: n ? /* @__PURE__ */ e.jsx(O, { size: 16 }) : /* @__PURE__ */ e.jsx(q, { size: 16 })
242
+ }
243
+ )
244
+ ] });
245
+ }, G = "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev", H = (t) => ({
246
+ deleteKey: async (n, a) => {
247
+ const r = new Request(t + `/v1/developer/api-keys/${n}`, {
248
+ method: "DELETE"
249
+ });
250
+ await a.signRequest(r);
251
+ const i = await fetch(r);
252
+ u(i.ok, "Failed to delete API key");
253
+ },
254
+ createKey: async (n, a) => {
255
+ const r = new Request(t + "/v1/developer/api-keys", {
256
+ method: "POST",
257
+ headers: {
258
+ "Content-Type": "application/json"
259
+ },
260
+ body: JSON.stringify(n)
261
+ });
262
+ await a.signRequest(r);
263
+ const i = await fetch(r);
264
+ u(i.ok, "Failed to create API key");
265
+ },
266
+ getKeys: async (n) => {
267
+ const a = new Request(t + "/v1/developer/api-keys");
268
+ await n.signRequest(a);
269
+ const r = await fetch(a);
270
+ return u(r.ok, "Failed to fetch API keys"), await r.json();
271
+ }
272
+ }), X = (t) => {
273
+ const n = "endpoint" in t ? t.endpoint : G, a = "getKeys" in t ? t : H(n);
274
+ return {
275
+ getProfileMenuItems: () => [
276
+ {
277
+ label: "API Keys",
278
+ path: "/settings/api-keys"
279
+ }
280
+ ],
281
+ getIdentities: async (r) => {
282
+ try {
283
+ return (await a.getKeys(r)).map((s) => ({
284
+ authorizeRequest: (l) => (l.headers.set("Authorization", `Bearer ${s.key}`), l),
285
+ id: s.id,
286
+ label: s.description ?? s.id
287
+ }));
288
+ } catch {
289
+ return [];
290
+ }
291
+ },
292
+ getRoutes: () => [
293
+ {
294
+ element: /* @__PURE__ */ e.jsx(F, {}),
295
+ errorElement: /* @__PURE__ */ e.jsx(b, {}),
296
+ children: [
297
+ {
298
+ path: "/settings/api-keys",
299
+ element: /* @__PURE__ */ e.jsx(_, { service: a })
300
+ },
301
+ {
302
+ path: "/settings/api-keys/new",
303
+ element: /* @__PURE__ */ e.jsx(T, { service: a })
304
+ }
305
+ ]
306
+ }
307
+ ]
308
+ };
309
+ };
310
+ export {
311
+ X as apiKeyPlugin
312
+ };
313
+ //# sourceMappingURL=zudoku.plugin-api-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-api-keys.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye-off.js","../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/eye.js","../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/rotate-cw.js","../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/trash.js","../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../src/lib/components/Input.tsx","../src/lib/plugins/api-keys/CreateApiKey.tsx","../src/lib/plugins/api-keys/ProtectedRoute.tsx","../src/lib/plugins/api-keys/SettingsApiKeys.tsx","../src/lib/plugins/api-keys/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst EyeOff = createLucideIcon(\"EyeOff\", [\n [\"path\", { d: \"M9.88 9.88a3 3 0 1 0 4.24 4.24\", key: \"1jxqfv\" }],\n [\n \"path\",\n {\n d: \"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68\",\n key: \"9wicm4\"\n }\n ],\n [\n \"path\",\n { d: \"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61\", key: \"1jreej\" }\n ],\n [\"line\", { x1: \"2\", x2: \"22\", y1: \"2\", y2: \"22\", key: \"a6p6uj\" }]\n]);\n\nexport { EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Eye = createLucideIcon(\"Eye\", [\n [\"path\", { d: \"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z\", key: \"rwhkz3\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n]);\n\nexport { Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RotateCw = createLucideIcon(\"RotateCw\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\", key: \"1p45f6\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }]\n]);\n\nexport { RotateCw as default };\n//# sourceMappingURL=rotate-cw.js.map\n","/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Trash = createLucideIcon(\"Trash\", [\n [\"path\", { d: \"M3 6h18\", key: \"d0wm0j\" }],\n [\"path\", { d: \"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6\", key: \"4alrt4\" }],\n [\"path\", { d: \"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\", key: \"v07s0e\" }]\n]);\n\nexport { Trash as default };\n//# sourceMappingURL=trash.js.map\n","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import * as React from \"react\";\nimport { cn } from \"../util/cn.js\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { useMutation } from \"@tanstack/react-query\";\nimport { useForm } from \"react-hook-form\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { useDevPortal } from \"../../components/context/DevPortalProvider.js\";\nimport { Input } from \"../../components/Input.js\";\nimport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/Select.js\";\nimport { Button } from \"../../ui/Button.js\";\nimport { ApiKeyService } from \"./index.js\";\n\ntype CreateApiKey = { description: string; expiresOn?: string };\n\nexport const CreateApiKey = ({ service }: { service: ApiKeyService }) => {\n const context = useDevPortal();\n const navigate = useNavigate();\n const form = useForm<CreateApiKey>({\n defaultValues: {\n expiresOn: \"30\",\n },\n });\n const createKeyMutation = useMutation({\n mutationFn: ({ description, expiresOn }: CreateApiKey) => {\n if (!service.createKey) {\n throw new Error(\"deleteKey not implemented\");\n }\n\n const expiresOnDate =\n expiresOn !== \"never\" ? addDaysToDate(Number(expiresOn)) : undefined;\n\n return service.createKey(\n { description: description, expiresOn: expiresOnDate },\n context,\n );\n },\n onSuccess: () => navigate(\"/settings/api-keys/\"),\n });\n\n if (!service.createKey) {\n return null;\n }\n\n return (\n <div className=\"max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]\">\n <div className=\"flex justify-between mb-4 border-b pb-1\">\n <h1 className=\"font-medium text-2xl\">New API Key</h1>\n </div>\n <form\n onSubmit={form.handleSubmit((data) => createKeyMutation.mutate(data))}\n >\n <div className=\"flex gap-2 flex-col\">\n Note\n <Input {...form.register(\"description\")} />\n Expiration\n <Select\n onValueChange={(value) => form.setValue(\"expiresOn\", value)}\n defaultValue={form.getValues(\"expiresOn\")}\n >\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectGroup>\n {[7, 30, 60, 90].map((option) => (\n <SelectItem value={String(option)} key={option}>\n {option} days\n </SelectItem>\n ))}\n <SelectItem value=\"never\">Never</SelectItem>\n </SelectGroup>\n </SelectContent>\n </Select>\n <div className=\"flex gap-2\">\n <Button>Generate Key</Button>\n <Button variant=\"outline\" asChild>\n <Link to=\"/settings/api-keys/\">Cancel</Link>\n </Button>\n </div>\n </div>\n </form>\n </div>\n );\n};\n\nconst addDaysToDate = (days: number): string => {\n const date = new Date();\n date.setDate(date.getDate() + days);\n return date.toISOString();\n};\n","import { Outlet } from \"react-router-dom\";\nimport { useAuth } from \"../../authentication/hook.js\";\nimport { DeveloperHint } from \"../../components/DeveloperHint.js\";\nimport { Button } from \"../../ui/Button.js\";\n\nexport const ProtectedRoute = () => {\n const auth = useAuth();\n\n // TODO: should we suspend here somehow?\n if (auth.isAuthEnabled && auth.isPending) {\n return null;\n }\n\n return auth.isAuthenticated ? (\n <Outlet />\n ) : !auth.isAuthEnabled ? (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n <DeveloperHint className=\"max-w-[600px]\">\n Authentication needs to be enabled for API keys to work. Enable it in\n your Zudoku configuration under <code>authentication</code>.\n </DeveloperHint>\n </div>\n ) : (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2\">\n Please login first to view this page\n <Button onClick={() => auth.login()}>Login</Button>\n </div>\n );\n};\n","import {\n useMutation,\n useQueryClient,\n useSuspenseQuery,\n} from \"@tanstack/react-query\";\nimport { EyeIcon, EyeOffIcon, RotateCwIcon, TrashIcon } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { useDevPortal } from \"../../components/context/DevPortalProvider.js\";\nimport { Button } from \"../../ui/Button.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { ApiKeyService } from \"./index.js\";\n\nexport const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {\n const context = useDevPortal();\n const queryClient = useQueryClient();\n const { data } = useSuspenseQuery({\n queryFn: () => service.getKeys(context),\n queryKey: [\"api-keys\"],\n retry: false,\n });\n\n const deleteKeyMutation = useMutation({\n mutationFn: (id: string) => {\n if (!service.deleteKey) {\n throw new Error(\"deleteKey not implemented\");\n }\n\n return service.deleteKey(id, context);\n },\n onSuccess: () => {\n void queryClient.invalidateQueries({ queryKey: [\"api-keys\"] });\n },\n });\n\n return (\n <div className=\"max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]\">\n <div className=\"flex justify-between mb-4 border-b pb-3\">\n <h1 className=\"font-medium text-2xl\">API Keys</h1>\n {service.createKey && (\n <Button asChild>\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n\n {data.length === 0 ? (\n <div className=\"flex flex-col justify-center gap-4 items-center h-1/2 my-8\">\n <div className=\"text-center\">\n No API keys created yet.\n <br />\n Get started and create the first one now\n </div>\n {service.createKey && (\n <Button asChild>\n <Link to=\"/settings/api-keys/new\">Create API Key</Link>\n </Button>\n )}\n </div>\n ) : (\n <ul\n className={cn(\n \"grid grid-cols-1 rounded border\",\n \"lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]\",\n )}\n >\n {data.map((key) => (\n <li\n className=\"border-b p-5 grid grid-cols-subgrid col-span-full gap-2 items-center\"\n key={key.id}\n >\n <div className=\"flex flex-col gap-1 text-sm\">\n {key.description ?? key.id}\n <div className=\"text-muted-foreground text-xs\">\n {key.createdOn && (\n <div>\n Created on {new Date(key.createdOn).toLocaleDateString()}\n </div>\n )}\n {key.expiresOn && (\n <div>\n Expires on {new Date(key.expiresOn).toLocaleDateString()}\n </div>\n )}\n </div>\n </div>\n <div className=\"items-center flex lg:justify-center\">\n <RevealApiKey apiKey={key.key} />\n </div>\n <div className=\"flex gap-2\">\n {service.rollKey && (\n <Button size=\"icon\">\n <RotateCwIcon size={16} />\n </Button>\n )}\n {service.deleteKey && (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n if (!confirm(\"Do you want to delete this key?\")) {\n return;\n }\n\n deleteKeyMutation.mutate(key.id);\n }}\n disabled={deleteKeyMutation.isPending}\n >\n <TrashIcon size={16} />\n </Button>\n )}\n </div>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n};\n\nconst RevealApiKey = ({ apiKey }: { apiKey: string }) => {\n const [revealed, setRevealed] = useState(false);\n\n return (\n <div className=\"flex gap-2 items-center text-sm w-full\">\n <input\n className=\"border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min\"\n value={revealed ? apiKey : \"•\".repeat(apiKey.length)}\n />\n <Button\n variant=\"outline\"\n onClick={() => setRevealed((prev) => !prev)}\n size=\"icon\"\n >\n {revealed ? <EyeOffIcon size={16} /> : <EyeIcon size={16} />}\n </Button>\n </div>\n );\n};\n","import { type RouteObject } from \"react-router-dom\";\nimport invariant from \"tiny-invariant\";\nimport { DevPortalContext } from \"../../core/DevPortalContext.js\";\nimport {\n type ApiIdentityPlugin,\n type DevPortalPlugin,\n ProfileMenuPlugin,\n} from \"../../core/plugins.js\";\nimport { RouterError } from \"../../errors/RouterError.js\";\nimport { CreateApiKey } from \"./CreateApiKey.js\";\nimport { ProtectedRoute } from \"./ProtectedRoute.js\";\nimport { SettingsApiKeys } from \"./SettingsApiKeys.js\";\n\nconst DEFAULT_API_KEY_ENDPOINT =\n \"https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev\";\n\nexport type ApiKeyService = {\n getKeys: (context: DevPortalContext) => Promise<ApiKey[]>;\n rollKey?: (id: string, context: DevPortalContext) => Promise<void>;\n deleteKey?: (id: string, context: DevPortalContext) => Promise<void>;\n updateKeyDescription?: (\n apiKey: { id: string; description: string },\n context: DevPortalContext,\n ) => Promise<void>;\n getUsage?: (apiKeys: string[], context: DevPortalContext) => Promise<void>;\n createKey?: (\n apiKey: { description: string; expiresOn?: string },\n context: DevPortalContext,\n ) => Promise<void>;\n};\n\nexport type GetApiKeysOptions = ApiKeyService | { endpoint: string } | object;\n\nexport type ApiKeyPluginOptions = object & GetApiKeysOptions;\n\nexport interface ApiKey {\n id: string;\n description?: string;\n createdOn?: string;\n updatedOn?: string;\n expiresOn?: string;\n key: string;\n}\n\nconst createDefaultHandler = (endpoint: string): ApiKeyService => {\n return {\n deleteKey: async (id, context) => {\n const request = new Request(endpoint + `/v1/developer/api-keys/${id}`, {\n method: \"DELETE\",\n });\n\n await context.signRequest(request);\n\n const response = await fetch(request);\n invariant(response.ok, \"Failed to delete API key\");\n },\n createKey: async (apiKey, context) => {\n const request = new Request(endpoint + `/v1/developer/api-keys`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(apiKey),\n });\n\n await context.signRequest(request);\n\n const response = await fetch(request);\n invariant(response.ok, \"Failed to create API key\");\n },\n getKeys: async (context) => {\n const request = new Request(endpoint + `/v1/developer/api-keys`);\n\n await context.signRequest(request);\n\n const keys = await fetch(request);\n invariant(keys.ok, \"Failed to fetch API keys\");\n\n return await keys.json();\n },\n };\n};\n\nexport const apiKeyPlugin = (\n options: ApiKeyPluginOptions,\n): DevPortalPlugin & ApiIdentityPlugin & ProfileMenuPlugin => {\n const endpoint =\n \"endpoint\" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;\n\n const service =\n \"getKeys\" in options ? options : createDefaultHandler(endpoint);\n\n return {\n getProfileMenuItems: () => [\n {\n label: \"API Keys\",\n path: \"/settings/api-keys\",\n },\n ],\n getIdentities: async (context) => {\n try {\n const keys = await service.getKeys(context);\n\n return keys.map((key) => ({\n authorizeRequest: (request) => {\n request.headers.set(\"Authorization\", `Bearer ${key.key}`);\n return request;\n },\n id: key.id,\n label: key.description ?? key.id,\n }));\n } catch {\n return [];\n }\n },\n getRoutes: (): RouteObject[] => {\n // TODO: Make lazy\n return [\n {\n element: <ProtectedRoute />,\n errorElement: <RouterError />,\n children: [\n {\n path: \"/settings/api-keys\",\n element: <SettingsApiKeys service={service} />,\n },\n {\n path: \"/settings/api-keys/new\",\n element: <CreateApiKey service={service} />,\n },\n ],\n },\n ];\n },\n };\n};\n"],"names":["EyeOff","createLucideIcon","Eye","RotateCw","Trash","isProduction","prefix","invariant","condition","message","provided","value","Input","React","className","type","props","ref","jsx","cn","CreateApiKey","service","context","useDevPortal","navigate","useNavigate","form","useForm","createKeyMutation","useMutation","description","expiresOn","expiresOnDate","addDaysToDate","jsxs","data","Select","SelectTrigger","SelectValue","SelectContent","SelectGroup","option","SelectItem","Button","Link","days","date","ProtectedRoute","auth","useAuth","Outlet","DeveloperHint","SettingsApiKeys","queryClient","useQueryClient","useSuspenseQuery","deleteKeyMutation","id","key","RevealApiKey","RotateCwIcon","TrashIcon","apiKey","revealed","setRevealed","useState","prev","EyeOffIcon","EyeIcon","DEFAULT_API_KEY_ENDPOINT","createDefaultHandler","endpoint","request","response","keys","apiKeyPlugin","options","RouterError"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAASC,EAAiB,UAAU;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,kCAAkC,KAAK,SAAQ,CAAE;AAAA,EAC/D;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACN;AAAA,EACF;AAAA,EACD;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAU;AAAA,EAC/F;AAAA,EACD,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,KAAK,SAAQ,CAAE;AAClE,CAAC;ACvBD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMC,IAAMD,EAAiB,OAAO;AAAA,EAClC,CAAC,QAAQ,EAAE,GAAG,gDAAgD,KAAK,SAAQ,CAAE;AAAA,EAC7E,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,UAAU;AAC1D,CAAC;ACZD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAME,IAAWF,EAAiB,YAAY;AAAA,EAC5C,CAAC,QAAQ,EAAE,GAAG,qDAAqD,KAAK,SAAQ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AUX,GAAe,EAAA;AAAA,QACzB,oCAAe8B,GAAY,EAAA;AAAA,QAC3B,UAAU;AAAA,UACR;AAAA,YACE,MAAM;AAAA,YACN,SAAU3D,gBAAAA,EAAA,IAAAkC,GAAA,EAAgB,SAAA/B,EAAkB,CAAA;AAAA,UAC9C;AAAA,UACA;AAAA,YACE,MAAM;AAAA,YACN,SAAUH,gBAAAA,EAAA,IAAAE,GAAA,EAAa,SAAAC,EAAkB,CAAA;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
@@ -0,0 +1,13 @@
1
+ import { j as m } from "./jsx-runtime-BIr0WBt_.js";
2
+ import { P as o } from "./Markdown-BjRJKl_E.js";
3
+ const l = (s) => ({
4
+ getRoutes: () => s.map(({ path: e, element: t }) => ({
5
+ path: e,
6
+ // TODO: we should componentize prose pages
7
+ element: /* @__PURE__ */ m.jsx("div", { className: o + " max-w-full", children: t })
8
+ }))
9
+ });
10
+ export {
11
+ l as customPagePlugin
12
+ };
13
+ //# sourceMappingURL=zudoku.plugin-custom-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-custom-page.js","sources":["../src/lib/plugins/custom-page/index.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\n\ntype CustomPageConfig = Array<{\n path: string;\n element: ReactNode;\n}>;\n\nexport const customPagePlugin = (\n config: CustomPageConfig,\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, element }) => ({\n path,\n // TODO: we should componentize prose pages\n element: <div className={ProseClasses + \" max-w-full\"}>{element}</div>,\n })),\n };\n};\n"],"names":["customPagePlugin","config","path","element","jsx","ProseClasses"],"mappings":";;AAUa,MAAAA,IAAmB,CAC9BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,SAAAC,SAAe;AAAA,IACjC,MAAAD;AAAA;AAAA,IAEA,SAAUE,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAWC,IAAe,eAAgB,UAAQF,GAAA;AAAA,EAAA,EAChE;AAAA;"}
@@ -0,0 +1,48 @@
1
+ import { j as o, N as x } from "./jsx-runtime-BIr0WBt_.js";
2
+ import { v as d, z as g, l as h } from "./DevPortalProvider-BBhQ8kgI.js";
3
+ const f = (t, e) => {
4
+ const a = Object.entries(t).flatMap(
5
+ ([n, m]) => {
6
+ const r = n.match(/pages\/(.*).mdx?$/), s = r == null ? void 0 : r.at(1);
7
+ if (!s) return [];
8
+ const i = s.split("/");
9
+ return {
10
+ path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : s,
11
+ lazy: async () => {
12
+ const { MdxPage: u } = await import("./MdxPage-DJTFOCbZ.js"), { default: c, ...l } = await m();
13
+ return {
14
+ element: /* @__PURE__ */ o.jsx(
15
+ u,
16
+ {
17
+ mdxComponent: c,
18
+ ...l,
19
+ defaultOptions: e
20
+ }
21
+ )
22
+ };
23
+ }
24
+ };
25
+ }
26
+ ), p = Array.from(
27
+ new Set(a.map((n) => n.path.split("/").at(0)))
28
+ ).map((n) => ({
29
+ path: `/${n}`,
30
+ element: /* @__PURE__ */ o.jsx(j, {})
31
+ }));
32
+ return [...a, ...p];
33
+ }, j = () => {
34
+ const t = d();
35
+ return t ? g(t, (e, a) => {
36
+ if (!("children" in e || !h(e)))
37
+ return /* @__PURE__ */ o.jsx(x, { to: a, replace: !0 });
38
+ }) : null;
39
+ }, w = ({
40
+ markdownFiles: t,
41
+ defaultOptions: e
42
+ }) => ({
43
+ getRoutes: () => f(t, e)
44
+ });
45
+ export {
46
+ w as markdownPlugin
47
+ };
48
+ //# sourceMappingURL=zudoku.plugin-markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/generateRoutes.tsx","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import { Navigate, type RouteObject } from \"react-router-dom\";\nimport { useTopNavigationItem } from \"../../components/context/DevPortalProvider.js\";\nimport { isPathItem } from \"../../components/navigation/util.js\";\nimport { traverseNavigation } from \"../../util/traverseNavigation.js\";\n\nimport {\n MarkdownPluginDefaultOptions,\n MarkdownPluginOptions,\n} from \"./index.js\";\n\nexport const generateRoutes = (\n markdownFiles: MarkdownPluginOptions[\"markdownFiles\"],\n defaultOptions?: MarkdownPluginDefaultOptions,\n): RouteObject[] => {\n const routes = Object.entries(markdownFiles).flatMap(\n ([file, importPromise]) => {\n // @todo we can pass in the folder name and then filter the markdown files based on that path\n const match = file.match(/pages\\/(.*).mdx?$/);\n const path = match?.at(1);\n\n if (!path) return [];\n\n const pathSegments = path.split(\"/\");\n const isIndexFile = pathSegments.at(-1) === \"index\";\n const routePath = isIndexFile\n ? pathSegments.slice(0, -1).join(\"/\")\n : path;\n\n return {\n path: routePath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n } satisfies RouteObject;\n },\n );\n\n const rootRoutes: RouteObject[] = Array.from(\n new Set(routes.map((route) => route.path.split(\"/\").at(0))),\n ).map((dir) => ({\n path: `/${dir}`,\n element: <Redirect />,\n }));\n\n return [...routes, ...rootRoutes];\n};\n\nconst Redirect = () => {\n const navItem = useTopNavigationItem();\n\n if (!navItem) return null;\n\n return traverseNavigation(navItem, (node, fullPath) => {\n if (\"children\" in node || !isPathItem(node)) return;\n return <Navigate to={fullPath} replace />;\n });\n};\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { generateRoutes } from \"./generateRoutes.js\";\n\nexport type MarkdownPluginOptions = {\n markdownFiles: Record<string, () => Promise<MDXImport>>;\n defaultOptions?: MarkdownPluginDefaultOptions;\n};\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = ({\n markdownFiles,\n defaultOptions,\n}: MarkdownPluginOptions): DevPortalPlugin => ({\n getRoutes: () => generateRoutes(markdownFiles, defaultOptions),\n});\n"],"names":["generateRoutes","markdownFiles","defaultOptions","routes","file","importPromise","match","path","pathSegments","MdxPage","Component","props","jsx","rootRoutes","route","dir","Redirect","navItem","useTopNavigationItem","traverseNavigation","node","fullPath","isPathItem","Navigate","markdownPlugin"],"mappings":";;AAUa,MAAAA,IAAiB,CAC5BC,GACAC,MACkB;AAClB,QAAMC,IAAS,OAAO,QAAQF,CAAa,EAAE;AAAA,IAC3C,CAAC,CAACG,GAAMC,CAAa,MAAM;AAEnB,YAAAC,IAAQF,EAAK,MAAM,mBAAmB,GACtCG,IAAOD,KAAA,gBAAAA,EAAO,GAAG;AAEnB,UAAA,CAACC,EAAM,QAAO;AAEZ,YAAAC,IAAeD,EAAK,MAAM,GAAG;AAM5B,aAAA;AAAA,QACL,MANkBC,EAAa,GAAG,EAAE,MAAM,UAExCA,EAAa,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,IAClCD;AAAA,QAIF,MAAM,YAAY;AAChB,gBAAM,EAAE,SAAAE,EAAA,IAAY,MAAM,OAAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAMN;AACxC,iBAAA;AAAA,YACL,SACEO,gBAAAA,EAAA;AAAA,cAACH;AAAA,cAAA;AAAA,gBACC,cAAcC;AAAA,gBACb,GAAGC;AAAA,gBACJ,gBAAAT;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QAGN;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA,GAGIW,IAA4B,MAAM;AAAA,IACtC,IAAI,IAAIV,EAAO,IAAI,CAACW,MAAUA,EAAM,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAAA,EAAA,EAC1D,IAAI,CAACC,OAAS;AAAA,IACd,MAAM,IAAIA,CAAG;AAAA,IACb,+BAAUC,GAAS,EAAA;AAAA,EACnB,EAAA;AAEF,SAAO,CAAC,GAAGb,GAAQ,GAAGU,CAAU;AAClC,GAEMG,IAAW,MAAM;AACrB,QAAMC,IAAUC;AAEZ,SAACD,IAEEE,EAAmBF,GAAS,CAACG,GAAMC,MAAa;AACrD,QAAI,gBAAcD,KAAQ,CAACE,EAAWF,CAAI;AAC1C,aAAQR,gBAAAA,EAAAA,IAAAW,GAAA,EAAS,IAAIF,GAAU,SAAO,GAAC,CAAA;AAAA,EAAA,CACxC,IALoB;AAMvB,GCtCaG,IAAiB,CAAC;AAAA,EAC7B,eAAAvB;AAAA,EACA,gBAAAC;AACF,OAA+C;AAAA,EAC7C,WAAW,MAAMF,EAAeC,GAAeC,CAAc;AAC/D;"}
@@ -0,0 +1,10 @@
1
+ import "./jsx-runtime-BIr0WBt_.js";
2
+ import { o as n } from "./index-BE2a6gGC.js";
3
+ import "./urql-DMlBWUKL.js";
4
+ import "zudoku/openapi-worker";
5
+ import "./Markdown-BjRJKl_E.js";
6
+ import "./router-BiRCp01d.js";
7
+ export {
8
+ n as openApiPlugin
9
+ };
10
+ //# sourceMappingURL=zudoku.plugin-openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1,11 @@
1
+ import { a as o } from "./router-BiRCp01d.js";
2
+ const i = (r) => ({
3
+ getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
+ path: e,
5
+ loader: () => o(t)
6
+ }))
7
+ });
8
+ export {
9
+ i as redirectPlugin
10
+ };
11
+ //# sourceMappingURL=zudoku.plugin-redirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\n\nexport type Redirect = {\n from: string;\n to: string;\n};\n\nexport const redirectPlugin = (options: {\n redirects: Redirect[];\n}): DevPortalPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to }) => ({\n path: from,\n loader: () => redirect(to),\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","redirect"],"mappings":";AAQa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,SAAU;AAAA,IACvC,MAAMD;AAAA,IACN,QAAQ,MAAME,EAASD,CAAE;AAAA,EAAA,EACzB;AAAA;"}