zudoku 0.1.1-dev.2 → 0.1.1-dev.21
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/cli.js +2 -0
- package/dist/app/App.js +22 -0
- package/dist/app/App.js.map +1 -0
- package/dist/app/main.js +4 -16
- package/dist/app/main.js.map +1 -1
- package/dist/cli/cmds/dev.js +0 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/common/logger.d.ts +1 -2
- package/dist/cli/common/logger.js +2 -4
- 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.d.ts +1 -1
- package/dist/cli/dev/handler.js +11 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +13 -7
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/{app → lib}/DevPortal.d.ts +2 -3
- package/dist/{app → lib}/DevPortal.js +6 -19
- package/dist/lib/DevPortal.js.map +1 -0
- package/dist/{app → lib}/Heading.js.map +1 -1
- package/dist/lib/Router.d.ts +4 -0
- package/dist/lib/Router.js +20 -0
- package/dist/lib/Router.js.map +1 -0
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +2 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/authentication/authentication.js.map +1 -0
- package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
- package/dist/{app → lib}/authentication/clerk.js +1 -2
- package/dist/lib/authentication/clerk.js.map +1 -0
- package/dist/{app → lib}/authentication/openid.js +2 -2
- package/dist/lib/authentication/openid.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/Dialog.d.ts +19 -0
- package/dist/lib/components/Dialog.js +23 -0
- package/dist/lib/components/Dialog.js.map +1 -0
- package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
- package/dist/{app → lib}/components/Header.d.ts +0 -1
- package/dist/{app → lib}/components/Header.js.map +1 -1
- package/dist/lib/components/Input.d.ts +5 -0
- package/dist/lib/components/Input.js +9 -0
- package/dist/lib/components/Input.js.map +1 -0
- package/dist/{app → lib}/components/Layout.js.map +1 -1
- package/dist/{app → lib}/components/Markdown.js.map +1 -1
- package/dist/{app → lib}/components/SyntaxHighlight.js +2 -0
- 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.js.map +1 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/context/PluginSystem.js.map +1 -0
- package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
- package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +1 -2
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -1
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/{app → lib}/components/navigation/util.js.map +1 -1
- package/dist/lib/components.d.ts +3 -0
- package/dist/lib/components.js +4 -0
- package/dist/lib/components.js.map +1 -0
- package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
- 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.js.map +1 -1
- package/dist/lib/core/router.js.map +1 -0
- package/dist/lib/core/types/combine.js.map +1 -0
- package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
- package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
- 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/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
- package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -1
- package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +12 -0
- package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +10 -5
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
- package/dist/lib/plugins/openapi/MakeRequest.js +23 -0
- package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +4 -0
- package/dist/{app → lib}/plugins/openapi/OperationList.js +16 -16
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +2 -2
- package/dist/{app → lib}/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +19 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +94 -0
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -0
- package/dist/lib/plugins/openapi/SidecarBox.d.ts +8 -0
- package/dist/lib/plugins/openapi/SidecarBox.js +6 -0
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +19 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +16 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +58 -0
- package/dist/lib/plugins/openapi/graphql/gql.js +22 -0
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +282 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +526 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/index.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/index.js +3 -0
- package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -1
- package/dist/{app → lib}/plugins/openapi/index.js +1 -1
- package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +98 -0
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -1
- package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
- 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/{app → lib}/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins.d.ts +4 -0
- package/dist/lib/plugins.js +6 -0
- package/dist/lib/plugins.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +11 -0
- package/dist/lib/ui/Button.js +34 -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 +1 -1
- package/dist/{app → lib}/ui/Card.js.map +1 -1
- package/dist/{app → lib}/ui/Note.js.map +1 -1
- package/dist/lib/ui/Tabs.d.ts +7 -0
- package/dist/lib/ui/Tabs.js +13 -0
- package/dist/lib/ui/Tabs.js.map +1 -0
- package/dist/{app → lib}/util/MdxComponents.d.ts +2 -2
- package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
- package/dist/{app → lib}/util/cn.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +15 -0
- package/dist/lib/util/createVariantComponent.js +12 -0
- package/dist/lib/util/createVariantComponent.js.map +1 -0
- package/dist/lib/util/createWaitForNotify.d.ts +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/{app → lib}/util/slugify.d.ts +0 -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.d.ts +6 -0
- package/dist/ts.js +62 -0
- package/dist/ts.js.map +1 -0
- package/dist/vite/build.js +2 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +8 -2
- package/dist/vite/config.js +114 -24
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.d.ts +1 -0
- package/dist/vite/config.test.js +10 -0
- package/dist/vite/config.test.js.map +1 -0
- package/dist/vite/dev-server.js +8 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.d.ts +1 -1
- package/dist/vite/html.js +2 -3
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +4 -0
- package/dist/vite/plugin-api.js +47 -0
- package/dist/vite/plugin-api.js.map +1 -0
- package/dist/vite/plugin-auth.d.ts +4 -0
- package/dist/vite/plugin-auth.js +28 -0
- package/dist/vite/plugin-auth.js.map +1 -0
- package/dist/vite/plugin-component.d.ts +4 -0
- package/dist/vite/plugin-component.js +31 -0
- package/dist/vite/plugin-component.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +6 -0
- package/dist/vite/plugin-config.js +24 -0
- package/dist/vite/plugin-config.js.map +1 -0
- package/dist/vite/plugin-docs.d.ts +4 -0
- package/dist/vite/plugin-docs.js +43 -0
- package/dist/vite/plugin-docs.js.map +1 -0
- package/dist/vite/plugin-docs.test.d.ts +1 -0
- package/dist/vite/plugin-docs.test.js +30 -0
- package/dist/vite/plugin-docs.test.js.map +1 -0
- package/dist/vite/plugin-html.d.ts +3 -0
- package/dist/vite/plugin-html.js +47 -0
- package/dist/vite/plugin-html.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +8 -0
- package/dist/vite/plugin-mdx.js +61 -0
- package/dist/vite/plugin-mdx.js.map +1 -0
- 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.d.ts +2 -6
- package/dist/vite/plugin.js +14 -104
- package/dist/vite/plugin.js.map +1 -1
- package/lib/DevPortal-DqcnbwLT.js +12967 -0
- package/lib/assets/index-BPdJm2ty.js +4764 -0
- package/lib/assets/worker-CnXQsqxH.js +14511 -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/urql-B7mLfVog.js +1611 -0
- package/lib/zudoku.auth.js +31 -0
- package/lib/zudoku.components.js +6 -0
- package/lib/zudoku.openapi-worker.js +143 -0
- package/lib/zudoku.plugins.js +15650 -0
- package/package.json +55 -37
- package/src/app/App.tsx +33 -0
- package/src/app/main.tsx +6 -19
- package/src/{app → lib}/DevPortal.tsx +7 -29
- package/src/lib/Router.tsx +28 -0
- package/src/lib/auth.ts +1 -0
- package/src/{app → lib}/authentication/clerk.ts +1 -3
- package/src/lib/components/Dialog.tsx +119 -0
- package/src/lib/components/Input.tsx +24 -0
- package/src/{app → lib}/components/SyntaxHighlight.tsx +2 -0
- package/src/lib/components.ts +3 -0
- package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +18 -9
- package/src/{app → lib}/plugins/openapi/MakeRequest.tsx +19 -0
- package/src/{app → lib}/plugins/openapi/OperationList.tsx +20 -22
- package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +3 -3
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +51 -0
- package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +1 -1
- package/src/{app → lib}/plugins/openapi/Sidecar.tsx +81 -20
- package/src/lib/plugins/openapi/SidecarBox.tsx +36 -0
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +111 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +70 -0
- package/src/lib/plugins/openapi/graphql/graphql.ts +795 -0
- package/src/lib/plugins/openapi/graphql/index.ts +2 -0
- package/src/{app → lib}/plugins/openapi/index.tsx +6 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +309 -0
- package/src/lib/plugins/openapi/queries.graphql +6 -0
- package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
- package/src/lib/plugins.ts +5 -0
- package/src/lib/ui/Button.tsx +56 -0
- package/src/{app → lib}/ui/Card.tsx +1 -1
- package/src/lib/ui/Tabs.tsx +52 -0
- package/src/lib/util/createVariantComponent.tsx +30 -0
- package/dist/app/DevPortal.js.map +0 -1
- package/dist/app/app.js +0 -69
- package/dist/app/app.js.map +0 -1
- package/dist/app/authentication/authentication.js.map +0 -1
- package/dist/app/authentication/clerk.js.map +0 -1
- package/dist/app/authentication/openid.js.map +0 -1
- package/dist/app/components/SyntaxHighlight.js.map +0 -1
- package/dist/app/components/context/PluginSystem.js.map +0 -1
- package/dist/app/config.d.ts +0 -3
- package/dist/app/config.js +0 -9
- package/dist/app/config.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.js.map +0 -1
- package/dist/app/markdowns.d.ts +0 -3
- package/dist/app/markdowns.js +0 -5
- package/dist/app/markdowns.js.map +0 -1
- package/dist/app/plugins/openapi/ColorizedParam.d.ts +0 -8
- package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
- package/dist/app/plugins/openapi/MakeRequest.js +0 -11
- package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/app/plugins/openapi/OperationList.d.ts +0 -47
- package/dist/app/plugins/openapi/OperationList.js.map +0 -1
- package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js +0 -19
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/ResponsesSidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/Sidecar.js +0 -39
- package/dist/app/plugins/openapi/Sidecar.js.map +0 -1
- package/dist/app/plugins/openapi/SidecarBox.d.ts +0 -10
- package/dist/app/plugins/openapi/SidecarBox.js +0 -8
- package/dist/app/plugins/openapi/SidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/graphql/index.d.ts +0 -836
- package/dist/app/plugins/openapi/graphql/index.js +0 -4
- package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
- package/dist/app/plugins/openapi/util/getCode.d.ts +0 -2
- package/dist/app/plugins/openapi/util/getCode.js +0 -54
- package/dist/app/plugins/openapi/util/getCode.js.map +0 -1
- package/dist/app/util/createWaitForNotify.d.ts +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/app.tsx +0 -85
- package/src/app/config.ts +0 -20
- package/src/app/markdowns.ts +0 -7
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -48
- package/src/app/plugins/openapi/SidecarBox.tsx +0 -35
- package/src/app/plugins/openapi/graphql/env.d.ts +0 -48
- package/src/app/plugins/openapi/graphql/index.ts +0 -13
- package/src/app/plugins/openapi/util/getCode.tsx +0 -69
- /package/dist/app/{app.d.ts → App.d.ts} +0 -0
- /package/dist/{app → lib}/Heading.d.ts +0 -0
- /package/dist/{app → lib}/Heading.js +0 -0
- /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
- /package/dist/{app → lib}/authentication/authentication.js +0 -0
- /package/dist/{app → lib}/authentication/openid.d.ts +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/DynamicIcon.d.ts +0 -0
- /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
- /package/dist/{app → lib}/components/Header.js +0 -0
- /package/dist/{app → lib}/components/Layout.d.ts +0 -0
- /package/dist/{app → lib}/components/Layout.js +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/SyntaxHighlight.d.ts +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.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
- /package/dist/{app → lib}/components/context/DevPortalProvider.js +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/ThemeContext.js +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/SideNavigation.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +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/DevPortalContext.d.ts +0 -0
- /package/dist/{app → lib}/core/DevPortalContext.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/plugins.d.ts +0 -0
- /package/dist/{app → lib}/core/plugins.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}/core/types/combine.d.ts +0 -0
- /package/dist/{app → lib}/core/types/combine.js +0 -0
- /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/index.js +0 -0
- /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/server.js +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/api-key/SettingsApiKeys.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.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/generateRoutes.js +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/ParameterList.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +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/util/generateSchemaExample.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +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/createSharedWorkerClient.js +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.d.ts +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/Note.d.ts +0 -0
- /package/dist/{app → lib}/ui/Note.js +0 -0
- /package/dist/{app → lib}/util/MdxComponents.js +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.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.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}/Heading.tsx +0 -0
- /package/src/{app → lib}/authentication/authentication.ts +0 -0
- /package/src/{app → lib}/authentication/openid.ts +0 -0
- /package/src/{app → lib}/components/AnchorLink.tsx +0 -0
- /package/src/{app → lib}/components/CategoryHeading.tsx +0 -0
- /package/src/{app → lib}/components/DynamicIcon.tsx +0 -0
- /package/src/{app → lib}/components/Header.tsx +0 -0
- /package/src/{app → lib}/components/Layout.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/DevPortalProvider.ts +0 -0
- /package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
- /package/src/{app → lib}/components/context/ThemeContext.tsx +0 -0
- /package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigation.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationWrapper.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/DevPortalContext.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/plugins.ts +0 -0
- /package/src/{app → lib}/core/router.tsx +0 -0
- /package/src/{app → lib}/core/types/combine.ts +0 -0
- /package/src/{app → lib}/oas/graphql/index.ts +0 -0
- /package/src/{app → lib}/oas/graphql/server.ts +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/api-key/SettingsApiKeys.tsx +0 -0
- /package/src/{app → lib}/plugins/api-key/index.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/MdxPage.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/generateRoutes.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/ParameterList.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
- /package/src/{app → lib}/plugins/redirect/index.tsx +0 -0
- /package/src/{app → lib}/ui/Callout.tsx +0 -0
- /package/src/{app → lib}/ui/Note.tsx +0 -0
- /package/src/{app → lib}/util/MdxComponents.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,14 +1,14 @@
|
|
|
1
|
-
import { type ResultOf } from "gql.tada";
|
|
2
1
|
import { Heading } from "../../Heading.js";
|
|
3
2
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
4
3
|
import { Markdown, ProseClasses } from "../../components/Markdown.js";
|
|
5
4
|
import { cn } from "../../util/cn.js";
|
|
6
5
|
import { OperationListItem } from "./OperationListItem.js";
|
|
7
|
-
import { graphql } from "./graphql/index.js";
|
|
8
6
|
import { useOasConfig } from "./index.js";
|
|
7
|
+
import { graphql } from "./graphql/index.js";
|
|
9
8
|
import { useQuery } from "./util/urql.js";
|
|
9
|
+
import { ResultOf } from "@graphql-typed-document-node/core";
|
|
10
10
|
|
|
11
|
-
export const OperationsFragment = graphql(`
|
|
11
|
+
export const OperationsFragment = graphql(/* GraphQL */ `
|
|
12
12
|
fragment OperationsFragment on OperationItem {
|
|
13
13
|
slug
|
|
14
14
|
summary
|
|
@@ -51,32 +51,30 @@ export const OperationsFragment = graphql(`
|
|
|
51
51
|
}
|
|
52
52
|
`);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
|
|
55
|
+
|
|
56
|
+
const AllOperationsQuery = graphql(/* GraphQL */ `
|
|
57
|
+
query AllOperations($input: JSON!, $type: SchemaType!) {
|
|
58
|
+
schema(input: $input, type: $type) {
|
|
59
|
+
description
|
|
60
|
+
title
|
|
61
|
+
url
|
|
62
|
+
version
|
|
63
|
+
tags {
|
|
64
|
+
name
|
|
58
65
|
description
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tags {
|
|
63
|
-
name
|
|
64
|
-
description
|
|
65
|
-
operations {
|
|
66
|
-
slug
|
|
67
|
-
...OperationsFragment
|
|
68
|
-
}
|
|
66
|
+
operations {
|
|
67
|
+
slug
|
|
68
|
+
...OperationsFragment
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
|
|
72
|
+
}
|
|
73
|
+
`);
|
|
77
74
|
|
|
78
75
|
export const OperationList = () => {
|
|
79
76
|
const { type, input } = useOasConfig();
|
|
77
|
+
|
|
80
78
|
const [result] = useQuery({
|
|
81
79
|
query: AllOperationsQuery,
|
|
82
80
|
variables: { type, input },
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { readFragment, type FragmentOf } from "gql.tada";
|
|
2
1
|
import { Heading } from "../../Heading.js";
|
|
3
2
|
import { Markdown, ProseClasses } from "../../components/Markdown.js";
|
|
4
3
|
import { groupBy } from "../../util/groupBy.js";
|
|
5
4
|
import { OperationsFragment } from "./OperationList.js";
|
|
6
5
|
import { ParameterList } from "./ParameterList.js";
|
|
7
6
|
import { Sidecar } from "./Sidecar.js";
|
|
7
|
+
import { FragmentType, useFragment } from "./graphql/index.js";
|
|
8
8
|
|
|
9
9
|
export const PARAM_GROUPS = ["path", "query", "header", "cookie"] as const;
|
|
10
10
|
export type ParameterGroup = (typeof PARAM_GROUPS)[number];
|
|
@@ -12,9 +12,9 @@ export type ParameterGroup = (typeof PARAM_GROUPS)[number];
|
|
|
12
12
|
export const OperationListItem = ({
|
|
13
13
|
operationFragment,
|
|
14
14
|
}: {
|
|
15
|
-
operationFragment:
|
|
15
|
+
operationFragment: FragmentType<typeof OperationsFragment>;
|
|
16
16
|
}) => {
|
|
17
|
-
const operation =
|
|
17
|
+
const operation = useFragment(OperationsFragment, operationFragment);
|
|
18
18
|
const groupedParameters = groupBy(operation?.parameters ?? [], "in");
|
|
19
19
|
|
|
20
20
|
return (
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
3
|
+
import { type SchemaObject } from "../../oas/graphql/index.js";
|
|
4
|
+
import type { OperationListItemResult } from "./OperationList.js";
|
|
5
|
+
import { Select } from "./Select.js";
|
|
6
|
+
import * as SidecarBox from "./SidecarBox.js";
|
|
7
|
+
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
8
|
+
|
|
9
|
+
type Content = NonNullable<
|
|
10
|
+
NonNullable<OperationListItemResult["requestBody"]>["content"]
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
// @todo should we handle multiple content types?
|
|
14
|
+
export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
|
|
15
|
+
const [selected, setSelected] = useState("example");
|
|
16
|
+
|
|
17
|
+
if (!content.length) return null;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<>
|
|
21
|
+
<div>lol</div>
|
|
22
|
+
<SidecarBox.Root>
|
|
23
|
+
<SidecarBox.Head className="text-xs flex justify-between items-center">
|
|
24
|
+
<span className="font-mono">Request Body</span>
|
|
25
|
+
<Select
|
|
26
|
+
onChange={(e) => setSelected(e.target.value)}
|
|
27
|
+
options={[
|
|
28
|
+
{ value: "example", label: "Example" },
|
|
29
|
+
{ value: "schema", label: "Schema" },
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
</SidecarBox.Head>
|
|
33
|
+
<SidecarBox.Body>
|
|
34
|
+
<SyntaxHighlight
|
|
35
|
+
language="json"
|
|
36
|
+
noBackground
|
|
37
|
+
copyable={false}
|
|
38
|
+
className="text-xs"
|
|
39
|
+
code={JSON.stringify(
|
|
40
|
+
selected === "example"
|
|
41
|
+
? generateSchemaExample(content[0].schema as SchemaObject)
|
|
42
|
+
: content[0].schema,
|
|
43
|
+
null,
|
|
44
|
+
2,
|
|
45
|
+
)}
|
|
46
|
+
/>
|
|
47
|
+
</SidecarBox.Body>
|
|
48
|
+
</SidecarBox.Root>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -3,7 +3,7 @@ import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
|
3
3
|
import { type SchemaObject } from "../../oas/graphql/index.js";
|
|
4
4
|
import { cn } from "../../util/cn.js";
|
|
5
5
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
6
|
-
import
|
|
6
|
+
import * as SidecarBox from "./SidecarBox.js";
|
|
7
7
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
8
8
|
|
|
9
9
|
type Responses = OperationListItemResult["responses"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, useState } from "react";
|
|
1
|
+
import { Fragment, useMemo, useState } from "react";
|
|
2
2
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
3
3
|
import { cn } from "../../util/cn.js";
|
|
4
4
|
import { ColorizedParam } from "./ColorizedParam.js";
|
|
@@ -8,8 +8,54 @@ import type { OperationListItemResult } from "./OperationList.js";
|
|
|
8
8
|
import { RequestBodySidecarBox } from "./RequestBodySidecarBox.js";
|
|
9
9
|
import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
|
|
10
10
|
import { Select } from "./Select.js";
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
11
|
+
import * as SidecarBox from "./SidecarBox.js";
|
|
12
|
+
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
13
|
+
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
14
|
+
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
15
|
+
|
|
16
|
+
const getConverted = (snippet: HTTPSnippet, option: string) => {
|
|
17
|
+
let converted;
|
|
18
|
+
switch (option) {
|
|
19
|
+
case "shell":
|
|
20
|
+
converted = snippet.convert("shell", "curl");
|
|
21
|
+
break;
|
|
22
|
+
case "js":
|
|
23
|
+
converted = snippet.convert("javascript", "fetch");
|
|
24
|
+
break;
|
|
25
|
+
case "python":
|
|
26
|
+
converted = snippet.convert("python", "requests");
|
|
27
|
+
break;
|
|
28
|
+
case "java":
|
|
29
|
+
converted = snippet.convert("java", "okhttp");
|
|
30
|
+
break;
|
|
31
|
+
case "go":
|
|
32
|
+
converted = snippet.convert("go", "native");
|
|
33
|
+
break;
|
|
34
|
+
case "csharp":
|
|
35
|
+
converted = snippet.convert("csharp", "httpclient");
|
|
36
|
+
break;
|
|
37
|
+
case "kotlin":
|
|
38
|
+
converted = snippet.convert("kotlin", "okhttp");
|
|
39
|
+
break;
|
|
40
|
+
case "objc":
|
|
41
|
+
converted = snippet.convert("objc", "nsurlsession");
|
|
42
|
+
break;
|
|
43
|
+
case "php":
|
|
44
|
+
converted = snippet.convert("php", "http2");
|
|
45
|
+
break;
|
|
46
|
+
case "ruby":
|
|
47
|
+
converted = snippet.convert("ruby");
|
|
48
|
+
break;
|
|
49
|
+
case "swift":
|
|
50
|
+
converted = snippet.convert("swift");
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
converted = snippet.convert("shell");
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return converted ? converted[0] : "";
|
|
58
|
+
};
|
|
13
59
|
|
|
14
60
|
export const Sidecar = ({
|
|
15
61
|
operation,
|
|
@@ -40,16 +86,27 @@ export const Sidecar = ({
|
|
|
40
86
|
</Fragment>
|
|
41
87
|
));
|
|
42
88
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
89
|
+
const code = useMemo(() => {
|
|
90
|
+
const example = requestBodyContent?.[0]?.schema
|
|
91
|
+
? generateSchemaExample(requestBodyContent[0].schema as SchemaObject)
|
|
92
|
+
: undefined;
|
|
93
|
+
|
|
94
|
+
const snippet = new HTTPSnippet(
|
|
95
|
+
{
|
|
96
|
+
method: operation.method.toLocaleUpperCase(),
|
|
97
|
+
url: operation.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
98
|
+
headers: [{ name: "Authorization", value: "Bearer <token>" }],
|
|
99
|
+
postData: example
|
|
100
|
+
? {
|
|
101
|
+
text: JSON.stringify(example, null, 2),
|
|
102
|
+
mimeType: "application/json",
|
|
103
|
+
}
|
|
104
|
+
: {},
|
|
105
|
+
} as never, // 👈 never touch this
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return getConverted(snippet, option) ?? "";
|
|
109
|
+
}, [option, operation.method, operation.path, requestBodyContent]);
|
|
53
110
|
|
|
54
111
|
return (
|
|
55
112
|
<aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
|
|
@@ -67,23 +124,27 @@ export const Sidecar = ({
|
|
|
67
124
|
className="self-start"
|
|
68
125
|
onChange={(e) => setOption(e.target.value)}
|
|
69
126
|
options={[
|
|
70
|
-
{ value: "
|
|
71
|
-
{ value: "wget", label: "wget" },
|
|
127
|
+
{ value: "shell", label: "cURL" },
|
|
72
128
|
{ value: "js", label: "Javascript" },
|
|
73
|
-
{ value: "
|
|
74
|
-
{ value: "
|
|
129
|
+
{ value: "python", label: "Python" },
|
|
130
|
+
{ value: "java", label: "Java" },
|
|
75
131
|
{ value: "go", label: "Go" },
|
|
76
|
-
{ value: "
|
|
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" },
|
|
77
138
|
]}
|
|
78
139
|
/>
|
|
79
140
|
</SidecarBox.Head>
|
|
80
141
|
<SidecarBox.Body>
|
|
81
142
|
<SyntaxHighlight
|
|
82
|
-
language={
|
|
143
|
+
language={option}
|
|
83
144
|
copyable={false}
|
|
84
145
|
noBackground
|
|
85
146
|
className="text-xs"
|
|
86
|
-
code={
|
|
147
|
+
code={code}
|
|
87
148
|
/>
|
|
88
149
|
</SidecarBox.Body>
|
|
89
150
|
</SidecarBox.Root>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
import { cn } from "../../util/cn.js";
|
|
3
|
+
|
|
4
|
+
type BaseComponentProps<T = unknown> = PropsWithChildren<
|
|
5
|
+
T & { className?: string }
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
export const Root = ({ children, className }: BaseComponentProps) => (
|
|
9
|
+
<div
|
|
10
|
+
className={cn(
|
|
11
|
+
"rounded-lg overflow-hidden border border-border dark:border-transparent",
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const Head = ({ children, className }: BaseComponentProps) => (
|
|
20
|
+
<div
|
|
21
|
+
className={cn(
|
|
22
|
+
"border-b border-b-border dark:border-b-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const Body = ({ children, className }: BaseComponentProps) => (
|
|
31
|
+
<div
|
|
32
|
+
className={cn("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", className)}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type {
|
|
3
|
+
ResultOf,
|
|
4
|
+
DocumentTypeDecoration,
|
|
5
|
+
TypedDocumentNode,
|
|
6
|
+
} from "@graphql-typed-document-node/core";
|
|
7
|
+
import type { FragmentDefinitionNode } from "graphql";
|
|
8
|
+
import type { Incremental } from "./graphql.js";
|
|
9
|
+
|
|
10
|
+
export type FragmentType<
|
|
11
|
+
TDocumentType extends DocumentTypeDecoration<any, any>,
|
|
12
|
+
> =
|
|
13
|
+
TDocumentType extends DocumentTypeDecoration<infer TType, any>
|
|
14
|
+
? [TType] extends [{ " $fragmentName"?: infer TKey }]
|
|
15
|
+
? TKey extends string
|
|
16
|
+
? { " $fragmentRefs"?: { [key in TKey]: TType } }
|
|
17
|
+
: never
|
|
18
|
+
: never
|
|
19
|
+
: never;
|
|
20
|
+
|
|
21
|
+
// return non-nullable if `fragmentType` is non-nullable
|
|
22
|
+
export function useFragment<TType>(
|
|
23
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
24
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>,
|
|
25
|
+
): TType;
|
|
26
|
+
// return nullable if `fragmentType` is undefined
|
|
27
|
+
export function useFragment<TType>(
|
|
28
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
29
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined,
|
|
30
|
+
): TType | undefined;
|
|
31
|
+
// return nullable if `fragmentType` is nullable
|
|
32
|
+
export function useFragment<TType>(
|
|
33
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
34
|
+
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null,
|
|
35
|
+
): TType | null;
|
|
36
|
+
// return nullable if `fragmentType` is nullable or undefined
|
|
37
|
+
export function useFragment<TType>(
|
|
38
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
39
|
+
fragmentType:
|
|
40
|
+
| FragmentType<DocumentTypeDecoration<TType, any>>
|
|
41
|
+
| null
|
|
42
|
+
| undefined,
|
|
43
|
+
): TType | null | undefined;
|
|
44
|
+
// return array of non-nullable if `fragmentType` is array of non-nullable
|
|
45
|
+
export function useFragment<TType>(
|
|
46
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
47
|
+
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>,
|
|
48
|
+
): Array<TType>;
|
|
49
|
+
// return array of nullable if `fragmentType` is array of nullable
|
|
50
|
+
export function useFragment<TType>(
|
|
51
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
52
|
+
fragmentType:
|
|
53
|
+
| Array<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
54
|
+
| null
|
|
55
|
+
| undefined,
|
|
56
|
+
): Array<TType> | null | undefined;
|
|
57
|
+
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
|
|
58
|
+
export function useFragment<TType>(
|
|
59
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
60
|
+
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>,
|
|
61
|
+
): ReadonlyArray<TType>;
|
|
62
|
+
// return readonly array of nullable if `fragmentType` is array of nullable
|
|
63
|
+
export function useFragment<TType>(
|
|
64
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
65
|
+
fragmentType:
|
|
66
|
+
| ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
67
|
+
| null
|
|
68
|
+
| undefined,
|
|
69
|
+
): ReadonlyArray<TType> | null | undefined;
|
|
70
|
+
export function useFragment<TType>(
|
|
71
|
+
_documentNode: DocumentTypeDecoration<TType, any>,
|
|
72
|
+
fragmentType:
|
|
73
|
+
| FragmentType<DocumentTypeDecoration<TType, any>>
|
|
74
|
+
| Array<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
75
|
+
| ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
|
76
|
+
| null
|
|
77
|
+
| undefined,
|
|
78
|
+
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
|
|
79
|
+
return fragmentType as any;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function makeFragmentData<
|
|
83
|
+
F extends DocumentTypeDecoration<any, any>,
|
|
84
|
+
FT extends ResultOf<F>,
|
|
85
|
+
>(data: FT, _fragment: F): FragmentType<F> {
|
|
86
|
+
return data as FragmentType<F>;
|
|
87
|
+
}
|
|
88
|
+
export function isFragmentReady<TQuery, TFrag>(
|
|
89
|
+
queryNode: DocumentTypeDecoration<TQuery, any>,
|
|
90
|
+
fragmentNode: TypedDocumentNode<TFrag>,
|
|
91
|
+
data:
|
|
92
|
+
| FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>
|
|
93
|
+
| null
|
|
94
|
+
| undefined,
|
|
95
|
+
): data is FragmentType<typeof fragmentNode> {
|
|
96
|
+
const deferredFields = (
|
|
97
|
+
queryNode as {
|
|
98
|
+
__meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };
|
|
99
|
+
}
|
|
100
|
+
).__meta__?.deferredFields;
|
|
101
|
+
|
|
102
|
+
if (!deferredFields) return true;
|
|
103
|
+
|
|
104
|
+
const fragDef = fragmentNode.definitions[0] as
|
|
105
|
+
| FragmentDefinitionNode
|
|
106
|
+
| undefined;
|
|
107
|
+
const fragName = fragDef?.name?.value;
|
|
108
|
+
|
|
109
|
+
const fields = (fragName && deferredFields[fragName]) || [];
|
|
110
|
+
return fields.length > 0 && fields.every((field) => data && field in data);
|
|
111
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import * as types from "./graphql.js";
|
|
3
|
+
import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Map of all GraphQL operations in the project.
|
|
7
|
+
*
|
|
8
|
+
* This map has several performance disadvantages:
|
|
9
|
+
* 1. It is not tree-shakeable, so it will include all operations in the project.
|
|
10
|
+
* 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
|
|
11
|
+
* 3. It does not support dead code elimination, so it will add unused operations.
|
|
12
|
+
*
|
|
13
|
+
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
14
|
+
*/
|
|
15
|
+
const documents = {
|
|
16
|
+
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n":
|
|
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":
|
|
19
|
+
types.OperationsFragmentFragmentDoc,
|
|
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
|
+
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":
|
|
23
|
+
types.GetCategoriesDocument,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* The query argument is unknown!
|
|
36
|
+
* Please regenerate the types.
|
|
37
|
+
*/
|
|
38
|
+
export function graphql(source: string): unknown;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
42
|
+
*/
|
|
43
|
+
export function graphql(
|
|
44
|
+
source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n",
|
|
45
|
+
): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n }\n }\n"];
|
|
46
|
+
/**
|
|
47
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
48
|
+
*/
|
|
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"];
|
|
52
|
+
/**
|
|
53
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
54
|
+
*/
|
|
55
|
+
export function graphql(
|
|
56
|
+
source: "\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",
|
|
57
|
+
): (typeof documents)["\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"];
|
|
58
|
+
/**
|
|
59
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
60
|
+
*/
|
|
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"];
|
|
64
|
+
|
|
65
|
+
export function graphql(source: string) {
|
|
66
|
+
return (documents as any)[source] ?? {};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
|
|
70
|
+
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|