@redocly/reef 0.137.0-next.1 → 0.137.0-next.10
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/CHANGELOG.md +201 -0
- package/dist/api-schemas/otel-traces.d.ts +1359 -0
- package/dist/api-schemas/otel-traces.js +1 -0
- package/dist/cli/stats/collectors/asyncapi/index.d.ts +3 -0
- package/dist/cli/stats/collectors/asyncapi/index.js +1 -0
- package/dist/cli/stats/collectors/extension-sampling.d.ts +44 -0
- package/dist/cli/stats/collectors/extension-sampling.js +1 -0
- package/dist/cli/stats/collectors/openapi/index.js +1 -1
- package/dist/cli/stats/collectors/prepare-stats-walk.d.ts +10 -0
- package/dist/cli/stats/collectors/prepare-stats-walk.js +1 -0
- package/dist/cli/stats/collectors/run-stats-collector.d.ts +24 -0
- package/dist/cli/stats/collectors/run-stats-collector.js +1 -0
- package/dist/cli/stats/index.js +1 -1
- package/dist/client/app/hooks/useMcpData.d.ts +1 -0
- package/dist/client/app/hooks/useMcpData.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/json-schema.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-code-sample.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-example.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/openapi-response-sample.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -1
- package/dist/client/app/markdoc/custom-components/openapi/use-markdown-adapter.d.ts +45 -0
- package/dist/client/app/markdoc/custom-components/openapi/use-markdown-adapter.js +1 -0
- package/dist/client/app/utils/loadAndNavigate.js +1 -1
- package/dist/client/providers/hooks.js +1 -1
- package/dist/client/providers/post-message/PostMessageProvider.js +1 -1
- package/dist/client/templates/api-docs/helpers.d.ts +4 -1
- package/dist/client/templates/api-docs/helpers.js +5 -1
- package/dist/client/templates/api-docs/template.js +8 -3
- package/dist/client/utils/catalog/get-next-page-param.d.ts +1 -1
- package/dist/client/utils/catalog/get-next-page-param.js +1 -1
- package/dist/compiled/svgo/svgo-node.js +32 -32
- package/dist/constants/l10n/langs/ar.js +1 -1
- package/dist/constants/l10n/langs/de.js +1 -1
- package/dist/constants/l10n/langs/en.js +1 -1
- package/dist/constants/l10n/langs/es.js +1 -1
- package/dist/constants/l10n/langs/fr.js +1 -1
- package/dist/constants/l10n/langs/hi.js +1 -1
- package/dist/constants/l10n/langs/it.js +1 -1
- package/dist/constants/l10n/langs/ja.js +1 -1
- package/dist/constants/l10n/langs/ko.js +1 -1
- package/dist/constants/l10n/langs/pl.js +1 -1
- package/dist/constants/l10n/langs/pt-BR.js +1 -1
- package/dist/constants/l10n/langs/pt.js +1 -1
- package/dist/constants/l10n/langs/ru.js +1 -1
- package/dist/constants/l10n/langs/uk.js +1 -1
- package/dist/constants/l10n/langs/zh.js +1 -1
- package/dist/server/config/env-config.d.ts +6 -0
- package/dist/server/config/env-schema.d.ts +15 -0
- package/dist/server/config/env-schemas/feature-flags.d.ts +9 -1
- package/dist/server/config/env-schemas/feature-flags.js +1 -1
- package/dist/server/config/env-schemas/search.d.ts +3 -0
- package/dist/server/config/env-schemas/search.js +1 -1
- package/dist/server/constants/common.d.ts +1 -0
- package/dist/server/constants/common.js +1 -1
- package/dist/server/constants/mcp.d.ts +5 -0
- package/dist/server/constants/mcp.js +1 -0
- package/dist/server/constants/plugins/search.d.ts +0 -2
- package/dist/server/constants/plugins/search.js +1 -1
- package/dist/server/constants/rbac.d.ts +3 -0
- package/dist/server/constants/rbac.js +1 -0
- package/dist/server/esbuild/esbuild.js +3 -3
- package/dist/server/esbuild/plugins/mcp-tool-handlers-resolver.js +1 -1
- package/dist/server/plugins/api-docs/options.js +1 -1
- package/dist/server/plugins/api-docs/search/create-indexer.d.ts +5 -0
- package/dist/server/plugins/api-docs/search/create-indexer.js +1 -0
- package/dist/server/plugins/api-docs/search/get-ai-search-documents.js +28 -28
- package/dist/server/plugins/api-docs/search/search-resolver.js +1 -1
- package/dist/server/plugins/{openapi-docs/is-openapi-doc.d.ts → api-docs/utils/is-api-doc.d.ts} +4 -2
- package/dist/server/plugins/api-docs/utils/is-api-doc.js +1 -0
- package/dist/server/plugins/arazzo-docs/arazzo-doc-loader.d.ts +1 -1
- package/dist/server/plugins/arazzo-docs/arazzo-doc-loader.js +1 -1
- package/dist/server/plugins/entitlements/index.js +1 -1
- package/dist/server/plugins/l10n/index.js +1 -1
- package/dist/server/plugins/lifecycle.js +2 -2
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-link.js +1 -1
- package/dist/server/plugins/markdown/attribute-resolvers/resolve-open-api-ref.js +1 -1
- package/dist/server/plugins/markdown/html/html-jsx-attribute-mapping.js +1 -1
- package/dist/server/plugins/markdown/utils/sanitize-malformed-md-content.js +2 -2
- package/dist/server/plugins/mcp/auth/auth-handlers.d.ts +1 -2
- package/dist/server/plugins/mcp/auth/auth-handlers.js +1 -1
- package/dist/server/plugins/mcp/auth/token-audience-telemetry.d.ts +7 -0
- package/dist/server/plugins/mcp/auth/token-audience-telemetry.js +1 -0
- package/dist/server/plugins/mcp/auth/token-audience.d.ts +6 -0
- package/dist/server/plugins/mcp/auth/token-audience.js +1 -0
- package/dist/server/plugins/mcp/codemode/capabilities/fetch/index.js +4 -4
- package/dist/server/plugins/mcp/codemode/code-execution-telemetry.d.ts +3 -1
- package/dist/server/plugins/mcp/codemode/code-execution-telemetry.js +1 -1
- package/dist/server/plugins/mcp/codemode/invoke-tool.js +1 -1
- package/dist/server/plugins/mcp/codemode/prompts.js +1 -1
- package/dist/server/plugins/mcp/codemode/sandbox/polyfills/fetch-shim.d.ts +1 -1
- package/dist/server/plugins/mcp/codemode/sandbox/polyfills/fetch-shim.js +9 -3
- package/dist/server/plugins/mcp/codemode/tools/describe-tools.d.ts +1 -1
- package/dist/server/plugins/mcp/codemode/tools/describe-tools.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/execute-schema.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.d.ts +1 -0
- package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -2
- package/dist/server/plugins/mcp/codemode/types.d.ts +1 -0
- package/dist/server/plugins/mcp/constants.d.ts +1 -1
- package/dist/server/plugins/mcp/constants.js +1 -1
- package/dist/server/plugins/mcp/custom-tools/extract-tool-definition.d.ts +13 -0
- package/dist/server/plugins/mcp/custom-tools/extract-tool-definition.js +1 -0
- package/dist/server/plugins/mcp/custom-tools/scan-custom-tools.d.ts +6 -0
- package/dist/server/plugins/mcp/custom-tools/scan-custom-tools.js +1 -0
- package/dist/server/plugins/mcp/custom-tools/validate-tool-definition.d.ts +3 -0
- package/dist/server/plugins/mcp/custom-tools/validate-tool-definition.js +1 -0
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.d.ts +2 -0
- package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/core/search.js +2 -2
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoints.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
- package/dist/server/plugins/mcp/docs-mcp/tools/openapi/utils.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/callable-apis.d.ts +10 -0
- package/dist/server/plugins/mcp/gateway-mcp/callable-apis.js +1 -0
- package/dist/server/plugins/mcp/gateway-mcp/credential-validation.d.ts +4 -0
- package/dist/server/plugins/mcp/gateway-mcp/credential-validation.js +1 -0
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +15 -5
- package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +5 -3
- package/dist/server/plugins/mcp/gateway-mcp/eligibility.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-audit.d.ts +2 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-audit.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.d.ts +10 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/fetch/upstream-detail.d.ts +7 -0
- package/dist/server/plugins/mcp/gateway-mcp/fetch/upstream-detail.js +1 -0
- package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.d.ts +2 -10
- package/dist/server/plugins/mcp/gateway-mcp/fetch-capability.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +16 -4
- package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -1
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.d.ts +26 -1
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth-scheme.js +2 -1
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +12 -0
- package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -1
- package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
- package/dist/server/plugins/mcp/handlers/errors.d.ts +7 -2
- package/dist/server/plugins/mcp/handlers/errors.js +1 -1
- package/dist/server/plugins/mcp/handlers/handle-mcp-request.js +1 -1
- package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +1 -124
- package/dist/server/plugins/mcp/handlers/mcp-credentials-page.d.ts +12 -0
- package/dist/server/plugins/mcp/handlers/mcp-credentials-page.js +225 -0
- package/dist/server/plugins/mcp/index.d.ts +0 -2
- package/dist/server/plugins/mcp/index.js +1 -1
- package/dist/server/plugins/mcp/servers/docs-server.d.ts +2 -2
- package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
- package/dist/server/plugins/mcp/servers/mcp-server.d.ts +2 -11
- package/dist/server/plugins/mcp/servers/mcp-server.js +4 -2
- package/dist/server/plugins/mcp/types.d.ts +32 -5
- package/dist/server/plugins/mcp/utils/available-sandbox-tools.d.ts +4 -0
- package/dist/server/plugins/mcp/utils/available-sandbox-tools.js +1 -0
- package/dist/server/plugins/mcp/utils/find-gated-tool-names.d.ts +12 -0
- package/dist/server/plugins/mcp/utils/find-gated-tool-names.js +1 -0
- package/dist/server/plugins/mcp/utils/mcp-client.d.ts +13 -0
- package/dist/server/plugins/mcp/utils/mcp-client.js +1 -0
- package/dist/server/plugins/mcp/utils/tool-registration.d.ts +17 -0
- package/dist/server/plugins/mcp/utils/tool-registration.js +1 -0
- package/dist/server/plugins/mcp/workers/execute-mcp-tool.d.ts +6 -1
- package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
- package/dist/server/plugins/mcp/workers/import-mcp-tool-handlers.d.ts +5 -0
- package/dist/server/plugins/mcp/workers/import-mcp-tool-handlers.js +1 -0
- package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.d.ts +6 -11
- package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.js +1 -1
- package/dist/server/plugins/mcp/workers/tool-file-system.d.ts +6 -0
- package/dist/server/plugins/mcp/workers/tool-file-system.js +1 -0
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.d.ts +4 -2
- package/dist/server/plugins/search/ai-indexer/prepare-semantic-documents.js +1 -3
- package/dist/server/plugins/search/engines/flexsearch/index.js +1 -1
- package/dist/server/plugins/search/engines/flexsearch/search-index.d.ts +8 -4
- package/dist/server/plugins/search/engines/flexsearch/search-index.js +1 -1
- package/dist/server/plugins/search/engines/typesense/index.js +1 -1
- package/dist/server/plugins/search/index.js +1 -1
- package/dist/server/plugins/search/llmstxt/build-page-llms-txt-md.d.ts +4 -0
- package/dist/server/plugins/search/llmstxt/build-page-llms-txt-md.js +3 -0
- package/dist/server/plugins/search/llmstxt/create-llms-txt-generator.d.ts +4 -0
- package/dist/server/plugins/search/llmstxt/create-llms-txt-generator.js +1 -0
- package/dist/server/plugins/search/llmstxt/get-llms-txt-exclude-matcher.d.ts +4 -0
- package/dist/server/plugins/search/llmstxt/get-llms-txt-exclude-matcher.js +1 -0
- package/dist/server/plugins/search/llmstxt/index.d.ts +2 -2
- package/dist/server/plugins/search/llmstxt/is-included-in-llms-txt.d.ts +6 -0
- package/dist/server/plugins/search/llmstxt/is-included-in-llms-txt.js +1 -0
- package/dist/server/plugins/search/utils.d.ts +2 -1
- package/dist/server/plugins/search/utils.js +2 -2
- package/dist/server/sandbox/constants/sandbox.d.ts +4 -1
- package/dist/server/sandbox/constants/sandbox.js +1 -1
- package/dist/server/sandbox/sandbox.js +2 -2
- package/dist/server/sandbox/utils/returns-from-top-level.d.ts +4 -0
- package/dist/server/sandbox/utils/returns-from-top-level.js +1 -0
- package/dist/server/store.d.ts +2 -0
- package/dist/server/store.js +1 -1
- package/dist/server/types/plugins/common.d.ts +5 -0
- package/dist/server/types/plugins/search.d.ts +7 -2
- package/dist/server/types/web-server.d.ts +8 -0
- package/dist/server/utils/envs/get-api-route-allowed-env-variables.js +1 -1
- package/dist/server/utils/get-route-ai-documents-store.d.ts +5 -0
- package/dist/server/utils/get-route-ai-documents-store.js +1 -0
- package/dist/server/utils/get-route-static-data.d.ts +4 -0
- package/dist/server/utils/get-route-static-data.js +1 -0
- package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +1 -1
- package/dist/server/utils/llmstxt/resolve-llms-txt-md.d.ts +10 -0
- package/dist/server/utils/llmstxt/resolve-llms-txt-md.js +1 -0
- package/dist/server/utils/rbac/can-anonymous-access-mcp-feature.d.ts +3 -0
- package/dist/server/utils/rbac/can-anonymous-access-mcp-feature.js +1 -0
- package/dist/server/utils/rbac/should-handle-mcp-auth.d.ts +2 -0
- package/dist/server/utils/rbac/should-handle-mcp-auth.js +1 -0
- package/dist/server/utils/rbac.js +1 -1
- package/dist/server/utils/search/highlight-text-for-search.js +1 -1
- package/dist/server/web-server/auth.d.ts +13 -2
- package/dist/server/web-server/auth.js +3 -3
- package/dist/server/web-server/dev-server.js +1 -1
- package/dist/server/web-server/handle-api-route-request.js +1 -1
- package/dist/server/web-server/middleware/ensureSearchData.js +1 -1
- package/dist/server/web-server/routes/ask-ai.d.ts +1 -0
- package/dist/server/web-server/routes/ask-ai.js +1 -1
- package/dist/server/web-server/routes/auth.js +1 -1
- package/dist/server/web-server/routes/dynamic-route.d.ts +2 -1
- package/dist/server/web-server/routes/dynamic-route.js +1 -1
- package/dist/server/web-server/routes/error.js +1 -1
- package/dist/server/web-server/routes/helpers/resolve-ui-locales-for-idp-login.js +1 -1
- package/dist/server/web-server/routes/index.d.ts +2 -1
- package/dist/server/web-server/routes/index.js +1 -1
- package/dist/server/web-server/routes/llms-txt.d.ts +4 -0
- package/dist/server/web-server/routes/llms-txt.js +1 -0
- package/dist/server/web-server/routes/mcp-routes/agent-card.js +1 -1
- package/dist/server/web-server/routes/mcp-routes/mcp-server-card.js +1 -1
- package/dist/server/web-server/routes/otel/otel.js +1 -1
- package/dist/server/web-server/routes/page-data.js +1 -1
- package/dist/server/web-server/routes/resolve-route.js +1 -1
- package/dist/server/web-server/utils/get-request-origin.d.ts +2 -0
- package/dist/server/web-server/utils/get-request-origin.js +1 -1
- package/dist/server/web-server/utils/prepare-list-response.d.ts +2 -4
- package/dist/server/web-server/utils/prepare-list-response.js +1 -1
- package/dist/server/web-server/utils.d.ts +1 -1
- package/dist/server/web-server/utils.js +1 -1
- package/dist/server/workers/mcp-tool-worker-pool.d.ts +1 -0
- package/dist/server/workers/mcp-tool-worker-pool.js +1 -1
- package/dist/server/workers/mcp-tool-worker.js +1 -1
- package/dist/server/workers/types.d.ts +9 -2
- package/dist/server/workers/worker-pool.d.ts +1 -0
- package/dist/server/workers/worker-pool.js +1 -1
- package/dist/types/global-data.d.ts +1 -0
- package/dist/utils/guards/is-plain-object.d.ts +19 -0
- package/dist/utils/guards/is-plain-object.js +1 -0
- package/package.json +12 -15
- package/dist/client/templates/asyncapi-docs/helpers.d.ts +0 -12
- package/dist/client/templates/asyncapi-docs/helpers.js +0 -1
- package/dist/client/templates/asyncapi-docs/template.d.ts +0 -15
- package/dist/client/templates/asyncapi-docs/template.js +0 -9
- package/dist/client/templates/openapi-docs/helpers.d.ts +0 -18
- package/dist/client/templates/openapi-docs/helpers.js +0 -5
- package/dist/client/templates/openapi-docs/template.d.ts +0 -6
- package/dist/client/templates/openapi-docs/template.js +0 -14
- package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-check.d.ts +0 -9
- package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-check.js +0 -1
- package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-overlay.d.ts +0 -2
- package/dist/server/esbuild/plugins/api-docs-module-replacer/empty-overlay.js +0 -1
- package/dist/server/esbuild/plugins/api-docs-module-replacer/index.d.ts +0 -6
- package/dist/server/esbuild/plugins/api-docs-module-replacer/index.js +0 -1
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-check.d.ts +0 -8
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-check.js +0 -1
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-overlay.d.ts +0 -2
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-overlay.js +0 -1
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-use-license-key.d.ts +0 -5
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/empty-use-license-key.js +0 -1
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/index.d.ts +0 -6
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/index.js +0 -1
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/loadAndBundleSpec.mock.d.ts +0 -3
- package/dist/server/esbuild/plugins/openapi-docs-module-replacer/loadAndBundleSpec.mock.js +0 -1
- package/dist/server/plugins/api-docs/search/search-indexer.d.ts +0 -9
- package/dist/server/plugins/api-docs/search/search-indexer.js +0 -1
- package/dist/server/plugins/asyncapi-docs/asyncapi-doc-loader.d.ts +0 -18
- package/dist/server/plugins/asyncapi-docs/asyncapi-doc-loader.js +0 -5
- package/dist/server/plugins/asyncapi-docs/get-server-props.d.ts +0 -4
- package/dist/server/plugins/asyncapi-docs/get-server-props.js +0 -1
- package/dist/server/plugins/asyncapi-docs/get-template-path.d.ts +0 -2
- package/dist/server/plugins/asyncapi-docs/get-template-path.js +0 -1
- package/dist/server/plugins/asyncapi-docs/index.d.ts +0 -3
- package/dist/server/plugins/asyncapi-docs/index.js +0 -1
- package/dist/server/plugins/asyncapi-docs/is-asyncapi-doc.d.ts +0 -3
- package/dist/server/plugins/asyncapi-docs/is-asyncapi-doc.js +0 -1
- package/dist/server/plugins/asyncapi-docs/search/get-ai-search-documents.d.ts +0 -9
- package/dist/server/plugins/asyncapi-docs/search/get-ai-search-documents.js +0 -56
- package/dist/server/plugins/asyncapi-docs/search/schema-processor.d.ts +0 -8
- package/dist/server/plugins/asyncapi-docs/search/schema-processor.js +0 -1
- package/dist/server/plugins/asyncapi-docs/search/search-facets.d.ts +0 -8
- package/dist/server/plugins/asyncapi-docs/search/search-facets.js +0 -1
- package/dist/server/plugins/asyncapi-docs/search/search-resolver.d.ts +0 -5
- package/dist/server/plugins/asyncapi-docs/search/search-resolver.js +0 -1
- package/dist/server/plugins/asyncapi-docs/store-definition-bundles.d.ts +0 -4
- package/dist/server/plugins/asyncapi-docs/store-definition-bundles.js +0 -1
- package/dist/server/plugins/graphql-docs/constants.d.ts +0 -2
- package/dist/server/plugins/graphql-docs/constants.js +0 -1
- package/dist/server/plugins/graphql-docs/get-template-path.d.ts +0 -2
- package/dist/server/plugins/graphql-docs/get-template-path.js +0 -1
- package/dist/server/plugins/graphql-docs/graphql-doc-loader.d.ts +0 -17
- package/dist/server/plugins/graphql-docs/graphql-doc-loader.js +0 -1
- package/dist/server/plugins/graphql-docs/index.d.ts +0 -4
- package/dist/server/plugins/graphql-docs/index.js +0 -1
- package/dist/server/plugins/graphql-docs/is-graphql-doc.d.ts +0 -2
- package/dist/server/plugins/graphql-docs/is-graphql-doc.js +0 -1
- package/dist/server/plugins/graphql-docs/search/ai/get-ai-search-document.d.ts +0 -17
- package/dist/server/plugins/graphql-docs/search/ai/get-ai-search-document.js +0 -4
- package/dist/server/plugins/graphql-docs/search/ai/utils.d.ts +0 -14
- package/dist/server/plugins/graphql-docs/search/ai/utils.js +0 -36
- package/dist/server/plugins/graphql-docs/search/search-facets.d.ts +0 -8
- package/dist/server/plugins/graphql-docs/search/search-facets.js +0 -1
- package/dist/server/plugins/graphql-docs/search/search-resolver.d.ts +0 -5
- package/dist/server/plugins/graphql-docs/search/search-resolver.js +0 -1
- package/dist/server/plugins/graphql-docs/spec-download.api.d.ts +0 -3
- package/dist/server/plugins/graphql-docs/spec-download.api.js +0 -1
- package/dist/server/plugins/graphql-docs/template/GraphQLDocs.d.ts +0 -5
- package/dist/server/plugins/graphql-docs/template/GraphQLDocs.js +0 -4
- package/dist/server/plugins/graphql-docs/types.d.ts +0 -40
- package/dist/server/plugins/graphql-docs/types.js +0 -0
- package/dist/server/plugins/openapi-docs/ai-search-indexer.d.ts +0 -14
- package/dist/server/plugins/openapi-docs/ai-search-indexer.js +0 -1
- package/dist/server/plugins/openapi-docs/decorators.d.ts +0 -25
- package/dist/server/plugins/openapi-docs/decorators.js +0 -1
- package/dist/server/plugins/openapi-docs/format-bundle-error.d.ts +0 -6
- package/dist/server/plugins/openapi-docs/format-bundle-error.js +0 -5
- package/dist/server/plugins/openapi-docs/get-server-props.d.ts +0 -4
- package/dist/server/plugins/openapi-docs/get-server-props.js +0 -1
- package/dist/server/plugins/openapi-docs/get-template-path.d.ts +0 -2
- package/dist/server/plugins/openapi-docs/get-template-path.js +0 -1
- package/dist/server/plugins/openapi-docs/index.d.ts +0 -3
- package/dist/server/plugins/openapi-docs/index.js +0 -1
- package/dist/server/plugins/openapi-docs/is-openapi-doc.js +0 -1
- package/dist/server/plugins/openapi-docs/load-definition.d.ts +0 -31
- package/dist/server/plugins/openapi-docs/load-definition.js +0 -3
- package/dist/server/plugins/openapi-docs/openapi-search-builder.d.ts +0 -24
- package/dist/server/plugins/openapi-docs/openapi-search-builder.js +0 -1
- package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.d.ts +0 -18
- package/dist/server/plugins/openapi-docs/search/get-ai-search-documents.js +0 -94
- package/dist/server/plugins/openapi-docs/search/search-facets.d.ts +0 -11
- package/dist/server/plugins/openapi-docs/search/search-facets.js +0 -1
- package/dist/server/plugins/openapi-docs/search/search-resolver.d.ts +0 -5
- package/dist/server/plugins/openapi-docs/search/search-resolver.js +0 -1
- package/dist/server/plugins/openapi-docs/search-indexer.d.ts +0 -17
- package/dist/server/plugins/openapi-docs/search-indexer.js +0 -1
- package/dist/server/plugins/openapi-docs/spec-download.api.d.ts +0 -4
- package/dist/server/plugins/openapi-docs/spec-download.api.js +0 -1
- package/dist/server/plugins/openapi-docs/store-definition-bundles.d.ts +0 -4
- package/dist/server/plugins/openapi-docs/store-definition-bundles.js +0 -1
- package/dist/server/plugins/openapi-docs/types.d.ts +0 -17
- package/dist/server/plugins/openapi-docs/types.js +0 -0
- package/dist/server/plugins/openapi-docs/utils.d.ts +0 -25
- package/dist/server/plugins/openapi-docs/utils.js +0 -1
- /package/dist/client/templates/{openapi-docs → api-docs}/mock-server-config.d.ts +0 -0
- /package/dist/client/templates/{openapi-docs → api-docs}/mock-server-config.js +0 -0
- /package/dist/{server/plugins → markdoc}/helpers/parse-partials.d.ts +0 -0
- /package/dist/{server/plugins → markdoc}/helpers/parse-partials.js +0 -0
- /package/dist/server/plugins/{openapi-docs → api-docs/utils}/ast-utils.d.ts +0 -0
- /package/dist/server/plugins/{openapi-docs → api-docs/utils}/ast-utils.js +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
2
|
export declare function getRequestOrigin(ctx: Context): string;
|
|
3
|
+
/** Request-based counterpart of `getRequestOrigin`; the same trust caveat applies. */
|
|
3
4
|
export declare function getForwardedOrigin(request: Request): string;
|
|
5
|
+
export declare function getInternalOrigin(request: Request): string | undefined;
|
|
4
6
|
//# sourceMappingURL=get-request-origin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{envConfig as i}from"../../config/env-config.js";const c=["localhost","127.0.0.1","::1","[::1]"];function n(o){return o?.split(",")[0].trim()||void 0}const a=/^(?:[A-Za-z0-9._-]+|\[[0-9A-Fa-f:.]+\])(?::\d{1,5})?$/;function s(o){const t=n(o);return t&&a.test(t)?t:void 0}function d(o){const t=n(o)?.toLowerCase();return t==="http"||t==="https"?t:void 0}function p(o){const t=o.replace(/:\d+$/,"");return c.includes(t)||t.endsWith(".localhost")}function h(o){const t=new URL(o.req.url),r=d(o.req.header("x-forwarded-proto"))||t.protocol.slice(0,-1)||"https",e=s(o.req.header("x-forwarded-host"))||t.host;return`${r}://${e}`}function u(o){const t=new URL(o.url),r=s(o.headers.get("x-forwarded-host"))||t.host;return`${d(o.headers.get("x-forwarded-proto"))||(p(r)?"http":"https")}://${r}`}function l(o){const t=o.context?.remoteAddr?.port??i.PORT;return t?`http://127.0.0.1:${t}`:void 0}export{u as getForwardedOrigin,l as getInternalOrigin,h as getRequestOrigin};
|
|
@@ -7,10 +7,8 @@ export type ListResponseResult<T extends {
|
|
|
7
7
|
page: {
|
|
8
8
|
total: number;
|
|
9
9
|
limit: number;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
startCursor: string | null;
|
|
13
|
-
endCursor: string | null;
|
|
10
|
+
nextPage: string | null;
|
|
11
|
+
previousPage: string | null;
|
|
14
12
|
};
|
|
15
13
|
};
|
|
16
14
|
export declare function prepareListResponse<T extends {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCursor as
|
|
1
|
+
import{createCursor as u}from"../../providers/database/pagination/utils/create-cursor.js";import{DEFAULT_LIMIT as l}from"../../providers/database/pagination/limit.js";function P(i){return!!(i.after||i.before)}function b(i,e,t){const r=P(e),n=e.limit??l;if(r){if(e.before)return!0;if(e.after)return i.length===n}return t!==void 0&&e.skip!==void 0?e.skip+n<t:t!==void 0?n<t:i.length===n}function v({data:i,params:e,totalCount:t,nameTransformationsFromDatabase:r={},hasMore:n}){if(!i.length)return{object:"list",items:[],page:{total:0,limit:e.limit??l,nextPage:null,previousPage:null}};const o=e.sort?.length?e.sort:[{field:"id",order:"ASC"}],f=n??b(i,e,t),s=!!(e.after||e.before&&n||e.skip!==void 0&&e.skip>0),c=u(i[0],o,r),g=u(i[i.length-1],o,r);return{object:"list",items:i,page:{total:t??0,limit:e.limit??l,nextPage:f?g:null,previousPage:s?c:null}}}export{v as prepareListResponse};
|
|
@@ -12,7 +12,7 @@ export declare function handleErrorPageRender(ctx: Context, store: Store, option
|
|
|
12
12
|
};
|
|
13
13
|
}, statusCode: ClientErrorStatusCode, templateId?: string): Promise<Response>;
|
|
14
14
|
export declare function getLoginUrlWithRedirect(redirectTo: string): string;
|
|
15
|
-
export declare function handleUnauthorizedAsset(ctx: Context): Promise<Response & import("hono").TypedResponse<
|
|
15
|
+
export declare function handleUnauthorizedAsset(ctx: Context): Promise<Response & import("hono").TypedResponse<string, -1 | 100 | 102 | 103 | 200 | 201 | 202 | 203 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511, "text">>;
|
|
16
16
|
export declare function handleUnauthorizedApiRequest(ctx: Context): Response & import("hono").TypedResponse<{
|
|
17
17
|
message: string;
|
|
18
18
|
}, -1 | 100 | 102 | 103 | 200 | 201 | 202 | 203 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511, "json">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setCookie as
|
|
1
|
+
import{setCookie as A}from"hono/cookie";import{withPathPrefix as c}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as b}from"../../constants/common.js";import{CACHE_CONTROL_NO_STORE_HEADER_VALUE as y}from"../constants/common.js";import{hasPostLogoutCookie as C}from"../utils/cookie.js";import{getAuthProviderLoginParams as _,buildLoginUrl as z}from"./auth.js";import{renderPage as O}from"../ssr/index.js";import{telemetry as R}from"../../cli/telemetry/index.js";async function F(t,r,o,n){const{isAuthenticated:a}=t.get("auth"),i=t.req.raw.headers.get("x-forwarded-host"),e=t.req.raw.headers.get("x-forwarded-proto"),w=i?`${e==="http"||e==="https"?e:"https"}://${i}`:new URL(t.req.url).origin,l=r.getConfig().ssoDirect,m=Object.keys(l||{}),d=n||m[0],p=l?.[d];if(a)return $(t,r,{slug:o},403);const s=d&&p?await _(d,p):void 0,f=s&&C(t)?{...s,extraParams:{...s.extraParams,prompt:"login",post_logout:"1"}}:s,{loginUrl:E,cookies:h={}}=f&&z(f,w,c(o))||{},L=r.globalData.auth?.devLogin||m.length>1?v(o):E;return Object.keys(h).forEach(u=>{A(t,u,h[u].value,h[u].options)}),L?t.newResponse(null,302,{Location:L}):t.text("Unauthorized",401)}const P={};async function $(t,r,o,n,a){const i=a?`${a}:${o.slug}`:String(n);let e=P[i];if(!e){const g={templateId:String(a||n),fsPath:"/",...o,baseSlug:o.slug};e=(await O(g,{},t,r,R)).html,P[i]=e}return t.html(e,n,{"Cache-Control":y})}function v(t){const r=new URLSearchParams({redirectTo:c(t)});return`${c(b)}?${r}`}async function G(t){const{status:r,reason:o}=U(t);return t.text(o,r)}function V(t){const{status:r,reason:o}=U(t);return t.json({message:o},r)}function U(t){const{isAuthenticated:r}=t.get("auth");return r?{status:403,reason:"Forbidden"}:{status:401,reason:"Unauthorized"}}function K(t){const r=t?.match(/(?:^|:)(\d{1,3}(?:\.\d{1,3}){3})$/);return r?r[1]:t}export{v as getLoginUrlWithRedirect,$ as handleErrorPageRender,F as handleUnauthorized,V as handleUnauthorizedApiRequest,G as handleUnauthorizedAsset,K as normalizeIpAddress};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WorkerPool } from './worker-pool.js';
|
|
2
2
|
export declare const MCP_TOOL_WORKER_KEY = "executeMcpTool";
|
|
3
3
|
export declare const MCP_TOOL_IS_AVAILABLE_KEY = "isMcpToolAvailable";
|
|
4
|
+
export declare const MCP_TOOL_AVAILABILITY_KEY = "mcpToolAvailability";
|
|
4
5
|
export declare const mcpToolWorkers: WorkerPool;
|
|
5
6
|
//# sourceMappingURL=mcp-tool-worker-pool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAllowedEnvs as o}from"../utils/envs/get-api-route-allowed-env-variables.js";import{WorkerPool as r}from"./worker-pool.js";const p="executeMcpTool",
|
|
1
|
+
import{getAllowedEnvs as o}from"../utils/envs/get-api-route-allowed-env-variables.js";import{WorkerPool as r}from"./worker-pool.js";const p="executeMcpTool",l="isMcpToolAvailable",c="mcpToolAvailability",e=5,i=new r({workerScript:"./mcp-tool-worker",minWorkers:1,maxWorkers:e,workerType:"process",forkOpts:{stdio:"inherit"},resolveForkEnv:o,lazy:!0,sandbox:!0});export{c as MCP_TOOL_AVAILABILITY_KEY,l as MCP_TOOL_IS_AVAILABLE_KEY,p as MCP_TOOL_WORKER_KEY,i as mcpToolWorkers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"workerpool";import{executeMcpTool as r,isMcpToolAvailable as _}from"../plugins/mcp/workers/execute-mcp-tool.js";import{MCP_TOOL_IS_AVAILABLE_KEY as
|
|
1
|
+
import o from"workerpool";import{executeMcpTool as r,isMcpToolAvailable as _,mcpToolAvailability as i}from"../plugins/mcp/workers/execute-mcp-tool.js";import{MCP_TOOL_AVAILABILITY_KEY as l,MCP_TOOL_IS_AVAILABLE_KEY as A,MCP_TOOL_WORKER_KEY as m}from"./mcp-tool-worker-pool.js";o.worker({[m]:r,[A]:_,[l]:i});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ApiRoutesWorkerParams, ApiRoutesWorkerResponse } from '../types/plugins/api-routes.js';
|
|
2
2
|
import type { RenderPayload } from '../../types/ssr.js';
|
|
3
3
|
import type { ScorecardsWorkerParams, ScorecardsWorkerResponse } from '../types/plugins/scorecards.js';
|
|
4
|
-
import type { McpToolExecutionParams, McpToolWorkerResponse } from '../plugins/mcp/types.js';
|
|
4
|
+
import type { McpToolContext, McpToolExecutionParams, McpToolWorkerResponse } from '../plugins/mcp/types.js';
|
|
5
5
|
import type { SCORECARDS_WORKER_KEY } from './scorecards-worker-pool.js';
|
|
6
6
|
import type { API_ROUTES_WORKER_KEY } from './api-routes-worker-pool.js';
|
|
7
7
|
import type { SSR_WORKER_KEY } from './ssr-worker-pool.js';
|
|
8
|
-
import type { MCP_TOOL_IS_AVAILABLE_KEY, MCP_TOOL_WORKER_KEY } from './mcp-tool-worker-pool.js';
|
|
8
|
+
import type { MCP_TOOL_AVAILABILITY_KEY, MCP_TOOL_IS_AVAILABLE_KEY, MCP_TOOL_WORKER_KEY } from './mcp-tool-worker-pool.js';
|
|
9
9
|
export type SsrWorkerResponse = {
|
|
10
10
|
html: string;
|
|
11
11
|
statusCode: 200 | 500;
|
|
@@ -32,6 +32,13 @@ export type WorkerTypeMapping = {
|
|
|
32
32
|
params: [Omit<McpToolExecutionParams, 'args' | 'extra'>];
|
|
33
33
|
response: boolean;
|
|
34
34
|
};
|
|
35
|
+
[MCP_TOOL_AVAILABILITY_KEY]: {
|
|
36
|
+
params: [{
|
|
37
|
+
toolNames: string[];
|
|
38
|
+
context: McpToolContext;
|
|
39
|
+
}];
|
|
40
|
+
response: Record<string, boolean>;
|
|
41
|
+
};
|
|
35
42
|
};
|
|
36
43
|
export type WorkerParams<T extends keyof WorkerTypeMapping> = WorkerTypeMapping[T]['params'];
|
|
37
44
|
export type WorkerResponse<T extends keyof WorkerTypeMapping> = WorkerTypeMapping[T]['response'];
|
|
@@ -7,6 +7,7 @@ export type WorkerPoolConfig = {
|
|
|
7
7
|
resolveForkEnv?: () => Record<string, string | undefined>;
|
|
8
8
|
} & WorkerPoolOptions;
|
|
9
9
|
type RegisteredWorkers = keyof WorkerTypeMapping;
|
|
10
|
+
export declare const workerBaseDir: string;
|
|
10
11
|
export declare class WorkerPool {
|
|
11
12
|
#private;
|
|
12
13
|
constructor(config: WorkerPoolConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import l from"workerpool";import{mkdirSync as m}from"node:fs";import{basename as u,dirname as c,resolve as
|
|
1
|
+
import l from"workerpool";import{mkdirSync as m}from"node:fs";import{basename as u,dirname as c,resolve as p}from"node:path";import{fileURLToPath as f}from"node:url";import{envConfig as n}from"../config/env-config.js";import{SandboxContext as v}from"../utils/sandbox-context.js";const h=(()=>{const o=c(f(import.meta.url));return u(o)==="chunks"?c(o):o})();class P{#t=null;#r;constructor(r){this.#r=r,this.#r.lazy||(this.#t=this.#e())}#e(){const{workerScript:r,lazy:t,sandbox:i,resolveForkEnv:s,...e}=this.#r,a=this.#s(r);return s&&e.forkOpts&&(e.forkOpts={...e.forkOpts,env:s()}),this.#o(i)?l.pool(a,{...e,forkOpts:this.#i(e.forkOpts)}):l.pool(a,{...e})}#o(r){return!!r&&n.isReunite&&n.REDOCLY_DISABLE_API_FUNCTION_SANDBOX!==!0}#i(r){const t=v.resolve(h);try{m(t.tmpDir,{recursive:!0})}catch{}return{...r,cwd:t.serverOutDir,execArgv:[...t.execArgv,...r?.execArgv??[]],env:{...r?.env,...t.env}}}#s(r){let t=r;return!t.endsWith(".js")&&!t.endsWith(".mjs")&&(t=`${t}.${n.isDevelopMode?"js":"mjs"}`),t.startsWith(".")?p(h,t):t}#n(){return this.#t||(this.#t=this.#e()),this.#t}async exec(r,t,i){let e=this.#n().exec(r,t);return i?.timeout&&(e=e.timeout(i.timeout)),await e}async terminate(){this.#t&&(await this.#t.terminate(),this.#t=null)}}export{P as WorkerPool,h as workerBaseDir};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines whether a value is a non-null, non-array object.
|
|
3
|
+
*
|
|
4
|
+
* Unlike `isObject`, class instances pass: the check guards shape
|
|
5
|
+
* (keyed properties), not prototype purity.
|
|
6
|
+
*
|
|
7
|
+
* @param value - The value to check.
|
|
8
|
+
* @returns True if the value is a non-null, non-array object.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* isPlainObject({}); // true
|
|
13
|
+
* isPlainObject(new Date()); // true
|
|
14
|
+
* isPlainObject([]); // false
|
|
15
|
+
* isPlainObject(null); // false
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
19
|
+
//# sourceMappingURL=is-plain-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}export{t as isPlainObject};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/reef",
|
|
3
|
-
"version": "0.137.0-next.
|
|
3
|
+
"version": "0.137.0-next.10",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,13 +33,19 @@
|
|
|
33
33
|
"@opentelemetry/sdk-trace-web": "2.8.0",
|
|
34
34
|
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
35
35
|
"@redocly/ajv": "8.18.0",
|
|
36
|
-
"@redocly/
|
|
36
|
+
"@redocly/api-docs": "0.2.0-next.10",
|
|
37
|
+
"@redocly/config": "0.56.0",
|
|
38
|
+
"@redocly/openapi-core": "2.51.2",
|
|
39
|
+
"@redocly/portal-legacy-ui": "0.19.0",
|
|
40
|
+
"@redocly/portal-plugin-mock-server": "0.22.0-next.7",
|
|
41
|
+
"@redocly/realm-asyncapi-sdk": "0.15.0-next.3",
|
|
42
|
+
"@redocly/theme": "0.69.0-next.9",
|
|
37
43
|
"@shikijs/transformers": "3.21.0",
|
|
38
44
|
"@tanstack/react-query": "5.62.3",
|
|
39
45
|
"@tanstack/react-table": "8.21.3",
|
|
40
46
|
"@tanstack/react-virtual": "3.13.0",
|
|
41
47
|
"@wojtekmaj/react-datetimerange-picker": "6.0.0",
|
|
42
|
-
"@xmldom/xmldom": "0.9.
|
|
48
|
+
"@xmldom/xmldom": "0.9.12",
|
|
43
49
|
"ajv-formats": "^3.0.1",
|
|
44
50
|
"anser": "^2.3.2",
|
|
45
51
|
"babel-plugin-styled-components": "2.1.4",
|
|
@@ -51,7 +57,7 @@
|
|
|
51
57
|
"enquirer": "2.3.6",
|
|
52
58
|
"esbuild": "0.28.1",
|
|
53
59
|
"escape-carriage": "^1.3.1",
|
|
54
|
-
"fflate": "0.7.
|
|
60
|
+
"fflate": "0.7.5",
|
|
55
61
|
"flexsearch": "0.7.43",
|
|
56
62
|
"graphql": "16.14.2",
|
|
57
63
|
"hono": "4.13.1",
|
|
@@ -64,7 +70,7 @@
|
|
|
64
70
|
"mri": "1.2.0",
|
|
65
71
|
"nanoid": "5.1.16",
|
|
66
72
|
"nprogress": "0.2.0",
|
|
67
|
-
"openapi-sampler": "^1.7.
|
|
73
|
+
"openapi-sampler": "^1.7.5",
|
|
68
74
|
"os-browserify": "0.3.0",
|
|
69
75
|
"path-browserify": "1.0.1",
|
|
70
76
|
"picomatch": "2.3.2",
|
|
@@ -92,16 +98,7 @@
|
|
|
92
98
|
"xml-crypto": "6.1.0",
|
|
93
99
|
"xpath": "0.0.34",
|
|
94
100
|
"yaml-ast-parser": "0.0.43",
|
|
95
|
-
"zod": "^3.25.76"
|
|
96
|
-
"@redocly/api-docs": "0.2.0-next.1",
|
|
97
|
-
"@redocly/asyncapi-docs": "1.14.0-next.1",
|
|
98
|
-
"@redocly/config": "0.53.1",
|
|
99
|
-
"@redocly/graphql-docs": "1.14.0-next.1",
|
|
100
|
-
"@redocly/openapi-docs": "3.25.0-next.1",
|
|
101
|
-
"@redocly/portal-legacy-ui": "0.19.0",
|
|
102
|
-
"@redocly/portal-plugin-mock-server": "0.22.0-next.1",
|
|
103
|
-
"@redocly/realm-asyncapi-sdk": "0.15.0-next.0",
|
|
104
|
-
"@redocly/theme": "0.69.0-next.1"
|
|
101
|
+
"zod": "^3.25.76"
|
|
105
102
|
},
|
|
106
103
|
"peerDependencies": {
|
|
107
104
|
"react": "^19.2.7",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PageProps } from '@redocly/config';
|
|
2
|
-
export declare function useCollectMarkdocOptions({ markdown }: PageProps): {
|
|
3
|
-
variables?: Record<string, any>;
|
|
4
|
-
tags: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
};
|
|
7
|
-
nodes: any;
|
|
8
|
-
functions: any;
|
|
9
|
-
components: any;
|
|
10
|
-
partials: Record<string, import("@markdoc/markdoc").Node[] | import("@markdoc/markdoc").Node> | undefined;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useMemo as t}from"react";import{components as m}from"@redocly-markdoc/components";import{schema as s}from"@redocly-markdoc/schema";import{tags as r,components as n}from"@redocly/theme/markdoc/default";import*as a from"../../app/markdoc/custom-components/index.js";import*as e from"../../../markdoc/nodes/index.js";import p from"../../../markdoc/tags/index.js";import{normalizeCustomTags as i}from"../../../markdoc/helpers/normalize-custom-tags.js";import{parsePartials as c}from"../../templates/openapi-docs/helpers.js";function O({markdown:o}){return t(()=>({tags:{...p,...r,...i(s?.tags??{})},nodes:{...e,...s?.nodes??{}},functions:{...s?.functions??{}},components:{...a,...n,...m,...globalThis.__LOADER.markdocComponents},...o,partials:c(o?.partials)}),[o])}export{O as useCollectMarkdocOptions};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { LayoutVariant } from '@redocly/theme/components/SidebarActions/SidebarActions';
|
|
3
|
-
type TemplateProps = {
|
|
4
|
-
pageProps: {
|
|
5
|
-
apiOptions: {
|
|
6
|
-
layout: LayoutVariant;
|
|
7
|
-
};
|
|
8
|
-
settings: {
|
|
9
|
-
baseUrlPath: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default function AsyncApiDocs({ pageProps }: TemplateProps): React.JSX.Element;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=template.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import m from"styled-components";import*as t from"react";import{RedoclyAsyncAPIDocs as d}from"@redocly/asyncapi-docs";import{withPathPrefix as r}from"@redocly/theme/core/utils";import{ServerRoutes as p}from"../../../constants/api.js";import{CLIENT_TELEMETRY_ENABLED as f}from"../../constants/common.js";import{PACKAGE_NAME as E}from"../../../config/product-gates";import{usePageSharedData as A}from"../../providers/page-data/hooks";import{useCollectMarkdocOptions as h}from"./helpers.js";function u({pageProps:o}){const e=A("AsyncApiDefinition"),{document:i,apiItems:a,protocol:n,downloadUrls:s}=e,c=r(o?.settings?.baseUrlPath),l=h(o);return t.createElement(g,null,t.createElement(d,{pageProps:o,document:i,apiItems:a,routingBasePath:c,protocol:n,downloadUrls:s,markdocOptions:l,telemetryConfig:{collectorUrl:new URL(r(p.OTEL_TRACES),location.origin).toString(),disabled:!f,serviceVersion:`${E}@${process.env.REDOCLY_PORTAL_VERSION}`}}))}const g=m.div`
|
|
2
|
-
a[id],
|
|
3
|
-
a[data-section-id],
|
|
4
|
-
div[data-section-id] {
|
|
5
|
-
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height) + var(--panel-gap-vertical));
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
--sidebar-width: 0px;
|
|
9
|
-
`;export{u as default};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Node } from '@markdoc/markdoc';
|
|
2
|
-
import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
|
|
3
|
-
import type { OpenAPIDefinition } from '@redocly/openapi-docs';
|
|
4
|
-
import type { EventType } from '@redocly/openapi-docs/src/events/types';
|
|
5
|
-
import type { RedocConfig, PageProps } from '@redocly/config';
|
|
6
|
-
type EventFunctionInput = string | ((event: EventType) => void) | undefined;
|
|
7
|
-
type OpenAPIDocsStore = {
|
|
8
|
-
definition: OpenAPIDefinition;
|
|
9
|
-
options: RedocConfig;
|
|
10
|
-
basePath?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function joinWithSeparator(base?: string, path?: string, sep?: string): string;
|
|
13
|
-
export declare function parsePartials(partials?: Record<string, any>): Record<string, Node[] | Node> | undefined;
|
|
14
|
-
export declare function usePatchedStore(storeJs: OpenAPIDocsStore, { markdown, baseSlug }: PageProps): OpenAPIDocsStore;
|
|
15
|
-
export declare function safeParseFunction(fnInput: EventFunctionInput): ((event: EventType) => void) | null;
|
|
16
|
-
export declare function mergeEvents(userFunction: ((event: EventType) => void) | null, telemetryEvent?: AsyncApiRealmUI.GetEventData<'com.redocly.openapiDocs.interacted'>[0]['eventType']): (event: EventType) => void;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{useMemo as f}from"react";import{components as g}from"@redocly-markdoc/components";import{schema as c}from"@redocly-markdoc/schema";import{Ast as d}from"@markdoc/markdoc";import{PageNavigation as h}from"@redocly/theme/components/PageNavigation/PageNavigation";import{tags as _,components as y}from"@redocly/theme/markdoc/default";import{Breadcrumbs as P}from"@redocly/theme/components/Breadcrumbs/Breadcrumbs";import{withPathPrefix as m,getBaseDataAttributes as w}from"@redocly/theme/core/utils";import{ServerRoutes as u}from"../../../constants/api.js";import{OPENAPI_DOCS_TEMPLATE_ID as S}from"../../../constants/common.js";import{isBrowser as O}from"../../../utils/env/is-browser.js";import*as v from"../../../markdoc/nodes/index.js";import C from"../../../markdoc/tags/index.js";import{normalizeCustomTags as T}from"../../../markdoc/helpers/normalize-custom-tags.js";import*as A from"../../app/markdoc/custom-components/index.js";import{usePageData as x,useSidebarSiblingsData as D}from"../../providers/page-data/hooks";import{telemetry as E}from"../../app/telemetry/index.js";import{getMockServerDocsConfig as R}from"./mock-server-config.js";function Z(o="",r="",t="/"){return o.endsWith(t)&&(o=o.slice(0,-t.length)),r.startsWith(t)&&(r=r.slice(t.length)),!o||!r?o+r:o+t+r}function b(o){if(o)return Object.entries(o).reduce((r,[t,n])=>(r[t]=d.fromJSON(JSON.stringify(n)),r),{})}function G(o,{markdown:r,baseSlug:t}){return f(()=>{const i=O();if(o.options.oAuth2RedirectURI=i?`${window.location.origin}${m(u.REPLAY_OAUTH2_CALLBACK)}`:void 0,o.options.routingBasePath=m(t),o.options.mockServer=R(o.options.mockServer,t),o.options.corsProxyUrl===void 0){const e=m(`${u.CORS_PROXY}/`);o.options.corsProxyUrl=i?new URL(e,window.location.origin).toString():e}o.options.scrollYOffset=i?parseInt(getComputedStyle(document.documentElement).getPropertyValue("--navbar-height"),10):0,o.options.markdocOptions={tags:{...C,..._,...T(c?.tags??{})},nodes:{...v,...c?.nodes??{}},functions:{...c?.functions??{}},components:{...A,...y,...g,...globalThis.__LOADER.markdocComponents},...r,partials:b(r?.partials)},o.options.unstable_hooks={...o.options.unstable_hooks,MiddlePanelFooter:()=>{const{templateId:e}=x()||{},{nextPage:s,prevPage:a}=D()||{};return e===S?null:h({nextPage:s,prevPage:a})},MiddlePanelHeader:()=>P({})};const l={codeSamplesLanguageSwitch:"samples_language_switch",codeSamplesCopy:"code_samples_copy",panelToggle:"panel_toggle",targetServerSwitch:"target_server_switch",tryItOpen:"try_it_toggle",tryItSent:"try_it_sent"},p={};for(const[e,s]of Object.entries(l)){const a=I(o.options.events?.[e]);p[e]=U(a,s)}return o.options.events=p,o},[o,r,t])}function I(o){if(typeof window>"u")return null;if(typeof o=="function")return o;if(typeof o!="string")return null;try{const r=o.trim();if(!r.match(/^(\([^)]*\)\s*=>\s*.+|[a-zA-Z_$][\w$]*\s*=>\s*.+)$/))throw new Error("Invalid function format. Only arrow functions allowed.");if(["eval","Function","constructor","prototype","__proto__","import","require","process","global","window","document"].some(i=>r.includes(i)))throw new Error("Function contains prohibited keywords");return new Function("event",`
|
|
2
|
-
'use strict';
|
|
3
|
-
const userFn = ${r};
|
|
4
|
-
return userFn(event);
|
|
5
|
-
`)}catch(r){return console.error("Function parsing error:",r),null}}function U(o,r){return t=>{if(o)try{o(t)}catch(n){console.error("User event handler error:",n)}if(r)try{E.sendOpenapiDocsMessage([{...w("openapiDocsInteraction","openapiDocs"),eventType:r,operationHttpVerb:t.operationHttpVerb,operationPath:t.operationPath,lang:"lang"in t?t.lang:void 0,action:t.action,state:"state"in t?t.state:void 0,serverUrl:"serverUrl"in t?t.serverUrl:void 0}])}catch{}}}export{Z as joinWithSeparator,U as mergeEvents,b as parsePartials,I as safeParseFunction,G as usePatchedStore};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import*as o from"react";import i from"styled-components";import{RedoclyOpenAPIDocs as m}from"@redocly/openapi-docs";import{LayoutVariant as c}from"@redocly/config";import{CLIENT_TELEMETRY_ENABLED as s}from"../../constants/common.js";import{ThreePanelLayout as p}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as f}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{withPathPrefix as h}from"@redocly/theme/core/utils";import{useUserClaims as d}from"../../app/hooks";import{ServerRoutes as u}from"../../../constants/api.js";import{PACKAGE_NAME as E}from"../../../config/product-gates";import{usePageSharedData as v}from"../../providers/page-data/hooks";import{usePatchedStore as g}from"./helpers.js";function y({pageProps:t}){const r=d(),e=v("openAPIDocsStore"),n=o.useMemo(()=>({layout:t.apiOptions?.layout,userClaims:r}),[t.apiOptions?.layout,r]),a=g(e,t);if(!e)return"Something went wrong";const l=t.apiOptions?.layout;return o.createElement(A,null,o.createElement(S,{layout:l},o.createElement(f,{metadata:t.metadata})),o.createElement(m,{store:{options:a.options,definition:a.definition,withState:n},telemetryConfig:{collectorUrl:new URL(h(u.OTEL_TRACES),location.origin).toString(),disabled:!s,serviceVersion:`${E}@${process.env.REDOCLY_PORTAL_VERSION}`}}))}const S=i(p)`
|
|
2
|
-
&& {
|
|
3
|
-
padding-right: ${({layout:t})=>t===c.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
|
|
4
|
-
}
|
|
5
|
-
`,A=i.div`
|
|
6
|
-
div[id] {
|
|
7
|
-
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height) - var(--panel-gap-vertical));
|
|
8
|
-
}
|
|
9
|
-
a[id] {
|
|
10
|
-
scroll-margin-top: calc(var(--navbar-height) + var(--banner-height) + var(--panel-gap-vertical));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
--sidebar-width: 0px;
|
|
14
|
-
`;export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{licenseInfo:{allowed:!0,valid:!0},isValid:!0,isPending:!1}}export{e as useLicense};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return null}export{e as LicenseOverlay};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as o}from"module";const s=o(import.meta.url),t=()=>({name:"esbuild-redocly-api-docs-module-replacer",setup:r=>{r.onResolve({filter:/\/hooks\/useLicense\.js$/},async e=>{if(e.resolveDir.endsWith("/api-docs/lib"))return{path:s.resolve("./empty-check.js")}}),r.onResolve({filter:/\/components\/LicenseOverlay\.js$/},async e=>{if(e.resolveDir.endsWith("/api-docs/lib"))return{path:s.resolve("./empty-overlay.js")}})}});export{t as ApiDocsModuleReplacer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{licenseInfo:{allowed:!0,valid:!0},isValid:!0}}export{e as useLicense};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const n=function(){return null};export{n as Overlay};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{isValid:!0,loading:!1}}export{e as useLicenseKey};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as r}from"module";const o=r(import.meta.url),c=()=>({name:"esbuild-redocly-openapi-docs-module-replacer",setup:e=>{e.onResolve({filter:/\.[\/\\]Overlay.js$/},async s=>{if(s.resolveDir.endsWith("openapi-docs/lib/components/RedoclyOpenAPIDocs"))return{path:o.resolve("./empty-overlay.js")}}),e.onResolve({filter:/(.*)\/hooks\/useLicense.js$/},async s=>{if(s.resolveDir.endsWith("openapi-docs/lib/components/RedoclyOpenAPIDocs"))return{path:o.resolve("./empty-check.js")}}),e.onResolve({filter:/shared\/license\/use-license-key/},async()=>({path:o.resolve("./empty-use-license-key.js")}))}});export{c as OpenapiDocsModuleReplacer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(){}function e(){}export{e as convertSwagger2OpenAPI,n as loadAndBundleDefinition};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ApiItem, SchemaEntry } from '@redocly/api-docs';
|
|
2
|
-
import type { SearchDocument } from '../../../types';
|
|
3
|
-
export declare class ApiDocsSearchIndexer {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(basePath: string, schemaStore?: Record<string, SchemaEntry>, document?: Record<string, unknown>);
|
|
6
|
-
addItem(item: ApiItem): void;
|
|
7
|
-
getResult(): SearchDocument[];
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=search-indexer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as p}from"@redocly/config";import{extractFullText as W,nodeTypes as g,contentType as P,schemaKind as j}from"@redocly/api-docs";import{toMarkdown as H}from"../../markdown/search/to-markdown.js";const L=10,_=200,C="message payload",D="message headers";function E(h){if(typeof h=="string")return h;const e=Array.isArray(h)?h:[h];return H(e).trim()}function N(h){return h.length>_?`${h.slice(0,_)}\u2026`:h}class B{#c=[];#i;#s;#o;#f;constructor(e,t,n){this.#i=e,this.#s=t,this.#o=n}addItem(e){if(!(!e.link||!e.content))try{switch(e.content.contentType){case P.OVERVIEW:this.#a(e,this.#i);break;case P.GROUP:case P.ITEM:this.#a(e,e.link);break}}catch(t){console.error(`Cannot add item to api-docs search indexer [${e.label}, ${e.link}]:`,t.message)}}#a(e,t){if(!e.content)return;const n=t.startsWith(this.#i+"/")?t.slice(this.#i.length+1):t.split("/").slice(-2).join("/"),i=e.content.children,o=this.#p(i),f=this.#y(i,n),r=e,s={id:t,url:t,title:e.label??"",text:o,path:[],deprecated:e.content.meta?.deprecated,..."httpVerb"in e&&e.httpVerb?{httpMethod:e.httpVerb}:{},..."httpPath"in e&&e.httpPath?{httpPath:e.httpPath}:{},..."badges"in e&&Array.isArray(e.badges)&&e.badges.length?{badges:e.badges}:{},..."isAdditionalOperation"in e&&e.isAdditionalOperation?{isAdditionalOperation:!0}:{},[p]:r[p],...f.length&&{parameters:f}};this.#c.push(s)}#p(e){const t=[],n=i=>{for(const o of i)if(o.nodeType===g.MARKDOC){const f=o;if(this.#h(f.content))continue;const r=W(f.content);r&&t.push(r)}else(o.nodeType===g.CONTAINER||o.nodeType===g.OVERVIEW_SECTION_WRAPPER)&&n(o.children)};return n(e),t.join(" ").trim()}#h(e){let t=!1,n=!1;const i=f=>{f.type==="code"&&f.attributes?.content?t=!0:f.type==="text"&&f.attributes?.content&&(n=!0);for(const r of f.children??[])i(r)},o=Array.isArray(e)?e:[e];for(const f of o)i(f);return t&&!n}#y(e,t){const n={},i=new Set,o=f=>{for(const r of f)if(r.nodeType===g.ITEM){const s=r;if(s[p])continue;if(s.parameters?.length)for(const a of s.parameters){if(a[p])continue;const d=this.#O(s.variant),c=this.#$(s.variant),u=a.description?E(a.description):"",l=this.#A(a.schemaId),$={name:a.name,description:u,place:d,mediaType:void 0,type:l,required:a.required??!1,deepLink:this.#d(t,"request",c,void 0,void 0,[a.name]),example:void 0,enum:void 0};n[this.#n($)]=$}this.#g(s,n,i,t)}else if(r.nodeType===g.CONTAINER){const s=r;if(s[p])continue;o(s.children)}else r.nodeType===g.OVERVIEW_SECTION_WRAPPER&&o(r.children)};return o(e),Object.values(n)}#n(e){return[...Array.isArray(e.path)?e.path:[],e.name.toString()].join(".")+e.description+e.place}#d(e,t,n,i,o,f){if(!e)return"";const r=f.join("/"),s=[`t=${t}`];return n&&s.push(`in=${n}`),o&&s.push(`c=${o}`),i&&s.push(`ct=${i}`),r&&s.push(`path=${r}`),`/${e}#${e}/${s.join("&")}`.toLowerCase()}#m(e,t,n,i){if(!e)return"";let o="messages";t&&(o+=`&m=${t}`),o+=`&t=${n}`;const f=i.join("/");return f&&(o+=`&path=${f}`),`/${e}#${e}/${o}`.toLowerCase()}#$(e){switch(e){case"query":return"query";case"path":return"path";case"headers":return"header";case"cookies":return"cookie";default:return}}#O(e){switch(e){case"query":return"query parameters";case"path":return"path parameters";case"headers":return"header parameters";case"cookies":return"cookie parameters";case"parameters":return"channel parameters";default:return e?`${e} parameters`:"parameters"}}#A(e){const t=this.#s?.[e];if(!t||t.kind!==j.JSON_SCHEMA)return"unknown";const n=t.data,i=this.#l(n);return this.#u(i)}#u(e){return Array.isArray(e.type)?e.type.join(" | "):e.type?e.type:e.properties||e.additionalProperties?"object":e.items?"array":e.enum?"string":"any"}#g(e,t,n,i){const o=this.#E(e);if(e.graphqlSchema&&Array.isArray(e.graphqlSchema)){this.#S(e.graphqlSchema,o,t);return}if(!this.#s||!this.#o)return;const f=o.startsWith("response");if(e.mediaTypeSchemas){const r=Object.entries(e.mediaTypeSchemas),s=r.find(([,a])=>!a[p]);if(s){const[a,d]=s;d.schemaId&&this.#r(d.schemaId,o,a,r.length>1,f,t,[],n,i)}}else e.schemaId&&this.#r(e.schemaId,o,void 0,!1,f,t,[],n,i);if(e.responses)for(const r of e.responses){if(r[p])continue;const s=`response ${r.code} fields`,a=new Set;if(r.mediaTypeContent){const d=Object.entries(r.mediaTypeContent),c=d.find(([,u])=>!u[p]);if(c){const[u,l]=c;l.schemaId&&this.#r(l.schemaId,s,u,d.length>1,!0,t,[],a,i)}}else r.schemaId&&this.#r(r.schemaId,s,r.mediaType,!1,!0,t,[],a,i)}if(e.messages)for(const r of e.messages){if(r[p])continue;const s=r.description?E(r.description):"",a=r.summary??"",d={name:r.name,description:(s+a).trim(),place:"message",mediaType:void 0,type:"unknown",required:!1,example:void 0,enum:void 0};t[this.#n(d)]=d,this.#f=r.name;const c=new Set;r.schemaId&&this.#r(r.schemaId,C,r.contentType,!1,!1,t,[],c,i),r.headerSchemaId&&this.#r(r.headerSchemaId,D,void 0,!1,!1,t,[],c,i),this.#f=void 0}}#E(e){switch(e.variant){case"body":return"request fields";case"responses":return"response fields";case"graphql-fields":return"fields";case"graphql-args":return"arguments";case"return-type":return"return type fields";default:return e.variant??"fields"}}#S(e,t,n){for(const i of e){const o=i.description?E(i.description):"",f={name:i.name,description:o,place:t,mediaType:void 0,path:[],type:i.type??"unknown",required:!1,example:void 0,enum:void 0};if(n[this.#n(f)]=f,i.args?.length)for(const r of i.args){const s=r.description?E(r.description):"",a={name:r.name,description:s,place:"arguments",mediaType:void 0,path:[i.name],type:r.type??"unknown",required:!1,example:void 0,enum:void 0};n[this.#n(a)]=a}}}#r(e,t,n,i,o,f,r,s,a=""){const d=this.#s?.[e];if(!d||d.kind!==j.JSON_SCHEMA||d[p])return;const c=d.data,u=i?n:void 0;this.#t(c,t,n,u,o,f,r,s,0,a)}#I(e){const t=e.match(/^response (\d+)/);return t?t[1]:void 0}#l(e){if(e.allOf){const t={};for(const n of e.allOf){const i=n.$ref?this.#e(n.$ref):n;if(i){const o=t.properties,f=t.required;Object.assign(t,i),(o||i.properties)&&(t.properties={...o||{},...i.properties||{}}),(f||i.required)&&(t.required=[...f||[],...i.required||[]])}}return delete t.allOf,e.description&&(t.description=e.description),t}if(e.$ref){const t=this.#e(e.$ref);if(t){const n={...t};return e.description&&(n.description=e.description),n}}return e}#e(e){if(!e.startsWith("#/"))return;const t=e.slice(2).split("/");let n=this.#o;for(const i of t){if(n==null||typeof n!="object")return;n=n[i]}return n!=null&&typeof n=="object"?n:void 0}#t(e,t,n,i,o,f,r,s,a,d=""){if(!(a>L||e[p])){if(e.$ref){if(s.has(e.$ref))return;s.add(e.$ref);const c=this.#e(e.$ref);c&&this.#t(c,t,n,i,o,f,r,s,a,d);return}if(e.allOf){const c={};for(const u of e.allOf){let l=u;if(u.$ref){if(s.has(u.$ref))continue;s.add(u.$ref),l=this.#e(u.$ref)}if(l){const $=c.properties,A=c.required;Object.assign(c,l),($||l.properties)&&(c.properties={...$||{},...l.properties||{}}),(A||l.required)&&(c.required=[...A||[],...l.required||[]])}}delete c.allOf,this.#t(c,t,n,i,o,f,r,s,a,d);return}if(e.discriminator&&e.properties&&e.oneOf){this.#t({...e,oneOf:void 0,discriminator:void 0},t,n,i,o,f,r,s,a,d);return}if(e.oneOf||e.anyOf){for(const c of e.oneOf||e.anyOf||[]){if(c.$ref){if(s.has(c.$ref))continue;s.add(c.$ref)}const u=c.$ref?this.#e(c.$ref):c;u&&this.#t(u,t,n,i,o,f,r,s,a+1,d)}return}if(e.properties){const c=e.required||[],u=this.#I(t),l=o?"response":"request",$=t===C?"payload":t===D?"headers":void 0;for(const[A,O]of Object.entries(e.properties)){if(O[p])continue;if(O.$ref){if(s.has(O.$ref))continue;s.add(O.$ref)}const m=O.$ref?this.#e(O.$ref):O;if(!m)continue;let x=!1;if(m.allOf){let b=!1;for(const q of m.allOf)q.$ref?s.has(q.$ref)||(s.add(q.$ref),b=!0):b=!0;x=!b}const y=this.#l(m);if(m[p]||y[p]||y.readOnly&&!o||y.writeOnly&&o||m.additionalProperties!==void 0&&!m.properties)continue;const T=m.description??y.description,R=T?E(T):"",S=m.example??y.example,V=S!==void 0?N(typeof S=="string"?S:JSON.stringify(S)):void 0,v=Array.isArray(y.enum)&&y.enum.length?y.enum:void 0,I=[...r,A],w={name:A,description:R,place:t,mediaType:n,path:r,type:this.#u(y),required:c.includes(A),deepLink:$?this.#m(d,this.#f,$,I):this.#d(d,l,void 0,i,u,I),example:V,enum:v},k=this.#n(w);f[k]==null&&(f[k]=w,x||this.#t(y,t,n,i,o,f,I,s,a+1,d))}}if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)){if(e.items.$ref){if(s.has(e.items.$ref))return;s.add(e.items.$ref)}const c=e.items.$ref?this.#e(e.items.$ref):e.items;c&&this.#t(c,t,n,i,o,f,r,s,a+1,d)}}}getResult(){return this.#c}}export{B as ApiDocsSearchIndexer};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AsyncApiDefinition, AsyncApiDefinitionReferenced } from '@redocly/asyncapi-docs';
|
|
2
|
-
import type { MarkdocChunk } from '../openapi-docs/load-definition.js';
|
|
3
|
-
import type { RedoclyConfig } from '@redocly/config';
|
|
4
|
-
import type { LifecycleContext } from '../../types';
|
|
5
|
-
export type BundledDefinition = {
|
|
6
|
-
document: AsyncApiDefinition;
|
|
7
|
-
documentWithReferences: AsyncApiDefinitionReferenced;
|
|
8
|
-
config: Partial<RedoclyConfig & NonNullable<RedoclyConfig['apis']>[string]>;
|
|
9
|
-
customOutputRelativeFile: string | undefined;
|
|
10
|
-
markdocChunks: MarkdocChunk[];
|
|
11
|
-
realRelativePath: string;
|
|
12
|
-
relativePath: string;
|
|
13
|
-
isVirtual: boolean;
|
|
14
|
-
hash: string;
|
|
15
|
-
};
|
|
16
|
-
export declare function asyncapiDocLoader(relativePath: string, { fs, logger, cache, getConfig, isPathIgnored }: LifecycleContext): Promise<Omit<BundledDefinition, 'hash'>[]>;
|
|
17
|
-
export declare function asyncapiDocsLoader(_: string, context: LifecycleContext): Promise<BundledDefinition[]>;
|
|
18
|
-
//# sourceMappingURL=asyncapi-doc-loader.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import s from"node:path";import{bundle as R,createConfig as B,getTotals as J}from"@redocly/openapi-core";import{CONFIG_FILE_NAME as L}from"../../../constants/common.js";import{deepMerge as M}from"../../../utils/object/deep-merge.js";import{pluralize as $}from"../../../utils/string/pluralize.js";import{getAllApiConfigsByPath as W}from"../get-api-config.js";import{injectDecoratorIntoConfig as _}from"../openapi-docs/decorators.js";import{ExternalResolver as T}from"../../fs/utils/external-ref-resolver.js";async function Z(n,{fs:o,logger:f,cache:u,getConfig:p,isPathIgnored:d}){let a;try{a=(await u.load(n,"yaml")).data}catch{return[]}if(!a?.asyncapi)return f.verbose(`${n} file is not AsyncAPI document. Skipping`),[];const l=[],e=o.getFileInfo(n),t=await p(s.posix.dirname(n)),A=W(t?.apis,n,t.configPath),D=await d(n);for(const c of A){if(!c.output&&D)continue;const O=t.configPath?s.posix.dirname(t.configPath):".",r=c.output?s.posix.join(O,c.output):n;if(await d(r))continue;e&&c.output&&!await o.exists(r)&&o.addVirtualFile(r,e);const m=M(t,{rbac:void 0},c),k=s.resolve(o.cwd,t.realConfigPath||L),w=new T(o),v=await B(_(m,r,o.cwd),{configPath:k,externalRefResolver:w}),h=s.resolve(o.cwd,n),g={config:v,base:s.dirname(h),doc:{source:{absoluteRef:h},parsed:JSON.parse(JSON.stringify(a))}},{bundle:{parsed:I},problems:y,visitorsData:N}=await R({...g,dereference:!0,externalRefResolver:w}),{bundle:{parsed:P}}=await R({...g,doc:{...g.doc,parsed:JSON.parse(JSON.stringify(a))}}),S=N["markdown/markdown"]?.markdocChunks??[],i=J(y);let b=[i.errors&&`${i.errors} ${$(i.errors,"error","errors")}`,i.warnings&&`${i.warnings} ${$(i.warnings,"warning","warnings")}`,i.ignored&&`${i.ignored} ignored`].filter(Boolean).join(", ");if(i.errors){const C=y.find(F=>F.severity==="error");throw new Error(`${b} while bundling ${r} definition.
|
|
2
|
-
|
|
3
|
-
${C?.message} at ${C?.location?.[0].pointer}
|
|
4
|
-
|
|
5
|
-
`)}i.warnings&&f.warn(`${b} while bundling %rp definition`,r);const V=x(I,t.metadata),j=x(P,t.metadata),E={document:V,documentWithReferences:j,config:m,relativePath:r,realRelativePath:e?.realRelativePath||r,customOutputRelativeFile:c.output&&r,markdocChunks:S,isVirtual:e?.isVirtual??!1};l.push(E)}return l}async function nn(n,o){const{fs:f,cache:u,getConfig:p}=o,d=[];for(const a of await f.scan(/(\.ya?ml|\.json)$/)){if(!await p(s.posix.dirname(a.relativePath)))continue;let e;try{e=await u.load(a.relativePath,"asyncapi-doc")}catch{continue}e.data?.length&&d.push(...e.data.map(t=>({...t,isVirtual:a.isVirtual||t.isVirtual,hash:e.compoundHash})))}return d}function x(n,o){return o?{...n,info:{...n.info,"x-metadata":{...n.info["x-metadata"],...o}}}:n}export{Z as asyncapiDocLoader,nn as asyncapiDocsLoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getPublicEnvVariables as n}from"../../utils/envs/get-public-env-variables.js";const l=async({fsPath:r,slug:e},t,{partials:a,variables:i},o)=>{const s=o.getPartialsForRoute?.(e)||a;return{definitionId:r,...t.props,markdown:{partials:s,variables:{...i,env:n()}}}};var d=l;export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fromCurrentDir as t}from"../../utils/paths.js";function m(r){return t(import.meta.url,r)}export{m as getTemplatePath};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import A from"path";import{simplifyAstStructure as E}from"@redocly/openapi-docs/lib/utils/simplifyAstStructure.js";import{buildMenuItems as $}from"@redocly/asyncapi-docs/lib/utils/build-menu-items.js";import{findFirstBinding as T}from"@redocly/asyncapi-docs/lib/utils/find-first-binding.js";import{ASYNC_API_DOCS_TEMPLATE_ID as v}from"../../../constants/common.js";import{combineUrls as D}from"@redocly/theme/core/utils";import{PUBLIC_API_DEFINITIONS_FOLDER as R}from"../../constants/common.js";import{logger as x}from"../../tools/notifiers/logger.js";import{getRouteSlugsForPath as F}from"../utils.js";import{getTemplatePath as b}from"./get-template-path.js";import{storeDefinitionBundles as O}from"./store-definition-bundles.js";import{asyncapiDocLoader as N,asyncapiDocsLoader as j}from"./asyncapi-doc-loader.js";import{searchResolver as L}from"./search/search-resolver.js";import{getAiDocumentsStore as G}from"./search/get-ai-search-documents.js";import{telemetryTraceStep as M}from"../../../cli/telemetry/helpers/trace-step.js";const _="asyncapi-docs-";async function ot(d){let p=[],u=new Set;return{id:"asyncapi",requiredEntitlements:["asyncapi"],loaders:{"asyncapi-doc":N,"asyncapi-docs":j},processContent:async(e,o)=>{await M("com.redocly.build.plugin.asyncapiDocs",async()=>{if((await o.getConfig()).plugins?.some(l=>l.startsWith("@redocly/portal-plugin-async-api/"))){x.warn("The plugin '@redocly/portal-plugin-async-api' is deprecated. Please remove it from your config to use built-in AsyncAPI docs.");return}const c=e.createTemplate(v,b("../../../client/templates/asyncapi-docs/template.js")),g=e.registerServerPropsGetter(v,b("./get-server-props.js"));for(const l of await o.fs.scan(/(\.ya?ml|\.json)$/))if(!await o.isPathIgnored(l.relativePath))try{const{data:r,compoundHash:w}=await o.cache.load(l.realRelativePath,"asyncapi-doc");if(!r?.length)continue;p=r.map(({markdocChunks:t,relativePath:s,isVirtual:m,customOutputRelativeFile:f,realRelativePath:y})=>({chunks:t,relativePath:s,realRelativePath:y,isVirtual:f!=null||l.isVirtual||m})),O(r,e.outdir,w);for(const t of r){const s=`${_}${t.relativePath}`,m=T(t.document),{navItems:f,apiItems:y}=$({asyncApiDoc:t.document,protocol:m||""}),I=[{url:D(R,`${C(t.relativePath,".json")}?download`)},{url:D(R,`${C(t.relativePath,".yaml")}?download`)}];await e.createSharedData(s,{document:t.document,apiItems:y,protocol:m,downloadUrls:I}),f.forEach(i=>{const n={fsPath:t.relativePath,slugSuffix:`/${i.link}`,templateId:c,sharedData:[{key:"AsyncApiDefinition",id:s}],getStaticData:S(o.withPathPrefix,i.label),serverPropsGetterIds:[g]};e.addRoute(n),i.items&&i.items.forEach(a=>{e.addRoute({...n,slugSuffix:`/${a.link}`,getStaticData:S(o.withPathPrefix,a.label)}),a.items&&a.items.forEach(h=>{e.addRoute({...n,slugSuffix:`/${h.link}`,getStaticData:S(o.withPathPrefix,a.label)})})})}),e.addRoute({fsPath:t.customOutputRelativeFile||t.relativePath,templateId:c,hasClientRoutes:!0,getSidebar:i=>{const n=a=>{const h={...a};return a.link&&(h.routeSlug=D(i.slug,a.link),h.link=D(i.slug,a.link)),a.items&&(h.items=a.items.map(n)),h};return[{type:"link",label:t.document.info?.title??"AsyncAPI Overview",routeSlug:i.slug,link:i.slug},...f.map(n)]},getSearchDocuments:L(e,t.document),getStaticData:S(o.withPathPrefix,t.document.info?.title??"AsyncAPI Docs"),getAiDocumentsStore:G({actions:e,document:t.document,metadata:{type:"asyncapi",title:t.document.info?.title??"AsyncAPI Docs",description:t.document.info?.description??"",...t.document.info?.["x-metadata"]??{}}}),metadata:{type:"asyncapi",title:t.document.info?.title??"AsyncAPI Docs",description:t.document.info?.description??"",...t.document.info?.["x-metadata"]??{}},sharedData:[{key:"AsyncApiDefinition",id:s}]})}}catch(r){console.error(r)}})},afterRoutesCreated:async(e,o)=>{const P=new Set;for(const{chunks:c,relativePath:g,isVirtual:l,realRelativePath:r}of p){const w=F(e.getAllRoutes(),g),t=(await o.cache.load(r,"asyncapi-doc")).compoundHash;await o.cache.load(g,{loader:async function(){for(const{node:m,markdown:f,pointer:y,key:I,relativePath:i}of c){const{ast:n}=await e.parseMarkdoc({input:{content:f,relativePath:y,isVirtual:l},context:o,deps:{sharedDataIds:[`${_}${i}`],routeSlugs:w}});m[`x-parsed-md-${I}`]={result:E(n)}}},name:"asyncapi-markdoc-inline-parser"},[t]);for(const{pointer:s}of c)P.add(s)}const k=u.difference(P);for(const c of k)o.cache.delete(c);u=P}}}function S(d,p){return async function(u,e){return{props:{settings:{baseUrlPath:d(u.baseSlug)},disableAutoScroll:!0,seo:{title:p}}}}}function C(d,p){const u=A.posix.dirname(d),e=A.posix.basename(d,A.posix.extname(d))+p;return A.posix.join(u,e)}export{ot as asyncAPIDocsPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import f from"node:path";import{CONFIG_FILE_NAME as n}from"../../../constants/common.js";const o=async(a,r)=>{if(!a.match(/(\.ya?ml|\.json)$/)||f.posix.basename(a)===n||await r.isPathIgnored(a))return!1;const s=r.fs.getFileInfo(a);if(!s)return!1;try{const{data:e}=await r.cache.load(s.realRelativePath,"yaml");return!!e?.asyncapi}catch{return!1}};export{o as isAsyncapiDoc};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AsyncApiDefinition } from '@redocly/asyncapi-docs';
|
|
2
|
-
import type { PageRouteDetails, ProcessContentActions, AfterRoutesCreatedLifecycleContext } from '../../../types';
|
|
3
|
-
import type { AiDocumentsStore } from '../../../plugins/search/types.js';
|
|
4
|
-
export declare const getAiDocumentsStore: ({ actions, document, metadata, }: {
|
|
5
|
-
actions: ProcessContentActions;
|
|
6
|
-
document: AsyncApiDefinition;
|
|
7
|
-
metadata: Record<string, unknown>;
|
|
8
|
-
}) => (route: PageRouteDetails, _staticData: unknown, context: AfterRoutesCreatedLifecycleContext) => Promise<AiDocumentsStore | undefined>;
|
|
9
|
-
//# sourceMappingURL=get-ai-search-documents.d.ts.map
|