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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Heading } from "../../Heading.js";
|
|
1
|
+
import { Heading } from "../../components/Heading.js";
|
|
2
2
|
import type { ParameterGroup } from "./OperationListItem.js";
|
|
3
3
|
import {
|
|
4
4
|
ParameterListItem,
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
} from "./ParameterListItem.js";
|
|
7
7
|
|
|
8
8
|
export const ParameterList = ({
|
|
9
|
-
groupedParameters,
|
|
10
9
|
group,
|
|
10
|
+
parameters,
|
|
11
11
|
id,
|
|
12
12
|
}: {
|
|
13
|
-
groupedParameters: Record<ParameterGroup, ParameterListItemResult[]>;
|
|
14
13
|
group: ParameterGroup;
|
|
14
|
+
parameters: ParameterListItemResult[];
|
|
15
15
|
id: string;
|
|
16
16
|
}) => (
|
|
17
17
|
<>
|
|
@@ -19,7 +19,7 @@ export const ParameterList = ({
|
|
|
19
19
|
{group === "header" ? "Headers" : `${group} Parameters`}
|
|
20
20
|
</Heading>
|
|
21
21
|
<ul className="list-none m-0 px-0 overflow-hidden">
|
|
22
|
-
{
|
|
22
|
+
{parameters.map((parameter) => (
|
|
23
23
|
<ParameterListItem
|
|
24
24
|
key={`${parameter.name}-${parameter.in}`}
|
|
25
25
|
parameter={parameter}
|
|
@@ -28,7 +28,7 @@ export const ParameterListItem = ({
|
|
|
28
28
|
group: ParameterGroup;
|
|
29
29
|
id: string;
|
|
30
30
|
}) => (
|
|
31
|
-
<li className="not-prose px-2 py-4 border-t border-border bg-border/20">
|
|
31
|
+
<li className="not-prose px-2 py-4 border-t border-border bg-border/20 text-sm flex flex-col gap-1">
|
|
32
32
|
<div className="flex items-center gap-2">
|
|
33
33
|
<code>
|
|
34
34
|
{group === "path" ? (
|
|
@@ -54,7 +54,10 @@ export const ParameterListItem = ({
|
|
|
54
54
|
)}
|
|
55
55
|
</div>
|
|
56
56
|
{parameter.description && (
|
|
57
|
-
<Markdown
|
|
57
|
+
<Markdown
|
|
58
|
+
content={parameter.description}
|
|
59
|
+
className="text-sm prose-p:my-1"
|
|
60
|
+
/>
|
|
58
61
|
)}
|
|
59
62
|
</li>
|
|
60
63
|
);
|
|
@@ -15,12 +15,12 @@ export const ResponsesSidecarBox = ({
|
|
|
15
15
|
const [tabIndex, setTabIndex] = useState(0);
|
|
16
16
|
|
|
17
17
|
const activeTab = responses[tabIndex];
|
|
18
|
-
const schema = activeTab
|
|
18
|
+
const schema = activeTab.content?.[0]?.schema as SchemaObject | undefined;
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<SidecarBox.Root>
|
|
22
22
|
<SidecarBox.Head className="text-xs grid grid-rows-2 pb-0">
|
|
23
|
-
<span className="font-mono">Responses</span>
|
|
23
|
+
<span className="font-mono">Example Responses</span>
|
|
24
24
|
<div className="flex gap-2">
|
|
25
25
|
{responses.map((response, index) => (
|
|
26
26
|
<div
|
|
@@ -43,7 +43,6 @@ export const ResponsesSidecarBox = ({
|
|
|
43
43
|
<SyntaxHighlight
|
|
44
44
|
language="json"
|
|
45
45
|
noBackground
|
|
46
|
-
copyable={false}
|
|
47
46
|
className="text-xs"
|
|
48
47
|
code={JSON.stringify(generateSchemaExample(schema), null, 2)}
|
|
49
48
|
/>
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
|
+
import { ListPlusIcon } from "lucide-react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Markdown } from "../../components/Markdown.js";
|
|
5
|
+
import { SchemaObject } from "../../oas/parser/index.js";
|
|
6
|
+
import { Button } from "../../ui/Button.js";
|
|
7
|
+
import { cn } from "../../util/cn.js";
|
|
8
|
+
|
|
9
|
+
export const SchemaListView = ({
|
|
10
|
+
name,
|
|
11
|
+
schema,
|
|
12
|
+
level = 0,
|
|
13
|
+
defaultOpen = false,
|
|
14
|
+
}: {
|
|
15
|
+
level?: number;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
name?: string;
|
|
18
|
+
schema: SchemaObject;
|
|
19
|
+
}) => {
|
|
20
|
+
const properties = Object.entries(schema.properties ?? {});
|
|
21
|
+
const additionalProperties =
|
|
22
|
+
typeof schema.additionalProperties === "object"
|
|
23
|
+
? Object.entries(schema.additionalProperties)
|
|
24
|
+
: [];
|
|
25
|
+
|
|
26
|
+
const combinedProperties = properties.concat(
|
|
27
|
+
Array.isArray(additionalProperties) ? additionalProperties : [],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const groups = Object.groupBy(
|
|
31
|
+
combinedProperties,
|
|
32
|
+
([propertyName, property]) => {
|
|
33
|
+
return property.deprecated
|
|
34
|
+
? "deprecated"
|
|
35
|
+
: schema.required?.includes(propertyName)
|
|
36
|
+
? "required"
|
|
37
|
+
: "optional";
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
className={cn(
|
|
44
|
+
"not-prose",
|
|
45
|
+
level > 0 && "border border-border rounded text-sm",
|
|
46
|
+
)}
|
|
47
|
+
>
|
|
48
|
+
{(schema.title ?? name) && (
|
|
49
|
+
<div className="ml-2 my-1 font-bold">{schema.title ?? name}</div>
|
|
50
|
+
)}
|
|
51
|
+
{level === 0 && schema.description && (
|
|
52
|
+
<p className="prose">{schema.description}</p>
|
|
53
|
+
)}
|
|
54
|
+
<ul>
|
|
55
|
+
{Object.entries(groups).map(([group, properties]) => {
|
|
56
|
+
return (
|
|
57
|
+
<SchemaListViewItemGroup
|
|
58
|
+
key={group}
|
|
59
|
+
defaultOpen={defaultOpen}
|
|
60
|
+
group={group as any}
|
|
61
|
+
nestingLevel={level}
|
|
62
|
+
properties={properties}
|
|
63
|
+
required={schema.required ?? []}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
})}
|
|
67
|
+
</ul>
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const SchemaListViewItemGroup = ({
|
|
73
|
+
group,
|
|
74
|
+
properties,
|
|
75
|
+
nestingLevel,
|
|
76
|
+
required,
|
|
77
|
+
defaultOpen = false,
|
|
78
|
+
}: {
|
|
79
|
+
group: "optional" | "required" | "deprecated";
|
|
80
|
+
defaultOpen?: boolean;
|
|
81
|
+
properties: [string, SchemaObject][];
|
|
82
|
+
nestingLevel: number;
|
|
83
|
+
required: string[];
|
|
84
|
+
}) => {
|
|
85
|
+
const notCollapsible =
|
|
86
|
+
defaultOpen ||
|
|
87
|
+
group === "required" ||
|
|
88
|
+
properties.length === 1 ||
|
|
89
|
+
nestingLevel === 0;
|
|
90
|
+
const [open, setOpen] = useState(notCollapsible);
|
|
91
|
+
if (properties.length === 0) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<Collapsible.Root
|
|
97
|
+
className="CollapsibleRoot"
|
|
98
|
+
open={open}
|
|
99
|
+
onOpenChange={setOpen}
|
|
100
|
+
>
|
|
101
|
+
{!open && (
|
|
102
|
+
<Collapsible.Trigger
|
|
103
|
+
className={cn(
|
|
104
|
+
"py-2 hover:bg-muted w-full",
|
|
105
|
+
group === "optional" && "font-semibold",
|
|
106
|
+
group === "deprecated" && "text-muted-foreground",
|
|
107
|
+
)}
|
|
108
|
+
>
|
|
109
|
+
{properties.length} {group} fields
|
|
110
|
+
</Collapsible.Trigger>
|
|
111
|
+
)}
|
|
112
|
+
|
|
113
|
+
<Collapsible.Content>
|
|
114
|
+
{properties.map(([propertyName, property]) => (
|
|
115
|
+
<SchemaListViewItem
|
|
116
|
+
key={propertyName}
|
|
117
|
+
property={property}
|
|
118
|
+
propertyName={propertyName}
|
|
119
|
+
nestingLevel={nestingLevel}
|
|
120
|
+
isRequired={required.includes(propertyName)}
|
|
121
|
+
/>
|
|
122
|
+
))}
|
|
123
|
+
</Collapsible.Content>
|
|
124
|
+
</Collapsible.Root>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const SchemaListViewItem = ({
|
|
129
|
+
propertyName,
|
|
130
|
+
property,
|
|
131
|
+
nestingLevel,
|
|
132
|
+
isRequired,
|
|
133
|
+
}: {
|
|
134
|
+
propertyName: string;
|
|
135
|
+
isRequired: boolean;
|
|
136
|
+
property: SchemaObject;
|
|
137
|
+
nestingLevel: number;
|
|
138
|
+
}) => {
|
|
139
|
+
return (
|
|
140
|
+
<div
|
|
141
|
+
key={propertyName}
|
|
142
|
+
className={cn(
|
|
143
|
+
nestingLevel > 0 ? "py-2" : "py-4",
|
|
144
|
+
"px-2 border-t border-border bg-border/20 hover:bg-border/30 flex gap-1 flex-col text-sm",
|
|
145
|
+
property.deprecated && "opacity-50",
|
|
146
|
+
)}
|
|
147
|
+
>
|
|
148
|
+
<div className="flex items-center gap-2 relative">
|
|
149
|
+
<code>
|
|
150
|
+
{propertyName} {property.title}
|
|
151
|
+
</code>
|
|
152
|
+
|
|
153
|
+
{property.type && (
|
|
154
|
+
<span className="text-xs text-muted-foreground">{property.type}</span>
|
|
155
|
+
)}
|
|
156
|
+
{property.deprecated && (
|
|
157
|
+
<span className="text-xs text-muted-foreground">Deprecated</span>
|
|
158
|
+
)}
|
|
159
|
+
{!isRequired && (
|
|
160
|
+
<span className="py-px px-1.5 font-medium text-xs border border-border rounded-lg">
|
|
161
|
+
optional {property.required}
|
|
162
|
+
</span>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
{property.description && (
|
|
166
|
+
<Markdown
|
|
167
|
+
content={property.description}
|
|
168
|
+
className="text-sm leading-normal line-clamp-4 "
|
|
169
|
+
/>
|
|
170
|
+
)}
|
|
171
|
+
|
|
172
|
+
{property.enum && (
|
|
173
|
+
<span className="text-sm text-muted-foreground flex gap-1 flex-wrap items-center">
|
|
174
|
+
<span>Possible values</span>
|
|
175
|
+
{property.enum
|
|
176
|
+
.filter((value) => value)
|
|
177
|
+
.map((value) => (
|
|
178
|
+
<span
|
|
179
|
+
key={value}
|
|
180
|
+
className="font-mono text-xs border-border border bg-muted rounded px-1"
|
|
181
|
+
>
|
|
182
|
+
{value}
|
|
183
|
+
</span>
|
|
184
|
+
))
|
|
185
|
+
.slice(0, 4)}
|
|
186
|
+
{property.enum.length > 4 && (
|
|
187
|
+
<span className="font-mono text-xs border-border border bg-muted rounded px-1">
|
|
188
|
+
...
|
|
189
|
+
</span>
|
|
190
|
+
)}
|
|
191
|
+
</span>
|
|
192
|
+
)}
|
|
193
|
+
|
|
194
|
+
<Collapsible.Root className="CollapsibleRoot" defaultOpen={false}>
|
|
195
|
+
{property.type === "object" ||
|
|
196
|
+
(property.type === "array" && property.items.type === "object") ? (
|
|
197
|
+
<Collapsible.Trigger asChild>
|
|
198
|
+
<Button variant="ghost" size="sm">
|
|
199
|
+
Show nested fields
|
|
200
|
+
<ListPlusIcon size={18} className="ml-1.5" />
|
|
201
|
+
</Button>
|
|
202
|
+
</Collapsible.Trigger>
|
|
203
|
+
) : null}
|
|
204
|
+
|
|
205
|
+
<Collapsible.Content>
|
|
206
|
+
{property.type === "object" && (
|
|
207
|
+
<div className="mt-2.5">
|
|
208
|
+
<SchemaListView
|
|
209
|
+
schema={property}
|
|
210
|
+
level={nestingLevel + 1}
|
|
211
|
+
defaultOpen
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
)}
|
|
215
|
+
{property.type === "array" && property.items.type === "object" && (
|
|
216
|
+
<div className="mt-2.5">
|
|
217
|
+
<SchemaListView
|
|
218
|
+
schema={property.items}
|
|
219
|
+
defaultOpen
|
|
220
|
+
level={nestingLevel + 1}
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
)}
|
|
224
|
+
</Collapsible.Content>
|
|
225
|
+
</Collapsible.Root>
|
|
226
|
+
</div>
|
|
227
|
+
);
|
|
228
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
1
2
|
import { Fragment, useMemo, useState } from "react";
|
|
2
3
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
4
|
+
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
3
5
|
import { cn } from "../../util/cn.js";
|
|
4
6
|
import { ColorizedParam } from "./ColorizedParam.js";
|
|
5
7
|
import { MakeRequest } from "./MakeRequest.js";
|
|
@@ -9,9 +11,7 @@ import { RequestBodySidecarBox } from "./RequestBodySidecarBox.js";
|
|
|
9
11
|
import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
|
|
10
12
|
import { Select } from "./Select.js";
|
|
11
13
|
import * as SidecarBox from "./SidecarBox.js";
|
|
12
|
-
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
13
14
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
14
|
-
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
15
15
|
|
|
16
16
|
const getConverted = (snippet: HTTPSnippet, option: string) => {
|
|
17
17
|
let converted;
|
|
@@ -105,13 +105,12 @@ export const Sidecar = ({
|
|
|
105
105
|
} as never, // 👈 never touch this
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
return getConverted(snippet, option)
|
|
108
|
+
return getConverted(snippet, option);
|
|
109
109
|
}, [option, operation.method, operation.path, requestBodyContent]);
|
|
110
110
|
|
|
111
111
|
return (
|
|
112
112
|
<aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
|
|
113
113
|
<SidecarBox.Root>
|
|
114
|
-
<MakeRequest operation={operation} />
|
|
115
114
|
<SidecarBox.Head className="flex justify-between items-center flex-nowrap p-2 gap-2 text-xs">
|
|
116
115
|
<span className="font-mono break-words">
|
|
117
116
|
<span className={cn("font-semibold", methodTextColor)}>
|
|
@@ -120,35 +119,36 @@ export const Sidecar = ({
|
|
|
120
119
|
|
|
121
120
|
{path}
|
|
122
121
|
</span>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
122
|
+
<div className="flex gap-2 items-center">
|
|
123
|
+
<Select
|
|
124
|
+
className="self-start"
|
|
125
|
+
onChange={(e) => setOption(e.target.value)}
|
|
126
|
+
options={[
|
|
127
|
+
{ value: "shell", label: "cURL" },
|
|
128
|
+
{ value: "js", label: "Javascript" },
|
|
129
|
+
{ value: "python", label: "Python" },
|
|
130
|
+
{ value: "java", label: "Java" },
|
|
131
|
+
{ value: "go", label: "Go" },
|
|
132
|
+
{ value: "csharp", label: "C#" },
|
|
133
|
+
{ value: "kotlin", label: "Kotlin" },
|
|
134
|
+
{ value: "objc", label: "Objective C" },
|
|
135
|
+
{ value: "php", label: "PHP" },
|
|
136
|
+
{ value: "ruby", label: "Ruby" },
|
|
137
|
+
{ value: "swift", label: "Swift" },
|
|
138
|
+
]}
|
|
139
|
+
/>
|
|
140
|
+
<MakeRequest operation={operation} />
|
|
141
|
+
</div>
|
|
140
142
|
</SidecarBox.Head>
|
|
141
143
|
<SidecarBox.Body>
|
|
142
144
|
<SyntaxHighlight
|
|
143
145
|
language={option}
|
|
144
|
-
copyable={false}
|
|
145
146
|
noBackground
|
|
146
147
|
className="text-xs"
|
|
147
148
|
code={code}
|
|
148
149
|
/>
|
|
149
150
|
</SidecarBox.Body>
|
|
150
151
|
</SidecarBox.Root>
|
|
151
|
-
{/*<MakeRequest />*/}
|
|
152
152
|
{requestBodyContent && (
|
|
153
153
|
<RequestBodySidecarBox content={requestBodyContent} />
|
|
154
154
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import * as types from "./graphql.js";
|
|
3
2
|
import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
|
|
3
|
+
import * as types from "./graphql.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Map of all GraphQL operations in the project.
|
|
@@ -15,11 +15,11 @@ import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-
|
|
|
15
15
|
const documents = {
|
|
16
16
|
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n":
|
|
17
17
|
types.GetServerQueryDocument,
|
|
18
|
-
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
|
|
18
|
+
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
|
|
19
19
|
types.OperationsFragmentFragmentDoc,
|
|
20
20
|
"\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
|
|
21
21
|
types.AllOperationsDocument,
|
|
22
|
-
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
|
|
22
|
+
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
|
|
23
23
|
types.GetCategoriesDocument,
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -47,8 +47,8 @@ export function graphql(
|
|
|
47
47
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
48
48
|
*/
|
|
49
49
|
export function graphql(
|
|
50
|
-
source: "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n",
|
|
51
|
-
): (typeof documents)["\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n"];
|
|
50
|
+
source: "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n",
|
|
51
|
+
): (typeof documents)["\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n"];
|
|
52
52
|
/**
|
|
53
53
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
54
54
|
*/
|
|
@@ -59,8 +59,8 @@ export function graphql(
|
|
|
59
59
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
60
60
|
*/
|
|
61
61
|
export function graphql(
|
|
62
|
-
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
|
|
63
|
-
): (typeof documents)["\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n"];
|
|
62
|
+
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
|
|
63
|
+
): (typeof documents)["\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n"];
|
|
64
64
|
|
|
65
65
|
export function graphql(source: string) {
|
|
66
66
|
return (documents as any)[source] ?? {};
|
|
@@ -190,6 +190,14 @@ export type OperationsFragmentFragment = {
|
|
|
190
190
|
required?: boolean | null;
|
|
191
191
|
schema?: any | null;
|
|
192
192
|
style?: string | null;
|
|
193
|
+
examples?: Array<{
|
|
194
|
+
__typename?: "ExampleItem";
|
|
195
|
+
name: string;
|
|
196
|
+
description?: string | null;
|
|
197
|
+
externalValue?: string | null;
|
|
198
|
+
value?: string | null;
|
|
199
|
+
summary?: string | null;
|
|
200
|
+
}> | null;
|
|
193
201
|
}> | null;
|
|
194
202
|
requestBody?: {
|
|
195
203
|
__typename?: "RequestBodyObject";
|
|
@@ -259,6 +267,7 @@ export type GetCategoriesQuery = {
|
|
|
259
267
|
operations: Array<{
|
|
260
268
|
__typename: "OperationItem";
|
|
261
269
|
slug: string;
|
|
270
|
+
deprecated?: boolean | null;
|
|
262
271
|
method: string;
|
|
263
272
|
summary?: string | null;
|
|
264
273
|
operationId?: string | null;
|
|
@@ -300,6 +309,29 @@ export const OperationsFragmentFragmentDoc = {
|
|
|
300
309
|
{ kind: "Field", name: { kind: "Name", value: "required" } },
|
|
301
310
|
{ kind: "Field", name: { kind: "Name", value: "schema" } },
|
|
302
311
|
{ kind: "Field", name: { kind: "Name", value: "style" } },
|
|
312
|
+
{
|
|
313
|
+
kind: "Field",
|
|
314
|
+
name: { kind: "Name", value: "examples" },
|
|
315
|
+
selectionSet: {
|
|
316
|
+
kind: "SelectionSet",
|
|
317
|
+
selections: [
|
|
318
|
+
{ kind: "Field", name: { kind: "Name", value: "name" } },
|
|
319
|
+
{
|
|
320
|
+
kind: "Field",
|
|
321
|
+
name: { kind: "Name", value: "description" },
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
kind: "Field",
|
|
325
|
+
name: { kind: "Name", value: "externalValue" },
|
|
326
|
+
},
|
|
327
|
+
{ kind: "Field", name: { kind: "Name", value: "value" } },
|
|
328
|
+
{
|
|
329
|
+
kind: "Field",
|
|
330
|
+
name: { kind: "Name", value: "summary" },
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
},
|
|
303
335
|
],
|
|
304
336
|
},
|
|
305
337
|
},
|
|
@@ -589,6 +621,29 @@ export const AllOperationsDocument = {
|
|
|
589
621
|
{ kind: "Field", name: { kind: "Name", value: "required" } },
|
|
590
622
|
{ kind: "Field", name: { kind: "Name", value: "schema" } },
|
|
591
623
|
{ kind: "Field", name: { kind: "Name", value: "style" } },
|
|
624
|
+
{
|
|
625
|
+
kind: "Field",
|
|
626
|
+
name: { kind: "Name", value: "examples" },
|
|
627
|
+
selectionSet: {
|
|
628
|
+
kind: "SelectionSet",
|
|
629
|
+
selections: [
|
|
630
|
+
{ kind: "Field", name: { kind: "Name", value: "name" } },
|
|
631
|
+
{
|
|
632
|
+
kind: "Field",
|
|
633
|
+
name: { kind: "Name", value: "description" },
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
kind: "Field",
|
|
637
|
+
name: { kind: "Name", value: "externalValue" },
|
|
638
|
+
},
|
|
639
|
+
{ kind: "Field", name: { kind: "Name", value: "value" } },
|
|
640
|
+
{
|
|
641
|
+
kind: "Field",
|
|
642
|
+
name: { kind: "Name", value: "summary" },
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
},
|
|
646
|
+
},
|
|
592
647
|
],
|
|
593
648
|
},
|
|
594
649
|
},
|
|
@@ -763,6 +818,10 @@ export const GetCategoriesDocument = {
|
|
|
763
818
|
kind: "Field",
|
|
764
819
|
name: { kind: "Name", value: "slug" },
|
|
765
820
|
},
|
|
821
|
+
{
|
|
822
|
+
kind: "Field",
|
|
823
|
+
name: { kind: "Name", value: "deprecated" },
|
|
824
|
+
},
|
|
766
825
|
{
|
|
767
826
|
kind: "Field",
|
|
768
827
|
name: { kind: "Name", value: "method" },
|
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
cacheExchange,
|
|
14
14
|
fetchExchange,
|
|
15
15
|
} from "./util/urql.js";
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
import { createSharedWorkerClient } from "virtual:zudoku-openapi-worker";
|
|
18
|
+
import type { createSharedWorkerClient as createSharedWorkerClientType } from "./worker/createSharedWorkerClient.js";
|
|
17
19
|
|
|
18
20
|
const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
|
|
19
21
|
undefined,
|
|
@@ -64,6 +66,7 @@ const GetCategoriesQuery = graphql(`
|
|
|
64
66
|
operations {
|
|
65
67
|
__typename
|
|
66
68
|
slug
|
|
69
|
+
deprecated
|
|
67
70
|
method
|
|
68
71
|
summary
|
|
69
72
|
operationId
|
|
@@ -82,7 +85,9 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
82
85
|
url: config.server,
|
|
83
86
|
exchanges: [cacheExchange, fetchExchange],
|
|
84
87
|
})
|
|
85
|
-
: createSharedWorkerClient()
|
|
88
|
+
: (createSharedWorkerClient() as ReturnType<
|
|
89
|
+
typeof createSharedWorkerClientType
|
|
90
|
+
>);
|
|
86
91
|
|
|
87
92
|
return {
|
|
88
93
|
getNavigation: async (path: string) => {
|
|
@@ -105,6 +110,7 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
105
110
|
collapsible: false,
|
|
106
111
|
children: tag.operations.map((operation) => ({
|
|
107
112
|
path: `#${operation.slug}`,
|
|
113
|
+
muted: !!operation.deprecated,
|
|
108
114
|
title: operation.summary ?? operation.path,
|
|
109
115
|
label: (
|
|
110
116
|
<div className="flex flex-1 min-w-0 justify-between gap-2">
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { XIcon } from "lucide-react";
|
|
2
|
+
import { Control, useFieldArray, UseFormRegister } from "react-hook-form";
|
|
3
|
+
import { Button } from "../../../ui/Button.js";
|
|
4
|
+
import { InlineInput } from "./InlineInput.js";
|
|
5
|
+
import type { Header, PlaygroundForm } from "./Playground.js";
|
|
6
|
+
|
|
7
|
+
export const Headers = ({
|
|
8
|
+
control,
|
|
9
|
+
register,
|
|
10
|
+
headers,
|
|
11
|
+
}: {
|
|
12
|
+
register: UseFormRegister<PlaygroundForm>;
|
|
13
|
+
control: Control<PlaygroundForm>;
|
|
14
|
+
headers: Header[];
|
|
15
|
+
}) => {
|
|
16
|
+
const { fields, append, remove } = useFieldArray<PlaygroundForm>({
|
|
17
|
+
control,
|
|
18
|
+
name: "headers",
|
|
19
|
+
});
|
|
20
|
+
return (
|
|
21
|
+
<div className="grid grid-cols-[1fr_1fr_auto]">
|
|
22
|
+
{fields.map((header, i) => (
|
|
23
|
+
<div
|
|
24
|
+
key={header.id}
|
|
25
|
+
className="grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group"
|
|
26
|
+
>
|
|
27
|
+
<InlineInput
|
|
28
|
+
{...register(`headers.${i}.name`)}
|
|
29
|
+
placeholder="Name"
|
|
30
|
+
className="peer"
|
|
31
|
+
autoComplete="off"
|
|
32
|
+
/>
|
|
33
|
+
<InlineInput
|
|
34
|
+
placeholder={"Value"}
|
|
35
|
+
className="peer"
|
|
36
|
+
{...register(`headers.${i}.value`)}
|
|
37
|
+
autoComplete="off"
|
|
38
|
+
/>
|
|
39
|
+
<button
|
|
40
|
+
className="hover:bg-black/5 p-1 rounded mr-2 text-muted-foreground invisible group-hover:visible peer-focus:visible"
|
|
41
|
+
onClick={() => {
|
|
42
|
+
remove(i);
|
|
43
|
+
}}
|
|
44
|
+
type="button"
|
|
45
|
+
>
|
|
46
|
+
<XIcon size={16} />
|
|
47
|
+
</button>
|
|
48
|
+
<div className="col-span-full border-b border-border"></div>
|
|
49
|
+
</div>
|
|
50
|
+
))}
|
|
51
|
+
<Button
|
|
52
|
+
className="col-span-full mt-4"
|
|
53
|
+
onClick={() => append({ name: "", value: "" })}
|
|
54
|
+
type="button"
|
|
55
|
+
>
|
|
56
|
+
Add header
|
|
57
|
+
</Button>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|