@redocly/reef 0.137.0-next.0 → 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 +234 -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/page-slugs/index.d.ts +9 -0
- package/dist/cli/stats/collectors/page-slugs/index.js +1 -0
- 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/config-parser/loaders/content-slugs-loader.d.ts +5 -0
- package/dist/server/plugins/config-parser/loaders/content-slugs-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,25 +0,0 @@
|
|
|
1
|
-
import type { RawUniversalConfig } from '@redocly/openapi-core';
|
|
2
|
-
export declare const MarkdownParserDecorator: ({ outputRelativePath, cwd, }: {
|
|
3
|
-
outputRelativePath: string;
|
|
4
|
-
cwd: string;
|
|
5
|
-
}) => {
|
|
6
|
-
any: {
|
|
7
|
-
leave(node: Record<string, unknown>, ctx: any): void;
|
|
8
|
-
};
|
|
9
|
-
ref: {
|
|
10
|
-
leave(node: Record<string, unknown>, ctx: any): void;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const RbacDecorator: () => {
|
|
14
|
-
Tag: {
|
|
15
|
-
enter(node: Record<string, unknown>): void;
|
|
16
|
-
};
|
|
17
|
-
any: {
|
|
18
|
-
leave(node: Record<string, unknown>, ctx: any): void;
|
|
19
|
-
};
|
|
20
|
-
ref: {
|
|
21
|
-
leave(node: Record<string, unknown>): void;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare function injectDecoratorIntoConfig(config: RawUniversalConfig, outputRelativePath: string, cwd: string): RawUniversalConfig;
|
|
25
|
-
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import b from"node:path";import{REDOCLY_TEAMS_RBAC as u}from"@redocly/config";import{slash as k}from"../../../utils/path/slash.js";function f(a,r,t){if(!r)throw new Error("Visitor required");if(a){a.description&&r(a,"description",t.location.absolutePointer+"/description",t);for(const o in a["x-enumDescriptions"])r(a["x-enumDescriptions"],o,t.location.absolutePointer+"/x-enumDescriptions/"+o,t)}}const g=/^[a-zA-Z0-9\s\-,.!\?:;'"()/]+$/,s=({outputRelativePath:a,cwd:r})=>{const t=function(e,m,l,p){const{node:n}=p.resolve(e[m]);if(!n||typeof n!="string"||n.match(g))return;const i=p.getVisitorData();i.markdocChunks=i.markdocChunks||[],i.markdocChunks.push({node:e,pointer:k(b.relative(r,l)),markdown:n,relativePath:a,key:m})};return{any:{leave(o,e){f(o,t,e)}},ref:{leave(o,e){f(o,t,e)}}}},c=()=>{const a={};return{Tag:{enter(r){r?.["x-rbac"]&&(a[String(r.name)]=r["x-rbac"])}},any:{leave(r,t){if((t.type.name==="Operation"||t.type.name==="Webhook")&&"tags"in r&&Array.isArray(r.tags))for(const o of r.tags)a[o]&&(r["x-rbac"]=r["x-rbac"]||a[o]);r?.["x-rbac"]&&(r[u]=r["x-rbac"],delete r["x-rbac"])}},ref:{leave(r){r?.["x-rbac"]&&(r[u]=r["x-rbac"],delete r["x-rbac"])}}}};function h(a,r,t){const o={id:"markdown",decorators:{oas2:{markdown:s,rbac:c},oas3:{markdown:s,rbac:c},async3:{markdown:s,rbac:c}}};return{...a,decorators:{"markdown/rbac":"on","markdown/markdown":{outputRelativePath:r,cwd:t},...a.decorators||{}},plugins:[...a.plugins||[],o]}}export{s as MarkdownParserDecorator,c as RbacDecorator,h as injectDecoratorIntoConfig};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type NormalizedProblem } from '@redocly/openapi-core';
|
|
2
|
-
/**
|
|
3
|
-
* Formats a bundle error with file path, line/column, and codeframe for better debugging.
|
|
4
|
-
*/
|
|
5
|
-
export declare function formatBundleError(problem: NormalizedProblem, cwd: string): Promise<string>;
|
|
6
|
-
//# sourceMappingURL=format-bundle-error.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{getLineColLocation as f,isAbsoluteUrl as m}from"@redocly/openapi-core";import g from"node:path";import{gray as s}from"../../tools/notifiers/helpers/colors.js";import{getCodeframe as h}from"../../utils/codeframes/codeframes.js";async function P(o,c){const e=o.location?.[0];if(!e)return`${o.message} at `;if(!e.source){const t=e.pointer??"";return`${o.message} at ${t}`}const n=m(e.source.absoluteRef)?e.source.absoluteRef:g.relative(c,e.source.absoluteRef);try{const t=f(e),i=e.pointer?s(`at ${e.pointer}`):"",l=`${n}:${t.start.line}:${t.start.col}`;let r="";try{const a=e.source?.getLines()??[],u={start:{line:t.start.line,character:t.start.col},end:{line:t.end?.line??t.start.line,character:t.end?.col??Math.max(t.start.col+1,a[t.start.line-1]?.length??t.start.col)},lines:a},{frame:$}=h(u,!0);r=$}catch{r=""}return`${l} ${i}
|
|
2
|
-
${o.message}
|
|
3
|
-
${r?`${r}
|
|
4
|
-
`:""}`}catch{const t=e.pointer?s(`at ${e.pointer}`):"";return`${n} ${t}
|
|
5
|
-
${o.message}`}}export{P as formatBundleError};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getPublicEnvVariables as n}from"../../utils/envs/get-public-env-variables.js";const l=async({fsPath:r,slug:e},t,{variables:a,partials:i},o)=>{const s=o.getPartialsForRoute?.(e)||i;return{definitionId:r,...t.props,markdown:{partials:s,variables:{...a,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{simplifyAstStructure as Z}from"@redocly/openapi-docs";import{REDOCLY_ROUTE_RBAC as y,REDOCLY_TEAMS_RBAC as D}from"@redocly/config";import{OPENAPI_DOCS_TEMPLATE_ID as j,PUBLIC_RBAC_SCOPE_ITEM as U}from"../../../constants/common.js";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as ee,PUBLIC_API_DEFINITIONS_FOLDER as te}from"../../constants/common.js";import{OPENAPI_SHARED_DATA_PREFIX as L}from"../../constants/plugins/openapi-docs.js";import{envConfig as V}from"../../config/env-config.js";import{isRbacScopeItems as oe}from"../../utils/rbac/is-rbac-scope-items.js";import{getRouteSlugsForPath as ae}from"../utils.js";import{searchResolver as re}from"./search/search-resolver.js";import{convertOpenAPIDocs2Sidebar as se,shouldAddRoute as ie}from"./utils.js";import{getTemplatePath as q}from"./get-template-path.js";import{storeDefinitionBundles as ne}from"./store-definition-bundles.js";import{definitionLoader as ce,definitionsLoader as pe}from"./load-definition.js";import{getAiDocumentsStore as de}from"./search/get-ai-search-documents.js";import{fromCurrentDir as le}from"../../utils/paths.js";import{telemetryTraceStep as fe}from"../../../cli/telemetry/helpers/trace-step.js";import{getApiConfigByPath as ue}from"../get-api-config.js";import{shouldAdvertiseGatewayXMcp as me,buildGatewayXMcp as ge}from"../mcp/gateway-mcp/eligibility.js";const x="openapi-spec-download";async function Be(){let k=[],C={},N=new Set,d={};return{id:"openapi",requiredEntitlements:["openapi"],loaders:{"load-oas-docs":pe,"load-oas":ce},processContent:async(e,n)=>{await fe("com.redocly.build.plugin.openapiDocs",async l=>{e.createRequestHandler(x,le(import.meta.url,"./spec-download.api.js")),e.addApiRoute({slug:te+"/*",requestHandlerId:x,httpMethod:"all",[D]:U,getStaticData:async()=>({props:{}})}),e.addApiRoute({slug:ee+"/*",requestHandlerId:x,httpMethod:"all",[D]:U,getStaticData:async()=>({props:{}})});const E=e.createTemplate(j,q("../../../client/templates/openapi-docs/template.js")),f=e.registerServerPropsGetter(j,q("./get-server-props.js")),u=await n.getConfig();l?.setAttribute("config",JSON.stringify(u.openapi||{})),C={},d={};const c=(await n.cache.load(".","load-oas-docs")).data;k=c.map(({markdocChunks:a,relativePath:o,customOutputRelativeFile:r,isVirtual:s,realRelativePath:m})=>({chunks:a,relativePath:o,realRelativePath:m,isVirtual:r!=null||s})),ne(c,e.outdir);for(const a of c||[]){const{definition:o,config:r,relativePath:s,customOutputRelativeFile:m,contentItems:_,flatItems:g,parser:h,options:I,rawOptions:v,hash:R}=a,S=m||s,i=[],G={},{definition:X}=h||{},{info:p}=X||{},O=p?.["x-metadata"],w=!!r.openapi?.excludeFromSearch||!!r.theme?.openapi?.excludeFromSearch||!!u.openapi?.excludeFromSearch||!!u.theme?.openapi?.excludeFromSearch,H={title:p?.title,description:p?.description,summary:p?.summary,...r.metadata,...O},P={untagged:[],tagged:new Map};for(const t of g){const{id:F,href:A,operationDefinition:T}=t;if(T){const{tags:b}=T;if(b)for(const B of b)P.tagged.has(B)||P.tagged.set(B,[]),P.tagged.get(B)?.push(t);else P.untagged.push(t);V.isDevelopMode&&(G[`#${T.pointer}`]=t.href)}if(!ie({item:t}))continue;const M=t,Q=M.type==="section"&&!!M.infoDefinition,W=A.split("#")[0]+"/",z=t?.operationDefinition?.[D],K=oe(r.access?.rbac)?r.access.rbac:void 0;i.push({excludeFromSearch:w,slugSuffix:W,fsPath:S,metadata:{subType:"openapi-operation"},httpVerb:t?.httpVerb||"",path:s,templateId:E,[D]:z||K,getAiDocumentsStore:de({parser:h,options:I,info:p,tagOperations:P,openapiContentItem:M,metadata:H,relativePath:s,getSearchFacets:e.getSearchFacets,includeInLLMsTxt:Q,excludeFromSearch:w}),getStaticData:async b=>({props:{dynamicMarkdocComponents:["openapi"],baseSlug:b.baseSlug,seo:t["x-metadata"]?.seo||{title:t.name,description:t.description},itemId:F,disableAutoScroll:!0}})})}if(i[0]={...i[0],metadata:{type:"openapi",...H},hasClientRoutes:!0,getSidebar:(t,F)=>{const A=[];return se({contentItems:_,sidebarItems:A,routeSlug:t.slug,navItem:F}),A},getNavText:()=>p?.title,getSearchDocuments:re(h,I,g,e.getSearchFacets,e.setSearchFacets,w)},O?.apiId&&!a.isVirtual){const t=ue(a.config.apis,a.realRelativePath);d[O.apiId]={[D]:t.rbac,[y]:{fsPath:S}}}const Y=i[0];i[0]=i[i.length-1],i[i.length-1]=Y;for(const t of i)e.addRoute({...t,serverPropsGetterIds:[f]});const J=V.isDevelopMode?s:void 0,$=`${L}${s}`;C[$]={fsPath:S,definition:o,options:v,sourcePath:J,routesMapping:G,hash:R};for(const t of i)e.addRoute({...t,sharedData:[{id:$,key:"openAPIDocsStore"}],serverPropsGetterIds:[f]})}})},afterRoutesCreated:async(e,n)=>{const l=new Set;for(const{chunks:a,relativePath:o,isVirtual:r,realRelativePath:s}of k){const m=ae(e.getAllRoutes(),o),_=(await n.cache.load(s,"load-oas")).compoundHash;await n.cache.load(o,{loader:async function(){for(const{node:h,markdown:I,key:v,relativePath:R}of a){const{ast:S}=await e.parseMarkdoc({input:{content:I,relativePath:R,isVirtual:r},context:n,deps:{sharedDataIds:[`${L}${R}`],routeSlugs:m}});h[`x-parsed-md-${v}`]={result:Z(S)}}},name:"openapi-markdoc-inline-parser"},[_]);for(const{pointer:g}of a)l.add(g)}const E=N.difference(l);for(const a of E)n.cache.delete(a);N=l;const f=e.getConfig(),u=f.access?.rbac??{},c=n.withPathPrefix("/mcp");for(const[a,o]of Object.entries(C)){const r=e.getRouteByFsPath(o.fsPath)?.baseSlug,s=r&&me(o.definition,a.slice(L.length),u,f.mcp)?{...o.definition,"x-mcp":{...ge(c),...o.definition["x-mcp"],servers:[{url:c}]}}:o.definition;await e.createSharedData(a,{...o,definition:s,baseSlug:r},o.hash)}Object.entries(d).forEach(([a,o])=>{const r=o[y]?.fsPath;if(!r)return;const s=e.getRouteByFsPath(r)?.baseSlug;d[a]={...o,[y]:{...o[y],slug:s},slug:s}}),e.setGlobalData({apiProducts:d})}}}export{Be as openAPIDocsPlugin};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import f from"node:path";import{CONFIG_FILE_NAME as h}from"../../../constants/common.js";import{normalizeRouteSlug as c}from"../../../utils/path/normalize-route-slug.js";import{removeLeadingSlash as L}from"../../../utils/url/remove-leading-slash.js";import{parseBaseName as x}from"../utils.js";const y=async(e,s)=>{if(!e.match(/(\.ya?ml|\.json)$/)||f.posix.basename(e)===h||await s.isPathIgnored(e))return!1;const i=s.fs.getFileInfo(e);if(!i)return!1;try{const{data:n}=await s.cache.load(i.realRelativePath,"yaml");return!(!n?.openapi&&!n?.swagger)}catch{return!1}},F=async(e,s,i,n)=>{const{getRouteBySlug:u,getRouteByFsPath:l}=i,o={isOpenapiDetected:!1,isOpenapiValid:!1},g={isOpenapiDetected:!0,isOpenapiValid:!1},d={isOpenapiDetected:!0,isOpenapiValid:!0};let r=e.toLowerCase();if(e.startsWith("/"))r=c(e);else if(e.startsWith("./")||e.startsWith("../")){const t=l(s)?.slug;if(!t)return o;const{isIndexFile:a}=x(s);r=a?c(f.posix.join(t,e)):c(f.posix.join(t,"../",e))}else return o;const p=r.toLowerCase().split("/");for(let t=p.length;t>=0;t--){const a=p.slice(0,t).join("/"),O=p.slice(t).join("/"),m=u(a)||l(L(a));if(m)return await y(m.fsPath,n)?O?g:d:o}return o};export{F as isOpenApiURL,y as isOpenapiDoc};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { OpenAPIParser } from '@redocly/openapi-docs';
|
|
2
|
-
import type { RbacScopeItems, RedocConfig, REDOCLY_TEAMS_RBAC, RedoclyConfig } from '@redocly/config';
|
|
3
|
-
import type { ContentItemModel, IMenuItem, OpenAPIDefinition, Options } from '@redocly/openapi-docs';
|
|
4
|
-
import type { LifecycleContext } from '../../types';
|
|
5
|
-
export type BundledDefinition = {
|
|
6
|
-
definition: OpenAPIDefinition;
|
|
7
|
-
config: Partial<RedoclyConfig & NonNullable<RedoclyConfig['apis']>[string]>;
|
|
8
|
-
relativePath: string;
|
|
9
|
-
realRelativePath: string;
|
|
10
|
-
customOutputRelativeFile?: string;
|
|
11
|
-
markdocChunks: MarkdocChunk[];
|
|
12
|
-
hash: string;
|
|
13
|
-
isVirtual: boolean;
|
|
14
|
-
contentItems: ContentItemModel[];
|
|
15
|
-
flatItems: (IMenuItem & {
|
|
16
|
-
[REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
|
|
17
|
-
})[];
|
|
18
|
-
options: Options;
|
|
19
|
-
rawOptions: RedocConfig;
|
|
20
|
-
parser: OpenAPIParser;
|
|
21
|
-
};
|
|
22
|
-
export type MarkdocChunk = {
|
|
23
|
-
node: Record<string, unknown>;
|
|
24
|
-
pointer: string;
|
|
25
|
-
markdown: string;
|
|
26
|
-
relativePath: string;
|
|
27
|
-
key: string;
|
|
28
|
-
};
|
|
29
|
-
export declare function definitionLoader(relativePath: string, context: LifecycleContext): Promise<Omit<BundledDefinition, 'hash'>[]>;
|
|
30
|
-
export declare function definitionsLoader(_: string, context: LifecycleContext): Promise<BundledDefinition[]>;
|
|
31
|
-
//# sourceMappingURL=load-definition.d.ts.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import*as l from"path";import{convertSwagger2OpenAPI as no}from"@redocly/openapi-docs/lib/utils/convertSwagger2OpenAPI.js";import{Source as ro,bundle as to,createConfig as io,getTotals as eo,resolvePlugins as ao}from"@redocly/openapi-core";import{normalizeOptions as so,OpenAPIParser as co,buildContentItems as fo}from"@redocly/openapi-docs";import{combineUrls as E}from"@redocly/theme/core/utils";import{CONFIG_FILE_NAME as j}from"../../../constants/common.js";import{PUBLIC_API_DEFINITIONS_FOLDER as P}from"../../constants/common.js";import{MAX_BUNDLING_ERRORS_TO_PRINT as lo}from"../../constants/plugins/openapi-docs.js";import{unique as po}from"../../../utils/array/unique.js";import{deepMerge as F}from"../../../utils/object/deep-merge.js";import{pluralize as R}from"../../../utils/string/pluralize.js";import{replaceEnvVariablesDeep as uo}from"../../utils/envs/replace-env-variables-deep.js";import{logger as N}from"../../tools/notifiers/logger.js";import{reporter as b}from"../../tools/notifiers/reporter.js";import{injectDecoratorIntoConfig as mo}from"./decorators.js";import{getAllApiConfigsByPath as go}from"../get-api-config.js";import{normalizeFeedbackOptions as wo}from"./utils.js";import{replaceFileExtension as L}from"./store-definition-bundles.js";import{ExternalResolver as ho}from"../../fs/utils/external-ref-resolver.js";import{formatBundleError as bo}from"./format-bundle-error.js";import{ensureAccessBackwardsCompatibility as Oo}from"../config-parser/loaders/utils/read-and-validate-config.js";async function Uo(o,u){const{fs:r,cache:O,getConfig:g,isPathIgnored:m}=u;if(l.posix.basename(o)===j)return[];let s;try{s=(await O.load(o,"yaml")).data}catch{return[]}if(!s?.openapi&&!s?.swagger)return N.verbose(`${o} file is not definition. Skipping`),[];const p=await g("."),e=r.getFileInfo(o),n=await g(l.posix.dirname(o)),M=go(n?.apis,o,n.configPath),S=[],V=await m(o);for(const c of M){if(!c.output&&V)continue;const T=F({decorators:p.decorators},n,{rbac:void 0,access:{rbac:void 0}},c),{resolvedObj:U}=uo(T),a=Oo(U);if(a.decorators&&typeof a.decorators!="object"){await b.panicOnBuildContentError(`'decorators' must be an object at redocly.yaml, got '${typeof a.decorators}'`);continue}if(a.plugins&&!Array.isArray(a.plugins)){await b.panicOnBuildContentError(`'plugins' must be an array at redocly.yaml, got '${typeof a.plugins}'`);continue}const z=n.configPath?l.posix.dirname(n.configPath):".",t=c.output?l.posix.join(z,c.output):o;if(await m(t))continue;e&&c.output&&!r.exists(t)&&r.addVirtualFile(t,e);const G=l.resolve(r.cwd,n.realConfigPath||j),v=new ho(r),C=await io(mo(a,t,r.cwd),{configPath:G,externalRefResolver:v});p.plugins&&p.configPath!==n.configPath&&(C.plugins=po([...C.plugins||[],...await ao(p.plugins,r.cwd)],f=>f.id));const B=l.resolve(r.cwd,o),J=await r.read(o),q={config:C,base:l.dirname(B),doc:{source:new ro(B,J),parsed:JSON.parse(JSON.stringify(s))},externalRefResolver:v},{bundle:{parsed:y},problems:D,visitorsData:H}=await to(q),X=H["markdown/markdown"]?.markdocChunks??[],i=eo(D);let A=[i.errors&&`${i.errors} ${R(i.errors,"error","errors")}`,i.warnings&&`${i.warnings} ${R(i.warnings,"warning","warnings")}`,i.ignored&&`${i.ignored} ignored`].filter(Boolean).join(", ");if(i.errors){const f=D.filter(d=>d.severity==="error");let $=`${A} while bundling ${t} definition:
|
|
2
|
-
`;const x=Math.min(f.length,lo);for(let d=0;d<x;d++){const Z=f[d],oo=await bo(Z,r.cwd);$+=`${oo}
|
|
3
|
-
`}if(f.length>x){const d=f.length-x;$+=`... and ${d} more ${R(d,"error","errors")}`}await b.panicOnBuild($)}i.warnings&&N.warn(`${A} while bundling %rp definition`,t);const w=Co(y.swagger!==void 0?await no(y):y,n.metadata),h=F(p.openapi||{},n.openapi||{},c.openapi||c?.theme?.openapi||{});h.showSchemaCatalogLinks&&(w["x-schema-catalog-link"]=E(P,t));const K=w["x-feedback"]||h.feedback||n.feedback,_={...h,feedback:wo(K),hideSidebar:!0,disableRouter:!0,mockServer:a?.mockServer||p?.mockServer,downloadUrls:h.downloadUrls||[{url:E(P,`${L(t,".json")}?download`)},{url:E(P,`${L(t,".yaml")}?download`)}]},I=so(_);let k;try{k=new co(w,void 0,I)}catch(f){await b.panicOnBuild(f);continue}const{contentItems:Q,flatItems:W}=fo(k,I),Y={definition:w,config:a,relativePath:t,realRelativePath:e?.realRelativePath||t,customOutputRelativeFile:c.output&&t,markdocChunks:X,contentItems:Q,flatItems:W,options:I,rawOptions:_,parser:k,isVirtual:e?.isVirtual??!1};S.push(Y)}return S}async function zo(o,u){const{fs:r,cache:O,getConfig:g}=u,m=[];for(const s of r.scan(/(\.ya?ml|\.json)$/)){if(!await g(l.posix.dirname(s.relativePath)))continue;const e=await O.load(s.relativePath,"load-oas");e.data&&e.data.length&&m.push(...e.data.map(n=>({...n,isVirtual:s.isVirtual||n.isVirtual,hash:e.compoundHash})))}return m}function Co(o,u){return u?{...o,info:{...o.info,"x-metadata":{...o.info["x-metadata"],...u}}}:o}export{Uo as definitionLoader,zo as definitionsLoader};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { OperationMenuItem } from '@redocly/openapi-docs/lib/models/types.js';
|
|
2
|
-
import type { ContentItemModel, OpenAPIParser, OperationModel, Options, SchemaModel } from '@redocly/openapi-docs';
|
|
3
|
-
import type { OperationParameter } from '@redocly/theme/core/types';
|
|
4
|
-
import type { SearchDocument } from '../../types';
|
|
5
|
-
type OperationParameterModel = OperationModel['parameters'][number];
|
|
6
|
-
type SchemaFieldModel = NonNullable<SchemaModel['fields']>[number];
|
|
7
|
-
export declare abstract class OpenApiSearchBuilder {
|
|
8
|
-
#private;
|
|
9
|
-
protected readonly parser: OpenAPIParser;
|
|
10
|
-
protected readonly options: Options;
|
|
11
|
-
protected readonly basePath: string;
|
|
12
|
-
constructor(parser: OpenAPIParser, options: Options, basePath: string);
|
|
13
|
-
getOperation(item: OperationMenuItem): OperationModel;
|
|
14
|
-
protected buildSearchDocument(item: ContentItemModel): SearchDocument | undefined;
|
|
15
|
-
protected abstract buildOperationDocument(operation: OperationModel, rbac: Record<string, string> | undefined): SearchDocument | undefined;
|
|
16
|
-
protected collectOperationSearchParameters(operation: OperationModel): OperationParameter[];
|
|
17
|
-
protected abstract addSchema(parameters: Record<string, OperationParameter>, schema: SchemaModel | undefined, mediaType: string | undefined, place: string, isResponse: boolean, path?: string[], visitedPointers?: Set<string>, level?: number): void;
|
|
18
|
-
protected createOperationDocumentBase(operation: OperationModel, rbac?: Record<string, string> | undefined): SearchDocument | undefined;
|
|
19
|
-
protected createOperationParameter(parameter: OperationParameterModel): OperationParameter;
|
|
20
|
-
protected createSchemaFieldParameter(field: SchemaFieldModel, schema: SchemaModel, place: string, mediaType: string | undefined, path: string[]): OperationParameter;
|
|
21
|
-
protected getParameterId(param: OperationParameter): string;
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=openapi-search-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as u from"@redocly/openapi-docs";import{REDOCLY_TEAMS_RBAC as i}from"@redocly/config";import{combineUrls as d}from"@redocly/theme/core/utils";import{removeMarkdownLinks as c,stripFormatting as a}from"./utils.js";const o=u.default||u;class g{parser;options;basePath;constructor(e,t,n){this.parser=e,this.options=t,this.basePath=n}getOperation(e){return o.getOperation(this.parser,e.operationDefinition,e.parent,{...this.options,internal_skipSamples:!0},e.href)}buildSearchDocument(e){switch(e.type){case"tag":case"section":return this.#e(e,!0);case"operation":return this.buildOperationDocument(this.getOperation(e),e[i]);case"rsrc":case"prompt":case"tool":return this.#e(e,!1);default:return}}collectOperationSearchParameters(e){const t={};for(const r of e.parameters){if(r[i])continue;const s=this.createOperationParameter(r);t[this.getParameterId(s)]=s}const n=new Set;this.addSchema(t,e.requestBody?.content?.mediaTypes[0]?.schema,e.requestBody?.content?.mediaTypes[0]?.name,"request fields",!1,[],n);for(const r of e.responses)this.addSchema(t,r.content?.mediaTypes[0]?.schema,r.content?.mediaTypes[0]?.name,`response ${r.code} fields`,!0,[],n);return Object.values(t)}createOperationDocumentBase(e,t){if(e.type!=="operation")return;const n=d(this.basePath,e.href);return{id:n,url:n,title:a(e.name),text:a(c(e.description||"")),httpMethod:e.httpVerb,httpPath:e.path,deprecated:e.deprecated,security:e.security.map(r=>r.schemes.map(s=>s.id)).flat().filter(Boolean),parameters:this.collectOperationSearchParameters(e),...t?{[i]:t}:{}}}createOperationParameter(e){const t=e.schema?.example||e.example;return{name:e.name,description:a(c(e.description)),place:`${e.in} parameters`,mediaType:void 0,type:e.schema?.type.toString()||"unknown",deepLink:o.generateDeepLink(e),required:e.required,example:t?JSON.stringify(t):void 0,enum:e.schema?.enum?.length?e.schema.enum:void 0}}createSchemaFieldParameter(e,t,n,r,s){const p=e.schema?.example||e.example,m=e.schema?.enum;return{name:e.name,description:a(e.description),place:n,mediaType:r,path:s,deepLink:o.generateDeepLink(e),type:e.schema?.type.toString()||"unknown",required:e.required||t.schema.required?.includes(e.name)||!1,example:p?JSON.stringify(p):void 0,enum:m?.length?m:void 0}}getParameterId(e){return[...e.path||[],e.name.toString()].join(".")+e.description+e.place}#e(e,t){const n=d(this.basePath,e.href);return{id:n,url:n,text:a(c(e.description||"")),title:t?a(e.name):e.name}}}export{g as OpenApiSearchBuilder};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ContentItemModel, OpenAPIParser, Options, OpenAPIInfo } from '@redocly/openapi-docs';
|
|
2
|
-
import type { AfterRoutesCreatedActions, AfterRoutesCreatedLifecycleContext, MdPageStaticData, PageRouteDetails } from '../../../types';
|
|
3
|
-
import type { AiDocumentsStore } from '../../../plugins/search/types.js';
|
|
4
|
-
import type { TagOperations } from '../types.js';
|
|
5
|
-
import type { SearchFacet } from '@redocly/theme/core/types';
|
|
6
|
-
export declare const getAiDocumentsStore: ({ parser, options, info, tagOperations, relativePath, openapiContentItem, metadata, getSearchFacets, includeInLLMsTxt, excludeFromSearch, }: {
|
|
7
|
-
parser: OpenAPIParser;
|
|
8
|
-
options: Options;
|
|
9
|
-
info: OpenAPIInfo;
|
|
10
|
-
tagOperations: TagOperations;
|
|
11
|
-
relativePath: string;
|
|
12
|
-
openapiContentItem: ContentItemModel;
|
|
13
|
-
metadata: Record<string, unknown>;
|
|
14
|
-
getSearchFacets: () => Map<string, SearchFacet>;
|
|
15
|
-
includeInLLMsTxt: boolean;
|
|
16
|
-
excludeFromSearch?: boolean;
|
|
17
|
-
}) => (route: PageRouteDetails, staticData: MdPageStaticData, context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions) => Promise<AiDocumentsStore | undefined>;
|
|
18
|
-
//# sourceMappingURL=get-ai-search-documents.d.ts.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as x}from"@redocly/config";import{basename as C,join as _}from"node:path";import q from"@markdoc/markdoc";import{joinSectionContent as G}from"../../../plugins/markdown/search/join-section-content.js";import{toMarkdown as J}from"../../../plugins/markdown/search/to-markdown.js";import{AstToSearchNodeTransformer as B}from"../../../plugins/markdown/search/walk-sections.js";import{createRenderTagFn as z}from"../../../plugins/markdown/search/create-render-tag-fn.js";import{getBuildTranslateContext as v}from"../../../utils/l10n/get-build-translate-context.js";import{canDownloadApiDefinition as V,isResourcePubliclyAccessible as Y}from"../../../utils/rbac.js";import{PUBLIC_API_DEFINITIONS_FOLDER as H}from"../../../constants/common.js";import{DEFAULT_ANONYMOUS_VISITOR_TEAM as I}from"../../../../constants/common.js";import{getLlmsTxtMdPathBySlug as K}from"../../../utils/llmstxt/get-llms-txt-md-path-by-slug.js";import{AiSearchIndexer as Q}from"../ai-search-indexer.js";import{getLocaleFromRelativePath as W}from"../../../fs/utils/get-locale-from-relative-path.js";import{extractDocumentSearchFacets as X}from"./search-facets.js";import{formatDocumentMetadata as Z}from"../../search/utils.js";import{llmsTxtLink as M}from"../../search/llmstxt/index.js";import{replaceFileExtension as ee}from"../store-definition-bundles.js";const j=new Map,Ee=({parser:s,options:c,info:n,tagOperations:r,relativePath:t,openapiContentItem:e,metadata:i,getSearchFacets:u,includeInLLMsTxt:a,excludeFromSearch:f})=>async(o,p,l,O)=>{if(f)return;const U=await o.getNavText?.()||C(o.fsPath),T=new Q(s,c,o.baseSlug||o.slug),m=T.addItem(e);if(!m)return;const w=await l.getConfig(),D=Array.isArray(m.title)?m.title.join(" "):m.title;let $,d,y=j.get(t);if((e.type==="tag"||e.type==="section"&&e.infoDefinition)&&!y){const{all:A,publiclyAccessible:g}=ue(r.tagged,T,w),{all:S,publiclyAccessible:b}=le(r.untagged,T,w);j.set(t,{taggedSearchDocuments:new Map(A),untaggedSearchDocuments:S,publiclyAccessibleTaggedSearchDocuments:new Map(g),publiclyAccessibleUntaggedSearchDocuments:b})}y=j.get(t);const h="#";switch(e.type){case"operation":const A=T.getOperation(e);$=d=ce({title:D,security:s.definition.security,document:m,version:m.version||n.version,headingLevel:h,operation:A});break;case"section":if(e.infoDefinition){y=j.get(t),d=await N({parser:s,info:n,staticData:p,relativePath:t,headingLevel:h,pageName:U,config:w}),d+=`
|
|
2
|
-
`;for(const[S,b]of y?.publiclyAccessibleTaggedSearchDocuments?.entries()||[]){if(!b.length)continue;const k=s.definition.tags?.find(L=>L.name===S);d+=E({title:k?.["x-displayName"]||S,description:k?.description,operationSearchDocuments:b,headingLevel:`${h}#`})}const g=y?.publiclyAccessibleUntaggedSearchDocuments||[];g.length&&(d+=E({title:"Other",description:void 0,operationSearchDocuments:g,headingLevel:`${h}#`})),$=await N({parser:s,info:n,staticData:p,relativePath:t,headingLevel:h,pageName:U,config:w})}else if(e.ast){const g=new q.Ast.Node("document",{},e.ast),{locale:S,translate:b}=await v(o.slug,O.getGlobalData?.().l10n),k=Array.from(new B({ast:g,partials:{},renderTag:z(O.markdocOptions.tags,S,b),getInnerContent:J,skipConditionals:!0}).transform());d=$=G(k)}break;case"tag":d=E({title:D,description:e.description,operationSearchDocuments:y?.publiclyAccessibleTaggedSearchDocuments.get(e.name)||[],headingLevel:h}),$=E({title:D,description:e.description,operationSearchDocuments:[],headingLevel:h});break;case"rsrc":case"prompt":case"tool":d=re({title:D,description:e.description,name:e.name,xMcpConfig:s.definition["x-mcp"],headingLevel:h}),$=d;break}return{async getLLMsTxts(){return[{title:e.name,description:e.type==="tag"?e.description:void 0,content:d||"",slug:o.slug,fsPath:o.fsPath,includeInLLMsTxt:a}]},async getSearchDocuments(){if(e.type==="operation"||e.type==="section"&&(e.infoDefinition||e.ast)||e.type==="tag"){const A=W(o.fsPath),g=X({...m,...i},n,u);return[{title:D,description:Array.isArray(m.text)?m.text.join(" "):m.text,content:$||"",url:m.url??o.slug,fsPath:o.fsPath,locale:A,product:o.product?.name,rbacTeams:m.rbacTeams,facets:g}]}return[]}}};async function N({parser:s,info:c,staticData:n,relativePath:r,pageName:t,headingLevel:e,config:i}){const u=Z(c["x-metadata"]);let a=c.title?`${e} ${c.title}
|
|
3
|
-
|
|
4
|
-
`:`${e} ${t}
|
|
5
|
-
|
|
6
|
-
`;return a+=c.description?`${c.description}
|
|
7
|
-
|
|
8
|
-
`:"",a+=c.summary?`${c.summary}
|
|
9
|
-
|
|
10
|
-
`:"",a+=c.version?`Version: ${c.version}
|
|
11
|
-
`:"",a+=c.license?`License: ${c.license.name}
|
|
12
|
-
`:"",e=`${e}#`,a+=u.length?`Metadata:
|
|
13
|
-
${u}
|
|
14
|
-
`:"",a+=`
|
|
15
|
-
`,a+=ne({parser:s,headingLevel:e}),a+=se({parser:s,headingLevel:e}),a+=await te({info:c,staticData:n,relativePath:r,pageName:t,headingLevel:e,config:i}),a}function E({title:s="",description:c,operationSearchDocuments:n,headingLevel:r}){let t=`${r} ${s}
|
|
16
|
-
|
|
17
|
-
`;return c&&(t+=`${c}
|
|
18
|
-
|
|
19
|
-
`),n.length&&n.forEach(e=>{const i=Array.isArray(e.title)?e.title.join(" "):e.title;t+=`${r}# ${i}${e.deprecated?" (deprecated)":""}
|
|
20
|
-
|
|
21
|
-
`,t+=` - ${M({title:`${e.httpMethod?.toUpperCase()} ${e.httpPath}`,description:Array.isArray(e.text)?e.text.join(" "):e.text,slug:K(e.url)})}`,t+=`
|
|
22
|
-
`}),t}function ne({parser:s,headingLevel:c}){const{servers:n}=s.definition;if(n&&n.length){let r=`${c} Servers
|
|
23
|
-
|
|
24
|
-
`;return n.forEach(t=>{r+=t.description?`${t.description}
|
|
25
|
-
`:"",r+=`\`\`\`
|
|
26
|
-
${t.url}
|
|
27
|
-
\`\`\`
|
|
28
|
-
|
|
29
|
-
`,t.variables&&(r+=`Variables:
|
|
30
|
-
`,Object.entries(t.variables).forEach(([e,i])=>{r+=`- \`${e}\`${i.description?`: ${i.description}`:""}
|
|
31
|
-
`,r+=i.default?`Default: ${JSON.stringify(i.default)}
|
|
32
|
-
`:"",r+=i.enum?`Enum: ${i.enum.map(u=>JSON.stringify(u)).join(", ")}
|
|
33
|
-
`:""}),r+=`
|
|
34
|
-
`)}),r}return""}async function te({info:s,staticData:c,relativePath:n,pageName:r,headingLevel:t,config:e}){const i=_(c.props?.outdir||"",H,ee(n,".yaml")),u=e.access?.rbac,a=e.access?.requiresLogin;if(V(i,u??{},a??!1,{isAuthenticated:!1,teams:[I]})){let f=`${t} Download OpenAPI description
|
|
35
|
-
|
|
36
|
-
`;return f+=M({title:s.title||r||"OpenAPI definition",description:void 0,slug:i}),f}return""}function se({parser:s,headingLevel:c}){if(!s.definition.components?.securitySchemes)return"";let n=`${c} Security
|
|
37
|
-
|
|
38
|
-
`;const{securitySchemes:r}=s.definition.components;return Object.keys(r).forEach(t=>{const e=r[t];e&&(n+=`${c}# ${t}
|
|
39
|
-
|
|
40
|
-
`,n+=e.description?`${e.description}
|
|
41
|
-
|
|
42
|
-
`:"",e.type&&(n+=`Type: ${e.type}
|
|
43
|
-
`),e.openIdConnectUrl&&(n+=`OpenID Connect URL: ${e.openIdConnectUrl}
|
|
44
|
-
`),e.in&&(n+=`In: ${e.in}
|
|
45
|
-
`),e.name&&(n+=`Name: ${e.name}
|
|
46
|
-
`),e.scheme&&(n+=`Scheme: ${e.scheme}
|
|
47
|
-
`),e.bearerFormat&&(n+=`Bearer Format: ${e.bearerFormat}
|
|
48
|
-
`),e.flows?.implicit?.authorizationUrl&&(n+=`Authorization URL: ${e.flows.implicit?.authorizationUrl}
|
|
49
|
-
`),e.flows?.implicit?.scopes&&(n+=`Scopes:
|
|
50
|
-
`,Object.entries(e.flows?.implicit?.scopes||{}).forEach(([i,u])=>{n+=`- \`${i}\`: ${u}
|
|
51
|
-
`})),e.flows?.password?.tokenUrl&&(n+=`Token URL: ${e.flows.password?.tokenUrl}
|
|
52
|
-
`),e.flows?.password?.scopes&&(n+=`Scopes:
|
|
53
|
-
`,Object.entries(e.flows?.password?.scopes||{}).forEach(([i,u])=>{n+=`- \`${i}\`: ${u}
|
|
54
|
-
`})),n+=`
|
|
55
|
-
`)}),n}function ce({title:s,security:c,document:n,version:r,headingLevel:t,operation:e}){const{text:i,httpMethod:u,httpPath:a,deprecated:f}=n,o=ae(n.parameters||[],`${t}#`),p=ie(`${t}#`,n.parameters,e);let l=s?`${t} ${s}${f?" (deprecated)":""}
|
|
56
|
-
|
|
57
|
-
`:"";return l+=i?`${i}
|
|
58
|
-
|
|
59
|
-
`:"",l+=`Endpoint: ${u?.toUpperCase()} ${a}
|
|
60
|
-
`,l+=r?`Version: ${r}
|
|
61
|
-
`:"",l+=n.security?.length?`Security: ${n.security.join(", ")}
|
|
62
|
-
`:c?.length?`Security: ${c.map(O=>O.id).join(", ")}
|
|
63
|
-
`:"",l+=`
|
|
64
|
-
`,l+=o?`${o}
|
|
65
|
-
`:"",l+=`
|
|
66
|
-
`,l+=`${p.join(`
|
|
67
|
-
`)}`,l}function re({title:s,name:c,xMcpConfig:n,headingLevel:r}){const t=n?.tools.find(i=>i.name===c);if(!t)return"";let e=`${r} ${s}
|
|
68
|
-
|
|
69
|
-
`;return e+=t.description?`${t.description}
|
|
70
|
-
|
|
71
|
-
`:"",e+=`${r}# Input schema:
|
|
72
|
-
|
|
73
|
-
`,e+=`\`\`\`json
|
|
74
|
-
${JSON.stringify(t.inputSchema,null,2)}
|
|
75
|
-
\`\`\`
|
|
76
|
-
|
|
77
|
-
`,t.outputSchema&&(e+=`${r}# Output schema:
|
|
78
|
-
|
|
79
|
-
`,e+=`\`\`\`json
|
|
80
|
-
${JSON.stringify(t.outputSchema,null,2)}
|
|
81
|
-
\`\`\`
|
|
82
|
-
|
|
83
|
-
`),e}function ie(s,c,n){return!c&&!n||!n?.responses?[]:n?.responses.filter(t=>!t.content?.mediaTypes[0]?.schema).map(t=>`${s} ${R(`response ${t.code} fields`)}
|
|
84
|
-
`)}function oe(s,c,n,r){const t=JSON.stringify(s),e=r.get(t);return e?`${n}Enum: same as ${e} (${s.length} values)
|
|
85
|
-
`:(r.set(t,c),`${n}Enum: ${s.map(i=>JSON.stringify(i)).join(", ")}
|
|
86
|
-
`)}function P(s,c,n,r){const t=`${c} `,e=s.oneOf,u=[...s.path||[],s.name].join("."),a=Array.isArray(s.description)?s.description.join(" "):s.description,f=!!e&&e.variants.length>1;let o=`${c}- \`${u}\` (${s.type}${s.required?", required":""})`;if(f&&(o+=e.discriminator?` \u2014 one of (discriminator: ${e.discriminator}):`:" \u2014 one of:"),o+=`
|
|
87
|
-
`,o+=a?`${t}${a.trim()}
|
|
88
|
-
`:"",s.enum){const p=r?`\`${u}\` in "${r}"`:`\`${u}\``;o+=oe(s.enum,p,t,n)}else s.example&&(o+=`${t}Example: ${s.example}
|
|
89
|
-
`);if(f)for(const p of e.variants){o+=`${c} - ${p.title}:
|
|
90
|
-
`;for(const l of p.parameters)o+=P(l,`${c} `,n,p.title)}else if(e)for(const p of e.variants[0].parameters)o+=P(p,`${c} `,n);return o}function ae(s,c){const n={};for(const e of s){const i=`${e.place}${e.mediaType?` (${e.mediaType})`:""}`;n[i]=[...n[i]||[],e]}const r=new Map;return Object.entries(n).map(([e,i])=>{const u=i.map(a=>P(a," ",r));return`${c} ${R(e)}:
|
|
91
|
-
|
|
92
|
-
${u.join(`
|
|
93
|
-
`)}`}).join(`
|
|
94
|
-
`)}function ue(s,c,n){const r=[],t=[];return s.forEach((e,i)=>{const u=[],a=[];e.forEach(f=>{const o=c.addItem(f);o&&(u.push(o),F({[x]:f[x],slug:o.url},n)&&a.push(o))}),r.push([i,u]),t.push([i,a])}),{all:r,publiclyAccessible:t}}function le(s,c,n){const r=[],t=[];return s.forEach(e=>{const i=c.addItem(e);i&&(r.push(i),F({[x]:e[x],slug:i.url},n)&&t.push(i))}),{all:r,publiclyAccessible:t}}function R(s){return s.charAt(0).toUpperCase()+s.slice(1)}function F(s,c){return c.access?.requiresLogin?!0:Y(s,c)}export{Ee as getAiDocumentsStore};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SearchFacet } from '@redocly/theme/core/types';
|
|
2
|
-
import type { OpenAPIInfo } from '@redocly/openapi-docs/lib/types';
|
|
3
|
-
export declare function setDocumentSearchFacets(documentSearchFacets: {
|
|
4
|
-
[key: string]: string | Set<string>;
|
|
5
|
-
}, getSearchFacets: () => Map<string, SearchFacet>, setSearchFacets: (searchFacets: Map<string, SearchFacet>) => void): void;
|
|
6
|
-
export declare function extractDocumentSearchFacets(metadata: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}, info: OpenAPIInfo, getSearchFacets: () => Map<string, SearchFacet>): {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=search-facets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SEARCH_GROUP_FACET_FIELD as f}from"../../../../constants/common.js";import{SEARCH_GROUP_NAME_API as u}from"../../../constants/plugins/search.js";function h(t,o,s){const e=o();for(const[n,r]of Object.entries(t)){const c=e.get(n);if(c){const i=new Set(c.values??[]);r instanceof Set?[...r].forEach(a=>c.values=Array.from(i.add(a))):c.values=Array.from(i.add(r))}}s(e)}function p(t,o,s){const e={[f]:u,apiTitle:o.title,apiVersion:o.version?.toString()};if(!t)return e;const n=s();for(const[r,c]of Object.entries(t))n.has(r)&&(e[r]=String(c));return t.title&&(e.apiTitle=t.title),e}export{p as extractDocumentSearchFacets,h as setDocumentSearchFacets};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { SearchFacet } from '@redocly/theme/core/types';
|
|
2
|
-
import type { ContentItemModel, OpenAPIParser, Options } from '@redocly/openapi-docs';
|
|
3
|
-
import type { PageRouteDetails, SearchDocument } from '../../../types';
|
|
4
|
-
export declare function searchResolver(parser: OpenAPIParser, options: Options, flatItems: ContentItemModel[], getSearchFacets: () => Map<string, SearchFacet>, setSearchFacets: (searchFacets: Map<string, SearchFacet>) => void, excludeFromSearch?: boolean): (route: PageRouteDetails) => Promise<SearchDocument[]>;
|
|
5
|
-
//# sourceMappingURL=search-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{REDOCLY_ROUTE_RBAC as f,REDOCLY_TEAMS_RBAC as s}from"@redocly/config";import{SearchIndexer as R}from"../search-indexer.js";import{extractDocumentSearchFacets as g,setDocumentSearchFacets as S}from"./search-facets.js";function E(n,i,m,c,d,l){return async t=>{if(l)return[];const o=t.metadata||{},a=new R(n,i,t.baseSlug||t.slug);a.addInfo(n.definition.info,o);for(const e of m)a.addItem(e);const h={},r=g(o,n.definition.info,c),u=a.getResult().map(e=>({...e,[s]:e[s]||t[s],[f]:t[f]||{slug:t.slug,fsPath:t.fsPath},facets:r}));return S({...r,...h},c,d),u}}export{E as searchResolver};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIParser, ContentItemModel, OperationModel, Options, SchemaModel } from '@redocly/openapi-docs';
|
|
2
|
-
import type { OpenAPIInfo } from '@redocly/openapi-docs/lib/types';
|
|
3
|
-
import type { OperationParameter } from '@redocly/theme/core/types';
|
|
4
|
-
import type { SearchDocument } from '../../types';
|
|
5
|
-
import { OpenApiSearchBuilder } from './openapi-search-builder.js';
|
|
6
|
-
export declare class SearchIndexer extends OpenApiSearchBuilder {
|
|
7
|
-
#private;
|
|
8
|
-
constructor(parser: OpenAPIParser, options: Options, basePath: string);
|
|
9
|
-
addItem(item: ContentItemModel): SearchDocument | undefined;
|
|
10
|
-
addInfo(info: OpenAPIInfo, metadata: Record<string, unknown>): SearchDocument & {
|
|
11
|
-
metadata: Record<string, unknown>;
|
|
12
|
-
};
|
|
13
|
-
getResult(): SearchDocument[];
|
|
14
|
-
protected buildOperationDocument(operation: OperationModel, rbac: Record<string, string> | undefined): SearchDocument | undefined;
|
|
15
|
-
protected addSchema(parameters: Record<string, OperationParameter>, schema: SchemaModel | undefined, mediaType: string | undefined, place: string, isResponse: boolean, path?: string[], visitedPointers?: Set<string>, level?: number): void;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=search-indexer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as f}from"@redocly/config";import{SEARCH_DOCUMENT_METADATA_KEY as h}from"../../constants/plugins/search.js";import{removeMarkdownLinks as m,stripFormatting as l}from"./utils.js";import{OpenApiSearchBuilder as p}from"./openapi-search-builder.js";import{normalizeFrontmatterKeywords as x}from"../helpers/normalize-frontmatter-keywords.js";class b extends p{#t=[];#e;constructor(e,t,r){super(e,t,r)}addItem(e){const{result:t}=x(e.keywords||e.operationDefinition?.keywords);t?.excludes&&e.type==="section"&&e.id===""&&(this.#e=t.excludes);try{const r=this.buildSearchDocument(e);if(!r)return;const n=[...new Set([...t?.excludes?t.excludes:[],...this.#e?this.#e:[]])];return(t||n.length)&&(r[h]={curated:!0,...t,excludes:n}),this.#t.push(r),r}catch(r){console.error("Cannot add item to search indexer",r.message)}}addInfo(e,t){const r=this.basePath,n={id:r,url:r,text:l(m(e.description||"")),title:l(`${e.title} (${e.version})`),metadata:t};return this.#t.push(n),n}getResult(){return this.#t}buildOperationDocument(e,t){const r=this.createOperationDocumentBase(e,t);if(r)return{...r,isAdditionalOperation:e.isAdditionalOperation,badges:e.badges.length?e.badges:void 0}}addSchema(e,t,r,n,o,s=[],d=new Set,a=0){if(!(!t||t.isCircular)){if(t.pointer){if(d.has(t.pointer))return;d.add(t.pointer)}if(!(a>this.options.generatedSamplesMaxDepth)){if(t.fields)for(const i of t.fields){if(t[f]||i.kind==="additionalProperties"||i.schema?.readOnly&&!o||i.schema?.writeOnly&&o)continue;const c=this.createSchemaFieldParameter(i,t,n,r,s),u=this.getParameterId(c);e[u]==null&&(e[u]=c,this.addSchema(e,i.schema,r,n,o,s.concat([i.name]),d,a+1))}t.items&&this.addSchema(e,t.items,r,n,o,s,d,a+1)}}}}export{b as SearchIndexer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import o from"node:path";import{readFile as L,existsSync as P}from"node:fs";import{promisify as N}from"node:util";import S from"js-yaml";import{withoutPathPrefix as _}from"@redocly/theme/core/utils";import{DEPRECATED_PUBLIC_API_DEFINITIONS_FOLDER as F,PUBLIC_API_DEFINITIONS_FOLDER as y}from"../../constants/common.js";import{canDownloadApiDefinition as C,filterDataByAccessDeep as O}from"../../utils/rbac.js";import{replaceFileExtension as I}from"./store-definition-bundles.js";const U=N(L),g=async(A,s,n)=>{const{isAuthenticated:e,teams:a,claims:{email:i}}=s.user,D=new URL(A.url),r=_(D.pathname),t=decodeURIComponent(r.replace(y,"").replace(F,"")),c=s.config.access??{},p=c.rbac??{},l=c.requiresLogin??!1;if(!C(r,p,l,{isAuthenticated:e,email:i,teams:a}))return new Response("Unauthorized",{status:e?403:401});const m=o.join(n.props?.outdir||"",y,I(t,".json")),f=o.join(n.props?.outdir||"",F,I(t,".json")),u=P(m),E=P(f);if(!u&&!E)return new Response("Not found",{status:404});const R=await U(u?m:f,"utf-8"),w=JSON.parse(R),d=O(w,{isAuthenticated:e,email:i,teams:a},p,l),h=o.extname(t),x=h===".yaml"?S.dump(d):JSON.stringify(d,null,2);return new Response(x,{headers:{"Content-Type":h===".yaml"?"application/yaml":"application/json"}})};var K=g;export{K as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { BundledDefinition } from './load-definition';
|
|
2
|
-
export declare function storeDefinitionBundles(definitions: BundledDefinition[], outDir: string): void;
|
|
3
|
-
export declare function replaceFileExtension(filePath: string, fileExt: string): string;
|
|
4
|
-
//# sourceMappingURL=store-definition-bundles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as l}from"fs";import o from"path";import{dump as d}from"js-yaml";import{PUBLIC_API_DEFINITIONS_FOLDER as u,PUBLIC_STATIC_FOLDER as c}from"../../constants/common.js";import{logger as x}from"../../tools/notifiers/logger.js";import{ensureDir as g}from"../../utils/fs.js";const a=new Map;function O(i,t){const r=u.slice(1);try{for(const e of i){const{definition:s,relativePath:n,hash:f}=e;if(a.get(n)!==f){if(n.startsWith(c+"/")){const p=o.posix.extname(n);m({outDir:t,definitionFolder:".",relativePath:n.replace(c+"/",""),definitionString:p===".json"?JSON.stringify(s,null,2):d(s)}),a.set(n,f);continue}m({outDir:t,definitionFolder:r,relativePath:h(n,".json"),definitionString:JSON.stringify(s,null,2)}),a.set(n,f)}}}catch(e){x.error("failed to store definition bundles",e)}}function h(i,t){const r=o.posix.dirname(i),e=o.posix.basename(i,o.posix.extname(i))+t;return o.posix.join(r,e)}function m({outDir:i,definitionString:t,relativePath:r,definitionFolder:e}){l(g(o.resolve(i,`${e}/${r}`)),t,"utf8")}export{h as replaceFileExtension,O as storeDefinitionBundles};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { OperationMenuItem } from '@redocly/openapi-docs/lib/models';
|
|
2
|
-
import type { OperationParameter } from '@redocly/theme/core/types';
|
|
3
|
-
export type TagOperations = {
|
|
4
|
-
untagged: OperationMenuItem[];
|
|
5
|
-
tagged: Map<string, OperationMenuItem[]>;
|
|
6
|
-
};
|
|
7
|
-
export type SchemaVariant = {
|
|
8
|
-
title: string;
|
|
9
|
-
parameters: OperationParameter[];
|
|
10
|
-
};
|
|
11
|
-
export type OperationParameterWithVariants = OperationParameter & {
|
|
12
|
-
oneOf?: {
|
|
13
|
-
discriminator?: string;
|
|
14
|
-
variants: SchemaVariant[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=types.d.ts.map
|
|
File without changes
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { IMenuItem, SchemaModel } from '@redocly/openapi-docs';
|
|
2
|
-
import type { ItemBadge, NavItem, ResolvedNavItem } from '@redocly/config';
|
|
3
|
-
export type IMenuItemExtended = {
|
|
4
|
-
httpVerb?: string;
|
|
5
|
-
isWebhook?: boolean;
|
|
6
|
-
badges?: ItemBadge[];
|
|
7
|
-
} & IMenuItem;
|
|
8
|
-
export declare function convertOpenAPIDocs2Sidebar(data: {
|
|
9
|
-
contentItems: IMenuItemExtended[];
|
|
10
|
-
sidebarItems: ResolvedNavItem[];
|
|
11
|
-
routeSlug: string;
|
|
12
|
-
navItem?: NavItem;
|
|
13
|
-
}): void;
|
|
14
|
-
export declare function shouldAddRoute({ item }: {
|
|
15
|
-
item: IMenuItem;
|
|
16
|
-
}): boolean;
|
|
17
|
-
export declare const removeMarkdownLinks: (text: string | Record<string, any>) => any;
|
|
18
|
-
export declare function normalizeFeedbackOptions(feedbackOptions: Record<string, any> | null | undefined): Record<string, any> | undefined;
|
|
19
|
-
export declare function stripFormatting(text: string | Record<string, any> | null): string;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the oneOf schema when `schema` (or, for an array, its items) is a
|
|
22
|
-
* oneOf/anyOf/discriminator — the single `oneOf` property the model uses for all of them.
|
|
23
|
-
*/
|
|
24
|
-
export declare function getOneOfSchema(schema: SchemaModel | undefined): SchemaModel | undefined;
|
|
25
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{REDOCLY_TEAMS_RBAC as i}from"@redocly/config";import{combineUrls as l}from"@redocly/theme/core/utils";import{FEEDBACK_TYPES as c}from"../../../constants/common.js";import{normalizeRouteSlug as f}from"../../../utils/path/normalize-route-slug.js";function u(t){const{contentItems:r,sidebarItems:a,routeSlug:o,navItem:s}=t;let m=!0;for(const e of r){let n;switch(e.type){case"group":a.push({type:"separator",label:e.name,hideWhenEmpty:!0,[i]:e[i]}),u({...t,contentItems:e.items,sidebarItems:a});break;case"tag":n=l(o,e.href);const b={type:"group",label:e.name,items:[],link:n,routeSlug:n,[i]:e[i]};a.push(b),u({routeSlug:o,contentItems:e.items,sidebarItems:b.items||[],navItem:s});break;case"operation":case"schema":case"rsrc":case"prompt":case"tool":e.isWebhook&&m&&(a.push({type:"separator",label:"Webhooks",variant:"secondary",hideWhenEmpty:!0}),m=!1),n=l(o,e.href),a.push({type:"link",label:e.name,httpVerb:e.type==="operation"?e.httpVerb:e.type,routeSlug:f(n),badges:e.badges,link:n,deprecated:e.deprecated,isAdditionalOperation:e.isAdditionalOperation,[i]:e[i]});break;case"section":if(e.depth===-1)continue;n=l(o,e.href);const p=e.href==="/",d={type:e.items.length?"group":"link",label:p&&s?.label?s.label:e.name,labelTranslationKey:s?.labelTranslationKey,routeSlug:n.split("#")[0]===o?o:f(n),link:n,items:[],...p&&s?.icon&&{icon:typeof s.icon=="object"?s.icon.srcSet:s.icon},...p&&s?.badges&&{badges:s.badges}};a.push(d),e.items.length&&u({routeSlug:o,contentItems:e.items,sidebarItems:d.items});break}}}function S({item:t}){return t.id===""?!0:t.type!=="group"||t.description!==""}const I=t=>(typeof t=="string"?t:t?.raw)?.replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1")||"";function E(t){if(!t)return;let r="";const{type:a,settings:o}=t;switch(a){case c.RATING:r="Rate this section";break;case c.SENTIMENT:r="Was this section helpful?";break;case c.MOOD:r="Was this section helpful?";break;case c.COMMENT:r="Share your feedback about this section";break;case c.SCALE:r="How would you rate this section?";break}return{...t,settings:{...o,label:o?.label||r}}}function O(t){return(typeof t=="string"?t:t?.raw||"").replace(/<[^>]*>/g,"").replace(/```([\s\S]*?)```/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").trim()}function A(t){if(t?.oneOf)return t;if(t?.items?.oneOf)return t.items}export{u as convertOpenAPIDocs2Sidebar,A as getOneOfSchema,E as normalizeFeedbackOptions,I as removeMarkdownLinks,S as shouldAddRoute,O as stripFormatting};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|