zudoku 0.0.0-f417aae → 0.0.0-f49e3ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +2 -2
- package/dist/app/demo.js +0 -2
- package/dist/app/demo.js.map +1 -1
- package/dist/app/entry.client.js +16 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +9 -6
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +2 -1
- package/dist/app/main.js +9 -24
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js +0 -2
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/cli.js +1 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.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/validators/InputSidebarSchema.d.ts +12 -12
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +76 -39
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +335 -259
- package/dist/config/validators/validate.js +13 -11
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +2 -2
- 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 +0 -1
- package/dist/lib/authentication/providers/openid.js +11 -26
- 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/Bootstrap.d.ts +3 -1
- package/dist/lib/components/Bootstrap.js +11 -3
- 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/Header.js +10 -7
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +6 -3
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +6 -7
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +2 -1
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +19 -12
- 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 +2 -0
- package/dist/lib/components/TopNavigation.js +36 -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} +13 -14
- package/dist/lib/components/Zudoku.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.d.ts +10 -16
- 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 +18 -10
- package/dist/lib/components/index.js +2 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +2 -4
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -3
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +10 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +6 -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 +13 -12
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +4 -4
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.js +3 -1
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +9 -9
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.js +2 -2
- package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +6 -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 +21 -22
- package/dist/lib/plugins/openapi/OperationList.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 +4 -4
- package/dist/lib/plugins/openapi/Route.js +2 -4
- 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 +35 -33
- 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 +102 -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 +13 -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/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 +4 -2
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +32 -8
- package/dist/lib/plugins/openapi/graphql/graphql.js +194 -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 +40 -53
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
- 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/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-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 +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
- package/dist/lib/plugins/search-inkeep/index.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/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/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 +1 -1
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/useExposedProps.js +3 -2
- package/dist/lib/util/useExposedProps.js.map +1 -1
- 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.map +1 -1
- package/dist/vite/build.js +12 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -8
- package/dist/vite/config.js +24 -60
- package/dist/vite/config.js.map +1 -1
- 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/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 +33 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-component.js +17 -7
- package/dist/vite/plugin-component.js.map +1 -1
- 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 +2 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +37 -26
- package/dist/vite/plugin-docs.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 +3 -2
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +2 -4
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -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/lib/{utils-G5XSiZc9.js → AnchorLink-CDlhr8gL.js} +232 -275
- package/lib/AnchorLink-CDlhr8gL.js.map +1 -0
- package/lib/{AuthenticationPlugin-tBvLKsFg.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
- package/lib/{AuthenticationPlugin-tBvLKsFg.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
- package/lib/Button-jK0EsymC.js +48 -0
- package/lib/Button-jK0EsymC.js.map +1 -0
- package/lib/{CategoryHeading-D2WS6sRI.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-D2WS6sRI.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
- package/lib/ClientOnly-E7hGysn1.js.map +1 -0
- package/lib/Dialog-k70Qfukb.js +67 -0
- package/lib/Dialog-k70Qfukb.js.map +1 -0
- package/lib/Markdown-ievDDhFT.js +15192 -0
- package/lib/Markdown-ievDDhFT.js.map +1 -0
- package/lib/{MdxPage-tWI_P8wP.js → MdxPage-Bwn-VSsH.js} +32 -30
- package/lib/{MdxPage-tWI_P8wP.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
- package/lib/OperationList-BwBl1xrD.js +4691 -0
- package/lib/OperationList-BwBl1xrD.js.map +1 -0
- package/lib/Route-DlG_HTMu.js +11 -0
- package/lib/Route-DlG_HTMu.js.map +1 -0
- package/lib/Select-O9ZM3ZgX.js +223 -0
- package/lib/Select-O9ZM3ZgX.js.map +1 -0
- package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
- package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
- package/lib/SlotletProvider-DyomlzGx.js +252 -0
- package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
- package/lib/Spinner-3cQDBVGr.js +7 -0
- package/lib/Spinner-3cQDBVGr.js.map +1 -0
- package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
- package/lib/SyntaxHighlight-DkLOsjHS.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/assets/{worker-Bf8vjASY.js → worker-CPsGZsve.js} +565 -561
- package/lib/assets/{worker-Bf8vjASY.js.map → worker-CPsGZsve.js.map} +1 -1
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/context-D1nXWxm7.js +22 -0
- package/lib/context-D1nXWxm7.js.map +1 -0
- package/lib/createServer-DK-g7kbB.js +16089 -0
- package/lib/createServer-DK-g7kbB.js.map +1 -0
- package/lib/hook-hEqe7fPB.js +227 -0
- package/lib/hook-hEqe7fPB.js.map +1 -0
- package/lib/index-BuAyrJe3.js +46 -0
- package/lib/index-BuAyrJe3.js.map +1 -0
- package/lib/index-Czzd9rjU.js +899 -0
- package/lib/index-Czzd9rjU.js.map +1 -0
- package/lib/index-DNxQ_rCt.js +1273 -0
- package/lib/index-DNxQ_rCt.js.map +1 -0
- package/lib/index-Yn8c3UWE.js +921 -0
- package/lib/index-Yn8c3UWE.js.map +1 -0
- package/lib/index.esm-C5mr_sKO.js +1193 -0
- package/lib/index.esm-C5mr_sKO.js.map +1 -0
- package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
- package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
- package/lib/state-tsXBLONe.js +203 -0
- package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
- 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 +1410 -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 +550 -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-CTPtylCV.js +10 -0
- package/lib/useExposedProps-CTPtylCV.js.map +1 -0
- package/lib/{ZudokuContext-DEoP3GGJ.js → utils-DcpDOncX.js} +455 -410
- package/lib/utils-DcpDOncX.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-openid.js +124 -138
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1128 -2987
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +10 -16336
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +24 -21
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +9 -8
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +93 -27
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -10
- 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 +1 -1
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +43 -11
- package/src/app/demo.tsx +0 -3
- package/src/app/entry.client.tsx +18 -2
- package/src/app/entry.server.tsx +60 -50
- package/src/app/main.css +5 -1
- package/src/app/main.tsx +14 -30
- package/src/app/standalone.tsx +1 -4
- package/src/lib/authentication/authentication.ts +2 -2
- package/src/lib/authentication/hook.ts +1 -3
- package/src/lib/authentication/providers/auth0.tsx +17 -11
- package/src/lib/authentication/providers/openid.tsx +12 -30
- 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/Bootstrap.tsx +36 -9
- package/src/lib/components/ClientOnly.tsx +6 -3
- package/src/lib/components/DeveloperHint.tsx +6 -1
- package/src/lib/components/Header.tsx +50 -40
- package/src/lib/components/Layout.tsx +43 -36
- package/src/lib/components/MobileTopNavigation.tsx +15 -18
- package/src/lib/components/SlotletProvider.tsx +2 -0
- package/src/lib/components/SyntaxHighlight.tsx +85 -46
- package/src/lib/components/ThemeSwitch.tsx +26 -0
- package/src/lib/components/TopNavigation.tsx +66 -24
- 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 +2 -3
- package/src/lib/components/navigation/Sidebar.tsx +5 -5
- package/src/lib/components/navigation/SidebarCategory.tsx +2 -4
- package/src/lib/components/navigation/SidebarItem.tsx +1 -3
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +6 -18
- package/src/lib/core/plugins.ts +14 -16
- package/src/lib/errors/ErrorAlert.tsx +2 -1
- package/src/lib/oas/graphql/index.ts +4 -4
- package/src/lib/oas/parser/upgrade/index.ts +3 -1
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/index.tsx +9 -9
- package/src/lib/plugins/custom-pages/CustomPage.tsx +2 -2
- package/src/lib/plugins/custom-pages/index.tsx +2 -2
- package/src/lib/plugins/markdown/index.tsx +50 -13
- package/src/lib/plugins/markdown/resolver.ts +92 -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 +20 -40
- 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 +11 -12
- package/src/lib/plugins/openapi/Sidecar.tsx +73 -59
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -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 +18 -0
- package/src/lib/plugins/openapi/client/worker.ts +38 -24
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
- package/src/lib/plugins/openapi/graphql/gql.ts +10 -27
- package/src/lib/plugins/openapi/graphql/graphql.ts +233 -665
- package/src/lib/plugins/openapi/index.tsx +42 -67
- package/src/lib/plugins/openapi/playground/Playground.tsx +3 -3
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- 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-worker.ts +11 -1
- package/src/lib/plugins/redirect/index.tsx +5 -9
- package/src/lib/plugins/search-inkeep/index.tsx +2 -2
- 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/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/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 +0 -1
- package/src/lib/util/useExposedProps.tsx +8 -2
- package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
- package/src/lib/util/useOnScreen.ts +32 -0
- package/src/lib/util/useScrollToAnchor.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/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/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-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/ClientOnly-CVN6leDu.js.map +0 -1
- package/lib/DeveloperHint-CRiZjqd2.js +0 -16
- package/lib/DeveloperHint-CRiZjqd2.js.map +0 -1
- package/lib/Input-CO-1DOZa.js +0 -2229
- package/lib/Input-CO-1DOZa.js.map +0 -1
- package/lib/Markdown-DM4zv3MA.js +0 -20442
- package/lib/Markdown-DM4zv3MA.js.map +0 -1
- package/lib/OperationList-Cd3lue0b.js +0 -600
- package/lib/OperationList-Cd3lue0b.js.map +0 -1
- package/lib/Route-DI0Y0pIV.js +0 -13
- package/lib/Route-DI0Y0pIV.js.map +0 -1
- package/lib/SlotletProvider-CBqY8mp6.js +0 -241
- package/lib/SlotletProvider-CBqY8mp6.js.map +0 -1
- package/lib/Spinner-DFQhPMBl.js +0 -505
- package/lib/Spinner-DFQhPMBl.js.map +0 -1
- package/lib/ZudokuContext-DEoP3GGJ.js.map +0 -1
- package/lib/index-Bs9roz8y.js +0 -5973
- package/lib/index-Bs9roz8y.js.map +0 -1
- package/lib/index-CBr6BM_4.js +0 -2867
- package/lib/index-CBr6BM_4.js.map +0 -1
- package/lib/index-CRo94sKK.js +0 -1783
- package/lib/index-CRo94sKK.js.map +0 -1
- package/lib/index-UUT9q9f9.js +0 -124
- package/lib/index-UUT9q9f9.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/state-CsuHT8ZO.js +0 -183
- package/lib/urql-core-KJnLL26g.js +0 -1455
- package/lib/urql-core-KJnLL26g.js.map +0 -1
- package/lib/useExposedProps-B9K-9GTc.js +0 -9
- package/lib/useExposedProps-B9K-9GTc.js.map +0 -1
- package/lib/utils-G5XSiZc9.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/markdown/generateRoutes.tsx +0 -38
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -51
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -75
- package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-f49e3ea",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -27,12 +27,17 @@
|
|
|
27
27
|
"import": "./dist/index.js",
|
|
28
28
|
"types": "./dist/index.d.ts"
|
|
29
29
|
},
|
|
30
|
+
"./ui/*": {
|
|
31
|
+
"import": "./lib/ui/*.js",
|
|
32
|
+
"types": "./dist/lib/ui/*.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./ui/*.js": {
|
|
35
|
+
"import": "./lib/ui/*.js",
|
|
36
|
+
"types": "./dist/lib/ui/*.d.ts"
|
|
37
|
+
},
|
|
30
38
|
"./client": {
|
|
31
39
|
"types": "./client.d.ts"
|
|
32
40
|
},
|
|
33
|
-
"./internal": {
|
|
34
|
-
"import": "./dist/internal.js"
|
|
35
|
-
},
|
|
36
41
|
"./auth/clerk": {
|
|
37
42
|
"import": "./lib/zudoku.auth-clerk.js",
|
|
38
43
|
"types": "./dist/lib/authentication/providers/clerk.d.ts"
|
|
@@ -101,32 +106,52 @@
|
|
|
101
106
|
"@envelop/core": "5.0.2",
|
|
102
107
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
103
108
|
"@hiogawa/vite-plugin-ssr-css": "0.0.1",
|
|
109
|
+
"@hookform/resolvers": "3.9.1",
|
|
104
110
|
"@lekoarts/rehype-meta-as-attributes": "3.0.1",
|
|
105
111
|
"@mdx-js/react": "3.0.1",
|
|
106
112
|
"@mdx-js/rollup": "3.0.1",
|
|
107
113
|
"@pothos/core": "3.41.0",
|
|
114
|
+
"@radix-ui/react-accordion": "1.2.1",
|
|
115
|
+
"@radix-ui/react-alert-dialog": "1.1.2",
|
|
116
|
+
"@radix-ui/react-aspect-ratio": "1.1.0",
|
|
117
|
+
"@radix-ui/react-checkbox": "1.1.2",
|
|
108
118
|
"@radix-ui/react-collapsible": "1.1.1",
|
|
109
119
|
"@radix-ui/react-dialog": "1.1.2",
|
|
110
120
|
"@radix-ui/react-dropdown-menu": "2.1.2",
|
|
121
|
+
"@radix-ui/react-hover-card": "1.1.2",
|
|
122
|
+
"@radix-ui/react-label": "2.1.0",
|
|
123
|
+
"@radix-ui/react-popover": "1.1.2",
|
|
124
|
+
"@radix-ui/react-progress": "1.1.0",
|
|
125
|
+
"@radix-ui/react-radio-group": "1.2.1",
|
|
126
|
+
"@radix-ui/react-scroll-area": "1.2.1",
|
|
111
127
|
"@radix-ui/react-select": "2.1.2",
|
|
128
|
+
"@radix-ui/react-slider": "1.2.1",
|
|
112
129
|
"@radix-ui/react-slot": "1.1.0",
|
|
130
|
+
"@radix-ui/react-switch": "1.1.1",
|
|
113
131
|
"@radix-ui/react-tabs": "1.1.1",
|
|
132
|
+
"@radix-ui/react-toggle": "1.1.0",
|
|
133
|
+
"@radix-ui/react-toggle-group": "1.1.0",
|
|
134
|
+
"@radix-ui/react-tooltip": "1.1.3",
|
|
114
135
|
"@radix-ui/react-visually-hidden": "1",
|
|
115
136
|
"@sentry/node": "8.34.0",
|
|
116
137
|
"@sindresorhus/slugify": "2.2.1",
|
|
117
138
|
"@stefanprobst/rehype-extract-toc": "2.2.0",
|
|
118
139
|
"@tailwindcss/typography": "0.5.15",
|
|
119
|
-
"@tanstack/react-query": "5.
|
|
140
|
+
"@tanstack/react-query": "5.61.0",
|
|
120
141
|
"@types/react": "18.3.11",
|
|
121
142
|
"@types/react-dom": "18.3.1",
|
|
122
143
|
"@vitejs/plugin-react": "4.3.1",
|
|
144
|
+
"@zudoku/config": "0.0.0-f49e3ea",
|
|
123
145
|
"@zudoku/httpsnippet": "10.0.9",
|
|
124
146
|
"@zudoku/react-helmet-async": "2.0.4",
|
|
125
147
|
"autoprefixer": "10.4.20",
|
|
126
148
|
"chokidar": "3.6.0",
|
|
127
149
|
"class-variance-authority": "0.7.0",
|
|
128
150
|
"clsx": "2.1.1",
|
|
151
|
+
"cmdk": "1.0.4",
|
|
129
152
|
"dotenv": "16.4.5",
|
|
153
|
+
"embla-carousel-react": "8.3.1",
|
|
154
|
+
"estree-util-value-to-estree": "3.2.1",
|
|
130
155
|
"express": "4.21.1",
|
|
131
156
|
"glob": "11.0.0",
|
|
132
157
|
"graphql": "16.9.0",
|
|
@@ -137,6 +162,7 @@
|
|
|
137
162
|
"loglevel": "1.9.2",
|
|
138
163
|
"lru-cache": "11.0.1",
|
|
139
164
|
"lucide-react": "0.452.0",
|
|
165
|
+
"next-themes": "0.4.3",
|
|
140
166
|
"oauth4webapi": "2.17.0",
|
|
141
167
|
"object-hash": "3.0.0",
|
|
142
168
|
"openapi-types": "12.1.3",
|
|
@@ -145,7 +171,7 @@
|
|
|
145
171
|
"posthog-node": "4.2.1",
|
|
146
172
|
"prism-react-renderer": "2.4.0",
|
|
147
173
|
"prismjs": "1.29.0",
|
|
148
|
-
"react-error-boundary": "4.
|
|
174
|
+
"react-error-boundary": "4.1.2",
|
|
149
175
|
"react-hook-form": "7.53.0",
|
|
150
176
|
"react-is": "18.3.1",
|
|
151
177
|
"react-markdown": "9.0.1",
|
|
@@ -164,11 +190,11 @@
|
|
|
164
190
|
"strip-ansi": "7.1.0",
|
|
165
191
|
"tailwind-merge": "2.5.4",
|
|
166
192
|
"tailwindcss": "3.4.13",
|
|
167
|
-
"tsx": "4.19.1",
|
|
168
193
|
"ulidx": "2.4.1",
|
|
169
194
|
"unist-util-visit": "5.0.0",
|
|
170
195
|
"urql": "4.1.0",
|
|
171
196
|
"vaul": "1.1.0",
|
|
197
|
+
"vfile": "6.0.3",
|
|
172
198
|
"vite": "5.4.9",
|
|
173
199
|
"yaml": "2.6.0",
|
|
174
200
|
"yargs": "17.7.2",
|
|
@@ -177,19 +203,24 @@
|
|
|
177
203
|
"zustand": "5.0.0"
|
|
178
204
|
},
|
|
179
205
|
"devDependencies": {
|
|
180
|
-
"@types/
|
|
206
|
+
"@types/estree": "1.0.6",
|
|
207
|
+
"@graphql-codegen/cli": "5.0.3",
|
|
208
|
+
"@graphql-codegen/client-preset": "4.5.0",
|
|
209
|
+
"@types/express": "5.0.0",
|
|
181
210
|
"@types/har-format": "1.2.15",
|
|
182
211
|
"@types/json-schema": "7.0.15",
|
|
212
|
+
"@types/mdast": "4.0.4",
|
|
183
213
|
"@types/mdx": "2.0.13",
|
|
184
214
|
"@types/node": "20.16.11",
|
|
185
215
|
"@types/object-hash": "3.0.6",
|
|
186
216
|
"@types/react-is": "18.3.0",
|
|
187
217
|
"@types/semver": "7.5.8",
|
|
188
218
|
"@types/yargs": "17.0.33",
|
|
189
|
-
"
|
|
219
|
+
"mdast-util-mdx": "3.0.0",
|
|
190
220
|
"react": "18.3.1",
|
|
191
221
|
"react-dom": "18.3.1",
|
|
192
|
-
"
|
|
222
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
223
|
+
"typescript": "5.7.2"
|
|
193
224
|
},
|
|
194
225
|
"peerDependencies": {
|
|
195
226
|
"react": ">=18",
|
|
@@ -201,11 +232,12 @@
|
|
|
201
232
|
},
|
|
202
233
|
"scripts": {
|
|
203
234
|
"build": "tsc --project tsconfig.json",
|
|
204
|
-
"build:vite": "vite build
|
|
235
|
+
"build:vite": "vite build",
|
|
205
236
|
"build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
|
|
206
237
|
"build:standalone:html": "cp ./src/app/standalone.html ./standalone/standalone.html && cp ./src/app/demo.html ./standalone/demo.html && cp ./src/app/demo-cdn.html ./standalone/index.html",
|
|
207
238
|
"hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
|
|
208
239
|
"clean": "tsc --build --clean",
|
|
240
|
+
"codegen": "graphql-codegen --config ./src/codegen.ts",
|
|
209
241
|
"test": "node --test --enable-source-maps"
|
|
210
242
|
},
|
|
211
243
|
"module": "./dist/index.js",
|
package/src/app/demo.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import { Bootstrap } from "zudoku/components";
|
|
|
5
5
|
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
6
6
|
import DemoAnnouncement from "../lib/demo/DemoAnnouncement.js";
|
|
7
7
|
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
8
|
-
import { themeToggle } from "../lib/themeToggle.js";
|
|
9
8
|
import "../lib/util/logInit.js";
|
|
10
9
|
import "./main.css";
|
|
11
10
|
import { getRoutesByConfig } from "./main.js";
|
|
@@ -18,8 +17,6 @@ if (!apiUrl) {
|
|
|
18
17
|
);
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
themeToggle();
|
|
22
|
-
|
|
23
20
|
logger.info(`API URL: ${apiUrl}`);
|
|
24
21
|
|
|
25
22
|
const root =
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -20,8 +20,10 @@ if (root.childElementCount > 0) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
23
|
-
const path = window.location.pathname
|
|
24
|
-
const lazyMatches = matchRoutes(routes, path)?.filter(
|
|
23
|
+
const path = window.location.pathname;
|
|
24
|
+
const lazyMatches = matchRoutes(routes, path, config.basePath)?.filter(
|
|
25
|
+
(m) => m.route.lazy,
|
|
26
|
+
);
|
|
25
27
|
|
|
26
28
|
if (lazyMatches?.length) {
|
|
27
29
|
await Promise.all(
|
|
@@ -36,6 +38,13 @@ async function hydrateLazyRoutes(routes: RouteObject[]) {
|
|
|
36
38
|
function render(routes: RouteObject[]) {
|
|
37
39
|
const router = createBrowserRouter(routes, {
|
|
38
40
|
basename: config.basePath,
|
|
41
|
+
future: {
|
|
42
|
+
v7_relativeSplatPath: true,
|
|
43
|
+
v7_fetcherPersist: true,
|
|
44
|
+
v7_partialHydration: true,
|
|
45
|
+
v7_skipActionErrorRevalidation: true,
|
|
46
|
+
v7_normalizeFormMethod: true,
|
|
47
|
+
},
|
|
39
48
|
});
|
|
40
49
|
createRoot(root).render(<Bootstrap router={router} />);
|
|
41
50
|
}
|
|
@@ -44,6 +53,13 @@ async function hydrate(routes: RouteObject[]) {
|
|
|
44
53
|
await hydrateLazyRoutes(routes);
|
|
45
54
|
const router = createBrowserRouter(routes, {
|
|
46
55
|
basename: config.basePath,
|
|
56
|
+
future: {
|
|
57
|
+
v7_relativeSplatPath: true,
|
|
58
|
+
v7_fetcherPersist: true,
|
|
59
|
+
v7_partialHydration: true,
|
|
60
|
+
v7_skipActionErrorRevalidation: true,
|
|
61
|
+
v7_normalizeFormMethod: true,
|
|
62
|
+
},
|
|
47
63
|
});
|
|
48
64
|
|
|
49
65
|
hydrateRoot(root, <Bootstrap hydrate router={router} />);
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dehydrate, QueryClient } from "@tanstack/react-query";
|
|
1
2
|
import { type HelmetData } from "@zudoku/react-helmet-async";
|
|
2
3
|
import type express from "express";
|
|
3
4
|
import logger from "loglevel";
|
|
@@ -32,15 +33,13 @@ export const render = async ({
|
|
|
32
33
|
const { query, dataRoutes } = createStaticHandler(routes, {
|
|
33
34
|
basename: config.basePath,
|
|
34
35
|
});
|
|
36
|
+
const queryClient = new QueryClient();
|
|
35
37
|
|
|
36
38
|
const request =
|
|
37
39
|
baseRequest instanceof Request
|
|
38
40
|
? baseRequest
|
|
39
41
|
: createFetchRequest(baseRequest, response);
|
|
40
42
|
|
|
41
|
-
if (!request) {
|
|
42
|
-
throw new Error("Either fetchRequest or expressRequest must be provided");
|
|
43
|
-
}
|
|
44
43
|
const context = await query(request);
|
|
45
44
|
let status = 200;
|
|
46
45
|
|
|
@@ -66,61 +65,72 @@ export const render = async ({
|
|
|
66
65
|
const router = createStaticRouter(dataRoutes, context);
|
|
67
66
|
const helmetContext = {} as HelmetData["context"];
|
|
68
67
|
|
|
69
|
-
const
|
|
68
|
+
const App = (
|
|
70
69
|
<BootstrapStatic
|
|
71
70
|
router={router}
|
|
72
71
|
context={context}
|
|
72
|
+
queryClient={queryClient}
|
|
73
73
|
helmetContext={helmetContext}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const { pipe } = renderToPipeableStream(App, {
|
|
78
|
+
onShellError(error) {
|
|
79
|
+
response.status(500);
|
|
80
|
+
response.set({ "Content-Type": "text/html" });
|
|
81
|
+
|
|
82
|
+
const html = renderToStaticMarkup(<ServerError error={error} />);
|
|
83
|
+
|
|
84
|
+
response.send(html);
|
|
85
|
+
},
|
|
86
|
+
// for SSG we could use onAllReady instead of onShellReady
|
|
87
|
+
// https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation
|
|
88
|
+
onAllReady() {
|
|
89
|
+
response.set({ "Content-Type": "text/html" });
|
|
90
|
+
response.status(status);
|
|
91
|
+
|
|
92
|
+
const transformStream = new Transform({
|
|
93
|
+
transform(chunk, encoding, callback) {
|
|
94
|
+
response.write(chunk, encoding);
|
|
95
|
+
callback();
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const [htmlStart, htmlEnd] = template.split("<!--app-html-->");
|
|
100
|
+
|
|
101
|
+
if (!htmlStart) {
|
|
102
|
+
throw new Error("No <!--app-html--> found in template");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
response.write(
|
|
106
|
+
htmlStart.replace(
|
|
107
|
+
"<!--app-helmet-->",
|
|
108
|
+
[
|
|
109
|
+
helmetContext.helmet.title.toString(),
|
|
110
|
+
helmetContext.helmet.meta.toString(),
|
|
111
|
+
helmetContext.helmet.link.toString(),
|
|
112
|
+
helmetContext.helmet.style.toString(),
|
|
113
|
+
helmetContext.helmet.script.toString(),
|
|
114
|
+
].join("\n"),
|
|
115
|
+
),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
transformStream.on("finish", () => {
|
|
119
|
+
response.end(
|
|
120
|
+
htmlEnd?.replace(
|
|
121
|
+
"</body>",
|
|
122
|
+
`<script>window.DATA = ${JSON.stringify(dehydrate(queryClient))}</script></body>`,
|
|
109
123
|
),
|
|
110
124
|
);
|
|
125
|
+
});
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
response.end(htmlEnd);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
pipe(transformStream);
|
|
117
|
-
},
|
|
118
|
-
onError(error) {
|
|
119
|
-
status = 500;
|
|
120
|
-
logger.error(error);
|
|
121
|
-
},
|
|
127
|
+
pipe(transformStream);
|
|
122
128
|
},
|
|
123
|
-
|
|
129
|
+
onError(error) {
|
|
130
|
+
status = 500;
|
|
131
|
+
logger.error(error);
|
|
132
|
+
},
|
|
133
|
+
});
|
|
124
134
|
};
|
|
125
135
|
|
|
126
136
|
export function createFetchRequest(
|
package/src/app/main.css
CHANGED
|
@@ -103,6 +103,10 @@
|
|
|
103
103
|
@apply h-full overscroll-none;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
details summary {
|
|
107
|
+
@apply cursor-pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
106
110
|
#root {
|
|
107
111
|
@apply min-h-screen w-full;
|
|
108
112
|
}
|
|
@@ -183,7 +187,7 @@
|
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
.scrollbar:hover {
|
|
186
|
-
scrollbar-color: hsla(var(--border)) transparent;
|
|
190
|
+
scrollbar-color: var(--scrollbar-color, hsla(var(--border))) transparent;
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
.scrollbar::-webkit-scrollbar {
|
package/src/app/main.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type RouteObject } from "react-router-dom";
|
|
2
2
|
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
3
3
|
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
4
4
|
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
@@ -8,12 +8,10 @@ import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
|
8
8
|
import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
|
|
9
9
|
import { configuredSidebar } from "virtual:zudoku-sidebar";
|
|
10
10
|
import "virtual:zudoku-theme.css";
|
|
11
|
-
import {
|
|
12
|
-
import { isNavigationPlugin } from "zudoku/internal";
|
|
11
|
+
import { Layout, RouterError, Zudoku } from "zudoku/components";
|
|
13
12
|
import type { ZudokuConfig } from "../config/config.js";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import { joinPath } from "../lib/util/joinPath.js";
|
|
13
|
+
import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
|
|
14
|
+
import { isNavigationPlugin } from "../lib/core/plugins.js";
|
|
17
15
|
|
|
18
16
|
export const convertZudokuConfigToOptions = (
|
|
19
17
|
config: ZudokuConfig,
|
|
@@ -67,9 +65,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
67
65
|
};
|
|
68
66
|
};
|
|
69
67
|
|
|
70
|
-
export const
|
|
71
|
-
const options = convertZudokuConfigToOptions(config);
|
|
72
|
-
|
|
68
|
+
export const getRoutesByOptions = (options: ZudokuContextOptions) => {
|
|
73
69
|
const allPlugins = [
|
|
74
70
|
...(options.plugins ? options.plugins : []),
|
|
75
71
|
...(options.authentication?.getAuthenticationPlugin
|
|
@@ -77,27 +73,8 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
77
73
|
: []),
|
|
78
74
|
];
|
|
79
75
|
|
|
80
|
-
const topNavRedirects =
|
|
81
|
-
options.topNavigation?.flatMap((topNavItem) => {
|
|
82
|
-
if (!options.sidebars?.[topNavItem.id]) return [];
|
|
83
|
-
|
|
84
|
-
const first =
|
|
85
|
-
topNavItem.default ??
|
|
86
|
-
traverseSidebar(options.sidebars[topNavItem.id], (item) => {
|
|
87
|
-
if (item.type === "doc") return joinPath(topNavItem.id, item.id);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
if (!first) return [];
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
path: topNavItem.id,
|
|
94
|
-
loader: () => redirect(joinPath(first)),
|
|
95
|
-
} satisfies RouteObject;
|
|
96
|
-
}) ?? [];
|
|
97
|
-
|
|
98
76
|
const routes = allPlugins
|
|
99
77
|
.flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
|
|
100
|
-
.concat(topNavRedirects)
|
|
101
78
|
.concat({
|
|
102
79
|
path: "*",
|
|
103
80
|
loader: () => {
|
|
@@ -105,12 +82,19 @@ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
|
105
82
|
},
|
|
106
83
|
});
|
|
107
84
|
|
|
85
|
+
return routes;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
|
|
89
|
+
const options = convertZudokuConfigToOptions(config);
|
|
90
|
+
const routes = getRoutesByOptions(options);
|
|
91
|
+
|
|
108
92
|
return [
|
|
109
93
|
{
|
|
110
94
|
element: (
|
|
111
|
-
<
|
|
95
|
+
<Zudoku {...options}>
|
|
112
96
|
<Layout />
|
|
113
|
-
</
|
|
97
|
+
</Zudoku>
|
|
114
98
|
),
|
|
115
99
|
children: [
|
|
116
100
|
{
|
package/src/app/standalone.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { createBrowserRouter } from "react-router-dom";
|
|
|
3
3
|
import { Bootstrap } from "zudoku/components";
|
|
4
4
|
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
5
5
|
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
6
|
-
import { themeToggle } from "../lib/themeToggle.js";
|
|
7
6
|
import "../lib/util/logInit.js";
|
|
8
7
|
import "./main.css";
|
|
9
8
|
import { getRoutesByConfig } from "./main.js";
|
|
@@ -13,10 +12,8 @@ if (!root) {
|
|
|
13
12
|
throw new Error("No div found with attribute data-api-url");
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
themeToggle();
|
|
17
|
-
|
|
18
15
|
const apiUrl = root.getAttribute("data-api-url");
|
|
19
|
-
const pageTitle = document.getElementsByTagName("title")[0]
|
|
16
|
+
const pageTitle = document.getElementsByTagName("title")[0]!.innerText;
|
|
20
17
|
const logoUrl = root.getAttribute("data-logo-url");
|
|
21
18
|
|
|
22
19
|
// IMPORTANT: This component must not contain tailwind classes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ZudokuPlugin } from "../core/plugins.js";
|
|
2
2
|
|
|
3
3
|
export interface AuthenticationProvider {
|
|
4
4
|
signUp(options?: { redirectTo?: string }): Promise<void>;
|
|
@@ -6,7 +6,7 @@ export interface AuthenticationProvider {
|
|
|
6
6
|
signOut(): Promise<void>;
|
|
7
7
|
getAccessToken(): Promise<string>;
|
|
8
8
|
pageLoad?(): void;
|
|
9
|
-
getAuthenticationPlugin?():
|
|
9
|
+
getAuthenticationPlugin?(): ZudokuPlugin;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface AuthenticationProviderInitializer<TConfig> {
|
|
@@ -18,23 +18,27 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
|
|
|
18
18
|
url: URL,
|
|
19
19
|
{ isSignUp }: { isSignUp: boolean },
|
|
20
20
|
) => {
|
|
21
|
+
url.searchParams.set("prompt", "login");
|
|
21
22
|
if (isSignUp) {
|
|
22
23
|
url.searchParams.set("screen_hint", "signup");
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
signOut = async (): Promise<void> => {
|
|
28
|
+
const as = await this.getAuthServer();
|
|
29
|
+
const idToken = await this.getAccessToken();
|
|
30
|
+
|
|
27
31
|
useAuthState.setState({
|
|
28
32
|
isAuthenticated: false,
|
|
29
33
|
isPending: false,
|
|
30
|
-
profile:
|
|
34
|
+
profile: null,
|
|
35
|
+
providerData: null,
|
|
31
36
|
});
|
|
32
|
-
sessionStorage.clear();
|
|
33
|
-
const as = await this.getAuthServer();
|
|
34
37
|
|
|
35
38
|
const redirectUrl = new URL(
|
|
36
39
|
window.location.origin + this.logoutRedirectUrlPath,
|
|
37
40
|
);
|
|
41
|
+
|
|
38
42
|
redirectUrl.pathname = this.logoutRedirectUrlPath;
|
|
39
43
|
|
|
40
44
|
// SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0
|
|
@@ -42,22 +46,24 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
|
|
|
42
46
|
// Logout End Session Endpoint Discovery is enabled by default.
|
|
43
47
|
// Otherwise we fallback to the old non-compliant logout
|
|
44
48
|
|
|
45
|
-
let logoutUrl: URL;
|
|
46
49
|
// The endSessionEndpoint is set, the IdP supports some form of logout,
|
|
47
50
|
// so we use the IdP logout. Otherwise, just redirect the user to home
|
|
48
51
|
if (as.end_session_endpoint) {
|
|
49
|
-
logoutUrl = new URL(as.end_session_endpoint);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// logoutUrl.searchParams.set("id_token_hint", id_token);
|
|
54
|
-
// }
|
|
52
|
+
const logoutUrl = new URL(as.end_session_endpoint);
|
|
53
|
+
if (idToken) {
|
|
54
|
+
logoutUrl.searchParams.set("id_token_hint", idToken);
|
|
55
|
+
}
|
|
55
56
|
logoutUrl.searchParams.set(
|
|
56
57
|
"post_logout_redirect_uri",
|
|
57
58
|
redirectUrl.toString(),
|
|
58
59
|
);
|
|
60
|
+
|
|
61
|
+
// window.location.href = logoutUrl.toString();
|
|
59
62
|
} else {
|
|
60
|
-
logoutUrl = new URL(
|
|
63
|
+
const logoutUrl = new URL(
|
|
64
|
+
`${this.issuer.replace(/\/$/, "")}/oidc/logout`,
|
|
65
|
+
);
|
|
66
|
+
// window.location.href = logoutUrl.toString();
|
|
61
67
|
}
|
|
62
68
|
};
|
|
63
69
|
}
|
|
@@ -107,7 +107,10 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
107
107
|
expiresOn: new Date(Date.now() + response.expires_in * 1000),
|
|
108
108
|
tokenType: response.token_type,
|
|
109
109
|
};
|
|
110
|
-
|
|
110
|
+
|
|
111
|
+
useAuthState.setState({
|
|
112
|
+
providerData: tokens,
|
|
113
|
+
});
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
async signUp({ redirectTo }: { redirectTo?: string } = {}) {
|
|
@@ -194,14 +197,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
194
197
|
|
|
195
198
|
async getAccessToken(): Promise<string> {
|
|
196
199
|
const as = await this.getAuthServer();
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
200
|
+
const { providerData } = useAuthState.getState();
|
|
201
|
+
if (!providerData) {
|
|
199
202
|
throw new AuthorizationError("User is not authenticated");
|
|
200
203
|
}
|
|
204
|
+
const tokenState = providerData as TokenState;
|
|
201
205
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (!state.refreshToken) {
|
|
206
|
+
if (tokenState.expiresOn < new Date()) {
|
|
207
|
+
if (!tokenState.refreshToken) {
|
|
205
208
|
await this.signIn();
|
|
206
209
|
return "";
|
|
207
210
|
}
|
|
@@ -209,7 +212,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
209
212
|
const request = await oauth.refreshTokenGrantRequest(
|
|
210
213
|
as,
|
|
211
214
|
this.client,
|
|
212
|
-
|
|
215
|
+
tokenState.refreshToken,
|
|
213
216
|
);
|
|
214
217
|
const response = await oauth.processRefreshTokenResponse(
|
|
215
218
|
as,
|
|
@@ -225,7 +228,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
225
228
|
|
|
226
229
|
return response.access_token.toString();
|
|
227
230
|
} else {
|
|
228
|
-
return
|
|
231
|
+
return tokenState.accessToken;
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
234
|
|
|
@@ -234,8 +237,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
234
237
|
isAuthenticated: false,
|
|
235
238
|
isPending: false,
|
|
236
239
|
profile: undefined,
|
|
240
|
+
providerData: undefined,
|
|
237
241
|
});
|
|
238
|
-
sessionStorage.clear();
|
|
239
242
|
|
|
240
243
|
const as = await this.getAuthServer();
|
|
241
244
|
|
|
@@ -342,32 +345,11 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
342
345
|
profile,
|
|
343
346
|
});
|
|
344
347
|
|
|
345
|
-
sessionStorage.setItem(
|
|
346
|
-
"profile-state",
|
|
347
|
-
JSON.stringify(useAuthState.getState().profile),
|
|
348
|
-
);
|
|
349
|
-
|
|
350
348
|
const redirectTo = sessionStorage.getItem("redirect-to") ?? "/";
|
|
351
349
|
sessionStorage.removeItem("redirect-to");
|
|
352
350
|
return redirectTo;
|
|
353
351
|
};
|
|
354
352
|
|
|
355
|
-
pageLoad(): void {
|
|
356
|
-
const profileState = sessionStorage.getItem("profile-state");
|
|
357
|
-
if (profileState) {
|
|
358
|
-
try {
|
|
359
|
-
const profile = JSON.parse(profileState);
|
|
360
|
-
useAuthState.setState({
|
|
361
|
-
isAuthenticated: true,
|
|
362
|
-
isPending: false,
|
|
363
|
-
profile,
|
|
364
|
-
});
|
|
365
|
-
} catch (err) {
|
|
366
|
-
logger.error("Error parsing auth state", err);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
353
|
getAuthenticationPlugin() {
|
|
372
354
|
// TODO: This API is a bit messy, we need to refactor auth plugins/providers
|
|
373
355
|
// to remove the extra layers of abstraction.
|