zudoku 0.0.0-e614aaa → 0.0.0-e6d1d34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app/entry.server.d.ts +8 -6
- package/dist/app/entry.server.js +12 -8
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +2 -0
- package/dist/app/main.js.map +1 -1
- package/dist/app/tailwind.js +14 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/build/handler.js +2 -1
- package/dist/cli/build/handler.js.map +1 -1
- package/dist/cli/cmds/dev.d.ts +1 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -1
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/cli/preview/handler.js +13 -15
- package/dist/cli/preview/handler.js.map +1 -1
- package/dist/config/common.d.ts +0 -1
- package/dist/config/config.d.ts +13 -8
- package/dist/config/loader.d.ts +2 -2
- package/dist/config/loader.js +14 -25
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +2773 -597
- package/dist/config/validators/common.js +81 -4
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1013 -257
- package/dist/lib/authentication/authentication.d.ts +1 -0
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js +11 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.d.ts +2 -2
- package/dist/lib/authentication/providers/clerk.js +19 -0
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -0
- package/dist/lib/authentication/providers/openid.js +20 -8
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/providers/supabase.d.ts +4 -0
- package/dist/lib/authentication/providers/supabase.js +117 -0
- package/dist/lib/authentication/providers/supabase.js.map +1 -0
- package/dist/lib/authentication/state.d.ts +0 -26
- package/dist/lib/authentication/state.js +1 -16
- package/dist/lib/authentication/state.js.map +1 -1
- package/dist/lib/components/AnchorLink.d.ts +2 -2
- package/dist/lib/components/AnchorLink.js +5 -4
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +3 -2
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Footer.d.ts +1 -0
- package/dist/lib/components/Footer.js +32 -0
- package/dist/lib/components/Footer.js.map +1 -0
- package/dist/lib/components/Header.js +4 -4
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/InlineCode.d.ts +2 -1
- package/dist/lib/components/InlineCode.js +2 -9
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/Layout.js +8 -29
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Main.d.ts +2 -0
- package/dist/lib/components/Main.js +17 -0
- package/dist/lib/components/Main.js.map +1 -0
- package/dist/lib/components/MobileTopNavigation.js +6 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Pagination.d.ts +11 -0
- package/dist/lib/components/Pagination.js +10 -0
- package/dist/lib/components/Pagination.js.map +1 -0
- package/dist/lib/components/TopNavigation.d.ts +3 -2
- package/dist/lib/components/TopNavigation.js +26 -13
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/Zudoku.js +9 -3
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/cache.d.ts +7 -0
- package/dist/lib/components/cache.js +7 -0
- package/dist/lib/components/cache.js.map +1 -1
- package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
- package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
- package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
- package/dist/lib/components/context/ZudokuContext.js +13 -7
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +5 -2
- package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
- package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +1 -12
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +10 -6
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
- package/dist/lib/components/navigation/SidebarItem.js +17 -11
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
- package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
- package/dist/lib/components/navigation/Toc.js.map +1 -0
- package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
- package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
- package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
- package/dist/lib/core/RouteGuard.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +10 -3
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +23 -7
- package/dist/lib/core/ZudokuContext.js +12 -5
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +9 -7
- package/dist/lib/errors/ErrorAlert.js +6 -1
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/hooks/useEvent.test.js +1 -1
- package/dist/lib/hooks/useEvent.test.js.map +1 -1
- package/dist/lib/oas/graphql/index.d.ts +17 -4
- package/dist/lib/oas/graphql/index.js +148 -38
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.js +2 -0
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +5 -3
- package/dist/lib/oas/parser/index.js +0 -22
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.js +19 -17
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +3 -9
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +63 -19
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +6 -12
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
- package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
- package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
- package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
- package/dist/lib/plugins/openapi/SchemaList.js +52 -0
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
- package/dist/lib/plugins/openapi/Sidecar.js +38 -9
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
- package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
- package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
- package/dist/lib/plugins/openapi/graphql/gql.js +5 -4
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
- package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +6 -11
- package/dist/lib/plugins/openapi/index.js +41 -60
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
- package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
- package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
- package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
- package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
- package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +19 -13
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
- package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
- package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
- package/dist/lib/plugins/openapi/schema/utils.js +3 -1
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/state.d.ts +25 -0
- package/dist/lib/plugins/openapi/state.js +18 -0
- package/dist/lib/plugins/openapi/state.js.map +1 -0
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
- package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +23 -10
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.d.ts +1 -0
- package/dist/lib/plugins/search-pagefind/ResultList.js +19 -17
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/get-results.d.ts +8 -1
- package/dist/lib/plugins/search-pagefind/get-results.js +9 -4
- package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +2 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +2 -1
- package/dist/lib/ui/Callout.js +3 -2
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Checkbox.d.ts +2 -8
- package/dist/lib/ui/Checkbox.js +1 -13
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/ui/Select.js +1 -1
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Stepper.d.ts +0 -1
- package/dist/lib/ui/Stepper.js +1 -1
- package/dist/lib/ui/Stepper.js.map +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/ui/SyntaxHighlight.js +21 -15
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -2
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.d.ts +3 -0
- package/dist/lib/util/joinPath.js +3 -0
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -8
- package/dist/lib/util/traverse.js +2 -2
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/lib/util/types.d.ts +7 -0
- package/dist/lib/util/types.js +2 -0
- package/dist/lib/util/types.js.map +1 -0
- package/dist/lib/util/useOnScreen.d.ts +3 -2
- package/dist/lib/util/useOnScreen.js +3 -3
- package/dist/lib/util/useOnScreen.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js +20 -12
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/api/schema-codegen.d.ts +1 -1
- package/dist/vite/api/schema-codegen.js +35 -12
- package/dist/vite/api/schema-codegen.js.map +1 -1
- package/dist/vite/api/schema-codegen.test.js +66 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -1
- package/dist/vite/build.js +1 -4
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +7 -9
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/create-pagefind-index.d.ts +4 -0
- package/dist/vite/create-pagefind-index.js +12 -0
- package/dist/vite/create-pagefind-index.js.map +1 -0
- package/dist/vite/dev-server.js +4 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +36 -29
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +3 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-docs.d.ts +1 -1
- package/dist/vite/plugin-docs.js +18 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/prerender/FileWritingResponse.d.ts +9 -5
- package/dist/vite/prerender/FileWritingResponse.js +5 -5
- package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
- package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
- package/dist/vite/prerender/InMemoryResponse.js +32 -0
- package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
- package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
- package/dist/vite/prerender/PrerenderResponse.js +2 -0
- package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
- package/dist/vite/prerender/prerender.d.ts +1 -0
- package/dist/vite/prerender/prerender.js +32 -8
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/worker.js +41 -14
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/zuplo/with-zuplo.js +4 -0
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js → AuthenticationPlugin-foqdvvkf.js} +3 -3
- package/lib/{AuthenticationPlugin-CiO1FM6Q.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
- package/lib/Button-Fp19CMUr.js +49 -0
- package/lib/Button-Fp19CMUr.js.map +1 -0
- package/lib/Callout-B2vsR09t.js +229 -0
- package/lib/Callout-B2vsR09t.js.map +1 -0
- package/lib/{Dialog-DIKGQxQc.js → Dialog-sbgekbjb.js} +47 -32
- package/lib/{Dialog-DIKGQxQc.js.map → Dialog-sbgekbjb.js.map} +1 -1
- package/lib/Drawer-kDAfOq_2.js +1133 -0
- package/lib/Drawer-kDAfOq_2.js.map +1 -0
- package/lib/{Markdown-DePfm7oQ.js → Markdown-aF5FdsNi.js} +6268 -4572
- package/lib/Markdown-aF5FdsNi.js.map +1 -0
- package/lib/MdxPage-Vw_dc9Yz.js +85 -0
- package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
- package/lib/{OasProvider-BSuptFK-.js → OasProvider-C5paEivQ.js} +4 -4
- package/lib/{OasProvider-BSuptFK-.js.map → OasProvider-C5paEivQ.js.map} +1 -1
- package/lib/OperationList-Ds9Izgkn.js +5069 -0
- package/lib/OperationList-Ds9Izgkn.js.map +1 -0
- package/lib/Pagination-SdlocK96.js +48 -0
- package/lib/Pagination-SdlocK96.js.map +1 -0
- package/lib/{index.esm-CQHE3GEU.js → RouteGuard-CqZPoZYJ.js} +192 -139
- package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
- package/lib/SchemaList-NZbDXAV5.js +148 -0
- package/lib/SchemaList-NZbDXAV5.js.map +1 -0
- package/lib/SchemaView-B3fOPR4V.js +357 -0
- package/lib/SchemaView-B3fOPR4V.js.map +1 -0
- package/lib/{Select-Dqtcn53H.js → Select-DVFRKf1R.js} +9 -9
- package/lib/{Select-Dqtcn53H.js.map → Select-DVFRKf1R.js.map} +1 -1
- package/lib/SlotletProvider-DXvc0aY6.js +338 -0
- package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
- package/lib/Spinner-CE68iCm0.js +7 -0
- package/lib/Spinner-CE68iCm0.js.map +1 -0
- package/lib/SyntaxHighlight-BEoSoPEo.js +2890 -0
- package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
- package/lib/Toc-YBsgI72s.js +92 -0
- package/lib/Toc-YBsgI72s.js.map +1 -0
- package/lib/{chunk-IR6S3I6Y-D_3UmFIn.js → chunk-HA7DTUK3-C4gP41vD.js} +278 -278
- package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
- package/lib/{circular-v7K6lDDh.js → circular-ByJI6Mci.js} +4887 -4419
- package/lib/circular-ByJI6Mci.js.map +1 -0
- package/lib/{createServer-DmusVVsi.js → createServer-mYvGvmc0.js} +4150 -4424
- package/lib/createServer-mYvGvmc0.js.map +1 -0
- package/lib/{hook-CN__aZIt.js → hook-CqpVYDqN.js} +398 -379
- package/lib/hook-CqpVYDqN.js.map +1 -0
- package/lib/index-D48iOQvJ.js +1973 -0
- package/lib/index-D48iOQvJ.js.map +1 -0
- package/lib/index-PGJOZ6R-.js +2227 -0
- package/lib/index-PGJOZ6R-.js.map +1 -0
- package/lib/{mutation-EclmI0is.js → mutation-8LjrN7uz.js} +2 -2
- package/lib/{mutation-EclmI0is.js.map → mutation-8LjrN7uz.js.map} +1 -1
- package/lib/post-processors/traverse.js +2 -2
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
- package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
- package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
- package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
- package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
- package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
- package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
- package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
- package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
- package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
- package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
- package/lib/ui/ActionButton.js +11 -10
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Button.js +13 -12
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/Callout.js +39 -21
- package/lib/ui/Callout.js.map +1 -1
- package/lib/ui/Checkbox.js +15 -25
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Drawer.js +14 -1129
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Stepper.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +8 -2902
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/{useExposedProps-RIvey2Oy.js → useExposedProps-B9qXJedG.js} +2 -2
- package/lib/{useExposedProps-RIvey2Oy.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
- package/lib/useLatest-hmRS46UF.js +11 -0
- package/lib/useLatest-hmRS46UF.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +59 -41
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +341 -337
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +32 -1395
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +94 -98
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -7
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +233 -0
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +32 -24
- package/src/app/entry.server.tsx +23 -13
- package/src/app/main.css +98 -57
- package/src/app/main.tsx +2 -0
- package/src/app/tailwind.ts +14 -0
- package/src/lib/authentication/authentication.ts +2 -0
- package/src/lib/authentication/hook.ts +12 -1
- package/src/lib/authentication/providers/clerk.tsx +22 -2
- package/src/lib/authentication/providers/openid.tsx +23 -10
- package/src/lib/authentication/providers/supabase.tsx +157 -0
- package/src/lib/authentication/state.ts +1 -35
- package/src/lib/components/AnchorLink.tsx +9 -7
- package/src/lib/components/Bootstrap.tsx +13 -6
- package/src/lib/components/Footer.tsx +136 -0
- package/src/lib/components/Header.tsx +11 -7
- package/src/lib/components/InlineCode.tsx +13 -16
- package/src/lib/components/Layout.tsx +22 -68
- package/src/lib/components/Main.tsx +50 -0
- package/src/lib/components/MobileTopNavigation.tsx +27 -18
- package/src/lib/components/Pagination.tsx +50 -0
- package/src/lib/components/TopNavigation.tsx +40 -17
- package/src/lib/components/Zudoku.tsx +12 -3
- package/src/lib/components/cache.ts +8 -0
- package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
- package/src/lib/components/context/ZudokuContext.ts +17 -8
- package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
- package/src/lib/components/navigation/Sidebar.tsx +30 -44
- package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
- package/src/lib/components/navigation/SidebarItem.tsx +21 -29
- package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
- package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
- package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
- package/src/lib/core/RouteGuard.tsx +27 -4
- package/src/lib/core/ZudokuContext.ts +35 -15
- package/src/lib/core/plugins.ts +8 -8
- package/src/lib/errors/ErrorAlert.tsx +24 -17
- package/src/lib/hooks/useEvent.test.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +202 -54
- package/src/lib/oas/parser/dereference/index.ts +2 -0
- package/src/lib/oas/parser/index.ts +7 -29
- package/src/lib/plugins/api-catalog/Catalog.tsx +1 -4
- package/src/lib/plugins/api-catalog/index.tsx +40 -35
- package/src/lib/plugins/markdown/MdxPage.tsx +11 -47
- package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +162 -84
- package/src/lib/plugins/openapi/OperationListItem.tsx +116 -110
- package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
- package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
- package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +47 -11
- package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
- package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +29 -20
- package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
- package/src/lib/plugins/openapi/index.tsx +55 -87
- package/src/lib/plugins/openapi/interfaces.ts +44 -15
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
- package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +175 -88
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
- package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +24 -4
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
- package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
- package/src/lib/plugins/openapi/schema/utils.ts +7 -1
- package/src/lib/plugins/openapi/state.ts +36 -0
- package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
- package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +39 -14
- package/src/lib/plugins/search-pagefind/ResultList.tsx +60 -53
- package/src/lib/plugins/search-pagefind/get-results.tsx +31 -10
- package/src/lib/ui/Button.tsx +4 -2
- package/src/lib/ui/Callout.tsx +28 -10
- package/src/lib/ui/Checkbox.tsx +8 -24
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/ui/Stepper.tsx +1 -1
- package/src/lib/ui/SyntaxHighlight.tsx +96 -96
- package/src/lib/util/MdxComponents.tsx +2 -2
- package/src/lib/util/joinPath.tsx +3 -0
- package/src/lib/util/traverse.ts +4 -8
- package/src/lib/util/types.ts +7 -0
- package/src/lib/util/useOnScreen.ts +6 -4
- package/src/lib/util/useScrollToAnchor.ts +22 -12
- package/dist/lib/components/context/PluginSystem.d.ts +0 -1
- package/dist/lib/components/context/PluginSystem.js +0 -2
- package/dist/lib/components/context/PluginSystem.js.map +0 -1
- package/dist/lib/plugins/markdown/Toc.js.map +0 -1
- package/dist/vite/pagefind.d.ts +0 -4
- package/dist/vite/pagefind.js +0 -15
- package/dist/vite/pagefind.js.map +0 -1
- package/lib/Markdown-DePfm7oQ.js.map +0 -1
- package/lib/MdxPage-BN6l6zXL.js +0 -201
- package/lib/MdxPage-BN6l6zXL.js.map +0 -1
- package/lib/OperationList-DOcfDmJP.js +0 -5217
- package/lib/OperationList-DOcfDmJP.js.map +0 -1
- package/lib/SlotletProvider-DdtIOUi6.js +0 -221
- package/lib/SlotletProvider-DdtIOUi6.js.map +0 -1
- package/lib/Spinner-1KrEmx1V.js +0 -51
- package/lib/Spinner-1KrEmx1V.js.map +0 -1
- package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +0 -1
- package/lib/circular-v7K6lDDh.js.map +0 -1
- package/lib/createServer-DmusVVsi.js.map +0 -1
- package/lib/hook-CN__aZIt.js.map +0 -1
- package/lib/index-BTbP6Lgf.js +0 -2103
- package/lib/index-BTbP6Lgf.js.map +0 -1
- package/lib/index.esm-CQHE3GEU.js.map +0 -1
- package/lib/joinUrl-10po2Jdj.js +0 -20
- package/lib/joinUrl-10po2Jdj.js.map +0 -1
- package/lib/useScrollToAnchor-RyqO3lj4.js +0 -290
- package/lib/useScrollToAnchor-RyqO3lj4.js.map +0 -1
- package/lib/zudoku.css +0 -1
- package/src/lib/components/context/PluginSystem.ts +0 -0
- package/src/lib/ui/Stepper.css +0 -43
- /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
|
@@ -1,69 +1,51 @@
|
|
|
1
|
-
import type { ResultOf } from "@graphql-typed-document-node/core";
|
|
2
|
-
import slugify from "@sindresorhus/slugify";
|
|
3
1
|
import { CirclePlayIcon, LogInIcon } from "lucide-react";
|
|
4
|
-
import { ReactNode } from "react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
5
3
|
import { matchPath } from "react-router";
|
|
6
4
|
import { useAuth } from "../../authentication/hook.js";
|
|
7
5
|
import { type ZudokuPlugin } from "../../core/plugins.js";
|
|
8
|
-
import type { SchemaImports } from "../../oas/graphql/index.js";
|
|
9
6
|
import { Button } from "../../ui/Button.js";
|
|
10
7
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
11
8
|
import { GraphQLClient } from "./client/GraphQLClient.js";
|
|
9
|
+
import type { GetSidebarOperationsQuery } from "./graphql/graphql.js";
|
|
12
10
|
import { graphql } from "./graphql/index.js";
|
|
13
|
-
import { OasPluginConfig } from "./interfaces.js";
|
|
11
|
+
import { type OasPluginConfig } from "./interfaces.js";
|
|
14
12
|
import type { PlaygroundContentProps } from "./playground/Playground.js";
|
|
15
13
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
16
14
|
import { createSidebarCategory } from "./util/createSidebarCategory.js";
|
|
17
15
|
import { getRoutes, getVersions } from "./util/getRoutes.js";
|
|
18
16
|
|
|
19
|
-
const
|
|
20
|
-
query
|
|
17
|
+
const GetSidebarOperationsQuery = graphql(`
|
|
18
|
+
query GetSidebarOperations($input: JSON!, $type: SchemaType!) {
|
|
21
19
|
schema(input: $input, type: $type) {
|
|
22
|
-
url
|
|
23
20
|
tags {
|
|
24
|
-
name
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`);
|
|
29
|
-
|
|
30
|
-
const GetOperationsQuery = graphql(`
|
|
31
|
-
query GetOperations($input: JSON!, $type: SchemaType!, $tag: String) {
|
|
32
|
-
schema(input: $input, type: $type) {
|
|
33
|
-
operations(tag: $tag) {
|
|
34
21
|
slug
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
name
|
|
23
|
+
extensions
|
|
24
|
+
operations {
|
|
25
|
+
summary
|
|
26
|
+
slug
|
|
27
|
+
method
|
|
28
|
+
operationId
|
|
29
|
+
path
|
|
42
30
|
}
|
|
43
31
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
summary
|
|
49
|
-
operationId
|
|
50
|
-
path
|
|
32
|
+
components {
|
|
33
|
+
schemas {
|
|
34
|
+
__typename
|
|
35
|
+
}
|
|
51
36
|
}
|
|
52
37
|
}
|
|
53
38
|
}
|
|
54
39
|
`);
|
|
55
40
|
|
|
56
|
-
export type OperationResult =
|
|
57
|
-
|
|
58
|
-
>["schema"]["operations"][number];
|
|
41
|
+
export type OperationResult =
|
|
42
|
+
GetSidebarOperationsQuery["schema"]["tags"][number]["operations"][number];
|
|
59
43
|
|
|
60
|
-
type
|
|
61
|
-
|
|
62
|
-
export type OpenApiPluginOptions = OasPluginConfig & InternalOasPluginConfig;
|
|
44
|
+
export type OpenApiPluginOptions = OasPluginConfig;
|
|
63
45
|
|
|
64
46
|
export const UNTAGGED_PATH = "~endpoints";
|
|
65
47
|
|
|
66
|
-
export const openApiPlugin = (config:
|
|
48
|
+
export const openApiPlugin = (config: OasPluginConfig): ZudokuPlugin => {
|
|
67
49
|
const basePath = joinUrl(config.navigationId ?? "/reference");
|
|
68
50
|
const client = new GraphQLClient(config);
|
|
69
51
|
|
|
@@ -134,7 +116,7 @@ export const openApiPlugin = (config: OpenApiPluginOptions): ZudokuPlugin => {
|
|
|
134
116
|
);
|
|
135
117
|
},
|
|
136
118
|
}),
|
|
137
|
-
getSidebar: async (path
|
|
119
|
+
getSidebar: async (path, context) => {
|
|
138
120
|
if (!matchPath({ path: basePath, end: false }, path)) {
|
|
139
121
|
return [];
|
|
140
122
|
}
|
|
@@ -147,72 +129,58 @@ export const openApiPlugin = (config: OpenApiPluginOptions): ZudokuPlugin => {
|
|
|
147
129
|
try {
|
|
148
130
|
const versionParam = match?.params.version;
|
|
149
131
|
const version = versionParam ?? getVersions(config).at(0);
|
|
150
|
-
const type = config
|
|
151
|
-
const input =
|
|
152
|
-
config.type === "file" ? config.input[version!] : config.input;
|
|
153
|
-
|
|
154
|
-
const collapsible = config.loadTags === true || config.type === "url";
|
|
155
|
-
const collapsed = !config.loadTags && config.type !== "url";
|
|
132
|
+
const { type } = config;
|
|
133
|
+
const input = type === "file" ? config.input[version!] : config.input;
|
|
156
134
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
(
|
|
160
|
-
|
|
135
|
+
const data = await context.queryClient.ensureQueryData({
|
|
136
|
+
queryKey: ["sidebar-operations-query", input],
|
|
137
|
+
queryFn: () =>
|
|
138
|
+
client.fetch(GetSidebarOperationsQuery, { type, input }),
|
|
139
|
+
});
|
|
161
140
|
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
client.fetch(GetOperationsQuery, {
|
|
165
|
-
type,
|
|
166
|
-
input,
|
|
167
|
-
tag: !config.loadTags ? tagName : undefined,
|
|
168
|
-
}),
|
|
169
|
-
]);
|
|
170
|
-
|
|
171
|
-
const categories = tagData.schema.tags.flatMap((tag) => {
|
|
172
|
-
const categoryPath = joinUrl(
|
|
173
|
-
basePath,
|
|
174
|
-
versionParam,
|
|
175
|
-
slugify(tag.name),
|
|
176
|
-
);
|
|
141
|
+
const categories = data.schema.tags.flatMap((tag) => {
|
|
142
|
+
if (!tag.name || tag.operations.length === 0) return [];
|
|
177
143
|
|
|
178
|
-
const
|
|
179
|
-
(operation) =>
|
|
180
|
-
operation.tags?.length !== 0 &&
|
|
181
|
-
operation.tags?.map((t) => t.name).includes(tag.name),
|
|
182
|
-
);
|
|
144
|
+
const categoryPath = joinUrl(basePath, versionParam, tag.slug);
|
|
183
145
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
146
|
+
const isCollapsed =
|
|
147
|
+
tag.extensions?.["x-zudoku-collapsed"] ??
|
|
148
|
+
!config.options?.expandAllTags;
|
|
149
|
+
const isCollapsible =
|
|
150
|
+
tag.extensions?.["x-zudoku-collapsible"] ?? true;
|
|
188
151
|
|
|
189
152
|
return createSidebarCategory({
|
|
190
153
|
label: tag.name,
|
|
191
154
|
path: categoryPath,
|
|
192
|
-
operations:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
: [],
|
|
196
|
-
collapsible,
|
|
197
|
-
collapsed,
|
|
155
|
+
operations: tag.operations,
|
|
156
|
+
collapsed: isCollapsed,
|
|
157
|
+
collapsible: isCollapsible,
|
|
198
158
|
});
|
|
199
159
|
});
|
|
200
160
|
|
|
201
|
-
|
|
161
|
+
const untaggedOperations = data.schema.tags.find(
|
|
162
|
+
(tag) => !tag.name,
|
|
163
|
+
)?.operations;
|
|
164
|
+
|
|
165
|
+
if (untaggedOperations) {
|
|
202
166
|
categories.push(
|
|
203
167
|
createSidebarCategory({
|
|
204
168
|
label: "Other endpoints",
|
|
205
169
|
path: joinUrl(basePath, versionParam, UNTAGGED_PATH),
|
|
206
|
-
operations:
|
|
207
|
-
|
|
208
|
-
? operationsData.schema.untagged
|
|
209
|
-
: [],
|
|
210
|
-
collapsible,
|
|
211
|
-
collapsed,
|
|
170
|
+
operations: untaggedOperations,
|
|
171
|
+
collapsed: !config.options?.expandAllTags,
|
|
212
172
|
}),
|
|
213
173
|
);
|
|
214
174
|
}
|
|
215
175
|
|
|
176
|
+
if (data.schema.components?.schemas?.length) {
|
|
177
|
+
categories.push({
|
|
178
|
+
type: "link" as const,
|
|
179
|
+
label: "Schemas",
|
|
180
|
+
href: joinUrl(basePath, versionParam, "~schemas"),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
216
184
|
return categories;
|
|
217
185
|
} catch {
|
|
218
186
|
return [];
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { AuthState } from "../../authentication/state.js";
|
|
2
|
+
import { ZudokuContext } from "../../core/ZudokuContext.js";
|
|
3
|
+
import type { SchemaImports } from "../../oas/graphql/index.js";
|
|
4
|
+
import { OperationListItemResult } from "./OperationList.js";
|
|
5
|
+
|
|
1
6
|
type DynamicInput = () => Promise<unknown>;
|
|
2
7
|
|
|
3
8
|
type OasSource =
|
|
@@ -10,26 +15,50 @@ export type ContextOasSource =
|
|
|
10
15
|
| { type: "file"; input: DynamicInput }
|
|
11
16
|
| { type: "raw"; input: string };
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
type Example = {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string | null;
|
|
21
|
+
externalValue?: string | null;
|
|
22
|
+
value?: any | null;
|
|
23
|
+
summary?: string | null;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type Content = {
|
|
27
|
+
mediaType: string;
|
|
28
|
+
schema?: any | null;
|
|
29
|
+
encoding?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
}> | null;
|
|
32
|
+
examples?: Array<Example> | null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type transformExamples = (options: {
|
|
36
|
+
content: Content[];
|
|
37
|
+
context: ZudokuContext;
|
|
38
|
+
auth: AuthState;
|
|
39
|
+
operation: OperationListItemResult;
|
|
40
|
+
type: "request" | "response";
|
|
41
|
+
}) => Content[];
|
|
42
|
+
|
|
43
|
+
type BaseOasConfig = {
|
|
14
44
|
server?: string;
|
|
15
45
|
navigationId?: string;
|
|
16
46
|
skipPreload?: boolean;
|
|
17
47
|
tagPages?: Array<string>;
|
|
18
|
-
|
|
19
|
-
} & OasPluginConfigOptions &
|
|
20
|
-
OasSource;
|
|
21
|
-
|
|
22
|
-
export type OasPluginConfigOptions = {
|
|
48
|
+
schemaImports?: SchemaImports;
|
|
23
49
|
options?: {
|
|
24
|
-
|
|
50
|
+
examplesLanguage?: string;
|
|
51
|
+
disablePlayground?: boolean;
|
|
52
|
+
showVersionSelect?: "always" | "if-available" | "hide";
|
|
53
|
+
expandAllTags?: boolean;
|
|
54
|
+
transformExamples?: transformExamples;
|
|
25
55
|
};
|
|
26
56
|
};
|
|
27
57
|
|
|
28
|
-
export type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
OasPluginConfigOptions;
|
|
58
|
+
export type OasPluginConfig = BaseOasConfig & OasSource;
|
|
59
|
+
|
|
60
|
+
export type OasPluginContext = BaseOasConfig &
|
|
61
|
+
ContextOasSource & {
|
|
62
|
+
version?: string;
|
|
63
|
+
versions: Record<string, string>;
|
|
64
|
+
};
|
|
@@ -8,46 +8,44 @@ import {
|
|
|
8
8
|
DropdownMenuSeparator,
|
|
9
9
|
DropdownMenuTrigger,
|
|
10
10
|
} from "zudoku/ui/DropdownMenu.js";
|
|
11
|
-
import { Content, Example } from "../SidecarExamples.js";
|
|
11
|
+
import type { Content, Example } from "../SidecarExamples.js";
|
|
12
12
|
|
|
13
13
|
const ExamplesDropdown = ({
|
|
14
14
|
examples,
|
|
15
15
|
onSelect,
|
|
16
16
|
}: {
|
|
17
17
|
examples: Content;
|
|
18
|
-
onSelect: (example: Example) => void;
|
|
18
|
+
onSelect: (example: Example, mediaType: string) => void;
|
|
19
19
|
}) => {
|
|
20
20
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
{example.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</DropdownMenu>
|
|
50
|
-
</div>
|
|
21
|
+
<DropdownMenu>
|
|
22
|
+
<DropdownMenuTrigger asChild>
|
|
23
|
+
<Button variant="outline">Use Example</Button>
|
|
24
|
+
</DropdownMenuTrigger>
|
|
25
|
+
<DropdownMenuContent className="max-w-72">
|
|
26
|
+
{examples.map((mediaTypeObject) => (
|
|
27
|
+
<div key={mediaTypeObject.mediaType}>
|
|
28
|
+
<DropdownMenuLabel>{mediaTypeObject.mediaType}</DropdownMenuLabel>
|
|
29
|
+
<DropdownMenuSeparator />
|
|
30
|
+
<DropdownMenuGroup>
|
|
31
|
+
{mediaTypeObject.examples?.map((example) => (
|
|
32
|
+
<DropdownMenuItem
|
|
33
|
+
key={example.name}
|
|
34
|
+
onSelect={() => onSelect(example, mediaTypeObject.mediaType)}
|
|
35
|
+
>
|
|
36
|
+
<span
|
|
37
|
+
className="line-clamp-1"
|
|
38
|
+
title={example.summary ?? example.name}
|
|
39
|
+
>
|
|
40
|
+
{example.summary ?? example.name}
|
|
41
|
+
</span>
|
|
42
|
+
</DropdownMenuItem>
|
|
43
|
+
))}
|
|
44
|
+
</DropdownMenuGroup>
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
</DropdownMenuContent>
|
|
48
|
+
</DropdownMenu>
|
|
51
49
|
);
|
|
52
50
|
};
|
|
53
51
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
3
|
+
import { Checkbox } from "zudoku/ui/Checkbox.js";
|
|
4
|
+
import {
|
|
5
|
+
Dialog,
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogDescription,
|
|
8
|
+
DialogFooter,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
} from "zudoku/ui/Dialog.js";
|
|
11
|
+
import { Label } from "zudoku/ui/Label.js";
|
|
12
|
+
import { type ApiIdentity } from "../../../core/ZudokuContext.js";
|
|
13
|
+
import IdentitySelector from "./IdentitySelector.js";
|
|
14
|
+
|
|
15
|
+
const IdentityDialog = ({
|
|
16
|
+
onSubmit,
|
|
17
|
+
identities,
|
|
18
|
+
open,
|
|
19
|
+
onOpenChange,
|
|
20
|
+
}: {
|
|
21
|
+
open: boolean;
|
|
22
|
+
onOpenChange: (open: boolean) => void;
|
|
23
|
+
onSubmit: ({
|
|
24
|
+
rememberedIdentity,
|
|
25
|
+
identity,
|
|
26
|
+
}: {
|
|
27
|
+
rememberedIdentity: boolean;
|
|
28
|
+
identity?: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
identities: ApiIdentity[];
|
|
31
|
+
}) => {
|
|
32
|
+
const [identity, setIdentity] = useState<string | undefined>(undefined);
|
|
33
|
+
const [rememberedIdentity, setRememberedIdentity] = useState<boolean>(false);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
37
|
+
<DialogContent>
|
|
38
|
+
<DialogTitle>Select an auth identity</DialogTitle>
|
|
39
|
+
<DialogDescription>
|
|
40
|
+
Please select an identity for this request.
|
|
41
|
+
</DialogDescription>
|
|
42
|
+
<div className="max-h-80 overflow-auto">
|
|
43
|
+
<IdentitySelector
|
|
44
|
+
identities={identities}
|
|
45
|
+
setValue={setIdentity}
|
|
46
|
+
value={identity}
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<DialogFooter className="flex flex-col gap-2">
|
|
50
|
+
<div className="flex items-center gap-2">
|
|
51
|
+
<Checkbox
|
|
52
|
+
id="remember"
|
|
53
|
+
checked={rememberedIdentity}
|
|
54
|
+
onCheckedChange={(checked) =>
|
|
55
|
+
setRememberedIdentity(
|
|
56
|
+
checked === "indeterminate" ? false : !!checked,
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
<Label htmlFor="remember">Remember my choice</Label>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<Button
|
|
64
|
+
onClick={() => onSubmit({ identity: identity, rememberedIdentity })}
|
|
65
|
+
>
|
|
66
|
+
Send
|
|
67
|
+
</Button>
|
|
68
|
+
</DialogFooter>
|
|
69
|
+
</DialogContent>
|
|
70
|
+
</Dialog>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { IdentityDialog };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Card } from "zudoku/ui/Card.js";
|
|
2
|
+
import { Label } from "zudoku/ui/Label.js";
|
|
3
|
+
import { RadioGroup, RadioGroupItem } from "zudoku/ui/RadioGroup.js";
|
|
4
|
+
import { type ApiIdentity } from "../../../core/ZudokuContext.js";
|
|
5
|
+
import { NO_IDENTITY } from "./Playground.js";
|
|
6
|
+
|
|
7
|
+
const IdentitySelector = ({
|
|
8
|
+
identities,
|
|
9
|
+
setValue,
|
|
10
|
+
value,
|
|
11
|
+
}: {
|
|
12
|
+
identities?: ApiIdentity[];
|
|
13
|
+
setValue: (value: string) => void;
|
|
14
|
+
value?: string;
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<Card className="w-full overflow-hidden">
|
|
18
|
+
<RadioGroup
|
|
19
|
+
onValueChange={(value) => setValue(value)}
|
|
20
|
+
value={value}
|
|
21
|
+
defaultValue={NO_IDENTITY}
|
|
22
|
+
className="gap-0"
|
|
23
|
+
disabled={identities?.length === 0}
|
|
24
|
+
>
|
|
25
|
+
<Label
|
|
26
|
+
className="h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent"
|
|
27
|
+
htmlFor="none"
|
|
28
|
+
>
|
|
29
|
+
<RadioGroupItem value={NO_IDENTITY} id="none">
|
|
30
|
+
None
|
|
31
|
+
</RadioGroupItem>
|
|
32
|
+
<Label htmlFor="none" className="ml-2">
|
|
33
|
+
None
|
|
34
|
+
</Label>
|
|
35
|
+
</Label>
|
|
36
|
+
{identities?.map((identity) => (
|
|
37
|
+
<Label
|
|
38
|
+
key={identity.id}
|
|
39
|
+
className="h-12 border-b items-center flex p-4 cursor-pointer hover:bg-accent"
|
|
40
|
+
>
|
|
41
|
+
<RadioGroupItem value={identity.id} id={identity.id}>
|
|
42
|
+
{identity.label}
|
|
43
|
+
</RadioGroupItem>
|
|
44
|
+
<Label htmlFor={identity.id} className="ml-2">
|
|
45
|
+
{identity.label}
|
|
46
|
+
</Label>
|
|
47
|
+
</Label>
|
|
48
|
+
))}
|
|
49
|
+
</RadioGroup>
|
|
50
|
+
</Card>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default IdentitySelector;
|