zudoku 0.0.0-fix-downgrade-openapi-parser.aac00796 → 0.0.0-fix-firebase-export.2e421fda
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/dist/app/main.d.ts +91 -1
- package/dist/app/main.js +5 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.js +1 -1
- package/dist/config/config.d.ts +15 -46
- package/dist/config/validators/BuildSchema.js +18 -3
- package/dist/config/validators/BuildSchema.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +61 -61
- package/dist/config/validators/NavigationSchema.js +2 -4
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +203 -5
- package/dist/config/validators/validate.js +44 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/config/validators/validate.test.js +43 -0
- package/dist/config/validators/validate.test.js.map +1 -1
- package/dist/flat-config.d.ts +31 -2
- package/dist/lib/auth/issuer.js +3 -0
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -1
- package/dist/lib/authentication/providers/auth0.js +6 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.d.ts +4 -0
- package/dist/lib/authentication/providers/firebase.js +215 -0
- package/dist/lib/authentication/providers/firebase.js.map +1 -0
- package/dist/lib/authentication/providers/supabase.js +1 -6
- package/dist/lib/authentication/providers/supabase.js.map +1 -1
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +24 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +124 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Apple.js +4 -0
- package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
- package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Github.js +4 -0
- package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Google.js +4 -0
- package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
- package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
- package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
- package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
- package/dist/lib/authentication/ui/icons/X.js +4 -0
- package/dist/lib/authentication/ui/icons/X.js.map +1 -0
- package/dist/lib/components/Autocomplete.d.ts +3 -1
- package/dist/lib/components/Autocomplete.js +6 -2
- package/dist/lib/components/Autocomplete.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Mermaid.d.ts +7 -0
- package/dist/lib/components/Mermaid.js +42 -0
- package/dist/lib/components/Mermaid.js.map +1 -0
- package/dist/lib/components/PagefindSearchMeta.d.ts +8 -0
- package/dist/lib/components/PagefindSearchMeta.js +7 -0
- package/dist/lib/components/PagefindSearchMeta.js.map +1 -0
- package/dist/lib/components/Zudoku.js +2 -5
- package/dist/lib/components/Zudoku.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +7 -7
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +3 -3
- package/dist/lib/errors/ErrorAlert.js +1 -1
- package/dist/lib/errors/RouterError.d.ts +3 -1
- package/dist/lib/errors/RouterError.js +3 -2
- package/dist/lib/errors/RouterError.js.map +1 -1
- package/dist/lib/oas/parser/index.d.ts +1 -0
- package/dist/lib/oas/parser/index.js +7 -3
- package/dist/lib/oas/parser/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
- package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
- package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
- package/dist/lib/plugins/openapi/DownloadSchemaButton.d.ts +3 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js +47 -0
- package/dist/lib/plugins/openapi/DownloadSchemaButton.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +3 -6
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
- package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
- package/dist/lib/plugins/openapi/OasProvider.js +22 -13
- package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +16 -6
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +4 -3
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +7 -4
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +4 -2
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +26 -4
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaList.js +2 -1
- package/dist/lib/plugins/openapi/SchemaList.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js +61 -26
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
- package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
- package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
- package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
- package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
- package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +11 -5
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +29 -13
- package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
- package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
- package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +58 -26
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
- package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
- package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
- package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
- package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaView.js +31 -16
- package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
- package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
- package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/utils.d.ts +2 -2
- package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +9 -11
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/plugins/openapi/util/getRoutes.d.ts +6 -1
- package/dist/lib/plugins/openapi/util/getRoutes.js +29 -2
- package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/IndexingDialog.d.ts +3 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js +64 -0
- package/dist/lib/plugins/search-pagefind/IndexingDialog.js.map +1 -0
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js +22 -5
- package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -1
- package/dist/lib/plugins/search-pagefind/ResultList.js +5 -4
- package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -1
- package/dist/lib/shiki.d.ts +1 -1
- package/dist/lib/shiki.js +18 -12
- package/dist/lib/shiki.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +3 -3
- package/dist/lib/ui/Badge.js +9 -7
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Button.js +9 -7
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/ButtonGroup.d.ts +11 -0
- package/dist/lib/ui/ButtonGroup.js +28 -0
- package/dist/lib/ui/ButtonGroup.js.map +1 -0
- package/dist/lib/ui/Checkbox.d.ts +2 -2
- package/dist/lib/ui/Checkbox.js +4 -4
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +0 -1
- package/dist/lib/ui/CodeBlock.js +1 -1
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Collapsible.d.ts +4 -4
- package/dist/lib/ui/Collapsible.js +11 -4
- package/dist/lib/ui/Collapsible.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +3 -3
- package/dist/lib/ui/Command.js +2 -2
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +21 -23
- package/dist/lib/ui/DropdownMenu.js +47 -32
- package/dist/lib/ui/DropdownMenu.js.map +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.d.ts +0 -1
- package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/dist/lib/ui/Frame.d.ts +8 -0
- package/dist/lib/ui/Frame.js +22 -0
- package/dist/lib/ui/Frame.js.map +1 -0
- package/dist/lib/ui/Item.d.ts +23 -0
- package/dist/lib/ui/Item.js +67 -0
- package/dist/lib/ui/Item.js.map +1 -0
- package/dist/lib/ui/Kbd.d.ts +3 -0
- package/dist/lib/ui/Kbd.js +10 -0
- package/dist/lib/ui/Kbd.js.map +1 -0
- package/dist/lib/ui/NativeSelect.d.ts +5 -0
- package/dist/lib/ui/NativeSelect.js +14 -0
- package/dist/lib/ui/NativeSelect.js.map +1 -0
- package/dist/lib/ui/Select.d.ts +13 -11
- package/dist/lib/ui/Select.js +34 -23
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/ui/Separator.d.ts +4 -0
- package/dist/lib/ui/Separator.js +8 -0
- package/dist/lib/ui/Separator.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -7
- package/dist/lib/ui/Tooltip.js +16 -10
- package/dist/lib/ui/Tooltip.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +1 -0
- package/dist/lib/util/MdxComponents.js +2 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +5 -2
- package/dist/lib/util/createVariantComponent.js +5 -2
- package/dist/lib/util/createVariantComponent.js.map +1 -1
- package/dist/lib/util/flattenAllOf.d.ts +4 -0
- package/dist/lib/util/flattenAllOf.js +88 -0
- package/dist/lib/util/flattenAllOf.js.map +1 -0
- package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
- package/dist/lib/util/flattenAllOf.test.js +587 -0
- package/dist/lib/util/flattenAllOf.test.js.map +1 -0
- package/dist/lib/util/readFrontmatter.d.ts +6 -0
- package/dist/lib/util/readFrontmatter.js +12 -0
- package/dist/lib/util/readFrontmatter.js.map +1 -0
- package/dist/vite/api/SchemaManager.d.ts +5 -0
- package/dist/vite/api/SchemaManager.js +30 -18
- package/dist/vite/api/SchemaManager.js.map +1 -1
- package/dist/vite/api/SchemaManager.test.js +67 -0
- package/dist/vite/api/SchemaManager.test.js.map +1 -1
- package/dist/vite/config.js +8 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +25 -0
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/mdx/remark-last-modified.js +57 -3
- package/dist/vite/mdx/remark-last-modified.js.map +1 -1
- package/dist/vite/pagefind-dev-index.d.ts +16 -0
- package/dist/vite/pagefind-dev-index.js +68 -0
- package/dist/vite/pagefind-dev-index.js.map +1 -0
- package/dist/vite/plugin-api.js +41 -3
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-frontmatter.js +3 -5
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-markdown-export.js +3 -4
- package/dist/vite/plugin-markdown-export.js.map +1 -1
- package/dist/vite/plugin-theme.js +10 -1
- package/dist/vite/plugin-theme.js.map +1 -1
- package/dist/vite/prerender/prerender.js +1 -19
- package/dist/vite/prerender/prerender.js.map +1 -1
- package/dist/vite/prerender/utils.d.ts +2 -0
- package/dist/vite/prerender/utils.js +24 -0
- package/dist/vite/prerender/utils.js.map +1 -0
- package/lib/ActionButton-DUgvSylL.js +25 -0
- package/lib/ActionButton-DUgvSylL.js.map +1 -0
- package/lib/Button-CynVW1JV.js +53 -0
- package/lib/Button-CynVW1JV.js.map +1 -0
- package/lib/ClaudeLogo-B4Xxt-x_.js +69 -0
- package/lib/ClaudeLogo-B4Xxt-x_.js.map +1 -0
- package/lib/{Command-CUcrW3qs.js → Command-BpT1iBE6.js} +25 -25
- package/lib/Command-BpT1iBE6.js.map +1 -0
- package/lib/Drawer-Ci7XwhqT.js.map +1 -1
- package/lib/DropdownMenu-C8SX_-S_.js +104 -0
- package/lib/DropdownMenu-C8SX_-S_.js.map +1 -0
- package/lib/{ErrorAlert-DE3Sf66a.js → ErrorAlert-DrOR8w3f.js} +475 -456
- package/lib/ErrorAlert-DrOR8w3f.js.map +1 -0
- package/lib/IndexingDialog-B5zCiUKr.js +100 -0
- package/lib/IndexingDialog-B5zCiUKr.js.map +1 -0
- package/lib/MdxPage-BagO2c-n.js +210 -0
- package/lib/MdxPage-BagO2c-n.js.map +1 -0
- package/lib/Mermaid-D_VSX7_Q.js +102 -0
- package/lib/Mermaid-D_VSX7_Q.js.map +1 -0
- package/lib/{OAuthErrorPage-BycMozgn.js → OAuthErrorPage-Fq54RLgt.js} +7 -7
- package/lib/{OAuthErrorPage-BycMozgn.js.map → OAuthErrorPage-Fq54RLgt.js.map} +1 -1
- package/lib/OasProvider-DPH8mwDa.js +40 -0
- package/lib/OasProvider-DPH8mwDa.js.map +1 -0
- package/lib/OperationList-C0jiEaG5.js +5805 -0
- package/lib/OperationList-C0jiEaG5.js.map +1 -0
- package/lib/RouteGuard-9wjejsKm.js +77 -0
- package/lib/RouteGuard-9wjejsKm.js.map +1 -0
- package/lib/RouterError-DSLXagd5.js +42 -0
- package/lib/RouterError-DSLXagd5.js.map +1 -0
- package/lib/{SchemaList-xZSf3IMh.js → SchemaList-BU0zCHn9.js} +28 -27
- package/lib/SchemaList-BU0zCHn9.js.map +1 -0
- package/lib/SchemaView-DVae4RO2.js +597 -0
- package/lib/SchemaView-DVae4RO2.js.map +1 -0
- package/lib/Select-CkxXP5I7.js +243 -0
- package/lib/Select-CkxXP5I7.js.map +1 -0
- package/lib/Separator-CTPSeW1S.js +27 -0
- package/lib/Separator-CTPSeW1S.js.map +1 -0
- package/lib/{SignUp-6SGx9Yyq.js → SignUp-BjS4ozA7.js} +13 -13
- package/lib/{SignUp-6SGx9Yyq.js.map → SignUp-BjS4ozA7.js.map} +1 -1
- package/lib/{SyntaxHighlight-zvlnSnHB.js → SyntaxHighlight-Kdyskw3C.js} +710 -662
- package/lib/{SyntaxHighlight-zvlnSnHB.js.map → SyntaxHighlight-Kdyskw3C.js.map} +1 -1
- package/lib/{Toc-Da9yp7lo.js → Toc-DJxFPfcS.js} +2 -2
- package/lib/{Toc-Da9yp7lo.js.map → Toc-DJxFPfcS.js.map} +1 -1
- package/lib/{ZudokuContext-BUZ5hkWB.js → ZudokuContext-BXldanA8.js} +11 -11
- package/lib/{ZudokuContext-BUZ5hkWB.js.map → ZudokuContext-BXldanA8.js.map} +1 -1
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js +9 -0
- package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +1 -0
- package/lib/{chunk-PVWAREVJ-BMhpCH5D.js → chunk-PVWAREVJ-dLIqswPy.js} +5 -5
- package/lib/{chunk-PVWAREVJ-BMhpCH5D.js.map → chunk-PVWAREVJ-dLIqswPy.js.map} +1 -1
- package/lib/{circular-DvuimBGQ.js → circular-CzWF1hj5.js} +6360 -5953
- package/lib/circular-CzWF1hj5.js.map +1 -0
- package/lib/createServer-BIr2_tGn.js +16693 -0
- package/lib/createServer-BIr2_tGn.js.map +1 -0
- package/lib/createVariantComponent-B9_dVBvu.js +35 -0
- package/lib/createVariantComponent-B9_dVBvu.js.map +1 -0
- package/lib/{errors-CuGgh3hf.js → errors-Bs4duWDy.js} +3 -3
- package/lib/{errors-CuGgh3hf.js.map → errors-Bs4duWDy.js.map} +1 -1
- package/lib/firebase-Cax7HPzn.js +7360 -0
- package/lib/firebase-Cax7HPzn.js.map +1 -0
- package/lib/{hook-CMeoxziF.js → hook-BNxidGQq.js} +3 -3
- package/lib/{hook-CMeoxziF.js.map → hook-BNxidGQq.js.map} +1 -1
- package/lib/index-0oT9beQN.js +3676 -0
- package/lib/index-0oT9beQN.js.map +1 -0
- package/lib/{index-rYHsvtTo.js → index-Bh-MffiL.js} +2 -2
- package/lib/{index-rYHsvtTo.js.map → index-Bh-MffiL.js.map} +1 -1
- package/lib/{index-B1rmok4X.js → index-CCmMJp02.js} +10 -10
- package/lib/{index-B1rmok4X.js.map → index-CCmMJp02.js.map} +1 -1
- package/lib/index-CrcNWbel.js.map +1 -1
- package/lib/index-Css56y3F.js +133 -0
- package/lib/index-Css56y3F.js.map +1 -0
- package/lib/index.esm-DDENMN4y.js +32 -0
- package/lib/index.esm-DDENMN4y.js.map +1 -0
- package/lib/{index.esm-BnYHxCYC.js → index.esm-DtzT_KoE.js} +20 -20
- package/lib/{index.esm-BnYHxCYC.js.map → index.esm-DtzT_KoE.js.map} +1 -1
- package/lib/{invariant-Bm-FVUQE.js → invariant-CGOLuIIz.js} +3 -3
- package/lib/{invariant-Bm-FVUQE.js.map → invariant-CGOLuIIz.js.map} +1 -1
- package/lib/{mutation-BSU0xu4m.js → mutation-BoVlx8yA.js} +2 -2
- package/lib/{mutation-BSU0xu4m.js.map → mutation-BoVlx8yA.js.map} +1 -1
- package/lib/ui/ActionButton.js +1 -1
- package/lib/ui/Badge.js +27 -13
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Button.js +26 -24
- package/lib/ui/Button.js.map +1 -1
- package/lib/ui/ButtonGroup.js +77 -0
- package/lib/ui/ButtonGroup.js.map +1 -0
- package/lib/ui/Checkbox.js +29 -26
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/CodeBlock.js +7 -7
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/Collapsible.js +32 -5
- package/lib/ui/Collapsible.js.map +1 -1
- package/lib/ui/Command.js +3 -3
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/DropdownMenu.js +227 -140
- package/lib/ui/DropdownMenu.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +26 -25
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
- package/lib/ui/Frame.js +81 -0
- package/lib/ui/Frame.js.map +1 -0
- package/lib/ui/Item.js +188 -0
- package/lib/ui/Item.js.map +1 -0
- package/lib/ui/Kbd.js +32 -0
- package/lib/ui/Kbd.js.map +1 -0
- package/lib/ui/NativeSelect.js +57 -0
- package/lib/ui/NativeSelect.js.map +1 -0
- package/lib/ui/Select.js +166 -116
- package/lib/ui/Select.js.map +1 -1
- package/lib/ui/Separator.js +27 -0
- package/lib/ui/Separator.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/ui/Tabs.js +10 -10
- package/lib/ui/Tooltip.js +55 -28
- package/lib/ui/Tooltip.js.map +1 -1
- package/lib/useMutation-C6RqWmTS.js +97 -0
- package/lib/useMutation-C6RqWmTS.js.map +1 -0
- package/lib/zudoku.__internal.js +349 -349
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +7 -7
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +9 -0
- package/lib/zudoku.auth-firebase.js.map +1 -0
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +31 -34
- package/lib/zudoku.auth-supabase.js.map +1 -1
- package/lib/zudoku.components.js +7 -7
- package/lib/zudoku.hooks.js +11 -24
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.mermaid.js +10 -0
- package/lib/zudoku.mermaid.js.map +1 -0
- package/lib/zudoku.plugin-api-catalog.js +6 -6
- package/lib/zudoku.plugin-api-keys.js +225 -216
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +184 -226
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/lib/zudoku.router.js +2 -2
- package/package.json +44 -27
- package/src/app/main.css +1 -1
- package/src/app/main.tsx +5 -1
- package/src/app/sentry.ts +1 -1
- package/src/lib/auth/issuer.ts +3 -0
- package/src/lib/authentication/authentication.ts +1 -1
- package/src/lib/authentication/providers/auth0.tsx +6 -1
- package/src/lib/authentication/providers/firebase.tsx +284 -0
- package/src/lib/authentication/providers/supabase.tsx +2 -7
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +335 -0
- package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
- package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
- package/src/lib/authentication/ui/icons/Github.tsx +16 -0
- package/src/lib/authentication/ui/icons/Google.tsx +16 -0
- package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
- package/src/lib/authentication/ui/icons/X.tsx +10 -0
- package/src/lib/components/Autocomplete.tsx +11 -2
- package/src/lib/components/Layout.tsx +3 -2
- package/src/lib/components/Mermaid.tsx +68 -0
- package/src/lib/components/PagefindSearchMeta.tsx +14 -0
- package/src/lib/components/Zudoku.tsx +4 -7
- package/src/lib/components/navigation/NavigationItem.tsx +7 -20
- package/src/lib/core/RouteGuard.tsx +9 -9
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/errors/ErrorAlert.tsx +1 -1
- package/src/lib/errors/RouterError.tsx +7 -2
- package/src/lib/oas/parser/index.ts +10 -3
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +115 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +20 -27
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
- package/src/lib/plugins/openapi/OasProvider.tsx +30 -17
- package/src/lib/plugins/openapi/OperationList.tsx +46 -21
- package/src/lib/plugins/openapi/OperationListItem.tsx +15 -12
- package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
- package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +101 -33
- package/src/lib/plugins/openapi/SchemaList.tsx +4 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +145 -65
- package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
- package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
- package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
- package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
- package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
- package/src/lib/plugins/openapi/index.tsx +16 -7
- package/src/lib/plugins/openapi/interfaces.ts +28 -7
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
- package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
- package/src/lib/plugins/openapi/playground/Playground.tsx +75 -33
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
- package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
- package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
- package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +98 -60
- package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
- package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
- package/src/lib/plugins/openapi/schema/utils.ts +5 -2
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +11 -11
- package/src/lib/plugins/openapi/util/getRoutes.tsx +35 -3
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +163 -0
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +61 -22
- package/src/lib/plugins/search-pagefind/ResultList.tsx +8 -3
- package/src/lib/shiki.ts +21 -12
- package/src/lib/ui/Badge.tsx +21 -12
- package/src/lib/ui/Button.tsx +10 -9
- package/src/lib/ui/ButtonGroup.tsx +82 -0
- package/src/lib/ui/Checkbox.tsx +23 -24
- package/src/lib/ui/CodeBlock.tsx +3 -4
- package/src/lib/ui/Collapsible.tsx +26 -4
- package/src/lib/ui/Command.tsx +3 -3
- package/src/lib/ui/DropdownMenu.tsx +226 -170
- package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -19
- package/src/lib/ui/Frame.tsx +81 -0
- package/src/lib/ui/Item.tsx +192 -0
- package/src/lib/ui/Kbd.tsx +28 -0
- package/src/lib/ui/NativeSelect.tsx +47 -0
- package/src/lib/ui/Select.tsx +153 -126
- package/src/lib/ui/Separator.tsx +25 -0
- package/src/lib/ui/Tooltip.tsx +54 -32
- package/src/lib/util/MdxComponents.tsx +2 -0
- package/src/lib/util/createVariantComponent.tsx +31 -5
- package/src/lib/util/flattenAllOf.test.ts +689 -0
- package/src/lib/util/flattenAllOf.ts +122 -0
- package/src/lib/util/readFrontmatter.ts +13 -0
- package/src/shiki/langs/markdown-nix.js +1 -0
- package/src/shiki/langs/openscad.js +1 -0
- package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
- package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
- package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
- package/dist/vite/create-pagefind-index.d.ts +0 -4
- package/dist/vite/create-pagefind-index.js +0 -12
- package/dist/vite/create-pagefind-index.js.map +0 -1
- package/lib/Button-DmS4u8Lj.js +0 -51
- package/lib/Button-DmS4u8Lj.js.map +0 -1
- package/lib/Command-CUcrW3qs.js.map +0 -1
- package/lib/DropdownMenu-BZ2NKQ3K.js +0 -126
- package/lib/DropdownMenu-BZ2NKQ3K.js.map +0 -1
- package/lib/ErrorAlert-DE3Sf66a.js.map +0 -1
- package/lib/MdxPage-DZfeC0QY.js +0 -240
- package/lib/MdxPage-DZfeC0QY.js.map +0 -1
- package/lib/OasProvider-Bf5zBDBY.js +0 -36
- package/lib/OasProvider-Bf5zBDBY.js.map +0 -1
- package/lib/OperationList-Cmiw1xm2.js +0 -5446
- package/lib/OperationList-Cmiw1xm2.js.map +0 -1
- package/lib/Pagination-CJszmeSA.js +0 -37
- package/lib/Pagination-CJszmeSA.js.map +0 -1
- package/lib/RouteGuard-DhU3LRr1.js +0 -81
- package/lib/RouteGuard-DhU3LRr1.js.map +0 -1
- package/lib/RouterError-VDLnrFqF.js +0 -41
- package/lib/RouterError-VDLnrFqF.js.map +0 -1
- package/lib/SchemaList-xZSf3IMh.js.map +0 -1
- package/lib/SchemaView-tHXTm5oM.js +0 -458
- package/lib/SchemaView-tHXTm5oM.js.map +0 -1
- package/lib/Select-C1DeCqKv.js +0 -372
- package/lib/Select-C1DeCqKv.js.map +0 -1
- package/lib/circular-DvuimBGQ.js.map +0 -1
- package/lib/createServer-D9UvCoDf.js +0 -12559
- package/lib/createServer-D9UvCoDf.js.map +0 -1
- package/lib/index-Cr9_YzOZ.js +0 -3364
- package/lib/index-Cr9_YzOZ.js.map +0 -1
- package/lib/useExposedProps-U3pmsHaG.js +0 -113
- package/lib/useExposedProps-U3pmsHaG.js.map +0 -1
- package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
- package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import type { JSONSchema7 } from "json-schema";
|
|
2
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
|
+
import type { OpenAPIDocument } from "../oas/parser/index.js";
|
|
4
|
+
import { flattenAllOf, flattenAllOfProcessor } from "./flattenAllOf.js";
|
|
5
|
+
import invariant from "./invariant.js";
|
|
6
|
+
|
|
7
|
+
describe("flattenAllOf", () => {
|
|
8
|
+
it("should merge two simple schemas", () => {
|
|
9
|
+
const schema = {
|
|
10
|
+
allOf: [
|
|
11
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
12
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
13
|
+
],
|
|
14
|
+
} as JSONSchema7;
|
|
15
|
+
|
|
16
|
+
const result = flattenAllOf(schema);
|
|
17
|
+
|
|
18
|
+
expect(result).toMatchObject({
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
id: { type: "string" },
|
|
22
|
+
name: { type: "string" },
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
expect(result).not.toHaveProperty("allOf");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should merge nested allOf chains", () => {
|
|
29
|
+
const schema = {
|
|
30
|
+
allOf: [
|
|
31
|
+
{
|
|
32
|
+
allOf: [
|
|
33
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
34
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{ type: "object", properties: { email: { type: "string" } } },
|
|
38
|
+
],
|
|
39
|
+
} as JSONSchema7;
|
|
40
|
+
|
|
41
|
+
const result = flattenAllOf(schema);
|
|
42
|
+
|
|
43
|
+
expect(result).toMatchObject({
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
id: { type: "string" },
|
|
47
|
+
name: { type: "string" },
|
|
48
|
+
email: { type: "string" },
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
expect(result).not.toHaveProperty("allOf");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("should recursively flatten allOf in nested properties", () => {
|
|
55
|
+
const schema = {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
user: {
|
|
59
|
+
allOf: [
|
|
60
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
61
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
} as JSONSchema7;
|
|
66
|
+
|
|
67
|
+
const result = flattenAllOf(schema);
|
|
68
|
+
|
|
69
|
+
invariant(
|
|
70
|
+
typeof result === "object" && result.properties,
|
|
71
|
+
"Result is not a schema",
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
expect(result.properties?.user).toMatchObject({
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
id: { type: "string" },
|
|
78
|
+
name: { type: "string" },
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
expect(result.properties.user).not.toHaveProperty("allOf");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("should flatten allOf in array items", () => {
|
|
85
|
+
const schema = {
|
|
86
|
+
type: "array",
|
|
87
|
+
items: {
|
|
88
|
+
allOf: [
|
|
89
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
90
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
} as JSONSchema7;
|
|
94
|
+
|
|
95
|
+
const result = flattenAllOf(schema);
|
|
96
|
+
|
|
97
|
+
invariant(
|
|
98
|
+
typeof result === "object" && result.items,
|
|
99
|
+
"Result is not a schema",
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
expect(result.items).toMatchObject({
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
id: { type: "string" },
|
|
106
|
+
name: { type: "string" },
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
expect(result.items).not.toHaveProperty("allOf");
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("should flatten allOf in tuple items", () => {
|
|
113
|
+
const schema = {
|
|
114
|
+
type: "array",
|
|
115
|
+
items: [
|
|
116
|
+
{
|
|
117
|
+
allOf: [
|
|
118
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
119
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{ type: "string" },
|
|
123
|
+
],
|
|
124
|
+
} as JSONSchema7;
|
|
125
|
+
|
|
126
|
+
const result = flattenAllOf(schema);
|
|
127
|
+
|
|
128
|
+
invariant(
|
|
129
|
+
typeof result === "object" && Array.isArray(result.items),
|
|
130
|
+
"Result is not a schema",
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
expect(result.items[0]).toMatchObject({
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
id: { type: "string" },
|
|
137
|
+
name: { type: "string" },
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
expect(result.items[0]).not.toHaveProperty("allOf");
|
|
141
|
+
expect(result.items[1]).toEqual({ type: "string" });
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("should flatten allOf in additionalProperties", () => {
|
|
145
|
+
const schema = {
|
|
146
|
+
type: "object",
|
|
147
|
+
additionalProperties: {
|
|
148
|
+
allOf: [
|
|
149
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
150
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
} as JSONSchema7;
|
|
154
|
+
|
|
155
|
+
const result = flattenAllOf(schema);
|
|
156
|
+
|
|
157
|
+
invariant(
|
|
158
|
+
typeof result === "object" && result.additionalProperties,
|
|
159
|
+
"Result is not a schema",
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
expect(result.additionalProperties as JSONSchema7).toMatchObject({
|
|
163
|
+
type: "object",
|
|
164
|
+
properties: {
|
|
165
|
+
id: { type: "string" },
|
|
166
|
+
name: { type: "string" },
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
expect(result.additionalProperties).not.toHaveProperty("allOf");
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("should flatten allOf within anyOf", () => {
|
|
173
|
+
const schema = {
|
|
174
|
+
anyOf: [
|
|
175
|
+
{
|
|
176
|
+
allOf: [
|
|
177
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
178
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{ type: "string" },
|
|
182
|
+
],
|
|
183
|
+
} as JSONSchema7;
|
|
184
|
+
|
|
185
|
+
const result = flattenAllOf(schema);
|
|
186
|
+
|
|
187
|
+
invariant(
|
|
188
|
+
typeof result === "object" && result.anyOf,
|
|
189
|
+
"Result is not a schema",
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
expect(result.anyOf[0]).toMatchObject({
|
|
193
|
+
type: "object",
|
|
194
|
+
properties: {
|
|
195
|
+
id: { type: "string" },
|
|
196
|
+
name: { type: "string" },
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
expect(result.anyOf[0]).not.toHaveProperty("allOf");
|
|
200
|
+
expect(result.anyOf[1]).toEqual({ type: "string" });
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("should flatten allOf within oneOf", () => {
|
|
204
|
+
const schema = {
|
|
205
|
+
oneOf: [
|
|
206
|
+
{
|
|
207
|
+
allOf: [
|
|
208
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
209
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
{ type: "string" },
|
|
213
|
+
],
|
|
214
|
+
} as JSONSchema7;
|
|
215
|
+
|
|
216
|
+
const result = flattenAllOf(schema);
|
|
217
|
+
|
|
218
|
+
invariant(
|
|
219
|
+
typeof result === "object" && result.oneOf,
|
|
220
|
+
"Result is not a schema",
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
expect(result.oneOf[0]).toMatchObject({
|
|
224
|
+
type: "object",
|
|
225
|
+
properties: {
|
|
226
|
+
id: { type: "string" },
|
|
227
|
+
name: { type: "string" },
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
expect(result.oneOf[0]).not.toHaveProperty("allOf");
|
|
231
|
+
expect(result.oneOf[1]).toEqual({ type: "string" });
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it("should handle schemas without allOf", () => {
|
|
235
|
+
const schema = { type: "string" } as JSONSchema7;
|
|
236
|
+
expect(flattenAllOf(schema)).toEqual({ type: "string" });
|
|
237
|
+
|
|
238
|
+
const objectSchema = {
|
|
239
|
+
type: "object",
|
|
240
|
+
properties: { id: { type: "string" } },
|
|
241
|
+
} as JSONSchema7;
|
|
242
|
+
expect(flattenAllOf(objectSchema)).toEqual(objectSchema);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it("should preserve description and other properties", () => {
|
|
246
|
+
const schema = {
|
|
247
|
+
description: "A test schema",
|
|
248
|
+
allOf: [
|
|
249
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
250
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
251
|
+
],
|
|
252
|
+
} as JSONSchema7;
|
|
253
|
+
|
|
254
|
+
const result = flattenAllOf(schema);
|
|
255
|
+
|
|
256
|
+
invariant(typeof result === "object", "Result is not a schema");
|
|
257
|
+
|
|
258
|
+
expect(result.description).toBe("A test schema");
|
|
259
|
+
expect(result.properties).toBeDefined();
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it("should merge required arrays", () => {
|
|
263
|
+
const schema = {
|
|
264
|
+
allOf: [
|
|
265
|
+
{
|
|
266
|
+
type: "object",
|
|
267
|
+
properties: { id: { type: "string" } },
|
|
268
|
+
required: ["id"],
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
type: "object",
|
|
272
|
+
properties: { name: { type: "string" } },
|
|
273
|
+
required: ["name"],
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
} as JSONSchema7;
|
|
277
|
+
|
|
278
|
+
const result = flattenAllOf(schema);
|
|
279
|
+
|
|
280
|
+
invariant(typeof result === "object", "Result is not a schema");
|
|
281
|
+
|
|
282
|
+
expect(result.required).toEqual(expect.arrayContaining(["id", "name"]));
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it("should handle complex nested structures", () => {
|
|
286
|
+
const schema = {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
booking: {
|
|
290
|
+
allOf: [
|
|
291
|
+
{
|
|
292
|
+
allOf: [
|
|
293
|
+
{
|
|
294
|
+
type: "object",
|
|
295
|
+
properties: { quoteId: { type: "string" } },
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
type: "object",
|
|
299
|
+
properties: { price: { type: "number" } },
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: { bookingId: { type: "string" } },
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
} as JSONSchema7;
|
|
311
|
+
|
|
312
|
+
const result = flattenAllOf(schema);
|
|
313
|
+
|
|
314
|
+
invariant(
|
|
315
|
+
typeof result === "object" && result.properties,
|
|
316
|
+
"Result is not a schema",
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
expect(result.properties.booking).toMatchObject({
|
|
320
|
+
type: "object",
|
|
321
|
+
properties: {
|
|
322
|
+
quoteId: { type: "string" },
|
|
323
|
+
price: { type: "number" },
|
|
324
|
+
bookingId: { type: "string" },
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
expect(result.properties.booking).not.toHaveProperty("allOf");
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
describe("flattenAllOf processor", () => {
|
|
332
|
+
it("should process an OpenAPI document and flatten allOf", async () => {
|
|
333
|
+
const schema: OpenAPIDocument = {
|
|
334
|
+
openapi: "3.0.0",
|
|
335
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
336
|
+
paths: {
|
|
337
|
+
"/users": {
|
|
338
|
+
get: {
|
|
339
|
+
responses: {
|
|
340
|
+
"200": {
|
|
341
|
+
description: "Success",
|
|
342
|
+
content: {
|
|
343
|
+
"application/json": {
|
|
344
|
+
schema: {
|
|
345
|
+
allOf: [
|
|
346
|
+
{
|
|
347
|
+
type: "object",
|
|
348
|
+
properties: { id: { type: "string" } },
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
type: "object",
|
|
352
|
+
properties: { name: { type: "string" } },
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
const result = await flattenAllOfProcessor({
|
|
366
|
+
schema,
|
|
367
|
+
file: "/test/schema.json",
|
|
368
|
+
dereference: vi.fn(),
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
const responseSchema =
|
|
372
|
+
result.paths?.["/users"]?.get?.responses?.[200]?.content?.[
|
|
373
|
+
"application/json"
|
|
374
|
+
]?.schema;
|
|
375
|
+
|
|
376
|
+
expect(responseSchema).toMatchObject({
|
|
377
|
+
type: "object",
|
|
378
|
+
properties: {
|
|
379
|
+
id: { type: "string" },
|
|
380
|
+
name: { type: "string" },
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
expect(responseSchema).not.toHaveProperty("allOf");
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it("should process components.schemas and flatten allOf", async () => {
|
|
387
|
+
const schema: OpenAPIDocument = {
|
|
388
|
+
openapi: "3.0.0",
|
|
389
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
390
|
+
paths: {},
|
|
391
|
+
components: {
|
|
392
|
+
schemas: {
|
|
393
|
+
User: {
|
|
394
|
+
allOf: [
|
|
395
|
+
{ type: "object", properties: { id: { type: "string" } } },
|
|
396
|
+
{ type: "object", properties: { name: { type: "string" } } },
|
|
397
|
+
],
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
const mockDereference = vi.fn().mockResolvedValue(schema);
|
|
404
|
+
|
|
405
|
+
const result = await flattenAllOfProcessor({
|
|
406
|
+
schema,
|
|
407
|
+
file: "/test/schema.json",
|
|
408
|
+
dereference: mockDereference,
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
const userSchema = result.components?.schemas?.User;
|
|
412
|
+
expect(userSchema).toMatchObject({
|
|
413
|
+
type: "object",
|
|
414
|
+
properties: {
|
|
415
|
+
id: { type: "string" },
|
|
416
|
+
name: { type: "string" },
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
expect(userSchema).not.toHaveProperty("allOf");
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it("should handle schemas without allOf gracefully", async () => {
|
|
423
|
+
const schema: OpenAPIDocument = {
|
|
424
|
+
openapi: "3.0.0",
|
|
425
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
426
|
+
paths: {},
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
const result = await flattenAllOfProcessor({
|
|
430
|
+
schema,
|
|
431
|
+
file: "/test/schema.json",
|
|
432
|
+
dereference: vi.fn(),
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
expect(result).toStrictEqual(schema);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
it("should only flatten schema objects, not other OpenAPI structures", async () => {
|
|
439
|
+
const schema: OpenAPIDocument = {
|
|
440
|
+
openapi: "3.0.0",
|
|
441
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
442
|
+
paths: {
|
|
443
|
+
"/users": {
|
|
444
|
+
get: {
|
|
445
|
+
operationId: "getUsers",
|
|
446
|
+
tags: ["users"],
|
|
447
|
+
responses: {
|
|
448
|
+
"200": {
|
|
449
|
+
description: "Success",
|
|
450
|
+
content: {
|
|
451
|
+
"application/json": {
|
|
452
|
+
schema: {
|
|
453
|
+
allOf: [
|
|
454
|
+
{
|
|
455
|
+
type: "object",
|
|
456
|
+
properties: { id: { type: "string" } },
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
type: "object",
|
|
460
|
+
properties: { name: { type: "string" } },
|
|
461
|
+
},
|
|
462
|
+
],
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
const mockDereference = vi.fn().mockResolvedValue(schema);
|
|
474
|
+
|
|
475
|
+
const result = await flattenAllOfProcessor({
|
|
476
|
+
schema,
|
|
477
|
+
file: "/test/schema.json",
|
|
478
|
+
dereference: mockDereference,
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// Operation objects should not be flattened
|
|
482
|
+
const operation = result.paths?.["/users"]?.get;
|
|
483
|
+
expect(operation?.operationId).toBe("getUsers");
|
|
484
|
+
expect(operation?.tags).toEqual(["users"]);
|
|
485
|
+
|
|
486
|
+
// But schema objects should be flattened
|
|
487
|
+
const responseSchema =
|
|
488
|
+
operation?.responses?.[200]?.content?.["application/json"]?.schema;
|
|
489
|
+
expect(responseSchema).not.toHaveProperty("allOf");
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
it("should handle deeply nested allOf in request bodies", async () => {
|
|
493
|
+
const schema: OpenAPIDocument = {
|
|
494
|
+
openapi: "3.0.0",
|
|
495
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
496
|
+
paths: {
|
|
497
|
+
"/bookings": {
|
|
498
|
+
post: {
|
|
499
|
+
requestBody: {
|
|
500
|
+
content: {
|
|
501
|
+
"application/json": {
|
|
502
|
+
schema: {
|
|
503
|
+
allOf: [
|
|
504
|
+
{
|
|
505
|
+
allOf: [
|
|
506
|
+
{
|
|
507
|
+
type: "object",
|
|
508
|
+
properties: { quoteId: { type: "string" } },
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
type: "object",
|
|
512
|
+
properties: { price: { type: "number" } },
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
type: "object",
|
|
518
|
+
properties: { bookingId: { type: "string" } },
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
},
|
|
525
|
+
responses: {},
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
const mockDereference = vi.fn().mockResolvedValue(schema);
|
|
532
|
+
|
|
533
|
+
const result = await flattenAllOfProcessor({
|
|
534
|
+
schema,
|
|
535
|
+
file: "/test/schema.json",
|
|
536
|
+
dereference: mockDereference,
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
const requestSchema =
|
|
540
|
+
result.paths?.["/bookings"]?.post?.requestBody?.content?.[
|
|
541
|
+
"application/json"
|
|
542
|
+
]?.schema;
|
|
543
|
+
|
|
544
|
+
expect(requestSchema).toMatchObject({
|
|
545
|
+
type: "object",
|
|
546
|
+
properties: {
|
|
547
|
+
quoteId: { type: "string" },
|
|
548
|
+
price: { type: "number" },
|
|
549
|
+
bookingId: { type: "string" },
|
|
550
|
+
},
|
|
551
|
+
});
|
|
552
|
+
expect(requestSchema).not.toHaveProperty("allOf");
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
it("should handle mixed allOf and oneOf combinations", async () => {
|
|
556
|
+
const schema: OpenAPIDocument = {
|
|
557
|
+
openapi: "3.0.0",
|
|
558
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
559
|
+
paths: {},
|
|
560
|
+
components: {
|
|
561
|
+
schemas: {
|
|
562
|
+
Container: {
|
|
563
|
+
oneOf: [
|
|
564
|
+
{
|
|
565
|
+
allOf: [
|
|
566
|
+
{
|
|
567
|
+
type: "object",
|
|
568
|
+
properties: { type: { type: "string", const: "standard" } },
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
type: "object",
|
|
572
|
+
properties: { weight: { type: "number" } },
|
|
573
|
+
},
|
|
574
|
+
],
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
allOf: [
|
|
578
|
+
{
|
|
579
|
+
type: "object",
|
|
580
|
+
properties: {
|
|
581
|
+
type: { type: "string", const: "refrigerated" },
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
type: "object",
|
|
586
|
+
properties: { temperature: { type: "number" } },
|
|
587
|
+
},
|
|
588
|
+
],
|
|
589
|
+
},
|
|
590
|
+
],
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
const mockDereference = vi.fn().mockResolvedValue(schema);
|
|
597
|
+
|
|
598
|
+
const result = await flattenAllOfProcessor({
|
|
599
|
+
schema,
|
|
600
|
+
file: "/test/schema.json",
|
|
601
|
+
dereference: mockDereference,
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
const containerSchema = result.components?.schemas?.Container;
|
|
605
|
+
expect(containerSchema?.oneOf?.[0]).toMatchObject({
|
|
606
|
+
type: "object",
|
|
607
|
+
properties: {
|
|
608
|
+
type: { type: "string", const: "standard" },
|
|
609
|
+
weight: { type: "number" },
|
|
610
|
+
},
|
|
611
|
+
});
|
|
612
|
+
expect(containerSchema?.oneOf?.[0]).not.toHaveProperty("allOf");
|
|
613
|
+
expect(containerSchema?.oneOf?.[1]).toMatchObject({
|
|
614
|
+
type: "object",
|
|
615
|
+
properties: {
|
|
616
|
+
type: { type: "string", const: "refrigerated" },
|
|
617
|
+
temperature: { type: "number" },
|
|
618
|
+
},
|
|
619
|
+
});
|
|
620
|
+
expect(containerSchema?.oneOf?.[1]).not.toHaveProperty("allOf");
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
it("should preserve $refs outside of allOf while flattening allOf with $refs", async () => {
|
|
624
|
+
// Schema with:
|
|
625
|
+
// 1. A reusable component (Base) that's referenced multiple times
|
|
626
|
+
// 2. An allOf that references Base (should be resolved for merging)
|
|
627
|
+
// 3. A property that references Base (should stay as $ref)
|
|
628
|
+
const schema = {
|
|
629
|
+
openapi: "3.0.0",
|
|
630
|
+
info: { title: "Test API", version: "1.0.0" },
|
|
631
|
+
paths: {},
|
|
632
|
+
components: {
|
|
633
|
+
schemas: {
|
|
634
|
+
Base: {
|
|
635
|
+
type: "object",
|
|
636
|
+
properties: {
|
|
637
|
+
id: { type: "string" },
|
|
638
|
+
createdAt: { type: "string", format: "date-time" },
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
Extended: {
|
|
642
|
+
allOf: [
|
|
643
|
+
{ $ref: "#/components/schemas/Base" },
|
|
644
|
+
{
|
|
645
|
+
type: "object",
|
|
646
|
+
properties: {
|
|
647
|
+
name: { type: "string" },
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
],
|
|
651
|
+
},
|
|
652
|
+
Container: {
|
|
653
|
+
type: "object",
|
|
654
|
+
properties: {
|
|
655
|
+
// This $ref should NOT be expanded
|
|
656
|
+
nested: { $ref: "#/components/schemas/Base" },
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
},
|
|
660
|
+
},
|
|
661
|
+
} as OpenAPIDocument;
|
|
662
|
+
|
|
663
|
+
const result = await flattenAllOfProcessor({
|
|
664
|
+
schema,
|
|
665
|
+
file: "/test/schema.json",
|
|
666
|
+
dereference: vi.fn(),
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// Extended should have allOf flattened (merged with Base)
|
|
670
|
+
const extendedSchema = result.components?.schemas?.Extended;
|
|
671
|
+
expect(extendedSchema).not.toHaveProperty("allOf");
|
|
672
|
+
expect(extendedSchema).toMatchObject({
|
|
673
|
+
type: "object",
|
|
674
|
+
properties: {
|
|
675
|
+
id: { type: "string" },
|
|
676
|
+
createdAt: { type: "string", format: "date-time" },
|
|
677
|
+
name: { type: "string" },
|
|
678
|
+
},
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
// Container.nested should still be a $ref (NOT expanded)
|
|
682
|
+
const containerSchema = result.components?.schemas
|
|
683
|
+
?.Container as unknown as Record<string, unknown>;
|
|
684
|
+
const nestedProp = (containerSchema?.properties as Record<string, unknown>)
|
|
685
|
+
?.nested as Record<string, unknown>;
|
|
686
|
+
expect(nestedProp).toHaveProperty("$ref");
|
|
687
|
+
expect(nestedProp.$ref).toBe("#/components/schemas/Base");
|
|
688
|
+
});
|
|
689
|
+
});
|