zudoku 0.1.1-dev.9 → 0.3.0-dev.3
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/App.js +15 -6
- package/dist/app/App.js.map +1 -1
- package/dist/app/main.js +10 -2
- package/dist/app/main.js.map +1 -1
- package/dist/cli/build/handler.js +3 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/common/analytics/lib.js +1 -1
- package/dist/cli/common/analytics/lib.js.map +1 -1
- package/dist/cli/common/logger.js +3 -1
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/common/outdated.js +4 -4
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/output.js +4 -4
- package/dist/cli/common/output.js.map +1 -1
- package/dist/cli/common/utils/box.js +2 -2
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/cli/dev/handler.js +4 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +30 -6
- package/dist/config/validators/auth.d.ts +2 -0
- package/dist/config/validators/auth.js +2 -0
- package/dist/config/validators/auth.js.map +1 -0
- package/dist/config/validators/validate.d.ts +2 -0
- package/dist/config/validators/validate.js +4 -0
- package/dist/config/validators/validate.js.map +1 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/Callback.d.ts +3 -0
- package/dist/lib/authentication/Callback.js +34 -0
- package/dist/lib/authentication/Callback.js.map +1 -0
- package/dist/lib/authentication/authentication.d.ts +14 -0
- package/dist/lib/authentication/authentication.js.map +1 -0
- package/dist/lib/authentication/errors.d.ts +15 -0
- package/dist/lib/authentication/errors.js +10 -0
- package/dist/lib/authentication/errors.js.map +1 -0
- package/dist/lib/authentication/hook.d.ts +7 -0
- package/dist/lib/authentication/hook.js +29 -0
- package/dist/lib/authentication/hook.js.map +1 -0
- package/dist/lib/authentication/providers/auth0.d.ts +4 -0
- package/dist/lib/authentication/providers/auth0.js +40 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -0
- package/dist/lib/authentication/providers/clerk.d.ts +4 -0
- package/dist/lib/authentication/providers/clerk.js +54 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -0
- package/dist/lib/authentication/providers/openid.d.ts +35 -0
- package/dist/lib/authentication/providers/openid.js +204 -0
- package/dist/lib/authentication/providers/openid.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +13 -0
- package/dist/lib/authentication/state.js +5 -0
- package/dist/lib/authentication/state.js.map +1 -0
- package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
- package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/DevPortal.d.ts +25 -0
- package/dist/lib/components/DevPortal.js +32 -0
- package/dist/lib/components/DevPortal.js.map +1 -0
- package/dist/{app → lib}/components/Dialog.d.ts +2 -2
- package/dist/{app → lib}/components/Dialog.js +3 -3
- package/dist/lib/components/Dialog.js.map +1 -0
- package/dist/lib/components/Header.d.ts +1 -0
- package/dist/lib/components/Header.js +15 -0
- package/dist/lib/components/Header.js.map +1 -0
- package/dist/{app → lib/components}/Heading.js +2 -2
- package/dist/lib/components/Heading.js.map +1 -0
- package/dist/{app → lib}/components/Input.js.map +1 -1
- package/dist/{app → lib}/components/Layout.js +4 -7
- package/dist/lib/components/Layout.js.map +1 -0
- package/dist/lib/components/Link.d.ts +1 -0
- package/dist/lib/components/Link.js +2 -0
- package/dist/lib/components/Link.js.map +1 -0
- package/dist/{app → lib}/components/Markdown.js.map +1 -1
- package/dist/lib/components/Router.d.ts +4 -0
- package/dist/lib/components/Router.js +20 -0
- package/dist/lib/components/Router.js.map +1 -0
- package/dist/lib/components/Select.d.ts +13 -0
- package/dist/lib/components/Select.js +27 -0
- package/dist/lib/components/Select.js.map +1 -0
- package/dist/lib/components/Spinner.d.ts +3 -0
- package/dist/lib/components/Spinner.js +4 -0
- package/dist/lib/components/Spinner.js.map +1 -0
- package/dist/{app → lib}/components/SyntaxHighlight.d.ts +2 -1
- package/dist/{app → lib}/components/SyntaxHighlight.js +4 -1
- package/dist/lib/components/SyntaxHighlight.js.map +1 -0
- package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
- package/dist/{app → lib}/components/context/ComponentsContext.d.ts +1 -1
- package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.js +1 -1
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -0
- package/dist/lib/components/context/PluginSystem.js.map +1 -0
- package/dist/{app → lib}/components/context/ThemeContext.js +1 -1
- package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
- package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +3 -0
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -0
- package/dist/{app → lib}/components/navigation/SideNavigation.js +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +2 -1
- package/dist/{app → lib}/components/navigation/SideNavigationItem.js +12 -6
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -0
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +3 -0
- package/dist/lib/components/navigation/SideNavigationWrapper.js +7 -0
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -0
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/{app → lib}/components/navigation/util.js.map +1 -1
- package/dist/{app → lib}/core/DevPortalContext.d.ts +10 -32
- package/dist/lib/core/DevPortalContext.js +48 -0
- package/dist/lib/core/DevPortalContext.js.map +1 -0
- package/dist/{app → lib}/core/helmet.js.map +1 -1
- package/dist/lib/core/icons.js.map +1 -0
- package/dist/{app → lib}/core/plugins.d.ts +2 -7
- package/dist/{app → lib}/core/plugins.js +1 -1
- package/dist/{app → lib}/core/plugins.js.map +1 -1
- package/dist/lib/core/router.js.map +1 -0
- package/dist/{app → lib}/oas/graphql/index.js +2 -2
- package/dist/lib/oas/graphql/index.js.map +1 -0
- package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
- package/dist/{app → lib}/oas/parser/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-key/CreateApiKey.d.ts +5 -0
- package/dist/lib/plugins/api-key/CreateApiKey.js +37 -0
- package/dist/lib/plugins/api-key/CreateApiKey.js.map +1 -0
- package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +5 -0
- package/dist/lib/plugins/api-key/SettingsApiKeys.js +38 -0
- package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +1 -0
- package/dist/lib/plugins/api-key/index.d.ts +30 -0
- package/dist/lib/plugins/api-key/index.js +67 -0
- package/dist/lib/plugins/api-key/index.js.map +1 -0
- package/dist/lib/plugins/index.d.ts +4 -0
- package/dist/lib/plugins/index.js +5 -0
- package/dist/lib/plugins/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +5 -0
- package/dist/lib/plugins/markdown/MdxPage.js +60 -0
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -0
- package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/generateRoutes.js +1 -6
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
- package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +1 -2
- package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +2 -2
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
- package/dist/lib/plugins/openapi/MakeRequest.js +43 -0
- package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/OperationList.js +12 -3
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
- package/dist/lib/plugins/openapi/OperationListItem.js +17 -0
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +2 -2
- package/dist/lib/plugins/openapi/ParameterList.js +5 -0
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -0
- package/dist/lib/plugins/openapi/ParameterListItem.js +13 -0
- package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +1 -1
- package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +3 -3
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListView.d.ts +7 -0
- package/dist/lib/plugins/openapi/SchemaListView.js +43 -0
- package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/Sidecar.js +15 -15
- package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +5 -5
- package/dist/{app → lib}/plugins/openapi/graphql/gql.js +2 -3
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +9 -0
- package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +50 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/index.js +3 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/Editor.js +5 -0
- package/dist/lib/plugins/openapi/playground/Editor.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +15 -0
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.js +3 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +21 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +31 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +97 -0
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.js +22 -0
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/UrlDisplay.js +22 -0
- package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/createUrl.d.ts +2 -0
- package/dist/lib/plugins/openapi/playground/createUrl.js +15 -0
- package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +1 -1
- package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +17 -9
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +2 -1
- package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -0
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
- package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
- package/dist/lib/plugins/openapi-worker.d.ts +1 -0
- package/dist/lib/plugins/openapi-worker.js +2 -0
- package/dist/lib/plugins/openapi-worker.js.map +1 -0
- package/dist/{app → lib}/plugins/redirect/index.d.ts +1 -2
- package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +7 -0
- package/dist/lib/ui/Button.js +11 -0
- package/dist/lib/ui/Button.js.map +1 -0
- package/dist/{app → lib}/ui/Callout.js.map +1 -1
- package/dist/{app → lib}/ui/Card.js.map +1 -1
- package/dist/{app → lib}/ui/Note.js.map +1 -1
- package/dist/{app → lib}/ui/Tabs.d.ts +2 -2
- package/dist/{app → lib}/ui/Tabs.js +2 -2
- package/dist/{app → lib}/ui/Tabs.js.map +1 -1
- package/dist/lib/ui/button-variants.d.ts +4 -0
- package/dist/{app/ui/Button.js → lib/ui/button-variants.js} +2 -12
- package/dist/lib/ui/button-variants.js.map +1 -0
- package/dist/{app → lib}/util/MdxComponents.js +9 -9
- package/dist/lib/util/MdxComponents.js.map +1 -0
- package/dist/{app → lib}/util/cn.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +9 -0
- package/dist/lib/util/createVariantComponent.js +17 -0
- package/dist/lib/util/createVariantComponent.js.map +1 -0
- package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
- package/dist/{app → lib}/util/groupBy.js.map +1 -1
- package/dist/{app → lib}/util/joinPath.js.map +1 -1
- package/dist/{app → lib}/util/pastellize.js.map +1 -1
- package/dist/lib/util/slugify.js.map +1 -0
- package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
- package/dist/ts.js +1 -2
- package/dist/ts.js.map +1 -1
- package/dist/vite/build.js +2 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/common.d.ts +1 -0
- package/dist/vite/common.js +5 -0
- package/dist/vite/common.js.map +1 -0
- package/dist/vite/config.d.ts +9 -2
- package/dist/vite/config.js +69 -28
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.d.ts +2 -0
- package/dist/vite/dev-server.js +30 -10
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +4 -0
- package/dist/vite/plugin-api-keys.js +33 -0
- package/dist/vite/plugin-api-keys.js.map +1 -0
- package/dist/vite/plugin-api.js +4 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +3 -2
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +4 -0
- package/dist/vite/plugin-component.js +16 -0
- package/dist/vite/plugin-component.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +1 -0
- package/dist/vite/plugin-config.js +4 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +4 -2
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +1 -2
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-html.js +0 -3
- package/dist/vite/plugin-html.js.map +1 -1
- package/dist/vite/plugin-mdx.js +3 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-metadata.d.ts +6 -0
- package/dist/vite/plugin-metadata.js +24 -0
- package/dist/vite/plugin-metadata.js.map +1 -0
- package/dist/vite/plugin-openapi-worker.d.ts +4 -0
- package/dist/vite/plugin-openapi-worker.js +28 -0
- package/dist/vite/plugin-openapi-worker.js.map +1 -0
- package/dist/vite/plugin-redirect.d.ts +4 -0
- package/dist/vite/plugin-redirect.js +32 -0
- package/dist/vite/plugin-redirect.js.map +1 -0
- package/dist/vite/plugin.js +8 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/Spinner-7LezPqGn.js +8393 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/lib/assets/index-BPdJm2ty.js +4764 -0
- package/lib/assets/worker-BCcpCNJ7.js +14473 -0
- package/lib/clerk-Wslx_mPo.js +19685 -0
- package/lib/index-DNx3xWa2.js +3461 -0
- package/lib/prism-bash.min-DadFsM4Z.js +6 -0
- package/lib/prism-java.min-d5iT_mOd.js +6 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
- package/lib/prism-php.min-o7FpoMP_.js +10 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
- package/lib/state-oycsxkHz.js +287 -0
- package/lib/urql-DMlBWUKL.js +1591 -0
- package/lib/zudoku.auth-auth0.js +26 -0
- package/lib/zudoku.auth-clerk.js +47 -0
- package/lib/zudoku.auth-openid.js +1058 -0
- package/lib/zudoku.components.js +925 -0
- package/lib/zudoku.openapi-worker.js +225 -0
- package/lib/zudoku.plugins.js +19863 -0
- package/package.json +69 -39
- package/src/app/App.tsx +16 -6
- package/src/app/main.css +1 -0
- package/src/app/main.tsx +12 -3
- package/src/lib/authentication/Callback.tsx +60 -0
- package/src/lib/authentication/authentication.ts +19 -0
- package/src/lib/authentication/errors.ts +21 -0
- package/src/lib/authentication/hook.ts +33 -0
- package/src/lib/authentication/providers/auth0.tsx +52 -0
- package/src/lib/authentication/providers/clerk.tsx +64 -0
- package/src/lib/authentication/providers/openid.tsx +312 -0
- package/src/lib/authentication/state.ts +19 -0
- package/src/{app → lib/components}/DevPortal.tsx +30 -42
- package/src/{app → lib}/components/Dialog.tsx +37 -37
- package/src/{app → lib}/components/Header.tsx +25 -20
- package/src/{app → lib/components}/Heading.tsx +2 -2
- package/src/{app → lib}/components/Layout.tsx +18 -12
- package/src/lib/components/Link.tsx +1 -0
- package/src/lib/components/Router.tsx +28 -0
- package/src/lib/components/Select.tsx +157 -0
- package/src/lib/components/Spinner.tsx +5 -0
- package/src/{app → lib}/components/SyntaxHighlight.tsx +10 -3
- package/src/{app → lib}/components/context/DevPortalProvider.ts +1 -1
- package/src/lib/components/index.ts +3 -0
- package/src/{app → lib}/components/navigation/SideNavigation.tsx +4 -1
- package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +3 -1
- package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +16 -7
- package/src/lib/components/navigation/SideNavigationWrapper.tsx +24 -0
- package/src/{app → lib}/core/DevPortalContext.ts +28 -64
- package/src/{app → lib}/core/plugins.ts +5 -5
- package/src/{app → lib}/oas/graphql/index.ts +2 -2
- package/src/lib/plugins/api-key/CreateApiKey.tsx +100 -0
- package/src/lib/plugins/api-key/SettingsApiKeys.tsx +125 -0
- package/src/lib/plugins/api-key/index.tsx +115 -0
- package/src/lib/plugins/index.ts +4 -0
- package/src/{app → lib}/plugins/markdown/MdxPage.tsx +32 -10
- package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +1 -16
- package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +1 -3
- package/src/lib/plugins/openapi/MakeRequest.tsx +63 -0
- package/src/{app → lib}/plugins/openapi/OperationList.tsx +14 -4
- package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +40 -6
- package/src/{app → lib}/plugins/openapi/ParameterList.tsx +4 -4
- package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +5 -2
- package/src/{app → lib}/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +2 -3
- package/src/lib/plugins/openapi/SchemaListView.tsx +228 -0
- package/src/{app → lib}/plugins/openapi/Sidecar.tsx +23 -23
- package/src/{app → lib}/plugins/openapi/graphql/gql.ts +7 -7
- package/src/{app → lib}/plugins/openapi/graphql/graphql.ts +59 -0
- package/src/{app → lib}/plugins/openapi/index.tsx +8 -2
- package/src/lib/plugins/openapi/playground/Editor.tsx +4 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +60 -0
- package/src/lib/plugins/openapi/playground/InlineInput.tsx +6 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +63 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +366 -0
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -0
- package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +32 -0
- package/src/lib/plugins/openapi/playground/createUrl.ts +22 -0
- package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +22 -9
- package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +2 -1
- package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
- package/src/lib/plugins/openapi-worker.ts +1 -0
- package/src/{app → lib}/plugins/redirect/index.tsx +1 -1
- package/src/lib/ui/Button.tsx +25 -0
- package/src/{app → lib}/ui/Tabs.tsx +2 -2
- package/src/{app/ui/Button.tsx → lib/ui/button-variants.ts} +4 -29
- package/src/{app → lib}/util/MdxComponents.tsx +33 -8
- package/src/{app → lib}/util/createVariantComponent.tsx +12 -7
- package/dist/app/DevPortal.d.ts +0 -25
- package/dist/app/DevPortal.js +0 -41
- package/dist/app/DevPortal.js.map +0 -1
- package/dist/app/Heading.js.map +0 -1
- package/dist/app/authentication/authentication.d.ts +0 -13
- package/dist/app/authentication/authentication.js.map +0 -1
- package/dist/app/authentication/clerk.d.ts +0 -5
- package/dist/app/authentication/clerk.js +0 -36
- package/dist/app/authentication/clerk.js.map +0 -1
- package/dist/app/authentication/openid.d.ts +0 -11
- package/dist/app/authentication/openid.js +0 -118
- package/dist/app/authentication/openid.js.map +0 -1
- package/dist/app/components/Dialog.js.map +0 -1
- package/dist/app/components/DynamicIcon.d.ts +0 -6
- package/dist/app/components/DynamicIcon.js +0 -6
- package/dist/app/components/DynamicIcon.js.map +0 -1
- package/dist/app/components/Header.d.ts +0 -1
- package/dist/app/components/Header.js +0 -15
- package/dist/app/components/Header.js.map +0 -1
- package/dist/app/components/Layout.js.map +0 -1
- package/dist/app/components/SyntaxHighlight.js.map +0 -1
- package/dist/app/components/context/DevPortalProvider.js.map +0 -1
- package/dist/app/components/context/PluginSystem.js.map +0 -1
- package/dist/app/components/navigation/SideNavigationItem.js.map +0 -1
- package/dist/app/components/navigation/SideNavigationWrapper.js +0 -6
- package/dist/app/components/navigation/SideNavigationWrapper.js.map +0 -1
- package/dist/app/core/DevPortalContext.js +0 -68
- package/dist/app/core/DevPortalContext.js.map +0 -1
- package/dist/app/core/icons.js.map +0 -1
- package/dist/app/core/router.js.map +0 -1
- package/dist/app/core/types/combine.d.ts +0 -4
- package/dist/app/core/types/combine.js +0 -2
- package/dist/app/core/types/combine.js.map +0 -1
- package/dist/app/oas/graphql/index.js.map +0 -1
- package/dist/app/oas/graphql/server.d.ts +0 -1
- package/dist/app/oas/graphql/server.js +0 -8
- package/dist/app/oas/graphql/server.js.map +0 -1
- package/dist/app/plugins/api-key/SettingsApiKeys.d.ts +0 -4
- package/dist/app/plugins/api-key/SettingsApiKeys.js +0 -7
- package/dist/app/plugins/api-key/SettingsApiKeys.js.map +0 -1
- package/dist/app/plugins/api-key/index.d.ts +0 -32
- package/dist/app/plugins/api-key/index.js +0 -55
- package/dist/app/plugins/api-key/index.js.map +0 -1
- package/dist/app/plugins/markdown/MdxPage.d.ts +0 -3
- package/dist/app/plugins/markdown/MdxPage.js +0 -55
- package/dist/app/plugins/markdown/MdxPage.js.map +0 -1
- package/dist/app/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
- package/dist/app/plugins/openapi/MakeRequest.js +0 -23
- package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/app/plugins/openapi/OperationList.js.map +0 -1
- package/dist/app/plugins/openapi/OperationListItem.js +0 -15
- package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
- package/dist/app/plugins/openapi/ParameterList.js +0 -5
- package/dist/app/plugins/openapi/ParameterList.js.map +0 -1
- package/dist/app/plugins/openapi/ParameterListItem.js +0 -13
- package/dist/app/plugins/openapi/graphql/gql.js.map +0 -1
- package/dist/app/plugins/openapi/graphql/graphql.js.map +0 -1
- package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
- package/dist/app/plugins/openapi/index.js.map +0 -1
- package/dist/app/plugins/openapi/playground/Playground.d.ts +0 -8
- package/dist/app/plugins/openapi/playground/Playground.js +0 -98
- package/dist/app/plugins/openapi/playground/Playground.js.map +0 -1
- package/dist/app/plugins/openapi/util/generateSchemaExample.js.map +0 -1
- package/dist/app/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
- package/dist/app/ui/Button.d.ts +0 -11
- package/dist/app/ui/Button.js.map +0 -1
- package/dist/app/util/MdxComponents.js.map +0 -1
- package/dist/app/util/createVariantComponent.d.ts +0 -15
- package/dist/app/util/createVariantComponent.js +0 -12
- package/dist/app/util/createVariantComponent.js.map +0 -1
- package/dist/app/util/slugify.js.map +0 -1
- package/dist/auth.d.ts +0 -2
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -1
- package/dist/plugins.d.ts +0 -4
- package/dist/plugins.js +0 -6
- package/dist/plugins.js.map +0 -1
- package/src/app/authentication/authentication.ts +0 -18
- package/src/app/authentication/clerk.ts +0 -47
- package/src/app/authentication/openid.ts +0 -192
- package/src/app/components/DynamicIcon.tsx +0 -60
- package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
- package/src/app/core/types/combine.ts +0 -16
- package/src/app/oas/graphql/server.ts +0 -10
- package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
- package/src/app/plugins/api-key/index.tsx +0 -123
- package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
- package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
- package/src/app/plugins/openapi/queries.graphql +0 -6
- package/dist/{app → lib}/authentication/authentication.js +0 -0
- package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
- package/dist/{app → lib}/components/AnchorLink.js +0 -0
- package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
- package/dist/{app → lib}/components/CategoryHeading.js +0 -0
- package/dist/{app → lib/components}/Heading.d.ts +0 -0
- package/dist/{app → lib}/components/Input.d.ts +0 -0
- package/dist/{app → lib}/components/Input.js +0 -0
- package/dist/{app → lib}/components/Layout.d.ts +0 -0
- package/dist/{app → lib}/components/Markdown.d.ts +0 -0
- package/dist/{app → lib}/components/Markdown.js +0 -0
- package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
- package/dist/{app → lib}/components/TopNavigation.js +0 -0
- package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
- package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
- package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
- package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
- package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
- package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
- package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
- package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
- package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
- package/dist/{app → lib}/components/navigation/util.js +0 -0
- package/dist/{app → lib}/core/helmet.d.ts +0 -0
- package/dist/{app → lib}/core/helmet.js +0 -0
- package/dist/{app → lib}/core/icons.d.ts +0 -0
- package/dist/{app → lib}/core/icons.js +0 -0
- package/dist/{app → lib}/core/router.d.ts +0 -0
- package/dist/{app → lib}/core/router.js +0 -0
- package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
- package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
- package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
- package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
- package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
- package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
- package/dist/{app → lib}/oas/parser/index.js +0 -0
- package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
- package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
- package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
- package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
- package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
- package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
- package/dist/{app → lib}/plugins/markdown/index.js +0 -0
- package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
- package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
- package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
- package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
- package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
- package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
- package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
- package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
- package/dist/{app → lib}/plugins/redirect/index.js +0 -0
- package/dist/{app → lib}/ui/Callout.d.ts +0 -0
- package/dist/{app → lib}/ui/Callout.js +0 -0
- package/dist/{app → lib}/ui/Card.d.ts +0 -0
- package/dist/{app → lib}/ui/Card.js +0 -0
- package/dist/{app → lib}/ui/Note.d.ts +0 -0
- package/dist/{app → lib}/ui/Note.js +0 -0
- package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
- package/dist/{app → lib}/util/cn.d.ts +0 -0
- package/dist/{app → lib}/util/cn.js +0 -0
- package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
- package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
- package/dist/{app → lib}/util/groupBy.d.ts +0 -0
- package/dist/{app → lib}/util/groupBy.js +0 -0
- package/dist/{app → lib}/util/joinPath.d.ts +0 -0
- package/dist/{app → lib}/util/joinPath.js +0 -0
- package/dist/{app → lib}/util/pastellize.d.ts +0 -0
- package/dist/{app → lib}/util/pastellize.js +0 -0
- package/dist/{app → lib}/util/slugify.d.ts +0 -0
- package/dist/{app → lib}/util/slugify.js +0 -0
- package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
- package/dist/{app → lib}/util/traverseNavigation.js +0 -0
- package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
- package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
- package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
- package/dist/{app → lib}/util/useScrollToTop.js +0 -0
- package/src/{app → lib}/components/AnchorLink.tsx +0 -0
- package/src/{app → lib}/components/CategoryHeading.tsx +1 -1
- package/src/{app → lib}/components/Input.tsx +0 -0
- package/src/{app → lib}/components/Markdown.tsx +0 -0
- package/src/{app → lib}/components/TopNavigation.tsx +0 -0
- package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
- package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
- package/src/{app → lib}/components/context/ThemeContext.tsx +1 -1
- package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
- package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
- package/src/{app → lib}/components/navigation/util.ts +0 -0
- package/src/{app → lib}/core/helmet.ts +0 -0
- package/src/{app → lib}/core/icons.tsx +0 -0
- package/src/{app → lib}/core/router.tsx +0 -0
- package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
- package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
- package/src/{app → lib}/oas/parser/index.ts +0 -0
- package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
- package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
- package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
- package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
- package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
- package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
- package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
- package/src/{app → lib}/plugins/openapi/SidecarBox.tsx +0 -0
- package/src/{app → lib}/plugins/openapi/graphql/fragment-masking.ts +1 -1
- /package/src/{app → lib}/plugins/openapi/graphql/index.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
- /package/src/{app → lib}/ui/Callout.tsx +0 -0
- /package/src/{app → lib}/ui/Card.tsx +0 -0
- /package/src/{app → lib}/ui/Note.tsx +0 -0
- /package/src/{app → lib}/util/cn.ts +0 -0
- /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
- /package/src/{app → lib}/util/groupBy.ts +0 -0
- /package/src/{app → lib}/util/joinPath.tsx +0 -0
- /package/src/{app → lib}/util/pastellize.ts +0 -0
- /package/src/{app → lib}/util/slugify.ts +0 -0
- /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
- /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
- /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
|
@@ -3,20 +3,16 @@ import { Outlet, useLocation } from "react-router-dom";
|
|
|
3
3
|
import { Helmet } from "../core/helmet.js";
|
|
4
4
|
import { useScrollToAnchor } from "../util/useScrollToAnchor.js";
|
|
5
5
|
import { useScrollToTop } from "../util/useScrollToTop.js";
|
|
6
|
-
import { Header } from "./Header.js";
|
|
7
6
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
8
7
|
import { useViewportAnchor } from "./context/ViewportAnchorContext.js";
|
|
8
|
+
import { Header } from "./Header.js";
|
|
9
9
|
import { SideNavigation } from "./navigation/SideNavigation.js";
|
|
10
|
-
import {
|
|
10
|
+
import { Spinner } from "./Spinner.js";
|
|
11
11
|
|
|
12
12
|
export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
13
13
|
const location = useLocation();
|
|
14
14
|
const { setActiveAnchor } = useViewportAnchor();
|
|
15
|
-
const { meta
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
void handleAuthenticationResponse(location);
|
|
19
|
-
}, [handleAuthenticationResponse, location]);
|
|
15
|
+
const { meta } = useDevPortal();
|
|
20
16
|
|
|
21
17
|
useScrollToAnchor();
|
|
22
18
|
useScrollToTop();
|
|
@@ -41,15 +37,25 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
41
37
|
{meta?.favicon && <link rel="icon" href={meta.favicon} />}
|
|
42
38
|
</Helmet>
|
|
43
39
|
<Header />
|
|
44
|
-
|
|
40
|
+
|
|
41
|
+
<div className="max-w-screen-2xl mx-auto pt-[--header-height] px-10 lg:px-12 h-full">
|
|
45
42
|
<Suspense
|
|
46
|
-
fallback={
|
|
43
|
+
fallback={
|
|
44
|
+
<div className="grid h-full place-items-center">
|
|
45
|
+
<Spinner />
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
47
48
|
>
|
|
48
49
|
<SideNavigation />
|
|
50
|
+
<main
|
|
51
|
+
className="dark:border-white/10 translate-x-0
|
|
52
|
+
lg:overflow-visible
|
|
53
|
+
lg:peer-data-[navigation=true]:w-[calc(100%-var(--side-nav-width))]
|
|
54
|
+
lg:peer-data-[navigation=true]:translate-x-[--side-nav-width] peer-data-[navigation=true]:pl-12"
|
|
55
|
+
>
|
|
56
|
+
{children ?? <Outlet />}
|
|
57
|
+
</main>
|
|
49
58
|
</Suspense>
|
|
50
|
-
<main className="dark:border-white/10 lg:overflow-visible translate-x-0 lg:w-[calc(100%-var(--side-nav-width))] lg:translate-x-[--side-nav-width] pl-12">
|
|
51
|
-
{children ?? <Outlet />}
|
|
52
|
-
</main>
|
|
53
59
|
</div>
|
|
54
60
|
</>
|
|
55
61
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Link } from "../core/router.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
|
+
import { DevPortalPlugin, isNavigationPlugin } from "../core/plugins.js";
|
|
4
|
+
import { Layout } from "./Layout.js";
|
|
5
|
+
|
|
6
|
+
export function Router({ plugins }: { plugins?: DevPortalPlugin[] }) {
|
|
7
|
+
const router = useMemo(() => {
|
|
8
|
+
const routes = (plugins ?? []).flatMap((plugin) =>
|
|
9
|
+
isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
return createBrowserRouter([
|
|
13
|
+
{
|
|
14
|
+
path: "/",
|
|
15
|
+
element: <Layout />,
|
|
16
|
+
errorElement: (
|
|
17
|
+
<Layout>
|
|
18
|
+
<div className="h-[75vh] flex items-center justify-center">
|
|
19
|
+
Error, look at the console
|
|
20
|
+
</div>
|
|
21
|
+
</Layout>
|
|
22
|
+
),
|
|
23
|
+
children: routes,
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
}, [plugins]);
|
|
27
|
+
return <RouterProvider router={router} />;
|
|
28
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../util/cn.js";
|
|
5
|
+
|
|
6
|
+
const Select = SelectPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
9
|
+
|
|
10
|
+
const SelectValue = SelectPrimitive.Value;
|
|
11
|
+
|
|
12
|
+
const SelectTrigger = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
15
|
+
>(({ className, children, ...props }, ref) => (
|
|
16
|
+
<SelectPrimitive.Trigger
|
|
17
|
+
ref={ref}
|
|
18
|
+
className={cn(
|
|
19
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
<span className="truncate">{children}</span>
|
|
25
|
+
<SelectPrimitive.Icon asChild>
|
|
26
|
+
<ChevronDown className="flex-shrink-0 h-4 w-4 opacity-50" />
|
|
27
|
+
</SelectPrimitive.Icon>
|
|
28
|
+
</SelectPrimitive.Trigger>
|
|
29
|
+
));
|
|
30
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
31
|
+
|
|
32
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
33
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
34
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
35
|
+
>(({ className, ...props }, ref) => (
|
|
36
|
+
<SelectPrimitive.ScrollUpButton
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(
|
|
39
|
+
"flex cursor-default items-center justify-center py-1",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<ChevronUp className="h-4 w-4" />
|
|
45
|
+
</SelectPrimitive.ScrollUpButton>
|
|
46
|
+
));
|
|
47
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
48
|
+
|
|
49
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
50
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
51
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
52
|
+
>(({ className, ...props }, ref) => (
|
|
53
|
+
<SelectPrimitive.ScrollDownButton
|
|
54
|
+
ref={ref}
|
|
55
|
+
className={cn(
|
|
56
|
+
"flex cursor-default items-center justify-center py-1",
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
<ChevronDown className="h-4 w-4" />
|
|
62
|
+
</SelectPrimitive.ScrollDownButton>
|
|
63
|
+
));
|
|
64
|
+
SelectScrollDownButton.displayName =
|
|
65
|
+
SelectPrimitive.ScrollDownButton.displayName;
|
|
66
|
+
|
|
67
|
+
const SelectContent = React.forwardRef<
|
|
68
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
69
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
70
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
71
|
+
<SelectPrimitive.Portal>
|
|
72
|
+
<SelectPrimitive.Content
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn(
|
|
75
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
76
|
+
position === "popper" &&
|
|
77
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
78
|
+
className,
|
|
79
|
+
)}
|
|
80
|
+
position={position}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
<SelectScrollUpButton />
|
|
84
|
+
<SelectPrimitive.Viewport
|
|
85
|
+
className={cn(
|
|
86
|
+
"p-1",
|
|
87
|
+
position === "popper" &&
|
|
88
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
89
|
+
)}
|
|
90
|
+
>
|
|
91
|
+
{children}
|
|
92
|
+
</SelectPrimitive.Viewport>
|
|
93
|
+
<SelectScrollDownButton />
|
|
94
|
+
</SelectPrimitive.Content>
|
|
95
|
+
</SelectPrimitive.Portal>
|
|
96
|
+
));
|
|
97
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
98
|
+
|
|
99
|
+
const SelectLabel = React.forwardRef<
|
|
100
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
101
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
102
|
+
>(({ className, ...props }, ref) => (
|
|
103
|
+
<SelectPrimitive.Label
|
|
104
|
+
ref={ref}
|
|
105
|
+
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
));
|
|
109
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
110
|
+
|
|
111
|
+
const SelectItem = React.forwardRef<
|
|
112
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
113
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
114
|
+
>(({ className, children, ...props }, ref) => (
|
|
115
|
+
<SelectPrimitive.Item
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
119
|
+
className,
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
>
|
|
123
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
124
|
+
<SelectPrimitive.ItemIndicator>
|
|
125
|
+
<Check className="h-4 w-4" />
|
|
126
|
+
</SelectPrimitive.ItemIndicator>
|
|
127
|
+
</span>
|
|
128
|
+
|
|
129
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
130
|
+
</SelectPrimitive.Item>
|
|
131
|
+
));
|
|
132
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
133
|
+
|
|
134
|
+
const SelectSeparator = React.forwardRef<
|
|
135
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
136
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
137
|
+
>(({ className, ...props }, ref) => (
|
|
138
|
+
<SelectPrimitive.Separator
|
|
139
|
+
ref={ref}
|
|
140
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
));
|
|
144
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Select,
|
|
148
|
+
SelectContent,
|
|
149
|
+
SelectGroup,
|
|
150
|
+
SelectItem,
|
|
151
|
+
SelectLabel,
|
|
152
|
+
SelectScrollDownButton,
|
|
153
|
+
SelectScrollUpButton,
|
|
154
|
+
SelectSeparator,
|
|
155
|
+
SelectTrigger,
|
|
156
|
+
SelectValue,
|
|
157
|
+
};
|
|
@@ -32,6 +32,7 @@ type SyntaxHighlightProps = {
|
|
|
32
32
|
noBackground?: boolean;
|
|
33
33
|
wrapLines?: boolean;
|
|
34
34
|
copyable?: boolean;
|
|
35
|
+
showLanguageIndicator?: boolean;
|
|
35
36
|
} & Omit<HighlightProps, "children">;
|
|
36
37
|
|
|
37
38
|
export const SyntaxHighlight = ({
|
|
@@ -41,6 +42,10 @@ export const SyntaxHighlight = ({
|
|
|
41
42
|
const [isDark] = useTheme();
|
|
42
43
|
const [isCopied, setIsCopied] = useState(false);
|
|
43
44
|
|
|
45
|
+
if (!props.code) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
return (
|
|
45
50
|
<Highlight theme={isDark ? themes.vsDark : themes.github} {...props}>
|
|
46
51
|
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
|
@@ -77,9 +82,11 @@ export const SyntaxHighlight = ({
|
|
|
77
82
|
)}
|
|
78
83
|
</button>
|
|
79
84
|
)}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
{props.showLanguageIndicator && (
|
|
86
|
+
<span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
|
|
87
|
+
{props.language}
|
|
88
|
+
</span>
|
|
89
|
+
)}
|
|
83
90
|
{tokens.map((line, i) => (
|
|
84
91
|
<div key={i} {...getLineProps({ line })}>
|
|
85
92
|
{line.map((token, key) => (
|
|
@@ -9,7 +9,10 @@ export const SideNavigation = () => {
|
|
|
9
9
|
const navigation = useNavigation();
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
|
-
<SideNavigationWrapper
|
|
12
|
+
<SideNavigationWrapper
|
|
13
|
+
ref={navRef}
|
|
14
|
+
pushMainContent={navigation.data.items.length > 0}
|
|
15
|
+
>
|
|
13
16
|
{navigation.data.items.map((category) => (
|
|
14
17
|
<SideNavigationCategory key={category.label} category={category} />
|
|
15
18
|
))}
|
|
@@ -36,7 +36,7 @@ export const SideNavigationCategory = ({
|
|
|
36
36
|
open={isOpen}
|
|
37
37
|
onOpenChange={() => setIsOpen((prev) => !prev)}
|
|
38
38
|
>
|
|
39
|
-
{category.label.length > 0
|
|
39
|
+
{category.label.length > 0 ? (
|
|
40
40
|
<Collapsible.Trigger asChild={isCollapsible} disabled={!isCollapsible}>
|
|
41
41
|
<h5
|
|
42
42
|
className={cn(
|
|
@@ -53,6 +53,8 @@ export const SideNavigationCategory = ({
|
|
|
53
53
|
)}
|
|
54
54
|
</h5>
|
|
55
55
|
</Collapsible.Trigger>
|
|
56
|
+
) : (
|
|
57
|
+
"Endpoints"
|
|
56
58
|
)}
|
|
57
59
|
<Collapsible.Content className="CollapsibleContent -mx-[--padding-nav-item]">
|
|
58
60
|
{/* margin on Collapsible.Content will lead jumpiness when animating because it's not added to the calculated height */}
|
|
@@ -11,11 +11,10 @@ import type {
|
|
|
11
11
|
import { cn } from "../../util/cn.js";
|
|
12
12
|
import { joinPath } from "../../util/joinPath.js";
|
|
13
13
|
import { AnchorLink } from "../AnchorLink.js";
|
|
14
|
-
import { DynamicIcon, isValidIcon } from "../DynamicIcon.js";
|
|
15
14
|
import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
|
|
16
15
|
import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
|
|
17
16
|
|
|
18
|
-
export const
|
|
17
|
+
export const navigationListItem = cva(
|
|
19
18
|
"flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
|
|
20
19
|
{
|
|
21
20
|
variants: {
|
|
@@ -23,6 +22,10 @@ export const linkItem = cva(
|
|
|
23
22
|
true: "text-primary font-medium",
|
|
24
23
|
false: "text-foreground/80",
|
|
25
24
|
},
|
|
25
|
+
isMuted: {
|
|
26
|
+
true: "text-foreground/30",
|
|
27
|
+
false: "",
|
|
28
|
+
},
|
|
26
29
|
},
|
|
27
30
|
},
|
|
28
31
|
);
|
|
@@ -54,7 +57,9 @@ export const SideNavigationItem = ({
|
|
|
54
57
|
if (isLinkItem(item)) {
|
|
55
58
|
const classes = cn(
|
|
56
59
|
"flex items-center gap-2",
|
|
57
|
-
|
|
60
|
+
navigationListItem({
|
|
61
|
+
isActive: item.href === location.pathname,
|
|
62
|
+
}),
|
|
58
63
|
);
|
|
59
64
|
return item.href.startsWith("http") ? (
|
|
60
65
|
<a
|
|
@@ -76,7 +81,7 @@ export const SideNavigationItem = ({
|
|
|
76
81
|
const linkContent = (
|
|
77
82
|
<div className="flex justify-between w-full">
|
|
78
83
|
<div className="flex items-center gap-2 truncate w-full">
|
|
79
|
-
{
|
|
84
|
+
{item.icon}
|
|
80
85
|
{typeof item.label !== "string" ? (
|
|
81
86
|
item.label
|
|
82
87
|
) : (
|
|
@@ -101,7 +106,10 @@ export const SideNavigationItem = ({
|
|
|
101
106
|
className="flex flex-col"
|
|
102
107
|
>
|
|
103
108
|
<Collapsible.Trigger
|
|
104
|
-
className={cn(
|
|
109
|
+
className={cn(
|
|
110
|
+
"group text-start",
|
|
111
|
+
navigationListItem({ isActive: false }),
|
|
112
|
+
)}
|
|
105
113
|
>
|
|
106
114
|
{linkContent}
|
|
107
115
|
</Collapsible.Trigger>
|
|
@@ -124,15 +132,16 @@ export const SideNavigationItem = ({
|
|
|
124
132
|
<AnchorLink
|
|
125
133
|
to={item.path}
|
|
126
134
|
{...{ [DATA_ANCHOR_ATTR]: item.path }}
|
|
127
|
-
className={
|
|
135
|
+
className={navigationListItem({
|
|
128
136
|
isActive: item.path.slice(1) === activeAnchor,
|
|
137
|
+
isMuted: item.muted,
|
|
129
138
|
})}
|
|
130
139
|
>
|
|
131
140
|
{linkContent}
|
|
132
141
|
</AnchorLink>
|
|
133
142
|
) : (
|
|
134
143
|
<NavLink
|
|
135
|
-
className={({ isActive }) =>
|
|
144
|
+
className={({ isActive }) => navigationListItem({ isActive })}
|
|
136
145
|
to={currentPath}
|
|
137
146
|
>
|
|
138
147
|
{linkContent}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { forwardRef, type PropsWithChildren } from "react";
|
|
2
|
+
import { cn } from "../../util/cn.js";
|
|
3
|
+
|
|
4
|
+
export const SideNavigationWrapper = forwardRef<
|
|
5
|
+
HTMLDivElement,
|
|
6
|
+
PropsWithChildren<{ pushMainContent?: boolean; className?: string }>
|
|
7
|
+
>(function SideNavigation({ children, className, pushMainContent }, ref) {
|
|
8
|
+
return (
|
|
9
|
+
<nav
|
|
10
|
+
// this data attribute is used in `Layout.tsx` to determine if side navigation
|
|
11
|
+
// is present for the current page so the main content is pushed to the right
|
|
12
|
+
// it's also important to set `peer` class here.
|
|
13
|
+
// maybe this could be simplified by adjusting the layout
|
|
14
|
+
data-navigation={String(pushMainContent)}
|
|
15
|
+
className={cn(
|
|
16
|
+
"peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0 p-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 pt-[--padding-content-top] w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
ref={ref}
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</nav>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import { create } from "zustand";
|
|
4
|
-
import { type
|
|
5
|
-
import { type AuthProvider } from "../authentication/authentication.js";
|
|
4
|
+
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
6
5
|
import {
|
|
7
|
-
|
|
6
|
+
type DevPortalPath,
|
|
7
|
+
type DevPortalProps,
|
|
8
|
+
} from "../components/DevPortal.js";
|
|
9
|
+
import {
|
|
10
|
+
isApiIdentityPlugin,
|
|
8
11
|
isNavigationPlugin,
|
|
9
12
|
needsInitialization,
|
|
10
13
|
type DevPortalPlugin,
|
|
11
14
|
type NavigationPlugin,
|
|
12
15
|
} from "./plugins.js";
|
|
13
16
|
|
|
14
|
-
import type { LucideIcon } from "lucide-react";
|
|
15
|
-
import type { IconName } from "../components/DynamicIcon.js";
|
|
16
|
-
|
|
17
17
|
export interface ApiIdentity {
|
|
18
18
|
authorizeRequest: (request: Request) => Request;
|
|
19
|
-
|
|
19
|
+
label: string;
|
|
20
20
|
id: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
type BaseNavigationCategoryItem = {
|
|
24
24
|
label: ReactNode;
|
|
25
25
|
title?: string;
|
|
26
|
-
|
|
26
|
+
muted?: boolean;
|
|
27
|
+
icon?: ReactNode;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export type PathNavigationCategoryItem = BaseNavigationCategoryItem & {
|
|
@@ -44,7 +45,7 @@ export type NavigationCategory = {
|
|
|
44
45
|
path?: string;
|
|
45
46
|
expanded?: boolean;
|
|
46
47
|
collapsible?: boolean;
|
|
47
|
-
icon?:
|
|
48
|
+
icon?: ReactNode;
|
|
48
49
|
children: NavigationCategoryItem[];
|
|
49
50
|
};
|
|
50
51
|
|
|
@@ -54,26 +55,13 @@ export type NavigationItem = {
|
|
|
54
55
|
categories?: NavigationCategory[];
|
|
55
56
|
};
|
|
56
57
|
|
|
57
|
-
export type SessionProfileState = {
|
|
58
|
-
isLoggedIn: boolean;
|
|
59
|
-
sub?: string;
|
|
60
|
-
email?: string;
|
|
61
|
-
name?: string;
|
|
62
|
-
email_verified?: string;
|
|
63
|
-
picture?: string;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
58
|
export type RoutingState = {
|
|
67
59
|
path?: string;
|
|
68
60
|
};
|
|
69
61
|
|
|
70
62
|
export const queryClient = new QueryClient();
|
|
71
63
|
|
|
72
|
-
export const
|
|
73
|
-
() => ({
|
|
74
|
-
isLoggedIn: false,
|
|
75
|
-
}),
|
|
76
|
-
);
|
|
64
|
+
export const useRoutingState = create<RoutingState>(() => ({}));
|
|
77
65
|
|
|
78
66
|
export type ApiKeyCache = "api-keys";
|
|
79
67
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
@@ -84,67 +72,38 @@ export class DevPortalContext {
|
|
|
84
72
|
|
|
85
73
|
public navigation: NavigationItem[];
|
|
86
74
|
public meta: DevPortalProps["meta"];
|
|
87
|
-
public authentication?:
|
|
88
|
-
public state: typeof
|
|
75
|
+
public authentication?: AuthenticationProvider;
|
|
76
|
+
public state: typeof useRoutingState;
|
|
89
77
|
|
|
90
|
-
constructor(
|
|
78
|
+
constructor(config: DevPortalProps) {
|
|
91
79
|
this.plugins = config.plugins ?? [];
|
|
92
80
|
this.navigation = config.navigation;
|
|
93
81
|
this.navigationPlugins = this.plugins.filter(isNavigationPlugin);
|
|
94
82
|
this.authentication = config.authentication;
|
|
95
83
|
this.meta = config.meta;
|
|
96
|
-
this.state =
|
|
84
|
+
this.state = useRoutingState;
|
|
97
85
|
}
|
|
98
86
|
|
|
99
87
|
initialize = async () => {
|
|
100
88
|
this.plugins
|
|
101
89
|
.filter(needsInitialization)
|
|
102
90
|
.forEach((plugin) => plugin.initialize(this));
|
|
103
|
-
this.authentication?.initialize(this);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
setUserProfile = async (profile: Partial<SessionProfileState>) => {
|
|
107
|
-
return useDevPortalState.setState(profile);
|
|
108
91
|
};
|
|
109
92
|
|
|
110
93
|
invalidateCache = async (key: DevPortalCacheKey[]) => {
|
|
111
|
-
queryClient.invalidateQueries({ queryKey: key });
|
|
94
|
+
await queryClient.invalidateQueries({ queryKey: key });
|
|
112
95
|
};
|
|
113
96
|
|
|
114
97
|
getApiIdentities = async () => {
|
|
115
98
|
const keys = await Promise.all(
|
|
116
99
|
this.plugins
|
|
117
|
-
.filter(
|
|
100
|
+
.filter(isApiIdentityPlugin)
|
|
118
101
|
.map((plugin) => plugin.getIdentities(this)),
|
|
119
102
|
);
|
|
120
103
|
|
|
121
104
|
return keys.flat();
|
|
122
105
|
};
|
|
123
106
|
|
|
124
|
-
login = async () => {
|
|
125
|
-
if (!this.authentication) {
|
|
126
|
-
throw new Error("No authentication configured");
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return this.authentication.login(this);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
logout = async () => {
|
|
133
|
-
if (!this.authentication) {
|
|
134
|
-
throw new Error("No authentication configured");
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return this.authentication.signOut(this);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
handleAuthenticationResponse = async (path: {
|
|
141
|
-
pathname: string;
|
|
142
|
-
search: string;
|
|
143
|
-
hash: string;
|
|
144
|
-
}) => {
|
|
145
|
-
this.config.authentication?.handleAuthenticationResponse?.(path, this);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
107
|
getNavigation = async (path: string) => {
|
|
149
108
|
const navigations = await Promise.all(
|
|
150
109
|
this.navigationPlugins.map(async (plugin) =>
|
|
@@ -155,10 +114,15 @@ export class DevPortalContext {
|
|
|
155
114
|
return navigations.flatMap((nav) => nav ?? []);
|
|
156
115
|
};
|
|
157
116
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
117
|
+
async signRequest(request: Request) {
|
|
118
|
+
if (!this.authentication) {
|
|
119
|
+
throw new Error("No authentication provider configured");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const accessToken = await this.authentication.getAccessToken();
|
|
123
|
+
|
|
124
|
+
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
125
|
+
|
|
126
|
+
return request;
|
|
127
|
+
}
|
|
164
128
|
}
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
type ApiIdentity,
|
|
5
5
|
type NavigationCategory,
|
|
6
6
|
} from "./DevPortalContext.js";
|
|
7
|
-
import { type Combine } from "./types/combine.js";
|
|
8
7
|
|
|
9
8
|
export type PluginNavigationCategory = {
|
|
10
9
|
path: string;
|
|
11
10
|
} & NavigationCategory;
|
|
12
11
|
|
|
13
|
-
export type DevPortalPlugin =
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type DevPortalPlugin =
|
|
13
|
+
| NavigationPlugin
|
|
14
|
+
| ApiIdentityPlugin
|
|
15
|
+
| InitializationPlugin;
|
|
16
16
|
|
|
17
17
|
export interface NavigationPlugin {
|
|
18
18
|
getRoutes: () => RouteObject[];
|
|
@@ -37,7 +37,7 @@ export const needsInitialization = (
|
|
|
37
37
|
): obj is InitializationPlugin =>
|
|
38
38
|
"initialize" in obj && typeof obj.initialize === "function";
|
|
39
39
|
|
|
40
|
-
export const
|
|
40
|
+
export const isApiIdentityPlugin = (
|
|
41
41
|
obj: DevPortalPlugin,
|
|
42
42
|
): obj is ApiIdentityPlugin =>
|
|
43
43
|
"getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
@@ -69,7 +69,7 @@ const getAllOperations = (paths?: PathsObject, tag?: string) => {
|
|
|
69
69
|
if (!value?.[method]) return [];
|
|
70
70
|
|
|
71
71
|
const operation = value[method] as OperationObject;
|
|
72
|
-
const pathParameters = value
|
|
72
|
+
const pathParameters = value.parameters ?? [];
|
|
73
73
|
const operationParameters = operation.parameters ?? [];
|
|
74
74
|
|
|
75
75
|
// parameters are inherited from the parent path object,
|
|
@@ -189,7 +189,7 @@ const ParameterItem = builder
|
|
|
189
189
|
resolve: (parent) =>
|
|
190
190
|
Object.entries(parent.examples ?? {}).map(([name, value]) => ({
|
|
191
191
|
name,
|
|
192
|
-
...value,
|
|
192
|
+
...(typeof value === "string" ? { value } : value),
|
|
193
193
|
})),
|
|
194
194
|
nullable: true,
|
|
195
195
|
}),
|