zudoku 0.3.0-dev.3 → 0.3.0-dev.31
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.
- package/dist/app/demo.d.ts +2 -0
- package/dist/app/demo.js +27 -0
- package/dist/app/demo.js.map +1 -0
- package/dist/app/main.d.ts +2 -1
- package/dist/app/main.js +31 -10
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +2 -0
- package/dist/app/standalone.js +32 -0
- package/dist/app/standalone.js.map +1 -0
- package/dist/app/tailwind.d.ts +1 -1
- package/dist/app/tailwind.js +0 -9
- package/dist/app/tailwind.js.map +1 -1
- package/dist/config/config.d.ts +10 -16
- package/dist/lib/authentication/Callback.js +1 -1
- package/dist/lib/authentication/Callback.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -2
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +1 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +2 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +2 -0
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +1 -0
- package/dist/lib/authentication/state.js +1 -0
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/DevPortal.d.ts +5 -20
- package/dist/lib/components/DevPortal.js +20 -11
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js +3 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +9 -4
- package/dist/lib/components/Heading.js +17 -2
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Router.js +2 -1
- package/dist/lib/components/Router.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +5 -1
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/TopNavigation.js +4 -0
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.d.ts +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +2 -2
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +13 -3
- package/dist/lib/components/index.js +8 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +33 -3
- package/dist/lib/core/DevPortalContext.js +8 -4
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +7 -4
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +3 -0
- package/dist/lib/errors/ErrorAlert.js +8 -0
- package/dist/lib/errors/ErrorAlert.js.map +1 -0
- package/dist/lib/errors/RouterError.d.ts +1 -0
- package/dist/lib/errors/RouterError.js +9 -0
- package/dist/lib/errors/RouterError.js.map +1 -0
- package/dist/lib/errors/TopLevelError.d.ts +2 -0
- package/dist/lib/errors/TopLevelError.js +7 -0
- package/dist/lib/errors/TopLevelError.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +1 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/index.js +3 -1
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.d.ts +4 -0
- package/dist/lib/plugins/{api-key → api-keys}/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.d.ts +4 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +38 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/{api-key → api-keys}/index.js +37 -9
- package/dist/lib/plugins/api-keys/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +3 -2
- package/dist/lib/plugins/markdown/MdxPage.js +7 -6
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +1 -1
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +3 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +4 -4
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +4 -1
- package/dist/lib/plugins/markdown/index.js +2 -2
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +5 -4
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +8 -4
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.d.ts → PlaygroundDialogWrapper.d.ts} +1 -1
- package/dist/lib/plugins/openapi/{MakeRequest.js → PlaygroundDialogWrapper.js} +5 -5
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +1 -9
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +4 -26
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +16 -0
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.d.ts +8 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js +17 -0
- package/dist/lib/plugins/openapi/SchemaListViewItemGroup.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +10 -8
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/{Select.d.ts → SimpleSelect.d.ts} +3 -2
- package/dist/lib/plugins/openapi/SimpleSelect.js +5 -0
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +12 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +46 -0
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +4 -0
- package/dist/lib/plugins/openapi/client/createServer.js +30 -0
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +10 -0
- package/dist/lib/plugins/openapi/{worker/createSharedWorkerClient.js → client/createWorkerClient.js} +11 -2
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/client/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/{worker → client}/worker.js +2 -2
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/index.d.ts +1 -19
- package/dist/lib/plugins/openapi/index.js +27 -20
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.d.ts +2 -3
- package/dist/lib/plugins/openapi/playground/Headers.js +16 -6
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +4 -3
- package/dist/lib/plugins/openapi/playground/Playground.js +8 -12
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +10 -0
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +1 -1
- package/dist/lib/plugins/openapi/util/prose.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/prose.js +4 -0
- package/dist/lib/plugins/openapi/util/prose.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +1 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/ui/Callout.js +1 -1
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/button-variants.d.ts +1 -1
- package/dist/lib/util/MdxComponents.js +1 -1
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/logInit.d.ts +1 -0
- package/dist/lib/util/logInit.js +9 -0
- package/dist/lib/util/logInit.js.map +1 -0
- package/dist/lib/util/objectEntries.d.ts +4 -0
- package/dist/lib/util/objectEntries.js +2 -0
- package/dist/lib/util/objectEntries.js.map +1 -0
- package/dist/lib/util/renderIf.d.ts +1 -0
- package/dist/lib/util/renderIf.js +2 -0
- package/dist/lib/util/renderIf.js.map +1 -0
- package/dist/vite/build.js +4 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +11 -8
- package/dist/vite/config.js +58 -50
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -4
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +0 -1
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +7 -8
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +7 -11
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +5 -6
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +0 -1
- package/dist/vite/plugin-config.js +13 -7
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +9 -8
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +1 -1
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-html.js +1 -9
- package/dist/vite/plugin-html.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +3 -1
- package/dist/vite/plugin-mdx.js +4 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-openapi-worker.js +11 -3
- package/dist/vite/plugin-openapi-worker.js.map +1 -1
- package/dist/vite/plugin-redirect.js +9 -9
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin.js +1 -1
- package/dist/vite/plugin.js.map +1 -1
- package/lib/AnchorLink-ptdQk87q.js +706 -0
- package/lib/AnchorLink-ptdQk87q.js.map +1 -0
- package/lib/DevPortalProvider-BMk-RCE0.js +1081 -0
- package/lib/DevPortalProvider-BMk-RCE0.js.map +1 -0
- package/lib/Markdown-DDmW47R9.js +8621 -0
- package/lib/Markdown-DDmW47R9.js.map +1 -0
- package/lib/MdxComponents-C0R6zobS.js +3019 -0
- package/lib/MdxComponents-C0R6zobS.js.map +1 -0
- package/lib/MdxPage-DyJAHF9y.js +217 -0
- package/lib/MdxPage-DyJAHF9y.js.map +1 -0
- package/lib/OperationList-Dz9rHM9r.js +5546 -0
- package/lib/OperationList-Dz9rHM9r.js.map +1 -0
- package/lib/Route-CN_7-e5r.js +14 -0
- package/lib/Route-CN_7-e5r.js.map +1 -0
- package/lib/Select-D-Jtx53Q.js +4572 -0
- package/lib/Select-D-Jtx53Q.js.map +1 -0
- package/lib/Spinner-BG1JnYy0.js +182 -0
- package/lib/Spinner-BG1JnYy0.js.map +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +1 -0
- package/lib/assets/index-BPdJm2ty.js.map +1 -0
- package/lib/assets/{worker-BCcpCNJ7.js → worker-BXS8hiSM.js} +9844 -9800
- package/lib/assets/worker-BXS8hiSM.js.map +1 -0
- package/lib/cn-DpqTslo9.js +2342 -0
- package/lib/cn-DpqTslo9.js.map +1 -0
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/context-_fYfJFgk.js.map +1 -0
- package/lib/hook-BzBeIPL4.js +25 -0
- package/lib/hook-BzBeIPL4.js.map +1 -0
- package/lib/index-BaOOUFsA.js +412 -0
- package/lib/index-BaOOUFsA.js.map +1 -0
- package/lib/index-CPvRaBBB.js +713 -0
- package/lib/index-CPvRaBBB.js.map +1 -0
- package/lib/index-Cpdpun6t.js +710 -0
- package/lib/index-Cpdpun6t.js.map +1 -0
- package/lib/index-DLS6fPwU.js +464 -0
- package/lib/index-DLS6fPwU.js.map +1 -0
- package/lib/jsx-runtime-SV6hXQua.js +3009 -0
- package/lib/jsx-runtime-SV6hXQua.js.map +1 -0
- package/lib/loglevel-CA34MiFn.js +153 -0
- package/lib/loglevel-CA34MiFn.js.map +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js +1 -0
- package/lib/prism-bash.min-DadFsM4Z.js.map +1 -0
- package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
- package/lib/prism-csharp.min-Yizuc34Y.js.map +1 -0
- package/lib/prism-java.min-d5iT_mOd.js +1 -0
- package/lib/prism-java.min-d5iT_mOd.js.map +1 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js.map +1 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -0
- package/lib/prism-php.min-o7FpoMP_.js +1 -0
- package/lib/prism-php.min-o7FpoMP_.js.map +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +1 -0
- package/lib/prism-ruby.min-C7LwcKyz.js.map +1 -0
- package/lib/{state-oycsxkHz.js → state-Ds_OxRHP.js} +20 -18
- package/lib/state-Ds_OxRHP.js.map +1 -0
- package/lib/urql-DMlBWUKL.js +1 -0
- package/lib/urql-DMlBWUKL.js.map +1 -0
- package/lib/util-CCWvaWo7.js +41 -0
- package/lib/util-CCWvaWo7.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +3 -1
- package/lib/zudoku.auth-auth0.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +11 -8
- package/lib/zudoku.auth-clerk.js.map +1 -0
- package/lib/zudoku.auth-openid.js +444 -588
- package/lib/zudoku.auth-openid.js.map +1 -0
- package/lib/zudoku.components.js +429 -334
- package/lib/zudoku.components.js.map +1 -0
- package/lib/zudoku.openapi-worker.js +16 -13
- package/lib/zudoku.openapi-worker.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +296 -0
- package/lib/zudoku.plugin-api-keys.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +52 -0
- package/lib/zudoku.plugin-markdown.js.map +1 -0
- package/lib/zudoku.plugin-openapi.js +8 -0
- package/lib/zudoku.plugin-openapi.js.map +1 -0
- package/lib/zudoku.plugin-redirect.js +12 -0
- package/lib/zudoku.plugin-redirect.js.map +1 -0
- package/package.json +21 -6
- package/src/app/demo-cdn.html +26 -0
- package/src/app/demo.html +18 -0
- package/src/app/demo.tsx +40 -0
- package/src/app/main.css +74 -0
- package/src/app/main.tsx +42 -9
- package/src/app/standalone.html +20 -0
- package/src/app/standalone.tsx +46 -0
- package/src/app/tailwind.ts +1 -11
- package/src/lib/authentication/Callback.tsx +1 -1
- package/src/lib/authentication/authentication.ts +2 -5
- package/src/lib/authentication/hook.ts +1 -0
- package/src/lib/authentication/providers/auth0.tsx +1 -0
- package/src/lib/authentication/providers/clerk.tsx +2 -0
- package/src/lib/authentication/providers/openid.tsx +3 -1
- package/src/lib/authentication/state.ts +2 -0
- package/src/lib/components/DevPortal.tsx +23 -30
- package/src/lib/components/Header.tsx +7 -7
- package/src/lib/components/Heading.tsx +26 -7
- package/src/lib/components/Layout.tsx +3 -4
- package/src/lib/components/Router.tsx +3 -7
- package/src/lib/components/SyntaxHighlight.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +5 -0
- package/src/lib/components/context/DevPortalProvider.ts +2 -2
- package/src/lib/components/index.ts +9 -3
- package/src/lib/core/DevPortalContext.ts +42 -12
- package/src/lib/core/plugins.ts +10 -5
- package/src/lib/errors/ErrorAlert.tsx +21 -0
- package/src/lib/errors/RouterError.tsx +12 -0
- package/src/lib/errors/TopLevelError.tsx +8 -0
- package/src/lib/oas/graphql/index.ts +2 -2
- package/src/lib/oas/parser/index.ts +3 -1
- package/src/lib/plugins/{api-key → api-keys}/CreateApiKey.tsx +2 -8
- package/src/lib/plugins/{api-key → api-keys}/SettingsApiKeys.tsx +21 -14
- package/src/lib/plugins/{api-key → api-keys}/index.tsx +54 -8
- package/src/lib/plugins/markdown/MdxPage.tsx +52 -35
- package/src/lib/plugins/markdown/Toc.tsx +1 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +15 -5
- package/src/lib/plugins/markdown/index.tsx +8 -1
- package/src/lib/plugins/openapi/OperationList.tsx +10 -4
- package/src/lib/plugins/openapi/OperationListItem.tsx +66 -41
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/ParameterListItem.tsx +3 -4
- package/src/lib/plugins/openapi/{MakeRequest.tsx → PlaygroundDialogWrapper.tsx} +4 -4
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -16
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +3 -1
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/SchemaListView.tsx +15 -182
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +110 -0
- package/src/lib/plugins/openapi/SchemaListViewItemGroup.tsx +63 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +15 -10
- package/src/lib/plugins/openapi/{Select.tsx → SimpleSelect.tsx} +6 -3
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +56 -0
- package/src/lib/plugins/openapi/client/createServer.ts +33 -0
- package/src/lib/plugins/openapi/{worker/createSharedWorkerClient.ts → client/createWorkerClient.ts} +13 -1
- package/src/lib/plugins/openapi/client/interfaces.ts +3 -0
- package/src/lib/plugins/openapi/{worker → client}/worker.ts +3 -3
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/index.tsx +37 -51
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +60 -33
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +158 -193
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +34 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/createUrl.ts +1 -1
- package/src/lib/plugins/openapi/util/prose.ts +7 -0
- package/src/lib/plugins/openapi-worker.ts +1 -1
- package/src/lib/ui/Callout.tsx +2 -2
- package/src/lib/util/MdxComponents.tsx +1 -2
- package/src/lib/util/logInit.ts +9 -0
- package/src/lib/util/objectEntries.ts +5 -0
- package/src/lib/util/renderIf.ts +4 -0
- package/dist/app/App.d.ts +0 -2
- package/dist/app/App.js +0 -29
- package/dist/app/App.js.map +0 -1
- package/dist/lib/components/Link.d.ts +0 -1
- package/dist/lib/components/Link.js +0 -2
- package/dist/lib/components/Link.js.map +0 -1
- package/dist/lib/core/helmet.d.ts +0 -4
- package/dist/lib/core/helmet.js +0 -5
- package/dist/lib/core/helmet.js.map +0 -1
- package/dist/lib/core/icons.d.ts +0 -1
- package/dist/lib/core/icons.js +0 -2
- package/dist/lib/core/icons.js.map +0 -1
- package/dist/lib/core/router.d.ts +0 -1
- package/dist/lib/core/router.js +0 -2
- package/dist/lib/core/router.js.map +0 -1
- package/dist/lib/plugins/api-key/CreateApiKey.d.ts +0 -5
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +0 -1
- package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +0 -5
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +0 -38
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/lib/plugins/api-key/index.js.map +0 -1
- package/dist/lib/plugins/index.d.ts +0 -4
- package/dist/lib/plugins/index.js +0 -5
- package/dist/lib/plugins/index.js.map +0 -1
- package/dist/lib/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/lib/plugins/openapi/Select.js +0 -5
- package/dist/lib/plugins/openapi/Select.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -5
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.js +0 -6
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +0 -1
- package/dist/lib/plugins/openapi/worker/worker.js.map +0 -1
- package/dist/vite/common.d.ts +0 -1
- package/dist/vite/common.js +0 -5
- package/dist/vite/common.js.map +0 -1
- package/lib/Spinner-7LezPqGn.js +0 -8393
- package/lib/clerk-Wslx_mPo.js +0 -19685
- package/lib/index-DNx3xWa2.js +0 -3461
- package/lib/zudoku.plugins.js +0 -19863
- package/src/app/App.tsx +0 -40
- package/src/lib/components/Link.tsx +0 -1
- package/src/lib/core/helmet.ts +0 -5
- package/src/lib/core/icons.tsx +0 -1
- package/src/lib/core/router.tsx +0 -1
- package/src/lib/plugins/index.ts +0 -4
- package/src/lib/plugins/openapi/worker/shared-worker.ts +0 -5
- /package/dist/lib/plugins/{api-key → api-keys}/index.d.ts +0 -0
- /package/dist/lib/plugins/openapi/{worker → client}/worker.d.ts +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-SV6hXQua.js";
|
|
2
|
+
import { l as g } from "./loglevel-CA34MiFn.js";
|
|
3
|
+
import { u as j } from "./hook-BzBeIPL4.js";
|
|
4
|
+
import { u as v, a as m, S as b, b as w, c as N, d as k, e as K, f as p, B as o } from "./Select-D-Jtx53Q.js";
|
|
5
|
+
import { c as l, L as x } from "./index-CPvRaBBB.js";
|
|
6
|
+
import { u as h, q as S, t as E } from "./DevPortalProvider-BMk-RCE0.js";
|
|
7
|
+
import * as A from "react";
|
|
8
|
+
import { useState as C } from "react";
|
|
9
|
+
import { c as P } from "./cn-DpqTslo9.js";
|
|
10
|
+
import { b as D, O as I, a as O } from "./index-DLS6fPwU.js";
|
|
11
|
+
/**
|
|
12
|
+
* @license lucide-react v0.378.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
const R = l("EyeOff", [
|
|
18
|
+
["path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24", key: "1jxqfv" }],
|
|
19
|
+
[
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
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",
|
|
23
|
+
key: "9wicm4"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"path",
|
|
28
|
+
{ 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" }
|
|
29
|
+
],
|
|
30
|
+
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
|
|
31
|
+
]);
|
|
32
|
+
/**
|
|
33
|
+
* @license lucide-react v0.378.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/
|
|
38
|
+
const q = l("Eye", [
|
|
39
|
+
["path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z", key: "rwhkz3" }],
|
|
40
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* @license lucide-react v0.378.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
48
|
+
const z = l("RotateCw", [
|
|
49
|
+
["path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8", key: "1p45f6" }],
|
|
50
|
+
["path", { d: "M21 3v5h-5", key: "1q7to0" }]
|
|
51
|
+
]);
|
|
52
|
+
/**
|
|
53
|
+
* @license lucide-react v0.378.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/
|
|
58
|
+
const M = l("Trash", [
|
|
59
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
60
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
61
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
|
|
62
|
+
]);
|
|
63
|
+
var L = process.env.NODE_ENV === "production", d = "Invariant failed";
|
|
64
|
+
function u(t, r) {
|
|
65
|
+
if (!t) {
|
|
66
|
+
if (L)
|
|
67
|
+
throw new Error(d);
|
|
68
|
+
var a = typeof r == "function" ? r() : r, n = a ? "".concat(d, ": ").concat(a) : d;
|
|
69
|
+
throw new Error(n);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const y = A.forwardRef(
|
|
73
|
+
({ className: t, type: r, ...a }, n) => /* @__PURE__ */ e.jsx(
|
|
74
|
+
"input",
|
|
75
|
+
{
|
|
76
|
+
type: r,
|
|
77
|
+
className: P(
|
|
78
|
+
"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",
|
|
79
|
+
t
|
|
80
|
+
),
|
|
81
|
+
ref: n,
|
|
82
|
+
...a
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
y.displayName = "Input";
|
|
87
|
+
const T = ({ service: t }) => {
|
|
88
|
+
const r = h(), a = D(), n = v({
|
|
89
|
+
defaultValues: {
|
|
90
|
+
expiresOn: "30"
|
|
91
|
+
}
|
|
92
|
+
}), i = m({
|
|
93
|
+
mutationFn: ({ description: s, expiresOn: c }) => {
|
|
94
|
+
if (!t.createKey)
|
|
95
|
+
throw new Error("deleteKey not implemented");
|
|
96
|
+
const f = c !== "never" ? V(Number(c)) : void 0;
|
|
97
|
+
return t.createKey(
|
|
98
|
+
{ description: s, expiresOn: f },
|
|
99
|
+
r
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
onSuccess: () => a("/settings/api-keys/")
|
|
103
|
+
});
|
|
104
|
+
return t.createKey ? /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
|
|
105
|
+
/* @__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" }) }),
|
|
106
|
+
/* @__PURE__ */ e.jsx(
|
|
107
|
+
"form",
|
|
108
|
+
{
|
|
109
|
+
onSubmit: n.handleSubmit((s) => i.mutate(s)),
|
|
110
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col", children: [
|
|
111
|
+
"Note",
|
|
112
|
+
/* @__PURE__ */ e.jsx(y, { ...n.register("description") }),
|
|
113
|
+
"Expiration",
|
|
114
|
+
/* @__PURE__ */ e.jsxs(
|
|
115
|
+
b,
|
|
116
|
+
{
|
|
117
|
+
onValueChange: (s) => n.setValue("expiresOn", s),
|
|
118
|
+
defaultValue: n.getValues("expiresOn"),
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ e.jsx(w, { children: /* @__PURE__ */ e.jsx(N, {}) }),
|
|
121
|
+
/* @__PURE__ */ e.jsx(k, { children: /* @__PURE__ */ e.jsxs(K, { children: [
|
|
122
|
+
[7, 30, 60, 90].map((s) => /* @__PURE__ */ e.jsxs(p, { value: String(s), children: [
|
|
123
|
+
s,
|
|
124
|
+
" days"
|
|
125
|
+
] }, s)),
|
|
126
|
+
/* @__PURE__ */ e.jsx(p, { value: "never", children: "Never" })
|
|
127
|
+
] }) })
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
132
|
+
/* @__PURE__ */ e.jsx(o, { children: "Generate Key" }),
|
|
133
|
+
/* @__PURE__ */ e.jsx(o, { variant: "outline", asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/", children: "Cancel" }) })
|
|
134
|
+
] })
|
|
135
|
+
] })
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] }) : null;
|
|
139
|
+
}, V = (t) => {
|
|
140
|
+
const r = /* @__PURE__ */ new Date();
|
|
141
|
+
return r.setDate(r.getDate() + t), r.toISOString();
|
|
142
|
+
}, F = ({ service: t }) => {
|
|
143
|
+
const r = h(), a = S(), { data: n } = E({
|
|
144
|
+
queryFn: () => t.getKeys(r),
|
|
145
|
+
queryKey: ["api-keys"],
|
|
146
|
+
retry: !1
|
|
147
|
+
}), i = m({
|
|
148
|
+
mutationFn: (s) => {
|
|
149
|
+
if (!t.deleteKey)
|
|
150
|
+
throw new Error("deleteKey not implemented");
|
|
151
|
+
return t.deleteKey(s, r);
|
|
152
|
+
},
|
|
153
|
+
onSuccess: () => {
|
|
154
|
+
a.invalidateQueries({ queryKey: ["api-keys"] });
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "max-w-screen-lg h-full pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
|
|
158
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-4 border-b border-border pb-3", children: [
|
|
159
|
+
/* @__PURE__ */ e.jsx("h1", { className: "font-medium text-2xl", children: "API Keys" }),
|
|
160
|
+
t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
|
|
161
|
+
] }),
|
|
162
|
+
n.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-4 items-center h-1/2 my-8", children: [
|
|
163
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
|
|
164
|
+
"No API keys created yet.",
|
|
165
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
166
|
+
"Get started and create the first one now"
|
|
167
|
+
] }),
|
|
168
|
+
t.createKey && /* @__PURE__ */ e.jsx(o, { asChild: !0, children: /* @__PURE__ */ e.jsx(x, { to: "/settings/api-keys/new", children: "Create API Key" }) })
|
|
169
|
+
] }) : /* @__PURE__ */ e.jsx("ul", { className: "grid grid-cols-[minmax(250px,min-content)_1fr_min-content] ", children: n.map((s) => /* @__PURE__ */ e.jsxs(
|
|
170
|
+
"li",
|
|
171
|
+
{
|
|
172
|
+
className: "border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1 text-sm", children: [
|
|
175
|
+
s.description ?? s.id,
|
|
176
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-xs", children: [
|
|
177
|
+
s.createdOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
178
|
+
"Created on ",
|
|
179
|
+
new Date(s.createdOn).toLocaleDateString()
|
|
180
|
+
] }),
|
|
181
|
+
s.expiresOn && /* @__PURE__ */ e.jsxs("div", { children: [
|
|
182
|
+
"Expires on ",
|
|
183
|
+
new Date(s.expiresOn).toLocaleDateString()
|
|
184
|
+
] })
|
|
185
|
+
] })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ e.jsx("div", { className: "items-center flex justify-center", children: /* @__PURE__ */ e.jsx(_, { apiKey: s.key }) }),
|
|
188
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
189
|
+
t.rollKey && /* @__PURE__ */ e.jsx(o, { size: "icon", children: /* @__PURE__ */ e.jsx(z, { size: 16 }) }),
|
|
190
|
+
t.deleteKey && /* @__PURE__ */ e.jsx(
|
|
191
|
+
o,
|
|
192
|
+
{
|
|
193
|
+
variant: "ghost",
|
|
194
|
+
size: "icon",
|
|
195
|
+
onClick: () => {
|
|
196
|
+
confirm("Do you want to delete this key?") && i.mutate(s.id);
|
|
197
|
+
},
|
|
198
|
+
disabled: i.isPending,
|
|
199
|
+
children: /* @__PURE__ */ e.jsx(M, { size: 16 })
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] })
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
s.id
|
|
206
|
+
)) })
|
|
207
|
+
] });
|
|
208
|
+
}, _ = ({ apiKey: t }) => {
|
|
209
|
+
const [r, a] = C(!1);
|
|
210
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center text-sm", children: [
|
|
211
|
+
/* @__PURE__ */ e.jsx("code", { className: "border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono", children: r ? t : "•".repeat(t.length) }),
|
|
212
|
+
/* @__PURE__ */ e.jsx(
|
|
213
|
+
o,
|
|
214
|
+
{
|
|
215
|
+
variant: "outline",
|
|
216
|
+
onClick: () => a((n) => !n),
|
|
217
|
+
size: "icon",
|
|
218
|
+
children: r ? /* @__PURE__ */ e.jsx(R, { size: 16 }) : /* @__PURE__ */ e.jsx(q, { size: 16 })
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] });
|
|
222
|
+
}, B = "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev", G = (t) => ({
|
|
223
|
+
deleteKey: async (r, a) => {
|
|
224
|
+
const n = new Request(t + `/v1/developer/api-keys/${r}`, {
|
|
225
|
+
method: "DELETE"
|
|
226
|
+
});
|
|
227
|
+
await a.signRequest(n);
|
|
228
|
+
const i = await fetch(n);
|
|
229
|
+
u(i.ok, "Failed to delete API key");
|
|
230
|
+
},
|
|
231
|
+
createKey: async (r, a) => {
|
|
232
|
+
const n = new Request(t + "/v1/developer/api-keys", {
|
|
233
|
+
method: "POST",
|
|
234
|
+
headers: {
|
|
235
|
+
"Content-Type": "application/json"
|
|
236
|
+
},
|
|
237
|
+
body: JSON.stringify(r)
|
|
238
|
+
});
|
|
239
|
+
await a.signRequest(n);
|
|
240
|
+
const i = await fetch(n);
|
|
241
|
+
u(i.ok, "Failed to create API key");
|
|
242
|
+
},
|
|
243
|
+
getKeys: async (r) => {
|
|
244
|
+
const a = new Request(t + "/v1/developer/api-keys");
|
|
245
|
+
await r.signRequest(a);
|
|
246
|
+
const n = await fetch(a);
|
|
247
|
+
return u(n.ok, "Failed to fetch API keys"), await n.json();
|
|
248
|
+
}
|
|
249
|
+
}), Q = () => {
|
|
250
|
+
const t = j();
|
|
251
|
+
return t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(I, {}) : /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2 my-12", children: [
|
|
252
|
+
"Please login first to view this page",
|
|
253
|
+
/* @__PURE__ */ e.jsx(o, { onClick: () => t.login(), children: "Login" })
|
|
254
|
+
] });
|
|
255
|
+
}, H = () => {
|
|
256
|
+
const t = O();
|
|
257
|
+
return g.error(String(t)), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2 my-12", children: [
|
|
258
|
+
/* @__PURE__ */ e.jsx("h1", { children: "Something went wrong" }),
|
|
259
|
+
t instanceof Error && /* @__PURE__ */ e.jsx("p", { children: t.message })
|
|
260
|
+
] });
|
|
261
|
+
}, se = (t) => {
|
|
262
|
+
const r = "endpoint" in t ? t.endpoint : B, a = "getKeys" in t ? t : G(r);
|
|
263
|
+
return {
|
|
264
|
+
getIdentities: async (n) => {
|
|
265
|
+
try {
|
|
266
|
+
return (await a.getKeys(n)).map((s) => ({
|
|
267
|
+
authorizeRequest: (c) => (c.headers.set("Authorization", `Bearer ${s.key}`), c),
|
|
268
|
+
id: s.id,
|
|
269
|
+
label: s.description ?? s.id
|
|
270
|
+
}));
|
|
271
|
+
} catch {
|
|
272
|
+
return [];
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
getRoutes: () => [
|
|
276
|
+
{
|
|
277
|
+
element: /* @__PURE__ */ e.jsx(Q, {}),
|
|
278
|
+
errorElement: /* @__PURE__ */ e.jsx(H, {}),
|
|
279
|
+
children: [
|
|
280
|
+
{
|
|
281
|
+
path: "/settings/api-keys",
|
|
282
|
+
element: /* @__PURE__ */ e.jsx(F, { service: a })
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
path: "/settings/api-keys/new",
|
|
286
|
+
element: /* @__PURE__ */ e.jsx(T, { service: a })
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
export {
|
|
294
|
+
se as apiKeyPlugin
|
|
295
|
+
};
|
|
296
|
+
//# 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 { 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 className=\"grid grid-cols-[minmax(250px,min-content)_1fr_min-content] \">\n {data.map((key: any) => (\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 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\">\n <code className=\"border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono\">\n {revealed ? apiKey : \"•\".repeat(apiKey.length)}\n </code>\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 logger from \"loglevel\";\nimport { Outlet, useRouteError } 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 { Button } from \"../../ui/Button.js\";\nimport { CreateApiKey } from \"./CreateApiKey.js\";\nimport { SettingsApiKeys } from \"./SettingsApiKeys.js\";\n\nexport type ApiKeyResults = Promise<ApiKey[]>;\nconst DEFAULT_API_KEY_ENDPOINT =\n \"https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev\";\n\nexport type ApiKeyService = {\n getKeys: (context: DevPortalContext) => ApiKeyResults;\n rollKey?: (id: string, context: DevPortalContext) => Promise<void>;\n deleteKey?: (id: string, context: DevPortalContext) => Promise<void>;\n updateKeyDescription?: (\n apiKey: { jd: 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\nconst SettingsErrorBoundary = () => {\n const error = useRouteError();\n logger.error(String(error));\n\n return (\n <div className=\"flex flex-col justify-center gap-2 items-center h-1/2 my-12\">\n <h1>Something went wrong</h1>\n {error instanceof Error && <p>{error.message}</p>}\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: () => {\n // TODO: Make lazy\n return [\n {\n element: <ProtectedRoute />,\n errorElement: <SettingsErrorBoundary />,\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","SettingsErrorBoundary","error","useRouteError","logger","apiKeyPlugin","options"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAASC,EAAiB,UAAU;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,kCAAkC,KAAK,SAAQ,CAAE;AAAA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EvC3C,IACJ,aAAa0D,IAAUA,IAAUd,EAAqBC,CAAQ;AAEzD,SAAA;AAAA,IACL,eAAe,OAAO5C,MAAY;AAC5B,UAAA;AAGK,gBAFM,MAAMD,EAAQ,QAAQC,CAAO,GAE9B,IAAI,CAAC+B,OAAS;AAAA,UACxB,kBAAkB,CAACc,OACjBA,EAAQ,QAAQ,IAAI,iBAAiB,UAAUd,EAAI,GAAG,EAAE,GACjDc;AAAA,UAET,IAAId,EAAI;AAAA,UACR,OAAOA,EAAI,eAAeA,EAAI;AAAA,QAC9B,EAAA;AAAA,MAAA,QACI;AACN,eAAO;MACT;AAAA,IACF;AAAA,IACA,WAAW,MAEF;AAAA,MACL;AAAA,QACE,+BAAUiB,GAAe,EAAA;AAAA,QACzB,oCAAeI,GAAsB,EAAA;AAAA,QACrC,UAAU;AAAA,UACR;AAAA,YACE,MAAM;AAAA,YACN,SAAUxD,gBAAAA,EAAA,IAAA6B,GAAA,EAAgB,SAAA1B,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,52 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-SV6hXQua.js";
|
|
2
|
+
import { j as x } from "./DevPortalProvider-BMk-RCE0.js";
|
|
3
|
+
import { t as f, i as d } from "./util-CCWvaWo7.js";
|
|
4
|
+
import { N as g } from "./index-DLS6fPwU.js";
|
|
5
|
+
const h = (t, e) => {
|
|
6
|
+
const n = Object.entries(t).flatMap(
|
|
7
|
+
([r, p]) => {
|
|
8
|
+
const o = r.match(/pages\/(.*).mdx?$/), a = o == null ? void 0 : o.at(1);
|
|
9
|
+
if (!a) return [];
|
|
10
|
+
const i = a.split("/");
|
|
11
|
+
return {
|
|
12
|
+
path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : a,
|
|
13
|
+
lazy: async () => {
|
|
14
|
+
const { MdxPage: u } = await import("./MdxPage-DyJAHF9y.js"), { default: c, ...l } = await p();
|
|
15
|
+
return {
|
|
16
|
+
element: /* @__PURE__ */ s.jsx(
|
|
17
|
+
u,
|
|
18
|
+
{
|
|
19
|
+
mdxComponent: c,
|
|
20
|
+
...l,
|
|
21
|
+
defaultOptions: e
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
), m = Array.from(
|
|
29
|
+
new Set(n.map((r) => r.path.split("/").at(0)))
|
|
30
|
+
).map((r) => ({
|
|
31
|
+
path: `/${r}`,
|
|
32
|
+
element: /* @__PURE__ */ s.jsx(j, {})
|
|
33
|
+
}));
|
|
34
|
+
return [...n, ...m];
|
|
35
|
+
}, j = () => {
|
|
36
|
+
const t = x();
|
|
37
|
+
return t ? f(t, (e, n) => {
|
|
38
|
+
if (!("children" in e || !d(e)))
|
|
39
|
+
return /* @__PURE__ */ s.jsx(g, { to: n, replace: !0 });
|
|
40
|
+
}) : null;
|
|
41
|
+
}, y = ({
|
|
42
|
+
markdownFiles: t,
|
|
43
|
+
defaultOptions: e
|
|
44
|
+
}) => ({
|
|
45
|
+
getRoutes() {
|
|
46
|
+
return h(t, e);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
y as markdownPlugin
|
|
51
|
+
};
|
|
52
|
+
//# 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 = 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 return {\n getRoutes() {\n return generateRoutes(markdownFiles, defaultOptions);\n },\n };\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,IAAa,MAAM;AAAA,IACvB,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,OACS;AAAA,EACL,YAAY;AACH,WAAAF,EAAeC,GAAeC,CAAc;AAAA,EACrD;AAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-SV6hXQua.js";
|
|
2
|
+
import { N as i } from "./index-DLS6fPwU.js";
|
|
3
|
+
const p = (t) => ({
|
|
4
|
+
getRoutes: () => t.redirects.map(({ from: e, to: r, replace: o }) => ({
|
|
5
|
+
path: e,
|
|
6
|
+
element: /* @__PURE__ */ s.jsx(i, { to: r, replace: o })
|
|
7
|
+
}))
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
p as redirectPlugin
|
|
11
|
+
};
|
|
12
|
+
//# 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 { Navigate } from \"react-router-dom\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\n\nexport type Redirect = {\n from: string;\n to: string;\n replace?: boolean;\n};\n\nexport const redirectPlugin = (options: {\n redirects: Redirect[];\n}): DevPortalPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to, replace }) => ({\n path: from,\n element: <Navigate to={to} replace={replace} />,\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","replace","jsx","Navigate"],"mappings":";;AASa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,GAAI,SAAAC,SAAe;AAAA,IAChD,MAAMF;AAAA,IACN,SAASG,gBAAAA,EAAAA,IAACC,GAAS,EAAA,IAAAH,GAAQ,SAAAC,EAAkB,CAAA;AAAA,EAAA,EAC7C;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -27,8 +27,17 @@
|
|
|
27
27
|
"./auth/openid": {
|
|
28
28
|
"import": "./lib/zudoku.auth-openid.js"
|
|
29
29
|
},
|
|
30
|
-
"./plugins": {
|
|
31
|
-
"import": "./lib/zudoku.
|
|
30
|
+
"./plugins/api-keys": {
|
|
31
|
+
"import": "./lib/zudoku.plugin-api-keys.js"
|
|
32
|
+
},
|
|
33
|
+
"./plugins/markdown": {
|
|
34
|
+
"import": "./lib/zudoku.plugin-markdown.js"
|
|
35
|
+
},
|
|
36
|
+
"./plugins/openapi": {
|
|
37
|
+
"import": "./lib/zudoku.plugin-openapi.js"
|
|
38
|
+
},
|
|
39
|
+
"./plugins/redirect": {
|
|
40
|
+
"import": "./lib/zudoku.plugin-redirect.js"
|
|
32
41
|
},
|
|
33
42
|
"./openapi-worker": {
|
|
34
43
|
"import": "./lib/zudoku.openapi-worker.js"
|
|
@@ -53,6 +62,7 @@
|
|
|
53
62
|
}
|
|
54
63
|
},
|
|
55
64
|
"dependencies": {
|
|
65
|
+
"@envelop/core": "5.0.1",
|
|
56
66
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
57
67
|
"@lekoarts/rehype-meta-as-attributes": "3.0.1",
|
|
58
68
|
"@mdx-js/react": "3.0.1",
|
|
@@ -68,7 +78,6 @@
|
|
|
68
78
|
"autoprefixer": "10.4.19",
|
|
69
79
|
"chokidar": "^3.6.0",
|
|
70
80
|
"dotenv": "16.4.5",
|
|
71
|
-
"esbuild": "0.23.0",
|
|
72
81
|
"express": "4.19.2",
|
|
73
82
|
"graphql": "16.9.0",
|
|
74
83
|
"graphql-type-json": "0.3.2",
|
|
@@ -85,6 +94,7 @@
|
|
|
85
94
|
"prismjs": "1.29.0",
|
|
86
95
|
"react": "18.3.1",
|
|
87
96
|
"react-dom": "18.3.1",
|
|
97
|
+
"react-error-boundary": "^4.0.13",
|
|
88
98
|
"react-helmet-async": "2.0.5",
|
|
89
99
|
"react-hook-form": "^7.52.1",
|
|
90
100
|
"react-markdown": "9.0.1",
|
|
@@ -96,10 +106,12 @@
|
|
|
96
106
|
"remark-frontmatter": "5.0.0",
|
|
97
107
|
"remark-gfm": "4.0.0",
|
|
98
108
|
"remark-mdx-frontmatter": "5.0.0",
|
|
109
|
+
"rollup": "^4.18.1",
|
|
99
110
|
"semver": "7.6.2",
|
|
100
111
|
"slugify": "1.6.6",
|
|
101
112
|
"strip-ansi": "7.1.0",
|
|
102
113
|
"tailwindcss": "3.4.4",
|
|
114
|
+
"tiny-invariant": "1.3.3",
|
|
103
115
|
"ulidx": "^2.3.0",
|
|
104
116
|
"unist-util-visit": "5.0.0",
|
|
105
117
|
"urql": "4.1.0",
|
|
@@ -116,12 +128,12 @@
|
|
|
116
128
|
"@types/express": "^4.17.21",
|
|
117
129
|
"@types/har-format": "^1.2.15",
|
|
118
130
|
"@types/json-schema": "7.0.15",
|
|
119
|
-
"@types/loglevel": "^1.6.3",
|
|
120
131
|
"@types/mdx": "2.0.13",
|
|
121
132
|
"@types/node": "20.12.10",
|
|
122
133
|
"@types/object-hash": "^3.0.6",
|
|
123
134
|
"@types/react": "18.3.3",
|
|
124
135
|
"@types/react-dom": "18.3.0",
|
|
136
|
+
"@types/rollup": "^0.54.0",
|
|
125
137
|
"@types/semver": "^7.5.8",
|
|
126
138
|
"@types/yargs": "^17.0.32",
|
|
127
139
|
"@zudoku/httpsnippet": "10.0.9",
|
|
@@ -134,6 +146,7 @@
|
|
|
134
146
|
"react-helmet-async": "2.0.5",
|
|
135
147
|
"react-markdown": "9.0.1",
|
|
136
148
|
"react-router-dom": "6.24.1",
|
|
149
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
137
150
|
"tailwind-merge": "2.3.0",
|
|
138
151
|
"typescript": "5.5.3",
|
|
139
152
|
"zustand": "4.5.4"
|
|
@@ -147,7 +160,9 @@
|
|
|
147
160
|
},
|
|
148
161
|
"scripts": {
|
|
149
162
|
"build": "tsc --project tsconfig.json",
|
|
150
|
-
"build:vite": "vite build && pnpm run hack:fix-worker-paths",
|
|
163
|
+
"build:vite": "vite build && pnpm run hack:fix-worker-paths lib",
|
|
164
|
+
"build:standalone:vite": "vite build --config vite.standalone.config.ts",
|
|
165
|
+
"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
166
|
"hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
|
|
152
167
|
"clean": "tsc --build --clean",
|
|
153
168
|
"test": "node --test --enable-source-maps"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
rel="icon"
|
|
7
|
+
type="image/svg+xml"
|
|
8
|
+
href="https://cdn.zudoku.dev/logos/icon.svg"
|
|
9
|
+
/>
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
|
+
<title>Zudoku Demo</title>
|
|
12
|
+
<script
|
|
13
|
+
type="module"
|
|
14
|
+
crossorigin
|
|
15
|
+
src="https://cdn.zudoku.dev/latest/demo.js"
|
|
16
|
+
></script>
|
|
17
|
+
<link
|
|
18
|
+
rel="stylesheet"
|
|
19
|
+
crossorigin
|
|
20
|
+
href="https://cdn.zudoku.dev/latest/style.css"
|
|
21
|
+
/>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="root"></div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link
|
|
6
|
+
rel="icon"
|
|
7
|
+
type="image/svg+xml"
|
|
8
|
+
href="https://cdn.zudoku.dev/logos/icon.svg"
|
|
9
|
+
/>
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
|
+
<title>Zudoku Demo</title>
|
|
12
|
+
<script type="module" crossorigin src="./demo.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./style.css" />
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
package/src/app/demo.tsx
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { StrictMode } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
|
|
4
|
+
// Styles
|
|
5
|
+
import "./main.css";
|
|
6
|
+
|
|
7
|
+
// Logger
|
|
8
|
+
import logger from "loglevel";
|
|
9
|
+
import "../lib/util/logInit.js";
|
|
10
|
+
|
|
11
|
+
// Base React Component
|
|
12
|
+
import { DevPortal } from "../lib/components/DevPortal.js";
|
|
13
|
+
|
|
14
|
+
// Plugins
|
|
15
|
+
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
16
|
+
|
|
17
|
+
const apiUrl = new URL(window.location.href).searchParams.get("api-url");
|
|
18
|
+
logger.info(`API URL: ${apiUrl}`);
|
|
19
|
+
|
|
20
|
+
// IMPORTANT: This component must not contain tailwind classes
|
|
21
|
+
// This directory is not processed by the tailwind plugin
|
|
22
|
+
|
|
23
|
+
createRoot(document.getElementById("root")!).render(
|
|
24
|
+
<StrictMode>
|
|
25
|
+
<DevPortal
|
|
26
|
+
page={{
|
|
27
|
+
logo: "https://cdn.zudoku.dev/logos/icon.svg",
|
|
28
|
+
pageTitle: "Developer Portal",
|
|
29
|
+
}}
|
|
30
|
+
navigation={[
|
|
31
|
+
{
|
|
32
|
+
label: "API Reference",
|
|
33
|
+
path: "/demo",
|
|
34
|
+
categories: [],
|
|
35
|
+
},
|
|
36
|
+
]}
|
|
37
|
+
plugins={[openApiPlugin({ type: "url", input: apiUrl!, path: "/demo" })]}
|
|
38
|
+
/>
|
|
39
|
+
</StrictMode>,
|
|
40
|
+
);
|