zudoku 0.0.0-eb4182d → 0.0.0-eeace45
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 +121 -0
- package/cli.js +2 -2
- package/client.d.ts +7 -0
- package/dist/app/demo.js +1 -3
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +16 -3
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +11 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +3 -2
- package/dist/app/main.js +16 -32
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/standalone.js +1 -3
- package/dist/app/standalone.js.map +1 -1
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +1 -4
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/cmds/build.js +1 -0
- package/dist/cli/cmds/build.js.map +1 -1
- package/dist/cli/cmds/dev.js +5 -0
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/common/logger.js +9 -0
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -0
- package/dist/cli/dev/handler.js +3 -3
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/codegen.d.ts +3 -0
- package/dist/codegen.js +45 -0
- package/dist/codegen.js.map +1 -0
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +35 -19
- package/dist/config/validators/InputSidebarSchema.js +7 -28
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +80 -44
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4945 -0
- package/dist/config/validators/common.js +280 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +888 -453
- package/dist/config/validators/validate.js +14 -213
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +4 -2
- package/dist/lib/authentication/AuthenticationPlugin.js +3 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +3 -3
- package/dist/lib/authentication/components/CallbackHandler.js +21 -31
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/SignIn.js +1 -1
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignOut.js +1 -1
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +5 -4
- package/dist/lib/authentication/hook.js +1 -3
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +12 -11
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +7 -1
- package/dist/lib/authentication/providers/openid.js +18 -27
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/state.d.ts +25 -4
- package/dist/lib/authentication/state.js +28 -3
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
- package/dist/lib/authentication/use-broadcast/shared.js +243 -0
- package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
- package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
- package/dist/lib/components/AnchorLink.d.ts +1 -1
- package/dist/lib/components/AnchorLink.js +1 -1
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +4 -3
- package/dist/lib/components/Bootstrap.js +12 -6
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/ClientOnly.d.ts +4 -2
- package/dist/lib/components/ClientOnly.js +1 -1
- package/dist/lib/components/ClientOnly.js.map +1 -1
- package/dist/lib/components/DeveloperHint.js +2 -1
- package/dist/lib/components/DeveloperHint.js.map +1 -1
- package/dist/lib/components/ErrorPage.js +1 -2
- package/dist/lib/components/ErrorPage.js.map +1 -1
- package/dist/lib/components/Header.js +21 -10
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +14 -5
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +9 -6
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/NotFoundPage.js +1 -1
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +11 -3
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +19 -16
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.d.ts +1 -0
- package/dist/lib/components/ThemeSwitch.js +13 -0
- package/dist/lib/components/ThemeSwitch.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +5 -0
- package/dist/lib/components/TopNavigation.js +44 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
- package/dist/lib/components/{DevPortal.js → Zudoku.js} +14 -15
- package/dist/lib/components/Zudoku.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +10 -14
- package/dist/lib/components/context/ZudokuContext.js +27 -26
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +38 -16
- package/dist/lib/components/index.js +16 -6
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +4 -4
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +0 -9
- package/dist/lib/components/navigation/SidebarBadge.js +0 -9
- 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 +18 -10
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +12 -12
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +11 -15
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +7 -14
- package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -0
- package/dist/lib/core/plugins.d.ts +18 -13
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +1 -1
- package/dist/lib/errors/ErrorAlert.js +8 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/errors/RouterError.js +1 -1
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +10 -11
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
- package/dist/lib/oas/parser/upgrade/index.js +2 -17
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +2 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +36 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +30 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/api-keys/CreateApiKey.js +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -9
- package/dist/lib/plugins/api-keys/index.js +3 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +11 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
- package/dist/lib/plugins/markdown/MdxPage.js +16 -3
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +8 -7
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
- package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +5 -9
- 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 +43 -23
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +14 -4
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +7 -5
- package/dist/lib/plugins/openapi/Route.js +23 -5
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +38 -46
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +114 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
- package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
- package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +24 -0
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
- package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
- package/dist/lib/plugins/openapi/client/worker.js +23 -14
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/context.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -3
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +34 -8
- package/dist/lib/plugins/openapi/graphql/graphql.js +195 -662
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +2 -2
- package/dist/lib/plugins/openapi/index.js +56 -68
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +20 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +3 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaView.js +2 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/plugins/openapi/util/methodToColor.d.ts +20 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js +24 -0
- package/dist/lib/plugins/openapi/util/methodToColor.js.map +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
- package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
- package/dist/lib/plugins/openapi-worker.d.ts +1 -1
- package/dist/lib/plugins/openapi-worker.js +7 -1
- package/dist/lib/plugins/openapi-worker.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +4 -7
- package/dist/lib/plugins/redirect/index.js +2 -2
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +24 -5
- package/dist/lib/plugins/search-inkeep/index.js +41 -5
- package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/inkeep.d.ts +3 -4
- package/dist/lib/plugins/search-inkeep/inkeep.js.map +1 -1
- package/dist/lib/ui/Accordion.d.ts +7 -0
- package/dist/lib/ui/Accordion.js +14 -0
- package/dist/lib/ui/Accordion.js.map +1 -0
- package/dist/lib/ui/ActionButton.d.ts +4 -0
- package/dist/lib/ui/ActionButton.js +10 -0
- package/dist/lib/ui/ActionButton.js.map +1 -0
- package/dist/lib/ui/Alert.d.ts +8 -0
- package/dist/lib/ui/Alert.js +23 -0
- package/dist/lib/ui/Alert.js.map +1 -0
- package/dist/lib/ui/AlertDialog.d.ts +20 -0
- package/dist/lib/ui/AlertDialog.js +27 -0
- package/dist/lib/ui/AlertDialog.js.map +1 -0
- package/dist/lib/ui/AspectRatio.d.ts +3 -0
- package/dist/lib/ui/AspectRatio.js +4 -0
- package/dist/lib/ui/AspectRatio.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +9 -0
- package/dist/lib/ui/Badge.js +21 -0
- package/dist/lib/ui/Badge.js.map +1 -0
- package/dist/lib/ui/Breadcrumb.d.ts +19 -0
- package/dist/lib/ui/Breadcrumb.js +24 -0
- package/dist/lib/ui/Breadcrumb.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -3
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Carousel.d.ts +18 -0
- package/dist/lib/ui/Carousel.js +99 -0
- package/dist/lib/ui/Carousel.js.map +1 -0
- package/dist/lib/ui/Checkbox.d.ts +4 -0
- package/dist/lib/ui/Checkbox.js +9 -0
- package/dist/lib/ui/Checkbox.js.map +1 -0
- package/dist/lib/ui/Collapsible.d.ts +5 -0
- package/dist/lib/ui/Collapsible.js +6 -0
- package/dist/lib/ui/Collapsible.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +80 -0
- package/dist/lib/ui/Command.js +31 -0
- package/dist/lib/ui/Command.js.map +1 -0
- package/dist/lib/{components → ui}/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -0
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/ui/Form.d.ts +23 -0
- package/dist/lib/ui/Form.js +63 -0
- package/dist/lib/ui/Form.js.map +1 -0
- package/dist/lib/ui/HoverCard.d.ts +6 -0
- package/dist/lib/ui/HoverCard.js +10 -0
- package/dist/lib/ui/HoverCard.js.map +1 -0
- package/dist/lib/ui/Label.d.ts +5 -0
- package/dist/lib/ui/Label.js +10 -0
- package/dist/lib/ui/Label.js.map +1 -0
- package/dist/lib/ui/Pagination.d.ts +28 -0
- package/dist/lib/ui/Pagination.js +24 -0
- package/dist/lib/ui/Pagination.js.map +1 -0
- package/dist/lib/ui/Popover.d.ts +6 -0
- package/dist/lib/ui/Popover.js +10 -0
- package/dist/lib/ui/Popover.js.map +1 -0
- package/dist/lib/ui/Progress.d.ts +4 -0
- package/dist/lib/ui/Progress.js +8 -0
- package/dist/lib/ui/Progress.js.map +1 -0
- package/dist/lib/ui/RadioGroup.d.ts +5 -0
- package/dist/lib/ui/RadioGroup.js +15 -0
- package/dist/lib/ui/RadioGroup.js.map +1 -0
- package/dist/lib/ui/ScrollArea.d.ts +5 -0
- package/dist/lib/ui/ScrollArea.js +12 -0
- package/dist/lib/ui/ScrollArea.js.map +1 -0
- package/dist/lib/ui/Select.js.map +1 -0
- package/dist/lib/ui/Skeleton.d.ts +2 -0
- package/dist/lib/ui/Skeleton.js +7 -0
- package/dist/lib/ui/Skeleton.js.map +1 -0
- package/dist/lib/ui/Slider.d.ts +4 -0
- package/dist/lib/ui/Slider.js +8 -0
- package/dist/lib/ui/Slider.js.map +1 -0
- package/dist/lib/ui/Switch.d.ts +4 -0
- package/dist/lib/ui/Switch.js +8 -0
- package/dist/lib/ui/Switch.js.map +1 -0
- package/dist/lib/ui/Textarea.d.ts +4 -0
- package/dist/lib/ui/Textarea.js +9 -0
- package/dist/lib/ui/Textarea.js.map +1 -0
- package/dist/lib/ui/Toggle.d.ts +12 -0
- package/dist/lib/ui/Toggle.js +26 -0
- package/dist/lib/ui/Toggle.js.map +1 -0
- package/dist/lib/ui/ToggleGroup.d.ts +12 -0
- package/dist/lib/ui/ToggleGroup.js +21 -0
- package/dist/lib/ui/ToggleGroup.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -0
- package/dist/lib/ui/Tooltip.js +11 -0
- package/dist/lib/ui/Tooltip.js.map +1 -0
- package/dist/lib/util/MdxComponents.d.ts +19 -20
- package/dist/lib/util/MdxComponents.js +1 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +2 -2
- package/dist/lib/util/invariant.d.ts +9 -0
- package/dist/lib/util/invariant.js +7 -3
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -0
- package/dist/lib/util/traverse.js +18 -0
- package/dist/lib/util/traverse.js.map +1 -0
- package/dist/lib/util/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +9 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
- package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +4 -0
- package/dist/lib/util/useOnScreen.js +19 -0
- package/dist/lib/util/useOnScreen.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/lib/util/useScrollToTop.js +1 -1
- package/dist/lib/util/useScrollToTop.js.map +1 -1
- package/dist/vite/build.js +26 -5
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -10
- package/dist/vite/config.js +91 -78
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -5
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/css/collect.d.ts +2 -0
- package/dist/vite/css/collect.js +27 -0
- package/dist/vite/css/collect.js.map +1 -0
- package/dist/vite/css/plugin.d.ts +5 -0
- package/dist/vite/css/plugin.js +79 -0
- package/dist/vite/css/plugin.js.map +1 -0
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.d.ts +7 -1
- package/dist/vite/dev-server.js +35 -8
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.js +0 -2
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +62 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-api.js +100 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +17 -12
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js +0 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -3
- package/dist/vite/plugin-config.js +22 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin-docs.js +37 -26
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +15 -23
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -1
- package/dist/vite/plugin-frontmatter.js +27 -24
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.d.ts +0 -6
- package/dist/vite/plugin-mdx.js +80 -6
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/plugin-theme-css.js +114 -0
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +12 -6
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +6 -1
- package/dist/vite/prerender.js +7 -5
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/remarkStaticGeneration.d.ts +3 -0
- package/dist/vite/remarkStaticGeneration.js +125 -0
- package/dist/vite/remarkStaticGeneration.js.map +1 -0
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +3 -0
- package/dist/zuplo/with-zuplo.js +28 -0
- package/dist/zuplo/with-zuplo.js.map +1 -0
- package/lib/AnchorLink-DFZZbmvr.js +34 -0
- package/lib/AnchorLink-DFZZbmvr.js.map +1 -0
- package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-DVLEc6cm.js} +23 -20
- package/lib/AuthenticationPlugin-DVLEc6cm.js.map +1 -0
- package/lib/Button-DeAoTouo.js +48 -0
- package/lib/Button-DeAoTouo.js.map +1 -0
- package/lib/CategoryHeading-CBconmtI.js +10 -0
- package/lib/{CategoryHeading-ovR-zHRq.js.map → CategoryHeading-CBconmtI.js.map} +1 -1
- package/lib/ClientOnly-E7hGysn1.js +11 -0
- package/lib/ClientOnly-E7hGysn1.js.map +1 -0
- package/lib/Dialog-Bxv1yEIg.js +67 -0
- package/lib/Dialog-Bxv1yEIg.js.map +1 -0
- package/lib/Markdown-CZDLNOFc.js +15202 -0
- package/lib/Markdown-CZDLNOFc.js.map +1 -0
- package/lib/MdxPage-DKMbBROv.js +188 -0
- package/lib/MdxPage-DKMbBROv.js.map +1 -0
- package/lib/OperationList-BKHUKlAL.js +5062 -0
- package/lib/OperationList-BKHUKlAL.js.map +1 -0
- package/lib/Route-DYwKZ_c_.js +35 -0
- package/lib/Route-DYwKZ_c_.js.map +1 -0
- package/lib/Select-B_IxRUUC.js +223 -0
- package/lib/Select-B_IxRUUC.js.map +1 -0
- package/lib/SlotletProvider-pfc9oejW.js +221 -0
- package/lib/SlotletProvider-pfc9oejW.js.map +1 -0
- package/lib/{Spinner-3cQDBVGr.js → Spinner-DuxJLLNE.js} +2 -2
- package/lib/{Spinner-3cQDBVGr.js.map → Spinner-DuxJLLNE.js.map} +1 -1
- package/lib/StaggeredRender-DgsamH_G.js +17 -0
- package/lib/StaggeredRender-DgsamH_G.js.map +1 -0
- package/lib/SyntaxHighlight-Bz-lOJtH.js +2979 -0
- package/lib/SyntaxHighlight-Bz-lOJtH.js.map +1 -0
- package/lib/ZudokuContext-hmLMUdf2.js +1217 -0
- package/lib/ZudokuContext-hmLMUdf2.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/{index-CLd8ycZz.js → assets/index-C7jnHK4b.js} +1008 -957
- package/lib/assets/index-C7jnHK4b.js.map +1 -0
- package/lib/assets/{worker-Bcj4NA2p.js → worker-D2kRl-cG.js} +6035 -5375
- package/lib/assets/worker-D2kRl-cG.js.map +1 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js +1823 -0
- package/lib/chunk-D52XG6IA-Dl7HLe6j.js.map +1 -0
- package/lib/cn-qaFjX9_3.js +2279 -0
- package/lib/cn-qaFjX9_3.js.map +1 -0
- package/lib/context-h_UkBLvr.js +22 -0
- package/lib/context-h_UkBLvr.js.map +1 -0
- package/lib/createServer-69sLlmQA.js +15679 -0
- package/lib/createServer-69sLlmQA.js.map +1 -0
- package/lib/hook-CHq7pFyz.js +227 -0
- package/lib/hook-CHq7pFyz.js.map +1 -0
- package/lib/{assets/index-B9EWVYfo.js → index-CBXSgjaE.js} +1034 -983
- package/lib/index-CBXSgjaE.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/index-CPNSgwSb.js.map +1 -0
- package/lib/index-CbrnMIak.js +1282 -0
- package/lib/index-CbrnMIak.js.map +1 -0
- package/lib/index-LNp6rxyU.js.map +1 -1
- package/lib/index.esm-BSV1C092.js +692 -0
- package/lib/index.esm-BSV1C092.js.map +1 -0
- package/lib/index.esm-BnnBRKJX.js +1214 -0
- package/lib/index.esm-BnnBRKJX.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -0
- package/lib/jsx-runtime-Dx-03ztt.js +446 -0
- package/lib/jsx-runtime-Dx-03ztt.js.map +1 -0
- package/lib/object_hash-BNWPnMN9.js +787 -0
- package/lib/object_hash-BNWPnMN9.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +11 -0
- package/lib/post-processors/removeExtensions.js.map +1 -0
- package/lib/post-processors/removePaths.js +28 -0
- package/lib/post-processors/removePaths.js.map +1 -0
- package/lib/post-processors/traverse.js +12 -0
- package/lib/post-processors/traverse.js.map +1 -0
- package/lib/prism-csharp.min-DUwvItt4.js +63 -0
- package/lib/{prism-csharp.min-Yizuc34Y.js.map → prism-csharp.min-DUwvItt4.js.map} +1 -1
- package/lib/prism-java.min-BtgBR4yd.js +35 -0
- package/lib/{prism-java.min-d5iT_mOd.js.map → prism-java.min-BtgBR4yd.js.map} +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-ruby.min-DeDXCp1r.js +38 -0
- package/lib/{prism-ruby.min-C7LwcKyz.js.map → prism-ruby.min-DeDXCp1r.js.map} +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js +34 -0
- package/lib/{prism-typescript.min-oSVeWCAd.js.map → prism-typescript.min-CD7H2IYQ.js.map} +1 -1
- package/lib/state-CFQsUZUP.js +202 -0
- package/lib/state-CFQsUZUP.js.map +1 -0
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/ActionButton.js +25 -0
- package/lib/ui/ActionButton.js.map +1 -0
- package/lib/ui/Alert.js +51 -0
- package/lib/ui/Alert.js.map +1 -0
- package/lib/ui/AlertDialog.js +114 -0
- package/lib/ui/AlertDialog.js.map +1 -0
- package/lib/ui/AspectRatio.js +6 -0
- package/lib/ui/AspectRatio.js.map +1 -0
- package/lib/ui/Badge.js +27 -0
- package/lib/ui/Badge.js.map +1 -0
- package/lib/ui/Breadcrumb.js +94 -0
- package/lib/ui/Breadcrumb.js.map +1 -0
- package/lib/ui/Button.js +49 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/Callout.js +77 -0
- package/lib/ui/Callout.js.map +1 -0
- package/lib/ui/Card.js +62 -0
- package/lib/ui/Card.js.map +1 -0
- package/lib/ui/Carousel.js +1416 -0
- package/lib/ui/Carousel.js.map +1 -0
- package/lib/ui/Checkbox.js +28 -0
- package/lib/ui/Checkbox.js.map +1 -0
- package/lib/ui/Collapsible.js +8 -0
- package/lib/ui/Collapsible.js.map +1 -0
- package/lib/ui/Command.js +553 -0
- package/lib/ui/Command.js.map +1 -0
- package/lib/ui/Dialog.js +101 -0
- package/lib/ui/Dialog.js.map +1 -0
- package/lib/ui/Drawer.js +1153 -0
- package/lib/ui/Drawer.js.map +1 -0
- package/lib/ui/DropdownMenu.js +145 -0
- package/lib/ui/DropdownMenu.js.map +1 -0
- package/lib/ui/Form.js +95 -0
- package/lib/ui/Form.js.map +1 -0
- package/lib/ui/HoverCard.js +24 -0
- package/lib/ui/HoverCard.js.map +1 -0
- package/lib/ui/Input.js +22 -0
- package/lib/ui/Input.js.map +1 -0
- package/lib/ui/Label.js +20 -0
- package/lib/ui/Label.js.map +1 -0
- package/lib/ui/Pagination.js +106 -0
- package/lib/ui/Pagination.js.map +1 -0
- package/lib/ui/Popover.js +24 -0
- package/lib/ui/Popover.js.map +1 -0
- package/lib/ui/Progress.js +27 -0
- package/lib/ui/Progress.js.map +1 -0
- package/lib/ui/RadioGroup.js +32 -0
- package/lib/ui/RadioGroup.js.map +1 -0
- package/lib/ui/ScrollArea.js +39 -0
- package/lib/ui/ScrollArea.js.map +1 -0
- package/lib/ui/Select.js +122 -0
- package/lib/ui/Select.js.map +1 -0
- package/lib/ui/Skeleton.js +18 -0
- package/lib/ui/Skeleton.js.map +1 -0
- package/lib/ui/Slider.js +24 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/Switch.js +28 -0
- package/lib/ui/Switch.js.map +1 -0
- package/lib/ui/Tabs.js +47 -0
- package/lib/ui/Tabs.js.map +1 -0
- package/lib/ui/Textarea.js +21 -0
- package/lib/ui/Textarea.js.map +1 -0
- package/lib/ui/Toggle.js +38 -0
- package/lib/ui/Toggle.js.map +1 -0
- package/lib/ui/ToggleGroup.js +42 -0
- package/lib/ui/ToggleGroup.js.map +1 -0
- package/lib/ui/Tooltip.js +24 -0
- package/lib/ui/Tooltip.js.map +1 -0
- package/lib/useExposedProps-DE9lR6MF.js +9 -0
- package/lib/useExposedProps-DE9lR6MF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +24 -18
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +620 -619
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1064 -3006
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16056
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +123 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +72 -78
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +22 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +94 -27
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -12
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +2 -2
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +53 -28
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +135 -87
- package/src/app/demo.tsx +1 -4
- package/src/app/entry.client.tsx +20 -3
- package/src/app/entry.server.tsx +63 -52
- package/src/app/main.css +5 -2
- package/src/app/main.tsx +24 -38
- package/src/app/sentry.ts +24 -0
- package/src/app/standalone.tsx +2 -5
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/AuthenticationPlugin.tsx +4 -1
- package/src/lib/authentication/authentication.ts +3 -3
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/components/SignIn.tsx +1 -1
- package/src/lib/authentication/components/SignOut.tsx +1 -1
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +17 -11
- package/src/lib/authentication/providers/openid.tsx +22 -33
- package/src/lib/authentication/state.ts +50 -9
- package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
- package/src/lib/authentication/use-broadcast/shared.ts +372 -0
- package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
- package/src/lib/components/AnchorLink.tsx +1 -1
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/Bootstrap.tsx +36 -16
- package/src/lib/components/ClientOnly.tsx +6 -3
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/ErrorPage.tsx +0 -2
- package/src/lib/components/Header.tsx +91 -46
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +56 -38
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +31 -26
- package/src/lib/components/NotFoundPage.tsx +1 -1
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +4 -4
- package/src/lib/components/SlotletProvider.tsx +29 -4
- package/src/lib/components/SyntaxHighlight.tsx +85 -50
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +78 -23
- package/src/lib/components/Zudoku.tsx +108 -0
- package/src/lib/components/context/ZudokuContext.ts +33 -30
- package/src/lib/components/context/ZudokuProvider.tsx +2 -2
- package/src/lib/components/index.ts +19 -7
- package/src/lib/components/navigation/Sidebar.tsx +22 -12
- package/src/lib/components/navigation/SidebarBadge.tsx +0 -10
- package/src/lib/components/navigation/SidebarCategory.tsx +39 -32
- package/src/lib/components/navigation/SidebarItem.tsx +24 -30
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/components/navigation/utils.ts +12 -17
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +7 -14
- package/src/lib/core/plugins.ts +19 -17
- package/src/lib/errors/ErrorAlert.tsx +20 -6
- package/src/lib/errors/RouterError.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +11 -16
- package/src/lib/oas/parser/upgrade/index.ts +3 -24
- package/src/lib/plugins/api-catalog/Catalog.tsx +123 -0
- package/src/lib/plugins/api-catalog/index.tsx +64 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +3 -3
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +1 -1
- package/src/lib/plugins/api-keys/index.tsx +13 -10
- package/src/lib/plugins/custom-pages/CustomPage.tsx +18 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +38 -10
- package/src/lib/plugins/markdown/index.tsx +53 -13
- package/src/lib/plugins/markdown/resolver.ts +90 -0
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
- package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
- package/src/lib/plugins/openapi/Endpoint.tsx +7 -12
- package/src/lib/plugins/openapi/OperationList.tsx +81 -45
- package/src/lib/plugins/openapi/OperationListItem.tsx +31 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
- package/src/lib/plugins/openapi/Route.tsx +42 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +75 -75
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +157 -0
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
- package/src/lib/plugins/openapi/client/createServer.ts +2 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +33 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/context.tsx +2 -2
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +12 -29
- package/src/lib/plugins/openapi/graphql/graphql.ts +236 -665
- package/src/lib/plugins/openapi/index.tsx +77 -97
- package/src/lib/plugins/openapi/interfaces.ts +22 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +5 -4
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -1
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
- package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
- package/src/lib/plugins/openapi/util/methodToColor.ts +27 -0
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
- package/src/lib/plugins/openapi-worker.ts +11 -1
- package/src/lib/plugins/redirect/index.tsx +6 -10
- package/src/lib/plugins/search-inkeep/index.tsx +80 -25
- package/src/lib/plugins/search-inkeep/inkeep.ts +3 -9
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/ActionButton.tsx +28 -0
- package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
- package/src/lib/ui/AlertDialog.tsx +139 -0
- package/src/lib/ui/AspectRatio.tsx +5 -0
- package/src/lib/ui/Badge.tsx +36 -0
- package/src/lib/ui/Breadcrumb.tsx +115 -0
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Carousel.tsx +260 -0
- package/src/lib/ui/Checkbox.tsx +28 -0
- package/src/lib/ui/Collapsible.tsx +9 -0
- package/src/lib/ui/Command.tsx +151 -0
- package/src/lib/{components → ui}/Dialog.tsx +4 -3
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/ui/Form.tsx +177 -0
- package/src/lib/ui/HoverCard.tsx +27 -0
- package/src/lib/ui/Label.tsx +24 -0
- package/src/lib/ui/Pagination.tsx +117 -0
- package/src/lib/ui/Popover.tsx +29 -0
- package/src/lib/ui/Progress.tsx +26 -0
- package/src/lib/ui/RadioGroup.tsx +42 -0
- package/src/lib/ui/ScrollArea.tsx +46 -0
- package/src/lib/ui/Skeleton.tsx +15 -0
- package/src/lib/ui/Slider.tsx +26 -0
- package/src/lib/ui/Switch.tsx +27 -0
- package/src/lib/ui/Textarea.tsx +23 -0
- package/src/lib/ui/Toggle.tsx +43 -0
- package/src/lib/ui/ToggleGroup.tsx +59 -0
- package/src/lib/ui/Tooltip.tsx +28 -0
- package/src/lib/util/MdxComponents.tsx +3 -9
- package/src/lib/util/createVariantComponent.tsx +2 -2
- package/src/lib/util/invariant.ts +15 -3
- package/src/lib/util/traverse.ts +25 -0
- package/src/lib/util/useExposedProps.tsx +16 -0
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -0
- package/src/lib/util/useScrollToAnchor.ts +2 -2
- package/src/lib/util/useScrollToTop.ts +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/DevPortal.js.map +0 -1
- package/dist/lib/components/Dialog.js.map +0 -1
- package/dist/lib/components/Select.js.map +0 -1
- package/dist/lib/components/context/ThemeContext.d.ts +0 -2
- package/dist/lib/components/context/ThemeContext.js +0 -7
- package/dist/lib/components/context/ThemeContext.js.map +0 -1
- package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
- package/dist/lib/components/context/ThemeProvider.js +0 -23
- package/dist/lib/components/context/ThemeProvider.js.map +0 -1
- package/dist/lib/core/DevPortalContext.js.map +0 -1
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
- package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
- package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
- package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.d.ts +0 -2
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js +0 -3
- package/dist/lib/plugins/search-inkeep/InkeepCustomTrigger.js.map +0 -1
- package/dist/lib/themeToggle.d.ts +0 -1
- package/dist/lib/themeToggle.js +0 -7
- package/dist/lib/themeToggle.js.map +0 -1
- package/dist/lib/ui/Note.d.ts +0 -8
- package/dist/lib/ui/Note.js +0 -23
- package/dist/lib/ui/Note.js.map +0 -1
- package/dist/lib/util/createWaitForNotify.d.ts +0 -1
- package/dist/lib/util/createWaitForNotify.js +0 -15
- package/dist/lib/util/createWaitForNotify.js.map +0 -1
- package/dist/vite/plugin-custom-css.js +0 -55
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/dist/vite/plugin-html-transform.d.ts +0 -2
- package/dist/vite/plugin-html-transform.js +0 -15
- package/dist/vite/plugin-html-transform.js.map +0 -1
- package/lib/AuthenticationPlugin-Bx9FK124.js.map +0 -1
- package/lib/CategoryHeading-ovR-zHRq.js +0 -10
- package/lib/DeveloperHint-YeWHKvyr.js +0 -16
- package/lib/DeveloperHint-YeWHKvyr.js.map +0 -1
- package/lib/ErrorPage-Dri5_2lr.js +0 -18
- package/lib/ErrorPage-Dri5_2lr.js.map +0 -1
- package/lib/InkeepCustomTrigger-CE5-K5ex.js +0 -6
- package/lib/InkeepCustomTrigger-CE5-K5ex.js.map +0 -1
- package/lib/Input-CtVUl3eT.js +0 -2198
- package/lib/Input-CtVUl3eT.js.map +0 -1
- package/lib/Markdown-DapSf3wG.js +0 -20281
- package/lib/Markdown-DapSf3wG.js.map +0 -1
- package/lib/MdxPage-BqBWsXZ1.js +0 -172
- package/lib/MdxPage-BqBWsXZ1.js.map +0 -1
- package/lib/OperationList-JAQF5-tn.js +0 -602
- package/lib/OperationList-JAQF5-tn.js.map +0 -1
- package/lib/Route-DSANUy5e.js +0 -14
- package/lib/Route-DSANUy5e.js.map +0 -1
- package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
- package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
- package/lib/SlotletProvider-D3UD5Go3.js +0 -238
- package/lib/SlotletProvider-D3UD5Go3.js.map +0 -1
- package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
- package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
- package/lib/index-BG0g4WW0.js +0 -1771
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-BngPzhKn.js +0 -124
- package/lib/index-BngPzhKn.js.map +0 -1
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-Dolisrci.js +0 -2814
- package/lib/index-Dolisrci.js.map +0 -1
- package/lib/index-DyJyULzS.js +0 -5816
- package/lib/index-DyJyULzS.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/jsx-runtime-B6kdoens.js +0 -635
- package/lib/jsx-runtime-B6kdoens.js.map +0 -1
- package/lib/prism-csharp.min-Yizuc34Y.js +0 -35
- package/lib/prism-java.min-d5iT_mOd.js +0 -7
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
- package/lib/prism-ruby.min-C7LwcKyz.js +0 -10
- package/lib/prism-typescript.min-oSVeWCAd.js +0 -6
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/state-hNe1dw4B.js +0 -548
- package/lib/state-hNe1dw4B.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-ByIc_KIM.js +0 -749
- package/lib/utils-ByIc_KIM.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/components/DevPortal.tsx +0 -111
- package/src/lib/components/context/ThemeContext.tsx +0 -8
- package/src/lib/components/context/ThemeProvider.tsx +0 -27
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -56
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -80
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
- package/src/lib/plugins/search-inkeep/InkeepCustomTrigger.tsx +0 -3
- package/src/lib/themeToggle.ts +0 -7
- package/src/lib/util/createWaitForNotify.ts +0 -18
- /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.js +0 -0
- /package/src/lib/{components → ui}/Select.tsx +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
1
2
|
import { HTTPSnippet } from "@zudoku/httpsnippet";
|
|
2
3
|
import { Fragment, useMemo, useTransition } from "react";
|
|
3
|
-
import { useSearchParams } from "react-router
|
|
4
|
+
import { useSearchParams } from "react-router";
|
|
4
5
|
import { useSelectedServerStore } from "../../authentication/state.js";
|
|
5
|
-
import { TextColorMap } from "../../components/navigation/SidebarBadge.js";
|
|
6
6
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
7
7
|
import type { SchemaObject } from "../../oas/parser/index.js";
|
|
8
8
|
import { cn } from "../../util/cn.js";
|
|
9
|
+
import { useOnScreen } from "../../util/useOnScreen.js";
|
|
10
|
+
import { useCreateQuery } from "./client/useCreateQuery.js";
|
|
11
|
+
import { CollapsibleCode } from "./CollapsibleCode.js";
|
|
9
12
|
import { ColorizedParam } from "./ColorizedParam.js";
|
|
10
13
|
import { useOasConfig } from "./context.js";
|
|
11
14
|
import { graphql } from "./graphql/index.js";
|
|
@@ -16,7 +19,7 @@ import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
|
|
|
16
19
|
import * as SidecarBox from "./SidecarBox.js";
|
|
17
20
|
import { SimpleSelect } from "./SimpleSelect.js";
|
|
18
21
|
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
19
|
-
import {
|
|
22
|
+
import { methodForColor } from "./util/methodToColor.js";
|
|
20
23
|
|
|
21
24
|
const getConverted = (snippet: HTTPSnippet, option: string) => {
|
|
22
25
|
let converted;
|
|
@@ -73,18 +76,19 @@ export const GetServerQuery = graphql(/* GraphQL */ `
|
|
|
73
76
|
}
|
|
74
77
|
`);
|
|
75
78
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
79
|
+
const EXAMPLE_LANGUAGES = [
|
|
80
|
+
{ value: "shell", label: "cURL" },
|
|
81
|
+
{ value: "js", label: "JavaScript" },
|
|
82
|
+
{ value: "python", label: "Python" },
|
|
83
|
+
{ value: "java", label: "Java" },
|
|
84
|
+
{ value: "go", label: "Go" },
|
|
85
|
+
{ value: "csharp", label: "C#" },
|
|
86
|
+
{ value: "kotlin", label: "Kotlin" },
|
|
87
|
+
{ value: "objc", label: "Objective-C" },
|
|
88
|
+
{ value: "php", label: "PHP" },
|
|
89
|
+
{ value: "ruby", label: "Ruby" },
|
|
90
|
+
{ value: "swift", label: "Swift" },
|
|
91
|
+
];
|
|
88
92
|
|
|
89
93
|
export const Sidecar = ({
|
|
90
94
|
operation,
|
|
@@ -95,16 +99,11 @@ export const Sidecar = ({
|
|
|
95
99
|
selectedResponse?: string;
|
|
96
100
|
onSelectResponse: (response: string) => void;
|
|
97
101
|
}) => {
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
const methodTextColor =
|
|
105
|
-
methodToColor[
|
|
106
|
-
operation.method.toLocaleLowerCase() as keyof typeof methodToColor
|
|
107
|
-
] ?? TextColorMap.gray;
|
|
102
|
+
const { input, type } = useOasConfig();
|
|
103
|
+
const query = useCreateQuery(GetServerQuery, { input, type });
|
|
104
|
+
const result = useSuspenseQuery(query);
|
|
105
|
+
|
|
106
|
+
const methodTextColor = methodForColor(operation.method);
|
|
108
107
|
|
|
109
108
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
110
109
|
const [, startTransition] = useTransition();
|
|
@@ -149,7 +148,7 @@ export const Sidecar = ({
|
|
|
149
148
|
const snippet = new HTTPSnippet({
|
|
150
149
|
method: operation.method.toLocaleUpperCase(),
|
|
151
150
|
url:
|
|
152
|
-
(selectedServer ?? result.data
|
|
151
|
+
(selectedServer ?? result.data.schema.url ?? "") +
|
|
153
152
|
operation.path.replaceAll("{", ":").replaceAll("}", ""),
|
|
154
153
|
postData: example
|
|
155
154
|
? {
|
|
@@ -167,15 +166,20 @@ export const Sidecar = ({
|
|
|
167
166
|
|
|
168
167
|
return getConverted(snippet, selectedLang);
|
|
169
168
|
}, [
|
|
170
|
-
|
|
171
|
-
selectedLang,
|
|
169
|
+
requestBodyContent,
|
|
172
170
|
operation.method,
|
|
173
171
|
operation.path,
|
|
174
|
-
|
|
172
|
+
selectedServer,
|
|
173
|
+
result.data.schema.url,
|
|
174
|
+
selectedLang,
|
|
175
175
|
]);
|
|
176
|
+
const [ref, isOnScreen] = useOnScreen({ rootMargin: "200px 0px 200px 0px" });
|
|
176
177
|
|
|
177
178
|
return (
|
|
178
|
-
<aside
|
|
179
|
+
<aside
|
|
180
|
+
ref={ref}
|
|
181
|
+
className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4"
|
|
182
|
+
>
|
|
179
183
|
<SidecarBox.Root>
|
|
180
184
|
<SidecarBox.Head className="flex justify-between items-center flex-nowrap py-3 gap-2 text-xs">
|
|
181
185
|
<span className="font-mono break-words">
|
|
@@ -185,55 +189,51 @@ export const Sidecar = ({
|
|
|
185
189
|
|
|
186
190
|
{path}
|
|
187
191
|
</span>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
{isOnScreen && (
|
|
193
|
+
<PlaygroundDialogWrapper
|
|
194
|
+
server={result.data.schema.url ?? ""}
|
|
195
|
+
servers={
|
|
196
|
+
result.data.schema.servers.map((server) => server.url) ?? []
|
|
197
|
+
}
|
|
198
|
+
operation={operation}
|
|
199
|
+
/>
|
|
200
|
+
)}
|
|
195
201
|
</SidecarBox.Head>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
{ value: "php", label: "PHP" },
|
|
227
|
-
{ value: "ruby", label: "Ruby" },
|
|
228
|
-
{ value: "swift", label: "Swift" },
|
|
229
|
-
]}
|
|
230
|
-
/>
|
|
231
|
-
</SidecarBox.Footer>
|
|
202
|
+
{isOnScreen && (
|
|
203
|
+
<>
|
|
204
|
+
<SidecarBox.Body className="p-0">
|
|
205
|
+
<CollapsibleCode>
|
|
206
|
+
<SyntaxHighlight
|
|
207
|
+
language={selectedLang}
|
|
208
|
+
noBackground
|
|
209
|
+
className="[--scrollbar-color:gray] text-xs max-h-[500px] p-2"
|
|
210
|
+
code={code!}
|
|
211
|
+
/>
|
|
212
|
+
</CollapsibleCode>
|
|
213
|
+
</SidecarBox.Body>
|
|
214
|
+
<SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
|
|
215
|
+
<span>Show example in</span>
|
|
216
|
+
<SimpleSelect
|
|
217
|
+
className="self-start max-w-[150px]"
|
|
218
|
+
value={selectedLang}
|
|
219
|
+
onChange={(e) => {
|
|
220
|
+
startTransition(() => {
|
|
221
|
+
setSearchParams((prev) => {
|
|
222
|
+
prev.set("lang", e.target.value);
|
|
223
|
+
return prev;
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
}}
|
|
227
|
+
options={EXAMPLE_LANGUAGES}
|
|
228
|
+
/>
|
|
229
|
+
</SidecarBox.Footer>
|
|
230
|
+
</>
|
|
231
|
+
)}
|
|
232
232
|
</SidecarBox.Root>
|
|
233
|
-
{requestBodyContent && (
|
|
233
|
+
{isOnScreen && requestBodyContent && (
|
|
234
234
|
<RequestBodySidecarBox content={requestBodyContent} />
|
|
235
235
|
)}
|
|
236
|
-
{operation.responses.length > 0 && (
|
|
236
|
+
{isOnScreen && operation.responses.length > 0 && (
|
|
237
237
|
<ResponsesSidecarBox
|
|
238
238
|
selectedResponse={selectedResponse}
|
|
239
239
|
onSelectResponse={onSelectResponse}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { GraphQLError } from "graphql/error/index.js";
|
|
2
|
+
import { ulid } from "ulidx";
|
|
3
|
+
import { initializeWorker } from "zudoku/openapi-worker";
|
|
4
|
+
import { ZudokuError } from "../../../util/invariant.js";
|
|
5
|
+
import type { TypedDocumentString } from "../graphql/graphql.js";
|
|
6
|
+
import type { OpenApiPluginOptions } from "../index.js";
|
|
7
|
+
import type { LocalServer } from "./createServer.js";
|
|
8
|
+
import type { WorkerGraphQLMessage } from "./worker.js";
|
|
9
|
+
|
|
10
|
+
let localServerPromise: Promise<LocalServer> | undefined;
|
|
11
|
+
let worker: SharedWorker | undefined;
|
|
12
|
+
|
|
13
|
+
type GraphQLResponse<TResult> = {
|
|
14
|
+
errors?: GraphQLError[];
|
|
15
|
+
data: TResult;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const resolveVariables = async (variables?: unknown) => {
|
|
19
|
+
if (!variables) return;
|
|
20
|
+
|
|
21
|
+
if (
|
|
22
|
+
typeof variables === "object" &&
|
|
23
|
+
"type" in variables &&
|
|
24
|
+
variables.type === "file" &&
|
|
25
|
+
"input" in variables &&
|
|
26
|
+
typeof variables.input === "function"
|
|
27
|
+
) {
|
|
28
|
+
variables.input = await variables.input();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const throwIfError = (response: GraphQLResponse<unknown>) => {
|
|
33
|
+
if (!response.errors?.[0]) return;
|
|
34
|
+
|
|
35
|
+
throw new ZudokuError(response.errors[0].message, {
|
|
36
|
+
developerHint:
|
|
37
|
+
"Check your configuration value `apis.type` and `apis.input` in the Zudoku config.",
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export class GraphQLClient {
|
|
42
|
+
readonly #mode: "remote" | "in-memory" | "worker";
|
|
43
|
+
#pendingRequests = new Map<string, (value: any) => void>();
|
|
44
|
+
#port: MessagePort | undefined;
|
|
45
|
+
|
|
46
|
+
constructor(private config: OpenApiPluginOptions) {
|
|
47
|
+
if (config.server) {
|
|
48
|
+
this.#mode = "remote";
|
|
49
|
+
} else if (config.inMemory || typeof SharedWorker === "undefined") {
|
|
50
|
+
this.#mode = "in-memory";
|
|
51
|
+
} else {
|
|
52
|
+
this.#mode = "worker";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#initializeLocalServer = () =>
|
|
57
|
+
import("./createServer.js").then((m) => m.createServer());
|
|
58
|
+
|
|
59
|
+
fetch = async <TResult, TVariables>(
|
|
60
|
+
query: TypedDocumentString<TResult, TVariables>,
|
|
61
|
+
...[variables]: TVariables extends Record<string, never> ? [] : [TVariables]
|
|
62
|
+
) => {
|
|
63
|
+
const operationName = query.match(/query (\w+)/)?.[1];
|
|
64
|
+
|
|
65
|
+
await resolveVariables(variables);
|
|
66
|
+
|
|
67
|
+
const body = JSON.stringify({ query, variables, operationName });
|
|
68
|
+
|
|
69
|
+
switch (this.#mode) {
|
|
70
|
+
case "remote": {
|
|
71
|
+
const response = await fetch(this.config.server!, {
|
|
72
|
+
method: "POST",
|
|
73
|
+
body,
|
|
74
|
+
headers: { "Content-Type": "application/json" },
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (!response.ok) {
|
|
78
|
+
throw new Error("Network response was not ok");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const result = (await response.json()) as GraphQLResponse<TResult>;
|
|
82
|
+
throwIfError(result);
|
|
83
|
+
|
|
84
|
+
return result.data;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
case "in-memory": {
|
|
88
|
+
if (!localServerPromise) {
|
|
89
|
+
localServerPromise = this.#initializeLocalServer();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const localServer = await localServerPromise;
|
|
93
|
+
if (!localServer) throw new Error("Local server not initialized");
|
|
94
|
+
|
|
95
|
+
const response = await localServer.fetch(
|
|
96
|
+
new Request("http://localhost/graphql", {
|
|
97
|
+
method: "POST",
|
|
98
|
+
body,
|
|
99
|
+
headers: { "Content-Type": "application/json" },
|
|
100
|
+
}),
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw new Error("Network response was not ok");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const result = (await response.json()) as GraphQLResponse<TResult>;
|
|
108
|
+
throwIfError(result);
|
|
109
|
+
|
|
110
|
+
return result.data;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
case "worker": {
|
|
114
|
+
if (!worker) {
|
|
115
|
+
worker = initializeWorker();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!this.#port) {
|
|
119
|
+
const channel = new MessageChannel();
|
|
120
|
+
|
|
121
|
+
worker.port.postMessage({ port: channel.port2 }, [channel.port2]);
|
|
122
|
+
|
|
123
|
+
this.#port = channel.port1;
|
|
124
|
+
|
|
125
|
+
this.#port.onmessage = (e: MessageEvent<WorkerGraphQLMessage>) => {
|
|
126
|
+
const { id, body } = e.data;
|
|
127
|
+
const resolve = this.#pendingRequests.get(id);
|
|
128
|
+
if (resolve) {
|
|
129
|
+
const result = JSON.parse(body);
|
|
130
|
+
resolve(result);
|
|
131
|
+
this.#pendingRequests.delete(id);
|
|
132
|
+
} else {
|
|
133
|
+
// eslint-disable-next-line no-console
|
|
134
|
+
console.error(`No pending request found for id: ${id}`);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
this.#port.start();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const id = ulid();
|
|
142
|
+
|
|
143
|
+
const resultPromise = new Promise<GraphQLResponse<TResult>>(
|
|
144
|
+
(resolve) => {
|
|
145
|
+
this.#pendingRequests.set(id, resolve);
|
|
146
|
+
this.#port!.postMessage({ id, body } as WorkerGraphQLMessage);
|
|
147
|
+
},
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
const result = await resultPromise;
|
|
151
|
+
throwIfError(result);
|
|
152
|
+
|
|
153
|
+
return result.data;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, type ReactNode } from "react";
|
|
2
|
+
import { GraphQLClient } from "./GraphQLClient.js";
|
|
3
|
+
|
|
4
|
+
export const GraphQLContext = createContext<GraphQLClient | undefined>(
|
|
5
|
+
undefined,
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const GraphQLProvider = ({
|
|
9
|
+
children,
|
|
10
|
+
client,
|
|
11
|
+
}: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
client: GraphQLClient;
|
|
14
|
+
}) => (
|
|
15
|
+
<GraphQLContext.Provider value={client}>{children}</GraphQLContext.Provider>
|
|
16
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import hashit from "object-hash";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import type { TypedDocumentString } from "../graphql/graphql.js";
|
|
4
|
+
import { GraphQLContext } from "./GraphQLContext.js";
|
|
5
|
+
|
|
6
|
+
export const useCreateQuery = <TResult, TVariables>(
|
|
7
|
+
query: TypedDocumentString<TResult, TVariables>,
|
|
8
|
+
...variables: TVariables extends Record<string, never> ? [] : [TVariables]
|
|
9
|
+
) => {
|
|
10
|
+
const graphQLClient = useContext(GraphQLContext);
|
|
11
|
+
if (graphQLClient === undefined) {
|
|
12
|
+
throw new Error("useGraphQL must be used within a GraphQLProvider");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const hash = useMemo(() => {
|
|
16
|
+
if (
|
|
17
|
+
typeof variables[0] === "object" &&
|
|
18
|
+
variables[0] != null &&
|
|
19
|
+
"input" in variables[0] &&
|
|
20
|
+
typeof variables[0].input === "function"
|
|
21
|
+
) {
|
|
22
|
+
// This is a pre-hashed name to ensure that the query key is consistent across server and client
|
|
23
|
+
return variables[0].input.name;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return hashit(variables[0] ?? {});
|
|
27
|
+
}, [variables]);
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
queryFn: () => graphQLClient.fetch(query, ...variables),
|
|
31
|
+
queryKey: [query, hash],
|
|
32
|
+
} as const;
|
|
33
|
+
};
|
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
import { createServer } from "./createServer.js";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
export type WorkerGraphQLMessage = { id: string; body: string };
|
|
3
4
|
|
|
4
5
|
const localServer = createServer();
|
|
5
6
|
|
|
6
7
|
const worker = self as unknown as SharedWorkerGlobalScope;
|
|
7
8
|
|
|
8
|
-
worker.addEventListener(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
9
|
+
worker.addEventListener("connect", (event) => {
|
|
10
|
+
const mainPort = event.ports[0];
|
|
11
|
+
|
|
12
|
+
mainPort!.onmessage = (e) => {
|
|
13
|
+
if (e.data.port) {
|
|
14
|
+
const clientPort = e.data.port as MessagePort;
|
|
15
|
+
|
|
16
|
+
clientPort.onmessage = async (
|
|
17
|
+
event: MessageEvent<{ id: string; body: string }>,
|
|
18
|
+
) => {
|
|
19
|
+
const { id, body } = event.data;
|
|
20
|
+
|
|
21
|
+
const response = await localServer.fetch(
|
|
22
|
+
new Request("/__z/graphql", {
|
|
23
|
+
method: "POST",
|
|
24
|
+
body,
|
|
25
|
+
headers: {
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
},
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const responseBody = await response.text();
|
|
32
|
+
|
|
33
|
+
clientPort.postMessage({
|
|
34
|
+
id,
|
|
35
|
+
body: responseBody,
|
|
36
|
+
} as WorkerGraphQLMessage);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
clientPort.start();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
mainPort!.start();
|
|
44
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext, useContext } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { type OasPluginContext } from "./interfaces.js";
|
|
3
3
|
|
|
4
|
-
const OasContext = createContext<{ config:
|
|
4
|
+
const OasContext = createContext<{ config: OasPluginContext } | undefined>(
|
|
5
5
|
undefined,
|
|
6
6
|
);
|
|
7
7
|
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
import type {
|
|
3
3
|
DocumentTypeDecoration,
|
|
4
4
|
ResultOf,
|
|
5
|
-
TypedDocumentNode,
|
|
6
5
|
} from "@graphql-typed-document-node/core";
|
|
7
|
-
import type {
|
|
8
|
-
import type { Incremental } from "./graphql.js";
|
|
6
|
+
import type { Incremental, TypedDocumentString } from "./graphql.js";
|
|
9
7
|
|
|
10
8
|
export type FragmentType<
|
|
11
9
|
TDocumentType extends DocumentTypeDecoration<any, any>,
|
|
@@ -86,26 +84,21 @@ export function makeFragmentData<
|
|
|
86
84
|
return data as FragmentType<F>;
|
|
87
85
|
}
|
|
88
86
|
export function isFragmentReady<TQuery, TFrag>(
|
|
89
|
-
queryNode:
|
|
90
|
-
fragmentNode:
|
|
87
|
+
queryNode: TypedDocumentString<TQuery, any>,
|
|
88
|
+
fragmentNode: TypedDocumentString<TFrag, any>,
|
|
91
89
|
data:
|
|
92
|
-
| FragmentType<
|
|
90
|
+
| FragmentType<TypedDocumentString<Incremental<TFrag>, any>>
|
|
93
91
|
| null
|
|
94
92
|
| undefined,
|
|
95
93
|
): data is FragmentType<typeof fragmentNode> {
|
|
96
|
-
const deferredFields =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
const deferredFields = queryNode.__meta__?.deferredFields as Record<
|
|
95
|
+
string,
|
|
96
|
+
(keyof TFrag)[]
|
|
97
|
+
>;
|
|
98
|
+
const fragName = fragmentNode.__meta__?.fragmentName as string | undefined;
|
|
101
99
|
|
|
102
|
-
if (!deferredFields) return true;
|
|
100
|
+
if (!deferredFields || !fragName) return true;
|
|
103
101
|
|
|
104
|
-
const
|
|
105
|
-
| FragmentDefinitionNode
|
|
106
|
-
| undefined;
|
|
107
|
-
const fragName = fragDef?.name?.value;
|
|
108
|
-
|
|
109
|
-
const fields = (fragName && deferredFields[fragName]) || [];
|
|
102
|
+
const fields = deferredFields[fragName] ?? [];
|
|
110
103
|
return fields.length > 0 && fields.every((field) => data && field in data);
|
|
111
104
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
|
|
3
2
|
import * as types from "./graphql.js";
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -11,68 +10,52 @@ import * as types from "./graphql.js";
|
|
|
11
10
|
* 3. It does not support dead code elimination, so it will add unused operations.
|
|
12
11
|
*
|
|
13
12
|
* Therefore it is highly recommended to use the babel or swc plugin for production.
|
|
13
|
+
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
14
14
|
*/
|
|
15
15
|
const documents = {
|
|
16
16
|
"\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
|
|
17
17
|
types.ServersQueryDocument,
|
|
18
|
-
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
|
|
18
|
+
"\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n":
|
|
19
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":
|
|
20
|
+
"\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
|
|
21
21
|
types.AllOperationsDocument,
|
|
22
22
|
"\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
|
|
23
23
|
types.GetServerQueryDocument,
|
|
24
|
-
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
|
|
24
|
+
"\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
|
|
25
25
|
types.GetCategoriesDocument,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* The query argument is unknown!
|
|
38
|
-
* Please regenerate the types.
|
|
39
|
-
*/
|
|
40
|
-
export function graphql(source: string): unknown;
|
|
41
|
-
|
|
42
28
|
/**
|
|
43
29
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
44
30
|
*/
|
|
45
31
|
export function graphql(
|
|
46
32
|
source: "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
|
|
47
|
-
):
|
|
33
|
+
): typeof import("./graphql.js").ServersQueryDocument;
|
|
48
34
|
/**
|
|
49
35
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
50
36
|
*/
|
|
51
37
|
export function graphql(
|
|
52
|
-
source: "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n",
|
|
53
|
-
):
|
|
38
|
+
source: "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n",
|
|
39
|
+
): typeof import("./graphql.js").OperationsFragmentFragmentDoc;
|
|
54
40
|
/**
|
|
55
41
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
56
42
|
*/
|
|
57
43
|
export function graphql(
|
|
58
|
-
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",
|
|
59
|
-
):
|
|
44
|
+
source: "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n summary\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n",
|
|
45
|
+
): typeof import("./graphql.js").AllOperationsDocument;
|
|
60
46
|
/**
|
|
61
47
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
62
48
|
*/
|
|
63
49
|
export function graphql(
|
|
64
50
|
source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
|
|
65
|
-
):
|
|
51
|
+
): typeof import("./graphql.js").GetServerQueryDocument;
|
|
66
52
|
/**
|
|
67
53
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
68
54
|
*/
|
|
69
55
|
export function graphql(
|
|
70
|
-
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
|
|
71
|
-
):
|
|
56
|
+
source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
|
|
57
|
+
): typeof import("./graphql.js").GetCategoriesDocument;
|
|
72
58
|
|
|
73
59
|
export function graphql(source: string) {
|
|
74
60
|
return (documents as any)[source] ?? {};
|
|
75
61
|
}
|
|
76
|
-
|
|
77
|
-
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
|
|
78
|
-
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|