zudoku 0.0.0-f90a252 → 0.0.0-f9211eb
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/README.md +1 -1
- package/cli.js +3 -0
- package/dist/app/entry.client.d.ts +5 -0
- package/dist/app/entry.client.js +1 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +8 -6
- package/dist/app/entry.server.js +12 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +3 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +20 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/build/handler.d.ts +1 -3
- package/dist/cli/build/handler.js +9 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/cli.js +5 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.d.ts +11 -3
- package/dist/cli/cmds/build.js +20 -13
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/cmds/dev.d.ts +1 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/cmds/preview.d.ts +16 -0
- package/dist/cli/cmds/preview.js +25 -0
- package/dist/cli/cmds/preview.js.map +1 -0
- package/dist/cli/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/cli/preview/handler.d.ts +3 -0
- package/dist/cli/preview/handler.js +35 -0
- package/dist/cli/preview/handler.js.map +1 -0
- package/dist/config/common.d.ts +5 -3
- package/dist/config/config.d.ts +15 -15
- package/dist/config/loader.d.ts +6 -6
- package/dist/config/loader.js +20 -28
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
- package/dist/config/validators/InputSidebarSchema.js +10 -1
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +2993 -599
- package/dist/config/validators/common.js +107 -12
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +1127 -284
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -0
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +11 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.d.ts +2 -2
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.d.ts +2 -2
- package/dist/lib/authentication/providers/clerk.js +25 -6
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +5 -3
- package/dist/lib/authentication/providers/openid.js +24 -10
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.d.ts +4 -0
- package/dist/lib/authentication/providers/supabase.js +117 -0
- package/dist/lib/authentication/providers/supabase.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +0 -26
- package/dist/lib/authentication/state.js +9 -18
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +2 -2
- package/dist/lib/components/AnchorLink.js +5 -4
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Banner.js +1 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +3 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Footer.d.ts +1 -0
- package/dist/lib/components/Footer.js +32 -0
- package/dist/lib/components/Footer.js.map +1 -0
- package/dist/lib/components/Header.js +4 -4
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +2 -2
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +2 -9
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +8 -29
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.d.ts +2 -0
- package/dist/lib/components/Main.js +17 -0
- package/dist/lib/components/Main.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +6 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Pagination.d.ts +11 -0
- package/dist/lib/components/Pagination.js +10 -0
- package/dist/lib/components/Pagination.js.map +1 -0
- package/dist/lib/components/ThemeSwitch.js +1 -1
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -2
- package/dist/lib/components/TopNavigation.js +28 -14
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.d.ts +1 -1
- package/dist/lib/components/Zudoku.js +15 -8
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/cache.d.ts +7 -0
- package/dist/lib/components/cache.js +7 -0
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
- package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
- package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
- package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
- package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
- package/dist/lib/components/context/ZudokuContext.js +13 -7
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +7 -3
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -12
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
- package/dist/lib/components/navigation/SidebarBadge.js +3 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
- package/dist/lib/components/navigation/SidebarItem.js +17 -11
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
- package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
- package/dist/lib/components/navigation/Toc.js.map +1 -0
- package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
- package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
- package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
- package/dist/lib/core/RouteGuard.d.ts +2 -1
- package/dist/lib/core/RouteGuard.js +31 -11
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +32 -6
- package/dist/lib/core/ZudokuContext.js +29 -6
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +15 -7
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +6 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/index.d.ts +3 -0
- package/dist/lib/hooks/index.js +5 -0
- package/dist/lib/hooks/index.js.map +1 -0
- package/dist/lib/hooks/useEvent.d.ts +11 -0
- package/dist/lib/hooks/useEvent.js +19 -0
- package/dist/lib/hooks/useEvent.js.map +1 -0
- package/dist/lib/hooks/useEvent.test.js +100 -0
- package/dist/lib/hooks/useEvent.test.js.map +1 -0
- package/dist/lib/oas/graphql/index.d.ts +17 -4
- package/dist/lib/oas/graphql/index.js +151 -39
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.js +2 -0
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +5 -3
- package/dist/lib/oas/parser/index.js +0 -22
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -2
- package/dist/lib/plugins/api-catalog/Catalog.js +16 -26
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
- package/dist/lib/plugins/api-catalog/index.js +39 -8
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -9
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
- package/dist/lib/plugins/openapi/OperationList.js +63 -18
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +7 -12
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
- package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
- package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
- package/dist/lib/plugins/openapi/ParameterList.js +3 -2
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
- package/dist/lib/plugins/openapi/SchemaList.js +52 -0
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +39 -10
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -15
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
- package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +6 -11
- package/dist/lib/plugins/openapi/index.js +41 -60
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js +3 -2
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
- package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +20 -14
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -1
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/state.d.ts +25 -0
- package/dist/lib/plugins/openapi/state.js +18 -0
- package/dist/lib/plugins/openapi/state.js.map +1 -0
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +80 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +32 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
- package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/index.d.ts +6 -0
- package/dist/lib/plugins/search-pagefind/index.js +9 -0
- package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
- package/dist/lib/plugins/search-pagefind/types.js +2 -0
- package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +2 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +2 -1
- package/dist/lib/ui/Callout.js +3 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -8
- package/dist/lib/ui/Checkbox.js +1 -13
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +7 -1
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/Select.js +1 -1
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Stepper.d.ts +3 -0
- package/dist/lib/ui/Stepper.js +7 -0
- package/dist/lib/ui/Stepper.js.map +1 -0
- package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
- package/dist/lib/ui/SyntaxHighlight.js +62 -0
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
- package/dist/lib/ui/util.d.ts +2 -0
- package/dist/lib/ui/util.js +3 -0
- package/dist/lib/ui/util.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +5 -2
- package/dist/lib/util/MdxComponents.js +6 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -8
- package/dist/lib/util/traverse.js +2 -2
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/types.d.ts +7 -0
- package/dist/lib/util/types.js +2 -0
- package/dist/lib/util/types.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +3 -2
- package/dist/lib/util/useOnScreen.js +3 -3
- package/dist/lib/util/useOnScreen.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +26 -20
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.d.ts +1 -1
- package/dist/vite/api/schema-codegen.js +31 -9
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +66 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/build.js +2 -0
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -5
- package/dist/vite/config.js +39 -56
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +1 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/create-pagefind-index.d.ts +4 -0
- package/dist/vite/create-pagefind-index.js +12 -0
- package/dist/vite/create-pagefind-index.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +2 -2
- package/dist/vite/css/plugin.js.map +1 -1
- package/dist/vite/dev-server.js +12 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api-keys.d.ts +2 -2
- package/dist/vite/plugin-api-keys.js +3 -3
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +2 -2
- package/dist/vite/plugin-api.js +42 -35
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.d.ts +2 -2
- package/dist/vite/plugin-auth.js +3 -3
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +2 -2
- package/dist/vite/plugin-component.js +7 -2
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +4 -3
- package/dist/vite/plugin-config-reload.js +13 -6
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -2
- package/dist/vite/plugin-config.js +7 -4
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +2 -2
- package/dist/vite/plugin-custom-pages.js +3 -3
- package/dist/vite/plugin-custom-pages.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +3 -3
- package/dist/vite/plugin-docs.js +23 -6
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -2
- package/dist/vite/plugin-frontmatter.js +5 -4
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +2 -2
- package/dist/vite/plugin-mdx.js +1 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-redirect.d.ts +2 -2
- package/dist/vite/plugin-redirect.js +3 -3
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +2 -2
- package/dist/vite/plugin-search.js +5 -1
- package/dist/vite/plugin-search.js.map +1 -1
- package/dist/vite/plugin-sidebar.d.ts +2 -2
- package/dist/vite/plugin-sidebar.js +2 -2
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin-theme-css.d.ts +2 -2
- package/dist/vite/plugin-theme-css.js.map +1 -1
- package/dist/vite/plugin.d.ts +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +11 -6
- package/dist/vite/prerender/FileWritingResponse.js +9 -6
- package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
- package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
- package/dist/vite/prerender/InMemoryResponse.js +32 -0
- package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
- package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
- package/dist/vite/prerender/PrerenderResponse.js +2 -0
- package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
- package/dist/vite/prerender/prerender.d.ts +1 -0
- package/dist/vite/prerender/prerender.js +34 -28
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.d.ts +1 -1
- package/dist/vite/prerender/worker.js +42 -12
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/sitemap.js +2 -1
- package/dist/vite/sitemap.js.map +1 -1
- package/dist/zuplo/with-zuplo.js +4 -0
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-_YVa673u.js → AuthenticationPlugin-foqdvvkf.js} +4 -4
- package/lib/{AuthenticationPlugin-_YVa673u.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
- package/lib/Button-Fp19CMUr.js +49 -0
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/Callout-B2vsR09t.js +229 -0
- package/lib/Callout-B2vsR09t.js.map +1 -0
- package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
- package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
- package/lib/Dialog-sbgekbjb.js +98 -0
- package/lib/Dialog-sbgekbjb.js.map +1 -0
- package/lib/Drawer-kDAfOq_2.js +1133 -0
- package/lib/Drawer-kDAfOq_2.js.map +1 -0
- package/lib/{Markdown-8mv9nhGd.js → Markdown-aF5FdsNi.js} +7822 -6052
- package/lib/Markdown-aF5FdsNi.js.map +1 -0
- package/lib/MdxPage-Vw_dc9Yz.js +85 -0
- package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
- package/lib/{OasProvider-IS9wBrb7.js → OasProvider-CjXTP-nz.js} +6 -6
- package/lib/{OasProvider-IS9wBrb7.js.map → OasProvider-CjXTP-nz.js.map} +1 -1
- package/lib/OperationList-BYemrDYk.js +5068 -0
- package/lib/OperationList-BYemrDYk.js.map +1 -0
- package/lib/Pagination-SdlocK96.js +48 -0
- package/lib/Pagination-SdlocK96.js.map +1 -0
- package/lib/{index.esm-9-TF9KQB.js → RouteGuard-CqZPoZYJ.js} +196 -144
- package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
- package/lib/SchemaList-CAeKy9pV.js +148 -0
- package/lib/SchemaList-CAeKy9pV.js.map +1 -0
- package/lib/SchemaView-B3fOPR4V.js +357 -0
- package/lib/SchemaView-B3fOPR4V.js.map +1 -0
- package/lib/{Select-D9CKL33X.js → Select-DVFRKf1R.js} +71 -71
- package/lib/{Select-D9CKL33X.js.map → Select-DVFRKf1R.js.map} +1 -1
- package/lib/SlotletProvider-DXvc0aY6.js +338 -0
- package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-BEoSoPEo.js} +496 -592
- package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
- package/lib/Toc-YBsgI72s.js +92 -0
- package/lib/Toc-YBsgI72s.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-QijJrSf0.js → chunk-HA7DTUK3-C4gP41vD.js} +560 -560
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
- package/lib/{circular-DxaIIlWD.js → circular-ByJI6Mci.js} +5461 -4993
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/context-DLCwaMXN.js +22 -0
- package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
- package/lib/{createServer-DSQiPwjN.js → createServer-mYvGvmc0.js} +5062 -5209
- package/lib/createServer-mYvGvmc0.js.map +1 -0
- package/lib/{hook-C_t2ISLC.js → hook-CqpVYDqN.js} +495 -467
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/index-Bn6Lc9tq.js.map +1 -0
- package/lib/index-C1OzjGUK.js +2227 -0
- package/lib/index-C1OzjGUK.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/index-D48iOQvJ.js +1973 -0
- package/lib/index-D48iOQvJ.js.map +1 -0
- package/lib/index-DwT-v3zK.js +86 -0
- package/lib/index-DwT-v3zK.js.map +1 -0
- package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/index-gQD2h1wX.js +447 -0
- package/lib/index-gQD2h1wX.js.map +1 -0
- package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
- package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
- package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
- package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
- package/lib/{mutation-Cm3O9f3X.js → mutation-8LjrN7uz.js} +26 -26
- package/lib/{mutation-Cm3O9f3X.js.map → mutation-8LjrN7uz.js.map} +1 -1
- package/lib/objectEntries-yMIkr2mI.js +5 -0
- package/lib/objectEntries-yMIkr2mI.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +4 -4
- package/lib/post-processors/traverse.js +2 -2
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
- package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
- package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
- package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +4 -4
- package/lib/ui/Button.js +13 -12
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +39 -21
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Checkbox.js +16 -26
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +105 -78
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +14 -1151
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +5 -5
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +10 -10
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Stepper.js +6 -0
- package/lib/ui/Stepper.js.map +1 -0
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +11 -0
- package/lib/ui/SyntaxHighlight.js.map +1 -0
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/util.js +6 -0
- package/lib/ui/util.js.map +1 -0
- package/lib/{useExposedProps-Bbf99zic.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-Bbf99zic.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
- package/lib/useLatest-hmRS46UF.js +11 -0
- package/lib/useLatest-hmRS46UF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +15 -14
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +67 -49
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +370 -404
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +32 -1334
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +19 -0
- package/lib/zudoku.hooks.js.map +1 -0
- package/lib/zudoku.icons.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +106 -111
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +108 -106
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-openapi.js +6 -8
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -9
- package/lib/zudoku.plugin-search-pagefind.js +233 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +76 -56
- package/src/app/entry.client.tsx +8 -0
- package/src/app/entry.server.tsx +23 -13
- package/src/app/main.css +98 -57
- package/src/app/main.tsx +3 -1
- package/src/app/tailwind.ts +20 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/auth0.tsx +3 -2
- package/src/lib/authentication/providers/clerk.tsx +32 -8
- package/src/lib/authentication/providers/openid.tsx +31 -15
- package/src/lib/authentication/providers/supabase.tsx +157 -0
- package/src/lib/authentication/state.ts +9 -37
- package/src/lib/components/AnchorLink.tsx +9 -7
- package/src/lib/components/Banner.tsx +1 -0
- package/src/lib/components/Bootstrap.tsx +13 -6
- package/src/lib/components/Footer.tsx +136 -0
- package/src/lib/components/Header.tsx +12 -8
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/InlineCode.tsx +13 -16
- package/src/lib/components/Layout.tsx +22 -67
- package/src/lib/components/Main.tsx +50 -0
- package/src/lib/components/MobileTopNavigation.tsx +27 -18
- package/src/lib/components/Pagination.tsx +50 -0
- package/src/lib/components/ThemeSwitch.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +51 -24
- package/src/lib/components/Zudoku.tsx +20 -7
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
- package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
- package/src/lib/components/context/ZudokuContext.ts +17 -8
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
- package/src/lib/components/navigation/Sidebar.tsx +30 -44
- package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +22 -29
- package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
- package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
- package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
- package/src/lib/core/RouteGuard.tsx +69 -12
- package/src/lib/core/ZudokuContext.ts +63 -12
- package/src/lib/core/plugins.ts +21 -7
- package/src/lib/errors/ErrorAlert.tsx +24 -17
- package/src/lib/hooks/index.ts +5 -0
- package/src/lib/hooks/useEvent.test.tsx +149 -0
- package/src/lib/hooks/useEvent.ts +41 -0
- package/src/lib/oas/graphql/index.ts +206 -55
- package/src/lib/oas/parser/dereference/index.ts +2 -0
- package/src/lib/oas/parser/index.ts +7 -29
- package/src/lib/plugins/api-catalog/Catalog.tsx +50 -100
- package/src/lib/plugins/api-catalog/index.tsx +66 -15
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +7 -3
- package/src/lib/plugins/markdown/MdxPage.tsx +15 -47
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +171 -81
- package/src/lib/plugins/openapi/OperationListItem.tsx +118 -104
- package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
- package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
- package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
- package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +50 -13
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
- package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +34 -17
- package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
- package/src/lib/plugins/openapi/index.tsx +55 -87
- package/src/lib/plugins/openapi/interfaces.ts +44 -15
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
- package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +8 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +176 -89
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
- package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +25 -5
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
- package/src/lib/plugins/openapi/schema/utils.ts +7 -1
- package/src/lib/plugins/openapi/state.ts +36 -0
- package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
- package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +164 -0
- package/src/lib/plugins/search-pagefind/ResultList.tsx +105 -0
- package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
- package/src/lib/plugins/search-pagefind/index.tsx +21 -0
- package/src/lib/plugins/search-pagefind/types.ts +118 -0
- package/src/lib/ui/Button.tsx +4 -2
- package/src/lib/ui/Callout.tsx +28 -10
- package/src/lib/ui/Checkbox.tsx +8 -24
- package/src/lib/ui/Command.tsx +25 -3
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/ui/Stepper.tsx +8 -0
- package/src/lib/ui/SyntaxHighlight.tsx +186 -0
- package/src/lib/ui/util.tsx +3 -0
- package/src/lib/util/MdxComponents.tsx +7 -4
- package/src/lib/util/joinPath.tsx +3 -0
- package/src/lib/util/traverse.ts +4 -8
- package/src/lib/util/types.ts +7 -0
- package/src/lib/util/useOnScreen.ts +6 -4
- package/src/lib/util/useScrollToAnchor.ts +30 -20
- package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
- package/dist/lib/components/SyntaxHighlight.js +0 -53
- package/dist/lib/components/SyntaxHighlight.js.map +0 -1
- package/dist/lib/components/context/PluginSystem.js +0 -2
- package/dist/lib/components/context/PluginSystem.js.map +0 -1
- package/dist/lib/plugins/markdown/Toc.js.map +0 -1
- package/lib/Markdown-8mv9nhGd.js.map +0 -1
- package/lib/MdxPage-GM1T5jmO.js +0 -193
- package/lib/MdxPage-GM1T5jmO.js.map +0 -1
- package/lib/OperationList-BTmRbbXk.js +0 -5179
- package/lib/OperationList-BTmRbbXk.js.map +0 -1
- package/lib/SlotletProvider-D0mFmGJu.js +0 -221
- package/lib/SlotletProvider-D0mFmGJu.js.map +0 -1
- package/lib/Spinner-BlzrEEk1.js +0 -51
- package/lib/Spinner-BlzrEEk1.js.map +0 -1
- package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
- package/lib/chunk-SYFQ2XB5-QijJrSf0.js.map +0 -1
- package/lib/circular-DxaIIlWD.js.map +0 -1
- package/lib/context-rwLGh-6_.js +0 -22
- package/lib/createServer-DSQiPwjN.js.map +0 -1
- package/lib/hook-C_t2ISLC.js.map +0 -1
- package/lib/index-B7mqiOei.js +0 -509
- package/lib/index-B7mqiOei.js.map +0 -1
- package/lib/index-BANyVRgL.js +0 -2098
- package/lib/index-BANyVRgL.js.map +0 -1
- package/lib/index-Djenk2Hj.js +0 -36
- package/lib/index.esm-9-TF9KQB.js.map +0 -1
- package/lib/joinUrl-nLx9pD-Z.js +0 -20
- package/lib/joinUrl-nLx9pD-Z.js.map +0 -1
- package/lib/useScrollToAnchor-BGEcH3HM.js +0 -286
- package/lib/useScrollToAnchor-BGEcH3HM.js.map +0 -1
- package/src/lib/components/SyntaxHighlight.tsx +0 -171
- package/src/lib/components/context/PluginSystem.ts +0 -0
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
- /package/dist/lib/{components/context/PluginSystem.d.ts → hooks/useEvent.test.d.ts} +0 -0
|
@@ -42,37 +42,41 @@ type OperationLike = {
|
|
|
42
42
|
export const createOperationSlug = (
|
|
43
43
|
slugify: CountableSlugify,
|
|
44
44
|
operation: OperationLike,
|
|
45
|
-
tag?: string,
|
|
46
45
|
) => {
|
|
47
46
|
const summary =
|
|
48
47
|
operation.summary ||
|
|
49
48
|
operation.operationId ||
|
|
50
49
|
`${operation.method}-${operation.path}`;
|
|
51
|
-
const prefix = tag ? `${tag}-` : "";
|
|
52
50
|
|
|
53
|
-
return slugify(
|
|
51
|
+
return slugify(summary);
|
|
54
52
|
};
|
|
55
53
|
|
|
56
|
-
export type
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
>;
|
|
54
|
+
export type SchemaImport = () => Promise<{
|
|
55
|
+
schema: OpenAPIDocument;
|
|
56
|
+
slugs: ReturnType<typeof getAllSlugs>;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
export type SchemaImports = Record<string, SchemaImport>;
|
|
60
|
+
|
|
61
|
+
type Context = {
|
|
62
|
+
schema: OpenAPIDocument;
|
|
63
|
+
operations: GraphQLOperationObject[];
|
|
64
|
+
schemaImports?: SchemaImports;
|
|
65
|
+
tags: ReturnType<typeof getAllTags>;
|
|
66
|
+
slugs: ReturnType<typeof getAllSlugs>;
|
|
67
|
+
};
|
|
60
68
|
|
|
61
69
|
const builder = new SchemaBuilder<{
|
|
70
|
+
DefaultFieldNullability: false;
|
|
62
71
|
Scalars: {
|
|
63
72
|
JSON: any;
|
|
64
73
|
JSONObject: any;
|
|
65
74
|
JSONSchema: any;
|
|
66
75
|
};
|
|
67
|
-
Context:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
schemaImports?: SchemaImports;
|
|
72
|
-
currentTag?: string;
|
|
73
|
-
slugify: CountableSlugify;
|
|
74
|
-
};
|
|
75
|
-
}>({});
|
|
76
|
+
Context: Context;
|
|
77
|
+
}>({
|
|
78
|
+
defaultFieldNullability: false,
|
|
79
|
+
});
|
|
76
80
|
|
|
77
81
|
type GraphQLOperationObject = OperationObject & {
|
|
78
82
|
path: string;
|
|
@@ -85,7 +89,15 @@ const JSONScalar = builder.addScalarType("JSON", GraphQLJSON);
|
|
|
85
89
|
const JSONObjectScalar = builder.addScalarType("JSONObject", GraphQLJSONObject);
|
|
86
90
|
const JSONSchemaScalar = builder.addScalarType("JSONSchema", GraphQLJSONSchema);
|
|
87
91
|
|
|
88
|
-
|
|
92
|
+
const resolveExtensions = (obj: Record<string, any>) =>
|
|
93
|
+
Object.fromEntries(
|
|
94
|
+
Object.entries(obj).filter(([key]) => key.startsWith("x-")),
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const getAllTags = (
|
|
98
|
+
schema: OpenAPIDocument,
|
|
99
|
+
slugs: ReturnType<typeof getAllSlugs>["tags"],
|
|
100
|
+
): Array<Omit<TagObject, "name"> & { name?: string; slug?: string }> => {
|
|
89
101
|
const rootTags = schema.tags ?? [];
|
|
90
102
|
const operationTags = new Set(
|
|
91
103
|
Object.values(schema.paths ?? {})
|
|
@@ -93,16 +105,53 @@ export const getAllTags = (schema: OpenAPIDocument): TagObject[] => {
|
|
|
93
105
|
.flatMap((op) => (op as OperationObject).tags ?? []),
|
|
94
106
|
);
|
|
95
107
|
|
|
108
|
+
const hasUntaggedOperations = Object.values(schema.paths ?? {}).some((path) =>
|
|
109
|
+
Object.values(path ?? {}).some(
|
|
110
|
+
(op) => !(op as OperationObject).tags?.length,
|
|
111
|
+
),
|
|
112
|
+
);
|
|
113
|
+
|
|
96
114
|
return [
|
|
97
115
|
// Keep root tags that are actually used in operations
|
|
98
|
-
...rootTags
|
|
116
|
+
...rootTags
|
|
117
|
+
.filter((tag) => operationTags.has(tag.name))
|
|
118
|
+
.map((tag) => ({ ...tag, slug: slugs[tag.name] })),
|
|
99
119
|
// Add tags found in operations but not defined in root tags
|
|
100
120
|
...[...operationTags]
|
|
101
121
|
.filter((tag) => !rootTags.some((rt) => rt.name === tag))
|
|
102
|
-
.map((tag) => ({ name: tag })),
|
|
122
|
+
.map((tag) => ({ name: tag, slug: slugs[tag] })),
|
|
123
|
+
// Add untagged operations if there are any
|
|
124
|
+
...(hasUntaggedOperations ? [{ name: undefined, slug: undefined }] : []),
|
|
103
125
|
];
|
|
104
126
|
};
|
|
105
127
|
|
|
128
|
+
export const getAllSlugs = (
|
|
129
|
+
ops: GraphQLOperationObject[],
|
|
130
|
+
schemaTags: TagObject[] = [],
|
|
131
|
+
) => {
|
|
132
|
+
const slugify = slugifyWithCounter();
|
|
133
|
+
|
|
134
|
+
const tags = Array.from(
|
|
135
|
+
new Set([
|
|
136
|
+
...ops.flatMap((op) => op.tags ?? []),
|
|
137
|
+
...schemaTags.map((tag) => tag.name),
|
|
138
|
+
]),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
operations: Object.fromEntries(
|
|
143
|
+
ops.map((op) => [
|
|
144
|
+
getOperationSlugKey(op),
|
|
145
|
+
createOperationSlug(slugify, op),
|
|
146
|
+
]),
|
|
147
|
+
),
|
|
148
|
+
tags: Object.fromEntries(tags.map((tag) => [tag, slugify(tag)])),
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const getOperationSlugKey = (op: GraphQLOperationObject) =>
|
|
153
|
+
[op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
|
|
154
|
+
|
|
106
155
|
export const getAllOperations = (
|
|
107
156
|
paths?: PathsObject,
|
|
108
157
|
): GraphQLOperationObject[] => {
|
|
@@ -140,14 +189,21 @@ export const getAllOperations = (
|
|
|
140
189
|
return operations;
|
|
141
190
|
};
|
|
142
191
|
|
|
143
|
-
const SchemaTag = builder.objectRef<
|
|
192
|
+
const SchemaTag = builder.objectRef<
|
|
193
|
+
Omit<TagObject, "name"> & { name?: string; slug?: string }
|
|
194
|
+
>("SchemaTag");
|
|
195
|
+
|
|
196
|
+
SchemaTag.implement({
|
|
144
197
|
fields: (t) => ({
|
|
145
|
-
name: t.exposeString("name"),
|
|
198
|
+
name: t.exposeString("name", { nullable: true }),
|
|
199
|
+
slug: t.exposeString("slug", { nullable: true }),
|
|
200
|
+
isUntagged: t.field({ type: "Boolean", resolve: (parent) => !parent.name }),
|
|
146
201
|
description: t.exposeString("description", { nullable: true }),
|
|
147
202
|
operations: t.field({
|
|
148
203
|
type: [OperationItem],
|
|
149
204
|
resolve: (parent, _args, ctx) => {
|
|
150
205
|
const rootTags = ctx.tags.map((tag) => tag.name);
|
|
206
|
+
|
|
151
207
|
return ctx.operations
|
|
152
208
|
.filter((item) =>
|
|
153
209
|
parent.name
|
|
@@ -156,12 +212,30 @@ const SchemaTag = builder.objectRef<TagObject>("SchemaTag").implement({
|
|
|
156
212
|
// If none of the tags are present in the root tags, then show them here
|
|
157
213
|
item.tags?.every((tag) => !rootTags.includes(tag)),
|
|
158
214
|
)
|
|
159
|
-
.map((item) => ({
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
215
|
+
.map((item) => ({ ...item, parentTag: parent.name }));
|
|
216
|
+
},
|
|
217
|
+
}),
|
|
218
|
+
prev: t.field({
|
|
219
|
+
type: SchemaTag,
|
|
220
|
+
nullable: true,
|
|
221
|
+
resolve: (parent, _args, ctx) => {
|
|
222
|
+
const index = ctx.tags.findIndex((tag) => tag.slug === parent.slug);
|
|
223
|
+
return ctx.tags[index - 1];
|
|
224
|
+
},
|
|
225
|
+
}),
|
|
226
|
+
next: t.field({
|
|
227
|
+
type: SchemaTag,
|
|
228
|
+
nullable: true,
|
|
229
|
+
resolve: (parent, _args, ctx) => {
|
|
230
|
+
const index = ctx.tags.findIndex((tag) => tag.slug === parent.slug);
|
|
231
|
+
return ctx.tags[index + 1];
|
|
163
232
|
},
|
|
164
233
|
}),
|
|
234
|
+
extensions: t.field({
|
|
235
|
+
type: JSONObjectScalar,
|
|
236
|
+
resolve: (parent) => resolveExtensions(parent),
|
|
237
|
+
nullable: true,
|
|
238
|
+
}),
|
|
165
239
|
}),
|
|
166
240
|
});
|
|
167
241
|
|
|
@@ -188,6 +262,11 @@ const TagItem = builder.objectRef<TagObject>("TagItem").implement({
|
|
|
188
262
|
fields: (t) => ({
|
|
189
263
|
name: t.exposeString("name"),
|
|
190
264
|
description: t.exposeString("description", { nullable: true }),
|
|
265
|
+
extensions: t.field({
|
|
266
|
+
type: JSONObjectScalar,
|
|
267
|
+
resolve: (parent) => resolveExtensions(parent),
|
|
268
|
+
nullable: true,
|
|
269
|
+
}),
|
|
191
270
|
}),
|
|
192
271
|
});
|
|
193
272
|
|
|
@@ -246,6 +325,11 @@ const ParameterItem = builder
|
|
|
246
325
|
nullable: true,
|
|
247
326
|
}),
|
|
248
327
|
schema: t.expose("schema", { type: JSONSchemaScalar, nullable: true }),
|
|
328
|
+
extensions: t.field({
|
|
329
|
+
type: JSONObjectScalar,
|
|
330
|
+
resolve: (parent) => resolveExtensions(parent),
|
|
331
|
+
nullable: true,
|
|
332
|
+
}),
|
|
249
333
|
}),
|
|
250
334
|
});
|
|
251
335
|
|
|
@@ -303,6 +387,11 @@ const ResponseItem = builder
|
|
|
303
387
|
content: t.expose("content", { type: [MediaTypeItem], nullable: true }),
|
|
304
388
|
headers: t.expose("headers", { type: JSONScalar, nullable: true }),
|
|
305
389
|
links: t.expose("links", { type: JSONScalar, nullable: true }),
|
|
390
|
+
extensions: t.field({
|
|
391
|
+
type: JSONObjectScalar,
|
|
392
|
+
resolve: (parent) => resolveExtensions(parent),
|
|
393
|
+
nullable: true,
|
|
394
|
+
}),
|
|
306
395
|
}),
|
|
307
396
|
});
|
|
308
397
|
|
|
@@ -313,18 +402,16 @@ const OperationItem = builder
|
|
|
313
402
|
slug: t.field({
|
|
314
403
|
type: "String",
|
|
315
404
|
resolve: (parent, _, ctx) => {
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
return createOperationSlug(ctx.slugify, slugData, parent.parentTag);
|
|
405
|
+
const slug = ctx.slugs.operations[getOperationSlugKey(parent)];
|
|
406
|
+
|
|
407
|
+
if (!slug) {
|
|
408
|
+
throw new Error(
|
|
409
|
+
`No slug found for operation: ${getOperationSlugKey(parent)}`,
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
return slug;
|
|
325
413
|
},
|
|
326
414
|
}),
|
|
327
|
-
|
|
328
415
|
path: t.exposeString("path"),
|
|
329
416
|
method: t.exposeString("method"),
|
|
330
417
|
operationId: t.exposeString("operationId", { nullable: true }),
|
|
@@ -396,9 +483,51 @@ const OperationItem = builder
|
|
|
396
483
|
nullable: true,
|
|
397
484
|
}),
|
|
398
485
|
deprecated: t.exposeBoolean("deprecated", { nullable: true }),
|
|
486
|
+
extensions: t.field({
|
|
487
|
+
type: JSONObjectScalar,
|
|
488
|
+
resolve: (parent) => resolveExtensions(parent),
|
|
489
|
+
nullable: true,
|
|
490
|
+
}),
|
|
399
491
|
}),
|
|
400
492
|
});
|
|
401
493
|
|
|
494
|
+
const SchemaItem = builder
|
|
495
|
+
.objectRef<{
|
|
496
|
+
name: string;
|
|
497
|
+
schema: SchemaObject;
|
|
498
|
+
extensions?: Record<string, any>;
|
|
499
|
+
}>("SchemaItem")
|
|
500
|
+
.implement({
|
|
501
|
+
fields: (t) => ({
|
|
502
|
+
name: t.exposeString("name"),
|
|
503
|
+
schema: t.expose("schema", { type: JSONSchemaScalar }),
|
|
504
|
+
extensions: t.expose("extensions", {
|
|
505
|
+
type: JSONObjectScalar,
|
|
506
|
+
nullable: true,
|
|
507
|
+
}),
|
|
508
|
+
}),
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
const Components = builder.objectRef<{
|
|
512
|
+
schemas?: Record<string, SchemaObject>;
|
|
513
|
+
}>("Components");
|
|
514
|
+
|
|
515
|
+
Components.implement({
|
|
516
|
+
fields: (t) => ({
|
|
517
|
+
schemas: t.field({
|
|
518
|
+
type: [SchemaItem],
|
|
519
|
+
resolve: (parent) => {
|
|
520
|
+
return Object.entries(parent.schemas ?? {}).map(([name, schema]) => ({
|
|
521
|
+
name,
|
|
522
|
+
schema,
|
|
523
|
+
extensions: resolveExtensions(schema),
|
|
524
|
+
}));
|
|
525
|
+
},
|
|
526
|
+
nullable: true,
|
|
527
|
+
}),
|
|
528
|
+
}),
|
|
529
|
+
});
|
|
530
|
+
|
|
402
531
|
const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
403
532
|
fields: (t) => ({
|
|
404
533
|
openapi: t.string({ resolve: (root) => root.openapi }),
|
|
@@ -428,17 +557,30 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
428
557
|
methods: Object.keys(value!) as typeof HttpMethods,
|
|
429
558
|
})),
|
|
430
559
|
}),
|
|
431
|
-
|
|
560
|
+
tag: t.field({
|
|
561
|
+
type: SchemaTag,
|
|
432
562
|
args: {
|
|
563
|
+
slug: t.arg.string(),
|
|
433
564
|
name: t.arg.string(),
|
|
565
|
+
untagged: t.arg.boolean(),
|
|
434
566
|
},
|
|
435
|
-
|
|
436
|
-
resolve: (
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
567
|
+
nullable: true,
|
|
568
|
+
resolve: (_, args, ctx) => {
|
|
569
|
+
if (args.untagged) {
|
|
570
|
+
return ctx.tags.find((tag) => tag.name === undefined);
|
|
571
|
+
}
|
|
572
|
+
if (args.slug) {
|
|
573
|
+
return ctx.tags.find((tag) => tag.slug === args.slug);
|
|
574
|
+
}
|
|
575
|
+
if (args.name) {
|
|
576
|
+
return ctx.tags.find((tag) => tag.name === args.name);
|
|
577
|
+
}
|
|
440
578
|
},
|
|
441
579
|
}),
|
|
580
|
+
tags: t.field({
|
|
581
|
+
type: [SchemaTag],
|
|
582
|
+
resolve: (_root, _args, ctx) => ctx.tags,
|
|
583
|
+
}),
|
|
442
584
|
operations: t.field({
|
|
443
585
|
type: [OperationItem],
|
|
444
586
|
args: {
|
|
@@ -448,7 +590,7 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
448
590
|
tag: t.arg.string(),
|
|
449
591
|
untagged: t.arg.boolean(),
|
|
450
592
|
},
|
|
451
|
-
resolve: (
|
|
593
|
+
resolve: (_parent, args, ctx) =>
|
|
452
594
|
ctx.operations.filter((op) => {
|
|
453
595
|
return (
|
|
454
596
|
(!args.operationId || op.operationId === args.operationId) &&
|
|
@@ -459,6 +601,16 @@ const Schema = builder.objectRef<OpenAPIDocument>("Schema").implement({
|
|
|
459
601
|
);
|
|
460
602
|
}),
|
|
461
603
|
}),
|
|
604
|
+
components: t.field({
|
|
605
|
+
type: Components,
|
|
606
|
+
resolve: (root) => root.components,
|
|
607
|
+
nullable: true,
|
|
608
|
+
}),
|
|
609
|
+
extensions: t.field({
|
|
610
|
+
type: JSONObjectScalar,
|
|
611
|
+
resolve: (root) => resolveExtensions(root),
|
|
612
|
+
nullable: true,
|
|
613
|
+
}),
|
|
462
614
|
}),
|
|
463
615
|
});
|
|
464
616
|
|
|
@@ -474,27 +626,26 @@ builder.queryType({
|
|
|
474
626
|
type: t.arg({ type: SchemaSource, required: true }),
|
|
475
627
|
input: t.arg({ type: JSONScalar, required: true }),
|
|
476
628
|
},
|
|
477
|
-
resolve: async (
|
|
478
|
-
let schema: OpenAPIDocument;
|
|
479
|
-
|
|
629
|
+
resolve: async (_parent, args, ctx) => {
|
|
480
630
|
if (args.type === "file" && typeof args.input === "string") {
|
|
481
631
|
const loadSchema = ctx.schemaImports?.[args.input];
|
|
482
632
|
|
|
483
633
|
if (!loadSchema) {
|
|
484
634
|
throw new Error(`No schema loader found for path: ${args.input}`);
|
|
485
635
|
}
|
|
486
|
-
const
|
|
487
|
-
schema =
|
|
636
|
+
const { schema, slugs } = await loadSchema();
|
|
637
|
+
ctx.schema = schema;
|
|
638
|
+
ctx.operations = getAllOperations(schema.paths);
|
|
639
|
+
ctx.slugs = slugs;
|
|
640
|
+
ctx.tags = getAllTags(schema, ctx.slugs.tags);
|
|
488
641
|
} else {
|
|
489
|
-
schema = await validate(args.input as string);
|
|
642
|
+
ctx.schema = await validate(args.input as string);
|
|
643
|
+
ctx.operations = getAllOperations(ctx.schema.paths);
|
|
644
|
+
ctx.slugs = getAllSlugs(ctx.operations);
|
|
645
|
+
ctx.tags = getAllTags(ctx.schema, ctx.slugs.tags);
|
|
490
646
|
}
|
|
491
647
|
|
|
492
|
-
ctx.schema
|
|
493
|
-
ctx.operations = getAllOperations(schema.paths);
|
|
494
|
-
ctx.slugify = slugifyWithCounter();
|
|
495
|
-
ctx.tags = getAllTags(schema);
|
|
496
|
-
|
|
497
|
-
return schema;
|
|
648
|
+
return ctx.schema;
|
|
498
649
|
},
|
|
499
650
|
}),
|
|
500
651
|
}),
|
|
@@ -504,4 +655,4 @@ export const schema = builder.toSchema();
|
|
|
504
655
|
|
|
505
656
|
export const createGraphQLServer = (
|
|
506
657
|
options?: Omit<YogaServerOptions<any, any>, "schema">,
|
|
507
|
-
) => createYoga({ schema, ...options });
|
|
658
|
+
) => createYoga({ schema, batching: true, ...options });
|
|
@@ -38,6 +38,8 @@ export const dereference = async (
|
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
40
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
41
|
+
// Store the ref path before resolving
|
|
42
|
+
current.__$ref = current.$ref;
|
|
41
43
|
for (const resolver of resolvers) {
|
|
42
44
|
const resolved = await resolver(current.$ref);
|
|
43
45
|
if (resolved) return await resolve(resolved, path);
|
|
@@ -3,11 +3,15 @@ import { OpenAPIV3, type OpenAPIV3_1 } from "openapi-types";
|
|
|
3
3
|
import { dereference, type JSONSchema } from "./dereference/index.js";
|
|
4
4
|
import { upgradeSchema } from "./upgrade/index.js";
|
|
5
5
|
|
|
6
|
-
type
|
|
7
|
-
|
|
6
|
+
// Must be an interface (not a type) to allow merging with OpenAPI types with index signatures
|
|
7
|
+
interface WithRef {
|
|
8
|
+
__$ref?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type DeepOmitReference<T> = T extends OpenAPIV3_1.ReferenceObject
|
|
8
12
|
? never
|
|
9
13
|
: T extends object
|
|
10
|
-
? { [K in keyof T]: DeepOmitReference<T[K]> }
|
|
14
|
+
? { [K in keyof T]: DeepOmitReference<T[K]> } & WithRef
|
|
11
15
|
: T;
|
|
12
16
|
|
|
13
17
|
export type OpenAPIDocument = DeepOmitReference<OpenAPIV3_1.Document>;
|
|
@@ -24,25 +28,6 @@ export type ServerObject = DeepOmitReference<OpenAPIV3_1.ServerObject>;
|
|
|
24
28
|
|
|
25
29
|
export const HttpMethods = Object.values(OpenAPIV3.HttpMethods);
|
|
26
30
|
|
|
27
|
-
// class ValidationError extends Error {
|
|
28
|
-
// constructor(public errors: OutputUnit[]) {
|
|
29
|
-
// super("Validation error");
|
|
30
|
-
// }
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
// const getValidator = async (openApiVersion: string) => {
|
|
34
|
-
// if (openApiVersion.startsWith("3.0")) {
|
|
35
|
-
// const schema = (await import("./schemas/v3.0.json")) as any;
|
|
36
|
-
// return new Validator(schema, "4");
|
|
37
|
-
// }
|
|
38
|
-
// if (openApiVersion.startsWith("3.1")) {
|
|
39
|
-
// const schema = (await import("./schemas/v3.1.json")) as any;
|
|
40
|
-
// return new Validator(schema as any, "2020-12");
|
|
41
|
-
// }
|
|
42
|
-
|
|
43
|
-
// throw new Error(`Unsupported OpenAPI version: ${openApiVersion}`);
|
|
44
|
-
// };
|
|
45
|
-
|
|
46
31
|
const parseSchemaInput = async (
|
|
47
32
|
schemaInput: unknown,
|
|
48
33
|
): Promise<JSONSchema & { openapi?: string }> => {
|
|
@@ -110,13 +95,6 @@ export const validate = async (schemaInput: unknown) => {
|
|
|
110
95
|
throw new GraphQLError("OpenAPI version is not defined");
|
|
111
96
|
}
|
|
112
97
|
|
|
113
|
-
// const validator = await getValidator(schema.openapi);
|
|
114
|
-
// const result = validator.validate(schema);
|
|
115
|
-
//
|
|
116
|
-
// if (!result.valid) {
|
|
117
|
-
// throw new ValidationError(result.errors);
|
|
118
|
-
// }
|
|
119
|
-
|
|
120
98
|
const dereferenced = await dereference(schema);
|
|
121
99
|
|
|
122
100
|
return upgradeSchema(dereferenced);
|
|
@@ -1,121 +1,71 @@
|
|
|
1
|
-
import slugify from "@sindresorhus/slugify";
|
|
2
1
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
|
+
import { useMatch } from "react-router";
|
|
4
|
+
import { Link } from "zudoku/components";
|
|
5
5
|
import { useAuthState } from "../../authentication/state.js";
|
|
6
|
+
import { Heading } from "../../components/Heading.js";
|
|
6
7
|
import { Markdown } from "../../components/Markdown.js";
|
|
7
|
-
import {
|
|
8
|
-
import type
|
|
9
|
-
|
|
10
|
-
const getKey = (category: string, tag: string) => slugify(`${category}-${tag}`);
|
|
8
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
9
|
+
import { type ApiCatalogPluginOptions, getKey } from "./index.js";
|
|
11
10
|
|
|
12
11
|
export const Catalog = ({
|
|
13
12
|
items,
|
|
14
13
|
filterCatalogItems = (items) => items,
|
|
15
|
-
categories,
|
|
16
14
|
label = "API Library",
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
categoryLabel,
|
|
16
|
+
}: Omit<ApiCatalogPluginOptions, "navigationId"> & {
|
|
17
|
+
categoryLabel?: string;
|
|
18
|
+
}) => {
|
|
20
19
|
const auth = useAuthState();
|
|
20
|
+
const match = useMatch({ path: "/catalog/:category" });
|
|
21
|
+
const activeCategory = match?.params.category;
|
|
21
22
|
|
|
22
23
|
const catalogItems = useSuspenseQuery({
|
|
23
24
|
queryFn: () => filterCatalogItems(items, { auth }),
|
|
24
25
|
queryKey: ["catalogItems", auth],
|
|
25
26
|
});
|
|
26
27
|
|
|
28
|
+
// Only index the overview page, ignore the rest
|
|
29
|
+
const dataSet = activeCategory ? { "data-pagefind-ignore": "all" } : {};
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
|
-
<section className="pt-[--padding-content-top]
|
|
29
|
-
<
|
|
30
|
-
<title>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<button
|
|
41
|
-
type="button"
|
|
42
|
-
className="text-end text-sm text-foreground/60 hover:text-foreground"
|
|
43
|
-
onClick={() => setSearchParams({})}
|
|
44
|
-
>
|
|
45
|
-
Clear
|
|
46
|
-
</button>
|
|
47
|
-
)}
|
|
48
|
-
</div>
|
|
49
|
-
<ul className="space-y-1 [&>li]:py-2">
|
|
50
|
-
{category.tags
|
|
51
|
-
.map((tag) => ({
|
|
52
|
-
tag,
|
|
53
|
-
count: items.filter((api) =>
|
|
54
|
-
api.categories.find((c) => c.tags.includes(tag)),
|
|
55
|
-
).length,
|
|
56
|
-
}))
|
|
57
|
-
.map(({ tag, count }) => {
|
|
58
|
-
const slug = getKey(category.label, tag);
|
|
59
|
-
const isActive = slug === activeCategory;
|
|
32
|
+
<section className="pt-[--padding-content-top]" {...dataSet}>
|
|
33
|
+
<Helmet>
|
|
34
|
+
<title>
|
|
35
|
+
{categoryLabel ? `${categoryLabel} - ` : ""}
|
|
36
|
+
{label}
|
|
37
|
+
</title>
|
|
38
|
+
</Helmet>
|
|
39
|
+
<div className="grid gap-4">
|
|
40
|
+
<Heading level={2}>
|
|
41
|
+
{label}
|
|
42
|
+
{categoryLabel && ` - ${categoryLabel}`}
|
|
43
|
+
</Heading>
|
|
60
44
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</div>
|
|
45
|
+
<div className="grid grid-cols-2 gap-4">
|
|
46
|
+
{catalogItems.data
|
|
47
|
+
.filter(
|
|
48
|
+
(api) =>
|
|
49
|
+
!activeCategory ||
|
|
50
|
+
api.categories.find((c) =>
|
|
51
|
+
c.tags.find((t) => getKey(c.label, t) === activeCategory),
|
|
52
|
+
),
|
|
53
|
+
)
|
|
54
|
+
.map((api) => (
|
|
55
|
+
<Link
|
|
56
|
+
to={joinUrl(api.path)}
|
|
57
|
+
className="no-underline hover:!text-foreground"
|
|
58
|
+
key={api.path}
|
|
59
|
+
>
|
|
60
|
+
<div className="border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal">
|
|
61
|
+
<span className="font-semibold">{api.label}</span>
|
|
62
|
+
<Markdown
|
|
63
|
+
className="text-sm whitespace-pre-wrap mb-6 line-clamp-2"
|
|
64
|
+
content={api.description}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</Link>
|
|
85
68
|
))}
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div className="col-span-9">
|
|
89
|
-
<h3 className="mt-0 text-2xl font-bold mb-4">{label}</h3>
|
|
90
|
-
|
|
91
|
-
<div className="grid grid-cols-2 gap-4">
|
|
92
|
-
{catalogItems.data
|
|
93
|
-
.filter(
|
|
94
|
-
(api) =>
|
|
95
|
-
!activeCategory ||
|
|
96
|
-
api.categories.find((c) =>
|
|
97
|
-
c.tags.find((t) => getKey(c.label, t) === activeCategory),
|
|
98
|
-
),
|
|
99
|
-
)
|
|
100
|
-
.map((api) => (
|
|
101
|
-
<Link
|
|
102
|
-
to={{
|
|
103
|
-
pathname: `/${api.path}`,
|
|
104
|
-
search: activeCategory ? `category=${activeCategory}` : "",
|
|
105
|
-
}}
|
|
106
|
-
className="no-underline hover:!text-foreground"
|
|
107
|
-
key={api.path}
|
|
108
|
-
>
|
|
109
|
-
<div className="border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal">
|
|
110
|
-
<span className="font-semibold">{api.label}</span>
|
|
111
|
-
<Markdown
|
|
112
|
-
className="text-sm whitespace-pre-wrap mb-6 line-clamp-2"
|
|
113
|
-
content={api.description}
|
|
114
|
-
/>
|
|
115
|
-
</div>
|
|
116
|
-
</Link>
|
|
117
|
-
))}
|
|
118
|
-
</div>
|
|
119
69
|
</div>
|
|
120
70
|
</div>
|
|
121
71
|
</section>
|