zudoku 0.3.0-dev.5 → 0.3.0-dev.51

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 (483) hide show
  1. package/dist/app/App.d.ts +1 -2
  2. package/dist/app/App.js +1 -28
  3. package/dist/app/App.js.map +1 -1
  4. package/dist/app/demo.d.ts +2 -0
  5. package/dist/app/demo.js +27 -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 +12 -0
  11. package/dist/app/entry.server.js +104 -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 +54 -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 +32 -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/app/zudoku-manifest.d.ts +1 -0
  23. package/dist/app/zudoku-manifest.js +20 -0
  24. package/dist/app/zudoku-manifest.js.map +1 -0
  25. package/dist/cli/cmds/dev.js +5 -0
  26. package/dist/cli/cmds/dev.js.map +1 -1
  27. package/dist/cli/dev/handler.d.ts +1 -0
  28. package/dist/cli/dev/handler.js +3 -1
  29. package/dist/cli/dev/handler.js.map +1 -1
  30. package/dist/config/config.d.ts +5 -39
  31. package/dist/config/validators/validate.d.ts +799 -2
  32. package/dist/config/validators/validate.js +134 -1
  33. package/dist/config/validators/validate.js.map +1 -1
  34. package/dist/internal.d.ts +1 -0
  35. package/dist/internal.js +2 -0
  36. package/dist/internal.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 +2 -2
  40. package/dist/lib/authentication/hook.d.ts +1 -0
  41. package/dist/lib/authentication/hook.js +1 -0
  42. package/dist/lib/authentication/hook.js.map +1 -1
  43. package/dist/lib/authentication/providers/auth0.js +1 -0
  44. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  45. package/dist/lib/authentication/providers/clerk.js +4 -0
  46. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  47. package/dist/lib/authentication/providers/openid.d.ts +1 -1
  48. package/dist/lib/authentication/providers/openid.js +2 -0
  49. package/dist/lib/authentication/providers/openid.js.map +1 -1
  50. package/dist/lib/authentication/state.d.ts +1 -0
  51. package/dist/lib/authentication/state.js +1 -0
  52. package/dist/lib/authentication/state.js.map +1 -1
  53. package/dist/lib/components/Bootstrap.d.ts +12 -0
  54. package/dist/lib/components/Bootstrap.js +9 -0
  55. package/dist/lib/components/Bootstrap.js.map +1 -0
  56. package/dist/lib/components/DevPortal.d.ts +4 -19
  57. package/dist/lib/components/DevPortal.js +17 -12
  58. package/dist/lib/components/DevPortal.js.map +1 -1
  59. package/dist/lib/components/ErrorPage.d.ts +6 -0
  60. package/dist/lib/components/ErrorPage.js +9 -0
  61. package/dist/lib/components/ErrorPage.js.map +1 -0
  62. package/dist/lib/components/Header.js +3 -3
  63. package/dist/lib/components/Header.js.map +1 -1
  64. package/dist/lib/components/Heading.d.ts +9 -4
  65. package/dist/lib/components/Heading.js +17 -2
  66. package/dist/lib/components/Heading.js.map +1 -1
  67. package/dist/lib/components/InlineCode.d.ts +5 -0
  68. package/dist/lib/components/InlineCode.js +4 -0
  69. package/dist/lib/components/InlineCode.js.map +1 -0
  70. package/dist/lib/components/Layout.js +3 -2
  71. package/dist/lib/components/Layout.js.map +1 -1
  72. package/dist/lib/components/NotFoundPage.d.ts +1 -0
  73. package/dist/lib/components/NotFoundPage.js +12 -0
  74. package/dist/lib/components/NotFoundPage.js.map +1 -0
  75. package/dist/lib/components/SyntaxHighlight.d.ts +3 -2
  76. package/dist/lib/components/SyntaxHighlight.js +21 -19
  77. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  78. package/dist/lib/components/TopNavigation.d.ts +1 -1
  79. package/dist/lib/components/TopNavigation.js +4 -0
  80. package/dist/lib/components/TopNavigation.js.map +1 -1
  81. package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
  82. package/dist/lib/components/context/DevPortalProvider.js +2 -2
  83. package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
  84. package/dist/lib/components/index.d.ts +28 -3
  85. package/dist/lib/components/index.js +17 -3
  86. package/dist/lib/components/index.js.map +1 -1
  87. package/dist/lib/core/DevPortalContext.d.ts +36 -11
  88. package/dist/lib/core/DevPortalContext.js +11 -12
  89. package/dist/lib/core/DevPortalContext.js.map +1 -1
  90. package/dist/lib/core/plugins.d.ts +7 -4
  91. package/dist/lib/core/plugins.js +1 -0
  92. package/dist/lib/core/plugins.js.map +1 -1
  93. package/dist/lib/errors/ErrorAlert.d.ts +3 -0
  94. package/dist/lib/errors/ErrorAlert.js +8 -0
  95. package/dist/lib/errors/ErrorAlert.js.map +1 -0
  96. package/dist/lib/errors/RouterError.d.ts +1 -0
  97. package/dist/lib/errors/RouterError.js +12 -0
  98. package/dist/lib/errors/RouterError.js.map +1 -0
  99. package/dist/lib/errors/ServerError.d.ts +3 -0
  100. package/dist/lib/errors/ServerError.js +6 -0
  101. package/dist/lib/errors/ServerError.js.map +1 -0
  102. package/dist/lib/errors/TopLevelError.d.ts +2 -0
  103. package/dist/lib/errors/TopLevelError.js +7 -0
  104. package/dist/lib/errors/TopLevelError.js.map +1 -0
  105. package/dist/lib/oas/graphql/index.js +1 -1
  106. package/dist/lib/oas/graphql/index.js.map +1 -1
  107. package/dist/lib/oas/parser/index.d.ts +1 -1
  108. package/dist/lib/oas/parser/index.js +38 -12
  109. package/dist/lib/oas/parser/index.js.map +1 -1
  110. package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +4 -0
  111. package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
  112. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
  113. package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +4 -0
  114. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +39 -0
  115. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
  116. package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +2 -3
  117. package/dist/lib/plugins/{api-key → api-keys}/index.js +15 -4
  118. package/dist/lib/plugins/api-keys/index.js.map +1 -0
  119. package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
  120. package/dist/lib/plugins/markdown/MdxPage.js +7 -6
  121. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  122. package/dist/lib/plugins/markdown/Toc.js +1 -1
  123. package/dist/lib/plugins/markdown/Toc.js.map +1 -1
  124. package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
  125. package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
  126. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
  127. package/dist/lib/plugins/markdown/index.d.ts +4 -1
  128. package/dist/lib/plugins/markdown/index.js +3 -7
  129. package/dist/lib/plugins/markdown/index.js.map +1 -1
  130. package/dist/lib/plugins/openapi/OperationList.js +16 -5
  131. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  132. package/dist/lib/plugins/openapi/OperationListItem.js +10 -5
  133. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  134. package/dist/lib/plugins/openapi/ParameterList.js +1 -1
  135. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  136. package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
  137. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  138. package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
  139. package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +5 -5
  140. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
  141. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
  142. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  143. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
  144. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  145. package/dist/lib/plugins/openapi/Route.d.ts +6 -0
  146. package/dist/lib/plugins/openapi/Route.js +8 -0
  147. package/dist/lib/plugins/openapi/Route.js.map +1 -0
  148. package/dist/lib/plugins/openapi/SchemaListView.js +6 -27
  149. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
  150. package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
  151. package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
  152. package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
  153. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
  154. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
  155. package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
  156. package/dist/lib/plugins/openapi/Sidecar.js +10 -8
  157. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  158. package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
  159. package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
  160. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
  161. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
  162. package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
  163. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
  164. package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
  165. package/dist/lib/plugins/openapi/client/createServer.js +30 -0
  166. package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
  167. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
  168. package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +15 -2
  169. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
  170. package/dist/lib/plugins/openapi/client/interfaces.d.ts +4 -0
  171. package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
  172. package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
  173. package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
  174. package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
  175. package/dist/lib/plugins/openapi/context.d.ts +5 -0
  176. package/dist/lib/plugins/openapi/context.js +11 -0
  177. package/dist/lib/plugins/openapi/context.js.map +1 -0
  178. package/dist/lib/plugins/openapi/index.d.ts +4 -18
  179. package/dist/lib/plugins/openapi/index.js +35 -20
  180. package/dist/lib/plugins/openapi/index.js.map +1 -1
  181. package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
  182. package/dist/lib/plugins/openapi/interfaces.js +2 -0
  183. package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
  184. package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
  185. package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
  186. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  187. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
  188. package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -3
  189. package/dist/lib/plugins/openapi/playground/Playground.js +8 -12
  190. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  191. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
  192. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +10 -0
  193. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
  195. package/dist/lib/plugins/openapi/playground/QueryParams.js +2 -1
  196. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  197. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
  198. package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
  199. package/dist/lib/plugins/openapi/util/prose.js +4 -0
  200. package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
  201. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  202. package/dist/lib/plugins/openapi-worker.js +1 -1
  203. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  204. package/dist/lib/plugins/redirect/index.d.ts +0 -1
  205. package/dist/lib/plugins/redirect/index.js +3 -4
  206. package/dist/lib/plugins/redirect/index.js.map +1 -1
  207. package/dist/lib/ui/Callout.js +2 -2
  208. package/dist/lib/ui/Callout.js.map +1 -1
  209. package/dist/lib/ui/button-variants.d.ts +1 -1
  210. package/dist/lib/util/MdxComponents.d.ts +2 -2
  211. package/dist/lib/util/MdxComponents.js +6 -4
  212. package/dist/lib/util/MdxComponents.js.map +1 -1
  213. package/dist/lib/util/groupBy.d.ts +1 -6
  214. package/dist/lib/util/groupBy.js +10 -8
  215. package/dist/lib/util/groupBy.js.map +1 -1
  216. package/dist/lib/util/logInit.d.ts +1 -0
  217. package/dist/lib/util/logInit.js +9 -0
  218. package/dist/lib/util/logInit.js.map +1 -0
  219. package/dist/lib/util/objectEntries.d.ts +4 -0
  220. package/dist/lib/util/objectEntries.js +2 -0
  221. package/dist/lib/util/objectEntries.js.map +1 -0
  222. package/dist/lib/util/renderIf.d.ts +1 -0
  223. package/dist/lib/util/renderIf.js +2 -0
  224. package/dist/lib/util/renderIf.js.map +1 -0
  225. package/dist/vite/build.js +26 -6
  226. package/dist/vite/build.js.map +1 -1
  227. package/dist/vite/config.d.ts +13 -12
  228. package/dist/vite/config.js +100 -55
  229. package/dist/vite/config.js.map +1 -1
  230. package/dist/vite/config.test.js +7 -4
  231. package/dist/vite/config.test.js.map +1 -1
  232. package/dist/vite/dev-server.d.ts +2 -1
  233. package/dist/vite/dev-server.js +43 -15
  234. package/dist/vite/dev-server.js.map +1 -1
  235. package/dist/vite/html.js +18 -5
  236. package/dist/vite/html.js.map +1 -1
  237. package/dist/vite/plugin-api-keys.js +7 -8
  238. package/dist/vite/plugin-api-keys.js.map +1 -1
  239. package/dist/vite/plugin-api.js +9 -20
  240. package/dist/vite/plugin-api.js.map +1 -1
  241. package/dist/vite/plugin-auth.js +5 -6
  242. package/dist/vite/plugin-auth.js.map +1 -1
  243. package/dist/vite/plugin-component.js +4 -2
  244. package/dist/vite/plugin-component.js.map +1 -1
  245. package/dist/vite/plugin-config.d.ts +0 -2
  246. package/dist/vite/plugin-config.js +2 -13
  247. package/dist/vite/plugin-config.js.map +1 -1
  248. package/dist/vite/plugin-custom-css.d.ts +6 -0
  249. package/dist/vite/plugin-custom-css.js +55 -0
  250. package/dist/vite/plugin-custom-css.js.map +1 -0
  251. package/dist/vite/plugin-docs.js +15 -5
  252. package/dist/vite/plugin-docs.js.map +1 -1
  253. package/dist/vite/plugin-docs.test.js +1 -1
  254. package/dist/vite/plugin-docs.test.js.map +1 -1
  255. package/dist/vite/plugin-mdx.d.ts +3 -1
  256. package/dist/vite/plugin-mdx.js +5 -5
  257. package/dist/vite/plugin-mdx.js.map +1 -1
  258. package/dist/vite/plugin-metadata.js +1 -1
  259. package/dist/vite/plugin-metadata.js.map +1 -1
  260. package/dist/vite/plugin-redirect.js +10 -10
  261. package/dist/vite/plugin-redirect.js.map +1 -1
  262. package/dist/vite/plugin.js +3 -5
  263. package/dist/vite/plugin.js.map +1 -1
  264. package/dist/vite/prerender.d.ts +17 -0
  265. package/dist/vite/prerender.js +55 -0
  266. package/dist/vite/prerender.js.map +1 -0
  267. package/lib/AnchorLink-CZUp-F0P.js +705 -0
  268. package/lib/AnchorLink-CZUp-F0P.js.map +1 -0
  269. package/lib/DevPortalProvider-Do9oJqme.js +1081 -0
  270. package/lib/DevPortalProvider-Do9oJqme.js.map +1 -0
  271. package/lib/Markdown-Dbzrtopg.js +15030 -0
  272. package/lib/Markdown-Dbzrtopg.js.map +1 -0
  273. package/lib/MdxPage-JvboTsbK.js +190 -0
  274. package/lib/MdxPage-JvboTsbK.js.map +1 -0
  275. package/lib/OperationList-DGdaixGa.js +5562 -0
  276. package/lib/OperationList-DGdaixGa.js.map +1 -0
  277. package/lib/Route-C1LyvITr.js +13 -0
  278. package/lib/Route-C1LyvITr.js.map +1 -0
  279. package/lib/Select-DHm1jDdS.js +4571 -0
  280. package/lib/Select-DHm1jDdS.js.map +1 -0
  281. package/lib/Spinner-BSk0ImmP.js +182 -0
  282. package/lib/Spinner-BSk0ImmP.js.map +1 -0
  283. package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
  284. package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
  285. package/lib/assets/index-BPdJm2ty.js +1 -0
  286. package/lib/assets/index-BPdJm2ty.js.map +1 -0
  287. package/lib/assets/{worker-BCcpCNJ7.js → worker-BjPv-hjP.js} +10742 -10318
  288. package/lib/assets/worker-BjPv-hjP.js.map +1 -0
  289. package/lib/context-_fYfJFgk.js +14 -0
  290. package/lib/context-_fYfJFgk.js.map +1 -0
  291. package/lib/hook-CGFJQf_n.js +77 -0
  292. package/lib/hook-CGFJQf_n.js.map +1 -0
  293. package/lib/index-CXXn0D4E.js +412 -0
  294. package/lib/index-CXXn0D4E.js.map +1 -0
  295. package/lib/index-DSZ4Cj5q.js +725 -0
  296. package/lib/index-DSZ4Cj5q.js.map +1 -0
  297. package/lib/index-pI9JkN46.js +4765 -0
  298. package/lib/index-pI9JkN46.js.map +1 -0
  299. package/lib/jsx-runtime-CJZJivg2.js +1526 -0
  300. package/lib/jsx-runtime-CJZJivg2.js.map +1 -0
  301. package/lib/prism-bash.min-DadFsM4Z.js +1 -0
  302. package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
  303. package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
  304. package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
  305. package/lib/prism-java.min-d5iT_mOd.js +1 -0
  306. package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
  307. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  308. package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
  309. package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
  310. package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
  311. package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
  312. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
  313. package/lib/prism-php.min-o7FpoMP_.js +1 -0
  314. package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
  315. package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
  316. package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
  317. package/lib/router-CBw2vqJE.js +2973 -0
  318. package/lib/router-CBw2vqJE.js.map +1 -0
  319. package/lib/slugify-CiPVjteN.js +28 -0
  320. package/lib/slugify-CiPVjteN.js.map +1 -0
  321. package/lib/state-DKdaQzvh.js +288 -0
  322. package/lib/state-DKdaQzvh.js.map +1 -0
  323. package/lib/urql-DMlBWUKL.js +1 -0
  324. package/lib/urql-DMlBWUKL.js.map +1 -0
  325. package/lib/util-_jwUlTBU.js +41 -0
  326. package/lib/util-_jwUlTBU.js.map +1 -0
  327. package/lib/zudoku.auth-auth0.js +3 -1
  328. package/lib/zudoku.auth-auth0.js.map +1 -0
  329. package/lib/zudoku.auth-clerk.js +11 -8
  330. package/lib/zudoku.auth-clerk.js.map +1 -0
  331. package/lib/zudoku.auth-openid.js +8 -4
  332. package/lib/zudoku.auth-openid.js.map +1 -0
  333. package/lib/zudoku.components.js +806 -451
  334. package/lib/zudoku.components.js.map +1 -0
  335. package/lib/zudoku.openapi-worker.js +15032 -146
  336. package/lib/zudoku.openapi-worker.js.map +1 -0
  337. package/lib/zudoku.plugin-api-keys.js +302 -0
  338. package/lib/zudoku.plugin-api-keys.js.map +1 -0
  339. package/lib/zudoku.plugin-markdown.js +49 -0
  340. package/lib/zudoku.plugin-markdown.js.map +1 -0
  341. package/lib/zudoku.plugin-openapi.js +10 -0
  342. package/lib/zudoku.plugin-openapi.js.map +1 -0
  343. package/lib/zudoku.plugin-redirect.js +11 -0
  344. package/lib/zudoku.plugin-redirect.js.map +1 -0
  345. package/package.json +37 -15
  346. package/src/app/App.tsx +0 -40
  347. package/src/app/demo-cdn.html +26 -0
  348. package/src/app/demo.html +18 -0
  349. package/src/app/demo.tsx +40 -0
  350. package/src/app/entry.client.tsx +47 -0
  351. package/src/app/entry.server.tsx +158 -0
  352. package/src/app/main.css +74 -0
  353. package/src/app/main.tsx +71 -15
  354. package/src/app/standalone.html +20 -0
  355. package/src/app/standalone.tsx +46 -0
  356. package/src/app/tailwind.ts +2 -6
  357. package/src/app/zudoku-manifest.ts +22 -0
  358. package/src/lib/authentication/Callback.tsx +1 -1
  359. package/src/lib/authentication/authentication.ts +2 -5
  360. package/src/lib/authentication/hook.ts +1 -0
  361. package/src/lib/authentication/providers/auth0.tsx +1 -0
  362. package/src/lib/authentication/providers/clerk.tsx +3 -0
  363. package/src/lib/authentication/providers/openid.tsx +3 -1
  364. package/src/lib/authentication/state.ts +2 -0
  365. package/src/lib/components/Bootstrap.tsx +37 -0
  366. package/src/lib/components/DevPortal.tsx +41 -56
  367. package/src/lib/components/ErrorPage.tsx +28 -0
  368. package/src/lib/components/Header.tsx +13 -7
  369. package/src/lib/components/Heading.tsx +26 -7
  370. package/src/lib/components/InlineCode.tsx +19 -0
  371. package/src/lib/components/Layout.tsx +9 -7
  372. package/src/lib/components/NotFoundPage.tsx +39 -0
  373. package/src/lib/components/SyntaxHighlight.tsx +27 -19
  374. package/src/lib/components/TopNavigation.tsx +5 -0
  375. package/src/lib/components/context/DevPortalProvider.ts +2 -2
  376. package/src/lib/components/index.ts +21 -3
  377. package/src/lib/core/DevPortalContext.ts +47 -28
  378. package/src/lib/core/plugins.ts +10 -5
  379. package/src/lib/errors/ErrorAlert.tsx +21 -0
  380. package/src/lib/errors/RouterError.tsx +13 -0
  381. package/src/lib/errors/ServerError.tsx +5 -0
  382. package/src/lib/errors/TopLevelError.tsx +8 -0
  383. package/src/lib/oas/graphql/index.ts +2 -2
  384. package/src/lib/oas/parser/index.ts +41 -20
  385. package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -8
  386. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +139 -0
  387. package/src/lib/plugins/{api-key → api-keys}/index.tsx +22 -9
  388. package/src/lib/plugins/markdown/MdxPage.tsx +51 -34
  389. package/src/lib/plugins/markdown/Toc.tsx +1 -1
  390. package/src/lib/plugins/markdown/generateRoutes.tsx +16 -6
  391. package/src/lib/plugins/markdown/index.tsx +10 -7
  392. package/src/lib/plugins/openapi/OperationList.tsx +40 -4
  393. package/src/lib/plugins/openapi/OperationListItem.tsx +69 -42
  394. package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
  395. package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
  396. package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +4 -4
  397. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
  398. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
  399. package/src/lib/plugins/openapi/Route.tsx +21 -0
  400. package/src/lib/plugins/openapi/SchemaListView.tsx +23 -192
  401. package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
  402. package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
  403. package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
  404. package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
  405. package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
  406. package/src/lib/plugins/openapi/client/createServer.ts +33 -0
  407. package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +21 -2
  408. package/src/lib/plugins/openapi/client/interfaces.ts +5 -0
  409. package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
  410. package/src/lib/plugins/openapi/context.tsx +16 -0
  411. package/src/lib/plugins/openapi/index.tsx +59 -52
  412. package/src/lib/plugins/openapi/interfaces.ts +9 -0
  413. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
  414. package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
  415. package/src/lib/plugins/openapi/playground/Playground.tsx +158 -193
  416. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +34 -0
  417. package/src/lib/plugins/openapi/playground/QueryParams.tsx +7 -2
  418. package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
  419. package/src/lib/plugins/openapi/util/prose.ts +7 -0
  420. package/src/lib/plugins/openapi-worker.ts +1 -1
  421. package/src/lib/plugins/redirect/index.tsx +3 -4
  422. package/src/lib/ui/Callout.tsx +4 -4
  423. package/src/lib/util/MdxComponents.tsx +6 -14
  424. package/src/lib/util/groupBy.ts +7 -12
  425. package/src/lib/util/logInit.ts +9 -0
  426. package/src/lib/util/objectEntries.ts +5 -0
  427. package/src/lib/util/renderIf.ts +4 -0
  428. package/dist/lib/components/Link.d.ts +0 -1
  429. package/dist/lib/components/Link.js +0 -2
  430. package/dist/lib/components/Link.js.map +0 -1
  431. package/dist/lib/components/Router.d.ts +0 -4
  432. package/dist/lib/components/Router.js +0 -20
  433. package/dist/lib/components/Router.js.map +0 -1
  434. package/dist/lib/core/helmet.d.ts +0 -4
  435. package/dist/lib/core/helmet.js +0 -5
  436. package/dist/lib/core/helmet.js.map +0 -1
  437. package/dist/lib/core/icons.d.ts +0 -1
  438. package/dist/lib/core/icons.js +0 -2
  439. package/dist/lib/core/icons.js.map +0 -1
  440. package/dist/lib/core/router.d.ts +0 -1
  441. package/dist/lib/core/router.js +0 -2
  442. package/dist/lib/core/router.js.map +0 -1
  443. package/dist/lib/plugins/api-key/CreateApiKey.d.ts +0 -5
  444. package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
  445. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +0 -5
  446. package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -37
  447. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
  448. package/dist/lib/plugins/api-key/index.js.map +0 -1
  449. package/dist/lib/plugins/index.d.ts +0 -4
  450. package/dist/lib/plugins/index.js +0 -5
  451. package/dist/lib/plugins/index.js.map +0 -1
  452. package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
  453. package/dist/lib/plugins/openapi/Select.js +0 -5
  454. package/dist/lib/plugins/openapi/Select.js.map +0 -1
  455. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
  456. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  457. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
  458. package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
  459. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
  460. package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
  461. package/dist/vite/common.d.ts +0 -1
  462. package/dist/vite/common.js +0 -5
  463. package/dist/vite/common.js.map +0 -1
  464. package/dist/vite/plugin-html.d.ts +0 -3
  465. package/dist/vite/plugin-html.js +0 -47
  466. package/dist/vite/plugin-html.js.map +0 -1
  467. package/dist/vite/plugin-openapi-worker.d.ts +0 -4
  468. package/dist/vite/plugin-openapi-worker.js +0 -28
  469. package/dist/vite/plugin-openapi-worker.js.map +0 -1
  470. package/lib/Spinner-DWHrSHMP.js +0 -8411
  471. package/lib/clerk-Wslx_mPo.js +0 -19685
  472. package/lib/index-DNx3xWa2.js +0 -3461
  473. package/lib/state-DfftBQ9X.js +0 -312
  474. package/lib/zudoku.plugins.js +0 -19873
  475. package/src/lib/components/Link.tsx +0 -1
  476. package/src/lib/components/Router.tsx +0 -28
  477. package/src/lib/core/helmet.ts +0 -5
  478. package/src/lib/core/icons.tsx +0 -1
  479. package/src/lib/core/router.tsx +0 -1
  480. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +0 -122
  481. package/src/lib/plugins/index.ts +0 -4
  482. package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
  483. /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
@@ -0,0 +1,302 @@
1
+ import { j as e, a as j, O as v } from "./jsx-runtime-CJZJivg2.js";
2
+ import { R as b, u as w } from "./hook-CGFJQf_n.js";
3
+ import { u as N, a as m, S as k, b as K, c as E, d as S, e as A, f as p, B as o } from "./Select-DHm1jDdS.js";
4
+ import { c as l, e as h, L as x } from "./Markdown-Dbzrtopg.js";
5
+ import { u as y, q as C, t as P } from "./DevPortalProvider-Do9oJqme.js";
6
+ import * as R from "react";
7
+ import { useState as D } from "react";
8
+ /**
9
+ * @license lucide-react v0.378.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const I = l("EyeOff", [
15
+ ["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
16
+ [
17
+ "path",
18
+ {
19
+ 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",
20
+ key: "9wicm4"
21
+ }
22
+ ],
23
+ [
24
+ "path",
25
+ { 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" }
26
+ ],
27
+ ["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
28
+ ]);
29
+ /**
30
+ * @license lucide-react v0.378.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */
35
+ const O = l("Eye", [
36
+ ["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
37
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
38
+ ]);
39
+ /**
40
+ * @license lucide-react v0.378.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */
45
+ const q = l("RotateCw", [
46
+ ["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
47
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }]
48
+ ]);
49
+ /**
50
+ * @license lucide-react v0.378.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */
55
+ const z = l("Trash", [
56
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
57
+ ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
58
+ ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
59
+ ]);
60
+ var M = process.env.NODE_ENV === "production", d = "Invariant failed";
61
+ function u(t, r) {
62
+ if (!t) {
63
+ if (M)
64
+ throw new Error(d);
65
+ var a = typeof r == "function" ? r() : r, n = a ? "".concat(d, ": ").concat(a) : d;
66
+ throw new Error(n);
67
+ }
68
+ }
69
+ const f = R.forwardRef(
70
+ ({ className: t, type: r, ...a }, n) => /* @__PURE__ */ e.jsx(
71
+ "input",
72
+ {
73
+ type: r,
74
+ className: h(
75
+ "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",
76
+ t
77
+ ),
78
+ ref: n,
79
+ ...a
80
+ }
81
+ )
82
+ );
83
+ f.displayName = "Input";
84
+ const L = ({ service: t }) => {
85
+ const r = y(), a = j(), n = N({
86
+ defaultValues: {
87
+ expiresOn: "30"
88
+ }
89
+ }), i = m({
90
+ mutationFn: ({ description: s, expiresOn: c }) => {
91
+ if (!t.createKey)
92
+ throw new Error("deleteKey not implemented");
93
+ const g = c !== "never" ? T(Number(c)) : void 0;
94
+ return t.createKey(
95
+ { description: s, expiresOn: g },
96
+ r
97
+ );
98
+ },
99
+ onSuccess: () => a("/settings/api-keys/")
100
+ });
101
+ return t.createKey ? /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
102
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-between mb-4 border-b border-border pb-1", children: /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "New API Key" }) }),
103
+ /* @__PURE__ */ e.jsx(
104
+ "form",
105
+ {
106
+ onSubmit: n.handleSubmit((s) => i.mutate(s)),
107
+ children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col", children: [
108
+ "Note",
109
+ /* @__PURE__ */ e.jsx(f, { ...n.register("description") }),
110
+ "Expiration",
111
+ /* @__PURE__ */ e.jsxs(
112
+ k,
113
+ {
114
+ onValueChange: (s) => n.setValue("expiresOn", s),
115
+ defaultValue: n.getValues("expiresOn"),
116
+ children: [
117
+ /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(E, {}) }),
118
+ /* @__PURE__ */ e.jsx(S, { children: /* @__PURE__ */ e.jsxs(A, { children: [
119
+ [7, 30, 60, 90].map((s) => /* @__PURE__ */ e.jsxs(p, { value: String(s), children: [
120
+ s,
121
+ " days"
122
+ ] }, s)),
123
+ /* @__PURE__ */ e.jsx(p, { value: "never", children: "Never" })
124
+ ] }) })
125
+ ]
126
+ }
127
+ ),
128
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
129
+ /* @__PURE__ */ e.jsx(o, { children: "Generate Key" }),
130
+ /* @__PURE__ */ e.jsx(o, { variant: "outline", asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/", children: "Cancel" }) })
131
+ ] })
132
+ ] })
133
+ }
134
+ )
135
+ ] }) : null;
136
+ }, T = (t) => {
137
+ const r = /* @__PURE__ */ new Date();
138
+ return r.setDate(r.getDate() + t), r.toISOString();
139
+ }, V = ({ service: t }) => {
140
+ const r = y(), a = C(), { data: n } = P({
141
+ queryFn: () => t.getKeys(r),
142
+ queryKey: ["api-keys"],
143
+ retry: !1
144
+ }), i = m({
145
+ mutationFn: (s) => {
146
+ if (!t.deleteKey)
147
+ throw new Error("deleteKey not implemented");
148
+ return t.deleteKey(s, r);
149
+ },
150
+ onSuccess: () => {
151
+ a.invalidateQueries({ queryKey: ["api-keys"] });
152
+ }
153
+ });
154
+ return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
155
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-4 border-b border-border pb-3", children: [
156
+ /* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
157
+ t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
158
+ ] }),
159
+ n.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-4 items-center h-1/2 my-8", children: [
160
+ /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
161
+ "No API keys created yet.",
162
+ /* @__PURE__ */ e.jsx("br", {}),
163
+ "Get started and create the first one now"
164
+ ] }),
165
+ t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
166
+ ] }) : /* @__PURE__ */ e.jsx(
167
+ "ul",
168
+ {
169
+ className: h(
170
+ "grid grid-cols-1 rounded border-border border",
171
+ "lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]"
172
+ ),
173
+ children: n.map((s) => /* @__PURE__ */ e.jsxs(
174
+ "li",
175
+ {
176
+ className: "border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center",
177
+ children: [
178
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [
179
+ s.description ?? s.id,
180
+ /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
181
+ s.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
182
+ "Created on ",
183
+ new Date(s.createdOn).toLocaleDateString()
184
+ ] }),
185
+ s.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
186
+ "Expires on ",
187
+ new Date(s.expiresOn).toLocaleDateString()
188
+ ] })
189
+ ] })
190
+ ] }),
191
+ /* @__PURE__ */ e.jsx("div", { className: "items-center flex lg:justify-center", children: /* @__PURE__ */ e.jsx(F, { apiKey: s.key }) }),
192
+ /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
193
+ t.rollKey && /* @__PURE__ */ e.jsx(o, { size: "icon", children: /* @__PURE__ */ e.jsx(q, { size: 16 }) }),
194
+ t.deleteKey && /* @__PURE__ */ e.jsx(
195
+ o,
196
+ {
197
+ variant: "ghost",
198
+ size: "icon",
199
+ onClick: () => {
200
+ confirm("Do you want to delete this key?") && i.mutate(s.id);
201
+ },
202
+ disabled: i.isPending,
203
+ children: /* @__PURE__ */ e.jsx(z, { size: 16 })
204
+ }
205
+ )
206
+ ] })
207
+ ]
208
+ },
209
+ s.id
210
+ ))
211
+ }
212
+ )
213
+ ] });
214
+ }, F = ({ apiKey: t }) => {
215
+ const [r, a] = D(!1);
216
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm w-full", children: [
217
+ /* @__PURE__ */ e.jsx(
218
+ "input",
219
+ {
220
+ className: "border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono max-w-min",
221
+ value: r ? t : "•".repeat(t.length)
222
+ }
223
+ ),
224
+ /* @__PURE__ */ e.jsx(
225
+ o,
226
+ {
227
+ variant: "outline",
228
+ onClick: () => a((n) => !n),
229
+ size: "icon",
230
+ children: r ? /* @__PURE__ */ e.jsx(I, { size: 16 }) : /* @__PURE__ */ e.jsx(O, { size: 16 })
231
+ }
232
+ )
233
+ ] });
234
+ }, _ = "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev", B = (t) => ({
235
+ deleteKey: async (r, a) => {
236
+ const n = new Request(t + `/v1/developer/api-keys/${r}`, {
237
+ method: "DELETE"
238
+ });
239
+ await a.signRequest(n);
240
+ const i = await fetch(n);
241
+ u(i.ok, "Failed to delete API key");
242
+ },
243
+ createKey: async (r, a) => {
244
+ const n = new Request(t + "/v1/developer/api-keys", {
245
+ method: "POST",
246
+ headers: {
247
+ "Content-Type": "application/json"
248
+ },
249
+ body: JSON.stringify(r)
250
+ });
251
+ await a.signRequest(n);
252
+ const i = await fetch(n);
253
+ u(i.ok, "Failed to create API key");
254
+ },
255
+ getKeys: async (r) => {
256
+ const a = new Request(t + "/v1/developer/api-keys");
257
+ await r.signRequest(a);
258
+ const n = await fetch(a);
259
+ return u(n.ok, "Failed to fetch API keys"), await n.json();
260
+ }
261
+ }), G = () => {
262
+ const t = w();
263
+ return t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(v, {}) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2 my-12", children: [
264
+ "Please login first to view this page",
265
+ /* @__PURE__ */ e.jsx(o, { onClick: () => t.login(), children: "Login" })
266
+ ] });
267
+ }, Z = (t) => {
268
+ const r = "endpoint" in t ? t.endpoint : _, a = "getKeys" in t ? t : B(r);
269
+ return {
270
+ getIdentities: async (n) => {
271
+ try {
272
+ return (await a.getKeys(n)).map((s) => ({
273
+ authorizeRequest: (c) => (c.headers.set("Authorization", `Bearer ${s.key}`), c),
274
+ id: s.id,
275
+ label: s.description ?? s.id
276
+ }));
277
+ } catch {
278
+ return [];
279
+ }
280
+ },
281
+ getRoutes: () => [
282
+ {
283
+ element: /* @__PURE__ */ e.jsx(G, {}),
284
+ errorElement: /* @__PURE__ */ e.jsx(b, {}),
285
+ children: [
286
+ {
287
+ path: "/settings/api-keys",
288
+ element: /* @__PURE__ */ e.jsx(V, { service: a })
289
+ },
290
+ {
291
+ path: "/settings/api-keys/new",
292
+ element: /* @__PURE__ */ e.jsx(L, { service: a })
293
+ }
294
+ ]
295
+ }
296
+ ]
297
+ };
298
+ };
299
+ export {
300
+ Z as apiKeyPlugin
301
+ };
302
+ //# 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/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 border-border 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 {\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 border-border 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-border border\",\n \"lg:grid-cols-[minmax(250px,min-content)_1fr_min-content]\",\n )}\n >\n {data.map((key) => (\n <li\n className=\"border-b border-border 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 border-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 { Outlet, type RouteObject } from \"react-router-dom\";\nimport invariant from \"tiny-invariant\";\nimport { useAuth } from \"../../authentication/hook.js\";\nimport { DevPortalContext } from \"../../core/DevPortalContext.js\";\nimport {\n type ApiIdentityPlugin,\n type DevPortalPlugin,\n} from \"../../core/plugins.js\";\nimport { RouterError } from \"../../errors/RouterError.js\";\nimport { Button } from \"../../ui/Button.js\";\nimport { CreateApiKey } from \"./CreateApiKey.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\nconst ProtectedRoute = () => {\n const auth = useAuth();\n\n // TODO: should we suspend here somehow?\n if (auth.isPending) {\n return null;\n }\n\n return auth.isAuthenticated ? (\n <Outlet />\n ) : (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2 my-12\">\n Please login first to view this page\n <Button onClick={() => auth.login()}>Login</Button>\n </div>\n );\n};\n\nexport const apiKeyPlugin = (\n options: ApiKeyPluginOptions,\n): DevPortalPlugin & ApiIdentityPlugin => {\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 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","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","ProtectedRoute","auth","useAuth","Outlet","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;AAA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H,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,49 @@
1
+ import { j as s, N as x } from "./jsx-runtime-CJZJivg2.js";
2
+ import { k as d } from "./DevPortalProvider-Do9oJqme.js";
3
+ import { t as f, i as g } from "./util-_jwUlTBU.js";
4
+ const h = (t, e) => {
5
+ const r = Object.entries(t).flatMap(
6
+ ([n, m]) => {
7
+ const a = n.match(/pages\/(.*).mdx?$/), o = a == null ? void 0 : a.at(1);
8
+ if (!o) return [];
9
+ const i = o.split("/");
10
+ return {
11
+ path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : o,
12
+ lazy: async () => {
13
+ const { MdxPage: u } = await import("./MdxPage-JvboTsbK.js"), { default: c, ...l } = await m();
14
+ return {
15
+ element: /* @__PURE__ */ s.jsx(
16
+ u,
17
+ {
18
+ mdxComponent: c,
19
+ ...l,
20
+ defaultOptions: e
21
+ }
22
+ )
23
+ };
24
+ }
25
+ };
26
+ }
27
+ ), p = Array.from(
28
+ new Set(r.map((n) => n.path.split("/").at(0)))
29
+ ).map((n) => ({
30
+ path: `/${n}`,
31
+ element: /* @__PURE__ */ s.jsx(j, {})
32
+ }));
33
+ return [...r, ...p];
34
+ }, j = () => {
35
+ const t = d();
36
+ return t ? f(t, (e, r) => {
37
+ if (!("children" in e || !g(e)))
38
+ return /* @__PURE__ */ s.jsx(x, { to: r, replace: !0 });
39
+ }) : null;
40
+ }, N = ({
41
+ markdownFiles: t,
42
+ defaultOptions: e
43
+ }) => ({
44
+ getRoutes: () => h(t, e)
45
+ });
46
+ export {
47
+ N as markdownPlugin
48
+ };
49
+ //# 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-CJZJivg2.js";
2
+ import { o as n } from "./index-DSZ4Cj5q.js";
3
+ import "./urql-DMlBWUKL.js";
4
+ import "zudoku/openapi-worker";
5
+ import "./Markdown-Dbzrtopg.js";
6
+ import "./router-CBw2vqJE.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 { q as o } from "./router-CBw2vqJE.js";
2
+ const a = (r) => ({
3
+ getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
+ path: e,
5
+ loader: () => o(t)
6
+ }))
7
+ });
8
+ export {
9
+ a 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;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.3.0-dev.5",
3
+ "version": "0.3.0-dev.51",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -18,6 +18,9 @@
18
18
  ".": {
19
19
  "import": "./dist/index.js"
20
20
  },
21
+ "./internal": {
22
+ "import": "./dist/internal.js"
23
+ },
21
24
  "./auth/clerk": {
22
25
  "import": "./lib/zudoku.auth-clerk.js"
23
26
  },
@@ -27,8 +30,17 @@
27
30
  "./auth/openid": {
28
31
  "import": "./lib/zudoku.auth-openid.js"
29
32
  },
30
- "./plugins": {
31
- "import": "./lib/zudoku.plugins.js"
33
+ "./plugins/api-keys": {
34
+ "import": "./lib/zudoku.plugin-api-keys.js"
35
+ },
36
+ "./plugins/markdown": {
37
+ "import": "./lib/zudoku.plugin-markdown.js"
38
+ },
39
+ "./plugins/openapi": {
40
+ "import": "./lib/zudoku.plugin-openapi.js"
41
+ },
42
+ "./plugins/redirect": {
43
+ "import": "./lib/zudoku.plugin-redirect.js"
32
44
  },
33
45
  "./openapi-worker": {
34
46
  "import": "./lib/zudoku.openapi-worker.js"
@@ -53,22 +65,27 @@
53
65
  }
54
66
  },
55
67
  "dependencies": {
68
+ "@envelop/core": "5.0.1",
56
69
  "@graphql-typed-document-node/core": "3.2.0",
70
+ "@hiogawa/vite-plugin-ssr-css": "0.0.0",
57
71
  "@lekoarts/rehype-meta-as-attributes": "3.0.1",
58
72
  "@mdx-js/react": "3.0.1",
59
73
  "@mdx-js/rollup": "3.0.1",
60
74
  "@monaco-editor/react": "^4.6.0",
61
75
  "@pothos/core": "3.41.0",
76
+ "@radix-ui/react-collapsible": "1.1.0",
62
77
  "@radix-ui/react-select": "2.1.1",
63
78
  "@radix-ui/react-visually-hidden": "1.1.0",
64
79
  "@sentry/node": "8.11.0",
65
80
  "@stefanprobst/rehype-extract-toc": "2.2.0",
66
81
  "@tailwindcss/typography": "0.5.13",
82
+ "@tanstack/react-query": "5.50.1",
67
83
  "@vitejs/plugin-react": "4.3.1",
84
+ "@zudoku/react-helmet-async": "2.0.4",
68
85
  "autoprefixer": "10.4.19",
69
86
  "chokidar": "^3.6.0",
87
+ "class-variance-authority": "0.7.0",
70
88
  "dotenv": "16.4.5",
71
- "esbuild": "0.23.0",
72
89
  "express": "4.19.2",
73
90
  "graphql": "16.9.0",
74
91
  "graphql-type-json": "0.3.2",
@@ -85,8 +102,9 @@
85
102
  "prismjs": "1.29.0",
86
103
  "react": "18.3.1",
87
104
  "react-dom": "18.3.1",
88
- "react-helmet-async": "2.0.5",
105
+ "react-error-boundary": "^4.0.13",
89
106
  "react-hook-form": "^7.52.1",
107
+ "react-is": "18.3.1",
90
108
  "react-markdown": "9.0.1",
91
109
  "react-router-dom": "6.24.1",
92
110
  "rehype-slug": "6.0.0",
@@ -96,47 +114,49 @@
96
114
  "remark-frontmatter": "5.0.0",
97
115
  "remark-gfm": "4.0.0",
98
116
  "remark-mdx-frontmatter": "5.0.0",
117
+ "rollup": "^4.18.1",
99
118
  "semver": "7.6.2",
100
119
  "slugify": "1.6.6",
101
120
  "strip-ansi": "7.1.0",
121
+ "tailwind-merge": "2.3.0",
102
122
  "tailwindcss": "3.4.4",
123
+ "tiny-invariant": "1.3.3",
103
124
  "ulidx": "^2.3.0",
104
125
  "unist-util-visit": "5.0.0",
105
126
  "urql": "4.1.0",
106
127
  "vite": "5.3.3",
107
128
  "yaml": "2.4.1",
108
- "yargs": "17.7.2"
129
+ "yargs": "17.7.2",
130
+ "zod": "3.23.8",
131
+ "zod-validation-error": "3.3.0",
132
+ "zustand": "4.5.4"
109
133
  },
110
134
  "devDependencies": {
111
- "@radix-ui/react-collapsible": "1.1.0",
112
135
  "@radix-ui/react-dialog": "1.1.1",
113
136
  "@radix-ui/react-slot": "1.1.0",
114
137
  "@radix-ui/react-tabs": "1.1.0",
115
- "@tanstack/react-query": "5.50.1",
116
138
  "@types/express": "^4.17.21",
117
139
  "@types/har-format": "^1.2.15",
118
140
  "@types/json-schema": "7.0.15",
119
- "@types/loglevel": "^1.6.3",
120
141
  "@types/mdx": "2.0.13",
121
142
  "@types/node": "20.12.10",
122
143
  "@types/object-hash": "^3.0.6",
123
144
  "@types/react": "18.3.3",
124
145
  "@types/react-dom": "18.3.0",
146
+ "@types/react-is": "18.3.0",
147
+ "@types/rollup": "^0.54.0",
125
148
  "@types/semver": "^7.5.8",
126
149
  "@types/yargs": "^17.0.32",
127
150
  "@zudoku/httpsnippet": "10.0.9",
128
- "class-variance-authority": "0.7.0",
129
151
  "clsx": "2.1.1",
130
152
  "lucide-react": "0.378.0",
131
153
  "oauth4webapi": "2.11.1",
132
154
  "prism-react-renderer": "2.3.1",
133
155
  "prismjs": "1.29.0",
134
- "react-helmet-async": "2.0.5",
135
156
  "react-markdown": "9.0.1",
136
157
  "react-router-dom": "6.24.1",
137
- "tailwind-merge": "2.3.0",
138
- "typescript": "5.5.3",
139
- "zustand": "4.5.4"
158
+ "rollup-plugin-visualizer": "^5.12.0",
159
+ "typescript": "5.5.3"
140
160
  },
141
161
  "peerDependencies": {
142
162
  "react": ">18.0.0",
@@ -147,7 +167,9 @@
147
167
  },
148
168
  "scripts": {
149
169
  "build": "tsc --project tsconfig.json",
150
- "build:vite": "vite build && pnpm run hack:fix-worker-paths",
170
+ "build:vite": "vite build && pnpm run hack:fix-worker-paths lib",
171
+ "build:standalone:vite": "vite build --config vite.standalone.config.ts",
172
+ "build:standalone:html": "cp ./src/app/standalone.html ./standalone/standalone.html && cp ./src/app/demo.html ./standalone/demo.html && cp ./src/app/demo-cdn.html ./standalone/index.html",
151
173
  "hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
152
174
  "clean": "tsc --build --clean",
153
175
  "test": "node --test --enable-source-maps"
package/src/app/App.tsx CHANGED
@@ -1,40 +0,0 @@
1
- import "./main.css";
2
-
3
- // Virtual config
4
- import config from "virtual:zudoku-config";
5
-
6
- // Virtual Plugins
7
- import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
8
- import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
9
- import { configuredAuthProvider } from "virtual:zudoku-auth";
10
- import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
11
- import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
12
-
13
- // Base React Component
14
- import { DevPortal } from "zudoku/components";
15
-
16
- // IMPORTANT: This component must not contain tailwind classes
17
- // This directory is not processed by the tailwind plugin
18
-
19
- export default function App() {
20
- return (
21
- <DevPortal
22
- meta={{
23
- headerTitle: config.ui?.headerTitle ?? "Developer Portal",
24
- pageTitle: config.ui?.pageTitle ?? "%s | Dev Portal",
25
- logo: config.ui?.logo ?? "https://cdn.zuplo.com/www/favicon.png",
26
- favicon:
27
- config.ui?.metadata?.favicon ??
28
- "https://cdn.zuplo.com/www/favicon.png",
29
- }}
30
- navigation={config.navigation ?? []}
31
- authentication={configuredAuthProvider}
32
- plugins={[
33
- ...configuredDocsPlugins,
34
- ...configuredApiPlugins,
35
- configuredApiKeysPlugin,
36
- configuredRedirectPlugin,
37
- ]}
38
- />
39
- );
40
- }